home *** CD-ROM | disk | FTP | other *** search
/ World of Shareware - Software Farm 2 / wosw_2.zip / wosw_2 / CPROG / EXEC33A.ZIP / CHECKPAT.H < prev    next >
C/C++ Source or Header  |  1991-11-21  |  2KB  |  66 lines

  1. /*
  2.     --- Version 3.3 91-11-21 16:12 ---
  3.  
  4.    CHECKPAT.H: Path check function header file.
  5.  
  6.    Public domain software by
  7.  
  8.         Thomas Wagner
  9.         Ferrari electronic GmbH
  10.         Beusselstrasse 27
  11.         D-1000 Berlin 21
  12.         Germany
  13. */
  14.  
  15. #ifdef __cplusplus
  16. extern "C" int
  17. #else
  18. extern int _cdecl
  19. #endif
  20. checkpath (char *string,     /* Input file name string */
  21.            int  inflags,     /* Analysis flags */
  22.            char *drive,      /* Drive letter and colon */
  23.            char *dir,        /* \directory\ */
  24.            char *fname,      /* file name */
  25.            char *ext,        /* .extension */
  26.            char *fullpath);  /* combined path */
  27.  
  28. /*
  29.    This routine accepts a file name and path, checks and resolves the
  30.    path, and splits the name into its components.
  31.  
  32.    A relative path, or no path at all, is resolved to a full path
  33.    specification. An invalid disk drive will not cause the routine 
  34.    to fail.
  35. */
  36.  
  37. #define INF_NODIR       1     /* Don't interpret name as directory */
  38.  
  39. /* Error returns: */
  40.  
  41. #define ERR_DRIVE       -1    /* Invalid drive */
  42. #define ERR_PATH        -2    /* Invalid path */
  43. #define ERR_FNAME       -3    /* Malformed filename */
  44. #define ERR_DRIVECHAR   -4    /* Illegal drive letter */
  45. #define ERR_PATHLEN     -5    /* Path too long */
  46. #define ERR_CRITICAL    -6    /* Critical error (invalid drive) */
  47.  
  48. /* Good returns (values ORed): */
  49.  
  50. #define HAS_WILD        1     /* Filename/ext has wildcard characters */
  51. #define HAS_EXT         2     /* Extension specified */
  52. #define HAS_FNAME       4     /* Filename specified */
  53. #define HAS_PATH        8     /* Path specified */
  54. #define HAS_DRIVE       0x10  /* Drive specified */
  55. #define FILE_EXISTS     0x20  /* File exists, upper byte has attributes */
  56. #define IS_DIR        0x1000  /* Directory, upper byte has attributes */
  57.  
  58. /* The file attributes returned if FILE_EXISTS or IS_DIR is set */
  59.  
  60. #define IS_READ_ONLY 0x0100
  61. #define IS_HIDDEN    0x0200
  62. #define IS_SYSTEM    0x0400
  63. #define IS_ARCHIVED  0x2000
  64. #define IS_DEVICE    0x4000
  65.  
  66.