这篇教程C++ websWrite函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中websWrite函数的典型用法代码示例。如果您正苦于以下问题:C++ websWrite函数的具体用法?C++ websWrite怎么用?C++ websWrite使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了websWrite函数的21个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: legacyTest/* Legacy handler with old parameter sequence */static int legacyTest(Webs *wp, char *prefix, char *dir, int flags){ websSetStatus(wp, 200); websWriteHeaders(wp, -1, 0); websWriteHeader(wp, "Content-Type", "text/plain"); websWriteEndHeaders(wp); websWrite(wp, "Hello Legacy World/n"); websDone(wp); return 1;}
开发者ID:AnXi-TieGuanYin-Tea,项目名称:goahead,代码行数:13,
示例2: formTeststatic void formTest( webs_t wp, char_t* path, char_t* query ){ char_t* name, *address; name = websGetVar( wp, T( "name" ), T( "Joe Smith" ) ); address = websGetVar( wp, T( "address" ), T( "1212 Milky Way Ave." ) ); websHeader( wp ); websWrite( wp, T( "<body><h2>Name: %s, Address: %s</h2>/n" ), name, address ); websFooter( wp ); websDone( wp, 200 );}
开发者ID:codywon,项目名称:bell-jpg,代码行数:10,
示例3: ej_exec_show_aliasesvoid ej_exec_show_aliases(webs_t wp, int argc, char_t ** argv){ int i; char *count; int c = 0; count = nvram_safe_get("milkfish_ddaliasesnum"); if (count == NULL || strlen(count) == 0 || (c = atoi(count)) <= 0) { websWrite(wp, "<tr>/n<td colspan=/"4/" align=/"center/" valign=/"middle/">- <script type=/"text/javascript/">Capture(share.none)</script> -</td>/n</tr>/n"); } for (i = 0; i < c; i++) { websWrite(wp, "<tr><td>/n<input maxlength=/"30/" size=/"30/" name=/"user%d/" onblur=/"valid_name(this,'Name')/" value=/"", i); show_aliases_table(wp, "user", i); websWrite(wp, "/" /></td>/n<td>/n<input maxlength=/"50/" size=/"50/" name=/"pass%d/" onblur=/"valid_name(this,'Name')/" value=/"", i); show_aliases_table(wp, "pass", i); websWrite(wp, "/" /></td>/n</tr>/n"); } return;}
开发者ID:rogerhu,项目名称:dd-wrt,代码行数:19,
示例4: aspTest/* Parse the form variables: name, address and echo back */static int aspTest(int eid, Webs *wp, int argc, char **argv){ char *name, *address; if (jsArgs(argc, argv, "%s %s", &name, &address) < 2) { websError(wp, 400, "Insufficient args/n"); return -1; } return (int) websWrite(wp, "Name: %s, Address %s", name, address);}
开发者ID:AnXi-TieGuanYin-Tea,项目名称:goahead,代码行数:13,
示例5: ej_dsl_get_parameter/* * retreive and convert dsls values for specified dsl_unit * Example: * <% dsl_get_parameter(); %> for coping wan[n]_ to wan_ */int ej_dsl_get_parameter(int eid, webs_t wp, int argc, char_t **argv){ int unit; unit = nvram_get_int("dsl_unit"); // handle generate cases first (void)copy_index_to_unindex("dsl_", unit, -1); return (websWrite(wp,""));}
开发者ID:matti,项目名称:asuswrt-merlin,代码行数:16,
示例6: ej_get_DSL_WAN_listint ej_get_DSL_WAN_list(int eid, webs_t wp, int argc, char_t **argv){ char buf[MAX_LINE_SIZE]; char buf2[MAX_LINE_SIZE]; char prefix[]="dslXXXXXX_", tmp[100]; int unit; int j; int firstItem; char *display_items[] = {"dsl_enable", "dsl_vpi", "dsl_vci","dsl_proto", "dsl_encap", "dsl_svc_cat", "dsl_pcr","dsl_scr","dsl_mbs",NULL}; for ( unit = 0; unit<8; unit++ ) { snprintf(prefix, sizeof(prefix), "dsl%d_", unit); firstItem = 1; websWrite(wp, "["); for ( j = 0; display_items[j] != NULL; j++ ) { if(firstItem == 1) { firstItem = 0; } else { websWrite(wp, ", "); } strcpy(buf,nvram_safe_get(strcat_r(prefix, &display_items[j][4], tmp))); if (strcmp(buf,"")==0) { strcpy(buf2,"/"0/""); } else { sprintf(buf2,"/"%s/"",buf); } websWrite(wp, "%s", buf2); } if (unit != 7) { websWrite(wp, "], "); } else { websWrite(wp, "]"); } } return 0;}
开发者ID:matti,项目名称:asuswrt-merlin,代码行数:41,
示例7: ShowMediaDirstatic int ShowMediaDir(int eid, webs_t wp, int argc, char_t **argv){ int index; fetchMediaConfig(); media_dir_count = 0; for(index=0;index<4;index++) { if (0 != strlen(media_conf[index].path)) { websWrite(wp, T("<tr align=/"center/">")); websWrite(wp, T("<td><input type=/"radio/" name=/"media_dir/" value=/"%d/"></td>"), index); websWrite(wp, T("<td>%s</td>"), media_conf[index].path); websWrite(wp, T("</tr>")); media_dir_count++; } } return 0;}
开发者ID:houzhenggang,项目名称:MT,代码行数:21,
示例8: ping_onloadvoid ping_onload(webs_t wp, char *arg){ int pid; char *type = websGetVar(wp, "submit_type", ""); pid = find_pid_by_ps("ping"); if (pid > 0 && strncmp(type, "stop", 4)) { // pinging websWrite(wp, arg); }}
开发者ID:ebichu,项目名称:dd-wrt,代码行数:12,
示例9: aspGenerateAccessLimitListstatic int aspGenerateAccessLimitList( int eid, webs_t wp, int argc, char_t** argv ){ char_t* url; int row, nBytesSent, nBytes; a_assert( wp ); row = nBytesSent = 0; url = umGetFirstAccessLimit(); nBytes = websWrite( wp, T( "<SELECT NAME=/"url/" SIZE=/"3/" TITLE=/"Select a URL/">" ) ); while ( url && ( nBytes > 0 ) ) { nBytes = websWrite( wp, T( "<OPTION VALUE=/"%s/">%s/n" ), url, url ); url = umGetNextAccessLimit( url ); nBytesSent += nBytes; } nBytesSent += websWrite( wp, T( "</SELECT>" ) ); return nBytesSent;}
开发者ID:codywon,项目名称:bell-jpg,代码行数:21,
示例10: actionTest/* Implement /action/actionTest. Parse the form variables: name, address and echo back. */static void actionTest(Webs *wp, char *path, char *query){ char *name, *address; name = websGetVar(wp, "name", NULL); address = websGetVar(wp, "address", NULL); websSetStatus(wp, 200); websWriteHeaders(wp, -1, 0); websWriteEndHeaders(wp); websWrite(wp, "<html><body><h2>name: %s, address: %s</h2></body></html>/n", name, address); websDone(wp);}
开发者ID:AnXi-TieGuanYin-Tea,项目名称:goahead,代码行数:15,
示例11: ej_vpns_leasesintej_vpns_leases(int eid, webs_t wp, int argc, char **argv){ FILE *fp; int ret = 0, i_clients = 0; char ifname[16], addr_l[32], addr_r[32], peer_name[64]; ret += websWrite(wp, "# IP Local IP Remote Login NetIf/n"); if (!(fp = fopen("/tmp/vpns.leases", "r"))) { return ret; } while (fscanf(fp, "%s %s %s %[^/n]/n", ifname, addr_l, addr_r, peer_name) == 4) { i_clients++; ret += websWrite(wp, "%-3u", i_clients); ret += websWrite(wp, "%-17s", addr_l); ret += websWrite(wp, "%-17s", addr_r); ret += websWrite(wp, "%-15s", peer_name); ret += websWrite(wp, "%s/n", ifname); } fclose(fp); return ret;}
开发者ID:PterX,项目名称:rt-n56u,代码行数:26,
示例12: formDeleteGroupstatic void formDeleteGroup(webs_t wp, char_t *path, char_t *query){ char_t *group, *ok; a_assert(wp); group = websGetVar(wp, T("group"), T("")); ok = websGetVar(wp, T("ok"), T("")); websHeader(wp); websMsgStart(wp); if (gstricmp(ok, T("ok")) != 0) { websWrite(wp, T("Delete Group Cancelled.")); } else if ((group == NULL) || (*group == '/0')) { websWrite(wp, T("ERROR: No group was selected.")); } else if (umGetGroupProtected(group)) { websWrite(wp, T("ERROR: Group, /"%s/" is delete-protected."), group); } else if (umGetGroupInUse(group)) { websWrite(wp, T("ERROR: Group, /"%s/" is being used."), group); } else if (umDeleteGroup(group) != 0) { websWrite(wp, T("ERROR: Unable to delete group, /"%s/" "), group); } else { websWrite(wp, T("Group, /"%s/" was successfully deleted."), group); } websMsgEnd(wp); websFooter(wp); websDone(wp, 200);}
开发者ID:BackupGGCode,项目名称:faceaip,代码行数:30,
示例13: __websLuciferHandlerstatic int __websLuciferHandler(webs_t wp, char_t *urlPrefix, char_t *webDir, int arg, char_t *url, char_t *path, char_t* query){ int method = 0; fprintf(stderr, "__websLuciferHandler: urlPrefix(%s),webDir(%s),arg(%d),url(%s), path(%s),query(%s)/r/n", urlPrefix,webDir,arg,url,path,query); fprintf(stderr, "flags(%08X)/r/n", wp->flags); if(wp->flags & WEBS_HEAD_REQUEST) { fprintf(stderr, "request(HEAD)/r/n"); } else if(wp->flags & WEBS_POST_REQUEST) { fprintf(stderr, "request(POST)/r/n"); websWrite(wp, T("{List:[ " "{/"Role/":/"A/",/"Msg/"Msg/":/"哈/":/"哈哈哈哈哈哈啊哈/",/"Date/":/"2012-12-24 15:32/"}," "{/"Role/":/"A/",哈哈哈哈哈啊哈/",/"Date/":/"2012-12-24 15:32/"}," "{/"Role/":/"A/",/"Msg/":/"哈哈哈哈哈哈啊哈/",/"Date/":/"2012-12-24 15:32/"}," "{/"Role/":/"B/",/"Msg/":/"哈哈哈哈哈哈啊哈/",/"Date/":/"2012-12-24 15:32/"}," "{/"Role/":/"A/",/"Msg/":/"哈哈哈哈哈哈啊哈/",/"Date/":/"2012-12-24 15:32/"}," "{/"Role/":/"B/",/"Msg/":/"哈哈哈哈哈哈啊哈/",/"Date/":/"2012-12-24 15:32/"}" "] }" )); } else { fprintf(stderr, "request(GET)/r/n"); websWrite(wp, T("{/"List/":[" "{/"No/":/"13696994500/",/"FName/":/"吴昕/",/"Date/":/"15:20/",/"Msg/":/"晚上去哪里吃饭/"}," "{/"No/":/"13696994501/",/"FName/":/"吴昕/",/"Date/":/"15:30/",/"Msg/":/"晚上去哪里吃饭/"}," "{/"No/":/"13696994502/",/"FName/":/"吴昕/",/"Date/":/"15:40/",/"Msg/":/"晚上去哪里吃饭/"}," "{/"No/":/"13696994503/",/"FName/":/"吴昕/",/"Date/":/"15:50/",/"Msg/":/"晚上去哪里吃饭/"} ]}" )); } websDone(wp, 200); return 1;}
开发者ID:18959263172,项目名称:httpserver,代码行数:40,
示例14: aspGenerateUserListstatic int aspGenerateUserList( int eid, webs_t wp, int argc, char_t** argv ){ char_t* userid; int row, nBytesSent, nBytes; a_assert( wp ); nBytes = websWrite( wp, T( "<SELECT NAME=/"user/" SIZE=/"3/" TITLE=/"Select a User/">" ) ); row = 0; userid = umGetFirstUser(); nBytesSent = 0; while ( userid && ( nBytes > 0 ) ) { nBytes = websWrite( wp, T( "<OPTION VALUE=/"%s/">%s/n" ), userid, userid ); userid = umGetNextUser( userid ); nBytesSent += nBytes; } nBytesSent += websWrite( wp, T( "</SELECT>" ) ); return nBytesSent;}
开发者ID:codywon,项目名称:bell-jpg,代码行数:22,
示例15: formDeleteUserstatic void formDeleteUser( webs_t wp, char_t* path, char_t* query ){ char_t* userid, *ok; a_assert( wp ); userid = websGetVar( wp, T( "user" ), T( "" ) ); ok = websGetVar( wp, T( "ok" ), T( "" ) ); websHeader( wp ); websMsgStart( wp ); if ( gstricmp( ok, T( "ok" ) ) != 0 ) { websWrite( wp, T( "Delete User Cancelled" ) ); } else if ( umUserExists( userid ) == FALSE ) { websWrite( wp, T( "ERROR: User /"%s/" not found" ), userid ); } else if ( umGetUserProtected( userid ) ) { websWrite( wp, T( "ERROR: User, /"%s/" is delete-protected." ), userid ); } else if ( umDeleteUser( userid ) != 0 ) { websWrite( wp, T( "ERROR: Unable to delete user, /"%s/" " ), userid ); } else { websWrite( wp, T( "User, /"%s/" was successfully deleted." ), userid ); } websMsgEnd( wp ); websFooter( wp ); websDone( wp, 200 );}
开发者ID:codywon,项目名称:bell-jpg,代码行数:38,
示例16: ej_get_clone_macvoid ej_get_clone_mac(webs_t wp, int argc, char_t ** argv){ char *c; int mac, which; int dofree = 0;#ifdef FASTWEB ejArgs(argc, argv, "%d", &which);#else if (ejArgs(argc, argv, "%d", &which) < 1) { websError(wp, 400, "Insufficient args/n"); }#endif if (nvram_match("clone_wan_mac", "1")) c = nvram_safe_get("http_client_mac"); else { if (nvram_match("def_hwaddr", "00:00:00:00:00:00")) { if (nvram_match("port_swap", "1")) c = strdup(nvram_safe_get("et1macaddr")); else c = strdup(nvram_safe_get("et0macaddr")); if (c) { MAC_ADD(c); dofree = 1; } } else c = nvram_safe_get("def_hwaddr"); } if (c) { mac = get_single_mac(c, which); websWrite(wp, "%02X", mac); if (dofree) free(c); } else websWrite(wp, "00");}
开发者ID:rogerhu,项目名称:dd-wrt,代码行数:38,
示例17: formSaveUserManagementstatic void formSaveUserManagement(webs_t wp, char *path, char *query){ char *ok; a_assert(wp); ok = websGetVar(wp, T("ok"), T("")); websHeader(wp); websMsgStart(wp); if (gstricmp(ok, T("ok")) != 0) { websWrite(wp, T("Save Cancelled.")); } else if (umCommit(NULL) != 0) { websWrite(wp, T("ERROR: Unable to save user configuration.")); } else { websWrite(wp, T("User configuration was saved successfully.")); } websMsgEnd(wp); websFooter(wp); websDone(wp, 200);}
开发者ID:victorquan,项目名称:goaheadServer,代码行数:23,
示例18: formLoadUserManagementstatic void formLoadUserManagement(webs_t wp, char_t *path, char_t *query){ char_t *ok; a_assert(wp); ok = websGetVar(wp, T("ok"), T("")); websHeader(wp); websMsgStart(wp); if (gstricmp(ok, T("ok")) != 0) { websWrite(wp, T("Load Cancelled.")); } else if (umRestore(NULL) != 0) { websWrite(wp, T("ERROR: Unable to load user configuration.")); } else { websWrite(wp, T("User configuration was re-loaded successfully.")); } websMsgEnd(wp); websFooter(wp); websDone(wp, 200);}
开发者ID:BackupGGCode,项目名称:faceaip,代码行数:23,
示例19: QoSPortSetupstatic void QoSPortSetup(webs_t wp, char_t *path, char_t *query){ int i; char_t *portX[32]; char_t *portX_remark[32]; char tmp_str[512]; memset(portX, 0, sizeof(char *) * 32); memset(portX_remark, 0, sizeof(char *) * 32); for(i=0; i<5; i++) { sprintf(tmp_str, "port%d_group", i); portX[i] = websGetVar(wp, T(tmp_str), T("")); sprintf(tmp_str, "port%d_remarker", i); portX_remark[i] = websGetVar(wp, T(tmp_str), T("")); } for(i=1; i<9; i++) { sprintf(tmp_str, "ssid%d_group", i); portX[i+4] = websGetVar(wp, T(tmp_str), T("")); sprintf(tmp_str, "ssid%d_remarker", i); portX_remark[i+4] = websGetVar(wp, T(tmp_str), T("")); } tmp_str[0] = '/0'; for(i=0; i<13; i++) { if(portX[i]) strcat(tmp_str, portX[i]); strcat(tmp_str, ","); if(portX_remark[i]) strcat(tmp_str, portX_remark[i]); strcat(tmp_str, ","); } nvram_bufset(RT2860_NVRAM, "QoSPortBasedRules", tmp_str); nvram_commit(RT2860_NVRAM); QoSRestart(); websHeader(wp); for(i=0; i<13; i++) { sprintf(tmp_str, "port%d=%s,%s<br>", i, portX[i], portX_remark[i]); websWrite(wp, T(tmp_str)); } websFooter(wp); websDone(wp, 200);}
开发者ID:withwave,项目名称:RT5350,代码行数:49,
示例20: traceroute_onloadinttraceroute_onload(webs_t wp, char *arg){ int ret = 0; int pid; char *type = websGetVar(wp, "submit_type", ""); pid = find_pid_by_ps("traceroute"); if (pid > 0 && strncmp(type, "stop", 4)) { // tracerouting ret += websWrite(wp, arg); } return ret;}
开发者ID:aircross,项目名称:ray,代码行数:15,
示例21: printersrvstatic void printersrv(webs_t wp, char_t *path, char_t *query){ char_t *enable; // fetch from web input enable = websGetVar(wp, T("enabled"), T("")); // set to nvram nvram_bufset(RT2860_NVRAM, "PrinterSrvEnabled", enable); nvram_commit(RT2860_NVRAM); // setup device doSystem("killall p910nd"); if (0 == strcmp(enable, "1")) { doSystem("p910nd -b -f /dev/lp0"); } // debug print websHeader(wp); websWrite(wp, T("<h2>Printer Server Settings</h2><br>/n")); websWrite(wp, T("enabled: %s<br>/n"), enable); websFooter(wp); websDone(wp, 200);}
开发者ID:houzhenggang,项目名称:MT,代码行数:24,
注:本文中的websWrite函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ weechat_config_integer函数代码示例 C++ websValid函数代码示例 |