]> diplodocus.org Git - nmh/blob - h/prototypes.h
be8a1d111ecf1b778ea75ec8f619ce2c4a583ee6
[nmh] / h / prototypes.h
1 /* prototypes.h -- various prototypes
2 *
3 * If you modify functions here, please document their current behavior
4 * as much as practical.
5 */
6
7 /*
8 * prototype from config.h
9 */
10 char *etcpath(char *) NONNULL(1);
11
12 /*
13 * prototypes from the nmh subroutine library
14 */
15
16 struct msgs_array;
17
18 char *concat (const char *, ...) ENDNULL;
19
20 /*
21 * Print null-terminated PROMPT to and flush standard output. Read answers from
22 * standard input until one matches an entry in SWITCHES. When one matches,
23 * return its swret field. Return 0 on EOF.
24 */
25 int read_switch(const char *PROMPT, const struct swit *SWITCHES);
26
27 /*
28 * If standard input is not a tty, return 1 without printing anything. Else,
29 * print null-terminated PROMPT to and flush standard output. Read answers from
30 * standard input until one is "yes" or "no", returning 1 for "yes" and 0 for
31 * "no". Also return 0 on EOF.
32 */
33 int read_yes_or_no_if_tty(const char *PROMPT);
34
35 /*
36 * Print null-terminated PROMPT to and flush standard output. Read multi-word
37 * answers from standard input until a first word matches an entry in SWITCHES.
38 * When one matches, return a pointer to an array of pointers to the words.
39 * Return NULL on EOF, interrupt, or other error.
40 */
41 char **read_switch_multiword(const char *PROMPT, const struct swit *SWITCHES);
42
43 /*
44 * Same as read_switch_multiword but using readline(3) for input.
45 */
46 #ifdef READLINE_SUPPORT
47 char **read_switch_multiword_via_readline (char *, struct swit *);
48 #endif /* READLINE_SUPPORT */
49
50 char **getarguments (char *, int, char **, int);
51
52 m_getfld_state_t m_getfld_state_init(FILE *iob);
53 void m_getfld_state_reset (m_getfld_state_t *);
54 void m_getfld_state_destroy (m_getfld_state_t *);
55 void m_getfld_track_filepos (m_getfld_state_t *, FILE *);
56 void m_getfld_track_filepos2(m_getfld_state_t *);
57 int m_getfld (m_getfld_state_t *, char[NAMESZ], char *, int *, FILE *);
58 int m_getfld2(m_getfld_state_t *, char[NAMESZ], char *, int *);
59 int m_gmprot (void) PURE;
60 char *m_name (int);
61
62 void m_unknown(m_getfld_state_t *, FILE *);
63 void m_unknown2(m_getfld_state_t *);
64
65 int pidwait (pid_t, int);
66
67 void scan_detect_mbox_style (FILE *);
68 void scan_finished(void);
69
70 void seq_save (struct msgs *);
71 void seq_setcur (struct msgs *, int);
72 void seq_setprev (struct msgs *);
73 void seq_setunseen (struct msgs *, int);
74
75 /*
76 * prototypes for some routines in uip
77 */
78 int annotate (char *, char *, char *, bool, bool, int, bool);
79 void annolist(char *, char *, char *, int);
80 void annopreserve(int);
81 int mhl(int, char **);
82 int mhlsbr(int, char **, FILE *(*)(char *));
83 int distout (char *, char *, char *);
84 int sendsbr (char **, int, char *, char *, struct stat *, int, const char *);
85 int what_now (char *, int, int, char *, char *,
86 int, struct msgs *, char *, int, char *, int);
87 int WhatNow(int, char **) NORETURN;