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

  1. /*
  2.  * File......: POKE.C
  3.  * Author....: Ted Means
  4.  * Date......: $Date:   15 Jul 1993 22:46:50  $
  5.  * Revision..: $Revision:   1.0  $
  6.  * Log file..: $Logfile:   C:/nanfor/src/exo/poke.c_v  $
  7.  * 
  8.  * This 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/poke.c_v  $
  15.  * 
  16.  *    Rev 1.0   15 Jul 1993 22:46:50   GLENN
  17.  * Initial revision.
  18.  *
  19.  */
  20.  
  21. /* Librarian's note:
  22.  *
  23.  * This source code is for a special version of ft_poke(), 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 POKE.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_POKE(void)
  39. {
  40.    auto unsigned char * byteptr;
  41.    auto unsigned char * pmptr;
  42.  
  43.    if ( (PCOUNT >= 3) && (ISNUM(1)) && (ISNUM(2)) && (ISNUM(3)) )
  44.    {
  45.       * ((unsigned int *) &byteptr)     = _parni(2);
  46.       * ((unsigned int *) &byteptr + 1) = _parni(1);
  47.       pmptr = ExoProtectedPtr(byteptr, 8);
  48.       *pmptr = ((unsigned char) _parni(3));
  49.       _retl( TRUE );
  50.    }
  51.    else
  52.       _retl( FALSE );
  53.    return;
  54. }
  55.