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