File:  [Research Unix] / researchv10dc / cmd / icon / src / iconx / ovalue.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 17:21:34 2018 UTC (8 years, 3 months ago) by root
Branches: belllabs, MAIN
CVS tags: researchv10, HEAD
researchv10 Dan Cross

/*
 * File: ovalue.c
 *  Contents: nonnull, null, value
 */

#include "../h/rt.h"

/*
 * \x - test x for nonnull value.
 */

OpDcl(nonnull,1,"\\")
   {

   /*
    * If x is not null, it is returned, otherwise, the function fails.
    *  Because the pre-dereference value of x is the return value (if
    *  any), x is copied into Arg0.
    */
   Arg0 = Arg1;
   DeRef(Arg1);
   if (ChkNull(Arg1))
      Fail;
   Return;
   }


/*
 * /x - test x for null value.
 */

OpDcl(null,1,"/")
   {

   /*
    * If x is null, it is returned, otherwise, the function fails.
    *  Because the pre-dereference value of x is the return value (if
    *  any), x is copied into Arg0.
    */
   Arg0 = Arg1;
   DeRef(Arg1);
   if (!ChkNull(Arg1))
      Fail;
   Return;
   }


/*
 * .x - produce value of x by dereferencing it.
 */

OpDcl(value,1,".")
   {

   Arg0 = Arg1;
   Return;
   }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.