Commit 746ee9e4 746ee9e48f5124fec880c01aedc915b08be78250 by Sergey Poznyakoff

Changed proto of mh_read_formfile()

1 parent 3d100a2d
2001-09-18 Sergey Poznyakoff
* mh/mh.h: Changed proto of mh_read_formfile(). Thanks to Alain
for noticing.
* mh/inc.c: Likewise.
* mh/scan.c: Likewise.
* mh/mh_init.c: Likewise.
2001-09-18 Sergey Poznyakoff
* mailbox/mbx_mh.c: Optimized for speed.
_mh_message_save(): scan the message while saving it. If expunge==0,
do not create temporary, operate directly on the message file instead.
......
......@@ -90,7 +90,7 @@ opt_handler (int key, char *arg, void *unused)
break;
case 'F':
format_str = mh_read_formfile (arg);
mh_read_formfile (arg, &format_str);
break;
case 'i':
......
......@@ -135,7 +135,7 @@ extern char mh_list_format[];
void mh_init (void);
int mh_read_context_file (char *path, header_t *header);
char *mh_read_formfile (char *name);
int mh_read_formfile (char *name, char **pformat);
int mh_format (mh_format_t *fmt, message_t msg, size_t msgno,
char *buffer, size_t bufsize);
......
......@@ -116,8 +116,8 @@ mh_read_context_file (char *path, header_t *header)
return status;
}
char *
mh_read_formfile (char *name)
int
mh_read_formfile (char *name, char **pformat)
{
FILE *fp;
struct stat st;
......@@ -128,14 +128,14 @@ mh_read_formfile (char *name)
if (stat (name, &st))
{
mh_error ("can't stat format file %s: %s", name, strerror (errno));
return;
return -1;
}
fp = fopen (name, "r");
if (!fp)
{
mh_error ("can't open format file %s: %s", name, strerror (errno));
return;
return -1;
}
format_str = xmalloc (st.st_size+1);
......@@ -150,7 +150,8 @@ mh_read_formfile (char *name)
}
format_str[off] = 0;
fclose (fp);
return format_str;
*pformat = format_str;
return 0;
}
static char *my_name;
......
......@@ -87,7 +87,7 @@ opt_handler (int key, char *arg, void *unused)
break;
case 'F':
format_str = mh_read_formfile (arg);
mh_read_formfile (arg, &format_str);
break;
case 't':
......