📄 common.h
字号:
# define UNSHAR "/bin/sh"#endif#ifdef METAMAIL/* default MIME extraction program */# ifndef MIMESTORE# define MIMESTORE "/usr/local/bin/mh/mhn -store -auto -file "# endif/* default MIME show program */# ifndef MIMESHOW# define MIMESHOW "metamail -e -p -m \"trn %s\" %A"# endif#endif/* path to default editor */#ifndef DEFEDITOR# define DEFEDITOR "/usr/ucb/vi"#endif/* location of macro file for trn and rn modes */#ifndef TRNMACRO# define TRNMACRO "%./.trnmac"#endif#ifndef RNMACRO# define RNMACRO "%./.rnmac"#endif/* location of full name */#ifndef FULLNAMEFILE# ifndef PASSNAMES# define FULLNAMEFILE "%./.fullname"# endif#endif/* virtual array file name template */#ifndef VARYNAME /* % and ~ */# define VARYNAME "/tmp/rnvary.%$"#endif/* where to compile a new newsgroup list */#ifndef RNEWNAME# define RNEWNAME "/tmp/rnew.%$"#endif/* file to pass header to followup article poster */#ifndef HEADNAME /* % and ~ */# define HEADNAME "%./.rnhead"/* or alternately #define HEADNAME "/tmp/rnhead.%$" */#endif#ifndef MAKEDIR/* shell script to make n-deep subdirectories */# ifndef DIRMAKER /* % and ~ */# define DIRMAKER "%X/makedir"# endif#endif/* location of newsrc file */#ifndef RCNAME /* % and ~ */# define RCNAME "%./.newsrc"#endif/* temporary newsrc file in case we crash while writing out */#ifndef RCTNAME /* % and ~ */# define RCTNAME "%./.newnewsrc"#endif/* newsrc file at the beginning of this session */#ifndef RCBNAME /* % and ~ */# define RCBNAME "%./.oldnewsrc"#endif/* if existent, contains process number of current or crashed trn */#ifndef LOCKNAME /* % and ~ */# define LOCKNAME "%./.rnlock"#endif/* information from last invocation of trn */#ifndef LASTNAME /* % and ~ */# define LASTNAME "%./.rnlast"#endif/* file with soft pointers into the active file */#ifndef SOFTNAME /* % and ~ */# define SOFTNAME "%./.rnsoft"#endif/* list of article numbers to mark as unread later (see M and Y cmmands) */#ifndef RNDELNAME /* % and ~ */# define RNDELNAME "%./.rndelay"#endif/* a motd-like file for trn */#ifndef NEWSNEWSNAME /* % and ~ */# define NEWSNEWSNAME "%X/newsnews"#endif/* command to send a reply */#ifndef MAILPOSTER /* % and ~ */# define MAILPOSTER "QUOTECHARS=%I Rnmail -h %h"#endif#ifdef INTERNET# ifndef MAILHEADER /* % */# ifdef CONDSUB# define MAILHEADER "To: %t\nSubject: Re: %S\n%(%{REPLYTO}=^$?:Reply-To: %{REPLYTO}\n)Newsgroups: %n\nIn-Reply-To: %i\n%(%[references]!=^$?References\\: %[references]\n)Organization: %o\nCc: \nBcc: \n\n"# else# define MAILHEADER "To: %t\nSubject: Re: %S\nNewsgroups: %n\nIn-Reply-To: %i\nReferences: %[references]\nCc: \nBcc: \n\n"# endif# endif#else# ifndef MAILHEADER /* % */# ifdef CONDSUB# define MAILHEADER "To: %T\nSubject: %(%i=^$?:Re: %S\nNewsgroups: %n\nIn-Reply-To: %i)\n%(%[references]!=^$?References\\: %[references]\n)Organization: %o\nCc: \nBcc: \n\n"# else# define MAILHEADER "To: %T\nSubject: Re: %S\nNewsgroups: %n\nIn-Reply-To: %i\nReferences: %[references]\nCc: \nBcc: \n\n"# endif# endif#endif#ifndef YOUSAID /* % */# define YOUSAID "In article %i you write:"#endif/* command to submit a followup article */#ifndef NEWSPOSTER /* % and ~ */# define NEWSPOSTER "QUOTECHARS=%I Pnews -h %h"#endif#ifndef NEWSHEADER /* % */# ifdef CONDSUB# define NEWSHEADER "%(%[followup-to]=^$?:X-ORIGINAL-NEWSGROUPS: %n\n)Newsgroups: %(%F=^$?%C:%F)\nSubject: %(%S=^$?%\"\n\nSubject: \":Re: %S)\nSummary: \nExpires: \n%(%R=^$?:References: %R\n)Sender: \nFollowup-To: \n%(%{REPLYTO}=^$?:Reply-To: %{REPLYTO}\n)Distribution: %(%i=^$?%\"Distribution: \":%D)\nOrganization: %o\nKeywords: %[keywords]\nCc: \n\n"# else# define NEWSHEADER "Newsgroups: %F\nSubject: Re: %S\nSummary: \nExpires: \nReferences: %R\nSender: \nFollowup-To: \nDistribution: %D\nOrganization: %o\nKeywords: %[keywords]\nCc: \n\n"# endif#endif#ifndef ATTRIBUTION /* % */# define ATTRIBUTION "In article %i %f writes:"#endif#ifndef PIPESAVER /* % */# ifdef CONDSUB# define PIPESAVER "%(%B=^0$?<%A:tail +%Bc %A |) %b"# else# define PIPESAVER "tail +%Bc %A | %b"# endif#endif#ifndef EXSAVER# define EXSAVER "tail +%Bc %A | %e"#endif#ifdef METAMAIL# ifndef EXMIMESAVER# define EXMIMESAVER "%e %A"# endif#endif#ifndef NORMSAVER /* % and ~ */# define NORMSAVER "%X/norm.saver %A %P %c %a %B %C \"%b\""#endif#ifndef MBOXSAVER /* % and ~ */# ifndef ANCIENT_NEWS# define MBOXSAVER "%X/mbox.saver %A %P %c %a %B %C \"%b\" \"From %t %`LANG= date`\""# else# ifdef CONDSUB# define MBOXSAVER "%X/mbox.saver %A %P %c %a %B %C \"%b\" \"From %t %(%[date]=^\\(\\w*\\), \\(\\w*\\)-\\(\\w*\\)-\\(\\w*\\) \\([^ ]*\\)?%1 %3 %(%2=..?%2: %2) %5 19%4)\"" /* header munging with a vengeance */# else# define MBOXSAVER "%X/mbox.saver %A %P %c %a %B %C \"%b\" \"From %t %[posted]\""# endif# endif#endif#ifdef MKDIRS# ifndef SAVEDIR /* % and ~ */# define SAVEDIR "%p/%c"# endif# ifndef SAVENAME /* % */# define SAVENAME "%a"# endif#else# ifndef SAVEDIR /* % and ~ */# define SAVEDIR "%p"# endif# ifndef SAVENAME /* % */# define SAVENAME "%^C"# endif#endif#ifndef KILLGLOBAL /* % and ~ */# define KILLGLOBAL "%p/KILL"#endif#ifndef KILLLOCAL /* % and ~ */# define KILLLOCAL "%p/%c/KILL"#endif/* how to cancel an article */#ifndef CANCEL# ifdef BNEWS# define CANCEL "%x/inews -h < %h"# else# define CANCEL "inews -h < %h"# endif#endif/* how to cancel an article, continued */#ifndef CANCELHEADER# define CANCELHEADER "Newsgroups: %n\nSubject: cancel\nControl: cancel %i\nDistribution: %D\n\n%i was cancelled from within trn.\n"#endif/* how to supersede an article */#ifndef SUPERSEDEHEADER# define SUPERSEDEHEADER "Newsgroups: %n\nSubject: %S\nSummary: %[summary]\nExpires: %[expires]\nReferences: %[references]\nSupersedes: %i\nSender: %[sender]\nFollowup-To: %[followup-to]\nDistribution: %D\nOrganization: %o\nKeywords: %[keywords]\n\n"#endif#ifndef LOCALTIMEFMT# define LOCALTIMEFMT "%a %b %d %X %Z %Y"#endif/* where to find the mail file */#ifndef MAILFILE# define MAILFILE "/usr/spool/mail/%L"#endif/* how to open binary format files */#ifndef FOPEN_RB# define FOPEN_RB "r"#endif#ifndef FOPEN_WB# define FOPEN_WB "w"#endif/* what to do with ansi prototypes -- '()' == ignore, 'x' == use */#ifndef _# ifdef __STDC__# define _(x) x# ifndef CONST# define CONST const# endif# else# define _(x) ()# ifndef CONST# define CONST# endif# endif#endif/* how many characters is a newline in a text file? */#ifndef NL_SIZE# define NL_SIZE 1#endif/* some important types */typedef int NG_NUM; /* newsgroup number */typedef long ART_NUM; /* article number */typedef long ART_UNREAD; /* could be short to save space */typedef long ART_POS; /* char position in article file */typedef int ART_LINE; /* line position in article file */typedef long ACT_POS; /* char position in active file */typedef unsigned int MEM_SIZE; /* for passing to malloc *//* *** end of the machine dependent stuff *** *//* GLOBAL THINGS *//* file statistics area */EXT struct stat filestat;/* various things of type char */char *index();char *rindex();char *getenv();char *strcat();char *strcpy();char *malloc();char *realloc();EXT char buf[LBUFLEN+1]; /* general purpose line buffer */EXT char cmd_buf[CBUFLEN]; /* buffer for formatting system commands */EXT char *indstr INIT(">"); /* indent for old article embedded in followup */EXT char *cwd INIT(Nullch); /* current working directory */EXT char *dfltcmd INIT(Nullch); /* 1st char is default command *//* switches */#ifdef DEBUG EXT int debug INIT(0); /* -D */# define DEB_COREDUMPSOK 2# define DEB_HEADER 4# define DEB_INTRP 8# define DEB_NNTP 16# define DEB_INNERSRCH 32# define DEB_FILEXP 64 # define DEB_HASH 128# define DEB_XREF_MARKER 256# define DEB_CTLAREA_BITMAP 512# define DEB_SOFT_POINTERS 1024# define DEB_NEWSRC_LINE 2048# define DEB_SEARCH_AHEAD 4096# define DEB_CHECKPOINTING 8192# define DEB_FEED_XREF 16384#endif#ifdef ARTSEARCH EXT int scanon INIT(0); /* -S */#endifEXT bool use_threads INIT(THREAD_INIT); /* -x */EXT int max_tree_lines INIT(6);EXT char select_order[4] INIT("lms");EXT int select_on INIT(SELECT_INIT); /* -X */EXT char end_select INIT('Z');EXT char page_select INIT('>');EXT bool dont_filter_control INIT(FALSE); /* -j */EXT bool mbox_always INIT(FALSE); /* -M */EXT bool norm_always INIT(FALSE); /* -N */EXT bool thread_always INIT(FALSE); /* -a */EXT bool auto_arrow_macros INIT(TRUE); /* -B */EXT bool breadth_first INIT(FALSE); /* -b */EXT bool bkgnd_spinner INIT(FALSE); /* -B */EXT bool novice_delays INIT(TRUE); /* +f */EXT int olden_days INIT(FALSE); /* -o */EXT bool auto_select_postings INIT(FALSE); /* -p */EXT bool checkflag INIT(FALSE); /* -c */EXT bool suppress_cn INIT(FALSE); /* -s */EXT int countdown INIT(5); /* how many lines to list before invoking -s */EXT bool muck_up_clear INIT(FALSE); /* -loco */EXT bool erase_screen INIT(FALSE); /* -e */EXT bool can_home INIT(FALSE);#ifdef CLEAREOLEXT bool can_home_clear INIT(FALSE); /* fancy -e */#endifEXT bool findlast INIT(FALSE); /* -r */EXT bool typeahead INIT(FALSE); /* -T */#ifdef EDIT_DISTANCEEXT bool fuzzyGet INIT(FALSE); /* -G */#endif#ifdef VERBOSE# ifdef TERSE EXT bool verbose INIT(TRUE); /* +t */# endif#endifEXT bool unbroken_subjects INIT(FALSE); /* -u */#ifdef VERIFY EXT bool verify INIT(FALSE); /* -v */#endif EXT bool quickstart INIT(FALSE); /* -q */#define NOMARKING 0#define STANDOUT 1#define UNDERLINE 2EXT int marking INIT(NOMARKING); /* -m */EXT ART_LINE initlines INIT(0); /* -i */EXT bool initlines_specified INIT(FALSE);#ifdef APPEND_UNSUBEXT bool append_unsub INIT(1); /* -I */#elseEXT bool append_unsub INIT(0);#endif/* miscellania */int fseek();long atol(), ftell();EXT bool in_ng INIT(FALSE); /* current state of trn */EXT char mode INIT('i'); /* current state of trn */EXT FILE *tmpfp INIT(Nullfp); /* scratch fp used for .rnlock, .rnlast, etc. */EXT NG_NUM nextrcline INIT(0); /* 1st unused slot in rcline array */ /* startup to avoid checking twice in a row */extern errno;/* Factored strings */EXT char nullstr[1] INIT("");EXT char sh[] INIT(SH);EXT char defeditor[] INIT(DEFEDITOR);EXT char hforhelp[] INIT("Type h for help.\n");#ifdef STRICTCREXT char badcr[] INIT("\nUnnecessary CR ignored.\n");#endifEXT char readerr[] INIT("rn read error");EXT char unsubto[] INIT("\n\nUnsubscribed to newsgroup %s\n");EXT char cantopen[] INIT("Can't open %s\n");EXT char cantcreate[] INIT("Can't create %s\n");EXT char cantrecreate[] INIT("Can't recreate %s -- restoring older version.\n");#ifdef VERBOSE EXT char nocd[] INIT("Can't chdir to directory %s\n");#else EXT char nocd[] INIT("Can't find %s\n");#endif#ifdef METAMAILEXT bool mime_article INIT(FALSE);#endif#ifdef NOLINEBUF#define FLUSH ,fflush(stdout)#else#define FLUSH#endif#ifdef lint#undef FLUSH#define FLUSH#undef putchar#define putchar(c)#endif#define advise(str) fputs(str,stdout)#define fatal_error(str) fputs(str,stderr), finalize(1)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -