michael@0: /* michael@0: * Header file of Pure API function declarations. michael@0: * michael@0: * (C) Copyright IBM Corporation. 2006, 2006. All Rights Reserved. michael@0: * You may recompile and redistribute these definitions as required. michael@0: * michael@0: * Version 1.0 michael@0: */ michael@0: michael@0: #if defined(PURIFY) || defined(QUANTIFY) michael@0: michael@0: #if defined(c_plusplus) || defined(__cplusplus) michael@0: extern "C" { michael@0: #endif michael@0: michael@0: // Don't include this file directly, use purify.h instead. michael@0: // If you need something that's not there, add it. michael@0: #ifdef PURIFY_PRIVATE_INCLUDE michael@0: michael@0: #define PURE_H_VERSION 1 michael@0: #include michael@0: michael@0: ////////////////////////////// michael@0: // API's Specific to Purify // michael@0: ////////////////////////////// michael@0: michael@0: // TRUE when Purify is running. michael@0: int __cdecl PurifyIsRunning(void) ; michael@0: // michael@0: // Print a string to the viewer. michael@0: // michael@0: int __cdecl PurePrintf(const char *fmt, ...) ; michael@0: int __cdecl PurifyPrintf(const char *fmt, ...) ; michael@0: // michael@0: // Purify functions for leak and memory-in-use functionalty. michael@0: // michael@0: size_t __cdecl PurifyNewInuse(void) ; michael@0: size_t __cdecl PurifyAllInuse(void) ; michael@0: size_t __cdecl PurifyClearInuse(void) ; michael@0: size_t __cdecl PurifyNewLeaks(void) ; michael@0: size_t __cdecl PurifyAllLeaks(void) ; michael@0: size_t __cdecl PurifyClearLeaks(void) ; michael@0: // michael@0: // Purify functions for handle leakage. michael@0: // michael@0: size_t __cdecl PurifyAllHandlesInuse(void) ; michael@0: size_t __cdecl PurifyNewHandlesInuse(void) ; michael@0: // michael@0: // Functions that tell you about the state of memory. michael@0: // michael@0: size_t __cdecl PurifyDescribe(void *addr) ; michael@0: size_t __cdecl PurifyWhatColors(void *addr, size_t size) ; michael@0: // michael@0: // Functions to test the state of memory. If the memory is not michael@0: // accessable, an error is signaled just as if there were a memory michael@0: // reference and the function returns false. michael@0: // michael@0: int __cdecl PurifyAssertIsReadable(const void *addr, size_t size) ; // size used to be an int, until IA64 came along michael@0: int __cdecl PurifyAssertIsWritable(const void *addr, size_t size) ; michael@0: // michael@0: // Functions to test the state of memory. If the memory is not michael@0: // accessable, these functions return false. No error is signaled. michael@0: // michael@0: int __cdecl PurifyIsReadable(const void *addr, size_t size) ; michael@0: int __cdecl PurifyIsWritable(const void *addr, size_t size) ; michael@0: int __cdecl PurifyIsInitialized(const void *addr, size_t size) ; michael@0: // michael@0: // Functions to set the state of memory. michael@0: // michael@0: void __cdecl PurifyMarkAsInitialized(void *addr, size_t size) ; michael@0: void __cdecl PurifyMarkAsUninitialized(void *addr, size_t size) ; michael@0: // michael@0: // Functions to do late detection of ABWs, FMWs, IPWs. michael@0: // michael@0: #define PURIFY_HEAP_CRT (HANDLE) ~(__int64) 1 /* 0xfffffffe */ michael@0: #define PURIFY_HEAP_ALL (HANDLE) ~(__int64) 2 /* 0xfffffffd */ michael@0: #define PURIFY_HEAP_BLOCKS_LIVE 0x80000000 michael@0: #define PURIFY_HEAP_BLOCKS_DEFERRED_FREE 0x40000000 michael@0: #define PURIFY_HEAP_BLOCKS_ALL (PURIFY_HEAP_BLOCKS_LIVE|PURIFY_HEAP_BLOCKS_DEFERRED_FREE) michael@0: int __cdecl PurifyHeapValidate(unsigned int hHeap, unsigned int dwFlags, const void *addr) ; michael@0: int __cdecl PurifySetLateDetectScanCounter(int counter); michael@0: int __cdecl PurifySetLateDetectScanInterval(int seconds); michael@0: // michael@0: // Functions to support pool allocators michael@0: // michael@0: void __cdecl PurifySetPoolId(const void *mem, int id); michael@0: int __cdecl PurifyGetPoolId(const void *mem); michael@0: void __cdecl PurifySetUserData(const void *mem, void *data); michael@0: void * __cdecl PurifyGetUserData(const void *mem); michael@0: void __cdecl PurifyMapPool(int id, void(*fn)()); michael@0: michael@0: michael@0: //////////////////////////////// michael@0: // API's Specific to Quantify // michael@0: //////////////////////////////// michael@0: michael@0: // TRUE when Quantify is running. michael@0: int __cdecl QuantifyIsRunning(void) ; michael@0: michael@0: // michael@0: // Functions for controlling collection michael@0: // michael@0: int __cdecl QuantifyDisableRecordingData(void) ; michael@0: int __cdecl QuantifyStartRecordingData(void) ; michael@0: int __cdecl QuantifyStopRecordingData(void) ; michael@0: int __cdecl QuantifyClearData(void) ; michael@0: int __cdecl QuantifyIsRecordingData(void) ; michael@0: michael@0: // Add a comment to the dataset michael@0: int __cdecl QuantifyAddAnnotation(char *) ; michael@0: michael@0: // Save the current data, creating a "checkpoint" dataset michael@0: int __cdecl QuantifySaveData(void) ; michael@0: michael@0: // Set the name of the current thread in the viewer michael@0: int __cdecl QuantifySetThreadName(char *) ; michael@0: michael@0: //////////////////////////////// michael@0: // API's Specific to Coverage // michael@0: //////////////////////////////// michael@0: michael@0: // TRUE when Coverage is running. michael@0: int __cdecl CoverageIsRunning(void) ; michael@0: // michael@0: // Functions for controlling collection michael@0: // michael@0: int __cdecl CoverageDisableRecordingData(void) ; michael@0: int __cdecl CoverageStartRecordingData(void) ; michael@0: int __cdecl CoverageStopRecordingData(void) ; michael@0: int __cdecl CoverageClearData(void) ; michael@0: int __cdecl CoverageIsRecordingData(void) ; michael@0: // Add a comment to the dataset michael@0: int __cdecl CoverageAddAnnotation(char *) ; michael@0: michael@0: // Save the current data, creating a "checkpoint" dataset michael@0: int __cdecl CoverageSaveData(void) ; michael@0: michael@0: michael@0: #endif // PURIFY_PRIVATE_INCLUDE michael@0: michael@0: #if defined(c_plusplus) || defined(__cplusplus) michael@0: } michael@0: #endif michael@0: michael@0: #endif // defined(PURIFY) || defined(QUANTIFY)