]> diplodocus.org Git - nmh/blob - h/prototypes.h
Remove SYNOPSIS from nmh(7).
[nmh] / h / prototypes.h
1
2 /*
3 * prototypes.h -- various prototypes
4 *
5 * If you modify functions here, please document their current behavior
6 * as much as practical.
7 */
8
9 /*
10 * missing system prototypes
11 */
12 #if ! defined(HAVE_TERMCAP_H) && ! defined (HAVE_NCURSES_TERMCAP_H)
13 extern int tgetent (char *bp, char *name);
14 extern int tgetnum (char *id);
15 extern int tgetflag (char *id);
16 extern char *tgetstr (char *id, char **area);
17 extern char *tgoto (char *cm, int destcol, int destline);
18 extern int tputs (char *cp, int affcnt, int (*outc) (int));
19 #endif
20
21 /*
22 * prototype from config.h
23 */
24 char *etcpath(char *);
25
26 /*
27 * prototypes from the nmh subroutine library
28 */
29
30 struct msgs_array;
31
32 void add_profile_entry (const char *, const char *);
33 void adios (char *, char *, ...) NORETURN;
34 void admonish (char *, char *, ...);
35 void advertise (char *, char *, char *, va_list);
36 void advise (char *, char *, ...);
37 char **argsplit (char *, char **, int *);
38 void argsplit_msgarg (struct msgs_array *, char *, char **);
39 void argsplit_insert (struct msgs_array *, char *, char **);
40 void arglist_free (char *, char **);
41 void ambigsw (char *, struct swit *);
42 int atooi(char *);
43 char **brkstring (char *, char *, char *);
44 int check_charset (char *, int);
45 int client(char *, char *, char *, int, int);
46 void closefds(int);
47 char *concat (const char *, ...);
48 int context_del (char *);
49 char *context_find (char *);
50 int context_foil (char *);
51 void context_read (void);
52 void context_replace (char *, char *);
53 void context_save (void);
54 char *copy (const char *, char *);
55 char **copyip (char **, char **, int);
56 void cpydata (int, int, char *, char *);
57 void cpydgst (int, int, char *, char *);
58 char *cpytrim (const char *);
59 int decode_rfc2047 (char *, char *, size_t);
60 void discard (FILE *);
61 int default_done (int);
62 void escape_display_name (char *, size_t);
63 void escape_local_part (char *, size_t);
64 int ext_hook(char *, char *, char *);
65 int fdcompare (int, int);
66 int folder_addmsg (struct msgs **, char *, int, int, int, int, char *);
67 int folder_delmsgs (struct msgs *, int, int);
68 void folder_free (struct msgs *);
69 int folder_pack (struct msgs **, int);
70
71 /*
72 * Read a MH folder structure and return an allocated "struct msgs"
73 * corresponding to the contents of the folder.
74 *
75 * Arguments include:
76 *
77 * name - Name of folder
78 * lockflag - If true, write-lock (and keep open) metadata files.
79 * See comments for seq_read() for more information.
80 */
81 struct msgs *folder_read (char *name, int lockflag);
82
83 struct msgs *folder_realloc (struct msgs *, int, int);
84 int gans (char *, struct swit *);
85 char **getans (char *, struct swit *);
86 #ifdef READLINE_SUPPORT
87 char **getans_via_readline (char *, struct swit *);
88 #endif /* READLINE_SUPPORT */
89 int getanswer (char *);
90 char **getarguments (char *, int, char **, int);
91 char *get_charset(void);
92 char *getcpy (const char *);
93 char *get_default_editor(void);
94 char *getfolder(int);
95 /*
96 * Lock open/close routines.
97 *
98 * The lk[f]opendata() functions are designed to open "data" files (anything
99 * not a mail spool file) using the locking mechanism configured for data
100 * files. The lk[f]openspool() functions are for opening the mail spool
101 * file, which will use the locking algorithm configured for the mail
102 * spool.
103 *
104 * Files opened for reading are locked with a read lock (if possible by
105 * the underlying lock mechanism), files opened for writing are locked
106 * using an exclusive lock.
107 */
108 int lkclosedata(int, const char *);
109 int lkclosespool(int, const char *);
110 int lkfclosedata(FILE *, const char *);
111 int lkfclosespool(FILE *, const char *);
112 FILE *lkfopendata(const char *, const char *);
113 int lkopendata(const char *, int, mode_t);
114 FILE *lkfopenspool(const char *, const char *);
115 int lkopenspool(const char *, int, mode_t);
116 int m_atoi (char *);
117 char *m_backup (char *);
118 int m_convert (struct msgs *, char *);
119 char *m_draft (char *, char *, int, int *);
120 void m_eomsbr (m_getfld_state_t, int (*)(int));
121 void m_getfld_state_reset (m_getfld_state_t *);
122 void m_getfld_state_destroy (m_getfld_state_t *);
123 void m_getfld_track_filepos (m_getfld_state_t *, FILE *);
124 int m_getfld (m_getfld_state_t *, char[NAMESZ], char *, int *, FILE *);
125 int m_gmprot (void);
126 char *m_maildir (char *);
127 char *m_mailpath (char *);
128 char *m_name (int);
129 int m_putenv (char *, char *);
130 int m_rand (unsigned char *, size_t);
131 char *m_mktemp(const char *, int *, FILE **);
132 char *m_mktemp2(const char *, const char *, int *, FILE **);
133 void m_unknown(m_getfld_state_t *, FILE *);
134 int makedir (char *);
135 char *message_id (time_t, int);
136 char *nmh_getpass(const char *);
137 char *norm_charmap(char *);
138 char *new_fs (char *, char *, char *);
139 char *path(char *, int);
140 int peekc(FILE *ib);
141 int pidwait (pid_t, int);
142 int pidstatus (int, FILE *, char *);
143 char *pluspath(char *);
144 void print_help (char *, struct swit *, int);
145 void print_sw (char *, struct swit *, char *, FILE *);
146 void print_version (char *);
147 void push (void);
148 char *pwd (void);
149 char *r1bindex(char *, int);
150 void readconfig (struct node **, FILE *, char *, int);
151 int refile (char **, char *);
152 void ruserpass (char *, char **, char **);
153 int remdir (char *);
154 void scan_detect_mbox_style (FILE *);
155 void scan_finished ();
156 void scan_eom_action (int (*)());
157 void scan_reset_m_getfld_state ();
158 int seq_addmsg (struct msgs *, char *, int, int, int);
159 int seq_addsel (struct msgs *, char *, int, int);
160 char *seq_bits (struct msgs *);
161 int seq_delmsg (struct msgs *, char *, int);
162 int seq_delsel (struct msgs *, char *, int, int);
163 int seq_getnum (struct msgs *, char *);
164 char *seq_list (struct msgs *, char *);
165 int seq_nameok (char *);
166 void seq_print (struct msgs *, char *);
167 void seq_printall (struct msgs *);
168
169 /*
170 * Read the sequence files for the folder referenced in the given
171 * struct msgs and populate the sequence entries in the struct msgs.
172 *
173 * Arguments:
174 *
175 * mp - Folder structure to add sequence entries to
176 * lockflag - If true, obtain a write lock on the sequence file.
177 * Additionally, the sequence file will remain open
178 * and a pointer to the filehandle will be stored in
179 * folder structure, where it will later be used by
180 * seq_save().
181 */
182 void seq_read (struct msgs * mp, int lockflag);
183 void seq_save (struct msgs *);
184 void seq_setcur (struct msgs *, int);
185 void seq_setprev (struct msgs *);
186 void seq_setunseen (struct msgs *, int);
187 int showfile (char **, char *);
188 int smatch(char *, struct swit *);
189 char *snprintb (char *, size_t, unsigned, char *);
190 int ssequal (char *, char *);
191 int stringdex (char *, char *);
192 char *trimcpy (char *);
193 int unputenv (char *);
194 int uprf (char *, char *);
195 int vfgets (FILE *, char **);
196 char *write_charset_8bit (void);
197
198
199 /*
200 * some prototypes for address parsing system
201 * (others are in addrsbr.h)
202 */
203 char *LocalName(int);
204 char *SystemName(void);
205
206 /*
207 * prototypes for some routines in uip
208 */
209 int annotate (char *, char *, char *, int, int, int, int);
210 void annolist(char *, char *, char *, int);
211 void annopreserve(int);
212 void clear_screen(void);
213 void m_pclose(void);
214 int make_intermediates(char *);
215 int mhl(int, char **);
216 int mhlsbr(int, char **, FILE *(*)(char *));
217 int distout (char *, char *, char *);
218 void replout (FILE *, char *, char *, struct msgs *, int,
219 int, char *, char *, char *, int);
220 int sc_hardcopy(void);
221 int sc_length(void);
222 int sc_width(void);
223 int build_form (char *, char *, int *, char *, char *, char *, char *,
224 char *, char *);
225 int sendsbr (char **, int, char *, char *, struct stat *, int, char *, int);
226 int SOprintf (char *, ...);
227 int what_now (char *, int, int, char *, char *,
228 int, struct msgs *, char *, int, char *, int);
229 int WhatNow(int, char **);
230 int writeBase64aux(FILE *, FILE *);
231 int writeBase64 (unsigned char *, size_t, unsigned char *);
232
233 /*
234 * credentials management
235 */
236 void init_credentials_file ();
237 int nmh_get_credentials (char *, char *, int, nmh_creds_t);