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