Annotation of coherent/d/support/bbsadmin/netmaps.c, revision 1.1.1.1

1.1       root        1: /* netmaps.c: utility to build mwcbbs data files for uunet maps.
                      2:  *
                      3:  * usage: cat MAPLIST | netmaps
                      4:  * 
                      5:  * Beware the MAP_PATH and FILENAME when building these files!
                      6:  */
                      7: 
                      8: #include <stdio.h>
                      9: 
                     10: #define MAP_PATH "/usr/spool/uucppublic/maps/can/"
                     11: #define FILENAME "Net_Maps.CAN"
                     12: 
                     13: struct map     {
                     14:                char name[15];
                     15:                char path[60];
                     16:                };
                     17: 
                     18: struct map map_rec;
                     19: 
                     20: main()
                     21: {
                     22: FILE *outfp;
                     23: char filename[15];
                     24: 
                     25:        if((outfp=fopen(FILENAME,"a")) == NULL)
                     26:                {
                     27:                printf("Error opening %s for output!\n",FILENAME);
                     28:                exit(1);
                     29:                }
                     30:        while (gets(filename)!=NULL)
                     31:                {
                     32:                strcpy(map_rec.name,filename);
                     33:                strcpy(map_rec.path, MAP_PATH);
                     34:                strcat(map_rec.path, filename);
                     35:                fwrite(&map_rec, sizeof (struct map),1,outfp);
                     36:                }
                     37:        fclose(outfp);
                     38: }

unix.superglobalmegacorp.com

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