home *** CD-ROM | disk | FTP | other *** search
/ GEMini Atari / GEMini_Atari_CD-ROM_Walnut_Creek_December_1993.iso / zip / program / lynxlib.zoo / stddef.h < prev    next >
C/C++ Source or Header  |  1991-01-27  |  2KB  |  75 lines

  1. /* This source file is part of the LynxLib miscellaneous library by
  2. Robert Fischer, and is Copyright 1990 by Robert Fischer.  It costs no
  3. money, and you may not make money off of it, but you may redistribute
  4. it.  It comes with ABSOLUTELY NO WARRANTY.  See the file LYNXLIB.DOC
  5. for more details.
  6. To contact the author:
  7.     Robert Fischer \\80 Killdeer Rd \\Hamden, CT   06517   USA
  8.     (203) 288-9599     fischer-robert@cs.yale.edu                 */
  9.  
  10. /* Standard definitions to use -- boolean variables, etc */
  11. #ifndef STDDEF_H
  12. #define STDDEF_H
  13.  
  14. typedef unsigned long LONG;
  15. typedef unsigned WORD;
  16. typedef unsigned char BYTE;
  17. typedef unsigned char SHORT;
  18. typedef void VOID;
  19.  
  20. #define MAXINT 0xFFFF
  21. #define MAXLONG 0xFFFFFFFF
  22.  
  23. #define NULL ((char *)0)
  24. #ifndef NIL
  25. #define NIL '\0'
  26. #endif
  27.  
  28. typedef char BOOLEAN;
  29. #define FALSE 0
  30. #define TRUE (!FALSE)
  31.  
  32. typedef VOID (func)();
  33. typedef int (ifunc)();
  34. typedef LONG (lfunc)();
  35.  
  36. /* Inclusive between macro */
  37. #define IBETWEEN(x, a, b) (((x) >= (a) && (x) <= (b)) ? TRUE : FALSE)
  38. /* Exclusive between macro */
  39. #define EBETWEEN(x, a, b) (((x) > (a) && (x) < (b)) ? TRUE : FALSE)
  40.  
  41. extern char *malloc();
  42. extern char *lmalloc();
  43. extern char *realloc();
  44. extern char *lrealloc();
  45.  
  46. typedef struct { int w,h; } wh;
  47. typedef struct { int x,y; } xy;
  48. typedef struct { int x,y,w,h; } xywh;
  49. typedef struct { int x,y,x1,y1; } xyxy;
  50. typedef struct { int x,y,x1,y1,x2,y2,x3,y3; } xyxyxyxy;
  51.  
  52. #define XYWH_PTR(a) &a.x, &a.y, &a.w, &a.h
  53. #define XYXY_PTR(a) &a.x, &a.y, &a.x1, &a.y1
  54. #define XY_PTR(a) &a.x, &a.y
  55. #define WH_PTR(a) &a.w, &a.h
  56. #define XYXYXYXY_PTR(a) &a.x, &a.y, &a.x1, &a.y1, &a.x2, &a.y2, &a.x3, &a.y3
  57. #define MAX(a, b) ((a) > (b) ? (a) : (b))
  58. #define MIN(a, b) ((a) < (b) ? (a) : (b))
  59.  
  60. #define new(p) ((p) = malloc(sizeof(*p)))   /* Like Pascal's new */
  61.  
  62. extern long peekl();
  63.  
  64. #define MAXPATH 128                   /* Maximum path length */
  65. #define MAXLEAF 12                    /* Length of leaf name */
  66. #define MAXROOT 8                     /* Length of root name */
  67. #define MAXEXT 3                      /* Length of extender */
  68.  
  69. /* Following defs have 2 extra bytes for null terminator and "extra" char */
  70. typedef char fle_name[MAXPATH+2];     /* Full path name */
  71. typedef char leaf_name[MAXLEAF+2];    /* The full leaf name */
  72. typedef char file_root[MAXROOT+2];    /* First eight characters */
  73. typedef char file_extender[MAXEXT+2]; /* The file extender */
  74. #endif
  75.