]> code.citadel.org Git - citadel.git/blobdiff - citadel/netmailer.c
Tue Aug 18 00:42:33 EDT 1998 Nathan Bryant <bryant@cs.usm.maine.edu>
[citadel.git] / citadel / netmailer.c
index e657f5a562b1860c9540d9edc1b9c5ef14005093..47c4d965b49bd081b0529bd9ff000e19b0fef08b 100644 (file)
@@ -16,9 +16,8 @@
 #include <syslog.h>
 #include "citadel.h"
 
-int struncmp();
-void LoadInternetConfig();
-void get_config();
+void LoadInternetConfig(void);
+void get_config(void);
 struct config config;
 
 char temp[20];
@@ -31,9 +30,8 @@ char GW_DOMAIN[128];
 char TABLEFILE[128];
 int RUN_NETPROC = 1;
 
-int haschar(st,ch)
-char st[];
-int ch; {
+int haschar(char *st, int ch)
+{
        int a,b;
        b=0;
        for (a=0; a<strlen(st); ++a) if (st[a]==ch) ++b;
@@ -41,26 +39,8 @@ int ch; {
        }
 
 
-int struncmp(lstr,rstr,len)
-char lstr[],rstr[];
-int len; {
-       int pos = 0;
-       char lc,rc;
-       while (pos<len) {
-               lc=tolower(lstr[pos]);
-               rc=tolower(rstr[pos]);
-               if ((lc==0)&&(rc==0)) return(0);
-               if (lc<rc) return(-1);
-               if (lc>rc) return(1);
-               pos=pos+1;
-               }
-       return(0);
-       }
 
-
-void fpgetfield(fp,string)
-FILE *fp;
-char string[];
+void fpgetfield(FILE *fp, char *string)
 {
        int a,b;
        strcpy(string,"");
@@ -81,16 +61,16 @@ char string[];
  * modified to format 80 columns into a temporary file, and extract the
  * sender and recipient names for use within the main() loop.
  */
-void msgform(msgfile,mfout,sbuf,rbuf,nbuf,pbuf,mid_buf,rmname,subj)
-char *msgfile;
-FILE *mfout;
-char *sbuf;            /* sender */
-char *rbuf;            /* recipient (in this case, an Internet address) */
-char *nbuf;            /* source node */
-char *pbuf;            /* path */
-long *mid_buf;         /* message ID */
-char *rmname;          /* room name */
-char *subj;            /* subject */
+void msgform(char *msgfile, FILE *mfout, char *sbuf, char *rbuf, char *nbuf, char *pbuf, long int *mid_buf, char *rmname, char *subj)
+              
+            
+                       /* sender */
+                       /* recipient (in this case, an Internet address) */
+                       /* source node */
+                       /* path */
+                       /* message ID */
+                       /* room name */
+                       /* subject */
        {
        int a,b,c,e,old,mtype,aflag;
        int real = 0;
@@ -178,9 +158,8 @@ BONFGM:     b=getc(fp); if (b<0) goto END;
        goto BONFGM;
        }
 
-void main(argc,argv)
-int argc;
-char *argv[]; {
+void main(int argc, char **argv)
+{
        int a;
        FILE *fp,*rmail;
        char sbuf[200],rbuf[200],cstr[100],fstr[128];
@@ -207,7 +186,7 @@ char *argv[]; {
         * accept postings from subscribed addresses, we must always use the
         * room's address as the originating user.
         */
-       if ( (argc == 3) && (!strucmp(argv[2], "mlist")) ) {
+       if ( (argc == 3) && (!strcasecmp(argv[2], "mlist")) ) {
                mlist = 1;
                }
 
@@ -238,9 +217,9 @@ char *argv[]; {
         * users to receive Internet mail.
         */
        fprintf(rmail,"From ");
-       if (strucmp(nbuf,NODENAME)) fprintf(rmail,"%s!",nbuf);
+       if (strcasecmp(nbuf,NODENAME)) fprintf(rmail,"%s!",nbuf);
 
-       if (!strucmp(nbuf,NODENAME)) strcpy(nbuf, FQDN);
+       if (!strcasecmp(nbuf,NODENAME)) strcpy(nbuf, FQDN);
        
        if (mlist) {
                fprintf(rmail,"%s\n", rmname);
@@ -248,7 +227,7 @@ char *argv[]; {
                }
        else {
 
-               if (!strucmp(nbuf, NODENAME)) {         /* from this system */
+               if (!strcasecmp(nbuf, NODENAME)) {              /* from this system */
                        fprintf(rmail,"%s\n",pbuf);
                        fprintf(rmail,"From: %s@%s (%s)\n",
                                sbuf, FQDN, fstr);