File: MacOSXCommon.c

package info (click to toggle)
openmohaa 0.82.1%2Bdfsg-1
  • links: PTS, VCS
  • area: contrib
  • in suites: forky, sid
  • size: 34,192 kB
  • sloc: cpp: 315,720; ansic: 275,789; sh: 312; xml: 246; asm: 141; makefile: 7
file content (47 lines) | stat: -rw-r--r-- 1,013 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#include "../gsCommon.h"
#include "../gsMemory.h"
#include "../gsDebug.h"

// sample common entry point
extern int test_main(int argc, char ** argp); 

// Debug output
#ifdef GSI_COMMON_DEBUG
static void DebugCallback(GSIDebugCategory theCat, GSIDebugType theType,
						  GSIDebugLevel theLevel, const char * theTokenStr,
						  va_list theParamList)

{
	GSI_UNUSED(theLevel);
	{
		static char    string[256];
		vsprintf(string, theTokenStr, theParamList); 			
		printf(string);
	}
	printf("[%s][%s] ", 
		   gGSIDebugCatStrings[theCat], 
		   gGSIDebugTypeStrings[theType]);
	
	vprintf(theTokenStr, theParamList);
}
#endif

// Common entry point
int main(int argc, char** argp)
{
	int		ret		= 0;
	// set up memanager
	//void	*heap	= (void*)gsiMemManagedInit();
	
#ifdef GSI_COMMON_DEBUG
	// Set up debugging
	gsSetDebugCallback(DebugCallback);
	gsSetDebugLevel(GSIDebugCat_All, GSIDebugType_All,    GSIDebugLevel_Verbose);
#endif
	
	ret = test_main(argc, argp);
	
	//gsiMemManagedClose(heap);
	
	return ret;
}