int main(int argc, char* argv[]) { global_program_name.setValue2( argv[0] ); sorted_arguments = (InputArgument**) malloc( argc * sizeof(InputArgument*) ); try { for ( int index = 0; index < argc; ++index ) all_arguments.push_back( new InputArgument(index, argv[index]) ); assert(argc >= 2); InputArgument input_count(1, argv[1]); read_arguments( input_count.valueToUll() ); std::thread printer1( print_arguments_1, 0 ); std::thread sorter( sort_arguments ); printer1.join(); sorter.join(); std::thread printer2( print_arguments_2 ); printer2.join(); delete_arguments(); return 0; } catch(std::exception& exc) { std::cerr << "Exception: " << exc.what() << std::endl; return 1; } }
int main(int argc, char *argv[]) { int rv; memset(&cl, 0, sizeof(cl)); rv = read_arguments(argc, argv); if (rv < 0) goto out; switch (cl.type) { case ACT_ARBITRATOR: rv = do_arbitrator(); break; case ACT_SITE: rv = do_site(); break; case ACT_CLIENT: rv = do_client(); break; } out: return rv ? EXIT_FAILURE : EXIT_SUCCESS; }
AST* readASTMisc(BufferedReader *reader) { uint8_t type = reader->readByte(); if (VERBOSITY("parsing") >= 2) printf("type = %d\n", type); if (type == 0) return NULL; uint8_t checkbyte = reader->readByte(); assert(checkbyte == 0xae); switch (type) { case AST_TYPE::alias: return read_alias(reader); case AST_TYPE::arguments: return read_arguments(reader); case AST_TYPE::comprehension: return read_comprehension(reader); case AST_TYPE::keyword: return read_keyword(reader); case AST_TYPE::Module: return read_module(reader); default: fprintf(stderr, "Unknown node type (parser.cpp:" STRINGIFY(__LINE__) "): %d\n", type); exit(1); break; } }
int main (int argc, char *argv[]) { global_option_type global_option; //!< Application global options global_option.server_port = DEFAULT_SERVER_PORT; global_option.number_player = MAX_NUMBER_PLAYER; global_option.type_server = LAN_PROTOCOL_TYPE; #if defined(DEBUG) fprintf (stderr, "DEBUG mode is ON\n"); #endif if (read_arguments (argc, argv, &global_option) != 0) { fprintf (stderr, "Error reading arguments\n"); return 2; } if (SDL_Init (0) == -1) { fprintf (stderr, "SDL_Init: %s\n", SDL_GetError ()); return 1; } if (init_network () != 0) { fprintf (stderr, "Error initializing network\n"); return 1; } #if defined(GTK) if (argc == 1) { // No option given starts the GUI build_gtk_interface(argc, argv); return; } #endif serve_dispatch (&global_option); shutdown_network (); SDL_Quit(); return 0; }
//! Set up device and execute command(s). // int main(int argc, char** argv) { // read in program arguments read_arguments(argc, argv); #ifdef _DEBUG // DEBUG: list the options dump_options(); #endif // _DEBUG // help over-rides all. For options variable see cmdline.h if (options.showHelp) { printHelp(); exit(0); } // open the device or its imposter (file), see dfile.h if (options.inputFromFile == 1) { dopen(cmdFilename); } else { dopen(":usb:"); } // dump header can be executed with other commands if (options.dumpHeader == 1) { printHeader(); } // now dispatch for processing if (options.dumpMemory == 1) { // hexdump device memory dumpmemory(memoryDumpStart, memoryDumpEnd, DumpWidth); } else if (options.writeMemoryToFile == 1) { // copy device memory to a file copymem(cmdFilename); } else if (options.printRecordsSince == 1) { // list records since given date & time listRecordsSince(dateSince); } else if (options.printRecords == 1) { // list specified records (0 = current, n = oldest) if (options.untilFirstRecord == 1) { endRecordNumber = getRecordsStored(); } listRecords(startRecordNumber, endRecordNumber); } dclose(); }
int main(int argc, char *argv[], char *envp[]) { int rv; init_set_proc_title(argc, argv, envp); get_secs(&start_time); memset(&cl, 0, sizeof(cl)); strncpy(cl.configfile, BOOTH_DEFAULT_CONF, BOOTH_PATH_LEN - 1); cl.lockfile[0] = 0; debug_level = 0; cl_log_set_entity("booth"); cl_log_enable_stderr(TRUE); cl_log_set_facility(0); rv = read_arguments(argc, argv); if (rv < 0) goto out; switch (cl.type) { case STATUS: rv = do_status(cl.type); break; case ARBITRATOR: case DAEMON: case SITE: rv = do_server(cl.type); break; case CLIENT: rv = do_client(); break; } out: /* Normalize values. 0x100 would be seen as "OK" by waitpid(). */ return (rv >= 0 && rv < 0x70) ? rv : 1; }
int main(int argc, char *argv[]) { int rv; memset(&cl, 0, sizeof(cl)); strncpy(cl.configfile, BOOTH_DEFAULT_CONF, BOOTH_PATH_LEN - 1); strncpy(cl.lockfile, BOOTH_DEFAULT_LOCKFILE, BOOTH_PATH_LEN - 1); rv = read_arguments(argc, argv); if (rv < 0) goto out; if (cl.type == ACT_CLIENT) { cl_log_enable_stderr(TRUE); cl_log_set_facility(0); } else { cl_log_set_entity(logging_entity); cl_log_enable_stderr(debug_level ? TRUE : FALSE); cl_log_set_facility(HA_LOG_FACILITY); } cl_inherit_logging_environment(0); switch (cl.type) { case ACT_ARBITRATOR: rv = do_server(ARBITRATOR); break; case ACT_SITE: rv = do_server(SITE); break; case ACT_CLIENT: rv = do_client(); break; } out: return rv ? EXIT_FAILURE : EXIT_SUCCESS; }
int main(int argc, char **argv){ // init the gpio if (!bcm2835_init()){return RETURN_ERROR;} //read the command line arguments if (read_arguments(argc,argv)==RETURN_ERROR){return RETURN_ERROR;} //record radio signals recording=record_burst(sample_time,sample_rate); if (recording==NULL) return RETURN_ERROR; //save recording to file if(save_recording_to_file(recording,recording_name,save_path)==RETURN_ERROR){return RETURN_ERROR;} //close gpio bcm2835_close(); //free allocated memory free(recording); printf("\nMy work here is done\n"); return RETURN_SUCCESS; }
int nebmodule_init( int flags, char *args, nebmodule *handle ) { int i; int broker_option_errors = 0; send_now = FALSE; result_threads_running = 0; /* save our handle */ gearman_module_handle=handle; /* set some module info */ neb_set_module_info( gearman_module_handle, NEBMODULE_MODINFO_TITLE, "Mod-Gearman" ); neb_set_module_info( gearman_module_handle, NEBMODULE_MODINFO_AUTHOR, "Sven Nierlein" ); neb_set_module_info( gearman_module_handle, NEBMODULE_MODINFO_TITLE, "Copyright (c) 2010-2011 Sven Nierlein" ); neb_set_module_info( gearman_module_handle, NEBMODULE_MODINFO_VERSION, GM_VERSION ); neb_set_module_info( gearman_module_handle, NEBMODULE_MODINFO_LICENSE, "GPL v3" ); neb_set_module_info( gearman_module_handle, NEBMODULE_MODINFO_DESC, "distribute host/service checks and eventhandler via gearman" ); mod_gm_opt = malloc(sizeof(mod_gm_opt_t)); set_default_options(mod_gm_opt); /* parse arguments */ gm_log( GM_LOG_DEBUG, "Version %s\n", GM_VERSION ); gm_log( GM_LOG_DEBUG, "args: %s\n", args ); gm_log( GM_LOG_TRACE, "nebmodule_init(%i, %i)\n", flags ); gm_log( GM_LOG_DEBUG, "running on libgearman %s\n", gearman_version() ); if( read_arguments( args ) == GM_ERROR ) return NEB_ERROR; /* check for minimum eventbroker options */ if(!(event_broker_options & BROKER_PROGRAM_STATE)) { gm_log( GM_LOG_ERROR, "mod_gearman needs BROKER_PROGRAM_STATE (%i) event_broker_options enabled to work\n", BROKER_PROGRAM_STATE ); broker_option_errors++; } if(!(event_broker_options & BROKER_TIMED_EVENTS)) { gm_log( GM_LOG_ERROR, "mod_gearman needs BROKER_TIMED_EVENTS (%i) event_broker_options enabled to work\n", BROKER_TIMED_EVENTS ); broker_option_errors++; } if( ( mod_gm_opt->perfdata == GM_ENABLED || mod_gm_opt->hostgroups_num > 0 || mod_gm_opt->hosts == GM_ENABLED ) && !(event_broker_options & BROKER_HOST_CHECKS)) { gm_log( GM_LOG_ERROR, "mod_gearman needs BROKER_HOST_CHECKS (%i) event_broker_options enabled to work\n", BROKER_HOST_CHECKS ); broker_option_errors++; } if( ( mod_gm_opt->perfdata == GM_ENABLED || mod_gm_opt->servicegroups_num > 0 || mod_gm_opt->services == GM_ENABLED ) && !(event_broker_options & BROKER_SERVICE_CHECKS)) { gm_log( GM_LOG_ERROR, "mod_gearman needs BROKER_SERVICE_CHECKS (%i) event_broker_options enabled to work\n", BROKER_SERVICE_CHECKS ); broker_option_errors++; } if(mod_gm_opt->events == GM_ENABLED && !(event_broker_options & BROKER_EVENT_HANDLERS)) { gm_log( GM_LOG_ERROR, "mod_gearman needs BROKER_EVENT_HANDLERS (%i) event_broker option enabled to work\n", BROKER_EVENT_HANDLERS ); broker_option_errors++; } if(broker_option_errors > 0) return NEB_ERROR; /* check the minimal gearman version */ if((float)atof(gearman_version()) < (float)GM_MIN_LIB_GEARMAN_VERSION) { gm_log( GM_LOG_ERROR, "minimum version of libgearman is %.2f, yours is %.2f\n", (float)GM_MIN_LIB_GEARMAN_VERSION, (float)atof(gearman_version()) ); return NEB_ERROR; } /* init crypto functions */ if(mod_gm_opt->encryption == GM_ENABLED) { if(mod_gm_opt->crypt_key == NULL) { gm_log( GM_LOG_ERROR, "no encryption key provided, please use --key=... or keyfile=...\n"); return NEB_ERROR; } mod_gm_crypt_init(mod_gm_opt->crypt_key); } else { mod_gm_opt->transportmode = GM_ENCODE_ONLY; } /* create client */ if ( create_client( mod_gm_opt->server_list, &client ) != GM_OK ) { gm_log( GM_LOG_ERROR, "cannot start client\n" ); return NEB_ERROR; } /* register callback for process event where everything else starts */ neb_register_callback( NEBCALLBACK_PROCESS_DATA, gearman_module_handle, 0, handle_process_events ); neb_register_callback( NEBCALLBACK_TIMED_EVENT_DATA, gearman_module_handle, 0, handle_timed_events ); /* register export callbacks */ for(i=0;i<GM_NEBTYPESSIZE;i++) { if(mod_gm_opt->exports[i]->elem_number > 0) neb_register_callback( i, gearman_module_handle, 0, handle_export ); } /* log at least one line into the core logfile */ if ( mod_gm_opt->logmode != GM_LOG_MODE_CORE ) { int logmode_saved = mod_gm_opt->logmode; mod_gm_opt->logmode = GM_LOG_MODE_CORE; gm_log( GM_LOG_INFO, "initialized version %s (libgearman %s)\n", GM_VERSION, gearman_version() ); mod_gm_opt->logmode = logmode_saved; } gm_log( GM_LOG_DEBUG, "finished initializing\n" ); return NEB_OK; }
int main(int argc, char *argv[]) { option_data options = {0}; fd_set rfds; struct timeval tv; int dmac_set = 0; int len; struct ifreq ifr; int i; int res; u8 buffer[BUFSIZE]; time_t time_now; struct arpreq arpr; odata = &options; options.spi_wait_time = 10; options.packet_print_intervall = 1000; options.ap_overhead = 44; options.rsv_bit = 1; read_arguments(argc, argv, &options); for (i = 0; i < 6; i++) { if (options.dmac[i] != 0x00) dmac_set = 1; } if (!dmac_set) { printf("Error! Destination mac must be set\n"); exit(0); } printf("Listening traffic between "); ipv4_print_address(htonl(options.src_address)); printf(" and "); ipv4_print_address(htonl(options.dst_address)); printf(" using fake IP src address "); ipv4_print_address(htonl(options.fake_src_address)); printf("\n"); printf(" using fake IP dst address "); ipv4_print_address(htonl(options.fake_dst_address)); printf("\n"); printf("Reserved bit check is %s\n",(options.rsv_bit ? "ON":"OFF")); printf("Verbose mode %i\n",options.verbose); printf("SPI change detection is %s\n",(options.spi_change_detection ? "ON":"OFF")); printf("Block to crack is "); for (i = 0; i < 6; i++) printf("%02x%s",options.block_to_crack[i],(i == 5 ? "\n" : ":")); printf("Initial guess is "); for (i = 0; i < 6; i++) printf("%02x%s",options.guess[i],(i == 5 ? "\n" : ":")); printf("Original IV is "); for (i = 0; i < 6; i++) printf("%02x%s",options.original_iv[i],(i == 5 ? "\n" : ":")); if (options.spi == 0x00000000) printf("SPI not set -> taking SPI from first ESP packet\n"); else printf("SPI 0x%08x\n",options.spi); /* Open socket for sending and listening */ listen_s = socket(AF_INET, SOCK_PACKET, htons (ETH_P_ALL)); if (listen_s < 0) { perror ("socket"); exit(1); } /* get local ethernet address. */ len = sizeof(listen_sockaddr); bzero(&listen_sockaddr, len); listen_sockaddr.sa_family = AF_INET; strcpy(listen_sockaddr.sa_data, options.listen_if); bzero (&ifr, sizeof(ifr)); strcpy (ifr.ifr_name, options.listen_if); if (ioctl (listen_s, SIOCGIFHWADDR, &ifr) < 0) { perror ("ioctl(SIOCGIFHWADDR)"); exit(1); } printf ("local address in listen socket: %s is ", options.listen_if); for (i = 0; i < 6; i++) { printf ("%02x%s", (ifr.ifr_hwaddr.sa_data [i]) & 0xff, (i == 5) ? "" : ":"); } printf (", address family 0x%x%s\n", ifr.ifr_hwaddr.sa_family, (ifr.ifr_hwaddr.sa_family == ARPHRD_ETHER) ? " (ethernet)" : ""); /* Now the send if */ send_s = socket(AF_INET, SOCK_PACKET, htons (ETH_P_ALL)); if (send_s < 0) { perror ("socket"); exit(1); } /* get local ethernet address. */ len = sizeof(send_sockaddr); bzero(&send_sockaddr, len); send_sockaddr.sa_family = AF_INET; strcpy(send_sockaddr.sa_data, options.send_if); bzero (&ifr, sizeof(ifr)); strcpy (ifr.ifr_name, options.send_if); if (ioctl (send_s, SIOCGIFHWADDR, &ifr) < 0) { perror ("ioctl(SIOCGIFHWADDR)"); exit(1); } /* bzero (&arpr, sizeof(arpr)); arpr.arp_pa.sa_family = AF_INET; memcpy(arpr.arp_pa.sa_data, (u8 *)&options.gw, 4); strcpy(arpr.arp_dev, options.send_if); if (ioctl (send_s, SIOCGARP, &arpr) < 0) { perror ("ioctl(SIOCGARP)"); exit(1); } */ for (i = 0; i < 6; i++) options.smac[i] = ifr.ifr_hwaddr.sa_data[i]; printf ("local address in send socket: %s is ", options.send_if); for (i = 0; i < 6; i++) { printf ("%02x%s", (options.smac[i]) & 0xff, (i == 5) ? "" : ":"); } printf (", address family 0x%x%s\n", ifr.ifr_hwaddr.sa_family, (ifr.ifr_hwaddr.sa_family == ARPHRD_ETHER) ? " (ethernet)" : ""); if (signal(SIGINT, user_signal_handler) == SIG_ERR || signal(SIGTERM, user_signal_handler) == SIG_ERR) { fprintf(stderr, "Error in setting a signal handler!\n"); return -1; } /* */ options.state = init; FD_ZERO(&rfds); FD_SET(listen_s,&rfds); options.start_time = time(NULL); options.spi_last_seen = time(NULL); while(1) { FD_ZERO(&rfds); FD_SET(listen_s,&rfds); tv.tv_sec = 0; tv.tv_usec = 500000; len = sizeof(listen_sockaddr); res = 0; res = select((listen_s + 1), &rfds, NULL, NULL, &tv); if (res) { res = recvfrom(listen_s, buffer, BUFSIZE, 0, &listen_sockaddr, &len); if (res < 0) { perror ("recvfrom"); exit(1); } user_ipv4_handler(buffer, &options); if (options.spi_change_detection) { time_now = time(NULL); if ((time_now - options.spi_last_seen) > options.spi_wait_time && options.spi_last_seen != 0) { printf("SPI not seen for %i seconds\n", options.spi_wait_time); exit(0); } } } else { if (options.state == send_done) { printf("senddoneK\n"); } if (options.verbose) printf("Sending a keepalive packet\n"); send_keepalive_packet(&options); } } return 1; }
int main(int argc, char* argv[]) { int return_val = 0, err; // // Install signal handler to perform cleanup before exit. // signal(SIGINT, (sig_fn_ptr) sigcleanup); signal(SIGHUP, (sig_fn_ptr) sigcleanup); signal(SIGTERM, (sig_fn_ptr) sigcleanup); if (argc < 2) { printf("\n%s\nNo parameters supplied. Entering interactive mode.\n" "For help on command line params, use --help switch.\n" "Hit Control-C at any time to exit program.\n", copyright_banner); read_arguments(); } else { for (int i = 1; i < argc; ) { i += process_argument(argv[i], argv[i+1]); } } if (display_help) { print_usage(); return 0; } if (testcount < 0 || testcount > 10000) { fatal("\nError: Test count value %d is out of range (0 - 10000)\n\n", testcount); } if (verifypasses < 1 || verifypasses > 100) { fatal("\nError: Verification passes value %d is out of range (1 - 100)\n\n", verifypasses); } if (filesize_MB < 1 || filesize_MB > 16777216) { fatal("\nError: Test file size %d is out of range (1 - 16777216)\n\n", filesize_MB); } // // In many operating systems it is advantageous to do file I/O in units of pages, // using buffers which start on page boundaries. Therefore we shall make the buffer // size a multiple of the page size and a multiple of the unit of work (uint32_t), // while trying to keep it at least as large as the bufsize_Mbytes constant. // pagesize = getpagesize(); uint32_t base_size = pagesize * sizeof(uint32_t); bufsize = ((0x100000 * bufsize_Mbytes) / base_size) + 1; bufsize = bufsize * base_size; // // For the purposes of the rest of the program, the buffer size is the number of uint32_ts // in a buffer, not the number of bytes. // bufsize /= sizeof(uint32_t); // // Translate the file size from megabytes to uint32_ts. // filesize = (off_t) filesize_MB * (1048576 / sizeof(uint32_t)); // // Create the log file. // logfile = fopen(logfilename, "a"); if (logfile == NULL) { fatal("Error: Couldn't open log file (%s).\n", logfilename); } time_t t = time(NULL); fprintf(logfile, "\n============================================================\n" "%s\n" "Start time: %s\n", copyright_banner, ctime(&t)); fprintf(logfile, "Test parameters:\n\t" "Test file size is %d megabytes\n\t", filesize_MB); fprintf(logfile, "%d%s test iteration%s\n\t", testcount, (testcount == 0) ? (" (infinite loop)") : (""), (testcount == 1) ? ("") : ("s") ); fprintf(logfile, "%d verification pass%s per test iteration\n", verifypasses, (verifypasses == 1) ? ("") : ("es") ); // // Test loop. // for (uint32_t testnum = 1; (testnum <= testcount) || (testcount == 0); testnum++) { print_and_log("\nBeginning test iteration #%d; creating test file...", testnum); putchar('\n'); process_testfile(CREATE, testfilename, filesize, testnum); fprintf(logfile, " (done)\n"); for (uint32_t pass = 1; pass <= verifypasses; pass++) { printf("Verifying integrity of test file, pass #%d\n", pass); err = process_testfile(VERIFY, testfilename, filesize, testnum); fprintf(logfile, "Completed test #%d verification pass #%d (%s)\n", testnum, pass, (err) ? "FAIL" : "OK"); if (err) { printf("Warning, corruption detected! Check logfile for details.\n"); return_val = 1; if (halt_on_error) { print_and_log("\nHalting test.\n"); fclose(logfile); logfile = NULL; return 1; } } } } print_and_log("\nFinished testing.\n\n"); // if (remove(testfilename)) { // print_and_log("Warning: test file could not be deleted!\n\n"); // } fclose(logfile); return return_val; }
PRIVATE void MPII_Read_options (int *argc, char ***argv) { read_environment (); read_arguments (argc, argv); }
int main(int argc, char *argv[], char *envp[]) { int rv; const char *cp; #ifdef LOGGING_LIBQB enum qb_log_target_slot i; #endif init_set_proc_title(argc, argv, envp); get_time(&start_time); memset(&cl, 0, sizeof(cl)); strncpy(cl.configfile, BOOTH_DEFAULT_CONF, BOOTH_PATH_LEN - 1); cl.lockfile[0] = 0; debug_level = 0; cp = ((cp = strstr(argv[0], ATTR_PROG)) && !strcmp(cp, ATTR_PROG) ? ATTR_PROG : "booth"); #ifndef LOGGING_LIBQB cl_log_set_entity(cp); #else qb_log_init(cp, LOG_USER, LOG_DEBUG); /* prio driven by debug_level */ for (i = QB_LOG_TARGET_START; i < QB_LOG_TARGET_MAX; i++) { if (i == QB_LOG_SYSLOG || i == QB_LOG_BLACKBOX) continue; qb_log_format_set(i, "%t %H %N: [%P]: %p: %b"); } (void) qb_log_filter_ctl(QB_LOG_STDERR, QB_LOG_FILTER_ADD, QB_LOG_FILTER_FILE, "*", LOG_DEBUG); #endif cl_log_enable_stderr(TRUE); cl_log_set_facility(0); rv = read_arguments(argc, argv); if (rv < 0) goto out; switch (cl.type) { case STATUS: rv = do_status(cl.type); break; case ARBITRATOR: case DAEMON: case SITE: rv = do_server(cl.type); break; case CLIENT: rv = do_client(); break; case GEOSTORE: rv = do_attr(); break; } out: #ifdef LOGGING_LIBQB qb_log_fini(); #endif /* Normalize values. 0x100 would be seen as "OK" by waitpid(). */ return (rv >= 0 && rv < 0x70) ? rv : 1; }
void graph_generator::init(int argc, const char **argv) { INT N; INT target_depth; BYTE prefix[1000]; A_base = new action; A_on_edges = new action; gen = new generator; read_arguments(argc, argv); INT verbose_level = gen->verbose_level; INT f_v = (verbose_level >= 1); if (f_v) { cout << "graph_generator::init" << endl; } if (f_tournament) { if (f_v) { cout << "graph_generator::init tournaments on " << n << " vertices" << endl; } sprintf(prefix, "%stournament_%ld", gen->prefix, n); if (f_no_superking) { sprintf(prefix + strlen(prefix), "_no_superking"); } } else { if (f_v) { cout << "graph_generator::init graphs on " << n << " vertices" << endl; } sprintf(prefix, "%sgraph_%ld", gen->prefix, n); } if (f_regular) { sprintf(prefix + strlen(prefix), "_r%ld", regularity); } if (f_girth) { sprintf(prefix + strlen(prefix), "_g%ld", girth); } if (f_v) { cout << "prefix=" << prefix << endl; } n2 = INT_n_choose_k(n, 2); if (f_v) { cout << "n2=" << n2 << endl; } A_base->init_symmetric_group(n, verbose_level - 3); if (f_v) { cout << "A_base->init_symmetric_group done" << endl; } if (!A_base->f_has_sims) { cout << "!A_base->f_has_sims" << endl; exit(1); } if (f_v) { cout << "generators for the symmetric group are:" << endl; A_base->Sims->print_generators(); } if (f_tournament) { A_on_edges->induced_action_on_ordered_pairs(*A_base, A_base->Sims, verbose_level - 3); if (f_v) { cout << "A_on_edges->induced_action_on_ordered_pairs done, created the following action:" << endl; A_on_edges->print_info(); cout << "generators for the symmetric group in the action on ordered_pairs are:" << endl; A_on_edges->Sims->print_generators(); } } else { A_on_edges->induced_action_on_pairs(*A_base, A_base->Sims, verbose_level - 3); if (f_v) { cout << "A_on_edges->induced_action_on_pairs done, created the following action:" << endl; A_on_edges->print_info(); cout << "generators for the symmetric group in the action on pairs are:" << endl; A_on_edges->Sims->print_generators(); } } A_on_edges->lex_least_base_in_place(verbose_level - 3); if (f_v) { cout << "After lex_least_base, we have the following action:" << endl; A_on_edges->print_info(); cout << "generators for the symmetric group in the induced action are:" << endl; A_on_edges->Sims->print_generators(); } adjacency = NEW_INT(n * n); if (f_tournament) { target_depth = n2; } if (f_regular) { degree_sequence = NEW_INT(n); N = n * regularity; if (ODD(N)) { cout << "n * regularity must be even" << endl; exit(1); } N >>= 1; target_depth = N; } else {
void sub_generator::init(int argc, const char **argv) { F = new finite_field; Asub = new action_on_subspaces; A_ind=new action; A = new action; gen = new generator; INT f_basis = TRUE; INT i; read_arguments(argc, argv); INT verbose_level = gen->verbose_level; INT f_v = (verbose_level >= 1); if (f_v) { cout << "sub_generator::init" << endl; } //nmk = n - k; char k_str[1000]; sprintf(gen->fname_base, "%scodes_%ld_%ld_%ld_%ld ", gen->prefix, n, q, d, nk); for (i=0;i<nk;i++) { sprintf(k_str,"%ld ",klist[i]); strcat(gen->fname_base,k_str); } F->init(q, 0); if (f_v) { cout << "sub_generator::init calling init_matrix_group" << endl; } A->init_projective_group(d, F, f_semilinear, f_basis, verbose_level - 2); if (f_v) { cout << "sub_generator::init finished with init_matrix_group" << endl; } if (f_v) { cout << "sub_generator::init calling init_matrix_group_strong_generators_builtin_projective" << endl; } A->init_matrix_group_strong_generators_builtin(A->G.matrix_grp, verbose_level); if (f_v) { cout << "sub_generator::init finished with init_matrix_group_strong_generators_builtin_projective" << endl; } if (f_v) { cout << "sub_generator::init group set up" << endl; } if (f_v) { cout << "arc_generator::init creating action on sets of subspaces" << endl; } subs = new subspaces; subs->init( d/*d*/, F, verbose_level - 2); Asub->init(*A, subs, verbose_level - 2); A_ind->induced_action_on_subspaces(A, Asub, FALSE /*f_induce_action*/, NULL /*sims *old_G */, MINIMUM(verbose_level - 2, 2)); if (f_v) { cout << "action A_ind created: "; A_ind->print_info(); } gen->depth = n; if (f_v) { cout << "A->f_has_strong_generators=" << A->f_has_strong_generators << endl; } gen->init(A, A_ind, A->Strong_gens, gen->depth /* sz */, verbose_level); if (f_v) { cout << "sub_generator::init group set up, calling gen->init_check_func" << endl; } gen->init_check_func(check_klist, (void*)this /* candidate_check_data */); if (f_v) { cout << "sub_generator::init group set up, calling gen->init_early_test_func" << endl; } //gen->init_early_test_func( //check_klist_early_test_func, //this, //verbose_level); gen->f_its_OK_to_not_have_an_early_test_func = TRUE; //rc.init(F, nmk, n, d); gen->f_print_function = TRUE; gen->print_function = print_code; gen->print_function_data = this; INT nb_oracle_nodes = ONE_MILLION; if (f_v) { cout << "sub_generator::init group set up, calling gen->init_oracle" << endl; } gen->init_oracle(nb_oracle_nodes, verbose_level - 1); if (f_v) { cout << "sub_generator::init group set up, calling gen->root[0].init_root_node" << endl; } gen->root[0].init_root_node(gen, gen->verbose_level - 2); }