Changeset 7508
- Timestamp:
- 06/27/18 19:53:55 (3 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/platform.h
r6858 r7508 1 2 /*3 * THIS FILE IS UNDER RCS - DO NOT MODIFY UNLESS YOU HAVE4 * CHECKED IT OUT USING THE COMMAND CHECKOUT.5 *6 * $Id$7 *8 * Revision history:9 * $Log$10 * Revision 1.11 2007/04/13 17:30:47 hal11 * added typedef for ulong when we're compining under cygwin12 *13 * Revision 1.10 2007/03/27 22:19:51 paulf14 * added _MACOSX flags15 *16 * Revision 1.9 2006/04/05 19:30:12 stefan17 * logit fix for log file slash18 *19 * Revision 1.8 2006/04/05 14:32:55 stefan20 * added platform specific DIR_SLASH string21 *22 * Revision 1.7 2006/03/10 13:50:56 paulf23 * minor linux related fixes to removing _SOLARIS from the include line24 *25 * Revision 1.6 2005/07/27 15:11:34 friberg26 * added in _LINUX ifdefs27 *28 * Revision 1.5 2004/10/07 21:30:15 mark29 * Added thread priority constants30 *31 * Revision 1.4 2003/12/03 01:16:05 davidk32 * added NT #def for snprintf() in lieu of _snprintf()33 *34 * Revision 1.3 2000/06/02 21:37:28 davidk35 * Added a #define for vsnprintf on NT. Removed comments from #define36 * lines. Comments on #define lines can be potentially diasterous if37 * you comment out a section of code, and there is an end comment (* /)38 * in a #define that you can't see, then you will get what seem like39 * random compile errors.40 *41 * Revision 1.2 2000/03/05 21:51:06 lombard42 * Added `ifndef LONG_t' around LONG to prevent redefinition errors.43 *44 * Revision 1.1 2000/02/14 20:05:54 lucky45 * Initial revision46 *47 *48 */49 50 1 51 2 /************************************************* … … 58 9 #ifndef PLATFORM_H 59 10 #define PLATFORM_H 11 12 /********************************************************************* _WINNT */ 60 13 61 14 #ifdef _WINNT … … 92 45 93 46 /* Thread functions return this */ 94 #define thr_ret void 47 typedef void thr_ret; 95 48 /* Value returned by thread functions; for Windows, nothing */ 96 49 #define THR_NULL_RET … … 109 62 typedef signed __int32 EW_INT32; 110 63 #endif 111 112 64 113 65 /* added so that logit.c can call vsnprintf for all platforms */ … … 126 78 #define DIR_SLASH '/' 127 79 #endif /* _WINNT */ 80 81 /*********************************************************************** _OS2 */ 128 82 129 83 #ifdef _OS2 … … 142 96 #include <sys\socket.h> /* Socket stuff */ 143 97 #include <netdb.h> /* Socket stuff */ 144 typedef void thr_ret; /* Thread functions return this */ 98 /* Thread functions return this */ 99 typedef void thr_ret; 145 100 /* Value returned by thread functions; for OS2, nothing */ 146 101 #define THR_NULL_RET … … 153 108 #endif /* _OS2 */ 154 109 110 /********************************************************************* _LINUX */ 155 111 156 112 #ifdef _LINUX … … 178 134 179 135 /* Thread functions return this */ 180 #define thr_ret void* 136 typedef void *thr_ret; 181 137 /* Value returned by thread functions; for UNIX, NULL */ 182 138 #define THR_NULL_RET (NULL) … … 207 163 208 164 #endif /* _LINUX */ 165 166 /******************************************************************** _MACOSX */ 209 167 210 168 #ifdef _MACOSX … … 230 188 231 189 /* Thread functions return this */ 232 #define thr_ret void* 190 typedef void *thr_ret; 233 191 /* Value returned by thread functions; for MACOSX, NULL */ 234 192 #define THR_NULL_RET (NULL) … … 258 216 259 217 #endif /* _MACOSX */ 218 219 /******************************************************************* _SOLARIS */ 260 220 261 221 #ifdef _SOLARIS … … 278 238 279 239 /* Thread functions return this */ 280 #define thr_ret void* 240 typedef void *thr_ret; 281 241 /* Value returned by thread functions; for Solaris, NULL */ 282 242 #define THR_NULL_RET (NULL) -
trunk/include_cpp/serverbase.h
r1334 r7508 14 14 15 15 extern "C" { 16 #include <platform.h> 17 // C++ compilers don't like the earthworm def for thr_ret 18 #undef thr_ret 19 #define thr_ret void fun 20 #include <socket_ew.h> 21 #include <transport.h> 16 #include "platform.h" 17 #include "socket_ew.h" 18 #include "transport.h" 22 19 } 23 20 #define _USING_EW_XPORT 1 // prevent conflict between EW & MW 24 25 21 26 22 // microsoft pragma to avoid 157 messages in some cases … … 40 36 #include <configsource.h> 41 37 42 43 44 38 #define SERVE_MAX_THREADS 100 45 39 #define WAIT_FOR_SERVICE_THREAD 3000 // milliseconds to wait for a service thread to come free … … 55 49 // Absolute minumum time to listen for a message if specified 56 50 #define MIN_RECV_TIMEOUT_MS 50 57 58 51 59 52 enum WORM_SERVER_THREAD_STATE // Server Thread States … … 126 119 ); 127 120 128 129 121 // ======================================================================= 130 122 // from TConfigurable … … 142 134 */ 143 135 void CheckConfig(); 144 145 136 146 137 // ======================================================================= … … 164 155 int LoggingLevel; 165 156 166 167 157 SERVICETHREAD_MAP ThreadsInfo; 168 158 … … 217 207 WORM_STATUS_CODE SendMessage( const SOCKET p_descriptor, const char * p_msg, int * p_length ); 218 208 219 220 209 /* Running -- flag indicating if the main loop is running, 221 210 ** set to false by terminate message, or various … … 237 226 } 238 227 239 240 228 /* PrepareToRun() -- actions to take prior to entering main loop 241 229 ** … … 277 265 // (WormServerBase) that takes no parameters and returns THREAD_RETURN 278 266 // THREAD_RETURN (WormServerBase::*MyThreadFunction)(void * p_argument); 279 280 267 281 268 public: … … 349 336 350 337 #endif // EWserverbaseH 351 352 -
trunk/include_cpp/simple_mod_base.h
r1334 r7508 1 /*2 * THIS FILE IS UNDER RCS - DO NOT MODIFY UNLESS YOU HAVE3 * CHECKED IT OUT USING THE COMMAND CHECKOUT.4 *5 * $Id$6 *7 * Revision history:8 * $Log$9 * Revision 1.2 2004/03/17 17:31:41 dhanych10 * for RCS11 *12 * Revision 1.1 2003/09/05 19:11:38 dhanych13 * Initial revision14 *15 *16 *17 */18 19 1 /* 20 2 * This is a base class which serves as a template providing … … 30 12 31 13 extern "C" { 32 #include <platform.h> 33 #include <earthworm_defs.h> 34 #include <earthworm_simple_funcs.h> 35 36 /* C++ compilers don't like the earthworm def for thr_ret */ 37 #undef thr_ret 38 #define thr_ret void fun 39 #include <transport.h> /* Ring stuff */ 40 #include <mem_circ_queue.h> 41 14 #include "platform.h" 15 #include "earthworm_defs.h" 16 #include "earthworm_simple_funcs.h" 17 #include "transport.h" /* Ring stuff */ 18 #include "mem_circ_queue.h" 42 19 } 43 20 … … 50 27 #include <threadableobject.h> 51 28 52 53 29 //#pragma warning(disable:4786) // microsoft pragma to avoid messages from cpp stdlib 54 30 //#include <string> // std::string 55 31 //#include <queue> // std::queue 56 57 58 32 59 33 enum WORKER_THREAD_STATUS … … 79 53 #define WORK_THREAD_DEAD_SEC 10 /* number of seconds without worker thread pulse before considered dead */ 80 54 81 82 55 // Default Logging Level 83 56 #define DEF_LOGGING_LEVEL WORM_LOG_DETAILS … … 94 67 // Default millisecond sleep time for Handler thread (if no new message) 95 68 #define DEF_HANDLE_SLEEP_MS 400 96 97 69 98 70 /* … … 101 73 #define SMB_ERR_QUEUE_WRAPPED 1 102 74 #define SMB_ERR_MSG_TOO_LONG 2 103 104 105 75 106 76 //--------------------------------------------------------------------------- … … 212 182 virtual void CheckConfig(); 213 183 214 215 216 // ======================================================================= 184 // ======================================================================= 217 185 // for SimpleModuleBase 218 186 // ======================================================================= … … 276 244 , const char * p_messagetext /* = NULL */ 277 245 ); 278 279 246 280 247 // ======================================================================= 281 248 // METHODS FOR DERIVATIVE CLASSES TO OVER-RIDE TO EXTEND FUNCTIONALITY … … 294 261 */ 295 262 virtual bool PrepareToRun(); 296 297 263 298 264 /* … … 317 283 virtual WORM_STATUS_CODE MainThreadActions() { return WORM_STAT_NOMATCH; } 318 284 319 320 285 /* CheckForFatal -- allows the main loop in the Run() method to query derived 321 286 * classes if a fatal error has been encountered. … … 328 293 */ 329 294 virtual bool CheckForFatal(); 330 331 295 332 296 /* FinishedRunning() -- actions to take after exiting main loop in the … … 352 316 , char * p_messagebody 353 317 ) { return true; } 354 355 318 356 319 // ======================================================================= 357 320 // MAIN METHOD FOR DERIVATIVE CLASSES TO PROVIDE APPLICATION-SPECIFIC … … 373 336 , char * p_messagebody 374 337 ) = 0; 375 376 338 377 339 public: 378 379 340 380 341 // ======================================================================= … … 408 369 } 409 370 } 410 411 371 412 372 // =======================================================================
Note: See TracChangeset
for help on using the changeset viewer.