这篇教程C++ ACL_SAFE_STRNCPY函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中ACL_SAFE_STRNCPY函数的典型用法代码示例。如果您正苦于以下问题:C++ ACL_SAFE_STRNCPY函数的具体用法?C++ ACL_SAFE_STRNCPY怎么用?C++ ACL_SAFE_STRNCPY使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了ACL_SAFE_STRNCPY函数的27个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: http_hdr_req_newHTTP_HDR_REQ *http_hdr_req_clone(const HTTP_HDR_REQ* hdr_req){ HTTP_HDR_REQ *hh; hh = http_hdr_req_new(); http_hdr_clone(&hdr_req->hdr, &hh->hdr); hh->port = hdr_req->port; ACL_SAFE_STRNCPY(hh->method, hdr_req->method, sizeof(hh->method)); ACL_SAFE_STRNCPY(hh->host, hdr_req->host, sizeof(hh->host)); acl_vstring_strcpy(hh->url_part, acl_vstring_str(hdr_req->url_part)); acl_vstring_strcpy(hh->url_path, acl_vstring_str(hdr_req->url_path)); acl_vstring_strcpy(hh->url_params, acl_vstring_str(hdr_req->url_params)); acl_vstring_strcpy(hh->file_path, acl_vstring_str(hdr_req->file_path)); if (hdr_req->params_table) { hh->params_table = acl_htable_create(__http_hdr_max_request, 0); acl_htable_walk(hdr_req->params_table, clone_table_entry, (void*) hh->params_table); } if (hdr_req->cookies_table) { hh->cookies_table = acl_htable_create(__http_hdr_max_cookies, 0); acl_htable_walk(hdr_req->cookies_table, clone_table_entry, (void*) hh->cookies_table); } return hh;}
开发者ID:1514louluo,项目名称:acl,代码行数:28,
示例2: dbconn_initstatic void dbconn_init(const char *addr, const char *name, const char *usr, const char *pass, int dbpool_max, int dbping, int dbtimeout){ const char *myname = "dbconn_init"; ACL_DB_INFO db_info; memset(&db_info, 0, sizeof(ACL_DB_INFO)); ACL_SAFE_STRNCPY(db_info.db_addr, addr, sizeof(db_info.db_addr)); ACL_SAFE_STRNCPY(db_info.db_name, name, sizeof(db_info.db_name)); ACL_SAFE_STRNCPY(db_info.db_user, usr, sizeof(db_info.db_user)); ACL_SAFE_STRNCPY(db_info.db_pass, pass, sizeof(db_info.db_pass)); db_info.db_max = dbpool_max; db_info.ping_inter = dbping; db_info.timeout_inter = dbtimeout; db_info.auto_commit = 1; //db_info.db_before_connect = db_before_connect; //db_info.db_after_connect = db_after_connect; __db_pool = acl_dbpool_create("mysql", &db_info); if (__db_pool == NULL) acl_msg_fatal("%s(%d): init db pool error", myname, __LINE__);}
开发者ID:aaronshang,项目名称:acl,代码行数:27,
示例3: xml_new_gidstatic int xml_new_gid(ACL_VSTREAM *client, int keep_alive, ACL_XML_NODE *node){ acl_int64 gid; char buf[256], tag[64]; const char *ptr; int errnum = 0;#define STR acl_vstring_str ACL_SAFE_STRNCPY(tag, "default:", sizeof(tag)); ptr = acl_xml_getElementAttrVal(node, "tag"); if (ptr && *ptr) { ACL_SAFE_STRNCPY(tag, ptr, sizeof(tag)); } gid = gid_next(var_cfg_gid_path, tag, var_cfg_gid_step, &errnum); if (gid >= 0) snprintf(buf, sizeof(buf), "<respond status='ok' gid='%lld' tag='%s' />/r/n", gid, tag); else snprintf(buf, sizeof(buf), "<respond status='error' gid='%lld' tag='%s'" " err='%d' msg='%s' />/r/n", gid, tag, errnum, gid_serror(errnum)); return (http_server_send_respond(client, 200, keep_alive, buf, (int) strlen(buf)));}
开发者ID:10jschen,项目名称:acl,代码行数:28,
示例4: acl_unix_listenbool server_socket::open(const char* addr){#ifndef ACL_WINDOWS if (strchr(addr, '/') != NULL) { fd_ = acl_unix_listen(addr, backlog_, block_ ? ACL_BLOCKING : ACL_NON_BLOCKING); unix_sock_ = true; ACL_SAFE_STRNCPY(addr_, addr, sizeof(addr_)); } else#endif fd_ = acl_inet_listen(addr, backlog_, block_ ? ACL_BLOCKING : ACL_NON_BLOCKING); if (fd_ == ACL_SOCKET_INVALID) { logger_error("listen %s error %s", addr, last_serror()); unix_sock_ = false; ACL_SAFE_STRNCPY(addr_, addr, sizeof(addr_)); return false; } if (unix_sock_) return true; // 之所以再用 getsockname 重新获得一些监听地址,主要是为了应对当输入的 addr // 为 ip:0 的情形,即当给定的地址中的端口为 0 时要求操作系统自动分配一个端口号 if (acl_getsockname(fd_, addr_, sizeof(addr_)) < 0) { logger_error("getsockname error: %s", acl_last_serror()); ACL_SAFE_STRNCPY(addr_, addr, sizeof(addr_)); } return true;}
开发者ID:1514louluo,项目名称:acl,代码行数:35,
|