home *** CD-ROM | disk | FTP | other *** search
- /* This source file is part of the LynxLib miscellaneous library by
- Robert Fischer, and is Copyright 1990 by Robert Fischer. It costs no
- money, and you may not make money off of it, but you may redistribute
- it. It comes with ABSOLUTELY NO WARRANTY. See the file LYNXLIB.DOC
- for more details.
- To contact the author:
- Robert Fischer \\80 Killdeer Rd \\Hamden, CT 06517 USA
- (203) 288-9599 fischer-robert@cs.yale.edu */
-
- /* Standard definitions to use -- boolean variables, etc */
- #ifndef STDDEF_H
- #define STDDEF_H
-
- typedef unsigned long LONG;
- typedef unsigned WORD;
- typedef unsigned char BYTE;
- typedef unsigned char SHORT;
- typedef void VOID;
-
- #define MAXINT 0xFFFF
- #define MAXLONG 0xFFFFFFFF
-
- #define NULL ((char *)0)
- #ifndef NIL
- #define NIL '\0'
- #endif
-
- typedef char BOOLEAN;
- #define FALSE 0
- #define TRUE (!FALSE)
-
- typedef VOID (func)();
- typedef int (ifunc)();
- typedef LONG (lfunc)();
-
- /* Inclusive between macro */
- #define IBETWEEN(x, a, b) (((x) >= (a) && (x) <= (b)) ? TRUE : FALSE)
- /* Exclusive between macro */
- #define EBETWEEN(x, a, b) (((x) > (a) && (x) < (b)) ? TRUE : FALSE)
-
- extern char *malloc();
- extern char *lmalloc();
- extern char *realloc();
- extern char *lrealloc();
-
- typedef struct { int w,h; } wh;
- typedef struct { int x,y; } xy;
- typedef struct { int x,y,w,h; } xywh;
- typedef struct { int x,y,x1,y1; } xyxy;
- typedef struct { int x,y,x1,y1,x2,y2,x3,y3; } xyxyxyxy;
-
- #define XYWH_PTR(a) &a.x, &a.y, &a.w, &a.h
- #define XYXY_PTR(a) &a.x, &a.y, &a.x1, &a.y1
- #define XY_PTR(a) &a.x, &a.y
- #define WH_PTR(a) &a.w, &a.h
- #define XYXYXYXY_PTR(a) &a.x, &a.y, &a.x1, &a.y1, &a.x2, &a.y2, &a.x3, &a.y3
- #define MAX(a, b) ((a) > (b) ? (a) : (b))
- #define MIN(a, b) ((a) < (b) ? (a) : (b))
-
- #define new(p) ((p) = malloc(sizeof(*p))) /* Like Pascal's new */
-
- extern long peekl();
-
- #define MAXPATH 128 /* Maximum path length */
- #define MAXLEAF 12 /* Length of leaf name */
- #define MAXROOT 8 /* Length of root name */
- #define MAXEXT 3 /* Length of extender */
-
- /* Following defs have 2 extra bytes for null terminator and "extra" char */
- typedef char fle_name[MAXPATH+2]; /* Full path name */
- typedef char leaf_name[MAXLEAF+2]; /* The full leaf name */
- typedef char file_root[MAXROOT+2]; /* First eight characters */
- typedef char file_extender[MAXEXT+2]; /* The file extender */
- #endif
-