Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string.h>
- #define MSL_TOKEN 1
- #define MSF_TOKEN 2
- char msl;
- char msf;
- char *temp, *temp2;
- int db_creation_mode = 0;
- FILE *fin;
- void run(){
- }
- int setup(int argc, char *argv[]) {
- if (argc < 2) {
- return NULL;
- }
- fin = fopen(argv[1], "r");
- if(fin){
- db_creation_mode = 1;
- }
- handle_optional(argc, argv);
- return 0;
- }
- int parse_option(char *option){
- char tmp[20];
- strcpy(tmp, option);
- if(strstr(tmp, "-msf")){
- return MSF_TOKEN;
- }
- else{
- return MSL_TOKEN;
- }
- }
- void handle_optional(int argc, int **argv){
- int i;
- if(argc > 2){
- for(i = 0; i < argc; i++){
- switch(parse_option(argv[i])){
- case MSF_TOKEN:
- break;
- case MSL_TOKEN:
- break;
- default:
- }
- }
- }
- }
- int shutdown(){
- }
- int main(int argc, char *argv[]) {
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement