home *** CD-ROM | disk | FTP | other *** search
/ APDL Public Domain 1 / APDL_PD1A.iso / program / language / icon / Source / Iconx / C / Ovalue < prev    next >
Encoding:
Text File  |  1990-07-19  |  1.3 KB  |  75 lines

  1. /*
  2.  * File: ovalue.c
  3.  *  Contents: nonnull, null, value
  4.  */
  5.  
  6. #include "../h/config.h"
  7. #include "../h/rt.h"
  8. #include "rproto.h"
  9.  
  10.  
  11. /*
  12.  * \x - test x for nonnull value.
  13.  */
  14.  
  15. #ifdef WATERLOO_C_V3_0
  16. struct b_iproc Bnonnull = {
  17.     T_Proc,
  18.     Vsizeof(struct b_proc),
  19.     Ononnull,
  20.     1,
  21.     -1,
  22.     0,
  23.     0,
  24.     {sizeof(BackSlash)-1,BackSlash}}; Ononnull(cargp,sptr) register dptr cargp;
  25. #else                    /* WATERLOO_C_V3_0 */
  26. OpDcl(nonnull,1,BackSlash)
  27. #endif                    /* WATERLOO_C_V3_0 */
  28.    {
  29.  
  30.    /*
  31.     * If Arg1 is not null, it is returned, otherwise, the function fails.
  32.     *  Because the pre-dereference value of Arg1 is the return value (if
  33.     *  any), Arg1 is copied into Arg0.
  34.     */
  35.    Arg0 = Arg1;
  36.    if (DeRef(Arg1) == Error) 
  37.       RunErr(0, NULL);
  38.    if (ChkNull(Arg1))
  39.       Fail;
  40.    Return;
  41.    }
  42.  
  43. /*
  44.  * /x - test x for null value.
  45.  */
  46.  
  47. OpDcl(null,1,"/")
  48.    {
  49.  
  50.    /*
  51.     * If Arg1 is null, it is returned, otherwise, the function fails.
  52.     *  Because the pre-dereference value of Arg1 is the return value (if
  53.     *  any), Arg1 is copied into Arg0.
  54.     */
  55.    Arg0 = Arg1;
  56.    if (DeRef(Arg1) == Error) 
  57.       RunErr(0, NULL);
  58.    if (!ChkNull(Arg1))
  59.       Fail;
  60.    Return;
  61.    }
  62.  
  63. /*
  64.  * .x - produce value of x.
  65.  */
  66.  
  67. OpDcl(value,1,".")
  68.    {
  69.  
  70.    if (DeRef(Arg1) == Error) 
  71.       RunErr(0, NULL);
  72.    Arg0 = Arg1;
  73.    Return;
  74.    }
  75.