Changeset 21916 for trunk/include/_ras.h
- Timestamp:
- Dec 18, 2011, 10:28:22 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:ignore
-
old new 1 bin 2 Makefile.inc 1 env.cmd 2 LocalConfig.kmk
-
-
Property svn:mergeinfo
set to
/branches/gcc-kmk merged eligible
- Property svn:ignore
-
trunk/include/_ras.h
r21301 r21916 15 15 #ifdef RAS 16 16 17 #ifdef __cplusplus 18 extern "C" { 19 #endif 20 17 21 /* The RAS subsystem initialization/deinitialization */ 18 22 … … 20 24 HMODULE hmod /* the custom dll handle */ 21 25 ); 22 26 23 27 void WIN32API RasUninitialize ( 24 28 void … … 33 37 ULONG cb /* size of event specific data */ 34 38 ); 35 39 36 40 /* RAS events */ 37 41 #define RAS_EVENT_Kernel32InitComplete (1) … … 43 47 typedef void WIN32API FNCLF (ULONG h); 44 48 typedef void WIN32API FNWL (ULONG h, char *buf, ULONG buflen); 45 49 46 50 /* Tracked objects logging functions typedefs */ 47 typedef void WIN32API FNRASLOG_EXTERNAL (char *fmt, ...);51 typedef void WIN32API_VA FNRASLOG_EXTERNAL (const char *fmt, ...); 48 52 49 53 typedef ULONG WIN32API FNLOC (ULONG objident, ULONG objhandle, void *objdata, ULONG cbobjdata, FNRASLOG_EXTERNAL *pRasLog); … … 62 66 void WIN32API RasRegisterObjectTracking ( 63 67 RAS_TRACK_HANDLE *ph, /* returned handle */ 64 c har *objname,/* arbitrary distinguishable object name */68 const char *objname, /* arbitrary distinguishable object name */ 65 69 ULONG cbuserdata, /* extra data size */ 66 70 ULONG flags, /* object tracking flags */ … … 68 72 FNCOC *pfnCompareObjectContent /* custom function to compare two objects */ 69 73 ); 70 74 71 75 void WIN32API RasDeregisterObjectTracking ( 72 76 RAS_TRACK_HANDLE h /* handle previously returned by RasRegisterObjectTracking */ 73 77 ); 74 78 75 79 ULONG WIN32API RasAddObject ( /* returns unique object ident */ 76 80 RAS_TRACK_HANDLE h, /* handle previously returned by RasRegisterObjectTracking */ … … 79 83 ULONG cbobjdata /* size of object */ 80 84 ); 81 85 82 86 void WIN32API RasTrackMemAlloc ( 83 87 RAS_TRACK_HANDLE h, /* handle previously returned by RasRegisterObjectTracking */ 84 88 ULONG size 85 89 ); 86 90 87 91 void WIN32API RasTrackMemRealloc ( 88 92 RAS_TRACK_HANDLE h, /* handle previously returned by RasRegisterObjectTracking */ … … 90 94 ULONG newsize 91 95 ); 92 96 93 97 void WIN32API RasTrackMemFree ( 94 98 RAS_TRACK_HANDLE h, /* handle previously returned by RasRegisterObjectTracking */ 95 99 ULONG size 96 100 ); 97 101 98 102 void WIN32API RasRemoveObject ( 99 103 RAS_TRACK_HANDLE h, /* handle previously returned by RasRegisterObjectTracking */ 100 104 ULONG objhandle /* distinctive handle of the object */ 101 105 ); 102 106 103 107 void WIN32API RasSetObjectUserData ( 104 108 RAS_TRACK_HANDLE h, /* handle previously returned by RasRegisterObjectTracking */ … … 108 112 ULONG *pcbdataret /* returned size of data actually saved */ 109 113 ); 110 114 111 115 void WIN32API RasQueryObjectUserData ( 112 116 RAS_TRACK_HANDLE h, /* handle previously returned by RasRegisterObjectTracking */ … … 127 131 128 132 /* RAS logging channels */ 129 typedef struct _RAS_LOG_CHANNEL;130 133 typedef struct _RAS_LOG_CHANNEL *RAS_LOG_CHANNEL_H; 131 134 … … 135 138 const char *filename /* file name to log to */ 136 139 ); 137 140 138 141 void WIN32API RasWriteLogChannel ( 139 142 RAS_LOG_CHANNEL_H hchannel, /* log channel handle returned by RasOpenLogChannel */ … … 147 150 148 151 /* RAS logging functions */ 149 void WIN32API RasLog (150 c har *fmt,/* 'printf' style format string */151 ... 152 ); 153 154 void WIN32API RasLogNoEOL (155 c har *fmt, /* 'printf' style format string */152 void WIN32API_VA RasLog ( 153 const char *fmt, /* 'printf' style format string */ 154 ... 155 ); 156 157 void WIN32API_VA RasLogNoEOL ( 158 const char *fmt, /* 'printf' style format string */ 156 159 ... 157 160 ); … … 162 165 ULONG parm2 /* message parameter 2 */ 163 166 ); 164 167 165 168 #define RAS_FLAG_LOG_OBJECTS (0x1) 166 169 … … 170 173 ); 171 174 172 void WIN32API RasLog2 (175 void WIN32API_VA RasLog2 ( 173 176 RAS_LOG_CHANNEL_H hchannel, /* log channel to log to */ 174 177 char *fmt, /* 'printf' style format string */ … … 176 179 ); 177 180 178 void WIN32API RasLogNoEOL2 (181 void WIN32API_VA RasLogNoEOL2 ( 179 182 RAS_LOG_CHANNEL_H hchannel, /* log channel to log to */ 180 char *fmt, /* 'printf' style format string */ 183 char *fmt, /* 'printf' style format string */ 181 184 ... 182 185 ); … … 188 191 ULONG parm2 /* message parameter 2 */ 189 192 ); 190 193 191 194 /* RAS replacement for C runtime sprintf function */ 195 #ifdef __GNUC__ 196 int WIN32API_VA ras_snprintf ( 197 #else 192 198 int WIN32API snprintf ( 199 #endif 193 200 char *buf, /* memory buffer for formatted string */ 194 201 int n, /* length of memeory buffer */ 195 const char *fmt, /* 'printf' style format string */ 202 const char *fmt, /* 'printf' style format string */ 196 203 ... 197 204 ); 198 205 199 206 /* Tracked object counting function */ 200 207 void WIN32API RasCountObjects ( … … 215 222 * any external API (OS/2 and or C runtime functions). 216 223 */ 217 224 218 225 typedef struct _RASCONTEXT 219 226 { … … 238 245 ); 239 246 247 #ifdef __cplusplus 248 } // extern "C" 249 #endif 240 250 241 251 /* RAS entries that are passed to plugin to use … … 245 255 ULONG cb; 246 256 247 void (* WIN32API RasRegisterObjectTracking) (RAS_TRACK_HANDLE *ph, c har *objname, ULONG cbuserdata, ULONG flags, FNLOC *pfnLogObjectContent, FNCOC *pfnCompareObjectContent);257 void (* WIN32API RasRegisterObjectTracking) (RAS_TRACK_HANDLE *ph, const char *objname, ULONG cbuserdata, ULONG flags, FNLOC *pfnLogObjectContent, FNCOC *pfnCompareObjectContent); 248 258 void (* WIN32API RasDeregisterObjectTracking) (RAS_TRACK_HANDLE h); 249 259 ULONG (* WIN32API RasAddObject) (RAS_TRACK_HANDLE h, ULONG objhandle, void *objdata, ULONG cbobjdata); … … 256 266 void (* WIN32API RasWriteLogChannel) (RAS_LOG_CHANNEL_H hchannel, const char *msg, ULONG length); 257 267 void (* WIN32API RasCloseLogChannel) (RAS_LOG_CHANNEL_H hchannel); 258 void (* WIN32API RasLog) (RAS_LOG_CHANNEL_H hchannel, char *fmt, ...);259 void (* WIN32API RasLogNoEOL) (RAS_LOG_CHANNEL_H hchannel, char *fmt, ...);268 void (* WIN32API_VA RasLog) (RAS_LOG_CHANNEL_H hchannel, char *fmt, ...); 269 void (* WIN32API_VA RasLogNoEOL) (RAS_LOG_CHANNEL_H hchannel, char *fmt, ...); 260 270 void (* WIN32API RasLogMsg) (RAS_LOG_CHANNEL_H hchannel, ULONG msg, ULONG parm1, ULONG parm2); 261 int (* WIN32API snprintf) (char *buf, int n, const char *fmt, ...);271 int (* WIN32API_VA snprintf) (char *buf, int n, const char *fmt, ...); 262 272 void (* WIN32API RasSaveContext) (RASCONTEXT *pcontext); 263 273 void (* WIN32API RasRestoreContext) (RASCONTEXT *pcontext); … … 269 279 void (* WIN32API RasTrackMemFree) (RAS_TRACK_HANDLE h, ULONG size); 270 280 RAS_TRACK_HANDLE (* WIN32API RasGetTrackHandle) (const char *objname); 271 281 272 282 } RasEntryTable; 273 283 … … 286 296 287 297 /* RAS breakpoint support */ 298 #if defined(__GNUC__) 299 #include <sys/builtin.h> 300 #else 288 301 #include <builtin.h> 302 #endif 289 303 290 304 #ifdef __cplusplus … … 299 313 #define RasDebugInt3_x(a, b, c) RasBreakPoint(__FILE__, __FUNCTION__, __LINE__, a, b, c) 300 314 301 void __INLINE RasBreakPoint (c har *szFile,char *szFunction, int iLine, ULONG msg, ULONG parm1, ULONG parm2)315 void __INLINE RasBreakPoint (const char *szFile, const char *szFunction, int iLine, ULONG msg, ULONG parm1, ULONG parm2) 302 316 { 303 317 RasLog ("BreakPoint at %s(%d)::%s", szFile, iLine, szFunction);
Note:
See TracChangeset
for help on using the changeset viewer.