home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / cawf407.zip / src / proto.h < prev    next >
C/C++ Source or Header  |  1993-12-28  |  5KB  |  125 lines

  1. /*
  2.  *    proto.h - function prototype definitions for cawf(1)
  3.  */
  4.  
  5. /*
  6.  *    Copyright (c) 1991 Purdue University Research Foundation,
  7.  *    West Lafayette, Indiana 47907.  All rights reserved.
  8.  *
  9.  *    Written by Victor A. Abell <abe@mace.cc.purdue.edu>,  Purdue
  10.  *    University Computing Center.  Not derived from licensed software;
  11.  *    derived from awf(1) by Henry Spencer of the University of Toronto.
  12.  *
  13.  *    Permission is granted to anyone to use this software for any
  14.  *    purpose on any computer system, and to alter it and redistribute
  15.  *    it freely, subject to the following restrictions:
  16.  *
  17.  *    1. The author is not responsible for any consequences of use of
  18.  *       this software, even if they arise from flaws in it.
  19.  *
  20.  *    2. The origin of this software must not be misrepresented, either
  21.  *       by explicit claim or by omission.  Credits must appear in the
  22.  *       documentation.
  23.  *
  24.  *    3. Altered versions must be plainly marked as such, and must not
  25.  *       be misrepresented as being the original software.  Credits must
  26.  *       appear in the documentation.
  27.  *
  28.  *    4. This notice may not be removed or altered.
  29.  */
  30.  
  31. #include "ansi.h"
  32.  
  33. #ifdef    UNIX
  34. # ifdef    USG
  35. #include <string.h>
  36. # else    /* not USG */
  37. #include <strings.h>
  38. # endif    /* USG */
  39. #else    /* not UNIX */
  40. #include <string.h>
  41. #endif    /* UNIX */
  42.  
  43. /*
  44.  * The following conditional rat's nest intends to:
  45.  *
  46.  * for MS-DOS    #include <stdlib.h> and <malloc.h>.  <stdlib.h> exists in
  47.  *        MS-DOS so the STDLIB symbol should be defined and UNIX
  48.  *        shouldn't be.
  49.  *
  50.  * for Unix    #include <stdlib.h> if the STDLIB symbol is defined.  If
  51.  *        STDLIB isn't defined, define a prototype for getenv().
  52.  *        If the UNIX symbol is defined (and it should be) and if
  53.  *        the MALLOCH symbol is defined, #include <malloc.h>; else
  54.  *        define a prototype for malloc() if UNIX is defined and
  55.  *        MALLOCH isn't.  (The Unix <stdlib.h> usually defines the
  56.  *        malloc() prototype.)
  57.  *
  58.  * for ???    Define a prototype for getenv() and #include <malloc.h>
  59.  *        if neither STDLIB nor UNIX are defined.  (What system is
  60.  *        this?)
  61.  */
  62.  
  63. #ifdef    STDLIB
  64. #include <stdlib.h>
  65. # ifndef    UNIX
  66. #include <malloc.h>
  67. # endif        /* UNIX */
  68. #else    /* not STDLIB */
  69. _PROTOTYPE(char *getenv,(char *name));
  70. # ifdef    UNIX
  71. #  ifdef    MALLOCH
  72. #include <malloc.h>
  73. #  else        /* not MALLOCH */
  74. _PROTOTYPE(char *malloc,(unsigned size));
  75. #  endif    /* MALLOCH */
  76. # else    /* not UNIX */
  77. #include <malloc.h>
  78. # endif    /* UNIX */
  79. #endif    /* STDLIB */
  80.  
  81. #define Charput(s) { \
  82.     if (!Divert && Pageprt) \
  83.         { (void) fwrite((char *)s, 1, 1, stdout); } }
  84.  
  85. _PROTOTYPE(unsigned char *Asmcode,(unsigned char **s, unsigned char *c));
  86. _PROTOTYPE(int Asmname,(unsigned char *s, unsigned char *c));
  87. _PROTOTYPE(char *AsmPg,(char *s, int *n));
  88. _PROTOTYPE(int AsmPgRange,(char *s));
  89. _PROTOTYPE(void Delmacro,(int mx));
  90. _PROTOTYPE(int Defdev,(void));
  91. _PROTOTYPE(void Delnum,(int nx));
  92. _PROTOTYPE(void Delstr,(int sx));
  93. _PROTOTYPE(void Endword,(void));
  94. _PROTOTYPE(void Error,(int t, int l, char *s1, char *s2));
  95. _PROTOTYPE(void Error3,(int len, char *word, char *sarg, int narg, char *msg));
  96. _PROTOTYPE(void Expand,(unsigned char *line));
  97. _PROTOTYPE(unsigned char *Field,(int n, unsigned char *p, int c));
  98. _PROTOTYPE(int Findchar,(unsigned char *nm, int l, unsigned char *s, int e));
  99. _PROTOTYPE(int Findhy,(unsigned char *s, int l, int e));
  100. _PROTOTYPE(int Findmacro,(unsigned char *p, int e));
  101. _PROTOTYPE(int Findnum,(unsigned char *n, int v, int e));
  102. _PROTOTYPE(int Findparms,(unsigned char *n));
  103. _PROTOTYPE(int Findscale,(int n, double v, int e));
  104. _PROTOTYPE(unsigned char *Findstr,(unsigned char *nm, unsigned char *s, int e));
  105. _PROTOTYPE(void Free,(unsigned char **p));
  106. _PROTOTYPE(int getopt,(int argc, char **argv, char *opts));
  107. _PROTOTYPE(int LenprtHF,(unsigned char *s, int p, int t, unsigned char **b, int bl));
  108. _PROTOTYPE(int main,(int argc, char *argv[]));
  109. _PROTOTYPE(void Macro,(unsigned char *inp));
  110. _PROTOTYPE(unsigned char *Newstr,(unsigned char *s));
  111. _PROTOTYPE(void Nreq,(unsigned char *line, int brk));
  112. _PROTOTYPE(unsigned char *Newstr,(unsigned char *s));
  113. _PROTOTYPE(int PageInRange,(int pg));
  114. _PROTOTYPE(void Pass2,(unsigned char *line));
  115. _PROTOTYPE(void Pass3,(int len, unsigned char *word, int wx, unsigned char *sarg, int narg));
  116. _PROTOTYPE(unsigned char *reg,(int paren, int *flagp));
  117. _PROTOTYPE(unsigned char *regatom,(int *flagp));
  118. _PROTOTYPE(unsigned char *regbranch,(int *flagp));
  119. _PROTOTYPE(regexp *regcomp,(char *exp));
  120. _PROTOTYPE(void regdump,(regexp *r));
  121. _PROTOTYPE(void regerror,(char *s));
  122. _PROTOTYPE(int regexec,(regexp *prog, unsigned char *string));
  123. _PROTOTYPE(void Stringput,(unsigned char *s, int len));
  124. _PROTOTYPE(int Str2word,(unsigned char *s, int len));
  125.