head	1.14;
access;
symbols;
locks
	ids:1.14; strict;
comment	@ * @;


1.14
date	2001.07.27.13.35.23;	author ids;	state Exp;
branches;
next	1.13;

1.13
date	2000.06.18.18.13.34;	author ids;	state Exp;
branches;
next	1.12;

1.12
date	99.09.23.12.10.30;	author ids;	state Exp;
branches;
next	1.11;

1.11
date	99.06.19.21.35.45;	author ids;	state Exp;
branches;
next	1.10;

1.10
date	98.09.22.18.43.12;	author ids;	state Exp;
branches;
next	1.9;

1.9
date	98.09.21.21.30.44;	author ids;	state Exp;
branches;
next	1.8;

1.8
date	97.11.27.19.58.05;	author ids;	state Exp;
branches;
next	1.7;

1.7
date	97.11.27.19.42.03;	author ids;	state Exp;
branches;
next	1.6;

1.6
date	97.11.19.21.22.54;	author ids;	state Exp;
branches;
next	1.5;

1.5
date	97.11.19.20.30.28;	author ids;	state Exp;
branches;
next	1.4;

1.4
date	97.11.19.20.23.51;	author ids;	state Exp;
branches;
next	1.3;

1.3
date	97.11.19.19.21.07;	author ids;	state Exp;
branches;
next	1.2;

1.2
date	97.11.18.21.08.02;	author ids;	state Exp;
branches;
next	1.1;

1.1
date	97.11.14.19.55.48;	author ids;	state Exp;
branches;
next	;


desc
@@


1.14
log
@changed to the more modern "--option" style for the various option flags.
 (i.e. -html, -notbefore -> --html, --notbefore.)
@
text
@/*
 *	dbparse.c:
 *	parses, as best it can, a Netscape-style database file.
 *	(Historically one recognized such files by Netscape giving them
 *	the extension ".db", although version 4.6 for Linux seems to use
 *	"history.dat" as its history database file,
 *	despite "history.db" being specified in the preferences.)
 *	Writes to the standard output.
 *
 *	usage: dbparse [--html] [--notbefore <time-as-string>] <db-file-name>
 *
 *	Only entries with timestamps between the specified "not before" time
 *	(or the Unix big bang if not specified) and the current time inclusive
 *	are displayed. Format expected for the "not before" time string
 *	is like this: "Tue Sep 22 19:12:44 1998".
 *
 *	Output format *without* --html flag is one entry per line, like this:
 *	numeric-timestamp [TAB] timestamp-as-string [TAB]
 *	db-file-entry-URL [TAB] db-file-entry-title [NEWLINE].
 *
 *	Output format *with* --html flag is one entry per line, like this:
 *	numeric-timestamp [TAB]
 *	<LI> <A HREF="[db-file-entry-URL]">
 *		[db-file-entry-title] <I>([db-file-entry-URL])</I>
 *	     </A>
 *	     <I> - [timestamp-as-string]</I>
 *	</LI> [NEWLINE].
 *
 *	In both cases an empty title is rendered as "Untitled".
 *
 *	In the --html format, '"' characters in the first displaying of the URL
 *	(the giving of it as an anchor) are rendered as "%22";
 *	and similarly, "<" and ">" characters in the title and the
 *	subsequent (second) displaying of the URL are rendered as
 *	"&lt;" and "&gt;" respectively. With these renderings we avoid unwanted
 *	"HTML meta-character interpretations" by browsers, which could
 *	potentially mess up the display of the rest of the page.
 *
 *
 *	NOTE: This source code is not very polished.
 */

#include <ctype.h>
#include <stdio.h>
#include <string.h>
#include <time.h>
#include <sys/types.h>
#include <sys/time.h>

#define bool	int
#define TRUE	1
#define FALSE	0

#define MAX_DB_FILE_ENTRY_TITLE_LENGTH	65536
#define MAX_DB_FILE_ENTRY_URL_LENGTH	65536


void main(int argc, char *argv[])
{
	int ch, time0, time1, time2, time3, count,
		db_file_entry_title_position, db_file_entry_URL_position;
	time_t db_file_entry_timestamp, not_before_time, current_time;
	struct tm not_before_time_as_struct_tm;
	char *htmlflag, *notbeforeflag, *not_before_time_as_string,
		*filename, *i;
	char db_file_entry_title[MAX_DB_FILE_ENTRY_TITLE_LENGTH+1];
	char db_file_entry_URL  [MAX_DB_FILE_ENTRY_URL_LENGTH  +1];
	bool output_as_html, use_not_before_time_given_as_argument;
	FILE *filehandle;


	/*
	 *	argument checking
	 */
	if (argc == 2) {

		output_as_html=FALSE;
		use_not_before_time_given_as_argument=FALSE;
		filename=argv[1];
		if (strcmp(filename, "--html") == 0 || strcmp(filename, "--notbefore") == 0) {
			fprintf(stderr, "usage: %s [--html] [--notbefore <time-as-string>] <db-file-name>\n", argv[0]);
			exit(1);
		}

	} else if (argc == 3) {

		htmlflag=argv[1];
		if (strcmp(htmlflag, "--html") != 0) {
			fprintf(stderr, "usage: %s [--html] [--notbefore <time-as-string>] <db-file-name>\n", argv[0]);
			exit(1);
		}

		output_as_html=TRUE;
		use_not_before_time_given_as_argument=FALSE;
		filename=argv[2];
		if (strcmp(filename, "--html") == 0 || strcmp(filename, "--notbefore") == 0) {
			fprintf(stderr, "usage: %s [--html] [--notbefore <time-as-string>] <db-file-name>\n", argv[0]);
			exit(1);
		}

	} else if (argc == 4) {

		notbeforeflag=argv[1];
		if (strcmp(notbeforeflag, "--notbefore") != 0) {
			fprintf(stderr, "usage: %s [--html] [--notbefore <time-as-string>] <db-file-name>\n", argv[0]);
			exit(1);
		}

		output_as_html=FALSE;
		use_not_before_time_given_as_argument=TRUE;
		not_before_time_as_string=argv[2];
		if (strcmp(not_before_time_as_string, "--html") == 0 || strcmp(not_before_time_as_string, "--notbefore") == 0) {
			fprintf(stderr, "usage: %s [--html] [--notbefore <time-as-string>] <db-file-name>\n", argv[0]);
			exit(1);
		}
		filename=argv[3];
		if (strcmp(filename, "--html") == 0 || strcmp(filename, "--notbefore") == 0) {
			fprintf(stderr, "usage: %s [--html] [--notbefore <time-as-string>] <db-file-name>\n", argv[0]);
			exit(1);
		}

	} else if (argc == 5) {

		htmlflag=argv[1];
		if (strcmp(htmlflag, "--html") != 0) {
			fprintf(stderr, "usage: %s [--html] [--notbefore <time-as-string>] <db-file-name>\n", argv[0]);
			exit(1);
		}

		notbeforeflag=argv[2];
		if (strcmp(notbeforeflag, "--notbefore") != 0) {
			fprintf(stderr, "usage: %s [--html] [--notbefore <time-as-string>] <db-file-name>\n", argv[0]);
			exit(1);
		}

		output_as_html=TRUE;
		use_not_before_time_given_as_argument=TRUE;
		not_before_time_as_string=argv[3];
		if (strcmp(not_before_time_as_string, "--html") == 0 || strcmp(not_before_time_as_string, "--notbefore") == 0) {
			fprintf(stderr, "usage: %s [--html] [--notbefore <time-as-string>] <db-file-name>\n", argv[0]);
			exit(1);
		}
		filename=argv[4];
		if (strcmp(filename, "--html") == 0 || strcmp(filename, "--notbefore") == 0) {
			fprintf(stderr, "usage: %s [--html] [--notbefore <time-as-string>] <db-file-name>\n", argv[0]);
			exit(1);
		}

	} else {

		fprintf(stderr, "usage: %s [--html] [--notbefore <time-as-string>] <db-file-name>\n", argv[0]);
		exit(1);

	}


	/*
	 *	do we have a readable file?
	 */
	filehandle=fopen(filename, "r");
	if (filehandle == NULL) {
		fprintf(stderr, "%s: cannot open file \"%s\" for reading!\n", argv[0], filename);
		exit(1);
	}


	/*
	 *	compute the "not before" time
	 *	(for rejecting entries whose timestamps are ostensibly
	 *	earlier than this)
	 */
	if (use_not_before_time_given_as_argument) {
		strptime(not_before_time_as_string, "%a %b %d %H:%M:%S %Y", &not_before_time_as_struct_tm);
		not_before_time=mktime(&not_before_time_as_struct_tm);
		if (not_before_time == (time_t) -1) {
			fprintf(stderr, "%s: cannot interpret \"not before\" time \"%s\"!\n", argv[0], not_before_time_as_string);
			exit(1);
		}
	} else {
		not_before_time=0;
	}


	/*
	 *	get the current time
	 *	(for rejecting entries whose timestamps are ostensibly
	 *	in the future)
	 */
	current_time=time(NULL);
	if (current_time == (time_t) -1) {
		fprintf(stderr, "%s: cannot determine current time!\n", argv[0]);
		exit(1);
	}


	/*
	 *	OK, now the parsing proper!
	 */
	ch=getc(filehandle);

	while (ch != EOF) {
		/*
		 *	find a null character if there is one
		 */
		while (ch != EOF && ch != '\0') {
			ch=getc(filehandle);
		}

		if (ch=='\0') {
			/*
			 *	see if the next 4 bytes are a "sensible"
			 *	entry-timestamp
			 *	(defined as between the "not before" time
			 *	and the current time inclusive)
			 */
			ch=getc(filehandle); time0=ch;
			ch=getc(filehandle); time1=ch;
			ch=getc(filehandle); time2=ch;
			ch=getc(filehandle); time3=ch;
			db_file_entry_timestamp=time0+256*time1+256*256*time2+256*256*256*time3;

			if (db_file_entry_timestamp >= not_before_time && db_file_entry_timestamp <= current_time) {
				/*
				 *	read a further 12 bytes,
				 *	which seem to be meant to be
				 *	(4 bytes each):
				 *	another time-valued thing,
				 *	a counter of some sort,
				 *	another counter of some sort.(!)
				 *	But here we just zip past them all.
				 */
				for (count=0; count<12; count++) {
					ch=getc(filehandle);
				}

				/*
				 *	collect up what we hope is a
				 *	db-file-entry title part.
				 *	(we collect only "printable"
				 *	characters, defined as having
				 *	7-bit ascii values greater than
				 *	or equal to space.)
				 */
				ch=getc(filehandle);
				db_file_entry_title_position=0;

				while (ch != '\0' && ch != EOF) {
					if (db_file_entry_title_position < MAX_DB_FILE_ENTRY_TITLE_LENGTH && ch>=' ' && ch<=127) {
						db_file_entry_title[db_file_entry_title_position++]=ch;
					}
					ch=getc(filehandle);
				}
				db_file_entry_title[db_file_entry_title_position]='\0';

				/*
				 *	Convert an empty title to "Untitled".
				 */
				if (strcmp(db_file_entry_title, "") == 0) {
					strcpy(db_file_entry_title, "Untitled");
				}

				/*
				 *	see if we then have a "sensible"
				 *	db-file-entry URL part.
				 *	(defined as starting with an
				 *	alphanumeric character:
				 *	OK, not an ideal definition!)
				 */
				ch=getc(filehandle);
				if (isalnum(ch)) {
					/*
					 *	collect up this supposedly
					 *	"sensible" db-file-entry
					 *	URL part.
					 *	(we collect only "printable"
					 *	characters, defined as having
					 *	7-bit ascii values greater than
					 *	or equal to space.)
					 */
					db_file_entry_URL_position=0;

					while (ch != '\0' && ch != EOF) {
						if (db_file_entry_URL_position < MAX_DB_FILE_ENTRY_URL_LENGTH && ch>=' ' && ch<=127) {
							db_file_entry_URL[db_file_entry_URL_position++]=ch;
						}
						ch=getc(filehandle);
					}
					db_file_entry_URL[db_file_entry_URL_position]='\0';

					/*
					 *	OK, we're now ready to print
					 *	out the current line.
					 */
					if (output_as_html) {
						printf("%d\t<LI> <A HREF=\"", db_file_entry_timestamp);
						for (i=db_file_entry_URL; *i != '\0'; i++) {
							switch (*i) {
							case '"' :
								printf("%%22");
								break;
							default :
								putchar(*i);
								break;
							}
						}
						printf("\">");
						for (i=db_file_entry_title; *i != '\0'; i++) {
							switch (*i) {
							case '<' :
								printf("&lt;");
								break;
							case '>' :
								printf("&gt;");
								break;
							default :
								putchar(*i);
								break;
							}
						}
						printf(" <I>(");
						for (i=db_file_entry_URL; *i != '\0'; i++) {
							switch (*i) {
							case '<' :
								printf("&lt;");
								break;
							case '>' :
								printf("&gt;");
								break;
							default :
								putchar(*i);
								break;
							}
						}
						printf(")</I></A> <I> - ");
						for (i=ctime(&db_file_entry_timestamp); *i != '\n' && *i != '\0'; i++) {
							putchar(*i);
						}
						printf("</I> </LI>\n");
					} else {
						printf("%d\t", db_file_entry_timestamp);
						for (i=ctime(&db_file_entry_timestamp); *i != '\n' && *i != '\0'; i++) {
							putchar(*i);
						}
						printf("\t%s\t%s\n", db_file_entry_URL, db_file_entry_title);
					}
				}
			}
		}
	}
}
@


1.13
log
@better choices of logical vs. physical HTML styles.
@
text
@d10 1
a10 1
 *	usage: dbparse [-html] [-notbefore <time-as-string>] <db-file-name>
d17 1
a17 1
 *	Output format *without* -html flag is one entry per line, like this:
d21 1
a21 1
 *	Output format *with* -html flag is one entry per line, like this:
d31 1
a31 1
 *	In the -html format, '"' characters in the first displaying of the URL
d80 2
a81 2
		if (strcmp(filename, "-html") == 0 || strcmp(filename, "-notbefore") == 0) {
			fprintf(stderr, "usage: %s [-html] [-notbefore <time-as-string>] <db-file-name>\n", argv[0]);
d88 2
a89 2
		if (strcmp(htmlflag, "-html") != 0) {
			fprintf(stderr, "usage: %s [-html] [-notbefore <time-as-string>] <db-file-name>\n", argv[0]);
d96 2
a97 2
		if (strcmp(filename, "-html") == 0 || strcmp(filename, "-notbefore") == 0) {
			fprintf(stderr, "usage: %s [-html] [-notbefore <time-as-string>] <db-file-name>\n", argv[0]);
d104 2
a105 2
		if (strcmp(notbeforeflag, "-notbefore") != 0) {
			fprintf(stderr, "usage: %s [-html] [-notbefore <time-as-string>] <db-file-name>\n", argv[0]);
d112 2
a113 2
		if (strcmp(not_before_time_as_string, "-html") == 0 || strcmp(not_before_time_as_string, "-notbefore") == 0) {
			fprintf(stderr, "usage: %s [-html] [-notbefore <time-as-string>] <db-file-name>\n", argv[0]);
d117 2
a118 2
		if (strcmp(filename, "-html") == 0 || strcmp(filename, "-notbefore") == 0) {
			fprintf(stderr, "usage: %s [-html] [-notbefore <time-as-string>] <db-file-name>\n", argv[0]);
d125 2
a126 2
		if (strcmp(htmlflag, "-html") != 0) {
			fprintf(stderr, "usage: %s [-html] [-notbefore <time-as-string>] <db-file-name>\n", argv[0]);
d131 2
a132 2
		if (strcmp(notbeforeflag, "-notbefore") != 0) {
			fprintf(stderr, "usage: %s [-html] [-notbefore <time-as-string>] <db-file-name>\n", argv[0]);
d139 2
a140 2
		if (strcmp(not_before_time_as_string, "-html") == 0 || strcmp(not_before_time_as_string, "-notbefore") == 0) {
			fprintf(stderr, "usage: %s [-html] [-notbefore <time-as-string>] <db-file-name>\n", argv[0]);
d144 2
a145 2
		if (strcmp(filename, "-html") == 0 || strcmp(filename, "-notbefore") == 0) {
			fprintf(stderr, "usage: %s [-html] [-notbefore <time-as-string>] <db-file-name>\n", argv[0]);
d151 1
a151 1
		fprintf(stderr, "usage: %s [-html] [-notbefore <time-as-string>] <db-file-name>\n", argv[0]);
@


1.12
log
@changed comment to no longer assume a Netscape-style database file will
 necessarily have the suffix ".db":

>  *    (Historically one recognized such files by Netscape giving them
>  *    the extension ".db", although version 4.6 for Linux seems to use
>  *    "history.dat" as its history database file,
>  *    despite "history.db" being specified in the preferences.)
@
text
@d24 1
a24 1
 *		[db-file-entry-title] <EM>([db-file-entry-URL])</EM>
d26 1
a26 1
 *	     <EM> - [timestamp-as-string]</EM>
d320 1
a320 1
						printf(" <EM>(");
d334 1
a334 1
						printf(")</EM></A> <EM> - ");
d338 1
a338 1
						printf("</EM> </LI>\n");
@


1.11
log
@took steps to avoid unwanted "HTML meta-character interpretations" by browsers:

>  *    In the -html format, '"' characters in the first displaying of the URL
>  *    (the giving of it as an anchor) are rendered as "%22";
>  *    and similarly, "<" and ">" characters in the title and the
>  *    subsequent (second) displaying of the URL are rendered as
>  *    "&lt;" and "&gt;" respectively. With these renderings we avoid unwanted
>  *    "HTML meta-character interpretations" by browsers, which could
>  *    potentially mess up the display of the rest of the page.
@
text
@d3 5
a7 1
 *	parses, as best it can, a Netscape-style ".db" file.
@


1.10
log
@MAJOR REVISION:
 * added a "not before" facility, where one can specify a time (as a string)
   that only entries with timestamps between that time and the current time
   inclusive are displayed. (Default value is the Unix big bang.)

Plus:
 * layout, comment and error message improvements.
@
text
@d27 8
d291 40
a330 1
						printf("%d\t<LI> <A HREF=\"%s\">%s <EM>(%s)</EM></A> <EM> - ", db_file_entry_timestamp, db_file_entry_URL, db_file_entry_title, db_file_entry_URL);
@


1.9
log
@new (and unfortunately more complicated and flaky!) protocol,
 representing my best effort to understand the Netscape 4.06 history
 database file format - as with the previous format, I'm guessing at it
 empirically.
(The main change is each entry now has a title as well as a URL.)
@
text
@d6 6
a11 1
 *	usage: dbparse [-html] <db-file-name>
d50 4
a53 2
	time_t db_file_entry_timestamp, current_time;
	char *htmlflag, *filename, *i;
d56 1
a56 1
	bool output_as_html;
d59 1
d64 1
d66 1
d68 2
a69 2
		if (strcmp(filename, "-html") == 0) {
			fprintf(stderr, "usage: %s [-html] <db-file-name>\n", argv[0]);
d72 1
d74 1
d77 1
a77 1
			fprintf(stderr, "usage: %s [-html] <db-file-name>\n", argv[0]);
d82 1
d84 53
d138 2
a139 1
		fprintf(stderr, "usage: %s [-html] <db-file-name>\n", argv[0]);
d141 1
d144 1
d150 1
a150 1
		fprintf(stderr, "%s: cannot open file %s for reading!\n", argv[0], filename);
d154 1
d156 18
a173 1
	 *	get current time
d183 1
d201 2
a202 2
			 *	(defined as positive and less than or equal to
			 *	the current time)
d210 1
a210 1
			if (db_file_entry_timestamp > 0 && db_file_entry_timestamp <= current_time) {
@


1.8
log
@better argument handling
used isalnum() to test for when a character is alphanumeric.
@
text
@d9 2
a10 2
 *	numeric-timestamp [TAB]
 *	timestamp-as-string [TAB] db-file-entry [NEWLINE].
d14 3
a16 1
 *	<LI> <A HREF="[db-file-entry]">[db-file-entry]</A>
d20 3
d37 2
a38 1
#define MAX_DB_FILE_ENTRY_LENGTH	65536
d43 2
a44 1
	int ch, time0, time1, time2, time3, db_file_entry_position;
d47 2
a48 1
	char db_file_entry[MAX_DB_FILE_ENTRY_LENGTH+1];
d124 39
d164 1
a164 1
				 *	db-file-entry.
d172 3
a174 1
					 *	collect up this db-file-entry.
d180 1
a180 1
					db_file_entry_position=0;
d183 2
a184 2
						if (db_file_entry_position < MAX_DB_FILE_ENTRY_LENGTH && ch>=' ' && ch<=127) {
							db_file_entry[db_file_entry_position++]=ch;
d188 1
a188 1
					db_file_entry[db_file_entry_position]='\0';
a193 2
					printf("%d\t", db_file_entry_timestamp);

d195 1
a195 1
						printf("<LI> <A HREF=\"%s\">%s</A> <EM> - ", db_file_entry, db_file_entry);
d201 1
d205 1
a205 1
						printf("\t%s\n", db_file_entry);
@


1.7
log
@standardized arguments to main().
@
text
@d21 1
d50 4
d123 1
a123 1
				if (ch>='a' && ch<='z' || ch>='A' && ch<='Z' || ch>='0' && ch<='9') {
@


1.6
log
@nicer output format in -html case, separating each entry and its timestamp
 more clearly.
@
text
@d34 1
a34 1
void main(int argc, char **argv)
@


1.5
log
@further comment and variable name improvements.
@
text
@d15 1
a15 1
 *	     <EM>[timestamp-as-string]</EM>
d143 1
a143 1
						printf("<LI> <A HREF=\"%s\">%s</A> <EM>", db_file_entry, db_file_entry);
@


1.4
log
@implemented the -html flag, which was previously ignored
better definitions of printable characters, sensible entries,
 and sensible entry-timestamps
layout, comment, and variable name improvements.
@
text
@d9 2
a10 1
 *	numeric-time [TAB] time-as-string [TAB] db-file-entry [NEWLINE].
d13 1
a13 1
 *	numeric-time [TAB]
d15 1
a15 1
 *	     <EM>[time-as-string]</EM>
d37 1
a37 1
	time_t db_file_entry_time, current_time;
d74 2
a75 1
	 *	(for rejecting entries apparently in the future)
d98 2
a99 1
			 *	see if the next 4 bytes are a "sensible" time
d107 1
a107 1
			db_file_entry_time=time0+256*time1+256*256*time2+256*256*256*time3;
d109 1
a109 1
			if (db_file_entry_time > 0 && db_file_entry_time <= current_time) {
d140 1
a140 1
					printf("%d\t", db_file_entry_time);
d144 1
a144 1
						for (i=ctime(&db_file_entry_time); *i != '\n' && *i != '\0'; i++) {
d149 1
a149 1
						for (i=ctime(&db_file_entry_time); *i != '\n' && *i != '\0'; i++) {
@


1.3
log
@upgraded to argument-based usage: dbparse [-html] <db-file-name>
 (although the -html flag is not yet implemented, and so is ignored).
@
text
@a17 1
 *	      Also, the -html flag is currently ignored (not implemented yet!).
d23 2
d30 2
d35 2
a36 2
	int ch, time0, time1, time2, time3;
	time_t time;
d38 1
d42 3
d62 3
d71 8
a78 3
	if (output_as_html) {
		fprintf(stderr, "(%s: warning: -html flag not yet implemented, ignoring)\n", argv[0]);
		/* but don't exit! */
d81 3
d87 3
d93 1
d95 5
d104 10
a113 2
			time=time0+256*time1+256*256*time2+256*256*256*time3;
			if (time > 0) {
d115 9
a123 2
				if (ch>='a' && ch<='z') {
					printf("%d\t", time);
d125 5
a129 2
					for (i=ctime(&time); *i != '\n' && *i != '\0'; i++) {
						putchar(*i);
d131 1
a131 1
					putchar('\t');
d133 15
a147 3
					while (ch != '\0' && ch != EOF) {
						if (ch<=127) {
							putchar(ch);
d149 1
a149 1
						ch=getc(filehandle);
a150 1
					putchar('\n');
@


1.2
log
@better format for chronological sorting if this is desired:
 numeric time first, then time as a string, then the actual entry.
 (Can be sorted with sort -n.)
Plus:
 * separated fields by tabs for ease of post-processing
 * times must now be positive, rather than merely non-zero, for printing
 * made sure single-character buffer is always up to date
   (otherwise you can sometimes get stuck at end-of-file reading forever!)
 * explained output format in a comment
 * layout and comment tidyups generally.
@
text
@d3 2
a4 2
 *	parses, as best it can, a Netscape-style ".db" file supplied on the
 *	standard input. It writes to the standard output.
d6 10
a15 2
 *	Output format is one entry per line, like this:
 *	numeric-time <TAB> time-as-string <TAB> db-file-entry <NEWLINE>.
d18 1
d22 1
d25 6
a30 1
void main()
d32 1
a32 1
	int ch=getchar(), time0, time1, time2, time3;
d34 33
a66 1
	char *i;
d70 1
a70 1
			ch=getchar();
d73 4
a76 4
			ch=getchar(); time0=ch;
			ch=getchar(); time1=ch;
			ch=getchar(); time2=ch;
			ch=getchar(); time3=ch;
d79 1
a79 1
				ch=getchar();
d92 1
a92 1
						ch=getchar();
@


1.1
log
@Initial revision
@
text
@d6 4
a9 1
 *	This source code is not very polished.
d26 4
a29 4
			time0=getchar();
			time1=getchar();
			time2=getchar();
			time3=getchar();
d31 1
a31 1
			if (time != 0) {
d34 2
d39 2
a40 1
					putchar(' ');
@
