00001
00022 #ifndef INC_MI32_MCB_H
00023 #define INC_MI32_MCB_H
00024
00025 #ifndef INC_MI32_MICALLBACKLIST_H
00026 #include <mi32/micallbacklist.h>
00027 #endif
00028
00029 #ifdef MISYSTEMDLL
00030 #define LIBEXPORT MI_DLLEXPORT
00031 #else
00032 #define LIBEXPORT MI_DLLIMPORT
00033 #endif
00034
00035
00037 struct McbAnyCallbackStruct {
00038 UINT32 reason;
00039
00040 McbAnyCallbackStruct (
00041 UINT32 ireason = 0
00042 ):
00043 reason(ireason)
00044 { }
00045 };
00046
00047
00048 typedef void (*McbCallbackFunc)(McbAnyCallbackStruct*,void*);
00049
00050
00051 #if defined(__cplusplus)
00052
00053 extern "C" {
00054 #endif
00055
00056 struct McbLIST;
00057
00058 #define MCB_PriorityNormal 0
00059
00064 DEPRECATED LIBEXPORT int McbAddCallbackExt (
00065 McbLIST *cblist,
00066 McbCallbackFunc cbfunc,
00067 void *cbdata,
00068 UINT32 reasonmask,
00069 INT8 priority
00070 );
00071
00075 DEPRECATED LIBEXPORT int McbAddCallback (
00076 McbLIST *cblist,
00077 McbCallbackFunc cbfunc,
00078 void *cbdata,
00079 UINT32 reasonmask
00080 );
00081
00089 DEPRECATED LIBEXPORT void McbCallCallbacks (
00090 McbLIST *cblist,
00091 McbAnyCallbackStruct *cbstruct,
00092 UINT32 reason
00093 );
00094
00099 DEPRECATED LIBEXPORT int McbHasCallbacks (
00100 McbLIST *cblist,
00101 UINT32 reason
00102 );
00103
00106 DEPRECATED LIBEXPORT void McbRemoveAllCallbacks (
00107 McbLIST *cblist
00108 );
00109
00118 DEPRECATED LIBEXPORT void McbRemoveCallback (
00119 McbLIST *cblist,
00120 McbCallbackFunc cbfunc,
00121 void *cbdata,
00122 UINT32 reasonmask
00123 );
00124
00125 #if defined(__cplusplus)
00126 }
00127 #endif
00128
00129 #ifndef GENERATING_DOXYGEN_OUTPUT
00130
00131 struct McbREC {
00132 McbCallbackFunc cbfunc;
00133 void *cbdata;
00134 UINT32 ReasonMask;
00135 INT8 Priority;
00136 McbREC *next;
00137 };
00138 #endif
00139
00142 DEPRECATED struct McbLIST {
00143
00144 #ifndef GENERATING_DOXYGEN_OUTPUT
00146 McbREC *first;
00147 McbREC *last;
00148 UINT16 callcount;
00149 UINT16 didremove;
00150 #endif
00151
00152
00153
00154 McbLIST (
00155 ):
00156 first(0),
00157 last(0),
00158 callcount(0),
00159 didremove(0)
00160 { }
00161
00162 ~McbLIST (
00163 ) {
00164 #ifdef WIN32
00165 #pragma warning (disable:4996)
00166 #endif
00167 McbRemoveAllCallbacks(this);
00168 #ifdef WIN32
00169 #pragma warning (default:4996)
00170 #endif
00171 }
00172 };
00173
00174 #undef LIBEXPORT
00175
00176 #endif // INC_MI32_MCB_H