X-Git-Url: http://git.chise.org/gitweb/?p=chise%2Fxemacs-chise.git.1;a=blobdiff_plain;f=lib-src%2Fcvtmail.c;h=a34434c8dcd335b7df7522d848558328e7239c3a;hp=962ec3af285a40a86a97b784ec51d2366be5cd0e;hb=b3351eb8b21e0018c9b1c7f864564480f8abd4b3;hpb=6883ee56ec887c2c48abe5b06b5e66aa74031910 diff --git a/lib-src/cvtmail.c b/lib-src/cvtmail.c index 962ec3a..a34434c 100644 --- a/lib-src/cvtmail.c +++ b/lib-src/cvtmail.c @@ -24,38 +24,31 @@ Boston, MA 02111-1307, USA. */ * exist in your home directory, containing individual mail messages in * separate files in the standard gosling emacs mail reader format. * - * Program takes one argument: an output file. THis file will contain + * Program takes one argument: an output file. This file will contain * all the messages in Messages directory, in berkeley mail format. * If no output file is mentioned, messages are put in ~/OMAIL. * * In order to get rmail to read the messages, the resulting file must * be mv'ed to ~/mbox, and then have rmail invoked on them. - * + * * Author: Larry Kolodney, 1985 */ -#include <../src/config.h> +#include #include #include +#include -#if __STDC__ || defined(STDC_HEADERS) -# include -#else -char *malloc (); -char *getenv (); -#endif -static void *xmalloc (unsigned int); -static void *xrealloc (char *ptr, unsigned int); +static void *xmalloc (size_t); +static void *xrealloc (void *, size_t); static void skip_to_lf (FILE *stream); -static void fatal (CONST char *s1, CONST char *s2); -static void error (CONST char *s1, CONST char *s2); +static void fatal (const char *s1, const char *s2); +static void error (const char *s1, const char *s2); int -main (argc, argv) - int argc; - char *argv[]; +main (int argc, char *argv[]) { char *hd; char *md; @@ -70,7 +63,7 @@ main (argc, argv) char name[14]; int c; - hd = (char *) getenv ("HOME"); + hd = getenv ("HOME"); md = (char *) xmalloc (strlen (hd) + 10); strcpy (md, hd); @@ -113,13 +106,12 @@ main (argc, argv) fclose (cff); } fclose (mddf); - fclose (mfilef); + fclose (mfilef); return 0; } static void -skip_to_lf (stream) - FILE *stream; +skip_to_lf (FILE *stream) { register int c; while ((c = getc(stream)) != '\n') @@ -127,21 +119,18 @@ skip_to_lf (stream) } static void * -xmalloc (size) - unsigned size; +xmalloc (size_t size) { - char *result = (char *) malloc (size); + void *result = malloc (size); if (!result) fatal ("virtual memory exhausted", 0); return result; } static void * -xrealloc (ptr, size) - char *ptr; - unsigned size; +xrealloc (void *ptr, size_t size) { - char *result = (char *) realloc (ptr, size); + void *result = realloc (ptr, size); if (!result) fatal ("virtual memory exhausted", 0); return result; @@ -150,14 +139,14 @@ xrealloc (ptr, size) /* Print error message and exit. */ static void -fatal (CONST char *s1, CONST char *s2) +fatal (const char *s1, const char *s2) { error (s1, s2); exit (1); } static void -error (CONST char *s1, CONST char *s2) +error (const char *s1, const char *s2) { fprintf (stderr, "cvtmail: "); fprintf (stderr, s1, s2);