]> rtime.felk.cvut.cz Git - orte.git/blob - orte/include/defines.h
Reformat the sources with orte/uncrustify script
[orte.git] / orte / include / defines.h
1 /*
2  *  $Id: defines.h,v 0.0.0.1            2003/08/21
3  *
4  *  -------------------------------------------------------------------
5  *                                ORTE
6  *                      Open Real-Time Ethernet
7  *
8  *                      Copyright (C) 2001-2006
9  *  Department of Control Engineering FEE CTU Prague, Czech Republic
10  *                      http://dce.felk.cvut.cz
11  *                      http://www.ocera.org
12  *
13  *  Author:              Petr Smolik    petr@smoliku.cz
14  *  Advisor:             Pavel Pisa
15  *  Project Responsible: Zdenek Hanzalek
16  *  --------------------------------------------------------------------
17  *
18  *  This program is free software; you can redistribute it and/or modify
19  *  it under the terms of the GNU General Public License as published by
20  *  the Free Software Foundation; either version 2 of the License, or
21  *  (at your option) any later version.
22  *
23  *  This program is distributed in the hope that it will be useful,
24  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
25  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
26  *  GNU General Public License for more details.
27  *
28  */
29
30 #ifndef _DEFINES_H
31 #define _DEFINES_H
32
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36
37 #define RTPS_DEFAULT_PORT           7400
38
39 #define MAX_PARAMETER_LOCAL_LENGTH  8     //min 8 bytes !!!
40
41
42 //#define ENABLE_MEM_CHECK
43
44 //////////////////////////////////////////////////////////////////////////////
45 // Debug
46 #define MAX_DEBUG_SECTIONS          100
47 #define MAX_DEBUG_LEVEL             10
48 #define debug(SECTION, LEVEL) \
49   ((LEVEL) > MAX_DEBUG_LEVEL) ? (void)0 : \
50   ((db_level = (LEVEL)) > debugLevels[SECTION]) ? (void)0 : db_print
51 #ifndef ENABLE_MEM_CHECK
52   #define MALLOC malloc
53   #define FREE   free
54 #else
55   #define MALLOC mem_check_malloc
56   #define FREE   mem_check_free
57 #endif
58
59 //////////////////////////////////////////////////////////////////////////////
60 // fnmatch
61 // We #undef these before defining them because some losing systems
62 // (HP-UX A.08.07 for example) define these in <unistd.h>.
63 #undef  FNM_PATHNAME
64 #undef  FNM_NOESCAPE
65 #undef  FNM_PERIOD
66 /* Bits set in the FLAGS argument to `fnmatch'.  */
67 #define FNM_PATHNAME    (1 << 0) /* No wildcard can ever match `/'.  */
68 #define FNM_NOESCAPE    (1 << 1) /* Backslashes don't quote special chars.  */
69 #define FNM_PERIOD  (1 << 2) /* Leading `.' is matched only explicitly.  */
70 #define FNM_FILE_NAME   FNM_PATHNAME /* Preferred GNU name.  */
71 #define FNM_LEADING_DIR (1 << 3) /* Ignore `/...' after a match.  */
72 #define FNM_CASEFOLD    (1 << 4) /* Compare without regard to case.  */
73 /* Value returned by `fnmatch' if STRING does not match PATTERN.  */
74 #define FNM_NOMATCH 1
75
76 //////////////////////////////////////////////////////////////////////////////
77 // Hash
78 #define HASH_LOADFACTOR  0.8
79 // Deleted entry indicator
80 #define HASH_EMPTY       0x00000000
81 #define HASH_INUSE       0x11111111
82 #define HASH_DELETED     0xffffffff
83
84 #define GUID_PRINTF(g) (g).hid, (g).aid, (g).oid
85
86
87 #ifdef __cplusplus
88 } /* extern "C"*/
89 #endif
90
91 #endif /* _DEFINES_H */