| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
#ifndef __CMDLIB__ |
| 27 |
#define __CMDLIB__ |
| 28 |
|
| 29 |
#include "globaldefs.h" |
| 30 |
#include <time.h> |
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
bool Q_Exec( const char *cmd, const char *cmdline, const char *execdir, bool bCreateConsole, bool waitfor ); |
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
#define access_owner_read 0400 |
| 53 |
#define access_owner_write 0200 |
| 54 |
#define access_owner_execute 0100 |
| 55 |
#define access_owner_rw_ 0600 |
| 56 |
#define access_owner_r_x 0500 |
| 57 |
#define access_owner__wx 0300 |
| 58 |
#define access_owner_rwx 0700 |
| 59 |
|
| 60 |
#define access_group_read 0040 |
| 61 |
#define access_group_write 0020 |
| 62 |
#define access_group_execute 0010 |
| 63 |
#define access_group_rw_ 0060 |
| 64 |
#define access_group_r_x 0050 |
| 65 |
#define access_group__wx 0030 |
| 66 |
#define access_group_rwx 0070 |
| 67 |
|
| 68 |
#define access_others_read 0004 |
| 69 |
#define access_others_write 0002 |
| 70 |
#define access_others_execute 0001 |
| 71 |
#define access_others_rw_ 0006 |
| 72 |
#define access_others_r_x 0005 |
| 73 |
#define access_others__wx 0003 |
| 74 |
#define access_others_rwx 0007 |
| 75 |
|
| 76 |
|
| 77 |
#define access_rwxrwxr_x ( access_owner_rwx | access_group_rwx | access_others_r_x ) |
| 78 |
#define access_rwxrwxrwx ( access_owner_rwx | access_group_rwx | access_others_rwx ) |
| 79 |
|
| 80 |
|
| 81 |
|
| 82 |
#if GDEF_OS_WINDOWS |
| 83 |
#include <direct.h> |
| 84 |
inline bool Q_mkdir( const char* name ){ |
| 85 |
return _mkdir( name ) != -1; |
| 86 |
} |
| 87 |
#else |
| 88 |
#include <sys/stat.h> |
| 89 |
inline bool Q_mkdir( const char* name ){ |
| 90 |
return mkdir( name, access_rwxrwxr_x ) != -1; |
| 91 |
} |
| 92 |
#endif |
| 93 |
|
| 94 |
|
| 95 |
inline double Sys_DoubleTime( void ){ |
| 96 |
return clock() / 1000.0; |
| 97 |
} |
| 98 |
|
| 99 |
|
| 100 |
|
| 101 |
#endif |