Exemple #1
0
int main()
{
    queueInit();
    queueTest();

    return 0;
}
Exemple #2
0
int main(int argc, char *argv[]) {
	GError *error = NULL;
	GOptionContext *context;
	
  atexit(safeExit);

	// init log system
	gp_log_init(APP_LOGFILE);
  
  // Get some application/host data
  appInfo();
/*
  if (isAppRunning()) {
    printf("Application is already running\n");
    exit(0);
    g_critical("Application is already running");
  }
  */
  // parse command line arguments
  context = g_option_context_new (APP_DESCRIPTION);
  g_option_context_add_main_entries (context, entries, NULL);
  if (!g_option_context_parse (context, &argc, &argv, &error)) {
    g_print ("option parsing failed: %s\n", error->message);
    exit (1);
  }

	// enable verbose mode
	if (opt_verbose) {
	  gp_log_set_verbose(TRUE);  
	}
  
  g_message("Program start\n");
	
  // print version information
	if (opt_version) {
		printf("Program version %s\nBuild ("__DATE__" "__TIME__")\n", APP_VERSION);
		exit(0);
	}
	
	
	// Error Test
	if (opt_errorTest) {
		errorTest();
		exit(0);
	}
	
	// thread test
	if (opt_threadTest) { 
		threadTest();
		exit(0);
	}
  
	// info test
	if (opt_info) { 
		infoTest();
		exit(0);
	}

	// daemon test
	if (opt_daemonTest) { 
		daemonTest();
		exit(0);
	}
	
	// queue test
	if (opt_queueTest) {
	  queueTest();
		exit(0);
	}

	// pipe test
	 if (opt_pipeTest) {
	  pipeTest();
		exit(0);
	}
	
	// domain socket test 
	if (opt_domainTest) {
	  domainTest();
		exit(0);
	}
	

	return 0;
}