Commit 57c7eddd 57c7edddeb682f552d75eafe503d951751a36d15 by Sergey Poznyakoff

(mh_builtin_fp, mh_msgset_t): New types. Added new prototypes.

1 parent 26a6bbb0
Showing 1 changed file with 51 additions and 24 deletions
...@@ -48,6 +48,7 @@ ...@@ -48,6 +48,7 @@
48 #define MH_SEQUENCES_FILE ".mh_sequences" 48 #define MH_SEQUENCES_FILE ".mh_sequences"
49 #define MH_USER_PROFILE ".mh_profile" 49 #define MH_USER_PROFILE ".mh_profile"
50 #define MH_GLOBAL_PROFILE "mh-profile" 50 #define MH_GLOBAL_PROFILE "mh-profile"
51 #define MH_CONTEXT_FILE "context"
51 52
52 enum mh_opcode 53 enum mh_opcode
53 { 54 {
...@@ -119,7 +120,7 @@ enum mh_type ...@@ -119,7 +120,7 @@ enum mh_type
119 typedef int mh_opcode_t; 120 typedef int mh_opcode_t;
120 121
121 struct mh_machine; 122 struct mh_machine;
122 typedef void (*mh_builtin_fp)(struct mh_machine *); 123 typedef void (*mh_builtin_fp) __P((struct mh_machine *));
123 124
124 typedef union { 125 typedef union {
125 mh_opcode_t opcode; 126 mh_opcode_t opcode;
...@@ -154,39 +155,65 @@ struct mh_builtin ...@@ -154,39 +155,65 @@ struct mh_builtin
154 int optarg; 155 int optarg;
155 }; 156 };
156 157
158 typedef struct
159 {
160 char *name;
161 header_t header;
162 } mh_context_t;
163
164 typedef struct
165 {
166 size_t count;
167 size_t *list;
168 } mh_msgset_t;
169
170 typedef void (*mh_iterator_fp) __P((mailbox_t mbox, message_t msg,
171 size_t num, void *data));
172
157 extern char *current_folder; 173 extern char *current_folder;
158 extern size_t current_message; 174 extern size_t current_message;
159 extern char mh_list_format[]; 175 extern char mh_list_format[];
160 extern header_t ctx_header;
161 extern header_t profile_header;
162 176
163 void mh_init (void); 177 void mh_init __P((void));
164 void mh_read_profile (void); 178 void mh_read_profile __P((void));
165 void mh_save_context (void); 179 void mh_save_context __P((void));
166 int mh_read_context_file (char *path, header_t *header); 180 int mh_read_formfile __P((char *name, char **pformat));
167 int mh_write_context_file (char *path, header_t header); 181
168 int mh_read_formfile (char *name, char **pformat); 182 char * mh_profile_value __P((char *name, char *defval));
183
184 int mh_getyn __P((const char *fmt, ...));
185 int mh_check_folder __P((char *pathname));
186
187 int mh_format __P((mh_format_t *fmt, message_t msg, size_t msgno,
188 char *buffer, size_t bufsize));
189 int mh_format_parse __P((char *format_str, mh_format_t *fmt));
190 void mh_format_free __P((mh_format_t *fmt));
191 mh_builtin_t *mh_lookup_builtin __P((char *name, int *rest));
169 192
170 char * mh_profile_value (char *name, char *defval); 193 void mh_error __P((const char *fmt, ...));
171 194
172 int mh_getyn (const char *fmt, ...); 195 FILE *mh_audit_open __P((char *name, mailbox_t mbox));
173 int mh_check_folder (char *pathname); 196 void mh_audit_close __P((FILE *fp));
174 197
175 int mh_format (mh_format_t *fmt, message_t msg, size_t msgno, 198 mh_context_t *mh_context_create __P((char *name, int copy));
176 char *buffer, size_t bufsize); 199 int mh_context_read __P((mh_context_t *ctx));
177 int mh_format_parse (char *format_str, mh_format_t *fmt); 200 int mh_context_write __P((mh_context_t *ctx));
178 void mh_format_free (mh_format_t *fmt); 201 char *mh_context_get_value __P((mh_context_t *ctx, const char *name,
179 mh_builtin_t *mh_lookup_builtin (char *name, int *rest); 202 char *defval));
203 int mh_context_set_value __P((mh_context_t *ctx, const char *name,
204 char *value));
180 205
181 void mh_error(const char *fmt, ...); 206 int mh_message_number __P((message_t msg, size_t *pnum));
182 207
183 FILE *mh_audit_open (char *name, mailbox_t mbox); 208 mailbox_t mh_open_folder __P((const char *folder));
184 void mh_audit_close (FILE *fp);
185 209
186 int mh_message_number (message_t msg, size_t *pnum); 210 int mh_msgset_parse __P((mailbox_t mbox, mh_msgset_t *msgset,
211 int argc, char **argv));
212 int mh_msgset_member __P((mh_msgset_t *msgset, size_t num));
187 213
188 mailbox_t mh_open_folder (void); 214 char *mh_get_dir __P((void));
215 const char *mh_expand_name __P((const char *name, int is_folder));
189 216
190 void *xmalloc (size_t); 217 void *xmalloc __P((size_t));
191 void *xrealloc (void *, size_t); 218 void *xrealloc __P((void *, size_t));
192 219
......