home *** CD-ROM | disk | FTP | other *** search
/ Power CD-ROM!! 7 / POWERCD7.ISO / prgmming / clipper / gtdir.c < prev    next >
C/C++ Source or Header  |  1993-05-26  |  2KB  |  48 lines

  1. /*****************************************************************************
  2. * Function: _GT_Internal_Directory()                                         *
  3. * Syntax..: int _GT_Internal_Directory(char DirCall)                         *
  4. * Usage...: Internal function for doing a Mk/Ch/RmDir call.                  *
  5. * By......: David A Pearson                                                  *
  6. *****************************************************************************/
  7.  
  8. #include <extend.h>
  9. #include "gt_mem.h"
  10.  
  11. void _GT_Internal_Directory(char DirCall)
  12. {
  13.         Boolean Result    = FALSE;
  14.         int     ErrorCode = 0;
  15.         char    *Path;
  16.         int     PathSeg;
  17.         int     PathOff;
  18.  
  19.         if (PCOUNT >= 1 && ISCHAR(1))
  20.         {
  21.                 Path    = _parc(1);
  22.                 PathSeg = _GT_FP_SEG(Path);
  23.                 PathOff = _GT_FP_OFF(Path);
  24.  
  25.                 asm     Push    DS
  26.                 asm     Mov     AH,DirCall
  27.                 asm     Mov     DS,PathSeg
  28.                 asm     Mov     DX,PathOff
  29.                 asm     Int     0x21
  30.                 asm     Jnc     NoProblem
  31.                 asm     Mov     ErrorCode,AX
  32. NoProblem:
  33.                 asm     Pop     DS
  34.                 if (ErrorCode)
  35.                 {
  36.                         if (PCOUNT == 2 && ISNUM(2) && ISBYREF(2))
  37.                         {
  38.                                 _storni(ErrorCode,2);
  39.                         }
  40.                 }
  41.                 else
  42.                 {
  43.                         Result = TRUE;
  44.                 }
  45.         }
  46.         _retl(Result);
  47. }
  48.