home *** CD-ROM | disk | FTP | other *** search
/ Power CD-ROM!! 7 / POWERCD7.ISO / prgmming / clipper / peekstrz.c < prev    next >
C/C++ Source or Header  |  1993-10-14  |  1KB  |  62 lines

  1. /*
  2.  * File......: PEEKSTRZ.C
  3.  * Author....: David Pearson
  4.  * BBS.......: The Dark Knight Returns
  5.  * Net/Node..: 050/069
  6.  * User Name.: Dave Pearson
  7.  * Date......: 25/03/93
  8.  * Revision..: 1.0
  9.  *
  10.  * This is an original work by Dave Pearson and is placed in the public
  11.  * domain.
  12.  *
  13.  * Modification history:
  14.  * ---------------------
  15.  *
  16.  * $Log$
  17.  *
  18.  */
  19.  
  20. #include "GT_Mem.H"
  21. #include <Extend.H>
  22.  
  23. /*
  24.  *  $DOC$
  25.  *  $FUNCNAME$
  26.  *      GT_PEEKSTZ()
  27.  *  $CATEGORY$
  28.  *      Memory
  29.  *  $ONELINER$
  30.  *      Get a NULL terminated string from memory.
  31.  *  $SYNTAX$
  32.  *      GT_PeekStZ(<nSegment>,<nOffset>) --> cString
  33.  *  $ARGUMENTS$
  34.  *      <nSegment> is the segment of the string in memory.
  35.  *
  36.  *      <nOffset>  is the offset of the string in memory.
  37.  *  $RETURNS$
  38.  *      The NULL terminated string found at <nSegment>:<nOffset>.
  39.  *  $DESCRIPTION$
  40.  *      GT_PeekStZ() can be used for getting NULL terminated strings from
  41.  *      specific areas of memory.
  42.  *  $EXAMPLES$
  43.  *      // Print the first entry in the program's environment table.
  44.  *
  45.  *      ? GT_PeekStZ(GT_PeekW(GT_PSPSeg(),44),0)
  46.  *  $SEEALSO$
  47.  *      GT_PEEKSTN()
  48.  *  $END$
  49.  */
  50.  
  51. CLIPPER GT_PeekStZ()
  52. {
  53.         if (PCOUNT == 2 && ISNUM(1) && ISNUM(2))
  54.         {
  55.                 _retc((char *)_GT_MK_FP(_parni(1),_parni(2)));
  56.         }
  57.         else
  58.         {
  59.                 _retc("");
  60.         }
  61. }
  62.