1 /*****************************************************************************/ 2 /* Software Testing Automation Framework (STAF) */ 3 /* (C) Copyright IBM Corp. 2001 */ 4 /* */ 5 /* This software is licensed under the Eclipse Public License (EPL) V1.0. */ 6 /*****************************************************************************/ 7 8 #ifndef STAF_UnixUtil 9 #define STAF_UnixUtil 10 11 #include "STAFString.h" 12 13 /*****************************************************************************/ 14 /* S_ISEXE - This macro takes the mode of a file (member of a struct stat) */ 15 /* and determines whether the file has execute permissions or not. */ 16 /* The naming convention of this macro follows the naming */ 17 /* convention of other macros used within sys/stat.h. */ 18 /*****************************************************************************/ 19 #define S_ISEXE(mode) (mode & 0x49) 20 21 22 /*****************************************************************************/ 23 /* STAFUtilUnixGetFilePath - Determines the path of a file as it is found in */ 24 /* the PATH environment variable. The path */ 25 /* returned will have no terminating "/", and, if */ 26 /* the file is not found in the PATH, an error */ 27 /* message will returned in the path string */ 28 /* instead. */ 29 /* */ 30 /* Accepts: (IN) The file to find in the PATH */ 31 /* (OUT) Pointer to the path of the file */ 32 /* (OUT) Pointer to operating system return code */ 33 /* */ 34 /* Returns: 0, if successful */ 35 /* >1, if unsuccessul */ 36 /* */ 37 /* */ 38 /* Notes: 1) You are responsible for destructing the string returned for the */ 39 /* path */ 40 /*****************************************************************************/ 41 STAFRC_t STAFUtilUnixGetFilePath(STAFStringConst_t file, STAFString_t *path, 42 unsigned int *osRC); 43 44 #endif 45