]> diplodocus.org Git - nmh/blob - h/prototypes.h
970cd21008b39eeb93cb725d0e48f97bc1d2e39a
[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 /*
19 * Print null-terminated PROMPT to and flush standard output. Read answers from
20 * standard input until one matches an entry in SWITCHES. When one matches,
21 * return its swret field. Return 0 on EOF.
22 */
23 int read_switch(const char *PROMPT, const struct swit *SWITCHES);
24
25 /*
26 * If standard input is not a tty, return 1 without printing anything. Else,
27 * print null-terminated PROMPT to and flush standard output. Read answers from
28 * standard input until one is "yes" or "no", returning 1 for "yes" and 0 for
29 * "no". Also return 0 on EOF.
30 */
31 int read_yes_or_no_if_tty(const char *PROMPT);
32
33 /*
34 * Print null-terminated PROMPT to and flush standard output. Read multi-word
35 * answers from standard input until a first word matches an entry in SWITCHES.
36 * When one matches, return a pointer to an array of pointers to the words.
37 * Return NULL on EOF, interrupt, or other error.
38 */
39 char **read_switch_multiword(const char *PROMPT, const struct swit *SWITCHES);
40
41 /*
42 * Same as read_switch_multiword but using readline(3) for input.
43 */
44 #ifdef READLINE_SUPPORT
45 char **read_switch_multiword_via_readline (char *, struct swit *);
46 #endif /* READLINE_SUPPORT */
47
48 char **getarguments (char *, int, char **, int);
49
50 m_getfld_state_t m_getfld_state_init(FILE *iob);
51 void m_getfld_state_reset (m_getfld_state_t *);
52 void m_getfld_state_destroy (m_getfld_state_t *);
53 void m_getfld_track_filepos (m_getfld_state_t *, FILE *);
54 void m_getfld_track_filepos2(m_getfld_state_t *);
55 int m_getfld (m_getfld_state_t *, char[NAMESZ], char *, int *, FILE *);
56 int m_getfld2(m_getfld_state_t *, char[NAMESZ], char *, int *);
57 int m_gmprot (void) PURE;
58 char *m_name (int);
59
60 void m_unknown(m_getfld_state_t *, FILE *);
61 void m_unknown2(m_getfld_state_t *);
62
63 int pidwait (pid_t, int);
64
65 void scan_detect_mbox_style (FILE *);
66 void scan_finished(void);
67
68 /*
69 * prototypes for some routines in uip
70 */
71 int annotate (char *, char *, char *, bool, bool, int, bool);
72 void annolist(char *, char *, char *, int);
73 void annopreserve(int);
74 int mhl(int, char **);
75 int mhlsbr(int, char **, FILE *(*)(char *));
76 int distout (char *, char *, char *);
77 int sendsbr (char **, int, char *, char *, struct stat *, int, const char *);
78 int what_now (char *, int, int, char *, char *,
79 int, struct msgs *, char *, int, char *, int);
80 int WhatNow(int, char **) NORETURN;