home *** CD-ROM | disk | FTP | other *** search
- head 1.1;
- branch 1.1.1;
- access;
- symbols;
- locks
- simons:1.1.1.8
- andy:1.1; strict;
- comment @ * @;
-
-
- 1.1
- date 92.09.14.11.03.46; author andy; state Exp;
- branches
- 1.1.1.1;
- next ;
-
- 1.1.1.1
- date 93.12.26.00.41.06; author simons; state Exp;
- branches;
- next 1.1.1.2;
-
- 1.1.1.2
- date 93.12.26.19.35.55; author simons; state Exp;
- branches;
- next 1.1.1.3;
-
- 1.1.1.3
- date 93.12.27.17.53.45; author simons; state Exp;
- branches;
- next 1.1.1.4;
-
- 1.1.1.4
- date 93.12.27.18.22.01; author simons; state Exp;
- branches;
- next 1.1.1.5;
-
- 1.1.1.5
- date 93.12.27.18.23.46; author simons; state Exp;
- branches;
- next 1.1.1.6;
-
- 1.1.1.6
- date 93.12.28.00.19.54; author simons; state Exp;
- branches;
- next 1.1.1.7;
-
- 1.1.1.7
- date 93.12.28.16.59.48; author simons; state Exp;
- branches;
- next 1.1.1.8;
-
- 1.1.1.8
- date 93.12.28.22.16.34; author simons; state Exp;
- branches;
- next ;
-
-
- desc
- @Original Unix-Listserv distribution.
- @
-
-
- 1.1
- 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/faq.c,v 1.1 92/09/14 11:03:46 andy Exp Locker: andy $";
-
- extern FILE *mailer;
-
- sendfaq(from, command, outsider)
- char *from, *command;
- int outsider;
- {
- int i;
- char grp[256], tmp[512];
-
- printf("called sendfaq with %s %s %s\n", from, command, outsider);
- i = sscanf(command, "%s%s", tmp, grp);
- if(i != 2)
- {
- callmailer("", from, command);
- sprintf(tmp, "%s/FAQHELP", SERVDIR);
- mailcat(tmp, "\t");
- fflush(mailer);
- pclose(mailer);
- return;
- }
-
- sprintf(tmp, "%s/%s.pub", SERVDIR, grp);
- callmailer("", from, command);
- if(access(tmp,R_OK) == 0)
- {
- sprintf(tmp, "%s/%s.faq", SERVDIR, grp);
- if(access(tmp, R_OK) == 0)
- {
- mailcat(tmp, "\t");
- fflush(mailer);
- pclose(mailer);
- return;
- }
- else
- {
- fprintf(mailer, "There is no FAQ available for");
- fprintf(mailer, " mailing list \"%s\".\n", grp);
- fflush(mailer);
- pclose(mailer);
- return;
- }
- }
- else if(outsider)
- {
- 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;
- }
- else {
- sprintf(tmp, "%s/%s.faq", SERVDIR, grp);
- if(access(tmp, R_OK) == 0)
- {
- mailcat(tmp, "\t");
- fflush(mailer);
- pclose(mailer);
- return;
- }
- else
- {
- fprintf(mailer, "There is no FAQ available for");
- fprintf(mailer, " mailing list \"%s\".\n", grp);
- fflush(mailer);
- pclose(mailer);
- return;
- }
- }
-
- }
-
-
- faqindex(from,request)
- char *from,*request;
- {
- FILE *ls;
- char tmp[128];
- char buf[128];
- int i;
- printf("called faqindex with %s %s\n", from,request);
-
- sprintf(tmp,"cd %s; ls *.faq | sed -e 's/.faq//", SERVDIR);
- ls = popen(tmp,"r");
- if (ls == NULL)
- {
- perror(tmp);
- exit(1);
- }
- callmailer("", from, request);
- fprintf(mailer,"Index of Frequently Asked Questions\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);
- }
- pclose(ls);
- pclose(mailer);
- return;
- }
-
-
-
-
- @
-
-
- 1.1.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 3
- a7 1
- void sendfaq(from, command, outsider)
- d79 1
- a79 1
- void faqindex(from,request)
- @
-
-
- 1.1.1.2
- 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: faq.c,v 1.1.1.1 1993/12/26 00:41:06 simons Exp simons $";
- d6 1
- a6 1
- void sendfaq(from, command)
- d8 1
- d13 1
- a13 1
- printf("called sendfaq with %s %s %s\n", from, command);
- d18 1
- a18 1
- sprintf(tmp, "%sFAQHELP", SERVDIR);
- d25 1
- a25 1
- sprintf(tmp, "%s%s.pub", SERVDIR, grp);
- d29 1
- a29 1
- sprintf(tmp, "%s%s.faq", SERVDIR, grp);
- d46 1
- a46 2
- sprintf(tmp, "%s%s.faq", SERVDIR, grp);
- if(access(tmp, R_OK) == 0)
- d48 4
- a51 1
- mailcat(tmp, "\t");
- d56 17
- a72 7
- else
- {
- fprintf(mailer, "There is no FAQ available for");
- fprintf(mailer, " mailing list \"%s\".\n", grp);
- fflush(mailer);
- pclose(mailer);
- return;
- d74 1
- @
-
-
- 1.1.1.3
- log
- @Fixed 'FAQ <listname>'-commamnd.
- @
- text
- @d4 1
- a4 1
- static char rcsid[] = "$Id: faq.c,v 1.1.1.2 1993/12/26 19:35:55 simons Exp simons $";
- d12 1
- a12 1
- printf("called sendfaq with %s %s\n", from, command);
- d16 5
- a20 1
- sendhelp(from, command);
- d24 1
- a24 1
- sprintf(tmp, "%s%s/FAQ", LISTDIR, grp);
- d26 23
- a48 2
- if(access(tmp,R_OK) == 0) {
- mailcat(tmp, "");
- d52 3
- a54 2
- }
- else {
- @
-
-
- 1.1.1.4
- log
- @Fixed the faqindex() function.
- @
- text
- @d4 1
- a4 1
- static char rcsid[] = "$Id: faq.c,v 1.1.1.3 1993/12/27 17:53:45 simons Exp simons $";
- d38 1
- a38 1
- void faqindex(from, request)
- d40 2
- a41 3
- {
- DIR *listdir;
- struct dirent *entry;
- d43 3
- a45 1
- printf("called faqindex with %s %s\n", from, request);
- d47 5
- a51 2
- if (!(listdir = opendir(LISTDIR))) {
- perror(LISTDIR);
- d53 3
- a55 1
- }
- d57 6
- a62 7
- callmailer(LISTSERVMANAGER, from, request);
- fprintf(mailer, "------------------------ Index of available FAQs ---------------------\n");
-
- while (entry = readdir(listdir)) {
- sprintf(tmp, "%s%s/FAQ", LISTDIR, entry->d_name);
- if (!access(tmp,R_OK))
- fprintf(mailer, "%s\n", entry->d_name);
- d64 1
- a64 2
- closedir(listdir);
- fprintf(mailer, "----------------------------------------------------------------------\n");
- d67 4
- a70 1
- }
- @
-
-
- 1.1.1.5
- log
- @Added file-locking.
- @
- text
- @d4 1
- a4 1
- static char rcsid[] = "$Id: faq.c,v 1.1.1.4 1993/12/27 18:22:01 simons Exp simons $";
- a21 1
- LockFile(tmp);
- a22 1
- UnLockFile(tmp);
- a28 1
- UnLockFile(tmp);
- d56 1
- a56 2
- LockFile(tmp);
- if (!access(tmp, R_OK))
- d58 1
- a58 2
- UnLockFile(tmp);
- }
- a59 1
-
- @
-
-
- 1.1.1.6
- log
- @Changed the username used in From-line to LISTSERVADDR instead of
- LISTSERVMANAGER, so people can simply reply to the mails they get.
- @
- text
- @d4 1
- a4 1
- static char rcsid[] = "$Id: faq.c,v 1.1.1.5 1993/12/27 18:23:46 simons Exp simons $";
- d54 1
- a54 1
- callmailer(LISTSERVADDR, from, request);
- @
-
-
- 1.1.1.7
- log
- @Changed a callmail() call to redirect parameter '""'. I'll probably use
- the redirect parameter for another purpose now.
- @
- text
- @d4 1
- a4 1
- static char rcsid[] = "$Id: faq.c,v 1.1.1.6 1993/12/28 00:19:54 simons Exp simons $";
- d54 1
- a54 1
- callmailer("", from, request);
- @
-
-
- 1.1.1.8
- log
- @Changed function declarations to ANSI-compliant style.
- @
- text
- @d4 1
- a4 1
- static char rcsid[] = "$Id: faq.c,v 1.1.1.7 1993/12/28 16:59:48 simons Exp simons $";
- d6 3
- a8 3
- void sendfaq(char *from,
- char *command)
- {
- d41 2
- a42 2
- void faqindex(char *from,
- char *request)
- @
-