home *** CD-ROM | disk | FTP | other *** search
- head 1.4;
- branch 1.4.1;
- access;
- symbols;
- locks
- simons:1.4.1.6
- andy:1.4; strict;
- comment @ * @;
-
-
- 1.4
- date 92.09.14.11.03.42; author andy; state Exp;
- branches
- 1.4.1.1;
- next ;
-
- 1.4.1.1
- date 93.12.26.00.40.30; author simons; state Exp;
- branches;
- next 1.4.1.2;
-
- 1.4.1.2
- date 93.12.26.19.08.25; author simons; state Exp;
- branches;
- next 1.4.1.3;
-
- 1.4.1.3
- date 93.12.26.19.35.55; author simons; state Exp;
- branches;
- next 1.4.1.4;
-
- 1.4.1.4
- date 93.12.27.17.37.04; author simons; state Exp;
- branches;
- next 1.4.1.5;
-
- 1.4.1.5
- date 93.12.27.17.42.19; author simons; state Exp;
- branches;
- next 1.4.1.6;
-
- 1.4.1.6
- date 93.12.28.22.16.34; author simons; state Exp;
- branches;
- next ;
-
-
- desc
- @Original Unix-Listserv distribution.
- @
-
-
- 1.4
- log
- @checked in with -k by simons at 1993/12/26 00:08:53
- @
- text
- @#include "listserv.h"
-
- static char rcsid[] = "$Header: /usr/local/src/mail/listserv/RCS/commands.c,v 1.4 92/09/14 11:03:42 andy Exp Locker: andy $";
-
- extern FILE *msg;
- extern FILE *mailer;
-
- sendhelp(from,request)
- char *from, *request;
- {
- printf("called sendhelp with %s %s\n", from, request);
- callmailer("", from, request);
- mailcat(HELPFILE,"");
- pclose(mailer);
- return;
- }
-
- listhelp(from,grp,request,outsider)
- char *from,*grp,*request;
- int outsider;
- {
- FILE *commands;
- int i;
- char tmp[128], hlp[128], cmd[128];
- printf("called listhelp with %s %s %s\n", from,grp,request);
-
- callmailer("", from, request);
- strcpy(tmp, COMMANDFILE);
- commands = fopen(tmp, "r");
- if( commands == NULL)
- {
- perror(tmp);
- exit(1);
- }
- while(i = fscanf(commands, "%s %s",cmd, hlp) > 0)
- if (!strcasecmp(cmd, grp))
- {
- sprintf(tmp, "%s/%s", SERVDIR, hlp);
- mailcat(tmp, "\t");
- fflush(mailer);
- pclose(mailer);
- fclose(commands);
- return;
- }
- fclose(commands);
-
- if (outsider)
- sprintf(tmp,"%s/%s.pub", SERVDIR, grp);
- else
- sprintf(tmp,"%s/%s.info", SERVDIR, grp);
- if (access(tmp,R_OK) != 0)
- {
- fprintf(mailer,"The mailing list \"%s\" could not be found.\n",
- grp);
- fprintf(mailer,"You may use the INDEX command to get a listing\n");
- fprintf(mailer,"of available mailing lists.\n");
- fflush(mailer);
- pclose(mailer);
- return;
- }
-
- fprintf(mailer,"Mailing list \"%s\":\n", grp);
- mailcat(tmp,"\t");
- pclose(mailer);
- return;
- }
-
- sendindex(from,request,l,outsider)
- char *from,*request;
- int l,outsider;
- {
- FILE *ls;
- char tmp[128];
- char buf[128];
- int i;
- printf("called sendindex with %s %s %d %d\n",
- from,request,l,outsider);
-
- if (outsider)
- sprintf(tmp,"cd %s; ls *.pub | sed -e 's/.pub//", SERVDIR);
- else
- sprintf(tmp,"cd %s; ls *.info | sed -e 's/.info//", SERVDIR);
- ls = popen(tmp,"r");
- if (ls == NULL)
- {
- perror(tmp);
- exit(1);
- }
- callmailer("", from, request);
- fprintf(mailer,"Index of mailing lists\n");
-
- /* read the result of the ls */
- while (fgets(tmp, sizeof(tmp), ls))
- {
- while (tmp[(i=strlen(tmp)-1)] == '\n')
- tmp[i] = '\0';
- fprintf(mailer, "%s\n", tmp);
-
- /* if he wanted the long listing, cat the .info file */
- if (l)
- {
- if (outsider)
- sprintf(buf, "%s/%s.pub", SERVDIR, tmp);
- else
- sprintf(buf, "%s/%s.info", SERVDIR, tmp);
- mailcat(buf,"\t");
- fprintf(mailer, "\n");
- }
- }
- pclose(ls);
- pclose(mailer);
- return;
- }
-
-
-
-
- @
-
-
- 1.4.1.1
- log
- @Changed source code to compiler under SAS/C 6.50.
- @
- text
- @a1 1
- #include "protos.h"
- d3 1
- a3 1
- static char rcsid[] = "$Id$";
- d5 4
- a8 1
- void sendhelp(from,request)
- d18 1
- a18 1
- void listhelp(from,grp,request,outsider)
- d68 1
- a68 1
- void sendindex(from,request,l,outsider)
- @
-
-
- 1.4.1.2
- log
- @Changed UNIX directory stuff to conform with the AmigaDOS.
- Changed sendindex() to fire the INDEX file up.
- 'LONGINDEX'-command still has to be implemented.
- @
- text
- @d4 1
- a4 1
- static char rcsid[] = "$Id: commands.c,v 1.4.1.1 1993/12/26 00:40:30 simons Exp simons $";
- d36 1
- a36 1
- sprintf(tmp, "%s%s", SERVDIR, hlp);
- d46 1
- a46 1
- sprintf(tmp,"%s%s.pub", SERVDIR, grp);
- d48 1
- a48 1
- sprintf(tmp,"%s%s.info", SERVDIR, grp);
- d66 1
- a66 1
- void sendindex(from,request,longi)
- d68 3
- a70 2
- int longi;
- {
- d72 4
- a75 1
- printf("called sendindex with %s %s %d\n", from, request, longi);
- d77 10
- d88 21
- a108 8
- fprintf(mailer, "------------------------ Index of mailing lists ----------------------\n");
- sprintf(tmp, "%sINDEX", SERVDIR);
- mailcat(tmp, "");
- fprintf(mailer, "----------------------------------------------------------------------\n");
- if (longi)
- {
- fprintf(mailer, "\nSorry, but the LONGINDEX command is not supported in this ListSERV\nversion!\n");
- }
- d111 4
- a114 1
- }
- @
-
-
- 1.4.1.3
- log
- @Removed the complete local/non-local user determination, including
- all >outsider< parameters and the cleanup() routine.
- Changed UNIX-paths to conform with AmigaDOS.
- @
- text
- @d4 1
- a4 1
- static char rcsid[] = "$Id: commands.c,v 1.4.1.2 1993/12/26 19:08:25 simons Exp simons $";
- d16 1
- a16 1
- void listhelp(from, grp, request)
- d18 1
- d45 4
- a48 1
- sprintf(tmp,"%s%s.pub", SERVDIR, grp);
- @
-
-
- 1.4.1.4
- log
- @Fixed 'HELP <listname>'-command.
- @
- text
- @d4 1
- a4 1
- static char rcsid[] = "$Id: commands.c,v 1.4.1.3 1993/12/26 19:35:55 simons Exp simons $";
- d25 33
- a57 2
- sprintf(tmp, "%s%s/Description", LISTDIR, grp);
- mailcat(tmp ,"");
- @
-
-
- 1.4.1.5
- log
- @Removed unecessary buffers.
- TODO: 'HELP <listname>' currently understands only one parameter!
- @
- text
- @d4 1
- a4 1
- static char rcsid[] = "$Id: commands.c,v 1.4.1.4 1993/12/27 17:37:04 simons Exp simons $";
- d19 3
- a21 1
- char tmp[128];
- @
-
-
- 1.4.1.6
- log
- @Changed function declarations to ANSI-compliant style.
- @
- text
- @d4 1
- a4 1
- static char rcsid[] = "$Id: commands.c,v 1.4.1.5 1993/12/27 17:42:19 simons Exp simons $";
- d6 3
- a8 3
- void sendhelp(char *from,
- char *request)
- {
- d16 3
- a18 4
- void listhelp(char *from,
- char *grp,
- char *request)
- {
- d29 3
- a31 3
- void sendindex(char *from,
- char *request,
- int longi)
- @
-