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