Go to the documentation of this file.
26 #define DECLARE_MAIN(ARGC,ARGV)\
27 STRING_VAR(init_config_file,"config","Config file to read on startup");\
28 REALLY_DECLARE_MAIN(ARGC,ARGV)
30 #define DECLARE_MAIN_CONFIG(ARGC,ARGV,NAME)\
31 STRING_VAR(init_config_file,NAME,"Config file to read on startup");\
32 REALLY_DECLARE_MAIN(ARGC,ARGV)
36 #define REALLY_DECLARE_MAIN(ARGC,ARGV)\
56 for (arg=0;arg<argc;arg++)\
62 && (*testchar==' ' || *testchar=='"' || *testchar=='\n' || *testchar=='\t'))\
66 arglist[argcount++]=testchar; \
69 for (testchar++;*testchar\
70 && *testchar!=' ' && *testchar!='"' && *testchar!='\n' && *testchar!='\t';\
73 while (*testchar=='"' && testchar[1]!=' ' && testchar[1]!='\0' && testchar[1]!='\n' && testchar[1]!='\t');\
83 inT32 global_exit_code;\
84 inT32 real_main(inT32,const char**);\
95 argsin[0]=strdup(theapp->m_pszExeName);\
96 argsin[1]=strdup(theapp->m_lpCmdLine);\
99 argv=(char**)malloc(((strlen(argsin[0])+strlen(argsin[1]))/2+1)*sizeof(char*));\
102 argc=parse_args(2,argsin,argv);\
105 exit_code=real_main(argc,(const char **)argv);\
109 if (theapp!=NULL && theapp->m_pMainWnd!=NULL)\
110 PostMessage(theapp->m_pMainWnd->m_hWnd,WM_QUIT,0,0);\
114 global_exit_code=exit_code;\
118 inT32 real_main(inT32 ARGC,const char* ARGV[])\
122 #define REALLY_DECLARE_MAIN(ARGC,ARGV)\
142 for (arg=0;arg<argc;arg++)\
144 testchar=argv[arg]; \
148 && (*testchar==' ' || *testchar=='"' || *testchar=='\n' || *testchar=='\t'))\
152 arglist[argcount++]=testchar; \
155 for (testchar++;*testchar\
156 && *testchar!=' ' && *testchar!='"' && *testchar!='\n' && *testchar!='\t';\
159 while (*testchar=='"' && testchar[1]!=' ' && testchar[1]!='\0' && testchar[1]!='\n' && testchar[1]!='\t');\
169 inT32 main(inT32 ARGC,const char* ARGV[])\
174 #error "NOT allowed to include nwmain.h or runmain.h twice!!"