Mercurial > hg > xemacs-beta
diff lib-src/fakemail.c @ 371:cc15677e0335 r21-2b1
Import from CVS: tag r21-2b1
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:03:08 +0200 |
parents | fbbf69b4e8a7 |
children | 6719134a07c2 |
line wrap: on
line diff
--- a/lib-src/fakemail.c Mon Aug 13 11:01:58 2007 +0200 +++ b/lib-src/fakemail.c Mon Aug 13 11:03:08 2007 +0200 @@ -24,9 +24,9 @@ #include <../src/config.h> #if defined (BSD) && !defined (BSD4_1) && !defined (USE_FAKEMAIL) -/* This program is not used in BSD, so just avoid loader complaints. */ +/* This program isnot used in BSD, so just avoid loader complaints. */ int -main (int argc, char *argv[]) +main () { return 0; } @@ -34,7 +34,7 @@ #include <stdio.h> #include <stdlib.h> int -main (int argc, char *argv[]) +main () { /* Linux /bin/mail, if it exists, is NOT the Unix v7 mail that fakemail depends on! This causes garbled mail. Better to @@ -48,7 +48,7 @@ #else /* not BSD 4.2 (or newer) */ #ifdef MSDOS int -main (int argc, char *argv[]) +main () { return 0; } @@ -100,11 +100,11 @@ struct header_record *previous; }; typedef struct header_record *header; - + struct stream_record { FILE *handle; - int (*action)(FILE *); + int (*action)(); struct stream_record *rest_streams; }; typedef struct stream_record *stream_list; @@ -191,7 +191,8 @@ /* Like malloc but get fatal error if memory is exhausted. */ static char * -xmalloc (size_t size) +xmalloc (size) + size_t size; { char *result = malloc (((unsigned) size)); if (result == ((char *) NULL)) @@ -200,7 +201,9 @@ } static char * -xrealloc (char *ptr, size_t size) +xrealloc (ptr, size) + char *ptr; + size_t size; { char *result = realloc (ptr, ((unsigned) size)); if (result == ((char *) NULL)) @@ -218,7 +221,7 @@ } /* Read a line of text from `stream' into `linebuffer'. - * Return the length of the line. + * Return the length of the line. */ static long @@ -260,17 +263,14 @@ ptr = &keyword[0]; c = *field++; - if ((isspace ((int) (unsigned char) c)) || (c == ':')) - return (char *) NULL; - *ptr++ = ((islower ((int) (unsigned char) c)) ? - (toupper ((int) (unsigned char) c)) : c); - while (((c = *field++) != ':') && - (!(isspace ((int) (unsigned char) c)))) - *ptr++ = ((islower ((int) (unsigned char) c)) ? - (toupper ((int) (unsigned char) c)) : c); + if ((isspace (c)) || (c == ':')) + return ((char *) NULL); + *ptr++ = ((islower (c)) ? (toupper (c)) : c); + while (((c = *field++) != ':') && (!(isspace (c)))) + *ptr++ = ((islower (c)) ? (toupper (c)) : c); *ptr++ = '\0'; - while (isspace ((int) (unsigned char) c)) c = *field++; - if (c != ':') return (char *) NULL; + while (isspace (c)) c = *field++; + if (c != ':') return ((char *) NULL); *rest = field; return &keyword[0]; } @@ -371,7 +371,7 @@ } static void -add_a_stream (FILE *the_stream, int (*closing_action)(FILE *)) +add_a_stream (FILE *the_stream, int (*closing_action)()) { stream_list old = the_streams; the_streams = new_stream (); @@ -553,7 +553,7 @@ *where = '\0'; return; } - + static header read_header (void) { @@ -624,7 +624,9 @@ } int -main (int argc, char *argv[]) +main (argc, argv) + int argc; + char **argv; { char *command_line; header the_header; @@ -653,7 +655,7 @@ args_size (the_header))); strcpy (command_line, mail_program_name); parse_header (the_header, &command_line[name_length]); - + the_pipe = popen (command_line, "w"); if (the_pipe == ((FILE *) NULL)) fatal ("cannot open pipe to real mailer", (char *) 0);