home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / MISC / GNU / GPTX01AS.ZIP / GPTX.H < prev    next >
Encoding:
C/C++ Source or Header  |  1992-02-22  |  3.3 KB  |  144 lines

  1. /* Permuted index, with keywords in their context.
  2.    Copyright (C) 1990 Free Software Foundation, Inc.
  3.    Francois Pinard <pinard@iro.umontreal.ca>, 1988.
  4.  
  5.    $Id$
  6. */
  7.  
  8.  
  9. /* Some system dependant declarations.  */
  10.  
  11. #ifdef appolo
  12. /* Appolo C compiler knows about standard library prototypes, and this
  13.    knowledge conflicts with my declarations.  */
  14. #define STDLIB_PROTO_ALREADY
  15. #endif
  16.  
  17. #ifdef sparc
  18. /* Sparc machines require word alignment for each OCCURS structure.  */
  19. #define OCCURS_ALIGNMENT 4
  20. #endif
  21.  
  22.  
  23. /* Prototype macros.  */
  24.  
  25. #ifdef __STDC__
  26. #define PROTO(x) x
  27. #ifndef __GNUC__
  28. #define volatile
  29. #endif /* not __GNUC__ */
  30. #else /* not __STDC__ */
  31. #define PROTO(x) ()
  32. #define const
  33. #define volatile
  34. #endif /* not __STDC__ */
  35.  
  36.  
  37. /* Standard library prototypes.  */
  38.  
  39. #ifndef STDLIB_PROTO_ALREADY
  40.  
  41. #include <assert.h>
  42.  
  43. #ifdef MSDOS
  44.  
  45. #include <stdlib.h>
  46. #include <io.h>
  47. int getopt (int, char **, const char *);
  48.  
  49. #else /* not MSDOS */
  50.  
  51. #ifdef BUFSIZ            /* stdio dependant -- how ugly! */
  52. int        _filbuf PROTO ((FILE *));
  53. int        _flsbuf PROTO ((unsigned char, FILE *));
  54. #endif /* BUFSIZ */
  55. void volatile    abort PROTO ((void));
  56. int        atoi PROTO ((const char *));
  57. void        close PROTO ((int));
  58. void volatile    exit PROTO ((int));
  59. void        free PROTO ((void *));
  60. int        fstat PROTO ((int, struct stat *));
  61. int        getopt PROTO ((int, char **, const char *));
  62. int        open PROTO ((const char *, int));
  63. void        perror PROTO ((const char *));
  64. void        qsort PROTO ((void *, int, int, int ()));
  65. int        read PROTO ((int, void *, unsigned));
  66.  
  67. #endif /* not MSDOS */
  68.  
  69. #endif /* not STDLIB_PROTO_ALREADY */
  70.  
  71.  
  72. /* GNU library prototypes.  */
  73.  
  74. void *        xmalloc PROTO ((int));
  75. void *        xrealloc PROTO ((void *, int));
  76.  
  77. /* Local prototypes.  */
  78.  
  79. void        print_copyright PROTO ((void));
  80. void        print_version PROTO ((void));
  81.  
  82. /* Teach MS-DOS to handel long files */
  83.  
  84. #ifdef MSDOS
  85.  
  86. #if defined (_MSC_VER) && (_MSC_VER >= 600)
  87. #define HUGE _huge
  88. #else
  89. #define HUGE huge
  90. #endif
  91. #define LONG long
  92.  
  93. void HUGE *xhalloc (long size);
  94. void HUGE *xhrealloc (void HUGE *ptr, long new_size, long old_size);
  95. long hread (int fd, void HUGE *buffer, long bytes);
  96.  
  97. #if defined (M_I86CM) || defined (M_I86LM)
  98.  
  99. #define L_PDIFF(ptr1,ptr2) \
  100.   ((long)((char HUGE *)(ptr1) - (char HUGE *)(ptr2)))
  101.  
  102. #define I_PDIFF(ptr1,ptr2) \
  103.   (assert ((long)((char HUGE *)(ptr1) - (char HUGE *)(ptr2)) < (1L << 15)), \
  104.    ((int)(long)((char HUGE *)(ptr1) - (char HUGE *)(ptr2))))
  105.  
  106. extern int re_hsearch (struct re_pattern_buffer *pbufp, char HUGE *string,
  107.                long size, long startpos, long range,
  108.                struct re_registers *regs);
  109. extern int re_hmatch (struct re_pattern_buffer *pbufp, char HUGE *string,
  110.               long size, long pos, struct re_registers *regs);
  111.  
  112. /* We must mask re_search () and re_match () *after* the prototypes
  113.    in regex.h!  */
  114.  
  115. #include <regex.h>
  116.  
  117. #define re_search re_hsearch
  118. #define re_match re_hmatch
  119.  
  120. #define ZERO 0L
  121.  
  122. #else /* not M_I86CM and not M_I86LM */
  123.  
  124. #define L_PDIFF(ptr1,ptr2)    ((ptr1) - (ptr2))
  125. #define I_PDIFF(ptr1,ptr2)    ((ptr1) - (ptr2))
  126.  
  127. #define ZERO 0
  128.  
  129. #endif /* not M_I86CM and not M_I86LM */
  130.  
  131. #else /* not MSDOS */
  132.  
  133. #define HUGE
  134. #define LONG int
  135.  
  136. #define L_PDIFF(ptr1,ptr2)    ((ptr1) - (ptr2))
  137. #define I_PDIFF(ptr1,ptr2)    ((ptr1) - (ptr2))
  138.  
  139. #define ZERO 0
  140.  
  141. #endif /* not MSDOS */
  142.  
  143.  
  144.