HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UT_NTUtil.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: UT_NTUtil.h (Utility Library, C++)
7  *
8  * COMMENTS: Functions and defines for WinNT to make it look like Linux.
9  *
10  */
11 
12 #ifndef _UT_NTUtil_h_
13 #define _UT_NTUtil_h_
14 
15 #include "UT_API.h"
16 #include "UT_Access.h" // UTaccess() used to be defined here
17 #include <SYS/SYS_Time.h>
18 
19 #ifdef WIN32
20 
21 /*
22  These functions replace the SGI forms with NT forms.
23 */
24 
25 #include <process.h> // for _getpid()
26 #include <io.h> // for open()/close() used by people who include us
27 
28 typedef int mode_t;
29 typedef void * key_t;
30 
31 struct timezone {
32  long tzd;
33 };
34 
35 #define IPC_CREAT 0001000
36 #define IPC_EXCL 0002000
37 #define IPC_PRIVATE (key_t)0
38 #define IPC_RMID 10
39 
40 #define PR_SADDR 1
41 #define PR_SALL 2
42 #define PR_SFDS 3
43 
44 #define MP_NPROCS 0
45 
46 #define CONF_INITUSERS 1
47 
48 UT_API void UTnap(int millisec);
49 
50 // nap in hundredths of a second
51 static inline void sginap(int centiseconds)
52 {
53  return UTnap(centiseconds * 10);
54 }
55 // nap in seconds
56 static inline void sleep(int seconds)
57 {
58  return UTnap(seconds * 1000);
59 }
60 
61 
62 UT_API int mkdir( const char *, int );
63 
64 // python/pyport.h also makes these exact same defines so guard against
65 // redefinition
66 #ifndef S_ISDIR
67 #define S_ISDIR(st_mode) (((st_mode) & S_IFMT) == S_IFDIR)
68 #endif
69 #ifndef S_ISREG
70 #define S_ISREG(st_mode) (((st_mode) & S_IFMT) == S_IFREG)
71 #endif
72 
73 UT_API int sysmp( int val, ... );
74 UT_API void *shmat( key_t h, void *addr, int flag );
75 UT_API int shmdt( void *mem );
76 UT_API key_t shmget( key_t key, int size, int flag );
77 UT_API int shmctl( key_t h, int cmd, int parm );
78 UT_API int shmctl( key_t h, int cmd );
79 UT_API key_t ftok( const char *path, int id );
80 
81 UT_API int umask( char c );
82 UT_API void UTclearHostnameCache();
83 UT_API int UTgethostname(char *host, int len);
84 
85 // FBX SDK defines its own getpid macro, so we
86 // only define it here if it hasn't been defined
87 // in FBX already to avoid compiler warnings.
88 #ifndef getpid
89 #define getpid() _getpid()
90 #endif
91 
92 UT_API int usconfig( int flag, int data );
93 UT_API char *dlerror();
94 
95 UT_API void cftime( char *dest, char *fmt, time_t *now );
96 
97 UT_API void closePerformanceKey(void *data);
98 
99 UT_API bool UTisUserAnAdmin();
100 
101 #endif
102 
103 #endif // _UT_NTUtil_h_
GLsizei const GLchar *const * path
Definition: glcorearb.h:3341
#define UT_API
Definition: UT_API.h:14
GLsizeiptr size
Definition: glcorearb.h:664
GLfloat GLfloat GLfloat GLfloat h
Definition: glcorearb.h:2002
UT_API int UTgethostname(UT_String &host)
GLuint GLfloat * val
Definition: glcorearb.h:1608
Definition: format.h:895