Main Page | Modules | Data Structures | File List | Data Fields | Globals | Related Pages

globals.h

Go to the documentation of this file.
00001 #ifdef GLOBALS_LOOKUP_NAME 00002 #undef DEF_GLOBALS 00003 #endif 00004 00005 #ifndef DEF_GLOBALS 00006 #define DEF_GLOBALS 00007 00008 /* ---------------------------------------------------------------------------- 00009 @COPYRIGHT : 00010 Copyright 1993,1994,1995 David MacDonald, 00011 McConnell Brain Imaging Centre, 00012 Montreal Neurological Institute, McGill University. 00013 Permission to use, copy, modify, and distribute this 00014 software and its documentation for any purpose and without 00015 fee is hereby granted, provided that the above copyright 00016 notice appear in all copies. The author and McGill University 00017 make no representations about the suitability of this 00018 software for any purpose. It is provided "as is" without 00019 express or implied warranty. 00020 ---------------------------------------------------------------------------- */ 00021 00022 #include <volume_io.h> 00023 00024 /* ----------------- globals are being defined --------------------- */ 00025 00026 #ifdef GLOBALS_LOOKUP_NAME 00027 00028 #define START_GLOBALS 00029 #define END_GLOBALS 00030 00031 #define DEF_GLOBAL( variable, type, initial ) \ 00032 type variable = initial; 00033 00034 #define DEF_GLOBAL3( variable, type, initial1, initial2, initial3 ) \ 00035 type variable = { initial1, initial2, initial3 }; 00036 00037 #define DEF_GLOBAL5( variable, type, initial1, initial2, initial3, initial4, initial5 ) \ 00038 type variable = { initial1, initial2, initial3, initial4, initial5 }; 00039 00040 #define DEF_GLOBAL_COLOUR( variable ) \ 00041 Colour variable; 00042 00043 #include <global_variables.h> 00044 00045 #undef START_GLOBALS 00046 #undef END_GLOBALS 00047 #undef DEF_GLOBAL 00048 #undef DEF_GLOBAL3 00049 #undef DEF_GLOBAL5 00050 #undef DEF_GLOBAL_COLOUR 00051 00052 /* ----- database of correspondence between globals and string names ----- */ 00053 00054 #include <bicpl/global_lookup.h> 00055 00056 #define START_GLOBALS static global_struct GLOBALS_LOOKUP_NAME[] = { 00057 #define END_GLOBALS }; 00058 00059 #define DEF_GLOBAL( variable, type, initial ) \ 00060 { \ 00061 (void *) &variable, CREATE_STRING(variable), GLUE(type,_type), FALSE\ 00062 }, 00063 00064 #define DEF_GLOBAL3( variable, type, initial1, initial2, initial3 ) \ 00065 DEF_GLOBAL( variable, type, initial1 ) 00066 00067 #define DEF_GLOBAL5( variable, type, i1, i2, i3, i4, i5 ) \ 00068 DEF_GLOBAL( variable, type, i1 ) 00069 00070 #define DEF_GLOBAL_COLOUR( variable ) \ 00071 DEF_GLOBAL( variable, Colour, 0 ) 00072 00073 #include <global_variables.h> 00074 00075 #undef START_GLOBALS 00076 #undef END_GLOBALS 00077 #undef DEF_GLOBAL 00078 #undef DEF_GLOBAL3 00079 #undef DEF_GLOBAL5 00080 #undef DEF_GLOBAL_COLOUR 00081 00082 #else /* GLOBALS_LOOKUP_NAME */ 00083 00084 /* ------ globals are being externed from application code ------------- */ 00085 00086 #define START_GLOBALS 00087 #define END_GLOBALS 00088 00089 #define DEF_GLOBAL( variable, type, initial ) \ 00090 extern type variable; 00091 00092 #define DEF_GLOBAL3( variable, type, i1, i2, i3 ) \ 00093 DEF_GLOBAL( variable, type, i1 ) 00094 00095 #define DEF_GLOBAL5( variable, type, i1, i2, i3, i4, i5 ) \ 00096 DEF_GLOBAL( variable, type, i1 ) 00097 00098 #define DEF_GLOBAL_COLOUR( variable ) \ 00099 extern Colour variable; 00100 00101 #include <global_variables.h> 00102 00103 #undef START_GLOBALS 00104 #undef END_GLOBALS 00105 #undef DEF_GLOBAL 00106 #undef DEF_GLOBAL3 00107 #undef DEF_GLOBAL5 00108 #undef DEF_GLOBAL_COLOUR 00109 00110 #endif /* GLOBALS_LOOKUP_NAME */ 00111 00112 #undef GLOBALS_LOOKUP_NAME 00113 00114 #endif

Generated on Wed Jul 28 09:10:57 2004 for BICPL by doxygen 1.3.7