(void) fprintf(stderr, "\t-r n\tset retention period for read news groups to 'n',\n\t\twhere 'n' may be a decimal fraction (default = %g).\n", READ_RETENTION_DEFAULT);
(void) fprintf(stderr, "\t-e n\tset expirey period for read news groups to 'n',\n\t\twhere 'n' may be a decimal fraction (default = %g).\n", READ_EXPIREY_DEFAULT);
(void) fprintf(stderr, "\t-p n\tset purge period for read news groups to 'n',\n\t\twhere 'n' may be a decimal fraction (default = %g).\n", READ_PURGE_DEFAULT);
(void) fprintf(stderr, "\t-R n\tset retention period for unread news groups to 'n',\n\t\twhere 'n' may be a decimal fraction (default = %g).\n", UNREAD_RETENTION_DEFAULT);
(void) fprintf(stderr, "\t-E n\tset expirey period for unread news groups to 'n',\n\t\twhere 'n' may be a decimal fraction (default = %g).\n", UNREAD_EXPIREY_DEFAULT);
(void) fprintf(stderr, "\t-P n\tset purge period for unread news groups to 'n',\n\t\twhere 'n' may be a decimal fraction (default = %g).\n", UNREAD_PURGE_DEFAULT);
(void) fprintf(stderr, "\t-s\ttakes UID 0 account .newsrc files into account\n");
(void) fprintf(stderr, "\t-v\tturns on verbose output mode\n\n");
exit(0);
#endif
}
}
/** next let's read in the netnews active file **/
read_active_file();
/** read in the EXPIRE_DEFAULTS file and set default expires **/
#ifndef CNEWS
set_default_expiration_dates();
#endif
/** check each user for a .newsrc and mark groups subscribed **/
check_each_user();
/** whip through a quick resort by expiration time **/
#ifndef CNEWS
sort_groups_by_expiration();
#endif
/** and finally output the script that we can execute **/
output_script();
/** and we're done **/
return(0);
}
read_active_file()
{
/** this routine reads in the active file, sorts it, and
returns. It is assumed that it always works - if something
fails it will exit from here..
**/
int compare();
FILE *fd;
char buffer[SLEN];
register int i;
if ((fd = fopen(ACTIVE_FILE, "r")) == NULL) {
(void) fprintf(stderr,"%s: cannot open active file '%s':\n",
prog_name, ACTIVE_FILE);
perror("fopen");
exit(1);
}
while (fgets(buffer, SLEN, fd) != NULL) {
/** get just the first word ... **/
for (i=0; ! whitespace(buffer[i]); i++) ;
buffer[i] = '\0';
if ((groups[group_count].name = malloc((unsigned)(i+1))) == NULL) {
(void) fprintf(stderr,"%s: couldn't malloc memory for group '%s'\n",
prog_name, buffer);
perror("malloc");
exit(1);
}
/** now load up the new record and increment our counter **/