int main(int argc, char *argv[]) { const char *config = "config"; struct pixel_config cfg; lua_State *L; if (argc > 1) { config = argv[1]; } signin(); pixel_init(); L = luaL_newstate(); if (LUA_OK != luaL_dofile(L, config)) { fprintf(stderr, "load config:%s\n", lua_tostring(L, -1)); return 1; } _init_env(L); cfg.thread = optint("thread", 8); cfg.harbor = optint("harbor", 1); cfg.module_path = optstring("cservice", "./?.so"); cfg.bootstrap = optstring("bootstrap", "lua bootstrap"); cfg.logfile = optstring("log", 0); lua_close(L); pixel_start(&cfg); pixel_unit(); return 0; }
void MMD() { cout << "SmallOS by <you will know who, if you sign in and type ""about""." << endl; cout << "1. Sign up" << endl; cout << "2. Sign in" << endl; cout << "3. Shutdown guest" << endl; cout << "Enter your choise: "; int choise = 0; cin >> choise; switch (choise) { case 1: signup();break; case 2: signin();break; case 3: exit(0);break; default : MMD();break; } }
/////////////////////////////////////////////////// // Initiatise translator & connect /////////////////////////////////////////////////// bool CSNAPIClient::startup(CHARPTR host,CHARPTR setUser,CHARPTR setHostpin,CHARPTR setDialnum,CHARPTR setLocale,CHARPTR logPath,eLogLevel logLevel) { // De-reference group handle grpHandle = MEDIA_INVALID; // Store access details strncpy(hostpin,setHostpin,CBUFF_MEDIUM); strncpy(dialnum,setDialnum,CBUFF_MEDIUM); strncpy(user,setUser,CBUFF_MEDIUM); // language strcpy(locale,setLocale); // Commence logging - to remove logging - comment out lub.launch(logPath,5,500,logLevel,logLevel,this); // Create second logger logger = lub.createLogger(); // Start thread signin(host,10098,lub.createLogger()); return true; }
string solve(string command,user*& cur_user) { vector <string> commands; string x; string sol; commands=parse(command); x=commands[0]; if(x=="exit" || x=="disconnect") return x; if(x=="signup") sol=signup(cur_user,commands); if(x=="signin") sol=signin(cur_user,commands); if(x=="signout" && commands.size()==1) { cur_user=NULL; return "signing out completed.\n"; } if(x=="show_boards") sol=show_boards(cur_user); if(x=="enter_board") sol=enter_board(cur_user,commands); if(x=="add_user") sol=add_user(cur_user,commands); if(x=="remove_user_from_board") sol=remove_user_from_board(cur_user,commands); if(x=="show_lists" && commands.size()==1) sol=show_lists(cur_user); if(x=="show_cards") sol=show_cards(cur_user,commands); if(x=="show_card") sol=show_card(cur_user,commands); if(x=="create_board") sol=create_board(cur_user,commands); if(x=="remove_board") sol=remove_board(cur_user,commands); if(x=="add_list") sol=add_list(cur_user,commands); if(x=="remove_list") sol=remove_list(cur_user,commands); if(x=="add_card") sol=add_card(cur_user,commands); if(x=="remove_card") sol=remove_card(cur_user,commands); if(x=="move_card") sol=move_card(cur_user,commands); if(x=="rename_card") sol=rename_card(cur_user,commands); if(x=="edit_card_description") sol=edit_card_des(cur_user,commands); if(x=="edit_card_due_date") sol=edit_card_date(cur_user,commands); if(x=="assign_user") sol=assign(cur_user,commands); if(x=="remove_user") sol=remove_user_from_card(cur_user,commands); if(x=="comment") sol=commenting(cur_user,commands); if(x=="filter") sol=filter(cur_user,commands); if(sol.size()==0) sol="Invalid command.\n"; return sol; }
Hub& Hub::signin(void){ std::string token = Host::env_var("STENCILA_HUB_TOKEN"); if(token.length()==0) STENCILA_THROW(Exception,"Environment variable STENCILA_HUB_TOKEN is not defined"); return signin(token); }