int main (int argc, char *argv[]) { show_key_schedule(); int show_vec = 0,show_galois = 0, show_ksch = 0, show_sbox = 0; for (int i = 1; i < argc && argv[i][0] == '-'; i++) { switch (argv[i][1]) { case 'g': show_galois++; break; case 'k': show_ksch++; break; case 's': show_sbox++; break; default: printf("unknown option -%c\n", argv[i][1]); printf("Usage: %s [OPTIONS]\n", argv[0]); exit(1); } } if (show_vec) test_lib(); if (show_ksch) show_key_schedule(); if (show_sbox) sbox_print(); return (0); }
main() { pthread_t thread1, thread2, thread3; char *message1 = "Thread 1"; char *message2 = "Thread 2"; char *message3 = "Thread 3"; int iret1, iret2, iret3; //signal(SIGTRAP, (sighandler_t) sigtrap_handler); //signal(SIGSTOP, (sighandler_t) sigstop_handler); //signal(SIGUSR2, (sighandler_t) sigusr2_handler); iret1 = pthread_create( &thread1, NULL, print_message_function, (void*) message1); iret2 = pthread_create( &thread2, NULL, print_message_function, (void*) message2); iret3 = pthread_create( &thread3, NULL, print_message_function_lib, (void*) message3); test_lib(); /* Wait till threads are complete before main continues. Unless we */ /* wait we run the risk of executing an exit which will terminate */ /* the process and all threads before the threads have completed. */ pthread_join( thread1, NULL); pthread_join( thread2, NULL); pthread_join( thread3, NULL); fprintf(stderr, "Thread 1 returns: %d\n",iret1); fprintf(stderr, "Thread 2 returns: %d\n",iret2); fprintf(stderr, "Thread 3 returns: %d\n",iret3); exit(0); }
int main(){ while(1){ test_lib(); sleep(2); printf("is test\n"); } }
int main(int argc, char *argv[]) { int opt; opterr = 0; while ((opt = getopt(argc, argv, "gksv")) != -1) { switch (opt) { case 'v': ++opt_show_vec; break; case 'g': ++opt_show_galois; break; case 'k': ++opt_show_ksch; break; case 's': ++opt_show_sbox; break; default: printf("unknown option -%c\n", PRTCHAR(optopt)); printf("Usage: %s [OPTIONS]\n", argv[0]); exit(1); } } aes_init(); if (opt_show_galois) galois_print_tables(); if (opt_show_sbox) rijndael_sbox_print(); if (opt_show_ksch) show_key_schedule(); if (opt_show_vec) test_lib(); return 0; }