- Adapted indenation to new agreed upon system
- Added support for second generation scriptcontext based counter
This commit is contained in:
54
fortify.h
54
fortify.h
@ -24,39 +24,38 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef void (*OutputFuncPtr)(char *);
|
||||
typedef void (*OutputFuncPtr) (char *);
|
||||
|
||||
void *Fortify_malloc(size_t size, char *file, unsigned long line);
|
||||
void *Fortify_realloc(void *ptr, size_t new_size, char *file, unsigned long line);
|
||||
void *Fortify_calloc(size_t num, size_t size, char *file, unsigned long line);
|
||||
void Fortify_free(void *uptr, char *file, unsigned long line);
|
||||
char *Fortify_STRDUP(const char *in, char *file, unsigned long line);
|
||||
void *Fortify_malloc(size_t size, char *file, unsigned long line);
|
||||
void *Fortify_realloc(void *ptr, size_t new_size, char *file,
|
||||
unsigned long line);
|
||||
void *Fortify_calloc(size_t num, size_t size, char *file,
|
||||
unsigned long line);
|
||||
void Fortify_free(void *uptr, char *file, unsigned long line);
|
||||
char *Fortify_STRDUP(const char *in, char *file, unsigned long line);
|
||||
|
||||
int Fortify_OutputAllMemory(char *file, unsigned long line);
|
||||
int Fortify_CheckAllMemory(char *file, unsigned long line);
|
||||
int Fortify_CheckPointer(void *uptr, char *file, unsigned long line);
|
||||
int Fortify_Disable(char *file, unsigned long line);
|
||||
int Fortify_SetMallocFailRate(int Percent);
|
||||
int Fortify_EnterScope(char *file, unsigned long line);
|
||||
int Fortify_LeaveScope(char *file, unsigned long line);
|
||||
int Fortify_DumpAllMemory(int scope, char *file, unsigned long line);
|
||||
int Fortify_OutputAllMemory(char *file, unsigned long line);
|
||||
int Fortify_CheckAllMemory(char *file, unsigned long line);
|
||||
int Fortify_CheckPointer(void *uptr, char *file, unsigned long line);
|
||||
int Fortify_Disable(char *file, unsigned long line);
|
||||
int Fortify_SetMallocFailRate(int Percent);
|
||||
int Fortify_EnterScope(char *file, unsigned long line);
|
||||
int Fortify_LeaveScope(char *file, unsigned long line);
|
||||
int Fortify_DumpAllMemory(int scope, char *file, unsigned long line);
|
||||
|
||||
typedef void (*Fortify_OutputFuncPtr)(const char *);
|
||||
Fortify_OutputFuncPtr Fortify_SetOutputFunc(Fortify_OutputFuncPtr Output);
|
||||
typedef void (*Fortify_OutputFuncPtr) (const char *);
|
||||
Fortify_OutputFuncPtr Fortify_SetOutputFunc(Fortify_OutputFuncPtr
|
||||
Output);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef __FORTIFY_C__ /* Only define the macros if we're NOT in fortify.c */
|
||||
|
||||
#ifdef FORTIFY /* Add file and line information to the fortify calls */
|
||||
|
||||
#ifndef __FORTIFY_C__ /* Only define the macros if we're NOT in fortify.c */
|
||||
#ifdef FORTIFY /* Add file and line information to the fortify calls */
|
||||
#define malloc(size) Fortify_malloc(size, __FILE__, __LINE__)
|
||||
#define realloc(ptr,new_size) Fortify_realloc(ptr, new_size, __FILE__, __LINE__)
|
||||
#define calloc(num,size) Fortify_calloc(num, size, __FILE__, __LINE__)
|
||||
#define free(ptr) Fortify_free(ptr, __FILE__, __LINE__)
|
||||
|
||||
#define Fortify_OutputAllMemory() Fortify_OutputAllMemory(__FILE__, __LINE__)
|
||||
#define Fortify_CheckAllMemory() Fortify_CheckAllMemory(__FILE__, __LINE__)
|
||||
#define Fortify_CheckPointer(ptr) Fortify_CheckPointer(ptr, __FILE__, __LINE__)
|
||||
@ -65,9 +64,7 @@ Fortify_OutputFuncPtr Fortify_SetOutputFunc(Fortify_OutputFuncPtr Output);
|
||||
#define Fortify_LeaveScope() Fortify_LeaveScope(__FILE__, __LINE__)
|
||||
#define Fortify_DumpAllMemory(s) Fortify_DumpAllMemory(s,__FILE__, __LINE__)
|
||||
#define strdup(s) Fortify_STRDUP(s,__FILE__,__LINE__)
|
||||
|
||||
#else /* FORTIFY Define the special fortify functions away to nothing */
|
||||
|
||||
#else /* FORTIFY Define the special fortify functions away to nothing */
|
||||
#define Fortify_OutputAllMemory() 0
|
||||
#define Fortify_CheckAllMemory() 0
|
||||
#define Fortify_CheckPointer(ptr) 1
|
||||
@ -77,7 +74,6 @@ Fortify_OutputFuncPtr Fortify_SetOutputFunc(Fortify_OutputFuncPtr Output);
|
||||
#define Fortify_EnterScope() 0
|
||||
#define Fortify_LeaveScope() 0
|
||||
#define Fortify_DumpAllMemory(s) 0
|
||||
|
||||
#endif /* FORTIFY */
|
||||
#endif /* __FORTIFY_C__ */
|
||||
#endif /* __FORTIFY_H__ */
|
||||
#endif /* FORTIFY */
|
||||
#endif /* __FORTIFY_C__ */
|
||||
#endif /* __FORTIFY_H__ */
|
||||
|
Reference in New Issue
Block a user