home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The World of Computer Software
/
World_Of_Computer_Software-02-387-Vol-3of3.iso
/
b
/
bmh02src.zip
/
POST.C
< prev
next >
Wrap
C/C++ Source or Header
|
1992-08-18
|
1KB
|
67 lines
/*
post.c : Copyright Paul Healy, EI9GL, 1992.
920816 : Created.
*/
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <ctype.h>
#include <string.h>
#include "mailer.h"
#include "current.h"
#include "help.h"
#include "rc.h"
#ifdef BMH
#define main post_main
#endif
static void
copyright(int argc, char *argv[])
{
if ( (argc > 1) && (strcmp(argv[1], "-help") == 0) ) {
fprintf(stderr, "Usage: post (post news)\n\n");
version();
fprintf(stderr, "\n%s%s%s%s",
"post is derived from the NOS NR0D NNTP server/client:\n",
"Copyright 1990 Jeffrey R. Comstock, All Rights Reserved.\n",
"Permission granted for non-commercial copying and use, provided\n",
"this notice is retained.");
exit(0);
}
}
int
main(int argc, char *argv[])
{
char filename[256];
FILE *fp;
copyright(argc, argv);
if (loadconfig()==-1)
return -1;
if ((fp = tempfile("post", filename, "w")) == NULL)
return -1;
if ( strchr(currentfolder(NULL), '/') != NULL ) {
char group[256];
fprintf(fp, "Newsgroup: %s\nSubject: \n--------\n",
dir2news(strcpy(group, currentfolder(NULL))) );
}
else
fprintf(fp, "Newsgroup: \nSubject: \n--------\n");
dosignature(fp);
fclose(fp);
if (call_ed("post", filename) == -1)
return -1;
return dowhatnow("post", filename, AG_NNTP);
}