Category : C Source Code
Archive   : PGP20SRC.ZIP
Filename : CONFIG.C

 
Output of file : CONFIG.C contained in archive : PGP20SRC.ZIP
/* config.c - config file parser by Peter Gutmann
Parses config file for PGP

Modified 24 Jun 92 - HAJK
Misc fixes for VAX C restrictions.

*/

#include
#include
#include
#include
#include "usuals.h"
#include "pgp.h"
/* The external config variables we can set here are referenced in pgp.h */

/* Return values */

#define ERROR -1
#define OK 0

/* The types of error we check for */

enum { NO_ERROR, ILLEGAL_CHAR_ERROR, LINELENGTH_ERROR };

#define CPM_EOF 0x1A /* ^Z = CPM EOF char */

#define MAX_ERRORS 3 /* Max.no.errors before we give up */

#define LINEBUF_SIZE 100 /* Size of input buffer */

int line; /* The line on which an error occurred */
int errCount; /* Total error count */
boolean hasError; /* Whether this line has an error in it */

/* The settings parsed out by getAssignment() */

char str[ LINEBUF_SIZE ];
int value;
boolean flag;

/* A .CFG file roughly follows the format used in the world-famous HPACK
archiver and is as follows:

- Leading spaces/tabs (whitespace) are ignored.

- Lines with a '#' as the first non-whitespace character are treated as
comment lines.

- All other lines are treated as config options for the program.

- Lines may be terminated by either linefeeds, carriage returns, or
carriage return/linefeed pairs (the latter being the DOS default method
of storing text files).

- Config options have the form:

  3 Responses to “Category : C Source Code
Archive   : PGP20SRC.ZIP
Filename : CONFIG.C

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/