home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / icon / dos / src / h / grttin.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-02-10  |  1.7 KB  |  75 lines

  1. /*
  2.  * Group of include files for input to rtt.
  3.  *   rtt reads these files for preprocessor directives and typedefs, but
  4.  *   does not output any code from them.
  5.  */
  6. #include "../h/define.h"
  7. #include "../h/path.h"
  8. #include "../h/config.h"
  9. #include "../h/typedefs.h"
  10. #include "../h/version.h"
  11.  
  12. /*
  13.  * Macros that must be expanded by rtt.
  14.  */
  15.  
  16. #define AnyType (co_expression ++ cset ++ file ++ integer ++ list ++ null ++\
  17.    procedure ++ real ++ record ++ set ++ string ++ table)
  18.  
  19. /*
  20.  * Declaration for library routine.
  21.  */
  22. #begdef LibDcl(nm,n,pn)
  23.    #passthru OpBlock(nm,n,pn,0)
  24.  
  25.    int O##nm(nargs,cargp)
  26.    int nargs;
  27.    register dptr cargp;
  28. #enddef
  29.  
  30. /*
  31.  * Error exit from non top-level routines. Set tentative values for
  32.  *   error number and error value; these errors will but put in
  33.  *   effect if the run-time error routine is called.
  34.  */
  35. #begdef ReturnErrVal(err_num, offending_val, ret_val)
  36.    {
  37.    t_errornumber = err_num;
  38.    t_errorvalue = offending_val;
  39.    t_have_val = 1;
  40.    return ret_val;
  41.    }
  42. #enddef
  43.  
  44. #begdef ReturnErrNum(err_num, ret_val)
  45.    {
  46.    t_errornumber = err_num;
  47.    t_errorvalue = nulldesc;
  48.    t_have_val = 0;
  49.    return ret_val;
  50.    }
  51. #enddef
  52.  
  53. /*
  54.  * Code expansions for exits from C code for top-level routines.
  55.  */
  56. #define Fail        return A_Resume
  57. #define Return        return A_Continue
  58.  
  59. /*
  60.  * RunErr encapsulates a call to the function err_msg, followed
  61.  *  by Fail.  The idea is to avoid the problem of calling
  62.  *  runerr directly and forgetting that it may actually return.
  63.  */
  64.  
  65. #define RunErr(n,dp) {\
  66.    err_msg((int)n,dp);\
  67.    Fail;\
  68.    }
  69.  
  70. /*
  71.  * Protection macro.
  72.  */
  73. #define Protect(notnull,orelse) if ((notnull)==NULL) orelse
  74.  
  75.