home *** CD-ROM | disk | FTP | other *** search
- /*
- * from simtel20 format to:
- * Remote Access / Maximus / TubFile / Opus / QuickBbs / SuperBbs
- */
-
- #if 0
- 1234567890123456789012345678901
- 4DOSANN.ZIP B 6864 910819 4DOS runs on DOS 5.0 and Norton DOS info
- ---------->
- AD-FEBBS.ZIP Great Demo for Febbs made by OUNO-Soft.
- #endif
-
- #include <ctype.h>
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
-
- struct data {
- char filename[15];
- long filesize;
- int year;
- int month;
- int day;
- char description[900];
- };
-
- int pastheader = 0;
- struct data line;
-
- void
- readline(void) {
- char buf[1000];
- char workbuf[1000];
- static char datebuf[5] = "12";
- char *r;
-
- if (NULL == gets(buf))
- exit(0);
-
- /* wait for header */
- if (! pastheader) {
- if (strstr(buf, "================"))
- ++pastheader;
- return;
- }
-
- if (strlen(buf) < 31) {
- fprintf(stderr, "warning: line too short:\n%s\n", buf);
- }
-
- strcpy(workbuf, buf);
-
- r = strtok(buf, " ");
- if (! r) {
- fprintf(stderr, "unknown line:\n%s\n", buf);
- return;
- }
- strcpy(line.filename, r);
-
- r += strlen(r) + 1; /* skip name */
- while (isspace(*r)) /* skip white */
- ++r;
-
- ++r; /* skip file type */
-
- while (isspace(*r)) /* skip white */
- ++r;
-
- r = strtok(r, " ");
- if (! r) {
- fprintf(stderr, "unknown line:\n%s\n", buf);
- return;
- }
- line.filesize = atol(r);
- r += strlen(r) + 1;
-
- while (isspace(*r)) /* skip white */
- ++r;
-
- datebuf[0] = *r;
- ++r;
- datebuf[1] = *r;
- ++r;
- line.year = atoi(datebuf);
-
- datebuf[0] = *r;
- ++r;
- datebuf[1] = *r;
- ++r;
- line.month = atoi(datebuf);
- datebuf[0] = *r;
- ++r;
- datebuf[1] = *r;
- ++r;
- line.day = atoi(datebuf);
-
- while (isspace(*r)) /* skip white */
- ++r;
-
- if (*r)
- strcpy(line.description, r);
- }
-
- void
- writeline(void) {
-
- if (! line.filename[0])
- return;
-
- #if 0
- 9600TEXT.ZIP 16576 09-26-91 A pair of US Robotics text files about HST
- | modems.
- #endif
-
- printf("%s %s\n", line.filename, line.description);
- }
-
- void _Cdecl
- main(void) {
-
- while (1) {
- readline();
- writeline();
- }
- }
-