HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros 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 IRIX.
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 "UT_Defines.h"
18 #include <SYS/SYS_Time.h>
19 
20 #ifdef WIN32
21 
22 /*
23  These functions replace the SGI forms with NT forms.
24 */
25 
26 #include <process.h> // for _getpid()
27 #include <io.h> // for open()/close() used by people who include us
28 
29 typedef int mode_t;
30 typedef void * key_t;
31 
32 struct timezone {
33  long tzd;
34 };
35 
36 #define IPC_CREAT 0001000
37 #define IPC_EXCL 0002000
38 #define IPC_PRIVATE (key_t)0
39 #define IPC_RMID 10
40 
41 #define PR_SADDR 1
42 #define PR_SALL 2
43 #define PR_SFDS 3
44 
45 #define MP_NPROCS 0
46 
47 #define CONF_INITUSERS 1
48 
49 UT_API void UTnap(int millisec);
50 
51 // nap in hundredths of a second
52 static inline void sginap(int centiseconds)
53 {
54  return UTnap(centiseconds * 10);
55 }
56 // nap in seconds
57 static inline void sleep(int seconds)
58 {
59  return UTnap(seconds * 1000);
60 }
61 
62 
63 UT_API int mkdir( const char *, int );
64 
65 // python/pyport.h also makes these exact same defines so guard against
66 // redefinition
67 #ifndef S_ISDIR
68 #define S_ISDIR(st_mode) (((st_mode) & S_IFMT) == S_IFDIR)
69 #endif
70 #ifndef S_ISREG
71 #define S_ISREG(st_mode) (((st_mode) & S_IFMT) == S_IFREG)
72 #endif
73 
74 UT_API int sysmp( int val, ... );
75 UT_API void *shmat( key_t h, void *addr, int flag );
76 UT_API int shmdt( void *mem );
77 UT_API key_t shmget( key_t key, int size, int flag );
78 UT_API int shmctl( key_t h, int cmd, int parm );
79 UT_API int shmctl( key_t h, int cmd );
80 UT_API key_t ftok( const char *path, int id );
81 
82 UT_API int umask( char c );
83 UT_API void UTclearHostnameCache();
84 UT_API int UTgethostname(char *host, int len);
85 
86 // FBX SDK defines its own getpid macro, so we
87 // only define it here if it hasn't been defined
88 // in FBX already to avoid compiler warnings.
89 #ifndef getpid
90 #define getpid() _getpid()
91 #endif
92 
93 UT_API int usconfig( int flag, int data );
94 UT_API char *dlerror( void );
95 
96 UT_API void cftime( char *dest, char *fmt, time_t *now );
97 
98 UT_API void closePerformanceKey(void *data);
99 
100 #define snprintf _snprintf
101 #endif
102 
103 #endif // _UT_NTUtil_h_
GLsizei const GLchar *const * path
Definition: glcorearb.h:3340
#define UT_API
Definition: UT_API.h:12
GLsizeiptr size
Definition: glcorearb.h:663
GLboolean * data
Definition: glcorearb.h:130
GLfloat GLfloat GLfloat GLfloat h
Definition: glcorearb.h:2001
UT_API int UTgethostname(UT_String &host)
GLuint GLfloat * val
Definition: glcorearb.h:1607
png_infop png_uint_32 flag
Definition: png.h:2242