home *** CD-ROM | disk | FTP | other *** search
- /*
- * $Filename: commands.c $
- * $Revision: 2.0 $
- * $Date: 1994/01/09 15:26:48 $
- *
- * Copyright (C) 1993 by Peter Simons <simons@peti.GUN.de>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * $Id: commands.c,v 2.0 1994/01/09 15:26:48 simons Rel simons $
- *
- */
-
-
- /************************************* includes ***********/
- #include "listserv.h"
- #include "protos.h"
-
- /************************************* global variables ***/
- static char rcsid[] = "$Id: commands.c,v 2.0 1994/01/09 15:26:48 simons Rel simons $";
-
- /************************************* program ************/
- void sendhelp(char *from, char *request)
- {
- printf("called sendhelp with %s %s\n", from, request);
- callmailer("", from, request);
- mailcat(HELPFILE,"");
- pclose(mailer);
- return;
- }
-
- void listhelp(char *from,
- char *grp,
- char *request)
- {
- char tmp[128];
- printf("called listhelp with %s %s %s\n", from,grp,request);
-
- callmailer("", from, request);
- sprintf(tmp, "%s%s/Description", LISTDIR, grp);
- mailcat(tmp ,"");
- pclose(mailer);
- return;
- }
-
- void sendindex(char *from,
- char *request,
- int longi)
- {
- DIR *listdir;
- struct dirent *entry;
- char tmp[128];
-
- printf("called sendindex with %s %s %d\n", from, request, longi);
-
- listdir = opendir(LISTDIR);
- if (!listdir) {
- perror(LISTDIR);
- exit(1);
- }
-
- callmailer("", from, request);
- fprintf(mailer, "------------------------ Index of mailing lists ----------------------\n");
-
- while (entry = readdir(listdir)) {
- fprintf(mailer, "%s\n", entry->d_name);
- if (longi) {
- sprintf(tmp, "%s%s/Description", LISTDIR, entry->d_name);
- LockFile(tmp);
- if(!access(tmp,R_OK)) {
- UnLockFile(tmp);
- mailcat(tmp, " ");
- fprintf(mailer, "\n", entry->d_name);
- }
- else
- UnLockFile(tmp);
- }
- }
-
- closedir(listdir);
- fprintf(mailer, "----------------------------------------------------------------------\n");
- pclose(mailer);
- return;
- }
-
-