home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / mitsch75.zip / scheme-7_5_17-src.zip / scheme-7.5.17 / src / microcode / comlin.h < prev    next >
C/C++ Source or Header  |  1999-01-02  |  2KB  |  89 lines

  1. /* -*-C-*-
  2.  
  3. Copyright (c) 1987-1999 Massachusetts Institute of Technology
  4.  
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 2 of the License, or (at
  8. your option) any later version.
  9.  
  10. This program is distributed in the hope that it will be useful, but
  11. WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  13. General Public License for more details.
  14.  
  15. You should have received a copy of the GNU General Public License
  16. along with this program; if not, write to the Free Software
  17. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  18. */
  19.  
  20. /* $Id: comlin.h,v 1.7 1999/01/02 06:11:34 cph Exp $
  21.  *
  22.  * This file contains definitions for the scheme command parser.
  23.  *
  24.  */
  25.  
  26. #ifndef COMLIN_H_INCLUDED
  27. #define COMLIN_H_INCLUDED
  28.  
  29. #include "ansidecl.h"
  30.  
  31. #ifndef boolean
  32. #  define boolean    int
  33. #endif
  34. #ifndef true
  35. #  define true        1
  36. #endif
  37. #ifndef false
  38. #  define false        0
  39. #endif
  40.  
  41. typedef char *string;
  42.  
  43. /* Argument List Keyword Descriptor Structure */
  44.  
  45. #define LAST_KYWRD    0
  46. #define BOOLEAN_KYWRD    1
  47. #define INT_KYWRD    2
  48. #define DOUBLE_KYWRD    3
  49. #define STRING_KYWRD    4
  50.  
  51. #define BOOLEAN_LVALUE(struc)    ((boolean *) ((struc).data))
  52. #define INT_LVALUE(struc)    ((int *) ((struc).data))
  53. #define DOUBLE_LVALUE(struc)    ((double *) ((struc).data))
  54. #define STRING_LVALUE(struc)    ((string *) ((struc).data))
  55.  
  56. struct keyword_struct
  57. {
  58.   int        type_tag;
  59.   string    keyword;
  60.   long        *data;
  61.   string    format;
  62.   boolean    *supplied_p;
  63. };
  64.  
  65. #define KEYWORD(str, var, type, format, sup)                \
  66. {                                    \
  67.   type,                                    \
  68.   ((string) str),                            \
  69.   ((long *) var),                            \
  70.   format,                                \
  71.   sup                                    \
  72. }
  73.  
  74. #define END_KEYWORD()    KEYWORD("", NULL, LAST_KYWRD, NULL, NULL)
  75.  
  76. /* Fake boolean and string formats */
  77.  
  78. #define BFRMT    ((string) NULL)
  79. #define SFRMT    ((string) NULL)
  80.  
  81. /* Exports */
  82.  
  83. extern char *program_name;
  84.  
  85. extern void EXFUN (parse_keywords,
  86.            (int, char **, struct keyword_struct *, boolean));
  87.  
  88. #endif /* COMLIN_H_INCLUDED */
  89.