]> diplodocus.org Git - nmh/blob - h/msh.h
Compare character with EOF using signed comparison because
[nmh] / h / msh.h
1
2 /*
3 * msh.h -- definitions for msh
4 */
5
6 /* flags for stream */
7 #define STDIO 0 /* regular stdoutput */
8 #define CRTIO 1 /* create re-direct */
9 #define APPIO 2 /* append re-direct */
10 #define PIPIO 3 /* pipe re-direct */
11
12 struct Cmd {
13 char line[BUFSIZ];
14 char *args[MAXARGS];
15 char *redirect;
16 int direction;
17 FILE *stream;
18 };
19
20 #define NULLCMD ((struct Cmd *) 0)
21
22 #define MHNCHK 0x0001 /* did nontext check */
23 #define MHNYES 0x0002 /* .. and known to be non-text */
24
25 /*
26 * Determine the number of user defined sequences we
27 * can have. The first FFATTRSLOT sequence flags are for
28 * internal nmh message flags.
29 */
30 #define NUMATTRS (27)
31 #define CUR (FFATTRSLOT + NUMATTRS - 1)
32
33 #ifdef BPOP
34 # define VIRTUAL SELECT_EMPTY
35
36 # define is_virtual(mp,msgnum) ((mp)->msgstats[msgnum] & VIRTUAL)
37 # define unset_virtual(mp,msgnum) ((mp)->msgstats[msgnum] &= ~VIRTUAL)
38 # define set_virtual(mp,msgnum) ((mp)->msgstats[msgnum] |= VIRTUAL)
39 #endif
40
41 struct Msg {
42 struct drop m_drop;
43 char *m_scanl;
44 struct tws m_tb;
45 short m_flags;
46 bvector_t m_stats;
47 };
48
49 #define m_bboard_id m_drop.d_id
50 #define m_top m_drop.d_size
51 #define m_start m_drop.d_start
52 #define m_stop m_drop.d_stop
53
54 /*
55 * FOLDER
56 */
57 extern char *fmsh; /* folder instead of file */
58 extern int modified; /* command modified folder */
59 extern struct msgs *mp; /* used a lot */
60 extern struct Msg *Msgs; /* Msgs[0] not used */
61
62 FILE *msh_ready (int, int);
63
64 /*
65 * COMMAND
66 */
67 extern int interactive; /* running from a /dev/tty */
68 extern int redirected; /* re-directing output */
69 extern FILE *sp; /* original stdout */
70 extern char *cmd_name; /* command being run */
71 extern char myfilter[]; /* path to mhl.forward */
72
73 extern char *BBoard_ID; /* BBoard-ID constant */
74
75 /*
76 * SIGNALS
77 */
78 extern SIGNAL_HANDLER istat; /* original SIGINT */
79 extern SIGNAL_HANDLER qstat; /* original SIGQUIT */
80 extern int interrupted; /* SIGINT detected */
81 extern int broken_pipe; /* SIGPIPE detected */
82 extern int told_to_quit; /* SIGQUIT detected */
83
84 /*
85 * prototypes
86 */
87 int readid (int);
88 int expand (char *);
89 void m_reset (void);
90 void fsetup (char *);
91 void setup (char *);
92 void readids (int);
93 void display_info (int);
94
95 void forkcmd (char **s, char *);
96 void distcmd (char **);
97 void explcmd (char **);
98 int filehak (char **);
99 void filecmd (char **);
100 void foldcmd (char **);
101 void forwcmd (char **);
102 void helpcmd (char **);
103 void markcmd (char **);
104 void mhncmd (char **);
105 void showcmd (char **);
106 int pack (char *, int, int);
107 int packhak (char **);
108 void packcmd (char **);
109 void pickcmd (char **);
110 void replcmd (char **);
111 void rmmcmd (char **);
112 void scancmd (char **);
113 void sortcmd (char **);