Debian Codegraph @

sysport/sysport.h

raw symbols SCIP
1 #cxx . . $ `<file>/sysport/sysport.h`/if !defined(H_SYSPOR)
2 #define H_SYSPORcxx . . $ `sysport/sysport.h:2:9`!
3
4 /*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>*/
5
6 /*
7 | Define
8 | MONOTHREAD: if SMP functions are not going to be used nor linked with -lpthread
9 |
10 */
11
12 #if defined(MINGW)
13 #include <windows.h>
14 #if !defined(MVSC)
15 #define MVSC
16 #endif
17 #endif
18
19 #ifdef _MSC_VER
20 #include <windows.h>
21 #if !defined(MVSC)
22 #define MVSC
23 #endif
24 #else
25 #include <unistd.h>
26 #endif
27
28
29 #if defined(__linux__cxx . . $ `<built-in>:398:9`!) || defined(__GNUC__cxx . . $ `<built-in>:8:9`!)
30 #if !defined(GCCLINUX)
31 #define GCCLINUXcxx . . $ `sysport/sysport.h:31:11`!
32 #endif
33 #endif
34
35 #if defined(MINGW)
36 #undef GCCLINUX
37 #endif
38
39 /*
40 |
41 | To allow multithreaded functions, MULTI_THREADED_INTERFACE should be defined
42 |
43 \*--------------------------------------------------------------------------------*/
44
45
46 #if defined(CYGWIN)
47 #define USECLOCK
48 #define MULTI_THREADED_INTERFACE
49 #undef NT_THREADS
50 #define POSIX_THREADS
51 #define GCCLINUX_INTEGERS
52 #elif defined(MINGW)
53 #define USEWINCLOCK
54 #define MULTI_THREADED_INTERFACE
55 #define NT_THREADS
56 #undef POSIX_THREADS
57 #define MSWINDOWS_INTEGERS
58 #elif defined(GCCLINUXcxx . . $ `sysport/sysport.h:31:11`!)
59 #define USELINCLOCKcxx . . $ `sysport/sysport.h:59:10`!
60 #define MULTI_THREADED_INTERFACEcxx . . $ `sysport/sysport.h:60:10`!
61 #undef NT_THREADS
62 #define POSIX_THREADScxx . . $ `sysport/sysport.h:62:10`!
63 #define GCCLINUX_INTEGERScxx . . $ `sysport/sysport.h:63:10`!
64 #elif defined(MVSC)
65 #define USEWINCLOCK
66 #define MULTI_THREADED_INTERFACE
67 #define NT_THREADS
68 #undef POSIX_THREADS
69 #define MSWINDOWS_INTEGERS
70 #else
71 #error COMPILER NOT DEFINED
72 #endif
73
74 #if defined(MONOTHREAD)
75 #undef MULTI_THREADED_INTERFACE
76 #endif
77
78
79 #if defined(GCCLINUXcxx . . $ `sysport/sysport.h:31:11`!) || defined(MINGW)
80 #define U64cxx . . $ `sysport/sysport.h:80:10`!(x) (x##ull)
81 #elif defined(MVSC)
82 #define U64(x) (x##ui64)
83 #else
84 #error OS not defined properly
85 #endif
86
87
88 #if defined(GCCLINUXcxx . . $ `sysport/sysport.h:31:11`!) || defined(MINGW)
89 /*
90 typedef unsigned long long int uint64_t;
91 typedef long long int int64_t;
92 typedef unsigned char uint8_t;
93 typedef unsigned short int uint16_t;
94 typedef unsigned int uint32_t;
95 */
96
97 #include <stdint.h>
98
99 #elif defined(MVSC)
100
101 typedef unsigned char uint8_t;
102 typedef unsigned short int uint16_t;
103 typedef unsigned int uint32_t;
104 typedef unsigned __int64 uint64_t;
105
106 typedef signed char int8_t;
107 typedef short int int16_t;
108 typedef int int32_t;
109 typedef __int64 int64_t;
110
111 #else
112 #error OS not defined properly for 64 bit integers
113 #endif
114
115
116 /*-----------------
117 PATH NAMES
118 ------------------*/
119
120 #if defined(GCCLINUXcxx . . $ `sysport/sysport.h:31:11`!)
121 #define FOLDERSEPcxx . . $ `sysport/sysport.h:121:10`! "/"
122 #elif defined(MVSC)
123 #define FOLDERSEP "\\"
124 #else
125 #define FOLDERSEP "/"
126 #endif
127
128 /* path names */
129 extern int isfoldersepcxx . . $ isfoldersep(7864480464b09eea). (int x);
130
131 /*-----------------
132 FOPEN MAX
133 ------------------*/
134
135 extern int mysys_fopen_maxcxx . . $ mysys_fopen_max(b126dc7c1de90089). (void);
136
137 /*------------
138 TIMER
139 -------------*/
140
141 typedef int64_tcxx . . $ int64_t# myclock_tcxx . . $ myclock_t#;
142
143 extern myclock_tcxx . . $ myclock_t# myclockcxx . . $ myclock(da6335ded91d79c2).(void);
144 extern myclock_tcxx . . $ myclock_t# ticks_per_seccxx . . $ ticks_per_sec(da6335ded91d79c2). (void);
145
146 #define MYCLOCKS_PER_SECcxx . . $ `sysport/sysport.h:146:9`! (ticks_per_sec())
147 #define GET_TICKcxx . . $ `sysport/sysport.h:147:9`! (myclock())
148
149
150 /*********************************************************************/
151 #if defined(MULTI_THREADED_INTERFACEcxx . . $ `sysport/sysport.h:60:10`!)
152
153 /*------------
154 THREADS
155 -------------*/
156
157 #if defined (POSIX_THREADScxx . . $ `sysport/sysport.h:62:10`!)
158
159 #include <pthread.h>
160 #include <semaphore.h>
161
162 #define THREAD_CALLcxx . . $ `sysport/sysport.h:162:10`!
163
164 typedef void * thread_return_tcxx . . $ thread_return_t#;
165 typedef pthread_tcxx . . $ pthread_t# mythread_tcxx . . $ mythread_t#;
166 typedef thread_return_tcxx . . $ thread_return_t# (THREAD_CALLcxx . . $ `sysport/sysport.h:162:10`! *routine_tcxx . . $ routine_t#) (void *);
167 typedef pthread_mutex_tcxx . . $ pthread_mutex_t# mythread_mutex_tcxx . . $ mythread_mutex_t#;
168
169 #ifdef SPINLOCKS
170 typedef pthread_spinlock_t mythread_spinx_t;
171 #else
172 typedef pthread_mutex_tcxx . . $ pthread_mutex_t# mythread_spinx_tcxx . . $ mythread_spinx_t#;
173 #endif
174
175 typedef sem_tcxx . . $ sem_t# mysem_tcxx . . $ mysem_t#;
176
177
178 #elif defined(NT_THREADS)
179
180 #define WIN32_LEAN_AND_MEAN
181
182 #include <windows.h>
183 #include <process.h>
184
185 #define THREAD_CALL __stdcall
186
187 typedef unsigned thread_return_t;
188 typedef HANDLE mythread_t;
189 typedef thread_return_t (THREAD_CALL *routine_t) (void *);
190 typedef HANDLE mythread_mutex_t;
191
192 #define SPINLOCKS
193
194 #ifdef SPINLOCKS
195 typedef CRITICAL_SECTION mythread_spinx_t;
196 #else
197 typedef HANDLE mythread_spinx_t;
198 #endif
199
200 typedef HANDLE mysem_t;
201
202 #else
203 #error Definition of threads not present
204 #endif
205
206
207
208 extern int /*boolean*/ mythread_createcxx . . $ mythread_create(fac9e0f9131e5f68). (/*@out@*/ mythread_tcxx . . $ mythread_t# *thread, routine_tcxx . . $ routine_t# start_routine, void *arg, /*@out@*/ int *ret_error);
209 extern int /*boolean*/ mythread_joincxx . . $ mythread_join(15f694ef3c96d230). (mythread_tcxx . . $ mythread_t# thread);
210 extern void mythread_exitcxx . . $ mythread_exit(49f6e7a06ebc5aa8). (void);
211 extern const char * mythread_create_errorcxx . . $ mythread_create_error(f7ae7e56280f18ae). (int err);
212
213 extern void mythread_mutex_initcxx . . $ mythread_mutex_init(4f83bfebf4bb9c8b). (mythread_mutex_tcxx . . $ mythread_mutex_t# *m);
214 extern void mythread_mutex_destroycxx . . $ mythread_mutex_destroy(4f83bfebf4bb9c8b). (mythread_mutex_tcxx . . $ mythread_mutex_t# *m);
215 extern void mythread_mutex_lockcxx . . $ mythread_mutex_lock(4f83bfebf4bb9c8b). (mythread_mutex_tcxx . . $ mythread_mutex_t# *m);
216 extern void mythread_mutex_unlockcxx . . $ mythread_mutex_unlock(4f83bfebf4bb9c8b). (mythread_mutex_tcxx . . $ mythread_mutex_t# *m);
217
218 extern void mythread_spinx_initcxx . . $ mythread_spinx_init(4f83bfebf4bb9c8b). (mythread_spinx_tcxx . . $ mythread_spinx_t# *m); /**/
219 extern void mythread_spinx_destroycxx . . $ mythread_spinx_destroy(4f83bfebf4bb9c8b). (mythread_spinx_tcxx . . $ mythread_spinx_t# *m); /**/
220 extern void mythread_spinx_lockcxx . . $ mythread_spinx_lock(4f83bfebf4bb9c8b). (mythread_spinx_tcxx . . $ mythread_spinx_t# *m); /**/
221 extern void mythread_spinx_unlockcxx . . $ mythread_spinx_unlock(4f83bfebf4bb9c8b). (mythread_spinx_tcxx . . $ mythread_spinx_t# *m); /**/
222
223 /* semaphores*/
224 extern int /*boolean*/ mysem_initcxx . . $ mysem_init(b34cd7d0155a4ca6). (mysem_tcxx . . $ mysem_t# *sem, unsigned int value);
225 extern int /*boolean*/ mysem_waitcxx . . $ mysem_wait(2e1de0073772a87a). (mysem_tcxx . . $ mysem_t# *sem);
226 extern int /*boolean*/ mysem_postcxx . . $ mysem_post(2e1de0073772a87a). (mysem_tcxx . . $ mysem_t# *sem);
227 extern int /*boolean*/ mysem_destroycxx . . $ mysem_destroy(2e1de0073772a87a). (mysem_tcxx . . $ mysem_t# *sem);
228 #endif
229
230
231
232
233
234 /* end MULTI_THREADED_INTERFACE*/
235 #endif
236
237 /*<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<*/