Category : C Source Code
Archive   : SQLVER1.ZIP
Filename : DEFS.H

 
Output of file : DEFS.H contained in archive : SQLVER1.ZIP
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include

#define COMPILE 1

#define DEL "DEL" /* 1st attribute for each tuple. */
#define TRUE 1
#define EOH '' /* end of file header */
#define RECORD '' /* tuple delimiter */
#define FIELD '' /* field delimiter */
#define TAB ".TAB" /* extension used for all tables */
#define cls( ) printf("")

/****************************************************************************/

struct DATE {
int month,
day,
year,
dow;
};

/****************************************************************************/

struct TIME {
int hours,
minutes,
seconds,
hundredths;
int ampm:1;
};

/****************************************************************************/

struct DATA {
long value; /* number attribute for tuple if applicable */
char attribute[128]; /* field/attribute name */
int type, /* 0 character, 1 number */
order, /* what position in tuple */
length; /* size of field */
};

struct LIST {
struct DATA data;
struct LIST *rlist;
};

/* */
/****************************************************************************/
/* Function Prototypes */
/****************************************************************************/
struct DATE gdate (void);
struct TIME gtime (void);
void pdate (void);
void prompt (void);
struct LIST *attributelist (struct LIST *fieldlist);
struct LIST *createlist (struct LIST *list,
struct DATA data);
struct LIST *fields (FILE *fp);
struct LIST *fixattributes (struct LIST *selectlist,
struct LIST *fieldlist,
struct LIST *tablelist);
struct LIST *insertlist (struct LIST *list,
struct DATA data);
struct LIST *joinfields (char *tablename,
struct LIST *attributes,
int remove);
struct LIST *makelist (struct LIST *pointer);
struct LIST *readselect (char *string);
struct LIST *sequencelist (struct LIST *filelist,
struct LIST *fieldlist);
struct LIST *tablelistfields(struct LIST *tablelist);
struct LIST *usegarbage (void);
void copyjointuple (struct LIST *joinfield,
struct LIST *field,
struct LIST *jointuple,
struct LIST *tuple);
void copytuple (struct LIST *tuplelist,
struct LIST *constantlist,
struct LIST *fieldlist,
struct LIST *list);
void createtempfile (char *table);
void deletetuple (FILE *fp);
void join (struct LIST *tablelist,
struct LIST *selectlist,
int distinct,
char *temptable,
char *predicate);
void jointables (FILE *jointable,
struct LIST *joinheader,
struct LIST *jointuple,
struct LIST *tablelist,
char *predicate);
void makedistinct (char *table,
char *temptable,
char *predicate);
void maketable (char *table,
struct LIST *list);
void makeview (char *temptable,
char *table,
char *predicate);
void notspace (void);
void printerror (int error);
void printfile (char *table,
char *predicate);
void printheader (struct LIST *list);
void printlist (struct LIST *list);
void recycle (struct LIST *list);
void reordertable (struct LIST *list,
struct LIST *table,
int distinct,
char *temptable,
char *predicate);
void writetuple (struct LIST *datalist,
FILE *fp);
char *getdata (struct LIST *attribute,
struct LIST *tuple,
struct DATA *data,
char *ch);
char *getstring (char *string,
char *ch);
int checkcondition (char *string);
int checkdata (struct DATA value,
struct DATA value1);
int checkfields (struct LIST *filelist,
struct LIST *datalist);
int checktuple (struct LIST *tuplelist,
struct LIST *list,
char *predicate);
int command (char *string);
int comparison (char *string);
int create (char *table);
int createview (char *table);
int delete (char *table);
int file (char *table);
int getspredicate (char *predicate,
struct LIST *attributes,
struct LIST *tables);
int gettype (char *string,
struct LIST *attributes);
int getvalue (char *string,
struct LIST *attributes,
struct LIST *tables);
int insert (char *table);
int nfields (struct LIST *list);
int parse (char *string,
int cmdfile);
int readconstant (struct LIST *data,
int datatype,
int length);
int readfield (char *attribute,
struct LIST *attributes,
struct LIST *tables);
int readnumber (char *string);
int readstring (char *string);
int readtuple (struct LIST *tuple,
FILE *fp);
int scanner (char *string);
int select (char *table,
int viewfile,
struct LIST *column_names);
int shellcommand (char *commandstring);
int update (char *table);
/* */
/****************************************************************************/
/* KEYWORDS */
/****************************************************************************/

#define AND "AND"
#define AS "AS"
#define CHAR "CHAR"
#define CLS "CLS"
#define CREATE "CREATE"
#define DELETE "DELETE"
#define DISTINCT "DISTINCT"
#define DROP "DROP"
#define EXIT "EXIT"
#define FROM "FROM"
#define INSERT "INSERT"
#define INT "INT"
#define INTO "INTO"
#define OR "OR"
#define SELECT "SELECT"
#define SET "SET"
#define TABLE "TABLE"
#define UPDATE "UPDATE"
#define WHERE "WHERE"
#define VALUES "VALUES"
#define VIEW "VIEW"

/* */

  3 Responses to “Category : C Source Code
Archive   : SQLVER1.ZIP
Filename : DEFS.H

  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/