Advertisement
Guest User

Untitled

a guest
Dec 18th, 2018
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.04 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4.  
  5. #define MSL_TOKEN 1
  6. #define MSF_TOKEN 2
  7. char msl;
  8. char msf;
  9. char *temp, *temp2;
  10.  
  11. int db_creation_mode = 0;
  12.  
  13.  
  14.  
  15. FILE  *fin;
  16.  
  17. void run(){
  18.  
  19. }
  20.  
  21. int setup(int argc, char *argv[]) {
  22.  
  23.     if (argc < 2) {
  24.         return NULL;
  25.     }
  26.  
  27.     fin = fopen(argv[1], "r");
  28.  
  29.  
  30.     if(fin){
  31.         db_creation_mode = 1;
  32.     }
  33.  
  34.     handle_optional(argc, argv);
  35.  
  36.  
  37.  
  38.  
  39.     return 0;
  40.  
  41. }
  42. int parse_option(char *option){
  43.     char tmp[20];
  44.  
  45.     strcpy(tmp, option);
  46.  
  47.     if(strstr(tmp, "-msf")){
  48.         return MSF_TOKEN;
  49.     }
  50.     else{
  51.         return MSL_TOKEN;
  52.     }
  53. }
  54.  
  55. void handle_optional(int argc, int **argv){
  56.     int i;
  57.     if(argc > 2){
  58.         for(i = 0; i < argc; i++){
  59.  
  60.             switch(parse_option(argv[i])){
  61.                 case MSF_TOKEN:
  62.                     break;
  63.  
  64.                 case MSL_TOKEN:
  65.                     break;
  66.  
  67.                 default:
  68.             }
  69.         }
  70.  
  71.     }
  72. }
  73. int shutdown(){
  74. }
  75.  
  76. int main(int argc, char *argv[]) {
  77.  
  78.  
  79.  
  80.  
  81.     return 0;
  82. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement