home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The CDPD Public Domain Collection for CDTV 4
/
CDPD_IV.bin
/
networking
/
uucp
/
amigauucpsrc
/
dnews
/
postnews.c
< prev
next >
Wrap
C/C++ Source or Header
|
1994-06-29
|
1KB
|
63 lines
/*
* POSTNEWS.C
*
* note: TmpFileName() may already be in use, do not use the call.
* note: PostNews deletes files for us
* note: grp might not be known, thus we cannot use the cache to
* obtain Referencs: and Message-ID:
*/
#include "defs.h"
Prototype void PostNews(FILE *, char *);
void
PostNews(refi, infile)
FILE *refi; /* can be NULL:, used to get References: */
char *infile;
{
char reffile[64];
FILE *xfi;
static short Count;
sprintf(reffile, "T:dnews-%06lx%04x", (unsigned long)FindTask(NULL) >> 2, Count);
++Count;
xfi = fopen(reffile, "w");
if (xfi == NULL) {
printf("Couldn't create %s\n", reffile);
return;
}
if (refi) {
char *field;
fprintf(xfi, "References: ");
if (field = FindField(refi, "References:")) {
fprintf(xfi, " %s", field);
free(field);
}
if (field = FindField(refi, "Message-ID:")) {
fprintf(xfi, " %s", field);
free(field);
}
fprintf(xfi, "\n");
}
fclose(xfi);
/*
* -x option to postnews deletes file
*/
sprintf(TmpBuf, "RUN <nil: >nil: %s %s -R %s -x %s -x %s",
GetConfigProgram(POSTNEWS),
infile, /* news file */
reffile, /* -R */
infile, /* done/delete */
reffile /* done/delete */
);
system(TmpBuf);
}