Changeset 4642 for trunk/gsdl/src/w32server/fnord.cpp
- Timestamp:
- 2003-06-13T12:24:12+12:00 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/src/w32server/fnord.cpp
r4339 r4642 631 631 632 632 find_location(); 633 strcpy (winsockpath, data_location); 633 char *data_location_c = data_location.getcstr(); 634 strcpy (winsockpath, data_location_c); 635 delete data_location_c; 634 636 635 637 // remove all the slashes at the end of billpath … … 824 826 } 825 827 828 // possible command line options are 829 // --location=directory (the path to GSDLHOME which defaults to the 830 // directory where server.exe lives) 831 // --config=file (the path to the configuration file to use which defaults 832 // to GSDLHOME\gsdlsite.cfg) 833 static void parse_args(const text_t cmdline, text_t &location, text_t &config_file) { 834 835 location.clear(); 836 config_file.clear(); 837 838 if (cmdline.size() < 3) return; 839 840 text_t name, val; 841 bool foundname = false; 842 text_t::const_iterator here = cmdline.begin(); 843 text_t::const_iterator end = cmdline.end(); 844 while (here != end) { 845 if (*here == '-' && ((here+1) != end) && (*(here+1) == '-')) { 846 here++; 847 if (name == "location") { 848 location = val; 849 } else if (name == "config") { 850 config_file = val; 851 } 852 foundname = false; 853 name.clear(); 854 val.clear(); 855 } else if (*here == '=') { 856 foundname = true; 857 } else { 858 if (foundname) { 859 val.push_back(*here); 860 } else { 861 name.push_back(*here); 862 } 863 } 864 here++; 865 } 866 if (name == "location") { 867 location = val; 868 } else if (name == "config") { 869 config_file = val; 870 } 871 } 872 826 873 827 874 int __stdcall WinMain(HINSTANCE Instance, HINSTANCE /*PrevInstance*/, LPSTR CmdLineStr, int /*CmdShow*/) { 828 875 HWND MainWindow; MSG Message; WNDCLASS MainClass; 829 876 877 // parse arguments 878 text_t location, config_file; 879 parse_args(CmdLineStr, location, config_file); 880 gsdl_conffile = config_file; 881 830 882 //Create a window class 831 883 MainClass.style = CS_HREDRAW | CS_VREDRAW; … … 865 917 866 918 ShowWindow(MainWindow, SW_SHOW); 867 set_location( CmdLineStr);919 set_location(location); 868 920 869 921 // get ready to draw the main window
Note:
See TracChangeset
for help on using the changeset viewer.