Esempio n. 1
0
extern "C" int MAMain() {
    InitConsole();
    gConsoleLogging = 1;
    printf("Hello World!\n");
    writeAFile("");
    FREEZE;
}
Esempio n. 2
0
extern "C" int MAMain() {
	InitConsole();
	gConsoleLogging = 1;
	scan();
	Freeze(0);
	return 0;
}
Esempio n. 3
0
int MAMain() {
	InitConsole();
	gConsoleLogging = 1;
	printf("Hello World!\n");
	printf("test1: %f\n", mxTest1());
	FREEZE;
}
Esempio n. 4
0
extern "C" int MAMain() {
	InitConsole();
	gConsoleLogging = 1;
	printf("Hello World!\n");
	tryToRead();
	FREEZE;
}
Esempio n. 5
0
CBoxProxyView::CBoxProxyView()
{
	InitConsole();
	// TODO: 在此处添加构造代码
	configPara.align_threshold=0.01;
	configPara.penetrate_threshold=0.01;
	configPara.touch_threshold=0.02;
	configPara.visibility_extension=0.3;
	configPara.visible_point_threshold=100;
	configPara.ground_touch_threshold=0.1;
	configPara.error_threshold=3e-5;
	cI.setPara(configPara);
	cam.defaultInit();
	defaultFileName="xml/scene1.xml";
	MouseDown=false;
	up=1;
	angle1=90;
	angle2=0;
	dist=5;
	cX=0;
	cY=0;
	cZ=0;
	testMode=false;
	gettingDepth=false;
	GraphCreated=false;
	GraphFinished=false;
	showExtend=true;
	showOrig=true;
	viewDepthMap=NULL;
	myDepthMap=NULL;
	testDepthMap=NULL;
	conGraph=NULL;
}
Esempio n. 6
0
extern "C" int MAMain()
{
	InitConsole();
	gConsoleLogging = 1;
	Moblet::run(new SMV());
	return 0;
}
Esempio n. 7
0
extern "C" int MAMain() {
	int discoveryState;
	InitConsole();
	gConsoleLogging = 1;

	printf("Hello World!\n");
	discoveryState = maWlanStartDiscovery();
	printf("WLAN: %i\n", discoveryState);
	
	while(1) {
		maWait(0);
		MAEvent event;
		if(maGetEvent(&event)) {
			if(event.type == EVENT_TYPE_CLOSE)
				break;
			if(event.type == EVENT_TYPE_KEY_PRESSED) {
				if(event.key == MAK_0)
					break;
				if(event.key == MAK_FIRE && discoveryState == 1) {
					discoveryState = maWlanStartDiscovery();
					printf("WLAN: %i\n", discoveryState);
				}
			}
			if(event.type == EVENT_TYPE_WLAN) {
				printf("State %i\n", event.state);
				dumpAllAvailableAps();
				printf("Done.\n");
				discoveryState = event.state;
			}
		}
	}
	return 0;
}
Esempio n. 8
0
extern "C" int MAMain() {
	int res;

	InitConsole();

	printf("CreateData\n");
	maCreateData(RES, 386);
	printf("DestroyObject\n");
	maDestroyObject(RES);

	printf("HTTP GET\n");
	//res = myHttpGetToObject(1, "http://dev.mopix.se:8080/testing/mobile.php");
	{
		MAUtil::HttpGetToObject http("http://link.astando.se/astwms/Request.aspx?REQUEST=GetMap&SERVICE=WMS&VERSION=1.1.1&LAYERS=TO_Vattenytor,TO_Oppen_mark,TO_Byggnadsytor,TO_Vagkonturer,Vagkanter,TO_Geografiska_texter,TO_Allm_byggnadsnamn,Gatunamn&STYLES=&FORMAT=png&BGCOLOR=0xFF0000&TRANSPARENT=TRUE&SRS=EPSG:3152&BBOX=78202.0228224145,99374.2252203757,79546.909389597,100413.827113304&WIDTH=240&HEIGHT=188&reaspect=false", RES);
		res = http.state();
		while(res == 0) {
			EVENT event;
			maWait(0);
			while(maGetEvent(&event)) {
				if(event.type == EVENT_TYPE_CLOSE ||
					(event.type == EVENT_TYPE_KEY_PRESSED && event.key == MAK_0))
				{
					maExit(0);
				} else if(event.type == EVENT_TYPE_CONN) {
					printf("cE %i %i %i\n", event.conn.handle, event.conn.opType, event.conn.result);
					http.notify(event.conn);
					res = http.state();
				}
			}
		}
	}
	printf("Got %i\n", res);
	FREEZE;
}
Esempio n. 9
0
void AppWnd::Init()
{
	InitConsole();
	InitWindow();

	Application = new AppTest();
	Application->Init(WindowHandle);
}
Esempio n. 10
0
File: main.c Progetto: Felard/MoSync
int MAMain() {
	InitConsole();

	printf("Battery Status: %i\n", maGetBatteryCharge());

	FREEZE;
	return 0;
}
Esempio n. 11
0
File: main.c Progetto: Felard/MoSync
int MAMain() {
	InitConsole();
	gConsoleLogging = 1;

	int res = maSendTextSMS("0763113276", "Hello World!");
	printf("Result: %i\n", res);
	FREEZE;
}
Esempio n. 12
0
extern "C" int MAMain() {
	InitConsole();
	gConsoleLogging = 1;
	printf("Hello World!\n");
	bool res = writeAFile("");
	printf("Done, %i. Press 0 to exit.\n", res);
	FREEZE;
}
Esempio n. 13
0
int CMPlugin::Load()
{
	g_plugin.registerIcon("Console", iconList);

	InitCommonControls();
	InitConsole();
	return 0;
}
Esempio n. 14
0
/*
 * Initialize the VM/CNSconsole.
 */
errr init_vme(void)
{
	register i;

	term *t = &term_screen_body;

	short blank = ' ';

	static int done = FALSE;

	/* Paranoia -- Already done */
	if (done) return (-1);

	/* Build a "wiper line" of blank spaces */
	for (i = 0; i < 256; i++) wiper[i] = blank;

	/* Acquire the size of the screen */
	rows = 25;
	cols = 80;

	/* Initialize the console */
	InitConsole();

	/* Wipe the screen */
	for (i = 0; i < rows; i++)
	{
		/* Wipe that row */
		memcpy(VirtualScreen + (i*cols), wiper, cols);
		memset(ScreenAttr + (i*cols), 0xF1, cols);
	}

	/* Erase the screen */
	ScreenClear();

	/* Initialize the term -- very large key buffer */
	term_init(t, cols, rows - 1, 1024);

	/* Prepare the init/nuke hooks */
	t->nuke_hook = Term_nuke_vm;

	/* Connect the hooks */
	t->text_hook = Term_text_vm;
	t->wipe_hook = Term_wipe_vm;
	t->curs_hook = Term_curs_vm;
	t->xtra_hook = Term_xtra_vm;

	/* Save it */
	term_screen = t;

	/* Activate it */
	Term_activate(term_screen);

	/* Done */
	done = TRUE;

	/* Success */
	return 0;
}
Esempio n. 15
0
extern "C" void __declspec(dllexport) CALLBACK RunTests(HWND hwnd, HINSTANCE hinst, LPSTR lpszCmdLine, int nCmdShow)
{
	InitConsole();

	std::cout << "cmd-line: " << lpszCmdLine << std::endl;
	std::cout << "Running test listFiles on file " << lpszCmdLine << ":" << std::endl;
	listFiles(lpszCmdLine);
	system("PAUSE");
}
Esempio n. 16
0
int  DumpObject::SizeAlloc(AG_SizeAlloc *a)
{
    int w,h;
    if(a == NULL) return -1;
    w = a->w / CHRW;
    h = a->h / CHRH;
    if((w <= 0) || (h <= 0)) return -1;
    InitConsole(w, h);
    return 0;
}
Esempio n. 17
0
void InitAllHooks()
{
	Utilits.HookThis((DWORD)&External_GameMainInit,oGameMainInit);
	Hooks.LoadAll();
	Configs.LoadAll();
	Fixes.Load();
#if ( DebugConsole == 1)
	InitConsole();
#endif
}
Esempio n. 18
0
int main(int argc, char *argv[])
{
#ifdef my_Debug
	InitConsole();
#endif
	QApplication a(argc, argv);
	HardDiskSearch w;
	w.show();
	return a.exec();
}
Esempio n. 19
0
extern "C" __declspec(dllexport) int Load(void)
{
	mir_getLP(&pluginInfoEx);

	Icon_Register(hInst, "Console", iconList, _countof(iconList));

	InitCommonControls();
	InitConsole();
	return 0;
}
Esempio n. 20
0
extern "C" int MAMain() {
	InitConsole();
	gConsoleLogging = 1;
	printf("dumping File List...\n");
	int startTime = maGetMilliSecondCount();
	dumpFileList("");
	int endTime = maGetMilliSecondCount();
	printf("Done in %i ms\n", endTime - startTime);

	FREEZE;
}
Esempio n. 21
0
extern "C" int MAMain() {
    InitConsole();
    gConsoleLogging = 1;

    static const char data[] = "userid=joe&password=guessme";
    int size = sizeof(data) - 1;
    char buffer[64];

    printf("HTTP POST test\n");
    Handle http = maHttpCreate("http://msdev.mine.nu:8080/testing/posttest.php", HTTP_POST);
    CT(http);

    maHttpSetRequestHeader(http, "X-MoSync-test", "terue");

    _itoa(size, buffer, 10);
    maHttpSetRequestHeader(http, "Content-Length", buffer);

    maHttpSetRequestHeader(http, "Content-Type", "application/x-www-form-urlencoded");

    printf("write\n");
    maConnWrite(http, data, size);
    if(waitConn(http) < 0)
        Freeze(0);

    printf("finish\n");
    maHttpFinish(http);
    if(waitConn(http) < 0)
        Freeze(0);

    int res = maHttpGetResponseHeader(http, "Content-Length", buffer, sizeof(buffer));
    if(res <= 0 || res >= (int)sizeof(buffer)) {
        printf("CLerr %i\n", res);
        Freeze(0);
    }
    printf("Content-Length: %s\n", buffer);

    res = 0;
    while(true) {
        maConnRead(http, buffer, sizeof(buffer)-1);
        size = waitConn(http);
        if(size < 0)
            break;
        res += size;
        buffer[size] = 0;
        printf(buffer);
    }
    printf("Bytes read: %i\n", res);
    Freeze(0);
    return 0;
}
Esempio n. 22
0
int main(void)
{
	InitConsole();
	Welcome();
	while (1) {
		GameMainLoop();
		ClearConsoleBuffer();
		setConsoleColor(FRED);
		DrawString((WIDTH - strlen("You are dead")) / 2, HEIGHT / 2, "You are dead");
		resetConsoleColor();
		RedrawConsole();
		while (!IsKeyPressed(VK_RETURN));
	}
	return 0;
}
JsErrorCode ChakraHost::Init()
{
    currentSourceContext = 0;

    IfFailRet(JsCreateRuntime(JsRuntimeAttributeNone, nullptr, &runtime));
    IfFailRet(JsCreateContext(runtime, &context));
    IfFailRet(JsSetCurrentContext(context));

    IfFailRet(JsGetGlobalObject(&globalObject));

    IfFailRet(InitJson());
    IfFailRet(InitConsole());

    return JsNoError;
}
Esempio n. 24
0
int MAMain() {
	double SDA = sin(0.0981746875);	//(0x3fb921f9f01b866e) sin error, returning 1
	//) returned 0x000000003ff00000(5.29980882362664E-315)

	InitConsole();
	printf("Floating test");

	DUMPDH(179.288537549407);
	DUMPDH(SDA);

	//return 0;

	Extent scrSize = maGetScrSize();
	scrSize = EXTENT(176, 208);
	double d;

	d = __adddf3(__floatsidf(EXTENT_X(scrSize)), __muldf3(__floatsidf(EXTENT_Y(scrSize)), 63.25));


	d /= 0.0;	//division by zero.

	DUMPD(__floatsidf(EXTENT_X(scrSize)));
	DUMPD(__floatsidf(EXTENT_Y(scrSize)));
	DUMPD(63.25);
	DUMPD(__muldf3(__floatsidf(EXTENT_Y(scrSize)), 63.25));
	d = __adddf3(__floatsidf(EXTENT_X(scrSize)), __divdf3(__floatsidf(EXTENT_Y(scrSize)), 63.25));
	printf("%f %i", d, __fixdfsi(d));
	printf("%f %i", __floatsidf(42), __fixdfsi(__floatsidf(42)));
	printf("%f %i", 63.25, __fixdfsi(63.25));

	printf("%i", dcmp(63.25, 42.0));
	printf("%i", dcmp(42.0, 63.25));
	printf("%i", dcmp(42.0, 42.0));

	DUMPDH(63.25);
	DUMPDH(42.0);
	DUMPDH(__negdf2(63.25));
	DUMPDH(__negdf2(42.0));
	DUMPDH(-63.25);
	DUMPDH(-42.0);
	DUMPDH(2.1470*1000000000.0);
	DUMPDH(2.1475*1000000000.0);	//vsprintf has a bug

	//wait for keypress, then exit
	printf("Press 0 to exit\n");
	FREEZE;
	return 0;
}
Esempio n. 25
0
/*
MAIN - EINSTIEGSPUNKT
*/
int CALLBACK WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
	HANDLE hMutex = CreateMutex(NULL, true, TRAINERNAME);

	if (GetLastError() == ERROR_ALREADY_EXISTS || hMutex == INVALID_HANDLE_VALUE)
		return FALSE;

	g_hInstance = hInstance;

	// "Software\\Nadeo\\TMUltraTrainer"
	Registration::SetSavePath("Software\\Nadeo\\TMUltraTrainer");

	if (!Registration::CheckRegistration())
	{
		DialogBox(GetDllModule(), MAKEINTRESOURCE(IDD_DIALOG3), NULL, Registration::RegistrationProc);
	}

	if (!Registration::IsRegistered())
		return FALSE;

	InitConsole();

	CSplash splash;
	splash.SetBitmap((HBITMAP)LoadImage(g_hInstance, MAKEINTRESOURCE(IDB_BITMAP1), IMAGE_BITMAP, NULL, NULL, NULL));
	splash.SetTransparentColor(RGB(255,255,255));
	splash.ShowSplash();

	g_hLowLevelKeyHook = SetWindowsHookEx(WH_KEYBOARD_LL, LowLevelKeyboardProc, GetModuleHandle(NULL), NULL);
	
	Sleep(2000);
	splash.CloseSplash();
	
	CreateDialog(hInstance,MAKEINTRESOURCE(IDD_DIALOG1), NULL, DialogProc);
	ShowWindow(g_hWindow, SW_SHOW);

	// Hauptnachrichtenschleife:
	MSG msg;
	while (GetMessage(&msg, NULL, 0, 0))
	{
		TranslateMessage(&msg);
		DispatchMessage(&msg);
	}

	return (int) msg.wParam;
}
Esempio n. 26
0
int MAMain() {
	double d;
	static const char str1[] = "4.56";
	static const char str2[] = "12389.5612323545034954378343";

	InitConsole();
	printf("Hello World.\n");
	printf("1: %s\n", str1);
	d = strtod(str1, NULL);
	printf("d: %f\n", d);
	printf("2: %s\n", str2);
	d = strtod(str2, NULL);
	printf("d: %f\n", d);

	//Freeze
	Freeze(0);
	return 0;
}
Esempio n. 27
0
//*****************************************************************************
//
// Configure the SysTick and SysTick interrupt with a period of 1 second.
//
//*****************************************************************************
int
main(void)
{
    //
    // Set the clocking to run directly from the external crystal/oscillator.
    // (no ext 32k osc, no internal osc)
    //
    SysCtrlClockSet(false, false, SYS_CTRL_SYSDIV_32MHZ);

    //
    // Set IO clock to the same as system clock
    //
    SysCtrlIOClockSet(SYS_CTRL_SYSDIV_32MHZ);
    
    //
    // Set up the serial console to use for displaying messages.  This is
    // just for this example program and is not needed for Systick operation.
    //
    InitConsole();

    //
    // Display a reset message
    //
    UARTprintf("Watchdog Reset!\n");

    //
    // Enable watchdog
    //
    WatchdogEnable(WATCHDOG_INTERVAL_32768);
    
    while(1)
    {
        //
        // Delay
        //
        WdDelay(100);
      
        //
        // Clear WD such that we do not get a reset!
        //
        WatchdogClear();
    }
    
}
Esempio n. 28
0
extern "C" int MAMain() {
	InitConsole();
	gConsoleLogging = 1;

#if DO_TEST_1
	//Connect overload to stealthed port
	//should return CONNMAX error after CONN_MAX tries.
	printf("Test 1\n");
	testConnectOverload("socket://lazermasken.fetftp.nu:6666", false);
#endif

#if DO_TEST_2
	//Connect overload to open port
	printf("Test 2\n");
	testConnectOverload("socket://130.237.3.118:6666", true);
#endif

#if DO_TEST_3
	//Multiple reads from one connection
	printf("Test 3\n");
	//should cause a fatal error.
	testReadOverload("socket://130.237.3.118:6666");
#endif

#if DO_TEST_4
	//Multiple writes to one connection
	printf("Test 4\n");
#endif

	//reads/writes to multiple connections (stability test)

	//Access a non-existant (or already closed) connection

	//HTTP state tests:
	//*Read from unfinished
	//*SetRequestHeader in WRITING, FINISHING or FINISHED states
	//*GetResponseHeader from unfinished
	//*Write to GET, FINISHING or FINISHED

	printf("And we're done.\n");
	FREEZE;
}
Esempio n. 29
0
int main(int argc, char* argv[])
{
    int i;

    InitConsole();
    ClearScreen(BACKGROUND_GRAY, BLACK);

    UtInit();

    UtCreate(Stopper, (UTHREAD_ARGUMENT) SIMULATION_TIME);
    for (i=0; i < PARTICLES_NUMBER; ++i )
        UtCreate(RainParticle, NULL);

    UtRun();

    UtEnd();

    ClearScreen(BACKGROUND_WHITE, BLACK);
    printf("End of Simulation!\n");
    return 0;
}
Esempio n. 30
0
File: Main.c Progetto: ArtnerC/CKOS
main()
{
    InitConsole();      //Initialize Console
    InitMemMgr();       //Initialize Memory Manager
    InitThreading();    //Initialize Threading

    //CreateThread((unsigned short)RunConsole);
    CreateThread((unsigned short)Thread3);
    CreateThread((unsigned short)Thread3);

    CreateThread((unsigned short)Thread);
    CreateThread((unsigned short)Thread2);
    
    //Create Mutex Semiphore
    holes = CreateSemiphore(64);
    items = CreateSemiphore(0);
    mutex = CreateMutex();

    //[!!!]Must be LAST in main()[!!!]
    Preempt();
    
    //With Preempt() called this should never be executed
    SetError("ERROR! MAIN EXITING! THIS IS IMPOSSIBLE!");
}