2 * $Id: defines.h,v 0.0.0.1 2003/08/21
4 * AUTHOR: Petr Smolik petr.smolik@wo.cz
6 * ORTE - OCERA Real-Time Ethernet http://www.ocera.org/
7 * --------------------------------------------------------------------
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
28 #define RTPS_DEFAULT_PORT 7400
30 #define MAX_PARAMETER_LOCAL_LENGTH 8 //min 8 bytes !!!
32 #define MAX_STRING_IPADDRESS_LENGTH 4*3+3+1
34 //#define ENABLE_MEM_CHECK
36 //////////////////////////////////////////////////////////////////////////////
38 #define MAX_DEBUG_SECTIONS 100
39 #define MAX_DEBUG_LEVEL 10
40 #define debug(SECTION, LEVEL) \
41 ((LEVEL) > MAX_DEBUG_LEVEL) ? (void) 0 : \
42 ((db_level = (LEVEL)) > debugLevels[SECTION]) ? (void) 0 : db_print
43 #ifndef ENABLE_MEM_CHECK
47 #define MALLOC mem_check_malloc
48 #define FREE mem_check_free
51 //////////////////////////////////////////////////////////////////////////////
53 // We #undef these before defining them because some losing systems
54 // (HP-UX A.08.07 for example) define these in <unistd.h>.
58 /* Bits set in the FLAGS argument to `fnmatch'. */
59 #define FNM_PATHNAME (1 << 0) /* No wildcard can ever match `/'. */
60 #define FNM_NOESCAPE (1 << 1) /* Backslashes don't quote special chars. */
61 #define FNM_PERIOD (1 << 2) /* Leading `.' is matched only explicitly. */
62 #define FNM_FILE_NAME FNM_PATHNAME /* Preferred GNU name. */
63 #define FNM_LEADING_DIR (1 << 3) /* Ignore `/...' after a match. */
64 #define FNM_CASEFOLD (1 << 4) /* Compare without regard to case. */
65 /* Value returned by `fnmatch' if STRING does not match PATTERN. */
68 //////////////////////////////////////////////////////////////////////////////
70 #define HASH_LOADFACTOR 0.8
71 // Deleted entry indicator
72 #define HASH_EMPTY 0x00000000
73 #define HASH_INUSE 0x11111111
74 #define HASH_DELETED 0xffffffff
76 //////////////////////////////////////////////////////////////////////////////
79 /* Swap bytes in 16 bit value. */
81 ((((x) >> 8) & 0xff) | (((x) & 0xff) << 8))
83 /* Swap bytes in 32 bit value. */
85 ((((x) & 0xff000000) >> 24) | (((x) & 0x00ff0000) >> 8) | \
86 (((x) & 0x0000ff00) << 8) | (((x) & 0x000000ff) << 24))
93 #endif /* _DEFINES_H */