]> diplodocus.org Git - nmh/blob - h/prototypes.h
44670f46e4f3c959a179f5f8c69a465bc1f05f21
[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 /*
71 * Read the sequence files for the folder referenced in the given
72 * struct msgs and populate the sequence entries in the struct msgs.
73 *
74 * Arguments:
75 *
76 * mp - Folder structure to add sequence entries to
77 * lockflag - If true, obtain a write lock on the sequence file.
78 * Additionally, the sequence file will remain open
79 * and a pointer to the filehandle will be stored in
80 * folder structure, where it will later be used by
81 * seq_save().
82 *
83 * Return values:
84 * OK - successfully read the sequence files, or they don't exist
85 * NOTOK - failed to lock sequence file
86 */
87 int seq_read (struct msgs * mp, int lockflag);
88 void seq_save (struct msgs *);
89 void seq_setcur (struct msgs *, int);
90 void seq_setprev (struct msgs *);
91 void seq_setunseen (struct msgs *, int);
92 int showfile (char **, char *);
93
94 /*
95 * prototypes for some routines in uip
96 */
97 int annotate (char *, char *, char *, bool, bool, int, bool);
98 void annolist(char *, char *, char *, int);
99 void annopreserve(int);
100 int mhl(int, char **);
101 int mhlsbr(int, char **, FILE *(*)(char *));
102 int distout (char *, char *, char *);
103 int sendsbr (char **, int, char *, char *, struct stat *, int, const char *);
104 int what_now (char *, int, int, char *, char *,
105 int, struct msgs *, char *, int, char *, int);
106 int WhatNow(int, char **) NORETURN;