コード例 #1
0
ファイル: main.cpp プロジェクト: busjaeger/cs410sp12
int main(int argc, char *argv[])
{
  if (argc>=2 && strcmp(argv[1], "-help") &&
      strcmp(argv[1], "--help") &&
      strcmp(argv[1], "-h") ) {  // recognize parameter file as argument
    if (!lemur::api::ParamPushFile(argv[1])) 
      {
        cerr << "Unable to load parameter file: " << argv[1] << endl;;
        exit(1);
      } 
  } else {
    
    // handle "-help", display parameters 
    GetAppParam(); // called only  to "register" parameters
    cerr << "Parameters for " <<  argv[0] << endl;
    lemur::api::ParamDisplay();
    exit(0);
  } 
  GetAppParam();

  int result = 1;
  try {
    result = AppMain(argc,argv);
  } 
  catch (lemur::api::Exception &ex) {
    ex.writeMessage();
    cerr << "Program aborted due to exception" << endl;;
    exit(1);
  } 
  // clean up
  lemur::api::ParamClear();
  return result;
}
コード例 #2
0
ファイル: main.cpp プロジェクト: crftwr/cfiler
int WINAPI WinMain(
	HINSTANCE hInstance,      /* handle to current instance */
	HINSTANCE hPrevInstance,  /* handle to previous instance */
	LPSTR lpCmdLine,          /* pointer to command line */
	int nCmdShow              /* show state of window */
	)
{
	return AppMain();
}
コード例 #3
0
ファイル: main.cpp プロジェクト: AdrianJMartin/opengl-series
int main(int argc, char *argv[]) {
    try {
        AppMain();
    } catch (const std::exception& e){
        std::cerr << "ERROR: " << e.what() << std::endl;
        return EXIT_FAILURE;
    }

    return EXIT_SUCCESS;
}
コード例 #4
0
ファイル: main.cpp プロジェクト: jamesconrad/Mek
int main(int argc, char *argv[]) {
    try {
        AppMain();
    } catch (const std::exception& e){
		printf("Did you run from Visual Studio?\n Visual Studio runs the application from the wrong folder!\n Use the exe!");
		std::cerr << "ERROR: " << e.what() << std::endl;
	    return EXIT_FAILURE;
    }

    return EXIT_SUCCESS;
}
コード例 #5
0
int main() //
{
	init();

    //
    // Start the application.
    //
    AppMain();

    return 0;
}
コード例 #6
0
ファイル: TestMain.c プロジェクト: 1spatial/CMock
void testMainShouldCallExecutorInitAndContinueToCallExecutorRunUntilHalted(void)
{
  Executor_Init_Expect();
  Executor_Run_ExpectAndReturn(TRUE);
  Executor_Run_ExpectAndReturn(TRUE);
  Executor_Run_ExpectAndReturn(TRUE);
  Executor_Run_ExpectAndReturn(TRUE);
  Executor_Run_ExpectAndReturn(FALSE);
  
  AppMain();
}
コード例 #7
0
ファイル: test_main.c プロジェクト: chrishonson/Ceedling
void test_AppMain_should_call_configure(void) //Reqs:
{
    /* Ensure known test state */
    BlinkTaskReady=0;
    /* Setup expected call chain */
    Configure_Expect();
    /* Call function under test */
    AppMain();

    /* Verify test results */
    TEST_ASSERT_EQUAL(0, BlinkTaskReady);
}
コード例 #8
0
ファイル: DrvLoader.cpp プロジェクト: tandasat/DrvLoader
int _tmain(int argc, _TCHAR* argv[]) {
  int result = EXIT_FAILURE;
  try {
    if (AppMain(argc, argv)) {
      result = EXIT_SUCCESS;
    }
  } catch (std::exception& e) {
    std::cout << e.what() << std::endl;
  } catch (...) {
    std::cout << "Unknown Exception." << std::endl;
  }
  return result;
}
コード例 #9
0
ファイル: kguipc.cpp プロジェクト: CarlHuff/kgui
int main(int argc, char *argv[])
{
	int rc;

	g_sys=new kGUISystemWin();
	kGUI::Init(g_sys,0,0,0,0,100);

	rc=AppMain(argc,argv);

	kGUI::Close();
	delete g_sys;
	return(rc);
}
コード例 #10
0
ファイル: main.c プロジェクト: sa66ath/MPLABXProjects
void main(void)
{
    /* Configure the oscillator for the device */
    ConfigureOscillator();

    /* Initialize I/O and Peripherals for application */
    InitApp();


    for(;;)
    {
        AppMain();
    }
}
コード例 #11
0
int _tmain(int argc, _TCHAR* argv[]) {
  auto result = EXIT_FAILURE;
  try {
    std::vector<std::wstring> args;
    for (auto i = 0; i < argc; ++i) {
      args.push_back(argv[i]);
    }
    if (AppMain(args)) {
      result = EXIT_SUCCESS;
    }
  } catch (std::exception& e) {
    std::cout << e.what() << std::endl;
  } catch (...) {
    std::cout << "An unhandled exception raised." << std::endl;
  }
  return result;
}
コード例 #12
0
ファイル: core.cpp プロジェクト: DasRegal/CMLib
int main (void)
{
    WDTCTL = WDTPW + WDTHOLD;
    // Настройка DCO генератора на частоту 8 МГц
    ConfigDCO(DCO_1MHZ);
    // Источник тактирования CPU - DCO
    ConfigMCLK(MCLK_DIV_1, MCLK_DCO, MCLK_ON);
    // Источник тактирования SMCLK - DCO
    ConfigSMCLK(SMCLK_DIV_1, SMCLK_DCO, SMCLK_ON);
    // Источником тактирования Таймера A является SMCLK
    // (см. описание ta.cpp)
//    ta.Configure(1000, 0);
    
    AppMain();
    
    return 0;
}
コード例 #13
0
ファイル: start.c プロジェクト: iceman1001/proxmark3
void __attribute__((section(".startos"))) Vector(void)
{
	/* Stack should have been set up by the bootloader */
	// char *src;
	char *dst, *end;
	
	uncompress_data_section();

	/* Set up (that is: clear) BSS. */
	dst = &__bss_start__;
	end = &__bss_end__;
	while(dst < end) *dst++ = 0;

	// Set up data segment: Copy from flash to ram
	// src = &__data_src_start__;
	// dst = &__data_start__;
	// end = &__data_end__;
	// while(dst < end) *dst++ = *src++;

	AppMain();
}
コード例 #14
0
ファイル: main.cpp プロジェクト: ctmartinez1992/Voxel
int main(int argc, char *argv[]) {
	//Initializes everything that isn't game content.
	init();
	
	//Start the game.
	AppMain();

	//Checks for Memory Leaks
	_CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE);
	_CrtSetReportFile(_CRT_WARN, _CRTDBG_FILE_STDOUT);
	_CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_FILE);
	_CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDOUT);
	_CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_FILE);
	_CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDOUT);
	if (_CrtDumpMemoryLeaks() == 0) {
		std::cout << std::endl << "NO Memory Leaks!!! Be Proud!!!!" << std::endl;
	}

	getchar();

	return 0;
}
コード例 #15
0
ファイル: Main.c プロジェクト: 1spatial/CMock
int main(void)
{
  return AppMain();
}
コード例 #16
0
ファイル: main.cpp プロジェクト: crftwr/cfiler
int main(int argc, const char * argv[])
{
	return AppMain();
}
コード例 #17
0
int main(int argc, char *argv[])
{
#ifdef HAVE_EXECV
    char cmd[PATH_MAX+1], buf[PATH_MAX+8], buf2[1100], *p;
    int i, i0 = 0, ac = 0, res = 0, e_mode = 0, set_dp = 0;
    char **av;

    if(argc <= 1) {
	usage();
	exit(1);
    }
    av = (char **) malloc((size_t) (argc+4)*sizeof(char *));
    if(!av) {
	fprintf(stderr, "malloc failure\n");
	exit(1);
    }

    p = getenv("RHOME");
#ifdef WIN32
    if(p && *p)
	snprintf(cmd, PATH_MAX+1, "%s\\%s\\Rterm.exe",  p, BINDIR);
    else {
	char rhome[MAX_PATH];
	GetModuleFileName(NULL, rhome, MAX_PATH);
	p = strrchr(rhome,'\\');
	if(!p) {fprintf(stderr, "installation problem\n"); exit(1);}
	*p = '\0';
	snprintf(cmd, PATH_MAX+1, "%s\\Rterm.exe",  rhome);
    }
#else
    if(!(p && *p)) p = rhome;
    /* avoid snprintf here */
    if(strlen(p) + 6 > PATH_MAX) {
	fprintf(stderr, "impossibly long path for RHOME\n");
	exit(1);
    }
    sprintf(cmd, "%s/bin/R", p);
#endif
    av[ac++] = cmd;
    av[ac++] = "--slave";
    av[ac++] = "--no-restore";

    if(argc == 2) {
	if(strcmp(argv[1], "--help") == 0) {
	    usage();
	    exit(0);
	}
	if(strcmp(argv[1], "--version") == 0) {
	    if(strlen(R_STATUS) == 0)
		fprintf(stderr, "R scripting front-end version %s.%s (%s-%s-%s)\n", 
			R_MAJOR, R_MINOR, R_YEAR, R_MONTH, R_DAY);
	    else 
		fprintf(stderr, "R scripting front-end version %s.%s %s (%s-%s-%s r%d)\n", 
			R_MAJOR, R_MINOR, R_STATUS, R_YEAR, R_MONTH, R_DAY,
			R_SVN_REVISION);
	    exit(0);
	}
    }

    /* first copy over any -e or --foo args */
    for(i = 1; i < argc; i++) {
	if(strcmp(argv[i], "-e") == 0) {
	    e_mode = 1;
	    av[ac++] = argv[i];
	    if(!argv[++i]) {
		fprintf(stderr, "-e not followed by an expression\n");
		exit(1);
	    }
	    av[ac++] = argv[i];
	    i0 = i;
	    continue;
	}
	if(strncmp(argv[i], "--", 2) != 0) break;
	if(strcmp(argv[i], "--verbose") == 0) {
	    verbose = 1;
	    i0 = i;
	    continue;
	}
	if(strncmp(argv[i], "--default-packages=", 18) == 0) {
	    set_dp = 1;
	    if(strlen(argv[i]) > 1000) {
		fprintf(stderr, "unable to set R_DEFAULT_PACKAGES\n");
		exit(1);
	    }
	    sprintf(buf2, "R_DEFAULT_PACKAGES=%s", argv[i]+19);
	    if(verbose)
		fprintf(stderr, "setting '%s'\n", buf2);
#ifdef HAVE_PUTENV
	    if(putenv(buf2))
#endif
	    {
		fprintf(stderr, "unable to set R_DEFAULT_PACKAGES\n");
		exit(1);
	    }
	    i0 = i;
	    continue;
	}
	av[ac++] = argv[i];
	i0 = i;
    }

    if(!e_mode) {
      if(++i0 >= argc) {
        fprintf(stderr, "file name is missing\n");
        exit(1);
      }
      if(strlen(argv[i0]) > PATH_MAX) {
	    fprintf(stderr, "file name is too long\n");
	    exit(1);
	}
	sprintf(buf, "--file=%s", argv[i0]);
	av[ac++] = buf;
    }
    av[ac++] = "--args";
    for(i = i0+1; i < argc; i++) av[ac++] = argv[i];
    av[ac] = (char *) NULL;
#ifdef HAVE_PUTENV
    if(!set_dp && !getenv("R_DEFAULT_PACKAGES"))
	putenv("R_DEFAULT_PACKAGES=datasets,utils,grDevices,graphics,stats");

#ifndef WIN32
    /* pass on r_arch from this binary to R as a default */
    if (!getenv("R_ARCH") && *rarch) {
	/* we have to prefix / so we may as well use putenv */
	if (strlen(rarch) + 9 > sizeof(buf2)) {
	    fprintf(stderr, "impossibly long string for R_ARCH\n");
	    exit(1);
	}
	strcpy(buf2, "R_ARCH=/");
	strcat(buf2, rarch);
	putenv(buf2);
    }
#endif
#endif
    if(verbose) {
	fprintf(stderr, "running\n  '%s", cmd);
	for(i = 1; i < ac-1; i++) fprintf(stderr, " %s", av[i]);
	fprintf(stderr, "'\n\n");
    }
#ifndef WIN32
    res = execv(cmd, av); /* will not return if R is launched */
    perror("Rscript execution error");
#else
    AppMain(ac, av);
#endif
    return res;
#else /* No execv*/
    fprintf(stderr, "Rscript is not supported on this system");
    exit(1);
#endif
}
コード例 #18
0
//-----------------------------------------------------------------------------
//
//-----------------------------------------------------------------------------
int __stdcall WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow )
{
	static CSceneViewerApp sceneViewerApp;				\
	static CSteamApplication steamApp( &sceneViewerApp );	\
	return AppMain( hInstance, hPrevInstance, lpCmdLine, nCmdShow, &steamApp );
}