home *** CD-ROM | disk | FTP | other *** search
/ High Voltage Shareware / high1.zip / high1 / DIR9 / WIZTOO.ZIP / CHNLSPEC.H < prev    next >
C/C++ Source or Header  |  1993-09-20  |  2KB  |  74 lines

  1. #ifndef _chnspec_h_
  2. #define _chnspec_h_
  3.  
  4. //  Module: CHNSPEC.H
  5.  
  6. //                                                   September 20, 1993
  7. //                                                   Fairfield, Iowa
  8.  
  9. //          Aerosoft  (R)  Broadcast Channel Wizard   Version 1.0
  10. //          Copyright (c)  Aerosoft 1993     All rights reserved.
  11.  
  12. //          This software source code is FREEWARE.  You may be use the
  13. //          source code or redistribute the source code free of charge.
  14. //          However, you cannot sell this source code or any alteration of
  15. //          the source code.
  16.  
  17. //  This module declares the classes ArgumentList and ChannelSpecs.  See
  18. //  file BCWIZ.TXT for a discussion of the use of these classes.
  19.  
  20. #include    "INSTREAM.H"
  21.  
  22. #define    MAXARGS                    50
  23. #define    DEFAULT_RETURN_TYPE        "void"
  24. #define    DEFAULT_MAX_RECEIVERS    "10"
  25. #define DEFAULT_RETURN_DEFAULT    "0"
  26.  
  27. typedef struct  tagArgument
  28. {
  29.     char    *cpString;
  30.     int     iLen;
  31. }               Argument;
  32.  
  33. class   ArgumentList
  34. {
  35.     InStream    *opInStream;
  36. public:
  37.     int         iNumInList;
  38.     Argument    oArgument[MAXARGS];
  39.     ArgumentList (InStream *opInStreamArg) {iNumInList=0;
  40.                                             opInStream=opInStreamArg;}
  41.     void Add (char *cp, int iLen);
  42.     int  Empty (void) {return (iNumInList==0);}
  43. };
  44.  
  45. typedef struct  tagChannelSpec
  46. {
  47.     char    *cpReturnType;
  48.     char    *cpFuncName;
  49.     char    *cpProtoList;
  50.     char    *cpArgList;
  51.     char    *cpReturnDefaultValue;
  52.     char    *cpMaxReceivers;
  53. }               ChannelSpec;
  54.  
  55. #define     MAXCHANNELS     200
  56.  
  57. class   ChannelSpecs
  58. {
  59.     ChannelSpec *opCurrentSpec;
  60.     InStream    *opInStream;
  61.     void SyntaxError (char *cpMsg);
  62.     char *ParseForward (int &iLen);
  63.     char *ParseNumber (int &iLen);
  64.     char *ParseBackward (int &iLen);
  65.     void MakeArgList (ArgumentList &oArgList);
  66. public:
  67.     int         iNumSpecs;
  68.     ChannelSpec oChannelSpec[MAXCHANNELS];
  69.     ChannelSpecs (void) {iNumSpecs=0;}
  70.     int GetNextChannelSpec(InStream &oInStream);
  71. };
  72.  
  73. #endif
  74.