📄 teachjove.c
字号:
/*************************************************************************** * This program is Copyright (C) 1986, 1987, 1988 by Jonathan Payne. JOVE * * is provided to you without charge, and with no warranty. You may give * * away copies of JOVE, including sources, provided that this notice is * * included in all the files. * ***************************************************************************/#include <stdio.h>#include <sys/types.h>#include <sys/file.h>#ifndef TEACHJOVE# define TEACHJOVE "/usr/lib/jove/teach-jove"#endif#ifndef W_OK# define W_OK 2# define F_OK 0#endif#ifdef __STDC__#define proto(x) x#else#define proto(x) ()#endifextern char *getenv proto((const char *));extern int access proto((const char *, int));extern int system proto((const char *));extern int execlp proto((const char *, const char *, ...));intmain(){ char cmd[256], fname[256], *home; if ((home = getenv("HOME")) == NULL) { printf("teachjove: cannot find your home!\n"); exit(-1); } (void) sprintf(fname, "%s/teach-jove", home); if (access(fname, F_OK) != 0) { (void) sprintf(cmd, "cp %s %s; chmod 644 %s", TEACHJOVE, fname, fname); system(cmd); } (void) execlp("jove", "teachjove", fname, (char *) NULL); printf("teachjove: cannot execl jove!\n"); return 1;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -