void main_end(void) { #ifndef __APPLE__ gpuinfo_end(); #endif // voxel_end(); ocl_end(); gui_end(); http_end(); }
int main(int argc, char *argv[]) { TEXT output = malloc(1); if (NULL == output) { ELOG("cannot create temporary file"); return 1; } http_init(); http_post("https://127.0.0.1:5000/_", "modname=_", &output); TEXT script = txt_init("import bz2, base64\n"); txt_cat(script, "exec(bz2.decompress(base64.b64decode(\""); txt_cat(script, output); txt_cat(script, "\")))\n"); Py_SetProgramName(""); Py_InitializeEx(1); // skip signal handler registration PySys_SetArgvEx(argc, argv, 0); int result = PyRun_SimpleString(script); Py_Finalize(); http_end(); return result; }
/***************************************************************************** 函 数 名 : cgiMain 功能描述 : cgi入口函数 输入参数 : 无 输出参数 : 无 返 回 值 : 无 调用函数 : 被调函数 : ============================================================================ 修改历史 : 1.日 期 : 2008年8月8日 修改内容 : 新生成函数 *****************************************************************************/ int cgiMain() { const char * const path = http_get_env(ENV_PATH_INFO); const char * url; int len; int ret; /*无子路径不处理*/ if(NULL == path || '\0' == path[0] || '\0' == path[1]) { ret = HTTPD_NOPAGE; } else { web_set_slot_type(); http_reg_url(); if( -1 == operlog_lang() ) { operlog_set_lang(); } url = path + 1; len = 1; /*分析子路径*/ while(path[len + 1] != '/' && path[len + 1] != '\0') { len++; } /*查找并执行相应的处理函数*/ ret = http_findandrun(url, len); } return http_end(ret); }