File:  [MW Coherent from dump] / coherent / d / support / bbsadmin / netmaps.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Wed May 29 04:56:38 2019 UTC (7 years, 2 months ago) by root
Branches: MarkWilliams, MAIN
CVS tags: relic, HEAD
coherent

/* netmaps.c: utility to build mwcbbs data files for uunet maps.
 *
 * usage: cat MAPLIST | netmaps
 * 
 * Beware the MAP_PATH and FILENAME when building these files!
 */

#include <stdio.h>

#define MAP_PATH "/usr/spool/uucppublic/maps/can/"
#define FILENAME "Net_Maps.CAN"

struct map	{
		char name[15];
		char path[60];
		};

struct map map_rec;

main()
{
FILE *outfp;
char filename[15];

	if((outfp=fopen(FILENAME,"a")) == NULL)
		{
		printf("Error opening %s for output!\n",FILENAME);
		exit(1);
		}
	while (gets(filename)!=NULL)
		{
		strcpy(map_rec.name,filename);
		strcpy(map_rec.path, MAP_PATH);
		strcat(map_rec.path, filename);
		fwrite(&map_rec, sizeof (struct map),1,outfp);
		}
	fclose(outfp);
}

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.