Category : C Source Code
Archive   : ARCSRC.ZIP
Filename : TOOLS.H

 
Output of file : TOOLS.H contained in archive : ARCSRC.ZIP
/******************************************************************************/
/* TOOLS.H: Definitions for type declarations, printing, bit handling, etc.
*/
typedef void *UNIV; /* Universal (i.e., undefined) pointer type. */
typedef char *STRING; /* String data type. */
typedef char UNCH; /* All characters are unsigned. */
typedef unsigned UNS; /* Simplifies changing int to unsigned. */

#define VOID void /* For compilers that don't support void yet. */
#define FILESPEC 2+64+1+8+4+(2) /* DOS: Maximum length of a file id + (2). */
#define ZAPEOL(cc) ((cc!=0&&cc!=9&&cc!=10&&cc!=13&&cc!=26&&cc!=28) ? cc : 168)

/* Macros for bit manipulation.
*/
#define SET(word, bits) ((word) |= (bits)) /* Turn bits on */
#define RESET(word, bits) ((word) &= ~(bits)) /* Turn bits off */
#define GET(word, bits) ((word) & (bits)) /* 1=any bit on */
#define BITOFF(word, bits) (GET(word, bits)==0) /* 1=no bits on */
#define BITON(word, bits) ((word) & (bits)) /* 1=any bit on */
#define BITNON(bits,n) ((bits) |= 1L<<((n)-1)) /* Turn on the nth bit. */
#define BITNIS(bits,n) (BITON((bits),(1L<<((n)-1))))/* Test the nth bit. */

/* Pointers (should work for big memory model).
*/
#define MINPTR ((struct etd *)10)/* Minimum value for real pointer. */
#define ETDCDATA ((struct etd *)1) /* Dummy etd pointer for #PCDATA. */
#define ETDNULL ((struct etd *)2) /* Dummy etd pointer for null tag. */
#define ETDNET ((struct etd *)3) /* Dummy etd pointer for NET delimiter. */
#define STRNULL ((UNCH *)2) /* Dummy pointer for null string. */

#define ITOAMAX 3 /* Max digits that itoa() can handle. */
/******************************************************************************/


  3 Responses to “Category : C Source Code
Archive   : ARCSRC.ZIP
Filename : TOOLS.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/