1 // -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- 2 // vi: set et ts=4 sw=2 sts=2: 3 /****************************************************************************/ 4 /* */ 5 /* File: cw.h */ 6 /* */ 7 /* Purpose: control word definitions header file */ 8 /* */ 9 /* Author: Peter Bastian */ 10 /* Institut fuer Computeranwendungen III */ 11 /* Universitaet Stuttgart */ 12 /* Pfaffenwaldring 27 */ 13 /* 70569 Stuttgart */ 14 /* email: ug@ica3.uni-stuttgart.de */ 15 /* */ 16 /* History: 11.01.95 begin, ug version 3.0 */ 17 /* */ 18 /* Remarks: */ 19 /* */ 20 /****************************************************************************/ 21 22 23 /****************************************************************************/ 24 /* */ 25 /* auto include mechanism and other include files */ 26 /* */ 27 /****************************************************************************/ 28 29 #ifndef __CW__ 30 #define __CW__ 31 32 #include <dune/uggrid/low/namespace.h> 33 34 START_UGDIM_NAMESPACE 35 36 /** @name Macros for the control word management */ 37 /*@{*/ 38 /** \brief maximum number of control words */ 39 #define MAX_CONTROL_WORDS 20 40 /** \brief max number of entries */ 41 #define MAX_CONTROL_ENTRIES 100 42 /*@}*/ 43 44 /** \brief Description of a control word */ 45 typedef struct { 46 47 /** \brief this struct is used */ 48 INT used; 49 50 /** \brief name string */ 51 const char *name; 52 53 /** \brief where in object is it ? */ 54 UINT offset_in_object; 55 56 /** \brief bitwise object ID */ 57 INT objt_used; 58 59 /** \brief used bits */ 60 UINT used_mask; 61 62 } CONTROL_WORD; 63 64 /** \brief Manage part of a control word */ 65 typedef struct { 66 67 /** \brief this struct is used */ 68 INT used; 69 70 /** \brief name string */ 71 const char *name; 72 73 /** \brief pointer to corresponding control word */ 74 INT control_word; 75 76 /** \brief shift in control word */ 77 INT offset_in_word; 78 79 /** \brief number of bits used */ 80 INT length; 81 82 /** \brief bitwise object ID */ 83 INT objt_used; 84 85 /** \brief copy from control word (faster) */ 86 UINT offset_in_object; 87 88 /** \brief 1 where bits are used */ 89 UINT mask; 90 91 /** \brief 0 where bits are used */ 92 UINT xor_mask; 93 94 } CONTROL_ENTRY; 95 96 /** \brief Global array with descriptions */ 97 extern CONTROL_WORD 98 control_words[]; 99 100 /** \brief Predefined control words */ 101 extern CONTROL_ENTRY 102 control_entries[MAX_CONTROL_ENTRIES]; 103 104 /****************************************************************************/ 105 /* */ 106 /* function definitions */ 107 /* */ 108 /****************************************************************************/ 109 110 INT InitCW (void); 111 112 END_UGDIM_NAMESPACE 113 114 #endif 115