home *** CD-ROM | disk | FTP | other *** search
/ Mega CD-ROM 1 / megacd_rom_1.zip / megacd_rom_1 / POSTSCRI / PSFIX.ZIP / STRLIB.H < prev    next >
C/C++ Source or Header  |  1991-03-28  |  3KB  |  163 lines

  1. /*
  2.  *
  3.  *  include file for strlib.c
  4.  *
  5.  */
  6.  
  7. /*
  8.  * This software may be freely distributed under the following conditions:
  9.  *         1. It is distributed in its current form, without alterations.
  10.  *         2. No monetary profit is made, under any circumstances.
  11.  *
  12.  *             Marc A. Murison
  13.  *             Smithsonian Astrophysical Observatory
  14.  *             60 Garden Street, MS 63
  15.  *             Cambridge, MA  02138
  16.  *
  17.  *             (617) 495-7079      murison@cfacx2.harvard.edu
  18.  */
  19.  
  20.  
  21. #ifndef  STRLIB_H
  22. #define  STRLIB_H
  23.  
  24. #include "mydefs.h"
  25.  
  26. #ifdef    STRLIB_C            /* stuff specific to strlib.c only */
  27.  
  28. #ifndef STDIO_H
  29. #define STDIO_H
  30. #include  <stdio.h>
  31. #endif
  32.  
  33. #ifndef STDLIB_H
  34. #define STDLIB_H
  35. #include <stdlib.h>
  36. #endif
  37.  
  38. #ifndef STRING_H
  39. #define STRING_H
  40. #include <string.h>
  41. #endif
  42.  
  43. #ifndef CTYPE_H
  44. #define CTYPE_H
  45. #include <ctype.h>
  46. #endif
  47.  
  48. #ifndef STDARG_H
  49. #define STDARG_H
  50. #include  <stdarg.h>
  51. #endif
  52.  
  53. #if __MSDOS__
  54.  
  55. #ifndef DOS_H
  56. #define DOS_H
  57. #include <dos.h>
  58. #endif
  59.  
  60. #ifndef CONIO_H
  61. #define CONIO_H
  62. #include <conio.h>
  63. #endif
  64.  
  65. #endif
  66.  
  67.  
  68. #include "vectdef.h"
  69.  
  70.  
  71. #define  TEXT_ROWS    25        /* rows per screenful */
  72.  
  73.  
  74. /* valid key check for browse */
  75. #define  BROWSE_KEY( extended, c )                                      \
  76.         (                                                                \
  77.             (extended)    ||                    /* any extended key */        \
  78.             (                                 /* valid normal keys: */    \
  79.                 (c) == KEY_CR      ||                                         \
  80.                 (c) == KEY_SP    ||                                        \
  81.                 (                             /* quit keys: */            \
  82.                     (c) != KEY_ESCAPE    &&                                \
  83.                     (c) != KEY_q        &&                                \
  84.                     (c) != KEY_Q                                        \
  85.                 )                                                       \
  86.             )                                                         \
  87.         )
  88.  
  89.  
  90. /* macros for next_word and next_word_num */
  91. #define  WORD_CHAR( c )      ( isalnum(c)   ||  (c) == '_' )
  92.  
  93. #define  WORD_NUM_CHAR( c )  ( isalnum(c)   ||                        \
  94.                                (c) == '_'   ||  (c) == PERIOD  ||     \
  95.                                (c) == PLUS  ||  (c) == MINUS      )
  96.  
  97.  
  98. #endif        /* stuff specific to strlib.c */
  99.  
  100.  
  101. /* tab structure */
  102. typedef    struct    { long ntabs, nspaces; } Tab_Info;
  103.  
  104.  
  105.  
  106. /* strlib.c function prototypes */
  107.  
  108. #if __MSDOS__
  109. Boolean        browse( char *text, char *title );
  110. void        cprint_line( int crlf, char **text_ptr );
  111. #endif
  112.  
  113.  
  114. Boolean        next_line( char **bp );
  115.  
  116. Boolean        prev_line( char **bp, char *buffer );
  117.  
  118. Boolean        beg_line( char **bp, char *buffer );
  119.  
  120. Boolean        end_line( char **bp );
  121.  
  122. void          announce( char *version_string, char *date_string );
  123.  
  124. char         *upcase( char *string );
  125.  
  126. char         *dncase( char *string );
  127.  
  128. char          *itoh( int i, char *string );
  129.  
  130. char          *ltoh( long i, char *string );
  131.  
  132. char          itohc( int i );
  133.  
  134. char        *sflip( char *string );
  135.  
  136. char        *ljust( char *sp );
  137.  
  138. Tab_Info    expand_tabs( int n, char *in_ptr, char *out_ptr, long maxchars );
  139.  
  140. Boolean        next_word( char **bp, char *word, int *n );
  141.  
  142. Boolean        next_word_num( char **bp, char *word, int *n );
  143.  
  144. Boolean        is_blank( char *string );
  145.  
  146. void        print_msg( Boolean nextline, Boolean lineafter, int n, ... );
  147.  
  148. void        moreprint( char *string );
  149.  
  150. char        moreprint_pause( char *msg );
  151.  
  152. void          print_line(int crlf, char **text_ptr );
  153.  
  154. ulong         append_buff( char *source_buff, ulong N, char *dest_buff );
  155.  
  156. #ifndef NO_FLOAT
  157. void        parse_args(char string[], int *nargs, double args[] );
  158. #endif
  159.  
  160.  
  161. #endif
  162.  
  163.