home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1993 #2 / Image.iso / clipper / nforx.zip / PEEK.C < prev    next >
C/C++ Source or Header  |  1993-07-15  |  1KB  |  54 lines

  1. /*
  2.  * File......: PEEK.C
  3.  * Author....: Ted Means
  4.  * Date......: $Date:   15 Jul 1993 22:46:16  $
  5.  * Revision..: $Revision:   1.0  $
  6.  * Log file..: $Logfile:   C:/nanfor/src/exo/peek.c_v  $
  7.  * 
  8.  * This function is an original work by Ted Means and is placed in the
  9.  * public domain.
  10.  *
  11.  * Modification history:
  12.  * ---------------------
  13.  *
  14.  * $Log:   C:/nanfor/src/exo/peek.c_v  $
  15.  * 
  16.  *    Rev 1.0   15 Jul 1993 22:46:16   GLENN
  17.  * Initial revision.
  18.  * 
  19.  */
  20.  
  21. /* Librarian's note:
  22.  *
  23.  * This source code is for a special version of ft_peek(), compatible
  24.  * with the ExoSpace (tm) DOS Extender from SofDesign, International.
  25.  * It is ExoSpace-specific and is maintained separately from the real
  26.  * mode version.
  27.  *
  28.  * The documentation can be found in the real-mode PEEK.C as
  29.  * distributed with the regular Nanforum Toolkit.
  30.  *
  31.  */ 
  32.  
  33.  
  34. #include "extend.h"
  35.  
  36. void *      ExoProtectedPtr(void *rmptr, unsigned int sizebytes);
  37.  
  38. CLIPPER FT_PEEK(void)
  39. {
  40.    auto unsigned char * byteptr;
  41.    auto unsigned char * pmptr;
  42.  
  43.    if ( (PCOUNT >= 2) && (ISNUM(1)) && (ISNUM(2)) )
  44.    {
  45.       * ((unsigned int *) &byteptr)     = _parni(2);
  46.       * ((unsigned int *) &byteptr + 1) = _parni(1);
  47.       pmptr = ExoProtectedPtr(byteptr, 8);
  48.       _retni( (unsigned int) (*pmptr) );
  49.    }
  50.    else
  51.       _retni( -1 );
  52.    return;
  53. }
  54.