commit 451f390036b73f233c3370b4fe0a304474280073 Author: lidy@connor.net.cn Date: Thu Mar 21 18:50:06 2024 +0800 20240321代码上传 diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..0c15648 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,5 @@ +# Rules in this file were initially inferred by Visual Studio IntelliCode from the D:\正泰\正泰整理\BOM数据读取优化\BOM数据读取优化\GetBOMProp codebase based on best match to current usage at 2023/11/7 +# You can modify the rules from these initially generated values to suit your own policies +# You can learn more about editorconfig here: https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference +[*.cs] + diff --git a/.vs/BOMToSapOpt/v14/.suo b/.vs/BOMToSapOpt/v14/.suo new file mode 100644 index 0000000..afdb091 Binary files /dev/null and b/.vs/BOMToSapOpt/v14/.suo differ diff --git a/BOMToSapOpt.sdf b/BOMToSapOpt.sdf new file mode 100644 index 0000000..d4b72dd Binary files /dev/null and b/BOMToSapOpt.sdf differ diff --git a/BOMToSapOpt.sln b/BOMToSapOpt.sln new file mode 100644 index 0000000..c03bf26 --- /dev/null +++ b/BOMToSapOpt.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.28307.1705 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DFL_BOM_WL_TOERP", "DFL_BOM_WL_TOERP\DFL_BOM_WL_TOERP.vcxproj", "{C1C26324-9AD6-4D45-B239-589A82585DD9}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {C1C26324-9AD6-4D45-B239-589A82585DD9}.Debug|x64.ActiveCfg = Debug|x64 + {C1C26324-9AD6-4D45-B239-589A82585DD9}.Debug|x64.Build.0 = Debug|x64 + {C1C26324-9AD6-4D45-B239-589A82585DD9}.Debug|x86.ActiveCfg = Debug|Win32 + {C1C26324-9AD6-4D45-B239-589A82585DD9}.Debug|x86.Build.0 = Debug|Win32 + {C1C26324-9AD6-4D45-B239-589A82585DD9}.Release|x64.ActiveCfg = Release|x64 + {C1C26324-9AD6-4D45-B239-589A82585DD9}.Release|x64.Build.0 = Release|x64 + {C1C26324-9AD6-4D45-B239-589A82585DD9}.Release|x86.ActiveCfg = Release|Win32 + {C1C26324-9AD6-4D45-B239-589A82585DD9}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {271C6664-6B03-4C7D-852A-CC17E0633488} + EndGlobalSection +EndGlobal diff --git a/DFL_BOM_WL_TOERP/AutoFeeding.cpp b/DFL_BOM_WL_TOERP/AutoFeeding.cpp new file mode 100644 index 0000000..7b646ac --- /dev/null +++ b/DFL_BOM_WL_TOERP/AutoFeeding.cpp @@ -0,0 +1,618 @@ +//#include "dfl_custom.h" +//#include +//#include +//#include +//#include +//#include "ado.h" +//#include +//#include +//#include "rapidjson/document.h" +//#include +//#include "rapidjson/writer.h" +//#include +//#include +//#include +//#include "ocilib.h" +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//using namespace std; +//extern "C" int POM_AM__set_application_bypass(logical bypass); +////regex qq_reg("^1ZDB5.*\\d{1,}1000X.*-\\d{5,}$"); +//tag_t getPBomTag(tag_t designRev) { +// char* object_type; +// AOM_ask_value_string(designRev,"object_type",&object_type); +// if (strcmp(object_type,"ZT2_Design3DRevision") == 0) { +// int num; +// tag_t* mantrs; +// ITKCALL(AOM_ask_value_tags(designRev, "representation_for", &num, &mantrs)); +// return mantrs[0]; +// } +// else if (strcmp(object_type, "Part Revision") == 0) { +// return designRev; +// } +//} +//void getDrawNo(tag_t bom_line,string &drawNo){ +// char* bl_desc; +// AOM_ask_value_string(bom_line, "bl_rev_object_desc", &bl_desc); +// regex qq_reg2("^1ZDB5.*\\d{1,}1000X.*"); +// //string item_id = id; +// AOM_ask_value_string(bom_line, "bl_rev_object_desc", &bl_desc); +// vector descVec1; +// Split(bl_desc, " ", descVec1); +// printf("bl_desc===>%s\n", bl_desc); +// if (descVec1.size() > 1) { +// string drawNos = descVec1[1]; +// printf("drawNos===>%s\n", descVec1[0].c_str()); +// printf("drawNos===>%s\n", drawNos.c_str()); +// vector drawNoVec1; +// Split(drawNos, "-", drawNoVec1); +// if (drawNoVec1.size() > 1) { +// drawNo = drawNoVec1[0]; +// smatch result; +// vector vec2; +// Split(drawNo,"_", vec2); +// if (vec2.size() > 1) { +// drawNo = vec2[0]; +// } +// bool ret = regex_match(drawNo, result, qq_reg2); +// if (ret) { +// drawNo = "1ZDB5*10000X"; +// } +// } +// } +//} +////PBOM +////void +//typedef struct { +// string name;//Ʒͺ ͡Сߡ +// string zzmb; +// string xh; +// string tlth; +// string type; +// string tl; +// string yjgx; +// string ejgx; +//}FeedRule; +// +//struct StBomBean { +// string currentName;//Ʒͺ ͡Сߡ +// tag_t bomline; +// boolean st = false; +// boolean istl = false; +// boolean flag = true; //һ㼶 +// vector childs; +// +//}; +// +//boolean isSt(tag_t matnr) { +// int cnt2, numFac, cnt3; +// boolean flag = false; +// char** procureType, ** factorys, ** specialProcureType; +// AOM_ask_value_strings(matnr, "zt2_SZSpecialProcuretype", &cnt3, &specialProcureType); //Ϊ/ +// AOM_ask_value_strings(matnr, "zt2_SZProcuretype", &cnt2, &procureType); // +// AOM_ask_value_strings(matnr, "zt2_SZFactory", &numFac, &factorys); +// for (int i = 0; i < numFac; i++) { +// if (strcmp(factorys[i], "M060") == 0 && cnt2 > i && cnt3 > i) { +// if (strstr(procureType[i], "") != NULL && strcmp(specialProcureType[i], "/") == 0) { +// flag = true; +// } +// } +// } +// return flag; +//} +//void getBomMessage(vector& stBomlines, tag_t cBomLine, StBomBean &pBean) { +// +// int c_line_count; +// tag_t * c_line_tags; +// //char* parentName; +// //ITKCALL(AOM_ask_value_tag(pBomLine, "bl_line_object", &mantr)); +// //ITKCALL(AOM_ask_value_string(mantr, "object_name", &parentName)); +// ITKCALL(BOM_line_ask_all_child_lines(cBomLine, &c_line_count, &c_line_tags)); +// tag_t cmantr; +// char* cName; +// ITKCALL(AOM_ask_value_tag(cBomLine, "bl_line_object", &cmantr)); +// ITKCALL(AOM_ask_value_string(cmantr, "object_name", &cName)); +// printf("===>%s\n", cName); +// StBomBean bean; +// bean.bomline = cBomLine; +// bean.currentName = cName; +// bean.flag = false; +// if (c_line_count > 0 && isSt(cmantr)) { +// bean.st = true; +// //stBomlines.push_back(bean); +// pBean.childs.push_back(bean); +// } +// else if (c_line_count == 0) { +// bean.st = true; +// // stBomlines.push_back(bean); +// pBean.childs.push_back(bean); +// } +// else { +// for (int i = 0; i < c_line_count; i++) { +// tag_t c_line_tag = c_line_tags[i]; +// getBomMessage(stBomlines, c_line_tag,bean); +// } +// // stBomlines.push_back(bean); +// pBean.childs.push_back(bean); +// } +//} +//void getBomMessage(vector &stBomlines, tag_t cBomLine) { +// +// int c_line_count; +// tag_t * c_line_tags; +// //char* parentName; +// //ITKCALL(AOM_ask_value_tag(pBomLine, "bl_line_object", &mantr)); +// //ITKCALL(AOM_ask_value_string(mantr, "object_name", &parentName)); +// ITKCALL(BOM_line_ask_all_child_lines(cBomLine, &c_line_count, &c_line_tags)); +// tag_t cmantr; +// char* cName; +// ITKCALL(AOM_ask_value_tag(cBomLine, "bl_line_object", &cmantr)); +// ITKCALL(AOM_ask_value_string(cmantr, "object_name", &cName)); +// StBomBean bean; +// bean.bomline = cBomLine; +// bean.currentName = cName; +// if (c_line_count > 0 && isSt(cmantr)) { +// bean.st = true; +// stBomlines.push_back(bean); +// } +// else if (c_line_count == 0) { +// bean.st = true; +// stBomlines.push_back(bean); +// //printf("st = true===>%s\n", cName); +// } +// else { +// printf("============>%s\n", cName); +// for (int i = 0; i < c_line_count; i++) { +// tag_t c_line_tag = c_line_tags[i]; +// getBomMessage( stBomlines, c_line_tag, bean); +// } +// stBomlines.push_back(bean); +// printf("===========>%d\n", bean.childs.size()); +// } +//} +//void autoFeedLike(tag_t towGxLine, StBomBean& pBean, vector& stBomlines) { +// if (!pBean.st) { +// printf("pBean.childs==>%d\n", pBean.childs.size()); +// for (int i = 0; i < pBean.childs.size(); i++) { +// StBomBean& child = pBean.childs[i]; +// autoFeedLike(towGxLine, child, stBomlines); +// } +// } +// else if (!pBean.istl) { +// +// pBean.istl = true; +// tag_t newChild; +// ITKCALL(BOM_line_copy(towGxLine, pBean.bomline, NULLTAG, &newChild)); +// //ITKCALL(AOM_save(newChild)); +// } +//} +//void autoFeedLike(tag_t towGxLine, StBomBean& pBean, string name2, vector& stBomlines) { +// +// printf(" pBean.childs.size()%d\n", pBean.childs.size()); +// for (int i = 0; i < pBean.childs.size(); i++) { +// StBomBean& child = pBean.childs[i]; +// printf("child.currentName%s %s \n", child.currentName.c_str(), name2.c_str()); +// if (name2.compare(child.currentName) == 0) { +// printf("===================\n"); +// autoFeedLike(towGxLine, child, stBomlines); +// } +// } +//} +// +//void startFeed(tag_t meprocess, vector& stBomlines, FeedRule bean, string name1, string name2) { +// int bvr_count = 0; +// tag_t ebom_window = NULLTAG; +// tag_t bom_line = NULLTAG; +// tag_t item_tag = NULLTAG, * c_line_tags; +// (BOM_create_window(&ebom_window)); +// tag_t* bvr_list = NULL; +// (ITEM_rev_list_bom_view_revs(meprocess, &bvr_count, &bvr_list)); +// printf("bvr_count=%d", bvr_count); +// +// (BOM_set_window_top_line_bvr(ebom_window, bvr_list[0], &bom_line)); //bomȡ +// //bom_line +// int c_line_count; +// ITKCALL(BOM_line_ask_all_child_lines(bom_line, &c_line_count, &c_line_tags)); // һ +// //һ +// for (int i = 0; i < c_line_count; i++) { +// tag_t oneGx = c_line_tags[i], * towGxLines; +// int c_cnt = 0; +// char* yjName; +// tag_t yjGx; +// ITKCALL(AOM_ask_value_tag(oneGx, "bl_line_object", &yjGx)); +// AOM_ask_value_string(yjGx, "object_name", &yjName); +// printf("yjName%s %s \n", yjName, bean.yjgx.c_str()); +// if (bean.yjgx.compare(yjName) == 0) { +// BOM_line_ask_all_child_lines(oneGx, &c_cnt, &towGxLines); +// // +// for (int j = 0; j < c_cnt; j++) { +// tag_t towGxLine = towGxLines[j]; +// char* ejName; +// tag_t ejGx; +// ITKCALL(AOM_ask_value_tag(towGxLine, "bl_line_object", &ejGx)); +// AOM_ask_value_string(ejGx, "object_name", &ejName); +// printf("ejName%s %s\n", ejName, bean.ejgx.c_str()); +// if (bean.ejgx.compare(ejName) == 0) { +// printf("stBomlines %d\n", stBomlines.size()); +// for (int t = 0; t < stBomlines.size(); t++) { +// StBomBean& stBom = stBomlines[t]; +// tag_t newChild; +// printf("stBom.currentName==>%s %d\n", stBom.currentName.c_str(), stBom.childs.size()); +// if (stBom.currentName.compare(name1) == 0) { +// //if (!stBom.istl && stBom.st && stBom.flag) { +// autoFeedLike(towGxLine, stBom, name2, stBomlines); +// //stBom.istl = true; +// //} +// } +// } +// } +// } +// } +// } +// BOM_save_window(ebom_window); +// BOM_close_window(ebom_window); +//} +//void startFeed(tag_t meprocess, vector& stBomlines, FeedRule bean, vector names) { +// int bvr_count = 0; +// tag_t ebom_window = NULLTAG; +// tag_t bom_line = NULLTAG; +// tag_t item_tag = NULLTAG, * c_line_tags; +// (BOM_create_window(&ebom_window)); +// tag_t* bvr_list = NULL; +// (ITEM_rev_list_bom_view_revs(meprocess, &bvr_count, &bvr_list)); +// printf("bvr_count=%d", bvr_count); +// +// (BOM_set_window_top_line_bvr(ebom_window, bvr_list[0], &bom_line)); //bomȡ +// //bom_line +// int c_line_count; +// ITKCALL(BOM_line_ask_all_child_lines(bom_line, &c_line_count, &c_line_tags)); // һ +// //һ +// for (int i = 0; i < c_line_count; i++) { +// tag_t oneGx = c_line_tags[i], * towGxLines; +// int c_cnt = 0; +// char* yjName; +// tag_t yjGx; +// ITKCALL(AOM_ask_value_tag(oneGx, "bl_line_object", &yjGx)); +// AOM_ask_value_string(yjGx, "object_name", &yjName); +// if (bean.yjgx.compare(yjName) == 0) { +// BOM_line_ask_all_child_lines(oneGx, &c_cnt, &towGxLines); +// // +// for (int j = 0; j < c_cnt; j++) { +// tag_t towGxLine = towGxLines[j]; +// char* ejName; +// tag_t ejGx; +// ITKCALL(AOM_ask_value_tag(towGxLine, "bl_line_object", &ejGx)); +// AOM_ask_value_string(ejGx, "object_name", &ejName); +// if (bean.ejgx.compare(ejName) == 0) { +// for (int t = 0; t < stBomlines.size(); t++) { +// StBomBean& stBom = stBomlines[t]; +// tag_t newChild; +// if (std::find(names.begin(), names.end(), stBom.currentName) != names.end() && stBom.flag) { +// printf("stBom.currentName2%s %d\n", stBom.currentName.c_str(), !stBom.istl); +// if (!stBom.istl) { +// autoFeedLike(towGxLine, stBom, stBomlines); +// stBom.istl = true; +// } +// } +// } +// } +// } +// } +// } +// BOM_save_window(ebom_window); +// BOM_close_window(ebom_window); +//} +//void startFeed(tag_t meprocess, vector& stBomlines, FeedRule bean, string nameLike) { +// int bvr_count = 0; +// tag_t ebom_window = NULLTAG; +// tag_t bom_line = NULLTAG; +// tag_t item_tag = NULLTAG, * c_line_tags; +// (BOM_create_window(&ebom_window)); +// tag_t* bvr_list = NULL; +// (ITEM_rev_list_bom_view_revs(meprocess, &bvr_count, &bvr_list)); +// printf("bvr_count=%d", bvr_count); +// +// (BOM_set_window_top_line_bvr(ebom_window, bvr_list[0], &bom_line)); //bomȡ +// //bom_line +// int c_line_count; +// ITKCALL(BOM_line_ask_all_child_lines(bom_line, &c_line_count, &c_line_tags)); // һ +// //һ +// for (int i = 0; i < c_line_count; i++) { +// tag_t oneGx = c_line_tags[i], * towGxLines; +// int c_cnt = 0; +// char* yjName; +// tag_t yjGx; +// ITKCALL(AOM_ask_value_tag(oneGx, "bl_line_object", &yjGx)); +// AOM_ask_value_string(yjGx, "object_name", &yjName); +// printf("yjName===>%s %s \n", yjName, bean.yjgx.c_str()); +// +// if (bean.yjgx.compare(yjName) == 0) { +// BOM_line_ask_all_child_lines(oneGx, &c_cnt, &towGxLines); +// // +// for (int j = 0; j < c_cnt; j++) { +// tag_t towGxLine = towGxLines[j]; +// char* ejName; +// tag_t ejGx; +// ITKCALL(AOM_ask_value_tag(towGxLine, "bl_line_object", &ejGx)); +// AOM_ask_value_string(ejGx, "object_name", &ejName); +// printf("ejName===>%s \n", ejName); +// if (bean.ejgx.compare(ejName) == 0) { +// for (int t = 0; t < stBomlines.size(); t++) { +// StBomBean& stBom = stBomlines[t]; +// tag_t newChild; +// //printf("Tlstart===>%s %d %d\n", stBom.currentName.c_str(), stBom.st, !stBom.istl); +// //printf("Tlstart===>%d %d\n", ); +// printf("stBom.currentName2==>%s %d\n", stBom.currentName.c_str(), !stBom.istl); +// if (!nameLike.empty()) { +// if (strstr(stBom.currentName.c_str(), nameLike.c_str()) != NULL) { +// printf("stBom.currentName2==>%s %d\n", stBom.currentName.c_str(), !stBom.st); +// if (!stBom.istl && stBom.flag) { +// autoFeedLike(towGxLine, stBom, stBomlines); +// stBom.istl = true; +// } +// } +// } +// else if (!stBom.istl) { +// autoFeedLike(towGxLine, stBom, stBomlines); +// stBom.istl = true; +// //ITKCALL(BOM_line_copy(towGxLine, stBom.bomline, NULLTAG, &newChild)); +// } +// //ITKCALL(AOM_save(newChild)); +// } +// break; +// } +// } +// } +// } +// BOM_save_window(ebom_window); +// BOM_close_window(ebom_window); +//} +//void AutoFeeding(char * revUid,string &errBuffer) { +// string sql = "select MC,ZZMB,XH,TLTH,LX,TL,YJGX,EJGX from CHINT_GYGL_001 WHERE LX is not NULL ORDER BY XH "; +// +// /*string sql22 = "select CHINT_MATERIAL_SEQ.nextval as sid from dual"; +// int colmun2 = 0, count2 = 0; +// char*** outputValue2 = NULL; +// printf("search1"); +// QuerySQLNoInputParam((char*)sql22.c_str(), &colmun2, &count2, &outputValue2);*/ +// tag_t matnrRev; +// ITK__convert_uid_to_tag(revUid, &matnrRev); +// +// +// tag_t mantr = getPBomTag(matnrRev); +// int n_references = 0; +// int* levels = 0; +// tag_t* references_tag = NULLTAG; +// char** relation_type_name = NULL; +// //ͨùϵҵ +// ITKCALL(WSOM_where_referenced(mantr, 1, &n_references, &levels, &references_tag, &relation_type_name)); +// //boolean hasProcess = false; +// int meNum = 0; +// tag_t meprocess; +// for (int i = 0; i < n_references; i++) +// { +// char* refType; +// tag_t refTag = references_tag[i]; +// AOM_ask_value_string(refTag, "object_type", &refType); +// if (strcmp(refType, "MEProcessRevision") == 0) { +// //hasProcess = true; +// //break; +// meNum = meNum + 1; +// meprocess = refTag; +// } +// } +// if (meNum == 0) { +// errBuffer.append("պ².\n"); +// return; +// } +// if (meNum > 1) { +// errBuffer.append("ȡպ².\n"); +// return; +// } +// int url_num = 0; +// char** url_vals = NULL; +// PREF_ask_char_values("database_tc", &url_num, &url_vals); +// string url = url_vals[0]; +// url.append("/").append(url_vals[2]); +// string errorBuff; +// //map %s \n", url.c_str()); +// if (ConnServer(url_vals[3], url_vals[4], (char*)url.c_str()) == -1) +// { +// printf("ʾ:мݱʧ\n"); +// //ifail = 1; +// } +// char selectCPZ[200], selectGyId[200]; +// int outputColumn1 = 0, outputValueCount1 = 0; +// char*** outputValue1 = NULL; +// sprintf(selectGyId, sql.c_str()); +// printf("search2 %s \n", selectGyId); +// QuerySQLNoInputParam(selectGyId, &outputColumn1, &outputValueCount1, &outputValue1); +// printf("search22\n"); +// map> drawMap; +// map> nameMap; +// for (int j = 0; j < outputValueCount1; j++) { +// string name = outputValue1[j][0]; +// string zzmb = outputValue1[j][1]; +// string num = outputValue1[j][2]; +// string tlth = outputValue1[j][3]; +// string type = outputValue1[j][4]; +// string tl = outputValue1[j][5]; +// string yjgx = outputValue1[j][6]; +// string ejgx = outputValue1[j][7]; +// FeedRule ruleBean; +// ruleBean.name = name; +// ruleBean.zzmb = zzmb; +// ruleBean.xh = num; +// ruleBean.tlth = tlth; +// ruleBean.type = type; +// ruleBean.tl = tl; +// ruleBean.yjgx = yjgx; +// ruleBean.ejgx = ejgx; +// if (strstr(zzmb.c_str(),"ZDB") != NULL) { +// if (drawMap.count(zzmb) == 0) { +// vector feedRuleVec; +// feedRuleVec.push_back(ruleBean); +// drawMap[zzmb] = feedRuleVec; +// } +// else { +// drawMap[zzmb].push_back(ruleBean); +// } +// } +// else { +// if (nameMap.count(zzmb) == 0) { +// vector feedRuleVec; +// feedRuleVec.push_back(ruleBean); +// nameMap[zzmb] = feedRuleVec; +// } +// else { +// nameMap[zzmb].push_back(ruleBean); +// } +// } +// } +// +// //PBOM +// tag_t* bvr_list = NULL, ebom_window, bom_line; +// int bvr_count; +// ITKCALL(ITEM_rev_list_bom_view_revs(mantr, &bvr_count, &bvr_list)); +// ITKCALL(BOM_create_window(&ebom_window)); +// ITKCALL(BOM_set_window_top_line(ebom_window, NULL, mantr, NULLTAG, &bom_line)); +// +// int c_line_count; +// tag_t * c_line_tags; +// vector stBomlines; +// ITKCALL(BOM_line_ask_all_child_lines(bom_line, &c_line_count, &c_line_tags)); +// for (int i = 0; i < c_line_count; i++) { +// getBomMessage(stBomlines, c_line_tags[i]); +// } +// POM_AM__set_application_bypass(true); +// string drawNo; +// getDrawNo(bom_line, drawNo); +// printf("Ŀ=====>%s\n", drawNo.c_str()); +// // +// if (drawMap.count(drawNo)>0) { +// //ͼƥ +// vector beans = drawMap[drawNo]; +// printf("beans===>%d\n", beans.size()); +// for (int t = 0; t < beans.size(); t++) { +// FeedRule bean = beans[t]; +// printf("nameMatnr%s\n", bean.tlth.c_str()); +// if (bean.tlth.empty()) { +// //ȫͶ +// printf("beans===>%s %s\n", bean.yjgx.c_str(), bean.ejgx.c_str()); +// startFeed(meprocess, stBomlines,bean,""); +// } +// else{ +// //ʣȫͶ +// if (bean.tlth.compare("else") == 0) { +// startFeed(meprocess, stBomlines, bean,""); +// } +// else { +// string nameMatnr = bean.tlth; +// //ģƥͶ +// +// if (strstr(nameMatnr.c_str(),"*") != NULL) { +// vector liVec; +// string nameLike; +// Split(nameMatnr, "*", liVec); +// for (int x = 0; x < liVec.size(); x++) { +// if (!liVec[x].empty()) { +// nameLike = liVec[x]; +// } +// } +// printf("beans===>%s %s\n", bean.yjgx.c_str(), nameLike); +// startFeed(meprocess, stBomlines, bean, nameLike); +// } +// else { +// printf("beans===>%s %s\n", bean.yjgx.c_str(), bean.ejgx.c_str()); +// //ƾ׼ƥͶ +// if (strstr(nameMatnr.c_str(), "\\") != NULL) { +// vector names; +// Split(nameMatnr, "\\", names); +// startFeed(meprocess, stBomlines, bean, names[0], names[1]); +// } +// else { +// vector names; +// Split(nameMatnr, ";", names); +// startFeed(meprocess, stBomlines, bean, names); +// } +// } +// } +// } +// } +// } +// else { +// //map> nameMap; +// map>::iterator it; +// //ģƥ +// for (it = nameMap.begin(); it != nameMap.end(); it++) { +// string s = it->first; +// char* nowName; +// AOM_ask_value_string(mantr,"object_name",&nowName); +// if (strstr(nowName, s.c_str()) != NULL) { +// vector beans = nameMap[s]; +// printf("beans===>%d\n", beans.size()); +// for (int t = 0; t < beans.size(); t++) { +// FeedRule bean = beans[t]; +// printf("beans===>%s %s\n", bean.yjgx.c_str(), bean.ejgx.c_str()); +// if (bean.tlth.empty()) { +// //ȫͶ +// //printf("beans===>%s %s\n", bean.yjgx.c_str(), bean.ejgx.c_str()); +// startFeed(meprocess, stBomlines, bean, ""); +// } +// else { +// //ʣȫͶ +// if (bean.tlth.compare("else") == 0) { +// startFeed(meprocess, stBomlines, bean, ""); +// } +// else { +// string nameMatnr = bean.tlth; +// //ģƥͶ +// if (strstr(nameMatnr.c_str(), "*") != NULL) { +// vector liVec; +// string nameLike; +// Split(nameMatnr, "*", liVec); +// for (int x = 0; x < liVec.size(); x++) { +// if (!liVec[x].empty()) { +// nameLike = liVec[x]; +// } +// } +// startFeed(meprocess, stBomlines, bean, nameLike); +// } +// else { +// //ƾ׼ƥͶ +// if (strstr(nameMatnr.c_str(), "\\") != NULL) { +// vector names; +// Split(nameMatnr, "\\", names); +// printf("beans===>%s %s\n", names[0].c_str(), names[1].c_str()); +// startFeed(meprocess, stBomlines, bean, names[0], names[1]); +// } +// else { +// vector names; +// Split(nameMatnr, ";", names); +// for (int k = 0; k < names.size(); k++) { +// printf("k===>%s\n", names[k].c_str()); +// } +// printf("beans===>%d %d\n", names.size()); +// startFeed(meprocess, stBomlines, bean, names); +// } +// } +// } +// } +// } +// } +// } +// } +// +// POM_AM__set_application_bypass(false); +// ITKCALL(BOM_close_window(ebom_window)); +// //readProcessBom(bom_line, errorBuff); +// DisConnServer(); +//} \ No newline at end of file diff --git a/DFL_BOM_WL_TOERP/BOMSendSap.cpp b/DFL_BOM_WL_TOERP/BOMSendSap.cpp new file mode 100644 index 0000000..1229c12 --- /dev/null +++ b/DFL_BOM_WL_TOERP/BOMSendSap.cpp @@ -0,0 +1,1831 @@ +#include "SIO_USCOREBOM_USCOREPLM_USCOREASYNBinding.nsmap" +#include "soapH.h" +#include "soapStub.h" +#include "stdsoap2.h" +#include "ado.h" +#include "soapSIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy.h" +#include "soapSI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy.h" +#include "soapSI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy.h" +#include +#include +#include +#include +#include +#include +#include +#include "ps/ps.h"; +#include "ps/vrule.h" +#include "sstream" +#include +#include "epm/epm.h" +#include "sa/sa.h" +#include "libxl.h" +#include +#include "epm/signoff.h" +#include +#include +#include +#include +#include "ae/dataset.h" +#include +#include +#include +#include +#include +//#include "ado.h" +#include "ocilib.h" +#include +#include +#include "util.h" +#include +#include "dfl_custom.h" +#include "CRUL_server_call_httpserver.h" +using namespace std; +// +struct FlowBean { + vector flowList; + tag_t flow_split = NULLTAG; + tag_t flow_combine = NULLTAG; + tag_t flow_end = NULLTAG; + char* BEZFL; // ο˳ + string PLNFL = ""; // + boolean isMain = true; + boolean isOther = false; + vector flow_combine_list; +}; +char* getNotNullMsg(char* msg); +void logBomMsg(vector<_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST> lists); +void logProcessMsg(vector <_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST> proclist);// vector <_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST> proclist; +char* getUnti(char* unti); +FlowBean getClone(FlowBean oldBean) { + FlowBean newBean; + newBean.isMain = false; + newBean.flow_combine = oldBean.flow_combine; + newBean.flow_split = oldBean.flow_split; + for (int num = 0; num < oldBean.flowList.size(); num++) { + newBean.flowList.push_back(oldBean.flowList[num]); + } + return newBean; +} +//// +void printfMsg(ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP ns1Rsp, string& sendMsg) { + /*_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO info = ns1Rsp.RSP_USCOREBASEINFO; + char* id = info.REQ_USCORETRACE_USCOREID; + log("id:[%s]", id);*/ + _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN* returnTable = ns1Rsp.ZTABLE_USCORERETURN; + int num = ns1Rsp.__sizeZTABLE_USCORERETURN; + log("·RETURN:{}", num);/**/ + for (int i = 0; i < num; i++) { + _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN returnMsg = returnTable[i]; + //System.out.println(z.getSERNR() + "|" + z.getTYPE() + "|" + z.getMESSAGE()); + string logMsg; + char* msg = getNotNullMsg(returnMsg.MESSAGE); + msg = U2G(msg); + logMsg.append(returnMsg.MATNR).append("|") + .append(returnMsg.TYPE).append("|").append(msg); + if (strcmp(returnMsg.TYPE, "E") == 0) { + sendMsg.append("\n").append(returnMsg.MATNR).append(": ").append(msg); + } + log(logMsg.c_str()); + } +} +void printfMsg(ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP ns1Rsp) { + int num = ns1Rsp.__sizeZTABLE_USCORERETURN; + //_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO *info = ns1Rsp.RSP_USCOREBASEINFO; + //char* id = info[0].REQ_USCORETRACE_USCOREID; + _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN* returnTable = ns1Rsp.ZTABLE_USCORERETURN; + log("RETURN:{}", num);/**/ + for (int i = 0; i < num; i++) { + _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN returnMsg = returnTable[i]; + //System.out.println(z.getSERNR() + "|" + z.getTYPE() + "|" + z.getMESSAGE()); + string logMsg = getNotNullMsg(returnMsg.SERNR); + char* msg = getNotNullMsg(returnMsg.MESSAGE); + msg = U2G(msg); + logMsg.append("|").append(getNotNullMsg(returnMsg.TYPE)).append("|").append(msg); + log("{}", logMsg); + } +} + +void SplitStr(string strArg, string spliter, vector& ans) +{ + ans.clear(); + size_t index0 = 0; + string one_arg; + if (strArg.find_first_not_of(' ') == string::npos) + strArg = ""; + while (strArg.size() > 0) + { + index0 = strArg.find(spliter); + log(" ind %d \n", index0); + if (index0 != string::npos) + { + one_arg = strArg.substr(0, index0); + strArg = strArg.substr(index0 + 1); + ans.push_back(one_arg); + } + else + { + ans.push_back(strArg); + break; + } + } +} +void sendBom(vector<_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST> list, string batchMsg) { + //SIO_USCOREBOM_USCOREPLM_USCOREASYNBinding + SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy proxy; + ns1__DT_USCOREBOM_USCORES4_USCOREREQ ns1Req; + proxy.userid = "shpodev"; + proxy.passwd = "sap@2019Test"; + soap_mode(&proxy, SOAP_C_UTFSTRING); + _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST* reqList = + new _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST[list.size()]; + log("list ===> %d \n", list.size()); + for (int i = 0; i < list.size(); i++) { + _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST msg = list[i]; + reqList[i] = list[i]; + } + _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO baseInfo; + ns1Req.LIST = reqList; + ns1Req.__sizeLIST = list.size(); + baseInfo.REQ_USCORETRACE_USCOREID = (char*)batchMsg.c_str();//batchNum; + ns1Req.BASEINFO = &baseInfo; + //ns1__DT_USCOREBOM_USCOREPLM_USCORERSP ns1Rsp; + int xlt = proxy.send_SIO_USCOREBOM_USCOREPLM_USCOREASYN(NULL, NULL, &ns1Req); + log("111"); + char* msg = proxy.buf; + vector vecMsg; + //Split(msg, "?>", vecMsg); + //webserviceͨ ʱֻȡxmlϢcurl + /*string lastMsg = vecMsg[vecMsg.size()-1].c_str(); + lastMsg = lastMsg.substr(1, lastMsg.size());*/ + log("BOM XML MSG:{}", msg);/* xmlϢ*/ + SplitStr(msg, "soap1.1\"", vecMsg); + string lastMsg = vecMsg[1].substr(11); + string str = callHttpserver2(lastMsg); + log("BOM XML MSG:{}", lastMsg);/* xmlϢ*/ + log("return MSG :{}", str); + soap_print_fault(&proxy, stderr); + log("xlt:[%d]", xlt); + //printfMsg(ns1Rsp, sendMsg); +} +//жǷΪ +void isMain(FlowBean& bean, vector& mainLines, vector& endLines, + vector& splits, map& BEZFL_maps, int num2) { + tag_t combine = bean.flow_combine; + vector lists = bean.flowList; + for (int i = 0; i < lists.size(); i++) { + tag_t b = lists[i]; + char* idmte; + tag_t gxRev; + ITKCALL(AOM_ask_value_tag(b, "bl_line_object", &gxRev)); + AOM_ask_value_string(gxRev, "item_id", &idmte); + log("=====flowList=====%s====\n", idmte); + } + vector lists2 = bean.flow_combine_list; + //char* uid; + //ITK__convert_tag_to_uid(combine, &uid); + if (combine == NULLTAG) { + log("ϵ:\n"); + } + int len = lists.size() - 1; + if (len >= -1) { + + if (std::find(splits.begin(), splits.end(), lists[0]) == splits.end()) { + bean.flow_split = lists[0]; + splits.push_back(lists[0]); + bean.isOther = true; + } + } + if (combine != NULLTAG && std::find(mainLines.begin(), mainLines.end(), combine) != mainLines.end()) { + bean.isMain = false; + int num = std::find(mainLines.begin(), mainLines.end(), combine) - mainLines.begin(); + log("num %d\n", num); + vector::const_iterator index1 = lists.begin(); + vector::const_iterator index2 = lists.begin() + num; + log("num %d\n", num); + vector vec_new; // µvector + log("num %d\n", num); + vec_new.assign(index1, index2); + log("num %d\n", num); + bean.flowList = vec_new; + + if (BEZFL_maps.count(combine) > 0) { + bean.BEZFL = BEZFL_maps[combine]; + } + return; + } + log("1\n"); + if (mainLines.size() == 0) { + bean.isMain = (true); + } + else { + bean.isMain = (false); + } + if (len > -1) { + tag_t end = lists[len]; + if (combine == NULLTAG) { + endLines.push_back(end); + if (BEZFL_maps.count(end) > 0) { + bean.BEZFL = BEZFL_maps[end]; + } + } + else { + int size = lists2.size(); + if (BEZFL_maps.count(lists2[size - 1]) > 0) { + bean.BEZFL = BEZFL_maps[lists2[size - 1]]; + } + if (!bean.isMain) { + int cout = 0; + for (int i = 0; i < size; i++) { + if (std::find(mainLines.begin(), mainLines.end(), lists2[i]) != mainLines.end()) { + //mainLines.count(lists2[i)) + cout = i; + break; + } + } + bean.flow_combine = lists2[cout]; + } + endLines.push_back(combine); + } + } + for (int i = 0; i <= len; i++) { + + if (std::find(mainLines.begin(), mainLines.end(), lists[i]) == mainLines.end()) { + log("3\n"); + mainLines.push_back(lists[i]); + char* fileDate = new char[20]; + sprintf(fileDate, "%06d", num2); + BEZFL_maps[lists[i]] = fileDate; + log("4\n"); + } + + } + + return; +} + +void sendProcess(vector <_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST> proclist, string& sendMsg) { + //ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ *ns1__MT_USCOREPROCESSROUTE_USCORES4_USCOREREQ + SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy proxy; + soap_mode(&proxy, SOAP_C_UTFSTRING); + ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ ns1Req; + _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO baseInfo; + baseInfo.REQ_USCORETRACE_USCOREID = (char*)"123456"; + + ns1Req.BASEINFO = baseInfo; + + _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST* LIST = new _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST[proclist.size()]; + for (int i = 0; i < proclist.size(); i++) { + _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST list = proclist[i]; + LIST[i] = list; + } + ns1Req.__sizeLIST = proclist.size(); + ns1Req.LIST = LIST; + ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP ns1Rsp; + proxy.userid = "shplm";//shplm + proxy.passwd = "sap@2019"; + + int xlt = proxy.SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN(NULL, NULL, &ns1Req, ns1Rsp); + if (xlt != 0) { + soap_print_fault(&proxy, stderr); + } + //log("PROCESS XML MSG:{}", U2G(proxy.buf));/* xmlϢ*/ + log("xlt:[%d]", xlt); + printfMsg(ns1Rsp, sendMsg); + +} +void sendFactoryNo(vector<_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM> list_Factorys) { + SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy proxy; + + //soap_set_omode(&proxy, SOAP_C_UTFSTRING); + /*ssoap_set_mode(&soap, SOAP_C_MBSTRING);*/ + soap_mode(&proxy, SOAP_C_UTFSTRING); + proxy.userid = "shplm"; + proxy.passwd = "sap@2019"; + ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ ns1Req; + _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO info; + info.REQ_USCORETRACE_USCOREID = (char*)"123456"; + ns1Req.BASEINFO = &info; + _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS items; + + _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM* item_items = + new _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM[list_Factorys.size()]; + for (int i = 0; i < list_Factorys.size(); i++) { + item_items[i] = list_Factorys[i]; + } + items.__sizeITEM = list_Factorys.size(); + items.ITEM = item_items; + ns1Req.ITEMS = &items; + ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP ns1Rsp; + int xlt = proxy.SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(NULL, NULL, &ns1Req, ns1Rsp); + log("xlt:[%d]", xlt); + if (xlt != 0) { + soap_print_fault(&proxy, stderr); + } + printfMsg(ns1Rsp); +} + +void getFactoryNoList(char* projectNo, char* groupName, char* wbs, + tag_t* factoryNos, int num, tag_t ccp, vector<_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM>& list) { + char* zt2_MaterialNo, *zt2_TankNo, *zt2_Site; + AOM_UIF_ask_value(ccp, "zt2_MaterialNo", &zt2_MaterialNo); + AOM_UIF_ask_value(ccp, "zt2_TankNo", &zt2_TankNo); + AOM_UIF_ask_value(ccp, "zt2_Site", &zt2_Site); + //_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM + for (int i = 0, len = num; i < len; i++) { + tag_t factoryNo = factoryNos[i]; + char* itemId; + AOM_ask_value_string(factoryNo, "item_id", &itemId); + _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM item_factoryNo; + int index = i + 1; + char fileDate[128] = ""; + item_factoryNo.MATNR = zt2_MaterialNo; + item_factoryNo.PSPID = projectNo; + sprintf_s(fileDate, "%04d", index); + char* rspos = fileDate; + item_factoryNo.RSPOS = rspos; + item_factoryNo.SERNR = itemId; + item_factoryNo.WERKS = groupName; + item_factoryNo.ZGH = G2U(zt2_TankNo); + item_factoryNo.ZPSPID = wbs; + item_factoryNo.ZZD = zt2_Site; + list.push_back(item_factoryNo); + } + +} +vector addLastRev(map> items2) { + + vector revLast; + map>::iterator it; + //ģƥ + for (it = items2.begin(); it != items2.end(); it++) { + tag_t s = it->first; + vector rev2 = items2[s]; + tag_t revTag = NULLTAG; + char* revId = (char*)""; + for (int j = 0; j < rev2.size(); j++) { + char* id2; + AOM_ask_value_string(rev2[j], "item_revision_id", &id2); + if (strcmp(id2, revId) > 0) { + revId = id2; + revTag = rev2[j]; + } + } + revLast.push_back(revTag); + } + return revLast; +} +tag_t getProcessTag(tag_t mantr) { + int n_references = 0; + int* levels = 0; + tag_t* references_tag, processTag = NULLTAG; + char** relation_type_name = NULL; + //ͨùϵҵ + ITKCALL(WSOM_where_referenced(mantr, 1, &n_references, &levels, &references_tag, &relation_type_name)); + for (int n = 0; n < n_references; n++) { + log("relation_type_name [%s]\n", relation_type_name[n]); + if (strcmp(relation_type_name[n], "IMAN_METarget") == 0) { + processTag = references_tag[n]; + } + } + return processTag; +} +boolean isTcm2(tag_t mantr) { + int releaseCount = 0; + tag_t* releaseTags = NULL; + //жӼǷ񷢲 + AOM_ask_value_tags(mantr, "release_status_list", &releaseCount, &releaseTags); + if (releaseCount > 0) { + return true; + } + else { + return false; + } +} +vector getFlowStartsYH(int num, tag_t* c_line_tags) { + vector starts; + for (int i = 0; i < num; i++) { + tag_t gxLine = c_line_tags[i], *successors, *Mfg0predecessors; + int sucCnt = 0, preCnt = 0; + + ITKCALL(AOM_ask_value_tags(gxLine, "Mfg0successors", &sucCnt, &successors)); + AOM_ask_value_tags(gxLine, "Mfg0predecessors", &preCnt, &Mfg0predecessors); + log("sucCnt %d preCnt%d \n", sucCnt, preCnt); + if (preCnt == 0 && sucCnt > 0) { + starts.push_back(gxLine); + } + } + return starts; +} + +void readGXFlow(tag_t gxLine, vector& flowBeans, FlowBean& currentFlow, + boolean isMainFlow, boolean top) { + tag_t* successors, *Mfg0predecessors; + int sucCnt = 0, preCnt = 0; + AOM_ask_value_tags(gxLine, "Mfg0successors", &sucCnt, &successors); + AOM_ask_value_tags(gxLine, "Mfg0predecessors", &preCnt, &Mfg0predecessors); + + currentFlow.flowList.push_back(gxLine); + if (preCnt > 1) { + currentFlow.flow_combine_list.push_back(gxLine); + } + if (preCnt > 1 && currentFlow.flow_combine == NULLTAG) { + currentFlow.flow_combine = gxLine; + } + + if (sucCnt == 0) { + return; + } + for (int i = 1; i < sucCnt; i++) { + FlowBean newFlow = getClone(currentFlow); + if (newFlow.flow_combine == NULLTAG) + { + log("=============="); + } + newFlow.flow_split = gxLine; + readGXFlow(successors[i], flowBeans, newFlow, false, false); + flowBeans.push_back(newFlow); + } + readGXFlow(successors[0], flowBeans, currentFlow, false, false); + if (top) { + log("sucCnt %d\n", sucCnt); + currentFlow.isMain = isMainFlow;; + flowBeans.push_back(currentFlow); + } +} +//Ϣ +void getSort(vector& flowBeans) { + if (flowBeans.size() == 1 || flowBeans.size() == 0) + return; + vector flowInt; + map> flows; + for (FlowBean b : flowBeans) { + int size = b.flowList.size(); + if (flows.count(size) > 0) { + flows[size].push_back(b); + } + else { + vector flow; + flow.push_back(b); + flowInt.push_back(size); + flows[size] = flow; + } + } + flowBeans.clear(); + vector mainLines; + vector endLines; + vector splits; + int index = 0; + map BEZFL_maps; + sort(flowInt.rbegin(), flowInt.rend()); + for (vector::iterator it = flowInt.begin(); it != flowInt.end(); it++) { + cout << *it << " "; + if (flows.count(*it) > 0) { + vector beans = flows[*it]; + for (int x = 0; x < beans.size(); x++) { + isMain(beans[x], mainLines, endLines, splits, BEZFL_maps, index); + flowBeans.push_back(beans[x]); + index++; + } + } + } +} +char* getGXNR(tag_t gxLine) { + if (gxLine == NULLTAG) { + return (char*)""; + } + char* bl_sequence_no; + AOM_ask_value_string(gxLine, "bl_sequence_no", &bl_sequence_no); + //String seq = gxLine.getProperty("bl_sequence_no"); + int seqI = 0; + if (strcmp(bl_sequence_no, "") != 0) { + seqI = atoi(bl_sequence_no); + } + char* fileDate = new char[20]; + sprintf(fileDate, "%04d", seqI); + return fileDate; +} +char* getBomUid(tag_t gxLine) { + char* gxUid; + tag_t gxRev; + if (gxLine == NULLTAG) { + return (char*)""; + } + ITKCALL(AOM_ask_value_tag(gxLine, "bl_line_object", &gxRev)); + ITK__convert_tag_to_uid(gxRev, &gxUid); + return gxUid; +} +_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM getGXInfo(FlowBean bean, int index, + tag_t partRev, char* p_uom, char* now) { + _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM item; + item.PLNAL = (char*)("1");// + char* fileDate = new char[20]; + sprintf(fileDate, "%06d", index); + item.PLNFL = fileDate;// + item.DATUV = now;// Чʼ + boolean bx = false; + item.VORNR1 = (char*)(""); + item.VORNR2 = (char*)(""); + item.BEZFL = (char*)("");// ο˳ + // item.setLTXA1("");//˳ + if (!bean.isMain) {// + // item.setBEZFL("000000");//ο˳ + item.BEZFL = bean.BEZFL; + bx = true; + item.FLGAT = (char*)("1");// ˳ + // System.out.println("ǰ:"+bean.flow_split); + if (bean.flow_split != NULLTAG) { + item.VORNR1 = getGXNR(bean.flow_split);// ǰ + } + else { + log("bean.flow_split ====== NULL"); + } + if (bean.isOther) + bean.flow_split = NULLTAG; + if (bean.flow_combine != NULLTAG) { + item.VORNR2 = getGXNR(bean.flow_combine);// (SAPUtil.getGXNR(bean.flow_combine)) + } + } + else {// Dz + item.FLGAT = (char*)("0");// ˳ + } + int cnt = bean.flowList.size(); + _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS subitemsArr; + + + vector<_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM> subItems; + boolean inBx = bean.flow_split == NULLTAG; + for (int i = 0; i < cnt; i++) { + tag_t gxLine = bean.flowList[i]; + char* gxUid; + tag_t gxRev; + ITKCALL(AOM_ask_value_tag(gxLine, "bl_line_object", &gxRev)); + ITK__convert_tag_to_uid(gxRev, &gxUid); + if (bx) { + if (strcmp(getBomUid(bean.flow_combine), gxUid) == 0) { //gxLine.equals(bean.flow_combine) + break; + } + if (strcmp(getBomUid(bean.flow_split), gxUid) == 0) { //gxLine.equals(bean.flow_split) + inBx = true; + continue; + } + if (!inBx) { + continue; + } + } + + _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM sub; + char* zt2_WorkCenter, *zt2_ControlCode, *object_name, *zt2_ClassificationCode, *zt2_ArtificialTime, *zt2_MachineTime, *zt2_ReadinessTime; + AOM_ask_value_string(gxRev, "zt2_WorkCenter", &zt2_WorkCenter); + AOM_UIF_ask_value(gxLine, "zt2_ControlCode", &zt2_ControlCode); + AOM_UIF_ask_value(gxRev, "object_name", &object_name); + AOM_UIF_ask_value(gxRev, "zt2_ClassificationCode", &zt2_ClassificationCode); + AOM_UIF_ask_value(gxLine, "zt2_ArtificialTime", &zt2_ArtificialTime); + AOM_UIF_ask_value(gxLine, "zt2_MachineTime", &zt2_MachineTime); + AOM_UIF_ask_value(gxLine, "zt2_ReadinessTime", &zt2_ReadinessTime); + sub.VORNR = getGXNR(gxLine);// + sub.ARBPL = zt2_WorkCenter;// (gxRev.getTCProperty("zt2_WorkCenter").getStringValue());// + sub.STEUS = zt2_ControlCode;// (gxLine.getProperty("zt2_ControlCode"));// + sub.LTXA1 = G2U(object_name);// (gxRev.getProperty("object_name"));// + sub.USR00 = zt2_ClassificationCode;// (gxRev.getProperty("zt2_ClassificationCode"));// + sub.BMSCH = (char*)("1");// + sub.PLNME = p_uom; + sub.VGW01 = zt2_ArtificialTime;// (gxLine.getProperty("zt2_ArtificialTime"));// ׼ֵ1 + sub.VGE01 = (char*)("MIN");// ׼ֵλ1 + sub.VGW02 = zt2_MachineTime;// (gxLine.getProperty("zt2_MachineTime"));// ׼ֵ2 + sub.VGE02 = (char*)("MIN");// ׼ֵλ2 + sub.VGW05 = zt2_ReadinessTime;// (gxLine.getProperty("zt2_ReadinessTime"));// ׼ֵ5 + sub.VGE05 = (char*)("MIN");// ׼ֵλ5 + subItems.push_back(sub); + } + _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM* SUBITEM = + new _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM[subItems.size()]; + for (int i = 0; i < subItems.size(); i++) { + SUBITEM[i] = subItems[i]; + } + subitemsArr.__sizeSUBITEM = subItems.size(); + subitemsArr.SUBITEM = SUBITEM; + item.SUBITEMS = subitemsArr; + return item; + +} + +//////ȡϢ +void readBopInfo1YH(tag_t rev, tag_t partRev, boolean flag, + map& gy_meops, vector& needTCM_meops, + char* groupName, char* now, vector <_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST>& proclist) { + //"zt2_MaterialNo", "zt2_WBSNo" + char* zt2_MaterialNo, *zt2_WBSNo; + AOM_ask_value_string(partRev, "zt2_MaterialNo", &zt2_MaterialNo); + AOM_ask_value_string(partRev, "zt2_WBSNo", &zt2_WBSNo); + if (isTcm2(rev) && flag) + return; + if (gy_meops.count(zt2_MaterialNo) > 0) + return; + /*if (rev == null) { + throw new Exception("Ȩ޲,޷ȡ[" + zt2_MaterialNo + "]"); + }*/ + gy_meops[zt2_MaterialNo] = rev; + //!needTCM_meops.contains(rev) + if (std::find(needTCM_meops.begin(), needTCM_meops.end(), rev) == needTCM_meops.end()) + needTCM_meops.push_back(rev); + tag_t ebom_window, bom_line; + + ITKCALL(ME_create_bop_window(&ebom_window)); + ITKCALL(BOM_set_window_top_line(ebom_window, NULL, rev, NULLTAG, &bom_line)); + int c_line_count; + tag_t* c_line_tags; + ITKCALL(BOM_line_ask_all_child_lines(bom_line, &c_line_count, &c_line_tags)); + if (c_line_count == 0) { + return; + } + _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST proc_list; + _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD head; + head.PSPNR = zt2_WBSNo; + head.MATNR = zt2_MaterialNo; + head.DATUV = now;// ʼ + head.PLNAL = (char*)"1";// + head.STATU = (char*)"4";// ״̬ + head.VERWE = (char*)"1";// ; + head.WERKS = groupName;// + _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS items; + vector flowBeans; + vector startLines = getFlowStartsYH(c_line_count, c_line_tags); + tag_t part2; + char* zt2_unit2; + ITEM_ask_item_of_rev(partRev, &part2); + AOM_ask_value_string(part2, "zt2_unit", &zt2_unit2); + char* unit = getUnti(zt2_unit2); + if (startLines.size() > 0) { + char* itemID; + //ITKCALL(AOM_ask_value_string(startLines[0], "item_id", &itemID)); + log("ҵʼ :\n"); + } + for (int i = 0; i < startLines.size(); i++) { + FlowBean firstBean; + log("startLines == \n"); + char* idmte; + tag_t gxRev; + ITKCALL(AOM_ask_value_tag(startLines[i], "bl_line_object", &gxRev)); + AOM_ask_value_string(gxRev, "item_id", &idmte); + log("=====idmte=====%s====\n", idmte); + readGXFlow(startLines[i], flowBeans, firstBean, i == 0, true); + for (int i = 0; i < firstBean.flowList.size(); i++) { + tag_t b = firstBean.flowList[i]; + char* idmte; + tag_t gxRev; + ITKCALL(AOM_ask_value_tag(b, "bl_line_object", &gxRev)); + AOM_ask_value_string(gxRev, "item_id", &idmte); + log("=====ffirstBean.flowList=====%s====\n", idmte); + } + }// ӡϢ + if (flowBeans.size() > 0) { + } + else { + // PERT + log("PERT"); + FlowBean bean; + bean.isMain = true; + for (int j = 0; j < c_line_count; j++) { + tag_t gxLine = c_line_tags[j]; + bean.flowList.push_back(gxLine); + } + // bean.print(); + flowBeans.push_back(bean); + } + // + getSort(flowBeans); + // ȡBOPϢ + _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM* gxInfo = + new _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM[flowBeans.size()]; + log("flowBeans %d \n", flowBeans.size()); + for (int i = 0; i < flowBeans.size(); i++) { + FlowBean bean = flowBeans[i]; + /*bean.print();;*/ + gxInfo[i] = getGXInfo(bean, i, partRev, unit, now); + //gxInfo(getGXInfo(bean, i, partRev, p_uom, now)); + } + items.__sizeITEM = flowBeans.size(); + items.ITEM = gxInfo; + proc_list.HEAD = head; + proc_list.ITEMS = items; + proclist.push_back(proc_list); + //for (int i = 0; i < flowBeans.size(); i++) { + // FlowBean bean = flowBeans.get(i); + // bean.print(); + // gxInfo.add(SAPUtil.getGXInfo(bean, i, partRev, p_uom, now)); + //} + //proclist.add( + // new DT_PROCESSROUTE_S4_REQLIST(head, gxInfo.toArray(new DT_PROCESSROUTE_S4_REQLISTITEMSITEM[]{}))); + //window.clearCache(); + //// window.refresh(); + //window.closeBOPWindow(); + //System.out.println("====ȡϢ==="); + + ITKCALL(ME_close_bop_window(ebom_window)); + +} +char* getUnti(char* unti) { + char* s = _strupr(unti); + return s; +} +// ¼ѾڵBOMList bomISExist +void recurZYZZSAPYH(tag_t line, tag_t rev, vector& bomISExist, + char* groupName, char* now, string& errMess, vector& set_meops, + map& material_revs, vector<_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST>& list, + map& gy_meops, vector& needTCM_meops, + vector <_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST>& proclist) { + char* zt2_Diagram, *item_id, *object_name, *zt2_MaterialNo, *zt2_WBSNo; + //"zt2_Diagram","item_id","object_name","zt2_MaterialNo","zt2_WBSNo" + AOM_ask_value_string(rev, "zt2_Diagram", &zt2_Diagram); + AOM_ask_value_string(rev, "item_id", &item_id); + AOM_ask_value_string(rev, "object_name", &object_name); + AOM_ask_value_string(rev, "zt2_MaterialNo", &zt2_MaterialNo); + AOM_ask_value_string(rev, "zt2_WBSNo", &zt2_WBSNo); + string x = zt2_MaterialNo; + log("item_id = [%s] \n", item_id); + if (x.rfind("99", 0) == 0) { + tag_t meops = getProcessTag(rev); + if (meops != NULLTAG) { + if (!isTcm2(meops)) { + set_meops.push_back(meops); + } + readBopInfo1YH(meops, rev, true, gy_meops, needTCM_meops, groupName, now, proclist); + } + else { + log("item_id22 = [%s] \n", item_id); + } + } + int c_line_count; + tag_t* c_line_tags; + ITKCALL(BOM_line_ask_all_child_lines(line, &c_line_count, &c_line_tags)); + log("child c_line_count %d \n", c_line_count); + if (c_line_count == 0) { + return; + } + _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD head; + if (std::find(bomISExist.begin(), bomISExist.end(), zt2_MaterialNo) != bomISExist.end()) { + return; + } + else { + bomISExist.push_back(zt2_MaterialNo); + } + tag_t item; + char* zt2_unit; + ITEM_ask_item_of_rev(rev, &item); + AOM_ask_value_string(item, "zt2_unit", &zt2_unit); + char* unit = getUnti(zt2_unit); + log("str = [%s] \n", unit); + head.PSPNR = zt2_WBSNo; + head.MATNR = zt2_MaterialNo; + head.BMEIN = unit; + head.STLAN = (char*)"1"; + head.STLAL = (char*)"1"; + head.BMENG = (char*)"1"; + head.WERKS = groupName; + head.DATUV = now; + char* parnetUid; + ITK__convert_tag_to_uid(rev, &parnetUid); + head.STKTX = parnetUid; + + _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM* items_items = + new _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM[c_line_count]; + _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS items; + + for (int i = 0; i < c_line_count; i++) { + string buff; + _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM items_item; + tag_t c_line_tag = c_line_tags[i], rev2; + ITKCALL(AOM_ask_value_tag(c_line_tag, "bl_line_object", &rev2)); + char* prop0, *prop1, *prop2, *prop3, *prop4, *zt2_unit2; + AOM_ask_value_string(rev2, "zt2_Diagram", &prop0); + AOM_ask_value_string(rev2, "item_id", &prop1); + AOM_ask_value_string(rev2, "object_name", &prop2); + AOM_ask_value_string(rev2, "zt2_SapState", &prop3); + AOM_ask_value_string(rev2, "zt2_MaterialNo", &prop4); + tag_t part2; + ITEM_ask_item_of_rev(rev2, &part2); + AOM_ask_value_string(part2, "zt2_unit", &zt2_unit2); + char* unit22 = getUnti(zt2_unit2); + items_item.IDNRK = prop4; + char* unit = unit22; + items_item.MEINS = unit; + items_item.DATUV = now; + items_item.POSTP = (char*)"L"; + char* bl_sequence_no, *bl_quantity, *ZT2_ClassificationNo, *ZT2_Remark; + //"bl_sequence_no", "bl_quantity", "ZT2_ClassificationNo", "ZT2_Remark" + AOM_ask_value_string(c_line_tag, "bl_sequence_no", &bl_sequence_no); + AOM_ask_value_string(c_line_tag, "bl_quantity", &bl_quantity); + AOM_ask_value_string(c_line_tag, "ZT2_ClassificationNo", &ZT2_ClassificationNo); + AOM_ask_value_string(c_line_tag, "ZT2_Remark", &ZT2_Remark); + items_item.POSNR = bl_sequence_no; + //string sss = bl_quantity;//line2.getProperty("bl_quantity"); + log("bl_quantity ===== %s\n", bl_quantity); + if (strcmp(bl_quantity, "") == 0) { + buff.append("δд(bl_quantity);"); + } + double ddd = atof(bl_quantity); + char* strff = new char[21]; + sprintf(strff, "%.3f", ddd); + items_item.MENGE = strff; + items_item.SORTF = ZT2_ClassificationNo; + if (strcmp(ZT2_ClassificationNo, "") == 0) { + buff.append("BOMδҵͶϢ;"); + } + items_item.POTX1 = ZT2_Remark; + items_items[i] = items_item; + string msg; + msg.append(prop1).append("-").append(prop2).append("(:") + .append(item_id).append("-").append(object_name).append("):").append(buff); + log("buff ===== %s\n", buff.c_str()); + if (buff.length() > 0 && strstr(errMess.c_str(), msg.c_str()) == NULL) { + errMess.append("\\n").append(msg); + } + if (strcmp(prop4, "") == 0) { + material_revs[prop4] = rev2; + } + } + //items. + items.ITEM = items_items; + items.__sizeITEM = c_line_count; + _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST list1; + list1.HEAD = head; + log("list1.HEAD %s\n ", list1.HEAD.BMEIN); + list1.ITEMS = items; + list.push_back(list1); +} + +// Ϊյ +//void removeNull(vector<_ns1__DT_USCOREBOM_USCOREPLM_USCOREREQ_LIST> list) { +// for (int i = list.size() - 1; i >= 0; i--) { +// _ns1__DT_USCOREBOM_USCOREPLM_USCOREREQ_LIST dt = list[i]; +// _ns1__DT_USCOREBOM_USCOREPLM_USCOREREQ_LIST_ITEMS items = dt.ITEMS; +// for (int j = 0; j < items.__sizeITEM; j++) { +// +// } +// } +//// for (int i = list.size() - 1; i >= 0; i--) { +//// DT_BOM_PLM_REQLIST dt = list.get(i); +//// List item_lists = new ArrayList(); +//// DT_BOM_PLM_REQLISTITEMSITEM items[] = dt.getITEMS(); +//// for (DT_BOM_PLM_REQLISTITEMSITEM item : items) { +//// if (item != null) +//// item_lists.add(item); +//// /* +//// * else { //KUtil.isEmpty(item.getDATUV()) } +//// */ +//// } +//// if (item_lists == null || item_lists.size() == 0) +//// list.remove(dt); +//// else { +//// DT_BOM_PLM_REQLISTITEMSITEM[] request = item_lists +//// .toArray(new DT_BOM_PLM_REQLISTITEMSITEM[item_lists.size()]); +//// dt.setITEMS(request); +//// } +//// } +//} +#define OBJECT_NAME "object_name" +#define MATERIAL_NO "zt2_MaterialNo" +void readSchemesYH(vector vectorRev, tag_t partRev, + map>& scheme_boms, + vector& bomISExist, map>& rev_meops, + char* groupName, char* now, string& errMess, + map& material_revs, map& gy_meops, vector& needTCM_meops, + map>& process_boms, char* transfer, + map> &inCcpMap) { + vector set_meops; + tag_t ebom_window; + ITKCALL(BOM_create_window(&ebom_window)); + //ƷĵBOM + char* ccpMaterialNo; + ITKCALL(AOM_ask_value_string(partRev, MATERIAL_NO, &ccpMaterialNo)); + for (int i = 0; i < vectorRev.size(); i++) { + tag_t rev = vectorRev[i], bom_line; + char* cName, *zt2_MaterialNo, *zt2_BOMScheme, *revUid; + ITK__convert_tag_to_uid(rev, &revUid); + //material_revs ¼ϱӦIJƷ޸״̬ + + ITKCALL(AOM_ask_value_string(rev, "object_name", &cName)); + ITKCALL(AOM_ask_value_string(rev, "zt2_MaterialNo", &zt2_MaterialNo)); + ITKCALL(AOM_UIF_ask_value(rev, "zt2_BOMScheme", &zt2_BOMScheme)); + //жǷ ơƿ + if (strstr(cName, transfer) == NULL) { + //жDzڶӦļ + boolean pflag = false; + int n_references = 0; + int* levels = 0; + tag_t* references_tag; + char** relation_type_name = NULL; + //ͨùϵڵļ + tag_t itemTag; + ITKCALL(ITEM_ask_item_of_rev(rev, &itemTag)); + ITKCALL(WSOM_where_referenced(itemTag, 1, &n_references, &levels, &references_tag, &relation_type_name)); + for (int j = 0; j < n_references; j++) { + tag_t refTag = references_tag[j]; + char* folderName; + ITKCALL(AOM_ask_value_string(refTag, OBJECT_NAME, &folderName)); + if (strstr(folderName, transfer) != NULL) { + pflag = true; + break; + } + } + //ȡrev + if (!pflag) { + continue; + } + } + if (scheme_boms.count(rev) > 0) { + log("folderName = {} \n", zt2_MaterialNo); + inCcpMap[revUid].push_back(ccpMaterialNo); + continue; + } + vector ccpMaterialMap; + ccpMaterialMap.push_back(ccpMaterialNo); + inCcpMap[revUid] = ccpMaterialMap; + //жϷϢ + //material_revs.put(zt2_MaterialNo, rev); + ITKCALL(BOM_set_window_top_line(ebom_window, NULL, rev, NULLTAG, &bom_line)); + vector<_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST> list; //¼BOMϢ + vector <_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST> proclist; + + recurZYZZSAPYH(bom_line, rev, bomISExist, groupName, now, errMess, set_meops, material_revs, + list, gy_meops, needTCM_meops, proclist); + /*List list = new ArrayList(); + List proclist = new ArrayList();*/ + if (list.size() > 0 && strcmp(zt2_BOMScheme, "") == 0) { + char* zt2_Quantity; + ITKCALL(AOM_ask_value_string(rev, "zt2_Quantity", &zt2_Quantity)); + if (strstr(zt2_Quantity, "") != 0) { + int quantity = atoi(zt2_Quantity); + if (quantity == 0) { + quantity = 1; + } + int size = list.size(); + char* s = new char[10]; + _itoa(quantity, s, 10); + list[size - 1].HEAD.BMENG = s; + //head.BMENG = (char*)to_string(quantity).c_str(); + } + } + log("BOMϢ"); + logBomMsg(list); + if (proclist.size() > 0) { + logProcessMsg(proclist); + } + scheme_boms[rev] = list; + process_boms[rev] = proclist; + } + ITKCALL(BOM_close_window(ebom_window)); + + rev_meops[partRev] = set_meops; +} + +char* getFLMDb2(string zt2_MaterialNo2, string groupName, map& flmMap) { + vector matnr; + split(zt2_MaterialNo2, "-", &matnr); + string mes = matnr[0]; + if (flmMap.count(mes) > 0) { + return flmMap[mes]; + } + char* sortno = (char*)""; + string sql = "select WLFLM from CHINT_GYGL_000 where ZZBM = '"; + sql.append(groupName).append("' and WLMC = '/' and FABN = '").append(mes).append("'"); + int outputColumn1 = 0, outputValueCount1 = 0; + char*** outputValue1 = NULL; + log("search3 ===> %s\n", sql.c_str()); + QuerySQLNoInputParam((char*)sql.c_str(), &outputColumn1, &outputValueCount1, &outputValue1); + if (outputValueCount1 > 0) { + sortno = outputValue1[0][0]; + } + flmMap[mes] = sortno; + log("sortno [%s]\n", sortno); + return sortno; + // if (read.next()) { + // sortno = read.getString("WLFLM"); + // System.out.println("ͶϷࣺ" + sortno + "zt2_MaterialNo2==>" + zt2_MaterialNo2 + "groupName==>" + groupName); + // } +} +char* getWlflm2(string fabn, map& flmMap) { + char* wlflmMap = (char*)""; + + // ѯϷ + if (flmMap.count(fabn) > 0) { + return flmMap[fabn]; + } + string query = "select WLFLM from CHINT_GYGL_000 where zzbm = 'M040' and WLMC = '/' and FABN = '%s' "; + char selectRxfs[200]; + sprintf(selectRxfs, query.c_str(), fabn.c_str()); + int outputColumn1 = 0, outputValueCount1 = 0; + char*** outputValue1 = NULL; + log("search3 ===> %s\n", selectRxfs); + QuerySQLNoInputParam(selectRxfs, &outputColumn1, &outputValueCount1, &outputValue1); + for (int num = 0; num < outputValueCount1; num++) { + //TarGXCODE\", \"TarGXNAME\", \"TemGXCODE\", \"TemGXNAME + wlflmMap = outputValue1[num][0]; + } + flmMap[fabn] = wlflmMap; + return wlflmMap; +} + +/** +* ȡBOMϸϢ ƷµĵԪϢ +* @param ccp Ʒ +* @param schemes ƷĵԪ +* @param list ¼BOM xml +* @param proclist ¼·xml +* @param isSends ¼ѾݵĶ +* @param txtPath û +* @param material_revs ¼Ҫ޸ԵIJƷֻ¼ˣ޸ڻش +* @param groupName ID M040 +* @param now ǰʱ +* @param scheme_boms Ԫ Ӧ ԪBOM +* @param gy_meops ¼չϢ +* @param needTCM_meops ¼ҪĹ· +* @param flmMap ¼Ϣ +* @param isExistBom ¼Ѿ֯ +*/ +void readBomInfoYH(tag_t ccp, vector schemes, + vector<_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST>& list, + vector <_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST>& proclist, + vector isSends, string txtPath, map& material_revs, + char* groupName, char* now, map> scheme_boms, + map& gy_meops, vector& needTCM_meops, map& flmMap, + map &isExistBom) { + + char* zt2_MaterialNo, *zt2_WBSNo, *zt2_BOMScheme, *zt2_Quantity, *zt2_unit2; + _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD head; + AOM_ask_value_string(ccp, "zt2_MaterialNo", &zt2_MaterialNo); + AOM_ask_value_string(ccp, "zt2_WBSNo", &zt2_WBSNo); + AOM_UIF_ask_value(ccp, "zt2_BOMScheme", &zt2_BOMScheme); + AOM_ask_value_string(ccp, "zt2_Quantity", &zt2_Quantity); + tag_t part2; + ITEM_ask_item_of_rev(ccp, &part2); + AOM_ask_value_string(part2, "zt2_unit", &zt2_unit2); + char* unit2 = getUnti(zt2_unit2); + material_revs[zt2_MaterialNo] = ccp; + head.PSPNR = (zt2_WBSNo); + head.MATNR = (zt2_MaterialNo); + head.STLAN = (char*)("1"); + head.STLAL = (char*)("1"); + head.BMENG = (char*)("1"); + if (strcmp("", zt2_BOMScheme) == 0) { + if (strstr(zt2_Quantity, "") != 0) { + int quantity = atoi(zt2_Quantity); + if (quantity == 0) { + quantity = 1; + } + char* s = new char[10]; + _itoa(quantity, s, 10); + head.BMENG = s; + } + } + head.WERKS = groupName; + head.BMEIN = unit2; + head.DATUV = now; + char* parnetUid; + ITK__convert_tag_to_uid(ccp, &parnetUid); + head.STKTX = parnetUid; + + tag_t meops = getProcessTag(ccp); //cƷ + + if (meops != NULLTAG) { + char* itemId; + AOM_ask_value_string(meops, "item_id", &itemId); + log("processId %s \n", itemId); + readBopInfo1YH(meops, ccp, true, gy_meops, needTCM_meops, groupName, now, proclist); + } + else { + vector vecc; + tag_t item, lastRev = NULLTAG; + split(zt2_MaterialNo, "-", &vecc); + ITEM_find_item(vecc[0].c_str(), &item); + ITEM_ask_latest_rev(item, &lastRev); + //log("vecc[0].c_str()%s\n", vecc[0].c_str()); + if (lastRev != NULLTAG) { + log("1"); + tag_t meops2 = getProcessTag(lastRev); + readBopInfo1YH(meops2, ccp, false, gy_meops, needTCM_meops, groupName, now, proclist); + } + } + _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM* items_items = + new _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM[schemes.size()]; + for (int i = 0; i < schemes.size(); i++) { + tag_t rev2 = schemes[i]; + char* prop1, *propp2; + AOM_ask_value_string(rev2, "zt2_MaterialNo", &prop1); + AOM_ask_value_string(rev2, "object_name", &propp2); + _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM items_item; + char* flm = getFLMDb2(prop1, groupName, flmMap); + items_item.SORTF = flm; + items_item.DATUV = now; + items_item.POSTP = (char*)"L"; + items_item.POSNR = (char*)""; + items_item.IDNRK = prop1; + items_item.MENGE = (char*)"1"; + items_item.POTX1 = (char*)""; + if (strstr(prop1, "-") != NULL) { + vector vecc; + split(prop1, "-", &vecc); + char* flm2 = getWlflm2(vecc[0], flmMap); + items_item.SORTF = flm2; + } + char* zt2_unit22; + tag_t part22; + ITEM_ask_item_of_rev(rev2, &part22); + AOM_ask_value_string(part22, "zt2_unit", &zt2_unit22); + char* unit22 = getUnti(zt2_unit22); + items_item.MEINS = unit22; + items_items[i] = items_item; + if (std::find(isSends.begin(), isSends.end(), rev2) != isSends.end()) + continue; + else + isSends.push_back(rev2); + if (scheme_boms.count(rev2) > 0 && isExistBom.count(rev2) == 0) { + isExistBom[rev2] = (char*)"test"; + vector<_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST> lists = scheme_boms[rev2]; + for (int j = 0, len = lists.size(); j < len; j++) { + if (j != len - 1) { + list.push_back(lists[j]); + } + else { + _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST dt = lists[j]; + dt.HEAD.PSPNR = zt2_WBSNo; + list.push_back(dt); + } + } + } + } + _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS items; + items.ITEM = items_items; + items.__sizeITEM = schemes.size(); + _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST list22; + list22.HEAD = head; + list22.ITEMS = items; + list.push_back(list22); +} +char* getNotNullMsg(char* msg) { + if (msg == NULL) { + return (char*)""; + } + else { + return msg; + } +} +/** +* ¼Ϣ־ +*/ +void logCcbh(vector<_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM> list_Factorys) { + string msg = ""; + for (int i = 0; i < list_Factorys.size(); i++) { + _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM list_Factory = list_Factorys[i]; + msg.append("PSPID = ").append(getNotNullMsg(list_Factory.PSPID)).append(" "); + msg.append("RSPOS = ").append(getNotNullMsg(list_Factory.RSPOS)).append(" "); + msg.append("SERNR = ").append(getNotNullMsg(list_Factory.SERNR)).append(" "); + msg.append("MATNR = ").append(getNotNullMsg(list_Factory.MATNR)).append(" "); + msg.append("WERKS = ").append(getNotNullMsg(list_Factory.WERKS)).append(" "); + msg.append("ZGH = ").append(U2G(getNotNullMsg(list_Factory.ZGH))).append(" "); + msg.append("ZPSPID = ").append(getNotNullMsg(list_Factory.ZPSPID)).append(" "); + msg.append("ZZD = ").append(getNotNullMsg(list_Factory.ZZD)).append("\n"); + } + log(" Ϣ:\n {} \n\n", msg); +} +/** +* ¼·Ϣ־ +*/ +void logProcessMsg(vector <_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST> proclist) { + log("start log ProecessMSG %d \n", proclist.size()); + string msg = ""; + for (int i = 0; i < proclist.size(); i++) { + _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST list = proclist[i]; + _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD head = list.HEAD; + msg.append("MATNR= ").append(getNotNullMsg(head.MATNR)).append(" "); + msg.append("WERKS= ").append(getNotNullMsg(head.WERKS)).append(" "); + msg.append("VERWE= ").append(getNotNullMsg(head.VERWE)).append(" "); + msg.append("STATU= ").append(getNotNullMsg(head.STATU)).append(" "); + msg.append("DATUV= ").append(getNotNullMsg(head.DATUV)).append(" "); + msg.append("PLNAL= ").append(getNotNullMsg(head.PLNAL)).append(" "); + msg.append("PSPNR= ").append(getNotNullMsg(head.PSPNR)).append("\n["); + + _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS items = list.ITEMS; + _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM* items_item = items.ITEM; + for (int j = 0; j < items.__sizeITEM; j++) { + _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM item_item = items_item[j]; + msg.append("PLNAL= ").append(getNotNullMsg(item_item.PLNAL)).append(" "); + msg.append("PLNFL= ").append(getNotNullMsg(item_item.PLNFL)).append(" "); + msg.append("DATUV= ").append(getNotNullMsg(item_item.DATUV)).append(" "); + msg.append("FLGAT= ").append(getNotNullMsg(item_item.FLGAT)).append(" "); + msg.append("BEZFL= ").append(getNotNullMsg(item_item.BEZFL)).append(" "); + msg.append("LTXA1= ").append(U2G(getNotNullMsg(item_item.LTXA1))).append(" "); + msg.append("VORNR1= ").append(getNotNullMsg(item_item.VORNR1)).append(" "); + msg.append("VORNR2= ").append(getNotNullMsg(item_item.VORNR2)).append("\n"); + _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS subItems = item_item.SUBITEMS; + _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM* sbuItemSubItems = subItems.SUBITEM; + msg.append("["); + for (int x = 0; x < subItems.__sizeSUBITEM; x++) { + _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM sbuItemSubItem = sbuItemSubItems[x]; + msg.append("VORNR= ").append(getNotNullMsg(sbuItemSubItem.VORNR)).append(" "); + msg.append("ARBPL= ").append(getNotNullMsg(sbuItemSubItem.ARBPL)).append(" "); + msg.append("STEUS= ").append(getNotNullMsg(sbuItemSubItem.STEUS)).append(" "); + msg.append("LTXA1= ").append(U2G(getNotNullMsg(sbuItemSubItem.LTXA1))).append(" "); + msg.append("USR00= ").append(getNotNullMsg(sbuItemSubItem.USR00)).append(" "); + msg.append("BMSCH= ").append(getNotNullMsg(sbuItemSubItem.BMSCH)).append(" "); + msg.append("PLNME= ").append(getNotNullMsg(sbuItemSubItem.PLNME)).append(" "); + msg.append("VGW01= ").append(getNotNullMsg(sbuItemSubItem.VGW01)).append(" "); + msg.append("VGE01= ").append(getNotNullMsg(sbuItemSubItem.VGE01)).append(" "); + msg.append("VGW02= ").append(getNotNullMsg(sbuItemSubItem.VGW02)).append(" "); + msg.append("VGE02= ").append(getNotNullMsg(sbuItemSubItem.VGE02)).append(" "); + msg.append("VGW05= ").append(getNotNullMsg(sbuItemSubItem.VGW05)).append(" "); + msg.append("VGE05= ").append(getNotNullMsg(sbuItemSubItem.VGE05)).append("\n"); + } + msg.append("]\n"); + } + msg.append("]\n"); + } + log(" ʼ¼PROCESSϢ====> \n {} \n\n", msg); +} +/** +* ¼BOMϢ־ +*/ +void logBomMsg(vector<_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST> lists) { + string msg = ""; + for (int i = 0; i < lists.size(); i++) { + _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST list = lists[i]; + _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD head = list.HEAD; + msg.append("PSPNR= ").append(getNotNullMsg(head.PSPNR)).append(" "); + msg.append("MATNR= ").append(getNotNullMsg(head.MATNR)).append(" "); + msg.append("WERKS= ").append(getNotNullMsg(head.WERKS)).append(" "); + msg.append("DATUV= ").append(getNotNullMsg(head.DATUV)).append(" "); + msg.append("STLAN= ").append(getNotNullMsg(head.STLAN)).append(" "); + msg.append("STLAL= ").append(getNotNullMsg(head.STLAL)).append(" "); + msg.append("BMENG= ").append(getNotNullMsg(head.BMENG)).append(" "); + msg.append("BMEIN= ").append(getNotNullMsg(head.BMEIN)).append(" "); + msg.append("STKTX= ").append(getNotNullMsg(head.STKTX)).append("\n["); + _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS items = list.ITEMS; + _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM* items_item = items.ITEM; + for (int j = 0; j < items.__sizeITEM; j++) { + _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM item_item = items_item[j]; + msg.append("DATUV= ").append(getNotNullMsg(item_item.DATUV)).append(" "); + msg.append("POSTP= ").append(getNotNullMsg(item_item.POSTP)).append(" "); + msg.append("POSNR= ").append(getNotNullMsg(item_item.POSNR)).append(" "); + msg.append("IDNRK= ").append(getNotNullMsg(item_item.IDNRK)).append(" "); + msg.append("MENGE= ").append(getNotNullMsg(item_item.MENGE)).append(" "); + msg.append("MEINS= ").append(getNotNullMsg(item_item.MEINS)).append(" "); + msg.append("SORTF= ").append(getNotNullMsg(item_item.SORTF)).append(" "); + msg.append("POTX1= ").append(getNotNullMsg(item_item.POTX1)).append("\n"); + } + msg.append("]\n"); + } + log(" ʼ¼BOMϢ====> \n {} \n\n", msg); +} +/** +* ¼ϢDETAILS ش +* @param bomMsg ֯xmlϢ +* @param isExistTag жϵԪǷγ +* @param ccpTagMap ȡԪӦIJƷϱ +* @param code ݺ +* @param batchNum κ +*/ +void logBatabase(_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST bomMsg, + map &isExistTag, map> ccpTagMap, + char *code, string batchNum, char *groupId, char*wbsNo) { + char* topUid = bomMsg.HEAD.STKTX, *itemId, *topMatnrNo; + string materialNoTmp = ""; + if (ccpTagMap.count(topUid) == 0) { + materialNoTmp = bomMsg.HEAD.MATNR; + } + else { + vector ccps = ccpTagMap[topUid]; + for (int i = 0; i < ccps.size(); i++) { + if (i > 0) { + materialNoTmp.append(";").append(ccps[i]); + } + else { + materialNoTmp.append(ccps[i]); + } + } + } + if (isExistTag.count(topUid) == 0) { + //ݱ + tag_t topTag; + ITK__convert_uid_to_tag(topUid, &topTag); + AOM_ask_value_string(topTag, "item_id", &itemId); + AOM_ask_value_string(topTag, "zt2_MaterialNo", &topMatnrNo); + isExistTag[topUid] = materialNoTmp.c_str(); + string insertSql = "insert into CHINT_BOM_TO_SAP_DETIALS (code,batchnumber,plmsendstatus,plmsendstarttime,factory,productmaterialno,pitemid,puid,materialno,wbsno,plmstatus) VALUES ('%s','%s','PLMʼ',SYSDATE,'%s','%s','%s','%s','%s','%s','δ') "; + char selectRxfs[3000]; + sprintf(selectRxfs, insertSql.c_str(), code, batchNum.c_str(), groupId, materialNoTmp.c_str(), itemId, topUid, topMatnrNo, wbsNo); + log("selectRecord2 ===> %s\n", selectRxfs); + ExecuteSQLNoInputParam(selectRxfs); + ExecuteSQLNoInputParam((char*)"commit"); + } + else { + string updateSql = "update CHINT_BOM_TO_SAP_DETIALS set productmaterialno = '%s' where batchnumber = '%s'"; + char selectRxfs[3000]; + sprintf(selectRxfs, updateSql.c_str(), materialNoTmp.c_str(), batchNum.c_str()); + log("selectRecord2 ===> %s\n", selectRxfs); + ExecuteSQLNoInputParam(selectRxfs); + ExecuteSQLNoInputParam((char*)"commit"); + } + log("========="); + return; +} +/** +* 㴫ݵĺʱ +* @param code ݺ +*/ +string getPlmTime(char *code) { + string getMsg = "select trunc((sysdate - plmstarttime) * 24)||'h:'||trunc(mod((sysdate - plmstarttime) * 24 * 60, 60))||'min:'|| trunc(mod((sysdate - plmstarttime) * 24 * 60 * 60, 60))||'s' tim from CHINT_BOM_TO_SAP_SUM where code = %s "; + char selectRxfs[600]; + string timel; + sprintf(selectRxfs, getMsg.c_str(), code); + int outputColumn1 = 0, outputValueCount1 = 0; + char*** outputValue1 = NULL; + log("selectRecord2 ===> %s\n", selectRxfs); + QuerySQLNoInputParam(selectRxfs, &outputColumn1, &outputValueCount1, &outputValue1); + for (int num = 0; num < outputValueCount1; num++) { + //TarGXCODE\", \"TarGXNAME\", \"TemGXCODE\", \"TemGXNAME + timel = outputValue1[num][0]; + } + return timel; +} +/** +* δBOMSAP +* @param groupId ûID +* @param mapList ¼ ƷӦBOMϢ +* @param code ݺ +* @param wbsNo WBS +* @param inCcpMap ԪӦƷϱ 1Զ +*/ +void startSplitSend(char*groupId, + map> mapList, + char *code, char *wbsNo, map> inCcpMap) { + int url_num = 0; + char** url_vals = NULL; + //ѡӦIJַ + PREF_ask_char_values("CHINT_SAPBOM_SPLIT", &url_num, &url_vals); + int cfNum = 1; // ִݵ + int type = 0; //0Ʒά 1 BOM + for (int j = 0; j < url_num; j++) { + vector vec; + Split(url_vals[j], ":", vec); + if (vec.size() == 3) { + if (strcmp(groupId, vec[0].c_str()) == 0) { + if (strcmp("BOM", vec[1].c_str()) == 0) { + type = 1; + } + cfNum = atoi(vec[2].c_str()); + } + } + } + log("====url_vals===={} {} \n", cfNum, mapList.size()); + int batchNum = 1; + int numberCnt = 0; + map ccpMap; + //map> ccpTagMap; + //BOM Ʒִ + if (type == 0) { + int count = 1; + vector<_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST> list; + for (auto it = mapList.begin(); it != mapList.end(); ++it) { + //std::cout << "Key: " << it->first << ", Value: " << it->second << std::endl; + tag_t ccp = it->first; + vector<_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST > bomList = mapList[ccp]; + log("====bomList====%d \n", bomList.size()); + logBomMsg(bomList); + for (int i = 0; i < bomList.size(); i++) { + _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST bomMsg = bomList[i]; + /*if (ccpTagMap.count(bomMsg.HEAD.STKTX) > 0) { + ccpTagMap[bomMsg.HEAD.STKTX].push_back(ccp); + } + else { + vector< tag_t> ccpVector; + ccpVector.push_back(ccp); + ccpTagMap[bomMsg.HEAD.STKTX] = ccpVector; + }*/ + + list.push_back(bomMsg); + } + if (count == mapList.size()) { + numberCnt = numberCnt + 1; + string batchMsg; + char numMsg[128] = ""; + sprintf_s(numMsg, "%05d", batchNum); + batchMsg.append(code).append("-").append(numMsg); + log("batchMsg%s\n", batchMsg.c_str()); + for (int i = 0; i < list.size(); i++) { + log("i.size() ===> %d \n", i); + _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST bomMsg = list[i]; + logBatabase(bomMsg, ccpMap, inCcpMap, code, batchMsg, groupId, wbsNo); + } + log(" start SEND ===\n"); + sendBom(list, batchMsg); + batchNum = batchNum + 1; + list.clear(); + } + else if (count % cfNum == 0) { + numberCnt = numberCnt + 1; + string batchMsg; + char numMsg[128] = ""; + sprintf_s(numMsg, "%05d", batchNum); + batchMsg.append(code).append("-").append(numMsg); + log("batchMsg%s\n", batchMsg.c_str()); + log("list.size() ===> %d \n", list.size()); + for (int i = 0; i < list.size(); i++) { + log("i.size() ===> %d \n", i); + _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST bomMsg = list[i]; + logBatabase(bomMsg, ccpMap, inCcpMap, code, batchMsg, groupId, wbsNo); + //log("i.size() ===> %d \n", i); + } + log(" start SEND ==="); + sendBom(list, batchMsg); + batchNum = batchNum + 1; + list.clear(); + } + count++; + } + } + else { + //BOMִ + int count = 1; + vector<_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST> list; + for (auto it = mapList.begin(); it != mapList.end(); ++it) { + //std::cout << "Key: " << it->first << ", Value: " << it->second << std::endl; + tag_t ccp = it->first; + vector<_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST > bomList = mapList[ccp]; + for (int i = 0; i < bomList.size(); i++) { + list.push_back(bomList[i]); + if (list.size() % cfNum == 0) { + numberCnt = numberCnt + 1; + string batchMsg; + char numMsg[128] = ""; + sprintf_s(numMsg, "%05d", batchNum); + batchMsg.append(code).append("-").append(numMsg); + for (int i = 0; i < list.size(); i++) { + _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST bomMsg = list[i]; + logBatabase(bomMsg, ccpMap, inCcpMap, code, batchMsg, groupId, wbsNo); + } + sendBom(list, batchMsg); + batchNum = batchNum + 1; + list.clear(); + } + } + if (count == mapList.size() && list.size()>0) { + string batchMsg; + char numMsg[128] = ""; + sprintf_s(numMsg, "%05d", batchNum); + numberCnt = numberCnt + 1; + batchMsg.append(code).append("-").append(numMsg); + for (int i = 0; i < list.size(); i++) { + _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST bomMsg = list[i]; + logBatabase(bomMsg, ccpMap, inCcpMap, code, batchMsg, groupId, wbsNo); + } + sendBom(list, batchMsg); + batchNum = batchNum + 1; + list.clear(); + } + count++; + } + } + string time1 = getPlmTime(code); + string updateSum = "update CHINT_BOM_TO_SAP_SUM set \"NUMBER\" = %d ,datastatus = 'SAP',organizationaltime = '%s',taskstauts = '֯',PLMFINISHTIME = SYSDATE where code = '%s' "; + char selectRxfs[800]; + string timel; + sprintf(selectRxfs, updateSum.c_str(), numberCnt, time1.c_str(), code); + log("selectRecord2 ===> %s\n", selectRxfs); + ExecuteSQLNoInputParam(selectRxfs); + ExecuteSQLNoInputParam((char*)"commit"); +} +#define SEND_MSG " \\\"" +#define SPLIT_MSG "\\\" \\\"" +#define CODE_MSG "\\\" ĿѾ, : " +#define TYPE_MSG ", : " +#define RESULT_MSG ", δݽΪ: PLMδͨԭ:\\n" + +/** +* Ϣͷ֪ͨ +* @param code ݵıcode +* @param errMsg Ϣ +* @param wbsNo ĿWBS +* @param userName û +* @param projectName Ŀ +*/ +void sendNotice(char *code, string errMsg, char *wbsNo, char *userName, char* projectName) { + /*string noticeMsg = "ĿBOM쳣WBS:"; + noticeMsg.append(wbsNo).append("\n").append(errMsg);*/ + + string search = "select userid,TO_CHAR(STARTTIME,'yyyy-MM-dd HH24:mi:ss'),transfer from CHINT_BOM_TO_SAP_SUM where code = '%s' "; + + char selectRxfs[600]; + string userNameStr = "wangll06"; + string startTime, transfer; + //ȡʱ + sprintf(selectRxfs, search.c_str(), code); + int outputColumn1 = 0, outputValueCount1 = 0; + char*** outputValue1 = NULL; + log("selectRecord2 ===> %s\n", selectRxfs); + QuerySQLNoInputParam(selectRxfs, &outputColumn1, &outputValueCount1, &outputValue1); + for (int num = 0; num < outputValueCount1; num++) { + userNameStr = outputValue1[num][0]; + startTime = outputValue1[num][1]; + transfer = outputValue1[num][2]; + } + string noticeMsg = "PLMϵͳԶ֪ͨ"; + noticeMsg.append(startTime).append(" ") + .append(userName).append(SEND_MSG) + .append(wbsNo).append(SPLIT_MSG) + .append(projectName).append(CODE_MSG) + .append(code).append(TYPE_MSG).append(transfer).append(RESULT_MSG) + .append(errMsg); + string json = "{"; + + json.append("\"mobiles\":").append("[\"13588843438\",\"15295371103\"],"); + json.append("\"emails\":").append("["); + json.append("\"").append(userNameStr).append("\"],"); + json.append("\"sms\":").append("false,"); + json.append("\"content\":\"").append(noticeMsg).append("\""); + json.append("}"); + + log(" Ŀ֯Ϣ :%s \n", json.c_str()); + string returnMsg = callFsHttpserver(json, "http://10.128.10.170/api/feishu/Message/sendMessages"); + log(" ֪ͨ :%s \n", returnMsg.c_str()); +} + +/** +* ݲƷȡ ͵µBOM +* @param ccpVector Ʒļ +* @param projectNo Ŀ +* @param groupName ûڵ +* @param wbs ĿWBS +* @param now ǰʱ +* @param errMsgBuf Ϣ +* @param code ݵıcode +* @param transfer +* @param userName û +* @param projectName Ŀ +*/ +void getCcpAndBom(vector ccpVector, char* projectNo, char* groupName, char* wbs, + char* now, string& errMsgBuf, char*code, char* transfer, char* userName, char* projectName) { + //¼Ƿظij + vector isCheck_FactoryNos; + //¼Ʒ Ӧ BOM + map> cPart_schemes; + vector<_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM> list_Factorys; + for (int len = 0; len < ccpVector.size(); len++) { + vector elcBoms; + tag_t ccp = ccpVector[len], *factoryNos; + char* ccpUid; + ITK__convert_tag_to_uid(ccp, &ccpUid); + log("ƷUID:%s\n", ccpUid); + ITKCALL(AOM_refresh(ccp, FALSE)); + int num = 0; + ITKCALL(AOM_ask_value_tags(ccp, "ZT2_FactoryNumber", &num, &factoryNos)); + if (num == 0) { + cPart_schemes[ccp] = elcBoms; + } + else { + if (cPart_schemes.count(ccp) > 0) { + continue; + }//֯ݳŵ + getFactoryNoList(projectNo, groupName, wbs, factoryNos, num, ccp, list_Factorys); + map> items2; + for (int i = 0; i < num; i++) { + tag_t factoryNo = factoryNos[i]; + if (std::find(isCheck_FactoryNos.begin(), isCheck_FactoryNos.end(), factoryNo) != isCheck_FactoryNos.end()) + continue; + isCheck_FactoryNos.push_back(factoryNos[i]); + + int n_references = 0; + int* levels = 0; + tag_t* references_tag; + char** relation_type_name = NULL; + //ͨùϵҵ + ITKCALL(WSOM_where_referenced(factoryNo, 1, &n_references, &levels, &references_tag, &relation_type_name)); + //߼ȡ²ƷITEMֹ汾Ӱ + tag_t ccpItem; + char* ccpItemUid; + ITEM_ask_item_of_rev(ccp, &ccpItem); + ITK__convert_tag_to_uid(ccpItem, &ccpItemUid); + log("===========%d \n", n_references); + for (int i = 0; i < n_references; i++) + { + char* refType, *grpName, *useUid, *object_name, *zt2_SapState; + tag_t refTag = references_tag[i], group, item; + AOM_ask_value_string(refTag, "object_type", &refType); + if (strcmp(refType, "Part Revision") != 0) { + continue; + } + ITK__convert_tag_to_uid(refTag, &useUid); + //жϲDzƷ ͬһ + AOM_ask_value_tag(refTag, "owning_group", &group); + AOM_ask_value_string(group, "name", &grpName); + if (strcmp(grpName, groupName) != 0 || strcmp(ccpUid, useUid) == 0) + continue; + AOM_UIF_ask_value(refTag, "object_name", &object_name); + AOM_UIF_ask_value(refTag, "zt2_SapState", &zt2_SapState); + if (strcmp(zt2_SapState, "1") == 0 || strcmp(zt2_SapState, "δ") == 0) { + continue; + } + ITEM_ask_item_of_rev(refTag, &item); + char* unitUid; + ITK__convert_tag_to_uid(item, &unitUid); + if (strcmp(unitUid, ccpItemUid) == 0) { + continue; + } + log("useUid %s object_name %s \n", useUid, object_name); + if (items2.count(item) > 0) { + items2[item].push_back(refTag); + } + else { + vector revs2; + revs2.push_back(refTag); + items2[item] = revs2; + } + } + } + + vector rev2 = addLastRev(items2); + cPart_schemes[ccp] = rev2; + } + } + //ݳŵļ¼־Ϣ + log(" num :{} \n\n\n", list_Factorys.size()); + logCcbh(list_Factorys); + sendFactoryNo(list_Factorys); + + string errMess;//¼BOMϢ + map material_revs; //¼Ҫ޸ԵIJƷ + vector set_meops; //¼ҪĹ· + map gy_meops; //ظ· + vector needTCM_meops;//û + map>::iterator it; + map> scheme_boms;//¼ƷBOMݵϢ + map> process_boms; + vector bomISExist;//¼ϱֹظ + //ģƥ + map> rev_meops; + map> inCcpMap;//¼ԪӦIJƷϱ + for (it = cPart_schemes.begin(); it != cPart_schemes.end(); it++) { + tag_t s = it->first; + vector vectorRev = cPart_schemes[s]; + log("vectorRev size BOM {} \n", vectorRev.size()); + readSchemesYH(vectorRev, s, scheme_boms, bomISExist, rev_meops, groupName, now, errMess, + material_revs, gy_meops, needTCM_meops, process_boms, transfer, inCcpMap); + log("scheme_boms {} \n", scheme_boms.size()); + } + if (errMess.length() > 0) { + errMsgBuf.append("BOM쳣:\\n").append(errMess); + // + string updateSum = "update CHINT_BOM_TO_SAP_SUM set \"DATASTATUS\" = 'ݼ' ,SAPRESULT = 'PLMδͨ',PLMRESULT = 'ѷͷ֪ͨ' where code = '%s' "; + char selectRxfs[800]; + string timel; + sprintf(selectRxfs, updateSum.c_str(), code); + log("selectRecord2 ===> %s\n", selectRxfs); + ExecuteSQLNoInputParam(selectRxfs); + ExecuteSQLNoInputParam((char*)"commit"); + + //ѷͷ + sendNotice(code, errMsgBuf, wbs, userName, projectName); + return; + } + + vector <_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST> proclist; + //vector< vector<_ns1__DT_USCOREBOM_USCOREPLM_USCOREREQ_LIST>> lists; + //vector< vector<_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST>> proclists; + vector isSends; + //vector errorParts; + //vector successParts; + map isExistBom; //ѾݹĵԪٴ + map flmMap; + string sendErrMsg; + map> mapList; + for (int i = 0; i < ccpVector.size(); i++) { + //list.clear(); + proclist.clear(); + vector<_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST> list; //¼BOMϢ + tag_t ccp = ccpVector[i]; + if (cPart_schemes.count(ccp) > 0) { + vector schemes = cPart_schemes[ccp]; + string sendMsg; + log("schemes size %d \n", schemes.size()); + //ƷûеԪ + if (schemes.size() == 0) { + continue; + } + readBomInfoYH(ccp, schemes, list, proclist, isSends, "", material_revs, + groupName, now, scheme_boms, gy_meops, needTCM_meops, flmMap, isExistBom); + if (list.size() > 0) { + //logBomMsg(list); + mapList[ccp] = list; + } + if (proclist.size() > 0) { + logProcessMsg(proclist);// vector <_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST> proclist; + sendProcess(proclist, sendMsg);//proclists.push_back(proclist);//sendProcess(proclist); + } + } + } + /*if (errorParts.size() > 0) { + errMsgBuf.append("BOMݷ쳣:\n").append(sendErrMsg); + } + else { + string endBuff; + for (int j = 0; j < successParts.size(); j++) { + char* object_string; + AOM_ask_value_string(successParts[j], "object_string", &object_string); + endBuff.append(object_string).append("\n"); + } + errMsgBuf.append("ݳɹ:\n").append(endBuff); + }*/ + if (mapList.size() > 0) { + //BOM + //logBomMsg(list); + //sendBom(list, sendMsg); + startSplitSend(groupName, mapList, code, wbs, inCcpMap); + //sendBom(list); + } + else { + string time1 = getPlmTime(code); + string updateSum = "update CHINT_BOM_TO_SAP_SUM set datastatus = 'ûкϷBOM',organizationaltime = '%s',taskstauts = '֯',PLMFINISHTIME = SYSDATE where code = '%s' "; + char selectRxfs[800]; + string timel; + sprintf(selectRxfs, updateSum.c_str(), time1.c_str(), code); + log("selectRecord2 ===> %s\n", selectRxfs); + ExecuteSQLNoInputParam(selectRxfs); + ExecuteSQLNoInputParam((char*)"commit"); + } + +} + +//void startLog() { +// tag_t current_member = NULLTAG, current_user = NULLTAG; +// char* user_id = ""; +// +// SA_ask_current_groupmember(¤t_member); +// SA_ask_groupmember_user(current_member, ¤t_user); +// SA_ask_user_identifier2(current_user, &user_id); +// +// string userId = user_id; +// //ȡǰʱ +// time_t now = time(0); +// tm* p = localtime(&now); +// char dateNow[128] = ""; +// sprintf_s(dateNow, "%04d%02d%02d%02d%02d%02d", 1900 + p->tm_year, p->tm_mon + 1, p->tm_mday, p->tm_hour, p->tm_min, p->tm_sec); +// string dateString = dateNow; +// auto file_logger = basic_logger_mt("import_logger", "C:/logs/" + userId + "_" + dateString + ".log"); +// set_default_logger(file_logger); +// log("begin connor_import_object"); +//} + +/** +* ݲƷȡ ͵µBOM +* @param ccpVector Ʒļ +* @param groupName ûڵ +* @param projectUid ĿUID +* @param code ݵıcode +* @param userName ûID +*/ +int readBomMsg(vector ccpVector, char * groupName, char* projectUid, char*code, char *userName) { + char* revUid; + int ifail = ITK_ok, num = 0; + //startLog(); + //TCݿ + + string errorBuff; + tag_t project; + time_t now = time(0); + tm* p = localtime(&now); + char fileDate[128] = ""; + sprintf_s(fileDate, "%04d%02d%02d", 1900 + p->tm_year, p->tm_mon + 1, p->tm_mday); + string nowTime = fileDate; + + tag_t ccp; + ITK__convert_uid_to_tag(projectUid, &project); + + char* projectNo, *zt2_WBSNo, *objectName; + //project.getProperty("zt2_ProjectNo"); + AOM_ask_value_string(project, "zt2_ProjectNo", &projectNo); + AOM_ask_value_string(project, "object_name", &objectName); + AOM_ask_value_string(project, "zt2_WBSNo", &zt2_WBSNo); + log("ccpVector%d\n", ccpVector.size()); + + //ѯ + char* transfer = (char*)""; + string sql = "select transfer from CHINT_BOM_TO_SAP_SUM where code = "; + sql.append(code); + int outputColumn1 = 0, outputValueCount1 = 0; + char*** outputValue1 = NULL; + log("search3 ===> :{}\n", sql.c_str()); + QuerySQLNoInputParam((char*)sql.c_str(), &outputColumn1, &outputValueCount1, &outputValue1); + if (outputValueCount1 > 0) { + transfer = outputValue1[0][0]; + } + log("transfer ===> :{}\n", transfer); + getCcpAndBom(ccpVector, projectNo, groupName, zt2_WBSNo + , fileDate, errorBuff, code, transfer, userName, objectName); + /*log("errorBuff ===>%s\n", errorBuff.c_str()); + *((char**)returnValue) = (char*)MEM_alloc((strlen(errorBuff.c_str()) + 1) * sizeof(char)); + tc_strcpy(*((char**)returnValue), errorBuff.c_str());*/ + + log("end connor_import_object"); + //spdlog::drop_all(); + return ITK_ok; +} \ No newline at end of file diff --git a/DFL_BOM_WL_TOERP/CRUL_server_call_httpserver.cpp b/DFL_BOM_WL_TOERP/CRUL_server_call_httpserver.cpp new file mode 100644 index 0000000..387b2cc --- /dev/null +++ b/DFL_BOM_WL_TOERP/CRUL_server_call_httpserver.cpp @@ -0,0 +1,123 @@ +#include "CRUL_server_call_httpserver.h" +#include +#include +#include +#include +//#define HTTP_HOST "localhost" +#define HTTP_POST 9293 +size_t write_data(void* ptr, size_t size, size_t nmemb, void* stream) { + string data((const char*)ptr, (size_t)size * nmemb); + *((stringstream*)stream) << data << endl; + return size * nmemb; +} +string callHttpserver(string signinfoJsonString, string url) { + CURL* curl; + CURLcode res; + curl = curl_easy_init(); + std::stringstream out; + if (curl) { + curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST"); + curl_easy_setopt(curl, CURLOPT_URL, url.c_str()); + curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L); + curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "http"); + struct curl_slist* headers = NULL; + curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_data); + curl_easy_setopt(curl, CURLOPT_WRITEDATA, &out); + headers = curl_slist_append(headers, "Content-Type: application/json"); + curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers); + const char* data = signinfoJsonString.c_str(); + curl_easy_setopt(curl, CURLOPT_POSTFIELDS, data); + res = curl_easy_perform(curl); + if (res != 0) { + string errMessage = curl_easy_strerror(res); + } + printf("ֵ%d\n", res); + } + string str_json = out.str(); + curl_easy_cleanup(curl); + printf("str_json===>%s\n", str_json.c_str()); + return str_json; +} +string callFsHttpserver(string signinfoJsonString, string url) { + CURL* curl; + CURLcode res; + curl = curl_easy_init(); + std::stringstream out; + if (curl) { + curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST"); + curl_easy_setopt(curl, CURLOPT_URL, url.c_str()); + curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L); + curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https"); + struct curl_slist* headers = NULL; + curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_data); + curl_easy_setopt(curl, CURLOPT_WRITEDATA, &out); + headers = curl_slist_append(headers, "Content-Type: application/json"); + curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers); + const char* data = signinfoJsonString.c_str(); + curl_easy_setopt(curl, CURLOPT_POSTFIELDS, data); + res = curl_easy_perform(curl); + if (res != 0) { + string errMessage = curl_easy_strerror(res); + } + printf("ֵ%d\n", res); + } + string str_json = out.str(); + curl_easy_cleanup(curl); + printf("str_json===>%s\n", str_json.c_str()); + return str_json; +} +//gfpoappʽ 192.168.0.184 +string callHttpserver2(string signinfoJsonString) { + CURL* curl; + CURLcode res; + std::stringstream out; + curl = curl_easy_init(); + if (curl) { + curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST"); + curl_easy_setopt(curl, CURLOPT_URL, "http://gfpoapp:50100/XISOAPAdapter/MessageServlet?senderParty=&senderService=BC_CHINT_ELECTRIC&receiverParty=&receiverService=&interface=SIO_BOM_PLM_ASYN&interfaceNamespace=urn%3Achintelectric.com%3Axi%3Aplm"); + curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L); + curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "http"); + struct curl_slist* headers = NULL; + curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_data); + curl_easy_setopt(curl, CURLOPT_WRITEDATA, &out); + headers = curl_slist_append(headers, "Content-Type: application/xml"); //c2hwb2RldjpzYXBAMjAxOQ== + headers = curl_slist_append(headers, "Authorization: Basic c2hwbG06c2FwQDIwMTk="); //c2hwbG06c2FwQDIwMTk=ʽ + curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers); + const char* data = signinfoJsonString.c_str(); + curl_easy_setopt(curl, CURLOPT_POSTFIELDS, data); + res = curl_easy_perform(curl); + if (res != 0) { + string errMessage = curl_easy_strerror(res); + } + printf("ֵ%d\n", res); + } + string str_json = out.str(); + curl_easy_cleanup(curl); + + printf("str_json===>%s\n", str_json.c_str()); + return str_json; +} + +string callHttpGet(string url) { + void* curl = curl_easy_init(); + // URL + std::stringstream out; + curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "GET"); + curl_easy_setopt(curl, CURLOPT_URL, url.c_str()); + // ýݵĴʹű + curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_data); + curl_easy_setopt(curl, CURLOPT_WRITEDATA, &out); + + // ִHTTP GET + CURLcode res = curl_easy_perform(curl); + if (res != CURLE_OK) { + fprintf(stderr, "curl_easy_perform() failed: %s\n", curl_easy_strerror(res)); + } + + // ݴoutУ֮ + //cout << out.str() << endl; + string str_json = out.str(); + curl_easy_cleanup(curl); + printf("str_json===>%s\n", str_json.c_str()); + return str_json; +} diff --git a/DFL_BOM_WL_TOERP/CRUL_server_call_httpserver.h b/DFL_BOM_WL_TOERP/CRUL_server_call_httpserver.h new file mode 100644 index 0000000..32e5244 --- /dev/null +++ b/DFL_BOM_WL_TOERP/CRUL_server_call_httpserver.h @@ -0,0 +1,8 @@ +#include +#include +#include +using namespace std; +string callHttpserver(string signinfoJsonString, string url); +string callHttpserver2(string signinfoJsonString); +string callHttpGet(string url); +string callFsHttpserver(string signinfoJsonString, string url); diff --git a/DFL_BOM_WL_TOERP/DFL_BOM_WL_TOERP.vcxproj b/DFL_BOM_WL_TOERP/DFL_BOM_WL_TOERP.vcxproj new file mode 100644 index 0000000..b4d3069 --- /dev/null +++ b/DFL_BOM_WL_TOERP/DFL_BOM_WL_TOERP.vcxproj @@ -0,0 +1,242 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 15.0 + {C1C26324-9AD6-4D45-B239-589A82585DD9} + Win32Proj + DFLBOMWLTOERP + 8.1 + BOMToSapOpt + + + + Application + true + v142 + Unicode + + + Application + false + v142 + true + Unicode + + + Application + true + v142 + Unicode + + + Application + false + v140 + true + Unicode + + + + + + + + + + + + + + + + + + + + + true + + + true + + + false + + + false + + + + + + Level3 + Disabled + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + + + Level3 + Disabled + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + + + Level3 + MaxSpeed + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + 20000000 + 8000000 + 20000000 + 8000000 + + + + + NotUsing + Level3 + MaxSpeed + true + true + true + WIN32;NDEBUG;_CONSOLE;IPLIB=none;%(PreprocessorDefinitions) + true + Z:\TC_install\ZhengTai\c\sdplog\include;Z:\TC_install\ZhengTai\c\libcurl-vc15-x64-release-dll-ipv6-sspi-schannel\include;Z:\TC_install\YSR\c\clib\OCI\include;Z:\TC_install\jingdiao\c\tclib\include;Z:\TC_install\jingdiao\c\tclib\include_cpp;Z:\TC_install\ZhengTai\c\libxl\include;%(AdditionalIncludeDirectories) + /D _CRT_SECURE_NO_WARNINGS %(AdditionalOptions) + false + + + Console + true + true + true + Z:\TC_install\ZhengTai\c\sdplog\lib\*.lib;Z:\TC_install\jingdiao\c\tclib\lib\*.lib;Z:\TC_install\jingdiao\c\tclib\lib\itk_main.obj;Z:\TC_install\ZhengTai\c\libxl\lib\*.lib;%(AdditionalDependencies) + libuser_exits.ar.lib;%(IgnoreSpecificDefaultLibraries) + 30000000 + 9000000 + 30000000 + 9000000 + Z:\TC_install\ZhengTai\c\sdplog\lib;Z:\TC_install\jingdiao\c\tclib\lib;Z:\TC_install\ZhengTai\c\libxl\lib;%(AdditionalLibraryDirectories) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/DFL_BOM_WL_TOERP/DFL_BOM_WL_TOERP.vcxproj.filters b/DFL_BOM_WL_TOERP/DFL_BOM_WL_TOERP.vcxproj.filters new file mode 100644 index 0000000..62caee6 --- /dev/null +++ b/DFL_BOM_WL_TOERP/DFL_BOM_WL_TOERP.vcxproj.filters @@ -0,0 +1,221 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + {9e65382d-9aa6-4ad3-838e-793ff9f1a7a4} + + + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + webservice + + + webservice + + + webservice + + + webservice + + + webservice + + + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + 头文件 + + + webservice + + + webservice + + + webservice + + + webservice + + + webservice + + + webservice + + + + + webservice + + + \ No newline at end of file diff --git a/DFL_BOM_WL_TOERP/DFL_BOM_WL_TOERP.vcxproj.user b/DFL_BOM_WL_TOERP/DFL_BOM_WL_TOERP.vcxproj.user new file mode 100644 index 0000000..be25078 --- /dev/null +++ b/DFL_BOM_WL_TOERP/DFL_BOM_WL_TOERP.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/DFL_BOM_WL_TOERP/EBomToPBom.cpp b/DFL_BOM_WL_TOERP/EBomToPBom.cpp new file mode 100644 index 0000000..eb26601 --- /dev/null +++ b/DFL_BOM_WL_TOERP/EBomToPBom.cpp @@ -0,0 +1,1528 @@ +//#include "dfl_custom.h" +//#include +//#include +//#include +//#include +//#include "ado.h" +//#include +//#include +//#include "rapidjson/document.h" +//#include +//#include "rapidjson/writer.h" +//#include +//#include +//#include +//#include "ocilib.h" +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +// +//extern "C" int POM_AM__set_application_bypass(logical bypass); +////жǷΪ Ȧ "1ZDB581000X-00055"; ȦP +//regex qq_reg("^1ZDB5.*\\d{1,}1000X.*"); //\\d{5,}$ +//struct newCBean +//{ +// int num; +// tag_t cLine; +//}; +//struct EBomBean +//{ +// boolean istop = false; +// vector topCcp; +// tag_t eRev; //ԭe +// tag_t eBomline; //Ebom +// vector pRev; //P +// tag_t pBomline = NULL; //PBOM +// tag_t designRev; //Eϵͼֽ +// vector parentBean; //EBOMʱĸ +// vector c_lines; //EBOMеӼ ֻȦ +//}; +// +///* +//primaryTag汾 +//secondTagݼ +//relationTypeϵ +//*/ +//string Sql2 = "select t.PrhName,t.PrdLine,t.PrdNo,t.PrdFeatureCode,t.FeatureName,t.PrdCanInput,t.PrdSign from CcemVW_Prd t where t.prhcode = '%s' order by t.PrdNo"; +//string Sql1 = "select t.PmpcPrhCode, t.PmpcPType,t.PmpcMType from CcemVW_Pmpc t where t.PmpcCode='%s'"; +//string m_code1 = "230101001"; +//string m_code2 = "220103001"; +// +//struct PRD +//{ +// string prdFeatureCode; +// string featureName; +//}; +//struct PMPC +//{ +// string m_code; +// string pmpcPrhCode; +// string pmpcPType; +// string pmpcMType; +//}; +//PMPC pmpc; +//vector prds; +//void save_representation2222(tag_t primaryTag, tag_t secondTag, char* relationType) +//{ +// +// //POM_AM__set_application_bypass(true); +// tag_t typeTag = NULLTAG; +// ITKCALL(GRM_find_relation_type(relationType, &typeTag)); +// +// ITKCALL(AOM_refresh(primaryTag, TRUE)); +// ITKCALL(AOM_refresh(secondTag, TRUE)); +// tag_t relationTag = NULLTAG; +// ITKCALL(GRM_create_relation(primaryTag, secondTag, typeTag, NULLTAG, &relationTag));//ϵѾڣôӶ +// +// ITKCALL(GRM_save_relation(relationTag));//ܱҪ +// ITKCALL(AOM_save(primaryTag)); +// ITKCALL(AOM_save(secondTag)); +// ITKCALL(AOM_refresh(primaryTag, FALSE)); +// ITKCALL(AOM_refresh(secondTag, FALSE)); +// //POM_AM__set_application_bypass(false); +// +//} +//void replaceBom(tag_t newTopLine, tag_t newChild) { +// int c_line_count, cnt2, numFac; +// tag_t* c_line_tags; +// char* uid1; +// ITK__convert_tag_to_uid(newChild, &uid1); +// ITKCALL(BOM_line_ask_all_child_lines(newTopLine, &c_line_count, &c_line_tags)); +// for (int t = 0; t < c_line_count; t++) { +// tag_t c_line_tag = c_line_tags[t], eRev; +// ITKCALL(AOM_ask_value_tag(c_line_tag, "bl_line_object", &eRev)); +// char* uid2; +// ITK__convert_tag_to_uid(eRev, &uid2); +// if (strcmp(uid2, uid1) == 0) { +// BOM_line_replace(c_line_tag, NULLTAG, newChild, NULLTAG); +// } +// } +// +//} +//string sql_query = "select FeatureList from CcemVW_GoodsFeature where GoodsCode ='%s' "; +//void saveAsCycle(EBomBean& childPm, map& map,tag_t& topPrev) { +// tag_t tcType, newItem, newRev; +// char* newId; +// if (childPm.parentBean.size() > 0) { +// saveAsCycle(childPm.parentBean[0], map, topPrev); +// } +// printf("1===>%d\n", childPm.pRev.size()); +// char* eRevUid, * zt2_ifpbom; +// AOM_ask_value_string(childPm.eRev, "zt2_ifpbom", &zt2_ifpbom); +// if (strcmp(zt2_ifpbom, "P") == 0) { +// if (childPm.pRev.size() == 0) { +// childPm.pRev.push_back(childPm.eRev); +// } +// return; +// } +// ITK__convert_tag_to_uid(childPm.eRev, &eRevUid); +// if (childPm.pRev.size() == 0) { +// if (map.count(eRevUid) > 0) { +// childPm.pRev.push_back(map[eRevUid]); +// } +// else { +// char* newid = NULL; +// logical isModified = FALSE; +// tag_t item_type_tag; +// TCTYPE_ask_type("Item", &item_type_tag); +// ITKCALL(USER_new_item_id(NULLTAG, item_type_tag, &isModified, &newid)); +// /*ITKCALL(NR_next_value("MEProcess", "item_id", NULLTAG, "", "", "", +// NULLTAG, "", "", &next_id));*/ +// printf("next_id==>%s\n", newid); +// ITKCALL(ITEM_copy_item(childPm.eRev, newid, NULL, &newItem, &newRev)); +// //ITKCALL(AOM_set_value_string(newRev, "zt2_PMaterial", "PBOM")); +// char* matnrNo; +// AOM_ask_value_string(childPm.eRev, "zt2_MaterialNo", &matnrNo); +// AOM_lock(newRev); +// +// AOM_set_value_string(newRev, "zt2_ifpbom", "P"); +// AOM_set_value_string(newRev, "zt2_MaterialNo", matnrNo); +// AOM_save(newRev); +// AOM_unlock(newRev); +// if (topPrev == NULLTAG) { +// topPrev = newRev; +// } +// childPm.pRev.push_back(newRev); +// map[eRevUid] = newRev; +// int num = 0, revNum = 0, tagNum = 0; +// tag_t* mantrs, dsuser, * structure_revisions, * bom_view_tags; +// AOM_ask_value_tags(childPm.eRev, "TC_Is_Represented_By", &num, &mantrs); +// if (num > 0) { +// AOM_ask_value_tags(newRev, "structure_revisions", &revNum, &structure_revisions); +// AOM_ask_value_tags(newRev, "bom_view_tags", &tagNum, &bom_view_tags); +// AOM_ask_value_tag(mantrs[0], "owning_user", &dsuser); +// tag_t defGroup; +// ITKCALL(AOM_ask_value_tag(dsuser, "default_group", &defGroup)); +// ITKCALL(AOM_set_ownership(newItem, dsuser, defGroup)); +// ITKCALL(AOM_set_ownership(newRev, dsuser, defGroup)); +// if (revNum > 0) { +// ITKCALL(AOM_set_ownership(structure_revisions[0], dsuser, defGroup)); +// } +// if (tagNum > 0) { +// ITKCALL(AOM_set_ownership(bom_view_tags[0], dsuser, defGroup)); +// } +// } +// } +// } +// if (childPm.parentBean.size() > 0) { +// EBomBean parentBean = childPm.parentBean[0]; +// vector pRevs = parentBean.pRev; +// if (pRevs.size() > 0) { +// int bvr_count = 0, c_line_count; +// tag_t ebom_window = NULLTAG; +// tag_t bom_line = NULLTAG, * c_line_tags; +// (BOM_create_window(&ebom_window)); +// tag_t* bvr_list = NULL; +// (ITEM_rev_list_bom_view_revs(pRevs[0], &bvr_count, &bvr_list)); +// printf("bvr_count=%d\n", bvr_count); +// +// (BOM_set_window_top_line_bvr(ebom_window, bvr_list[0], &bom_line)); //bomȡ +// //ITKCALL(AOM_ask_value_tag(bom_line, "bl_line_object", &mantr)); +// ITKCALL(BOM_line_ask_all_child_lines(bom_line, &c_line_count, &c_line_tags)); +// +// for (int ind = 0; ind < c_line_count; ind++) { +// tag_t c_line_tag = c_line_tags[ind], mantr; +// AOM_ask_value_tag(c_line_tag, "bl_line_object", &mantr); +// char* eRevUid2; +// ITK__convert_tag_to_uid(mantr, &eRevUid2); +// if (strcmp(eRevUid2, eRevUid) == 0) { +// if (childPm.pRev.size() > 0) { +// printf("eRevUid===>%s\n", eRevUid); +// ITKCALL(BOM_line_replace(c_line_tag, NULLTAG, childPm.pRev[0], NULLTAG)); +// } +// } +// } +// BOM_save_window(ebom_window); +// BOM_close_window(ebom_window); +// } +// } +//} +//void getSpecs(tag_t rev, vector& vec) { +// tag_t* comps; +// int cnt; +// /*AOM_ask_value_string(line, "ZT2_TYSpecifications", &ZT2_TYSpecifications); +// if (strcmp(ZT2_TYSpecifications, "") == 0) {*/ +// AOM_ask_value_tags(rev, "representation_for", &cnt, &comps); +// char* zt2_Specifications; +// //if (cnt == 0) { +// AOM_ask_value_string(rev, "zt2_Specifications", &zt2_Specifications); +// vec.push_back(zt2_Specifications); +// // //} +// //} +//} +//string insertSql = "insert into chint_material(\"Code\",\"PUID\",\"PmpcCode\",\"GoodsCode\",\"GoodsName\",\"UnitCode\",\"CompanyCode\",\"BpNo\",\"Spec\",\"TeRe\",\"State\",\"User\",\"Time\",\"Condition\",\"Info\") values('%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s',to_date('%s','yyyy-mm-dd HH24:mi:ss'),'%s','%s')"; +//tag_t send1(tag_t rev, string now, +// char* user_id, vector& jsons, string groupId, string spec, char* nameNum, char* idss, tag_t dcproxy) { +// //map>::iterator it; +// //for (it = general_maps.begin(); it != general_maps.end(); it++) { +// char* item_id, * object_name, * zt2_DrawingNo1, * zt2_MaterialMark, * zt2_ProductModel +// , * object_desc, * zt2_SurfaceTreatment, * zt2_Source; +// AOM_ask_value_string(rev, "item_id", &item_id); //groupId +// AOM_ask_value_string(rev, "object_name", &object_name); +// AOM_ask_value_string(rev, "zt2_DrawingNo", &zt2_DrawingNo1); +// AOM_ask_value_string(rev, "zt2_MaterialMark", &zt2_MaterialMark); +// AOM_ask_value_string(rev, "zt2_ProductModel", &zt2_ProductModel); +// AOM_ask_value_string(rev, "object_desc", &object_desc); +// AOM_ask_value_string(rev, "zt2_SurfaceTreatment", &zt2_SurfaceTreatment); +// AOM_UIF_ask_value(rev, "zt2_Source", &zt2_Source); +// PMPC m_pmpc; +// vector m_prds; +// //if (strcmp(item_id, "1ZDB") == 0) { +// m_prds = prds; +// m_pmpc = pmpc; +// printf("m_pmpc\n"); +// //} +// string pmpcCode = m_pmpc.m_code; +// string prhCode = m_pmpc.pmpcPrhCode; +// string pmpcType = m_pmpc.pmpcMType; +// printf("pmpcType===>%s\n", pmpcType.c_str()); +// if (pmpcType.length() == 0) { +// return NULLTAG; +// } +// string goodsCode = ""; // ʱΪ +// string prefixName = nameNum; +// string goodsName = prefixName.append(object_name);//rev.getProperty("object_name"); +// string unitCode = "ST"; // ĬϼʵֵST +// string companyCode = groupId; +// string mp = "M"; +// if (strcmp(zt2_Source, "⹺") == 0) { +// mp = "P"; +// pmpcType = m_pmpc.pmpcPType; +// } +// string bpNo = item_id;//rev.getProperty("item_id"); // DZ +// string zt2_DrawingNo = zt2_DrawingNo1;//rev.getProperty("zt2_DrawingNo"); +// if (!zt2_DrawingNo.empty()) { +// if (strcmp(item_id, zt2_DrawingNo1) != 0) +// bpNo = zt2_DrawingNo1; +// } +// vector vec2; +// if (strstr(bpNo.c_str(), "-") != NULL) { +// Split(bpNo, "-", vec2); +// bpNo = vec2[0].append("-").append(idss).append("-").append(vec2[1]); +// } +// string materialMark = zt2_MaterialMark;//rev.getProperty("zt2_MaterialMark"); // DZ +// +// if (materialMark.compare("--") == 0) { +// materialMark = ""; +// } +// // Ʒͺ //Ʒ +// string productModel = zt2_ProductModel;//rev.getProperty("zt2_ProductModel"); +// string teRe = ""; +// string state = ""; // ʱΪ +// string wbs = ""; +// string product = ""; +// string user = user_id; +// string time = now; +// string condition = "";// Ĭ +// string desc = object_desc;// properties[5];//rev.getProperty("object_desc"); +// //for (int i = 0; i < specs.size(); i++) { +// string json = "{"; +// string sql22 = "select CHINT_MATERIAL_SEQ.nextval as sid from dual"; +// int colmun2 = 0, count2 = 0; +// char*** outputValue2 = NULL; +// printf("search1"); +// QuerySQLNoInputParam((char*)sql22.c_str(), &colmun2, &count2, &outputValue2); +// char* projn = ""; +// if (count2 > 0) { +// projn = outputValue2[0][0]; +// } +// printf("projn===>%s\n", projn); +// json.append("\"Code\":\"").append(projn).append("\","); +// //string spec = specs[i]; // DZ +// string feature = "\"Feature\":{"; +// for (int j = 0; j < m_prds.size(); j++) { +// PRD prd = m_prds[j]; +// //System.out.println(prd.prdFeatureCode + "-" + prd.featureName); +// if (strstr(prd.featureName.c_str(), "") != NULL) { +// feature.append("\"").append(prd.prdFeatureCode).append("\":\"") +// .append(zt2_MaterialMark).append("\","); +// } +// else if (strstr(prd.featureName.c_str(), "") != NULL) { +// feature.append("\"").append(prd.prdFeatureCode).append("\":\"") +// .append(goodsName).append("\","); +// } +// else if (strstr(prd.featureName.c_str(), "ͺ") != NULL || strstr(prd.featureName.c_str(), "") != NULL) { +// feature.append("\"").append(prd.prdFeatureCode).append("\":\"") +// .append(spec).append("\","); +// } +// else if (strstr(prd.featureName.c_str(), "ͼ") != NULL) { +// feature.append("\"").append(prd.prdFeatureCode).append("\":\"") +// .append(bpNo).append("\","); +// } +// else if (strstr(prd.featureName.c_str(), "Ʒ") != NULL) { +// feature.append("\"").append(prd.prdFeatureCode).append("\":\"") +// .append(zt2_ProductModel).append("\","); +// } +// else { +// feature.append("\"").append(prd.prdFeatureCode).append("\":\"").append("\","); +// } +// } +// +// if (strcmp(zt2_SurfaceTreatment, "") != 0) { +// feature.append("\"").append("F067").append("\":\"").append(zt2_SurfaceTreatment).append("\""); +// } +// else { +// feature = feature.substr(0, feature.length() - 1); +// } +// //feature.substr(0, feature.length()); +// feature.append("},"); +// string data = json; +// data.append("\"Data\":[{"); +// data.append("\"PrhCode").append("\":\"").append(prhCode).append("\","); +// data.append("\"PmpcCode").append("\":\"").append(pmpcCode).append("\","); +// data.append("\"PmpcType").append("\":\"").append(pmpcType).append("\","); +// data.append("\"UnitCode").append("\":\"").append(unitCode).append("\","); +// data.append("\"CompanyCode").append("\":\"").append(companyCode).append("\","); +// data.append("\"UserCode").append("\":\"").append(user).append("\","); +// data.append("\"MP").append("\":\"").append(mp).append("\","); +// data.append(feature); +// data.append("\"ProductGroupCode").append("\":\"").append("\","); +// data.append("\"AssistUnitCode").append("\":\"").append("\","); +// data.append("\"UnitQty").append("\":\"").append("\","); +// data.append("\"AssistUnitQty").append("\":\"").append("\","); +// data.append("\"Desc").append("\":\"").append(desc).append("\""); +// data.append("}]}"); +// jsons.push_back(data); +// tag_t newItem, newRev, pitem; +// ITKCALL(ITEM_create_item(NULL, goodsName.c_str(), "Part", NULL, &newItem, &newRev)); +// AOM_lock(newItem); +// AOM_lock(newRev); +// ITKCALL(AOM_set_value_string(newRev, "zt2_Factory", groupId.c_str())); +// ITKCALL(AOM_set_value_string(newRev, "object_desc", spec.c_str())); +// ITKCALL(AOM_set_value_string(newRev, "zt2_ClassificationCode", "230101001")); +// char* zt2_unit, * newUid; +// ITK__convert_tag_to_uid(newRev, &newUid); +// ITEM_ask_item_of_rev(rev, &pitem); +// ITKCALL(AOM_ask_value_string(pitem, "zt2_unit", &zt2_unit)); +// ITKCALL(AOM_set_value_string(newItem, "zt2_unit", zt2_unit)); +// +// tag_t defGroup; +// ITKCALL(AOM_ask_value_tag(dcproxy, "default_group", &defGroup)); +// ITKCALL(AOM_set_ownership(newItem, dcproxy, defGroup)); +// ITKCALL(AOM_set_ownership(newRev, dcproxy, defGroup)); +// AOM_save(newRev); +// AOM_unlock(newRev); +// AOM_save(newItem); +// AOM_unlock(newItem); +// char selectGyId[400]; +// sprintf(selectGyId, insertSql.c_str(), projn, newUid, pmpcCode.c_str(), "", goodsName.c_str(), "ST", companyCode.c_str(), +// bpNo.c_str(), spec.c_str(), "", "", user_id, now.c_str(), "", ""); +// ExecuteSQLNoInputParam(selectGyId); +// return newRev; +// /*uid = ""; +// Object params[] = new Object[15]; +// params[0] = code; +// params[1] = uid; +// params[2] = pmpcCode; +// params[3] = goodsCode; +// params[4] = goodsName; +// params[5] = unitCode; +// params[6] = companyCode; +// params[7] = bpNo; +// params[8] = spec; +// params[9] = teRe; +// params[10] = state; +// params[11] = user; +// params[12] = time; +// params[13] = condition; +// params[14] = "";*/ +//} +////AȦ +//void addToAmatnr(tag_t* c_line_tags, int c_line_count, int len, tag_t newPAmatnr) { +// +// tag_t mantr = newPAmatnr, ebom_window, bom_line; +// tag_t* bvr_list = NULL; +// int bvr_count; +// ITKCALL(ITEM_rev_list_bom_view_revs(mantr, &bvr_count, &bvr_list)); +// if (bvr_count == 0) { +// tag_t newView, newViewBvr, pitem; +// ITEM_ask_item_of_rev(mantr, &pitem); +// ITKCALL(PS_create_bom_view(NULL, NULL, NULL, pitem, &newView)); +// AOM_save(newView); +// ITKCALL(PS_create_bvr(newView, NULL, NULL, FALSE, mantr, &newViewBvr)); +// AOM_save(newViewBvr); +// AOM_save(mantr); +// } +// ITKCALL(BOM_create_window(&ebom_window)); +// ITKCALL(BOM_set_window_top_line(ebom_window, NULL, mantr, NULLTAG, &bom_line)); +// +// for (int i = 0; i < c_line_count; i++) { +// tag_t newChild; +// char* oldQty, * seqNo; +// ITKCALL(BOM_line_copy(bom_line, c_line_tags[i], NULLTAG, &newChild)); +// AOM_ask_value_string(c_line_tags[i], "bl_quantity", &oldQty); +// AOM_ask_value_string(c_line_tags[i], "bl_sequence_no", &seqNo); +// int blQty = atoi(oldQty); +// int num = blQty / len; +// string numNew = to_string(num); +// AOM_lock(newChild); +// AOM_set_value_string(newChild, "bl_quantity", numNew.c_str()); +// AOM_set_value_string(newChild, "bl_sequence_no", seqNo); +// AOM_save(newChild); +// AOM_unlock(newChild); +// } +// +// ITKCALL(BOM_save_window(ebom_window)); +// ITKCALL(BOM_close_window(ebom_window)); +//} +//char* G2U222(const char* gb2312) +//{ +// int len = MultiByteToWideChar(CP_ACP, 0, gb2312, -1, NULL, 0); +// wchar_t* wstr = new wchar_t[len + 1]; +// memset(wstr, 0, len + 1); +// MultiByteToWideChar(CP_ACP, 0, gb2312, -1, wstr, len); +// len = WideCharToMultiByte(CP_UTF8, 0, wstr, -1, NULL, 0, NULL, NULL); +// char* str = new char[len + 1]; +// memset(str, 0, len + 1); +// WideCharToMultiByte(CP_UTF8, 0, wstr, -1, str, len, NULL, NULL); +// if (wstr) delete[] wstr; +// return str; +//} +////childPmȦEϣP +//void replaceBom(EBomBean& childPm, map& map, int len, tag_t dcproxy,tag_t &topPrev) { +// +// vector parentBeans = childPm.parentBean; +// +// //P ŵϵļ +// saveAsCycle(childPm, map, topPrev); +// +// printf("saveAsCycle OVER \n"); +// tag_t owning_group, owning_user; +// char* grpId, * user_id; +// int num = 0; +// tag_t* mantrs, designRev; +// string errBuff; +// ITKCALL(AOM_ask_value_tags(childPm.eRev, "TC_Is_Represented_By", &num, &mantrs)); +// if (num > 0) { +// tag_t tzRev = mantrs[0]; +// ITKCALL(AOM_ask_value_tag(tzRev, "owning_user", &owning_user)); +// ITKCALL(AOM_ask_value_tag(tzRev, "owning_group", &owning_group)); +// ITKCALL(AOM_ask_value_string(owning_group, "name", &grpId)); +// ITKCALL(AOM_ask_value_string(owning_user, "user_id", &user_id)); +// vector specs; +// getSpecs(tzRev, specs); +// printf("ȡ \n"); +// time_t now; +// struct tm* p; +// time(&now); +// p = localtime(&now); +// char buffer[80]; +// sprintf_s(buffer, "%04d%02d%02d %02d:%02d:%02d", 1900 + p->tm_year, p->tm_mon + 1, p->tm_mday, p->tm_hour, p->tm_min, p->tm_sec); +// string now1 = buffer; +// vector jsons; +// char* names[5] = { "A","B","C","D","E" }; +// char* idss[5] = { "A","B","C","D","E" }; +// tag_t axqPmatnr = childPm.pRev[0]; //ȦP +// +// int bvr_count = 0, c_line_count; +// tag_t ebom_window = NULLTAG; +// tag_t bom_line = NULLTAG, * c_line_tags; +// tag_t* bvr_list = NULL; +// (ITEM_rev_list_bom_view_revs(axqPmatnr, &bvr_count, &bvr_list)); +// printf("bvr_count=%d\n", bvr_count); +// +// if (bvr_count == 0) { +// tag_t newView, newViewBvr, pitem; +// ITEM_ask_item_of_rev(axqPmatnr, &pitem); +// ITKCALL(PS_create_bom_view(NULL, NULL, NULL, pitem, &newView)); +// AOM_save(newView); +// ITKCALL(PS_create_bvr(newView, NULL, NULL, FALSE, axqPmatnr, &newViewBvr)); +// AOM_save(newViewBvr); +// AOM_save(axqPmatnr); +// tag_t dsuser, * structure_revisions, * bom_view_tags; +// AOM_ask_value_tag(tzRev, "owning_user", &dsuser); +// tag_t defGroup; +// ITKCALL(AOM_ask_value_tag(dsuser, "default_group", &defGroup)); +// ITKCALL(AOM_set_ownership(newView, dsuser, defGroup)); +// ITKCALL(AOM_set_ownership(newViewBvr, dsuser, defGroup)); +// //return; +// (ITEM_rev_list_bom_view_revs(axqPmatnr, &bvr_count, &bvr_list)); +// } +// (BOM_create_window(&ebom_window)); +// (BOM_set_window_top_line_bvr(ebom_window, bvr_list[0], &bom_line)); //bomȡ +// //ITKCALL(AOM_ask_value_tag(bom_line, "bl_line_object", &mantr)); +// ITKCALL(BOM_line_ask_all_child_lines(bom_line, &c_line_count, &c_line_tags)); +// printf("int===>%d\n", len); +// vector newPAmatnrs; +// for (int i = 0; i < len; i++) { +// //A +// printf("names[i]===>%s\n", names[i]); +// tag_t newPAmatnr = send1(tzRev, now1, user_id, jsons, grpId, specs[0], names[i], idss[i], dcproxy); +// newPAmatnrs.push_back(newPAmatnr); +// addToAmatnr(c_line_tags, c_line_count, len, newPAmatnr); +// //ITKCALL(BOM_line_add(bom_line, NULLTAG, newPAmatnr, NULLTAG, &bomLineAdd)); +// } +// for (int i = 0; i < c_line_count; i++) { +// ITKCALL(BOM_line_cut(c_line_tags[i])); +// } +// for (int t = 0; t < newPAmatnrs.size(); t++) { +// tag_t bomLineAdd; +// ITKCALL(BOM_line_add(bom_line, NULLTAG, newPAmatnrs[t], NULLTAG, &bomLineAdd)); +// } +// //ITKCALL(AOM_save(bom_line)); +// ITKCALL(BOM_save_window(ebom_window)); +// ITKCALL(BOM_close_window(ebom_window)); +// for (int i = 0; i < jsons.size(); i++) { +// printf("jsons ===> %s \n", jsons[i].c_str()); +// string url = "http://10.128.20.35:9002/Post/PLM_Goods"; +// string jsonUf = G2U222(jsons[i].c_str()); +// //string msg = callHttpserver(jsonUf, url); +// } +// } +//} +////ȡ жǷ +//int getClassVal2(tag_t topItem, string& errMessage) { +// tag_t top_classificationObject; +// ICS_ask_classification_object(topItem, &top_classificationObject); +// if (top_classificationObject == NULL_TAG) +// { +// errMessage.append("ûз͵\n"); +// return 0; +// } +// char* top_class_id = NULL, * top_class_name = NULL; +// //ICS_ask_class_of_classification_obj(top_classificationObject, &top_class_tag); +// //ICS_ask_id_name(top_class_tag, &top_class_id, &top_class_name); +// printf("BOM TOP LINE CLASS ID = %s | NAME = %s \n", top_class_id, top_class_name); +// int n_attrs; +// char** attr_names; +// char** attr_vals; +// ITKCALL(ICS_ask_attributes_of_classification_obj(top_classificationObject, &n_attrs, &attr_names, &attr_vals)); +// cout << n_attrs << endl; +// int num = 1; +// for (int ii = 0; ii < n_attrs; ii++) +// { +// printf("attr_names[ii]==>%sTTT\n", attr_names[ii]); +// printf("attr_vals[ii]==>%sTTT\n", attr_vals[ii]); +// if (strcmp(attr_names[ii], "") == 0) { +// if (strcmp(attr_vals[ii], "") == 0) { +// errMessage.append("Ϊգ顣\n"); +// return 0; +// } +// else { +// printf("111[ii]==TTT\n"); +// if (strstr(attr_vals[ii], "3") != NULL) { +// num = 3; +// } +// else if (strstr(attr_vals[ii], "1") != NULL) { +// num = 1; +// } +// else if (strstr(attr_vals[ii], "5") != NULL) { +// num = 5; +// } +// //num = atoi(attr_vals[ii]); +// } +// break; +// } +// } +// return num; +//} +//void recyReadEBom(tag_t pLine, EBomBean parentBean, vector& beans, int len, tag_t pErev, string& errBuff) { +// +// int c_line_count, cnt2, numFac, cnt3; +// tag_t* c_line_tags; +// ITKCALL(BOM_line_ask_all_child_lines(pLine, &c_line_count, &c_line_tags)); +// char* sffc, * name, * pRevId, ** sealeds, ** factorys, ** procureType; +// ITKCALL(AOM_ask_value_string(pErev, "item_id", &pRevId)); +// ITKCALL(AOM_ask_value_string(pErev, "object_name", &name)); +// ITKCALL(AOM_ask_value_string(pErev, "zt2_State", &sffc)); +// if (strcmp(sffc, "D1") == 0 || strcmp(sffc, "") == 0) { +// errBuff.append(":").append(pRevId).append("/").append(name).append("ѷ޷תPBOM.\n"); +// //return; +// } +// AOM_ask_value_strings(pErev, "zt2_SZProcuretype", &cnt3, &procureType); // +// AOM_ask_value_strings(pErev, "zt2_SZSealedornot", &cnt2, &sealeds); +// AOM_ask_value_strings(pErev, "zt2_SZFactory", &numFac, &factorys); +// for (int i = 0; i < numFac; i++) { +// if (strcmp(factorys[i], "M060") == 0 && cnt2 > i) { +// if (strcmp(sealeds[i], "Y") == 0) { +// errBuff.append(":").append(pRevId).append("/").append(name).append("ѷ޷תPBOM.\n"); +// //return; +// } +// if (cnt3 > i && strcmp(procureType[i], "/") == 0) { +// errBuff.append(":").append(pRevId).append("/").append(name).append("ϲ޷תPBOM.\n"); +// } +// } +// } +// printf("c_line_count%d===>\n", c_line_count); +// for (int i = 0; i < c_line_count; i++) { +// +// tag_t c_line_tag = c_line_tags[i], eRev; +// ITKCALL(AOM_ask_value_tag(c_line_tag, "bl_line_object", &eRev)); +// EBomBean cBean; +// cBean.eRev = eRev; +// cBean.eBomline = c_line_tag; +// cBean.parentBean.push_back(parentBean); +// //ȡͼֽ +// //жʽͨ ӵbeans +// int num = 0; +// tag_t* mantrs; +// ITKCALL(AOM_ask_value_tags(eRev, "TC_Is_Represented_By", &num, &mantrs)); +// if (num == 1) { +// char* id; +// AOM_ask_value_string(mantrs[0], "item_id", &id); +// string item_id = id; +// smatch result; +// bool ret = regex_match(item_id, result, qq_reg); +// if (ret) { +// char* zt2_ifpbom; +// AOM_ask_value_string(eRev, "zt2_ifpbom", &zt2_ifpbom); +// if (zt2_ifpbom != NULL && strcmp(zt2_ifpbom, "P") == 0) { +// continue; +// } +// int cc_cnt; +// tag_t* cc_lines; +// BOM_line_ask_all_child_lines(c_line_tag, &cc_cnt, &cc_lines); +// printf("cc_cnt===> %d item_id ==> %s \n", cc_cnt, id); +// for (int tt = 0; tt < cc_cnt; tt++) { +// tag_t cc_line = cc_lines[tt], c_eRev; +// char* bl_quantity, * pId, * c_pId; +// AOM_ask_value_string(eRev, "item_id", &pId); +// AOM_ask_value_string(cc_line, "bl_quantity", &bl_quantity); +// ITKCALL(AOM_ask_value_tag(cc_line, "bl_line_object", &c_eRev)); +// AOM_ask_value_string(c_eRev, "item_id", &c_pId); +// printf("c_pId===> %s bl_quantity ==> %s len==> %d \n", c_pId, bl_quantity, len); +// if (strcmp("bl_quantity", "") == 0) { +// errBuff.append("P:").append(pId).append("Ӽ").append(c_pId) +// .append("޷顣").append("\n"); +// } +// else { +// int blQty = atoi(bl_quantity); +// if (blQty % len != 0) { +// errBuff.append("P:").append(pId).append("Ӽ").append(c_pId) +// .append("޷顣").append("\n"); +// } +// else { +// newCBean aBean; +// aBean.num = blQty / len; +// aBean.cLine = cc_line; +// cBean.c_lines.push_back(aBean); +// } +// } +// } +// beans.push_back(cBean); +// continue; +// } +// } +// recyReadEBom(c_line_tag, cBean, beans, len, eRev, errBuff); +// //жӼǷ Ȧ +// } +// +//} +//tag_t findDcUser() { +// tag_t* tags; +// tag_t query = NULLTAG; +// //ѯзϵϱ +// ITKCALL(QRY_find2("__WEB_find_user", &query)); +// if (query == NULLTAG) { +// cout << "ûҵǰѯ" << endl; +// } +// int cnt; +// char** qry_entries1, ** qry_values2; +// QRY_find_user_entries(query, &cnt, &qry_entries1, &qry_values2); +// char* qry_values[1] = { "dcproxy" }; +// int n_found; +// ITKCALL(QRY_execute(query, 1, qry_entries1, qry_values, &n_found, &tags)); +// if (n_found == 0) { +// return NULLTAG; +// } +// else { +// return tags[0]; +// } +//} +// +//class E2PBean //class ͷ +//{ +//public: +// string key;//wbs+Ϻɵıʶ +// tag_t pMantr; // p 棬û£ȡ°汾 (PƳ) +// string revId = ""; +// tag_t eMantr; // e +//public: +// //Ա +// void isSameKey(string newKey) +// { +// if (key.compare(newKey) == 0) { +// //һ +// } +// } +// +//}; +//struct EBomUpBean +//{ +// string matnrNo; +// tag_t bomline; +// vector parentBean; //EBOMʱĸ +// vector c_lines; //EBOMеӼ ֻȦ +//}; +////EBOM EBOM +//void updatePbomCycle(tag_t eLine,string &errBuff,int len, EBomUpBean &upBean) { +// int c_line_count; +// tag_t *c_line_tags; +// ITKCALL(BOM_line_ask_all_child_lines(eLine, &c_line_count, &c_line_tags)); +// //printf("upBean===>%s\n", upBean.matnrNo.c_str()); +// for (int i = 0; i < c_line_count; i++) { +// char* ifpBom,*matnrNo; +// tag_t c_line_tag = c_line_tags[i], eRev; +// ITKCALL(AOM_ask_value_tag(c_line_tag, "bl_line_object", &eRev)); +// AOM_ask_value_string(eRev, "zt2_ifpbom", &ifpBom); +// AOM_ask_value_string(eRev, "zt2_MaterialNo", &matnrNo); +// +// EBomUpBean cBean; +// cBean.matnrNo = matnrNo; +// //printf("CChild===>%s\n", matnrNo); +// cBean.bomline = c_line_tag; +// int num = 0; +// tag_t* mantrs; +// ITKCALL(AOM_ask_value_tags(eRev, "TC_Is_Represented_By", &num, &mantrs)); +// if (num == 1) { +// char* id; +// AOM_ask_value_string(mantrs[0], "item_id", &id); +// string item_id = id; +// smatch result; +// bool ret = regex_match(item_id, result, qq_reg); +// if (ret) { +// char* zt2_ifpbom; +// AOM_ask_value_string(eRev, "zt2_ifpbom", &zt2_ifpbom); +// if (zt2_ifpbom != NULL && strcmp(zt2_ifpbom, "P") == 0) { +// continue; +// } +// int cc_cnt; +// tag_t* cc_lines; +// BOM_line_ask_all_child_lines(c_line_tag, &cc_cnt, &cc_lines); +// printf("cc_cnt===> %d item_id ==> %s \n", cc_cnt, id); +// for (int tt = 0; tt < cc_cnt; tt++) { +// tag_t cc_line = cc_lines[tt], c_eRev; +// char* bl_quantity, * pId, * c_pId; +// AOM_ask_value_string(eRev, "item_id", &pId); +// AOM_ask_value_string(cc_line, "bl_quantity", &bl_quantity); +// ITKCALL(AOM_ask_value_tag(cc_line, "bl_line_object", &c_eRev)); +// AOM_ask_value_string(c_eRev, "item_id", &c_pId); +// printf("c_pId===> %s bl_quantity ==> %s len==> %d \n", c_pId, bl_quantity, len); +// if (strcmp("bl_quantity", "") == 0) { +// errBuff.append("P:").append(pId).append("Ӽ").append(c_pId) +// .append("޷顣").append("\n"); +// } +// else { +// int blQty = atoi(bl_quantity); +// if (blQty % len != 0) { +// errBuff.append("P:").append(pId).append("Ӽ").append(c_pId) +// .append("޷顣").append("\n"); +// } +// else { +// newCBean aBean; +// aBean.num = blQty / len; +// aBean.cLine = cc_line; +// cBean.c_lines.push_back(aBean); +// } +// } +// } +// //beans.push_back(cBean); +// //continue; +// } +// } +// updatePbomCycle(c_line_tag, errBuff, len, cBean); +// upBean.parentBean.push_back(cBean); +// } +//} +//boolean checkName(char* name) { +// +// if (strstr(name, "A") != NULL || strstr(name, "B") != NULL || strstr(name, "C") != NULL +// || strstr(name, "E") != NULL || strstr(name, "D") != NULL ) { +// return true; +// } +// else { +// return false; +// } +// +//} +//tag_t saveAsUpdate(tag_t eRev, char *uid,tag_t pLine) { +// char* newid = NULL; +// logical isModified = FALSE; +// tag_t item_type_tag, newItem, newRev; +// TCTYPE_ask_type("Item", &item_type_tag); +// ITKCALL(USER_new_item_id(NULLTAG, item_type_tag, &isModified, &newid)); +// /*ITKCALL(NR_next_value("MEProcess", "item_id", NULLTAG, "", "", "", +// NULLTAG, "", "", &next_id));*/ +// printf("next_id==>%s\n", newid); +// ITKCALL(ITEM_copy_item(eRev, newid, NULL, &newItem, &newRev)); +// //ITKCALL(AOM_set_value_string(newRev, "zt2_PMaterial", "PBOM")); +// char* matnrNo; +// AOM_ask_value_string(eRev, "zt2_MaterialNo", &matnrNo); +// AOM_lock(newRev); +// +// AOM_set_value_string(newRev, "zt2_ifpbom", "P"); +// AOM_set_value_string(newRev, "zt2_MaterialNo", matnrNo); +// AOM_save(newRev); +// AOM_unlock(newRev); +// +// int num = 0, revNum = 0, tagNum = 0; +// tag_t* mantrs, dsuser, * structure_revisions, * bom_view_tags; +// AOM_ask_value_tags(eRev, "TC_Is_Represented_By", &num, &mantrs); +// if (num > 0) { +// AOM_ask_value_tags(newRev, "structure_revisions", &revNum, &structure_revisions); +// AOM_ask_value_tags(newRev, "bom_view_tags", &tagNum, &bom_view_tags); +// AOM_ask_value_tag(mantrs[0], "owning_user", &dsuser); +// tag_t defGroup; +// ITKCALL(AOM_ask_value_tag(dsuser, "default_group", &defGroup)); +// ITKCALL(AOM_set_ownership(newItem, dsuser, defGroup)); +// ITKCALL(AOM_set_ownership(newRev, dsuser, defGroup)); +// if (revNum > 0) { +// ITKCALL(AOM_set_ownership(structure_revisions[0], dsuser, defGroup)); +// } +// if (tagNum > 0) { +// ITKCALL(AOM_set_ownership(bom_view_tags[0], dsuser, defGroup)); +// } +// } +// { +// //ITKCALL(BOM_line_replace(newChild, NULLTAG, newRev, NULLTAG)); +// int bvr_count = 0, c_line_count; +// tag_t ebom_window = NULLTAG; +// tag_t bom_line = NULLTAG, * c_line_tags; +// (BOM_create_window(&ebom_window)); +// tag_t* bvr_list = NULL; +// (ITEM_rev_list_bom_view_revs(pLine, &bvr_count, &bvr_list)); +// printf("bvr_count=%d\n", bvr_count); +// +// (BOM_set_window_top_line_bvr(ebom_window, bvr_list[0], &bom_line)); //bomȡ +// //ITKCALL(AOM_ask_value_tag(bom_line, "bl_line_object", &mantr)); +// ITKCALL(BOM_line_ask_all_child_lines(bom_line, &c_line_count, &c_line_tags)); +// +// for (int ind = 0; ind < c_line_count; ind++) { +// tag_t c_line_tag = c_line_tags[ind], mantr; +// AOM_ask_value_tag(c_line_tag, "bl_line_object", &mantr); +// char* eRevUid2; +// ITK__convert_tag_to_uid(mantr, &eRevUid2); +// if (strcmp(eRevUid2, uid) == 0) { +// ITKCALL(BOM_line_replace(c_line_tag, NULLTAG, newRev, NULLTAG)); +// } +// } +// BOM_save_window(ebom_window); +// BOM_close_window(ebom_window); +// } +// return newRev; +//} +//tag_t saveAsUpdate(tag_t eRev,tag_t newChild) { +// char* newid = NULL; +// logical isModified = FALSE; +// tag_t item_type_tag, newItem, newRev; +// TCTYPE_ask_type("Item", &item_type_tag); +// ITKCALL(USER_new_item_id(NULLTAG, item_type_tag, &isModified, &newid)); +// /*ITKCALL(NR_next_value("MEProcess", "item_id", NULLTAG, "", "", "", +// NULLTAG, "", "", &next_id));*/ +// printf("next_id==>%s\n", newid); +// ITKCALL(ITEM_copy_item(eRev, newid, NULL, &newItem, &newRev)); +// //ITKCALL(AOM_set_value_string(newRev, "zt2_PMaterial", "PBOM")); +// char* matnrNo; +// AOM_ask_value_string(eRev, "zt2_MaterialNo", &matnrNo); +// AOM_lock(newRev); +// +// AOM_set_value_string(newRev, "zt2_ifpbom", "P"); +// AOM_set_value_string(newRev, "zt2_MaterialNo", matnrNo); +// AOM_save(newRev); +// AOM_unlock(newRev); +// +// int num = 0, revNum = 0, tagNum = 0; +// tag_t* mantrs, dsuser, * structure_revisions, * bom_view_tags; +// AOM_ask_value_tags(eRev, "TC_Is_Represented_By", &num, &mantrs); +// if (num > 0) { +// AOM_ask_value_tags(newRev, "structure_revisions", &revNum, &structure_revisions); +// AOM_ask_value_tags(newRev, "bom_view_tags", &tagNum, &bom_view_tags); +// AOM_ask_value_tag(mantrs[0], "owning_user", &dsuser); +// tag_t defGroup; +// ITKCALL(AOM_ask_value_tag(dsuser, "default_group", &defGroup)); +// ITKCALL(AOM_set_ownership(newItem, dsuser, defGroup)); +// ITKCALL(AOM_set_ownership(newRev, dsuser, defGroup)); +// if (revNum > 0) { +// ITKCALL(AOM_set_ownership(structure_revisions[0], dsuser, defGroup)); +// } +// if (tagNum > 0) { +// ITKCALL(AOM_set_ownership(bom_view_tags[0], dsuser, defGroup)); +// } +// } +// { +// ITKCALL(BOM_line_replace(newChild, NULLTAG, newRev, NULLTAG)); +// //int bvr_count = 0, c_line_count; +// //tag_t ebom_window = NULLTAG; +// //tag_t bom_line = NULLTAG, * c_line_tags; +// //(BOM_create_window(&ebom_window)); +// //tag_t* bvr_list = NULL; +// //(ITEM_rev_list_bom_view_revs(pRevs[0], &bvr_count, &bvr_list)); +// //printf("bvr_count=%d\n", bvr_count); +// +// //(BOM_set_window_top_line_bvr(ebom_window, bvr_list[0], &bom_line)); //bomȡ +// ////ITKCALL(AOM_ask_value_tag(bom_line, "bl_line_object", &mantr)); +// //ITKCALL(BOM_line_ask_all_child_lines(bom_line, &c_line_count, &c_line_tags)); +// +// //for (int ind = 0; ind < c_line_count; ind++) { +// // tag_t c_line_tag = c_line_tags[ind], mantr; +// // AOM_ask_value_tag(c_line_tag, "bl_line_object", &mantr); +// // char* eRevUid2; +// // ITK__convert_tag_to_uid(mantr, &eRevUid2); +// // if (strcmp(eRevUid2, eRevUid) == 0) { +// // if (childPm.pRev.size() > 0) { +// // printf("eRevUid===>%s\n", eRevUid); +// // ITKCALL(BOM_line_replace(c_line_tag, NULLTAG, childPm.pRev[0], NULLTAG)); +// // } +// // } +// //} +// //BOM_save_window(ebom_window); +// //BOM_close_window(ebom_window); +// } +// return newRev; +//} +// +//void createAXxq(tag_t eRev,tag_t pRev,int len, tag_t dcproxy) { +// tag_t owning_group, owning_user; +// char* grpId, * user_id; +// int num = 0; +// tag_t* mantrs, designRev; +// string errBuff; +// ITKCALL(AOM_ask_value_tags(eRev, "TC_Is_Represented_By", &num, &mantrs)); +// if (num > 0) { +// tag_t tzRev = mantrs[0]; +// ITKCALL(AOM_ask_value_tag(tzRev, "owning_user", &owning_user)); +// ITKCALL(AOM_ask_value_tag(tzRev, "owning_group", &owning_group)); +// ITKCALL(AOM_ask_value_string(owning_group, "name", &grpId)); +// ITKCALL(AOM_ask_value_string(owning_user, "user_id", &user_id)); +// vector specs; +// getSpecs(tzRev, specs); +// printf("ȡ \n"); +// time_t now; +// struct tm* p; +// time(&now); +// p = localtime(&now); +// char buffer[80]; +// sprintf_s(buffer, "%04d%02d%02d %02d:%02d:%02d", 1900 + p->tm_year, p->tm_mon + 1, p->tm_mday, p->tm_hour, p->tm_min, p->tm_sec); +// string now1 = buffer; +// vector jsons; +// char* names[5] = { "A","B","C","D","E" }; +// char* idss[5] = { "A","B","C","D","E" }; +// tag_t axqPmatnr = pRev; //ȦP +// +// int bvr_count = 0, c_line_count; +// tag_t ebom_window = NULLTAG; +// tag_t bom_line = NULLTAG, * c_line_tags; +// tag_t* bvr_list = NULL; +// (ITEM_rev_list_bom_view_revs(axqPmatnr, &bvr_count, &bvr_list)); +// printf("bvr_count=%d\n", bvr_count); +// +// if (bvr_count == 0) { +// tag_t newView, newViewBvr, pitem; +// ITEM_ask_item_of_rev(axqPmatnr, &pitem); +// ITKCALL(PS_create_bom_view(NULL, NULL, NULL, pitem, &newView)); +// AOM_save(newView); +// ITKCALL(PS_create_bvr(newView, NULL, NULL, FALSE, axqPmatnr, &newViewBvr)); +// AOM_save(newViewBvr); +// AOM_save(axqPmatnr); +// //return; +// tag_t dsuser, * structure_revisions, * bom_view_tags; +// AOM_ask_value_tag(tzRev, "owning_user", &dsuser); +// tag_t defGroup; +// ITKCALL(AOM_ask_value_tag(dsuser, "default_group", &defGroup)); +// ITKCALL(AOM_set_ownership(newView, dsuser, defGroup)); +// ITKCALL(AOM_set_ownership(newViewBvr, dsuser, defGroup)); +// (ITEM_rev_list_bom_view_revs(axqPmatnr, &bvr_count, &bvr_list)); +// } +// (BOM_create_window(&ebom_window)); +// (BOM_set_window_top_line_bvr(ebom_window, bvr_list[0], &bom_line)); //bomȡ +// //ITKCALL(AOM_ask_value_tag(bom_line, "bl_line_object", &mantr)); +// ITKCALL(BOM_line_ask_all_child_lines(bom_line, &c_line_count, &c_line_tags)); +// printf("int===>%d\n", len); +// vector newPAmatnrs; +// for (int i = 0; i < len; i++) { +// //A +// printf("names[i]===>%s\n", names[i]); +// tag_t newPAmatnr = send1(tzRev, now1, user_id, jsons, grpId, specs[0], names[i], idss[i], dcproxy); +// newPAmatnrs.push_back(newPAmatnr); +// addToAmatnr(c_line_tags, c_line_count, len, newPAmatnr); +// //ITKCALL(BOM_line_add(bom_line, NULLTAG, newPAmatnr, NULLTAG, &bomLineAdd)); +// } +// for (int i = 0; i < c_line_count; i++) { +// ITKCALL(BOM_line_cut(c_line_tags[i])); +// } +// for (int t = 0; t < newPAmatnrs.size(); t++) { +// tag_t bomLineAdd; +// ITKCALL(BOM_line_add(bom_line, NULLTAG, newPAmatnrs[t], NULLTAG, &bomLineAdd)); +// } +// //ITKCALL(AOM_save(bom_line)); +// ITKCALL(BOM_save_window(ebom_window)); +// ITKCALL(BOM_close_window(ebom_window)); +// for (int i = 0; i < jsons.size(); i++) { +// printf("jsons ===> %s \n", jsons[i].c_str()); +// string url = "http://10.128.20.35:9002/Post/PLM_Goods"; +// string jsonUf = G2U222(jsons[i].c_str()); +// //string msg = callHttpserver(jsonUf, url); +// } +// } +//} +// +//void startUpdate(EBomUpBean upBean,tag_t bom_line,int len,tag_t dcproxy) { +// vector vecs = upBean.parentBean; +// int c_line_count = 0; +// tag_t* c_line_tags; +// vector matnrVec; +// map pBomMap; +// ITKCALL(BOM_line_ask_all_child_lines(bom_line, &c_line_count, &c_line_tags)); +// for (int i = 0; i < c_line_count; i++) { +// char* ifpBom, * matnrNo,* name; +// tag_t c_line_tag = c_line_tags[i], eRev; +// ITKCALL(AOM_ask_value_tag(c_line_tag, "bl_line_object", &eRev)); +// AOM_ask_value_string(eRev, "zt2_ifpbom", &ifpBom); +// AOM_ask_value_string(eRev, "zt2_MaterialNo", &matnrNo); +// AOM_ask_value_string(eRev, "object_name", &name); +// printf("zt2_MaterialNo ===>%s ifpBom==>%s\n", matnrNo, ifpBom); +// if (strcmp(ifpBom, "P") == 0) { +// matnrVec.push_back(matnrNo); +// pBomMap[matnrNo] = c_line_tag; +// //BOM_line_cut(c_line_tag); +// } +// else if(!checkName(name)){ +// BOM_line_cut(c_line_tag);//pBomMap[matnrNo] = c_line_tag; +// } +// } +// //ƳзP ٴEBOM +// printf("vecs===>%d\n", vecs.size()); +// for (int i = 0; i < vecs.size(); i++) { +// EBomUpBean cupBean = vecs[i]; +// +// if (std::find(matnrVec.begin(), matnrVec.end(), cupBean.matnrNo) != matnrVec.end()) { +// tag_t c_line_tag = pBomMap[cupBean.matnrNo]; +// tag_t c_Rev,bomView=NULLTAG; +// ITKCALL(AOM_ask_value_tag(c_line_tag, "bl_line_object", &c_Rev)); +// boolean flagAs = false; +// { +// int structs = 0, statusNum = 0; +// tag_t* structure_revisions, * release_status_list; +// AOM_ask_value_tags(c_Rev, "structure_revisions", &structs, &structure_revisions); +// if (structs > 0) { +// AOM_ask_value_tags(structure_revisions[0], "release_status_list", &statusNum, &release_status_list); +// if (statusNum > 0) { +// tag_t* mantrsAs, dsuser, pBomTop,* bvr_list; +// int revNum=0, num=0, bvr_count=0; +// ITEM_copy_rev(c_Rev, NULL, &pBomTop); +// flagAs = true; +// AOM_ask_value_tags(c_Rev, "TC_Is_Represented_By", &num, &mantrsAs); +// AOM_ask_value_tag(mantrsAs[0], "owning_user", &dsuser); +// tag_t defGroup; +// ITKCALL(AOM_ask_value_tag(dsuser, "default_group", &defGroup)); +// ITKCALL(AOM_set_ownership(pBomTop, dsuser, defGroup)); +// if (num > 0) { +// AOM_ask_value_tags(pBomTop, "structure_revisions", &revNum, &structure_revisions); +// if (revNum > 0) { +// ITKCALL(AOM_set_ownership(structure_revisions[0], dsuser, defGroup)); +// } +// } +// (BOM_create_window(&bomView)); +// (ITEM_rev_list_bom_view_revs(pBomTop, &bvr_count, &bvr_list)); +// printf("bvr_count=%d \n", bvr_count); +// if (bvr_count == 0) { +// //errBuff.append("EBOM\n"); +// } +// ITKCALL(BOM_set_window_top_line_bvr(bomView, bvr_list[0], &c_line_tag)); //bomȡ +// } +// } +// } +// printf("matnrVec ===>%s\n", cupBean.matnrNo.c_str()); +// startUpdate(cupBean, c_line_tag,len, dcproxy); +// if (bomView!=NULLTAG&& flagAs) { +// BOM_save_window(bomView); +// BOM_close_window(bomView); +// } +// } +// else{ +// boolean flagLc = false; +// char* seq; +// printf("matnrVecNotP===>%s\n", cupBean.matnrNo.c_str()); +// tag_t cline = cupBean.bomline; +// tag_t newChild; +// ITKCALL(BOM_line_copy(bom_line, cline, NULLTAG, &newChild)); +// AOM_ask_value_string(cline, "bl_sequence_no", &seq); +// AOM_lock(newChild); +// AOM_set_value_string(newChild, "bl_sequence_no", seq); +// AOM_save(newChild); +// AOM_unlock(newChild); +// tag_t c_Rev; +// ITKCALL(AOM_ask_value_tag(cline, "bl_line_object", &c_Rev)); +// +// vector ccBeans = cupBean.parentBean; +// //Ȧװ +// for (int j = 0; j < ccBeans.size(); j++) { +// EBomUpBean ccBean = ccBeans[j]; +// if (ccBean.c_lines.size() > 0) { +// //Ҫ +// char* uid; +// tag_t cc_Rev; +// tag_t newPrev = saveAsUpdate(c_Rev, newChild); +// ITKCALL(AOM_ask_value_tag(ccBean.bomline, "bl_line_object", &cc_Rev)); +// ITK__convert_tag_to_uid(cc_Rev, &uid); +// tag_t cc_PRev = saveAsUpdate(cc_Rev, uid, newPrev); +// createAXxq(cc_Rev, cc_PRev, len, dcproxy); +// } +// } +// +// } +// } +//} +//void copyBomLine(tag_t matnrTop,tag_t otherPbom) { +// tag_t ebom_window, ebom_window2, *bvr_list, * bvr_list2, bom_line, bom_line2,* c_line_tags,* c_line_tags2; +// int bvr_count = 0, bvr_count2=0, c_line_count, c_line_count2; +// (BOM_create_window(&ebom_window)); +// (ITEM_rev_list_bom_view_revs(matnrTop, &bvr_count, &bvr_list)); +// printf("bvr_count=%d \n", bvr_count); +// if (bvr_count == 0) { +// //errBuff.append("EBOM\n"); +// } +// ITKCALL(BOM_set_window_top_line_bvr(ebom_window, bvr_list[0], &bom_line)); //bomȡ +// printf("bomȡ\n"); +// //ITKCALL(AOM_ask_value_tag(bom_line, "bl_line_object", &mantr)); +// ITKCALL(BOM_line_ask_all_child_lines(bom_line, &c_line_count, &c_line_tags)); +// +// +// (ITEM_rev_list_bom_view_revs(otherPbom, &bvr_count2, &bvr_list2)); +// if (bvr_count2 == 0) { +// tag_t newView, newViewBvr,pitem; +// ITEM_ask_item_of_rev(otherPbom, &pitem); +// ITKCALL(PS_create_bom_view(NULL, NULL, NULL, pitem, &newView)); +// AOM_save(newView); +// ITKCALL(PS_create_bvr(newView, NULL, NULL, FALSE, otherPbom, &newViewBvr)); +// AOM_save(newViewBvr); +// AOM_save(otherPbom); +// int num = 0; +// tag_t dsuser, * structure_revisions, * bom_view_tags,* mantrs; +// ITKCALL(AOM_ask_value_tags(otherPbom, "TC_Is_Represented_By", &num, &mantrs)); +// if (num == 1) { +// AOM_ask_value_tag(mantrs[0], "owning_user", &dsuser); +// tag_t defGroup; +// ITKCALL(AOM_ask_value_tag(dsuser, "default_group", &defGroup)); +// ITKCALL(AOM_set_ownership(newView, dsuser, defGroup)); +// ITKCALL(AOM_set_ownership(newViewBvr, dsuser, defGroup)); +// } +// //return; +// (ITEM_rev_list_bom_view_revs(otherPbom, &bvr_count2, &bvr_list2)); +// } +// (BOM_create_window(&ebom_window2)); +// (BOM_set_window_top_line_bvr(ebom_window2, bvr_list2[0], &bom_line2)); //bomȡ +// ITKCALL(BOM_line_ask_all_child_lines(bom_line2, &c_line_count2, &c_line_tags2)); +// for (int i = 0; i < c_line_count2; i++) { +// BOM_line_cut(c_line_tags2[i]); +// } +// for (int i = 0; i < c_line_count; i++) { +// tag_t newChild; +// ITKCALL(BOM_line_copy(bom_line2, c_line_tags[i], NULLTAG, &newChild)); +// } +// //tag_t newChild; +// //ITKCALL(BOM_line_copy(bom_line2, c_line_tags[i], NULLTAG, &newChild)); +// +// ITKCALL(BOM_save_window(ebom_window2)); +// BOM_close_window(ebom_window2); +// BOM_close_window(ebom_window); +//} +// +//void EbomToPMethod(char* revUid, string& errBuffer) { +// int ifail = ITK_ok; +// char* sql = NULL; +// tag_t matnrRev1; +// ITK__convert_uid_to_tag(revUid, &matnrRev1); +// +// if (open("PLMUser", "PLMUser", "BDP2020", "10.128.20.35")) { +// printf("SQLSERVERʧ\n"); +// } +// else { +// printf("SQLSERVERɹ\n"); +// } +// { +// char selectRecord[200], selectRecord1[200]; +// sprintf(selectRecord, Sql1.c_str(), m_code1.c_str()); +// printf("ִвѯ %s\n", selectRecord); +// int outputColumn = 0, outputValueCount = 0; +// char*** outputValue = NULL; +// ado_QuerySQLNoInputParam(selectRecord, &outputColumn, &outputValueCount, &outputValue); +// prds.clear(); +// string pmpcPrhCode, pmpcPType, pmpcMType; +// for (int j = 0; j < outputValueCount; j++) { +// pmpcPrhCode = outputValue[j][0]; +// pmpcPType = outputValue[j][1]; +// pmpcMType = outputValue[j][2]; +// pmpc.m_code = m_code1; +// pmpc.pmpcPrhCode = pmpcPrhCode; +// pmpc.pmpcPType = pmpcPType; +// pmpc.pmpcMType = pmpcMType; +// printf("pmpcMType====>%s\n", outputValue[j][2]); +// } +// sprintf(selectRecord1, Sql2.c_str(), pmpcPrhCode.c_str()); +// int outputColumn1 = 0, outputValueCount1 = 0; +// char*** outputValue1 = NULL; +// printf("ִвѯ %s\n", selectRecord1); +// ado_QuerySQLNoInputParam(selectRecord1, &outputColumn1, &outputValueCount1, &outputValue1); +// for (int j = 0; j < outputValueCount1; j++) { +// string prdFeatureCode = outputValue1[j][3]; +// string featureName = outputValue1[j][4]; +// PRD prd; +// prd.prdFeatureCode = prdFeatureCode; +// prd.featureName = featureName; +// prds.push_back(prd); +// } +// } +// close(); +// //design BOM ȡϢ +// int bvr_count = 0, c_line_count; +// tag_t ebom_window = NULLTAG; +// tag_t bom_line = NULLTAG; +// tag_t item_tag = NULLTAG, * c_line_tags; +// +// int num = 0, num2 = 0; +// tag_t* mantrs, designRev; +// string errBuff; +// ITKCALL(AOM_ask_value_tags(matnrRev1, "TC_Is_Represented_By", &num, &mantrs)); +// int len = 1; +// if (num == 1) { +// designRev = mantrs[0]; +// char* itemId; +// AOM_ask_value_string(designRev, "item_id", &itemId); +// vector vec2; +// Split(itemId, "-", vec2); +// string idTop = "1ZDB300000P"; +// if (vec2.size() > 0) { +// idTop = idTop.append("-").append(vec2[1]); +// } +// tag_t topItem, topDesginRev; +// ITEM_find_item(idTop.c_str(), &topItem); +// ITEM_ask_latest_rev(topItem, &topDesginRev); +// len = getClassVal2(topItem, errBuff); +// printf("len%d\n", len); +// if (len > 0) { +// boolean isUpdate = false; +// +// tag_t* bvr_list = NULL, * topMatnrs; +// ITKCALL(AOM_ask_value_tags(topDesginRev, "representation_for", &num2, &topMatnrs)); +// //tag_t matnrTop = NULLTAG; +// printf("num2===>%d\n", num2); +// map wlbmMap; +// for (int t = 0; t < num2; t++) { +// char* isPm, * zt2_MaterialNo, * zt2_WBSNo; +// AOM_ask_value_string(topMatnrs[t], "zt2_WBSNo", &zt2_WBSNo); +// AOM_ask_value_string(topMatnrs[t], "zt2_MaterialNo", &zt2_MaterialNo); +// AOM_ask_value_string(topMatnrs[t], "zt2_ifpbom", &isPm); +// string key = ""; +// key.append(zt2_WBSNo).append(zt2_MaterialNo); +// +// if (wlbmMap.count(key) > 0) { +// E2PBean &bean = wlbmMap[key]; +// if (strcmp(isPm,"P") == 0) { +// char* revId; +// AOM_ask_value_string(topMatnrs[t], "item_revision_id", &revId); +// if (strcmp(revId, bean.revId.c_str()) > 0) { +// bean.pMantr = topMatnrs[t]; +// bean.revId = revId; +// } +// } +// else { +// printf("1\n"); +// bean.eMantr = topMatnrs[t]; +// } +// } +// else { +// E2PBean bean; +// bean.key = key; +// if (strcmp(isPm, "P") == 0) { +// char* revId; +// AOM_ask_value_string(topMatnrs[t],"item_revision_id", &revId); +// bean.pMantr = topMatnrs[t]; +// bean.revId = revId; +// } +// else { +// printf("2\n"); +// bean.eMantr = topMatnrs[t]; +// } +// wlbmMap[key] = bean; +// } +// if (strcmp(isPm, "P") == 0) { +// isUpdate = true; +// } +// } +// POM_AM__set_application_bypass(true); +// tag_t dcproxy = findDcUser(); +// if(!isUpdate && wlbmMap.size()>0){ +// printf("wlbmMap.size()===>%d\n", wlbmMap.size()); +// map::iterator it; +// //ģƥ +// tag_t matnrTop = NULLTAG; +// string keyNum = ""; +// //һƾ +// for (it = wlbmMap.begin(); it != wlbmMap.end(); it++) { +// string s = it->first; +// keyNum = s; +// E2PBean tagBean = wlbmMap[s]; +// printf("tagBean.key.c_str()=%s \n", tagBean.key.c_str()); //tagBean.key.c_str() +// matnrTop = tagBean.eMantr; +// break; +// } +// char* uida; +// ITK__convert_tag_to_uid(matnrTop, &uida); +// printf("uida=%s \n", uida); +// //ֻE½߼ +// (BOM_create_window(&ebom_window)); +// (ITEM_rev_list_bom_view_revs(matnrTop, &bvr_count, &bvr_list)); +// printf("bvr_count=%d \n", bvr_count); +// if (bvr_count == 0) { +// errBuff.append("EBOM\n"); +// } +// ITKCALL(BOM_set_window_top_line_bvr(ebom_window, bvr_list[0], &bom_line)); //bomȡ +// printf("bomȡ\n"); +// EBomBean topBean; +// topBean.eRev = matnrTop; +// topBean.eBomline = bom_line; +// //EBOMȡP +// vector beans; +// recyReadEBom(bom_line, topBean, beans, len, matnrTop, errBuff); +// printf("read end %d\n", beans.size()); +// +// BOM_close_window(ebom_window); +// //BOM +// +// printf("buff %s==>\n", errBuff.c_str()); +// tag_t topPrev = NULLTAG; +// if (errBuff.empty()) { +// map map; +// +// int url_num = 0; +// char** url_vals = NULL; +// PREF_ask_char_values("database_tc", &url_num, &url_vals); +// string url = url_vals[0]; +// url.append("/").append(url_vals[2]); +// printf("url ==> %s \n", url.c_str()); +// if (ConnServer(url_vals[3], url_vals[4], (char*)url.c_str()) == -1) +// { +// printf("ʾ:мݱʧ\n"); +// ifail = 1; +// } +// for (int t = 0; t < beans.size(); t++) { +// replaceBom(beans[t], map, len, dcproxy, topPrev); +// } +// DisConnServer(); +// } +// {//ֱӸ +// map::iterator it2; +// for (it2 = wlbmMap.begin(); it2 != wlbmMap.end(); it2++) { +// string ss = it2->first; +// tag_t eMantr = wlbmMap[ss].eMantr; +// if (keyNum.compare(ss) == 0) { +// continue; +// } +// char* newid = NULL; +// logical isModified = FALSE; +// tag_t item_type_tag, newRev, newItem; +// TCTYPE_ask_type("Item", &item_type_tag); +// ITKCALL(USER_new_item_id(NULLTAG, item_type_tag, &isModified, &newid)); +// /*ITKCALL(NR_next_value("MEProcess", "item_id", NULLTAG, "", "", "", +// NULLTAG, "", "", &next_id));*/ +// printf("next_id==>%s\n", newid); +// ITKCALL(ITEM_copy_item(eMantr, newid, NULL, &newItem, &newRev)); +// //ITKCALL(AOM_set_value_string(newRev, "zt2_PMaterial", "PBOM")); +// char* matnrNo; +// AOM_ask_value_string(eMantr, "zt2_MaterialNo", &matnrNo); +// AOM_lock(newRev); +// AOM_set_value_string(newRev, "zt2_ifpbom", "P"); +// AOM_set_value_string(newRev, "zt2_MaterialNo", matnrNo); +// AOM_save(newRev); +// AOM_unlock(newRev); +// copyBomLine(topPrev, newRev); +// } +// } +// } +// else { +// //߼ Ebom PĺʹP +// tag_t matnrTop = NULLTAG; +// tag_t pBomTop = NULLTAG; +// map::iterator it; +// //һƾ +// string keyNum = ""; +// for (it = wlbmMap.begin(); it != wlbmMap.end(); it++) { +// string s = it->first; +// keyNum = s; +// //printf("newRev===>%s\n", tagBean.revId.c_str()); +// E2PBean tagBean = wlbmMap[s]; +// matnrTop = tagBean.eMantr; +// pBomTop = tagBean.pMantr; +// //жϰ汾ͼǷ񷢲ˣ +// int structs = 0, statusNum=0; +// tag_t *structure_revisions,* release_status_list; +// AOM_ask_value_tags(pBomTop, "structure_revisions", &structs, &structure_revisions); +// if (structs > 0) { +// AOM_ask_value_tags(structure_revisions[0], "release_status_list", &statusNum, &release_status_list); +// if (statusNum > 0) { +// tag_t *mantrsAs, dsuser; +// int revNum; +// ITEM_copy_rev(pBomTop, NULL, &pBomTop); +// AOM_ask_value_tags(matnrTop, "TC_Is_Represented_By", &num, &mantrsAs); +// AOM_ask_value_tag(mantrsAs[0], "owning_user", &dsuser); +// tag_t defGroup; +// ITKCALL(AOM_ask_value_tag(dsuser, "default_group", &defGroup)); +// ITKCALL(AOM_set_ownership(pBomTop, dsuser, defGroup)); +// if (num > 0) { +// AOM_ask_value_tags(pBomTop, "structure_revisions", &revNum, &structure_revisions); +// if (revNum > 0) { +// ITKCALL(AOM_set_ownership(structure_revisions[0], dsuser, defGroup)); +// } +// } +// +// } +// } +// break; +// } +// (BOM_create_window(&ebom_window)); +// (ITEM_rev_list_bom_view_revs(matnrTop, &bvr_count, &bvr_list)); +// printf("bvr_count=%d \n", bvr_count); +// if (bvr_count == 0) { +// errBuff.append("EBOM\n"); +// } +// ITKCALL(BOM_set_window_top_line_bvr(ebom_window, bvr_list[0], &bom_line)); //bomȡ +// printf("bomȡ\n"); +// EBomUpBean upBean; +// upBean.bomline = bom_line; +// updatePbomCycle(bom_line, errBuff,len, upBean); +// tag_t ebom_window2, * bvr_list2, bom_line2; +// int bvr_count2 = 0; +// char* revIdP; +// (BOM_create_window(&ebom_window2)); +// (ITEM_rev_list_bom_view_revs(pBomTop, &bvr_count2, &bvr_list2)); +// AOM_ask_value_string(pBomTop,"item_revision_id",&revIdP); +// printf("bvr_count=%d revIdP==>%s \n", bvr_count2, revIdP); +// if (bvr_count2 == 0) { +// errBuff.append("EBOM\n"); +// } +// ITKCALL(BOM_set_window_top_line_bvr(ebom_window2, bvr_list2[0], &bom_line2)); //bomȡ +// +// int url_num = 0; +// char** url_vals = NULL; +// PREF_ask_char_values("database_tc", &url_num, &url_vals); +// string url = url_vals[0]; +// url.append("/").append(url_vals[2]); +// printf("url ==> %s \n", url.c_str()); +// if (ConnServer(url_vals[3], url_vals[4], (char*)url.c_str()) == -1) +// { +// printf("ʾ:мݱʧ\n"); +// ifail = 1; +// } +// startUpdate(upBean, bom_line2, len, dcproxy); +// DisConnServer(); +// +// BOM_save_window(ebom_window2); +// BOM_close_window(ebom_window2); +// +// BOM_close_window(ebom_window); +// printf("keyNum===>%s\n", keyNum.c_str()); +// map::iterator it2; +// for (it2 = wlbmMap.begin(); it2 != wlbmMap.end(); it2++) { +// string ss = it2->first; +// E2PBean tagBean = wlbmMap[ss]; +// printf("ss===>%s\n", ss.c_str()); +// if (keyNum.compare(ss) == 0) { +// continue; +// } +// tag_t newRev = tagBean.pMantr; +// printf("newRev===>%s\n", tagBean.revId.c_str()); +// int structs = 0, statusNum = 0; +// tag_t* structure_revisions, * release_status_list; +// AOM_ask_value_tags(newRev, "structure_revisions", &structs, &structure_revisions); +// if (structs > 0) { +// AOM_ask_value_tags(structure_revisions[0], "release_status_list", &statusNum, &release_status_list); +// if (statusNum > 0) { +// int revNum = 0; +// tag_t *mantrsAs, dsuser; +// ITKCALL(ITEM_copy_rev(newRev, NULL, &newRev)); +// AOM_ask_value_tags(matnrTop, "TC_Is_Represented_By", &num, &mantrsAs); +// AOM_ask_value_tag(mantrs[0], "owning_user", &dsuser); +// tag_t defGroup; +// ITKCALL(AOM_ask_value_tag(dsuser, "default_group", &defGroup)); +// ITKCALL(AOM_set_ownership(newRev, dsuser, defGroup)); +// if (num > 0) { +// AOM_ask_value_tags(newRev, "structure_revisions", &revNum, &structure_revisions); +// if (revNum > 0) { +// ITKCALL(AOM_set_ownership(structure_revisions[0], dsuser, defGroup)); +// } +// } +// } +// } +// copyBomLine(pBomTop, newRev); +// } +// } +// +// POM_AM__set_application_bypass(false); +// } +// } +// string buff = errBuff; +// if (buff.empty()) { +// buff = "succ"; +// } +// printf("buff===>%s\n", buff.c_str()); +// /**((char**)returnValue) = (char*)MEM_alloc((strlen(buff.c_str()) + 1) * sizeof(char)); +// tc_strcpy(*((char**)returnValue), buff.c_str());*/ +// return; +//} \ No newline at end of file diff --git a/DFL_BOM_WL_TOERP/GetBOMProp.cpp b/DFL_BOM_WL_TOERP/GetBOMProp.cpp new file mode 100644 index 0000000..b1f0866 --- /dev/null +++ b/DFL_BOM_WL_TOERP/GetBOMProp.cpp @@ -0,0 +1,136 @@ +#include "dfl_custom.h" +#include +#include +#include +#include +#include +#include "ado.h" +#include +#include +#include "rapidjson/document.h" +#include +#include "rapidjson/writer.h" +#include +#include +#include +#include +#include +#include +#include "CRUL_server_call_httpserver.h" +#define ITK_err 919012 +#include "spdlog/spdlog.h" +#include "spdlog/sinks/basic_file_sink.h" +#include "ocilib.h" +#include "util.h" +using namespace spdlog; +#define PREF_ML_DB "Meling_dbinfo" +using namespace std; +using namespace rapidjson; + +string startLog(char* userName) { + tag_t current_member = NULLTAG, current_user = NULLTAG; + string userId = userName; + //获取当前时间 + time_t now = time(0); + tm* p = localtime(&now); + char dateNow[128] = ""; + sprintf_s(dateNow, "%04d%02d%02d%02d%02d%02d", 1900 + p->tm_year, p->tm_mon + 1, p->tm_mday, p->tm_hour, p->tm_min, p->tm_sec); + string dateString = dateNow; + string logPath = "C:/logs/" + userId + "_" + dateString + ".log"; + auto file_logger = basic_logger_mt("import_logger", logPath); + set_default_logger(file_logger); + log("begin connor_import_object"); + return logPath; +} + +string uploadMinio(string jarName, string logPath) { + char cmd[1024] = ""; + strcpy(cmd, "java -jar \""); + //strcat(cmd, jar_file); + strcat(cmd, getenv("TC_ROOT")); + strcat(cmd, "\\bin\\"); + strcat(cmd, jarName.c_str()); + strcat(cmd, "\" "); + string strResult; + strcat(cmd, logPath.c_str()); + char buf[8000] = { 0 }; + log("cmd:\n%s\n", cmd); + FILE* pf = NULL; + if ((pf = _popen(cmd, "r")) == NULL) { + log("接口返回1\n"); + } + else { + log("接口返回2\n"); + while (fgets(buf, sizeof buf, pf)) { + strResult += buf; + } + _pclose(pf); + } + log("strResult:%s\n", strResult.c_str()); + return strResult; + //return; +} + +int ITK_user_main(int argc, char* argv[]) +{ + int ifail = ITK_ok; + char* tc_name, *tc_pwd, *tc_group, *code, *groupId, *projectUid, *uids, *userName; + tc_name = (char*)"dcproxy";//ITK_ask_cli_argument("-u="); + tc_pwd = (char*)"dcproxy";// ITK_ask_cli_argument("-p="); + tc_group = (char*)"";// ITK_ask_cli_argument("-g="); + code = ITK_ask_cli_argument("-a="); //编号 + groupId = ITK_ask_cli_argument("-b="); //编号 + projectUid = ITK_ask_cli_argument("-c="); //编号 + uids = ITK_ask_cli_argument("-d="); //编号 + userName = ITK_ask_cli_argument("-e="); //编号 + ITKCALL(ifail = TC_init_module(tc_name, tc_pwd, tc_group)); + if (ifail != ITK_ok) { + log("login fail! \n"); + return ifail; + } + else { + log("login2222>>>>> \n"); + } + string logPath = startLog(userName); + vector uidVector; + vector ccpVector; + Split(uids, ":", uidVector); + log("uidVector>>>>> %d \n", uidVector.size()); + for (int i = 0; i < uidVector.size(); i++) { + tag_t ccp; + log("idVector[i].c_str() %s \n", uidVector[i].c_str()); + ITK__convert_uid_to_tag(uidVector[i].c_str(), &ccp); + ccpVector.push_back(ccp); + } + int url_num = 0; + char** url_vals = NULL; + PREF_ask_char_values("database_tc", &url_num, &url_vals); + string url = url_vals[0]; + url.append("/").append(url_vals[2]); + + + log("url ==>%s", url.c_str()); + if (ConnServer(url_vals[3], url_vals[4], (char*)url.c_str()) == -1) + { + log("提示:中间数据表访问失败"); + ifail = 1; + } + readBomMsg(ccpVector, groupId, projectUid, code, userName);//,char * groupName,char* groupUid,char*code + + //log("产成品UID: {%s} " , uids); + + string str = uploadMinio("uploadMinio.jar", logPath); + + //string minioPath = "/plmichi/SapBomLog/" + logPath; + //char updateSum[1024] = "update CHINT_BOM_TO_SAP_SUM set \"LOGURL\" = '%s' where code = '%s' "; + char selectRxfs[1024]; + sprintf(selectRxfs, "update CHINT_BOM_TO_SAP_SUM set \"LOGURL\" = '%s' where code = '%s' ", str.c_str(), code); + log("selectRecord3 ===> %s\n", selectRxfs); + ExecuteSQLNoInputParam(selectRxfs); + ExecuteSQLNoInputParam((char*)"commit"); + //上传文件 + DisConnServer(); + ITK_exit_module(true); + spdlog::drop_all(); + return ifail; +} diff --git a/DFL_BOM_WL_TOERP/SIO_USCOREBOM_USCOREPLM_USCOREASYNBinding.nsmap b/DFL_BOM_WL_TOERP/SIO_USCOREBOM_USCOREPLM_USCOREASYNBinding.nsmap new file mode 100644 index 0000000..82f777c --- /dev/null +++ b/DFL_BOM_WL_TOERP/SIO_USCOREBOM_USCOREPLM_USCOREASYNBinding.nsmap @@ -0,0 +1,12 @@ + +#include "stdsoap2.h" +/* This defines the global XML namespaces[] table to #include and compile + The first four entries are mandatory and should not be removed */ +SOAP_NMAC struct Namespace namespaces[] = { + { "SOAP-ENV", "http://schemas.xmlsoap.org/soap/envelope/", "http://www.w3.org/*/soap-envelope", NULL }, + { "SOAP-ENC", "http://schemas.xmlsoap.org/soap/encoding/", "http://www.w3.org/*/soap-encoding", NULL }, + { "xsi", "http://www.w3.org/2001/XMLSchema-instance", "http://www.w3.org/*/XMLSchema-instance", NULL }, + { "xsd", "http://www.w3.org/2001/XMLSchema", "http://www.w3.org/*/XMLSchema", NULL }, + { "ns1", "urn:chintelectric.com:xi:plm", NULL, NULL }, + { NULL, NULL, NULL, NULL} /* end of namespaces[] */ + }; diff --git a/DFL_BOM_WL_TOERP/ado.cxx b/DFL_BOM_WL_TOERP/ado.cxx new file mode 100644 index 0000000..094bb27 --- /dev/null +++ b/DFL_BOM_WL_TOERP/ado.cxx @@ -0,0 +1,224 @@ +#include "ado.h" +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#ifdef WIN32 +#include +#include +#else +#include +#endif + +using namespace std; + +_ConnectionPtr m_pConnection; +_RecordsetPtr m_pRecordset; +HRESULT hr; + +bool open(char* username, char* password, char* dbname, char* ip) +{ + try + { + ::CoInitialize(NULL); //ʼCOM + m_pConnection.CreateInstance(__uuidof(Connection)); //Ӷ + char connStr[200] = ""; + sprintf(connStr, "Provider=SQLOLEDB;Data Source=%s;Initial Catalog=%s;", ip, dbname); + cout << connStr << endl; + hr = m_pConnection->Open(connStr, username, password, -1); + if (hr != S_OK) + return true; + } + catch (_com_error e) + { + cout << e.Description() << endl; + return true; + } + return false; +} +bool openMySql(char* username, char* password, char* dbname, char* ip) +{ + try + { + ::CoInitialize(NULL); //ʼCOM + m_pConnection.CreateInstance(__uuidof(Connection)); //Ӷ + char connStr[200] = ""; + sprintf(connStr, ("DATABASE=%s;DSN=myodbc;OPTION=0;PWD=%s;PORT=0;SERVER=%s;UID=%s;"), + dbname, username,ip, password); + cout << connStr << endl; + hr = m_pConnection->Open(connStr, username, password, -1); + if (hr != S_OK) + return true; + } + catch (_com_error e) + { + cout << e.Description() << endl; + return true; + } + return false; +} +void Split(string strArg, string spliter, vector& ans) +{ + ans.clear(); + size_t index0 = 0; + string one_arg; + if (strArg.find_first_not_of(' ') == string::npos) + strArg = ""; + while (strArg.size() > 0) + { + index0 = strArg.find_first_of(spliter); + if (index0 != string::npos) + { + one_arg = strArg.substr(0, index0); + strArg = strArg.substr(index0 + 1); + ans.push_back(one_arg); + } + else + { + ans.push_back(strArg); + break; + } + } +} +// IJѯ +int ado_QuerySQL(char *SQL, int inputValueCount, char ** inputValue, int * outputColumn, int * outputValueCount, char **** outputValue) +{ + Fields * fields = NULL; + long ColCount = 0; + long RowCount = 0; + + *outputColumn = 0; + *outputValueCount = 0; + + m_pRecordset.CreateInstance(__uuidof(Recordset)); + + m_pRecordset->Open(SQL, m_pConnection.GetInterfacePtr(), adOpenStatic, adLockOptimistic, adCmdText); + + hr = m_pRecordset->get_Fields(&fields); //õ¼ֶμ + + if (SUCCEEDED(hr)) + { + RowCount = m_pRecordset->GetRecordCount(); + + ColCount = m_pRecordset->Fields->Count; + + + //fields->get_Count(&ColCount); + + + printf("ѯ%d\n", RowCount); + printf("ѯ%d\n", ColCount); + + + *outputValueCount = (int)RowCount; + *outputColumn = (int)ColCount; + } + + if (*outputValueCount <= 0) + { + return 0; + } + int index = 0; + // ʼڴ沢Ҵ洢 + *outputValue = (char ***)calloc(RowCount + 1, sizeof(char**)); + while (!m_pRecordset->adoEOF) + { + (*outputValue)[index] = (char **)calloc(ColCount + 1, sizeof(char *)); + for (long i = 0; i < ColCount; i++) + { + //printf("%d\n", i); + /*if (i > 0 && i < 4) { + continue; + }*/ + BSTR bstrColName; + fields->Item[i]->get_Name(&bstrColName); + //printf("%d\n", i); + + //printf("%d\n", i); + _variant_t taskStyle = NULL; + taskStyle = m_pRecordset->GetCollect(bstrColName); + + // printf("%d\n", i); + if (taskStyle.vt != VT_NULL) { + const char* str = NULL; + + + + _bstr_t bst_t = (_bstr_t)taskStyle; + + str = (const char*)bst_t; + + (*outputValue)[index][i] = (char *)calloc(strlen(str)+1, sizeof(char)); + strcpy((*outputValue)[index][i], str); + + } + else + { + //printf("NULL\n"); + (*outputValue)[index][i] = (char *)calloc(10000, sizeof(char)); + strcpy((*outputValue)[index][i], ""); + } + + + } + m_pRecordset->MoveNext();///Ƶһ¼ + index++; + } + return 0; +} + +// IJѯ +int ado_QuerySQLNoInputParam(char *SQL, int * outputColumn, int * outputValueCount, char **** outputValue) +{ + return ado_QuerySQL(SQL, 0, NULL, outputColumn, outputValueCount, outputValue); +} + +// ޲ +int ado_ExecuteSQLNoInputParam(char *SQL) +{ + return ado_ExecuteSQL(SQL, 0, NULL); +} + +// ִ +int ado_ExecuteSQL(char *SQL, int valueCount, char **value) +{ + try + { + m_pConnection->Execute(_bstr_t(SQL), 0, adCmdText); + printf("ɾ\n"); + //LogInsert ("д!"); + } + catch (_com_error e) + { + printf(e.Description()); + return -1; + } + + return 0; +} + +void close(void) +{ + + try + { + if (m_pRecordset != NULL) { + m_pRecordset->Close(); + m_pConnection->Close(); + } + printf("2222"); + ::CoUninitialize(); //ͷŻ + } + catch (_com_error e) + { + cout << e.Description() << endl; + } +} \ No newline at end of file diff --git a/DFL_BOM_WL_TOERP/ado.h b/DFL_BOM_WL_TOERP/ado.h new file mode 100644 index 0000000..ca6cf43 --- /dev/null +++ b/DFL_BOM_WL_TOERP/ado.h @@ -0,0 +1,36 @@ +#import "c:\program files\common files\system\ado\msado15.dll" no_namespace rename("EOF", "adoEOF") + +bool open(char* username, char* password, char* dbname, char* ip); +_RecordsetPtr& execute(_bstr_t SQL); +/** +* IJѯSQL. +* @param SQL - SQL +* @param inputValueCount - +* @param inputValue - ֵ +* @param outputColumn - е +* @param outputValueCount - е +* @param outputValue - +* @return - OCI_OK or error code +* +* ORACLE ݿװ +*/ + +int ado_QuerySQL(char *SQL, int inputValueCount, char ** inputValue, int * outputColumn, int * outputValueCount, char **** outputValue); + +int ado_QuerySQLNoInputParam(char *SQL, int * outputColumn, int * outputValueCount, char **** outputValue); +// ִ +int ado_ExecuteSQL(char *SQL, int valueCount, char **value); +/** +* ִSQL. +* @param SQL - SQL +* @return - OCI_OK or error code +* +* ORACLE ݿװ +*/ +int ado_ExecuteSQLNoInputParam(char *SQL); +/** +* Ͽݿ. +* +* ORACLE ݿװ +*/ +void close(); \ No newline at end of file diff --git a/DFL_BOM_WL_TOERP/bin/README.txt b/DFL_BOM_WL_TOERP/bin/README.txt new file mode 100644 index 0000000..ba02e55 --- /dev/null +++ b/DFL_BOM_WL_TOERP/bin/README.txt @@ -0,0 +1,12 @@ + +This directory contains pre-built soapcpp2 and wsdl2h executables for platforms +on which these tools are more complex to build (compared to Linux/Unix): + +macosx MAC OS X binaries +win32 Windows 386 compatible binaries for 32 and 64 bit systems + +For other platforms: see installation instructions INSTALL.txt in the root dir. + +Binaries of the soapcpp2 and wsdl2h tools can be (re)build by following the +installation instructions in the root directory. + diff --git a/DFL_BOM_WL_TOERP/bin/macosx/soapcpp2 b/DFL_BOM_WL_TOERP/bin/macosx/soapcpp2 new file mode 100644 index 0000000..c3a1978 Binary files /dev/null and b/DFL_BOM_WL_TOERP/bin/macosx/soapcpp2 differ diff --git a/DFL_BOM_WL_TOERP/bin/macosx/wsdl2h b/DFL_BOM_WL_TOERP/bin/macosx/wsdl2h new file mode 100644 index 0000000..81b2e9c Binary files /dev/null and b/DFL_BOM_WL_TOERP/bin/macosx/wsdl2h differ diff --git a/DFL_BOM_WL_TOERP/bin/win32/soapcpp2.exe b/DFL_BOM_WL_TOERP/bin/win32/soapcpp2.exe new file mode 100644 index 0000000..fd05aae Binary files /dev/null and b/DFL_BOM_WL_TOERP/bin/win32/soapcpp2.exe differ diff --git a/DFL_BOM_WL_TOERP/bin/win32/wsdl2h.exe b/DFL_BOM_WL_TOERP/bin/win32/wsdl2h.exe new file mode 100644 index 0000000..23f564c Binary files /dev/null and b/DFL_BOM_WL_TOERP/bin/win32/wsdl2h.exe differ diff --git a/DFL_BOM_WL_TOERP/bin/win64/BOP.h b/DFL_BOM_WL_TOERP/bin/win64/BOP.h new file mode 100644 index 0000000..7f68655 --- /dev/null +++ b/DFL_BOM_WL_TOERP/bin/win64/BOP.h @@ -0,0 +1,736 @@ +/* BOP.h + Generated by wsdl2h 2.8.131 from BOP.wsdl and wsmap.dat + 2023-11-28 03:25:43 GMT + + DO NOT INCLUDE THIS ANNOTATED FILE DIRECTLY IN YOUR PROJECT SOURCE CODE. + USE THE FILES GENERATED BY soapcpp2 FOR YOUR PROJECT'S SOURCE CODE. + +gSOAP XML Web services tools +Copyright (C) 2000-2023, Robert van Engelen, Genivia Inc. All Rights Reserved. +This program is released under the GPL with the additional exemption that +compiling, linking, and/or using OpenSSL is allowed. +-------------------------------------------------------------------------------- +A commercial use license is available from Genivia Inc., contact@genivia.com +-------------------------------------------------------------------------------- +*/ + +/** + +@page page_notes Notes + +@note HINTS: + - Run soapcpp2 on BOP.h to generate the SOAP/XML processing logic: + Use soapcpp2 -I to specify paths for #import + Use soapcpp2 -j to generate improved proxy and server classes. + Use soapcpp2 -r to generate a report. + - Edit 'typemap.dat' to control namespace bindings and type mappings: + It is strongly recommended to customize the names of the namespace prefixes + generated by wsdl2h. To do so, modify the prefix bindings in the Namespaces + section below and add the modified lines to 'typemap.dat' to rerun wsdl2h. + - Run Doxygen (www.doxygen.org) on this file to generate documentation. + - Use wsdl2h -c to generate pure C code. + - Use wsdl2h -R to include the REST operations defined by the WSDLs. + - Use wsdl2h -O3 or -O4 to optimize by removing unused schema components. + - Use wsdl2h -d to enable DOM support for xsd:any and xsd:anyType. + - Use wsdl2h -F to simulate struct-type derivation in C (also works in C++). + - Use wsdl2h -f to generate flat C++ class hierarchy, removes type derivation. + - Use wsdl2h -g to generate top-level root elements with readers and writers. + - Use wsdl2h -U to map XML names to C++ Unicode identifiers instead of _xNNNN. + - Use wsdl2h -u to disable the generation of unions. + - Use wsdl2h -L to remove this @note and all other @note comments. + - Use wsdl2h -nname to use name as the base namespace prefix instead of 'ns'. + - Use wsdl2h -Nname for service prefix and produce multiple service bindings + - Struct/class members serialized as XML attributes are annotated with a '@'. + - Struct/class members that have a special role are annotated with a '$'. + +@warning + DO NOT INCLUDE THIS ANNOTATED FILE DIRECTLY IN YOUR PROJECT SOURCE CODE. + USE THE FILES GENERATED BY soapcpp2 FOR YOUR PROJECT'S SOURCE CODE: + THE GENERATED soapStub.h FILE CONTAINS THIS CONTENT WITHOUT ANNOTATIONS. + +@copyright LICENSE: +@verbatim +-------------------------------------------------------------------------------- +gSOAP XML Web services tools +Copyright (C) 2000-2023, Robert van Engelen, Genivia Inc. All Rights Reserved. +The wsdl2h tool and its generated software are released under the GPL. +This software is released under the GPL with the additional exemption that +compiling, linking, and/or using OpenSSL is allowed. +-------------------------------------------------------------------------------- +GPL license. + +This program is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free Software +Foundation; either version 2 of the License, or (at your option) any later +version. + +This program is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A +PARTICULAR PURPOSE. See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along with +this program; if not, write to the Free Software Foundation, Inc., 59 Temple +Place, Suite 330, Boston, MA 02111-1307 USA + +Author contact information: +engelen@genivia.com / engelen@acm.org + +This program is released under the GPL with the additional exemption that +compiling, linking, and/or using OpenSSL is allowed. +-------------------------------------------------------------------------------- +A commercial-use license is available from Genivia, Inc., contact@genivia.com +-------------------------------------------------------------------------------- +@endverbatim + +*/ + + +//gsoapopt c++,w + +/******************************************************************************\ + * * + * Definitions * + * urn:chintelectric.com:xi:plm * + * * +\******************************************************************************/ + +/* WSDL Documentation: + +*/ + + +/******************************************************************************\ + * * + * $SIZE typemap variable: * + * int * + * * +\******************************************************************************/ + + +/******************************************************************************\ + * * + * Import * + * * +\******************************************************************************/ + + +/******************************************************************************\ + * * + * Schema Namespaces * + * * +\******************************************************************************/ + + +/* NOTE: + +It is strongly recommended to customize the names of the namespace prefixes +generated by wsdl2h. To do so, modify the prefix bindings below and add the +modified lines to 'typemap.dat' then rerun wsdl2h (use wsdl2h -t typemap.dat): + +ns1 = "urn:chintelectric.com:xi:plm" + +*/ + +#define SOAP_NAMESPACE_OF_ns1 "urn:chintelectric.com:xi:plm" +//gsoap ns1 schema namespace: urn:chintelectric.com:xi:plm +//gsoap ns1 schema form: unqualified + +/******************************************************************************\ + * * + * Built-in Schema Types and Top-Level Elements and Attributes * + * * +\******************************************************************************/ + + +/******************************************************************************\ + * * + * Forward Declarations * + * * +\******************************************************************************/ + + +class ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP; + +class ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ; + + +/******************************************************************************\ + * * + * Schema Types and Top-Level Elements and Attributes * + * urn:chintelectric.com:xi:plm * + * * +\******************************************************************************/ + + +/******************************************************************************\ + * * + * Schema Complex Types and Top-Level Elements * + * urn:chintelectric.com:xi:plm * + * * +\******************************************************************************/ + +/// @brief "urn:chintelectric.com:xi:plm":DT_PROCESSROUTE_S4_RSP is a complexType. +/// +///
+/// PPI002-PLM ERP (PLM->SAP) +///
+/// +/// @note class ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP operations: +/// - ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP* soap_new_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP(soap*) allocate and default initialize +/// - ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP* soap_new_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP(soap*, int num) allocate and default initialize an array +/// - ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP* soap_new_req_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP(soap*, ...) allocate, set required members +/// - ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP* soap_new_set_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP(soap*, ...) allocate, set all public members +/// - ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP::soap_default(soap*) default initialize members +/// - int soap_read_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP(soap*, ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP*) deserialize from a stream +/// - int soap_write_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP(soap*, ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP*) serialize to a stream +/// - ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP* ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP::soap_dup(soap*) returns deep copy of ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) +/// - ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP::soap_del() deep deletes ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP data members, use only after ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP::soap_dup(NULL) (use soapcpp2 -Ed) +/// - int ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP::soap_type() returns SOAP_TYPE_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP or derived type identifier +class ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP +{ public: +/// @note class _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO operations: +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO* soap_new__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO(soap*) allocate and default initialize +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO* soap_new__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO(soap*, int num) allocate and default initialize an array +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO* soap_new_req__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO(soap*, ...) allocate, set required members +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO* soap_new_set__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO(soap*, ...) allocate, set all public members +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO::soap_default(soap*) default initialize members +/// - int soap_read__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO(soap*, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO*) deserialize from a stream +/// - int soap_write__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO(soap*, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO*) serialize to a stream +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO* _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO::soap_dup(soap*) returns deep copy of _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO::soap_del() deep deletes _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO data members, use only after _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO::soap_dup(NULL) (use soapcpp2 -Ed) +/// - int _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO::soap_type() returns SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO or derived type identifier + class _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO + { public: +/// Element "REQ_TRACE_ID" of type xs:string. + char* REQ_USCORETRACE_USCOREID 1; ///< Required element. + } RSP_USCOREBASEINFO 1; ///< Required element. +/// Size of ZTABLE_RETURN array is 0..unbounded. + $ int __sizeZTABLE_USCORERETURN 0; +/// @note class _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN operations: +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN* soap_new__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN(soap*) allocate and default initialize +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN* soap_new__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN(soap*, int num) allocate and default initialize an array +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN* soap_new_req__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN(soap*, ...) allocate, set required members +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN* soap_new_set__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN(soap*, ...) allocate, set all public members +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN::soap_default(soap*) default initialize members +/// - int soap_read__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN(soap*, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN*) deserialize from a stream +/// - int soap_write__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN(soap*, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN*) serialize to a stream +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN* _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN::soap_dup(soap*) returns deep copy of _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN::soap_del() deep deletes _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN data members, use only after _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN::soap_dup(NULL) (use soapcpp2 -Ed) +/// - int _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN::soap_type() returns SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN or derived type identifier + class _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN + { public: + +/// +/// +/// Element "MATNR" of type xs:string. + char* MATNR 0; ///< Optional element. + +/// +/// +/// Element "TYPE" of type xs:string. + char* TYPE 0; ///< Optional element. + +/// +/// +/// Element "MESSAGE" of type xs:string. + char* MESSAGE 0; ///< Optional element. + } *ZTABLE_USCORERETURN 0; ///< Multiple elements. +/// Pointer to soap context that manages this instance. + struct soap *soap ; +}; + +/// @brief "urn:chintelectric.com:xi:plm":DT_PROCESSROUTE_S4_REQ is a complexType. +/// +///
+/// PPI002-PLM ERP (PLM->SAP) +///
+/// +/// @note class ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ operations: +/// - ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ* soap_new_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ(soap*) allocate and default initialize +/// - ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ* soap_new_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ(soap*, int num) allocate and default initialize an array +/// - ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ* soap_new_req_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ(soap*, ...) allocate, set required members +/// - ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ* soap_new_set_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ(soap*, ...) allocate, set all public members +/// - ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ::soap_default(soap*) default initialize members +/// - int soap_read_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ(soap*, ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ*) deserialize from a stream +/// - int soap_write_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ(soap*, ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ*) serialize to a stream +/// - ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ* ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ::soap_dup(soap*) returns deep copy of ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) +/// - ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ::soap_del() deep deletes ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ data members, use only after ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ::soap_dup(NULL) (use soapcpp2 -Ed) +/// - int ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ::soap_type() returns SOAP_TYPE_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ or derived type identifier +class ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ +{ public: +/// @note class _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO operations: +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO* soap_new__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO(soap*) allocate and default initialize +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO* soap_new__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO(soap*, int num) allocate and default initialize an array +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO* soap_new_req__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO(soap*, ...) allocate, set required members +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO* soap_new_set__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO(soap*, ...) allocate, set all public members +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO::soap_default(soap*) default initialize members +/// - int soap_read__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO(soap*, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO*) deserialize from a stream +/// - int soap_write__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO(soap*, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO*) serialize to a stream +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO* _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO::soap_dup(soap*) returns deep copy of _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO::soap_del() deep deletes _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO data members, use only after _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO::soap_dup(NULL) (use soapcpp2 -Ed) +/// - int _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO::soap_type() returns SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO or derived type identifier + class _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO + { public: +/// Element "REQ_TRACE_ID" of type xs:string. + char* REQ_USCORETRACE_USCOREID 0; ///< Optional element. + } BASEINFO 1; ///< Required element. +/// Size of LIST array is 0..unbounded. + $ int __sizeLIST 0; +/// @note class _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST operations: +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST* soap_new__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST(soap*) allocate and default initialize +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST* soap_new__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST(soap*, int num) allocate and default initialize an array +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST* soap_new_req__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST(soap*, ...) allocate, set required members +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST* soap_new_set__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST(soap*, ...) allocate, set all public members +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST::soap_default(soap*) default initialize members +/// - int soap_read__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST(soap*, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST*) deserialize from a stream +/// - int soap_write__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST(soap*, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST*) serialize to a stream +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST* _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST::soap_dup(soap*) returns deep copy of _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST::soap_del() deep deletes _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST data members, use only after _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST::soap_dup(NULL) (use soapcpp2 -Ed) +/// - int _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST::soap_type() returns SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST or derived type identifier + class _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST + { public: +/// @note class _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD operations: +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD* soap_new__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD(soap*) allocate and default initialize +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD* soap_new__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD(soap*, int num) allocate and default initialize an array +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD* soap_new_req__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD(soap*, ...) allocate, set required members +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD* soap_new_set__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD(soap*, ...) allocate, set all public members +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD::soap_default(soap*) default initialize members +/// - int soap_read__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD(soap*, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD*) deserialize from a stream +/// - int soap_write__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD(soap*, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD*) serialize to a stream +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD* _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD::soap_dup(soap*) returns deep copy of _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD::soap_del() deep deletes _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD data members, use only after _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD::soap_dup(NULL) (use soapcpp2 -Ed) +/// - int _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD::soap_type() returns SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD or derived type identifier + class _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD + { public: + +/// +/// +/// Element "MATNR" of type xs:string. + char* MATNR 1; ///< Required element. + +/// +/// +/// Element "WERKS" of type xs:string. + char* WERKS 1; ///< Required element. + +/// +/// +/// Element "VERWE" of type xs:string. + char* VERWE 1; ///< Required element. + +/// +/// +/// Element "STATU" of type xs:string. + char* STATU 1; ///< Required element. + +/// +/// +/// Element "DATUV" of type xs:string. + char* DATUV 0; ///< Optional element. + +/// +/// +/// Element "PLNAL" of type xs:string. + char* PLNAL 0; ///< Optional element. +///
+/// WBS +///
+/// +/// Element "PSPNR" of type xs:string. + char* PSPNR 0; ///< Optional element. + } HEAD 1; ///< Required element. +/// @note class _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS operations: +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS* soap_new__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS(soap*) allocate and default initialize +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS* soap_new__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS(soap*, int num) allocate and default initialize an array +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS* soap_new_req__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS(soap*, ...) allocate, set required members +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS* soap_new_set__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS(soap*, ...) allocate, set all public members +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS::soap_default(soap*) default initialize members +/// - int soap_read__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS(soap*, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS*) deserialize from a stream +/// - int soap_write__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS(soap*, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS*) serialize to a stream +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS* _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS::soap_dup(soap*) returns deep copy of _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS::soap_del() deep deletes _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS data members, use only after _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS::soap_dup(NULL) (use soapcpp2 -Ed) +/// - int _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS::soap_type() returns SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS or derived type identifier + class _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS + { public: +/// Size of ITEM array is 0..unbounded. + $ int __sizeITEM 0; +/// @note class _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM operations: +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM* soap_new__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(soap*) allocate and default initialize +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM* soap_new__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(soap*, int num) allocate and default initialize an array +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM* soap_new_req__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(soap*, ...) allocate, set required members +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM* soap_new_set__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(soap*, ...) allocate, set all public members +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::soap_default(soap*) default initialize members +/// - int soap_read__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(soap*, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM*) deserialize from a stream +/// - int soap_write__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(soap*, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM*) serialize to a stream +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM* _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::soap_dup(soap*) returns deep copy of _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::soap_del() deep deletes _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM data members, use only after _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::soap_dup(NULL) (use soapcpp2 -Ed) +/// - int _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::soap_type() returns SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM or derived type identifier + class _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM + { public: + +/// +/// +/// Element "PLNAL" of type xs:string. + char* PLNAL 0; ///< Optional element. + +/// +/// +/// Element "PLNFL" of type xs:string. + char* PLNFL 0; ///< Optional element. + +/// +/// +/// Element "DATUV" of type xs:string. + char* DATUV 0; ///< Optional element. + +/// +/// +/// Element "FLGAT" of type xs:string. + char* FLGAT 0; ///< Optional element. + +/// +/// +/// Element "BEZFL" of type xs:string. + char* BEZFL 0; ///< Optional element. + +/// +/// +/// Element "LTXA1" of type xs:string. + char* LTXA1 0; ///< Optional element. + +/// +/// +/// Element "VORNR1" of type xs:string. + char* VORNR1 0; ///< Optional element. + +/// +/// +/// Element "VORNR2" of type xs:string. + char* VORNR2 0; ///< Optional element. +/// @note class _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS operations: +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS* soap_new__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS(soap*) allocate and default initialize +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS* soap_new__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS(soap*, int num) allocate and default initialize an array +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS* soap_new_req__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS(soap*, ...) allocate, set required members +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS* soap_new_set__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS(soap*, ...) allocate, set all public members +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS::soap_default(soap*) default initialize members +/// - int soap_read__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS(soap*, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS*) deserialize from a stream +/// - int soap_write__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS(soap*, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS*) serialize to a stream +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS* _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS::soap_dup(soap*) returns deep copy of _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS::soap_del() deep deletes _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS data members, use only after _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS::soap_dup(NULL) (use soapcpp2 -Ed) +/// - int _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS::soap_type() returns SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS or derived type identifier + class _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS + { public: +/// Size of SUBITEM array is 0..unbounded. + $ int __sizeSUBITEM 0; +/// @note class _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM operations: +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM* soap_new__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM(soap*) allocate and default initialize +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM* soap_new__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM(soap*, int num) allocate and default initialize an array +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM* soap_new_req__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM(soap*, ...) allocate, set required members +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM* soap_new_set__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM(soap*, ...) allocate, set all public members +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM::soap_default(soap*) default initialize members +/// - int soap_read__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM(soap*, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM*) deserialize from a stream +/// - int soap_write__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM(soap*, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM*) serialize to a stream +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM* _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM::soap_dup(soap*) returns deep copy of _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM::soap_del() deep deletes _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM data members, use only after _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM::soap_dup(NULL) (use soapcpp2 -Ed) +/// - int _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM::soap_type() returns SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM or derived type identifier + class _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM + { public: + +/// +/// +/// Element "VORNR" of type xs:string. + char* VORNR 0; ///< Optional element. + +/// +/// +/// Element "ARBPL" of type xs:string. + char* ARBPL 0; ///< Optional element. + +/// +/// +/// Element "STEUS" of type xs:string. + char* STEUS 0; ///< Optional element. + +/// +/// +/// Element "LTXA1" of type xs:string. + char* LTXA1 0; ///< Optional element. + +/// +/// +/// Element "USR00" of type xs:string. + char* USR00 0; ///< Optional element. + +/// +/// +/// Element "BMSCH" of type xs:string. + char* BMSCH 1; ///< Required element. + +/// +/// +/// Element "PLNME" of type xs:string. + char* PLNME 0; ///< Optional element. +///
+/// 1 +///
+/// +/// Element "VGW01" of type xs:string. + char* VGW01 1; ///< Required element. +///
+/// 1 +///
+/// +/// Element "VGE01" of type xs:string. + char* VGE01 1; ///< Required element. +///
+/// 2 +///
+/// +/// Element "VGW02" of type xs:string. + char* VGW02 1; ///< Required element. +///
+/// 2 +///
+/// +/// Element "VGE02" of type xs:string. + char* VGE02 1; ///< Required element. +///
+/// 5 +///
+/// +/// Element "VGW05" of type xs:string. + char* VGW05 0; ///< Optional element. +///
+/// 5 +///
+/// +/// Element "VGE05" of type xs:string. + char* VGE05 0; ///< Optional element. + } *SUBITEM 0; ///< Multiple elements. + } SUBITEMS 1; ///< Required element. + } *ITEM 0; ///< Multiple elements. + } ITEMS 1; ///< Required element. + } *LIST 0; ///< Multiple elements. +/// Pointer to soap context that manages this instance. + struct soap *soap ; +}; + + +/******************************************************************************\ + * * + * Additional Top-Level Elements * + * urn:chintelectric.com:xi:plm * + * * +\******************************************************************************/ + +/// @brief Top-level root element "urn:chintelectric.com:xi:plm":MT_PROCESSROUTE_S4_RSP of type "urn:chintelectric.com:xi:plm":DT_PROCESSROUTE_S4_RSP. +/// @note Use wsdl2h option -g to auto-generate a top-level root element declaration. + +/// @brief Top-level root element "urn:chintelectric.com:xi:plm":MT_PROCESSROUTE_S4_REQ of type "urn:chintelectric.com:xi:plm":DT_PROCESSROUTE_S4_REQ. +/// @note Use wsdl2h option -g to auto-generate a top-level root element declaration. + + +/******************************************************************************\ + * * + * Additional Top-Level Attributes * + * urn:chintelectric.com:xi:plm * + * * +\******************************************************************************/ + + +/******************************************************************************\ + * * + * Services * + * * +\******************************************************************************/ + + +//gsoap ns1 service name: SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBinding +//gsoap ns1 service type: SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN +//gsoap ns1 service port: http://gfpoapp:50100/XISOAPAdapter/MessageServlet?senderParty=&senderService=BC_CHINT_ELECTRIC&receiverParty=&receiverService=&interface=SI_PROCESSROUTE_PLM_OUT_SYN&interfaceNamespace=urn%3Achintelectric.com%3Axi%3Aplm +//gsoap ns1 service port: https://gfpoapp:50101/XISOAPAdapter/MessageServlet?senderParty=&senderService=BC_CHINT_ELECTRIC&receiverParty=&receiverService=&interface=SI_PROCESSROUTE_PLM_OUT_SYN&interfaceNamespace=urn%3Achintelectric.com%3Axi%3Aplm +//gsoap ns1 service namespace: urn:chintelectric.com:xi:plm +//gsoap ns1 service transport: http://schemas.xmlsoap.org/soap/http + +/** @mainpage SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN Definitions + +@section SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN_documentation Documentation + +@section SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN_bindings Service Bindings + + - @ref SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBinding + +@section SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN_more More Information + + - @ref page_notes "Notes" + + - @ref page_XMLDataBinding "XML Data Binding" + + - @ref SOAP_ENV__Header "SOAP Header Content" (when applicable) + + - @ref SOAP_ENV__Detail "SOAP Fault Detail Content" (when applicable) + + +*/ + +/** @page SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBinding Binding "SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBinding" + +@section SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBinding_operations Operations of Binding "SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBinding" + + - @ref __ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN + +@section SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBinding_ports Default endpoints of Binding "SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBinding" + + - http://gfpoapp:50100/XISOAPAdapter/MessageServlet?senderParty=&senderService=BC_CHINT_ELECTRIC&receiverParty=&receiverService=&interface=SI_PROCESSROUTE_PLM_OUT_SYN&interfaceNamespace=urn%3Achintelectric.com%3Axi%3Aplm + + - https://gfpoapp:50101/XISOAPAdapter/MessageServlet?senderParty=&senderService=BC_CHINT_ELECTRIC&receiverParty=&receiverService=&interface=SI_PROCESSROUTE_PLM_OUT_SYN&interfaceNamespace=urn%3Achintelectric.com%3Axi%3Aplm + +@note Use wsdl2h option -Nname to change the service binding prefix name + + +*/ + +/******************************************************************************\ + * * + * Service Binding * + * SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBinding * + * * +\******************************************************************************/ + + +/******************************************************************************\ + * * + * Service Operation * + * __ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN * + * * +\******************************************************************************/ + + +/** Operation "__ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN" of service binding "SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBinding". + + - WS-Policy applicable to the operation: + + - SOAP document/literal style messaging + + - Default endpoints: + - http://gfpoapp:50100/XISOAPAdapter/MessageServlet?senderParty=&senderService=BC_CHINT_ELECTRIC&receiverParty=&receiverService=&interface=SI_PROCESSROUTE_PLM_OUT_SYN&interfaceNamespace=urn%3Achintelectric.com%3Axi%3Aplm + - https://gfpoapp:50101/XISOAPAdapter/MessageServlet?senderParty=&senderService=BC_CHINT_ELECTRIC&receiverParty=&receiverService=&interface=SI_PROCESSROUTE_PLM_OUT_SYN&interfaceNamespace=urn%3Achintelectric.com%3Axi%3Aplm + + - Default SOAP action or REST location path: + - "http://sap.com/xi/WebService/soap1.1" + + - Addressing input action: "http://sap.com/xi/WebService/soap1.1" + + - Addressing output action: "http://sap.com/xi/WebService/soap1.1Response" + +C stub function (defined in soapClient.c[pp] generated by soapcpp2): +@code + int soap_call___ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN( + struct soap *soap, + NULL, // char *endpoint = NULL selects default endpoint for this operation + NULL, // char *action = NULL selects default action for this operation + // input parameters: + ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ* ns1__MT_USCOREPROCESSROUTE_USCORES4_USCOREREQ, + // output parameters: + ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP&ns1__MT_USCOREPROCESSROUTE_USCORES4_USCORERSP + ); +@endcode + +C server function (called from the service dispatcher defined in soapServer.c[pp]): +@code + int __ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN( + struct soap *soap, + // input parameters: + ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ* ns1__MT_USCOREPROCESSROUTE_USCORES4_USCOREREQ, + // output parameters: + ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP&ns1__MT_USCOREPROCESSROUTE_USCORES4_USCORERSP + ); +@endcode + +C++ proxy class (defined in soapSI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy.h generated with soapcpp2): +@code + class SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy; +@endcode +Important: use soapcpp2 option '-j' (or '-i') to generate improved and easy-to-use proxy classes; + +C++ service class (defined in soapSI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingService.h generated with soapcpp2): +@code + class SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingService; +@endcode +Important: use soapcpp2 option '-j' (or '-i') to generate improved and easy-to-use service classes; + +*/ + +//gsoap ns1 service method-protocol: SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN SOAP +//gsoap ns1 service method-style: SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN document +//gsoap ns1 service method-encoding: SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN literal +//gsoap ns1 service method-input-action: SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN http://sap.com/xi/WebService/soap1.1 +//gsoap ns1 service method-output-action: SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN http://sap.com/xi/WebService/soap1.1Response +int __ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN( + ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ* ns1__MT_USCOREPROCESSROUTE_USCORES4_USCOREREQ, ///< Input parameter + ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP&ns1__MT_USCOREPROCESSROUTE_USCORES4_USCORERSP ///< Output parameter +); + +/** @page SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBinding Binding "SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBinding" + +@section SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBinding_policy_enablers Policy Enablers of Binding "SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBinding" + +None specified. + +*/ + +/******************************************************************************\ + * * + * XML Data Binding * + * * +\******************************************************************************/ + + +/** @page page_XMLDataBinding XML Data Binding + +SOAP/XML services use data bindings that are contractually bound by WSDLs and +are auto-generated by wsdl2h and soapcpp2 (see Service Bindings). Plain data +bindings are adopted from XML schemas as part of the WSDL types section or when +running wsdl2h on a set of schemas to produce non-SOAP-based XML data bindings. + +@note The following readers and writers are C/C++ data type (de)serializers +auto-generated by wsdl2h and soapcpp2. Run soapcpp2 on this file to generate the +(de)serialization code, which is stored in soapC.c[pp]. Include "soapH.h" in +your code to import these data type and function declarations. Only use the +soapcpp2-generated files in your project build. Do not include the wsdl2h- +generated .h file in your code. + +@note Data can be read and deserialized from: + - an int file descriptor, using soap->recvfd = fd + - a socket, using soap->socket = (int)... + - a C++ stream (istream, stringstream), using soap->is = (istream*)... + - a C string, using soap->is = (const char*)... + - any input, using the soap->frecv() callback + +@note Data can be serialized and written to: + - an int file descriptor, using soap->sendfd = (int)... + - a socket, using soap->socket = (int)... + - a C++ stream (ostream, stringstream), using soap->os = (ostream*)... + - a C string, using soap->os = (const char**)... + - any output, using the soap->fsend() callback + +@note The following options are available for (de)serialization control: + - soap->encodingStyle = NULL; to remove SOAP 1.1/1.2 encodingStyle + - soap_set_mode(soap, SOAP_XML_TREE); XML without id-ref (no cycles!) + - soap_set_mode(soap, SOAP_XML_GRAPH); XML with id-ref (including cycles) + - soap_set_namespaces(soap, struct Namespace *nsmap); to set xmlns bindings + + +*/ + +/** + +@section ns1 Top-level root elements of schema "urn:chintelectric.com:xi:plm" + + - (use wsdl2h option -g to auto-generate type _ns1__MT_USCOREPROCESSROUTE_USCORES4_USCORERSP) + + - (use wsdl2h option -g to auto-generate type _ns1__MT_USCOREPROCESSROUTE_USCORES4_USCOREREQ) + +*/ + +/* End of BOP.h */ diff --git a/DFL_BOM_WL_TOERP/bin/win64/BOP.wsdl b/DFL_BOM_WL_TOERP/bin/win64/BOP.wsdl new file mode 100644 index 0000000..30789fc --- /dev/null +++ b/DFL_BOM_WL_TOERP/bin/win64/BOP.wsdl @@ -0,0 +1 @@ +PPI002-PLM 到ERP 工艺路线接口程序开发(PLM->SAP)84050b81dce411e9cdc70000010495f66dc33edcdce411e9860294659c5180ec6dc33edbdce411e9c5e494659c5180ec6dc33edddce411e9845594659c5180ec4eff7b37db3f11e9942994659c5180ec物料编码4eff7b38db3f11e9cf6794659c5180ec状态4eff7b39db3f11e9ca3f94659c5180ec消息文本PPI002-PLM 到ERP 工艺路线接口程序开发(PLM->SAP)85aef356afa311eaae630000010495f64e78b17adad211e9c92294659c5180ed4e78b179dad211e9a63894659c5180ed1ab87f11df3411e9ac0194659c5180ed1ab863f8df3411e9a9db94659c5180ed03d1f212df3411e9cb2e94659c5180ed物料编码03d1f213df3411e98aab94659c5180ed工厂03d1f214df3411e9904e94659c5180ed用途9cc31de5df3411e9c18794659c5180ed状态03d1f215df3411e9812694659c5180ed起始日期03d1f216df3411e9beb694659c5180ed组计数器8431bc14afa311ea83f500ffa67f8aeeWBS 要素1ab87f10df3411e9932c94659c5180ed1ab87f0fdf3411e98ce594659c5180ed03d20daadf3411e993b994659c5180ed组计数器03d20dabdf3411e99da394659c5180ed序列03d20dacdf3411e9ca9e94659c5180ed有效起始日期03d20daddf3411e9984f94659c5180ed顺序类别03d20daedf3411e9b80894659c5180ed参考顺序03d20dafdf3411e994b894659c5180ed顺序描述03d20db0df3411e9bb7094659c5180ed分支工序数03d20db1df3411e9c07894659c5180ed返回工序数1ab87f0edf3411e9873c94659c5180ed1ab87f0ddf3411e9ac0c94659c5180ed03d20db2df3411e9c9b894659c5180ed工序03d20db3df3411e99f8594659c5180ed工作中心03d20db4df3411e994dc94659c5180ed控制码03d20db5df3411e98f7d94659c5180ed工序描述03d20db6df3411e9aaeb94659c5180ed工序编码03d20db7df3411e98d0394659c5180ed基本数量03d20db8df3411e98e6b94659c5180ed基本单位03d20db9df3411e9ad8c94659c5180ed标准值103d20dbadf3411e9903594659c5180ed标准值单位103d20dbbdf3411e9914394659c5180ed标准值203d20dbcdf3411e98ee794659c5180ed标准值单位29cc31de6df3411e9b3cd94659c5180ed标准值59cc31de7df3411e9c2dc94659c5180ed标准值单位5 \ No newline at end of file diff --git a/DFL_BOM_WL_TOERP/bin/win64/SIO_USCOREBOM_USCOREPLM_USCOREASYNBinding.nsmap b/DFL_BOM_WL_TOERP/bin/win64/SIO_USCOREBOM_USCOREPLM_USCOREASYNBinding.nsmap new file mode 100644 index 0000000..82f777c --- /dev/null +++ b/DFL_BOM_WL_TOERP/bin/win64/SIO_USCOREBOM_USCOREPLM_USCOREASYNBinding.nsmap @@ -0,0 +1,12 @@ + +#include "stdsoap2.h" +/* This defines the global XML namespaces[] table to #include and compile + The first four entries are mandatory and should not be removed */ +SOAP_NMAC struct Namespace namespaces[] = { + { "SOAP-ENV", "http://schemas.xmlsoap.org/soap/envelope/", "http://www.w3.org/*/soap-envelope", NULL }, + { "SOAP-ENC", "http://schemas.xmlsoap.org/soap/encoding/", "http://www.w3.org/*/soap-encoding", NULL }, + { "xsi", "http://www.w3.org/2001/XMLSchema-instance", "http://www.w3.org/*/XMLSchema-instance", NULL }, + { "xsd", "http://www.w3.org/2001/XMLSchema", "http://www.w3.org/*/XMLSchema", NULL }, + { "ns1", "urn:chintelectric.com:xi:plm", NULL, NULL }, + { NULL, NULL, NULL, NULL} /* end of namespaces[] */ + }; diff --git a/DFL_BOM_WL_TOERP/bin/win64/SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBinding.nsmap b/DFL_BOM_WL_TOERP/bin/win64/SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBinding.nsmap new file mode 100644 index 0000000..82f777c --- /dev/null +++ b/DFL_BOM_WL_TOERP/bin/win64/SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBinding.nsmap @@ -0,0 +1,12 @@ + +#include "stdsoap2.h" +/* This defines the global XML namespaces[] table to #include and compile + The first four entries are mandatory and should not be removed */ +SOAP_NMAC struct Namespace namespaces[] = { + { "SOAP-ENV", "http://schemas.xmlsoap.org/soap/envelope/", "http://www.w3.org/*/soap-envelope", NULL }, + { "SOAP-ENC", "http://schemas.xmlsoap.org/soap/encoding/", "http://www.w3.org/*/soap-encoding", NULL }, + { "xsi", "http://www.w3.org/2001/XMLSchema-instance", "http://www.w3.org/*/XMLSchema-instance", NULL }, + { "xsd", "http://www.w3.org/2001/XMLSchema", "http://www.w3.org/*/XMLSchema", NULL }, + { "ns1", "urn:chintelectric.com:xi:plm", NULL, NULL }, + { NULL, NULL, NULL, NULL} /* end of namespaces[] */ + }; diff --git a/DFL_BOM_WL_TOERP/bin/win64/SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBinding.nsmap b/DFL_BOM_WL_TOERP/bin/win64/SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBinding.nsmap new file mode 100644 index 0000000..82f777c --- /dev/null +++ b/DFL_BOM_WL_TOERP/bin/win64/SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBinding.nsmap @@ -0,0 +1,12 @@ + +#include "stdsoap2.h" +/* This defines the global XML namespaces[] table to #include and compile + The first four entries are mandatory and should not be removed */ +SOAP_NMAC struct Namespace namespaces[] = { + { "SOAP-ENV", "http://schemas.xmlsoap.org/soap/envelope/", "http://www.w3.org/*/soap-envelope", NULL }, + { "SOAP-ENC", "http://schemas.xmlsoap.org/soap/encoding/", "http://www.w3.org/*/soap-encoding", NULL }, + { "xsi", "http://www.w3.org/2001/XMLSchema-instance", "http://www.w3.org/*/XMLSchema-instance", NULL }, + { "xsd", "http://www.w3.org/2001/XMLSchema", "http://www.w3.org/*/XMLSchema", NULL }, + { "ns1", "urn:chintelectric.com:xi:plm", NULL, NULL }, + { NULL, NULL, NULL, NULL} /* end of namespaces[] */ + }; diff --git a/DFL_BOM_WL_TOERP/bin/win64/bomtest.h b/DFL_BOM_WL_TOERP/bin/win64/bomtest.h new file mode 100644 index 0000000..6f343cb --- /dev/null +++ b/DFL_BOM_WL_TOERP/bin/win64/bomtest.h @@ -0,0 +1,570 @@ +/* bomtest.h + Generated by wsdl2h 2.8.131 from bomtest.wsdl and wsmap.dat + 2023-11-28 03:25:46 GMT + + DO NOT INCLUDE THIS ANNOTATED FILE DIRECTLY IN YOUR PROJECT SOURCE CODE. + USE THE FILES GENERATED BY soapcpp2 FOR YOUR PROJECT'S SOURCE CODE. + +gSOAP XML Web services tools +Copyright (C) 2000-2023, Robert van Engelen, Genivia Inc. All Rights Reserved. +This program is released under the GPL with the additional exemption that +compiling, linking, and/or using OpenSSL is allowed. +-------------------------------------------------------------------------------- +A commercial use license is available from Genivia Inc., contact@genivia.com +-------------------------------------------------------------------------------- +*/ + +/** + +@page page_notes Notes + +@note HINTS: + - Run soapcpp2 on bomtest.h to generate the SOAP/XML processing logic: + Use soapcpp2 -I to specify paths for #import + Use soapcpp2 -j to generate improved proxy and server classes. + Use soapcpp2 -r to generate a report. + - Edit 'typemap.dat' to control namespace bindings and type mappings: + It is strongly recommended to customize the names of the namespace prefixes + generated by wsdl2h. To do so, modify the prefix bindings in the Namespaces + section below and add the modified lines to 'typemap.dat' to rerun wsdl2h. + - Run Doxygen (www.doxygen.org) on this file to generate documentation. + - Use wsdl2h -c to generate pure C code. + - Use wsdl2h -R to include the REST operations defined by the WSDLs. + - Use wsdl2h -O3 or -O4 to optimize by removing unused schema components. + - Use wsdl2h -d to enable DOM support for xsd:any and xsd:anyType. + - Use wsdl2h -F to simulate struct-type derivation in C (also works in C++). + - Use wsdl2h -f to generate flat C++ class hierarchy, removes type derivation. + - Use wsdl2h -g to generate top-level root elements with readers and writers. + - Use wsdl2h -U to map XML names to C++ Unicode identifiers instead of _xNNNN. + - Use wsdl2h -u to disable the generation of unions. + - Use wsdl2h -L to remove this @note and all other @note comments. + - Use wsdl2h -nname to use name as the base namespace prefix instead of 'ns'. + - Use wsdl2h -Nname for service prefix and produce multiple service bindings + - Struct/class members serialized as XML attributes are annotated with a '@'. + - Struct/class members that have a special role are annotated with a '$'. + +@warning + DO NOT INCLUDE THIS ANNOTATED FILE DIRECTLY IN YOUR PROJECT SOURCE CODE. + USE THE FILES GENERATED BY soapcpp2 FOR YOUR PROJECT'S SOURCE CODE: + THE GENERATED soapStub.h FILE CONTAINS THIS CONTENT WITHOUT ANNOTATIONS. + +@copyright LICENSE: +@verbatim +-------------------------------------------------------------------------------- +gSOAP XML Web services tools +Copyright (C) 2000-2023, Robert van Engelen, Genivia Inc. All Rights Reserved. +The wsdl2h tool and its generated software are released under the GPL. +This software is released under the GPL with the additional exemption that +compiling, linking, and/or using OpenSSL is allowed. +-------------------------------------------------------------------------------- +GPL license. + +This program is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free Software +Foundation; either version 2 of the License, or (at your option) any later +version. + +This program is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A +PARTICULAR PURPOSE. See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along with +this program; if not, write to the Free Software Foundation, Inc., 59 Temple +Place, Suite 330, Boston, MA 02111-1307 USA + +Author contact information: +engelen@genivia.com / engelen@acm.org + +This program is released under the GPL with the additional exemption that +compiling, linking, and/or using OpenSSL is allowed. +-------------------------------------------------------------------------------- +A commercial-use license is available from Genivia, Inc., contact@genivia.com +-------------------------------------------------------------------------------- +@endverbatim + +*/ + + +//gsoapopt c++,w + +/******************************************************************************\ + * * + * Definitions * + * urn:chintelectric.com:xi:plm * + * * +\******************************************************************************/ + +/* WSDL Documentation: + +*/ + + +/******************************************************************************\ + * * + * $SIZE typemap variable: * + * int * + * * +\******************************************************************************/ + + +/******************************************************************************\ + * * + * Import * + * * +\******************************************************************************/ + + +/******************************************************************************\ + * * + * Schema Namespaces * + * * +\******************************************************************************/ + + +/* NOTE: + +It is strongly recommended to customize the names of the namespace prefixes +generated by wsdl2h. To do so, modify the prefix bindings below and add the +modified lines to 'typemap.dat' then rerun wsdl2h (use wsdl2h -t typemap.dat): + +ns1 = "urn:chintelectric.com:xi:plm" + +*/ + +#define SOAP_NAMESPACE_OF_ns1 "urn:chintelectric.com:xi:plm" +//gsoap ns1 schema namespace: urn:chintelectric.com:xi:plm +//gsoap ns1 schema form: unqualified + +/******************************************************************************\ + * * + * Built-in Schema Types and Top-Level Elements and Attributes * + * * +\******************************************************************************/ + + +/******************************************************************************\ + * * + * Forward Declarations * + * * +\******************************************************************************/ + + +class ns1__DT_USCOREBOM_USCORES4_USCOREREQ; + + +/******************************************************************************\ + * * + * Schema Types and Top-Level Elements and Attributes * + * urn:chintelectric.com:xi:plm * + * * +\******************************************************************************/ + + +/******************************************************************************\ + * * + * Schema Complex Types and Top-Level Elements * + * urn:chintelectric.com:xi:plm * + * * +\******************************************************************************/ + +/// @brief "urn:chintelectric.com:xi:plm":DT_BOM_S4_REQ is a complexType. +/// +///
+/// PPI001-BOMPLM->SAP +///
+/// +/// @note class ns1__DT_USCOREBOM_USCORES4_USCOREREQ operations: +/// - ns1__DT_USCOREBOM_USCORES4_USCOREREQ* soap_new_ns1__DT_USCOREBOM_USCORES4_USCOREREQ(soap*) allocate and default initialize +/// - ns1__DT_USCOREBOM_USCORES4_USCOREREQ* soap_new_ns1__DT_USCOREBOM_USCORES4_USCOREREQ(soap*, int num) allocate and default initialize an array +/// - ns1__DT_USCOREBOM_USCORES4_USCOREREQ* soap_new_req_ns1__DT_USCOREBOM_USCORES4_USCOREREQ(soap*, ...) allocate, set required members +/// - ns1__DT_USCOREBOM_USCORES4_USCOREREQ* soap_new_set_ns1__DT_USCOREBOM_USCORES4_USCOREREQ(soap*, ...) allocate, set all public members +/// - ns1__DT_USCOREBOM_USCORES4_USCOREREQ::soap_default(soap*) default initialize members +/// - int soap_read_ns1__DT_USCOREBOM_USCORES4_USCOREREQ(soap*, ns1__DT_USCOREBOM_USCORES4_USCOREREQ*) deserialize from a stream +/// - int soap_write_ns1__DT_USCOREBOM_USCORES4_USCOREREQ(soap*, ns1__DT_USCOREBOM_USCORES4_USCOREREQ*) serialize to a stream +/// - ns1__DT_USCOREBOM_USCORES4_USCOREREQ* ns1__DT_USCOREBOM_USCORES4_USCOREREQ::soap_dup(soap*) returns deep copy of ns1__DT_USCOREBOM_USCORES4_USCOREREQ, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) +/// - ns1__DT_USCOREBOM_USCORES4_USCOREREQ::soap_del() deep deletes ns1__DT_USCOREBOM_USCORES4_USCOREREQ data members, use only after ns1__DT_USCOREBOM_USCORES4_USCOREREQ::soap_dup(NULL) (use soapcpp2 -Ed) +/// - int ns1__DT_USCOREBOM_USCORES4_USCOREREQ::soap_type() returns SOAP_TYPE_ns1__DT_USCOREBOM_USCORES4_USCOREREQ or derived type identifier +class ns1__DT_USCOREBOM_USCORES4_USCOREREQ +{ public: +/// @note class _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO operations: +/// - _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO* soap_new__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO(soap*) allocate and default initialize +/// - _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO* soap_new__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO(soap*, int num) allocate and default initialize an array +/// - _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO* soap_new_req__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO(soap*, ...) allocate, set required members +/// - _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO* soap_new_set__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO(soap*, ...) allocate, set all public members +/// - _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO::soap_default(soap*) default initialize members +/// - int soap_read__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO(soap*, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO*) deserialize from a stream +/// - int soap_write__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO(soap*, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO*) serialize to a stream +/// - _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO* _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO::soap_dup(soap*) returns deep copy of _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) +/// - _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO::soap_del() deep deletes _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO data members, use only after _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO::soap_dup(NULL) (use soapcpp2 -Ed) +/// - int _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO::soap_type() returns SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO or derived type identifier + class _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO + { public: +/// Element "REQ_TRACE_ID" of type xs:string. + char* REQ_USCORETRACE_USCOREID 0; ///< Optional element. + } *BASEINFO 0; ///< Optional element. +/// Size of LIST array is 0..unbounded. + $ int __sizeLIST 0; +/// @note class _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST operations: +/// - _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST* soap_new__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST(soap*) allocate and default initialize +/// - _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST* soap_new__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST(soap*, int num) allocate and default initialize an array +/// - _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST* soap_new_req__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST(soap*, ...) allocate, set required members +/// - _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST* soap_new_set__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST(soap*, ...) allocate, set all public members +/// - _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST::soap_default(soap*) default initialize members +/// - int soap_read__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST(soap*, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST*) deserialize from a stream +/// - int soap_write__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST(soap*, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST*) serialize to a stream +/// - _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST* _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST::soap_dup(soap*) returns deep copy of _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) +/// - _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST::soap_del() deep deletes _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST data members, use only after _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST::soap_dup(NULL) (use soapcpp2 -Ed) +/// - int _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST::soap_type() returns SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST or derived type identifier + class _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST + { public: +/// @note class _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD operations: +/// - _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD* soap_new__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD(soap*) allocate and default initialize +/// - _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD* soap_new__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD(soap*, int num) allocate and default initialize an array +/// - _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD* soap_new_req__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD(soap*, ...) allocate, set required members +/// - _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD* soap_new_set__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD(soap*, ...) allocate, set all public members +/// - _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD::soap_default(soap*) default initialize members +/// - int soap_read__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD(soap*, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD*) deserialize from a stream +/// - int soap_write__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD(soap*, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD*) serialize to a stream +/// - _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD* _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD::soap_dup(soap*) returns deep copy of _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) +/// - _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD::soap_del() deep deletes _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD data members, use only after _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD::soap_dup(NULL) (use soapcpp2 -Ed) +/// - int _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD::soap_type() returns SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD or derived type identifier + class _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD + { public: +///
+/// WBS +///
+/// +/// Element "PSPNR" of type xs:string. + char* PSPNR 0; ///< Optional element. + +/// +/// +/// Element "MATNR" of type xs:string. + char* MATNR 1; ///< Required element. + +/// +/// +/// Element "WERKS" of type xs:string. + char* WERKS 1; ///< Required element. +///
+/// BOM +///
+/// +/// Element "DATUV" of type xs:string. + char* DATUV 0; ///< Optional element. +///
+/// BOM +///
+/// +/// Element "STLAN" of type xs:string. + char* STLAN 0; ///< Optional element. +///
+/// BOM +///
+/// +/// Element "STLAL" of type xs:string. + char* STLAL 0; ///< Optional element. + +/// +/// +/// Element "BMENG" of type xs:string. + char* BMENG 1; ///< Required element. + +/// +/// +/// Element "BMEIN" of type xs:string. + char* BMEIN 0; ///< Optional element. + +/// +/// +/// Element "STKTX" of type xs:string. + char* STKTX 0; ///< Optional element. + } HEAD 1; ///< Required element. +/// @note class _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS operations: +/// - _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS* soap_new__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS(soap*) allocate and default initialize +/// - _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS* soap_new__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS(soap*, int num) allocate and default initialize an array +/// - _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS* soap_new_req__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS(soap*, ...) allocate, set required members +/// - _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS* soap_new_set__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS(soap*, ...) allocate, set all public members +/// - _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS::soap_default(soap*) default initialize members +/// - int soap_read__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS(soap*, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS*) deserialize from a stream +/// - int soap_write__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS(soap*, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS*) serialize to a stream +/// - _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS* _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS::soap_dup(soap*) returns deep copy of _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) +/// - _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS::soap_del() deep deletes _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS data members, use only after _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS::soap_dup(NULL) (use soapcpp2 -Ed) +/// - int _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS::soap_type() returns SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS or derived type identifier + class _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS + { public: +/// Size of ITEM array is 0..unbounded. + $ int __sizeITEM 0; +/// @note class _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM operations: +/// - _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM* soap_new__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(soap*) allocate and default initialize +/// - _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM* soap_new__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(soap*, int num) allocate and default initialize an array +/// - _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM* soap_new_req__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(soap*, ...) allocate, set required members +/// - _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM* soap_new_set__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(soap*, ...) allocate, set all public members +/// - _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::soap_default(soap*) default initialize members +/// - int soap_read__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(soap*, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM*) deserialize from a stream +/// - int soap_write__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(soap*, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM*) serialize to a stream +/// - _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM* _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::soap_dup(soap*) returns deep copy of _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) +/// - _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::soap_del() deep deletes _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM data members, use only after _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::soap_dup(NULL) (use soapcpp2 -Ed) +/// - int _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::soap_type() returns SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM or derived type identifier + class _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM + { public: +///
+/// BOM +///
+/// +/// Element "DATUV" of type xs:string. + char* DATUV 0; ///< Optional element. + +/// +/// +/// Element "POSTP" of type xs:string. + char* POSTP 1; ///< Required element. + +/// +/// +/// Element "POSNR" of type xs:string. + char* POSNR 1; ///< Required element. +///
+/// BOM +///
+/// +/// Element "IDNRK" of type xs:string. + char* IDNRK 1; ///< Required element. + +/// +/// +/// Element "MENGE" of type xs:string. + char* MENGE 1; ///< Required element. + +/// +/// +/// Element "MEINS" of type xs:string. + char* MEINS 0; ///< Optional element. + +/// +/// +/// Element "SORTF" of type xs:string. + char* SORTF 0; ///< Optional element. +///
+/// 1 +///
+/// +/// Element "POTX1" of type xs:string. + char* POTX1 0; ///< Optional element. + } *ITEM 0; ///< Multiple elements. + } ITEMS 1; ///< Required element. + } *LIST 0; ///< Multiple elements. +/// Pointer to soap context that manages this instance. + struct soap *soap ; +}; + + +/******************************************************************************\ + * * + * Additional Top-Level Elements * + * urn:chintelectric.com:xi:plm * + * * +\******************************************************************************/ + +/// @brief Top-level root element "urn:chintelectric.com:xi:plm":MT_BOM_S4_REQ of type "urn:chintelectric.com:xi:plm":DT_BOM_S4_REQ. +/// @note Use wsdl2h option -g to auto-generate a top-level root element declaration. + + +/******************************************************************************\ + * * + * Additional Top-Level Attributes * + * urn:chintelectric.com:xi:plm * + * * +\******************************************************************************/ + + +/******************************************************************************\ + * * + * Services * + * * +\******************************************************************************/ + + +//gsoap ns1 service name: SIO_USCOREBOM_USCOREPLM_USCOREASYNBinding +//gsoap ns1 service type: SIO_USCOREBOM_USCOREPLM_USCOREASYN +//gsoap ns1 service port: http://gfpot01:50100/XISOAPAdapter/MessageServlet?senderParty=&senderService=BC_CHINT_ELECTRIC&receiverParty=&receiverService=&interface=SIO_BOM_PLM_ASYN&interfaceNamespace=urn%3Achintelectric.com%3Axi%3Aplm +//gsoap ns1 service port: https://gfpot01:50101/XISOAPAdapter/MessageServlet?senderParty=&senderService=BC_CHINT_ELECTRIC&receiverParty=&receiverService=&interface=SIO_BOM_PLM_ASYN&interfaceNamespace=urn%3Achintelectric.com%3Axi%3Aplm +//gsoap ns1 service namespace: urn:chintelectric.com:xi:plm +//gsoap ns1 service transport: http://schemas.xmlsoap.org/soap/http + +/** @mainpage SIO_USCOREBOM_USCOREPLM_USCOREASYN Definitions + +@section SIO_USCOREBOM_USCOREPLM_USCOREASYN_documentation Documentation + +@section SIO_USCOREBOM_USCOREPLM_USCOREASYN_bindings Service Bindings + + - @ref SIO_USCOREBOM_USCOREPLM_USCOREASYNBinding + +@section SIO_USCOREBOM_USCOREPLM_USCOREASYN_more More Information + + - @ref page_notes "Notes" + + - @ref page_XMLDataBinding "XML Data Binding" + + - @ref SOAP_ENV__Header "SOAP Header Content" (when applicable) + + - @ref SOAP_ENV__Detail "SOAP Fault Detail Content" (when applicable) + + +*/ + +/** @page SIO_USCOREBOM_USCOREPLM_USCOREASYNBinding Binding "SIO_USCOREBOM_USCOREPLM_USCOREASYNBinding" + +@section SIO_USCOREBOM_USCOREPLM_USCOREASYNBinding_operations Operations of Binding "SIO_USCOREBOM_USCOREPLM_USCOREASYNBinding" + + - @ref __ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN + +@section SIO_USCOREBOM_USCOREPLM_USCOREASYNBinding_ports Default endpoints of Binding "SIO_USCOREBOM_USCOREPLM_USCOREASYNBinding" + + - http://gfpot01:50100/XISOAPAdapter/MessageServlet?senderParty=&senderService=BC_CHINT_ELECTRIC&receiverParty=&receiverService=&interface=SIO_BOM_PLM_ASYN&interfaceNamespace=urn%3Achintelectric.com%3Axi%3Aplm + + - https://gfpot01:50101/XISOAPAdapter/MessageServlet?senderParty=&senderService=BC_CHINT_ELECTRIC&receiverParty=&receiverService=&interface=SIO_BOM_PLM_ASYN&interfaceNamespace=urn%3Achintelectric.com%3Axi%3Aplm + +@note Use wsdl2h option -Nname to change the service binding prefix name + + +*/ + +/******************************************************************************\ + * * + * Service Binding * + * SIO_USCOREBOM_USCOREPLM_USCOREASYNBinding * + * * +\******************************************************************************/ + + +/******************************************************************************\ + * * + * Service Operation * + * __ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN * + * * +\******************************************************************************/ + + +/** Operation "__ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN" of service binding "SIO_USCOREBOM_USCOREPLM_USCOREASYNBinding". + + - WS-Policy applicable to the operation: + + - One-way service request message + + - SOAP document/literal style messaging + + - Default endpoints: + - http://gfpot01:50100/XISOAPAdapter/MessageServlet?senderParty=&senderService=BC_CHINT_ELECTRIC&receiverParty=&receiverService=&interface=SIO_BOM_PLM_ASYN&interfaceNamespace=urn%3Achintelectric.com%3Axi%3Aplm + - https://gfpot01:50101/XISOAPAdapter/MessageServlet?senderParty=&senderService=BC_CHINT_ELECTRIC&receiverParty=&receiverService=&interface=SIO_BOM_PLM_ASYN&interfaceNamespace=urn%3Achintelectric.com%3Axi%3Aplm + + - Default SOAP action or REST location path: + - "http://sap.com/xi/WebService/soap1.1" + + - Addressing input action: "http://sap.com/xi/WebService/soap1.1" + +C stub function (defined in soapClient.c[pp] generated by soapcpp2): +@code + int soap_send___ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN( + struct soap *soap, + NULL, // char *endpoint = NULL selects default endpoint for this operation + NULL, // char *action = NULL selects default action for this operation + // input parameters: + ns1__DT_USCOREBOM_USCORES4_USCOREREQ* ns1__MT_USCOREBOM_USCORES4_USCOREREQ, + ); +@endcode + +C server function (called from the service dispatcher defined in soapServer.c[pp]): +@code + int __ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN( + struct soap *soap, + // input parameters: + ns1__DT_USCOREBOM_USCORES4_USCOREREQ* ns1__MT_USCOREBOM_USCORES4_USCOREREQ, + // output parameters: + ); +@endcode + +C++ proxy class (defined in soapSIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy.h generated with soapcpp2): +@code + class SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy; +@endcode +Important: use soapcpp2 option '-j' (or '-i') to generate improved and easy-to-use proxy classes; + +C++ service class (defined in soapSIO_USCOREBOM_USCOREPLM_USCOREASYNBindingService.h generated with soapcpp2): +@code + class SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingService; +@endcode +Important: use soapcpp2 option '-j' (or '-i') to generate improved and easy-to-use service classes; + +*/ + +//gsoap ns1 service method-protocol: SIO_USCOREBOM_USCOREPLM_USCOREASYN SOAP +//gsoap ns1 service method-style: SIO_USCOREBOM_USCOREPLM_USCOREASYN document +//gsoap ns1 service method-encoding: SIO_USCOREBOM_USCOREPLM_USCOREASYN literal +//gsoap ns1 service method-input-action: SIO_USCOREBOM_USCOREPLM_USCOREASYN http://sap.com/xi/WebService/soap1.1 +int __ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN( + ns1__DT_USCOREBOM_USCORES4_USCOREREQ* ns1__MT_USCOREBOM_USCORES4_USCOREREQ, ///< Input parameter + void ///< One-way message: no output parameter +); + +/** @page SIO_USCOREBOM_USCOREPLM_USCOREASYNBinding Binding "SIO_USCOREBOM_USCOREPLM_USCOREASYNBinding" + +@section SIO_USCOREBOM_USCOREPLM_USCOREASYNBinding_policy_enablers Policy Enablers of Binding "SIO_USCOREBOM_USCOREPLM_USCOREASYNBinding" + +None specified. + +*/ + +/******************************************************************************\ + * * + * XML Data Binding * + * * +\******************************************************************************/ + + +/** @page page_XMLDataBinding XML Data Binding + +SOAP/XML services use data bindings that are contractually bound by WSDLs and +are auto-generated by wsdl2h and soapcpp2 (see Service Bindings). Plain data +bindings are adopted from XML schemas as part of the WSDL types section or when +running wsdl2h on a set of schemas to produce non-SOAP-based XML data bindings. + +@note The following readers and writers are C/C++ data type (de)serializers +auto-generated by wsdl2h and soapcpp2. Run soapcpp2 on this file to generate the +(de)serialization code, which is stored in soapC.c[pp]. Include "soapH.h" in +your code to import these data type and function declarations. Only use the +soapcpp2-generated files in your project build. Do not include the wsdl2h- +generated .h file in your code. + +@note Data can be read and deserialized from: + - an int file descriptor, using soap->recvfd = fd + - a socket, using soap->socket = (int)... + - a C++ stream (istream, stringstream), using soap->is = (istream*)... + - a C string, using soap->is = (const char*)... + - any input, using the soap->frecv() callback + +@note Data can be serialized and written to: + - an int file descriptor, using soap->sendfd = (int)... + - a socket, using soap->socket = (int)... + - a C++ stream (ostream, stringstream), using soap->os = (ostream*)... + - a C string, using soap->os = (const char**)... + - any output, using the soap->fsend() callback + +@note The following options are available for (de)serialization control: + - soap->encodingStyle = NULL; to remove SOAP 1.1/1.2 encodingStyle + - soap_set_mode(soap, SOAP_XML_TREE); XML without id-ref (no cycles!) + - soap_set_mode(soap, SOAP_XML_GRAPH); XML with id-ref (including cycles) + - soap_set_namespaces(soap, struct Namespace *nsmap); to set xmlns bindings + + +*/ + +/** + +@section ns1 Top-level root elements of schema "urn:chintelectric.com:xi:plm" + + - (use wsdl2h option -g to auto-generate type _ns1__MT_USCOREBOM_USCORES4_USCOREREQ) + +*/ + +/* End of bomtest.h */ diff --git a/DFL_BOM_WL_TOERP/bin/win64/bomtest.wsdl b/DFL_BOM_WL_TOERP/bin/win64/bomtest.wsdl new file mode 100644 index 0000000..1047623 --- /dev/null +++ b/DFL_BOM_WL_TOERP/bin/win64/bomtest.wsdl @@ -0,0 +1 @@ +PPI001-BOM(PLM->SAP)c68354ffdec511e99b900000010495f6b2c41095dec511e997bd94659c5180edb2c41094dec511e9be8c94659c5180edb2c41096dec511e9a95794659c5180edWBS编号b2c41097dec511e98e4194659c5180ed父件料号b2c41098dec511e999ea94659c5180ed工厂b2c41099dec511e9a34a94659c5180edBOM有效起始日期b2c4109adec511e9c99894659c5180edBOM用途b2c4109bdec511e9c49794659c5180ed可选的BOMb2c4109cdec511e9842694659c5180ed基本数量b2c4109ddec511e9ca2394659c5180ed单位b2c4109edec511e9c88194659c5180ed抬头文本b2c4109fdec511e9a2c794659c5180edBOM有效起始日期b2c410a0dec511e99b0f94659c5180ed项目类别b2c410a1dec511e988cb94659c5180ed项目编号b2c410a2dec511e9b75394659c5180edBOM组件b2c410a3dec511e98f2194659c5180ed组件的用量b2c410a4dec511e9b5fe94659c5180ed组件的单位b2c410a5dec511e98c3294659c5180ed排序字符串b2c410a6dec511e996f394659c5180ed文本备注1 \ No newline at end of file diff --git a/DFL_BOM_WL_TOERP/bin/win64/factory.h b/DFL_BOM_WL_TOERP/bin/win64/factory.h new file mode 100644 index 0000000..4104092 --- /dev/null +++ b/DFL_BOM_WL_TOERP/bin/win64/factory.h @@ -0,0 +1,561 @@ +/* factory.h + Generated by wsdl2h 2.8.131 from factory.wsdl and wsmap.dat + 2023-11-28 03:25:39 GMT + + DO NOT INCLUDE THIS ANNOTATED FILE DIRECTLY IN YOUR PROJECT SOURCE CODE. + USE THE FILES GENERATED BY soapcpp2 FOR YOUR PROJECT'S SOURCE CODE. + +gSOAP XML Web services tools +Copyright (C) 2000-2023, Robert van Engelen, Genivia Inc. All Rights Reserved. +This program is released under the GPL with the additional exemption that +compiling, linking, and/or using OpenSSL is allowed. +-------------------------------------------------------------------------------- +A commercial use license is available from Genivia Inc., contact@genivia.com +-------------------------------------------------------------------------------- +*/ + +/** + +@page page_notes Notes + +@note HINTS: + - Run soapcpp2 on factory.h to generate the SOAP/XML processing logic: + Use soapcpp2 -I to specify paths for #import + Use soapcpp2 -j to generate improved proxy and server classes. + Use soapcpp2 -r to generate a report. + - Edit 'typemap.dat' to control namespace bindings and type mappings: + It is strongly recommended to customize the names of the namespace prefixes + generated by wsdl2h. To do so, modify the prefix bindings in the Namespaces + section below and add the modified lines to 'typemap.dat' to rerun wsdl2h. + - Run Doxygen (www.doxygen.org) on this file to generate documentation. + - Use wsdl2h -c to generate pure C code. + - Use wsdl2h -R to include the REST operations defined by the WSDLs. + - Use wsdl2h -O3 or -O4 to optimize by removing unused schema components. + - Use wsdl2h -d to enable DOM support for xsd:any and xsd:anyType. + - Use wsdl2h -F to simulate struct-type derivation in C (also works in C++). + - Use wsdl2h -f to generate flat C++ class hierarchy, removes type derivation. + - Use wsdl2h -g to generate top-level root elements with readers and writers. + - Use wsdl2h -U to map XML names to C++ Unicode identifiers instead of _xNNNN. + - Use wsdl2h -u to disable the generation of unions. + - Use wsdl2h -L to remove this @note and all other @note comments. + - Use wsdl2h -nname to use name as the base namespace prefix instead of 'ns'. + - Use wsdl2h -Nname for service prefix and produce multiple service bindings + - Struct/class members serialized as XML attributes are annotated with a '@'. + - Struct/class members that have a special role are annotated with a '$'. + +@warning + DO NOT INCLUDE THIS ANNOTATED FILE DIRECTLY IN YOUR PROJECT SOURCE CODE. + USE THE FILES GENERATED BY soapcpp2 FOR YOUR PROJECT'S SOURCE CODE: + THE GENERATED soapStub.h FILE CONTAINS THIS CONTENT WITHOUT ANNOTATIONS. + +@copyright LICENSE: +@verbatim +-------------------------------------------------------------------------------- +gSOAP XML Web services tools +Copyright (C) 2000-2023, Robert van Engelen, Genivia Inc. All Rights Reserved. +The wsdl2h tool and its generated software are released under the GPL. +This software is released under the GPL with the additional exemption that +compiling, linking, and/or using OpenSSL is allowed. +-------------------------------------------------------------------------------- +GPL license. + +This program is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free Software +Foundation; either version 2 of the License, or (at your option) any later +version. + +This program is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A +PARTICULAR PURPOSE. See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along with +this program; if not, write to the Free Software Foundation, Inc., 59 Temple +Place, Suite 330, Boston, MA 02111-1307 USA + +Author contact information: +engelen@genivia.com / engelen@acm.org + +This program is released under the GPL with the additional exemption that +compiling, linking, and/or using OpenSSL is allowed. +-------------------------------------------------------------------------------- +A commercial-use license is available from Genivia, Inc., contact@genivia.com +-------------------------------------------------------------------------------- +@endverbatim + +*/ + + +//gsoapopt c++,w + +/******************************************************************************\ + * * + * Definitions * + * urn:chintelectric.com:xi:plm * + * * +\******************************************************************************/ + +/* WSDL Documentation: + +*/ + + +/******************************************************************************\ + * * + * $SIZE typemap variable: * + * int * + * * +\******************************************************************************/ + + +/******************************************************************************\ + * * + * Import * + * * +\******************************************************************************/ + + +/******************************************************************************\ + * * + * Schema Namespaces * + * * +\******************************************************************************/ + + +/* NOTE: + +It is strongly recommended to customize the names of the namespace prefixes +generated by wsdl2h. To do so, modify the prefix bindings below and add the +modified lines to 'typemap.dat' then rerun wsdl2h (use wsdl2h -t typemap.dat): + +ns1 = "urn:chintelectric.com:xi:plm" + +*/ + +#define SOAP_NAMESPACE_OF_ns1 "urn:chintelectric.com:xi:plm" +//gsoap ns1 schema namespace: urn:chintelectric.com:xi:plm +//gsoap ns1 schema form: unqualified + +/******************************************************************************\ + * * + * Built-in Schema Types and Top-Level Elements and Attributes * + * * +\******************************************************************************/ + + +/******************************************************************************\ + * * + * Forward Declarations * + * * +\******************************************************************************/ + + +class ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP; + +class ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ; + + +/******************************************************************************\ + * * + * Schema Types and Top-Level Elements and Attributes * + * urn:chintelectric.com:xi:plm * + * * +\******************************************************************************/ + + +/******************************************************************************\ + * * + * Schema Complex Types and Top-Level Elements * + * urn:chintelectric.com:xi:plm * + * * +\******************************************************************************/ + +/// @brief "urn:chintelectric.com:xi:plm":DT_FACTORY_NUMBER_RSP is a complexType. +/// +///
+/// PPI004PLM->SAP +///
+/// +/// @note class ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP operations: +/// - ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP* soap_new_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP(soap*) allocate and default initialize +/// - ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP* soap_new_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP(soap*, int num) allocate and default initialize an array +/// - ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP* soap_new_req_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP(soap*, ...) allocate, set required members +/// - ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP* soap_new_set_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP(soap*, ...) allocate, set all public members +/// - ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP::soap_default(soap*) default initialize members +/// - int soap_read_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP(soap*, ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP*) deserialize from a stream +/// - int soap_write_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP(soap*, ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP*) serialize to a stream +/// - ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP* ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP::soap_dup(soap*) returns deep copy of ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) +/// - ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP::soap_del() deep deletes ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP data members, use only after ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP::soap_dup(NULL) (use soapcpp2 -Ed) +/// - int ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP::soap_type() returns SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP or derived type identifier +class ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP +{ public: +/// @note class _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO operations: +/// - _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO* soap_new__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(soap*) allocate and default initialize +/// - _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO* soap_new__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(soap*, int num) allocate and default initialize an array +/// - _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO* soap_new_req__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(soap*, ...) allocate, set required members +/// - _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO* soap_new_set__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(soap*, ...) allocate, set all public members +/// - _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO::soap_default(soap*) default initialize members +/// - int soap_read__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(soap*, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO*) deserialize from a stream +/// - int soap_write__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(soap*, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO*) serialize to a stream +/// - _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO* _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO::soap_dup(soap*) returns deep copy of _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) +/// - _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO::soap_del() deep deletes _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO data members, use only after _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO::soap_dup(NULL) (use soapcpp2 -Ed) +/// - int _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO::soap_type() returns SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO or derived type identifier + class _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO + { public: +/// Element "REQ_TRACE_ID" of type xs:string. + char* REQ_USCORETRACE_USCOREID 0; ///< Optional element. + } *RSP_USCOREBASEINFO 0; ///< Optional element. +/// Size of ZTABLE_RETURN array is 0..unbounded. + $ int __sizeZTABLE_USCORERETURN 0; +/// @note class _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN operations: +/// - _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN* soap_new__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(soap*) allocate and default initialize +/// - _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN* soap_new__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(soap*, int num) allocate and default initialize an array +/// - _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN* soap_new_req__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(soap*, ...) allocate, set required members +/// - _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN* soap_new_set__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(soap*, ...) allocate, set all public members +/// - _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN::soap_default(soap*) default initialize members +/// - int soap_read__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(soap*, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN*) deserialize from a stream +/// - int soap_write__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(soap*, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN*) serialize to a stream +/// - _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN* _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN::soap_dup(soap*) returns deep copy of _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) +/// - _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN::soap_del() deep deletes _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN data members, use only after _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN::soap_dup(NULL) (use soapcpp2 -Ed) +/// - int _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN::soap_type() returns SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN or derived type identifier + class _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN + { public: +/// Element "SERNR" of type xs:string. + char* SERNR 0; ///< Optional element. +/// Element "TYPE" of type xs:string. + char* TYPE 0; ///< Optional element. +/// Element "MESSAGE" of type xs:string. + char* MESSAGE 0; ///< Optional element. + } *ZTABLE_USCORERETURN 0; ///< Multiple elements. +/// Pointer to soap context that manages this instance. + struct soap *soap ; +}; + +/// @brief "urn:chintelectric.com:xi:plm":DT_FACTORY_NUMBER_REQ is a complexType. +/// +///
+/// PPI004PLM->SAP +///
+/// +/// @note class ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ operations: +/// - ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ* soap_new_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(soap*) allocate and default initialize +/// - ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ* soap_new_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(soap*, int num) allocate and default initialize an array +/// - ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ* soap_new_req_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(soap*, ...) allocate, set required members +/// - ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ* soap_new_set_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(soap*, ...) allocate, set all public members +/// - ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ::soap_default(soap*) default initialize members +/// - int soap_read_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(soap*, ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ*) deserialize from a stream +/// - int soap_write_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(soap*, ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ*) serialize to a stream +/// - ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ* ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ::soap_dup(soap*) returns deep copy of ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) +/// - ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ::soap_del() deep deletes ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ data members, use only after ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ::soap_dup(NULL) (use soapcpp2 -Ed) +/// - int ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ::soap_type() returns SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ or derived type identifier +class ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ +{ public: +/// @note class _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO operations: +/// - _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO* soap_new__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(soap*) allocate and default initialize +/// - _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO* soap_new__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(soap*, int num) allocate and default initialize an array +/// - _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO* soap_new_req__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(soap*, ...) allocate, set required members +/// - _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO* soap_new_set__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(soap*, ...) allocate, set all public members +/// - _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO::soap_default(soap*) default initialize members +/// - int soap_read__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(soap*, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO*) deserialize from a stream +/// - int soap_write__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(soap*, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO*) serialize to a stream +/// - _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO* _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO::soap_dup(soap*) returns deep copy of _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) +/// - _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO::soap_del() deep deletes _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO data members, use only after _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO::soap_dup(NULL) (use soapcpp2 -Ed) +/// - int _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO::soap_type() returns SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO or derived type identifier + class _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO + { public: +/// Element "REQ_TRACE_ID" of type xs:string. + char* REQ_USCORETRACE_USCOREID 0; ///< Optional element. + } *BASEINFO 0; ///< Optional element. +/// @note class _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS operations: +/// - _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS* soap_new__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(soap*) allocate and default initialize +/// - _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS* soap_new__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(soap*, int num) allocate and default initialize an array +/// - _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS* soap_new_req__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(soap*, ...) allocate, set required members +/// - _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS* soap_new_set__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(soap*, ...) allocate, set all public members +/// - _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS::soap_default(soap*) default initialize members +/// - int soap_read__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(soap*, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS*) deserialize from a stream +/// - int soap_write__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(soap*, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS*) serialize to a stream +/// - _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS* _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS::soap_dup(soap*) returns deep copy of _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) +/// - _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS::soap_del() deep deletes _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS data members, use only after _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS::soap_dup(NULL) (use soapcpp2 -Ed) +/// - int _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS::soap_type() returns SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS or derived type identifier + class _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS + { public: +/// Size of ITEM array is 0..unbounded. + $ int __sizeITEM 0; +/// @note class _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM operations: +/// - _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM* soap_new__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(soap*) allocate and default initialize +/// - _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM* soap_new__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(soap*, int num) allocate and default initialize an array +/// - _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM* soap_new_req__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(soap*, ...) allocate, set required members +/// - _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM* soap_new_set__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(soap*, ...) allocate, set all public members +/// - _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::soap_default(soap*) default initialize members +/// - int soap_read__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(soap*, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM*) deserialize from a stream +/// - int soap_write__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(soap*, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM*) serialize to a stream +/// - _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM* _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::soap_dup(soap*) returns deep copy of _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) +/// - _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::soap_del() deep deletes _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM data members, use only after _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::soap_dup(NULL) (use soapcpp2 -Ed) +/// - int _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::soap_type() returns SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM or derived type identifier + class _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM + { public: + +/// +/// +/// Element "PSPID" of type xs:string. + char* PSPID 0; ///< Optional element. +///
+/// WBS +///
+/// +/// Element "ZPSPID" of type xs:string. + char* ZPSPID 0; ///< Optional element. + +/// +/// +/// Element "MATNR" of type xs:string. + char* MATNR 0; ///< Optional element. + +/// +/// +/// Element "ZZD" of type xs:string. + char* ZZD 0; ///< Optional element. + +/// +/// +/// Element "ZGH" of type xs:string. + char* ZGH 0; ///< Optional element. + +/// +/// +/// Element "SERNR" of type xs:string. + char* SERNR 0; ///< Optional element. + +/// +/// +/// Element "WERKS" of type xs:string. + char* WERKS 0; ///< Optional element. + +/// +/// +/// Element "RSPOS" of type xs:string. + char* RSPOS 0; ///< Optional element. + } *ITEM 0; ///< Multiple elements. + } *ITEMS 0; ///< Optional element. +/// Pointer to soap context that manages this instance. + struct soap *soap ; +}; + + +/******************************************************************************\ + * * + * Additional Top-Level Elements * + * urn:chintelectric.com:xi:plm * + * * +\******************************************************************************/ + +/// @brief Top-level root element "urn:chintelectric.com:xi:plm":MT_FACTORY_NUMBER_REQ of type "urn:chintelectric.com:xi:plm":DT_FACTORY_NUMBER_REQ. +/// @note Use wsdl2h option -g to auto-generate a top-level root element declaration. + +/// @brief Top-level root element "urn:chintelectric.com:xi:plm":MT_FACTORY_NUMBER_RSP of type "urn:chintelectric.com:xi:plm":DT_FACTORY_NUMBER_RSP. +/// @note Use wsdl2h option -g to auto-generate a top-level root element declaration. + + +/******************************************************************************\ + * * + * Additional Top-Level Attributes * + * urn:chintelectric.com:xi:plm * + * * +\******************************************************************************/ + + +/******************************************************************************\ + * * + * Services * + * * +\******************************************************************************/ + + +//gsoap ns1 service name: SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBinding +//gsoap ns1 service type: SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN +//gsoap ns1 service port: http://gfpoapp:50100/XISOAPAdapter/MessageServlet?senderParty=&senderService=BC_CHINT_ELECTRIC&receiverParty=&receiverService=&interface=SI_FACTORY_NUMBER_PLM_OUT_SYN&interfaceNamespace=urn%3Achintelectric.com%3Axi%3Aplm +//gsoap ns1 service port: https://gfpoapp:50101/XISOAPAdapter/MessageServlet?senderParty=&senderService=BC_CHINT_ELECTRIC&receiverParty=&receiverService=&interface=SI_FACTORY_NUMBER_PLM_OUT_SYN&interfaceNamespace=urn%3Achintelectric.com%3Axi%3Aplm +//gsoap ns1 service namespace: urn:chintelectric.com:xi:plm +//gsoap ns1 service transport: http://schemas.xmlsoap.org/soap/http + +/** @mainpage SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN Definitions + +@section SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN_documentation Documentation + +@section SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN_bindings Service Bindings + + - @ref SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBinding + +@section SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN_more More Information + + - @ref page_notes "Notes" + + - @ref page_XMLDataBinding "XML Data Binding" + + - @ref SOAP_ENV__Header "SOAP Header Content" (when applicable) + + - @ref SOAP_ENV__Detail "SOAP Fault Detail Content" (when applicable) + + +*/ + +/** @page SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBinding Binding "SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBinding" + +@section SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBinding_operations Operations of Binding "SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBinding" + + - @ref __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN + +@section SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBinding_ports Default endpoints of Binding "SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBinding" + + - http://gfpoapp:50100/XISOAPAdapter/MessageServlet?senderParty=&senderService=BC_CHINT_ELECTRIC&receiverParty=&receiverService=&interface=SI_FACTORY_NUMBER_PLM_OUT_SYN&interfaceNamespace=urn%3Achintelectric.com%3Axi%3Aplm + + - https://gfpoapp:50101/XISOAPAdapter/MessageServlet?senderParty=&senderService=BC_CHINT_ELECTRIC&receiverParty=&receiverService=&interface=SI_FACTORY_NUMBER_PLM_OUT_SYN&interfaceNamespace=urn%3Achintelectric.com%3Axi%3Aplm + +@note Use wsdl2h option -Nname to change the service binding prefix name + + +*/ + +/******************************************************************************\ + * * + * Service Binding * + * SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBinding * + * * +\******************************************************************************/ + + +/******************************************************************************\ + * * + * Service Operation * + * __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN * + * * +\******************************************************************************/ + + +/** Operation "__ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN" of service binding "SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBinding". + + - WS-Policy applicable to the operation: + + - SOAP document/literal style messaging + + - Default endpoints: + - http://gfpoapp:50100/XISOAPAdapter/MessageServlet?senderParty=&senderService=BC_CHINT_ELECTRIC&receiverParty=&receiverService=&interface=SI_FACTORY_NUMBER_PLM_OUT_SYN&interfaceNamespace=urn%3Achintelectric.com%3Axi%3Aplm + - https://gfpoapp:50101/XISOAPAdapter/MessageServlet?senderParty=&senderService=BC_CHINT_ELECTRIC&receiverParty=&receiverService=&interface=SI_FACTORY_NUMBER_PLM_OUT_SYN&interfaceNamespace=urn%3Achintelectric.com%3Axi%3Aplm + + - Default SOAP action or REST location path: + - "http://sap.com/xi/WebService/soap1.1" + + - Addressing input action: "http://sap.com/xi/WebService/soap1.1" + + - Addressing output action: "http://sap.com/xi/WebService/soap1.1Response" + +C stub function (defined in soapClient.c[pp] generated by soapcpp2): +@code + int soap_call___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN( + struct soap *soap, + NULL, // char *endpoint = NULL selects default endpoint for this operation + NULL, // char *action = NULL selects default action for this operation + // input parameters: + ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ* ns1__MT_USCOREFACTORY_USCORENUMBER_USCOREREQ, + // output parameters: + ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP&ns1__MT_USCOREFACTORY_USCORENUMBER_USCORERSP + ); +@endcode + +C server function (called from the service dispatcher defined in soapServer.c[pp]): +@code + int __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN( + struct soap *soap, + // input parameters: + ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ* ns1__MT_USCOREFACTORY_USCORENUMBER_USCOREREQ, + // output parameters: + ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP&ns1__MT_USCOREFACTORY_USCORENUMBER_USCORERSP + ); +@endcode + +C++ proxy class (defined in soapSI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy.h generated with soapcpp2): +@code + class SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy; +@endcode +Important: use soapcpp2 option '-j' (or '-i') to generate improved and easy-to-use proxy classes; + +C++ service class (defined in soapSI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingService.h generated with soapcpp2): +@code + class SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingService; +@endcode +Important: use soapcpp2 option '-j' (or '-i') to generate improved and easy-to-use service classes; + +*/ + +//gsoap ns1 service method-protocol: SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN SOAP +//gsoap ns1 service method-style: SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN document +//gsoap ns1 service method-encoding: SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN literal +//gsoap ns1 service method-input-action: SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN http://sap.com/xi/WebService/soap1.1 +//gsoap ns1 service method-output-action: SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN http://sap.com/xi/WebService/soap1.1Response +int __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN( + ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ* ns1__MT_USCOREFACTORY_USCORENUMBER_USCOREREQ, ///< Input parameter + ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP&ns1__MT_USCOREFACTORY_USCORENUMBER_USCORERSP ///< Output parameter +); + +/** @page SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBinding Binding "SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBinding" + +@section SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBinding_policy_enablers Policy Enablers of Binding "SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBinding" + +None specified. + +*/ + +/******************************************************************************\ + * * + * XML Data Binding * + * * +\******************************************************************************/ + + +/** @page page_XMLDataBinding XML Data Binding + +SOAP/XML services use data bindings that are contractually bound by WSDLs and +are auto-generated by wsdl2h and soapcpp2 (see Service Bindings). Plain data +bindings are adopted from XML schemas as part of the WSDL types section or when +running wsdl2h on a set of schemas to produce non-SOAP-based XML data bindings. + +@note The following readers and writers are C/C++ data type (de)serializers +auto-generated by wsdl2h and soapcpp2. Run soapcpp2 on this file to generate the +(de)serialization code, which is stored in soapC.c[pp]. Include "soapH.h" in +your code to import these data type and function declarations. Only use the +soapcpp2-generated files in your project build. Do not include the wsdl2h- +generated .h file in your code. + +@note Data can be read and deserialized from: + - an int file descriptor, using soap->recvfd = fd + - a socket, using soap->socket = (int)... + - a C++ stream (istream, stringstream), using soap->is = (istream*)... + - a C string, using soap->is = (const char*)... + - any input, using the soap->frecv() callback + +@note Data can be serialized and written to: + - an int file descriptor, using soap->sendfd = (int)... + - a socket, using soap->socket = (int)... + - a C++ stream (ostream, stringstream), using soap->os = (ostream*)... + - a C string, using soap->os = (const char**)... + - any output, using the soap->fsend() callback + +@note The following options are available for (de)serialization control: + - soap->encodingStyle = NULL; to remove SOAP 1.1/1.2 encodingStyle + - soap_set_mode(soap, SOAP_XML_TREE); XML without id-ref (no cycles!) + - soap_set_mode(soap, SOAP_XML_GRAPH); XML with id-ref (including cycles) + - soap_set_namespaces(soap, struct Namespace *nsmap); to set xmlns bindings + + +*/ + +/** + +@section ns1 Top-level root elements of schema "urn:chintelectric.com:xi:plm" + + - (use wsdl2h option -g to auto-generate type _ns1__MT_USCOREFACTORY_USCORENUMBER_USCOREREQ) + + - (use wsdl2h option -g to auto-generate type _ns1__MT_USCOREFACTORY_USCORENUMBER_USCORERSP) + +*/ + +/* End of factory.h */ diff --git a/DFL_BOM_WL_TOERP/bin/win64/factory.wsdl b/DFL_BOM_WL_TOERP/bin/win64/factory.wsdl new file mode 100644 index 0000000..9f25c61 --- /dev/null +++ b/DFL_BOM_WL_TOERP/bin/win64/factory.wsdl @@ -0,0 +1 @@ +PPI004出厂编号PLM->SAP748c17a6067d11eaa3a70000010495f6PPI004出厂编号PLM->SAP77bf5ae8117911eaaa870000010495f6ca6c7643117811ea8ef094659c5180ecca6c7642117811ea81e994659c5180ecca6c7646117811eaa8b594659c5180ecca6c7645117811ea88f294659c5180ec2a9617b7067d11eaa2e294659c5180ed项目号2a9617b8067d11eaa19a94659c5180edWBS号2a9617b9067d11eaa6ae94659c5180ed物料编码2a9617ba067d11eac88694659c5180ed站点2a9617bb067d11ea914494659c5180ed柜号2a9617bc067d11ea93f894659c5180ed出厂编号2a9617bd067d11eac16d94659c5180ed工厂ca6c7644117811eaccd694659c5180ec行号 \ No newline at end of file diff --git a/DFL_BOM_WL_TOERP/bin/win64/soapC.cpp b/DFL_BOM_WL_TOERP/bin/win64/soapC.cpp new file mode 100644 index 0000000..14a28b7 --- /dev/null +++ b/DFL_BOM_WL_TOERP/bin/win64/soapC.cpp @@ -0,0 +1,3192 @@ +/* soapC.cpp + Generated by gSOAP 2.8.131 for factory.h + +gSOAP XML Web services tools +Copyright (C) 2000-2023, Robert van Engelen, Genivia Inc. All Rights Reserved. +The soapcpp2 tool and its generated software are released under the GPL. +This program is released under the GPL with the additional exemption that +compiling, linking, and/or using OpenSSL is allowed. +-------------------------------------------------------------------------------- +A commercial use license is available from Genivia Inc., contact@genivia.com +-------------------------------------------------------------------------------- +*/ + +#if defined(__BORLANDC__) +#pragma option push -w-8060 +#pragma option push -w-8004 +#endif + +#include "soapH.h" + +SOAP_SOURCE_STAMP("@(#) soapC.cpp ver 2.8.131 2023-11-28 03:28:36 GMT") + + +#ifndef WITH_NOGLOBAL + +SOAP_FMAC3 int SOAP_FMAC4 soap_getheader(struct soap *soap) +{ + soap->part = SOAP_IN_HEADER; + soap->header = soap_in_SOAP_ENV__Header(soap, "SOAP-ENV:Header", soap->header, NULL); + soap->part = SOAP_END_HEADER; + return soap->header == NULL; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_putheader(struct soap *soap) +{ + if (soap->version && soap->header) + { soap->part = SOAP_IN_HEADER; + if (soap_out_SOAP_ENV__Header(soap, "SOAP-ENV:Header", 0, soap->header, "")) + return soap->error; + soap->part = SOAP_END_HEADER; + } + return SOAP_OK; +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_serializeheader(struct soap *soap) +{ + if (soap->version && soap->header) + soap_serialize_SOAP_ENV__Header(soap, soap->header); +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_header(struct soap *soap) +{ + if (soap->header == NULL) + { if ((soap->header = soap_new_SOAP_ENV__Header(soap))) + soap_default_SOAP_ENV__Header(soap, soap->header); + } +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_fault(struct soap *soap) +{ + if (soap->fault == NULL) + { soap->fault = soap_new_SOAP_ENV__Fault(soap, -1); + if (soap->fault == NULL) + return; + } + if (soap->version == 2 && soap->fault->SOAP_ENV__Code == NULL) + soap->fault->SOAP_ENV__Code = soap_new_SOAP_ENV__Code(soap, -1); + if (soap->version == 2 && soap->fault->SOAP_ENV__Reason == NULL) + soap->fault->SOAP_ENV__Reason = soap_new_SOAP_ENV__Reason(soap, -1); +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_serializefault(struct soap *soap) +{ + if (soap->fault) + soap_serialize_SOAP_ENV__Fault(soap, soap->fault); +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_putfault(struct soap *soap) +{ + if (soap->fault) + return soap_put_SOAP_ENV__Fault(soap, soap->fault, "SOAP-ENV:Fault", ""); + return SOAP_OK; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_getfault(struct soap *soap) +{ + return (soap->fault = soap_get_SOAP_ENV__Fault(soap, NULL, "SOAP-ENV:Fault", NULL)) == NULL; +} + +SOAP_FMAC3 const char ** SOAP_FMAC4 soap_faultcode(struct soap *soap) +{ + soap_fault(soap); + if (soap->fault == NULL) + return NULL; + if (soap->version == 2 && soap->fault->SOAP_ENV__Code) + return (const char**)(void*)&soap->fault->SOAP_ENV__Code->SOAP_ENV__Value; + return (const char**)(void*)&soap->fault->faultcode; +} + +SOAP_FMAC3 const char ** SOAP_FMAC4 soap_faultsubcode(struct soap *soap) +{ + soap_fault(soap); + if (soap->fault == NULL) + return NULL; + if (soap->version == 2 && soap->fault->SOAP_ENV__Code) + { if (soap->fault->SOAP_ENV__Code->SOAP_ENV__Subcode == NULL) + { soap->fault->SOAP_ENV__Code->SOAP_ENV__Subcode = soap_new_SOAP_ENV__Code(soap, -1); + if (soap->fault->SOAP_ENV__Code->SOAP_ENV__Subcode == NULL) + return NULL; + } + return (const char**)(void*)&soap->fault->SOAP_ENV__Code->SOAP_ENV__Subcode->SOAP_ENV__Value; + } + return (const char**)(void*)&soap->fault->faultcode; +} + +SOAP_FMAC3 const char * SOAP_FMAC4 soap_fault_subcode(struct soap *soap) +{ + if (!soap->fault) + return NULL; + if (soap->version == 2) + return soap->fault->SOAP_ENV__Code && soap->fault->SOAP_ENV__Code->SOAP_ENV__Subcode ? soap->fault->SOAP_ENV__Code->SOAP_ENV__Subcode->SOAP_ENV__Value : NULL; + return soap->fault->faultcode; +} + +SOAP_FMAC3 const char ** SOAP_FMAC4 soap_faultstring(struct soap *soap) +{ + soap_fault(soap); + if (soap->fault == NULL) + return NULL; + if (soap->version == 2 && soap->fault->SOAP_ENV__Reason) + return (const char**)(void*)&soap->fault->SOAP_ENV__Reason->SOAP_ENV__Text; + return (const char**)(void*)&soap->fault->faultstring; +} + +SOAP_FMAC3 const char * SOAP_FMAC4 soap_fault_string(struct soap *soap) +{ + const char **s = soap_faultstring(soap); + return s ? *s : NULL; +} + +SOAP_FMAC3 const char ** SOAP_FMAC4 soap_faultdetail(struct soap *soap) +{ + soap_fault(soap); + if (soap->fault == NULL) + return NULL; + if (soap->version == 2) + { if (soap->fault->SOAP_ENV__Detail == NULL) + soap->fault->SOAP_ENV__Detail = soap_new_SOAP_ENV__Detail(soap, -1); + return (const char**)(void*)&soap->fault->SOAP_ENV__Detail->__any; + } + if (soap->fault->detail == NULL) + soap->fault->detail = soap_new_SOAP_ENV__Detail(soap, -1); + return (const char**)(void*)&soap->fault->detail->__any; +} + +SOAP_FMAC3 const char * SOAP_FMAC4 soap_fault_detail(struct soap *soap) +{ + const char **s = soap_faultdetail(soap); + return s ? *s : NULL; +} + +#endif + +#ifndef WITH_NOIDREF +SOAP_FMAC3 int SOAP_FMAC4 soap_getindependent(struct soap *soap) +{ + int t; + if (soap->version == 1) + { for (;;) + { if (!soap_getelement(soap, NULL, &t)) + if ((soap->error && soap->error != SOAP_TAG_MISMATCH) || soap_ignore_element(soap)) + break; + } + } + if (soap->error == SOAP_NO_TAG || soap->error == SOAP_EOF) + soap->error = SOAP_OK; + return soap->error; +} +#endif + +#ifdef __cplusplus +extern "C" { +#endif +SOAP_FMAC3 void * SOAP_FMAC4 soap_getelement(struct soap *soap, const char *tag, int *type) +{ (void)type; + if (soap_peek_element(soap)) + return NULL; +#ifndef WITH_NOIDREF + if (!*soap->id || !(*type = soap_lookup_type(soap, soap->id))) + *type = soap_lookup_type(soap, soap->href); + switch (*type) + { + case SOAP_TYPE_byte: + return soap_in_byte(soap, tag, NULL, "xsd:byte"); + case SOAP_TYPE_int: + return soap_in_int(soap, tag, NULL, "xsd:int"); + case SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ: + return soap_in_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(soap, tag, NULL, "ns1:DT_FACTORY_NUMBER_REQ"); + case SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP: + return soap_in_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP(soap, tag, NULL, "ns1:DT_FACTORY_NUMBER_RSP"); + case SOAP_TYPE_PointerTons1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ: + return soap_in_PointerTons1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(soap, tag, NULL, "ns1:DT_FACTORY_NUMBER_REQ"); + case SOAP_TYPE_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS: + return soap_in_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(soap, tag, NULL, "ns1:DT_FACTORY_NUMBER_REQ-ITEMS"); + case SOAP_TYPE_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM: + return soap_in_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(soap, tag, NULL, "ns1:DT_FACTORY_NUMBER_REQ-ITEMS-ITEM"); + case SOAP_TYPE_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO: + return soap_in_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(soap, tag, NULL, "ns1:DT_FACTORY_NUMBER_REQ-BASEINFO"); + case SOAP_TYPE_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN: + return soap_in_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(soap, tag, NULL, "ns1:DT_FACTORY_NUMBER_RSP-ZTABLE_RETURN"); + case SOAP_TYPE_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO: + return soap_in_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(soap, tag, NULL, "ns1:DT_FACTORY_NUMBER_RSP-RSP_BASEINFO"); + case SOAP_TYPE__QName: + { char **s; + s = soap_in__QName(soap, tag, NULL, "xsd:QName"); + return s ? *s : NULL; + } + case SOAP_TYPE_string: + { char **s; + s = soap_in_string(soap, tag, NULL, "xsd:string"); + return s ? *s : NULL; + } + default: +#else + *type = 0; +#endif + { const char *t = soap->type; + if (!*t) + t = soap->tag; + if (!soap_match_tag(soap, t, "ns1:DT_FACTORY_NUMBER_REQ")) + { *type = SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ; + return soap_in_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(soap, tag, NULL, NULL); + } + if (!soap_match_tag(soap, t, "ns1:DT_FACTORY_NUMBER_RSP")) + { *type = SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP; + return soap_in_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP(soap, tag, NULL, NULL); + } + if (!soap_match_tag(soap, t, "xsd:byte")) + { *type = SOAP_TYPE_byte; + return soap_in_byte(soap, tag, NULL, NULL); + } + if (!soap_match_tag(soap, t, "xsd:int")) + { *type = SOAP_TYPE_int; + return soap_in_int(soap, tag, NULL, NULL); + } + if (!soap_match_tag(soap, t, "xsd:QName")) + { char **s; + *type = SOAP_TYPE__QName; + s = soap_in__QName(soap, tag, NULL, NULL); + return s ? *s : NULL; + } + if (!soap_match_tag(soap, t, "xsd:string")) + { char **s; + *type = SOAP_TYPE_string; + s = soap_in_string(soap, tag, NULL, NULL); + return s ? *s : NULL; + } + t = soap->tag; + if (!soap_match_tag(soap, t, "ns1:DT_FACTORY_NUMBER_REQ-ITEMS-ITEM")) + { *type = SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM; + return soap_in__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(soap, NULL, NULL, NULL); + } + if (!soap_match_tag(soap, t, "ns1:DT_FACTORY_NUMBER_REQ-ITEMS")) + { *type = SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS; + return soap_in__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(soap, NULL, NULL, NULL); + } + if (!soap_match_tag(soap, t, "ns1:DT_FACTORY_NUMBER_REQ-BASEINFO")) + { *type = SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO; + return soap_in__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(soap, NULL, NULL, NULL); + } + if (!soap_match_tag(soap, t, "ns1:DT_FACTORY_NUMBER_RSP-ZTABLE_RETURN")) + { *type = SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN; + return soap_in__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(soap, NULL, NULL, NULL); + } + if (!soap_match_tag(soap, t, "ns1:DT_FACTORY_NUMBER_RSP-RSP_BASEINFO")) + { *type = SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO; + return soap_in__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(soap, NULL, NULL, NULL); + } +#ifndef WITH_NOIDREF + } +#endif + } + soap->error = SOAP_TAG_MISMATCH; + return NULL; +} + +#ifdef __cplusplus +} +#endif + +SOAP_FMAC3 int SOAP_FMAC4 soap_ignore_element(struct soap *soap) +{ + if (!soap_peek_element(soap)) + { int t; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Unexpected element '%s' in input at level = %u body = %d)\n", soap->tag, soap->level, soap->body)); + if (soap->mustUnderstand && !soap->other && !soap->fignore) + return soap->error = SOAP_MUSTUNDERSTAND; + if (((soap->mode & SOAP_XML_STRICT) && !soap->fignore && soap->part != SOAP_IN_HEADER) || !soap_match_tag(soap, soap->tag, "SOAP-ENV:")) + { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "REJECTING element '%s'\n", soap->tag)); + return soap->error = SOAP_TAG_MISMATCH; + } + if (!*soap->id || !soap_getelement(soap, NULL, &t)) + { soap->peeked = 0; + if (soap->fignore) + soap->error = soap->fignore(soap, soap->tag); + else + soap->error = SOAP_OK; + DBGLOG(TEST, if (!soap->error) SOAP_MESSAGE(fdebug, "IGNORING element '%s'\n", soap->tag)); + if (!soap->error && soap->body && soap_ignore(soap)) + return soap->error; + } + } + return soap->error; +} + +#ifndef WITH_NOIDREF +SOAP_FMAC3 int SOAP_FMAC4 soap_putindependent(struct soap *soap) +{ + int i; + struct soap_plist *pp; + if (soap->version == 1 && soap->encodingStyle && !(soap->mode & (SOAP_XML_TREE | SOAP_XML_GRAPH))) + for (i = 0; i < SOAP_PTRHASH; i++) + for (pp = soap->pht[i]; pp; pp = pp->next) + if (pp->mark1 == 2 || pp->mark2 == 2) + if (soap_putelement(soap, pp->ptr, SOAP_MULTIREFTAG, pp->id, pp->type)) + return soap->error; + return SOAP_OK; +} +#endif + +#ifdef __cplusplus +extern "C" { +#endif +SOAP_FMAC3 int SOAP_FMAC4 soap_putelement(struct soap *soap, const void *ptr, const char *tag, int id, int type) +{ (void)tag; + switch (type) + { + case SOAP_TYPE_byte: + return soap_out_byte(soap, tag, id, (const char *)ptr, "xsd:byte"); + case SOAP_TYPE_int: + return soap_out_int(soap, tag, id, (const int *)ptr, "xsd:int"); + case SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM: + return ((_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM *)ptr)->soap_out(soap, "ns1:DT_FACTORY_NUMBER_REQ-ITEMS-ITEM", id, ""); + case SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS: + return ((_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS *)ptr)->soap_out(soap, "ns1:DT_FACTORY_NUMBER_REQ-ITEMS", id, ""); + case SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO: + return ((_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO *)ptr)->soap_out(soap, "ns1:DT_FACTORY_NUMBER_REQ-BASEINFO", id, ""); + case SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN: + return ((_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN *)ptr)->soap_out(soap, "ns1:DT_FACTORY_NUMBER_RSP-ZTABLE_RETURN", id, ""); + case SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO: + return ((_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO *)ptr)->soap_out(soap, "ns1:DT_FACTORY_NUMBER_RSP-RSP_BASEINFO", id, ""); + case SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ: + return ((ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ *)ptr)->soap_out(soap, tag, id, "ns1:DT_FACTORY_NUMBER_REQ"); + case SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP: + return ((ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP *)ptr)->soap_out(soap, tag, id, "ns1:DT_FACTORY_NUMBER_RSP"); + case SOAP_TYPE_PointerTons1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ: + return soap_out_PointerTons1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(soap, tag, id, (ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ *const*)ptr, "ns1:DT_FACTORY_NUMBER_REQ"); + case SOAP_TYPE_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS: + return soap_out_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(soap, tag, id, (_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS *const*)ptr, "ns1:DT_FACTORY_NUMBER_REQ-ITEMS"); + case SOAP_TYPE_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM: + return soap_out_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(soap, tag, id, (_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM *const*)ptr, "ns1:DT_FACTORY_NUMBER_REQ-ITEMS-ITEM"); + case SOAP_TYPE_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO: + return soap_out_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(soap, tag, id, (_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO *const*)ptr, "ns1:DT_FACTORY_NUMBER_REQ-BASEINFO"); + case SOAP_TYPE_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN: + return soap_out_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(soap, tag, id, (_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN *const*)ptr, "ns1:DT_FACTORY_NUMBER_RSP-ZTABLE_RETURN"); + case SOAP_TYPE_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO: + return soap_out_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(soap, tag, id, (_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO *const*)ptr, "ns1:DT_FACTORY_NUMBER_RSP-RSP_BASEINFO"); + case SOAP_TYPE__QName: + return soap_out_string(soap, tag, id, (char*const*)(void*)&ptr, "xsd:QName"); + case SOAP_TYPE_string: + return soap_out_string(soap, tag, id, (char*const*)(void*)&ptr, "xsd:string"); + case 0: + return SOAP_OK; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "soap_putelement '%s' failed for type %d in soapC.cpp\n", tag ? tag : "", type)); + return soap_element_empty(soap, tag, 0, NULL); /* unknown type to serialize */ +} +#ifdef __cplusplus +} +#endif + +#ifndef WITH_NOIDREF + +#ifdef __cplusplus +extern "C" { +#endif +SOAP_FMAC3 void SOAP_FMAC4 soap_markelement(struct soap *soap, const void *ptr, int type) +{ + (void)soap; (void)ptr; (void)type; /* appease -Wall -Werror */ + switch (type) + { + case SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM: + ((_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM *)ptr)->soap_serialize(soap); + break; + case SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS: + ((_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS *)ptr)->soap_serialize(soap); + break; + case SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO: + ((_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO *)ptr)->soap_serialize(soap); + break; + case SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN: + ((_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN *)ptr)->soap_serialize(soap); + break; + case SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO: + ((_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO *)ptr)->soap_serialize(soap); + break; + case SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ: + ((ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ *)ptr)->soap_serialize(soap); + break; + case SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP: + ((ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP *)ptr)->soap_serialize(soap); + break; + case SOAP_TYPE___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN: + soap_serialize___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(soap, (const struct __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN *)ptr); + break; + case SOAP_TYPE_PointerTons1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ: + soap_serialize_PointerTons1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(soap, (ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ *const*)ptr); + break; + case SOAP_TYPE_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS: + soap_serialize_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(soap, (_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS *const*)ptr); + break; + case SOAP_TYPE_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM: + soap_serialize_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(soap, (_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM *const*)ptr); + break; + case SOAP_TYPE_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO: + soap_serialize_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(soap, (_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO *const*)ptr); + break; + case SOAP_TYPE_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN: + soap_serialize_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(soap, (_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN *const*)ptr); + break; + case SOAP_TYPE_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO: + soap_serialize_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(soap, (_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO *const*)ptr); + break; + case SOAP_TYPE__QName: + soap_serialize_string(soap, (char*const*)(void*)&ptr); + break; + case SOAP_TYPE_string: + soap_serialize_string(soap, (char*const*)(void*)&ptr); + break; + } +} +#ifdef __cplusplus +} +#endif +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +SOAP_FMAC3 void * SOAP_FMAC4 soap_dupelement(struct soap *soap, const void *ptr, int type) +{(void)soap; (void)ptr; (void)type; /* appease -Wall -Werror */ + return NULL; +} +#ifdef __cplusplus +} +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +SOAP_FMAC3 void SOAP_FMAC4 soap_delelement(const void *ptr, int type) +{(void)ptr; (void)type; /* appease -Wall -Werror */ +} +#ifdef __cplusplus +} +#endif + +SOAP_FMAC3 void * SOAP_FMAC4 soap_instantiate(struct soap *soap, int t, const char *type, const char *arrayType, size_t *n) +{ (void)type; + switch (t) + { + case SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO: + return (void*)soap_instantiate__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(soap, -1, type, arrayType, n); + case SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN: + return (void*)soap_instantiate__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(soap, -1, type, arrayType, n); + case SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP: + return (void*)soap_instantiate_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP(soap, -1, type, arrayType, n); + case SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO: + return (void*)soap_instantiate__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(soap, -1, type, arrayType, n); + case SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM: + return (void*)soap_instantiate__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(soap, -1, type, arrayType, n); + case SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS: + return (void*)soap_instantiate__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(soap, -1, type, arrayType, n); + case SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ: + return (void*)soap_instantiate_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(soap, -1, type, arrayType, n); + case SOAP_TYPE___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN: + return (void*)soap_instantiate___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(soap, -1, type, arrayType, n); +#ifndef WITH_NOGLOBAL + case SOAP_TYPE_SOAP_ENV__Header: + return (void*)soap_instantiate_SOAP_ENV__Header(soap, -1, type, arrayType, n); +#endif +#ifndef WITH_NOGLOBAL + case SOAP_TYPE_SOAP_ENV__Code: + return (void*)soap_instantiate_SOAP_ENV__Code(soap, -1, type, arrayType, n); +#endif +#ifndef WITH_NOGLOBAL + case SOAP_TYPE_SOAP_ENV__Detail: + return (void*)soap_instantiate_SOAP_ENV__Detail(soap, -1, type, arrayType, n); +#endif +#ifndef WITH_NOGLOBAL + case SOAP_TYPE_SOAP_ENV__Reason: + return (void*)soap_instantiate_SOAP_ENV__Reason(soap, -1, type, arrayType, n); +#endif +#ifndef WITH_NOGLOBAL + case SOAP_TYPE_SOAP_ENV__Fault: + return (void*)soap_instantiate_SOAP_ENV__Fault(soap, -1, type, arrayType, n); +#endif + } + return NULL; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_fdelete(struct soap *soap, struct soap_clist *p) +{ + (void)soap; /* appease -Wall -Werror */ + if (!p->ptr) + return SOAP_OK; + switch (p->type) + { + case SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO: + if (p->size < 0) + SOAP_DELETE(soap, static_cast<_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO*>(p->ptr), _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO); + else + SOAP_DELETE_ARRAY(soap, static_cast<_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO*>(p->ptr), _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO); + break; + case SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN: + if (p->size < 0) + SOAP_DELETE(soap, static_cast<_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN*>(p->ptr), _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN); + else + SOAP_DELETE_ARRAY(soap, static_cast<_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN*>(p->ptr), _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN); + break; + case SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP: + if (p->size < 0) + SOAP_DELETE(soap, static_cast(p->ptr), ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP); + else + SOAP_DELETE_ARRAY(soap, static_cast(p->ptr), ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP); + break; + case SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO: + if (p->size < 0) + SOAP_DELETE(soap, static_cast<_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO*>(p->ptr), _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO); + else + SOAP_DELETE_ARRAY(soap, static_cast<_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO*>(p->ptr), _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO); + break; + case SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM: + if (p->size < 0) + SOAP_DELETE(soap, static_cast<_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM*>(p->ptr), _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM); + else + SOAP_DELETE_ARRAY(soap, static_cast<_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM*>(p->ptr), _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM); + break; + case SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS: + if (p->size < 0) + SOAP_DELETE(soap, static_cast<_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS*>(p->ptr), _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS); + else + SOAP_DELETE_ARRAY(soap, static_cast<_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS*>(p->ptr), _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS); + break; + case SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ: + if (p->size < 0) + SOAP_DELETE(soap, static_cast(p->ptr), ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ); + else + SOAP_DELETE_ARRAY(soap, static_cast(p->ptr), ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ); + break; + case SOAP_TYPE___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN: + if (p->size < 0) + SOAP_DELETE(soap, static_cast(p->ptr), struct __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN); + else + SOAP_DELETE_ARRAY(soap, static_cast(p->ptr), struct __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN); + break; +#ifndef WITH_NOGLOBAL + case SOAP_TYPE_SOAP_ENV__Header: + if (p->size < 0) + SOAP_DELETE(soap, static_cast(p->ptr), struct SOAP_ENV__Header); + else + SOAP_DELETE_ARRAY(soap, static_cast(p->ptr), struct SOAP_ENV__Header); + break; +#endif +#ifndef WITH_NOGLOBAL + case SOAP_TYPE_SOAP_ENV__Code: + if (p->size < 0) + SOAP_DELETE(soap, static_cast(p->ptr), struct SOAP_ENV__Code); + else + SOAP_DELETE_ARRAY(soap, static_cast(p->ptr), struct SOAP_ENV__Code); + break; +#endif +#ifndef WITH_NOGLOBAL + case SOAP_TYPE_SOAP_ENV__Detail: + if (p->size < 0) + SOAP_DELETE(soap, static_cast(p->ptr), struct SOAP_ENV__Detail); + else + SOAP_DELETE_ARRAY(soap, static_cast(p->ptr), struct SOAP_ENV__Detail); + break; +#endif +#ifndef WITH_NOGLOBAL + case SOAP_TYPE_SOAP_ENV__Reason: + if (p->size < 0) + SOAP_DELETE(soap, static_cast(p->ptr), struct SOAP_ENV__Reason); + else + SOAP_DELETE_ARRAY(soap, static_cast(p->ptr), struct SOAP_ENV__Reason); + break; +#endif +#ifndef WITH_NOGLOBAL + case SOAP_TYPE_SOAP_ENV__Fault: + if (p->size < 0) + SOAP_DELETE(soap, static_cast(p->ptr), struct SOAP_ENV__Fault); + else + SOAP_DELETE_ARRAY(soap, static_cast(p->ptr), struct SOAP_ENV__Fault); + break; +#endif + default: + return SOAP_ERR; + } + return SOAP_OK; +} + +#ifdef WIN32 +#pragma warning(push) +// do not warn on switch w/o cases +#pragma warning(disable:4065) +#endif +SOAP_FMAC3 int SOAP_FMAC4 soap_fbase(int t, int b) +{ + (void)t; (void)b; /* appease -Wall -Werror */ + return 0; +} +#ifdef WIN32 +#pragma warning(pop) +#endif + +#ifndef WITH_NOIDREF +#ifdef WIN32 +#pragma warning(push) +// do not warn on switch w/o cases +#pragma warning(disable:4065) +#endif +SOAP_FMAC3 void SOAP_FMAC4 soap_finsert(struct soap *soap, int t, int tt, void *p, size_t index, const void *q, void **x) +{ + (void)soap; (void)t; (void)p; (void)index; (void)q; (void)x; /* appease -Wall -Werror */ + switch (tt) + { + case SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO type=%d location=%p object=%p\n", t, p, q)); + *(_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO*)p = *(_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO*)q; + break; + case SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN type=%d location=%p object=%p\n", t, p, q)); + *(_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN*)p = *(_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN*)q; + break; + case SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP type=%d location=%p object=%p\n", t, p, q)); + *(ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP*)p = *(ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP*)q; + break; + case SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO type=%d location=%p object=%p\n", t, p, q)); + *(_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO*)p = *(_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO*)q; + break; + case SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM type=%d location=%p object=%p\n", t, p, q)); + *(_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM*)p = *(_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM*)q; + break; + case SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS type=%d location=%p object=%p\n", t, p, q)); + *(_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS*)p = *(_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS*)q; + break; + case SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ type=%d location=%p object=%p\n", t, p, q)); + *(ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ*)p = *(ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ*)q; + break; + case SOAP_TYPE___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy struct __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN type=%d location=%p object=%p\n", t, p, q)); + *(struct __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN*)p = *(struct __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN*)q; + break; +#ifndef WITH_NOGLOBAL + case SOAP_TYPE_SOAP_ENV__Header: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy struct SOAP_ENV__Header type=%d location=%p object=%p\n", t, p, q)); + *(struct SOAP_ENV__Header*)p = *(struct SOAP_ENV__Header*)q; + break; +#endif +#ifndef WITH_NOGLOBAL + case SOAP_TYPE_SOAP_ENV__Code: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy struct SOAP_ENV__Code type=%d location=%p object=%p\n", t, p, q)); + *(struct SOAP_ENV__Code*)p = *(struct SOAP_ENV__Code*)q; + break; +#endif +#ifndef WITH_NOGLOBAL + case SOAP_TYPE_SOAP_ENV__Detail: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy struct SOAP_ENV__Detail type=%d location=%p object=%p\n", t, p, q)); + *(struct SOAP_ENV__Detail*)p = *(struct SOAP_ENV__Detail*)q; + break; +#endif +#ifndef WITH_NOGLOBAL + case SOAP_TYPE_SOAP_ENV__Reason: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy struct SOAP_ENV__Reason type=%d location=%p object=%p\n", t, p, q)); + *(struct SOAP_ENV__Reason*)p = *(struct SOAP_ENV__Reason*)q; + break; +#endif +#ifndef WITH_NOGLOBAL + case SOAP_TYPE_SOAP_ENV__Fault: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy struct SOAP_ENV__Fault type=%d location=%p object=%p\n", t, p, q)); + *(struct SOAP_ENV__Fault*)p = *(struct SOAP_ENV__Fault*)q; + break; +#endif + default: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Could not insert type=%d in %d\n", t, tt)); + } +} +#ifdef WIN32 +#pragma warning(pop) +#endif +#endif + +SOAP_FMAC3 int SOAP_FMAC4 soap_out_byte(struct soap *soap, const char *tag, int id, const char *a, const char *type) +{ + return soap_outbyte(soap, tag, id, a, type, SOAP_TYPE_byte); +} + +SOAP_FMAC3 char * SOAP_FMAC4 soap_in_byte(struct soap *soap, const char *tag, char *a, const char *type) +{ + a = soap_inbyte(soap, tag, a, type, SOAP_TYPE_byte); + return a; +} + +SOAP_FMAC3 char * SOAP_FMAC4 soap_new_byte(struct soap *soap, int n) +{ + char *a = static_cast(soap_malloc(soap, (n = (n < 0 ? 1 : n)) * sizeof(char))); + for (char *p = a; p && n--; ++p) + soap_default_byte(soap, p); + return a; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_put_byte(struct soap *soap, const char *a, const char *tag, const char *type) +{ + if (soap_out_byte(soap, tag ? tag : "byte", -2, a, type)) + return soap->error; + return soap_putindependent(soap); +} + +SOAP_FMAC3 char * SOAP_FMAC4 soap_get_byte(struct soap *soap, char *p, const char *tag, const char *type) +{ + if ((p = soap_in_byte(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out_int(struct soap *soap, const char *tag, int id, const int *a, const char *type) +{ + return soap_outint(soap, tag, id, a, type, SOAP_TYPE_int); +} + +SOAP_FMAC3 int * SOAP_FMAC4 soap_in_int(struct soap *soap, const char *tag, int *a, const char *type) +{ + a = soap_inint(soap, tag, a, type, SOAP_TYPE_int); + return a; +} + +SOAP_FMAC3 int * SOAP_FMAC4 soap_new_int(struct soap *soap, int n) +{ + int *a = static_cast(soap_malloc(soap, (n = (n < 0 ? 1 : n)) * sizeof(int))); + for (int *p = a; p && n--; ++p) + soap_default_int(soap, p); + return a; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_put_int(struct soap *soap, const int *a, const char *tag, const char *type) +{ + if (soap_out_int(soap, tag ? tag : "int", -2, a, type)) + return soap->error; + return soap_putindependent(soap); +} + +SOAP_FMAC3 int * SOAP_FMAC4 soap_get_int(struct soap *soap, int *p, const char *tag, const char *type) +{ + if ((p = soap_in_int(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +void _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::soap_default(struct soap *soap) +{ + (void)soap; /* appease -Wall -Werror */ + soap_default_string(soap, &this->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::PSPID); + soap_default_string(soap, &this->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::ZPSPID); + soap_default_string(soap, &this->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::MATNR); + soap_default_string(soap, &this->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::ZZD); + soap_default_string(soap, &this->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::ZGH); + soap_default_string(soap, &this->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::SERNR); + soap_default_string(soap, &this->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::WERKS); + soap_default_string(soap, &this->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::RSPOS); +} + +void _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::soap_serialize(struct soap *soap) const +{ + (void)soap; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + soap_serialize_string(soap, (char*const*)&this->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::PSPID); + soap_serialize_string(soap, (char*const*)&this->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::ZPSPID); + soap_serialize_string(soap, (char*const*)&this->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::MATNR); + soap_serialize_string(soap, (char*const*)&this->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::ZZD); + soap_serialize_string(soap, (char*const*)&this->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::ZGH); + soap_serialize_string(soap, (char*const*)&this->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::SERNR); + soap_serialize_string(soap, (char*const*)&this->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::WERKS); + soap_serialize_string(soap, (char*const*)&this->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::RSPOS); +#endif +} + +int _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::soap_out(struct soap *soap, const char *tag, int id, const char *type) const +{ + return soap_out__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(soap, tag, id, this, type); +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(struct soap *soap, const char *tag, int id, const _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM *a, const char *type) +{ + (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM), type)) + return soap->error; + if (soap_out_string(soap, "PSPID", -1, (char*const*)&a->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::PSPID, "")) + return soap->error; + if (soap_out_string(soap, "ZPSPID", -1, (char*const*)&a->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::ZPSPID, "")) + return soap->error; + if (soap_out_string(soap, "MATNR", -1, (char*const*)&a->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::MATNR, "")) + return soap->error; + if (soap_out_string(soap, "ZZD", -1, (char*const*)&a->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::ZZD, "")) + return soap->error; + if (soap_out_string(soap, "ZGH", -1, (char*const*)&a->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::ZGH, "")) + return soap->error; + if (soap_out_string(soap, "SERNR", -1, (char*const*)&a->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::SERNR, "")) + return soap->error; + if (soap_out_string(soap, "WERKS", -1, (char*const*)&a->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::WERKS, "")) + return soap->error; + if (soap_out_string(soap, "RSPOS", -1, (char*const*)&a->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::RSPOS, "")) + return soap->error; + return soap_element_end_out(soap, tag); +} + +void *_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::soap_in(struct soap *soap, const char *tag, const char *type) +{ + return soap_in__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(soap, tag, this, type); +} + +SOAP_FMAC3 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM * SOAP_FMAC4 soap_in__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(struct soap *soap, const char *tag, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM *a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; + a = (_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM*)soap_id_enter(soap, soap->id, a, SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM, sizeof(_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM), soap->type, soap->arrayType, soap_instantiate, soap_fbase); + if (!a) + return NULL; + if (soap->alloced && soap->alloced != SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM) + { soap_revert(soap); + *soap->id = '\0'; + return (_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM *)a->soap_in(soap, tag, type); + } + if (soap->alloced) + a->soap_default(soap); + size_t soap_flag_PSPID1 = 1; + size_t soap_flag_ZPSPID1 = 1; + size_t soap_flag_MATNR1 = 1; + size_t soap_flag_ZZD1 = 1; + size_t soap_flag_ZGH1 = 1; + size_t soap_flag_SERNR1 = 1; + size_t soap_flag_WERKS1 = 1; + size_t soap_flag_RSPOS1 = 1; + if (soap->body && *soap->href != '#') + { + for (;;) + { soap->error = SOAP_TAG_MISMATCH; + if (soap_flag_PSPID1 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_string(soap, "PSPID", (char**)&a->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::PSPID, "xsd:string")) + { soap_flag_PSPID1--; + continue; + } + } + if (soap_flag_ZPSPID1 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_string(soap, "ZPSPID", (char**)&a->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::ZPSPID, "xsd:string")) + { soap_flag_ZPSPID1--; + continue; + } + } + if (soap_flag_MATNR1 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_string(soap, "MATNR", (char**)&a->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::MATNR, "xsd:string")) + { soap_flag_MATNR1--; + continue; + } + } + if (soap_flag_ZZD1 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_string(soap, "ZZD", (char**)&a->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::ZZD, "xsd:string")) + { soap_flag_ZZD1--; + continue; + } + } + if (soap_flag_ZGH1 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_string(soap, "ZGH", (char**)&a->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::ZGH, "xsd:string")) + { soap_flag_ZGH1--; + continue; + } + } + if (soap_flag_SERNR1 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_string(soap, "SERNR", (char**)&a->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::SERNR, "xsd:string")) + { soap_flag_SERNR1--; + continue; + } + } + if (soap_flag_WERKS1 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_string(soap, "WERKS", (char**)&a->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::WERKS, "xsd:string")) + { soap_flag_WERKS1--; + continue; + } + } + if (soap_flag_RSPOS1 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_string(soap, "RSPOS", (char**)&a->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::RSPOS, "xsd:string")) + { soap_flag_RSPOS1--; + continue; + } + } + if (soap->error == SOAP_TAG_MISMATCH) + soap->error = soap_ignore_element(soap); + if (soap->error == SOAP_NO_TAG) + break; + if (soap->error) + return NULL; + } + if (soap_element_end_in(soap, tag)) + return NULL; + } + else + { a = (_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM, SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM, sizeof(_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM), 0, soap_finsert, soap_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC1 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM * SOAP_FMAC2 soap_instantiate__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "soap_instantiate__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(%p, %d, %s, %s)\n", (void*)soap, n, type?type:"", arrayType?arrayType:"")); + (void)type; (void)arrayType; /* appease -Wall -Werror */ + _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM *p; + size_t k = sizeof(_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM); + struct soap_clist *cp = soap_link(soap, SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM, n, soap_fdelete); + if (!cp && soap && n != SOAP_NO_LINK_TO_DELETE) + return NULL; + if (n < 0) + { p = SOAP_NEW(soap, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM); + } + else + { p = SOAP_NEW_ARRAY(soap, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM, n); + k *= n; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM location=%p n=%d\n", (void*)p, n)); + if (size) + *size = k; + if (!p) + soap->error = SOAP_EOM; + else if (cp) + cp->ptr = (void*)p; + return p; +} + +int _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::soap_put(struct soap *soap, const char *tag, const char *type) const +{ + if (soap_out__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(soap, tag ? tag : "ns1:DT_FACTORY_NUMBER_REQ-ITEMS-ITEM", -2, this, type)) + return soap->error; + return soap_putindependent(soap); +} + +void *_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::soap_get(struct soap *soap, const char *tag, const char *type) +{ + return soap_get__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(soap, this, tag, type); +} + +SOAP_FMAC3 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM * SOAP_FMAC4 soap_get__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(struct soap *soap, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM *p, const char *tag, const char *type) +{ + if ((p = soap_in__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +void _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS::soap_default(struct soap *soap) +{ + (void)soap; /* appease -Wall -Werror */ + this->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS::__sizeITEM = 0; + this->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS::ITEM = NULL; +} + +void _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS::soap_serialize(struct soap *soap) const +{ + (void)soap; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + if (this->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS::ITEM) + { int i; + for (i = 0; i < (int)this->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS::__sizeITEM; i++) + { + soap_embedded(soap, this->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS::ITEM + i, SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM); + this->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS::ITEM[i].soap_serialize(soap); + } + } +#endif +} + +int _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS::soap_out(struct soap *soap, const char *tag, int id, const char *type) const +{ + return soap_out__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(soap, tag, id, this, type); +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(struct soap *soap, const char *tag, int id, const _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS *a, const char *type) +{ + (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS), type)) + return soap->error; + if (a->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS::ITEM) + { int i; + for (i = 0; i < (int)a->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS::__sizeITEM; i++) + if (a->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS::ITEM[i].soap_out(soap, "ITEM", -1, "")) + return soap->error; + } + return soap_element_end_out(soap, tag); +} + +void *_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS::soap_in(struct soap *soap, const char *tag, const char *type) +{ + return soap_in__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(soap, tag, this, type); +} + +SOAP_FMAC3 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS * SOAP_FMAC4 soap_in__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(struct soap *soap, const char *tag, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS *a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; + a = (_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS*)soap_id_enter(soap, soap->id, a, SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS, sizeof(_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS), soap->type, soap->arrayType, soap_instantiate, soap_fbase); + if (!a) + return NULL; + if (soap->alloced && soap->alloced != SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS) + { soap_revert(soap); + *soap->id = '\0'; + return (_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS *)a->soap_in(soap, tag, type); + } + if (soap->alloced) + a->soap_default(soap); + struct soap_blist *soap_blist_ITEM1 = NULL; + if (soap->body && *soap->href != '#') + { + for (;;) + { soap->error = SOAP_TAG_MISMATCH; + if (soap->error == SOAP_TAG_MISMATCH && !soap_element_begin_in(soap, "ITEM", 1, NULL)) + { if (a->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS::ITEM == NULL) + { if (soap_blist_ITEM1 == NULL) + soap_blist_ITEM1 = soap_alloc_block(soap); + a->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS::ITEM = soap_block<_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM>::push(soap, soap_blist_ITEM1); + if (a->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS::ITEM == NULL) + return NULL; + a->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS::ITEM->soap_default(soap); + } + soap_revert(soap); + if (soap_in__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(soap, "ITEM", a->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS::ITEM, "")) + { a->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS::__sizeITEM++; + a->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS::ITEM = NULL; + continue; + } + } + if (soap->error == SOAP_TAG_MISMATCH) + soap->error = soap_ignore_element(soap); + if (soap->error == SOAP_NO_TAG) + break; + if (soap->error) + return NULL; + } + if (a->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS::ITEM) + soap_block<_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM>::pop(soap, soap_blist_ITEM1); + if (a->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS::__sizeITEM) + { a->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS::ITEM = soap_new__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(soap, a->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS::__sizeITEM); + if (!a->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS::ITEM) + return NULL; + soap_block<_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM>::save(soap, soap_blist_ITEM1, a->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS::ITEM); + } + else + { a->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS::ITEM = NULL; + if (soap_blist_ITEM1) + soap_block<_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM>::end(soap, soap_blist_ITEM1); + } + if (soap_element_end_in(soap, tag)) + return NULL; + } + else + { a = (_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS, SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS, sizeof(_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS), 0, soap_finsert, soap_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC1 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS * SOAP_FMAC2 soap_instantiate__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "soap_instantiate__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(%p, %d, %s, %s)\n", (void*)soap, n, type?type:"", arrayType?arrayType:"")); + (void)type; (void)arrayType; /* appease -Wall -Werror */ + _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS *p; + size_t k = sizeof(_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS); + struct soap_clist *cp = soap_link(soap, SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS, n, soap_fdelete); + if (!cp && soap && n != SOAP_NO_LINK_TO_DELETE) + return NULL; + if (n < 0) + { p = SOAP_NEW(soap, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS); + } + else + { p = SOAP_NEW_ARRAY(soap, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS, n); + k *= n; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS location=%p n=%d\n", (void*)p, n)); + if (size) + *size = k; + if (!p) + soap->error = SOAP_EOM; + else if (cp) + cp->ptr = (void*)p; + return p; +} + +int _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS::soap_put(struct soap *soap, const char *tag, const char *type) const +{ + if (soap_out__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(soap, tag ? tag : "ns1:DT_FACTORY_NUMBER_REQ-ITEMS", -2, this, type)) + return soap->error; + return soap_putindependent(soap); +} + +void *_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS::soap_get(struct soap *soap, const char *tag, const char *type) +{ + return soap_get__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(soap, this, tag, type); +} + +SOAP_FMAC3 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS * SOAP_FMAC4 soap_get__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(struct soap *soap, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS *p, const char *tag, const char *type) +{ + if ((p = soap_in__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +void _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO::soap_default(struct soap *soap) +{ + (void)soap; /* appease -Wall -Werror */ + soap_default_string(soap, &this->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO::REQ_USCORETRACE_USCOREID); +} + +void _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO::soap_serialize(struct soap *soap) const +{ + (void)soap; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + soap_serialize_string(soap, (char*const*)&this->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO::REQ_USCORETRACE_USCOREID); +#endif +} + +int _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO::soap_out(struct soap *soap, const char *tag, int id, const char *type) const +{ + return soap_out__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(soap, tag, id, this, type); +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(struct soap *soap, const char *tag, int id, const _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO *a, const char *type) +{ + (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO), type)) + return soap->error; + if (soap_out_string(soap, "REQ_TRACE_ID", -1, (char*const*)&a->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO::REQ_USCORETRACE_USCOREID, "")) + return soap->error; + return soap_element_end_out(soap, tag); +} + +void *_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO::soap_in(struct soap *soap, const char *tag, const char *type) +{ + return soap_in__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(soap, tag, this, type); +} + +SOAP_FMAC3 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO * SOAP_FMAC4 soap_in__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(struct soap *soap, const char *tag, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO *a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; + a = (_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO*)soap_id_enter(soap, soap->id, a, SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO, sizeof(_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO), soap->type, soap->arrayType, soap_instantiate, soap_fbase); + if (!a) + return NULL; + if (soap->alloced && soap->alloced != SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO) + { soap_revert(soap); + *soap->id = '\0'; + return (_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO *)a->soap_in(soap, tag, type); + } + if (soap->alloced) + a->soap_default(soap); + size_t soap_flag_REQ_USCORETRACE_USCOREID1 = 1; + if (soap->body && *soap->href != '#') + { + for (;;) + { soap->error = SOAP_TAG_MISMATCH; + if (soap_flag_REQ_USCORETRACE_USCOREID1 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_string(soap, "REQ_TRACE_ID", (char**)&a->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO::REQ_USCORETRACE_USCOREID, "xsd:string")) + { soap_flag_REQ_USCORETRACE_USCOREID1--; + continue; + } + } + if (soap->error == SOAP_TAG_MISMATCH) + soap->error = soap_ignore_element(soap); + if (soap->error == SOAP_NO_TAG) + break; + if (soap->error) + return NULL; + } + if (soap_element_end_in(soap, tag)) + return NULL; + } + else + { a = (_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO, SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO, sizeof(_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO), 0, soap_finsert, soap_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC1 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO * SOAP_FMAC2 soap_instantiate__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "soap_instantiate__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(%p, %d, %s, %s)\n", (void*)soap, n, type?type:"", arrayType?arrayType:"")); + (void)type; (void)arrayType; /* appease -Wall -Werror */ + _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO *p; + size_t k = sizeof(_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO); + struct soap_clist *cp = soap_link(soap, SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO, n, soap_fdelete); + if (!cp && soap && n != SOAP_NO_LINK_TO_DELETE) + return NULL; + if (n < 0) + { p = SOAP_NEW(soap, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO); + } + else + { p = SOAP_NEW_ARRAY(soap, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO, n); + k *= n; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO location=%p n=%d\n", (void*)p, n)); + if (size) + *size = k; + if (!p) + soap->error = SOAP_EOM; + else if (cp) + cp->ptr = (void*)p; + return p; +} + +int _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO::soap_put(struct soap *soap, const char *tag, const char *type) const +{ + if (soap_out__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(soap, tag ? tag : "ns1:DT_FACTORY_NUMBER_REQ-BASEINFO", -2, this, type)) + return soap->error; + return soap_putindependent(soap); +} + +void *_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO::soap_get(struct soap *soap, const char *tag, const char *type) +{ + return soap_get__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(soap, this, tag, type); +} + +SOAP_FMAC3 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO * SOAP_FMAC4 soap_get__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(struct soap *soap, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO *p, const char *tag, const char *type) +{ + if ((p = soap_in__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +void _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN::soap_default(struct soap *soap) +{ + (void)soap; /* appease -Wall -Werror */ + soap_default_string(soap, &this->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN::SERNR); + soap_default_string(soap, &this->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN::TYPE); + soap_default_string(soap, &this->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN::MESSAGE); +} + +void _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN::soap_serialize(struct soap *soap) const +{ + (void)soap; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + soap_serialize_string(soap, (char*const*)&this->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN::SERNR); + soap_serialize_string(soap, (char*const*)&this->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN::TYPE); + soap_serialize_string(soap, (char*const*)&this->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN::MESSAGE); +#endif +} + +int _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN::soap_out(struct soap *soap, const char *tag, int id, const char *type) const +{ + return soap_out__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(soap, tag, id, this, type); +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(struct soap *soap, const char *tag, int id, const _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN *a, const char *type) +{ + (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN), type)) + return soap->error; + if (soap_out_string(soap, "SERNR", -1, (char*const*)&a->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN::SERNR, "")) + return soap->error; + if (soap_out_string(soap, "TYPE", -1, (char*const*)&a->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN::TYPE, "")) + return soap->error; + if (soap_out_string(soap, "MESSAGE", -1, (char*const*)&a->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN::MESSAGE, "")) + return soap->error; + return soap_element_end_out(soap, tag); +} + +void *_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN::soap_in(struct soap *soap, const char *tag, const char *type) +{ + return soap_in__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(soap, tag, this, type); +} + +SOAP_FMAC3 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN * SOAP_FMAC4 soap_in__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(struct soap *soap, const char *tag, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN *a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; + a = (_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN*)soap_id_enter(soap, soap->id, a, SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN, sizeof(_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN), soap->type, soap->arrayType, soap_instantiate, soap_fbase); + if (!a) + return NULL; + if (soap->alloced && soap->alloced != SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN) + { soap_revert(soap); + *soap->id = '\0'; + return (_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN *)a->soap_in(soap, tag, type); + } + if (soap->alloced) + a->soap_default(soap); + size_t soap_flag_SERNR1 = 1; + size_t soap_flag_TYPE1 = 1; + size_t soap_flag_MESSAGE1 = 1; + if (soap->body && *soap->href != '#') + { + for (;;) + { soap->error = SOAP_TAG_MISMATCH; + if (soap_flag_SERNR1 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_string(soap, "SERNR", (char**)&a->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN::SERNR, "xsd:string")) + { soap_flag_SERNR1--; + continue; + } + } + if (soap_flag_TYPE1 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_string(soap, "TYPE", (char**)&a->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN::TYPE, "xsd:string")) + { soap_flag_TYPE1--; + continue; + } + } + if (soap_flag_MESSAGE1 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_string(soap, "MESSAGE", (char**)&a->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN::MESSAGE, "xsd:string")) + { soap_flag_MESSAGE1--; + continue; + } + } + if (soap->error == SOAP_TAG_MISMATCH) + soap->error = soap_ignore_element(soap); + if (soap->error == SOAP_NO_TAG) + break; + if (soap->error) + return NULL; + } + if (soap_element_end_in(soap, tag)) + return NULL; + } + else + { a = (_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN, SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN, sizeof(_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN), 0, soap_finsert, soap_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC1 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN * SOAP_FMAC2 soap_instantiate__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "soap_instantiate__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(%p, %d, %s, %s)\n", (void*)soap, n, type?type:"", arrayType?arrayType:"")); + (void)type; (void)arrayType; /* appease -Wall -Werror */ + _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN *p; + size_t k = sizeof(_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN); + struct soap_clist *cp = soap_link(soap, SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN, n, soap_fdelete); + if (!cp && soap && n != SOAP_NO_LINK_TO_DELETE) + return NULL; + if (n < 0) + { p = SOAP_NEW(soap, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN); + } + else + { p = SOAP_NEW_ARRAY(soap, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN, n); + k *= n; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN location=%p n=%d\n", (void*)p, n)); + if (size) + *size = k; + if (!p) + soap->error = SOAP_EOM; + else if (cp) + cp->ptr = (void*)p; + return p; +} + +int _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN::soap_put(struct soap *soap, const char *tag, const char *type) const +{ + if (soap_out__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(soap, tag ? tag : "ns1:DT_FACTORY_NUMBER_RSP-ZTABLE_RETURN", -2, this, type)) + return soap->error; + return soap_putindependent(soap); +} + +void *_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN::soap_get(struct soap *soap, const char *tag, const char *type) +{ + return soap_get__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(soap, this, tag, type); +} + +SOAP_FMAC3 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN * SOAP_FMAC4 soap_get__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(struct soap *soap, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN *p, const char *tag, const char *type) +{ + if ((p = soap_in__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +void _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO::soap_default(struct soap *soap) +{ + (void)soap; /* appease -Wall -Werror */ + soap_default_string(soap, &this->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO::REQ_USCORETRACE_USCOREID); +} + +void _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO::soap_serialize(struct soap *soap) const +{ + (void)soap; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + soap_serialize_string(soap, (char*const*)&this->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO::REQ_USCORETRACE_USCOREID); +#endif +} + +int _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO::soap_out(struct soap *soap, const char *tag, int id, const char *type) const +{ + return soap_out__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(soap, tag, id, this, type); +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(struct soap *soap, const char *tag, int id, const _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO *a, const char *type) +{ + (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO), type)) + return soap->error; + if (soap_out_string(soap, "REQ_TRACE_ID", -1, (char*const*)&a->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO::REQ_USCORETRACE_USCOREID, "")) + return soap->error; + return soap_element_end_out(soap, tag); +} + +void *_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO::soap_in(struct soap *soap, const char *tag, const char *type) +{ + return soap_in__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(soap, tag, this, type); +} + +SOAP_FMAC3 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO * SOAP_FMAC4 soap_in__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(struct soap *soap, const char *tag, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO *a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; + a = (_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO*)soap_id_enter(soap, soap->id, a, SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO, sizeof(_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO), soap->type, soap->arrayType, soap_instantiate, soap_fbase); + if (!a) + return NULL; + if (soap->alloced && soap->alloced != SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO) + { soap_revert(soap); + *soap->id = '\0'; + return (_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO *)a->soap_in(soap, tag, type); + } + if (soap->alloced) + a->soap_default(soap); + size_t soap_flag_REQ_USCORETRACE_USCOREID1 = 1; + if (soap->body && *soap->href != '#') + { + for (;;) + { soap->error = SOAP_TAG_MISMATCH; + if (soap_flag_REQ_USCORETRACE_USCOREID1 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_string(soap, "REQ_TRACE_ID", (char**)&a->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO::REQ_USCORETRACE_USCOREID, "xsd:string")) + { soap_flag_REQ_USCORETRACE_USCOREID1--; + continue; + } + } + if (soap->error == SOAP_TAG_MISMATCH) + soap->error = soap_ignore_element(soap); + if (soap->error == SOAP_NO_TAG) + break; + if (soap->error) + return NULL; + } + if (soap_element_end_in(soap, tag)) + return NULL; + } + else + { a = (_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO, SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO, sizeof(_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO), 0, soap_finsert, soap_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC1 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO * SOAP_FMAC2 soap_instantiate__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "soap_instantiate__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(%p, %d, %s, %s)\n", (void*)soap, n, type?type:"", arrayType?arrayType:"")); + (void)type; (void)arrayType; /* appease -Wall -Werror */ + _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO *p; + size_t k = sizeof(_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO); + struct soap_clist *cp = soap_link(soap, SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO, n, soap_fdelete); + if (!cp && soap && n != SOAP_NO_LINK_TO_DELETE) + return NULL; + if (n < 0) + { p = SOAP_NEW(soap, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO); + } + else + { p = SOAP_NEW_ARRAY(soap, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO, n); + k *= n; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO location=%p n=%d\n", (void*)p, n)); + if (size) + *size = k; + if (!p) + soap->error = SOAP_EOM; + else if (cp) + cp->ptr = (void*)p; + return p; +} + +int _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO::soap_put(struct soap *soap, const char *tag, const char *type) const +{ + if (soap_out__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(soap, tag ? tag : "ns1:DT_FACTORY_NUMBER_RSP-RSP_BASEINFO", -2, this, type)) + return soap->error; + return soap_putindependent(soap); +} + +void *_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO::soap_get(struct soap *soap, const char *tag, const char *type) +{ + return soap_get__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(soap, this, tag, type); +} + +SOAP_FMAC3 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO * SOAP_FMAC4 soap_get__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(struct soap *soap, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO *p, const char *tag, const char *type) +{ + if ((p = soap_in__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +void ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ::soap_default(struct soap *soap) +{ + this->soap = soap; + this->ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ::BASEINFO = NULL; + this->ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ::ITEMS = NULL; +} + +void ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ::soap_serialize(struct soap *soap) const +{ + (void)soap; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + soap_serialize_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(soap, &this->ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ::BASEINFO); + soap_serialize_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(soap, &this->ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ::ITEMS); +#endif +} + +int ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ::soap_out(struct soap *soap, const char *tag, int id, const char *type) const +{ + return soap_out_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(soap, tag, id, this, type); +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(struct soap *soap, const char *tag, int id, const ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ *a, const char *type) +{ + (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ), type)) + return soap->error; + if (soap_out_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(soap, "BASEINFO", -1, &a->ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ::BASEINFO, "")) + return soap->error; + if (soap_out_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(soap, "ITEMS", -1, &a->ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ::ITEMS, "")) + return soap->error; + return soap_element_end_out(soap, tag); +} + +void *ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ::soap_in(struct soap *soap, const char *tag, const char *type) +{ + return soap_in_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(soap, tag, this, type); +} + +SOAP_FMAC3 ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ * SOAP_FMAC4 soap_in_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(struct soap *soap, const char *tag, ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ *a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; + a = (ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ*)soap_id_enter(soap, soap->id, a, SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ, sizeof(ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ), soap->type, soap->arrayType, soap_instantiate, soap_fbase); + if (!a) + return NULL; + if (soap->alloced && soap->alloced != SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ) + { soap_revert(soap); + *soap->id = '\0'; + return (ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ *)a->soap_in(soap, tag, type); + } + if (soap->alloced) + a->soap_default(soap); + size_t soap_flag_BASEINFO1 = 1; + size_t soap_flag_ITEMS1 = 1; + if (soap->body && *soap->href != '#') + { + for (;;) + { soap->error = SOAP_TAG_MISMATCH; + if (soap_flag_BASEINFO1 && soap->error == SOAP_TAG_MISMATCH) + { if (soap_in_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(soap, "BASEINFO", &a->ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ::BASEINFO, "")) + { soap_flag_BASEINFO1--; + continue; + } + } + if (soap_flag_ITEMS1 && soap->error == SOAP_TAG_MISMATCH) + { if (soap_in_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(soap, "ITEMS", &a->ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ::ITEMS, "")) + { soap_flag_ITEMS1--; + continue; + } + } + if (soap->error == SOAP_TAG_MISMATCH) + soap->error = soap_ignore_element(soap); + if (soap->error == SOAP_NO_TAG) + break; + if (soap->error) + return NULL; + } + if (soap_element_end_in(soap, tag)) + return NULL; + } + else + { a = (ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ, SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ, sizeof(ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ), 0, soap_finsert, soap_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC1 ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ * SOAP_FMAC2 soap_instantiate_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "soap_instantiate_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(%p, %d, %s, %s)\n", (void*)soap, n, type?type:"", arrayType?arrayType:"")); + (void)type; (void)arrayType; /* appease -Wall -Werror */ + ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ *p; + size_t k = sizeof(ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ); + struct soap_clist *cp = soap_link(soap, SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ, n, soap_fdelete); + if (!cp && soap && n != SOAP_NO_LINK_TO_DELETE) + return NULL; + if (n < 0) + { p = SOAP_NEW(soap, ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ); + if (p) + p->soap = soap; + } + else + { p = SOAP_NEW_ARRAY(soap, ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ, n); + k *= n; + if (p) + for (int i = 0; i < n; i++) + p[i].soap = soap; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ location=%p n=%d\n", (void*)p, n)); + if (size) + *size = k; + if (!p) + soap->error = SOAP_EOM; + else if (cp) + cp->ptr = (void*)p; + return p; +} + +int ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ::soap_put(struct soap *soap, const char *tag, const char *type) const +{ + if (soap_out_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(soap, tag ? tag : "ns1:DT_FACTORY_NUMBER_REQ", -2, this, type)) + return soap->error; + return soap_putindependent(soap); +} + +void *ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ::soap_get(struct soap *soap, const char *tag, const char *type) +{ + return soap_get_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(soap, this, tag, type); +} + +SOAP_FMAC3 ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ * SOAP_FMAC4 soap_get_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(struct soap *soap, ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ *p, const char *tag, const char *type) +{ + if ((p = soap_in_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +void ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP::soap_default(struct soap *soap) +{ + this->soap = soap; + this->ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP::RSP_USCOREBASEINFO = NULL; + this->ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP::__sizeZTABLE_USCORERETURN = 0; + this->ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP::ZTABLE_USCORERETURN = NULL; +} + +void ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP::soap_serialize(struct soap *soap) const +{ + (void)soap; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + soap_serialize_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(soap, &this->ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP::RSP_USCOREBASEINFO); + if (this->ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP::ZTABLE_USCORERETURN) + { int i; + for (i = 0; i < (int)this->ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP::__sizeZTABLE_USCORERETURN; i++) + { + soap_embedded(soap, this->ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP::ZTABLE_USCORERETURN + i, SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN); + this->ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP::ZTABLE_USCORERETURN[i].soap_serialize(soap); + } + } +#endif +} + +int ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP::soap_out(struct soap *soap, const char *tag, int id, const char *type) const +{ + return soap_out_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP(soap, tag, id, this, type); +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP(struct soap *soap, const char *tag, int id, const ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP *a, const char *type) +{ + (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP), type)) + return soap->error; + if (soap_out_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(soap, "RSP_BASEINFO", -1, &a->ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP::RSP_USCOREBASEINFO, "")) + return soap->error; + if (a->ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP::ZTABLE_USCORERETURN) + { int i; + for (i = 0; i < (int)a->ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP::__sizeZTABLE_USCORERETURN; i++) + if (a->ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP::ZTABLE_USCORERETURN[i].soap_out(soap, "ZTABLE_RETURN", -1, "")) + return soap->error; + } + return soap_element_end_out(soap, tag); +} + +void *ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP::soap_in(struct soap *soap, const char *tag, const char *type) +{ + return soap_in_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP(soap, tag, this, type); +} + +SOAP_FMAC3 ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP * SOAP_FMAC4 soap_in_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP(struct soap *soap, const char *tag, ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP *a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; + a = (ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP*)soap_id_enter(soap, soap->id, a, SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP, sizeof(ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP), soap->type, soap->arrayType, soap_instantiate, soap_fbase); + if (!a) + return NULL; + if (soap->alloced && soap->alloced != SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP) + { soap_revert(soap); + *soap->id = '\0'; + return (ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP *)a->soap_in(soap, tag, type); + } + if (soap->alloced) + a->soap_default(soap); + size_t soap_flag_RSP_USCOREBASEINFO1 = 1; + struct soap_blist *soap_blist_ZTABLE_USCORERETURN1 = NULL; + if (soap->body && *soap->href != '#') + { + for (;;) + { soap->error = SOAP_TAG_MISMATCH; + if (soap_flag_RSP_USCOREBASEINFO1 && soap->error == SOAP_TAG_MISMATCH) + { if (soap_in_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(soap, "RSP_BASEINFO", &a->ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP::RSP_USCOREBASEINFO, "")) + { soap_flag_RSP_USCOREBASEINFO1--; + continue; + } + } + if (soap->error == SOAP_TAG_MISMATCH && !soap_element_begin_in(soap, "ZTABLE_RETURN", 1, NULL)) + { if (a->ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP::ZTABLE_USCORERETURN == NULL) + { if (soap_blist_ZTABLE_USCORERETURN1 == NULL) + soap_blist_ZTABLE_USCORERETURN1 = soap_alloc_block(soap); + a->ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP::ZTABLE_USCORERETURN = soap_block<_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN>::push(soap, soap_blist_ZTABLE_USCORERETURN1); + if (a->ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP::ZTABLE_USCORERETURN == NULL) + return NULL; + a->ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP::ZTABLE_USCORERETURN->soap_default(soap); + } + soap_revert(soap); + if (soap_in__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(soap, "ZTABLE_RETURN", a->ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP::ZTABLE_USCORERETURN, "")) + { a->ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP::__sizeZTABLE_USCORERETURN++; + a->ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP::ZTABLE_USCORERETURN = NULL; + continue; + } + } + if (soap->error == SOAP_TAG_MISMATCH) + soap->error = soap_ignore_element(soap); + if (soap->error == SOAP_NO_TAG) + break; + if (soap->error) + return NULL; + } + if (a->ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP::ZTABLE_USCORERETURN) + soap_block<_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN>::pop(soap, soap_blist_ZTABLE_USCORERETURN1); + if (a->ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP::__sizeZTABLE_USCORERETURN) + { a->ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP::ZTABLE_USCORERETURN = soap_new__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(soap, a->ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP::__sizeZTABLE_USCORERETURN); + if (!a->ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP::ZTABLE_USCORERETURN) + return NULL; + soap_block<_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN>::save(soap, soap_blist_ZTABLE_USCORERETURN1, a->ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP::ZTABLE_USCORERETURN); + } + else + { a->ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP::ZTABLE_USCORERETURN = NULL; + if (soap_blist_ZTABLE_USCORERETURN1) + soap_block<_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN>::end(soap, soap_blist_ZTABLE_USCORERETURN1); + } + if (soap_element_end_in(soap, tag)) + return NULL; + } + else + { a = (ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP, SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP, sizeof(ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP), 0, soap_finsert, soap_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC1 ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP * SOAP_FMAC2 soap_instantiate_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "soap_instantiate_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP(%p, %d, %s, %s)\n", (void*)soap, n, type?type:"", arrayType?arrayType:"")); + (void)type; (void)arrayType; /* appease -Wall -Werror */ + ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP *p; + size_t k = sizeof(ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP); + struct soap_clist *cp = soap_link(soap, SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP, n, soap_fdelete); + if (!cp && soap && n != SOAP_NO_LINK_TO_DELETE) + return NULL; + if (n < 0) + { p = SOAP_NEW(soap, ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP); + if (p) + p->soap = soap; + } + else + { p = SOAP_NEW_ARRAY(soap, ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP, n); + k *= n; + if (p) + for (int i = 0; i < n; i++) + p[i].soap = soap; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP location=%p n=%d\n", (void*)p, n)); + if (size) + *size = k; + if (!p) + soap->error = SOAP_EOM; + else if (cp) + cp->ptr = (void*)p; + return p; +} + +int ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP::soap_put(struct soap *soap, const char *tag, const char *type) const +{ + if (soap_out_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP(soap, tag ? tag : "ns1:DT_FACTORY_NUMBER_RSP", -2, this, type)) + return soap->error; + return soap_putindependent(soap); +} + +void *ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP::soap_get(struct soap *soap, const char *tag, const char *type) +{ + return soap_get_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP(soap, this, tag, type); +} + +SOAP_FMAC3 ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP * SOAP_FMAC4 soap_get_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP(struct soap *soap, ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP *p, const char *tag, const char *type) +{ + if ((p = soap_in_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +#ifndef WITH_NOGLOBAL + +SOAP_FMAC3 void SOAP_FMAC4 soap_default_SOAP_ENV__Fault(struct soap *soap, struct SOAP_ENV__Fault *a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ + soap_default__QName(soap, &a->faultcode); + soap_default_string(soap, &a->faultstring); + soap_default_string(soap, &a->faultactor); + a->detail = NULL; + a->SOAP_ENV__Code = NULL; + a->SOAP_ENV__Reason = NULL; + soap_default_string(soap, &a->SOAP_ENV__Node); + soap_default_string(soap, &a->SOAP_ENV__Role); + a->SOAP_ENV__Detail = NULL; +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_SOAP_ENV__Fault(struct soap *soap, const struct SOAP_ENV__Fault *a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + soap_serialize__QName(soap, (char*const*)&a->faultcode); + soap_serialize_string(soap, (char*const*)&a->faultstring); + soap_serialize_string(soap, (char*const*)&a->faultactor); + soap_serialize_PointerToSOAP_ENV__Detail(soap, &a->detail); + soap_serialize_PointerToSOAP_ENV__Code(soap, &a->SOAP_ENV__Code); + soap_serialize_PointerToSOAP_ENV__Reason(soap, &a->SOAP_ENV__Reason); + soap_serialize_string(soap, (char*const*)&a->SOAP_ENV__Node); + soap_serialize_string(soap, (char*const*)&a->SOAP_ENV__Role); + soap_serialize_PointerToSOAP_ENV__Detail(soap, &a->SOAP_ENV__Detail); +#endif +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out_SOAP_ENV__Fault(struct soap *soap, const char *tag, int id, const struct SOAP_ENV__Fault *a, const char *type) +{ + const char *soap_tmp_faultcode; + soap_tmp_faultcode = soap_QName2s(soap, a->faultcode); + (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE_SOAP_ENV__Fault), type)) + return soap->error; + if (soap_out__QName(soap, "faultcode", -1, (char*const*)(void*)&soap_tmp_faultcode, "")) + return soap->error; + if (soap_out_string(soap, "faultstring", -1, (char*const*)&a->faultstring, "")) + return soap->error; + if (soap_out_string(soap, "faultactor", -1, (char*const*)&a->faultactor, "")) + return soap->error; + if (soap_out_PointerToSOAP_ENV__Detail(soap, "detail", -1, &a->detail, "")) + return soap->error; + if (soap_out_PointerToSOAP_ENV__Code(soap, "SOAP-ENV:Code", -1, &a->SOAP_ENV__Code, "")) + return soap->error; + if (soap_out_PointerToSOAP_ENV__Reason(soap, "SOAP-ENV:Reason", -1, &a->SOAP_ENV__Reason, "")) + return soap->error; + if (soap_out_string(soap, "SOAP-ENV:Node", -1, (char*const*)&a->SOAP_ENV__Node, "")) + return soap->error; + if (soap_out_string(soap, "SOAP-ENV:Role", -1, (char*const*)&a->SOAP_ENV__Role, "")) + return soap->error; + if (soap_out_PointerToSOAP_ENV__Detail(soap, "SOAP-ENV:Detail", -1, &a->SOAP_ENV__Detail, "")) + return soap->error; + return soap_element_end_out(soap, tag); +} + +SOAP_FMAC3 struct SOAP_ENV__Fault * SOAP_FMAC4 soap_in_SOAP_ENV__Fault(struct soap *soap, const char *tag, struct SOAP_ENV__Fault *a, const char *type) +{ + size_t soap_flag_faultcode = 1; + size_t soap_flag_faultstring = 1; + size_t soap_flag_faultactor = 1; + size_t soap_flag_detail = 1; + size_t soap_flag_SOAP_ENV__Code = 1; + size_t soap_flag_SOAP_ENV__Reason = 1; + size_t soap_flag_SOAP_ENV__Node = 1; + size_t soap_flag_SOAP_ENV__Role = 1; + size_t soap_flag_SOAP_ENV__Detail = 1; + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; + (void)type; /* appease -Wall -Werror */ + a = (struct SOAP_ENV__Fault*)soap_id_enter(soap, soap->id, a, SOAP_TYPE_SOAP_ENV__Fault, sizeof(struct SOAP_ENV__Fault), NULL, NULL, NULL, NULL); + if (!a) + return NULL; + soap_default_SOAP_ENV__Fault(soap, a); + if (soap->body && *soap->href != '#') + { + for (;;) + { soap->error = SOAP_TAG_MISMATCH; + if (soap_flag_faultcode && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in__QName(soap, "faultcode", (char**)&a->faultcode, "xsd:QName")) + { soap_flag_faultcode--; + continue; + } + } + if (soap_flag_faultstring && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_string(soap, "faultstring", (char**)&a->faultstring, "xsd:string")) + { soap_flag_faultstring--; + continue; + } + } + if (soap_flag_faultactor && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_string(soap, "faultactor", (char**)&a->faultactor, "xsd:string")) + { soap_flag_faultactor--; + continue; + } + } + if (soap_flag_detail && soap->error == SOAP_TAG_MISMATCH) + { if (soap_in_PointerToSOAP_ENV__Detail(soap, "detail", &a->detail, "")) + { soap_flag_detail--; + continue; + } + } + if (soap_flag_SOAP_ENV__Code && soap->error == SOAP_TAG_MISMATCH) + { if (soap_in_PointerToSOAP_ENV__Code(soap, "SOAP-ENV:Code", &a->SOAP_ENV__Code, "")) + { soap_flag_SOAP_ENV__Code--; + continue; + } + } + if (soap_flag_SOAP_ENV__Reason && soap->error == SOAP_TAG_MISMATCH) + { if (soap_in_PointerToSOAP_ENV__Reason(soap, "SOAP-ENV:Reason", &a->SOAP_ENV__Reason, "")) + { soap_flag_SOAP_ENV__Reason--; + continue; + } + } + if (soap_flag_SOAP_ENV__Node && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_string(soap, "SOAP-ENV:Node", (char**)&a->SOAP_ENV__Node, "xsd:string")) + { soap_flag_SOAP_ENV__Node--; + continue; + } + } + if (soap_flag_SOAP_ENV__Role && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_string(soap, "SOAP-ENV:Role", (char**)&a->SOAP_ENV__Role, "xsd:string")) + { soap_flag_SOAP_ENV__Role--; + continue; + } + } + if (soap_flag_SOAP_ENV__Detail && soap->error == SOAP_TAG_MISMATCH) + { if (soap_in_PointerToSOAP_ENV__Detail(soap, "SOAP-ENV:Detail", &a->SOAP_ENV__Detail, "")) + { soap_flag_SOAP_ENV__Detail--; + continue; + } + } + if (soap->error == SOAP_TAG_MISMATCH) + soap->error = soap_ignore_element(soap); + if (soap->error == SOAP_NO_TAG) + break; + if (soap->error) + return NULL; + } + if (soap_element_end_in(soap, tag)) + return NULL; + } + else + { a = (struct SOAP_ENV__Fault *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE_SOAP_ENV__Fault, SOAP_TYPE_SOAP_ENV__Fault, sizeof(struct SOAP_ENV__Fault), 0, soap_finsert, NULL); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC1 struct SOAP_ENV__Fault * SOAP_FMAC2 soap_instantiate_SOAP_ENV__Fault(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "soap_instantiate_SOAP_ENV__Fault(%p, %d, %s, %s)\n", (void*)soap, n, type?type:"", arrayType?arrayType:"")); + (void)type; (void)arrayType; /* appease -Wall -Werror */ + struct SOAP_ENV__Fault *p; + size_t k = sizeof(struct SOAP_ENV__Fault); + struct soap_clist *cp = soap_link(soap, SOAP_TYPE_SOAP_ENV__Fault, n, soap_fdelete); + if (!cp && soap && n != SOAP_NO_LINK_TO_DELETE) + return NULL; + if (n < 0) + { p = SOAP_NEW(soap, struct SOAP_ENV__Fault); + } + else + { p = SOAP_NEW_ARRAY(soap, struct SOAP_ENV__Fault, n); + k *= n; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated struct SOAP_ENV__Fault location=%p n=%d\n", (void*)p, n)); + if (size) + *size = k; + if (!p) + soap->error = SOAP_EOM; + else if (cp) + cp->ptr = (void*)p; + return p; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_put_SOAP_ENV__Fault(struct soap *soap, const struct SOAP_ENV__Fault *a, const char *tag, const char *type) +{ + if (soap_out_SOAP_ENV__Fault(soap, tag ? tag : "SOAP-ENV:Fault", -2, a, type)) + return soap->error; + return soap_putindependent(soap); +} + +SOAP_FMAC3 struct SOAP_ENV__Fault * SOAP_FMAC4 soap_get_SOAP_ENV__Fault(struct soap *soap, struct SOAP_ENV__Fault *p, const char *tag, const char *type) +{ + if ((p = soap_in_SOAP_ENV__Fault(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +#endif + +#ifndef WITH_NOGLOBAL + +SOAP_FMAC3 void SOAP_FMAC4 soap_default_SOAP_ENV__Reason(struct soap *soap, struct SOAP_ENV__Reason *a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ + soap_default_string(soap, &a->SOAP_ENV__Text); +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_SOAP_ENV__Reason(struct soap *soap, const struct SOAP_ENV__Reason *a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + soap_serialize_string(soap, (char*const*)&a->SOAP_ENV__Text); +#endif +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out_SOAP_ENV__Reason(struct soap *soap, const char *tag, int id, const struct SOAP_ENV__Reason *a, const char *type) +{ + (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE_SOAP_ENV__Reason), type)) + return soap->error; + if (soap->lang) + soap_set_attr(soap, "xml:lang", soap->lang, 1); + if (soap_out_string(soap, "SOAP-ENV:Text", -1, (char*const*)&a->SOAP_ENV__Text, "")) + return soap->error; + return soap_element_end_out(soap, tag); +} + +SOAP_FMAC3 struct SOAP_ENV__Reason * SOAP_FMAC4 soap_in_SOAP_ENV__Reason(struct soap *soap, const char *tag, struct SOAP_ENV__Reason *a, const char *type) +{ + size_t soap_flag_SOAP_ENV__Text = 1; + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; + (void)type; /* appease -Wall -Werror */ + a = (struct SOAP_ENV__Reason*)soap_id_enter(soap, soap->id, a, SOAP_TYPE_SOAP_ENV__Reason, sizeof(struct SOAP_ENV__Reason), NULL, NULL, NULL, NULL); + if (!a) + return NULL; + soap_default_SOAP_ENV__Reason(soap, a); + if (soap->body && *soap->href != '#') + { + for (;;) + { soap->error = SOAP_TAG_MISMATCH; + if (soap_flag_SOAP_ENV__Text && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_string(soap, "SOAP-ENV:Text", (char**)&a->SOAP_ENV__Text, "xsd:string")) + { soap_flag_SOAP_ENV__Text--; + continue; + } + } + if (soap->error == SOAP_TAG_MISMATCH) + soap->error = soap_ignore_element(soap); + if (soap->error == SOAP_NO_TAG) + break; + if (soap->error) + return NULL; + } + if (soap_element_end_in(soap, tag)) + return NULL; + } + else + { a = (struct SOAP_ENV__Reason *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE_SOAP_ENV__Reason, SOAP_TYPE_SOAP_ENV__Reason, sizeof(struct SOAP_ENV__Reason), 0, soap_finsert, NULL); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC1 struct SOAP_ENV__Reason * SOAP_FMAC2 soap_instantiate_SOAP_ENV__Reason(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "soap_instantiate_SOAP_ENV__Reason(%p, %d, %s, %s)\n", (void*)soap, n, type?type:"", arrayType?arrayType:"")); + (void)type; (void)arrayType; /* appease -Wall -Werror */ + struct SOAP_ENV__Reason *p; + size_t k = sizeof(struct SOAP_ENV__Reason); + struct soap_clist *cp = soap_link(soap, SOAP_TYPE_SOAP_ENV__Reason, n, soap_fdelete); + if (!cp && soap && n != SOAP_NO_LINK_TO_DELETE) + return NULL; + if (n < 0) + { p = SOAP_NEW(soap, struct SOAP_ENV__Reason); + } + else + { p = SOAP_NEW_ARRAY(soap, struct SOAP_ENV__Reason, n); + k *= n; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated struct SOAP_ENV__Reason location=%p n=%d\n", (void*)p, n)); + if (size) + *size = k; + if (!p) + soap->error = SOAP_EOM; + else if (cp) + cp->ptr = (void*)p; + return p; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_put_SOAP_ENV__Reason(struct soap *soap, const struct SOAP_ENV__Reason *a, const char *tag, const char *type) +{ + if (soap_out_SOAP_ENV__Reason(soap, tag ? tag : "SOAP-ENV:Reason", -2, a, type)) + return soap->error; + return soap_putindependent(soap); +} + +SOAP_FMAC3 struct SOAP_ENV__Reason * SOAP_FMAC4 soap_get_SOAP_ENV__Reason(struct soap *soap, struct SOAP_ENV__Reason *p, const char *tag, const char *type) +{ + if ((p = soap_in_SOAP_ENV__Reason(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +#endif + +#ifndef WITH_NOGLOBAL + +SOAP_FMAC3 void SOAP_FMAC4 soap_default_SOAP_ENV__Detail(struct soap *soap, struct SOAP_ENV__Detail *a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ + a->__any = NULL; + a->__type = 0; + a->fault = NULL; +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_SOAP_ENV__Detail(struct soap *soap, const struct SOAP_ENV__Detail *a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + soap_markelement(soap, a->fault, a->__type); +#endif +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out_SOAP_ENV__Detail(struct soap *soap, const char *tag, int id, const struct SOAP_ENV__Detail *a, const char *type) +{ + (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE_SOAP_ENV__Detail), type)) + return soap->error; + if (soap_outliteral(soap, "-any", (char*const*)&a->__any, NULL)) + return soap->error; + if (soap_putelement(soap, a->fault, "fault", -1, a->__type)) + return soap->error; + return soap_element_end_out(soap, tag); +} + +SOAP_FMAC3 struct SOAP_ENV__Detail * SOAP_FMAC4 soap_in_SOAP_ENV__Detail(struct soap *soap, const char *tag, struct SOAP_ENV__Detail *a, const char *type) +{ + size_t soap_flag___any = 1; + size_t soap_flag_fault = 1; + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; + (void)type; /* appease -Wall -Werror */ + a = (struct SOAP_ENV__Detail*)soap_id_enter(soap, soap->id, a, SOAP_TYPE_SOAP_ENV__Detail, sizeof(struct SOAP_ENV__Detail), NULL, NULL, NULL, NULL); + if (!a) + return NULL; + soap_default_SOAP_ENV__Detail(soap, a); + if (soap->body && *soap->href != '#') + { + for (;;) + { soap->error = SOAP_TAG_MISMATCH; + if (soap_flag_fault && soap->error == SOAP_TAG_MISMATCH) + { if ((a->fault = soap_getelement(soap, "fault", &a->__type))) + { soap_flag_fault = 0; + continue; + } + } + if (soap_flag___any && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_inliteral(soap, "-any", (char**)&a->__any)) + { soap_flag___any--; + continue; + } + } + if (soap->error == SOAP_TAG_MISMATCH) + soap->error = soap_ignore_element(soap); + if (soap->error == SOAP_NO_TAG) + break; + if (soap->error) + return NULL; + } + if (soap_element_end_in(soap, tag)) + return NULL; + } + else + { a = (struct SOAP_ENV__Detail *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE_SOAP_ENV__Detail, SOAP_TYPE_SOAP_ENV__Detail, sizeof(struct SOAP_ENV__Detail), 0, soap_finsert, NULL); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC1 struct SOAP_ENV__Detail * SOAP_FMAC2 soap_instantiate_SOAP_ENV__Detail(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "soap_instantiate_SOAP_ENV__Detail(%p, %d, %s, %s)\n", (void*)soap, n, type?type:"", arrayType?arrayType:"")); + (void)type; (void)arrayType; /* appease -Wall -Werror */ + struct SOAP_ENV__Detail *p; + size_t k = sizeof(struct SOAP_ENV__Detail); + struct soap_clist *cp = soap_link(soap, SOAP_TYPE_SOAP_ENV__Detail, n, soap_fdelete); + if (!cp && soap && n != SOAP_NO_LINK_TO_DELETE) + return NULL; + if (n < 0) + { p = SOAP_NEW(soap, struct SOAP_ENV__Detail); + } + else + { p = SOAP_NEW_ARRAY(soap, struct SOAP_ENV__Detail, n); + k *= n; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated struct SOAP_ENV__Detail location=%p n=%d\n", (void*)p, n)); + if (size) + *size = k; + if (!p) + soap->error = SOAP_EOM; + else if (cp) + cp->ptr = (void*)p; + return p; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_put_SOAP_ENV__Detail(struct soap *soap, const struct SOAP_ENV__Detail *a, const char *tag, const char *type) +{ + if (soap_out_SOAP_ENV__Detail(soap, tag ? tag : "SOAP-ENV:Detail", -2, a, type)) + return soap->error; + return soap_putindependent(soap); +} + +SOAP_FMAC3 struct SOAP_ENV__Detail * SOAP_FMAC4 soap_get_SOAP_ENV__Detail(struct soap *soap, struct SOAP_ENV__Detail *p, const char *tag, const char *type) +{ + if ((p = soap_in_SOAP_ENV__Detail(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +#endif + +#ifndef WITH_NOGLOBAL + +SOAP_FMAC3 void SOAP_FMAC4 soap_default_SOAP_ENV__Code(struct soap *soap, struct SOAP_ENV__Code *a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ + soap_default__QName(soap, &a->SOAP_ENV__Value); + a->SOAP_ENV__Subcode = NULL; +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_SOAP_ENV__Code(struct soap *soap, const struct SOAP_ENV__Code *a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + soap_serialize__QName(soap, (char*const*)&a->SOAP_ENV__Value); + soap_serialize_PointerToSOAP_ENV__Code(soap, &a->SOAP_ENV__Subcode); +#endif +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out_SOAP_ENV__Code(struct soap *soap, const char *tag, int id, const struct SOAP_ENV__Code *a, const char *type) +{ + const char *soap_tmp_SOAP_ENV__Value; + soap_tmp_SOAP_ENV__Value = soap_QName2s(soap, a->SOAP_ENV__Value); + (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE_SOAP_ENV__Code), type)) + return soap->error; + if (soap_out__QName(soap, "SOAP-ENV:Value", -1, (char*const*)(void*)&soap_tmp_SOAP_ENV__Value, "")) + return soap->error; + if (soap_out_PointerToSOAP_ENV__Code(soap, "SOAP-ENV:Subcode", -1, &a->SOAP_ENV__Subcode, "")) + return soap->error; + return soap_element_end_out(soap, tag); +} + +SOAP_FMAC3 struct SOAP_ENV__Code * SOAP_FMAC4 soap_in_SOAP_ENV__Code(struct soap *soap, const char *tag, struct SOAP_ENV__Code *a, const char *type) +{ + size_t soap_flag_SOAP_ENV__Value = 1; + size_t soap_flag_SOAP_ENV__Subcode = 1; + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; + (void)type; /* appease -Wall -Werror */ + a = (struct SOAP_ENV__Code*)soap_id_enter(soap, soap->id, a, SOAP_TYPE_SOAP_ENV__Code, sizeof(struct SOAP_ENV__Code), NULL, NULL, NULL, NULL); + if (!a) + return NULL; + soap_default_SOAP_ENV__Code(soap, a); + if (soap->body && *soap->href != '#') + { + for (;;) + { soap->error = SOAP_TAG_MISMATCH; + if (soap_flag_SOAP_ENV__Value && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in__QName(soap, "SOAP-ENV:Value", (char**)&a->SOAP_ENV__Value, "xsd:QName")) + { soap_flag_SOAP_ENV__Value--; + continue; + } + } + if (soap_flag_SOAP_ENV__Subcode && soap->error == SOAP_TAG_MISMATCH) + { if (soap_in_PointerToSOAP_ENV__Code(soap, "SOAP-ENV:Subcode", &a->SOAP_ENV__Subcode, "")) + { soap_flag_SOAP_ENV__Subcode--; + continue; + } + } + if (soap->error == SOAP_TAG_MISMATCH) + soap->error = soap_ignore_element(soap); + if (soap->error == SOAP_NO_TAG) + break; + if (soap->error) + return NULL; + } + if (soap_element_end_in(soap, tag)) + return NULL; + } + else + { a = (struct SOAP_ENV__Code *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE_SOAP_ENV__Code, SOAP_TYPE_SOAP_ENV__Code, sizeof(struct SOAP_ENV__Code), 0, soap_finsert, NULL); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC1 struct SOAP_ENV__Code * SOAP_FMAC2 soap_instantiate_SOAP_ENV__Code(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "soap_instantiate_SOAP_ENV__Code(%p, %d, %s, %s)\n", (void*)soap, n, type?type:"", arrayType?arrayType:"")); + (void)type; (void)arrayType; /* appease -Wall -Werror */ + struct SOAP_ENV__Code *p; + size_t k = sizeof(struct SOAP_ENV__Code); + struct soap_clist *cp = soap_link(soap, SOAP_TYPE_SOAP_ENV__Code, n, soap_fdelete); + if (!cp && soap && n != SOAP_NO_LINK_TO_DELETE) + return NULL; + if (n < 0) + { p = SOAP_NEW(soap, struct SOAP_ENV__Code); + } + else + { p = SOAP_NEW_ARRAY(soap, struct SOAP_ENV__Code, n); + k *= n; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated struct SOAP_ENV__Code location=%p n=%d\n", (void*)p, n)); + if (size) + *size = k; + if (!p) + soap->error = SOAP_EOM; + else if (cp) + cp->ptr = (void*)p; + return p; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_put_SOAP_ENV__Code(struct soap *soap, const struct SOAP_ENV__Code *a, const char *tag, const char *type) +{ + if (soap_out_SOAP_ENV__Code(soap, tag ? tag : "SOAP-ENV:Code", -2, a, type)) + return soap->error; + return soap_putindependent(soap); +} + +SOAP_FMAC3 struct SOAP_ENV__Code * SOAP_FMAC4 soap_get_SOAP_ENV__Code(struct soap *soap, struct SOAP_ENV__Code *p, const char *tag, const char *type) +{ + if ((p = soap_in_SOAP_ENV__Code(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +#endif + +#ifndef WITH_NOGLOBAL + +SOAP_FMAC3 void SOAP_FMAC4 soap_default_SOAP_ENV__Header(struct soap *soap, struct SOAP_ENV__Header *a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_SOAP_ENV__Header(struct soap *soap, const struct SOAP_ENV__Header *a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF +#endif +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out_SOAP_ENV__Header(struct soap *soap, const char *tag, int id, const struct SOAP_ENV__Header *a, const char *type) +{ + (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE_SOAP_ENV__Header), type)) + return soap->error; + return soap_element_end_out(soap, tag); +} + +SOAP_FMAC3 struct SOAP_ENV__Header * SOAP_FMAC4 soap_in_SOAP_ENV__Header(struct soap *soap, const char *tag, struct SOAP_ENV__Header *a, const char *type) +{ + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; + (void)type; /* appease -Wall -Werror */ + a = (struct SOAP_ENV__Header*)soap_id_enter(soap, soap->id, a, SOAP_TYPE_SOAP_ENV__Header, sizeof(struct SOAP_ENV__Header), NULL, NULL, NULL, NULL); + if (!a) + return NULL; + soap_default_SOAP_ENV__Header(soap, a); + if (soap->body && *soap->href != '#') + { + for (;;) + { soap->error = SOAP_TAG_MISMATCH; + if (soap->error == SOAP_TAG_MISMATCH) + soap->error = soap_ignore_element(soap); + if (soap->error == SOAP_NO_TAG) + break; + if (soap->error) + return NULL; + } + if (soap_element_end_in(soap, tag)) + return NULL; + } + else + { a = (struct SOAP_ENV__Header *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE_SOAP_ENV__Header, SOAP_TYPE_SOAP_ENV__Header, sizeof(struct SOAP_ENV__Header), 0, soap_finsert, NULL); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC1 struct SOAP_ENV__Header * SOAP_FMAC2 soap_instantiate_SOAP_ENV__Header(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "soap_instantiate_SOAP_ENV__Header(%p, %d, %s, %s)\n", (void*)soap, n, type?type:"", arrayType?arrayType:"")); + (void)type; (void)arrayType; /* appease -Wall -Werror */ + struct SOAP_ENV__Header *p; + size_t k = sizeof(struct SOAP_ENV__Header); + struct soap_clist *cp = soap_link(soap, SOAP_TYPE_SOAP_ENV__Header, n, soap_fdelete); + if (!cp && soap && n != SOAP_NO_LINK_TO_DELETE) + return NULL; + if (n < 0) + { p = SOAP_NEW(soap, struct SOAP_ENV__Header); + } + else + { p = SOAP_NEW_ARRAY(soap, struct SOAP_ENV__Header, n); + k *= n; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated struct SOAP_ENV__Header location=%p n=%d\n", (void*)p, n)); + if (size) + *size = k; + if (!p) + soap->error = SOAP_EOM; + else if (cp) + cp->ptr = (void*)p; + return p; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_put_SOAP_ENV__Header(struct soap *soap, const struct SOAP_ENV__Header *a, const char *tag, const char *type) +{ + if (soap_out_SOAP_ENV__Header(soap, tag ? tag : "SOAP-ENV:Header", -2, a, type)) + return soap->error; + return soap_putindependent(soap); +} + +SOAP_FMAC3 struct SOAP_ENV__Header * SOAP_FMAC4 soap_get_SOAP_ENV__Header(struct soap *soap, struct SOAP_ENV__Header *p, const char *tag, const char *type) +{ + if ((p = soap_in_SOAP_ENV__Header(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +#endif + +SOAP_FMAC3 void SOAP_FMAC4 soap_default___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(struct soap *soap, struct __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN *a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ + a->ns1__MT_USCOREFACTORY_USCORENUMBER_USCOREREQ = NULL; +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(struct soap *soap, const struct __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN *a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + soap_serialize_PointerTons1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(soap, &a->ns1__MT_USCOREFACTORY_USCORENUMBER_USCOREREQ); +#endif +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(struct soap *soap, const char *tag, int id, const struct __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN *a, const char *type) +{ + (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */ + if (soap_out_PointerTons1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(soap, "ns1:MT_FACTORY_NUMBER_REQ", -1, &a->ns1__MT_USCOREFACTORY_USCORENUMBER_USCOREREQ, "")) + return soap->error; + return SOAP_OK; +} + +SOAP_FMAC3 struct __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN * SOAP_FMAC4 soap_in___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(struct soap *soap, const char *tag, struct __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN *a, const char *type) +{ + size_t soap_flag_ns1__MT_USCOREFACTORY_USCORENUMBER_USCOREREQ = 1; + short soap_flag; + (void)tag; (void)type; /* appease -Wall -Werror */ + a = (struct __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN*)soap_id_enter(soap, "", a, SOAP_TYPE___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN, sizeof(struct __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN), NULL, NULL, NULL, NULL); + if (!a) + return NULL; + soap_default___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(soap, a); + for (soap_flag = 0;; soap_flag = 1) + { soap->error = SOAP_TAG_MISMATCH; + if (soap_flag_ns1__MT_USCOREFACTORY_USCORENUMBER_USCOREREQ && soap->error == SOAP_TAG_MISMATCH) + { if (soap_in_PointerTons1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(soap, "ns1:MT_FACTORY_NUMBER_REQ", &a->ns1__MT_USCOREFACTORY_USCORENUMBER_USCOREREQ, "ns1:DT_FACTORY_NUMBER_REQ")) + { soap_flag_ns1__MT_USCOREFACTORY_USCORENUMBER_USCOREREQ--; + continue; + } + } + if (soap->error == SOAP_TAG_MISMATCH && soap_flag) + { soap->error = SOAP_OK; + break; + } + if (soap_flag && soap->error == SOAP_NO_TAG) + break; + if (soap->error) + return NULL; + } + return a; +} + +SOAP_FMAC1 struct __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN * SOAP_FMAC2 soap_instantiate___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "soap_instantiate___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(%p, %d, %s, %s)\n", (void*)soap, n, type?type:"", arrayType?arrayType:"")); + (void)type; (void)arrayType; /* appease -Wall -Werror */ + struct __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN *p; + size_t k = sizeof(struct __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN); + struct soap_clist *cp = soap_link(soap, SOAP_TYPE___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN, n, soap_fdelete); + if (!cp && soap && n != SOAP_NO_LINK_TO_DELETE) + return NULL; + if (n < 0) + { p = SOAP_NEW(soap, struct __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN); + } + else + { p = SOAP_NEW_ARRAY(soap, struct __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN, n); + k *= n; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated struct __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN location=%p n=%d\n", (void*)p, n)); + if (size) + *size = k; + if (!p) + soap->error = SOAP_EOM; + else if (cp) + cp->ptr = (void*)p; + return p; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_put___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(struct soap *soap, const struct __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN *a, const char *tag, const char *type) +{ + if (soap_out___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(soap, tag ? tag : "-ns1:SI_FACTORY_NUMBER_PLM_OUT_SYN", -2, a, type)) + return soap->error; + return SOAP_OK; +} + +SOAP_FMAC3 struct __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN * SOAP_FMAC4 soap_get___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(struct soap *soap, struct __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN *p, const char *tag, const char *type) +{ + if ((p = soap_in___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +#ifndef WITH_NOGLOBAL + +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerToSOAP_ENV__Reason(struct soap *soap, struct SOAP_ENV__Reason *const*a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + if (!soap_reference(soap, *a, SOAP_TYPE_SOAP_ENV__Reason)) + soap_serialize_SOAP_ENV__Reason(soap, *a); +#endif +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerToSOAP_ENV__Reason(struct soap *soap, const char *tag, int id, struct SOAP_ENV__Reason *const*a, const char *type) +{ + id = soap_element_id(soap, tag, id, *a, NULL, 0, type, SOAP_TYPE_SOAP_ENV__Reason, NULL); + if (id < 0) + return soap->error; + return soap_out_SOAP_ENV__Reason(soap, tag, id, *a, type); +} + +SOAP_FMAC3 struct SOAP_ENV__Reason ** SOAP_FMAC4 soap_in_PointerToSOAP_ENV__Reason(struct soap *soap, const char *tag, struct SOAP_ENV__Reason **a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 1, NULL)) + return NULL; + if (!a) + if (!(a = (struct SOAP_ENV__Reason **)soap_malloc(soap, sizeof(struct SOAP_ENV__Reason *)))) + return NULL; + *a = NULL; + if (!soap->null && *soap->href != '#') + { soap_revert(soap); + if (!(*a = soap_in_SOAP_ENV__Reason(soap, tag, *a, type))) + return NULL; + } + else + { a = (struct SOAP_ENV__Reason **)soap_id_lookup(soap, soap->href, (void**)a, SOAP_TYPE_SOAP_ENV__Reason, sizeof(struct SOAP_ENV__Reason), 0, NULL); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerToSOAP_ENV__Reason(struct soap *soap, struct SOAP_ENV__Reason *const*a, const char *tag, const char *type) +{ + if (soap_out_PointerToSOAP_ENV__Reason(soap, tag ? tag : "SOAP-ENV:Reason", -2, a, type)) + return soap->error; + return soap_putindependent(soap); +} + +SOAP_FMAC3 struct SOAP_ENV__Reason ** SOAP_FMAC4 soap_get_PointerToSOAP_ENV__Reason(struct soap *soap, struct SOAP_ENV__Reason **p, const char *tag, const char *type) +{ + if ((p = soap_in_PointerToSOAP_ENV__Reason(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +#endif + +#ifndef WITH_NOGLOBAL + +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerToSOAP_ENV__Detail(struct soap *soap, struct SOAP_ENV__Detail *const*a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + if (!soap_reference(soap, *a, SOAP_TYPE_SOAP_ENV__Detail)) + soap_serialize_SOAP_ENV__Detail(soap, *a); +#endif +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerToSOAP_ENV__Detail(struct soap *soap, const char *tag, int id, struct SOAP_ENV__Detail *const*a, const char *type) +{ + id = soap_element_id(soap, tag, id, *a, NULL, 0, type, SOAP_TYPE_SOAP_ENV__Detail, NULL); + if (id < 0) + return soap->error; + return soap_out_SOAP_ENV__Detail(soap, tag, id, *a, type); +} + +SOAP_FMAC3 struct SOAP_ENV__Detail ** SOAP_FMAC4 soap_in_PointerToSOAP_ENV__Detail(struct soap *soap, const char *tag, struct SOAP_ENV__Detail **a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 1, NULL)) + return NULL; + if (!a) + if (!(a = (struct SOAP_ENV__Detail **)soap_malloc(soap, sizeof(struct SOAP_ENV__Detail *)))) + return NULL; + *a = NULL; + if (!soap->null && *soap->href != '#') + { soap_revert(soap); + if (!(*a = soap_in_SOAP_ENV__Detail(soap, tag, *a, type))) + return NULL; + } + else + { a = (struct SOAP_ENV__Detail **)soap_id_lookup(soap, soap->href, (void**)a, SOAP_TYPE_SOAP_ENV__Detail, sizeof(struct SOAP_ENV__Detail), 0, NULL); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerToSOAP_ENV__Detail(struct soap *soap, struct SOAP_ENV__Detail *const*a, const char *tag, const char *type) +{ + if (soap_out_PointerToSOAP_ENV__Detail(soap, tag ? tag : "SOAP-ENV:Detail", -2, a, type)) + return soap->error; + return soap_putindependent(soap); +} + +SOAP_FMAC3 struct SOAP_ENV__Detail ** SOAP_FMAC4 soap_get_PointerToSOAP_ENV__Detail(struct soap *soap, struct SOAP_ENV__Detail **p, const char *tag, const char *type) +{ + if ((p = soap_in_PointerToSOAP_ENV__Detail(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +#endif + +#ifndef WITH_NOGLOBAL + +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerToSOAP_ENV__Code(struct soap *soap, struct SOAP_ENV__Code *const*a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + if (!soap_reference(soap, *a, SOAP_TYPE_SOAP_ENV__Code)) + soap_serialize_SOAP_ENV__Code(soap, *a); +#endif +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerToSOAP_ENV__Code(struct soap *soap, const char *tag, int id, struct SOAP_ENV__Code *const*a, const char *type) +{ + char *mark; + id = soap_element_id(soap, tag, id, *a, NULL, 0, type, SOAP_TYPE_SOAP_ENV__Code, &mark); + if (id < 0) + return soap->error; + (void)soap_out_SOAP_ENV__Code(soap, tag, id, *a, type); + soap_unmark(soap, mark); + return soap->error; +} + +SOAP_FMAC3 struct SOAP_ENV__Code ** SOAP_FMAC4 soap_in_PointerToSOAP_ENV__Code(struct soap *soap, const char *tag, struct SOAP_ENV__Code **a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 1, NULL)) + return NULL; + if (!a) + if (!(a = (struct SOAP_ENV__Code **)soap_malloc(soap, sizeof(struct SOAP_ENV__Code *)))) + return NULL; + *a = NULL; + if (!soap->null && *soap->href != '#') + { soap_revert(soap); + if (!(*a = soap_in_SOAP_ENV__Code(soap, tag, *a, type))) + return NULL; + } + else + { a = (struct SOAP_ENV__Code **)soap_id_lookup(soap, soap->href, (void**)a, SOAP_TYPE_SOAP_ENV__Code, sizeof(struct SOAP_ENV__Code), 0, NULL); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerToSOAP_ENV__Code(struct soap *soap, struct SOAP_ENV__Code *const*a, const char *tag, const char *type) +{ + if (soap_out_PointerToSOAP_ENV__Code(soap, tag ? tag : "SOAP-ENV:Code", -2, a, type)) + return soap->error; + return soap_putindependent(soap); +} + +SOAP_FMAC3 struct SOAP_ENV__Code ** SOAP_FMAC4 soap_get_PointerToSOAP_ENV__Code(struct soap *soap, struct SOAP_ENV__Code **p, const char *tag, const char *type) +{ + if ((p = soap_in_PointerToSOAP_ENV__Code(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +#endif + +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerTons1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(struct soap *soap, ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ *const*a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + if (!soap_reference(soap, *a, SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ)) + (*a)->soap_serialize(soap); +#endif +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerTons1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(struct soap *soap, const char *tag, int id, ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ *const*a, const char *type) +{ + id = soap_element_id(soap, tag, id, *a, NULL, 0, type, SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ, NULL); + if (id < 0) + return soap->error; + return (*a)->soap_out(soap, tag, id, (*a)->soap_type() == SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ ? type : NULL); +} + +SOAP_FMAC3 ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ ** SOAP_FMAC4 soap_in_PointerTons1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(struct soap *soap, const char *tag, ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ **a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 1, NULL)) + return NULL; + if (!a) + if (!(a = (ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ **)soap_malloc(soap, sizeof(ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ *)))) + return NULL; + *a = NULL; + if (!soap->null && *soap->href != '#') + { soap_revert(soap); + if (!(*a = (ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ *)soap_instantiate_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(soap, -1, soap->type, soap->arrayType, NULL))) + return NULL; + (*a)->soap_default(soap); + if (!(*a)->soap_in(soap, tag, NULL)) + { *a = NULL; + return NULL; + } + } + else + { a = (ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ **)soap_id_lookup(soap, soap->href, (void**)a, SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ, sizeof(ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ), 0, soap_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerTons1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(struct soap *soap, ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ *const*a, const char *tag, const char *type) +{ + if (soap_out_PointerTons1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(soap, tag ? tag : "ns1:DT_FACTORY_NUMBER_REQ", -2, a, type)) + return soap->error; + return soap_putindependent(soap); +} + +SOAP_FMAC3 ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ ** SOAP_FMAC4 soap_get_PointerTons1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(struct soap *soap, ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ **p, const char *tag, const char *type) +{ + if ((p = soap_in_PointerTons1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(struct soap *soap, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS *const*a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + if (!soap_reference(soap, *a, SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS)) + (*a)->soap_serialize(soap); +#endif +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(struct soap *soap, const char *tag, int id, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS *const*a, const char *type) +{ + id = soap_element_id(soap, tag, id, *a, NULL, 0, type, SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS, NULL); + if (id < 0) + return soap->error; + return (*a)->soap_out(soap, tag, id, (*a)->soap_type() == SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS ? type : NULL); +} + +SOAP_FMAC3 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS ** SOAP_FMAC4 soap_in_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(struct soap *soap, const char *tag, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS **a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 1, NULL)) + return NULL; + if (!a) + if (!(a = (_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS **)soap_malloc(soap, sizeof(_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS *)))) + return NULL; + *a = NULL; + if (!soap->null && *soap->href != '#') + { soap_revert(soap); + if (!(*a = (_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS *)soap_instantiate__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(soap, -1, soap->type, soap->arrayType, NULL))) + return NULL; + (*a)->soap_default(soap); + if (!(*a)->soap_in(soap, tag, NULL)) + { *a = NULL; + return NULL; + } + } + else + { a = (_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS **)soap_id_lookup(soap, soap->href, (void**)a, SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS, sizeof(_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS), 0, soap_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(struct soap *soap, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS *const*a, const char *tag, const char *type) +{ + if (soap_out_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(soap, tag ? tag : "ns1:DT_FACTORY_NUMBER_REQ-ITEMS", -2, a, type)) + return soap->error; + return soap_putindependent(soap); +} + +SOAP_FMAC3 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS ** SOAP_FMAC4 soap_get_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(struct soap *soap, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS **p, const char *tag, const char *type) +{ + if ((p = soap_in_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(struct soap *soap, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM *const*a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + if (!soap_reference(soap, *a, SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM)) + (*a)->soap_serialize(soap); +#endif +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(struct soap *soap, const char *tag, int id, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM *const*a, const char *type) +{ + id = soap_element_id(soap, tag, id, *a, NULL, 0, type, SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM, NULL); + if (id < 0) + return soap->error; + return (*a)->soap_out(soap, tag, id, (*a)->soap_type() == SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM ? type : NULL); +} + +SOAP_FMAC3 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM ** SOAP_FMAC4 soap_in_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(struct soap *soap, const char *tag, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM **a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 1, NULL)) + return NULL; + if (!a) + if (!(a = (_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM **)soap_malloc(soap, sizeof(_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM *)))) + return NULL; + *a = NULL; + if (!soap->null && *soap->href != '#') + { soap_revert(soap); + if (!(*a = (_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM *)soap_instantiate__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(soap, -1, soap->type, soap->arrayType, NULL))) + return NULL; + (*a)->soap_default(soap); + if (!(*a)->soap_in(soap, tag, NULL)) + { *a = NULL; + return NULL; + } + } + else + { a = (_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM **)soap_id_lookup(soap, soap->href, (void**)a, SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM, sizeof(_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM), 0, soap_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(struct soap *soap, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM *const*a, const char *tag, const char *type) +{ + if (soap_out_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(soap, tag ? tag : "ns1:DT_FACTORY_NUMBER_REQ-ITEMS-ITEM", -2, a, type)) + return soap->error; + return soap_putindependent(soap); +} + +SOAP_FMAC3 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM ** SOAP_FMAC4 soap_get_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(struct soap *soap, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM **p, const char *tag, const char *type) +{ + if ((p = soap_in_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(struct soap *soap, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO *const*a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + if (!soap_reference(soap, *a, SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO)) + (*a)->soap_serialize(soap); +#endif +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(struct soap *soap, const char *tag, int id, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO *const*a, const char *type) +{ + id = soap_element_id(soap, tag, id, *a, NULL, 0, type, SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO, NULL); + if (id < 0) + return soap->error; + return (*a)->soap_out(soap, tag, id, (*a)->soap_type() == SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO ? type : NULL); +} + +SOAP_FMAC3 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO ** SOAP_FMAC4 soap_in_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(struct soap *soap, const char *tag, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO **a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 1, NULL)) + return NULL; + if (!a) + if (!(a = (_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO **)soap_malloc(soap, sizeof(_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO *)))) + return NULL; + *a = NULL; + if (!soap->null && *soap->href != '#') + { soap_revert(soap); + if (!(*a = (_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO *)soap_instantiate__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(soap, -1, soap->type, soap->arrayType, NULL))) + return NULL; + (*a)->soap_default(soap); + if (!(*a)->soap_in(soap, tag, NULL)) + { *a = NULL; + return NULL; + } + } + else + { a = (_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO **)soap_id_lookup(soap, soap->href, (void**)a, SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO, sizeof(_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO), 0, soap_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(struct soap *soap, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO *const*a, const char *tag, const char *type) +{ + if (soap_out_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(soap, tag ? tag : "ns1:DT_FACTORY_NUMBER_REQ-BASEINFO", -2, a, type)) + return soap->error; + return soap_putindependent(soap); +} + +SOAP_FMAC3 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO ** SOAP_FMAC4 soap_get_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(struct soap *soap, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO **p, const char *tag, const char *type) +{ + if ((p = soap_in_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(struct soap *soap, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN *const*a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + if (!soap_reference(soap, *a, SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN)) + (*a)->soap_serialize(soap); +#endif +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(struct soap *soap, const char *tag, int id, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN *const*a, const char *type) +{ + id = soap_element_id(soap, tag, id, *a, NULL, 0, type, SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN, NULL); + if (id < 0) + return soap->error; + return (*a)->soap_out(soap, tag, id, (*a)->soap_type() == SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN ? type : NULL); +} + +SOAP_FMAC3 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN ** SOAP_FMAC4 soap_in_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(struct soap *soap, const char *tag, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN **a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 1, NULL)) + return NULL; + if (!a) + if (!(a = (_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN **)soap_malloc(soap, sizeof(_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN *)))) + return NULL; + *a = NULL; + if (!soap->null && *soap->href != '#') + { soap_revert(soap); + if (!(*a = (_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN *)soap_instantiate__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(soap, -1, soap->type, soap->arrayType, NULL))) + return NULL; + (*a)->soap_default(soap); + if (!(*a)->soap_in(soap, tag, NULL)) + { *a = NULL; + return NULL; + } + } + else + { a = (_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN **)soap_id_lookup(soap, soap->href, (void**)a, SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN, sizeof(_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN), 0, soap_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(struct soap *soap, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN *const*a, const char *tag, const char *type) +{ + if (soap_out_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(soap, tag ? tag : "ns1:DT_FACTORY_NUMBER_RSP-ZTABLE_RETURN", -2, a, type)) + return soap->error; + return soap_putindependent(soap); +} + +SOAP_FMAC3 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN ** SOAP_FMAC4 soap_get_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(struct soap *soap, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN **p, const char *tag, const char *type) +{ + if ((p = soap_in_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(struct soap *soap, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO *const*a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + if (!soap_reference(soap, *a, SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO)) + (*a)->soap_serialize(soap); +#endif +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(struct soap *soap, const char *tag, int id, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO *const*a, const char *type) +{ + id = soap_element_id(soap, tag, id, *a, NULL, 0, type, SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO, NULL); + if (id < 0) + return soap->error; + return (*a)->soap_out(soap, tag, id, (*a)->soap_type() == SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO ? type : NULL); +} + +SOAP_FMAC3 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO ** SOAP_FMAC4 soap_in_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(struct soap *soap, const char *tag, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO **a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 1, NULL)) + return NULL; + if (!a) + if (!(a = (_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO **)soap_malloc(soap, sizeof(_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO *)))) + return NULL; + *a = NULL; + if (!soap->null && *soap->href != '#') + { soap_revert(soap); + if (!(*a = (_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO *)soap_instantiate__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(soap, -1, soap->type, soap->arrayType, NULL))) + return NULL; + (*a)->soap_default(soap); + if (!(*a)->soap_in(soap, tag, NULL)) + { *a = NULL; + return NULL; + } + } + else + { a = (_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO **)soap_id_lookup(soap, soap->href, (void**)a, SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO, sizeof(_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO), 0, soap_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(struct soap *soap, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO *const*a, const char *tag, const char *type) +{ + if (soap_out_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(soap, tag ? tag : "ns1:DT_FACTORY_NUMBER_RSP-RSP_BASEINFO", -2, a, type)) + return soap->error; + return soap_putindependent(soap); +} + +SOAP_FMAC3 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO ** SOAP_FMAC4 soap_get_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(struct soap *soap, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO **p, const char *tag, const char *type) +{ + if ((p = soap_in_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize__QName(struct soap *soap, char *const*a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + (void)soap_reference(soap, *a, SOAP_TYPE__QName); +#endif +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out__QName(struct soap *soap, const char *tag, int id, char *const*a, const char *type) +{ + return soap_outstring(soap, tag, id, a, type, SOAP_TYPE__QName); +} + +SOAP_FMAC3 char * * SOAP_FMAC4 soap_in__QName(struct soap *soap, const char *tag, char **a, const char *type) +{ + a = soap_instring(soap, tag, a, type, SOAP_TYPE__QName, 2, 0, -1, NULL); + return a; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_put__QName(struct soap *soap, char *const*a, const char *tag, const char *type) +{ + if (soap_out__QName(soap, tag ? tag : "QName", -2, a, type)) + return soap->error; + return soap_putindependent(soap); +} + +SOAP_FMAC3 char ** SOAP_FMAC4 soap_get__QName(struct soap *soap, char **p, const char *tag, const char *type) +{ + if ((p = soap_in__QName(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_string(struct soap *soap, char *const*a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + (void)soap_reference(soap, *a, SOAP_TYPE_string); +#endif +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out_string(struct soap *soap, const char *tag, int id, char *const*a, const char *type) +{ + return soap_outstring(soap, tag, id, a, type, SOAP_TYPE_string); +} + +SOAP_FMAC3 char * * SOAP_FMAC4 soap_in_string(struct soap *soap, const char *tag, char **a, const char *type) +{ + a = soap_instring(soap, tag, a, type, SOAP_TYPE_string, 1, 0, -1, NULL); + return a; +} + +SOAP_FMAC3 char * * SOAP_FMAC4 soap_new_string(struct soap *soap, int n) +{ + char * *a = static_cast(soap_malloc(soap, (n = (n < 0 ? 1 : n)) * sizeof(char *))); + for (char * *p = a; p && n--; ++p) + soap_default_string(soap, p); + return a; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_put_string(struct soap *soap, char *const*a, const char *tag, const char *type) +{ + if (soap_out_string(soap, tag ? tag : "string", -2, a, type)) + return soap->error; + return soap_putindependent(soap); +} + +SOAP_FMAC3 char ** SOAP_FMAC4 soap_get_string(struct soap *soap, char **p, const char *tag, const char *type) +{ + if ((p = soap_in_string(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +#if defined(__BORLANDC__) +#pragma option pop +#pragma option pop +#endif + +/* End of soapC.cpp */ diff --git a/DFL_BOM_WL_TOERP/bin/win64/soapH.h b/DFL_BOM_WL_TOERP/bin/win64/soapH.h new file mode 100644 index 0000000..d096499 --- /dev/null +++ b/DFL_BOM_WL_TOERP/bin/win64/soapH.h @@ -0,0 +1,1748 @@ +/* soapH.h + Generated by gSOAP 2.8.131 for factory.h + +gSOAP XML Web services tools +Copyright (C) 2000-2023, Robert van Engelen, Genivia Inc. All Rights Reserved. +The soapcpp2 tool and its generated software are released under the GPL. +This program is released under the GPL with the additional exemption that +compiling, linking, and/or using OpenSSL is allowed. +-------------------------------------------------------------------------------- +A commercial use license is available from Genivia Inc., contact@genivia.com +-------------------------------------------------------------------------------- +*/ + +#ifndef soapH_H +#define soapH_H +#include "soapStub.h" +#ifndef WITH_NOIDREF + +#ifdef __cplusplus +extern "C" { +#endif +SOAP_FMAC3 void SOAP_FMAC4 soap_markelement(struct soap*, const void*, int); + +#ifdef __cplusplus +} +#endif +SOAP_FMAC3 int SOAP_FMAC4 soap_putindependent(struct soap*); +SOAP_FMAC3 int SOAP_FMAC4 soap_getindependent(struct soap*); +#endif + +#ifdef __cplusplus +extern "C" { +#endif +SOAP_FMAC3 void * SOAP_FMAC4 soap_getelement(struct soap*, const char*, int*); +SOAP_FMAC3 int SOAP_FMAC4 soap_putelement(struct soap*, const void*, const char*, int, int); +SOAP_FMAC3 void * SOAP_FMAC4 soap_dupelement(struct soap*, const void*, int); +SOAP_FMAC3 void SOAP_FMAC4 soap_delelement(const void*, int); + +#ifdef __cplusplus +} +#endif +SOAP_FMAC3 int SOAP_FMAC4 soap_ignore_element(struct soap*); +SOAP_FMAC3 void * SOAP_FMAC4 soap_instantiate(struct soap*, int, const char*, const char*, size_t*); +SOAP_FMAC3 int SOAP_FMAC4 soap_fdelete(struct soap *soap, struct soap_clist*); +SOAP_FMAC3 int SOAP_FMAC4 soap_fbase(int, int); +SOAP_FMAC3 void SOAP_FMAC4 soap_finsert(struct soap*, int, int, void*, size_t, const void*, void**); + +#ifndef SOAP_TYPE_byte_DEFINED +#define SOAP_TYPE_byte_DEFINED + +inline void soap_default_byte(struct soap *soap, char *a) +{ + (void)soap; /* appease -Wall -Werror */ +#ifdef SOAP_DEFAULT_byte + *a = SOAP_DEFAULT_byte; +#else + *a = (char)0; +#endif +} +SOAP_FMAC3 int SOAP_FMAC4 soap_out_byte(struct soap*, const char*, int, const char *, const char*); +SOAP_FMAC3 char * SOAP_FMAC4 soap_in_byte(struct soap*, const char*, char *, const char*); + +SOAP_FMAC3 char * SOAP_FMAC4 soap_new_byte(struct soap *soap, int n = -1); +SOAP_FMAC3 int SOAP_FMAC4 soap_put_byte(struct soap*, const char *, const char*, const char*); + +inline int soap_write_byte(struct soap *soap, char const*p) +{ + soap_free_temp(soap); + if (p) + { if (soap_begin_send(soap) || ::soap_put_byte(soap, p, "byte", "") || soap_end_send(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_PUT_byte(struct soap *soap, const char *URL, char const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || ::soap_put_byte(soap, p, "byte", "") || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH_byte(struct soap *soap, const char *URL, char const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || ::soap_put_byte(soap, p, "byte", "") || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send_byte(struct soap *soap, const char *URL, char const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || ::soap_put_byte(soap, p, "byte", "") || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 char * SOAP_FMAC4 soap_get_byte(struct soap*, char *, const char*, const char*); + +inline int soap_read_byte(struct soap *soap, char *p) +{ + if (p) + { if (soap_begin_recv(soap) || ::soap_get_byte(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET_byte(struct soap *soap, const char *URL, char *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read_byte(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv_byte(struct soap *soap, char *p) +{ + if (::soap_read_byte(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#ifndef SOAP_TYPE_int_DEFINED +#define SOAP_TYPE_int_DEFINED + +inline void soap_default_int(struct soap *soap, int *a) +{ + (void)soap; /* appease -Wall -Werror */ +#ifdef SOAP_DEFAULT_int + *a = SOAP_DEFAULT_int; +#else + *a = (int)0; +#endif +} +SOAP_FMAC3 int SOAP_FMAC4 soap_out_int(struct soap*, const char*, int, const int *, const char*); +SOAP_FMAC3 int * SOAP_FMAC4 soap_in_int(struct soap*, const char*, int *, const char*); + +SOAP_FMAC3 int * SOAP_FMAC4 soap_new_int(struct soap *soap, int n = -1); +SOAP_FMAC3 int SOAP_FMAC4 soap_put_int(struct soap*, const int *, const char*, const char*); + +inline int soap_write_int(struct soap *soap, int const*p) +{ + soap_free_temp(soap); + if (p) + { if (soap_begin_send(soap) || ::soap_put_int(soap, p, "int", "") || soap_end_send(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_PUT_int(struct soap *soap, const char *URL, int const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || ::soap_put_int(soap, p, "int", "") || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH_int(struct soap *soap, const char *URL, int const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || ::soap_put_int(soap, p, "int", "") || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send_int(struct soap *soap, const char *URL, int const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || ::soap_put_int(soap, p, "int", "") || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 int * SOAP_FMAC4 soap_get_int(struct soap*, int *, const char*, const char*); + +inline int soap_read_int(struct soap *soap, int *p) +{ + if (p) + { if (soap_begin_recv(soap) || ::soap_get_int(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET_int(struct soap *soap, const char *URL, int *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read_int(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv_int(struct soap *soap, int *p) +{ + if (::soap_read_int(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#ifndef SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM_DEFINED +#define SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM_DEFINED +SOAP_FMAC3 int SOAP_FMAC4 soap_out__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(struct soap*, const char*, int, const _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM *, const char*); +SOAP_FMAC3 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM * SOAP_FMAC4 soap_in__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(struct soap*, const char*, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM *, const char*); +SOAP_FMAC1 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM * SOAP_FMAC2 soap_instantiate__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(struct soap*, int, const char*, const char*, size_t*); + +inline _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM * soap_new__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(struct soap *soap, int n = -1) +{ + return soap_instantiate__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(soap, n, NULL, NULL, NULL); +} + +inline _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM * soap_new_req__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM( + struct soap *soap) +{ + _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM *_p = ::soap_new__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(soap); + if (_p) + { _p->soap_default(soap); + } + return _p; +} + +inline _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM * soap_new_set__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM( + struct soap *soap, + char *PSPID, + char *ZPSPID, + char *MATNR, + char *ZZD, + char *ZGH, + char *SERNR, + char *WERKS, + char *RSPOS) +{ + _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM *_p = ::soap_new__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(soap); + if (_p) + { _p->soap_default(soap); + _p->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::PSPID = PSPID; + _p->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::ZPSPID = ZPSPID; + _p->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::MATNR = MATNR; + _p->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::ZZD = ZZD; + _p->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::ZGH = ZGH; + _p->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::SERNR = SERNR; + _p->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::WERKS = WERKS; + _p->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::RSPOS = RSPOS; + } + return _p; +} + +inline int soap_write__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(struct soap *soap, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM const*p) +{ + soap_free_temp(soap); + if (soap_begin_send(soap) || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_FACTORY_NUMBER_REQ-ITEMS-ITEM", p->soap_type() == SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM ? "" : NULL) || soap_end_send(soap)) + return soap->error; + return SOAP_OK; +} + +inline int soap_PUT__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(struct soap *soap, const char *URL, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_FACTORY_NUMBER_REQ-ITEMS-ITEM", p->soap_type() == SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(struct soap *soap, const char *URL, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_FACTORY_NUMBER_REQ-ITEMS-ITEM", p->soap_type() == SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(struct soap *soap, const char *URL, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_FACTORY_NUMBER_REQ-ITEMS-ITEM", p->soap_type() == SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM ? "" : NULL) || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM * SOAP_FMAC4 soap_get__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(struct soap*, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM *, const char*, const char*); + +inline int soap_read__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(struct soap *soap, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM *p) +{ + if (p) + { p->soap_default(soap); + if (soap_begin_recv(soap) || ::soap_get__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(struct soap *soap, const char *URL, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(struct soap *soap, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM *p) +{ + if (::soap_read__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#ifndef SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_DEFINED +#define SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_DEFINED +SOAP_FMAC3 int SOAP_FMAC4 soap_out__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(struct soap*, const char*, int, const _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS *, const char*); +SOAP_FMAC3 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS * SOAP_FMAC4 soap_in__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(struct soap*, const char*, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS *, const char*); +SOAP_FMAC1 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS * SOAP_FMAC2 soap_instantiate__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(struct soap*, int, const char*, const char*, size_t*); + +inline _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS * soap_new__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(struct soap *soap, int n = -1) +{ + return soap_instantiate__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(soap, n, NULL, NULL, NULL); +} + +inline _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS * soap_new_req__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS( + struct soap *soap, + int __sizeITEM, + _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM *ITEM) +{ + _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS *_p = ::soap_new__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(soap); + if (_p) + { _p->soap_default(soap); + _p->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS::__sizeITEM = __sizeITEM; + _p->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS::ITEM = ITEM; + } + return _p; +} + +inline _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS * soap_new_set__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS( + struct soap *soap, + int __sizeITEM, + _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM *ITEM) +{ + _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS *_p = ::soap_new__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(soap); + if (_p) + { _p->soap_default(soap); + _p->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS::__sizeITEM = __sizeITEM; + _p->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS::ITEM = ITEM; + } + return _p; +} + +inline int soap_write__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(struct soap *soap, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS const*p) +{ + soap_free_temp(soap); + if (soap_begin_send(soap) || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_FACTORY_NUMBER_REQ-ITEMS", p->soap_type() == SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS ? "" : NULL) || soap_end_send(soap)) + return soap->error; + return SOAP_OK; +} + +inline int soap_PUT__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(struct soap *soap, const char *URL, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_FACTORY_NUMBER_REQ-ITEMS", p->soap_type() == SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(struct soap *soap, const char *URL, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_FACTORY_NUMBER_REQ-ITEMS", p->soap_type() == SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(struct soap *soap, const char *URL, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_FACTORY_NUMBER_REQ-ITEMS", p->soap_type() == SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS ? "" : NULL) || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS * SOAP_FMAC4 soap_get__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(struct soap*, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS *, const char*, const char*); + +inline int soap_read__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(struct soap *soap, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS *p) +{ + if (p) + { p->soap_default(soap); + if (soap_begin_recv(soap) || ::soap_get__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(struct soap *soap, const char *URL, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(struct soap *soap, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS *p) +{ + if (::soap_read__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#ifndef SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO_DEFINED +#define SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO_DEFINED +SOAP_FMAC3 int SOAP_FMAC4 soap_out__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(struct soap*, const char*, int, const _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO *, const char*); +SOAP_FMAC3 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO * SOAP_FMAC4 soap_in__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(struct soap*, const char*, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO *, const char*); +SOAP_FMAC1 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO * SOAP_FMAC2 soap_instantiate__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(struct soap*, int, const char*, const char*, size_t*); + +inline _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO * soap_new__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(struct soap *soap, int n = -1) +{ + return soap_instantiate__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(soap, n, NULL, NULL, NULL); +} + +inline _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO * soap_new_req__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO( + struct soap *soap) +{ + _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO *_p = ::soap_new__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(soap); + if (_p) + { _p->soap_default(soap); + } + return _p; +} + +inline _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO * soap_new_set__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO( + struct soap *soap, + char *REQ_USCORETRACE_USCOREID) +{ + _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO *_p = ::soap_new__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(soap); + if (_p) + { _p->soap_default(soap); + _p->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO::REQ_USCORETRACE_USCOREID = REQ_USCORETRACE_USCOREID; + } + return _p; +} + +inline int soap_write__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(struct soap *soap, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO const*p) +{ + soap_free_temp(soap); + if (soap_begin_send(soap) || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_FACTORY_NUMBER_REQ-BASEINFO", p->soap_type() == SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO ? "" : NULL) || soap_end_send(soap)) + return soap->error; + return SOAP_OK; +} + +inline int soap_PUT__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(struct soap *soap, const char *URL, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_FACTORY_NUMBER_REQ-BASEINFO", p->soap_type() == SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(struct soap *soap, const char *URL, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_FACTORY_NUMBER_REQ-BASEINFO", p->soap_type() == SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(struct soap *soap, const char *URL, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_FACTORY_NUMBER_REQ-BASEINFO", p->soap_type() == SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO ? "" : NULL) || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO * SOAP_FMAC4 soap_get__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(struct soap*, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO *, const char*, const char*); + +inline int soap_read__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(struct soap *soap, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO *p) +{ + if (p) + { p->soap_default(soap); + if (soap_begin_recv(soap) || ::soap_get__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(struct soap *soap, const char *URL, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(struct soap *soap, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO *p) +{ + if (::soap_read__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#ifndef SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN_DEFINED +#define SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN_DEFINED +SOAP_FMAC3 int SOAP_FMAC4 soap_out__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(struct soap*, const char*, int, const _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN *, const char*); +SOAP_FMAC3 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN * SOAP_FMAC4 soap_in__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(struct soap*, const char*, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN *, const char*); +SOAP_FMAC1 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN * SOAP_FMAC2 soap_instantiate__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(struct soap*, int, const char*, const char*, size_t*); + +inline _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN * soap_new__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(struct soap *soap, int n = -1) +{ + return soap_instantiate__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(soap, n, NULL, NULL, NULL); +} + +inline _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN * soap_new_req__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN( + struct soap *soap) +{ + _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN *_p = ::soap_new__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(soap); + if (_p) + { _p->soap_default(soap); + } + return _p; +} + +inline _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN * soap_new_set__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN( + struct soap *soap, + char *SERNR, + char *TYPE, + char *MESSAGE) +{ + _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN *_p = ::soap_new__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(soap); + if (_p) + { _p->soap_default(soap); + _p->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN::SERNR = SERNR; + _p->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN::TYPE = TYPE; + _p->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN::MESSAGE = MESSAGE; + } + return _p; +} + +inline int soap_write__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(struct soap *soap, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN const*p) +{ + soap_free_temp(soap); + if (soap_begin_send(soap) || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_FACTORY_NUMBER_RSP-ZTABLE_RETURN", p->soap_type() == SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN ? "" : NULL) || soap_end_send(soap)) + return soap->error; + return SOAP_OK; +} + +inline int soap_PUT__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(struct soap *soap, const char *URL, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_FACTORY_NUMBER_RSP-ZTABLE_RETURN", p->soap_type() == SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(struct soap *soap, const char *URL, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_FACTORY_NUMBER_RSP-ZTABLE_RETURN", p->soap_type() == SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(struct soap *soap, const char *URL, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_FACTORY_NUMBER_RSP-ZTABLE_RETURN", p->soap_type() == SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN ? "" : NULL) || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN * SOAP_FMAC4 soap_get__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(struct soap*, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN *, const char*, const char*); + +inline int soap_read__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(struct soap *soap, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN *p) +{ + if (p) + { p->soap_default(soap); + if (soap_begin_recv(soap) || ::soap_get__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(struct soap *soap, const char *URL, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(struct soap *soap, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN *p) +{ + if (::soap_read__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#ifndef SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO_DEFINED +#define SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO_DEFINED +SOAP_FMAC3 int SOAP_FMAC4 soap_out__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(struct soap*, const char*, int, const _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO *, const char*); +SOAP_FMAC3 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO * SOAP_FMAC4 soap_in__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(struct soap*, const char*, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO *, const char*); +SOAP_FMAC1 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO * SOAP_FMAC2 soap_instantiate__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(struct soap*, int, const char*, const char*, size_t*); + +inline _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO * soap_new__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(struct soap *soap, int n = -1) +{ + return soap_instantiate__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(soap, n, NULL, NULL, NULL); +} + +inline _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO * soap_new_req__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO( + struct soap *soap) +{ + _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO *_p = ::soap_new__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(soap); + if (_p) + { _p->soap_default(soap); + } + return _p; +} + +inline _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO * soap_new_set__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO( + struct soap *soap, + char *REQ_USCORETRACE_USCOREID) +{ + _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO *_p = ::soap_new__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(soap); + if (_p) + { _p->soap_default(soap); + _p->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO::REQ_USCORETRACE_USCOREID = REQ_USCORETRACE_USCOREID; + } + return _p; +} + +inline int soap_write__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(struct soap *soap, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO const*p) +{ + soap_free_temp(soap); + if (soap_begin_send(soap) || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_FACTORY_NUMBER_RSP-RSP_BASEINFO", p->soap_type() == SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO ? "" : NULL) || soap_end_send(soap)) + return soap->error; + return SOAP_OK; +} + +inline int soap_PUT__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(struct soap *soap, const char *URL, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_FACTORY_NUMBER_RSP-RSP_BASEINFO", p->soap_type() == SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(struct soap *soap, const char *URL, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_FACTORY_NUMBER_RSP-RSP_BASEINFO", p->soap_type() == SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(struct soap *soap, const char *URL, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_FACTORY_NUMBER_RSP-RSP_BASEINFO", p->soap_type() == SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO ? "" : NULL) || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO * SOAP_FMAC4 soap_get__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(struct soap*, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO *, const char*, const char*); + +inline int soap_read__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(struct soap *soap, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO *p) +{ + if (p) + { p->soap_default(soap); + if (soap_begin_recv(soap) || ::soap_get__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(struct soap *soap, const char *URL, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(struct soap *soap, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO *p) +{ + if (::soap_read__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#ifndef SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_DEFINED +#define SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_DEFINED +SOAP_FMAC3 int SOAP_FMAC4 soap_out_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(struct soap*, const char*, int, const ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ *, const char*); +SOAP_FMAC3 ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ * SOAP_FMAC4 soap_in_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(struct soap*, const char*, ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ *, const char*); +SOAP_FMAC1 ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ * SOAP_FMAC2 soap_instantiate_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(struct soap*, int, const char*, const char*, size_t*); + +inline ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ * soap_new_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(struct soap *soap, int n = -1) +{ + return soap_instantiate_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(soap, n, NULL, NULL, NULL); +} + +inline ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ * soap_new_req_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ( + struct soap *soap) +{ + ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ *_p = ::soap_new_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(soap); + if (_p) + { _p->soap_default(soap); + } + return _p; +} + +inline ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ * soap_new_set_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ( + struct soap *soap, + _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO *BASEINFO, + _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS *ITEMS) +{ + ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ *_p = ::soap_new_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(soap); + if (_p) + { _p->soap_default(soap); + _p->ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ::BASEINFO = BASEINFO; + _p->ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ::ITEMS = ITEMS; + } + return _p; +} + +inline int soap_write_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(struct soap *soap, ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ const*p) +{ + soap_free_temp(soap); + if (soap_begin_send(soap) || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_FACTORY_NUMBER_REQ", p->soap_type() == SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ ? "" : NULL) || soap_end_send(soap)) + return soap->error; + return SOAP_OK; +} + +inline int soap_PUT_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(struct soap *soap, const char *URL, ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_FACTORY_NUMBER_REQ", p->soap_type() == SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(struct soap *soap, const char *URL, ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_FACTORY_NUMBER_REQ", p->soap_type() == SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(struct soap *soap, const char *URL, ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_FACTORY_NUMBER_REQ", p->soap_type() == SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ ? "" : NULL) || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ * SOAP_FMAC4 soap_get_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(struct soap*, ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ *, const char*, const char*); + +inline int soap_read_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(struct soap *soap, ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ *p) +{ + if (p) + { p->soap_default(soap); + if (soap_begin_recv(soap) || ::soap_get_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(struct soap *soap, const char *URL, ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(struct soap *soap, ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ *p) +{ + if (::soap_read_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#ifndef SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_DEFINED +#define SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_DEFINED +SOAP_FMAC3 int SOAP_FMAC4 soap_out_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP(struct soap*, const char*, int, const ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP *, const char*); +SOAP_FMAC3 ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP * SOAP_FMAC4 soap_in_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP(struct soap*, const char*, ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP *, const char*); +SOAP_FMAC1 ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP * SOAP_FMAC2 soap_instantiate_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP(struct soap*, int, const char*, const char*, size_t*); + +inline ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP * soap_new_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP(struct soap *soap, int n = -1) +{ + return soap_instantiate_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP(soap, n, NULL, NULL, NULL); +} + +inline ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP * soap_new_req_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP( + struct soap *soap, + int __sizeZTABLE_USCORERETURN, + _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN *ZTABLE_USCORERETURN) +{ + ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP *_p = ::soap_new_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP(soap); + if (_p) + { _p->soap_default(soap); + _p->ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP::__sizeZTABLE_USCORERETURN = __sizeZTABLE_USCORERETURN; + _p->ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP::ZTABLE_USCORERETURN = ZTABLE_USCORERETURN; + } + return _p; +} + +inline ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP * soap_new_set_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP( + struct soap *soap, + _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO *RSP_USCOREBASEINFO, + int __sizeZTABLE_USCORERETURN, + _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN *ZTABLE_USCORERETURN) +{ + ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP *_p = ::soap_new_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP(soap); + if (_p) + { _p->soap_default(soap); + _p->ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP::RSP_USCOREBASEINFO = RSP_USCOREBASEINFO; + _p->ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP::__sizeZTABLE_USCORERETURN = __sizeZTABLE_USCORERETURN; + _p->ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP::ZTABLE_USCORERETURN = ZTABLE_USCORERETURN; + } + return _p; +} + +inline int soap_write_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP(struct soap *soap, ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP const*p) +{ + soap_free_temp(soap); + if (soap_begin_send(soap) || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_FACTORY_NUMBER_RSP", p->soap_type() == SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP ? "" : NULL) || soap_end_send(soap)) + return soap->error; + return SOAP_OK; +} + +inline int soap_PUT_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP(struct soap *soap, const char *URL, ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_FACTORY_NUMBER_RSP", p->soap_type() == SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP(struct soap *soap, const char *URL, ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_FACTORY_NUMBER_RSP", p->soap_type() == SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP(struct soap *soap, const char *URL, ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_FACTORY_NUMBER_RSP", p->soap_type() == SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP ? "" : NULL) || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP * SOAP_FMAC4 soap_get_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP(struct soap*, ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP *, const char*, const char*); + +inline int soap_read_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP(struct soap *soap, ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP *p) +{ + if (p) + { p->soap_default(soap); + if (soap_begin_recv(soap) || ::soap_get_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP(struct soap *soap, const char *URL, ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP(struct soap *soap, ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP *p) +{ + if (::soap_read_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#ifndef WITH_NOGLOBAL + +#ifndef SOAP_TYPE_SOAP_ENV__Fault_DEFINED +#define SOAP_TYPE_SOAP_ENV__Fault_DEFINED +SOAP_FMAC3 void SOAP_FMAC4 soap_default_SOAP_ENV__Fault(struct soap*, struct SOAP_ENV__Fault *); +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_SOAP_ENV__Fault(struct soap*, const struct SOAP_ENV__Fault *); +SOAP_FMAC3 int SOAP_FMAC4 soap_out_SOAP_ENV__Fault(struct soap*, const char*, int, const struct SOAP_ENV__Fault *, const char*); +SOAP_FMAC3 struct SOAP_ENV__Fault * SOAP_FMAC4 soap_in_SOAP_ENV__Fault(struct soap*, const char*, struct SOAP_ENV__Fault *, const char*); +SOAP_FMAC1 struct SOAP_ENV__Fault * SOAP_FMAC2 soap_instantiate_SOAP_ENV__Fault(struct soap*, int, const char*, const char*, size_t*); + +inline struct SOAP_ENV__Fault * soap_new_SOAP_ENV__Fault(struct soap *soap, int n = -1) +{ + return soap_instantiate_SOAP_ENV__Fault(soap, n, NULL, NULL, NULL); +} + +inline struct SOAP_ENV__Fault * soap_new_req_SOAP_ENV__Fault( + struct soap *soap) +{ + struct SOAP_ENV__Fault *_p = ::soap_new_SOAP_ENV__Fault(soap); + if (_p) + { ::soap_default_SOAP_ENV__Fault(soap, _p); + } + return _p; +} + +inline struct SOAP_ENV__Fault * soap_new_set_SOAP_ENV__Fault( + struct soap *soap, + char *faultcode, + char *faultstring, + char *faultactor, + struct SOAP_ENV__Detail *detail, + struct SOAP_ENV__Code *SOAP_ENV__Code, + struct SOAP_ENV__Reason *SOAP_ENV__Reason, + char *SOAP_ENV__Node, + char *SOAP_ENV__Role, + struct SOAP_ENV__Detail *SOAP_ENV__Detail) +{ + struct SOAP_ENV__Fault *_p = ::soap_new_SOAP_ENV__Fault(soap); + if (_p) + { ::soap_default_SOAP_ENV__Fault(soap, _p); + _p->faultcode = faultcode; + _p->faultstring = faultstring; + _p->faultactor = faultactor; + _p->detail = detail; + _p->SOAP_ENV__Code = SOAP_ENV__Code; + _p->SOAP_ENV__Reason = SOAP_ENV__Reason; + _p->SOAP_ENV__Node = SOAP_ENV__Node; + _p->SOAP_ENV__Role = SOAP_ENV__Role; + _p->SOAP_ENV__Detail = SOAP_ENV__Detail; + } + return _p; +} +SOAP_FMAC3 int SOAP_FMAC4 soap_put_SOAP_ENV__Fault(struct soap*, const struct SOAP_ENV__Fault *, const char*, const char*); + +inline int soap_write_SOAP_ENV__Fault(struct soap *soap, struct SOAP_ENV__Fault const*p) +{ + soap_free_temp(soap); + if (soap_begin_send(soap) || (::soap_serialize_SOAP_ENV__Fault(soap, p), 0) || ::soap_put_SOAP_ENV__Fault(soap, p, "SOAP-ENV:Fault", "") || soap_end_send(soap)) + return soap->error; + return SOAP_OK; +} + +inline int soap_PUT_SOAP_ENV__Fault(struct soap *soap, const char *URL, struct SOAP_ENV__Fault const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize_SOAP_ENV__Fault(soap, p), 0) || ::soap_put_SOAP_ENV__Fault(soap, p, "SOAP-ENV:Fault", "") || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH_SOAP_ENV__Fault(struct soap *soap, const char *URL, struct SOAP_ENV__Fault const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize_SOAP_ENV__Fault(soap, p), 0) || ::soap_put_SOAP_ENV__Fault(soap, p, "SOAP-ENV:Fault", "") || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send_SOAP_ENV__Fault(struct soap *soap, const char *URL, struct SOAP_ENV__Fault const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize_SOAP_ENV__Fault(soap, p), 0) || ::soap_put_SOAP_ENV__Fault(soap, p, "SOAP-ENV:Fault", "") || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 struct SOAP_ENV__Fault * SOAP_FMAC4 soap_get_SOAP_ENV__Fault(struct soap*, struct SOAP_ENV__Fault *, const char*, const char*); + +inline int soap_read_SOAP_ENV__Fault(struct soap *soap, struct SOAP_ENV__Fault *p) +{ + if (p) + { ::soap_default_SOAP_ENV__Fault(soap, p); + if (soap_begin_recv(soap) || ::soap_get_SOAP_ENV__Fault(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET_SOAP_ENV__Fault(struct soap *soap, const char *URL, struct SOAP_ENV__Fault *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read_SOAP_ENV__Fault(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv_SOAP_ENV__Fault(struct soap *soap, struct SOAP_ENV__Fault *p) +{ + if (::soap_read_SOAP_ENV__Fault(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#endif + +#ifndef WITH_NOGLOBAL + +#ifndef SOAP_TYPE_SOAP_ENV__Reason_DEFINED +#define SOAP_TYPE_SOAP_ENV__Reason_DEFINED +SOAP_FMAC3 void SOAP_FMAC4 soap_default_SOAP_ENV__Reason(struct soap*, struct SOAP_ENV__Reason *); +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_SOAP_ENV__Reason(struct soap*, const struct SOAP_ENV__Reason *); +SOAP_FMAC3 int SOAP_FMAC4 soap_out_SOAP_ENV__Reason(struct soap*, const char*, int, const struct SOAP_ENV__Reason *, const char*); +SOAP_FMAC3 struct SOAP_ENV__Reason * SOAP_FMAC4 soap_in_SOAP_ENV__Reason(struct soap*, const char*, struct SOAP_ENV__Reason *, const char*); +SOAP_FMAC1 struct SOAP_ENV__Reason * SOAP_FMAC2 soap_instantiate_SOAP_ENV__Reason(struct soap*, int, const char*, const char*, size_t*); + +inline struct SOAP_ENV__Reason * soap_new_SOAP_ENV__Reason(struct soap *soap, int n = -1) +{ + return soap_instantiate_SOAP_ENV__Reason(soap, n, NULL, NULL, NULL); +} + +inline struct SOAP_ENV__Reason * soap_new_req_SOAP_ENV__Reason( + struct soap *soap) +{ + struct SOAP_ENV__Reason *_p = ::soap_new_SOAP_ENV__Reason(soap); + if (_p) + { ::soap_default_SOAP_ENV__Reason(soap, _p); + } + return _p; +} + +inline struct SOAP_ENV__Reason * soap_new_set_SOAP_ENV__Reason( + struct soap *soap, + char *SOAP_ENV__Text) +{ + struct SOAP_ENV__Reason *_p = ::soap_new_SOAP_ENV__Reason(soap); + if (_p) + { ::soap_default_SOAP_ENV__Reason(soap, _p); + _p->SOAP_ENV__Text = SOAP_ENV__Text; + } + return _p; +} +SOAP_FMAC3 int SOAP_FMAC4 soap_put_SOAP_ENV__Reason(struct soap*, const struct SOAP_ENV__Reason *, const char*, const char*); + +inline int soap_write_SOAP_ENV__Reason(struct soap *soap, struct SOAP_ENV__Reason const*p) +{ + soap_free_temp(soap); + if (soap_begin_send(soap) || (::soap_serialize_SOAP_ENV__Reason(soap, p), 0) || ::soap_put_SOAP_ENV__Reason(soap, p, "SOAP-ENV:Reason", "") || soap_end_send(soap)) + return soap->error; + return SOAP_OK; +} + +inline int soap_PUT_SOAP_ENV__Reason(struct soap *soap, const char *URL, struct SOAP_ENV__Reason const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize_SOAP_ENV__Reason(soap, p), 0) || ::soap_put_SOAP_ENV__Reason(soap, p, "SOAP-ENV:Reason", "") || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH_SOAP_ENV__Reason(struct soap *soap, const char *URL, struct SOAP_ENV__Reason const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize_SOAP_ENV__Reason(soap, p), 0) || ::soap_put_SOAP_ENV__Reason(soap, p, "SOAP-ENV:Reason", "") || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send_SOAP_ENV__Reason(struct soap *soap, const char *URL, struct SOAP_ENV__Reason const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize_SOAP_ENV__Reason(soap, p), 0) || ::soap_put_SOAP_ENV__Reason(soap, p, "SOAP-ENV:Reason", "") || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 struct SOAP_ENV__Reason * SOAP_FMAC4 soap_get_SOAP_ENV__Reason(struct soap*, struct SOAP_ENV__Reason *, const char*, const char*); + +inline int soap_read_SOAP_ENV__Reason(struct soap *soap, struct SOAP_ENV__Reason *p) +{ + if (p) + { ::soap_default_SOAP_ENV__Reason(soap, p); + if (soap_begin_recv(soap) || ::soap_get_SOAP_ENV__Reason(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET_SOAP_ENV__Reason(struct soap *soap, const char *URL, struct SOAP_ENV__Reason *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read_SOAP_ENV__Reason(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv_SOAP_ENV__Reason(struct soap *soap, struct SOAP_ENV__Reason *p) +{ + if (::soap_read_SOAP_ENV__Reason(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#endif + +#ifndef WITH_NOGLOBAL + +#ifndef SOAP_TYPE_SOAP_ENV__Detail_DEFINED +#define SOAP_TYPE_SOAP_ENV__Detail_DEFINED +SOAP_FMAC3 void SOAP_FMAC4 soap_default_SOAP_ENV__Detail(struct soap*, struct SOAP_ENV__Detail *); +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_SOAP_ENV__Detail(struct soap*, const struct SOAP_ENV__Detail *); +SOAP_FMAC3 int SOAP_FMAC4 soap_out_SOAP_ENV__Detail(struct soap*, const char*, int, const struct SOAP_ENV__Detail *, const char*); +SOAP_FMAC3 struct SOAP_ENV__Detail * SOAP_FMAC4 soap_in_SOAP_ENV__Detail(struct soap*, const char*, struct SOAP_ENV__Detail *, const char*); +SOAP_FMAC1 struct SOAP_ENV__Detail * SOAP_FMAC2 soap_instantiate_SOAP_ENV__Detail(struct soap*, int, const char*, const char*, size_t*); + +inline struct SOAP_ENV__Detail * soap_new_SOAP_ENV__Detail(struct soap *soap, int n = -1) +{ + return soap_instantiate_SOAP_ENV__Detail(soap, n, NULL, NULL, NULL); +} + +inline struct SOAP_ENV__Detail * soap_new_req_SOAP_ENV__Detail( + struct soap *soap, + int __type, + void *fault) +{ + struct SOAP_ENV__Detail *_p = ::soap_new_SOAP_ENV__Detail(soap); + if (_p) + { ::soap_default_SOAP_ENV__Detail(soap, _p); + _p->__type = __type; + _p->fault = fault; + } + return _p; +} + +inline struct SOAP_ENV__Detail * soap_new_set_SOAP_ENV__Detail( + struct soap *soap, + char *__any, + int __type, + void *fault) +{ + struct SOAP_ENV__Detail *_p = ::soap_new_SOAP_ENV__Detail(soap); + if (_p) + { ::soap_default_SOAP_ENV__Detail(soap, _p); + _p->__any = __any; + _p->__type = __type; + _p->fault = fault; + } + return _p; +} +SOAP_FMAC3 int SOAP_FMAC4 soap_put_SOAP_ENV__Detail(struct soap*, const struct SOAP_ENV__Detail *, const char*, const char*); + +inline int soap_write_SOAP_ENV__Detail(struct soap *soap, struct SOAP_ENV__Detail const*p) +{ + soap_free_temp(soap); + if (soap_begin_send(soap) || (::soap_serialize_SOAP_ENV__Detail(soap, p), 0) || ::soap_put_SOAP_ENV__Detail(soap, p, "SOAP-ENV:Detail", "") || soap_end_send(soap)) + return soap->error; + return SOAP_OK; +} + +inline int soap_PUT_SOAP_ENV__Detail(struct soap *soap, const char *URL, struct SOAP_ENV__Detail const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize_SOAP_ENV__Detail(soap, p), 0) || ::soap_put_SOAP_ENV__Detail(soap, p, "SOAP-ENV:Detail", "") || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH_SOAP_ENV__Detail(struct soap *soap, const char *URL, struct SOAP_ENV__Detail const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize_SOAP_ENV__Detail(soap, p), 0) || ::soap_put_SOAP_ENV__Detail(soap, p, "SOAP-ENV:Detail", "") || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send_SOAP_ENV__Detail(struct soap *soap, const char *URL, struct SOAP_ENV__Detail const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize_SOAP_ENV__Detail(soap, p), 0) || ::soap_put_SOAP_ENV__Detail(soap, p, "SOAP-ENV:Detail", "") || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 struct SOAP_ENV__Detail * SOAP_FMAC4 soap_get_SOAP_ENV__Detail(struct soap*, struct SOAP_ENV__Detail *, const char*, const char*); + +inline int soap_read_SOAP_ENV__Detail(struct soap *soap, struct SOAP_ENV__Detail *p) +{ + if (p) + { ::soap_default_SOAP_ENV__Detail(soap, p); + if (soap_begin_recv(soap) || ::soap_get_SOAP_ENV__Detail(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET_SOAP_ENV__Detail(struct soap *soap, const char *URL, struct SOAP_ENV__Detail *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read_SOAP_ENV__Detail(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv_SOAP_ENV__Detail(struct soap *soap, struct SOAP_ENV__Detail *p) +{ + if (::soap_read_SOAP_ENV__Detail(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#endif + +#ifndef WITH_NOGLOBAL + +#ifndef SOAP_TYPE_SOAP_ENV__Code_DEFINED +#define SOAP_TYPE_SOAP_ENV__Code_DEFINED +SOAP_FMAC3 void SOAP_FMAC4 soap_default_SOAP_ENV__Code(struct soap*, struct SOAP_ENV__Code *); +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_SOAP_ENV__Code(struct soap*, const struct SOAP_ENV__Code *); +SOAP_FMAC3 int SOAP_FMAC4 soap_out_SOAP_ENV__Code(struct soap*, const char*, int, const struct SOAP_ENV__Code *, const char*); +SOAP_FMAC3 struct SOAP_ENV__Code * SOAP_FMAC4 soap_in_SOAP_ENV__Code(struct soap*, const char*, struct SOAP_ENV__Code *, const char*); +SOAP_FMAC1 struct SOAP_ENV__Code * SOAP_FMAC2 soap_instantiate_SOAP_ENV__Code(struct soap*, int, const char*, const char*, size_t*); + +inline struct SOAP_ENV__Code * soap_new_SOAP_ENV__Code(struct soap *soap, int n = -1) +{ + return soap_instantiate_SOAP_ENV__Code(soap, n, NULL, NULL, NULL); +} + +inline struct SOAP_ENV__Code * soap_new_req_SOAP_ENV__Code( + struct soap *soap) +{ + struct SOAP_ENV__Code *_p = ::soap_new_SOAP_ENV__Code(soap); + if (_p) + { ::soap_default_SOAP_ENV__Code(soap, _p); + } + return _p; +} + +inline struct SOAP_ENV__Code * soap_new_set_SOAP_ENV__Code( + struct soap *soap, + char *SOAP_ENV__Value, + struct SOAP_ENV__Code *SOAP_ENV__Subcode) +{ + struct SOAP_ENV__Code *_p = ::soap_new_SOAP_ENV__Code(soap); + if (_p) + { ::soap_default_SOAP_ENV__Code(soap, _p); + _p->SOAP_ENV__Value = SOAP_ENV__Value; + _p->SOAP_ENV__Subcode = SOAP_ENV__Subcode; + } + return _p; +} +SOAP_FMAC3 int SOAP_FMAC4 soap_put_SOAP_ENV__Code(struct soap*, const struct SOAP_ENV__Code *, const char*, const char*); + +inline int soap_write_SOAP_ENV__Code(struct soap *soap, struct SOAP_ENV__Code const*p) +{ + soap_free_temp(soap); + if (soap_begin_send(soap) || (::soap_serialize_SOAP_ENV__Code(soap, p), 0) || ::soap_put_SOAP_ENV__Code(soap, p, "SOAP-ENV:Code", "") || soap_end_send(soap)) + return soap->error; + return SOAP_OK; +} + +inline int soap_PUT_SOAP_ENV__Code(struct soap *soap, const char *URL, struct SOAP_ENV__Code const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize_SOAP_ENV__Code(soap, p), 0) || ::soap_put_SOAP_ENV__Code(soap, p, "SOAP-ENV:Code", "") || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH_SOAP_ENV__Code(struct soap *soap, const char *URL, struct SOAP_ENV__Code const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize_SOAP_ENV__Code(soap, p), 0) || ::soap_put_SOAP_ENV__Code(soap, p, "SOAP-ENV:Code", "") || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send_SOAP_ENV__Code(struct soap *soap, const char *URL, struct SOAP_ENV__Code const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize_SOAP_ENV__Code(soap, p), 0) || ::soap_put_SOAP_ENV__Code(soap, p, "SOAP-ENV:Code", "") || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 struct SOAP_ENV__Code * SOAP_FMAC4 soap_get_SOAP_ENV__Code(struct soap*, struct SOAP_ENV__Code *, const char*, const char*); + +inline int soap_read_SOAP_ENV__Code(struct soap *soap, struct SOAP_ENV__Code *p) +{ + if (p) + { ::soap_default_SOAP_ENV__Code(soap, p); + if (soap_begin_recv(soap) || ::soap_get_SOAP_ENV__Code(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET_SOAP_ENV__Code(struct soap *soap, const char *URL, struct SOAP_ENV__Code *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read_SOAP_ENV__Code(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv_SOAP_ENV__Code(struct soap *soap, struct SOAP_ENV__Code *p) +{ + if (::soap_read_SOAP_ENV__Code(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#endif + +#ifndef WITH_NOGLOBAL + +#ifndef SOAP_TYPE_SOAP_ENV__Header_DEFINED +#define SOAP_TYPE_SOAP_ENV__Header_DEFINED +SOAP_FMAC3 void SOAP_FMAC4 soap_default_SOAP_ENV__Header(struct soap*, struct SOAP_ENV__Header *); +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_SOAP_ENV__Header(struct soap*, const struct SOAP_ENV__Header *); +SOAP_FMAC3 int SOAP_FMAC4 soap_out_SOAP_ENV__Header(struct soap*, const char*, int, const struct SOAP_ENV__Header *, const char*); +SOAP_FMAC3 struct SOAP_ENV__Header * SOAP_FMAC4 soap_in_SOAP_ENV__Header(struct soap*, const char*, struct SOAP_ENV__Header *, const char*); +SOAP_FMAC1 struct SOAP_ENV__Header * SOAP_FMAC2 soap_instantiate_SOAP_ENV__Header(struct soap*, int, const char*, const char*, size_t*); + +inline struct SOAP_ENV__Header * soap_new_SOAP_ENV__Header(struct soap *soap, int n = -1) +{ + return soap_instantiate_SOAP_ENV__Header(soap, n, NULL, NULL, NULL); +} + +inline struct SOAP_ENV__Header * soap_new_req_SOAP_ENV__Header( + struct soap *soap) +{ + struct SOAP_ENV__Header *_p = ::soap_new_SOAP_ENV__Header(soap); + if (_p) + { ::soap_default_SOAP_ENV__Header(soap, _p); + } + return _p; +} + +inline struct SOAP_ENV__Header * soap_new_set_SOAP_ENV__Header( + struct soap *soap) +{ + struct SOAP_ENV__Header *_p = ::soap_new_SOAP_ENV__Header(soap); + if (_p) + { ::soap_default_SOAP_ENV__Header(soap, _p); + } + return _p; +} +SOAP_FMAC3 int SOAP_FMAC4 soap_put_SOAP_ENV__Header(struct soap*, const struct SOAP_ENV__Header *, const char*, const char*); + +inline int soap_write_SOAP_ENV__Header(struct soap *soap, struct SOAP_ENV__Header const*p) +{ + soap_free_temp(soap); + if (soap_begin_send(soap) || (::soap_serialize_SOAP_ENV__Header(soap, p), 0) || ::soap_put_SOAP_ENV__Header(soap, p, "SOAP-ENV:Header", "") || soap_end_send(soap)) + return soap->error; + return SOAP_OK; +} + +inline int soap_PUT_SOAP_ENV__Header(struct soap *soap, const char *URL, struct SOAP_ENV__Header const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize_SOAP_ENV__Header(soap, p), 0) || ::soap_put_SOAP_ENV__Header(soap, p, "SOAP-ENV:Header", "") || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH_SOAP_ENV__Header(struct soap *soap, const char *URL, struct SOAP_ENV__Header const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize_SOAP_ENV__Header(soap, p), 0) || ::soap_put_SOAP_ENV__Header(soap, p, "SOAP-ENV:Header", "") || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send_SOAP_ENV__Header(struct soap *soap, const char *URL, struct SOAP_ENV__Header const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize_SOAP_ENV__Header(soap, p), 0) || ::soap_put_SOAP_ENV__Header(soap, p, "SOAP-ENV:Header", "") || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 struct SOAP_ENV__Header * SOAP_FMAC4 soap_get_SOAP_ENV__Header(struct soap*, struct SOAP_ENV__Header *, const char*, const char*); + +inline int soap_read_SOAP_ENV__Header(struct soap *soap, struct SOAP_ENV__Header *p) +{ + if (p) + { ::soap_default_SOAP_ENV__Header(soap, p); + if (soap_begin_recv(soap) || ::soap_get_SOAP_ENV__Header(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET_SOAP_ENV__Header(struct soap *soap, const char *URL, struct SOAP_ENV__Header *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read_SOAP_ENV__Header(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv_SOAP_ENV__Header(struct soap *soap, struct SOAP_ENV__Header *p) +{ + if (::soap_read_SOAP_ENV__Header(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#endif + +#ifndef SOAP_TYPE___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN_DEFINED +#define SOAP_TYPE___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN_DEFINED +SOAP_FMAC3 void SOAP_FMAC4 soap_default___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(struct soap*, struct __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN *); +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(struct soap*, const struct __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN *); +SOAP_FMAC3 int SOAP_FMAC4 soap_out___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(struct soap*, const char*, int, const struct __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN *, const char*); +SOAP_FMAC3 struct __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN * SOAP_FMAC4 soap_in___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(struct soap*, const char*, struct __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN *, const char*); +SOAP_FMAC1 struct __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN * SOAP_FMAC2 soap_instantiate___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(struct soap*, int, const char*, const char*, size_t*); + +inline struct __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN * soap_new___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(struct soap *soap, int n = -1) +{ + return soap_instantiate___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(soap, n, NULL, NULL, NULL); +} + +inline struct __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN * soap_new_req___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN( + struct soap *soap) +{ + struct __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN *_p = ::soap_new___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(soap); + if (_p) + { ::soap_default___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(soap, _p); + } + return _p; +} + +inline struct __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN * soap_new_set___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN( + struct soap *soap, + ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ *ns1__MT_USCOREFACTORY_USCORENUMBER_USCOREREQ) +{ + struct __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN *_p = ::soap_new___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(soap); + if (_p) + { ::soap_default___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(soap, _p); + _p->ns1__MT_USCOREFACTORY_USCORENUMBER_USCOREREQ = ns1__MT_USCOREFACTORY_USCORENUMBER_USCOREREQ; + } + return _p; +} +SOAP_FMAC3 int SOAP_FMAC4 soap_put___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(struct soap*, const struct __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN *, const char*, const char*); + +inline int soap_write___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(struct soap *soap, struct __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN const*p) +{ + soap_free_temp(soap); + if (soap_begin_send(soap) || (::soap_serialize___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(soap, p), 0) || ::soap_put___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(soap, p, "-ns1:SI_FACTORY_NUMBER_PLM_OUT_SYN", "") || soap_end_send(soap)) + return soap->error; + return SOAP_OK; +} + +inline int soap_PUT___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(struct soap *soap, const char *URL, struct __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(soap, p), 0) || ::soap_put___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(soap, p, "-ns1:SI_FACTORY_NUMBER_PLM_OUT_SYN", "") || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(struct soap *soap, const char *URL, struct __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(soap, p), 0) || ::soap_put___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(soap, p, "-ns1:SI_FACTORY_NUMBER_PLM_OUT_SYN", "") || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(struct soap *soap, const char *URL, struct __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(soap, p), 0) || ::soap_put___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(soap, p, "-ns1:SI_FACTORY_NUMBER_PLM_OUT_SYN", "") || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 struct __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN * SOAP_FMAC4 soap_get___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(struct soap*, struct __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN *, const char*, const char*); + +inline int soap_read___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(struct soap *soap, struct __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN *p) +{ + if (p) + { ::soap_default___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(soap, p); + if (soap_begin_recv(soap) || ::soap_get___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(struct soap *soap, const char *URL, struct __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(struct soap *soap, struct __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN *p) +{ + if (::soap_read___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#ifndef WITH_NOGLOBAL + +#ifndef SOAP_TYPE_PointerToSOAP_ENV__Reason_DEFINED +#define SOAP_TYPE_PointerToSOAP_ENV__Reason_DEFINED +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerToSOAP_ENV__Reason(struct soap*, struct SOAP_ENV__Reason *const*); +SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerToSOAP_ENV__Reason(struct soap*, const char *, int, struct SOAP_ENV__Reason *const*, const char *); +SOAP_FMAC3 struct SOAP_ENV__Reason ** SOAP_FMAC4 soap_in_PointerToSOAP_ENV__Reason(struct soap*, const char*, struct SOAP_ENV__Reason **, const char*); +SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerToSOAP_ENV__Reason(struct soap*, struct SOAP_ENV__Reason *const*, const char*, const char*); +SOAP_FMAC3 struct SOAP_ENV__Reason ** SOAP_FMAC4 soap_get_PointerToSOAP_ENV__Reason(struct soap*, struct SOAP_ENV__Reason **, const char*, const char*); +#endif + +#endif + +#ifndef WITH_NOGLOBAL + +#ifndef SOAP_TYPE_PointerToSOAP_ENV__Detail_DEFINED +#define SOAP_TYPE_PointerToSOAP_ENV__Detail_DEFINED +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerToSOAP_ENV__Detail(struct soap*, struct SOAP_ENV__Detail *const*); +SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerToSOAP_ENV__Detail(struct soap*, const char *, int, struct SOAP_ENV__Detail *const*, const char *); +SOAP_FMAC3 struct SOAP_ENV__Detail ** SOAP_FMAC4 soap_in_PointerToSOAP_ENV__Detail(struct soap*, const char*, struct SOAP_ENV__Detail **, const char*); +SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerToSOAP_ENV__Detail(struct soap*, struct SOAP_ENV__Detail *const*, const char*, const char*); +SOAP_FMAC3 struct SOAP_ENV__Detail ** SOAP_FMAC4 soap_get_PointerToSOAP_ENV__Detail(struct soap*, struct SOAP_ENV__Detail **, const char*, const char*); +#endif + +#endif + +#ifndef WITH_NOGLOBAL + +#ifndef SOAP_TYPE_PointerToSOAP_ENV__Code_DEFINED +#define SOAP_TYPE_PointerToSOAP_ENV__Code_DEFINED +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerToSOAP_ENV__Code(struct soap*, struct SOAP_ENV__Code *const*); +SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerToSOAP_ENV__Code(struct soap*, const char *, int, struct SOAP_ENV__Code *const*, const char *); +SOAP_FMAC3 struct SOAP_ENV__Code ** SOAP_FMAC4 soap_in_PointerToSOAP_ENV__Code(struct soap*, const char*, struct SOAP_ENV__Code **, const char*); +SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerToSOAP_ENV__Code(struct soap*, struct SOAP_ENV__Code *const*, const char*, const char*); +SOAP_FMAC3 struct SOAP_ENV__Code ** SOAP_FMAC4 soap_get_PointerToSOAP_ENV__Code(struct soap*, struct SOAP_ENV__Code **, const char*, const char*); +#endif + +#endif + +#ifndef SOAP_TYPE_PointerTons1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_DEFINED +#define SOAP_TYPE_PointerTons1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_DEFINED +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerTons1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(struct soap*, ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ *const*); +SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerTons1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(struct soap*, const char *, int, ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ *const*, const char *); +SOAP_FMAC3 ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ ** SOAP_FMAC4 soap_in_PointerTons1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(struct soap*, const char*, ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ **, const char*); +SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerTons1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(struct soap*, ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ *const*, const char*, const char*); +SOAP_FMAC3 ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ ** SOAP_FMAC4 soap_get_PointerTons1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(struct soap*, ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ **, const char*, const char*); +#endif + +#ifndef SOAP_TYPE_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_DEFINED +#define SOAP_TYPE_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_DEFINED +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(struct soap*, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS *const*); +SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(struct soap*, const char *, int, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS *const*, const char *); +SOAP_FMAC3 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS ** SOAP_FMAC4 soap_in_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(struct soap*, const char*, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS **, const char*); +SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(struct soap*, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS *const*, const char*, const char*); +SOAP_FMAC3 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS ** SOAP_FMAC4 soap_get_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(struct soap*, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS **, const char*, const char*); +#endif + +#ifndef SOAP_TYPE_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM_DEFINED +#define SOAP_TYPE_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM_DEFINED +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(struct soap*, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM *const*); +SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(struct soap*, const char *, int, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM *const*, const char *); +SOAP_FMAC3 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM ** SOAP_FMAC4 soap_in_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(struct soap*, const char*, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM **, const char*); +SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(struct soap*, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM *const*, const char*, const char*); +SOAP_FMAC3 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM ** SOAP_FMAC4 soap_get_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(struct soap*, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM **, const char*, const char*); +#endif + +#ifndef SOAP_TYPE_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO_DEFINED +#define SOAP_TYPE_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO_DEFINED +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(struct soap*, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO *const*); +SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(struct soap*, const char *, int, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO *const*, const char *); +SOAP_FMAC3 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO ** SOAP_FMAC4 soap_in_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(struct soap*, const char*, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO **, const char*); +SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(struct soap*, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO *const*, const char*, const char*); +SOAP_FMAC3 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO ** SOAP_FMAC4 soap_get_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(struct soap*, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO **, const char*, const char*); +#endif + +#ifndef SOAP_TYPE_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN_DEFINED +#define SOAP_TYPE_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN_DEFINED +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(struct soap*, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN *const*); +SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(struct soap*, const char *, int, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN *const*, const char *); +SOAP_FMAC3 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN ** SOAP_FMAC4 soap_in_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(struct soap*, const char*, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN **, const char*); +SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(struct soap*, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN *const*, const char*, const char*); +SOAP_FMAC3 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN ** SOAP_FMAC4 soap_get_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(struct soap*, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN **, const char*, const char*); +#endif + +#ifndef SOAP_TYPE_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO_DEFINED +#define SOAP_TYPE_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO_DEFINED +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(struct soap*, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO *const*); +SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(struct soap*, const char *, int, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO *const*, const char *); +SOAP_FMAC3 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO ** SOAP_FMAC4 soap_in_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(struct soap*, const char*, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO **, const char*); +SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(struct soap*, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO *const*, const char*, const char*); +SOAP_FMAC3 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO ** SOAP_FMAC4 soap_get_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(struct soap*, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO **, const char*, const char*); +#endif + +#ifndef SOAP_TYPE__QName_DEFINED +#define SOAP_TYPE__QName_DEFINED + +inline void soap_default__QName(struct soap *soap, char **a) +{ + (void)soap; /* appease -Wall -Werror */ +#ifdef SOAP_DEFAULT__QName + *a = SOAP_DEFAULT__QName; +#else + *a = (char *)0; +#endif +} +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize__QName(struct soap*, char *const*); + +#define soap__QName2s(soap, a) soap_QName2s(soap, (a)) +SOAP_FMAC3 int SOAP_FMAC4 soap_out__QName(struct soap*, const char*, int, char*const*, const char*); + +#define soap_s2_QName(soap, s, a) soap_s2QName((soap), (s), (char**)(a), 0, -1, NULL) +SOAP_FMAC3 char * * SOAP_FMAC4 soap_in__QName(struct soap*, const char*, char **, const char*); + +#define soap_instantiate__QName soap_instantiate_string + + +#define soap_new__QName soap_new_string + +SOAP_FMAC3 int SOAP_FMAC4 soap_put__QName(struct soap*, char *const*, const char*, const char*); + +inline int soap_write__QName(struct soap *soap, char *const*p) +{ + soap_free_temp(soap); + if (p) + { if (soap_begin_send(soap) || ::soap_put__QName(soap, p, "QName", "") || soap_end_send(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_PUT__QName(struct soap *soap, const char *URL, char *const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || ::soap_put__QName(soap, p, "QName", "") || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH__QName(struct soap *soap, const char *URL, char *const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || ::soap_put__QName(soap, p, "QName", "") || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send__QName(struct soap *soap, const char *URL, char *const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || ::soap_put__QName(soap, p, "QName", "") || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 char ** SOAP_FMAC4 soap_get__QName(struct soap*, char **, const char*, const char*); + +inline int soap_read__QName(struct soap *soap, char **p) +{ + if (p) + { if (soap_begin_recv(soap) || ::soap_get__QName(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET__QName(struct soap *soap, const char *URL, char **p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read__QName(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv__QName(struct soap *soap, char **p) +{ + if (::soap_read__QName(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#ifndef SOAP_TYPE__XML_DEFINED +#define SOAP_TYPE__XML_DEFINED +#endif + +#ifndef SOAP_TYPE_string_DEFINED +#define SOAP_TYPE_string_DEFINED + +inline void soap_default_string(struct soap *soap, char **a) +{ + (void)soap; /* appease -Wall -Werror */ +#ifdef SOAP_DEFAULT_string + *a = SOAP_DEFAULT_string; +#else + *a = (char *)0; +#endif +} +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_string(struct soap*, char *const*); + +#define soap_string2s(soap, a) (a) +SOAP_FMAC3 int SOAP_FMAC4 soap_out_string(struct soap*, const char*, int, char*const*, const char*); + +#define soap_s2string(soap, s, a) soap_s2char((soap), (s), (char**)(a), 1, 0, -1, NULL) +SOAP_FMAC3 char * * SOAP_FMAC4 soap_in_string(struct soap*, const char*, char **, const char*); + +SOAP_FMAC3 char * * SOAP_FMAC4 soap_new_string(struct soap *soap, int n = -1); +SOAP_FMAC3 int SOAP_FMAC4 soap_put_string(struct soap*, char *const*, const char*, const char*); + +inline int soap_write_string(struct soap *soap, char *const*p) +{ + soap_free_temp(soap); + if (p) + { if (soap_begin_send(soap) || ::soap_put_string(soap, p, "string", "") || soap_end_send(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_PUT_string(struct soap *soap, const char *URL, char *const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || ::soap_put_string(soap, p, "string", "") || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH_string(struct soap *soap, const char *URL, char *const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || ::soap_put_string(soap, p, "string", "") || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send_string(struct soap *soap, const char *URL, char *const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || ::soap_put_string(soap, p, "string", "") || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 char ** SOAP_FMAC4 soap_get_string(struct soap*, char **, const char*, const char*); + +inline int soap_read_string(struct soap *soap, char **p) +{ + if (p) + { if (soap_begin_recv(soap) || ::soap_get_string(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET_string(struct soap *soap, const char *URL, char **p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read_string(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv_string(struct soap *soap, char **p) +{ + if (::soap_read_string(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#endif + +/* End of soapH.h */ diff --git a/DFL_BOM_WL_TOERP/bin/win64/soapSIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy.cpp b/DFL_BOM_WL_TOERP/bin/win64/soapSIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy.cpp new file mode 100644 index 0000000..d823b59 --- /dev/null +++ b/DFL_BOM_WL_TOERP/bin/win64/soapSIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy.cpp @@ -0,0 +1,204 @@ +/* soapSIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy.cpp + Generated by gSOAP 2.8.131 for bomtest.h + +gSOAP XML Web services tools +Copyright (C) 2000-2023, Robert van Engelen, Genivia Inc. All Rights Reserved. +The soapcpp2 tool and its generated software are released under the GPL. +This program is released under the GPL with the additional exemption that +compiling, linking, and/or using OpenSSL is allowed. +-------------------------------------------------------------------------------- +A commercial use license is available from Genivia Inc., contact@genivia.com +-------------------------------------------------------------------------------- +*/ + +#include "soapSIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy.h" + +SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy::SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy() : soap(SOAP_IO_DEFAULT) +{ SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy_init(SOAP_IO_DEFAULT, SOAP_IO_DEFAULT); +} + +SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy::SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy(const SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy& rhs) +{ soap_copy_context(this, &rhs); + this->soap_endpoint = rhs.soap_endpoint; +} + +SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy::SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy(const struct soap &_soap) : soap(_soap) +{ } + +SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy::SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy(const struct soap &_soap, const char *soap_endpoint_url) : soap(_soap) +{ + soap_endpoint = soap_endpoint_url; +} + +SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy::SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy(const char *soap_endpoint_url) : soap(SOAP_IO_DEFAULT) +{ SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy_init(SOAP_IO_DEFAULT, SOAP_IO_DEFAULT); + soap_endpoint = soap_endpoint_url; +} + +SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy::SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy(soap_mode iomode) : soap(iomode) +{ SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy_init(iomode, iomode); +} + +SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy::SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy(const char *soap_endpoint_url, soap_mode iomode) : soap(iomode) +{ SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy_init(iomode, iomode); + soap_endpoint = soap_endpoint_url; +} + +SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy::SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy(soap_mode imode, soap_mode omode) : soap(imode, omode) +{ SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy_init(imode, omode); +} + +SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy::~SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy() +{ + SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy::destroy(); +} + +void SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy::SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy_init(soap_mode imode, soap_mode omode) +{ soap_imode(this, imode); + soap_omode(this, omode); + soap_endpoint = NULL; + static const struct Namespace namespaces[] = { + { "SOAP-ENV", "http://schemas.xmlsoap.org/soap/envelope/", "http://www.w3.org/*/soap-envelope", NULL }, + { "SOAP-ENC", "http://schemas.xmlsoap.org/soap/encoding/", "http://www.w3.org/*/soap-encoding", NULL }, + { "xsi", "http://www.w3.org/2001/XMLSchema-instance", "http://www.w3.org/*/XMLSchema-instance", NULL }, + { "xsd", "http://www.w3.org/2001/XMLSchema", "http://www.w3.org/*/XMLSchema", NULL }, + { "ns1", "urn:chintelectric.com:xi:plm", NULL, NULL }, + { NULL, NULL, NULL, NULL} /* end of namespaces[] */ + }; + soap_set_namespaces(this, namespaces); +} + +SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy *SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy::copy() +{ SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy *dup = SOAP_NEW_UNMANAGED(SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy(*(struct soap*)this)); + return dup; +} + +SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy& SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy::operator=(const SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy& rhs) +{ soap_done(this); + soap_copy_context(this, &rhs); + this->soap_endpoint = rhs.soap_endpoint; + return *this; +} + +void SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy::destroy() +{ soap_destroy(this); + soap_end(this); +} + +void SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy::reset() +{ this->destroy(); + soap_done(this); + soap_initialize(this); + SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy_init(SOAP_IO_DEFAULT, SOAP_IO_DEFAULT); +} + +void SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy::soap_noheader() +{ this->header = NULL; +} + +::SOAP_ENV__Header *SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy::soap_header() +{ return this->header; +} + +::SOAP_ENV__Fault *SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy::soap_fault() +{ return this->fault; +} + +const char *SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy::soap_fault_subcode() +{ return ::soap_fault_subcode(this); +} + +const char *SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy::soap_fault_string() +{ return ::soap_fault_string(this); +} + +const char *SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy::soap_fault_detail() +{ return ::soap_fault_detail(this); +} + +int SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy::soap_close_socket() +{ return ::soap_closesock(this); +} + +int SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy::soap_force_close_socket() +{ return ::soap_force_closesock(this); +} + +void SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy::soap_print_fault(FILE *fd) +{ ::soap_print_fault(this, fd); +} + +#ifndef WITH_LEAN +#ifndef WITH_COMPAT +void SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy::soap_stream_fault(std::ostream& os) +{ ::soap_stream_fault(this, os); +} +#endif + +char *SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy::soap_sprint_fault(char *buf, size_t len) +{ return ::soap_sprint_fault(this, buf, len); +} +#endif + +int SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy::send_SIO_USCOREBOM_USCOREPLM_USCOREASYN(const char *soap_endpoint_url, const char *soap_action, ns1__DT_USCOREBOM_USCORES4_USCOREREQ *ns1__MT_USCOREBOM_USCORES4_USCOREREQ) +{ + struct soap *soap = this; + struct __ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN soap_tmp___ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN; + if (soap_endpoint_url != NULL) + soap_endpoint = soap_endpoint_url; + if (soap_endpoint == NULL) + soap_endpoint = "http://gfpot01:50100/XISOAPAdapter/MessageServlet?senderParty=&senderService=BC_CHINT_ELECTRIC&receiverParty=&receiverService=&interface=SIO_BOM_PLM_ASYN&interfaceNamespace=urn%3Achintelectric.com%3Axi%3Aplm https://gfpot01:50101/XISOAPAdapter/MessageServlet?senderParty=&senderService=BC_CHINT_ELECTRIC&receiverParty=&receiverService=&interface=SIO_BOM_PLM_ASYN&interfaceNamespace=urn%3Achintelectric.com%3Axi%3Aplm"; + if (soap_action == NULL) + soap_action = "http://sap.com/xi/WebService/soap1.1"; + soap_tmp___ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN.ns1__MT_USCOREBOM_USCORES4_USCOREREQ = ns1__MT_USCOREBOM_USCORES4_USCOREREQ; + soap_begin(soap); + soap->encodingStyle = NULL; /* use SOAP literal style */ + soap_serializeheader(soap); + soap_serialize___ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN(soap, &soap_tmp___ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN); + if (soap_begin_count(soap)) + return soap->error; + if ((soap->mode & SOAP_IO_LENGTH)) + { if (soap_envelope_begin_out(soap) + || soap_putheader(soap) + || soap_body_begin_out(soap) + || soap_put___ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN(soap, &soap_tmp___ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN, "-ns1:SIO_BOM_PLM_ASYN", "") + || soap_body_end_out(soap) + || soap_envelope_end_out(soap)) + return soap->error; + } + if (soap_end_count(soap)) + return soap->error; + if (soap_connect(soap, soap_endpoint, soap_action) + || soap_envelope_begin_out(soap) + || soap_putheader(soap) + || soap_body_begin_out(soap) + || soap_put___ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN(soap, &soap_tmp___ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN, "-ns1:SIO_BOM_PLM_ASYN", "") + || soap_body_end_out(soap) + || soap_envelope_end_out(soap) + || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +int SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy::recv_SIO_USCOREBOM_USCOREPLM_USCOREASYN(struct __ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN& tmp) +{ + struct soap *soap = this; + struct __ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN *_param_1 = &tmp; + soap_default___ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN(soap, _param_1); + soap_begin(soap); + if (soap_begin_recv(soap) + || soap_envelope_begin_in(soap) + || soap_recv_header(soap) + || soap_body_begin_in(soap)) + return soap_closesock(soap); + soap_get___ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN(soap, _param_1, "-ns1:SIO_BOM_PLM_ASYN", NULL); + if (soap->error == SOAP_TAG_MISMATCH && soap->level == 2) + soap->error = SOAP_OK; + if (soap->error + || soap_body_end_in(soap) + || soap_envelope_end_in(soap) + || soap_end_recv(soap)) + return soap_closesock(soap); + return soap_closesock(soap); +} +/* End of client proxy code */ diff --git a/DFL_BOM_WL_TOERP/bin/win64/soapSIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy.h b/DFL_BOM_WL_TOERP/bin/win64/soapSIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy.h new file mode 100644 index 0000000..17fa88a --- /dev/null +++ b/DFL_BOM_WL_TOERP/bin/win64/soapSIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy.h @@ -0,0 +1,91 @@ +/* soapSIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy.h + Generated by gSOAP 2.8.131 for bomtest.h + +gSOAP XML Web services tools +Copyright (C) 2000-2023, Robert van Engelen, Genivia Inc. All Rights Reserved. +The soapcpp2 tool and its generated software are released under the GPL. +This program is released under the GPL with the additional exemption that +compiling, linking, and/or using OpenSSL is allowed. +-------------------------------------------------------------------------------- +A commercial use license is available from Genivia Inc., contact@genivia.com +-------------------------------------------------------------------------------- +*/ + +#ifndef soapSIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy_H +#define soapSIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy_H +#include "soapH.h" + + class SOAP_CMAC SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy : public soap { + public: + /// Endpoint URL of service 'SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy' (change as needed) + const char *soap_endpoint; + /// Variables globally declared in bomtest.h, if any + /// Construct a proxy with new managing context + SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy(); + /// Copy constructor + SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy(const SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy& rhs); + /// Construct proxy given a managing context + SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy(const struct soap&); + /// Construct proxy given a managing context and endpoint URL + SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy(const struct soap&, const char *soap_endpoint_url); + /// Constructor taking an endpoint URL + SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy(const char *soap_endpoint_url); + /// Constructor taking input and output mode flags for the new managing context + SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy(soap_mode iomode); + /// Constructor taking endpoint URL and input and output mode flags for the new managing context + SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy(const char *soap_endpoint_url, soap_mode iomode); + /// Constructor taking input and output mode flags for the new managing context + SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy(soap_mode imode, soap_mode omode); + /// Destructor deletes deserialized data and its managing context + virtual ~SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy(); + /// Initializer used by constructors + virtual void SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy_init(soap_mode imode, soap_mode omode); + /// Return a copy that has a new managing context with the same engine state + virtual SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy *copy(); + /// Copy assignment + SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy& operator=(const SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy&); + /// Delete all deserialized data (uses soap_destroy() and soap_end()) + virtual void destroy(); + /// Delete all deserialized data and reset to default + virtual void reset(); + /// Disables and removes SOAP Header from message by setting soap->header = NULL + virtual void soap_noheader(); + /// Get SOAP Header structure (i.e. soap->header, which is NULL when absent) + virtual ::SOAP_ENV__Header *soap_header(); + /// Get SOAP Fault structure (i.e. soap->fault, which is NULL when absent) + virtual ::SOAP_ENV__Fault *soap_fault(); + /// Get SOAP Fault subcode QName string (NULL when absent) + virtual const char *soap_fault_subcode(); + /// Get SOAP Fault string/reason (NULL when absent) + virtual const char *soap_fault_string(); + /// Get SOAP Fault detail XML string (NULL when absent) + virtual const char *soap_fault_detail(); + /// Close connection (normally automatic, except for send_X ops) + virtual int soap_close_socket(); + /// Force close connection (can kill a thread blocked on IO) + virtual int soap_force_close_socket(); + /// Print fault + virtual void soap_print_fault(FILE*); + #ifndef WITH_LEAN + #ifndef WITH_COMPAT + /// Print fault to stream + virtual void soap_stream_fault(std::ostream&); + #endif + /// Write fault to buffer + virtual char *soap_sprint_fault(char *buf, size_t len); + #endif + // + /// Web service one-way synchronous send operation 'SIO_BOM_PLM_ASYN' to the default endpoint with the default SOAP Action header then wait for HTTP OK/Accept response, returns SOAP_OK or error code + virtual int SIO_USCOREBOM_USCOREPLM_USCOREASYN(ns1__DT_USCOREBOM_USCORES4_USCOREREQ *ns1__MT_USCOREBOM_USCORES4_USCOREREQ) { return this->SIO_USCOREBOM_USCOREPLM_USCOREASYN(NULL, NULL, ns1__MT_USCOREBOM_USCORES4_USCOREREQ); } + /// Web service one-way synchronous send operation 'SIO_BOM_PLM_ASYN' to the specified endpoint and SOAP Action header then wait for HTTP OK/Accept response, returns SOAP_OK or error code + virtual int SIO_USCOREBOM_USCOREPLM_USCOREASYN(const char *soap_endpoint_url, const char *soap_action, ns1__DT_USCOREBOM_USCORES4_USCOREREQ *ns1__MT_USCOREBOM_USCORES4_USCOREREQ) { return (this->send_SIO_USCOREBOM_USCOREPLM_USCOREASYN(soap_endpoint_url, soap_action, ns1__MT_USCOREBOM_USCORES4_USCOREREQ) || soap_recv_empty_response(this)) ? this->error : SOAP_OK; } + /// Web service one-way asynchronous send operation 'send_SIO_BOM_PLM_ASYN' with default endpoint and default SOAP Action header, returns SOAP_OK or error code + virtual int send_SIO_USCOREBOM_USCOREPLM_USCOREASYN(ns1__DT_USCOREBOM_USCORES4_USCOREREQ *ns1__MT_USCOREBOM_USCORES4_USCOREREQ) { return this->send_SIO_USCOREBOM_USCOREPLM_USCOREASYN(NULL, NULL, ns1__MT_USCOREBOM_USCORES4_USCOREREQ); } + /// Web service one-way asynchronous send operation 'send_SIO_BOM_PLM_ASYN' to the specified endpoint and SOAP Action header, returns SOAP_OK or error code + virtual int send_SIO_USCOREBOM_USCOREPLM_USCOREASYN(const char *soap_endpoint_url, const char *soap_action, ns1__DT_USCOREBOM_USCORES4_USCOREREQ *ns1__MT_USCOREBOM_USCORES4_USCOREREQ); + /// Web service one-way asynchronous receive operation 'recv_SIO_BOM_PLM_ASYN', returns SOAP_OK or error code; + virtual int recv_SIO_USCOREBOM_USCOREPLM_USCOREASYN(struct __ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN&); + /// Web service asynchronous receive of HTTP Accept acknowledgment for one-way asynchronous send operation 'send_SIO_BOM_PLM_ASYN', returns SOAP_OK or error code + virtual int recv_SIO_USCOREBOM_USCOREPLM_USCOREASYN_empty_response() { return soap_recv_empty_response(this); } + }; +#endif diff --git a/DFL_BOM_WL_TOERP/bin/win64/soapSI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy.cpp b/DFL_BOM_WL_TOERP/bin/win64/soapSI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy.cpp new file mode 100644 index 0000000..6b2b49a --- /dev/null +++ b/DFL_BOM_WL_TOERP/bin/win64/soapSI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy.cpp @@ -0,0 +1,201 @@ +/* soapSI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy.cpp + Generated by gSOAP 2.8.131 for factory.h + +gSOAP XML Web services tools +Copyright (C) 2000-2023, Robert van Engelen, Genivia Inc. All Rights Reserved. +The soapcpp2 tool and its generated software are released under the GPL. +This program is released under the GPL with the additional exemption that +compiling, linking, and/or using OpenSSL is allowed. +-------------------------------------------------------------------------------- +A commercial use license is available from Genivia Inc., contact@genivia.com +-------------------------------------------------------------------------------- +*/ + +#include "soapSI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy.h" + +SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy() : soap(SOAP_IO_DEFAULT) +{ SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy_init(SOAP_IO_DEFAULT, SOAP_IO_DEFAULT); +} + +SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy(const SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy& rhs) +{ soap_copy_context(this, &rhs); + this->soap_endpoint = rhs.soap_endpoint; +} + +SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy(const struct soap &_soap) : soap(_soap) +{ } + +SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy(const struct soap &_soap, const char *soap_endpoint_url) : soap(_soap) +{ + soap_endpoint = soap_endpoint_url; +} + +SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy(const char *soap_endpoint_url) : soap(SOAP_IO_DEFAULT) +{ SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy_init(SOAP_IO_DEFAULT, SOAP_IO_DEFAULT); + soap_endpoint = soap_endpoint_url; +} + +SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy(soap_mode iomode) : soap(iomode) +{ SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy_init(iomode, iomode); +} + +SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy(const char *soap_endpoint_url, soap_mode iomode) : soap(iomode) +{ SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy_init(iomode, iomode); + soap_endpoint = soap_endpoint_url; +} + +SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy(soap_mode imode, soap_mode omode) : soap(imode, omode) +{ SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy_init(imode, omode); +} + +SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::~SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy() +{ + SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::destroy(); +} + +void SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy_init(soap_mode imode, soap_mode omode) +{ soap_imode(this, imode); + soap_omode(this, omode); + soap_endpoint = NULL; + static const struct Namespace namespaces[] = { + { "SOAP-ENV", "http://schemas.xmlsoap.org/soap/envelope/", "http://www.w3.org/*/soap-envelope", NULL }, + { "SOAP-ENC", "http://schemas.xmlsoap.org/soap/encoding/", "http://www.w3.org/*/soap-encoding", NULL }, + { "xsi", "http://www.w3.org/2001/XMLSchema-instance", "http://www.w3.org/*/XMLSchema-instance", NULL }, + { "xsd", "http://www.w3.org/2001/XMLSchema", "http://www.w3.org/*/XMLSchema", NULL }, + { "ns1", "urn:chintelectric.com:xi:plm", NULL, NULL }, + { NULL, NULL, NULL, NULL} /* end of namespaces[] */ + }; + soap_set_namespaces(this, namespaces); +} + +SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy *SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::copy() +{ SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy *dup = SOAP_NEW_UNMANAGED(SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy(*(struct soap*)this)); + return dup; +} + +SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy& SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::operator=(const SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy& rhs) +{ soap_done(this); + soap_copy_context(this, &rhs); + this->soap_endpoint = rhs.soap_endpoint; + return *this; +} + +void SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::destroy() +{ soap_destroy(this); + soap_end(this); +} + +void SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::reset() +{ this->destroy(); + soap_done(this); + soap_initialize(this); + SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy_init(SOAP_IO_DEFAULT, SOAP_IO_DEFAULT); +} + +void SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::soap_noheader() +{ this->header = NULL; +} + +::SOAP_ENV__Header *SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::soap_header() +{ return this->header; +} + +::SOAP_ENV__Fault *SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::soap_fault() +{ return this->fault; +} + +const char *SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::soap_fault_subcode() +{ return ::soap_fault_subcode(this); +} + +const char *SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::soap_fault_string() +{ return ::soap_fault_string(this); +} + +const char *SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::soap_fault_detail() +{ return ::soap_fault_detail(this); +} + +int SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::soap_close_socket() +{ return ::soap_closesock(this); +} + +int SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::soap_force_close_socket() +{ return ::soap_force_closesock(this); +} + +void SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::soap_print_fault(FILE *fd) +{ ::soap_print_fault(this, fd); +} + +#ifndef WITH_LEAN +#ifndef WITH_COMPAT +void SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::soap_stream_fault(std::ostream& os) +{ ::soap_stream_fault(this, os); +} +#endif + +char *SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::soap_sprint_fault(char *buf, size_t len) +{ return ::soap_sprint_fault(this, buf, len); +} +#endif + +int SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::send_SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(const char *soap_endpoint_url, const char *soap_action, ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ *ns1__MT_USCOREFACTORY_USCORENUMBER_USCOREREQ) +{ + struct soap *soap = this; + struct __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN soap_tmp___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN; + if (soap_endpoint_url != NULL) + soap_endpoint = soap_endpoint_url; + if (soap_endpoint == NULL) + soap_endpoint = "http://gfpoapp:50100/XISOAPAdapter/MessageServlet?senderParty=&senderService=BC_CHINT_ELECTRIC&receiverParty=&receiverService=&interface=SI_FACTORY_NUMBER_PLM_OUT_SYN&interfaceNamespace=urn%3Achintelectric.com%3Axi%3Aplm https://gfpoapp:50101/XISOAPAdapter/MessageServlet?senderParty=&senderService=BC_CHINT_ELECTRIC&receiverParty=&receiverService=&interface=SI_FACTORY_NUMBER_PLM_OUT_SYN&interfaceNamespace=urn%3Achintelectric.com%3Axi%3Aplm"; + if (soap_action == NULL) + soap_action = "http://sap.com/xi/WebService/soap1.1"; + soap_tmp___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN.ns1__MT_USCOREFACTORY_USCORENUMBER_USCOREREQ = ns1__MT_USCOREFACTORY_USCORENUMBER_USCOREREQ; + soap_begin(soap); + soap->encodingStyle = NULL; /* use SOAP literal style */ + soap_serializeheader(soap); + soap_serialize___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(soap, &soap_tmp___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN); + if (soap_begin_count(soap)) + return soap->error; + if ((soap->mode & SOAP_IO_LENGTH)) + { if (soap_envelope_begin_out(soap) + || soap_putheader(soap) + || soap_body_begin_out(soap) + || soap_put___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(soap, &soap_tmp___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN, "-ns1:SI_FACTORY_NUMBER_PLM_OUT_SYN", "") + || soap_body_end_out(soap) + || soap_envelope_end_out(soap)) + return soap->error; + } + if (soap_end_count(soap)) + return soap->error; + if (soap_connect(soap, soap_endpoint, soap_action) + || soap_envelope_begin_out(soap) + || soap_putheader(soap) + || soap_body_begin_out(soap) + || soap_put___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(soap, &soap_tmp___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN, "-ns1:SI_FACTORY_NUMBER_PLM_OUT_SYN", "") + || soap_body_end_out(soap) + || soap_envelope_end_out(soap) + || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +int SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::recv_SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP &ns1__MT_USCOREFACTORY_USCORENUMBER_USCORERSP) +{ + struct soap *soap = this; + ns1__MT_USCOREFACTORY_USCORENUMBER_USCORERSP.soap_default(soap); + if (soap_begin_recv(soap) + || soap_envelope_begin_in(soap) + || soap_recv_header(soap) + || soap_body_begin_in(soap)) + return soap_closesock(soap); + ns1__MT_USCOREFACTORY_USCORENUMBER_USCORERSP.soap_get(soap, "ns1:MT_FACTORY_NUMBER_RSP", NULL); + if (soap->error) + return soap_recv_fault(soap, 0); + if (soap_body_end_in(soap) + || soap_envelope_end_in(soap) + || soap_end_recv(soap)) + return soap_closesock(soap); + return soap_closesock(soap); +} +/* End of client proxy code */ diff --git a/DFL_BOM_WL_TOERP/bin/win64/soapSI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy.h b/DFL_BOM_WL_TOERP/bin/win64/soapSI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy.h new file mode 100644 index 0000000..7cca54e --- /dev/null +++ b/DFL_BOM_WL_TOERP/bin/win64/soapSI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy.h @@ -0,0 +1,87 @@ +/* soapSI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy.h + Generated by gSOAP 2.8.131 for factory.h + +gSOAP XML Web services tools +Copyright (C) 2000-2023, Robert van Engelen, Genivia Inc. All Rights Reserved. +The soapcpp2 tool and its generated software are released under the GPL. +This program is released under the GPL with the additional exemption that +compiling, linking, and/or using OpenSSL is allowed. +-------------------------------------------------------------------------------- +A commercial use license is available from Genivia Inc., contact@genivia.com +-------------------------------------------------------------------------------- +*/ + +#ifndef soapSI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy_H +#define soapSI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy_H +#include "soapH.h" + + class SOAP_CMAC SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy : public soap { + public: + /// Endpoint URL of service 'SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy' (change as needed) + const char *soap_endpoint; + /// Variables globally declared in factory.h, if any + /// Construct a proxy with new managing context + SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy(); + /// Copy constructor + SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy(const SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy& rhs); + /// Construct proxy given a managing context + SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy(const struct soap&); + /// Construct proxy given a managing context and endpoint URL + SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy(const struct soap&, const char *soap_endpoint_url); + /// Constructor taking an endpoint URL + SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy(const char *soap_endpoint_url); + /// Constructor taking input and output mode flags for the new managing context + SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy(soap_mode iomode); + /// Constructor taking endpoint URL and input and output mode flags for the new managing context + SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy(const char *soap_endpoint_url, soap_mode iomode); + /// Constructor taking input and output mode flags for the new managing context + SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy(soap_mode imode, soap_mode omode); + /// Destructor deletes deserialized data and its managing context + virtual ~SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy(); + /// Initializer used by constructors + virtual void SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy_init(soap_mode imode, soap_mode omode); + /// Return a copy that has a new managing context with the same engine state + virtual SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy *copy(); + /// Copy assignment + SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy& operator=(const SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy&); + /// Delete all deserialized data (uses soap_destroy() and soap_end()) + virtual void destroy(); + /// Delete all deserialized data and reset to default + virtual void reset(); + /// Disables and removes SOAP Header from message by setting soap->header = NULL + virtual void soap_noheader(); + /// Get SOAP Header structure (i.e. soap->header, which is NULL when absent) + virtual ::SOAP_ENV__Header *soap_header(); + /// Get SOAP Fault structure (i.e. soap->fault, which is NULL when absent) + virtual ::SOAP_ENV__Fault *soap_fault(); + /// Get SOAP Fault subcode QName string (NULL when absent) + virtual const char *soap_fault_subcode(); + /// Get SOAP Fault string/reason (NULL when absent) + virtual const char *soap_fault_string(); + /// Get SOAP Fault detail XML string (NULL when absent) + virtual const char *soap_fault_detail(); + /// Close connection (normally automatic, except for send_X ops) + virtual int soap_close_socket(); + /// Force close connection (can kill a thread blocked on IO) + virtual int soap_force_close_socket(); + /// Print fault + virtual void soap_print_fault(FILE*); + #ifndef WITH_LEAN + #ifndef WITH_COMPAT + /// Print fault to stream + virtual void soap_stream_fault(std::ostream&); + #endif + /// Write fault to buffer + virtual char *soap_sprint_fault(char *buf, size_t len); + #endif + // + /// Web service synchronous operation 'SI_FACTORY_NUMBER_PLM_OUT_SYN' with default endpoint and default SOAP Action header, returns SOAP_OK or error code + virtual int SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ *ns1__MT_USCOREFACTORY_USCORENUMBER_USCOREREQ, ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP &ns1__MT_USCOREFACTORY_USCORENUMBER_USCORERSP) { return this->SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(NULL, NULL, ns1__MT_USCOREFACTORY_USCORENUMBER_USCOREREQ, ns1__MT_USCOREFACTORY_USCORENUMBER_USCORERSP); } + /// Web service synchronous operation 'SI_FACTORY_NUMBER_PLM_OUT_SYN' to the specified endpoint and SOAP Action header, returns SOAP_OK or error code + virtual int SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(const char *soap_endpoint_url, const char *soap_action, ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ *ns1__MT_USCOREFACTORY_USCORENUMBER_USCOREREQ, ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP &ns1__MT_USCOREFACTORY_USCORENUMBER_USCORERSP) { return this->send_SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(soap_endpoint_url, soap_action, ns1__MT_USCOREFACTORY_USCORENUMBER_USCOREREQ) || this->recv_SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(ns1__MT_USCOREFACTORY_USCORENUMBER_USCORERSP) ? this->error : SOAP_OK; } + /// Web service asynchronous operation 'send_SI_FACTORY_NUMBER_PLM_OUT_SYN' to send a request message to the specified endpoint and SOAP Action header, returns SOAP_OK or error code + virtual int send_SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(const char *soap_endpoint_url, const char *soap_action, ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ *ns1__MT_USCOREFACTORY_USCORENUMBER_USCOREREQ); + /// Web service asynchronous operation 'recv_SI_FACTORY_NUMBER_PLM_OUT_SYN' to receive a response message from the connected endpoint, returns SOAP_OK or error code + virtual int recv_SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP &ns1__MT_USCOREFACTORY_USCORENUMBER_USCORERSP); + }; +#endif diff --git a/DFL_BOM_WL_TOERP/bin/win64/soapSI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy.cpp b/DFL_BOM_WL_TOERP/bin/win64/soapSI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy.cpp new file mode 100644 index 0000000..0555d66 --- /dev/null +++ b/DFL_BOM_WL_TOERP/bin/win64/soapSI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy.cpp @@ -0,0 +1,201 @@ +/* soapSI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy.cpp + Generated by gSOAP 2.8.131 for BOP.h + +gSOAP XML Web services tools +Copyright (C) 2000-2023, Robert van Engelen, Genivia Inc. All Rights Reserved. +The soapcpp2 tool and its generated software are released under the GPL. +This program is released under the GPL with the additional exemption that +compiling, linking, and/or using OpenSSL is allowed. +-------------------------------------------------------------------------------- +A commercial use license is available from Genivia Inc., contact@genivia.com +-------------------------------------------------------------------------------- +*/ + +#include "soapSI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy.h" + +SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy() : soap(SOAP_IO_DEFAULT) +{ SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy_init(SOAP_IO_DEFAULT, SOAP_IO_DEFAULT); +} + +SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy(const SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy& rhs) +{ soap_copy_context(this, &rhs); + this->soap_endpoint = rhs.soap_endpoint; +} + +SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy(const struct soap &_soap) : soap(_soap) +{ } + +SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy(const struct soap &_soap, const char *soap_endpoint_url) : soap(_soap) +{ + soap_endpoint = soap_endpoint_url; +} + +SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy(const char *soap_endpoint_url) : soap(SOAP_IO_DEFAULT) +{ SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy_init(SOAP_IO_DEFAULT, SOAP_IO_DEFAULT); + soap_endpoint = soap_endpoint_url; +} + +SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy(soap_mode iomode) : soap(iomode) +{ SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy_init(iomode, iomode); +} + +SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy(const char *soap_endpoint_url, soap_mode iomode) : soap(iomode) +{ SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy_init(iomode, iomode); + soap_endpoint = soap_endpoint_url; +} + +SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy(soap_mode imode, soap_mode omode) : soap(imode, omode) +{ SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy_init(imode, omode); +} + +SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::~SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy() +{ + SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::destroy(); +} + +void SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy_init(soap_mode imode, soap_mode omode) +{ soap_imode(this, imode); + soap_omode(this, omode); + soap_endpoint = NULL; + static const struct Namespace namespaces[] = { + { "SOAP-ENV", "http://schemas.xmlsoap.org/soap/envelope/", "http://www.w3.org/*/soap-envelope", NULL }, + { "SOAP-ENC", "http://schemas.xmlsoap.org/soap/encoding/", "http://www.w3.org/*/soap-encoding", NULL }, + { "xsi", "http://www.w3.org/2001/XMLSchema-instance", "http://www.w3.org/*/XMLSchema-instance", NULL }, + { "xsd", "http://www.w3.org/2001/XMLSchema", "http://www.w3.org/*/XMLSchema", NULL }, + { "ns1", "urn:chintelectric.com:xi:plm", NULL, NULL }, + { NULL, NULL, NULL, NULL} /* end of namespaces[] */ + }; + soap_set_namespaces(this, namespaces); +} + +SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy *SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::copy() +{ SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy *dup = SOAP_NEW_UNMANAGED(SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy(*(struct soap*)this)); + return dup; +} + +SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy& SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::operator=(const SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy& rhs) +{ soap_done(this); + soap_copy_context(this, &rhs); + this->soap_endpoint = rhs.soap_endpoint; + return *this; +} + +void SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::destroy() +{ soap_destroy(this); + soap_end(this); +} + +void SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::reset() +{ this->destroy(); + soap_done(this); + soap_initialize(this); + SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy_init(SOAP_IO_DEFAULT, SOAP_IO_DEFAULT); +} + +void SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::soap_noheader() +{ this->header = NULL; +} + +::SOAP_ENV__Header *SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::soap_header() +{ return this->header; +} + +::SOAP_ENV__Fault *SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::soap_fault() +{ return this->fault; +} + +const char *SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::soap_fault_subcode() +{ return ::soap_fault_subcode(this); +} + +const char *SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::soap_fault_string() +{ return ::soap_fault_string(this); +} + +const char *SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::soap_fault_detail() +{ return ::soap_fault_detail(this); +} + +int SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::soap_close_socket() +{ return ::soap_closesock(this); +} + +int SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::soap_force_close_socket() +{ return ::soap_force_closesock(this); +} + +void SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::soap_print_fault(FILE *fd) +{ ::soap_print_fault(this, fd); +} + +#ifndef WITH_LEAN +#ifndef WITH_COMPAT +void SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::soap_stream_fault(std::ostream& os) +{ ::soap_stream_fault(this, os); +} +#endif + +char *SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::soap_sprint_fault(char *buf, size_t len) +{ return ::soap_sprint_fault(this, buf, len); +} +#endif + +int SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::send_SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN(const char *soap_endpoint_url, const char *soap_action, ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ *ns1__MT_USCOREPROCESSROUTE_USCORES4_USCOREREQ) +{ + struct soap *soap = this; + struct __ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN soap_tmp___ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN; + if (soap_endpoint_url != NULL) + soap_endpoint = soap_endpoint_url; + if (soap_endpoint == NULL) + soap_endpoint = "http://gfpoapp:50100/XISOAPAdapter/MessageServlet?senderParty=&senderService=BC_CHINT_ELECTRIC&receiverParty=&receiverService=&interface=SI_PROCESSROUTE_PLM_OUT_SYN&interfaceNamespace=urn%3Achintelectric.com%3Axi%3Aplm https://gfpoapp:50101/XISOAPAdapter/MessageServlet?senderParty=&senderService=BC_CHINT_ELECTRIC&receiverParty=&receiverService=&interface=SI_PROCESSROUTE_PLM_OUT_SYN&interfaceNamespace=urn%3Achintelectric.com%3Axi%3Aplm"; + if (soap_action == NULL) + soap_action = "http://sap.com/xi/WebService/soap1.1"; + soap_tmp___ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN.ns1__MT_USCOREPROCESSROUTE_USCORES4_USCOREREQ = ns1__MT_USCOREPROCESSROUTE_USCORES4_USCOREREQ; + soap_begin(soap); + soap->encodingStyle = NULL; /* use SOAP literal style */ + soap_serializeheader(soap); + soap_serialize___ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN(soap, &soap_tmp___ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN); + if (soap_begin_count(soap)) + return soap->error; + if ((soap->mode & SOAP_IO_LENGTH)) + { if (soap_envelope_begin_out(soap) + || soap_putheader(soap) + || soap_body_begin_out(soap) + || soap_put___ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN(soap, &soap_tmp___ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN, "-ns1:SI_PROCESSROUTE_PLM_OUT_SYN", "") + || soap_body_end_out(soap) + || soap_envelope_end_out(soap)) + return soap->error; + } + if (soap_end_count(soap)) + return soap->error; + if (soap_connect(soap, soap_endpoint, soap_action) + || soap_envelope_begin_out(soap) + || soap_putheader(soap) + || soap_body_begin_out(soap) + || soap_put___ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN(soap, &soap_tmp___ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN, "-ns1:SI_PROCESSROUTE_PLM_OUT_SYN", "") + || soap_body_end_out(soap) + || soap_envelope_end_out(soap) + || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +int SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::recv_SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN(ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP &ns1__MT_USCOREPROCESSROUTE_USCORES4_USCORERSP) +{ + struct soap *soap = this; + ns1__MT_USCOREPROCESSROUTE_USCORES4_USCORERSP.soap_default(soap); + if (soap_begin_recv(soap) + || soap_envelope_begin_in(soap) + || soap_recv_header(soap) + || soap_body_begin_in(soap)) + return soap_closesock(soap); + ns1__MT_USCOREPROCESSROUTE_USCORES4_USCORERSP.soap_get(soap, "ns1:MT_PROCESSROUTE_S4_RSP", NULL); + if (soap->error) + return soap_recv_fault(soap, 0); + if (soap_body_end_in(soap) + || soap_envelope_end_in(soap) + || soap_end_recv(soap)) + return soap_closesock(soap); + return soap_closesock(soap); +} +/* End of client proxy code */ diff --git a/DFL_BOM_WL_TOERP/bin/win64/soapSI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy.h b/DFL_BOM_WL_TOERP/bin/win64/soapSI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy.h new file mode 100644 index 0000000..9dfe1a1 --- /dev/null +++ b/DFL_BOM_WL_TOERP/bin/win64/soapSI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy.h @@ -0,0 +1,87 @@ +/* soapSI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy.h + Generated by gSOAP 2.8.131 for BOP.h + +gSOAP XML Web services tools +Copyright (C) 2000-2023, Robert van Engelen, Genivia Inc. All Rights Reserved. +The soapcpp2 tool and its generated software are released under the GPL. +This program is released under the GPL with the additional exemption that +compiling, linking, and/or using OpenSSL is allowed. +-------------------------------------------------------------------------------- +A commercial use license is available from Genivia Inc., contact@genivia.com +-------------------------------------------------------------------------------- +*/ + +#ifndef soapSI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy_H +#define soapSI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy_H +#include "soapH.h" + + class SOAP_CMAC SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy : public soap { + public: + /// Endpoint URL of service 'SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy' (change as needed) + const char *soap_endpoint; + /// Variables globally declared in BOP.h, if any + /// Construct a proxy with new managing context + SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy(); + /// Copy constructor + SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy(const SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy& rhs); + /// Construct proxy given a managing context + SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy(const struct soap&); + /// Construct proxy given a managing context and endpoint URL + SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy(const struct soap&, const char *soap_endpoint_url); + /// Constructor taking an endpoint URL + SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy(const char *soap_endpoint_url); + /// Constructor taking input and output mode flags for the new managing context + SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy(soap_mode iomode); + /// Constructor taking endpoint URL and input and output mode flags for the new managing context + SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy(const char *soap_endpoint_url, soap_mode iomode); + /// Constructor taking input and output mode flags for the new managing context + SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy(soap_mode imode, soap_mode omode); + /// Destructor deletes deserialized data and its managing context + virtual ~SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy(); + /// Initializer used by constructors + virtual void SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy_init(soap_mode imode, soap_mode omode); + /// Return a copy that has a new managing context with the same engine state + virtual SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy *copy(); + /// Copy assignment + SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy& operator=(const SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy&); + /// Delete all deserialized data (uses soap_destroy() and soap_end()) + virtual void destroy(); + /// Delete all deserialized data and reset to default + virtual void reset(); + /// Disables and removes SOAP Header from message by setting soap->header = NULL + virtual void soap_noheader(); + /// Get SOAP Header structure (i.e. soap->header, which is NULL when absent) + virtual ::SOAP_ENV__Header *soap_header(); + /// Get SOAP Fault structure (i.e. soap->fault, which is NULL when absent) + virtual ::SOAP_ENV__Fault *soap_fault(); + /// Get SOAP Fault subcode QName string (NULL when absent) + virtual const char *soap_fault_subcode(); + /// Get SOAP Fault string/reason (NULL when absent) + virtual const char *soap_fault_string(); + /// Get SOAP Fault detail XML string (NULL when absent) + virtual const char *soap_fault_detail(); + /// Close connection (normally automatic, except for send_X ops) + virtual int soap_close_socket(); + /// Force close connection (can kill a thread blocked on IO) + virtual int soap_force_close_socket(); + /// Print fault + virtual void soap_print_fault(FILE*); + #ifndef WITH_LEAN + #ifndef WITH_COMPAT + /// Print fault to stream + virtual void soap_stream_fault(std::ostream&); + #endif + /// Write fault to buffer + virtual char *soap_sprint_fault(char *buf, size_t len); + #endif + // + /// Web service synchronous operation 'SI_PROCESSROUTE_PLM_OUT_SYN' with default endpoint and default SOAP Action header, returns SOAP_OK or error code + virtual int SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN(ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ *ns1__MT_USCOREPROCESSROUTE_USCORES4_USCOREREQ, ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP &ns1__MT_USCOREPROCESSROUTE_USCORES4_USCORERSP) { return this->SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN(NULL, NULL, ns1__MT_USCOREPROCESSROUTE_USCORES4_USCOREREQ, ns1__MT_USCOREPROCESSROUTE_USCORES4_USCORERSP); } + /// Web service synchronous operation 'SI_PROCESSROUTE_PLM_OUT_SYN' to the specified endpoint and SOAP Action header, returns SOAP_OK or error code + virtual int SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN(const char *soap_endpoint_url, const char *soap_action, ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ *ns1__MT_USCOREPROCESSROUTE_USCORES4_USCOREREQ, ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP &ns1__MT_USCOREPROCESSROUTE_USCORES4_USCORERSP) { return this->send_SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN(soap_endpoint_url, soap_action, ns1__MT_USCOREPROCESSROUTE_USCORES4_USCOREREQ) || this->recv_SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN(ns1__MT_USCOREPROCESSROUTE_USCORES4_USCORERSP) ? this->error : SOAP_OK; } + /// Web service asynchronous operation 'send_SI_PROCESSROUTE_PLM_OUT_SYN' to send a request message to the specified endpoint and SOAP Action header, returns SOAP_OK or error code + virtual int send_SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN(const char *soap_endpoint_url, const char *soap_action, ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ *ns1__MT_USCOREPROCESSROUTE_USCORES4_USCOREREQ); + /// Web service asynchronous operation 'recv_SI_PROCESSROUTE_PLM_OUT_SYN' to receive a response message from the connected endpoint, returns SOAP_OK or error code + virtual int recv_SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN(ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP &ns1__MT_USCOREPROCESSROUTE_USCORES4_USCORERSP); + }; +#endif diff --git a/DFL_BOM_WL_TOERP/bin/win64/soapStub.h b/DFL_BOM_WL_TOERP/bin/win64/soapStub.h new file mode 100644 index 0000000..ac59a88 --- /dev/null +++ b/DFL_BOM_WL_TOERP/bin/win64/soapStub.h @@ -0,0 +1,621 @@ +/* soapStub.h + Generated by gSOAP 2.8.131 for factory.h + +gSOAP XML Web services tools +Copyright (C) 2000-2023, Robert van Engelen, Genivia Inc. All Rights Reserved. +The soapcpp2 tool and its generated software are released under the GPL. +This program is released under the GPL with the additional exemption that +compiling, linking, and/or using OpenSSL is allowed. +-------------------------------------------------------------------------------- +A commercial use license is available from Genivia Inc., contact@genivia.com +-------------------------------------------------------------------------------- +*/ + +#define SOAP_NAMESPACE_OF_ns1 "urn:chintelectric.com:xi:plm" + +#ifndef soapStub_H +#define soapStub_H +#include "stdsoap2.h" +#if GSOAP_VERSION != 208131 +# error "GSOAP VERSION 208131 MISMATCH IN GENERATED CODE VERSUS LIBRARY CODE: PLEASE REINSTALL PACKAGE" +#endif + + +/******************************************************************************\ + * * + * Types with Custom Serializers * + * * +\******************************************************************************/ + + +/******************************************************************************\ + * * + * Classes, Structs and Unions * + * * +\******************************************************************************/ + +class _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO; /* factory.h:202 */ +class _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN; /* factory.h:220 */ +class ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP; /* factory.h:152 */ +class _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO; /* factory.h:263 */ +class _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM; /* factory.h:294 */ +class _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS; /* factory.h:279 */ +class ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ; /* factory.h:154 */ +struct __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN; /* factory.h:497 */ + +/* factory.h:202 */ +#ifndef SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO +#define SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO (9) +/* complex XML schema type 'ns1:DT_FACTORY_NUMBER_RSP-RSP_BASEINFO': */ +class SOAP_CMAC _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO { + public: + /// Optional element 'REQ_TRACE_ID' of XML schema type 'xsd:string' + char *REQ_USCORETRACE_USCOREID; + public: + /// Return unique type id SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO + virtual long soap_type(void) const { return SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO; } + /// (Re)set members to default values + virtual void soap_default(struct soap*); + /// Serialize object to prepare for SOAP 1.1/1.2 encoded output (or with SOAP_XML_GRAPH) by analyzing its (cyclic) structures + virtual void soap_serialize(struct soap*) const; + /// Output object in XML, compliant with SOAP 1.1 encoding style, return error code or SOAP_OK + virtual int soap_put(struct soap*, const char *tag, const char *type) const; + /// Output object in XML, with tag and optional id attribute and xsi:type, return error code or SOAP_OK + virtual int soap_out(struct soap*, const char *tag, int id, const char *type) const; + /// Get object from XML, compliant with SOAP 1.1 encoding style, return pointer to object or NULL on error + virtual void *soap_get(struct soap*, const char *tag, const char *type); + /// Get object from XML, with matching tag and type (NULL matches any tag and type), return pointer to object or NULL on error + virtual void *soap_in(struct soap*, const char *tag, const char *type); + /// Return a new object of type _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO, default initialized and not managed by a soap context + virtual _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO *soap_alloc(void) const { return SOAP_NEW_UNMANAGED(_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO); } + public: + /// Constructor with default initializations + _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO() : REQ_USCORETRACE_USCOREID() { } + /// Destructor + virtual ~_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO() { } + /// Friend allocator used by soap_new__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(struct soap*, int) + friend SOAP_FMAC1 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO * SOAP_FMAC2 soap_instantiate__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(struct soap*, int, const char*, const char*, size_t*); +}; +#endif + +/* factory.h:220 */ +#ifndef SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN +#define SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN (11) +/* complex XML schema type 'ns1:DT_FACTORY_NUMBER_RSP-ZTABLE_RETURN': */ +class SOAP_CMAC _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN { + public: + /// Optional element 'SERNR' of XML schema type 'xsd:string' + char *SERNR; + /// Optional element 'TYPE' of XML schema type 'xsd:string' + char *TYPE; + /// Optional element 'MESSAGE' of XML schema type 'xsd:string' + char *MESSAGE; + public: + /// Return unique type id SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN + virtual long soap_type(void) const { return SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN; } + /// (Re)set members to default values + virtual void soap_default(struct soap*); + /// Serialize object to prepare for SOAP 1.1/1.2 encoded output (or with SOAP_XML_GRAPH) by analyzing its (cyclic) structures + virtual void soap_serialize(struct soap*) const; + /// Output object in XML, compliant with SOAP 1.1 encoding style, return error code or SOAP_OK + virtual int soap_put(struct soap*, const char *tag, const char *type) const; + /// Output object in XML, with tag and optional id attribute and xsi:type, return error code or SOAP_OK + virtual int soap_out(struct soap*, const char *tag, int id, const char *type) const; + /// Get object from XML, compliant with SOAP 1.1 encoding style, return pointer to object or NULL on error + virtual void *soap_get(struct soap*, const char *tag, const char *type); + /// Get object from XML, with matching tag and type (NULL matches any tag and type), return pointer to object or NULL on error + virtual void *soap_in(struct soap*, const char *tag, const char *type); + /// Return a new object of type _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN, default initialized and not managed by a soap context + virtual _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN *soap_alloc(void) const { return SOAP_NEW_UNMANAGED(_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN); } + public: + /// Constructor with default initializations + _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN() : SERNR(), TYPE(), MESSAGE() { } + /// Destructor + virtual ~_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN() { } + /// Friend allocator used by soap_new__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(struct soap*, int) + friend SOAP_FMAC1 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN * SOAP_FMAC2 soap_instantiate__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(struct soap*, int, const char*, const char*, size_t*); +}; +#endif + +/* factory.h:152 */ +#ifndef SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP +#define SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP (7) +/* complex XML schema type 'ns1:DT_FACTORY_NUMBER_RSP': */ +class SOAP_CMAC ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP { + public: + /// Optional element 'RSP_BASEINFO' of XML schema type 'ns1:DT_FACTORY_NUMBER_RSP-RSP_BASEINFO' + _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO *RSP_USCOREBASEINFO; + /// Sequence of elements 'ZTABLE_RETURN' of XML schema type 'ns1:DT_FACTORY_NUMBER_RSP-ZTABLE_RETURN' stored in dynamic array ZTABLE_USCORERETURN of length __sizeZTABLE_USCORERETURN + int __sizeZTABLE_USCORERETURN; + _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN *ZTABLE_USCORERETURN; + /// Context that manages this object + struct soap *soap; + public: + /// Return unique type id SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP + virtual long soap_type(void) const { return SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP; } + /// (Re)set members to default values + virtual void soap_default(struct soap*); + /// Serialize object to prepare for SOAP 1.1/1.2 encoded output (or with SOAP_XML_GRAPH) by analyzing its (cyclic) structures + virtual void soap_serialize(struct soap*) const; + /// Output object in XML, compliant with SOAP 1.1 encoding style, return error code or SOAP_OK + virtual int soap_put(struct soap*, const char *tag, const char *type) const; + /// Output object in XML, with tag and optional id attribute and xsi:type, return error code or SOAP_OK + virtual int soap_out(struct soap*, const char *tag, int id, const char *type) const; + /// Get object from XML, compliant with SOAP 1.1 encoding style, return pointer to object or NULL on error + virtual void *soap_get(struct soap*, const char *tag, const char *type); + /// Get object from XML, with matching tag and type (NULL matches any tag and type), return pointer to object or NULL on error + virtual void *soap_in(struct soap*, const char *tag, const char *type); + /// Return a new object of type ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP, default initialized and not managed by a soap context + virtual ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP *soap_alloc(void) const { return SOAP_NEW_UNMANAGED(ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP); } + public: + /// Constructor with default initializations + ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP() : RSP_USCOREBASEINFO(), __sizeZTABLE_USCORERETURN(), ZTABLE_USCORERETURN(), soap() { } + /// Destructor + virtual ~ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP() { } + /// Friend allocator used by soap_new_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP(struct soap*, int) + friend SOAP_FMAC1 ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP * SOAP_FMAC2 soap_instantiate_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP(struct soap*, int, const char*, const char*, size_t*); +}; +#endif + +/* factory.h:263 */ +#ifndef SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO +#define SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO (14) +/* complex XML schema type 'ns1:DT_FACTORY_NUMBER_REQ-BASEINFO': */ +class SOAP_CMAC _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO { + public: + /// Optional element 'REQ_TRACE_ID' of XML schema type 'xsd:string' + char *REQ_USCORETRACE_USCOREID; + public: + /// Return unique type id SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO + virtual long soap_type(void) const { return SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO; } + /// (Re)set members to default values + virtual void soap_default(struct soap*); + /// Serialize object to prepare for SOAP 1.1/1.2 encoded output (or with SOAP_XML_GRAPH) by analyzing its (cyclic) structures + virtual void soap_serialize(struct soap*) const; + /// Output object in XML, compliant with SOAP 1.1 encoding style, return error code or SOAP_OK + virtual int soap_put(struct soap*, const char *tag, const char *type) const; + /// Output object in XML, with tag and optional id attribute and xsi:type, return error code or SOAP_OK + virtual int soap_out(struct soap*, const char *tag, int id, const char *type) const; + /// Get object from XML, compliant with SOAP 1.1 encoding style, return pointer to object or NULL on error + virtual void *soap_get(struct soap*, const char *tag, const char *type); + /// Get object from XML, with matching tag and type (NULL matches any tag and type), return pointer to object or NULL on error + virtual void *soap_in(struct soap*, const char *tag, const char *type); + /// Return a new object of type _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO, default initialized and not managed by a soap context + virtual _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO *soap_alloc(void) const { return SOAP_NEW_UNMANAGED(_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO); } + public: + /// Constructor with default initializations + _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO() : REQ_USCORETRACE_USCOREID() { } + /// Destructor + virtual ~_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO() { } + /// Friend allocator used by soap_new__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(struct soap*, int) + friend SOAP_FMAC1 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO * SOAP_FMAC2 soap_instantiate__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(struct soap*, int, const char*, const char*, size_t*); +}; +#endif + +/* factory.h:294 */ +#ifndef SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM +#define SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM (17) +/* complex XML schema type 'ns1:DT_FACTORY_NUMBER_REQ-ITEMS-ITEM': */ +class SOAP_CMAC _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM { + public: + /// Optional element 'PSPID' of XML schema type 'xsd:string' + char *PSPID; + /// Optional element 'ZPSPID' of XML schema type 'xsd:string' + char *ZPSPID; + /// Optional element 'MATNR' of XML schema type 'xsd:string' + char *MATNR; + /// Optional element 'ZZD' of XML schema type 'xsd:string' + char *ZZD; + /// Optional element 'ZGH' of XML schema type 'xsd:string' + char *ZGH; + /// Optional element 'SERNR' of XML schema type 'xsd:string' + char *SERNR; + /// Optional element 'WERKS' of XML schema type 'xsd:string' + char *WERKS; + /// Optional element 'RSPOS' of XML schema type 'xsd:string' + char *RSPOS; + public: + /// Return unique type id SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM + virtual long soap_type(void) const { return SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM; } + /// (Re)set members to default values + virtual void soap_default(struct soap*); + /// Serialize object to prepare for SOAP 1.1/1.2 encoded output (or with SOAP_XML_GRAPH) by analyzing its (cyclic) structures + virtual void soap_serialize(struct soap*) const; + /// Output object in XML, compliant with SOAP 1.1 encoding style, return error code or SOAP_OK + virtual int soap_put(struct soap*, const char *tag, const char *type) const; + /// Output object in XML, with tag and optional id attribute and xsi:type, return error code or SOAP_OK + virtual int soap_out(struct soap*, const char *tag, int id, const char *type) const; + /// Get object from XML, compliant with SOAP 1.1 encoding style, return pointer to object or NULL on error + virtual void *soap_get(struct soap*, const char *tag, const char *type); + /// Get object from XML, with matching tag and type (NULL matches any tag and type), return pointer to object or NULL on error + virtual void *soap_in(struct soap*, const char *tag, const char *type); + /// Return a new object of type _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM, default initialized and not managed by a soap context + virtual _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM *soap_alloc(void) const { return SOAP_NEW_UNMANAGED(_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM); } + public: + /// Constructor with default initializations + _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM() : PSPID(), ZPSPID(), MATNR(), ZZD(), ZGH(), SERNR(), WERKS(), RSPOS() { } + /// Destructor + virtual ~_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM() { } + /// Friend allocator used by soap_new__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(struct soap*, int) + friend SOAP_FMAC1 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM * SOAP_FMAC2 soap_instantiate__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(struct soap*, int, const char*, const char*, size_t*); +}; +#endif + +/* factory.h:279 */ +#ifndef SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS +#define SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS (16) +/* complex XML schema type 'ns1:DT_FACTORY_NUMBER_REQ-ITEMS': */ +class SOAP_CMAC _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS { + public: + /// Sequence of elements 'ITEM' of XML schema type 'ns1:DT_FACTORY_NUMBER_REQ-ITEMS-ITEM' stored in dynamic array ITEM of length __sizeITEM + int __sizeITEM; + _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM *ITEM; + public: + /// Return unique type id SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS + virtual long soap_type(void) const { return SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS; } + /// (Re)set members to default values + virtual void soap_default(struct soap*); + /// Serialize object to prepare for SOAP 1.1/1.2 encoded output (or with SOAP_XML_GRAPH) by analyzing its (cyclic) structures + virtual void soap_serialize(struct soap*) const; + /// Output object in XML, compliant with SOAP 1.1 encoding style, return error code or SOAP_OK + virtual int soap_put(struct soap*, const char *tag, const char *type) const; + /// Output object in XML, with tag and optional id attribute and xsi:type, return error code or SOAP_OK + virtual int soap_out(struct soap*, const char *tag, int id, const char *type) const; + /// Get object from XML, compliant with SOAP 1.1 encoding style, return pointer to object or NULL on error + virtual void *soap_get(struct soap*, const char *tag, const char *type); + /// Get object from XML, with matching tag and type (NULL matches any tag and type), return pointer to object or NULL on error + virtual void *soap_in(struct soap*, const char *tag, const char *type); + /// Return a new object of type _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS, default initialized and not managed by a soap context + virtual _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS *soap_alloc(void) const { return SOAP_NEW_UNMANAGED(_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS); } + public: + /// Constructor with default initializations + _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS() : __sizeITEM(), ITEM() { } + /// Destructor + virtual ~_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS() { } + /// Friend allocator used by soap_new__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(struct soap*, int) + friend SOAP_FMAC1 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS * SOAP_FMAC2 soap_instantiate__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(struct soap*, int, const char*, const char*, size_t*); +}; +#endif + +/* factory.h:154 */ +#ifndef SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ +#define SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ (8) +/* complex XML schema type 'ns1:DT_FACTORY_NUMBER_REQ': */ +class SOAP_CMAC ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ { + public: + /// Optional element 'BASEINFO' of XML schema type 'ns1:DT_FACTORY_NUMBER_REQ-BASEINFO' + _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO *BASEINFO; + /// Optional element 'ITEMS' of XML schema type 'ns1:DT_FACTORY_NUMBER_REQ-ITEMS' + _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS *ITEMS; + /// Context that manages this object + struct soap *soap; + public: + /// Return unique type id SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ + virtual long soap_type(void) const { return SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ; } + /// (Re)set members to default values + virtual void soap_default(struct soap*); + /// Serialize object to prepare for SOAP 1.1/1.2 encoded output (or with SOAP_XML_GRAPH) by analyzing its (cyclic) structures + virtual void soap_serialize(struct soap*) const; + /// Output object in XML, compliant with SOAP 1.1 encoding style, return error code or SOAP_OK + virtual int soap_put(struct soap*, const char *tag, const char *type) const; + /// Output object in XML, with tag and optional id attribute and xsi:type, return error code or SOAP_OK + virtual int soap_out(struct soap*, const char *tag, int id, const char *type) const; + /// Get object from XML, compliant with SOAP 1.1 encoding style, return pointer to object or NULL on error + virtual void *soap_get(struct soap*, const char *tag, const char *type); + /// Get object from XML, with matching tag and type (NULL matches any tag and type), return pointer to object or NULL on error + virtual void *soap_in(struct soap*, const char *tag, const char *type); + /// Return a new object of type ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ, default initialized and not managed by a soap context + virtual ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ *soap_alloc(void) const { return SOAP_NEW_UNMANAGED(ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ); } + public: + /// Constructor with default initializations + ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ() : BASEINFO(), ITEMS(), soap() { } + /// Destructor + virtual ~ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ() { } + /// Friend allocator used by soap_new_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(struct soap*, int) + friend SOAP_FMAC1 ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ * SOAP_FMAC2 soap_instantiate_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(struct soap*, int, const char*, const char*, size_t*); +}; +#endif + +/* factory.h:497 */ +#ifndef SOAP_TYPE___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN +#define SOAP_TYPE___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN (23) +/* Wrapper: */ +struct SOAP_CMAC __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN { + public: + /** Optional element 'ns1:MT_FACTORY_NUMBER_REQ' of XML schema type 'ns1:DT_FACTORY_NUMBER_REQ' */ + ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ *ns1__MT_USCOREFACTORY_USCORENUMBER_USCOREREQ; + public: + /** Return unique type id SOAP_TYPE___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN */ + long soap_type() const { return SOAP_TYPE___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN; } + /** Constructor with member initializations */ + __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN() : ns1__MT_USCOREFACTORY_USCORENUMBER_USCOREREQ() { } + /** Friend allocator */ + friend SOAP_FMAC1 __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN * SOAP_FMAC2 soap_instantiate___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(struct soap*, int, const char*, const char*, size_t*); +}; +#endif + +/* factory.h:562 */ +#ifndef WITH_NOGLOBAL +#ifndef SOAP_TYPE_SOAP_ENV__Header +#define SOAP_TYPE_SOAP_ENV__Header (24) +/* SOAP_ENV__Header: */ +struct SOAP_CMAC SOAP_ENV__Header { + public: + /** Return unique type id SOAP_TYPE_SOAP_ENV__Header */ + long soap_type() const { return SOAP_TYPE_SOAP_ENV__Header; } + /** Constructor with member initializations */ + SOAP_ENV__Header() { } + /** Friend allocator */ + friend SOAP_FMAC1 SOAP_ENV__Header * SOAP_FMAC2 soap_instantiate_SOAP_ENV__Header(struct soap*, int, const char*, const char*, size_t*); +}; +#endif +#endif + +/* factory.h:562 */ +#ifndef WITH_NOGLOBAL +#ifndef SOAP_TYPE_SOAP_ENV__Code +#define SOAP_TYPE_SOAP_ENV__Code (25) +/* Type SOAP_ENV__Code is a recursive data type, (in)directly referencing itself through its (base or derived class) members */ +/* SOAP_ENV__Code: */ +struct SOAP_CMAC SOAP_ENV__Code { + public: + /** Optional element 'SOAP-ENV:Value' of XML schema type 'xsd:QName' */ + char *SOAP_ENV__Value; + /** Optional element 'SOAP-ENV:Subcode' of XML schema type 'SOAP-ENV:Code' */ + struct SOAP_ENV__Code *SOAP_ENV__Subcode; + public: + /** Return unique type id SOAP_TYPE_SOAP_ENV__Code */ + long soap_type() const { return SOAP_TYPE_SOAP_ENV__Code; } + /** Constructor with member initializations */ + SOAP_ENV__Code() : SOAP_ENV__Value(), SOAP_ENV__Subcode() { } + /** Friend allocator */ + friend SOAP_FMAC1 SOAP_ENV__Code * SOAP_FMAC2 soap_instantiate_SOAP_ENV__Code(struct soap*, int, const char*, const char*, size_t*); +}; +#endif +#endif + +/* factory.h:562 */ +#ifndef WITH_NOGLOBAL +#ifndef SOAP_TYPE_SOAP_ENV__Detail +#define SOAP_TYPE_SOAP_ENV__Detail (27) +/* SOAP_ENV__Detail: */ +struct SOAP_CMAC SOAP_ENV__Detail { + public: + char *__any; + /** Any type of element 'fault' assigned to fault with its SOAP_TYPE_ assigned to __type */ + /** Do not create a cyclic data structure through this member unless SOAP encoding or SOAP_XML_GRAPH are used for id-ref serialization */ + int __type; + void *fault; + public: + /** Return unique type id SOAP_TYPE_SOAP_ENV__Detail */ + long soap_type() const { return SOAP_TYPE_SOAP_ENV__Detail; } + /** Constructor with member initializations */ + SOAP_ENV__Detail() : __any(), __type(), fault() { } + /** Friend allocator */ + friend SOAP_FMAC1 SOAP_ENV__Detail * SOAP_FMAC2 soap_instantiate_SOAP_ENV__Detail(struct soap*, int, const char*, const char*, size_t*); +}; +#endif +#endif + +/* factory.h:562 */ +#ifndef WITH_NOGLOBAL +#ifndef SOAP_TYPE_SOAP_ENV__Reason +#define SOAP_TYPE_SOAP_ENV__Reason (30) +/* SOAP_ENV__Reason: */ +struct SOAP_CMAC SOAP_ENV__Reason { + public: + /** Optional element 'SOAP-ENV:Text' of XML schema type 'xsd:string' */ + char *SOAP_ENV__Text; + public: + /** Return unique type id SOAP_TYPE_SOAP_ENV__Reason */ + long soap_type() const { return SOAP_TYPE_SOAP_ENV__Reason; } + /** Constructor with member initializations */ + SOAP_ENV__Reason() : SOAP_ENV__Text() { } + /** Friend allocator */ + friend SOAP_FMAC1 SOAP_ENV__Reason * SOAP_FMAC2 soap_instantiate_SOAP_ENV__Reason(struct soap*, int, const char*, const char*, size_t*); +}; +#endif +#endif + +/* factory.h:562 */ +#ifndef WITH_NOGLOBAL +#ifndef SOAP_TYPE_SOAP_ENV__Fault +#define SOAP_TYPE_SOAP_ENV__Fault (31) +/* SOAP_ENV__Fault: */ +struct SOAP_CMAC SOAP_ENV__Fault { + public: + /** Optional element 'faultcode' of XML schema type 'xsd:QName' */ + char *faultcode; + /** Optional element 'faultstring' of XML schema type 'xsd:string' */ + char *faultstring; + /** Optional element 'faultactor' of XML schema type 'xsd:string' */ + char *faultactor; + /** Optional element 'detail' of XML schema type 'SOAP-ENV:Detail' */ + struct SOAP_ENV__Detail *detail; + /** Optional element 'SOAP-ENV:Code' of XML schema type 'SOAP-ENV:Code' */ + struct SOAP_ENV__Code *SOAP_ENV__Code; + /** Optional element 'SOAP-ENV:Reason' of XML schema type 'SOAP-ENV:Reason' */ + struct SOAP_ENV__Reason *SOAP_ENV__Reason; + /** Optional element 'SOAP-ENV:Node' of XML schema type 'xsd:string' */ + char *SOAP_ENV__Node; + /** Optional element 'SOAP-ENV:Role' of XML schema type 'xsd:string' */ + char *SOAP_ENV__Role; + /** Optional element 'SOAP-ENV:Detail' of XML schema type 'SOAP-ENV:Detail' */ + struct SOAP_ENV__Detail *SOAP_ENV__Detail; + public: + /** Return unique type id SOAP_TYPE_SOAP_ENV__Fault */ + long soap_type() const { return SOAP_TYPE_SOAP_ENV__Fault; } + /** Constructor with member initializations */ + SOAP_ENV__Fault() : faultcode(), faultstring(), faultactor(), detail(), SOAP_ENV__Code(), SOAP_ENV__Reason(), SOAP_ENV__Node(), SOAP_ENV__Role(), SOAP_ENV__Detail() { } + /** Friend allocator */ + friend SOAP_FMAC1 SOAP_ENV__Fault * SOAP_FMAC2 soap_instantiate_SOAP_ENV__Fault(struct soap*, int, const char*, const char*, size_t*); +}; +#endif +#endif + +/******************************************************************************\ + * * + * Typedefs * + * * +\******************************************************************************/ + + +/* (built-in):0 */ +#ifndef SOAP_TYPE__XML +#define SOAP_TYPE__XML (5) +typedef char *_XML; +#endif + +/* (built-in):0 */ +#ifndef SOAP_TYPE__QName +#define SOAP_TYPE__QName (6) +typedef char *_QName; +#endif + +/******************************************************************************\ + * * + * Serializable Types * + * * +\******************************************************************************/ + + +/* char has binding name 'byte' for type 'xsd:byte' */ +#ifndef SOAP_TYPE_byte +#define SOAP_TYPE_byte (3) +#endif + +/* int has binding name 'int' for type 'xsd:int' */ +#ifndef SOAP_TYPE_int +#define SOAP_TYPE_int (1) +#endif + +/* _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM has binding name '_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM' for type '' */ +#ifndef SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM +#define SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM (17) +#endif + +/* _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS has binding name '_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS' for type '' */ +#ifndef SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS +#define SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS (16) +#endif + +/* _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO has binding name '_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO' for type '' */ +#ifndef SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO +#define SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO (14) +#endif + +/* _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN has binding name '_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN' for type '' */ +#ifndef SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN +#define SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN (11) +#endif + +/* _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO has binding name '_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO' for type '' */ +#ifndef SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO +#define SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO (9) +#endif + +/* ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ has binding name 'ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ' for type 'ns1:DT_FACTORY_NUMBER_REQ' */ +#ifndef SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ +#define SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ (8) +#endif + +/* ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP has binding name 'ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP' for type 'ns1:DT_FACTORY_NUMBER_RSP' */ +#ifndef SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP +#define SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP (7) +#endif + +/* struct SOAP_ENV__Fault has binding name 'SOAP_ENV__Fault' for type '' */ +#ifndef SOAP_TYPE_SOAP_ENV__Fault +#define SOAP_TYPE_SOAP_ENV__Fault (31) +#endif + +/* struct SOAP_ENV__Reason has binding name 'SOAP_ENV__Reason' for type '' */ +#ifndef SOAP_TYPE_SOAP_ENV__Reason +#define SOAP_TYPE_SOAP_ENV__Reason (30) +#endif + +/* struct SOAP_ENV__Detail has binding name 'SOAP_ENV__Detail' for type '' */ +#ifndef SOAP_TYPE_SOAP_ENV__Detail +#define SOAP_TYPE_SOAP_ENV__Detail (27) +#endif + +/* struct SOAP_ENV__Code has binding name 'SOAP_ENV__Code' for type '' */ +#ifndef SOAP_TYPE_SOAP_ENV__Code +#define SOAP_TYPE_SOAP_ENV__Code (25) +#endif + +/* struct SOAP_ENV__Header has binding name 'SOAP_ENV__Header' for type '' */ +#ifndef SOAP_TYPE_SOAP_ENV__Header +#define SOAP_TYPE_SOAP_ENV__Header (24) +#endif + +/* struct SOAP_ENV__Reason * has binding name 'PointerToSOAP_ENV__Reason' for type '' */ +#ifndef SOAP_TYPE_PointerToSOAP_ENV__Reason +#define SOAP_TYPE_PointerToSOAP_ENV__Reason (33) +#endif + +/* struct SOAP_ENV__Detail * has binding name 'PointerToSOAP_ENV__Detail' for type '' */ +#ifndef SOAP_TYPE_PointerToSOAP_ENV__Detail +#define SOAP_TYPE_PointerToSOAP_ENV__Detail (32) +#endif + +/* struct SOAP_ENV__Code * has binding name 'PointerToSOAP_ENV__Code' for type '' */ +#ifndef SOAP_TYPE_PointerToSOAP_ENV__Code +#define SOAP_TYPE_PointerToSOAP_ENV__Code (26) +#endif + +/* ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ * has binding name 'PointerTons1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ' for type 'ns1:DT_FACTORY_NUMBER_REQ' */ +#ifndef SOAP_TYPE_PointerTons1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ +#define SOAP_TYPE_PointerTons1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ (20) +#endif + +/* _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS * has binding name 'PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS' for type '' */ +#ifndef SOAP_TYPE_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS +#define SOAP_TYPE_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS (19) +#endif + +/* _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM * has binding name 'PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM' for type '' */ +#ifndef SOAP_TYPE_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM +#define SOAP_TYPE_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM (18) +#endif + +/* _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO * has binding name 'PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO' for type '' */ +#ifndef SOAP_TYPE_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO +#define SOAP_TYPE_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO (15) +#endif + +/* _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN * has binding name 'PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN' for type '' */ +#ifndef SOAP_TYPE_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN +#define SOAP_TYPE_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN (12) +#endif + +/* _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO * has binding name 'PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO' for type '' */ +#ifndef SOAP_TYPE_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO +#define SOAP_TYPE_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO (10) +#endif + +/* _QName has binding name '_QName' for type 'xsd:QName' */ +#ifndef SOAP_TYPE__QName +#define SOAP_TYPE__QName (6) +#endif + +/* _XML has binding name '_XML' for type '' */ +#ifndef SOAP_TYPE__XML +#define SOAP_TYPE__XML (5) +#endif + +/* char * has binding name 'string' for type 'xsd:string' */ +#ifndef SOAP_TYPE_string +#define SOAP_TYPE_string (4) +#endif + +/******************************************************************************\ + * * + * Externals * + * * +\******************************************************************************/ + + +#endif + +/* End of soapStub.h */ diff --git a/DFL_BOM_WL_TOERP/bin/win64/soapcpp2.exe b/DFL_BOM_WL_TOERP/bin/win64/soapcpp2.exe new file mode 100644 index 0000000..c2a84c0 Binary files /dev/null and b/DFL_BOM_WL_TOERP/bin/win64/soapcpp2.exe differ diff --git a/DFL_BOM_WL_TOERP/bin/win64/total2.h b/DFL_BOM_WL_TOERP/bin/win64/total2.h new file mode 100644 index 0000000..0deb453 --- /dev/null +++ b/DFL_BOM_WL_TOERP/bin/win64/total2.h @@ -0,0 +1,1865 @@ +/* bomtest.h + Generated by wsdl2h 2.8.131 from bomtest.wsdl and wsmap.dat + 2023-11-28 03:25:46 GMT + + DO NOT INCLUDE THIS ANNOTATED FILE DIRECTLY IN YOUR PROJECT SOURCE CODE. + USE THE FILES GENERATED BY soapcpp2 FOR YOUR PROJECT'S SOURCE CODE. + +gSOAP XML Web services tools +Copyright (C) 2000-2023, Robert van Engelen, Genivia Inc. All Rights Reserved. +This program is released under the GPL with the additional exemption that +compiling, linking, and/or using OpenSSL is allowed. +-------------------------------------------------------------------------------- +A commercial use license is available from Genivia Inc., contact@genivia.com +-------------------------------------------------------------------------------- +*/ + +/** + +@page page_notes Notes + +@note HINTS: + - Run soapcpp2 on bomtest.h to generate the SOAP/XML processing logic: + Use soapcpp2 -I to specify paths for #import + Use soapcpp2 -j to generate improved proxy and server classes. + Use soapcpp2 -r to generate a report. + - Edit 'typemap.dat' to control namespace bindings and type mappings: + It is strongly recommended to customize the names of the namespace prefixes + generated by wsdl2h. To do so, modify the prefix bindings in the Namespaces + section below and add the modified lines to 'typemap.dat' to rerun wsdl2h. + - Run Doxygen (www.doxygen.org) on this file to generate documentation. + - Use wsdl2h -c to generate pure C code. + - Use wsdl2h -R to include the REST operations defined by the WSDLs. + - Use wsdl2h -O3 or -O4 to optimize by removing unused schema components. + - Use wsdl2h -d to enable DOM support for xsd:any and xsd:anyType. + - Use wsdl2h -F to simulate struct-type derivation in C (also works in C++). + - Use wsdl2h -f to generate flat C++ class hierarchy, removes type derivation. + - Use wsdl2h -g to generate top-level root elements with readers and writers. + - Use wsdl2h -U to map XML names to C++ Unicode identifiers instead of _xNNNN. + - Use wsdl2h -u to disable the generation of unions. + - Use wsdl2h -L to remove this @note and all other @note comments. + - Use wsdl2h -nname to use name as the base namespace prefix instead of 'ns'. + - Use wsdl2h -Nname for service prefix and produce multiple service bindings + - Struct/class members serialized as XML attributes are annotated with a '@'. + - Struct/class members that have a special role are annotated with a '$'. + +@warning + DO NOT INCLUDE THIS ANNOTATED FILE DIRECTLY IN YOUR PROJECT SOURCE CODE. + USE THE FILES GENERATED BY soapcpp2 FOR YOUR PROJECT'S SOURCE CODE: + THE GENERATED soapStub.h FILE CONTAINS THIS CONTENT WITHOUT ANNOTATIONS. + +@copyright LICENSE: +@verbatim +-------------------------------------------------------------------------------- +gSOAP XML Web services tools +Copyright (C) 2000-2023, Robert van Engelen, Genivia Inc. All Rights Reserved. +The wsdl2h tool and its generated software are released under the GPL. +This software is released under the GPL with the additional exemption that +compiling, linking, and/or using OpenSSL is allowed. +-------------------------------------------------------------------------------- +GPL license. + +This program is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free Software +Foundation; either version 2 of the License, or (at your option) any later +version. + +This program is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A +PARTICULAR PURPOSE. See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along with +this program; if not, write to the Free Software Foundation, Inc., 59 Temple +Place, Suite 330, Boston, MA 02111-1307 USA + +Author contact information: +engelen@genivia.com / engelen@acm.org + +This program is released under the GPL with the additional exemption that +compiling, linking, and/or using OpenSSL is allowed. +-------------------------------------------------------------------------------- +A commercial-use license is available from Genivia, Inc., contact@genivia.com +-------------------------------------------------------------------------------- +@endverbatim + +*/ + + +//gsoapopt c++,w + +/******************************************************************************\ + * * + * Definitions * + * urn:chintelectric.com:xi:plm * + * * +\******************************************************************************/ + +/* WSDL Documentation: + +*/ + + +/******************************************************************************\ + * * + * $SIZE typemap variable: * + * int * + * * +\******************************************************************************/ + + +/******************************************************************************\ + * * + * Import * + * * +\******************************************************************************/ + + +/******************************************************************************\ + * * + * Schema Namespaces * + * * +\******************************************************************************/ + + +/* NOTE: + +It is strongly recommended to customize the names of the namespace prefixes +generated by wsdl2h. To do so, modify the prefix bindings below and add the +modified lines to 'typemap.dat' then rerun wsdl2h (use wsdl2h -t typemap.dat): + +ns1 = "urn:chintelectric.com:xi:plm" + +*/ + +#define SOAP_NAMESPACE_OF_ns1 "urn:chintelectric.com:xi:plm" +//gsoap ns1 schema namespace: urn:chintelectric.com:xi:plm +//gsoap ns1 schema form: unqualified + +/******************************************************************************\ + * * + * Built-in Schema Types and Top-Level Elements and Attributes * + * * +\******************************************************************************/ + + +/******************************************************************************\ + * * + * Forward Declarations * + * * +\******************************************************************************/ + + +class ns1__DT_USCOREBOM_USCORES4_USCOREREQ; + + +/******************************************************************************\ + * * + * Schema Types and Top-Level Elements and Attributes * + * urn:chintelectric.com:xi:plm * + * * +\******************************************************************************/ + + +/******************************************************************************\ + * * + * Schema Complex Types and Top-Level Elements * + * urn:chintelectric.com:xi:plm * + * * +\******************************************************************************/ + +/// @brief "urn:chintelectric.com:xi:plm":DT_BOM_S4_REQ is a complexType. +/// +///
+/// PPI001-BOMPLM->SAP +///
+/// +/// @note class ns1__DT_USCOREBOM_USCORES4_USCOREREQ operations: +/// - ns1__DT_USCOREBOM_USCORES4_USCOREREQ* soap_new_ns1__DT_USCOREBOM_USCORES4_USCOREREQ(soap*) allocate and default initialize +/// - ns1__DT_USCOREBOM_USCORES4_USCOREREQ* soap_new_ns1__DT_USCOREBOM_USCORES4_USCOREREQ(soap*, int num) allocate and default initialize an array +/// - ns1__DT_USCOREBOM_USCORES4_USCOREREQ* soap_new_req_ns1__DT_USCOREBOM_USCORES4_USCOREREQ(soap*, ...) allocate, set required members +/// - ns1__DT_USCOREBOM_USCORES4_USCOREREQ* soap_new_set_ns1__DT_USCOREBOM_USCORES4_USCOREREQ(soap*, ...) allocate, set all public members +/// - ns1__DT_USCOREBOM_USCORES4_USCOREREQ::soap_default(soap*) default initialize members +/// - int soap_read_ns1__DT_USCOREBOM_USCORES4_USCOREREQ(soap*, ns1__DT_USCOREBOM_USCORES4_USCOREREQ*) deserialize from a stream +/// - int soap_write_ns1__DT_USCOREBOM_USCORES4_USCOREREQ(soap*, ns1__DT_USCOREBOM_USCORES4_USCOREREQ*) serialize to a stream +/// - ns1__DT_USCOREBOM_USCORES4_USCOREREQ* ns1__DT_USCOREBOM_USCORES4_USCOREREQ::soap_dup(soap*) returns deep copy of ns1__DT_USCOREBOM_USCORES4_USCOREREQ, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) +/// - ns1__DT_USCOREBOM_USCORES4_USCOREREQ::soap_del() deep deletes ns1__DT_USCOREBOM_USCORES4_USCOREREQ data members, use only after ns1__DT_USCOREBOM_USCORES4_USCOREREQ::soap_dup(NULL) (use soapcpp2 -Ed) +/// - int ns1__DT_USCOREBOM_USCORES4_USCOREREQ::soap_type() returns SOAP_TYPE_ns1__DT_USCOREBOM_USCORES4_USCOREREQ or derived type identifier +class ns1__DT_USCOREBOM_USCORES4_USCOREREQ +{ public: +/// @note class _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO operations: +/// - _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO* soap_new__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO(soap*) allocate and default initialize +/// - _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO* soap_new__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO(soap*, int num) allocate and default initialize an array +/// - _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO* soap_new_req__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO(soap*, ...) allocate, set required members +/// - _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO* soap_new_set__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO(soap*, ...) allocate, set all public members +/// - _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO::soap_default(soap*) default initialize members +/// - int soap_read__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO(soap*, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO*) deserialize from a stream +/// - int soap_write__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO(soap*, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO*) serialize to a stream +/// - _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO* _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO::soap_dup(soap*) returns deep copy of _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) +/// - _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO::soap_del() deep deletes _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO data members, use only after _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO::soap_dup(NULL) (use soapcpp2 -Ed) +/// - int _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO::soap_type() returns SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO or derived type identifier + class _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO + { public: +/// Element "REQ_TRACE_ID" of type xs:string. + char* REQ_USCORETRACE_USCOREID 0; ///< Optional element. + } *BASEINFO 0; ///< Optional element. +/// Size of LIST array is 0..unbounded. + $ int __sizeLIST 0; +/// @note class _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST operations: +/// - _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST* soap_new__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST(soap*) allocate and default initialize +/// - _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST* soap_new__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST(soap*, int num) allocate and default initialize an array +/// - _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST* soap_new_req__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST(soap*, ...) allocate, set required members +/// - _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST* soap_new_set__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST(soap*, ...) allocate, set all public members +/// - _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST::soap_default(soap*) default initialize members +/// - int soap_read__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST(soap*, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST*) deserialize from a stream +/// - int soap_write__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST(soap*, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST*) serialize to a stream +/// - _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST* _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST::soap_dup(soap*) returns deep copy of _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) +/// - _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST::soap_del() deep deletes _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST data members, use only after _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST::soap_dup(NULL) (use soapcpp2 -Ed) +/// - int _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST::soap_type() returns SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST or derived type identifier + class _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST + { public: +/// @note class _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD operations: +/// - _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD* soap_new__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD(soap*) allocate and default initialize +/// - _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD* soap_new__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD(soap*, int num) allocate and default initialize an array +/// - _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD* soap_new_req__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD(soap*, ...) allocate, set required members +/// - _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD* soap_new_set__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD(soap*, ...) allocate, set all public members +/// - _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD::soap_default(soap*) default initialize members +/// - int soap_read__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD(soap*, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD*) deserialize from a stream +/// - int soap_write__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD(soap*, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD*) serialize to a stream +/// - _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD* _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD::soap_dup(soap*) returns deep copy of _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) +/// - _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD::soap_del() deep deletes _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD data members, use only after _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD::soap_dup(NULL) (use soapcpp2 -Ed) +/// - int _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD::soap_type() returns SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD or derived type identifier + class _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD + { public: +///
+/// WBS +///
+/// +/// Element "PSPNR" of type xs:string. + char* PSPNR 0; ///< Optional element. + +/// +/// +/// Element "MATNR" of type xs:string. + char* MATNR 1; ///< Required element. + +/// +/// +/// Element "WERKS" of type xs:string. + char* WERKS 1; ///< Required element. +///
+/// BOM +///
+/// +/// Element "DATUV" of type xs:string. + char* DATUV 0; ///< Optional element. +///
+/// BOM +///
+/// +/// Element "STLAN" of type xs:string. + char* STLAN 0; ///< Optional element. +///
+/// BOM +///
+/// +/// Element "STLAL" of type xs:string. + char* STLAL 0; ///< Optional element. + +/// +/// +/// Element "BMENG" of type xs:string. + char* BMENG 1; ///< Required element. + +/// +/// +/// Element "BMEIN" of type xs:string. + char* BMEIN 0; ///< Optional element. + +/// +/// +/// Element "STKTX" of type xs:string. + char* STKTX 0; ///< Optional element. + } HEAD 1; ///< Required element. +/// @note class _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS operations: +/// - _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS* soap_new__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS(soap*) allocate and default initialize +/// - _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS* soap_new__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS(soap*, int num) allocate and default initialize an array +/// - _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS* soap_new_req__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS(soap*, ...) allocate, set required members +/// - _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS* soap_new_set__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS(soap*, ...) allocate, set all public members +/// - _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS::soap_default(soap*) default initialize members +/// - int soap_read__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS(soap*, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS*) deserialize from a stream +/// - int soap_write__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS(soap*, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS*) serialize to a stream +/// - _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS* _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS::soap_dup(soap*) returns deep copy of _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) +/// - _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS::soap_del() deep deletes _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS data members, use only after _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS::soap_dup(NULL) (use soapcpp2 -Ed) +/// - int _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS::soap_type() returns SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS or derived type identifier + class _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS + { public: +/// Size of ITEM array is 0..unbounded. + $ int __sizeITEM 0; +/// @note class _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM operations: +/// - _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM* soap_new__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(soap*) allocate and default initialize +/// - _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM* soap_new__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(soap*, int num) allocate and default initialize an array +/// - _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM* soap_new_req__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(soap*, ...) allocate, set required members +/// - _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM* soap_new_set__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(soap*, ...) allocate, set all public members +/// - _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::soap_default(soap*) default initialize members +/// - int soap_read__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(soap*, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM*) deserialize from a stream +/// - int soap_write__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(soap*, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM*) serialize to a stream +/// - _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM* _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::soap_dup(soap*) returns deep copy of _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) +/// - _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::soap_del() deep deletes _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM data members, use only after _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::soap_dup(NULL) (use soapcpp2 -Ed) +/// - int _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::soap_type() returns SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM or derived type identifier + class _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM + { public: +///
+/// BOM +///
+/// +/// Element "DATUV" of type xs:string. + char* DATUV 0; ///< Optional element. + +/// +/// +/// Element "POSTP" of type xs:string. + char* POSTP 1; ///< Required element. + +/// +/// +/// Element "POSNR" of type xs:string. + char* POSNR 1; ///< Required element. +///
+/// BOM +///
+/// +/// Element "IDNRK" of type xs:string. + char* IDNRK 1; ///< Required element. + +/// +/// +/// Element "MENGE" of type xs:string. + char* MENGE 1; ///< Required element. + +/// +/// +/// Element "MEINS" of type xs:string. + char* MEINS 0; ///< Optional element. + +/// +/// +/// Element "SORTF" of type xs:string. + char* SORTF 0; ///< Optional element. +///
+/// 1 +///
+/// +/// Element "POTX1" of type xs:string. + char* POTX1 0; ///< Optional element. + } *ITEM 0; ///< Multiple elements. + } ITEMS 1; ///< Required element. + } *LIST 0; ///< Multiple elements. +/// Pointer to soap context that manages this instance. + struct soap *soap ; +}; + + +/******************************************************************************\ + * * + * Additional Top-Level Elements * + * urn:chintelectric.com:xi:plm * + * * +\******************************************************************************/ + +/// @brief Top-level root element "urn:chintelectric.com:xi:plm":MT_BOM_S4_REQ of type "urn:chintelectric.com:xi:plm":DT_BOM_S4_REQ. +/// @note Use wsdl2h option -g to auto-generate a top-level root element declaration. + + +/******************************************************************************\ + * * + * Additional Top-Level Attributes * + * urn:chintelectric.com:xi:plm * + * * +\******************************************************************************/ + + +/******************************************************************************\ + * * + * Services * + * * +\******************************************************************************/ + + +//gsoap ns1 service name: SIO_USCOREBOM_USCOREPLM_USCOREASYNBinding +//gsoap ns1 service type: SIO_USCOREBOM_USCOREPLM_USCOREASYN +//gsoap ns1 service port: http://gfpot01:50100/XISOAPAdapter/MessageServlet?senderParty=&senderService=BC_CHINT_ELECTRIC&receiverParty=&receiverService=&interface=SIO_BOM_PLM_ASYN&interfaceNamespace=urn%3Achintelectric.com%3Axi%3Aplm +//gsoap ns1 service port: https://gfpot01:50101/XISOAPAdapter/MessageServlet?senderParty=&senderService=BC_CHINT_ELECTRIC&receiverParty=&receiverService=&interface=SIO_BOM_PLM_ASYN&interfaceNamespace=urn%3Achintelectric.com%3Axi%3Aplm +//gsoap ns1 service namespace: urn:chintelectric.com:xi:plm +//gsoap ns1 service transport: http://schemas.xmlsoap.org/soap/http + +/** @mainpage SIO_USCOREBOM_USCOREPLM_USCOREASYN Definitions + +@section SIO_USCOREBOM_USCOREPLM_USCOREASYN_documentation Documentation + +@section SIO_USCOREBOM_USCOREPLM_USCOREASYN_bindings Service Bindings + + - @ref SIO_USCOREBOM_USCOREPLM_USCOREASYNBinding + +@section SIO_USCOREBOM_USCOREPLM_USCOREASYN_more More Information + + - @ref page_notes "Notes" + + - @ref page_XMLDataBinding "XML Data Binding" + + - @ref SOAP_ENV__Header "SOAP Header Content" (when applicable) + + - @ref SOAP_ENV__Detail "SOAP Fault Detail Content" (when applicable) + + +*/ + +/** @page SIO_USCOREBOM_USCOREPLM_USCOREASYNBinding Binding "SIO_USCOREBOM_USCOREPLM_USCOREASYNBinding" + +@section SIO_USCOREBOM_USCOREPLM_USCOREASYNBinding_operations Operations of Binding "SIO_USCOREBOM_USCOREPLM_USCOREASYNBinding" + + - @ref __ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN + +@section SIO_USCOREBOM_USCOREPLM_USCOREASYNBinding_ports Default endpoints of Binding "SIO_USCOREBOM_USCOREPLM_USCOREASYNBinding" + + - http://gfpot01:50100/XISOAPAdapter/MessageServlet?senderParty=&senderService=BC_CHINT_ELECTRIC&receiverParty=&receiverService=&interface=SIO_BOM_PLM_ASYN&interfaceNamespace=urn%3Achintelectric.com%3Axi%3Aplm + + - https://gfpot01:50101/XISOAPAdapter/MessageServlet?senderParty=&senderService=BC_CHINT_ELECTRIC&receiverParty=&receiverService=&interface=SIO_BOM_PLM_ASYN&interfaceNamespace=urn%3Achintelectric.com%3Axi%3Aplm + +@note Use wsdl2h option -Nname to change the service binding prefix name + + +*/ + +/******************************************************************************\ + * * + * Service Binding * + * SIO_USCOREBOM_USCOREPLM_USCOREASYNBinding * + * * +\******************************************************************************/ + + +/******************************************************************************\ + * * + * Service Operation * + * __ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN * + * * +\******************************************************************************/ + + +/** Operation "__ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN" of service binding "SIO_USCOREBOM_USCOREPLM_USCOREASYNBinding". + + - WS-Policy applicable to the operation: + + - One-way service request message + + - SOAP document/literal style messaging + + - Default endpoints: + - http://gfpot01:50100/XISOAPAdapter/MessageServlet?senderParty=&senderService=BC_CHINT_ELECTRIC&receiverParty=&receiverService=&interface=SIO_BOM_PLM_ASYN&interfaceNamespace=urn%3Achintelectric.com%3Axi%3Aplm + - https://gfpot01:50101/XISOAPAdapter/MessageServlet?senderParty=&senderService=BC_CHINT_ELECTRIC&receiverParty=&receiverService=&interface=SIO_BOM_PLM_ASYN&interfaceNamespace=urn%3Achintelectric.com%3Axi%3Aplm + + - Default SOAP action or REST location path: + - "http://sap.com/xi/WebService/soap1.1" + + - Addressing input action: "http://sap.com/xi/WebService/soap1.1" + +C stub function (defined in soapClient.c[pp] generated by soapcpp2): +@code + int soap_send___ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN( + struct soap *soap, + NULL, // char *endpoint = NULL selects default endpoint for this operation + NULL, // char *action = NULL selects default action for this operation + // input parameters: + ns1__DT_USCOREBOM_USCORES4_USCOREREQ* ns1__MT_USCOREBOM_USCORES4_USCOREREQ, + ); +@endcode + +C server function (called from the service dispatcher defined in soapServer.c[pp]): +@code + int __ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN( + struct soap *soap, + // input parameters: + ns1__DT_USCOREBOM_USCORES4_USCOREREQ* ns1__MT_USCOREBOM_USCORES4_USCOREREQ, + // output parameters: + ); +@endcode + +C++ proxy class (defined in soapSIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy.h generated with soapcpp2): +@code + class SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy; +@endcode +Important: use soapcpp2 option '-j' (or '-i') to generate improved and easy-to-use proxy classes; + +C++ service class (defined in soapSIO_USCOREBOM_USCOREPLM_USCOREASYNBindingService.h generated with soapcpp2): +@code + class SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingService; +@endcode +Important: use soapcpp2 option '-j' (or '-i') to generate improved and easy-to-use service classes; + +*/ + +//gsoap ns1 service method-protocol: SIO_USCOREBOM_USCOREPLM_USCOREASYN SOAP +//gsoap ns1 service method-style: SIO_USCOREBOM_USCOREPLM_USCOREASYN document +//gsoap ns1 service method-encoding: SIO_USCOREBOM_USCOREPLM_USCOREASYN literal +//gsoap ns1 service method-input-action: SIO_USCOREBOM_USCOREPLM_USCOREASYN http://sap.com/xi/WebService/soap1.1 +int __ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN( + ns1__DT_USCOREBOM_USCORES4_USCOREREQ* ns1__MT_USCOREBOM_USCORES4_USCOREREQ, ///< Input parameter + void ///< One-way message: no output parameter +); + +/** @page SIO_USCOREBOM_USCOREPLM_USCOREASYNBinding Binding "SIO_USCOREBOM_USCOREPLM_USCOREASYNBinding" + +@section SIO_USCOREBOM_USCOREPLM_USCOREASYNBinding_policy_enablers Policy Enablers of Binding "SIO_USCOREBOM_USCOREPLM_USCOREASYNBinding" + +None specified. + +*/ + +/******************************************************************************\ + * * + * XML Data Binding * + * * +\******************************************************************************/ + + +/** @page page_XMLDataBinding XML Data Binding + +SOAP/XML services use data bindings that are contractually bound by WSDLs and +are auto-generated by wsdl2h and soapcpp2 (see Service Bindings). Plain data +bindings are adopted from XML schemas as part of the WSDL types section or when +running wsdl2h on a set of schemas to produce non-SOAP-based XML data bindings. + +@note The following readers and writers are C/C++ data type (de)serializers +auto-generated by wsdl2h and soapcpp2. Run soapcpp2 on this file to generate the +(de)serialization code, which is stored in soapC.c[pp]. Include "soapH.h" in +your code to import these data type and function declarations. Only use the +soapcpp2-generated files in your project build. Do not include the wsdl2h- +generated .h file in your code. + +@note Data can be read and deserialized from: + - an int file descriptor, using soap->recvfd = fd + - a socket, using soap->socket = (int)... + - a C++ stream (istream, stringstream), using soap->is = (istream*)... + - a C string, using soap->is = (const char*)... + - any input, using the soap->frecv() callback + +@note Data can be serialized and written to: + - an int file descriptor, using soap->sendfd = (int)... + - a socket, using soap->socket = (int)... + - a C++ stream (ostream, stringstream), using soap->os = (ostream*)... + - a C string, using soap->os = (const char**)... + - any output, using the soap->fsend() callback + +@note The following options are available for (de)serialization control: + - soap->encodingStyle = NULL; to remove SOAP 1.1/1.2 encodingStyle + - soap_set_mode(soap, SOAP_XML_TREE); XML without id-ref (no cycles!) + - soap_set_mode(soap, SOAP_XML_GRAPH); XML with id-ref (including cycles) + - soap_set_namespaces(soap, struct Namespace *nsmap); to set xmlns bindings + + +*/ + +/** + +@section ns1 Top-level root elements of schema "urn:chintelectric.com:xi:plm" + + - (use wsdl2h option -g to auto-generate type _ns1__MT_USCOREBOM_USCORES4_USCOREREQ) + +*/ + +/* End of bomtest.h */ +/* BOP.h + Generated by wsdl2h 2.8.131 from BOP.wsdl and wsmap.dat + 2023-11-28 03:25:43 GMT + + DO NOT INCLUDE THIS ANNOTATED FILE DIRECTLY IN YOUR PROJECT SOURCE CODE. + USE THE FILES GENERATED BY soapcpp2 FOR YOUR PROJECT'S SOURCE CODE. + +gSOAP XML Web services tools +Copyright (C) 2000-2023, Robert van Engelen, Genivia Inc. All Rights Reserved. +This program is released under the GPL with the additional exemption that +compiling, linking, and/or using OpenSSL is allowed. +-------------------------------------------------------------------------------- +A commercial use license is available from Genivia Inc., contact@genivia.com +-------------------------------------------------------------------------------- +*/ + +/** + +@page page_notes Notes + +@note HINTS: + - Run soapcpp2 on BOP.h to generate the SOAP/XML processing logic: + Use soapcpp2 -I to specify paths for #import + Use soapcpp2 -j to generate improved proxy and server classes. + Use soapcpp2 -r to generate a report. + - Edit 'typemap.dat' to control namespace bindings and type mappings: + It is strongly recommended to customize the names of the namespace prefixes + generated by wsdl2h. To do so, modify the prefix bindings in the Namespaces + section below and add the modified lines to 'typemap.dat' to rerun wsdl2h. + - Run Doxygen (www.doxygen.org) on this file to generate documentation. + - Use wsdl2h -c to generate pure C code. + - Use wsdl2h -R to include the REST operations defined by the WSDLs. + - Use wsdl2h -O3 or -O4 to optimize by removing unused schema components. + - Use wsdl2h -d to enable DOM support for xsd:any and xsd:anyType. + - Use wsdl2h -F to simulate struct-type derivation in C (also works in C++). + - Use wsdl2h -f to generate flat C++ class hierarchy, removes type derivation. + - Use wsdl2h -g to generate top-level root elements with readers and writers. + - Use wsdl2h -U to map XML names to C++ Unicode identifiers instead of _xNNNN. + - Use wsdl2h -u to disable the generation of unions. + - Use wsdl2h -L to remove this @note and all other @note comments. + - Use wsdl2h -nname to use name as the base namespace prefix instead of 'ns'. + - Use wsdl2h -Nname for service prefix and produce multiple service bindings + - Struct/class members serialized as XML attributes are annotated with a '@'. + - Struct/class members that have a special role are annotated with a '$'. + +@warning + DO NOT INCLUDE THIS ANNOTATED FILE DIRECTLY IN YOUR PROJECT SOURCE CODE. + USE THE FILES GENERATED BY soapcpp2 FOR YOUR PROJECT'S SOURCE CODE: + THE GENERATED soapStub.h FILE CONTAINS THIS CONTENT WITHOUT ANNOTATIONS. + +@copyright LICENSE: +@verbatim +-------------------------------------------------------------------------------- +gSOAP XML Web services tools +Copyright (C) 2000-2023, Robert van Engelen, Genivia Inc. All Rights Reserved. +The wsdl2h tool and its generated software are released under the GPL. +This software is released under the GPL with the additional exemption that +compiling, linking, and/or using OpenSSL is allowed. +-------------------------------------------------------------------------------- +GPL license. + +This program is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free Software +Foundation; either version 2 of the License, or (at your option) any later +version. + +This program is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A +PARTICULAR PURPOSE. See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along with +this program; if not, write to the Free Software Foundation, Inc., 59 Temple +Place, Suite 330, Boston, MA 02111-1307 USA + +Author contact information: +engelen@genivia.com / engelen@acm.org + +This program is released under the GPL with the additional exemption that +compiling, linking, and/or using OpenSSL is allowed. +-------------------------------------------------------------------------------- +A commercial-use license is available from Genivia, Inc., contact@genivia.com +-------------------------------------------------------------------------------- +@endverbatim + +*/ + + +//gsoapopt c++,w + +/******************************************************************************\ + * * + * Definitions * + * urn:chintelectric.com:xi:plm * + * * +\******************************************************************************/ + +/* WSDL Documentation: + +*/ + + +/******************************************************************************\ + * * + * $SIZE typemap variable: * + * int * + * * +\******************************************************************************/ + + +/******************************************************************************\ + * * + * Import * + * * +\******************************************************************************/ + + +/******************************************************************************\ + * * + * Schema Namespaces * + * * +\******************************************************************************/ + + +/* NOTE: + +It is strongly recommended to customize the names of the namespace prefixes +generated by wsdl2h. To do so, modify the prefix bindings below and add the +modified lines to 'typemap.dat' then rerun wsdl2h (use wsdl2h -t typemap.dat): + +ns1 = "urn:chintelectric.com:xi:plm" + +*/ + +//gsoap ns1 schema namespace: urn:chintelectric.com:xi:plm +//gsoap ns1 schema form: unqualified + +/******************************************************************************\ + * * + * Built-in Schema Types and Top-Level Elements and Attributes * + * * +\******************************************************************************/ + + +/******************************************************************************\ + * * + * Forward Declarations * + * * +\******************************************************************************/ + + +class ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP; + +class ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ; + + +/******************************************************************************\ + * * + * Schema Types and Top-Level Elements and Attributes * + * urn:chintelectric.com:xi:plm * + * * +\******************************************************************************/ + + +/******************************************************************************\ + * * + * Schema Complex Types and Top-Level Elements * + * urn:chintelectric.com:xi:plm * + * * +\******************************************************************************/ + +/// @brief "urn:chintelectric.com:xi:plm":DT_PROCESSROUTE_S4_RSP is a complexType. +/// +///
+/// PPI002-PLM ERP (PLM->SAP) +///
+/// +/// @note class ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP operations: +/// - ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP* soap_new_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP(soap*) allocate and default initialize +/// - ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP* soap_new_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP(soap*, int num) allocate and default initialize an array +/// - ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP* soap_new_req_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP(soap*, ...) allocate, set required members +/// - ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP* soap_new_set_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP(soap*, ...) allocate, set all public members +/// - ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP::soap_default(soap*) default initialize members +/// - int soap_read_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP(soap*, ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP*) deserialize from a stream +/// - int soap_write_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP(soap*, ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP*) serialize to a stream +/// - ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP* ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP::soap_dup(soap*) returns deep copy of ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) +/// - ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP::soap_del() deep deletes ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP data members, use only after ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP::soap_dup(NULL) (use soapcpp2 -Ed) +/// - int ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP::soap_type() returns SOAP_TYPE_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP or derived type identifier +class ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP +{ public: +/// @note class _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO operations: +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO* soap_new__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO(soap*) allocate and default initialize +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO* soap_new__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO(soap*, int num) allocate and default initialize an array +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO* soap_new_req__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO(soap*, ...) allocate, set required members +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO* soap_new_set__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO(soap*, ...) allocate, set all public members +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO::soap_default(soap*) default initialize members +/// - int soap_read__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO(soap*, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO*) deserialize from a stream +/// - int soap_write__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO(soap*, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO*) serialize to a stream +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO* _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO::soap_dup(soap*) returns deep copy of _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO::soap_del() deep deletes _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO data members, use only after _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO::soap_dup(NULL) (use soapcpp2 -Ed) +/// - int _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO::soap_type() returns SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO or derived type identifier + class _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO + { public: +/// Element "REQ_TRACE_ID" of type xs:string. + char* REQ_USCORETRACE_USCOREID 1; ///< Required element. + } RSP_USCOREBASEINFO 1; ///< Required element. +/// Size of ZTABLE_RETURN array is 0..unbounded. + $ int __sizeZTABLE_USCORERETURN 0; +/// @note class _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN operations: +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN* soap_new__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN(soap*) allocate and default initialize +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN* soap_new__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN(soap*, int num) allocate and default initialize an array +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN* soap_new_req__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN(soap*, ...) allocate, set required members +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN* soap_new_set__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN(soap*, ...) allocate, set all public members +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN::soap_default(soap*) default initialize members +/// - int soap_read__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN(soap*, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN*) deserialize from a stream +/// - int soap_write__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN(soap*, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN*) serialize to a stream +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN* _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN::soap_dup(soap*) returns deep copy of _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN::soap_del() deep deletes _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN data members, use only after _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN::soap_dup(NULL) (use soapcpp2 -Ed) +/// - int _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN::soap_type() returns SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN or derived type identifier + class _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN + { public: + +/// +/// +/// Element "MATNR" of type xs:string. + char* MATNR 0; ///< Optional element. + +/// +/// +/// Element "TYPE" of type xs:string. + char* TYPE 0; ///< Optional element. + +/// +/// +/// Element "MESSAGE" of type xs:string. + char* MESSAGE 0; ///< Optional element. + } *ZTABLE_USCORERETURN 0; ///< Multiple elements. +/// Pointer to soap context that manages this instance. + struct soap *soap ; +}; + +/// @brief "urn:chintelectric.com:xi:plm":DT_PROCESSROUTE_S4_REQ is a complexType. +/// +///
+/// PPI002-PLM ERP (PLM->SAP) +///
+/// +/// @note class ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ operations: +/// - ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ* soap_new_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ(soap*) allocate and default initialize +/// - ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ* soap_new_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ(soap*, int num) allocate and default initialize an array +/// - ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ* soap_new_req_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ(soap*, ...) allocate, set required members +/// - ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ* soap_new_set_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ(soap*, ...) allocate, set all public members +/// - ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ::soap_default(soap*) default initialize members +/// - int soap_read_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ(soap*, ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ*) deserialize from a stream +/// - int soap_write_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ(soap*, ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ*) serialize to a stream +/// - ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ* ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ::soap_dup(soap*) returns deep copy of ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) +/// - ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ::soap_del() deep deletes ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ data members, use only after ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ::soap_dup(NULL) (use soapcpp2 -Ed) +/// - int ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ::soap_type() returns SOAP_TYPE_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ or derived type identifier +class ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ +{ public: +/// @note class _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO operations: +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO* soap_new__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO(soap*) allocate and default initialize +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO* soap_new__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO(soap*, int num) allocate and default initialize an array +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO* soap_new_req__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO(soap*, ...) allocate, set required members +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO* soap_new_set__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO(soap*, ...) allocate, set all public members +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO::soap_default(soap*) default initialize members +/// - int soap_read__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO(soap*, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO*) deserialize from a stream +/// - int soap_write__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO(soap*, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO*) serialize to a stream +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO* _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO::soap_dup(soap*) returns deep copy of _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO::soap_del() deep deletes _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO data members, use only after _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO::soap_dup(NULL) (use soapcpp2 -Ed) +/// - int _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO::soap_type() returns SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO or derived type identifier + class _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO + { public: +/// Element "REQ_TRACE_ID" of type xs:string. + char* REQ_USCORETRACE_USCOREID 0; ///< Optional element. + } BASEINFO 1; ///< Required element. +/// Size of LIST array is 0..unbounded. + $ int __sizeLIST 0; +/// @note class _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST operations: +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST* soap_new__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST(soap*) allocate and default initialize +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST* soap_new__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST(soap*, int num) allocate and default initialize an array +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST* soap_new_req__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST(soap*, ...) allocate, set required members +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST* soap_new_set__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST(soap*, ...) allocate, set all public members +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST::soap_default(soap*) default initialize members +/// - int soap_read__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST(soap*, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST*) deserialize from a stream +/// - int soap_write__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST(soap*, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST*) serialize to a stream +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST* _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST::soap_dup(soap*) returns deep copy of _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST::soap_del() deep deletes _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST data members, use only after _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST::soap_dup(NULL) (use soapcpp2 -Ed) +/// - int _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST::soap_type() returns SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST or derived type identifier + class _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST + { public: +/// @note class _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD operations: +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD* soap_new__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD(soap*) allocate and default initialize +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD* soap_new__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD(soap*, int num) allocate and default initialize an array +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD* soap_new_req__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD(soap*, ...) allocate, set required members +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD* soap_new_set__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD(soap*, ...) allocate, set all public members +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD::soap_default(soap*) default initialize members +/// - int soap_read__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD(soap*, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD*) deserialize from a stream +/// - int soap_write__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD(soap*, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD*) serialize to a stream +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD* _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD::soap_dup(soap*) returns deep copy of _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD::soap_del() deep deletes _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD data members, use only after _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD::soap_dup(NULL) (use soapcpp2 -Ed) +/// - int _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD::soap_type() returns SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD or derived type identifier + class _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD + { public: + +/// +/// +/// Element "MATNR" of type xs:string. + char* MATNR 1; ///< Required element. + +/// +/// +/// Element "WERKS" of type xs:string. + char* WERKS 1; ///< Required element. + +/// +/// +/// Element "VERWE" of type xs:string. + char* VERWE 1; ///< Required element. + +/// +/// +/// Element "STATU" of type xs:string. + char* STATU 1; ///< Required element. + +/// +/// +/// Element "DATUV" of type xs:string. + char* DATUV 0; ///< Optional element. + +/// +/// +/// Element "PLNAL" of type xs:string. + char* PLNAL 0; ///< Optional element. +///
+/// WBS +///
+/// +/// Element "PSPNR" of type xs:string. + char* PSPNR 0; ///< Optional element. + } HEAD 1; ///< Required element. +/// @note class _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS operations: +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS* soap_new__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS(soap*) allocate and default initialize +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS* soap_new__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS(soap*, int num) allocate and default initialize an array +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS* soap_new_req__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS(soap*, ...) allocate, set required members +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS* soap_new_set__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS(soap*, ...) allocate, set all public members +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS::soap_default(soap*) default initialize members +/// - int soap_read__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS(soap*, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS*) deserialize from a stream +/// - int soap_write__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS(soap*, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS*) serialize to a stream +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS* _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS::soap_dup(soap*) returns deep copy of _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS::soap_del() deep deletes _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS data members, use only after _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS::soap_dup(NULL) (use soapcpp2 -Ed) +/// - int _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS::soap_type() returns SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS or derived type identifier + class _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS + { public: +/// Size of ITEM array is 0..unbounded. + $ int __sizeITEM 0; +/// @note class _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM operations: +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM* soap_new__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(soap*) allocate and default initialize +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM* soap_new__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(soap*, int num) allocate and default initialize an array +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM* soap_new_req__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(soap*, ...) allocate, set required members +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM* soap_new_set__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(soap*, ...) allocate, set all public members +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::soap_default(soap*) default initialize members +/// - int soap_read__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(soap*, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM*) deserialize from a stream +/// - int soap_write__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(soap*, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM*) serialize to a stream +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM* _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::soap_dup(soap*) returns deep copy of _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::soap_del() deep deletes _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM data members, use only after _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::soap_dup(NULL) (use soapcpp2 -Ed) +/// - int _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::soap_type() returns SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM or derived type identifier + class _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM + { public: + +/// +/// +/// Element "PLNAL" of type xs:string. + char* PLNAL 0; ///< Optional element. + +/// +/// +/// Element "PLNFL" of type xs:string. + char* PLNFL 0; ///< Optional element. + +/// +/// +/// Element "DATUV" of type xs:string. + char* DATUV 0; ///< Optional element. + +/// +/// +/// Element "FLGAT" of type xs:string. + char* FLGAT 0; ///< Optional element. + +/// +/// +/// Element "BEZFL" of type xs:string. + char* BEZFL 0; ///< Optional element. + +/// +/// +/// Element "LTXA1" of type xs:string. + char* LTXA1 0; ///< Optional element. + +/// +/// +/// Element "VORNR1" of type xs:string. + char* VORNR1 0; ///< Optional element. + +/// +/// +/// Element "VORNR2" of type xs:string. + char* VORNR2 0; ///< Optional element. +/// @note class _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS operations: +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS* soap_new__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS(soap*) allocate and default initialize +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS* soap_new__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS(soap*, int num) allocate and default initialize an array +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS* soap_new_req__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS(soap*, ...) allocate, set required members +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS* soap_new_set__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS(soap*, ...) allocate, set all public members +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS::soap_default(soap*) default initialize members +/// - int soap_read__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS(soap*, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS*) deserialize from a stream +/// - int soap_write__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS(soap*, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS*) serialize to a stream +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS* _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS::soap_dup(soap*) returns deep copy of _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS::soap_del() deep deletes _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS data members, use only after _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS::soap_dup(NULL) (use soapcpp2 -Ed) +/// - int _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS::soap_type() returns SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS or derived type identifier + class _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS + { public: +/// Size of SUBITEM array is 0..unbounded. + $ int __sizeSUBITEM 0; +/// @note class _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM operations: +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM* soap_new__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM(soap*) allocate and default initialize +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM* soap_new__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM(soap*, int num) allocate and default initialize an array +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM* soap_new_req__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM(soap*, ...) allocate, set required members +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM* soap_new_set__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM(soap*, ...) allocate, set all public members +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM::soap_default(soap*) default initialize members +/// - int soap_read__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM(soap*, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM*) deserialize from a stream +/// - int soap_write__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM(soap*, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM*) serialize to a stream +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM* _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM::soap_dup(soap*) returns deep copy of _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) +/// - _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM::soap_del() deep deletes _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM data members, use only after _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM::soap_dup(NULL) (use soapcpp2 -Ed) +/// - int _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM::soap_type() returns SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM or derived type identifier + class _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM + { public: + +/// +/// +/// Element "VORNR" of type xs:string. + char* VORNR 0; ///< Optional element. + +/// +/// +/// Element "ARBPL" of type xs:string. + char* ARBPL 0; ///< Optional element. + +/// +/// +/// Element "STEUS" of type xs:string. + char* STEUS 0; ///< Optional element. + +/// +/// +/// Element "LTXA1" of type xs:string. + char* LTXA1 0; ///< Optional element. + +/// +/// +/// Element "USR00" of type xs:string. + char* USR00 0; ///< Optional element. + +/// +/// +/// Element "BMSCH" of type xs:string. + char* BMSCH 1; ///< Required element. + +/// +/// +/// Element "PLNME" of type xs:string. + char* PLNME 0; ///< Optional element. +///
+/// 1 +///
+/// +/// Element "VGW01" of type xs:string. + char* VGW01 1; ///< Required element. +///
+/// 1 +///
+/// +/// Element "VGE01" of type xs:string. + char* VGE01 1; ///< Required element. +///
+/// 2 +///
+/// +/// Element "VGW02" of type xs:string. + char* VGW02 1; ///< Required element. +///
+/// 2 +///
+/// +/// Element "VGE02" of type xs:string. + char* VGE02 1; ///< Required element. +///
+/// 5 +///
+/// +/// Element "VGW05" of type xs:string. + char* VGW05 0; ///< Optional element. +///
+/// 5 +///
+/// +/// Element "VGE05" of type xs:string. + char* VGE05 0; ///< Optional element. + } *SUBITEM 0; ///< Multiple elements. + } SUBITEMS 1; ///< Required element. + } *ITEM 0; ///< Multiple elements. + } ITEMS 1; ///< Required element. + } *LIST 0; ///< Multiple elements. +/// Pointer to soap context that manages this instance. + struct soap *soap ; +}; + + +/******************************************************************************\ + * * + * Additional Top-Level Elements * + * urn:chintelectric.com:xi:plm * + * * +\******************************************************************************/ + +/// @brief Top-level root element "urn:chintelectric.com:xi:plm":MT_PROCESSROUTE_S4_RSP of type "urn:chintelectric.com:xi:plm":DT_PROCESSROUTE_S4_RSP. +/// @note Use wsdl2h option -g to auto-generate a top-level root element declaration. + +/// @brief Top-level root element "urn:chintelectric.com:xi:plm":MT_PROCESSROUTE_S4_REQ of type "urn:chintelectric.com:xi:plm":DT_PROCESSROUTE_S4_REQ. +/// @note Use wsdl2h option -g to auto-generate a top-level root element declaration. + + +/******************************************************************************\ + * * + * Additional Top-Level Attributes * + * urn:chintelectric.com:xi:plm * + * * +\******************************************************************************/ + + +/******************************************************************************\ + * * + * Services * + * * +\******************************************************************************/ + + +//gsoap ns1 service name: SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBinding +//gsoap ns1 service type: SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN +//gsoap ns1 service port: http://gfpoapp:50100/XISOAPAdapter/MessageServlet?senderParty=&senderService=BC_CHINT_ELECTRIC&receiverParty=&receiverService=&interface=SI_PROCESSROUTE_PLM_OUT_SYN&interfaceNamespace=urn%3Achintelectric.com%3Axi%3Aplm +//gsoap ns1 service port: https://gfpoapp:50101/XISOAPAdapter/MessageServlet?senderParty=&senderService=BC_CHINT_ELECTRIC&receiverParty=&receiverService=&interface=SI_PROCESSROUTE_PLM_OUT_SYN&interfaceNamespace=urn%3Achintelectric.com%3Axi%3Aplm +//gsoap ns1 service namespace: urn:chintelectric.com:xi:plm +//gsoap ns1 service transport: http://schemas.xmlsoap.org/soap/http + +/** @mainpage SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN Definitions + +@section SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN_documentation Documentation + +@section SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN_bindings Service Bindings + + - @ref SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBinding + +@section SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN_more More Information + + - @ref page_notes "Notes" + + - @ref page_XMLDataBinding "XML Data Binding" + + - @ref SOAP_ENV__Header "SOAP Header Content" (when applicable) + + - @ref SOAP_ENV__Detail "SOAP Fault Detail Content" (when applicable) + + +*/ + +/** @page SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBinding Binding "SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBinding" + +@section SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBinding_operations Operations of Binding "SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBinding" + + - @ref __ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN + +@section SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBinding_ports Default endpoints of Binding "SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBinding" + + - http://gfpoapp:50100/XISOAPAdapter/MessageServlet?senderParty=&senderService=BC_CHINT_ELECTRIC&receiverParty=&receiverService=&interface=SI_PROCESSROUTE_PLM_OUT_SYN&interfaceNamespace=urn%3Achintelectric.com%3Axi%3Aplm + + - https://gfpoapp:50101/XISOAPAdapter/MessageServlet?senderParty=&senderService=BC_CHINT_ELECTRIC&receiverParty=&receiverService=&interface=SI_PROCESSROUTE_PLM_OUT_SYN&interfaceNamespace=urn%3Achintelectric.com%3Axi%3Aplm + +@note Use wsdl2h option -Nname to change the service binding prefix name + + +*/ + +/******************************************************************************\ + * * + * Service Binding * + * SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBinding * + * * +\******************************************************************************/ + + +/******************************************************************************\ + * * + * Service Operation * + * __ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN * + * * +\******************************************************************************/ + + +/** Operation "__ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN" of service binding "SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBinding". + + - WS-Policy applicable to the operation: + + - SOAP document/literal style messaging + + - Default endpoints: + - http://gfpoapp:50100/XISOAPAdapter/MessageServlet?senderParty=&senderService=BC_CHINT_ELECTRIC&receiverParty=&receiverService=&interface=SI_PROCESSROUTE_PLM_OUT_SYN&interfaceNamespace=urn%3Achintelectric.com%3Axi%3Aplm + - https://gfpoapp:50101/XISOAPAdapter/MessageServlet?senderParty=&senderService=BC_CHINT_ELECTRIC&receiverParty=&receiverService=&interface=SI_PROCESSROUTE_PLM_OUT_SYN&interfaceNamespace=urn%3Achintelectric.com%3Axi%3Aplm + + - Default SOAP action or REST location path: + - "http://sap.com/xi/WebService/soap1.1" + + - Addressing input action: "http://sap.com/xi/WebService/soap1.1" + + - Addressing output action: "http://sap.com/xi/WebService/soap1.1Response" + +C stub function (defined in soapClient.c[pp] generated by soapcpp2): +@code + int soap_call___ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN( + struct soap *soap, + NULL, // char *endpoint = NULL selects default endpoint for this operation + NULL, // char *action = NULL selects default action for this operation + // input parameters: + ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ* ns1__MT_USCOREPROCESSROUTE_USCORES4_USCOREREQ, + // output parameters: + ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP&ns1__MT_USCOREPROCESSROUTE_USCORES4_USCORERSP + ); +@endcode + +C server function (called from the service dispatcher defined in soapServer.c[pp]): +@code + int __ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN( + struct soap *soap, + // input parameters: + ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ* ns1__MT_USCOREPROCESSROUTE_USCORES4_USCOREREQ, + // output parameters: + ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP&ns1__MT_USCOREPROCESSROUTE_USCORES4_USCORERSP + ); +@endcode + +C++ proxy class (defined in soapSI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy.h generated with soapcpp2): +@code + class SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy; +@endcode +Important: use soapcpp2 option '-j' (or '-i') to generate improved and easy-to-use proxy classes; + +C++ service class (defined in soapSI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingService.h generated with soapcpp2): +@code + class SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingService; +@endcode +Important: use soapcpp2 option '-j' (or '-i') to generate improved and easy-to-use service classes; + +*/ + +//gsoap ns1 service method-protocol: SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN SOAP +//gsoap ns1 service method-style: SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN document +//gsoap ns1 service method-encoding: SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN literal +//gsoap ns1 service method-input-action: SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN http://sap.com/xi/WebService/soap1.1 +//gsoap ns1 service method-output-action: SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN http://sap.com/xi/WebService/soap1.1Response +int __ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN( + ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ* ns1__MT_USCOREPROCESSROUTE_USCORES4_USCOREREQ, ///< Input parameter + ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP&ns1__MT_USCOREPROCESSROUTE_USCORES4_USCORERSP ///< Output parameter +); + +/** @page SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBinding Binding "SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBinding" + +@section SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBinding_policy_enablers Policy Enablers of Binding "SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBinding" + +None specified. + +*/ + +/******************************************************************************\ + * * + * XML Data Binding * + * * +\******************************************************************************/ + + +/** @page page_XMLDataBinding XML Data Binding + +SOAP/XML services use data bindings that are contractually bound by WSDLs and +are auto-generated by wsdl2h and soapcpp2 (see Service Bindings). Plain data +bindings are adopted from XML schemas as part of the WSDL types section or when +running wsdl2h on a set of schemas to produce non-SOAP-based XML data bindings. + +@note The following readers and writers are C/C++ data type (de)serializers +auto-generated by wsdl2h and soapcpp2. Run soapcpp2 on this file to generate the +(de)serialization code, which is stored in soapC.c[pp]. Include "soapH.h" in +your code to import these data type and function declarations. Only use the +soapcpp2-generated files in your project build. Do not include the wsdl2h- +generated .h file in your code. + +@note Data can be read and deserialized from: + - an int file descriptor, using soap->recvfd = fd + - a socket, using soap->socket = (int)... + - a C++ stream (istream, stringstream), using soap->is = (istream*)... + - a C string, using soap->is = (const char*)... + - any input, using the soap->frecv() callback + +@note Data can be serialized and written to: + - an int file descriptor, using soap->sendfd = (int)... + - a socket, using soap->socket = (int)... + - a C++ stream (ostream, stringstream), using soap->os = (ostream*)... + - a C string, using soap->os = (const char**)... + - any output, using the soap->fsend() callback + +@note The following options are available for (de)serialization control: + - soap->encodingStyle = NULL; to remove SOAP 1.1/1.2 encodingStyle + - soap_set_mode(soap, SOAP_XML_TREE); XML without id-ref (no cycles!) + - soap_set_mode(soap, SOAP_XML_GRAPH); XML with id-ref (including cycles) + - soap_set_namespaces(soap, struct Namespace *nsmap); to set xmlns bindings + + +*/ + +/** + +@section ns1 Top-level root elements of schema "urn:chintelectric.com:xi:plm" + + - (use wsdl2h option -g to auto-generate type _ns1__MT_USCOREPROCESSROUTE_USCORES4_USCORERSP) + + - (use wsdl2h option -g to auto-generate type _ns1__MT_USCOREPROCESSROUTE_USCORES4_USCOREREQ) + +*/ + +/* End of BOP.h */ +/* factory.h + Generated by wsdl2h 2.8.131 from factory.wsdl and wsmap.dat + 2023-11-28 03:25:39 GMT + + DO NOT INCLUDE THIS ANNOTATED FILE DIRECTLY IN YOUR PROJECT SOURCE CODE. + USE THE FILES GENERATED BY soapcpp2 FOR YOUR PROJECT'S SOURCE CODE. + +gSOAP XML Web services tools +Copyright (C) 2000-2023, Robert van Engelen, Genivia Inc. All Rights Reserved. +This program is released under the GPL with the additional exemption that +compiling, linking, and/or using OpenSSL is allowed. +-------------------------------------------------------------------------------- +A commercial use license is available from Genivia Inc., contact@genivia.com +-------------------------------------------------------------------------------- +*/ + +/** + +@page page_notes Notes + +@note HINTS: + - Run soapcpp2 on factory.h to generate the SOAP/XML processing logic: + Use soapcpp2 -I to specify paths for #import + Use soapcpp2 -j to generate improved proxy and server classes. + Use soapcpp2 -r to generate a report. + - Edit 'typemap.dat' to control namespace bindings and type mappings: + It is strongly recommended to customize the names of the namespace prefixes + generated by wsdl2h. To do so, modify the prefix bindings in the Namespaces + section below and add the modified lines to 'typemap.dat' to rerun wsdl2h. + - Run Doxygen (www.doxygen.org) on this file to generate documentation. + - Use wsdl2h -c to generate pure C code. + - Use wsdl2h -R to include the REST operations defined by the WSDLs. + - Use wsdl2h -O3 or -O4 to optimize by removing unused schema components. + - Use wsdl2h -d to enable DOM support for xsd:any and xsd:anyType. + - Use wsdl2h -F to simulate struct-type derivation in C (also works in C++). + - Use wsdl2h -f to generate flat C++ class hierarchy, removes type derivation. + - Use wsdl2h -g to generate top-level root elements with readers and writers. + - Use wsdl2h -U to map XML names to C++ Unicode identifiers instead of _xNNNN. + - Use wsdl2h -u to disable the generation of unions. + - Use wsdl2h -L to remove this @note and all other @note comments. + - Use wsdl2h -nname to use name as the base namespace prefix instead of 'ns'. + - Use wsdl2h -Nname for service prefix and produce multiple service bindings + - Struct/class members serialized as XML attributes are annotated with a '@'. + - Struct/class members that have a special role are annotated with a '$'. + +@warning + DO NOT INCLUDE THIS ANNOTATED FILE DIRECTLY IN YOUR PROJECT SOURCE CODE. + USE THE FILES GENERATED BY soapcpp2 FOR YOUR PROJECT'S SOURCE CODE: + THE GENERATED soapStub.h FILE CONTAINS THIS CONTENT WITHOUT ANNOTATIONS. + +@copyright LICENSE: +@verbatim +-------------------------------------------------------------------------------- +gSOAP XML Web services tools +Copyright (C) 2000-2023, Robert van Engelen, Genivia Inc. All Rights Reserved. +The wsdl2h tool and its generated software are released under the GPL. +This software is released under the GPL with the additional exemption that +compiling, linking, and/or using OpenSSL is allowed. +-------------------------------------------------------------------------------- +GPL license. + +This program is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free Software +Foundation; either version 2 of the License, or (at your option) any later +version. + +This program is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A +PARTICULAR PURPOSE. See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along with +this program; if not, write to the Free Software Foundation, Inc., 59 Temple +Place, Suite 330, Boston, MA 02111-1307 USA + +Author contact information: +engelen@genivia.com / engelen@acm.org + +This program is released under the GPL with the additional exemption that +compiling, linking, and/or using OpenSSL is allowed. +-------------------------------------------------------------------------------- +A commercial-use license is available from Genivia, Inc., contact@genivia.com +-------------------------------------------------------------------------------- +@endverbatim + +*/ + + +//gsoapopt c++,w + +/******************************************************************************\ + * * + * Definitions * + * urn:chintelectric.com:xi:plm * + * * +\******************************************************************************/ + +/* WSDL Documentation: + +*/ + + +/******************************************************************************\ + * * + * $SIZE typemap variable: * + * int * + * * +\******************************************************************************/ + + +/******************************************************************************\ + * * + * Import * + * * +\******************************************************************************/ + + +/******************************************************************************\ + * * + * Schema Namespaces * + * * +\******************************************************************************/ + + +/* NOTE: + +It is strongly recommended to customize the names of the namespace prefixes +generated by wsdl2h. To do so, modify the prefix bindings below and add the +modified lines to 'typemap.dat' then rerun wsdl2h (use wsdl2h -t typemap.dat): + +ns1 = "urn:chintelectric.com:xi:plm" + +*/ + +//gsoap ns1 schema namespace: urn:chintelectric.com:xi:plm +//gsoap ns1 schema form: unqualified + +/******************************************************************************\ + * * + * Built-in Schema Types and Top-Level Elements and Attributes * + * * +\******************************************************************************/ + + +/******************************************************************************\ + * * + * Forward Declarations * + * * +\******************************************************************************/ + + +class ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP; + +class ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ; + + +/******************************************************************************\ + * * + * Schema Types and Top-Level Elements and Attributes * + * urn:chintelectric.com:xi:plm * + * * +\******************************************************************************/ + + +/******************************************************************************\ + * * + * Schema Complex Types and Top-Level Elements * + * urn:chintelectric.com:xi:plm * + * * +\******************************************************************************/ + +/// @brief "urn:chintelectric.com:xi:plm":DT_FACTORY_NUMBER_RSP is a complexType. +/// +///
+/// PPI004PLM->SAP +///
+/// +/// @note class ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP operations: +/// - ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP* soap_new_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP(soap*) allocate and default initialize +/// - ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP* soap_new_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP(soap*, int num) allocate and default initialize an array +/// - ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP* soap_new_req_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP(soap*, ...) allocate, set required members +/// - ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP* soap_new_set_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP(soap*, ...) allocate, set all public members +/// - ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP::soap_default(soap*) default initialize members +/// - int soap_read_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP(soap*, ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP*) deserialize from a stream +/// - int soap_write_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP(soap*, ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP*) serialize to a stream +/// - ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP* ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP::soap_dup(soap*) returns deep copy of ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) +/// - ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP::soap_del() deep deletes ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP data members, use only after ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP::soap_dup(NULL) (use soapcpp2 -Ed) +/// - int ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP::soap_type() returns SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP or derived type identifier +class ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP +{ public: +/// @note class _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO operations: +/// - _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO* soap_new__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(soap*) allocate and default initialize +/// - _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO* soap_new__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(soap*, int num) allocate and default initialize an array +/// - _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO* soap_new_req__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(soap*, ...) allocate, set required members +/// - _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO* soap_new_set__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(soap*, ...) allocate, set all public members +/// - _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO::soap_default(soap*) default initialize members +/// - int soap_read__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(soap*, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO*) deserialize from a stream +/// - int soap_write__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(soap*, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO*) serialize to a stream +/// - _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO* _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO::soap_dup(soap*) returns deep copy of _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) +/// - _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO::soap_del() deep deletes _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO data members, use only after _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO::soap_dup(NULL) (use soapcpp2 -Ed) +/// - int _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO::soap_type() returns SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO or derived type identifier + class _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO + { public: +/// Element "REQ_TRACE_ID" of type xs:string. + char* REQ_USCORETRACE_USCOREID 0; ///< Optional element. + } *RSP_USCOREBASEINFO 0; ///< Optional element. +/// Size of ZTABLE_RETURN array is 0..unbounded. + $ int __sizeZTABLE_USCORERETURN 0; +/// @note class _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN operations: +/// - _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN* soap_new__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(soap*) allocate and default initialize +/// - _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN* soap_new__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(soap*, int num) allocate and default initialize an array +/// - _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN* soap_new_req__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(soap*, ...) allocate, set required members +/// - _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN* soap_new_set__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(soap*, ...) allocate, set all public members +/// - _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN::soap_default(soap*) default initialize members +/// - int soap_read__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(soap*, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN*) deserialize from a stream +/// - int soap_write__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(soap*, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN*) serialize to a stream +/// - _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN* _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN::soap_dup(soap*) returns deep copy of _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) +/// - _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN::soap_del() deep deletes _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN data members, use only after _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN::soap_dup(NULL) (use soapcpp2 -Ed) +/// - int _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN::soap_type() returns SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN or derived type identifier + class _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN + { public: +/// Element "SERNR" of type xs:string. + char* SERNR 0; ///< Optional element. +/// Element "TYPE" of type xs:string. + char* TYPE 0; ///< Optional element. +/// Element "MESSAGE" of type xs:string. + char* MESSAGE 0; ///< Optional element. + } *ZTABLE_USCORERETURN 0; ///< Multiple elements. +/// Pointer to soap context that manages this instance. + struct soap *soap ; +}; + +/// @brief "urn:chintelectric.com:xi:plm":DT_FACTORY_NUMBER_REQ is a complexType. +/// +///
+/// PPI004PLM->SAP +///
+/// +/// @note class ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ operations: +/// - ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ* soap_new_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(soap*) allocate and default initialize +/// - ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ* soap_new_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(soap*, int num) allocate and default initialize an array +/// - ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ* soap_new_req_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(soap*, ...) allocate, set required members +/// - ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ* soap_new_set_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(soap*, ...) allocate, set all public members +/// - ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ::soap_default(soap*) default initialize members +/// - int soap_read_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(soap*, ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ*) deserialize from a stream +/// - int soap_write_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(soap*, ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ*) serialize to a stream +/// - ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ* ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ::soap_dup(soap*) returns deep copy of ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) +/// - ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ::soap_del() deep deletes ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ data members, use only after ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ::soap_dup(NULL) (use soapcpp2 -Ed) +/// - int ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ::soap_type() returns SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ or derived type identifier +class ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ +{ public: +/// @note class _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO operations: +/// - _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO* soap_new__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(soap*) allocate and default initialize +/// - _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO* soap_new__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(soap*, int num) allocate and default initialize an array +/// - _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO* soap_new_req__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(soap*, ...) allocate, set required members +/// - _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO* soap_new_set__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(soap*, ...) allocate, set all public members +/// - _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO::soap_default(soap*) default initialize members +/// - int soap_read__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(soap*, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO*) deserialize from a stream +/// - int soap_write__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(soap*, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO*) serialize to a stream +/// - _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO* _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO::soap_dup(soap*) returns deep copy of _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) +/// - _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO::soap_del() deep deletes _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO data members, use only after _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO::soap_dup(NULL) (use soapcpp2 -Ed) +/// - int _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO::soap_type() returns SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO or derived type identifier + class _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO + { public: +/// Element "REQ_TRACE_ID" of type xs:string. + char* REQ_USCORETRACE_USCOREID 0; ///< Optional element. + } *BASEINFO 0; ///< Optional element. +/// @note class _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS operations: +/// - _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS* soap_new__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(soap*) allocate and default initialize +/// - _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS* soap_new__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(soap*, int num) allocate and default initialize an array +/// - _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS* soap_new_req__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(soap*, ...) allocate, set required members +/// - _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS* soap_new_set__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(soap*, ...) allocate, set all public members +/// - _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS::soap_default(soap*) default initialize members +/// - int soap_read__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(soap*, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS*) deserialize from a stream +/// - int soap_write__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(soap*, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS*) serialize to a stream +/// - _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS* _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS::soap_dup(soap*) returns deep copy of _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) +/// - _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS::soap_del() deep deletes _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS data members, use only after _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS::soap_dup(NULL) (use soapcpp2 -Ed) +/// - int _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS::soap_type() returns SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS or derived type identifier + class _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS + { public: +/// Size of ITEM array is 0..unbounded. + $ int __sizeITEM 0; +/// @note class _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM operations: +/// - _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM* soap_new__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(soap*) allocate and default initialize +/// - _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM* soap_new__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(soap*, int num) allocate and default initialize an array +/// - _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM* soap_new_req__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(soap*, ...) allocate, set required members +/// - _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM* soap_new_set__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(soap*, ...) allocate, set all public members +/// - _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::soap_default(soap*) default initialize members +/// - int soap_read__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(soap*, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM*) deserialize from a stream +/// - int soap_write__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(soap*, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM*) serialize to a stream +/// - _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM* _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::soap_dup(soap*) returns deep copy of _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) +/// - _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::soap_del() deep deletes _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM data members, use only after _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::soap_dup(NULL) (use soapcpp2 -Ed) +/// - int _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::soap_type() returns SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM or derived type identifier + class _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM + { public: + +/// +/// +/// Element "PSPID" of type xs:string. + char* PSPID 0; ///< Optional element. +///
+/// WBS +///
+/// +/// Element "ZPSPID" of type xs:string. + char* ZPSPID 0; ///< Optional element. + +/// +/// +/// Element "MATNR" of type xs:string. + char* MATNR 0; ///< Optional element. + +/// +/// +/// Element "ZZD" of type xs:string. + char* ZZD 0; ///< Optional element. + +/// +/// +/// Element "ZGH" of type xs:string. + char* ZGH 0; ///< Optional element. + +/// +/// +/// Element "SERNR" of type xs:string. + char* SERNR 0; ///< Optional element. + +/// +/// +/// Element "WERKS" of type xs:string. + char* WERKS 0; ///< Optional element. + +/// +/// +/// Element "RSPOS" of type xs:string. + char* RSPOS 0; ///< Optional element. + } *ITEM 0; ///< Multiple elements. + } *ITEMS 0; ///< Optional element. +/// Pointer to soap context that manages this instance. + struct soap *soap ; +}; + + +/******************************************************************************\ + * * + * Additional Top-Level Elements * + * urn:chintelectric.com:xi:plm * + * * +\******************************************************************************/ + +/// @brief Top-level root element "urn:chintelectric.com:xi:plm":MT_FACTORY_NUMBER_REQ of type "urn:chintelectric.com:xi:plm":DT_FACTORY_NUMBER_REQ. +/// @note Use wsdl2h option -g to auto-generate a top-level root element declaration. + +/// @brief Top-level root element "urn:chintelectric.com:xi:plm":MT_FACTORY_NUMBER_RSP of type "urn:chintelectric.com:xi:plm":DT_FACTORY_NUMBER_RSP. +/// @note Use wsdl2h option -g to auto-generate a top-level root element declaration. + + +/******************************************************************************\ + * * + * Additional Top-Level Attributes * + * urn:chintelectric.com:xi:plm * + * * +\******************************************************************************/ + + +/******************************************************************************\ + * * + * Services * + * * +\******************************************************************************/ + + +//gsoap ns1 service name: SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBinding +//gsoap ns1 service type: SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN +//gsoap ns1 service port: http://gfpoapp:50100/XISOAPAdapter/MessageServlet?senderParty=&senderService=BC_CHINT_ELECTRIC&receiverParty=&receiverService=&interface=SI_FACTORY_NUMBER_PLM_OUT_SYN&interfaceNamespace=urn%3Achintelectric.com%3Axi%3Aplm +//gsoap ns1 service port: https://gfpoapp:50101/XISOAPAdapter/MessageServlet?senderParty=&senderService=BC_CHINT_ELECTRIC&receiverParty=&receiverService=&interface=SI_FACTORY_NUMBER_PLM_OUT_SYN&interfaceNamespace=urn%3Achintelectric.com%3Axi%3Aplm +//gsoap ns1 service namespace: urn:chintelectric.com:xi:plm +//gsoap ns1 service transport: http://schemas.xmlsoap.org/soap/http + +/** @mainpage SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN Definitions + +@section SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN_documentation Documentation + +@section SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN_bindings Service Bindings + + - @ref SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBinding + +@section SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN_more More Information + + - @ref page_notes "Notes" + + - @ref page_XMLDataBinding "XML Data Binding" + + - @ref SOAP_ENV__Header "SOAP Header Content" (when applicable) + + - @ref SOAP_ENV__Detail "SOAP Fault Detail Content" (when applicable) + + +*/ + +/** @page SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBinding Binding "SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBinding" + +@section SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBinding_operations Operations of Binding "SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBinding" + + - @ref __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN + +@section SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBinding_ports Default endpoints of Binding "SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBinding" + + - http://gfpoapp:50100/XISOAPAdapter/MessageServlet?senderParty=&senderService=BC_CHINT_ELECTRIC&receiverParty=&receiverService=&interface=SI_FACTORY_NUMBER_PLM_OUT_SYN&interfaceNamespace=urn%3Achintelectric.com%3Axi%3Aplm + + - https://gfpoapp:50101/XISOAPAdapter/MessageServlet?senderParty=&senderService=BC_CHINT_ELECTRIC&receiverParty=&receiverService=&interface=SI_FACTORY_NUMBER_PLM_OUT_SYN&interfaceNamespace=urn%3Achintelectric.com%3Axi%3Aplm + +@note Use wsdl2h option -Nname to change the service binding prefix name + + +*/ + +/******************************************************************************\ + * * + * Service Binding * + * SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBinding * + * * +\******************************************************************************/ + + +/******************************************************************************\ + * * + * Service Operation * + * __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN * + * * +\******************************************************************************/ + + +/** Operation "__ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN" of service binding "SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBinding". + + - WS-Policy applicable to the operation: + + - SOAP document/literal style messaging + + - Default endpoints: + - http://gfpoapp:50100/XISOAPAdapter/MessageServlet?senderParty=&senderService=BC_CHINT_ELECTRIC&receiverParty=&receiverService=&interface=SI_FACTORY_NUMBER_PLM_OUT_SYN&interfaceNamespace=urn%3Achintelectric.com%3Axi%3Aplm + - https://gfpoapp:50101/XISOAPAdapter/MessageServlet?senderParty=&senderService=BC_CHINT_ELECTRIC&receiverParty=&receiverService=&interface=SI_FACTORY_NUMBER_PLM_OUT_SYN&interfaceNamespace=urn%3Achintelectric.com%3Axi%3Aplm + + - Default SOAP action or REST location path: + - "http://sap.com/xi/WebService/soap1.1" + + - Addressing input action: "http://sap.com/xi/WebService/soap1.1" + + - Addressing output action: "http://sap.com/xi/WebService/soap1.1Response" + +C stub function (defined in soapClient.c[pp] generated by soapcpp2): +@code + int soap_call___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN( + struct soap *soap, + NULL, // char *endpoint = NULL selects default endpoint for this operation + NULL, // char *action = NULL selects default action for this operation + // input parameters: + ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ* ns1__MT_USCOREFACTORY_USCORENUMBER_USCOREREQ, + // output parameters: + ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP&ns1__MT_USCOREFACTORY_USCORENUMBER_USCORERSP + ); +@endcode + +C server function (called from the service dispatcher defined in soapServer.c[pp]): +@code + int __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN( + struct soap *soap, + // input parameters: + ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ* ns1__MT_USCOREFACTORY_USCORENUMBER_USCOREREQ, + // output parameters: + ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP&ns1__MT_USCOREFACTORY_USCORENUMBER_USCORERSP + ); +@endcode + +C++ proxy class (defined in soapSI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy.h generated with soapcpp2): +@code + class SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy; +@endcode +Important: use soapcpp2 option '-j' (or '-i') to generate improved and easy-to-use proxy classes; + +C++ service class (defined in soapSI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingService.h generated with soapcpp2): +@code + class SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingService; +@endcode +Important: use soapcpp2 option '-j' (or '-i') to generate improved and easy-to-use service classes; + +*/ + +//gsoap ns1 service method-protocol: SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN SOAP +//gsoap ns1 service method-style: SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN document +//gsoap ns1 service method-encoding: SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN literal +//gsoap ns1 service method-input-action: SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN http://sap.com/xi/WebService/soap1.1 +//gsoap ns1 service method-output-action: SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN http://sap.com/xi/WebService/soap1.1Response +int __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN( + ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ* ns1__MT_USCOREFACTORY_USCORENUMBER_USCOREREQ, ///< Input parameter + ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP&ns1__MT_USCOREFACTORY_USCORENUMBER_USCORERSP ///< Output parameter +); + +/** @page SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBinding Binding "SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBinding" + +@section SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBinding_policy_enablers Policy Enablers of Binding "SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBinding" + +None specified. + +*/ + +/******************************************************************************\ + * * + * XML Data Binding * + * * +\******************************************************************************/ + + +/** @page page_XMLDataBinding XML Data Binding + +SOAP/XML services use data bindings that are contractually bound by WSDLs and +are auto-generated by wsdl2h and soapcpp2 (see Service Bindings). Plain data +bindings are adopted from XML schemas as part of the WSDL types section or when +running wsdl2h on a set of schemas to produce non-SOAP-based XML data bindings. + +@note The following readers and writers are C/C++ data type (de)serializers +auto-generated by wsdl2h and soapcpp2. Run soapcpp2 on this file to generate the +(de)serialization code, which is stored in soapC.c[pp]. Include "soapH.h" in +your code to import these data type and function declarations. Only use the +soapcpp2-generated files in your project build. Do not include the wsdl2h- +generated .h file in your code. + +@note Data can be read and deserialized from: + - an int file descriptor, using soap->recvfd = fd + - a socket, using soap->socket = (int)... + - a C++ stream (istream, stringstream), using soap->is = (istream*)... + - a C string, using soap->is = (const char*)... + - any input, using the soap->frecv() callback + +@note Data can be serialized and written to: + - an int file descriptor, using soap->sendfd = (int)... + - a socket, using soap->socket = (int)... + - a C++ stream (ostream, stringstream), using soap->os = (ostream*)... + - a C string, using soap->os = (const char**)... + - any output, using the soap->fsend() callback + +@note The following options are available for (de)serialization control: + - soap->encodingStyle = NULL; to remove SOAP 1.1/1.2 encodingStyle + - soap_set_mode(soap, SOAP_XML_TREE); XML without id-ref (no cycles!) + - soap_set_mode(soap, SOAP_XML_GRAPH); XML with id-ref (including cycles) + - soap_set_namespaces(soap, struct Namespace *nsmap); to set xmlns bindings + + +*/ + +/** + +@section ns1 Top-level root elements of schema "urn:chintelectric.com:xi:plm" + + - (use wsdl2h option -g to auto-generate type _ns1__MT_USCOREFACTORY_USCORENUMBER_USCOREREQ) + + - (use wsdl2h option -g to auto-generate type _ns1__MT_USCOREFACTORY_USCORENUMBER_USCORERSP) + +*/ + +/* End of factory.h */ diff --git a/DFL_BOM_WL_TOERP/bin/win64/wsdl2h.exe b/DFL_BOM_WL_TOERP/bin/win64/wsdl2h.exe new file mode 100644 index 0000000..0c59659 Binary files /dev/null and b/DFL_BOM_WL_TOERP/bin/win64/wsdl2h.exe differ diff --git a/DFL_BOM_WL_TOERP/bin/win64/wsmp.dat b/DFL_BOM_WL_TOERP/bin/win64/wsmp.dat new file mode 100644 index 0000000..b50b027 --- /dev/null +++ b/DFL_BOM_WL_TOERP/bin/win64/wsmp.dat @@ -0,0 +1 @@ +xsd__string = | std::wstring | wchar_t* \ No newline at end of file diff --git a/DFL_BOM_WL_TOERP/createProcessTmp.cpp b/DFL_BOM_WL_TOERP/createProcessTmp.cpp new file mode 100644 index 0000000..8bafe17 --- /dev/null +++ b/DFL_BOM_WL_TOERP/createProcessTmp.cpp @@ -0,0 +1,673 @@ +////#include "dfl_custom.h" +////#include +////#include +////#include +////#include +////#include "ado.h" +////#include +////#include +////#include "rapidjson/document.h" +////#include +////#include "rapidjson/writer.h" +////#include +////#include +////#include +////#include "ocilib.h" +////#include +////#include +////#include +////#include +////#include +////#include +////#include +////#include +////#include +////using namespace std; +//// +////typedef struct { +//// string cpxh;//Ʒͺ ͡Сߡ +//// string dyxq; +//// string zyxq; +//// string gyxq; +//// string tyxq; +//// string wyxq; +////}ByqBean; +////typedef struct { +//// string rgsj;//Ʒͺ ͡Сߡ +//// string jqsj; +//// string zbsj; +//// string zrsczq; +////}TimeBean; +////typedef struct { +//// string temGxCode; +//// string temGxName; +//// +////}TemGxBean; +////string sqlRxfs = "select \"TarGXCODE\", \"TarGXNAME\", \"TemGXCODE\", \"TemGXNAME\" from \"CHINT_WORKHOUR_WhGXName\" where \"WindStyle\" = '%s'"; +////string sqlGyRule = "select GYID from \"CHINT_WORKHOUR_WhGYRule\" where \"ProductZu\" = '%s' and \"TuHao\" = '%s'"; +////string sqlCpxh = "SELECT \"ProductZu\" FROM \"CHINT_WORKHOUR_WhProductXH\" where \"ProductXH\" = '%s'"; +////string sqlGxTime = "select GXCODE,ARTIFICIALTIME,MACHINETIME,READINESSTIME,\"ProCycle\" from CHINT_WORKHOUR where \"PRODUCTXH\" = '%s' and GYID = '%s'"; +////void save_representation(tag_t primaryTag, tag_t secondTag, char* relationType) +////{ +//// tag_t typeTag = NULLTAG; +//// ITKCALL(GRM_find_relation_type(relationType, &typeTag)); +//// +//// ITKCALL(AOM_refresh(primaryTag, TRUE)); +//// ITKCALL(AOM_refresh(secondTag, TRUE)); +//// tag_t relationTag = NULLTAG; +//// ITKCALL(GRM_create_relation(primaryTag, secondTag, typeTag, NULLTAG, &relationTag));//ϵѾڣôӶ +//// +//// ITKCALL(GRM_save_relation(relationTag));//ܱҪ +//// ITKCALL(AOM_save(primaryTag)); +//// ITKCALL(AOM_save(secondTag)); +//// ITKCALL(AOM_refresh(primaryTag, FALSE)); +//// ITKCALL(AOM_refresh(secondTag, FALSE)); +////} +////void updateTemGxCode(tag_t processTag, map temGxMap) { +//// int bvr_count = 0; +//// tag_t ebom_window = NULLTAG; +//// tag_t bom_line = NULLTAG; +//// tag_t item_tag = NULLTAG, * c_line_tags; +//// (BOM_create_window(&ebom_window)); +//// tag_t* bvr_list = NULL; +//// (ITEM_rev_list_bom_view_revs(processTag, &bvr_count, &bvr_list)); +//// printf("bvr_count=%d", bvr_count); +//// +//// (BOM_set_window_top_line_bvr(ebom_window, bvr_list[0], &bom_line)); //bomȡ +//// //bom_line +//// int c_line_count; +//// ITKCALL(BOM_line_ask_all_child_lines(bom_line, &c_line_count, &c_line_tags)); // һ +//// for (int i = 0; i < c_line_count; i++) { +//// tag_t oneGxLine = c_line_tags[i], * towGxLines,oneGx, gxItem; +//// char* gxbm1; +//// AOM_ask_value_string(oneGxLine, "bl_ZT2_FirstOPRevision_zt2_ClassificationCode", &gxbm1); +//// +//// printf("gxbm1===>%s\n", gxbm1); +//// if (temGxMap.count(gxbm1) > 0) { +//// char* oldName; +//// TemGxBean temGxBean = temGxMap[gxbm1]; +//// AOM_lock(oneGxLine); +//// AOM_set_value_string(oneGxLine, "bl_ZT2_FirstOPRevision_zt2_ClassificationCode", temGxBean.temGxCode.c_str()); +//// AOM_save(oneGxLine); +//// AOM_unlock(oneGxLine); +//// ITKCALL(AOM_ask_value_tag(oneGxLine, "bl_line_object", &oneGx)); +//// ITKCALL(ITEM_ask_item_of_rev(oneGx, &gxItem)); +//// ITKCALL(AOM_lock(gxItem)); +//// ITKCALL(AOM_ask_value_string(gxItem, "object_name", &oldName)); +//// ITKCALL(AOM_set_value_string(gxItem, "object_name", temGxBean.temGxName.c_str())); +//// ITKCALL(AOM_save(gxItem)); +//// ITKCALL(AOM_unlock(gxItem)); +//// ITKCALL(AOM_lock(oneGx)); +//// ITKCALL(AOM_set_value_string(oneGx, "object_name", temGxBean.temGxName.c_str())); +//// ITKCALL(AOM_save(oneGx)); +//// ITKCALL(AOM_unlock(oneGx)); +//// printf("oldName===>%s\n", oldName); +//// printf("temGxName===>%s\n", temGxBean.temGxName.c_str()); +//// printf("temGxCode===>%s\n", temGxBean.temGxCode.c_str()); +//// } +//// +//// int c_cnt = 0; +//// BOM_line_ask_all_child_lines(oneGxLine, &c_cnt, &towGxLines); +//// for (int j = 0; j < c_cnt; j++) { +//// tag_t towGxLine = towGxLines[j]; +//// tag_t towGx, gxItem2; +//// char* gxbm2; +//// ITKCALL(AOM_ask_value_string(towGxLine, "bl_ZT2_FirstOPRevision_zt2_ClassificationCode", &gxbm2)); +//// +//// printf("gxbm2===>%s\n", gxbm2); +//// if (temGxMap.count(gxbm2) > 0) { +//// TemGxBean temGxBean = temGxMap[gxbm2]; +//// AOM_lock(towGxLine); +//// ITKCALL(AOM_set_value_string(towGxLine, "bl_ZT2_FirstOPRevision_zt2_ClassificationCode", temGxBean.temGxCode.c_str())); +//// AOM_save(towGxLine); +//// AOM_unlock(towGxLine); +//// char* oldName,* oldName2; +//// ITKCALL(AOM_ask_value_tag(towGxLine, "bl_line_object", &towGx)); +//// ITKCALL(ITEM_ask_item_of_rev(towGx, &gxItem2)); +//// ITKCALL(AOM_lock(gxItem2)); +//// ITKCALL(AOM_ask_value_string(gxItem2, "object_name", &oldName)); +//// ITKCALL(AOM_set_value_string(gxItem2, "object_name", temGxBean.temGxName.c_str())); +//// ITKCALL(AOM_save(gxItem2)); +//// ITKCALL(AOM_unlock(gxItem2)); +//// ITKCALL(AOM_ask_value_string(gxItem2, "object_name", &oldName2)); +//// printf("oldName===>%s\n", oldName); +//// printf("oldName2===>%s\n", oldName2); +//// printf("temGxName===>%s\n", temGxBean.temGxName.c_str()); +//// printf("temGxCode===>%s\n", temGxBean.temGxCode.c_str()); +//// ITKCALL(AOM_lock(towGx)); +//// ITKCALL(AOM_set_value_string(towGx, "object_name", temGxBean.temGxName.c_str())); +//// ITKCALL(AOM_save(towGx)); +//// ITKCALL(AOM_unlock(towGx)); +//// +//// } +//// +//// } +//// } +//// BOM_close_window(ebom_window); +////} +////void getGxbmMap(tag_t processTag, map& gxDocMap, map timebeans) { +//// int bvr_count = 0; +//// tag_t ebom_window = NULLTAG; +//// tag_t bom_line = NULLTAG; +//// tag_t item_tag = NULLTAG, * c_line_tags; +//// (BOM_create_window(&ebom_window)); +//// tag_t* bvr_list = NULL; +//// (ITEM_rev_list_bom_view_revs(processTag, &bvr_count, &bvr_list)); +//// printf("bvr_count=%d", bvr_count); +//// +//// (BOM_set_window_top_line_bvr(ebom_window, bvr_list[0], &bom_line)); //bomȡ +//// //bom_line +//// int c_line_count; +//// ITKCALL(BOM_line_ask_all_child_lines(bom_line, &c_line_count, &c_line_tags)); // һ +//// +//// for (int i = 0; i < c_line_count; i++) { +//// tag_t oneGx = c_line_tags[i], * towGxLines; +//// char* gxbm1; +//// AOM_ask_value_string(oneGx,"bl_ZT2_FirstOPRevision_zt2_ClassificationCode", &gxbm1); +//// if (timebeans.count(gxbm1) > 0) { +//// AOM_lock(oneGx); +//// TimeBean tbean = timebeans[gxbm1]; +//// ITKCALL(AOM_set_value_string(oneGx, "bl_ZT2_FirstOPRevision_zt2_ArtificialTime", tbean.rgsj.c_str())); +//// ITKCALL(AOM_set_value_string(oneGx, "bl_ZT2_FirstOPRevision_zt2_MachineTime", tbean.jqsj.c_str())); +//// ITKCALL(AOM_set_value_string(oneGx, "bl_ZT2_FirstOPRevision_zt2_ReadinessTime", tbean.zbsj.c_str())); +//// ITKCALL(AOM_set_value_string(oneGx, "bl_ZT2_FirstOPRevision_zt2_ProductionCycle", tbean.zrsczq.c_str())); +//// AOM_save(oneGx); +//// AOM_unlock(oneGx); +//// } +//// int c_cnt = 0; +//// BOM_line_ask_all_child_lines(oneGx, &c_cnt, &towGxLines); +//// for (int j = 0; j < c_cnt; j++) { +//// tag_t towGxLine = towGxLines[j]; +//// tag_t towGx; +//// char* gxbm2; +//// ITKCALL(AOM_ask_value_string(towGxLine, "bl_ZT2_FirstOPRevision_zt2_ClassificationCode", &gxbm2)); +//// if (timebeans.count(gxbm2) > 0) { +//// AOM_lock(towGxLine); +//// TimeBean tbean = timebeans[gxbm2]; +//// printf("ʱ====>%s\n", tbean.jqsj.c_str()); +//// ITKCALL(AOM_set_value_string(towGxLine, "bl_ZT2_FirstOPRevision_zt2_ArtificialTime", tbean.rgsj.c_str())); +//// ITKCALL(AOM_set_value_string(towGxLine, "bl_ZT2_FirstOPRevision_zt2_MachineTime", tbean.jqsj.c_str())); +//// ITKCALL(AOM_set_value_string(towGxLine, "bl_ZT2_FirstOPRevision_zt2_ReadinessTime", tbean.zbsj.c_str())); +//// ITKCALL(AOM_set_value_string(towGxLine, "bl_ZT2_FirstOPRevision_zt2_ProductionCycle", tbean.zrsczq.c_str())); +//// AOM_save(towGxLine); +//// AOM_unlock(towGxLine); +//// } +//// ITKCALL(AOM_ask_value_tag(towGxLine, "bl_line_object", &towGx)); +//// gxDocMap[gxbm2] = towGx; +//// } +//// } +//// BOM_close_window(ebom_window); +////} +////tag_t clone_process_from_template(char* process_item_id,boolean isXq,string productZu, string xqfs) +////{ +//// tag_t item_tag = NULLTAG; +//// ITKCALL(ITEM_find_item(process_item_id, &item_tag)); +//// if (item_tag == NULLTAG) +//// { +//// printf("\n MEProcess NOT found! \n"); +//// return NULLTAG; +//// } +//// tag_t revision_tag = NULLTAG; +//// ITKCALL(ITEM_ask_latest_rev(item_tag, &revision_tag)); +//// char* nameOld,* item_revision_id; +//// AOM_ask_value_string(revision_tag, "item_revision_id", &item_revision_id); +//// AOM_ask_value_string(revision_tag,"object_name",&nameOld); +//// MEBOM_init_module(); +//// +//// tag_t window_tag = NULLTAG; +//// ITKCALL(ME_create_bop_window(&window_tag)); +//// +//// tag_t rule_tag = NULLTAG; +//// ITKCALL(CFM_find("Latest Working", &rule_tag)); +//// +//// ITKCALL(BOM_set_window_config_rule(window_tag, rule_tag)); +//// //AOM_ask +//// char* next_id = NULL; +//// ITKCALL(NR_next_value("MEProcess", "item_id", NULLTAG, "", "", "", +//// NULLTAG, "", "", &next_id)); +//// +//// tag_t clone_tag = NULLTAG; +//// ITKCALL(ME_create_process_from_template(next_id, item_revision_id, +//// nameOld, "", revision_tag, rule_tag, window_tag, +//// "Process.Template.Mapping_Consumes", &clone_tag)); +//// +//// if (next_id) MEM_free(next_id); +//// +//// ITKCALL(AOM_refresh(clone_tag, TRUE)); +//// ITKCALL(AOM_save(clone_tag)); +//// ITKCALL(AOM_refresh(clone_tag, FALSE)); +//// +//// char* item_id = NULL; +//// ITKCALL(WSOM_ask_id_string(clone_tag, &item_id)); +//// +//// printf("\n\t MEProcess Clone ID: %s\n", item_id); +//// ITKCALL(AOM_unload(clone_tag)); +//// +//// if (item_id != NULL) +//// MEM_free(item_id); +//// +//// //ơ򡱡ҵָ顱 +//// +//// if (isXq) { +//// char selectRxfs[200]; +//// sprintf(selectRxfs, sqlRxfs.c_str(), xqfs.c_str()); +//// int outputColumn1 = 0, outputValueCount1 = 0; +//// char*** outputValue1 = NULL; +//// printf("search3 ===> %s\n", selectRxfs); +//// QuerySQLNoInputParam(selectRxfs, &outputColumn1, &outputValueCount1, &outputValue1); +//// map temGxMap; +//// printf("search result ===> %d\n", outputValueCount1); +//// for (int num = 0; num < outputValueCount1; num++) { +//// //TarGXCODE\", \"TarGXNAME\", \"TemGXCODE\", \"TemGXNAME +//// string tarGxCode = outputValue1[num][0]; +//// string tarGxName = outputValue1[num][1]; +//// string temGxCode = outputValue1[num][2]; +//// TemGxBean bean; +//// bean.temGxCode = tarGxCode; +//// bean.temGxName = tarGxName; +//// temGxMap[temGxCode] = bean; +//// } +//// // +//// updateTemGxCode(clone_tag, temGxMap); +//// } +//// //if (!isXq) { +//// map tmpProcessMap; +//// //vector timeVec; +//// //ģ +//// map beanMap; +//// getGxbmMap(revision_tag, tmpProcessMap, beanMap); +//// map newProcessMap; +//// char selectGyId[200]; +//// sprintf(selectGyId, sqlGxTime.c_str(), productZu.c_str(), process_item_id); +//// int outputColumn1 = 0, outputValueCount1 = 0; +//// char*** outputValue1 = NULL; +//// string gyId; +//// printf("search3 ===> %s\n", selectGyId); +//// +//// QuerySQLNoInputParam(selectGyId, &outputColumn1, &outputValueCount1, &outputValue1); +//// for (int num = 0; num < outputValueCount1; num++) { +//// string gxbm = outputValue1[num][0]; +//// string rgsj = outputValue1[num][1]; +//// string jqsj = outputValue1[num][2]; +//// if (jqsj.find_first_of(".") != std::string::npos) { +//// string a = "0"; +//// jqsj = a.append(jqsj); +//// } +//// string zbsj = outputValue1[num][3]; +//// string zrsczq = outputValue1[num][4]; +//// TimeBean bean; +//// bean.rgsj = rgsj; +//// bean.jqsj = jqsj; +//// bean.zbsj = zbsj; +//// bean.zrsczq = zrsczq; +//// beanMap[gxbm] = bean; +//// } +//// //¡Ĺ· +//// getGxbmMap(clone_tag, newProcessMap, beanMap); +//// map::iterator it; +//// for (it = tmpProcessMap.begin(); it != tmpProcessMap.end(); it++) { +//// string gxbm = it->first; +//// tag_t tmpGx = it->second; +//// if (newProcessMap.count(gxbm) != 0) { +//// tag_t* procGuidBooks, * processRules; +//// int cnt2 = 0, cnt3 = 0; +//// tag_t newGx = newProcessMap[gxbm]; +//// ITKCALL(AOM_ask_value_tags(tmpGx, "ZT2_ProcGuidBookRelation", &cnt2, &procGuidBooks)); +//// ITKCALL(AOM_ask_value_tags(tmpGx, "ZT2_ProcessRuleRelation", &cnt3, &processRules)); +//// AOM_lock(newGx); +//// if (cnt2 > 0) { +//// ITKCALL(AOM_set_value_tags(newGx, "ZT2_ProcGuidBookRelation", cnt2, procGuidBooks)); +//// } +//// if (cnt3 > 0) { +//// ITKCALL(AOM_set_value_tags(newGx, "ZT2_ProcessRuleRelation", cnt3, processRules)); +//// } +//// AOM_save(newGx); +//// AOM_unlock(newGx); +//// } +//// } +//// //} +//// return clone_tag; +////} +//////ʵBOM +////boolean isXn(tag_t matnr) { +//// int cnt2, numFac, cnt3; +//// boolean flag = false; +//// char** procureType, ** factorys, ** specialProcureType; +//// AOM_ask_value_strings(matnr, "zt2_SZSpecialProcuretype", &cnt3, &specialProcureType); //Ϊ/ +//// AOM_ask_value_strings(matnr, "zt2_SZProcuretype", &cnt2, &procureType); // +//// AOM_ask_value_strings(matnr, "zt2_SZFactory", &numFac, &factorys); +//// for (int i = 0; i < numFac; i++) { +//// if (strcmp(factorys[i], "M060") == 0 && cnt2 > i && cnt3 > i) { +//// if (strstr(procureType[i], "") != NULL && strcmp(specialProcureType[i], "/") == 0) { +//// flag = true; +//// } +//// } +//// } +//// return flag; +////} +//////ȡ жǷ +////string getClassVal(tag_t top_rev_tag, string& errMessage,ByqBean &bean) { +//// //, string className +//// tag_t top_classificationObject; +//// ICS_ask_classification_object(top_rev_tag, &top_classificationObject); +//// if (top_classificationObject == NULL_TAG) +//// { +//// printf("ûз͵\n"); +//// return ""; +//// } +//// char* top_class_id = NULL, * top_class_name = NULL; +//// //ICS_ask_class_of_classification_obj(top_classificationObject, &top_class_tag); +//// //ICS_ask_id_name(top_class_tag, &top_class_id, &top_class_name); +//// printf("BOM TOP LINE CLASS ID = %s | NAME = %s \n", top_class_id, top_class_name); +//// int n_attrs; +//// char** attr_names; +//// char** attr_vals; +//// ITKCALL(ICS_ask_attributes_of_classification_obj(top_classificationObject, &n_attrs, &attr_names, &attr_vals)); +//// cout << n_attrs << endl; +//// // int num = 1; +//// string cpxh; +//// for (int ii = 0; ii < n_attrs; ii++) +//// { +//// if (strcmp(attr_names[ii], "Ʒͺ") == 0) { +//// if (strcmp(attr_vals[ii], "") == 0) { +//// errMessage.append("ԲƷͺΪգ顣\n"); +//// return ""; +//// } +//// else { +//// cpxh = (attr_vals[ii]); +//// } +//// //break; +//// }else if (strcmp(attr_names[ii], "ѹȦ߷ʽ") == 0) { +//// if (strcmp(attr_vals[ii], "") == 0) { +//// errMessage.append("ԵѹȦ߷ʽΪգ顣\n"); +//// return ""; +//// } +//// else { +//// bean.dyxq = attr_vals[ii];//cpxh = (attr_vals[ii]); +//// } +//// //break; +//// } +//// else if (strcmp(attr_names[ii], "ѹȦ߷ʽ") == 0) { +//// if (strcmp(attr_vals[ii], "") == 0) { +//// errMessage.append("ѹȦ߷ʽΪգ顣\n"); +//// return ""; +//// } +//// else { +//// bean.zyxq = attr_vals[ii];//cpxh = (attr_vals[ii]); +//// } +//// //break; +//// } +//// else if (strcmp(attr_names[ii], "ѹȦ߷ʽ") == 0) { +//// if (strcmp(attr_vals[ii], "") == 0) { +//// errMessage.append("ԸѹȦ߷ʽΪգ顣\n"); +//// return ""; +//// } +//// else { +//// bean.gyxq = attr_vals[ii];//cpxh = (attr_vals[ii]); +//// } +//// //break; +//// } +//// else if (strcmp(attr_names[ii], "ѹȦ߷ʽ") == 0) { +//// if (strcmp(attr_vals[ii], "") == 0) { +//// errMessage.append("ԵѹȦ߷ʽΪգ顣\n"); +//// return ""; +//// } +//// else { +//// bean.tyxq = attr_vals[ii];//cpxh = (attr_vals[ii]); +//// } +//// //break; +//// } +//// else if (strcmp(attr_names[ii], "ѹȦ߷ʽ") == 0) { +//// if (strcmp(attr_vals[ii], "") == 0) { +//// errMessage.append("ѹȦ߷ʽΪգ顣\n"); +//// return ""; +//// } +//// else { +//// bean.wyxq = attr_vals[ii];//cpxh = (attr_vals[ii]); +//// } +//// //break; +//// } +//// // +//// cout << attr_names[ii] << "\t" +//// << attr_vals[ii] << endl; +//// } +//// return cpxh; +////} +//////Ȧ +//// +//////Ȧ +////void Split2(string strArg, string spliter, vector& ans) +////{ +//// ans.clear(); +//// size_t index0 = 0; +//// string one_arg; +//// if (strArg.find_first_not_of(' ') == string::npos) +//// strArg = ""; +//// while (strArg.size() > 0) +//// { +//// index0 = strArg.find_first_of(spliter); +//// if (index0 != string::npos) +//// { +//// one_arg = strArg.substr(0, index0); +//// strArg = strArg.substr(index0 + 1); +//// ans.push_back(one_arg); +//// } +//// else +//// { +//// ans.push_back(strArg); +//// break; +//// } +//// } +////} +////tag_t getTmpProcess(string cpxh, string th, string& errBuff, string& oldGyId,boolean isXq, string xqfs) { +//// char selectCPZ[200], selectGyId[200]; +//// sprintf(selectCPZ, sqlCpxh.c_str(), cpxh.c_str()); +//// int outputColumn = 0, outputValueCount = 0; +//// char*** outputValue = NULL; +//// string productZu; +//// printf("search1\n"); +//// QuerySQLNoInputParam(selectCPZ, &outputColumn, &outputValueCount, &outputValue); +//// printf("search11\n"); +//// if (outputValueCount == 0) { +//// errBuff.append("ǰѹƷͺݿ޶ӦͲƷֵϵԱά.\n"); +//// return NULLTAG; +//// } +//// for (int j = 0; j < outputValueCount; j++) { +//// productZu = outputValue[j][0]; +//// printf("productZu===>%s\n", productZu.c_str()); +//// } +//// +//// sprintf(selectGyId, sqlGyRule.c_str(), productZu.c_str(), th.c_str()); +//// +//// int outputColumn1 = 0, outputValueCount1 = 0; +//// char*** outputValue1 = NULL; +//// string gyId; +//// printf("search2 %s \n", selectGyId); +//// QuerySQLNoInputParam(selectGyId, &outputColumn1, &outputValueCount1, &outputValue1); +//// if (outputValueCount1 == 0) { +//// errBuff.append("ͼ:").append(th).append("޶ӦģID,άָɹ·.\n"); +//// return NULLTAG; +//// } +//// printf("search22\n"); +//// for (int j = 0; j < outputValueCount1; j++) { +//// gyId = outputValue1[j][0]; +//// printf("gyId===>%s\n", gyId.c_str()); +//// } +//// oldGyId = gyId; +//// tag_t clone_tag = clone_process_from_template((char*)gyId.c_str(), isXq, productZu, xqfs); +//// printf("¡===>\n"); +//// return clone_tag; +////} +//// +////void readProcessBom(tag_t bom_line, string& errorBuff) { +//// +//// int c_line_count; +//// tag_t mantr, * c_line_tags; +//// ITKCALL(AOM_ask_value_tag(bom_line, "bl_line_object", &mantr)); +//// ITKCALL(BOM_line_ask_all_child_lines(bom_line, &c_line_count, &c_line_tags)); +//// if (c_line_count > 0 && isXn(mantr)) { +//// printf("ʵ\n"); +//// //Ƿй· +//// int n_references = 0; +//// int* levels = 0; +//// tag_t* references_tag = NULLTAG; +//// char** relation_type_name = NULL; +//// //ͨùϵҵ +//// ITKCALL(WSOM_where_referenced(mantr, 1, &n_references, &levels, &references_tag, &relation_type_name)); +//// boolean hasProcess = false; +//// for (int i = 0; i < n_references; i++) +//// { +//// char* refType; +//// tag_t refTag = references_tag[i]; +//// AOM_ask_value_string(refTag, "object_type", &refType); +//// if (strcmp(refType, "MEProcessRevision") == 0) { +//// hasProcess = true; +//// break; +//// } +//// } +//// if (!hasProcess) { +//// char* bl_desc,* objName; +//// AOM_ask_value_string(mantr, "object_name", &objName); +//// if (strstr(objName,"װͼ") != NULL) { +//// tag_t byqRev; +//// string tmpGyId; +//// AOM_ask_value_tag(mantr,"TC_Is_Represented_By",&byqRev); +//// ByqBean bean; +//// string cpxh = getClassVal(byqRev, errorBuff, bean); +//// printf("cpxh===>%s\n", cpxh.c_str()); +//// tag_t processTag = NULLTAG; +//// if (strstr(objName, "Ȧ") == NULL) { +//// processTag = getTmpProcess(cpxh, "1ZDB300000P", errorBuff, tmpGyId, false,""); +//// if (processTag != NULLTAG) { +//// save_representation(processTag, mantr, "IMAN_METarget"); +//// //Ȧ +//// } +//// } +//// } +//// else { +//// AOM_ask_value_string(bom_line, "bl_rev_object_desc", &bl_desc); +//// vector descVec1; +//// Split2(bl_desc, " ", descVec1); +//// if (descVec1.size() > 1) { +//// string drawNos = descVec1[1]; +//// vector drawNoVec1; +//// Split2(drawNos, "-", drawNoVec1); +//// if (drawNoVec1.size() > 1) { +//// string wordNo = drawNoVec1[1]; //̺ ƴ1ZDB300000P ҷ +//// string drawNo = drawNoVec1[0]; //ͼ +//// /*vector vec2; +//// Split2(drawNo,"_", vec2); +//// if (vec2.size() > 1) { +//// drawNo = vec2[0]; +//// }*/ +//// string byqId = "1ZDB300000P-", tmpGyId; +//// tag_t byqTag, byqRev; +//// byqId.append(wordNo); +//// ITKCALL(ITEM_find_item(byqId.c_str(), &byqTag)); +//// ITKCALL(ITEM_ask_latest_rev(byqTag, &byqRev)); +//// ByqBean bean; +//// string cpxh = getClassVal(byqRev, errorBuff,bean); +//// printf("cpxh===>%s\n", cpxh.c_str()); +//// tag_t processTag = NULLTAG; +//// if (strstr(objName, "Ȧ") == NULL) { +//// processTag = getTmpProcess(cpxh, drawNo, errorBuff, tmpGyId, false, ""); +//// if (processTag != NULLTAG) { +//// save_representation(processTag, mantr, "IMAN_METarget"); +//// } +//// } +//// else { +//// string xqfs; +//// if (strstr(objName, "ѹȦ")!=NULL) { +//// //ǰXXXȦδڱѹά߷ʽԣǰά +//// if (bean.dyxq.empty()) { +//// errorBuff.append("ǰѹȦδڱѹά߷ʽԣǰά\n"); +//// return; +//// } +//// xqfs = bean.dyxq; +//// }else if(strstr(objName, "ѹȦ") != NULL) { +//// //ǰXXXȦδڱѹά߷ʽԣǰά +//// if (bean.zyxq.empty()) { +//// errorBuff.append("ǰѹȦδڱѹά߷ʽԣǰά\n"); +//// return; +//// } +//// xqfs = bean.zyxq; +//// } +//// else if (strstr(objName, "ѹȦ") != NULL) { +//// //ǰXXXȦδڱѹά߷ʽԣǰά +//// if (bean.gyxq.empty()) { +//// errorBuff.append("ǰѹȦδڱѹά߷ʽԣǰά\n"); +//// return; +//// } +//// xqfs = bean.gyxq; +//// } +//// else if (strstr(objName, "ѹȦ") != NULL) { +//// //ǰXXXȦδڱѹά߷ʽԣǰά +//// if (bean.tyxq.empty()) { +//// errorBuff.append("ǰѹȦδڱѹά߷ʽԣǰά\n"); +//// return; +//// } +//// xqfs = bean.tyxq; +//// } +//// else if (strstr(objName, "ѹȦ") != NULL) { +//// //ǰXXXȦδڱѹά߷ʽԣǰά +//// if (bean.wyxq.empty()) { +//// errorBuff.append("ǰѹȦδڱѹά߷ʽԣǰά\n"); +//// return; +//// } +//// xqfs = bean.wyxq; +//// } +//// processTag = getTmpProcess(cpxh, drawNo, errorBuff, tmpGyId, true, xqfs); +//// if (processTag != NULLTAG) { +//// save_representation(processTag, mantr, "IMAN_METarget"); +//// } +//// } +//// } +//// } +//// } +//// } +//// } +//// for (int i = 0; i < c_line_count; i++) { +//// tag_t c_line_tag = c_line_tags[i]; +//// readProcessBom(c_line_tag, errorBuff); +//// } +////} +//// +////void cloneProcess(char * revUid) { +//// +//// int ifail = ITK_ok; +//// char* sql = NULL; +//// tag_t designRev; +//// //ITKCALL(ifail = USERARG_get_string_argument(&revUid)); +//// ITK__convert_uid_to_tag(revUid, &designRev); +//// int bvr_count = 0, c_line_count; +//// tag_t ebom_window = NULLTAG; +//// tag_t bom_line = NULLTAG; +//// tag_t item_tag = NULLTAG, * c_line_tags; +//// (BOM_create_window(&ebom_window)); +//// tag_t* bvr_list = NULL; +//// (ITEM_rev_list_bom_view_revs(designRev, &bvr_count, &bvr_list)); +//// printf("bvr_count=%d", bvr_count); +//// +//// (BOM_set_window_top_line_bvr(ebom_window, bvr_list[0], &bom_line)); //bomȡ +//// +//// int url_num = 0; +//// char** url_vals = NULL; +//// PREF_ask_char_values("database_tc", &url_num, &url_vals); +//// string url = url_vals[0]; +//// url.append("/").append(url_vals[2]); +//// string errorBuff; +//// //map %s \n", url.c_str()); +//// if (ConnServer(url_vals[3], url_vals[4], (char*)url.c_str()) == -1) +//// { +//// printf("ʾ:мݱʧ\n"); +//// ifail = 1; +//// } +//// +//// readProcessBom(bom_line, errorBuff); +//// DisConnServer(); +//// +//// printf("errorBuff==>%s\n", errorBuff.c_str()); +//// BOM_close_window(ebom_window); +//// +////} \ No newline at end of file diff --git a/DFL_BOM_WL_TOERP/dfl_custom.h b/DFL_BOM_WL_TOERP/dfl_custom.h new file mode 100644 index 0000000..48b8143 --- /dev/null +++ b/DFL_BOM_WL_TOERP/dfl_custom.h @@ -0,0 +1,70 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#define EPM_HANDLER_COMMON +#include +using namespace std; + + + +#define ERROR_QRY_NOT_FOUND (EMH_USER_error_base + 120) + +int readBomMsg(vector uidList,char * groupName,char* groupUid, char*code, char*userName); +void Split(string strArg, string spliter, vector& ans); + +typedef struct { + string ID; +}DFL_ID; + + +struct FLOW +{ + string timeinfo; + string userid; + string type; + +}; + +struct WL_ITEM +{ + string item_id; + string item_name; + string item_spec; + string item_groupCode; + string item_unit; + string item_sourceCode; + string item_brand; + string item_rev; + string oldMateriel; + string item_uid; + tag_t item_tag; + string item_type; +}; +struct WL_ZJ +{ + string zi_id; + string last_mod_date; + string yonglian; + string work_id; + string chajian_id; + string beizhu_re; + string plmkey; +}; +struct WL_BOM +{ + string fu_id; + string fu_uid; + vector zjs; +}; + + + diff --git a/DFL_BOM_WL_TOERP/libmysql.dll b/DFL_BOM_WL_TOERP/libmysql.dll new file mode 100644 index 0000000..f697f00 Binary files /dev/null and b/DFL_BOM_WL_TOERP/libmysql.dll differ diff --git a/DFL_BOM_WL_TOERP/ocilib.cpp b/DFL_BOM_WL_TOERP/ocilib.cpp new file mode 100644 index 0000000..0282201 --- /dev/null +++ b/DFL_BOM_WL_TOERP/ocilib.cpp @@ -0,0 +1,507 @@ +/*===================================================================================================================== + Copyright(c) 2012 ORIGIN. + Unpublished - All rights reserved +======================================================================================================================= +File description: + + Filename: ocilib.cxx + Module : OCI + + This file describes OCI library Package. + +======================================================================================================================= +Date Name Description of Change +1-Feb-2015 Ray li Initialize creation +$HISTORY$ +=====================================================================================================================*/ +#include "ocilib.h" +#include +#include + +#define NUM 100 +#define USERNAME "MES" +#define PASSWORD "infodba" +#define DBNAME "TCPORD" + + +// ṹ +typedef struct { + OCIEnv* p_env; //OCI environment handle + OCIError* p_err; //OCI error handle + OCISvcCtx* p_svc; //OCI service context handel ľ + OCIServer* p_ser; //OCI server handle + OCISession* p_usr; //OCI user session handle ûỰ + OCIStmt* p_sql; //OCI statement handle + OCIDefine* p_dfn; //OCI define handle + OCIBind* p_bnd; //OCI bind handle 󶨾 +}OCIHandleInfo; + + +// ṹ +typedef struct { + OCIEnv* p_env; + OCIError* p_err; + OCISvcCtx* p_svc; + OCIStmt* p_sql; + OCIDefine* p_dfn; + OCIBind* p_bnd; +}OCIDATA; + + +// ִʱ +typedef struct { + char value[NUM][NUM]; + char type[NUM][NUM]; +}SqlField; + + +// ѯʱ, +typedef struct { + int naIntValue[NUM]; + int nIntNum; + char caCharValue[500][500]; + int nCharNum; +}SqlSelField; + +OCIHandleInfo* ociHandle = NULL; +OCIHandleInfo ociHand; + +int InitHandle(); +int _ExeSQL(char* SQL, char** inputValue, int inputValueCount); +int _QuerySQL(char* SQL, SqlSelField* pOutField, SqlSelField* pSelField); +int GetDataFromQuery(int* pRc, SqlSelField* pOutField); +void QuitFreeHandle(); + + + + +/**************************************************************************************************************************************** +ƣ +ܣ +ڲ +ڲ + ע +*****************************************************************************************************************************************/ + + +// ʼHandler +int InitHandle() +{ + int swResult; + + ociHandle = &ociHand; + + + /*create OCI environment*/ + if (swResult = OCIEnvCreate(&ociHandle->p_env, OCI_DEFAULT, NULL, NULL, NULL, NULL, 0, NULL)) // + { + printf("environment create error!\n\n"); + return -1; + } + else + { + printf("environment create success!\n\n"); + //return 0; + } + + /*init handle*/ + if (swResult = OCIHandleAlloc(ociHandle->p_env, (dvoid**)&ociHandle->p_ser, OCI_HTYPE_SERVER, 0, NULL)) // + { + printf("init server handle error!\n\n"); + return -1; + } + + + if (swResult = OCIHandleAlloc(ociHandle->p_env, (dvoid**)&ociHandle->p_err, OCI_HTYPE_ERROR, 0, NULL)) // + { + printf("init error handle error!\n\n"); + return -1; + } + + + if (swResult = OCIHandleAlloc(ociHandle->p_env, (dvoid**)&ociHandle->p_usr, OCI_HTYPE_SESSION, 0, NULL)) // + { + printf("init session handle error!\n\n"); + return -1; + } + + + if (swResult = OCIHandleAlloc(ociHandle->p_env, (dvoid**)&ociHandle->p_svc, OCI_HTYPE_SVCCTX, 0, NULL)) //ľ + { + printf("init service context handle error!\n\n"); + return -1; + } + + + if (swResult = OCIHandleAlloc(ociHandle->p_env, (dvoid**)&ociHandle->p_sql, OCI_HTYPE_STMT, 0, NULL)) //SQL + { + printf("init statement handle error!\n\n"); + return -1; + } + + printf("init handle success!\n\n"); + + return 0; +} + + + +// ݿ +int ConnServer(char* username, char* password, char* dbname) +{ + int swResult; + char errbuf[100] = { 0 }; + int errcode; + + if (InitHandle() == -1)//ʼ + return -1; + + if (swResult = OCILogon(ociHandle->p_env, ociHandle->p_err, &ociHandle->p_svc, (text*)username, strlen(username), (text*)password, strlen(password), (text*)dbname, strlen(dbname))) + { + OCIErrorGet((dvoid*)ociHandle->p_err, (ub4)1, (text*)NULL, &errcode, (ub1*)errbuf, (ub4)sizeof(errbuf), OCI_HTYPE_ERROR); + printf("Error - %.*s/n", 512, errbuf); + return -1; + } + else + printf("ݿӳɹ!\n\n"); + return 0; +} + + + +// SQLij(ִSQL) +int _ExeSQL(char* SQL, char** inputValue, int inputValueCount) +{ + int swResult, i; + int errcode; + + //ð󶨱 + OCIBind* p_bndp[100]; + + //׼SQL + if (swResult = OCIStmtPrepare(ociHandle->p_sql, ociHandle->p_err, (text*)SQL, strlen(SQL), OCI_NTV_SYNTAX, OCI_DEFAULT)) + { + printf("prepare SQL statements error!\n\n"); + } + else + { + printf("prepare SQL statements success!\n\n"); + } + + + // + for (i = 0; i < inputValueCount; i++) + { + char errbuf[100] = { 0 }; + if (swResult = OCIBindByPos(ociHandle->p_sql, &p_bndp[i], ociHandle->p_err, i + 1, (dvoid*)inputValue[i], (sb4)strlen(inputValue[i]) + 1, SQLT_STR, (dvoid*)0, (ub2*)0, (ub2*)0, (ub4)0, (ub4*)0, OCI_DEFAULT)) + { + OCIErrorGet((dvoid*)ociHandle->p_err, (ub4)1, (text*)NULL, &errcode, (ub1*)errbuf, (ub4)sizeof(errbuf), OCI_HTYPE_ERROR); + printf("Bind Error - %.*s/n", 512, errbuf); + return -1; + } + } + + //ִSQL statements + if (swResult = OCIStmtExecute(ociHandle->p_svc, ociHandle->p_sql, ociHandle->p_err, 1, 0, NULL, NULL, OCI_DEFAULT)) + { + char errbuf[100] = { 0 }; + OCIErrorGet((dvoid*)ociHandle->p_err, (ub4)1, (text*)NULL, &errcode, (ub1*)errbuf, (ub4)sizeof(errbuf), OCI_HTYPE_ERROR); + printf("execute SQL statement Error - %.*s\n", 512, errbuf); + return -1; + } + else + { + printf("execute SQL statement success!\n\n"); + } + return 0; +} + + + + +// ѯSQL +int _QuerySQL(char* SQL, SqlSelField* pOutField, SqlSelField* pSelField) +{ + sword status; + int rc = 0, ret = 0; + char errbuf[100] = { 0 }; + int maxNum = 2048; + char chTag[8]; + int iIndex = 0; + int outputColumn = 0; + int errcode = 0; + char nullValue = '\0'; // + sb2 sb2aInd[30] = { '\0' }; + + // ׼SQL + status = OCIStmtPrepare(ociHandle->p_sql, ociHandle->p_err, (text*)SQL, (ub4)strlen(SQL), (ub4)OCI_NTV_SYNTAX, (ub4)OCI_DEFAULT); + + if (status != OCI_SUCCESS) + { + printf("SQL Preparing failed/n"); + return -1; + } + + + // int͵, SQLʱ :1,:2, + for (iIndex = 0; iIndex < pSelField->nIntNum; iIndex++) + { + memset(chTag, 0, 8); + sprintf(chTag, ":%d", iIndex + 1); + if (rc = OCIBindByName(ociHandle->p_sql, (OCIBind**)&ociHandle->p_dfn, ociHandle->p_err, (text*)chTag, (sb4)strlen((char*)chTag), (dvoid*)&pSelField->naIntValue[iIndex], sizeof(int), SQLT_INT, (dvoid*)0, (ub2*)0, (ub2*)0, (ub4)0, (ub4*)0, OCI_DEFAULT)) + { + OCIErrorGet((dvoid*)ociHandle->p_err, (ub4)1, (text*)NULL, &errcode, (ub1*)errbuf, (ub4)sizeof(errbuf), OCI_HTYPE_ERROR); + printf("BindByPos Error of ociHandle->p_sql - %.*s\n", 512, errbuf); + return -1; + } + } + + // char *͵, SQLʱ :3,:4, + for (iIndex = 0; iIndex < pSelField->nCharNum; iIndex++) + { + int n = 0; + memset(chTag, 0, 8); + n = pSelField->nIntNum + iIndex + 1; + sprintf(chTag, ":%d", n); + if (rc = OCIBindByName(ociHandle->p_sql, (OCIBind**)&ociHandle->p_dfn, ociHandle->p_err, (text*)chTag, (sb4)strlen((char*)chTag), (dvoid*)&pSelField->caCharValue[iIndex], NUM, SQLT_STR, (dvoid*)0, (ub2*)0, (ub2*)0, (ub4)0, (ub4*)0, OCI_DEFAULT)) + { + OCIErrorGet((dvoid*)ociHandle->p_err, (ub4)1, (text*)NULL, &errcode, (ub1*)errbuf, (ub4)sizeof(errbuf), OCI_HTYPE_ERROR); + printf("BindByPos Error of ociHandle->p_sql - %.*s\n", 512, errbuf); + return -1; + } + } + + + // ִSQL + if (rc = OCIStmtExecute(ociHandle->p_svc, ociHandle->p_sql, ociHandle->p_err, (ub4)0, (ub4)0, (CONST OCISnapshot*) NULL, (OCISnapshot*)NULL, OCI_STMT_SCROLLABLE_READONLY)) + { + OCIErrorGet((dvoid*)ociHandle->p_err, (ub4)1, (text*)NULL, &errcode, (ub1*)errbuf, (ub4)sizeof(errbuf), OCI_HTYPE_ERROR); + printf("execute SQL Error - %.*s\n", 512, errbuf); + return -1; + } + else + { + printf("execute SQL success!\n\n"); + } + + + if (ret = OCIAttrGet(ociHandle->p_sql, (ub4)OCI_HTYPE_STMT, (dvoid*)&outputColumn, (ub4*)0, (ub4)OCI_ATTR_PARAM_COUNT, ociHandle->p_err)) + { + OCIErrorGet((dvoid*)ociHandle->p_err, (ub4)1, (text*)NULL, &errcode, (ub1*)errbuf, (ub4)sizeof(errbuf), OCI_HTYPE_ERROR); + printf("Get OCIAttr Error of ociHandle->p_sql - %.*s\n", 512, errbuf); + return -1; + } + + + // int͵, SQLʱ :1,:2, + for (iIndex = 0; iIndex < pOutField->nIntNum; iIndex++) + { + if (rc = OCIDefineByPos(ociHandle->p_sql, &ociHandle->p_dfn, ociHandle->p_err, iIndex + 1, (dvoid*)&pOutField->naIntValue[iIndex], sizeof(int), SQLT_INT, (dvoid*)0, (ub2*)0, (ub2*)0, OCI_DEFAULT)) + { + OCIErrorGet((dvoid*)ociHandle->p_err, (ub4)1, (text*)NULL, &errcode, (ub1*)errbuf, (ub4)sizeof(errbuf), OCI_HTYPE_ERROR); + printf("DefineByPos Error of ociHandle->p_sql - %.*s\n", 512, errbuf); + return -1; + } + } + + + // char *͵, SQLʱ :1,:2, + for (iIndex = 0; iIndex < outputColumn; iIndex++) + { + int n = iIndex + 1; + if (rc = OCIDefineByPos(ociHandle->p_sql, &ociHandle->p_dfn, ociHandle->p_err, n, (dvoid*)&pOutField->caCharValue[iIndex], 1000 * sizeof(char), SQLT_STR, (dvoid*)0, (ub2*)0, (ub2*)0, OCI_DEFAULT)) + { + OCIErrorGet((dvoid*)ociHandle->p_err, (ub4)1, (text*)NULL, &errcode, (ub1*)errbuf, (ub4)sizeof(errbuf), OCI_HTYPE_ERROR); + printf("DefineByPos Error of ociHandle->p_sql - %.*s\n", 512, errbuf); + return -1; + } + } + + return 0; + +} + + + +// ͷHandler +void QuitFreeHandle() +{ + // ˳ + OCILogoff(ociHandle->p_svc, ociHandle->p_err); + printf("Quit success!\n"); + + // ͷž + OCIHandleFree(ociHandle->p_ser, OCI_HTYPE_SERVER); //ͷŷ + OCIHandleFree(ociHandle->p_err, OCI_HTYPE_ERROR); //ͷŴ + OCIHandleFree(ociHandle->p_usr, OCI_HTYPE_SESSION); //ͷ + OCIHandleFree(ociHandle->p_svc, OCI_HTYPE_SVCCTX); //ͷľ + OCIHandleFree(ociHandle->p_sql, OCI_HTYPE_STMT); //ͷSQL +} + + +// ִ +int ExecuteSQL(char* SQL, int valueCount, char** value) +{ + int i = 0; + + if (i = _ExeSQL(SQL, value, valueCount)) + { + printf("1\n"); + QuitFreeHandle(); + return -1; + } + printf("2\n"); + return 0; +} + + +// IJѯ +int QuerySQL(char* SQL, int inputValueCount, char** inputValue, int* outputColumn, int* outputValueCount, char**** outputValue) +{ + int i = 0, j = 0, ret = 0; + + int times = 0, temp = 0; + SqlSelField infield; + SqlSelField outField; + + // ʼṹ + infield.nCharNum = inputValueCount; + infield.nIntNum = 0; + outField.nCharNum = 0; + outField.nIntNum = 0; + + *outputColumn = 0; + *outputValueCount = 0; + + for (i = 0; i < inputValueCount; i++) + { + strcpy(infield.caCharValue[i], inputValue[i]); + } + + // ִвѯ + + + if (ret = _QuerySQL(SQL, &outField, &infield)) + { + printf("SQLѯʧ!\n"); + QuitFreeHandle(); + return -1; + } + + // ȡ + ret = OCIAttrGet(ociHandle->p_sql, (ub4)OCI_HTYPE_STMT, (dvoid*)outputColumn, (ub4*)0, (ub4)OCI_ATTR_PARAM_COUNT, ociHandle->p_err); + + // ȡһ,ȥ + ret = OCIStmtFetch2(ociHandle->p_sql, ociHandle->p_err, 1, OCI_FETCH_LAST, 0, OCI_DEFAULT); + // ȡ + ret = OCIAttrGet(ociHandle->p_sql, (ub4)OCI_HTYPE_STMT, (dvoid*)outputValueCount, (ub4*)0, (ub4)OCI_ATTR_ROW_COUNT, ociHandle->p_err); + + if (*outputValueCount == 0) + return 0; + + + // ʼڴ沢Ҵ洢 + ret = OCIStmtFetch2(ociHandle->p_sql, ociHandle->p_err, 1, OCI_FETCH_FIRST, 0, OCI_DEFAULT); + *outputValue = (char***)calloc((*outputValueCount) + 1, sizeof(char**)); + do + { + (*outputValue)[i] = (char**)calloc((*outputColumn) + 1, sizeof(char*)); + for (j = 0; j < (*outputColumn); j++) + { + (*outputValue)[i][j] = (char*)calloc(1000, sizeof(char)); + printf("sqlResult %s num %d \n", outField.caCharValue[j],j); + strcpy((*outputValue)[i][j], outField.caCharValue[j]); + //printf("outValue[%d][%d] = %s , ַ=%d, ַָ= %d\n ",i,j,(*outputValue)[i][j],&(*outputValue)[i][j],(*outputValue)[i][j]); + } + i++; + } while ((ret = OCIStmtFetch2(ociHandle->p_sql, ociHandle->p_err, 1, OCI_FETCH_NEXT, 1, OCI_DEFAULT) != OCI_NO_DATA)); + + return 0; +} + +int QuerySQLInt(char* SQL, int inputValueCount, char** inputValue, int* outputColumn, int* outputValueCount, char**** outputValue) +{ + int i = 0, j = 0, ret = 0; + + int times = 0, temp = 0; + + SqlSelField infield; + SqlSelField outField; + // ʼṹ + infield.nCharNum = inputValueCount; + infield.nIntNum = 0; + outField.nCharNum = 0; + outField.nIntNum = 0; + + *outputColumn = 0; + *outputValueCount = 0; + + for (i = 0; i < inputValueCount; i++) + { + strcpy(infield.caCharValue[i], inputValue[i]); + } + + // ִвѯ + + + if (ret = _QuerySQL(SQL, &outField, &infield)) + { + printf("SQLѯʧ!\n"); + QuitFreeHandle(); + return -1; + } + + // ȡ + ret = OCIAttrGet(ociHandle->p_sql, (ub4)OCI_HTYPE_STMT, (dvoid*)outputColumn, (ub4*)0, (ub4)OCI_ATTR_PARAM_COUNT, ociHandle->p_err); + + // ȡһ,ȥ + ret = OCIStmtFetch2(ociHandle->p_sql, ociHandle->p_err, 1, OCI_FETCH_LAST, 0, OCI_DEFAULT); + // ȡ + ret = OCIAttrGet(ociHandle->p_sql, (ub4)OCI_HTYPE_STMT, (dvoid*)outputValueCount, (ub4*)0, (ub4)OCI_ATTR_ROW_COUNT, ociHandle->p_err); + + if (*outputValueCount == 0) + return 0; + + + // ʼڴ沢Ҵ洢 + ret = OCIStmtFetch2(ociHandle->p_sql, ociHandle->p_err, 1, OCI_FETCH_FIRST, 0, OCI_DEFAULT); + *outputValue = (char***)calloc((*outputValueCount) + 1, sizeof(char**)); + do + { + (*outputValue)[i] = (char**)calloc((*outputColumn) + 1, sizeof(char*)); + for (j = 0; j < (*outputColumn); j++) + { + (*outputValue)[i][j] = (char*)calloc(1000, sizeof(char)); + //printf("sqlResult %d num %d \n", outField.caCharValue[j], j); + strcpy((*outputValue)[i][j], outField.caCharValue[j]); + //printf("outValue[%d][%d] = %s , ַ=%d, ַָ= %d\n ",i,j,(*outputValue)[i][j],&(*outputValue)[i][j],(*outputValue)[i][j]); + } + i++; + } while ((ret = OCIStmtFetch2(ociHandle->p_sql, ociHandle->p_err, 1, OCI_FETCH_NEXT, 1, OCI_DEFAULT) != OCI_NO_DATA)); + + return 0; +} +// IJѯ +int QuerySQLNoInputParam(char* SQL, int* outputColumn, int* outputValueCount, char**** outputValue) +{ + return QuerySQL(SQL, 0, NULL, outputColumn, outputValueCount, outputValue); +} +// IJѯ +int QuerySQLNoInputParamInt(char* SQL, int* outputColumn, int* outputValueCount, char**** outputValue) +{ + return QuerySQLInt(SQL, 0, NULL, outputColumn, outputValueCount, outputValue); +} +// ޲ +int ExecuteSQLNoInputParam(char* SQL) +{ + printf("ʼ\n"); + return ExecuteSQL(SQL, 0, NULL); +} + +// Ͽ +void DisConnServer() +{ + if (ociHandle != NULL) + QuitFreeHandle(); +} + diff --git a/DFL_BOM_WL_TOERP/ocilib.h b/DFL_BOM_WL_TOERP/ocilib.h new file mode 100644 index 0000000..a253f27 --- /dev/null +++ b/DFL_BOM_WL_TOERP/ocilib.h @@ -0,0 +1,99 @@ +#pragma once +/*===================================================================================================================== + Copyright(c) 2012 ORIGIN. + Unpublished - All rights reserved +======================================================================================================================= +File description: + + Filename: ocilib.h + Module : OCI + + This Header file of OCI library Package. + +======================================================================================================================= +Date Name Description of Change +1-Feb-2015 Ray Initialize creation +$HISTORY$ +=====================================================================================================================*/ +#include +#include +#include +#include +#include +//#include + +#define OCI_FAIL 1 +#define OCI_OK 0 + +#ifdef __cplusplus +extern "C" +{ +#endif + /** + * ݿ. + * @param username - û + * @param password - + * @param dbname - ݿSID + * @return - OCI_OK or error code + * + * ORACLE ݿװ + */ + extern int ConnServer(char* username, char* password, char* dbname); + + + /** + * ִSQL. + * @param SQL - SQL + * @return - OCI_OK or error code + * + * ORACLE ݿװ + */ + extern int ExecuteSQLNoInputParam(char* SQL); + + /** + * ִSQL. + * @param SQL - SQL + * @param inputValueCount - + * @param inputValue - ֵ + * @return - OCI_OK or error code + * + * ORACLE ݿװ + */ + extern int ExecuteSQL(char* SQL, int inputValueCount, char** inputValue); + + /** + * IJѯSQL. + * @param SQL - SQL + * @param outputColumn - е + * @param outputValueCount - е + * @param outputValue - + * @return - OCI_OK or error code + * + * ORACLE ݿװ + */ + extern int QuerySQLNoInputParam(char* SQL, int* outputColumn, int* outputValueCount, char**** outputValue); + extern int QuerySQLNoInputParamInt(char* SQL, int* outputColumn, int* outputValueCount, char**** outputValue); + /** + * IJѯSQL. + * @param SQL - SQL + * @param inputValueCount - + * @param inputValue - ֵ + * @param outputColumn - е + * @param outputValueCount - е + * @param outputValue - + * @return - OCI_OK or error code + * + * ORACLE ݿװ + */ + extern int QuerySQL(char* SQL, int inputValueCount, char** inputValue, int* outputColumn, int* outputValueCount, char**** outputValue); + extern int QuerySQLInt(char* SQL, int inputValueCount, char** inputValue, int* outputColumn, int* outputValueCount, char**** outputValue); + /** + * Ͽݿ. + * + * ORACLE ݿװ + */ + extern void DisConnServer(); + +#ifdef __cplusplus +} +#endif diff --git a/DFL_BOM_WL_TOERP/rapidjson/allocators.h b/DFL_BOM_WL_TOERP/rapidjson/allocators.h new file mode 100644 index 0000000..ddcf478 --- /dev/null +++ b/DFL_BOM_WL_TOERP/rapidjson/allocators.h @@ -0,0 +1,693 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +#ifndef RAPIDJSON_ALLOCATORS_H_ +#define RAPIDJSON_ALLOCATORS_H_ + +#include "rapidjson.h" +#include "internal/meta.h" + +#include +#include + +#if RAPIDJSON_HAS_CXX11 +#include +#endif + +RAPIDJSON_NAMESPACE_BEGIN + +/////////////////////////////////////////////////////////////////////////////// +// Allocator + +/*! \class rapidjson::Allocator + \brief Concept for allocating, resizing and freeing memory block. + + Note that Malloc() and Realloc() are non-static but Free() is static. + + So if an allocator need to support Free(), it needs to put its pointer in + the header of memory block. + +\code +concept Allocator { + static const bool kNeedFree; //!< Whether this allocator needs to call Free(). + + // Allocate a memory block. + // \param size of the memory block in bytes. + // \returns pointer to the memory block. + void* Malloc(size_t size); + + // Resize a memory block. + // \param originalPtr The pointer to current memory block. Null pointer is permitted. + // \param originalSize The current size in bytes. (Design issue: since some allocator may not book-keep this, explicitly pass to it can save memory.) + // \param newSize the new size in bytes. + void* Realloc(void* originalPtr, size_t originalSize, size_t newSize); + + // Free a memory block. + // \param pointer to the memory block. Null pointer is permitted. + static void Free(void *ptr); +}; +\endcode +*/ + + +/*! \def RAPIDJSON_ALLOCATOR_DEFAULT_CHUNK_CAPACITY + \ingroup RAPIDJSON_CONFIG + \brief User-defined kDefaultChunkCapacity definition. + + User can define this as any \c size that is a power of 2. +*/ + +#ifndef RAPIDJSON_ALLOCATOR_DEFAULT_CHUNK_CAPACITY +#define RAPIDJSON_ALLOCATOR_DEFAULT_CHUNK_CAPACITY (64 * 1024) +#endif + + +/////////////////////////////////////////////////////////////////////////////// +// CrtAllocator + +//! C-runtime library allocator. +/*! This class is just wrapper for standard C library memory routines. + \note implements Allocator concept +*/ +class CrtAllocator { +public: + static const bool kNeedFree = true; + void* Malloc(size_t size) { + if (size) // behavior of malloc(0) is implementation defined. + return RAPIDJSON_MALLOC(size); + else + return NULL; // standardize to returning NULL. + } + void* Realloc(void* originalPtr, size_t originalSize, size_t newSize) { + (void)originalSize; + if (newSize == 0) { + RAPIDJSON_FREE(originalPtr); + return NULL; + } + return RAPIDJSON_REALLOC(originalPtr, newSize); + } + static void Free(void *ptr) RAPIDJSON_NOEXCEPT { RAPIDJSON_FREE(ptr); } + + bool operator==(const CrtAllocator&) const RAPIDJSON_NOEXCEPT { + return true; + } + bool operator!=(const CrtAllocator&) const RAPIDJSON_NOEXCEPT { + return false; + } +}; + +/////////////////////////////////////////////////////////////////////////////// +// MemoryPoolAllocator + +//! Default memory allocator used by the parser and DOM. +/*! This allocator allocate memory blocks from pre-allocated memory chunks. + + It does not free memory blocks. And Realloc() only allocate new memory. + + The memory chunks are allocated by BaseAllocator, which is CrtAllocator by default. + + User may also supply a buffer as the first chunk. + + If the user-buffer is full then additional chunks are allocated by BaseAllocator. + + The user-buffer is not deallocated by this allocator. + + \tparam BaseAllocator the allocator type for allocating memory chunks. Default is CrtAllocator. + \note implements Allocator concept +*/ +template +class MemoryPoolAllocator { + //! Chunk header for perpending to each chunk. + /*! Chunks are stored as a singly linked list. + */ + struct ChunkHeader { + size_t capacity; //!< Capacity of the chunk in bytes (excluding the header itself). + size_t size; //!< Current size of allocated memory in bytes. + ChunkHeader *next; //!< Next chunk in the linked list. + }; + + struct SharedData { + ChunkHeader *chunkHead; //!< Head of the chunk linked-list. Only the head chunk serves allocation. + BaseAllocator* ownBaseAllocator; //!< base allocator created by this object. + size_t refcount; + bool ownBuffer; + }; + + static const size_t SIZEOF_SHARED_DATA = RAPIDJSON_ALIGN(sizeof(SharedData)); + static const size_t SIZEOF_CHUNK_HEADER = RAPIDJSON_ALIGN(sizeof(ChunkHeader)); + + static inline ChunkHeader *GetChunkHead(SharedData *shared) + { + return reinterpret_cast(reinterpret_cast(shared) + SIZEOF_SHARED_DATA); + } + static inline uint8_t *GetChunkBuffer(SharedData *shared) + { + return reinterpret_cast(shared->chunkHead) + SIZEOF_CHUNK_HEADER; + } + + static const size_t kDefaultChunkCapacity = RAPIDJSON_ALLOCATOR_DEFAULT_CHUNK_CAPACITY; //!< Default chunk capacity. + +public: + static const bool kNeedFree = false; //!< Tell users that no need to call Free() with this allocator. (concept Allocator) + static const bool kRefCounted = true; //!< Tell users that this allocator is reference counted on copy + + //! Constructor with chunkSize. + /*! \param chunkSize The size of memory chunk. The default is kDefaultChunkSize. + \param baseAllocator The allocator for allocating memory chunks. + */ + explicit + MemoryPoolAllocator(size_t chunkSize = kDefaultChunkCapacity, BaseAllocator* baseAllocator = 0) : + chunk_capacity_(chunkSize), + baseAllocator_(baseAllocator ? baseAllocator : RAPIDJSON_NEW(BaseAllocator)()), + shared_(static_cast(baseAllocator_ ? baseAllocator_->Malloc(SIZEOF_SHARED_DATA + SIZEOF_CHUNK_HEADER) : 0)) + { + RAPIDJSON_ASSERT(baseAllocator_ != 0); + RAPIDJSON_ASSERT(shared_ != 0); + if (baseAllocator) { + shared_->ownBaseAllocator = 0; + } + else { + shared_->ownBaseAllocator = baseAllocator_; + } + shared_->chunkHead = GetChunkHead(shared_); + shared_->chunkHead->capacity = 0; + shared_->chunkHead->size = 0; + shared_->chunkHead->next = 0; + shared_->ownBuffer = true; + shared_->refcount = 1; + } + + //! Constructor with user-supplied buffer. + /*! The user buffer will be used firstly. When it is full, memory pool allocates new chunk with chunk size. + + The user buffer will not be deallocated when this allocator is destructed. + + \param buffer User supplied buffer. + \param size Size of the buffer in bytes. It must at least larger than sizeof(ChunkHeader). + \param chunkSize The size of memory chunk. The default is kDefaultChunkSize. + \param baseAllocator The allocator for allocating memory chunks. + */ + MemoryPoolAllocator(void *buffer, size_t size, size_t chunkSize = kDefaultChunkCapacity, BaseAllocator* baseAllocator = 0) : + chunk_capacity_(chunkSize), + baseAllocator_(baseAllocator), + shared_(static_cast(AlignBuffer(buffer, size))) + { + RAPIDJSON_ASSERT(size >= SIZEOF_SHARED_DATA + SIZEOF_CHUNK_HEADER); + shared_->chunkHead = GetChunkHead(shared_); + shared_->chunkHead->capacity = size - SIZEOF_SHARED_DATA - SIZEOF_CHUNK_HEADER; + shared_->chunkHead->size = 0; + shared_->chunkHead->next = 0; + shared_->ownBaseAllocator = 0; + shared_->ownBuffer = false; + shared_->refcount = 1; + } + + MemoryPoolAllocator(const MemoryPoolAllocator& rhs) RAPIDJSON_NOEXCEPT : + chunk_capacity_(rhs.chunk_capacity_), + baseAllocator_(rhs.baseAllocator_), + shared_(rhs.shared_) + { + RAPIDJSON_NOEXCEPT_ASSERT(shared_->refcount > 0); + ++shared_->refcount; + } + MemoryPoolAllocator& operator=(const MemoryPoolAllocator& rhs) RAPIDJSON_NOEXCEPT + { + RAPIDJSON_NOEXCEPT_ASSERT(rhs.shared_->refcount > 0); + ++rhs.shared_->refcount; + this->~MemoryPoolAllocator(); + baseAllocator_ = rhs.baseAllocator_; + chunk_capacity_ = rhs.chunk_capacity_; + shared_ = rhs.shared_; + return *this; + } + +#if RAPIDJSON_HAS_CXX11_RVALUE_REFS + MemoryPoolAllocator(MemoryPoolAllocator&& rhs) RAPIDJSON_NOEXCEPT : + chunk_capacity_(rhs.chunk_capacity_), + baseAllocator_(rhs.baseAllocator_), + shared_(rhs.shared_) + { + RAPIDJSON_NOEXCEPT_ASSERT(rhs.shared_->refcount > 0); + rhs.shared_ = 0; + } + MemoryPoolAllocator& operator=(MemoryPoolAllocator&& rhs) RAPIDJSON_NOEXCEPT + { + RAPIDJSON_NOEXCEPT_ASSERT(rhs.shared_->refcount > 0); + this->~MemoryPoolAllocator(); + baseAllocator_ = rhs.baseAllocator_; + chunk_capacity_ = rhs.chunk_capacity_; + shared_ = rhs.shared_; + rhs.shared_ = 0; + return *this; + } +#endif + + //! Destructor. + /*! This deallocates all memory chunks, excluding the user-supplied buffer. + */ + ~MemoryPoolAllocator() RAPIDJSON_NOEXCEPT { + if (!shared_) { + // do nothing if moved + return; + } + if (shared_->refcount > 1) { + --shared_->refcount; + return; + } + Clear(); + BaseAllocator *a = shared_->ownBaseAllocator; + if (shared_->ownBuffer) { + baseAllocator_->Free(shared_); + } + RAPIDJSON_DELETE(a); + } + + //! Deallocates all memory chunks, excluding the first/user one. + void Clear() RAPIDJSON_NOEXCEPT { + RAPIDJSON_NOEXCEPT_ASSERT(shared_->refcount > 0); + for (;;) { + ChunkHeader* c = shared_->chunkHead; + if (!c->next) { + break; + } + shared_->chunkHead = c->next; + baseAllocator_->Free(c); + } + shared_->chunkHead->size = 0; + } + + //! Computes the total capacity of allocated memory chunks. + /*! \return total capacity in bytes. + */ + size_t Capacity() const RAPIDJSON_NOEXCEPT { + RAPIDJSON_NOEXCEPT_ASSERT(shared_->refcount > 0); + size_t capacity = 0; + for (ChunkHeader* c = shared_->chunkHead; c != 0; c = c->next) + capacity += c->capacity; + return capacity; + } + + //! Computes the memory blocks allocated. + /*! \return total used bytes. + */ + size_t Size() const RAPIDJSON_NOEXCEPT { + RAPIDJSON_NOEXCEPT_ASSERT(shared_->refcount > 0); + size_t size = 0; + for (ChunkHeader* c = shared_->chunkHead; c != 0; c = c->next) + size += c->size; + return size; + } + + //! Whether the allocator is shared. + /*! \return true or false. + */ + bool Shared() const RAPIDJSON_NOEXCEPT { + RAPIDJSON_NOEXCEPT_ASSERT(shared_->refcount > 0); + return shared_->refcount > 1; + } + + //! Allocates a memory block. (concept Allocator) + void* Malloc(size_t size) { + RAPIDJSON_NOEXCEPT_ASSERT(shared_->refcount > 0); + if (!size) + return NULL; + + size = RAPIDJSON_ALIGN(size); + if (RAPIDJSON_UNLIKELY(shared_->chunkHead->size + size > shared_->chunkHead->capacity)) + if (!AddChunk(chunk_capacity_ > size ? chunk_capacity_ : size)) + return NULL; + + void *buffer = GetChunkBuffer(shared_) + shared_->chunkHead->size; + shared_->chunkHead->size += size; + return buffer; + } + + //! Resizes a memory block (concept Allocator) + void* Realloc(void* originalPtr, size_t originalSize, size_t newSize) { + if (originalPtr == 0) + return Malloc(newSize); + + RAPIDJSON_NOEXCEPT_ASSERT(shared_->refcount > 0); + if (newSize == 0) + return NULL; + + originalSize = RAPIDJSON_ALIGN(originalSize); + newSize = RAPIDJSON_ALIGN(newSize); + + // Do not shrink if new size is smaller than original + if (originalSize >= newSize) + return originalPtr; + + // Simply expand it if it is the last allocation and there is sufficient space + if (originalPtr == GetChunkBuffer(shared_) + shared_->chunkHead->size - originalSize) { + size_t increment = static_cast(newSize - originalSize); + if (shared_->chunkHead->size + increment <= shared_->chunkHead->capacity) { + shared_->chunkHead->size += increment; + return originalPtr; + } + } + + // Realloc process: allocate and copy memory, do not free original buffer. + if (void* newBuffer = Malloc(newSize)) { + if (originalSize) + std::memcpy(newBuffer, originalPtr, originalSize); + return newBuffer; + } + else + return NULL; + } + + //! Frees a memory block (concept Allocator) + static void Free(void *ptr) RAPIDJSON_NOEXCEPT { (void)ptr; } // Do nothing + + //! Compare (equality) with another MemoryPoolAllocator + bool operator==(const MemoryPoolAllocator& rhs) const RAPIDJSON_NOEXCEPT { + RAPIDJSON_NOEXCEPT_ASSERT(shared_->refcount > 0); + RAPIDJSON_NOEXCEPT_ASSERT(rhs.shared_->refcount > 0); + return shared_ == rhs.shared_; + } + //! Compare (inequality) with another MemoryPoolAllocator + bool operator!=(const MemoryPoolAllocator& rhs) const RAPIDJSON_NOEXCEPT { + return !operator==(rhs); + } + +private: + //! Creates a new chunk. + /*! \param capacity Capacity of the chunk in bytes. + \return true if success. + */ + bool AddChunk(size_t capacity) { + if (!baseAllocator_) + shared_->ownBaseAllocator = baseAllocator_ = RAPIDJSON_NEW(BaseAllocator)(); + if (ChunkHeader* chunk = static_cast(baseAllocator_->Malloc(SIZEOF_CHUNK_HEADER + capacity))) { + chunk->capacity = capacity; + chunk->size = 0; + chunk->next = shared_->chunkHead; + shared_->chunkHead = chunk; + return true; + } + else + return false; + } + + static inline void* AlignBuffer(void* buf, size_t &size) + { + RAPIDJSON_NOEXCEPT_ASSERT(buf != 0); + const uintptr_t mask = sizeof(void*) - 1; + const uintptr_t ubuf = reinterpret_cast(buf); + if (RAPIDJSON_UNLIKELY(ubuf & mask)) { + const uintptr_t abuf = (ubuf + mask) & ~mask; + RAPIDJSON_ASSERT(size >= abuf - ubuf); + buf = reinterpret_cast(abuf); + size -= abuf - ubuf; + } + return buf; + } + + size_t chunk_capacity_; //!< The minimum capacity of chunk when they are allocated. + BaseAllocator* baseAllocator_; //!< base allocator for allocating memory chunks. + SharedData *shared_; //!< The shared data of the allocator +}; + +namespace internal { + template + struct IsRefCounted : + public FalseType + { }; + template + struct IsRefCounted::Type> : + public TrueType + { }; +} + +template +inline T* Realloc(A& a, T* old_p, size_t old_n, size_t new_n) +{ + RAPIDJSON_NOEXCEPT_ASSERT(old_n <= std::numeric_limits::max() / sizeof(T) && new_n <= std::numeric_limits::max() / sizeof(T)); + return static_cast(a.Realloc(old_p, old_n * sizeof(T), new_n * sizeof(T))); +} + +template +inline T *Malloc(A& a, size_t n = 1) +{ + return Realloc(a, NULL, 0, n); +} + +template +inline void Free(A& a, T *p, size_t n = 1) +{ + static_cast(Realloc(a, p, n, 0)); +} + +#ifdef __GNUC__ +RAPIDJSON_DIAG_PUSH +RAPIDJSON_DIAG_OFF(effc++) // std::allocator can safely be inherited +#endif + +template +class StdAllocator : + public std::allocator +{ + typedef std::allocator allocator_type; +#if RAPIDJSON_HAS_CXX11 + typedef std::allocator_traits traits_type; +#else + typedef allocator_type traits_type; +#endif + +public: + typedef BaseAllocator BaseAllocatorType; + + StdAllocator() RAPIDJSON_NOEXCEPT : + allocator_type(), + baseAllocator_() + { } + + StdAllocator(const StdAllocator& rhs) RAPIDJSON_NOEXCEPT : + allocator_type(rhs), + baseAllocator_(rhs.baseAllocator_) + { } + + template + StdAllocator(const StdAllocator& rhs) RAPIDJSON_NOEXCEPT : + allocator_type(rhs), + baseAllocator_(rhs.baseAllocator_) + { } + +#if RAPIDJSON_HAS_CXX11_RVALUE_REFS + StdAllocator(StdAllocator&& rhs) RAPIDJSON_NOEXCEPT : + allocator_type(std::move(rhs)), + baseAllocator_(std::move(rhs.baseAllocator_)) + { } +#endif +#if RAPIDJSON_HAS_CXX11 + using propagate_on_container_move_assignment = std::true_type; + using propagate_on_container_swap = std::true_type; +#endif + + /* implicit */ + StdAllocator(const BaseAllocator& allocator) RAPIDJSON_NOEXCEPT : + allocator_type(), + baseAllocator_(allocator) + { } + + ~StdAllocator() RAPIDJSON_NOEXCEPT + { } + + template + struct rebind { + typedef StdAllocator other; + }; + + typedef typename traits_type::size_type size_type; + typedef typename traits_type::difference_type difference_type; + + typedef typename traits_type::value_type value_type; + typedef typename traits_type::pointer pointer; + typedef typename traits_type::const_pointer const_pointer; + +#if RAPIDJSON_HAS_CXX11 + + typedef typename std::add_lvalue_reference::type &reference; + typedef typename std::add_lvalue_reference::type>::type &const_reference; + + pointer address(reference r) const RAPIDJSON_NOEXCEPT + { + return std::addressof(r); + } + const_pointer address(const_reference r) const RAPIDJSON_NOEXCEPT + { + return std::addressof(r); + } + + size_type max_size() const RAPIDJSON_NOEXCEPT + { + return traits_type::max_size(*this); + } + + template + void construct(pointer p, Args&&... args) + { + traits_type::construct(*this, p, std::forward(args)...); + } + void destroy(pointer p) + { + traits_type::destroy(*this, p); + } + +#else // !RAPIDJSON_HAS_CXX11 + + typedef typename allocator_type::reference reference; + typedef typename allocator_type::const_reference const_reference; + + pointer address(reference r) const RAPIDJSON_NOEXCEPT + { + return allocator_type::address(r); + } + const_pointer address(const_reference r) const RAPIDJSON_NOEXCEPT + { + return allocator_type::address(r); + } + + size_type max_size() const RAPIDJSON_NOEXCEPT + { + return allocator_type::max_size(); + } + + void construct(pointer p, const_reference r) + { + allocator_type::construct(p, r); + } + void destroy(pointer p) + { + allocator_type::destroy(p); + } + +#endif // !RAPIDJSON_HAS_CXX11 + + template + U* allocate(size_type n = 1, const void* = 0) + { + return RAPIDJSON_NAMESPACE::Malloc(baseAllocator_, n); + } + template + void deallocate(U* p, size_type n = 1) + { + RAPIDJSON_NAMESPACE::Free(baseAllocator_, p, n); + } + + pointer allocate(size_type n = 1, const void* = 0) + { + return allocate(n); + } + void deallocate(pointer p, size_type n = 1) + { + deallocate(p, n); + } + +#if RAPIDJSON_HAS_CXX11 + using is_always_equal = std::is_empty; +#endif + + template + bool operator==(const StdAllocator& rhs) const RAPIDJSON_NOEXCEPT + { + return baseAllocator_ == rhs.baseAllocator_; + } + template + bool operator!=(const StdAllocator& rhs) const RAPIDJSON_NOEXCEPT + { + return !operator==(rhs); + } + + //! rapidjson Allocator concept + static const bool kNeedFree = BaseAllocator::kNeedFree; + static const bool kRefCounted = internal::IsRefCounted::Value; + void* Malloc(size_t size) + { + return baseAllocator_.Malloc(size); + } + void* Realloc(void* originalPtr, size_t originalSize, size_t newSize) + { + return baseAllocator_.Realloc(originalPtr, originalSize, newSize); + } + static void Free(void *ptr) RAPIDJSON_NOEXCEPT + { + BaseAllocator::Free(ptr); + } + +private: + template + friend class StdAllocator; // access to StdAllocator.* + + BaseAllocator baseAllocator_; +}; + +#if !RAPIDJSON_HAS_CXX17 // std::allocator deprecated in C++17 +template +class StdAllocator : + public std::allocator +{ + typedef std::allocator allocator_type; + +public: + typedef BaseAllocator BaseAllocatorType; + + StdAllocator() RAPIDJSON_NOEXCEPT : + allocator_type(), + baseAllocator_() + { } + + StdAllocator(const StdAllocator& rhs) RAPIDJSON_NOEXCEPT : + allocator_type(rhs), + baseAllocator_(rhs.baseAllocator_) + { } + + template + StdAllocator(const StdAllocator& rhs) RAPIDJSON_NOEXCEPT : + allocator_type(rhs), + baseAllocator_(rhs.baseAllocator_) + { } + + /* implicit */ + StdAllocator(const BaseAllocator& baseAllocator) RAPIDJSON_NOEXCEPT : + allocator_type(), + baseAllocator_(baseAllocator) + { } + + ~StdAllocator() RAPIDJSON_NOEXCEPT + { } + + template + struct rebind { + typedef StdAllocator other; + }; + + typedef typename allocator_type::value_type value_type; + +private: + template + friend class StdAllocator; // access to StdAllocator.* + + BaseAllocator baseAllocator_; +}; +#endif + +#ifdef __GNUC__ +RAPIDJSON_DIAG_POP +#endif + +RAPIDJSON_NAMESPACE_END + +#endif // RAPIDJSON_ENCODINGS_H_ diff --git a/DFL_BOM_WL_TOERP/rapidjson/cursorstreamwrapper.h b/DFL_BOM_WL_TOERP/rapidjson/cursorstreamwrapper.h new file mode 100644 index 0000000..fd6513d --- /dev/null +++ b/DFL_BOM_WL_TOERP/rapidjson/cursorstreamwrapper.h @@ -0,0 +1,78 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +#ifndef RAPIDJSON_CURSORSTREAMWRAPPER_H_ +#define RAPIDJSON_CURSORSTREAMWRAPPER_H_ + +#include "stream.h" + +#if defined(__GNUC__) +RAPIDJSON_DIAG_PUSH +RAPIDJSON_DIAG_OFF(effc++) +#endif + +#if defined(_MSC_VER) && _MSC_VER <= 1800 +RAPIDJSON_DIAG_PUSH +RAPIDJSON_DIAG_OFF(4702) // unreachable code +RAPIDJSON_DIAG_OFF(4512) // assignment operator could not be generated +#endif + +RAPIDJSON_NAMESPACE_BEGIN + + +//! Cursor stream wrapper for counting line and column number if error exists. +/*! + \tparam InputStream Any stream that implements Stream Concept +*/ +template > +class CursorStreamWrapper : public GenericStreamWrapper { +public: + typedef typename Encoding::Ch Ch; + + CursorStreamWrapper(InputStream& is): + GenericStreamWrapper(is), line_(1), col_(0) {} + + // counting line and column number + Ch Take() { + Ch ch = this->is_.Take(); + if(ch == '\n') { + line_ ++; + col_ = 0; + } else { + col_ ++; + } + return ch; + } + + //! Get the error line number, if error exists. + size_t GetLine() const { return line_; } + //! Get the error column number, if error exists. + size_t GetColumn() const { return col_; } + +private: + size_t line_; //!< Current Line + size_t col_; //!< Current Column +}; + +#if defined(_MSC_VER) && _MSC_VER <= 1800 +RAPIDJSON_DIAG_POP +#endif + +#if defined(__GNUC__) +RAPIDJSON_DIAG_POP +#endif + +RAPIDJSON_NAMESPACE_END + +#endif // RAPIDJSON_CURSORSTREAMWRAPPER_H_ diff --git a/DFL_BOM_WL_TOERP/rapidjson/document.h b/DFL_BOM_WL_TOERP/rapidjson/document.h new file mode 100644 index 0000000..4f1e246 --- /dev/null +++ b/DFL_BOM_WL_TOERP/rapidjson/document.h @@ -0,0 +1,3043 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +#ifndef RAPIDJSON_DOCUMENT_H_ +#define RAPIDJSON_DOCUMENT_H_ + +/*! \file document.h */ + +#include "reader.h" +#include "internal/meta.h" +#include "internal/strfunc.h" +#include "memorystream.h" +#include "encodedstream.h" +#include // placement new +#include +#ifdef __cpp_lib_three_way_comparison +#include +#endif + +RAPIDJSON_DIAG_PUSH +#ifdef __clang__ +RAPIDJSON_DIAG_OFF(padded) +RAPIDJSON_DIAG_OFF(switch-enum) +RAPIDJSON_DIAG_OFF(c++98-compat) +#elif defined(_MSC_VER) +RAPIDJSON_DIAG_OFF(4127) // conditional expression is constant +RAPIDJSON_DIAG_OFF(4244) // conversion from kXxxFlags to 'uint16_t', possible loss of data +#endif + +#ifdef __GNUC__ +RAPIDJSON_DIAG_OFF(effc++) +#endif // __GNUC__ + +#ifdef GetObject +// see https://github.com/Tencent/rapidjson/issues/1448 +// a former included windows.h might have defined a macro called GetObject, which affects +// GetObject defined here. This ensures the macro does not get applied +#pragma push_macro("GetObject") +#define RAPIDJSON_WINDOWS_GETOBJECT_WORKAROUND_APPLIED +#undef GetObject +#endif + +#ifndef RAPIDJSON_NOMEMBERITERATORCLASS +#include // std::random_access_iterator_tag +#endif + +#if RAPIDJSON_USE_MEMBERSMAP +#include // std::multimap +#endif + +RAPIDJSON_NAMESPACE_BEGIN + +// Forward declaration. +template +class GenericValue; + +template +class GenericDocument; + +/*! \def RAPIDJSON_DEFAULT_ALLOCATOR + \ingroup RAPIDJSON_CONFIG + \brief Allows to choose default allocator. + + User can define this to use CrtAllocator or MemoryPoolAllocator. +*/ +#ifndef RAPIDJSON_DEFAULT_ALLOCATOR +#define RAPIDJSON_DEFAULT_ALLOCATOR ::RAPIDJSON_NAMESPACE::MemoryPoolAllocator<::RAPIDJSON_NAMESPACE::CrtAllocator> +#endif + +/*! \def RAPIDJSON_DEFAULT_STACK_ALLOCATOR + \ingroup RAPIDJSON_CONFIG + \brief Allows to choose default stack allocator for Document. + + User can define this to use CrtAllocator or MemoryPoolAllocator. +*/ +#ifndef RAPIDJSON_DEFAULT_STACK_ALLOCATOR +#define RAPIDJSON_DEFAULT_STACK_ALLOCATOR ::RAPIDJSON_NAMESPACE::CrtAllocator +#endif + +/*! \def RAPIDJSON_VALUE_DEFAULT_OBJECT_CAPACITY + \ingroup RAPIDJSON_CONFIG + \brief User defined kDefaultObjectCapacity value. + + User can define this as any natural number. +*/ +#ifndef RAPIDJSON_VALUE_DEFAULT_OBJECT_CAPACITY +// number of objects that rapidjson::Value allocates memory for by default +#define RAPIDJSON_VALUE_DEFAULT_OBJECT_CAPACITY 16 +#endif + +/*! \def RAPIDJSON_VALUE_DEFAULT_ARRAY_CAPACITY + \ingroup RAPIDJSON_CONFIG + \brief User defined kDefaultArrayCapacity value. + + User can define this as any natural number. +*/ +#ifndef RAPIDJSON_VALUE_DEFAULT_ARRAY_CAPACITY +// number of array elements that rapidjson::Value allocates memory for by default +#define RAPIDJSON_VALUE_DEFAULT_ARRAY_CAPACITY 16 +#endif + +//! Name-value pair in a JSON object value. +/*! + This class was internal to GenericValue. It used to be a inner struct. + But a compiler (IBM XL C/C++ for AIX) have reported to have problem with that so it moved as a namespace scope struct. + https://code.google.com/p/rapidjson/issues/detail?id=64 +*/ +template +class GenericMember { +public: + GenericValue name; //!< name of member (must be a string) + GenericValue value; //!< value of member. + +#if RAPIDJSON_HAS_CXX11_RVALUE_REFS + //! Move constructor in C++11 + GenericMember(GenericMember&& rhs) RAPIDJSON_NOEXCEPT + : name(std::move(rhs.name)), + value(std::move(rhs.value)) + { + } + + //! Move assignment in C++11 + GenericMember& operator=(GenericMember&& rhs) RAPIDJSON_NOEXCEPT { + return *this = static_cast(rhs); + } +#endif + + //! Assignment with move semantics. + /*! \param rhs Source of the assignment. Its name and value will become a null value after assignment. + */ + GenericMember& operator=(GenericMember& rhs) RAPIDJSON_NOEXCEPT { + if (RAPIDJSON_LIKELY(this != &rhs)) { + name = rhs.name; + value = rhs.value; + } + return *this; + } + + // swap() for std::sort() and other potential use in STL. + friend inline void swap(GenericMember& a, GenericMember& b) RAPIDJSON_NOEXCEPT { + a.name.Swap(b.name); + a.value.Swap(b.value); + } + +private: + //! Copy constructor is not permitted. + GenericMember(const GenericMember& rhs); +}; + +/////////////////////////////////////////////////////////////////////////////// +// GenericMemberIterator + +#ifndef RAPIDJSON_NOMEMBERITERATORCLASS + +//! (Constant) member iterator for a JSON object value +/*! + \tparam Const Is this a constant iterator? + \tparam Encoding Encoding of the value. (Even non-string values need to have the same encoding in a document) + \tparam Allocator Allocator type for allocating memory of object, array and string. + + This class implements a Random Access Iterator for GenericMember elements + of a GenericValue, see ISO/IEC 14882:2003(E) C++ standard, 24.1 [lib.iterator.requirements]. + + \note This iterator implementation is mainly intended to avoid implicit + conversions from iterator values to \c NULL, + e.g. from GenericValue::FindMember. + + \note Define \c RAPIDJSON_NOMEMBERITERATORCLASS to fall back to a + pointer-based implementation, if your platform doesn't provide + the C++ header. + + \see GenericMember, GenericValue::MemberIterator, GenericValue::ConstMemberIterator + */ +template +class GenericMemberIterator { + + friend class GenericValue; + template friend class GenericMemberIterator; + + typedef GenericMember PlainType; + typedef typename internal::MaybeAddConst::Type ValueType; + +public: + //! Iterator type itself + typedef GenericMemberIterator Iterator; + //! Constant iterator type + typedef GenericMemberIterator ConstIterator; + //! Non-constant iterator type + typedef GenericMemberIterator NonConstIterator; + + /** \name std::iterator_traits support */ + //@{ + typedef ValueType value_type; + typedef ValueType * pointer; + typedef ValueType & reference; + typedef std::ptrdiff_t difference_type; + typedef std::random_access_iterator_tag iterator_category; + //@} + + //! Pointer to (const) GenericMember + typedef pointer Pointer; + //! Reference to (const) GenericMember + typedef reference Reference; + //! Signed integer type (e.g. \c ptrdiff_t) + typedef difference_type DifferenceType; + + //! Default constructor (singular value) + /*! Creates an iterator pointing to no element. + \note All operations, except for comparisons, are undefined on such values. + */ + GenericMemberIterator() : ptr_() {} + + //! Iterator conversions to more const + /*! + \param it (Non-const) iterator to copy from + + Allows the creation of an iterator from another GenericMemberIterator + that is "less const". Especially, creating a non-constant iterator + from a constant iterator are disabled: + \li const -> non-const (not ok) + \li const -> const (ok) + \li non-const -> const (ok) + \li non-const -> non-const (ok) + + \note If the \c Const template parameter is already \c false, this + constructor effectively defines a regular copy-constructor. + Otherwise, the copy constructor is implicitly defined. + */ + GenericMemberIterator(const NonConstIterator & it) : ptr_(it.ptr_) {} + Iterator& operator=(const NonConstIterator & it) { ptr_ = it.ptr_; return *this; } + + //! @name stepping + //@{ + Iterator& operator++(){ ++ptr_; return *this; } + Iterator& operator--(){ --ptr_; return *this; } + Iterator operator++(int){ Iterator old(*this); ++ptr_; return old; } + Iterator operator--(int){ Iterator old(*this); --ptr_; return old; } + //@} + + //! @name increment/decrement + //@{ + Iterator operator+(DifferenceType n) const { return Iterator(ptr_+n); } + Iterator operator-(DifferenceType n) const { return Iterator(ptr_-n); } + + Iterator& operator+=(DifferenceType n) { ptr_+=n; return *this; } + Iterator& operator-=(DifferenceType n) { ptr_-=n; return *this; } + //@} + + //! @name relations + //@{ + template bool operator==(const GenericMemberIterator& that) const { return ptr_ == that.ptr_; } + template bool operator!=(const GenericMemberIterator& that) const { return ptr_ != that.ptr_; } + template bool operator<=(const GenericMemberIterator& that) const { return ptr_ <= that.ptr_; } + template bool operator>=(const GenericMemberIterator& that) const { return ptr_ >= that.ptr_; } + template bool operator< (const GenericMemberIterator& that) const { return ptr_ < that.ptr_; } + template bool operator> (const GenericMemberIterator& that) const { return ptr_ > that.ptr_; } + +#ifdef __cpp_lib_three_way_comparison + template std::strong_ordering operator<=>(const GenericMemberIterator& that) const { return ptr_ <=> that.ptr_; } +#endif + //@} + + //! @name dereference + //@{ + Reference operator*() const { return *ptr_; } + Pointer operator->() const { return ptr_; } + Reference operator[](DifferenceType n) const { return ptr_[n]; } + //@} + + //! Distance + DifferenceType operator-(ConstIterator that) const { return ptr_-that.ptr_; } + +private: + //! Internal constructor from plain pointer + explicit GenericMemberIterator(Pointer p) : ptr_(p) {} + + Pointer ptr_; //!< raw pointer +}; + +#else // RAPIDJSON_NOMEMBERITERATORCLASS + +// class-based member iterator implementation disabled, use plain pointers + +template +class GenericMemberIterator; + +//! non-const GenericMemberIterator +template +class GenericMemberIterator { +public: + //! use plain pointer as iterator type + typedef GenericMember* Iterator; +}; +//! const GenericMemberIterator +template +class GenericMemberIterator { +public: + //! use plain const pointer as iterator type + typedef const GenericMember* Iterator; +}; + +#endif // RAPIDJSON_NOMEMBERITERATORCLASS + +/////////////////////////////////////////////////////////////////////////////// +// GenericStringRef + +//! Reference to a constant string (not taking a copy) +/*! + \tparam CharType character type of the string + + This helper class is used to automatically infer constant string + references for string literals, especially from \c const \b (!) + character arrays. + + The main use is for creating JSON string values without copying the + source string via an \ref Allocator. This requires that the referenced + string pointers have a sufficient lifetime, which exceeds the lifetime + of the associated GenericValue. + + \b Example + \code + Value v("foo"); // ok, no need to copy & calculate length + const char foo[] = "foo"; + v.SetString(foo); // ok + + const char* bar = foo; + // Value x(bar); // not ok, can't rely on bar's lifetime + Value x(StringRef(bar)); // lifetime explicitly guaranteed by user + Value y(StringRef(bar, 3)); // ok, explicitly pass length + \endcode + + \see StringRef, GenericValue::SetString +*/ +template +struct GenericStringRef { + typedef CharType Ch; //!< character type of the string + + //! Create string reference from \c const character array +#ifndef __clang__ // -Wdocumentation + /*! + This constructor implicitly creates a constant string reference from + a \c const character array. It has better performance than + \ref StringRef(const CharType*) by inferring the string \ref length + from the array length, and also supports strings containing null + characters. + + \tparam N length of the string, automatically inferred + + \param str Constant character array, lifetime assumed to be longer + than the use of the string in e.g. a GenericValue + + \post \ref s == str + + \note Constant complexity. + \note There is a hidden, private overload to disallow references to + non-const character arrays to be created via this constructor. + By this, e.g. function-scope arrays used to be filled via + \c snprintf are excluded from consideration. + In such cases, the referenced string should be \b copied to the + GenericValue instead. + */ +#endif + template + GenericStringRef(const CharType (&str)[N]) RAPIDJSON_NOEXCEPT + : s(str), length(N-1) {} + + //! Explicitly create string reference from \c const character pointer +#ifndef __clang__ // -Wdocumentation + /*! + This constructor can be used to \b explicitly create a reference to + a constant string pointer. + + \see StringRef(const CharType*) + + \param str Constant character pointer, lifetime assumed to be longer + than the use of the string in e.g. a GenericValue + + \post \ref s == str + + \note There is a hidden, private overload to disallow references to + non-const character arrays to be created via this constructor. + By this, e.g. function-scope arrays used to be filled via + \c snprintf are excluded from consideration. + In such cases, the referenced string should be \b copied to the + GenericValue instead. + */ +#endif + explicit GenericStringRef(const CharType* str) + : s(str), length(NotNullStrLen(str)) {} + + //! Create constant string reference from pointer and length +#ifndef __clang__ // -Wdocumentation + /*! \param str constant string, lifetime assumed to be longer than the use of the string in e.g. a GenericValue + \param len length of the string, excluding the trailing NULL terminator + + \post \ref s == str && \ref length == len + \note Constant complexity. + */ +#endif + GenericStringRef(const CharType* str, SizeType len) + : s(RAPIDJSON_LIKELY(str) ? str : emptyString), length(len) { RAPIDJSON_ASSERT(str != 0 || len == 0u); } + + GenericStringRef(const GenericStringRef& rhs) : s(rhs.s), length(rhs.length) {} + + //! implicit conversion to plain CharType pointer + operator const Ch *() const { return s; } + + const Ch* const s; //!< plain CharType pointer + const SizeType length; //!< length of the string (excluding the trailing NULL terminator) + +private: + SizeType NotNullStrLen(const CharType* str) { + RAPIDJSON_ASSERT(str != 0); + return internal::StrLen(str); + } + + /// Empty string - used when passing in a NULL pointer + static const Ch emptyString[]; + + //! Disallow construction from non-const array + template + GenericStringRef(CharType (&str)[N]) /* = delete */; + //! Copy assignment operator not permitted - immutable type + GenericStringRef& operator=(const GenericStringRef& rhs) /* = delete */; +}; + +template +const CharType GenericStringRef::emptyString[] = { CharType() }; + +//! Mark a character pointer as constant string +/*! Mark a plain character pointer as a "string literal". This function + can be used to avoid copying a character string to be referenced as a + value in a JSON GenericValue object, if the string's lifetime is known + to be valid long enough. + \tparam CharType Character type of the string + \param str Constant string, lifetime assumed to be longer than the use of the string in e.g. a GenericValue + \return GenericStringRef string reference object + \relatesalso GenericStringRef + + \see GenericValue::GenericValue(StringRefType), GenericValue::operator=(StringRefType), GenericValue::SetString(StringRefType), GenericValue::PushBack(StringRefType, Allocator&), GenericValue::AddMember +*/ +template +inline GenericStringRef StringRef(const CharType* str) { + return GenericStringRef(str); +} + +//! Mark a character pointer as constant string +/*! Mark a plain character pointer as a "string literal". This function + can be used to avoid copying a character string to be referenced as a + value in a JSON GenericValue object, if the string's lifetime is known + to be valid long enough. + + This version has better performance with supplied length, and also + supports string containing null characters. + + \tparam CharType character type of the string + \param str Constant string, lifetime assumed to be longer than the use of the string in e.g. a GenericValue + \param length The length of source string. + \return GenericStringRef string reference object + \relatesalso GenericStringRef +*/ +template +inline GenericStringRef StringRef(const CharType* str, size_t length) { + return GenericStringRef(str, SizeType(length)); +} + +#if RAPIDJSON_HAS_STDSTRING +//! Mark a string object as constant string +/*! Mark a string object (e.g. \c std::string) as a "string literal". + This function can be used to avoid copying a string to be referenced as a + value in a JSON GenericValue object, if the string's lifetime is known + to be valid long enough. + + \tparam CharType character type of the string + \param str Constant string, lifetime assumed to be longer than the use of the string in e.g. a GenericValue + \return GenericStringRef string reference object + \relatesalso GenericStringRef + \note Requires the definition of the preprocessor symbol \ref RAPIDJSON_HAS_STDSTRING. +*/ +template +inline GenericStringRef StringRef(const std::basic_string& str) { + return GenericStringRef(str.data(), SizeType(str.size())); +} +#endif + +/////////////////////////////////////////////////////////////////////////////// +// GenericValue type traits +namespace internal { + +template +struct IsGenericValueImpl : FalseType {}; + +// select candidates according to nested encoding and allocator types +template struct IsGenericValueImpl::Type, typename Void::Type> + : IsBaseOf, T>::Type {}; + +// helper to match arbitrary GenericValue instantiations, including derived classes +template struct IsGenericValue : IsGenericValueImpl::Type {}; + +} // namespace internal + +/////////////////////////////////////////////////////////////////////////////// +// TypeHelper + +namespace internal { + +template +struct TypeHelper {}; + +template +struct TypeHelper { + static bool Is(const ValueType& v) { return v.IsBool(); } + static bool Get(const ValueType& v) { return v.GetBool(); } + static ValueType& Set(ValueType& v, bool data) { return v.SetBool(data); } + static ValueType& Set(ValueType& v, bool data, typename ValueType::AllocatorType&) { return v.SetBool(data); } +}; + +template +struct TypeHelper { + static bool Is(const ValueType& v) { return v.IsInt(); } + static int Get(const ValueType& v) { return v.GetInt(); } + static ValueType& Set(ValueType& v, int data) { return v.SetInt(data); } + static ValueType& Set(ValueType& v, int data, typename ValueType::AllocatorType&) { return v.SetInt(data); } +}; + +template +struct TypeHelper { + static bool Is(const ValueType& v) { return v.IsUint(); } + static unsigned Get(const ValueType& v) { return v.GetUint(); } + static ValueType& Set(ValueType& v, unsigned data) { return v.SetUint(data); } + static ValueType& Set(ValueType& v, unsigned data, typename ValueType::AllocatorType&) { return v.SetUint(data); } +}; + +#ifdef _MSC_VER +RAPIDJSON_STATIC_ASSERT(sizeof(long) == sizeof(int)); +template +struct TypeHelper { + static bool Is(const ValueType& v) { return v.IsInt(); } + static long Get(const ValueType& v) { return v.GetInt(); } + static ValueType& Set(ValueType& v, long data) { return v.SetInt(data); } + static ValueType& Set(ValueType& v, long data, typename ValueType::AllocatorType&) { return v.SetInt(data); } +}; + +RAPIDJSON_STATIC_ASSERT(sizeof(unsigned long) == sizeof(unsigned)); +template +struct TypeHelper { + static bool Is(const ValueType& v) { return v.IsUint(); } + static unsigned long Get(const ValueType& v) { return v.GetUint(); } + static ValueType& Set(ValueType& v, unsigned long data) { return v.SetUint(data); } + static ValueType& Set(ValueType& v, unsigned long data, typename ValueType::AllocatorType&) { return v.SetUint(data); } +}; +#endif + +template +struct TypeHelper { + static bool Is(const ValueType& v) { return v.IsInt64(); } + static int64_t Get(const ValueType& v) { return v.GetInt64(); } + static ValueType& Set(ValueType& v, int64_t data) { return v.SetInt64(data); } + static ValueType& Set(ValueType& v, int64_t data, typename ValueType::AllocatorType&) { return v.SetInt64(data); } +}; + +template +struct TypeHelper { + static bool Is(const ValueType& v) { return v.IsUint64(); } + static uint64_t Get(const ValueType& v) { return v.GetUint64(); } + static ValueType& Set(ValueType& v, uint64_t data) { return v.SetUint64(data); } + static ValueType& Set(ValueType& v, uint64_t data, typename ValueType::AllocatorType&) { return v.SetUint64(data); } +}; + +template +struct TypeHelper { + static bool Is(const ValueType& v) { return v.IsDouble(); } + static double Get(const ValueType& v) { return v.GetDouble(); } + static ValueType& Set(ValueType& v, double data) { return v.SetDouble(data); } + static ValueType& Set(ValueType& v, double data, typename ValueType::AllocatorType&) { return v.SetDouble(data); } +}; + +template +struct TypeHelper { + static bool Is(const ValueType& v) { return v.IsFloat(); } + static float Get(const ValueType& v) { return v.GetFloat(); } + static ValueType& Set(ValueType& v, float data) { return v.SetFloat(data); } + static ValueType& Set(ValueType& v, float data, typename ValueType::AllocatorType&) { return v.SetFloat(data); } +}; + +template +struct TypeHelper { + typedef const typename ValueType::Ch* StringType; + static bool Is(const ValueType& v) { return v.IsString(); } + static StringType Get(const ValueType& v) { return v.GetString(); } + static ValueType& Set(ValueType& v, const StringType data) { return v.SetString(typename ValueType::StringRefType(data)); } + static ValueType& Set(ValueType& v, const StringType data, typename ValueType::AllocatorType& a) { return v.SetString(data, a); } +}; + +#if RAPIDJSON_HAS_STDSTRING +template +struct TypeHelper > { + typedef std::basic_string StringType; + static bool Is(const ValueType& v) { return v.IsString(); } + static StringType Get(const ValueType& v) { return StringType(v.GetString(), v.GetStringLength()); } + static ValueType& Set(ValueType& v, const StringType& data, typename ValueType::AllocatorType& a) { return v.SetString(data, a); } +}; +#endif + +template +struct TypeHelper { + typedef typename ValueType::Array ArrayType; + static bool Is(const ValueType& v) { return v.IsArray(); } + static ArrayType Get(ValueType& v) { return v.GetArray(); } + static ValueType& Set(ValueType& v, ArrayType data) { return v = data; } + static ValueType& Set(ValueType& v, ArrayType data, typename ValueType::AllocatorType&) { return v = data; } +}; + +template +struct TypeHelper { + typedef typename ValueType::ConstArray ArrayType; + static bool Is(const ValueType& v) { return v.IsArray(); } + static ArrayType Get(const ValueType& v) { return v.GetArray(); } +}; + +template +struct TypeHelper { + typedef typename ValueType::Object ObjectType; + static bool Is(const ValueType& v) { return v.IsObject(); } + static ObjectType Get(ValueType& v) { return v.GetObject(); } + static ValueType& Set(ValueType& v, ObjectType data) { return v = data; } + static ValueType& Set(ValueType& v, ObjectType data, typename ValueType::AllocatorType&) { return v = data; } +}; + +template +struct TypeHelper { + typedef typename ValueType::ConstObject ObjectType; + static bool Is(const ValueType& v) { return v.IsObject(); } + static ObjectType Get(const ValueType& v) { return v.GetObject(); } +}; + +} // namespace internal + +// Forward declarations +template class GenericArray; +template class GenericObject; + +/////////////////////////////////////////////////////////////////////////////// +// GenericValue + +//! Represents a JSON value. Use Value for UTF8 encoding and default allocator. +/*! + A JSON value can be one of 7 types. This class is a variant type supporting + these types. + + Use the Value if UTF8 and default allocator + + \tparam Encoding Encoding of the value. (Even non-string values need to have the same encoding in a document) + \tparam Allocator Allocator type for allocating memory of object, array and string. +*/ +template +class GenericValue { +public: + //! Name-value pair in an object. + typedef GenericMember Member; + typedef Encoding EncodingType; //!< Encoding type from template parameter. + typedef Allocator AllocatorType; //!< Allocator type from template parameter. + typedef typename Encoding::Ch Ch; //!< Character type derived from Encoding. + typedef GenericStringRef StringRefType; //!< Reference to a constant string + typedef typename GenericMemberIterator::Iterator MemberIterator; //!< Member iterator for iterating in object. + typedef typename GenericMemberIterator::Iterator ConstMemberIterator; //!< Constant member iterator for iterating in object. + typedef GenericValue* ValueIterator; //!< Value iterator for iterating in array. + typedef const GenericValue* ConstValueIterator; //!< Constant value iterator for iterating in array. + typedef GenericValue ValueType; //!< Value type of itself. + typedef GenericArray Array; + typedef GenericArray ConstArray; + typedef GenericObject Object; + typedef GenericObject ConstObject; + + //!@name Constructors and destructor. + //@{ + + //! Default constructor creates a null value. + GenericValue() RAPIDJSON_NOEXCEPT : data_() { data_.f.flags = kNullFlag; } + +#if RAPIDJSON_HAS_CXX11_RVALUE_REFS + //! Move constructor in C++11 + GenericValue(GenericValue&& rhs) RAPIDJSON_NOEXCEPT : data_(rhs.data_) { + rhs.data_.f.flags = kNullFlag; // give up contents + } +#endif + +private: + //! Copy constructor is not permitted. + GenericValue(const GenericValue& rhs); + +#if RAPIDJSON_HAS_CXX11_RVALUE_REFS + //! Moving from a GenericDocument is not permitted. + template + GenericValue(GenericDocument&& rhs); + + //! Move assignment from a GenericDocument is not permitted. + template + GenericValue& operator=(GenericDocument&& rhs); +#endif + +public: + + //! Constructor with JSON value type. + /*! This creates a Value of specified type with default content. + \param type Type of the value. + \note Default content for number is zero. + */ + explicit GenericValue(Type type) RAPIDJSON_NOEXCEPT : data_() { + static const uint16_t defaultFlags[] = { + kNullFlag, kFalseFlag, kTrueFlag, kObjectFlag, kArrayFlag, kShortStringFlag, + kNumberAnyFlag + }; + RAPIDJSON_NOEXCEPT_ASSERT(type >= kNullType && type <= kNumberType); + data_.f.flags = defaultFlags[type]; + + // Use ShortString to store empty string. + if (type == kStringType) + data_.ss.SetLength(0); + } + + //! Explicit copy constructor (with allocator) + /*! Creates a copy of a Value by using the given Allocator + \tparam SourceAllocator allocator of \c rhs + \param rhs Value to copy from (read-only) + \param allocator Allocator for allocating copied elements and buffers. Commonly use GenericDocument::GetAllocator(). + \param copyConstStrings Force copying of constant strings (e.g. referencing an in-situ buffer) + \see CopyFrom() + */ + template + GenericValue(const GenericValue& rhs, Allocator& allocator, bool copyConstStrings = false) { + switch (rhs.GetType()) { + case kObjectType: + DoCopyMembers(rhs, allocator, copyConstStrings); + break; + case kArrayType: { + SizeType count = rhs.data_.a.size; + GenericValue* le = reinterpret_cast(allocator.Malloc(count * sizeof(GenericValue))); + const GenericValue* re = rhs.GetElementsPointer(); + for (SizeType i = 0; i < count; i++) + new (&le[i]) GenericValue(re[i], allocator, copyConstStrings); + data_.f.flags = kArrayFlag; + data_.a.size = data_.a.capacity = count; + SetElementsPointer(le); + } + break; + case kStringType: + if (rhs.data_.f.flags == kConstStringFlag && !copyConstStrings) { + data_.f.flags = rhs.data_.f.flags; + data_ = *reinterpret_cast(&rhs.data_); + } + else + SetStringRaw(StringRef(rhs.GetString(), rhs.GetStringLength()), allocator); + break; + default: + data_.f.flags = rhs.data_.f.flags; + data_ = *reinterpret_cast(&rhs.data_); + break; + } + } + + //! Constructor for boolean value. + /*! \param b Boolean value + \note This constructor is limited to \em real boolean values and rejects + implicitly converted types like arbitrary pointers. Use an explicit cast + to \c bool, if you want to construct a boolean JSON value in such cases. + */ +#ifndef RAPIDJSON_DOXYGEN_RUNNING // hide SFINAE from Doxygen + template + explicit GenericValue(T b, RAPIDJSON_ENABLEIF((internal::IsSame))) RAPIDJSON_NOEXCEPT // See #472 +#else + explicit GenericValue(bool b) RAPIDJSON_NOEXCEPT +#endif + : data_() { + // safe-guard against failing SFINAE + RAPIDJSON_STATIC_ASSERT((internal::IsSame::Value)); + data_.f.flags = b ? kTrueFlag : kFalseFlag; + } + + //! Constructor for int value. + explicit GenericValue(int i) RAPIDJSON_NOEXCEPT : data_() { + data_.n.i64 = i; + data_.f.flags = (i >= 0) ? (kNumberIntFlag | kUintFlag | kUint64Flag) : kNumberIntFlag; + } + + //! Constructor for unsigned value. + explicit GenericValue(unsigned u) RAPIDJSON_NOEXCEPT : data_() { + data_.n.u64 = u; + data_.f.flags = (u & 0x80000000) ? kNumberUintFlag : (kNumberUintFlag | kIntFlag | kInt64Flag); + } + + //! Constructor for int64_t value. + explicit GenericValue(int64_t i64) RAPIDJSON_NOEXCEPT : data_() { + data_.n.i64 = i64; + data_.f.flags = kNumberInt64Flag; + if (i64 >= 0) { + data_.f.flags |= kNumberUint64Flag; + if (!(static_cast(i64) & RAPIDJSON_UINT64_C2(0xFFFFFFFF, 0x00000000))) + data_.f.flags |= kUintFlag; + if (!(static_cast(i64) & RAPIDJSON_UINT64_C2(0xFFFFFFFF, 0x80000000))) + data_.f.flags |= kIntFlag; + } + else if (i64 >= static_cast(RAPIDJSON_UINT64_C2(0xFFFFFFFF, 0x80000000))) + data_.f.flags |= kIntFlag; + } + + //! Constructor for uint64_t value. + explicit GenericValue(uint64_t u64) RAPIDJSON_NOEXCEPT : data_() { + data_.n.u64 = u64; + data_.f.flags = kNumberUint64Flag; + if (!(u64 & RAPIDJSON_UINT64_C2(0x80000000, 0x00000000))) + data_.f.flags |= kInt64Flag; + if (!(u64 & RAPIDJSON_UINT64_C2(0xFFFFFFFF, 0x00000000))) + data_.f.flags |= kUintFlag; + if (!(u64 & RAPIDJSON_UINT64_C2(0xFFFFFFFF, 0x80000000))) + data_.f.flags |= kIntFlag; + } + + //! Constructor for double value. + explicit GenericValue(double d) RAPIDJSON_NOEXCEPT : data_() { data_.n.d = d; data_.f.flags = kNumberDoubleFlag; } + + //! Constructor for float value. + explicit GenericValue(float f) RAPIDJSON_NOEXCEPT : data_() { data_.n.d = static_cast(f); data_.f.flags = kNumberDoubleFlag; } + + //! Constructor for constant string (i.e. do not make a copy of string) + GenericValue(const Ch* s, SizeType length) RAPIDJSON_NOEXCEPT : data_() { SetStringRaw(StringRef(s, length)); } + + //! Constructor for constant string (i.e. do not make a copy of string) + explicit GenericValue(StringRefType s) RAPIDJSON_NOEXCEPT : data_() { SetStringRaw(s); } + + //! Constructor for copy-string (i.e. do make a copy of string) + GenericValue(const Ch* s, SizeType length, Allocator& allocator) : data_() { SetStringRaw(StringRef(s, length), allocator); } + + //! Constructor for copy-string (i.e. do make a copy of string) + GenericValue(const Ch*s, Allocator& allocator) : data_() { SetStringRaw(StringRef(s), allocator); } + +#if RAPIDJSON_HAS_STDSTRING + //! Constructor for copy-string from a string object (i.e. do make a copy of string) + /*! \note Requires the definition of the preprocessor symbol \ref RAPIDJSON_HAS_STDSTRING. + */ + GenericValue(const std::basic_string& s, Allocator& allocator) : data_() { SetStringRaw(StringRef(s), allocator); } +#endif + + //! Constructor for Array. + /*! + \param a An array obtained by \c GetArray(). + \note \c Array is always pass-by-value. + \note the source array is moved into this value and the sourec array becomes empty. + */ + GenericValue(Array a) RAPIDJSON_NOEXCEPT : data_(a.value_.data_) { + a.value_.data_ = Data(); + a.value_.data_.f.flags = kArrayFlag; + } + + //! Constructor for Object. + /*! + \param o An object obtained by \c GetObject(). + \note \c Object is always pass-by-value. + \note the source object is moved into this value and the sourec object becomes empty. + */ + GenericValue(Object o) RAPIDJSON_NOEXCEPT : data_(o.value_.data_) { + o.value_.data_ = Data(); + o.value_.data_.f.flags = kObjectFlag; + } + + //! Destructor. + /*! Need to destruct elements of array, members of object, or copy-string. + */ + ~GenericValue() { + // With RAPIDJSON_USE_MEMBERSMAP, the maps need to be destroyed to release + // their Allocator if it's refcounted (e.g. MemoryPoolAllocator). + if (Allocator::kNeedFree || (RAPIDJSON_USE_MEMBERSMAP+0 && + internal::IsRefCounted::Value)) { + switch(data_.f.flags) { + case kArrayFlag: + { + GenericValue* e = GetElementsPointer(); + for (GenericValue* v = e; v != e + data_.a.size; ++v) + v->~GenericValue(); + if (Allocator::kNeedFree) { // Shortcut by Allocator's trait + Allocator::Free(e); + } + } + break; + + case kObjectFlag: + DoFreeMembers(); + break; + + case kCopyStringFlag: + if (Allocator::kNeedFree) { // Shortcut by Allocator's trait + Allocator::Free(const_cast(GetStringPointer())); + } + break; + + default: + break; // Do nothing for other types. + } + } + } + + //@} + + //!@name Assignment operators + //@{ + + //! Assignment with move semantics. + /*! \param rhs Source of the assignment. It will become a null value after assignment. + */ + GenericValue& operator=(GenericValue& rhs) RAPIDJSON_NOEXCEPT { + if (RAPIDJSON_LIKELY(this != &rhs)) { + // Can't destroy "this" before assigning "rhs", otherwise "rhs" + // could be used after free if it's an sub-Value of "this", + // hence the temporary danse. + GenericValue temp; + temp.RawAssign(rhs); + this->~GenericValue(); + RawAssign(temp); + } + return *this; + } + +#if RAPIDJSON_HAS_CXX11_RVALUE_REFS + //! Move assignment in C++11 + GenericValue& operator=(GenericValue&& rhs) RAPIDJSON_NOEXCEPT { + return *this = rhs.Move(); + } +#endif + + //! Assignment of constant string reference (no copy) + /*! \param str Constant string reference to be assigned + \note This overload is needed to avoid clashes with the generic primitive type assignment overload below. + \see GenericStringRef, operator=(T) + */ + GenericValue& operator=(StringRefType str) RAPIDJSON_NOEXCEPT { + GenericValue s(str); + return *this = s; + } + + //! Assignment with primitive types. + /*! \tparam T Either \ref Type, \c int, \c unsigned, \c int64_t, \c uint64_t + \param value The value to be assigned. + + \note The source type \c T explicitly disallows all pointer types, + especially (\c const) \ref Ch*. This helps avoiding implicitly + referencing character strings with insufficient lifetime, use + \ref SetString(const Ch*, Allocator&) (for copying) or + \ref StringRef() (to explicitly mark the pointer as constant) instead. + All other pointer types would implicitly convert to \c bool, + use \ref SetBool() instead. + */ + template + RAPIDJSON_DISABLEIF_RETURN((internal::IsPointer), (GenericValue&)) + operator=(T value) { + GenericValue v(value); + return *this = v; + } + + //! Deep-copy assignment from Value + /*! Assigns a \b copy of the Value to the current Value object + \tparam SourceAllocator Allocator type of \c rhs + \param rhs Value to copy from (read-only) + \param allocator Allocator to use for copying + \param copyConstStrings Force copying of constant strings (e.g. referencing an in-situ buffer) + */ + template + GenericValue& CopyFrom(const GenericValue& rhs, Allocator& allocator, bool copyConstStrings = false) { + RAPIDJSON_ASSERT(static_cast(this) != static_cast(&rhs)); + this->~GenericValue(); + new (this) GenericValue(rhs, allocator, copyConstStrings); + return *this; + } + + //! Exchange the contents of this value with those of other. + /*! + \param other Another value. + \note Constant complexity. + */ + GenericValue& Swap(GenericValue& other) RAPIDJSON_NOEXCEPT { + GenericValue temp; + temp.RawAssign(*this); + RawAssign(other); + other.RawAssign(temp); + return *this; + } + + //! free-standing swap function helper + /*! + Helper function to enable support for common swap implementation pattern based on \c std::swap: + \code + void swap(MyClass& a, MyClass& b) { + using std::swap; + swap(a.value, b.value); + // ... + } + \endcode + \see Swap() + */ + friend inline void swap(GenericValue& a, GenericValue& b) RAPIDJSON_NOEXCEPT { a.Swap(b); } + + //! Prepare Value for move semantics + /*! \return *this */ + GenericValue& Move() RAPIDJSON_NOEXCEPT { return *this; } + //@} + + //!@name Equal-to and not-equal-to operators + //@{ + //! Equal-to operator + /*! + \note If an object contains duplicated named member, comparing equality with any object is always \c false. + \note Complexity is quadratic in Object's member number and linear for the rest (number of all values in the subtree and total lengths of all strings). + */ + template + bool operator==(const GenericValue& rhs) const { + typedef GenericValue RhsType; + if (GetType() != rhs.GetType()) + return false; + + switch (GetType()) { + case kObjectType: // Warning: O(n^2) inner-loop + if (data_.o.size != rhs.data_.o.size) + return false; + for (ConstMemberIterator lhsMemberItr = MemberBegin(); lhsMemberItr != MemberEnd(); ++lhsMemberItr) { + typename RhsType::ConstMemberIterator rhsMemberItr = rhs.FindMember(lhsMemberItr->name); + if (rhsMemberItr == rhs.MemberEnd() || lhsMemberItr->value != rhsMemberItr->value) + return false; + } + return true; + + case kArrayType: + if (data_.a.size != rhs.data_.a.size) + return false; + for (SizeType i = 0; i < data_.a.size; i++) + if ((*this)[i] != rhs[i]) + return false; + return true; + + case kStringType: + return StringEqual(rhs); + + case kNumberType: + if (IsDouble() || rhs.IsDouble()) { + double a = GetDouble(); // May convert from integer to double. + double b = rhs.GetDouble(); // Ditto + return a >= b && a <= b; // Prevent -Wfloat-equal + } + else + return data_.n.u64 == rhs.data_.n.u64; + + default: + return true; + } + } + + //! Equal-to operator with const C-string pointer + bool operator==(const Ch* rhs) const { return *this == GenericValue(StringRef(rhs)); } + +#if RAPIDJSON_HAS_STDSTRING + //! Equal-to operator with string object + /*! \note Requires the definition of the preprocessor symbol \ref RAPIDJSON_HAS_STDSTRING. + */ + bool operator==(const std::basic_string& rhs) const { return *this == GenericValue(StringRef(rhs)); } +#endif + + //! Equal-to operator with primitive types + /*! \tparam T Either \ref Type, \c int, \c unsigned, \c int64_t, \c uint64_t, \c double, \c true, \c false + */ + template RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr,internal::IsGenericValue >), (bool)) operator==(const T& rhs) const { return *this == GenericValue(rhs); } + + //! Not-equal-to operator + /*! \return !(*this == rhs) + */ + template + bool operator!=(const GenericValue& rhs) const { return !(*this == rhs); } + + //! Not-equal-to operator with const C-string pointer + bool operator!=(const Ch* rhs) const { return !(*this == rhs); } + + //! Not-equal-to operator with arbitrary types + /*! \return !(*this == rhs) + */ + template RAPIDJSON_DISABLEIF_RETURN((internal::IsGenericValue), (bool)) operator!=(const T& rhs) const { return !(*this == rhs); } + +#ifndef __cpp_impl_three_way_comparison + //! Equal-to operator with arbitrary types (symmetric version) + /*! \return (rhs == lhs) + */ + template friend RAPIDJSON_DISABLEIF_RETURN((internal::IsGenericValue), (bool)) operator==(const T& lhs, const GenericValue& rhs) { return rhs == lhs; } + + //! Not-Equal-to operator with arbitrary types (symmetric version) + /*! \return !(rhs == lhs) + */ + template friend RAPIDJSON_DISABLEIF_RETURN((internal::IsGenericValue), (bool)) operator!=(const T& lhs, const GenericValue& rhs) { return !(rhs == lhs); } + //@} +#endif + + //!@name Type + //@{ + + Type GetType() const { return static_cast(data_.f.flags & kTypeMask); } + bool IsNull() const { return data_.f.flags == kNullFlag; } + bool IsFalse() const { return data_.f.flags == kFalseFlag; } + bool IsTrue() const { return data_.f.flags == kTrueFlag; } + bool IsBool() const { return (data_.f.flags & kBoolFlag) != 0; } + bool IsObject() const { return data_.f.flags == kObjectFlag; } + bool IsArray() const { return data_.f.flags == kArrayFlag; } + bool IsNumber() const { return (data_.f.flags & kNumberFlag) != 0; } + bool IsInt() const { return (data_.f.flags & kIntFlag) != 0; } + bool IsUint() const { return (data_.f.flags & kUintFlag) != 0; } + bool IsInt64() const { return (data_.f.flags & kInt64Flag) != 0; } + bool IsUint64() const { return (data_.f.flags & kUint64Flag) != 0; } + bool IsDouble() const { return (data_.f.flags & kDoubleFlag) != 0; } + bool IsString() const { return (data_.f.flags & kStringFlag) != 0; } + + // Checks whether a number can be losslessly converted to a double. + bool IsLosslessDouble() const { + if (!IsNumber()) return false; + if (IsUint64()) { + uint64_t u = GetUint64(); + volatile double d = static_cast(u); + return (d >= 0.0) + && (d < static_cast((std::numeric_limits::max)())) + && (u == static_cast(d)); + } + if (IsInt64()) { + int64_t i = GetInt64(); + volatile double d = static_cast(i); + return (d >= static_cast((std::numeric_limits::min)())) + && (d < static_cast((std::numeric_limits::max)())) + && (i == static_cast(d)); + } + return true; // double, int, uint are always lossless + } + + // Checks whether a number is a float (possible lossy). + bool IsFloat() const { + if ((data_.f.flags & kDoubleFlag) == 0) + return false; + double d = GetDouble(); + return d >= -3.4028234e38 && d <= 3.4028234e38; + } + // Checks whether a number can be losslessly converted to a float. + bool IsLosslessFloat() const { + if (!IsNumber()) return false; + double a = GetDouble(); + if (a < static_cast(-(std::numeric_limits::max)()) + || a > static_cast((std::numeric_limits::max)())) + return false; + double b = static_cast(static_cast(a)); + return a >= b && a <= b; // Prevent -Wfloat-equal + } + + //@} + + //!@name Null + //@{ + + GenericValue& SetNull() { this->~GenericValue(); new (this) GenericValue(); return *this; } + + //@} + + //!@name Bool + //@{ + + bool GetBool() const { RAPIDJSON_ASSERT(IsBool()); return data_.f.flags == kTrueFlag; } + //!< Set boolean value + /*! \post IsBool() == true */ + GenericValue& SetBool(bool b) { this->~GenericValue(); new (this) GenericValue(b); return *this; } + + //@} + + //!@name Object + //@{ + + //! Set this value as an empty object. + /*! \post IsObject() == true */ + GenericValue& SetObject() { this->~GenericValue(); new (this) GenericValue(kObjectType); return *this; } + + //! Get the number of members in the object. + SizeType MemberCount() const { RAPIDJSON_ASSERT(IsObject()); return data_.o.size; } + + //! Get the capacity of object. + SizeType MemberCapacity() const { RAPIDJSON_ASSERT(IsObject()); return data_.o.capacity; } + + //! Check whether the object is empty. + bool ObjectEmpty() const { RAPIDJSON_ASSERT(IsObject()); return data_.o.size == 0; } + + //! Get a value from an object associated with the name. + /*! \pre IsObject() == true + \tparam T Either \c Ch or \c const \c Ch (template used for disambiguation with \ref operator[](SizeType)) + \note In version 0.1x, if the member is not found, this function returns a null value. This makes issue 7. + Since 0.2, if the name is not correct, it will assert. + If user is unsure whether a member exists, user should use HasMember() first. + A better approach is to use FindMember(). + \note Linear time complexity. + */ + template + RAPIDJSON_DISABLEIF_RETURN((internal::NotExpr::Type, Ch> >),(GenericValue&)) operator[](T* name) { + GenericValue n(StringRef(name)); + return (*this)[n]; + } + template + RAPIDJSON_DISABLEIF_RETURN((internal::NotExpr::Type, Ch> >),(const GenericValue&)) operator[](T* name) const { return const_cast(*this)[name]; } + + //! Get a value from an object associated with the name. + /*! \pre IsObject() == true + \tparam SourceAllocator Allocator of the \c name value + + \note Compared to \ref operator[](T*), this version is faster because it does not need a StrLen(). + And it can also handle strings with embedded null characters. + + \note Linear time complexity. + */ + template + GenericValue& operator[](const GenericValue& name) { + MemberIterator member = FindMember(name); + if (member != MemberEnd()) + return member->value; + else { + RAPIDJSON_ASSERT(false); // see above note + +#if RAPIDJSON_HAS_CXX11 + // Use thread-local storage to prevent races between threads. + // Use static buffer and placement-new to prevent destruction, with + // alignas() to ensure proper alignment. + alignas(GenericValue) thread_local static char buffer[sizeof(GenericValue)]; + return *new (buffer) GenericValue(); +#elif defined(_MSC_VER) && _MSC_VER < 1900 + // There's no way to solve both thread locality and proper alignment + // simultaneously. + __declspec(thread) static char buffer[sizeof(GenericValue)]; + return *new (buffer) GenericValue(); +#elif defined(__GNUC__) || defined(__clang__) + // This will generate -Wexit-time-destructors in clang, but that's + // better than having under-alignment. + __thread static GenericValue buffer; + return buffer; +#else + // Don't know what compiler this is, so don't know how to ensure + // thread-locality. + static GenericValue buffer; + return buffer; +#endif + } + } + template + const GenericValue& operator[](const GenericValue& name) const { return const_cast(*this)[name]; } + +#if RAPIDJSON_HAS_STDSTRING + //! Get a value from an object associated with name (string object). + GenericValue& operator[](const std::basic_string& name) { return (*this)[GenericValue(StringRef(name))]; } + const GenericValue& operator[](const std::basic_string& name) const { return (*this)[GenericValue(StringRef(name))]; } +#endif + + //! Const member iterator + /*! \pre IsObject() == true */ + ConstMemberIterator MemberBegin() const { RAPIDJSON_ASSERT(IsObject()); return ConstMemberIterator(GetMembersPointer()); } + //! Const \em past-the-end member iterator + /*! \pre IsObject() == true */ + ConstMemberIterator MemberEnd() const { RAPIDJSON_ASSERT(IsObject()); return ConstMemberIterator(GetMembersPointer() + data_.o.size); } + //! Member iterator + /*! \pre IsObject() == true */ + MemberIterator MemberBegin() { RAPIDJSON_ASSERT(IsObject()); return MemberIterator(GetMembersPointer()); } + //! \em Past-the-end member iterator + /*! \pre IsObject() == true */ + MemberIterator MemberEnd() { RAPIDJSON_ASSERT(IsObject()); return MemberIterator(GetMembersPointer() + data_.o.size); } + + //! Request the object to have enough capacity to store members. + /*! \param newCapacity The capacity that the object at least need to have. + \param allocator Allocator for reallocating memory. It must be the same one as used before. Commonly use GenericDocument::GetAllocator(). + \return The value itself for fluent API. + \note Linear time complexity. + */ + GenericValue& MemberReserve(SizeType newCapacity, Allocator &allocator) { + RAPIDJSON_ASSERT(IsObject()); + DoReserveMembers(newCapacity, allocator); + return *this; + } + + //! Check whether a member exists in the object. + /*! + \param name Member name to be searched. + \pre IsObject() == true + \return Whether a member with that name exists. + \note It is better to use FindMember() directly if you need the obtain the value as well. + \note Linear time complexity. + */ + bool HasMember(const Ch* name) const { return FindMember(name) != MemberEnd(); } + +#if RAPIDJSON_HAS_STDSTRING + //! Check whether a member exists in the object with string object. + /*! + \param name Member name to be searched. + \pre IsObject() == true + \return Whether a member with that name exists. + \note It is better to use FindMember() directly if you need the obtain the value as well. + \note Linear time complexity. + */ + bool HasMember(const std::basic_string& name) const { return FindMember(name) != MemberEnd(); } +#endif + + //! Check whether a member exists in the object with GenericValue name. + /*! + This version is faster because it does not need a StrLen(). It can also handle string with null character. + \param name Member name to be searched. + \pre IsObject() == true + \return Whether a member with that name exists. + \note It is better to use FindMember() directly if you need the obtain the value as well. + \note Linear time complexity. + */ + template + bool HasMember(const GenericValue& name) const { return FindMember(name) != MemberEnd(); } + + //! Find member by name. + /*! + \param name Member name to be searched. + \pre IsObject() == true + \return Iterator to member, if it exists. + Otherwise returns \ref MemberEnd(). + + \note Earlier versions of Rapidjson returned a \c NULL pointer, in case + the requested member doesn't exist. For consistency with e.g. + \c std::map, this has been changed to MemberEnd() now. + \note Linear time complexity. + */ + MemberIterator FindMember(const Ch* name) { + GenericValue n(StringRef(name)); + return FindMember(n); + } + + ConstMemberIterator FindMember(const Ch* name) const { return const_cast(*this).FindMember(name); } + + //! Find member by name. + /*! + This version is faster because it does not need a StrLen(). It can also handle string with null character. + \param name Member name to be searched. + \pre IsObject() == true + \return Iterator to member, if it exists. + Otherwise returns \ref MemberEnd(). + + \note Earlier versions of Rapidjson returned a \c NULL pointer, in case + the requested member doesn't exist. For consistency with e.g. + \c std::map, this has been changed to MemberEnd() now. + \note Linear time complexity. + */ + template + MemberIterator FindMember(const GenericValue& name) { + RAPIDJSON_ASSERT(IsObject()); + RAPIDJSON_ASSERT(name.IsString()); + return DoFindMember(name); + } + template ConstMemberIterator FindMember(const GenericValue& name) const { return const_cast(*this).FindMember(name); } + +#if RAPIDJSON_HAS_STDSTRING + //! Find member by string object name. + /*! + \param name Member name to be searched. + \pre IsObject() == true + \return Iterator to member, if it exists. + Otherwise returns \ref MemberEnd(). + */ + MemberIterator FindMember(const std::basic_string& name) { return FindMember(GenericValue(StringRef(name))); } + ConstMemberIterator FindMember(const std::basic_string& name) const { return FindMember(GenericValue(StringRef(name))); } +#endif + + //! Add a member (name-value pair) to the object. + /*! \param name A string value as name of member. + \param value Value of any type. + \param allocator Allocator for reallocating memory. It must be the same one as used before. Commonly use GenericDocument::GetAllocator(). + \return The value itself for fluent API. + \note The ownership of \c name and \c value will be transferred to this object on success. + \pre IsObject() && name.IsString() + \post name.IsNull() && value.IsNull() + \note Amortized Constant time complexity. + */ + GenericValue& AddMember(GenericValue& name, GenericValue& value, Allocator& allocator) { + RAPIDJSON_ASSERT(IsObject()); + RAPIDJSON_ASSERT(name.IsString()); + DoAddMember(name, value, allocator); + return *this; + } + + //! Add a constant string value as member (name-value pair) to the object. + /*! \param name A string value as name of member. + \param value constant string reference as value of member. + \param allocator Allocator for reallocating memory. It must be the same one as used before. Commonly use GenericDocument::GetAllocator(). + \return The value itself for fluent API. + \pre IsObject() + \note This overload is needed to avoid clashes with the generic primitive type AddMember(GenericValue&,T,Allocator&) overload below. + \note Amortized Constant time complexity. + */ + GenericValue& AddMember(GenericValue& name, StringRefType value, Allocator& allocator) { + GenericValue v(value); + return AddMember(name, v, allocator); + } + +#if RAPIDJSON_HAS_STDSTRING + //! Add a string object as member (name-value pair) to the object. + /*! \param name A string value as name of member. + \param value constant string reference as value of member. + \param allocator Allocator for reallocating memory. It must be the same one as used before. Commonly use GenericDocument::GetAllocator(). + \return The value itself for fluent API. + \pre IsObject() + \note This overload is needed to avoid clashes with the generic primitive type AddMember(GenericValue&,T,Allocator&) overload below. + \note Amortized Constant time complexity. + */ + GenericValue& AddMember(GenericValue& name, std::basic_string& value, Allocator& allocator) { + GenericValue v(value, allocator); + return AddMember(name, v, allocator); + } +#endif + + //! Add any primitive value as member (name-value pair) to the object. + /*! \tparam T Either \ref Type, \c int, \c unsigned, \c int64_t, \c uint64_t + \param name A string value as name of member. + \param value Value of primitive type \c T as value of member + \param allocator Allocator for reallocating memory. Commonly use GenericDocument::GetAllocator(). + \return The value itself for fluent API. + \pre IsObject() + + \note The source type \c T explicitly disallows all pointer types, + especially (\c const) \ref Ch*. This helps avoiding implicitly + referencing character strings with insufficient lifetime, use + \ref AddMember(StringRefType, GenericValue&, Allocator&) or \ref + AddMember(StringRefType, StringRefType, Allocator&). + All other pointer types would implicitly convert to \c bool, + use an explicit cast instead, if needed. + \note Amortized Constant time complexity. + */ + template + RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr, internal::IsGenericValue >), (GenericValue&)) + AddMember(GenericValue& name, T value, Allocator& allocator) { + GenericValue v(value); + return AddMember(name, v, allocator); + } + +#if RAPIDJSON_HAS_CXX11_RVALUE_REFS + GenericValue& AddMember(GenericValue&& name, GenericValue&& value, Allocator& allocator) { + return AddMember(name, value, allocator); + } + GenericValue& AddMember(GenericValue&& name, GenericValue& value, Allocator& allocator) { + return AddMember(name, value, allocator); + } + GenericValue& AddMember(GenericValue& name, GenericValue&& value, Allocator& allocator) { + return AddMember(name, value, allocator); + } + GenericValue& AddMember(StringRefType name, GenericValue&& value, Allocator& allocator) { + GenericValue n(name); + return AddMember(n, value, allocator); + } +#endif // RAPIDJSON_HAS_CXX11_RVALUE_REFS + + + //! Add a member (name-value pair) to the object. + /*! \param name A constant string reference as name of member. + \param value Value of any type. + \param allocator Allocator for reallocating memory. It must be the same one as used before. Commonly use GenericDocument::GetAllocator(). + \return The value itself for fluent API. + \note The ownership of \c value will be transferred to this object on success. + \pre IsObject() + \post value.IsNull() + \note Amortized Constant time complexity. + */ + GenericValue& AddMember(StringRefType name, GenericValue& value, Allocator& allocator) { + GenericValue n(name); + return AddMember(n, value, allocator); + } + + //! Add a constant string value as member (name-value pair) to the object. + /*! \param name A constant string reference as name of member. + \param value constant string reference as value of member. + \param allocator Allocator for reallocating memory. It must be the same one as used before. Commonly use GenericDocument::GetAllocator(). + \return The value itself for fluent API. + \pre IsObject() + \note This overload is needed to avoid clashes with the generic primitive type AddMember(StringRefType,T,Allocator&) overload below. + \note Amortized Constant time complexity. + */ + GenericValue& AddMember(StringRefType name, StringRefType value, Allocator& allocator) { + GenericValue v(value); + return AddMember(name, v, allocator); + } + + //! Add any primitive value as member (name-value pair) to the object. + /*! \tparam T Either \ref Type, \c int, \c unsigned, \c int64_t, \c uint64_t + \param name A constant string reference as name of member. + \param value Value of primitive type \c T as value of member + \param allocator Allocator for reallocating memory. Commonly use GenericDocument::GetAllocator(). + \return The value itself for fluent API. + \pre IsObject() + + \note The source type \c T explicitly disallows all pointer types, + especially (\c const) \ref Ch*. This helps avoiding implicitly + referencing character strings with insufficient lifetime, use + \ref AddMember(StringRefType, GenericValue&, Allocator&) or \ref + AddMember(StringRefType, StringRefType, Allocator&). + All other pointer types would implicitly convert to \c bool, + use an explicit cast instead, if needed. + \note Amortized Constant time complexity. + */ + template + RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr, internal::IsGenericValue >), (GenericValue&)) + AddMember(StringRefType name, T value, Allocator& allocator) { + GenericValue n(name); + return AddMember(n, value, allocator); + } + + //! Remove all members in the object. + /*! This function do not deallocate memory in the object, i.e. the capacity is unchanged. + \note Linear time complexity. + */ + void RemoveAllMembers() { + RAPIDJSON_ASSERT(IsObject()); + DoClearMembers(); + } + + //! Remove a member in object by its name. + /*! \param name Name of member to be removed. + \return Whether the member existed. + \note This function may reorder the object members. Use \ref + EraseMember(ConstMemberIterator) if you need to preserve the + relative order of the remaining members. + \note Linear time complexity. + */ + bool RemoveMember(const Ch* name) { + GenericValue n(StringRef(name)); + return RemoveMember(n); + } + +#if RAPIDJSON_HAS_STDSTRING + bool RemoveMember(const std::basic_string& name) { return RemoveMember(GenericValue(StringRef(name))); } +#endif + + template + bool RemoveMember(const GenericValue& name) { + MemberIterator m = FindMember(name); + if (m != MemberEnd()) { + RemoveMember(m); + return true; + } + else + return false; + } + + //! Remove a member in object by iterator. + /*! \param m member iterator (obtained by FindMember() or MemberBegin()). + \return the new iterator after removal. + \note This function may reorder the object members. Use \ref + EraseMember(ConstMemberIterator) if you need to preserve the + relative order of the remaining members. + \note Constant time complexity. + */ + MemberIterator RemoveMember(MemberIterator m) { + RAPIDJSON_ASSERT(IsObject()); + RAPIDJSON_ASSERT(data_.o.size > 0); + RAPIDJSON_ASSERT(GetMembersPointer() != 0); + RAPIDJSON_ASSERT(m >= MemberBegin() && m < MemberEnd()); + return DoRemoveMember(m); + } + + //! Remove a member from an object by iterator. + /*! \param pos iterator to the member to remove + \pre IsObject() == true && \ref MemberBegin() <= \c pos < \ref MemberEnd() + \return Iterator following the removed element. + If the iterator \c pos refers to the last element, the \ref MemberEnd() iterator is returned. + \note This function preserves the relative order of the remaining object + members. If you do not need this, use the more efficient \ref RemoveMember(MemberIterator). + \note Linear time complexity. + */ + MemberIterator EraseMember(ConstMemberIterator pos) { + return EraseMember(pos, pos +1); + } + + //! Remove members in the range [first, last) from an object. + /*! \param first iterator to the first member to remove + \param last iterator following the last member to remove + \pre IsObject() == true && \ref MemberBegin() <= \c first <= \c last <= \ref MemberEnd() + \return Iterator following the last removed element. + \note This function preserves the relative order of the remaining object + members. + \note Linear time complexity. + */ + MemberIterator EraseMember(ConstMemberIterator first, ConstMemberIterator last) { + RAPIDJSON_ASSERT(IsObject()); + RAPIDJSON_ASSERT(data_.o.size > 0); + RAPIDJSON_ASSERT(GetMembersPointer() != 0); + RAPIDJSON_ASSERT(first >= MemberBegin()); + RAPIDJSON_ASSERT(first <= last); + RAPIDJSON_ASSERT(last <= MemberEnd()); + return DoEraseMembers(first, last); + } + + //! Erase a member in object by its name. + /*! \param name Name of member to be removed. + \return Whether the member existed. + \note Linear time complexity. + */ + bool EraseMember(const Ch* name) { + GenericValue n(StringRef(name)); + return EraseMember(n); + } + +#if RAPIDJSON_HAS_STDSTRING + bool EraseMember(const std::basic_string& name) { return EraseMember(GenericValue(StringRef(name))); } +#endif + + template + bool EraseMember(const GenericValue& name) { + MemberIterator m = FindMember(name); + if (m != MemberEnd()) { + EraseMember(m); + return true; + } + else + return false; + } + + Object GetObject() { RAPIDJSON_ASSERT(IsObject()); return Object(*this); } + Object GetObj() { RAPIDJSON_ASSERT(IsObject()); return Object(*this); } + ConstObject GetObject() const { RAPIDJSON_ASSERT(IsObject()); return ConstObject(*this); } + ConstObject GetObj() const { RAPIDJSON_ASSERT(IsObject()); return ConstObject(*this); } + + //@} + + //!@name Array + //@{ + + //! Set this value as an empty array. + /*! \post IsArray == true */ + GenericValue& SetArray() { this->~GenericValue(); new (this) GenericValue(kArrayType); return *this; } + + //! Get the number of elements in array. + SizeType Size() const { RAPIDJSON_ASSERT(IsArray()); return data_.a.size; } + + //! Get the capacity of array. + SizeType Capacity() const { RAPIDJSON_ASSERT(IsArray()); return data_.a.capacity; } + + //! Check whether the array is empty. + bool Empty() const { RAPIDJSON_ASSERT(IsArray()); return data_.a.size == 0; } + + //! Remove all elements in the array. + /*! This function do not deallocate memory in the array, i.e. the capacity is unchanged. + \note Linear time complexity. + */ + void Clear() { + RAPIDJSON_ASSERT(IsArray()); + GenericValue* e = GetElementsPointer(); + for (GenericValue* v = e; v != e + data_.a.size; ++v) + v->~GenericValue(); + data_.a.size = 0; + } + + //! Get an element from array by index. + /*! \pre IsArray() == true + \param index Zero-based index of element. + \see operator[](T*) + */ + GenericValue& operator[](SizeType index) { + RAPIDJSON_ASSERT(IsArray()); + RAPIDJSON_ASSERT(index < data_.a.size); + return GetElementsPointer()[index]; + } + const GenericValue& operator[](SizeType index) const { return const_cast(*this)[index]; } + + //! Element iterator + /*! \pre IsArray() == true */ + ValueIterator Begin() { RAPIDJSON_ASSERT(IsArray()); return GetElementsPointer(); } + //! \em Past-the-end element iterator + /*! \pre IsArray() == true */ + ValueIterator End() { RAPIDJSON_ASSERT(IsArray()); return GetElementsPointer() + data_.a.size; } + //! Constant element iterator + /*! \pre IsArray() == true */ + ConstValueIterator Begin() const { return const_cast(*this).Begin(); } + //! Constant \em past-the-end element iterator + /*! \pre IsArray() == true */ + ConstValueIterator End() const { return const_cast(*this).End(); } + + //! Request the array to have enough capacity to store elements. + /*! \param newCapacity The capacity that the array at least need to have. + \param allocator Allocator for reallocating memory. It must be the same one as used before. Commonly use GenericDocument::GetAllocator(). + \return The value itself for fluent API. + \note Linear time complexity. + */ + GenericValue& Reserve(SizeType newCapacity, Allocator &allocator) { + RAPIDJSON_ASSERT(IsArray()); + if (newCapacity > data_.a.capacity) { + SetElementsPointer(reinterpret_cast(allocator.Realloc(GetElementsPointer(), data_.a.capacity * sizeof(GenericValue), newCapacity * sizeof(GenericValue)))); + data_.a.capacity = newCapacity; + } + return *this; + } + + //! Append a GenericValue at the end of the array. + /*! \param value Value to be appended. + \param allocator Allocator for reallocating memory. It must be the same one as used before. Commonly use GenericDocument::GetAllocator(). + \pre IsArray() == true + \post value.IsNull() == true + \return The value itself for fluent API. + \note The ownership of \c value will be transferred to this array on success. + \note If the number of elements to be appended is known, calls Reserve() once first may be more efficient. + \note Amortized constant time complexity. + */ + GenericValue& PushBack(GenericValue& value, Allocator& allocator) { + RAPIDJSON_ASSERT(IsArray()); + if (data_.a.size >= data_.a.capacity) + Reserve(data_.a.capacity == 0 ? kDefaultArrayCapacity : (data_.a.capacity + (data_.a.capacity + 1) / 2), allocator); + GetElementsPointer()[data_.a.size++].RawAssign(value); + return *this; + } + +#if RAPIDJSON_HAS_CXX11_RVALUE_REFS + GenericValue& PushBack(GenericValue&& value, Allocator& allocator) { + return PushBack(value, allocator); + } +#endif // RAPIDJSON_HAS_CXX11_RVALUE_REFS + + //! Append a constant string reference at the end of the array. + /*! \param value Constant string reference to be appended. + \param allocator Allocator for reallocating memory. It must be the same one used previously. Commonly use GenericDocument::GetAllocator(). + \pre IsArray() == true + \return The value itself for fluent API. + \note If the number of elements to be appended is known, calls Reserve() once first may be more efficient. + \note Amortized constant time complexity. + \see GenericStringRef + */ + GenericValue& PushBack(StringRefType value, Allocator& allocator) { + return (*this).template PushBack(value, allocator); + } + + //! Append a primitive value at the end of the array. + /*! \tparam T Either \ref Type, \c int, \c unsigned, \c int64_t, \c uint64_t + \param value Value of primitive type T to be appended. + \param allocator Allocator for reallocating memory. It must be the same one as used before. Commonly use GenericDocument::GetAllocator(). + \pre IsArray() == true + \return The value itself for fluent API. + \note If the number of elements to be appended is known, calls Reserve() once first may be more efficient. + + \note The source type \c T explicitly disallows all pointer types, + especially (\c const) \ref Ch*. This helps avoiding implicitly + referencing character strings with insufficient lifetime, use + \ref PushBack(GenericValue&, Allocator&) or \ref + PushBack(StringRefType, Allocator&). + All other pointer types would implicitly convert to \c bool, + use an explicit cast instead, if needed. + \note Amortized constant time complexity. + */ + template + RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr, internal::IsGenericValue >), (GenericValue&)) + PushBack(T value, Allocator& allocator) { + GenericValue v(value); + return PushBack(v, allocator); + } + + //! Remove the last element in the array. + /*! + \note Constant time complexity. + */ + GenericValue& PopBack() { + RAPIDJSON_ASSERT(IsArray()); + RAPIDJSON_ASSERT(!Empty()); + GetElementsPointer()[--data_.a.size].~GenericValue(); + return *this; + } + + //! Remove an element of array by iterator. + /*! + \param pos iterator to the element to remove + \pre IsArray() == true && \ref Begin() <= \c pos < \ref End() + \return Iterator following the removed element. If the iterator pos refers to the last element, the End() iterator is returned. + \note Linear time complexity. + */ + ValueIterator Erase(ConstValueIterator pos) { + return Erase(pos, pos + 1); + } + + //! Remove elements in the range [first, last) of the array. + /*! + \param first iterator to the first element to remove + \param last iterator following the last element to remove + \pre IsArray() == true && \ref Begin() <= \c first <= \c last <= \ref End() + \return Iterator following the last removed element. + \note Linear time complexity. + */ + ValueIterator Erase(ConstValueIterator first, ConstValueIterator last) { + RAPIDJSON_ASSERT(IsArray()); + RAPIDJSON_ASSERT(data_.a.size > 0); + RAPIDJSON_ASSERT(GetElementsPointer() != 0); + RAPIDJSON_ASSERT(first >= Begin()); + RAPIDJSON_ASSERT(first <= last); + RAPIDJSON_ASSERT(last <= End()); + ValueIterator pos = Begin() + (first - Begin()); + for (ValueIterator itr = pos; itr != last; ++itr) + itr->~GenericValue(); + std::memmove(static_cast(pos), last, static_cast(End() - last) * sizeof(GenericValue)); + data_.a.size -= static_cast(last - first); + return pos; + } + + Array GetArray() { RAPIDJSON_ASSERT(IsArray()); return Array(*this); } + ConstArray GetArray() const { RAPIDJSON_ASSERT(IsArray()); return ConstArray(*this); } + + //@} + + //!@name Number + //@{ + + int GetInt() const { RAPIDJSON_ASSERT(data_.f.flags & kIntFlag); return data_.n.i.i; } + unsigned GetUint() const { RAPIDJSON_ASSERT(data_.f.flags & kUintFlag); return data_.n.u.u; } + int64_t GetInt64() const { RAPIDJSON_ASSERT(data_.f.flags & kInt64Flag); return data_.n.i64; } + uint64_t GetUint64() const { RAPIDJSON_ASSERT(data_.f.flags & kUint64Flag); return data_.n.u64; } + + //! Get the value as double type. + /*! \note If the value is 64-bit integer type, it may lose precision. Use \c IsLosslessDouble() to check whether the converison is lossless. + */ + double GetDouble() const { + RAPIDJSON_ASSERT(IsNumber()); + if ((data_.f.flags & kDoubleFlag) != 0) return data_.n.d; // exact type, no conversion. + if ((data_.f.flags & kIntFlag) != 0) return data_.n.i.i; // int -> double + if ((data_.f.flags & kUintFlag) != 0) return data_.n.u.u; // unsigned -> double + if ((data_.f.flags & kInt64Flag) != 0) return static_cast(data_.n.i64); // int64_t -> double (may lose precision) + RAPIDJSON_ASSERT((data_.f.flags & kUint64Flag) != 0); return static_cast(data_.n.u64); // uint64_t -> double (may lose precision) + } + + //! Get the value as float type. + /*! \note If the value is 64-bit integer type, it may lose precision. Use \c IsLosslessFloat() to check whether the converison is lossless. + */ + float GetFloat() const { + return static_cast(GetDouble()); + } + + GenericValue& SetInt(int i) { this->~GenericValue(); new (this) GenericValue(i); return *this; } + GenericValue& SetUint(unsigned u) { this->~GenericValue(); new (this) GenericValue(u); return *this; } + GenericValue& SetInt64(int64_t i64) { this->~GenericValue(); new (this) GenericValue(i64); return *this; } + GenericValue& SetUint64(uint64_t u64) { this->~GenericValue(); new (this) GenericValue(u64); return *this; } + GenericValue& SetDouble(double d) { this->~GenericValue(); new (this) GenericValue(d); return *this; } + GenericValue& SetFloat(float f) { this->~GenericValue(); new (this) GenericValue(static_cast(f)); return *this; } + + //@} + + //!@name String + //@{ + + const Ch* GetString() const { RAPIDJSON_ASSERT(IsString()); return DataString(data_); } + + //! Get the length of string. + /*! Since rapidjson permits "\\u0000" in the json string, strlen(v.GetString()) may not equal to v.GetStringLength(). + */ + SizeType GetStringLength() const { RAPIDJSON_ASSERT(IsString()); return DataStringLength(data_); } + + //! Set this value as a string without copying source string. + /*! This version has better performance with supplied length, and also support string containing null character. + \param s source string pointer. + \param length The length of source string, excluding the trailing null terminator. + \return The value itself for fluent API. + \post IsString() == true && GetString() == s && GetStringLength() == length + \see SetString(StringRefType) + */ + GenericValue& SetString(const Ch* s, SizeType length) { return SetString(StringRef(s, length)); } + + //! Set this value as a string without copying source string. + /*! \param s source string reference + \return The value itself for fluent API. + \post IsString() == true && GetString() == s && GetStringLength() == s.length + */ + GenericValue& SetString(StringRefType s) { this->~GenericValue(); SetStringRaw(s); return *this; } + + //! Set this value as a string by copying from source string. + /*! This version has better performance with supplied length, and also support string containing null character. + \param s source string. + \param length The length of source string, excluding the trailing null terminator. + \param allocator Allocator for allocating copied buffer. Commonly use GenericDocument::GetAllocator(). + \return The value itself for fluent API. + \post IsString() == true && GetString() != s && strcmp(GetString(),s) == 0 && GetStringLength() == length + */ + GenericValue& SetString(const Ch* s, SizeType length, Allocator& allocator) { return SetString(StringRef(s, length), allocator); } + + //! Set this value as a string by copying from source string. + /*! \param s source string. + \param allocator Allocator for allocating copied buffer. Commonly use GenericDocument::GetAllocator(). + \return The value itself for fluent API. + \post IsString() == true && GetString() != s && strcmp(GetString(),s) == 0 && GetStringLength() == length + */ + GenericValue& SetString(const Ch* s, Allocator& allocator) { return SetString(StringRef(s), allocator); } + + //! Set this value as a string by copying from source string. + /*! \param s source string reference + \param allocator Allocator for allocating copied buffer. Commonly use GenericDocument::GetAllocator(). + \return The value itself for fluent API. + \post IsString() == true && GetString() != s.s && strcmp(GetString(),s) == 0 && GetStringLength() == length + */ + GenericValue& SetString(StringRefType s, Allocator& allocator) { this->~GenericValue(); SetStringRaw(s, allocator); return *this; } + +#if RAPIDJSON_HAS_STDSTRING + //! Set this value as a string by copying from source string. + /*! \param s source string. + \param allocator Allocator for allocating copied buffer. Commonly use GenericDocument::GetAllocator(). + \return The value itself for fluent API. + \post IsString() == true && GetString() != s.data() && strcmp(GetString(),s.data() == 0 && GetStringLength() == s.size() + \note Requires the definition of the preprocessor symbol \ref RAPIDJSON_HAS_STDSTRING. + */ + GenericValue& SetString(const std::basic_string& s, Allocator& allocator) { return SetString(StringRef(s), allocator); } +#endif + + //@} + + //!@name Array + //@{ + + //! Templated version for checking whether this value is type T. + /*! + \tparam T Either \c bool, \c int, \c unsigned, \c int64_t, \c uint64_t, \c double, \c float, \c const \c char*, \c std::basic_string + */ + template + bool Is() const { return internal::TypeHelper::Is(*this); } + + template + T Get() const { return internal::TypeHelper::Get(*this); } + + template + T Get() { return internal::TypeHelper::Get(*this); } + + template + ValueType& Set(const T& data) { return internal::TypeHelper::Set(*this, data); } + + template + ValueType& Set(const T& data, AllocatorType& allocator) { return internal::TypeHelper::Set(*this, data, allocator); } + + //@} + + //! Generate events of this value to a Handler. + /*! This function adopts the GoF visitor pattern. + Typical usage is to output this JSON value as JSON text via Writer, which is a Handler. + It can also be used to deep clone this value via GenericDocument, which is also a Handler. + \tparam Handler type of handler. + \param handler An object implementing concept Handler. + */ + template + bool Accept(Handler& handler) const { + switch(GetType()) { + case kNullType: return handler.Null(); + case kFalseType: return handler.Bool(false); + case kTrueType: return handler.Bool(true); + + case kObjectType: + if (RAPIDJSON_UNLIKELY(!handler.StartObject())) + return false; + for (ConstMemberIterator m = MemberBegin(); m != MemberEnd(); ++m) { + RAPIDJSON_ASSERT(m->name.IsString()); // User may change the type of name by MemberIterator. + if (RAPIDJSON_UNLIKELY(!handler.Key(m->name.GetString(), m->name.GetStringLength(), (m->name.data_.f.flags & kCopyFlag) != 0))) + return false; + if (RAPIDJSON_UNLIKELY(!m->value.Accept(handler))) + return false; + } + return handler.EndObject(data_.o.size); + + case kArrayType: + if (RAPIDJSON_UNLIKELY(!handler.StartArray())) + return false; + for (ConstValueIterator v = Begin(); v != End(); ++v) + if (RAPIDJSON_UNLIKELY(!v->Accept(handler))) + return false; + return handler.EndArray(data_.a.size); + + case kStringType: + return handler.String(GetString(), GetStringLength(), (data_.f.flags & kCopyFlag) != 0); + + default: + RAPIDJSON_ASSERT(GetType() == kNumberType); + if (IsDouble()) return handler.Double(data_.n.d); + else if (IsInt()) return handler.Int(data_.n.i.i); + else if (IsUint()) return handler.Uint(data_.n.u.u); + else if (IsInt64()) return handler.Int64(data_.n.i64); + else return handler.Uint64(data_.n.u64); + } + } + +private: + template friend class GenericValue; + template friend class GenericDocument; + + enum { + kBoolFlag = 0x0008, + kNumberFlag = 0x0010, + kIntFlag = 0x0020, + kUintFlag = 0x0040, + kInt64Flag = 0x0080, + kUint64Flag = 0x0100, + kDoubleFlag = 0x0200, + kStringFlag = 0x0400, + kCopyFlag = 0x0800, + kInlineStrFlag = 0x1000, + + // Initial flags of different types. + kNullFlag = kNullType, + // These casts are added to suppress the warning on MSVC about bitwise operations between enums of different types. + kTrueFlag = static_cast(kTrueType) | static_cast(kBoolFlag), + kFalseFlag = static_cast(kFalseType) | static_cast(kBoolFlag), + kNumberIntFlag = static_cast(kNumberType) | static_cast(kNumberFlag | kIntFlag | kInt64Flag), + kNumberUintFlag = static_cast(kNumberType) | static_cast(kNumberFlag | kUintFlag | kUint64Flag | kInt64Flag), + kNumberInt64Flag = static_cast(kNumberType) | static_cast(kNumberFlag | kInt64Flag), + kNumberUint64Flag = static_cast(kNumberType) | static_cast(kNumberFlag | kUint64Flag), + kNumberDoubleFlag = static_cast(kNumberType) | static_cast(kNumberFlag | kDoubleFlag), + kNumberAnyFlag = static_cast(kNumberType) | static_cast(kNumberFlag | kIntFlag | kInt64Flag | kUintFlag | kUint64Flag | kDoubleFlag), + kConstStringFlag = static_cast(kStringType) | static_cast(kStringFlag), + kCopyStringFlag = static_cast(kStringType) | static_cast(kStringFlag | kCopyFlag), + kShortStringFlag = static_cast(kStringType) | static_cast(kStringFlag | kCopyFlag | kInlineStrFlag), + kObjectFlag = kObjectType, + kArrayFlag = kArrayType, + + kTypeMask = 0x07 + }; + + static const SizeType kDefaultArrayCapacity = RAPIDJSON_VALUE_DEFAULT_ARRAY_CAPACITY; + static const SizeType kDefaultObjectCapacity = RAPIDJSON_VALUE_DEFAULT_OBJECT_CAPACITY; + + struct Flag { +#if RAPIDJSON_48BITPOINTER_OPTIMIZATION + char payload[sizeof(SizeType) * 2 + 6]; // 2 x SizeType + lower 48-bit pointer +#elif RAPIDJSON_64BIT + char payload[sizeof(SizeType) * 2 + sizeof(void*) + 6]; // 6 padding bytes +#else + char payload[sizeof(SizeType) * 2 + sizeof(void*) + 2]; // 2 padding bytes +#endif + uint16_t flags; + }; + + struct String { + SizeType length; + SizeType hashcode; //!< reserved + const Ch* str; + }; // 12 bytes in 32-bit mode, 16 bytes in 64-bit mode + + // implementation detail: ShortString can represent zero-terminated strings up to MaxSize chars + // (excluding the terminating zero) and store a value to determine the length of the contained + // string in the last character str[LenPos] by storing "MaxSize - length" there. If the string + // to store has the maximal length of MaxSize then str[LenPos] will be 0 and therefore act as + // the string terminator as well. For getting the string length back from that value just use + // "MaxSize - str[LenPos]". + // This allows to store 13-chars strings in 32-bit mode, 21-chars strings in 64-bit mode, + // 13-chars strings for RAPIDJSON_48BITPOINTER_OPTIMIZATION=1 inline (for `UTF8`-encoded strings). + struct ShortString { + enum { MaxChars = sizeof(static_cast(0)->payload) / sizeof(Ch), MaxSize = MaxChars - 1, LenPos = MaxSize }; + Ch str[MaxChars]; + + inline static bool Usable(SizeType len) { return (MaxSize >= len); } + inline void SetLength(SizeType len) { str[LenPos] = static_cast(MaxSize - len); } + inline SizeType GetLength() const { return static_cast(MaxSize - str[LenPos]); } + }; // at most as many bytes as "String" above => 12 bytes in 32-bit mode, 16 bytes in 64-bit mode + + // By using proper binary layout, retrieval of different integer types do not need conversions. + union Number { +#if RAPIDJSON_ENDIAN == RAPIDJSON_LITTLEENDIAN + struct I { + int i; + char padding[4]; + }i; + struct U { + unsigned u; + char padding2[4]; + }u; +#else + struct I { + char padding[4]; + int i; + }i; + struct U { + char padding2[4]; + unsigned u; + }u; +#endif + int64_t i64; + uint64_t u64; + double d; + }; // 8 bytes + + struct ObjectData { + SizeType size; + SizeType capacity; + Member* members; + }; // 12 bytes in 32-bit mode, 16 bytes in 64-bit mode + + struct ArrayData { + SizeType size; + SizeType capacity; + GenericValue* elements; + }; // 12 bytes in 32-bit mode, 16 bytes in 64-bit mode + + union Data { + String s; + ShortString ss; + Number n; + ObjectData o; + ArrayData a; + Flag f; + }; // 16 bytes in 32-bit mode, 24 bytes in 64-bit mode, 16 bytes in 64-bit with RAPIDJSON_48BITPOINTER_OPTIMIZATION + + static RAPIDJSON_FORCEINLINE const Ch* DataString(const Data& data) { + return (data.f.flags & kInlineStrFlag) ? data.ss.str : RAPIDJSON_GETPOINTER(Ch, data.s.str); + } + static RAPIDJSON_FORCEINLINE SizeType DataStringLength(const Data& data) { + return (data.f.flags & kInlineStrFlag) ? data.ss.GetLength() : data.s.length; + } + + RAPIDJSON_FORCEINLINE const Ch* GetStringPointer() const { return RAPIDJSON_GETPOINTER(Ch, data_.s.str); } + RAPIDJSON_FORCEINLINE const Ch* SetStringPointer(const Ch* str) { return RAPIDJSON_SETPOINTER(Ch, data_.s.str, str); } + RAPIDJSON_FORCEINLINE GenericValue* GetElementsPointer() const { return RAPIDJSON_GETPOINTER(GenericValue, data_.a.elements); } + RAPIDJSON_FORCEINLINE GenericValue* SetElementsPointer(GenericValue* elements) { return RAPIDJSON_SETPOINTER(GenericValue, data_.a.elements, elements); } + RAPIDJSON_FORCEINLINE Member* GetMembersPointer() const { return RAPIDJSON_GETPOINTER(Member, data_.o.members); } + RAPIDJSON_FORCEINLINE Member* SetMembersPointer(Member* members) { return RAPIDJSON_SETPOINTER(Member, data_.o.members, members); } + +#if RAPIDJSON_USE_MEMBERSMAP + + struct MapTraits { + struct Less { + bool operator()(const Data& s1, const Data& s2) const { + SizeType n1 = DataStringLength(s1), n2 = DataStringLength(s2); + int cmp = std::memcmp(DataString(s1), DataString(s2), sizeof(Ch) * (n1 < n2 ? n1 : n2)); + return cmp < 0 || (cmp == 0 && n1 < n2); + } + }; + typedef std::pair Pair; + typedef std::multimap > Map; + typedef typename Map::iterator Iterator; + }; + typedef typename MapTraits::Map Map; + typedef typename MapTraits::Less MapLess; + typedef typename MapTraits::Pair MapPair; + typedef typename MapTraits::Iterator MapIterator; + + // + // Layout of the members' map/array, re(al)located according to the needed capacity: + // + // {Map*}<>{capacity}<>{Member[capacity]}<>{MapIterator[capacity]} + // + // (where <> stands for the RAPIDJSON_ALIGN-ment, if needed) + // + + static RAPIDJSON_FORCEINLINE size_t GetMapLayoutSize(SizeType capacity) { + return RAPIDJSON_ALIGN(sizeof(Map*)) + + RAPIDJSON_ALIGN(sizeof(SizeType)) + + RAPIDJSON_ALIGN(capacity * sizeof(Member)) + + capacity * sizeof(MapIterator); + } + + static RAPIDJSON_FORCEINLINE SizeType &GetMapCapacity(Map* &map) { + return *reinterpret_cast(reinterpret_cast(&map) + + RAPIDJSON_ALIGN(sizeof(Map*))); + } + + static RAPIDJSON_FORCEINLINE Member* GetMapMembers(Map* &map) { + return reinterpret_cast(reinterpret_cast(&map) + + RAPIDJSON_ALIGN(sizeof(Map*)) + + RAPIDJSON_ALIGN(sizeof(SizeType))); + } + + static RAPIDJSON_FORCEINLINE MapIterator* GetMapIterators(Map* &map) { + return reinterpret_cast(reinterpret_cast(&map) + + RAPIDJSON_ALIGN(sizeof(Map*)) + + RAPIDJSON_ALIGN(sizeof(SizeType)) + + RAPIDJSON_ALIGN(GetMapCapacity(map) * sizeof(Member))); + } + + static RAPIDJSON_FORCEINLINE Map* &GetMap(Member* members) { + RAPIDJSON_ASSERT(members != 0); + return *reinterpret_cast(reinterpret_cast(members) - + RAPIDJSON_ALIGN(sizeof(SizeType)) - + RAPIDJSON_ALIGN(sizeof(Map*))); + } + + // Some compilers' debug mechanisms want all iterators to be destroyed, for their accounting.. + RAPIDJSON_FORCEINLINE MapIterator DropMapIterator(MapIterator& rhs) { +#if RAPIDJSON_HAS_CXX11 + MapIterator ret = std::move(rhs); +#else + MapIterator ret = rhs; +#endif + rhs.~MapIterator(); + return ret; + } + + Map* &DoReallocMap(Map** oldMap, SizeType newCapacity, Allocator& allocator) { + Map **newMap = static_cast(allocator.Malloc(GetMapLayoutSize(newCapacity))); + GetMapCapacity(*newMap) = newCapacity; + if (!oldMap) { + *newMap = new (allocator.Malloc(sizeof(Map))) Map(MapLess(), allocator); + } + else { + *newMap = *oldMap; + size_t count = (*oldMap)->size(); + std::memcpy(static_cast(GetMapMembers(*newMap)), + static_cast(GetMapMembers(*oldMap)), + count * sizeof(Member)); + MapIterator *oldIt = GetMapIterators(*oldMap), + *newIt = GetMapIterators(*newMap); + while (count--) { + new (&newIt[count]) MapIterator(DropMapIterator(oldIt[count])); + } + Allocator::Free(oldMap); + } + return *newMap; + } + + RAPIDJSON_FORCEINLINE Member* DoAllocMembers(SizeType capacity, Allocator& allocator) { + return GetMapMembers(DoReallocMap(0, capacity, allocator)); + } + + void DoReserveMembers(SizeType newCapacity, Allocator& allocator) { + ObjectData& o = data_.o; + if (newCapacity > o.capacity) { + Member* oldMembers = GetMembersPointer(); + Map **oldMap = oldMembers ? &GetMap(oldMembers) : 0, + *&newMap = DoReallocMap(oldMap, newCapacity, allocator); + RAPIDJSON_SETPOINTER(Member, o.members, GetMapMembers(newMap)); + o.capacity = newCapacity; + } + } + + template + MemberIterator DoFindMember(const GenericValue& name) { + if (Member* members = GetMembersPointer()) { + Map* &map = GetMap(members); + MapIterator mit = map->find(reinterpret_cast(name.data_)); + if (mit != map->end()) { + return MemberIterator(&members[mit->second]); + } + } + return MemberEnd(); + } + + void DoClearMembers() { + if (Member* members = GetMembersPointer()) { + Map* &map = GetMap(members); + MapIterator* mit = GetMapIterators(map); + for (SizeType i = 0; i < data_.o.size; i++) { + map->erase(DropMapIterator(mit[i])); + members[i].~Member(); + } + data_.o.size = 0; + } + } + + void DoFreeMembers() { + if (Member* members = GetMembersPointer()) { + GetMap(members)->~Map(); + for (SizeType i = 0; i < data_.o.size; i++) { + members[i].~Member(); + } + if (Allocator::kNeedFree) { // Shortcut by Allocator's trait + Map** map = &GetMap(members); + Allocator::Free(*map); + Allocator::Free(map); + } + } + } + +#else // !RAPIDJSON_USE_MEMBERSMAP + + RAPIDJSON_FORCEINLINE Member* DoAllocMembers(SizeType capacity, Allocator& allocator) { + return Malloc(allocator, capacity); + } + + void DoReserveMembers(SizeType newCapacity, Allocator& allocator) { + ObjectData& o = data_.o; + if (newCapacity > o.capacity) { + Member* newMembers = Realloc(allocator, GetMembersPointer(), o.capacity, newCapacity); + RAPIDJSON_SETPOINTER(Member, o.members, newMembers); + o.capacity = newCapacity; + } + } + + template + MemberIterator DoFindMember(const GenericValue& name) { + MemberIterator member = MemberBegin(); + for ( ; member != MemberEnd(); ++member) + if (name.StringEqual(member->name)) + break; + return member; + } + + void DoClearMembers() { + for (MemberIterator m = MemberBegin(); m != MemberEnd(); ++m) + m->~Member(); + data_.o.size = 0; + } + + void DoFreeMembers() { + for (MemberIterator m = MemberBegin(); m != MemberEnd(); ++m) + m->~Member(); + Allocator::Free(GetMembersPointer()); + } + +#endif // !RAPIDJSON_USE_MEMBERSMAP + + void DoAddMember(GenericValue& name, GenericValue& value, Allocator& allocator) { + ObjectData& o = data_.o; + if (o.size >= o.capacity) + DoReserveMembers(o.capacity ? (o.capacity + (o.capacity + 1) / 2) : kDefaultObjectCapacity, allocator); + Member* members = GetMembersPointer(); + Member* m = members + o.size; + m->name.RawAssign(name); + m->value.RawAssign(value); +#if RAPIDJSON_USE_MEMBERSMAP + Map* &map = GetMap(members); + MapIterator* mit = GetMapIterators(map); + new (&mit[o.size]) MapIterator(map->insert(MapPair(m->name.data_, o.size))); +#endif + ++o.size; + } + + MemberIterator DoRemoveMember(MemberIterator m) { + ObjectData& o = data_.o; + Member* members = GetMembersPointer(); +#if RAPIDJSON_USE_MEMBERSMAP + Map* &map = GetMap(members); + MapIterator* mit = GetMapIterators(map); + SizeType mpos = static_cast(&*m - members); + map->erase(DropMapIterator(mit[mpos])); +#endif + MemberIterator last(members + (o.size - 1)); + if (o.size > 1 && m != last) { +#if RAPIDJSON_USE_MEMBERSMAP + new (&mit[mpos]) MapIterator(DropMapIterator(mit[&*last - members])); + mit[mpos]->second = mpos; +#endif + *m = *last; // Move the last one to this place + } + else { + m->~Member(); // Only one left, just destroy + } + --o.size; + return m; + } + + MemberIterator DoEraseMembers(ConstMemberIterator first, ConstMemberIterator last) { + ObjectData& o = data_.o; + MemberIterator beg = MemberBegin(), + pos = beg + (first - beg), + end = MemberEnd(); +#if RAPIDJSON_USE_MEMBERSMAP + Map* &map = GetMap(GetMembersPointer()); + MapIterator* mit = GetMapIterators(map); +#endif + for (MemberIterator itr = pos; itr != last; ++itr) { +#if RAPIDJSON_USE_MEMBERSMAP + map->erase(DropMapIterator(mit[itr - beg])); +#endif + itr->~Member(); + } +#if RAPIDJSON_USE_MEMBERSMAP + if (first != last) { + // Move remaining members/iterators + MemberIterator next = pos + (last - first); + for (MemberIterator itr = pos; next != end; ++itr, ++next) { + std::memcpy(static_cast(&*itr), &*next, sizeof(Member)); + SizeType mpos = static_cast(itr - beg); + new (&mit[mpos]) MapIterator(DropMapIterator(mit[next - beg])); + mit[mpos]->second = mpos; + } + } +#else + std::memmove(static_cast(&*pos), &*last, + static_cast(end - last) * sizeof(Member)); +#endif + o.size -= static_cast(last - first); + return pos; + } + + template + void DoCopyMembers(const GenericValue& rhs, Allocator& allocator, bool copyConstStrings) { + RAPIDJSON_ASSERT(rhs.GetType() == kObjectType); + + data_.f.flags = kObjectFlag; + SizeType count = rhs.data_.o.size; + Member* lm = DoAllocMembers(count, allocator); + const typename GenericValue::Member* rm = rhs.GetMembersPointer(); +#if RAPIDJSON_USE_MEMBERSMAP + Map* &map = GetMap(lm); + MapIterator* mit = GetMapIterators(map); +#endif + for (SizeType i = 0; i < count; i++) { + new (&lm[i].name) GenericValue(rm[i].name, allocator, copyConstStrings); + new (&lm[i].value) GenericValue(rm[i].value, allocator, copyConstStrings); +#if RAPIDJSON_USE_MEMBERSMAP + new (&mit[i]) MapIterator(map->insert(MapPair(lm[i].name.data_, i))); +#endif + } + data_.o.size = data_.o.capacity = count; + SetMembersPointer(lm); + } + + // Initialize this value as array with initial data, without calling destructor. + void SetArrayRaw(GenericValue* values, SizeType count, Allocator& allocator) { + data_.f.flags = kArrayFlag; + if (count) { + GenericValue* e = static_cast(allocator.Malloc(count * sizeof(GenericValue))); + SetElementsPointer(e); + std::memcpy(static_cast(e), values, count * sizeof(GenericValue)); + } + else + SetElementsPointer(0); + data_.a.size = data_.a.capacity = count; + } + + //! Initialize this value as object with initial data, without calling destructor. + void SetObjectRaw(Member* members, SizeType count, Allocator& allocator) { + data_.f.flags = kObjectFlag; + if (count) { + Member* m = DoAllocMembers(count, allocator); + SetMembersPointer(m); + std::memcpy(static_cast(m), members, count * sizeof(Member)); +#if RAPIDJSON_USE_MEMBERSMAP + Map* &map = GetMap(m); + MapIterator* mit = GetMapIterators(map); + for (SizeType i = 0; i < count; i++) { + new (&mit[i]) MapIterator(map->insert(MapPair(m[i].name.data_, i))); + } +#endif + } + else + SetMembersPointer(0); + data_.o.size = data_.o.capacity = count; + } + + //! Initialize this value as constant string, without calling destructor. + void SetStringRaw(StringRefType s) RAPIDJSON_NOEXCEPT { + data_.f.flags = kConstStringFlag; + SetStringPointer(s); + data_.s.length = s.length; + } + + //! Initialize this value as copy string with initial data, without calling destructor. + void SetStringRaw(StringRefType s, Allocator& allocator) { + Ch* str = 0; + if (ShortString::Usable(s.length)) { + data_.f.flags = kShortStringFlag; + data_.ss.SetLength(s.length); + str = data_.ss.str; + } else { + data_.f.flags = kCopyStringFlag; + data_.s.length = s.length; + str = static_cast(allocator.Malloc((s.length + 1) * sizeof(Ch))); + SetStringPointer(str); + } + std::memcpy(str, s, s.length * sizeof(Ch)); + str[s.length] = '\0'; + } + + //! Assignment without calling destructor + void RawAssign(GenericValue& rhs) RAPIDJSON_NOEXCEPT { + data_ = rhs.data_; + // data_.f.flags = rhs.data_.f.flags; + rhs.data_.f.flags = kNullFlag; + } + + template + bool StringEqual(const GenericValue& rhs) const { + RAPIDJSON_ASSERT(IsString()); + RAPIDJSON_ASSERT(rhs.IsString()); + + const SizeType len1 = GetStringLength(); + const SizeType len2 = rhs.GetStringLength(); + if(len1 != len2) { return false; } + + const Ch* const str1 = GetString(); + const Ch* const str2 = rhs.GetString(); + if(str1 == str2) { return true; } // fast path for constant string + + return (std::memcmp(str1, str2, sizeof(Ch) * len1) == 0); + } + + Data data_; +}; + +//! GenericValue with UTF8 encoding +typedef GenericValue > Value; + +/////////////////////////////////////////////////////////////////////////////// +// GenericDocument + +//! A document for parsing JSON text as DOM. +/*! + \note implements Handler concept + \tparam Encoding Encoding for both parsing and string storage. + \tparam Allocator Allocator for allocating memory for the DOM + \tparam StackAllocator Allocator for allocating memory for stack during parsing. + \warning Although GenericDocument inherits from GenericValue, the API does \b not provide any virtual functions, especially no virtual destructor. To avoid memory leaks, do not \c delete a GenericDocument object via a pointer to a GenericValue. +*/ +template +class GenericDocument : public GenericValue { +public: + typedef typename Encoding::Ch Ch; //!< Character type derived from Encoding. + typedef GenericValue ValueType; //!< Value type of the document. + typedef Allocator AllocatorType; //!< Allocator type from template parameter. + typedef StackAllocator StackAllocatorType; //!< StackAllocator type from template parameter. + + //! Constructor + /*! Creates an empty document of specified type. + \param type Mandatory type of object to create. + \param allocator Optional allocator for allocating memory. + \param stackCapacity Optional initial capacity of stack in bytes. + \param stackAllocator Optional allocator for allocating memory for stack. + */ + explicit GenericDocument(Type type, Allocator* allocator = 0, size_t stackCapacity = kDefaultStackCapacity, StackAllocator* stackAllocator = 0) : + GenericValue(type), allocator_(allocator), ownAllocator_(0), stack_(stackAllocator, stackCapacity), parseResult_() + { + if (!allocator_) + ownAllocator_ = allocator_ = RAPIDJSON_NEW(Allocator)(); + } + + //! Constructor + /*! Creates an empty document which type is Null. + \param allocator Optional allocator for allocating memory. + \param stackCapacity Optional initial capacity of stack in bytes. + \param stackAllocator Optional allocator for allocating memory for stack. + */ + GenericDocument(Allocator* allocator = 0, size_t stackCapacity = kDefaultStackCapacity, StackAllocator* stackAllocator = 0) : + allocator_(allocator), ownAllocator_(0), stack_(stackAllocator, stackCapacity), parseResult_() + { + if (!allocator_) + ownAllocator_ = allocator_ = RAPIDJSON_NEW(Allocator)(); + } + +#if RAPIDJSON_HAS_CXX11_RVALUE_REFS + //! Move constructor in C++11 + GenericDocument(GenericDocument&& rhs) RAPIDJSON_NOEXCEPT + : ValueType(std::forward(rhs)), // explicit cast to avoid prohibited move from Document + allocator_(rhs.allocator_), + ownAllocator_(rhs.ownAllocator_), + stack_(std::move(rhs.stack_)), + parseResult_(rhs.parseResult_) + { + rhs.allocator_ = 0; + rhs.ownAllocator_ = 0; + rhs.parseResult_ = ParseResult(); + } +#endif + + ~GenericDocument() { + // Clear the ::ValueType before ownAllocator is destroyed, ~ValueType() + // runs last and may access its elements or members which would be freed + // with an allocator like MemoryPoolAllocator (CrtAllocator does not + // free its data when destroyed, but MemoryPoolAllocator does). + if (ownAllocator_) { + ValueType::SetNull(); + } + Destroy(); + } + +#if RAPIDJSON_HAS_CXX11_RVALUE_REFS + //! Move assignment in C++11 + GenericDocument& operator=(GenericDocument&& rhs) RAPIDJSON_NOEXCEPT + { + // The cast to ValueType is necessary here, because otherwise it would + // attempt to call GenericValue's templated assignment operator. + ValueType::operator=(std::forward(rhs)); + + // Calling the destructor here would prematurely call stack_'s destructor + Destroy(); + + allocator_ = rhs.allocator_; + ownAllocator_ = rhs.ownAllocator_; + stack_ = std::move(rhs.stack_); + parseResult_ = rhs.parseResult_; + + rhs.allocator_ = 0; + rhs.ownAllocator_ = 0; + rhs.parseResult_ = ParseResult(); + + return *this; + } +#endif + + //! Exchange the contents of this document with those of another. + /*! + \param rhs Another document. + \note Constant complexity. + \see GenericValue::Swap + */ + GenericDocument& Swap(GenericDocument& rhs) RAPIDJSON_NOEXCEPT { + ValueType::Swap(rhs); + stack_.Swap(rhs.stack_); + internal::Swap(allocator_, rhs.allocator_); + internal::Swap(ownAllocator_, rhs.ownAllocator_); + internal::Swap(parseResult_, rhs.parseResult_); + return *this; + } + + // Allow Swap with ValueType. + // Refer to Effective C++ 3rd Edition/Item 33: Avoid hiding inherited names. + using ValueType::Swap; + + //! free-standing swap function helper + /*! + Helper function to enable support for common swap implementation pattern based on \c std::swap: + \code + void swap(MyClass& a, MyClass& b) { + using std::swap; + swap(a.doc, b.doc); + // ... + } + \endcode + \see Swap() + */ + friend inline void swap(GenericDocument& a, GenericDocument& b) RAPIDJSON_NOEXCEPT { a.Swap(b); } + + //! Populate this document by a generator which produces SAX events. + /*! \tparam Generator A functor with bool f(Handler) prototype. + \param g Generator functor which sends SAX events to the parameter. + \return The document itself for fluent API. + */ + template + GenericDocument& Populate(Generator& g) { + ClearStackOnExit scope(*this); + if (g(*this)) { + RAPIDJSON_ASSERT(stack_.GetSize() == sizeof(ValueType)); // Got one and only one root object + ValueType::operator=(*stack_.template Pop(1));// Move value from stack to document + } + return *this; + } + + //!@name Parse from stream + //!@{ + + //! Parse JSON text from an input stream (with Encoding conversion) + /*! \tparam parseFlags Combination of \ref ParseFlag. + \tparam SourceEncoding Encoding of input stream + \tparam InputStream Type of input stream, implementing Stream concept + \param is Input stream to be parsed. + \return The document itself for fluent API. + */ + template + GenericDocument& ParseStream(InputStream& is) { + GenericReader reader( + stack_.HasAllocator() ? &stack_.GetAllocator() : 0); + ClearStackOnExit scope(*this); + parseResult_ = reader.template Parse(is, *this); + if (parseResult_) { + RAPIDJSON_ASSERT(stack_.GetSize() == sizeof(ValueType)); // Got one and only one root object + ValueType::operator=(*stack_.template Pop(1));// Move value from stack to document + } + return *this; + } + + //! Parse JSON text from an input stream + /*! \tparam parseFlags Combination of \ref ParseFlag. + \tparam InputStream Type of input stream, implementing Stream concept + \param is Input stream to be parsed. + \return The document itself for fluent API. + */ + template + GenericDocument& ParseStream(InputStream& is) { + return ParseStream(is); + } + + //! Parse JSON text from an input stream (with \ref kParseDefaultFlags) + /*! \tparam InputStream Type of input stream, implementing Stream concept + \param is Input stream to be parsed. + \return The document itself for fluent API. + */ + template + GenericDocument& ParseStream(InputStream& is) { + return ParseStream(is); + } + //!@} + + //!@name Parse in-place from mutable string + //!@{ + + //! Parse JSON text from a mutable string + /*! \tparam parseFlags Combination of \ref ParseFlag. + \param str Mutable zero-terminated string to be parsed. + \return The document itself for fluent API. + */ + template + GenericDocument& ParseInsitu(Ch* str) { + GenericInsituStringStream s(str); + return ParseStream(s); + } + + //! Parse JSON text from a mutable string (with \ref kParseDefaultFlags) + /*! \param str Mutable zero-terminated string to be parsed. + \return The document itself for fluent API. + */ + GenericDocument& ParseInsitu(Ch* str) { + return ParseInsitu(str); + } + //!@} + + //!@name Parse from read-only string + //!@{ + + //! Parse JSON text from a read-only string (with Encoding conversion) + /*! \tparam parseFlags Combination of \ref ParseFlag (must not contain \ref kParseInsituFlag). + \tparam SourceEncoding Transcoding from input Encoding + \param str Read-only zero-terminated string to be parsed. + */ + template + GenericDocument& Parse(const typename SourceEncoding::Ch* str) { + RAPIDJSON_ASSERT(!(parseFlags & kParseInsituFlag)); + GenericStringStream s(str); + return ParseStream(s); + } + + //! Parse JSON text from a read-only string + /*! \tparam parseFlags Combination of \ref ParseFlag (must not contain \ref kParseInsituFlag). + \param str Read-only zero-terminated string to be parsed. + */ + template + GenericDocument& Parse(const Ch* str) { + return Parse(str); + } + + //! Parse JSON text from a read-only string (with \ref kParseDefaultFlags) + /*! \param str Read-only zero-terminated string to be parsed. + */ + GenericDocument& Parse(const Ch* str) { + return Parse(str); + } + + template + GenericDocument& Parse(const typename SourceEncoding::Ch* str, size_t length) { + RAPIDJSON_ASSERT(!(parseFlags & kParseInsituFlag)); + MemoryStream ms(reinterpret_cast(str), length * sizeof(typename SourceEncoding::Ch)); + EncodedInputStream is(ms); + ParseStream(is); + return *this; + } + + template + GenericDocument& Parse(const Ch* str, size_t length) { + return Parse(str, length); + } + + GenericDocument& Parse(const Ch* str, size_t length) { + return Parse(str, length); + } + +#if RAPIDJSON_HAS_STDSTRING + template + GenericDocument& Parse(const std::basic_string& str) { + // c_str() is constant complexity according to standard. Should be faster than Parse(const char*, size_t) + return Parse(str.c_str()); + } + + template + GenericDocument& Parse(const std::basic_string& str) { + return Parse(str.c_str()); + } + + GenericDocument& Parse(const std::basic_string& str) { + return Parse(str); + } +#endif // RAPIDJSON_HAS_STDSTRING + + //!@} + + //!@name Handling parse errors + //!@{ + + //! Whether a parse error has occurred in the last parsing. + bool HasParseError() const { return parseResult_.IsError(); } + + //! Get the \ref ParseErrorCode of last parsing. + ParseErrorCode GetParseError() const { return parseResult_.Code(); } + + //! Get the position of last parsing error in input, 0 otherwise. + size_t GetErrorOffset() const { return parseResult_.Offset(); } + + //! Implicit conversion to get the last parse result +#ifndef __clang // -Wdocumentation + /*! \return \ref ParseResult of the last parse operation + + \code + Document doc; + ParseResult ok = doc.Parse(json); + if (!ok) + printf( "JSON parse error: %s (%u)\n", GetParseError_En(ok.Code()), ok.Offset()); + \endcode + */ +#endif + operator ParseResult() const { return parseResult_; } + //!@} + + //! Get the allocator of this document. + Allocator& GetAllocator() { + RAPIDJSON_ASSERT(allocator_); + return *allocator_; + } + + //! Get the capacity of stack in bytes. + size_t GetStackCapacity() const { return stack_.GetCapacity(); } + +private: + // clear stack on any exit from ParseStream, e.g. due to exception + struct ClearStackOnExit { + explicit ClearStackOnExit(GenericDocument& d) : d_(d) {} + ~ClearStackOnExit() { d_.ClearStack(); } + private: + ClearStackOnExit(const ClearStackOnExit&); + ClearStackOnExit& operator=(const ClearStackOnExit&); + GenericDocument& d_; + }; + + // callers of the following private Handler functions + // template friend class GenericReader; // for parsing + template friend class GenericValue; // for deep copying + +public: + // Implementation of Handler + bool Null() { new (stack_.template Push()) ValueType(); return true; } + bool Bool(bool b) { new (stack_.template Push()) ValueType(b); return true; } + bool Int(int i) { new (stack_.template Push()) ValueType(i); return true; } + bool Uint(unsigned i) { new (stack_.template Push()) ValueType(i); return true; } + bool Int64(int64_t i) { new (stack_.template Push()) ValueType(i); return true; } + bool Uint64(uint64_t i) { new (stack_.template Push()) ValueType(i); return true; } + bool Double(double d) { new (stack_.template Push()) ValueType(d); return true; } + + bool RawNumber(const Ch* str, SizeType length, bool copy) { + if (copy) + new (stack_.template Push()) ValueType(str, length, GetAllocator()); + else + new (stack_.template Push()) ValueType(str, length); + return true; + } + + bool String(const Ch* str, SizeType length, bool copy) { + if (copy) + new (stack_.template Push()) ValueType(str, length, GetAllocator()); + else + new (stack_.template Push()) ValueType(str, length); + return true; + } + + bool StartObject() { new (stack_.template Push()) ValueType(kObjectType); return true; } + + bool Key(const Ch* str, SizeType length, bool copy) { return String(str, length, copy); } + + bool EndObject(SizeType memberCount) { + typename ValueType::Member* members = stack_.template Pop(memberCount); + stack_.template Top()->SetObjectRaw(members, memberCount, GetAllocator()); + return true; + } + + bool StartArray() { new (stack_.template Push()) ValueType(kArrayType); return true; } + + bool EndArray(SizeType elementCount) { + ValueType* elements = stack_.template Pop(elementCount); + stack_.template Top()->SetArrayRaw(elements, elementCount, GetAllocator()); + return true; + } + +private: + //! Prohibit copying + GenericDocument(const GenericDocument&); + //! Prohibit assignment + GenericDocument& operator=(const GenericDocument&); + + void ClearStack() { + if (Allocator::kNeedFree) + while (stack_.GetSize() > 0) // Here assumes all elements in stack array are GenericValue (Member is actually 2 GenericValue objects) + (stack_.template Pop(1))->~ValueType(); + else + stack_.Clear(); + stack_.ShrinkToFit(); + } + + void Destroy() { + RAPIDJSON_DELETE(ownAllocator_); + } + + static const size_t kDefaultStackCapacity = 1024; + Allocator* allocator_; + Allocator* ownAllocator_; + internal::Stack stack_; + ParseResult parseResult_; +}; + +//! GenericDocument with UTF8 encoding +typedef GenericDocument > Document; + + +//! Helper class for accessing Value of array type. +/*! + Instance of this helper class is obtained by \c GenericValue::GetArray(). + In addition to all APIs for array type, it provides range-based for loop if \c RAPIDJSON_HAS_CXX11_RANGE_FOR=1. +*/ +template +class GenericArray { +public: + typedef GenericArray ConstArray; + typedef GenericArray Array; + typedef ValueT PlainType; + typedef typename internal::MaybeAddConst::Type ValueType; + typedef ValueType* ValueIterator; // This may be const or non-const iterator + typedef const ValueT* ConstValueIterator; + typedef typename ValueType::AllocatorType AllocatorType; + typedef typename ValueType::StringRefType StringRefType; + + template + friend class GenericValue; + + GenericArray(const GenericArray& rhs) : value_(rhs.value_) {} + GenericArray& operator=(const GenericArray& rhs) { value_ = rhs.value_; return *this; } + ~GenericArray() {} + + operator ValueType&() const { return value_; } + SizeType Size() const { return value_.Size(); } + SizeType Capacity() const { return value_.Capacity(); } + bool Empty() const { return value_.Empty(); } + void Clear() const { value_.Clear(); } + ValueType& operator[](SizeType index) const { return value_[index]; } + ValueIterator Begin() const { return value_.Begin(); } + ValueIterator End() const { return value_.End(); } + GenericArray Reserve(SizeType newCapacity, AllocatorType &allocator) const { value_.Reserve(newCapacity, allocator); return *this; } + GenericArray PushBack(ValueType& value, AllocatorType& allocator) const { value_.PushBack(value, allocator); return *this; } +#if RAPIDJSON_HAS_CXX11_RVALUE_REFS + GenericArray PushBack(ValueType&& value, AllocatorType& allocator) const { value_.PushBack(value, allocator); return *this; } +#endif // RAPIDJSON_HAS_CXX11_RVALUE_REFS + GenericArray PushBack(StringRefType value, AllocatorType& allocator) const { value_.PushBack(value, allocator); return *this; } + template RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr, internal::IsGenericValue >), (const GenericArray&)) PushBack(T value, AllocatorType& allocator) const { value_.PushBack(value, allocator); return *this; } + GenericArray PopBack() const { value_.PopBack(); return *this; } + ValueIterator Erase(ConstValueIterator pos) const { return value_.Erase(pos); } + ValueIterator Erase(ConstValueIterator first, ConstValueIterator last) const { return value_.Erase(first, last); } + +#if RAPIDJSON_HAS_CXX11_RANGE_FOR + ValueIterator begin() const { return value_.Begin(); } + ValueIterator end() const { return value_.End(); } +#endif + +private: + GenericArray(); + GenericArray(ValueType& value) : value_(value) {} + ValueType& value_; +}; + +//! Helper class for accessing Value of object type. +/*! + Instance of this helper class is obtained by \c GenericValue::GetObject(). + In addition to all APIs for array type, it provides range-based for loop if \c RAPIDJSON_HAS_CXX11_RANGE_FOR=1. +*/ +template +class GenericObject { +public: + typedef GenericObject ConstObject; + typedef GenericObject Object; + typedef ValueT PlainType; + typedef typename internal::MaybeAddConst::Type ValueType; + typedef GenericMemberIterator MemberIterator; // This may be const or non-const iterator + typedef GenericMemberIterator ConstMemberIterator; + typedef typename ValueType::AllocatorType AllocatorType; + typedef typename ValueType::StringRefType StringRefType; + typedef typename ValueType::EncodingType EncodingType; + typedef typename ValueType::Ch Ch; + + template + friend class GenericValue; + + GenericObject(const GenericObject& rhs) : value_(rhs.value_) {} + GenericObject& operator=(const GenericObject& rhs) { value_ = rhs.value_; return *this; } + ~GenericObject() {} + + operator ValueType&() const { return value_; } + SizeType MemberCount() const { return value_.MemberCount(); } + SizeType MemberCapacity() const { return value_.MemberCapacity(); } + bool ObjectEmpty() const { return value_.ObjectEmpty(); } + template ValueType& operator[](T* name) const { return value_[name]; } + template ValueType& operator[](const GenericValue& name) const { return value_[name]; } +#if RAPIDJSON_HAS_STDSTRING + ValueType& operator[](const std::basic_string& name) const { return value_[name]; } +#endif + MemberIterator MemberBegin() const { return value_.MemberBegin(); } + MemberIterator MemberEnd() const { return value_.MemberEnd(); } + GenericObject MemberReserve(SizeType newCapacity, AllocatorType &allocator) const { value_.MemberReserve(newCapacity, allocator); return *this; } + bool HasMember(const Ch* name) const { return value_.HasMember(name); } +#if RAPIDJSON_HAS_STDSTRING + bool HasMember(const std::basic_string& name) const { return value_.HasMember(name); } +#endif + template bool HasMember(const GenericValue& name) const { return value_.HasMember(name); } + MemberIterator FindMember(const Ch* name) const { return value_.FindMember(name); } + template MemberIterator FindMember(const GenericValue& name) const { return value_.FindMember(name); } +#if RAPIDJSON_HAS_STDSTRING + MemberIterator FindMember(const std::basic_string& name) const { return value_.FindMember(name); } +#endif + GenericObject AddMember(ValueType& name, ValueType& value, AllocatorType& allocator) const { value_.AddMember(name, value, allocator); return *this; } + GenericObject AddMember(ValueType& name, StringRefType value, AllocatorType& allocator) const { value_.AddMember(name, value, allocator); return *this; } +#if RAPIDJSON_HAS_STDSTRING + GenericObject AddMember(ValueType& name, std::basic_string& value, AllocatorType& allocator) const { value_.AddMember(name, value, allocator); return *this; } +#endif + template RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr, internal::IsGenericValue >), (ValueType&)) AddMember(ValueType& name, T value, AllocatorType& allocator) const { value_.AddMember(name, value, allocator); return *this; } +#if RAPIDJSON_HAS_CXX11_RVALUE_REFS + GenericObject AddMember(ValueType&& name, ValueType&& value, AllocatorType& allocator) const { value_.AddMember(name, value, allocator); return *this; } + GenericObject AddMember(ValueType&& name, ValueType& value, AllocatorType& allocator) const { value_.AddMember(name, value, allocator); return *this; } + GenericObject AddMember(ValueType& name, ValueType&& value, AllocatorType& allocator) const { value_.AddMember(name, value, allocator); return *this; } + GenericObject AddMember(StringRefType name, ValueType&& value, AllocatorType& allocator) const { value_.AddMember(name, value, allocator); return *this; } +#endif // RAPIDJSON_HAS_CXX11_RVALUE_REFS + GenericObject AddMember(StringRefType name, ValueType& value, AllocatorType& allocator) const { value_.AddMember(name, value, allocator); return *this; } + GenericObject AddMember(StringRefType name, StringRefType value, AllocatorType& allocator) const { value_.AddMember(name, value, allocator); return *this; } + template RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr, internal::IsGenericValue >), (GenericObject)) AddMember(StringRefType name, T value, AllocatorType& allocator) const { value_.AddMember(name, value, allocator); return *this; } + void RemoveAllMembers() { value_.RemoveAllMembers(); } + bool RemoveMember(const Ch* name) const { return value_.RemoveMember(name); } +#if RAPIDJSON_HAS_STDSTRING + bool RemoveMember(const std::basic_string& name) const { return value_.RemoveMember(name); } +#endif + template bool RemoveMember(const GenericValue& name) const { return value_.RemoveMember(name); } + MemberIterator RemoveMember(MemberIterator m) const { return value_.RemoveMember(m); } + MemberIterator EraseMember(ConstMemberIterator pos) const { return value_.EraseMember(pos); } + MemberIterator EraseMember(ConstMemberIterator first, ConstMemberIterator last) const { return value_.EraseMember(first, last); } + bool EraseMember(const Ch* name) const { return value_.EraseMember(name); } +#if RAPIDJSON_HAS_STDSTRING + bool EraseMember(const std::basic_string& name) const { return EraseMember(ValueType(StringRef(name))); } +#endif + template bool EraseMember(const GenericValue& name) const { return value_.EraseMember(name); } + +#if RAPIDJSON_HAS_CXX11_RANGE_FOR + MemberIterator begin() const { return value_.MemberBegin(); } + MemberIterator end() const { return value_.MemberEnd(); } +#endif + +private: + GenericObject(); + GenericObject(ValueType& value) : value_(value) {} + ValueType& value_; +}; + +RAPIDJSON_NAMESPACE_END +RAPIDJSON_DIAG_POP + +#ifdef RAPIDJSON_WINDOWS_GETOBJECT_WORKAROUND_APPLIED +#pragma pop_macro("GetObject") +#undef RAPIDJSON_WINDOWS_GETOBJECT_WORKAROUND_APPLIED +#endif + +#endif // RAPIDJSON_DOCUMENT_H_ diff --git a/DFL_BOM_WL_TOERP/rapidjson/encodedstream.h b/DFL_BOM_WL_TOERP/rapidjson/encodedstream.h new file mode 100644 index 0000000..cf046b8 --- /dev/null +++ b/DFL_BOM_WL_TOERP/rapidjson/encodedstream.h @@ -0,0 +1,299 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +#ifndef RAPIDJSON_ENCODEDSTREAM_H_ +#define RAPIDJSON_ENCODEDSTREAM_H_ + +#include "stream.h" +#include "memorystream.h" + +#ifdef __GNUC__ +RAPIDJSON_DIAG_PUSH +RAPIDJSON_DIAG_OFF(effc++) +#endif + +#ifdef __clang__ +RAPIDJSON_DIAG_PUSH +RAPIDJSON_DIAG_OFF(padded) +#endif + +RAPIDJSON_NAMESPACE_BEGIN + +//! Input byte stream wrapper with a statically bound encoding. +/*! + \tparam Encoding The interpretation of encoding of the stream. Either UTF8, UTF16LE, UTF16BE, UTF32LE, UTF32BE. + \tparam InputByteStream Type of input byte stream. For example, FileReadStream. +*/ +template +class EncodedInputStream { + RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1); +public: + typedef typename Encoding::Ch Ch; + + EncodedInputStream(InputByteStream& is) : is_(is) { + current_ = Encoding::TakeBOM(is_); + } + + Ch Peek() const { return current_; } + Ch Take() { Ch c = current_; current_ = Encoding::Take(is_); return c; } + size_t Tell() const { return is_.Tell(); } + + // Not implemented + void Put(Ch) { RAPIDJSON_ASSERT(false); } + void Flush() { RAPIDJSON_ASSERT(false); } + Ch* PutBegin() { RAPIDJSON_ASSERT(false); return 0; } + size_t PutEnd(Ch*) { RAPIDJSON_ASSERT(false); return 0; } + +private: + EncodedInputStream(const EncodedInputStream&); + EncodedInputStream& operator=(const EncodedInputStream&); + + InputByteStream& is_; + Ch current_; +}; + +//! Specialized for UTF8 MemoryStream. +template <> +class EncodedInputStream, MemoryStream> { +public: + typedef UTF8<>::Ch Ch; + + EncodedInputStream(MemoryStream& is) : is_(is) { + if (static_cast(is_.Peek()) == 0xEFu) is_.Take(); + if (static_cast(is_.Peek()) == 0xBBu) is_.Take(); + if (static_cast(is_.Peek()) == 0xBFu) is_.Take(); + } + Ch Peek() const { return is_.Peek(); } + Ch Take() { return is_.Take(); } + size_t Tell() const { return is_.Tell(); } + + // Not implemented + void Put(Ch) {} + void Flush() {} + Ch* PutBegin() { return 0; } + size_t PutEnd(Ch*) { return 0; } + + MemoryStream& is_; + +private: + EncodedInputStream(const EncodedInputStream&); + EncodedInputStream& operator=(const EncodedInputStream&); +}; + +//! Output byte stream wrapper with statically bound encoding. +/*! + \tparam Encoding The interpretation of encoding of the stream. Either UTF8, UTF16LE, UTF16BE, UTF32LE, UTF32BE. + \tparam OutputByteStream Type of input byte stream. For example, FileWriteStream. +*/ +template +class EncodedOutputStream { + RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1); +public: + typedef typename Encoding::Ch Ch; + + EncodedOutputStream(OutputByteStream& os, bool putBOM = true) : os_(os) { + if (putBOM) + Encoding::PutBOM(os_); + } + + void Put(Ch c) { Encoding::Put(os_, c); } + void Flush() { os_.Flush(); } + + // Not implemented + Ch Peek() const { RAPIDJSON_ASSERT(false); return 0;} + Ch Take() { RAPIDJSON_ASSERT(false); return 0;} + size_t Tell() const { RAPIDJSON_ASSERT(false); return 0; } + Ch* PutBegin() { RAPIDJSON_ASSERT(false); return 0; } + size_t PutEnd(Ch*) { RAPIDJSON_ASSERT(false); return 0; } + +private: + EncodedOutputStream(const EncodedOutputStream&); + EncodedOutputStream& operator=(const EncodedOutputStream&); + + OutputByteStream& os_; +}; + +#define RAPIDJSON_ENCODINGS_FUNC(x) UTF8::x, UTF16LE::x, UTF16BE::x, UTF32LE::x, UTF32BE::x + +//! Input stream wrapper with dynamically bound encoding and automatic encoding detection. +/*! + \tparam CharType Type of character for reading. + \tparam InputByteStream type of input byte stream to be wrapped. +*/ +template +class AutoUTFInputStream { + RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1); +public: + typedef CharType Ch; + + //! Constructor. + /*! + \param is input stream to be wrapped. + \param type UTF encoding type if it is not detected from the stream. + */ + AutoUTFInputStream(InputByteStream& is, UTFType type = kUTF8) : is_(&is), type_(type), hasBOM_(false) { + RAPIDJSON_ASSERT(type >= kUTF8 && type <= kUTF32BE); + DetectType(); + static const TakeFunc f[] = { RAPIDJSON_ENCODINGS_FUNC(Take) }; + takeFunc_ = f[type_]; + current_ = takeFunc_(*is_); + } + + UTFType GetType() const { return type_; } + bool HasBOM() const { return hasBOM_; } + + Ch Peek() const { return current_; } + Ch Take() { Ch c = current_; current_ = takeFunc_(*is_); return c; } + size_t Tell() const { return is_->Tell(); } + + // Not implemented + void Put(Ch) { RAPIDJSON_ASSERT(false); } + void Flush() { RAPIDJSON_ASSERT(false); } + Ch* PutBegin() { RAPIDJSON_ASSERT(false); return 0; } + size_t PutEnd(Ch*) { RAPIDJSON_ASSERT(false); return 0; } + +private: + AutoUTFInputStream(const AutoUTFInputStream&); + AutoUTFInputStream& operator=(const AutoUTFInputStream&); + + // Detect encoding type with BOM or RFC 4627 + void DetectType() { + // BOM (Byte Order Mark): + // 00 00 FE FF UTF-32BE + // FF FE 00 00 UTF-32LE + // FE FF UTF-16BE + // FF FE UTF-16LE + // EF BB BF UTF-8 + + const unsigned char* c = reinterpret_cast(is_->Peek4()); + if (!c) + return; + + unsigned bom = static_cast(c[0] | (c[1] << 8) | (c[2] << 16) | (c[3] << 24)); + hasBOM_ = false; + if (bom == 0xFFFE0000) { type_ = kUTF32BE; hasBOM_ = true; is_->Take(); is_->Take(); is_->Take(); is_->Take(); } + else if (bom == 0x0000FEFF) { type_ = kUTF32LE; hasBOM_ = true; is_->Take(); is_->Take(); is_->Take(); is_->Take(); } + else if ((bom & 0xFFFF) == 0xFFFE) { type_ = kUTF16BE; hasBOM_ = true; is_->Take(); is_->Take(); } + else if ((bom & 0xFFFF) == 0xFEFF) { type_ = kUTF16LE; hasBOM_ = true; is_->Take(); is_->Take(); } + else if ((bom & 0xFFFFFF) == 0xBFBBEF) { type_ = kUTF8; hasBOM_ = true; is_->Take(); is_->Take(); is_->Take(); } + + // RFC 4627: Section 3 + // "Since the first two characters of a JSON text will always be ASCII + // characters [RFC0020], it is possible to determine whether an octet + // stream is UTF-8, UTF-16 (BE or LE), or UTF-32 (BE or LE) by looking + // at the pattern of nulls in the first four octets." + // 00 00 00 xx UTF-32BE + // 00 xx 00 xx UTF-16BE + // xx 00 00 00 UTF-32LE + // xx 00 xx 00 UTF-16LE + // xx xx xx xx UTF-8 + + if (!hasBOM_) { + int pattern = (c[0] ? 1 : 0) | (c[1] ? 2 : 0) | (c[2] ? 4 : 0) | (c[3] ? 8 : 0); + switch (pattern) { + case 0x08: type_ = kUTF32BE; break; + case 0x0A: type_ = kUTF16BE; break; + case 0x01: type_ = kUTF32LE; break; + case 0x05: type_ = kUTF16LE; break; + case 0x0F: type_ = kUTF8; break; + default: break; // Use type defined by user. + } + } + + // Runtime check whether the size of character type is sufficient. It only perform checks with assertion. + if (type_ == kUTF16LE || type_ == kUTF16BE) RAPIDJSON_ASSERT(sizeof(Ch) >= 2); + if (type_ == kUTF32LE || type_ == kUTF32BE) RAPIDJSON_ASSERT(sizeof(Ch) >= 4); + } + + typedef Ch (*TakeFunc)(InputByteStream& is); + InputByteStream* is_; + UTFType type_; + Ch current_; + TakeFunc takeFunc_; + bool hasBOM_; +}; + +//! Output stream wrapper with dynamically bound encoding and automatic encoding detection. +/*! + \tparam CharType Type of character for writing. + \tparam OutputByteStream type of output byte stream to be wrapped. +*/ +template +class AutoUTFOutputStream { + RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1); +public: + typedef CharType Ch; + + //! Constructor. + /*! + \param os output stream to be wrapped. + \param type UTF encoding type. + \param putBOM Whether to write BOM at the beginning of the stream. + */ + AutoUTFOutputStream(OutputByteStream& os, UTFType type, bool putBOM) : os_(&os), type_(type) { + RAPIDJSON_ASSERT(type >= kUTF8 && type <= kUTF32BE); + + // Runtime check whether the size of character type is sufficient. It only perform checks with assertion. + if (type_ == kUTF16LE || type_ == kUTF16BE) RAPIDJSON_ASSERT(sizeof(Ch) >= 2); + if (type_ == kUTF32LE || type_ == kUTF32BE) RAPIDJSON_ASSERT(sizeof(Ch) >= 4); + + static const PutFunc f[] = { RAPIDJSON_ENCODINGS_FUNC(Put) }; + putFunc_ = f[type_]; + + if (putBOM) + PutBOM(); + } + + UTFType GetType() const { return type_; } + + void Put(Ch c) { putFunc_(*os_, c); } + void Flush() { os_->Flush(); } + + // Not implemented + Ch Peek() const { RAPIDJSON_ASSERT(false); return 0;} + Ch Take() { RAPIDJSON_ASSERT(false); return 0;} + size_t Tell() const { RAPIDJSON_ASSERT(false); return 0; } + Ch* PutBegin() { RAPIDJSON_ASSERT(false); return 0; } + size_t PutEnd(Ch*) { RAPIDJSON_ASSERT(false); return 0; } + +private: + AutoUTFOutputStream(const AutoUTFOutputStream&); + AutoUTFOutputStream& operator=(const AutoUTFOutputStream&); + + void PutBOM() { + typedef void (*PutBOMFunc)(OutputByteStream&); + static const PutBOMFunc f[] = { RAPIDJSON_ENCODINGS_FUNC(PutBOM) }; + f[type_](*os_); + } + + typedef void (*PutFunc)(OutputByteStream&, Ch); + + OutputByteStream* os_; + UTFType type_; + PutFunc putFunc_; +}; + +#undef RAPIDJSON_ENCODINGS_FUNC + +RAPIDJSON_NAMESPACE_END + +#ifdef __clang__ +RAPIDJSON_DIAG_POP +#endif + +#ifdef __GNUC__ +RAPIDJSON_DIAG_POP +#endif + +#endif // RAPIDJSON_FILESTREAM_H_ diff --git a/DFL_BOM_WL_TOERP/rapidjson/encodings.h b/DFL_BOM_WL_TOERP/rapidjson/encodings.h new file mode 100644 index 0000000..50ad18b --- /dev/null +++ b/DFL_BOM_WL_TOERP/rapidjson/encodings.h @@ -0,0 +1,716 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +#ifndef RAPIDJSON_ENCODINGS_H_ +#define RAPIDJSON_ENCODINGS_H_ + +#include "rapidjson.h" + +#if defined(_MSC_VER) && !defined(__clang__) +RAPIDJSON_DIAG_PUSH +RAPIDJSON_DIAG_OFF(4244) // conversion from 'type1' to 'type2', possible loss of data +RAPIDJSON_DIAG_OFF(4702) // unreachable code +#elif defined(__GNUC__) +RAPIDJSON_DIAG_PUSH +RAPIDJSON_DIAG_OFF(effc++) +RAPIDJSON_DIAG_OFF(overflow) +#endif + +RAPIDJSON_NAMESPACE_BEGIN + +/////////////////////////////////////////////////////////////////////////////// +// Encoding + +/*! \class rapidjson::Encoding + \brief Concept for encoding of Unicode characters. + +\code +concept Encoding { + typename Ch; //! Type of character. A "character" is actually a code unit in unicode's definition. + + enum { supportUnicode = 1 }; // or 0 if not supporting unicode + + //! \brief Encode a Unicode codepoint to an output stream. + //! \param os Output stream. + //! \param codepoint An unicode codepoint, ranging from 0x0 to 0x10FFFF inclusively. + template + static void Encode(OutputStream& os, unsigned codepoint); + + //! \brief Decode a Unicode codepoint from an input stream. + //! \param is Input stream. + //! \param codepoint Output of the unicode codepoint. + //! \return true if a valid codepoint can be decoded from the stream. + template + static bool Decode(InputStream& is, unsigned* codepoint); + + //! \brief Validate one Unicode codepoint from an encoded stream. + //! \param is Input stream to obtain codepoint. + //! \param os Output for copying one codepoint. + //! \return true if it is valid. + //! \note This function just validating and copying the codepoint without actually decode it. + template + static bool Validate(InputStream& is, OutputStream& os); + + // The following functions are deal with byte streams. + + //! Take a character from input byte stream, skip BOM if exist. + template + static CharType TakeBOM(InputByteStream& is); + + //! Take a character from input byte stream. + template + static Ch Take(InputByteStream& is); + + //! Put BOM to output byte stream. + template + static void PutBOM(OutputByteStream& os); + + //! Put a character to output byte stream. + template + static void Put(OutputByteStream& os, Ch c); +}; +\endcode +*/ + +/////////////////////////////////////////////////////////////////////////////// +// UTF8 + +//! UTF-8 encoding. +/*! http://en.wikipedia.org/wiki/UTF-8 + http://tools.ietf.org/html/rfc3629 + \tparam CharType Code unit for storing 8-bit UTF-8 data. Default is char. + \note implements Encoding concept +*/ +template +struct UTF8 { + typedef CharType Ch; + + enum { supportUnicode = 1 }; + + template + static void Encode(OutputStream& os, unsigned codepoint) { + if (codepoint <= 0x7F) + os.Put(static_cast(codepoint & 0xFF)); + else if (codepoint <= 0x7FF) { + os.Put(static_cast(0xC0 | ((codepoint >> 6) & 0xFF))); + os.Put(static_cast(0x80 | ((codepoint & 0x3F)))); + } + else if (codepoint <= 0xFFFF) { + os.Put(static_cast(0xE0 | ((codepoint >> 12) & 0xFF))); + os.Put(static_cast(0x80 | ((codepoint >> 6) & 0x3F))); + os.Put(static_cast(0x80 | (codepoint & 0x3F))); + } + else { + RAPIDJSON_ASSERT(codepoint <= 0x10FFFF); + os.Put(static_cast(0xF0 | ((codepoint >> 18) & 0xFF))); + os.Put(static_cast(0x80 | ((codepoint >> 12) & 0x3F))); + os.Put(static_cast(0x80 | ((codepoint >> 6) & 0x3F))); + os.Put(static_cast(0x80 | (codepoint & 0x3F))); + } + } + + template + static void EncodeUnsafe(OutputStream& os, unsigned codepoint) { + if (codepoint <= 0x7F) + PutUnsafe(os, static_cast(codepoint & 0xFF)); + else if (codepoint <= 0x7FF) { + PutUnsafe(os, static_cast(0xC0 | ((codepoint >> 6) & 0xFF))); + PutUnsafe(os, static_cast(0x80 | ((codepoint & 0x3F)))); + } + else if (codepoint <= 0xFFFF) { + PutUnsafe(os, static_cast(0xE0 | ((codepoint >> 12) & 0xFF))); + PutUnsafe(os, static_cast(0x80 | ((codepoint >> 6) & 0x3F))); + PutUnsafe(os, static_cast(0x80 | (codepoint & 0x3F))); + } + else { + RAPIDJSON_ASSERT(codepoint <= 0x10FFFF); + PutUnsafe(os, static_cast(0xF0 | ((codepoint >> 18) & 0xFF))); + PutUnsafe(os, static_cast(0x80 | ((codepoint >> 12) & 0x3F))); + PutUnsafe(os, static_cast(0x80 | ((codepoint >> 6) & 0x3F))); + PutUnsafe(os, static_cast(0x80 | (codepoint & 0x3F))); + } + } + + template + static bool Decode(InputStream& is, unsigned* codepoint) { +#define RAPIDJSON_COPY() c = is.Take(); *codepoint = (*codepoint << 6) | (static_cast(c) & 0x3Fu) +#define RAPIDJSON_TRANS(mask) result &= ((GetRange(static_cast(c)) & mask) != 0) +#define RAPIDJSON_TAIL() RAPIDJSON_COPY(); RAPIDJSON_TRANS(0x70) + typename InputStream::Ch c = is.Take(); + if (!(c & 0x80)) { + *codepoint = static_cast(c); + return true; + } + + unsigned char type = GetRange(static_cast(c)); + if (type >= 32) { + *codepoint = 0; + } else { + *codepoint = (0xFFu >> type) & static_cast(c); + } + bool result = true; + switch (type) { + case 2: RAPIDJSON_TAIL(); return result; + case 3: RAPIDJSON_TAIL(); RAPIDJSON_TAIL(); return result; + case 4: RAPIDJSON_COPY(); RAPIDJSON_TRANS(0x50); RAPIDJSON_TAIL(); return result; + case 5: RAPIDJSON_COPY(); RAPIDJSON_TRANS(0x10); RAPIDJSON_TAIL(); RAPIDJSON_TAIL(); return result; + case 6: RAPIDJSON_TAIL(); RAPIDJSON_TAIL(); RAPIDJSON_TAIL(); return result; + case 10: RAPIDJSON_COPY(); RAPIDJSON_TRANS(0x20); RAPIDJSON_TAIL(); return result; + case 11: RAPIDJSON_COPY(); RAPIDJSON_TRANS(0x60); RAPIDJSON_TAIL(); RAPIDJSON_TAIL(); return result; + default: return false; + } +#undef RAPIDJSON_COPY +#undef RAPIDJSON_TRANS +#undef RAPIDJSON_TAIL + } + + template + static bool Validate(InputStream& is, OutputStream& os) { +#define RAPIDJSON_COPY() os.Put(c = is.Take()) +#define RAPIDJSON_TRANS(mask) result &= ((GetRange(static_cast(c)) & mask) != 0) +#define RAPIDJSON_TAIL() RAPIDJSON_COPY(); RAPIDJSON_TRANS(0x70) + Ch c; + RAPIDJSON_COPY(); + if (!(c & 0x80)) + return true; + + bool result = true; + switch (GetRange(static_cast(c))) { + case 2: RAPIDJSON_TAIL(); return result; + case 3: RAPIDJSON_TAIL(); RAPIDJSON_TAIL(); return result; + case 4: RAPIDJSON_COPY(); RAPIDJSON_TRANS(0x50); RAPIDJSON_TAIL(); return result; + case 5: RAPIDJSON_COPY(); RAPIDJSON_TRANS(0x10); RAPIDJSON_TAIL(); RAPIDJSON_TAIL(); return result; + case 6: RAPIDJSON_TAIL(); RAPIDJSON_TAIL(); RAPIDJSON_TAIL(); return result; + case 10: RAPIDJSON_COPY(); RAPIDJSON_TRANS(0x20); RAPIDJSON_TAIL(); return result; + case 11: RAPIDJSON_COPY(); RAPIDJSON_TRANS(0x60); RAPIDJSON_TAIL(); RAPIDJSON_TAIL(); return result; + default: return false; + } +#undef RAPIDJSON_COPY +#undef RAPIDJSON_TRANS +#undef RAPIDJSON_TAIL + } + + static unsigned char GetRange(unsigned char c) { + // Referring to DFA of http://bjoern.hoehrmann.de/utf-8/decoder/dfa/ + // With new mapping 1 -> 0x10, 7 -> 0x20, 9 -> 0x40, such that AND operation can test multiple types. + static const unsigned char type[] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, + 0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 8,8,2,2,2,2,2,2,2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, + 10,3,3,3,3,3,3,3,3,3,3,3,3,4,3,3, 11,6,6,6,5,8,8,8,8,8,8,8,8,8,8,8, + }; + return type[c]; + } + + template + static CharType TakeBOM(InputByteStream& is) { + RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1); + typename InputByteStream::Ch c = Take(is); + if (static_cast(c) != 0xEFu) return c; + c = is.Take(); + if (static_cast(c) != 0xBBu) return c; + c = is.Take(); + if (static_cast(c) != 0xBFu) return c; + c = is.Take(); + return c; + } + + template + static Ch Take(InputByteStream& is) { + RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1); + return static_cast(is.Take()); + } + + template + static void PutBOM(OutputByteStream& os) { + RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1); + os.Put(static_cast(0xEFu)); + os.Put(static_cast(0xBBu)); + os.Put(static_cast(0xBFu)); + } + + template + static void Put(OutputByteStream& os, Ch c) { + RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1); + os.Put(static_cast(c)); + } +}; + +/////////////////////////////////////////////////////////////////////////////// +// UTF16 + +//! UTF-16 encoding. +/*! http://en.wikipedia.org/wiki/UTF-16 + http://tools.ietf.org/html/rfc2781 + \tparam CharType Type for storing 16-bit UTF-16 data. Default is wchar_t. C++11 may use char16_t instead. + \note implements Encoding concept + + \note For in-memory access, no need to concern endianness. The code units and code points are represented by CPU's endianness. + For streaming, use UTF16LE and UTF16BE, which handle endianness. +*/ +template +struct UTF16 { + typedef CharType Ch; + RAPIDJSON_STATIC_ASSERT(sizeof(Ch) >= 2); + + enum { supportUnicode = 1 }; + + template + static void Encode(OutputStream& os, unsigned codepoint) { + RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputStream::Ch) >= 2); + if (codepoint <= 0xFFFF) { + RAPIDJSON_ASSERT(codepoint < 0xD800 || codepoint > 0xDFFF); // Code point itself cannot be surrogate pair + os.Put(static_cast(codepoint)); + } + else { + RAPIDJSON_ASSERT(codepoint <= 0x10FFFF); + unsigned v = codepoint - 0x10000; + os.Put(static_cast((v >> 10) | 0xD800)); + os.Put(static_cast((v & 0x3FF) | 0xDC00)); + } + } + + + template + static void EncodeUnsafe(OutputStream& os, unsigned codepoint) { + RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputStream::Ch) >= 2); + if (codepoint <= 0xFFFF) { + RAPIDJSON_ASSERT(codepoint < 0xD800 || codepoint > 0xDFFF); // Code point itself cannot be surrogate pair + PutUnsafe(os, static_cast(codepoint)); + } + else { + RAPIDJSON_ASSERT(codepoint <= 0x10FFFF); + unsigned v = codepoint - 0x10000; + PutUnsafe(os, static_cast((v >> 10) | 0xD800)); + PutUnsafe(os, static_cast((v & 0x3FF) | 0xDC00)); + } + } + + template + static bool Decode(InputStream& is, unsigned* codepoint) { + RAPIDJSON_STATIC_ASSERT(sizeof(typename InputStream::Ch) >= 2); + typename InputStream::Ch c = is.Take(); + if (c < 0xD800 || c > 0xDFFF) { + *codepoint = static_cast(c); + return true; + } + else if (c <= 0xDBFF) { + *codepoint = (static_cast(c) & 0x3FF) << 10; + c = is.Take(); + *codepoint |= (static_cast(c) & 0x3FF); + *codepoint += 0x10000; + return c >= 0xDC00 && c <= 0xDFFF; + } + return false; + } + + template + static bool Validate(InputStream& is, OutputStream& os) { + RAPIDJSON_STATIC_ASSERT(sizeof(typename InputStream::Ch) >= 2); + RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputStream::Ch) >= 2); + typename InputStream::Ch c; + os.Put(static_cast(c = is.Take())); + if (c < 0xD800 || c > 0xDFFF) + return true; + else if (c <= 0xDBFF) { + os.Put(c = is.Take()); + return c >= 0xDC00 && c <= 0xDFFF; + } + return false; + } +}; + +//! UTF-16 little endian encoding. +template +struct UTF16LE : UTF16 { + template + static CharType TakeBOM(InputByteStream& is) { + RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1); + CharType c = Take(is); + return static_cast(c) == 0xFEFFu ? Take(is) : c; + } + + template + static CharType Take(InputByteStream& is) { + RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1); + unsigned c = static_cast(is.Take()); + c |= static_cast(static_cast(is.Take())) << 8; + return static_cast(c); + } + + template + static void PutBOM(OutputByteStream& os) { + RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1); + os.Put(static_cast(0xFFu)); + os.Put(static_cast(0xFEu)); + } + + template + static void Put(OutputByteStream& os, CharType c) { + RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1); + os.Put(static_cast(static_cast(c) & 0xFFu)); + os.Put(static_cast((static_cast(c) >> 8) & 0xFFu)); + } +}; + +//! UTF-16 big endian encoding. +template +struct UTF16BE : UTF16 { + template + static CharType TakeBOM(InputByteStream& is) { + RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1); + CharType c = Take(is); + return static_cast(c) == 0xFEFFu ? Take(is) : c; + } + + template + static CharType Take(InputByteStream& is) { + RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1); + unsigned c = static_cast(static_cast(is.Take())) << 8; + c |= static_cast(static_cast(is.Take())); + return static_cast(c); + } + + template + static void PutBOM(OutputByteStream& os) { + RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1); + os.Put(static_cast(0xFEu)); + os.Put(static_cast(0xFFu)); + } + + template + static void Put(OutputByteStream& os, CharType c) { + RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1); + os.Put(static_cast((static_cast(c) >> 8) & 0xFFu)); + os.Put(static_cast(static_cast(c) & 0xFFu)); + } +}; + +/////////////////////////////////////////////////////////////////////////////// +// UTF32 + +//! UTF-32 encoding. +/*! http://en.wikipedia.org/wiki/UTF-32 + \tparam CharType Type for storing 32-bit UTF-32 data. Default is unsigned. C++11 may use char32_t instead. + \note implements Encoding concept + + \note For in-memory access, no need to concern endianness. The code units and code points are represented by CPU's endianness. + For streaming, use UTF32LE and UTF32BE, which handle endianness. +*/ +template +struct UTF32 { + typedef CharType Ch; + RAPIDJSON_STATIC_ASSERT(sizeof(Ch) >= 4); + + enum { supportUnicode = 1 }; + + template + static void Encode(OutputStream& os, unsigned codepoint) { + RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputStream::Ch) >= 4); + RAPIDJSON_ASSERT(codepoint <= 0x10FFFF); + os.Put(codepoint); + } + + template + static void EncodeUnsafe(OutputStream& os, unsigned codepoint) { + RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputStream::Ch) >= 4); + RAPIDJSON_ASSERT(codepoint <= 0x10FFFF); + PutUnsafe(os, codepoint); + } + + template + static bool Decode(InputStream& is, unsigned* codepoint) { + RAPIDJSON_STATIC_ASSERT(sizeof(typename InputStream::Ch) >= 4); + Ch c = is.Take(); + *codepoint = c; + return c <= 0x10FFFF; + } + + template + static bool Validate(InputStream& is, OutputStream& os) { + RAPIDJSON_STATIC_ASSERT(sizeof(typename InputStream::Ch) >= 4); + Ch c; + os.Put(c = is.Take()); + return c <= 0x10FFFF; + } +}; + +//! UTF-32 little endian enocoding. +template +struct UTF32LE : UTF32 { + template + static CharType TakeBOM(InputByteStream& is) { + RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1); + CharType c = Take(is); + return static_cast(c) == 0x0000FEFFu ? Take(is) : c; + } + + template + static CharType Take(InputByteStream& is) { + RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1); + unsigned c = static_cast(is.Take()); + c |= static_cast(static_cast(is.Take())) << 8; + c |= static_cast(static_cast(is.Take())) << 16; + c |= static_cast(static_cast(is.Take())) << 24; + return static_cast(c); + } + + template + static void PutBOM(OutputByteStream& os) { + RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1); + os.Put(static_cast(0xFFu)); + os.Put(static_cast(0xFEu)); + os.Put(static_cast(0x00u)); + os.Put(static_cast(0x00u)); + } + + template + static void Put(OutputByteStream& os, CharType c) { + RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1); + os.Put(static_cast(c & 0xFFu)); + os.Put(static_cast((c >> 8) & 0xFFu)); + os.Put(static_cast((c >> 16) & 0xFFu)); + os.Put(static_cast((c >> 24) & 0xFFu)); + } +}; + +//! UTF-32 big endian encoding. +template +struct UTF32BE : UTF32 { + template + static CharType TakeBOM(InputByteStream& is) { + RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1); + CharType c = Take(is); + return static_cast(c) == 0x0000FEFFu ? Take(is) : c; + } + + template + static CharType Take(InputByteStream& is) { + RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1); + unsigned c = static_cast(static_cast(is.Take())) << 24; + c |= static_cast(static_cast(is.Take())) << 16; + c |= static_cast(static_cast(is.Take())) << 8; + c |= static_cast(static_cast(is.Take())); + return static_cast(c); + } + + template + static void PutBOM(OutputByteStream& os) { + RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1); + os.Put(static_cast(0x00u)); + os.Put(static_cast(0x00u)); + os.Put(static_cast(0xFEu)); + os.Put(static_cast(0xFFu)); + } + + template + static void Put(OutputByteStream& os, CharType c) { + RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1); + os.Put(static_cast((c >> 24) & 0xFFu)); + os.Put(static_cast((c >> 16) & 0xFFu)); + os.Put(static_cast((c >> 8) & 0xFFu)); + os.Put(static_cast(c & 0xFFu)); + } +}; + +/////////////////////////////////////////////////////////////////////////////// +// ASCII + +//! ASCII encoding. +/*! http://en.wikipedia.org/wiki/ASCII + \tparam CharType Code unit for storing 7-bit ASCII data. Default is char. + \note implements Encoding concept +*/ +template +struct ASCII { + typedef CharType Ch; + + enum { supportUnicode = 0 }; + + template + static void Encode(OutputStream& os, unsigned codepoint) { + RAPIDJSON_ASSERT(codepoint <= 0x7F); + os.Put(static_cast(codepoint & 0xFF)); + } + + template + static void EncodeUnsafe(OutputStream& os, unsigned codepoint) { + RAPIDJSON_ASSERT(codepoint <= 0x7F); + PutUnsafe(os, static_cast(codepoint & 0xFF)); + } + + template + static bool Decode(InputStream& is, unsigned* codepoint) { + uint8_t c = static_cast(is.Take()); + *codepoint = c; + return c <= 0X7F; + } + + template + static bool Validate(InputStream& is, OutputStream& os) { + uint8_t c = static_cast(is.Take()); + os.Put(static_cast(c)); + return c <= 0x7F; + } + + template + static CharType TakeBOM(InputByteStream& is) { + RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1); + uint8_t c = static_cast(Take(is)); + return static_cast(c); + } + + template + static Ch Take(InputByteStream& is) { + RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1); + return static_cast(is.Take()); + } + + template + static void PutBOM(OutputByteStream& os) { + RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1); + (void)os; + } + + template + static void Put(OutputByteStream& os, Ch c) { + RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1); + os.Put(static_cast(c)); + } +}; + +/////////////////////////////////////////////////////////////////////////////// +// AutoUTF + +//! Runtime-specified UTF encoding type of a stream. +enum UTFType { + kUTF8 = 0, //!< UTF-8. + kUTF16LE = 1, //!< UTF-16 little endian. + kUTF16BE = 2, //!< UTF-16 big endian. + kUTF32LE = 3, //!< UTF-32 little endian. + kUTF32BE = 4 //!< UTF-32 big endian. +}; + +//! Dynamically select encoding according to stream's runtime-specified UTF encoding type. +/*! \note This class can be used with AutoUTFInputtStream and AutoUTFOutputStream, which provides GetType(). +*/ +template +struct AutoUTF { + typedef CharType Ch; + + enum { supportUnicode = 1 }; + +#define RAPIDJSON_ENCODINGS_FUNC(x) UTF8::x, UTF16LE::x, UTF16BE::x, UTF32LE::x, UTF32BE::x + + template + static RAPIDJSON_FORCEINLINE void Encode(OutputStream& os, unsigned codepoint) { + typedef void (*EncodeFunc)(OutputStream&, unsigned); + static const EncodeFunc f[] = { RAPIDJSON_ENCODINGS_FUNC(Encode) }; + (*f[os.GetType()])(os, codepoint); + } + + template + static RAPIDJSON_FORCEINLINE void EncodeUnsafe(OutputStream& os, unsigned codepoint) { + typedef void (*EncodeFunc)(OutputStream&, unsigned); + static const EncodeFunc f[] = { RAPIDJSON_ENCODINGS_FUNC(EncodeUnsafe) }; + (*f[os.GetType()])(os, codepoint); + } + + template + static RAPIDJSON_FORCEINLINE bool Decode(InputStream& is, unsigned* codepoint) { + typedef bool (*DecodeFunc)(InputStream&, unsigned*); + static const DecodeFunc f[] = { RAPIDJSON_ENCODINGS_FUNC(Decode) }; + return (*f[is.GetType()])(is, codepoint); + } + + template + static RAPIDJSON_FORCEINLINE bool Validate(InputStream& is, OutputStream& os) { + typedef bool (*ValidateFunc)(InputStream&, OutputStream&); + static const ValidateFunc f[] = { RAPIDJSON_ENCODINGS_FUNC(Validate) }; + return (*f[is.GetType()])(is, os); + } + +#undef RAPIDJSON_ENCODINGS_FUNC +}; + +/////////////////////////////////////////////////////////////////////////////// +// Transcoder + +//! Encoding conversion. +template +struct Transcoder { + //! Take one Unicode codepoint from source encoding, convert it to target encoding and put it to the output stream. + template + static RAPIDJSON_FORCEINLINE bool Transcode(InputStream& is, OutputStream& os) { + unsigned codepoint; + if (!SourceEncoding::Decode(is, &codepoint)) + return false; + TargetEncoding::Encode(os, codepoint); + return true; + } + + template + static RAPIDJSON_FORCEINLINE bool TranscodeUnsafe(InputStream& is, OutputStream& os) { + unsigned codepoint; + if (!SourceEncoding::Decode(is, &codepoint)) + return false; + TargetEncoding::EncodeUnsafe(os, codepoint); + return true; + } + + //! Validate one Unicode codepoint from an encoded stream. + template + static RAPIDJSON_FORCEINLINE bool Validate(InputStream& is, OutputStream& os) { + return Transcode(is, os); // Since source/target encoding is different, must transcode. + } +}; + +// Forward declaration. +template +inline void PutUnsafe(Stream& stream, typename Stream::Ch c); + +//! Specialization of Transcoder with same source and target encoding. +template +struct Transcoder { + template + static RAPIDJSON_FORCEINLINE bool Transcode(InputStream& is, OutputStream& os) { + os.Put(is.Take()); // Just copy one code unit. This semantic is different from primary template class. + return true; + } + + template + static RAPIDJSON_FORCEINLINE bool TranscodeUnsafe(InputStream& is, OutputStream& os) { + PutUnsafe(os, is.Take()); // Just copy one code unit. This semantic is different from primary template class. + return true; + } + + template + static RAPIDJSON_FORCEINLINE bool Validate(InputStream& is, OutputStream& os) { + return Encoding::Validate(is, os); // source/target encoding are the same + } +}; + +RAPIDJSON_NAMESPACE_END + +#if defined(__GNUC__) || (defined(_MSC_VER) && !defined(__clang__)) +RAPIDJSON_DIAG_POP +#endif + +#endif // RAPIDJSON_ENCODINGS_H_ diff --git a/DFL_BOM_WL_TOERP/rapidjson/error/en.h b/DFL_BOM_WL_TOERP/rapidjson/error/en.h new file mode 100644 index 0000000..5d2e57b --- /dev/null +++ b/DFL_BOM_WL_TOERP/rapidjson/error/en.h @@ -0,0 +1,122 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +#ifndef RAPIDJSON_ERROR_EN_H_ +#define RAPIDJSON_ERROR_EN_H_ + +#include "error.h" + +#ifdef __clang__ +RAPIDJSON_DIAG_PUSH +RAPIDJSON_DIAG_OFF(switch-enum) +RAPIDJSON_DIAG_OFF(covered-switch-default) +#endif + +RAPIDJSON_NAMESPACE_BEGIN + +//! Maps error code of parsing into error message. +/*! + \ingroup RAPIDJSON_ERRORS + \param parseErrorCode Error code obtained in parsing. + \return the error message. + \note User can make a copy of this function for localization. + Using switch-case is safer for future modification of error codes. +*/ +inline const RAPIDJSON_ERROR_CHARTYPE* GetParseError_En(ParseErrorCode parseErrorCode) { + switch (parseErrorCode) { + case kParseErrorNone: return RAPIDJSON_ERROR_STRING("No error."); + + case kParseErrorDocumentEmpty: return RAPIDJSON_ERROR_STRING("The document is empty."); + case kParseErrorDocumentRootNotSingular: return RAPIDJSON_ERROR_STRING("The document root must not be followed by other values."); + + case kParseErrorValueInvalid: return RAPIDJSON_ERROR_STRING("Invalid value."); + + case kParseErrorObjectMissName: return RAPIDJSON_ERROR_STRING("Missing a name for object member."); + case kParseErrorObjectMissColon: return RAPIDJSON_ERROR_STRING("Missing a colon after a name of object member."); + case kParseErrorObjectMissCommaOrCurlyBracket: return RAPIDJSON_ERROR_STRING("Missing a comma or '}' after an object member."); + + case kParseErrorArrayMissCommaOrSquareBracket: return RAPIDJSON_ERROR_STRING("Missing a comma or ']' after an array element."); + + case kParseErrorStringUnicodeEscapeInvalidHex: return RAPIDJSON_ERROR_STRING("Incorrect hex digit after \\u escape in string."); + case kParseErrorStringUnicodeSurrogateInvalid: return RAPIDJSON_ERROR_STRING("The surrogate pair in string is invalid."); + case kParseErrorStringEscapeInvalid: return RAPIDJSON_ERROR_STRING("Invalid escape character in string."); + case kParseErrorStringMissQuotationMark: return RAPIDJSON_ERROR_STRING("Missing a closing quotation mark in string."); + case kParseErrorStringInvalidEncoding: return RAPIDJSON_ERROR_STRING("Invalid encoding in string."); + + case kParseErrorNumberTooBig: return RAPIDJSON_ERROR_STRING("Number too big to be stored in double."); + case kParseErrorNumberMissFraction: return RAPIDJSON_ERROR_STRING("Miss fraction part in number."); + case kParseErrorNumberMissExponent: return RAPIDJSON_ERROR_STRING("Miss exponent in number."); + + case kParseErrorTermination: return RAPIDJSON_ERROR_STRING("Terminate parsing due to Handler error."); + case kParseErrorUnspecificSyntaxError: return RAPIDJSON_ERROR_STRING("Unspecific syntax error."); + + default: return RAPIDJSON_ERROR_STRING("Unknown error."); + } +} + +//! Maps error code of validation into error message. +/*! + \ingroup RAPIDJSON_ERRORS + \param validateErrorCode Error code obtained from validator. + \return the error message. + \note User can make a copy of this function for localization. + Using switch-case is safer for future modification of error codes. +*/ +inline const RAPIDJSON_ERROR_CHARTYPE* GetValidateError_En(ValidateErrorCode validateErrorCode) { + switch (validateErrorCode) { + case kValidateErrors: return RAPIDJSON_ERROR_STRING("One or more validation errors have occurred"); + case kValidateErrorNone: return RAPIDJSON_ERROR_STRING("No error."); + + case kValidateErrorMultipleOf: return RAPIDJSON_ERROR_STRING("Number '%actual' is not a multiple of the 'multipleOf' value '%expected'."); + case kValidateErrorMaximum: return RAPIDJSON_ERROR_STRING("Number '%actual' is greater than the 'maximum' value '%expected'."); + case kValidateErrorExclusiveMaximum: return RAPIDJSON_ERROR_STRING("Number '%actual' is greater than or equal to the 'exclusiveMaximum' value '%expected'."); + case kValidateErrorMinimum: return RAPIDJSON_ERROR_STRING("Number '%actual' is less than the 'minimum' value '%expected'."); + case kValidateErrorExclusiveMinimum: return RAPIDJSON_ERROR_STRING("Number '%actual' is less than or equal to the 'exclusiveMinimum' value '%expected'."); + + case kValidateErrorMaxLength: return RAPIDJSON_ERROR_STRING("String '%actual' is longer than the 'maxLength' value '%expected'."); + case kValidateErrorMinLength: return RAPIDJSON_ERROR_STRING("String '%actual' is shorter than the 'minLength' value '%expected'."); + case kValidateErrorPattern: return RAPIDJSON_ERROR_STRING("String '%actual' does not match the 'pattern' regular expression."); + + case kValidateErrorMaxItems: return RAPIDJSON_ERROR_STRING("Array of length '%actual' is longer than the 'maxItems' value '%expected'."); + case kValidateErrorMinItems: return RAPIDJSON_ERROR_STRING("Array of length '%actual' is shorter than the 'minItems' value '%expected'."); + case kValidateErrorUniqueItems: return RAPIDJSON_ERROR_STRING("Array has duplicate items at indices '%duplicates' but 'uniqueItems' is true."); + case kValidateErrorAdditionalItems: return RAPIDJSON_ERROR_STRING("Array has an additional item at index '%disallowed' that is not allowed by the schema."); + + case kValidateErrorMaxProperties: return RAPIDJSON_ERROR_STRING("Object has '%actual' members which is more than 'maxProperties' value '%expected'."); + case kValidateErrorMinProperties: return RAPIDJSON_ERROR_STRING("Object has '%actual' members which is less than 'minProperties' value '%expected'."); + case kValidateErrorRequired: return RAPIDJSON_ERROR_STRING("Object is missing the following members required by the schema: '%missing'."); + case kValidateErrorAdditionalProperties: return RAPIDJSON_ERROR_STRING("Object has an additional member '%disallowed' that is not allowed by the schema."); + case kValidateErrorPatternProperties: return RAPIDJSON_ERROR_STRING("Object has 'patternProperties' that are not allowed by the schema."); + case kValidateErrorDependencies: return RAPIDJSON_ERROR_STRING("Object has missing property or schema dependencies, refer to following errors."); + + case kValidateErrorEnum: return RAPIDJSON_ERROR_STRING("Property has a value that is not one of its allowed enumerated values."); + case kValidateErrorType: return RAPIDJSON_ERROR_STRING("Property has a type '%actual' that is not in the following list: '%expected'."); + + case kValidateErrorOneOf: return RAPIDJSON_ERROR_STRING("Property did not match any of the sub-schemas specified by 'oneOf', refer to following errors."); + case kValidateErrorOneOfMatch: return RAPIDJSON_ERROR_STRING("Property matched more than one of the sub-schemas specified by 'oneOf'."); + case kValidateErrorAllOf: return RAPIDJSON_ERROR_STRING("Property did not match all of the sub-schemas specified by 'allOf', refer to following errors."); + case kValidateErrorAnyOf: return RAPIDJSON_ERROR_STRING("Property did not match any of the sub-schemas specified by 'anyOf', refer to following errors."); + case kValidateErrorNot: return RAPIDJSON_ERROR_STRING("Property matched the sub-schema specified by 'not'."); + + default: return RAPIDJSON_ERROR_STRING("Unknown error."); + } +} + +RAPIDJSON_NAMESPACE_END + +#ifdef __clang__ +RAPIDJSON_DIAG_POP +#endif + +#endif // RAPIDJSON_ERROR_EN_H_ diff --git a/DFL_BOM_WL_TOERP/rapidjson/error/error.h b/DFL_BOM_WL_TOERP/rapidjson/error/error.h new file mode 100644 index 0000000..6270da1 --- /dev/null +++ b/DFL_BOM_WL_TOERP/rapidjson/error/error.h @@ -0,0 +1,216 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +#ifndef RAPIDJSON_ERROR_ERROR_H_ +#define RAPIDJSON_ERROR_ERROR_H_ + +#include "../rapidjson.h" + +#ifdef __clang__ +RAPIDJSON_DIAG_PUSH +RAPIDJSON_DIAG_OFF(padded) +#endif + +/*! \file error.h */ + +/*! \defgroup RAPIDJSON_ERRORS RapidJSON error handling */ + +/////////////////////////////////////////////////////////////////////////////// +// RAPIDJSON_ERROR_CHARTYPE + +//! Character type of error messages. +/*! \ingroup RAPIDJSON_ERRORS + The default character type is \c char. + On Windows, user can define this macro as \c TCHAR for supporting both + unicode/non-unicode settings. +*/ +#ifndef RAPIDJSON_ERROR_CHARTYPE +#define RAPIDJSON_ERROR_CHARTYPE char +#endif + +/////////////////////////////////////////////////////////////////////////////// +// RAPIDJSON_ERROR_STRING + +//! Macro for converting string literial to \ref RAPIDJSON_ERROR_CHARTYPE[]. +/*! \ingroup RAPIDJSON_ERRORS + By default this conversion macro does nothing. + On Windows, user can define this macro as \c _T(x) for supporting both + unicode/non-unicode settings. +*/ +#ifndef RAPIDJSON_ERROR_STRING +#define RAPIDJSON_ERROR_STRING(x) x +#endif + +RAPIDJSON_NAMESPACE_BEGIN + +/////////////////////////////////////////////////////////////////////////////// +// ParseErrorCode + +//! Error code of parsing. +/*! \ingroup RAPIDJSON_ERRORS + \see GenericReader::Parse, GenericReader::GetParseErrorCode +*/ +enum ParseErrorCode { + kParseErrorNone = 0, //!< No error. + + kParseErrorDocumentEmpty, //!< The document is empty. + kParseErrorDocumentRootNotSingular, //!< The document root must not follow by other values. + + kParseErrorValueInvalid, //!< Invalid value. + + kParseErrorObjectMissName, //!< Missing a name for object member. + kParseErrorObjectMissColon, //!< Missing a colon after a name of object member. + kParseErrorObjectMissCommaOrCurlyBracket, //!< Missing a comma or '}' after an object member. + + kParseErrorArrayMissCommaOrSquareBracket, //!< Missing a comma or ']' after an array element. + + kParseErrorStringUnicodeEscapeInvalidHex, //!< Incorrect hex digit after \\u escape in string. + kParseErrorStringUnicodeSurrogateInvalid, //!< The surrogate pair in string is invalid. + kParseErrorStringEscapeInvalid, //!< Invalid escape character in string. + kParseErrorStringMissQuotationMark, //!< Missing a closing quotation mark in string. + kParseErrorStringInvalidEncoding, //!< Invalid encoding in string. + + kParseErrorNumberTooBig, //!< Number too big to be stored in double. + kParseErrorNumberMissFraction, //!< Miss fraction part in number. + kParseErrorNumberMissExponent, //!< Miss exponent in number. + + kParseErrorTermination, //!< Parsing was terminated. + kParseErrorUnspecificSyntaxError //!< Unspecific syntax error. +}; + +//! Result of parsing (wraps ParseErrorCode) +/*! + \ingroup RAPIDJSON_ERRORS + \code + Document doc; + ParseResult ok = doc.Parse("[42]"); + if (!ok) { + fprintf(stderr, "JSON parse error: %s (%u)", + GetParseError_En(ok.Code()), ok.Offset()); + exit(EXIT_FAILURE); + } + \endcode + \see GenericReader::Parse, GenericDocument::Parse +*/ +struct ParseResult { + //!! Unspecified boolean type + typedef bool (ParseResult::*BooleanType)() const; +public: + //! Default constructor, no error. + ParseResult() : code_(kParseErrorNone), offset_(0) {} + //! Constructor to set an error. + ParseResult(ParseErrorCode code, size_t offset) : code_(code), offset_(offset) {} + + //! Get the error code. + ParseErrorCode Code() const { return code_; } + //! Get the error offset, if \ref IsError(), 0 otherwise. + size_t Offset() const { return offset_; } + + //! Explicit conversion to \c bool, returns \c true, iff !\ref IsError(). + operator BooleanType() const { return !IsError() ? &ParseResult::IsError : NULL; } + //! Whether the result is an error. + bool IsError() const { return code_ != kParseErrorNone; } + + bool operator==(const ParseResult& that) const { return code_ == that.code_; } + bool operator==(ParseErrorCode code) const { return code_ == code; } + friend bool operator==(ParseErrorCode code, const ParseResult & err) { return code == err.code_; } + + bool operator!=(const ParseResult& that) const { return !(*this == that); } + bool operator!=(ParseErrorCode code) const { return !(*this == code); } + friend bool operator!=(ParseErrorCode code, const ParseResult & err) { return err != code; } + + //! Reset error code. + void Clear() { Set(kParseErrorNone); } + //! Update error code and offset. + void Set(ParseErrorCode code, size_t offset = 0) { code_ = code; offset_ = offset; } + +private: + ParseErrorCode code_; + size_t offset_; +}; + +//! Function pointer type of GetParseError(). +/*! \ingroup RAPIDJSON_ERRORS + + This is the prototype for \c GetParseError_X(), where \c X is a locale. + User can dynamically change locale in runtime, e.g.: +\code + GetParseErrorFunc GetParseError = GetParseError_En; // or whatever + const RAPIDJSON_ERROR_CHARTYPE* s = GetParseError(document.GetParseErrorCode()); +\endcode +*/ +typedef const RAPIDJSON_ERROR_CHARTYPE* (*GetParseErrorFunc)(ParseErrorCode); + +/////////////////////////////////////////////////////////////////////////////// +// ValidateErrorCode + +//! Error codes when validating. +/*! \ingroup RAPIDJSON_ERRORS + \see GenericSchemaValidator +*/ +enum ValidateErrorCode { + kValidateErrors = -1, //!< Top level error code when kValidateContinueOnErrorsFlag set. + kValidateErrorNone = 0, //!< No error. + + kValidateErrorMultipleOf, //!< Number is not a multiple of the 'multipleOf' value. + kValidateErrorMaximum, //!< Number is greater than the 'maximum' value. + kValidateErrorExclusiveMaximum, //!< Number is greater than or equal to the 'maximum' value. + kValidateErrorMinimum, //!< Number is less than the 'minimum' value. + kValidateErrorExclusiveMinimum, //!< Number is less than or equal to the 'minimum' value. + + kValidateErrorMaxLength, //!< String is longer than the 'maxLength' value. + kValidateErrorMinLength, //!< String is longer than the 'maxLength' value. + kValidateErrorPattern, //!< String does not match the 'pattern' regular expression. + + kValidateErrorMaxItems, //!< Array is longer than the 'maxItems' value. + kValidateErrorMinItems, //!< Array is shorter than the 'minItems' value. + kValidateErrorUniqueItems, //!< Array has duplicate items but 'uniqueItems' is true. + kValidateErrorAdditionalItems, //!< Array has additional items that are not allowed by the schema. + + kValidateErrorMaxProperties, //!< Object has more members than 'maxProperties' value. + kValidateErrorMinProperties, //!< Object has less members than 'minProperties' value. + kValidateErrorRequired, //!< Object is missing one or more members required by the schema. + kValidateErrorAdditionalProperties, //!< Object has additional members that are not allowed by the schema. + kValidateErrorPatternProperties, //!< See other errors. + kValidateErrorDependencies, //!< Object has missing property or schema dependencies. + + kValidateErrorEnum, //!< Property has a value that is not one of its allowed enumerated values + kValidateErrorType, //!< Property has a type that is not allowed by the schema.. + + kValidateErrorOneOf, //!< Property did not match any of the sub-schemas specified by 'oneOf'. + kValidateErrorOneOfMatch, //!< Property matched more than one of the sub-schemas specified by 'oneOf'. + kValidateErrorAllOf, //!< Property did not match all of the sub-schemas specified by 'allOf'. + kValidateErrorAnyOf, //!< Property did not match any of the sub-schemas specified by 'anyOf'. + kValidateErrorNot //!< Property matched the sub-schema specified by 'not'. +}; + +//! Function pointer type of GetValidateError(). +/*! \ingroup RAPIDJSON_ERRORS + + This is the prototype for \c GetValidateError_X(), where \c X is a locale. + User can dynamically change locale in runtime, e.g.: +\code + GetValidateErrorFunc GetValidateError = GetValidateError_En; // or whatever + const RAPIDJSON_ERROR_CHARTYPE* s = GetValidateError(validator.GetInvalidSchemaCode()); +\endcode +*/ +typedef const RAPIDJSON_ERROR_CHARTYPE* (*GetValidateErrorFunc)(ValidateErrorCode); + +RAPIDJSON_NAMESPACE_END + +#ifdef __clang__ +RAPIDJSON_DIAG_POP +#endif + +#endif // RAPIDJSON_ERROR_ERROR_H_ diff --git a/DFL_BOM_WL_TOERP/rapidjson/filereadstream.h b/DFL_BOM_WL_TOERP/rapidjson/filereadstream.h new file mode 100644 index 0000000..f8bb43c --- /dev/null +++ b/DFL_BOM_WL_TOERP/rapidjson/filereadstream.h @@ -0,0 +1,99 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +#ifndef RAPIDJSON_FILEREADSTREAM_H_ +#define RAPIDJSON_FILEREADSTREAM_H_ + +#include "stream.h" +#include + +#ifdef __clang__ +RAPIDJSON_DIAG_PUSH +RAPIDJSON_DIAG_OFF(padded) +RAPIDJSON_DIAG_OFF(unreachable-code) +RAPIDJSON_DIAG_OFF(missing-noreturn) +#endif + +RAPIDJSON_NAMESPACE_BEGIN + +//! File byte stream for input using fread(). +/*! + \note implements Stream concept +*/ +class FileReadStream { +public: + typedef char Ch; //!< Character type (byte). + + //! Constructor. + /*! + \param fp File pointer opened for read. + \param buffer user-supplied buffer. + \param bufferSize size of buffer in bytes. Must >=4 bytes. + */ + FileReadStream(std::FILE* fp, char* buffer, size_t bufferSize) : fp_(fp), buffer_(buffer), bufferSize_(bufferSize), bufferLast_(0), current_(buffer_), readCount_(0), count_(0), eof_(false) { + RAPIDJSON_ASSERT(fp_ != 0); + RAPIDJSON_ASSERT(bufferSize >= 4); + Read(); + } + + Ch Peek() const { return *current_; } + Ch Take() { Ch c = *current_; Read(); return c; } + size_t Tell() const { return count_ + static_cast(current_ - buffer_); } + + // Not implemented + void Put(Ch) { RAPIDJSON_ASSERT(false); } + void Flush() { RAPIDJSON_ASSERT(false); } + Ch* PutBegin() { RAPIDJSON_ASSERT(false); return 0; } + size_t PutEnd(Ch*) { RAPIDJSON_ASSERT(false); return 0; } + + // For encoding detection only. + const Ch* Peek4() const { + return (current_ + 4 - !eof_ <= bufferLast_) ? current_ : 0; + } + +private: + void Read() { + if (current_ < bufferLast_) + ++current_; + else if (!eof_) { + count_ += readCount_; + readCount_ = std::fread(buffer_, 1, bufferSize_, fp_); + bufferLast_ = buffer_ + readCount_ - 1; + current_ = buffer_; + + if (readCount_ < bufferSize_) { + buffer_[readCount_] = '\0'; + ++bufferLast_; + eof_ = true; + } + } + } + + std::FILE* fp_; + Ch *buffer_; + size_t bufferSize_; + Ch *bufferLast_; + Ch *current_; + size_t readCount_; + size_t count_; //!< Number of characters read + bool eof_; +}; + +RAPIDJSON_NAMESPACE_END + +#ifdef __clang__ +RAPIDJSON_DIAG_POP +#endif + +#endif // RAPIDJSON_FILESTREAM_H_ diff --git a/DFL_BOM_WL_TOERP/rapidjson/filewritestream.h b/DFL_BOM_WL_TOERP/rapidjson/filewritestream.h new file mode 100644 index 0000000..5d89588 --- /dev/null +++ b/DFL_BOM_WL_TOERP/rapidjson/filewritestream.h @@ -0,0 +1,104 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +#ifndef RAPIDJSON_FILEWRITESTREAM_H_ +#define RAPIDJSON_FILEWRITESTREAM_H_ + +#include "stream.h" +#include + +#ifdef __clang__ +RAPIDJSON_DIAG_PUSH +RAPIDJSON_DIAG_OFF(unreachable-code) +#endif + +RAPIDJSON_NAMESPACE_BEGIN + +//! Wrapper of C file stream for output using fwrite(). +/*! + \note implements Stream concept +*/ +class FileWriteStream { +public: + typedef char Ch; //!< Character type. Only support char. + + FileWriteStream(std::FILE* fp, char* buffer, size_t bufferSize) : fp_(fp), buffer_(buffer), bufferEnd_(buffer + bufferSize), current_(buffer_) { + RAPIDJSON_ASSERT(fp_ != 0); + } + + void Put(char c) { + if (current_ >= bufferEnd_) + Flush(); + + *current_++ = c; + } + + void PutN(char c, size_t n) { + size_t avail = static_cast(bufferEnd_ - current_); + while (n > avail) { + std::memset(current_, c, avail); + current_ += avail; + Flush(); + n -= avail; + avail = static_cast(bufferEnd_ - current_); + } + + if (n > 0) { + std::memset(current_, c, n); + current_ += n; + } + } + + void Flush() { + if (current_ != buffer_) { + size_t result = std::fwrite(buffer_, 1, static_cast(current_ - buffer_), fp_); + if (result < static_cast(current_ - buffer_)) { + // failure deliberately ignored at this time + // added to avoid warn_unused_result build errors + } + current_ = buffer_; + } + } + + // Not implemented + char Peek() const { RAPIDJSON_ASSERT(false); return 0; } + char Take() { RAPIDJSON_ASSERT(false); return 0; } + size_t Tell() const { RAPIDJSON_ASSERT(false); return 0; } + char* PutBegin() { RAPIDJSON_ASSERT(false); return 0; } + size_t PutEnd(char*) { RAPIDJSON_ASSERT(false); return 0; } + +private: + // Prohibit copy constructor & assignment operator. + FileWriteStream(const FileWriteStream&); + FileWriteStream& operator=(const FileWriteStream&); + + std::FILE* fp_; + char *buffer_; + char *bufferEnd_; + char *current_; +}; + +//! Implement specialized version of PutN() with memset() for better performance. +template<> +inline void PutN(FileWriteStream& stream, char c, size_t n) { + stream.PutN(c, n); +} + +RAPIDJSON_NAMESPACE_END + +#ifdef __clang__ +RAPIDJSON_DIAG_POP +#endif + +#endif // RAPIDJSON_FILESTREAM_H_ diff --git a/DFL_BOM_WL_TOERP/rapidjson/fwd.h b/DFL_BOM_WL_TOERP/rapidjson/fwd.h new file mode 100644 index 0000000..d62f77f --- /dev/null +++ b/DFL_BOM_WL_TOERP/rapidjson/fwd.h @@ -0,0 +1,151 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +#ifndef RAPIDJSON_FWD_H_ +#define RAPIDJSON_FWD_H_ + +#include "rapidjson.h" + +RAPIDJSON_NAMESPACE_BEGIN + +// encodings.h + +template struct UTF8; +template struct UTF16; +template struct UTF16BE; +template struct UTF16LE; +template struct UTF32; +template struct UTF32BE; +template struct UTF32LE; +template struct ASCII; +template struct AutoUTF; + +template +struct Transcoder; + +// allocators.h + +class CrtAllocator; + +template +class MemoryPoolAllocator; + +// stream.h + +template +struct GenericStringStream; + +typedef GenericStringStream > StringStream; + +template +struct GenericInsituStringStream; + +typedef GenericInsituStringStream > InsituStringStream; + +// stringbuffer.h + +template +class GenericStringBuffer; + +typedef GenericStringBuffer, CrtAllocator> StringBuffer; + +// filereadstream.h + +class FileReadStream; + +// filewritestream.h + +class FileWriteStream; + +// memorybuffer.h + +template +struct GenericMemoryBuffer; + +typedef GenericMemoryBuffer MemoryBuffer; + +// memorystream.h + +struct MemoryStream; + +// reader.h + +template +struct BaseReaderHandler; + +template +class GenericReader; + +typedef GenericReader, UTF8, CrtAllocator> Reader; + +// writer.h + +template +class Writer; + +// prettywriter.h + +template +class PrettyWriter; + +// document.h + +template +class GenericMember; + +template +class GenericMemberIterator; + +template +struct GenericStringRef; + +template +class GenericValue; + +typedef GenericValue, MemoryPoolAllocator > Value; + +template +class GenericDocument; + +typedef GenericDocument, MemoryPoolAllocator, CrtAllocator> Document; + +// pointer.h + +template +class GenericPointer; + +typedef GenericPointer Pointer; + +// schema.h + +template +class IGenericRemoteSchemaDocumentProvider; + +template +class GenericSchemaDocument; + +typedef GenericSchemaDocument SchemaDocument; +typedef IGenericRemoteSchemaDocumentProvider IRemoteSchemaDocumentProvider; + +template < + typename SchemaDocumentType, + typename OutputHandler, + typename StateAllocator> +class GenericSchemaValidator; + +typedef GenericSchemaValidator, void>, CrtAllocator> SchemaValidator; + +RAPIDJSON_NAMESPACE_END + +#endif // RAPIDJSON_RAPIDJSONFWD_H_ diff --git a/DFL_BOM_WL_TOERP/rapidjson/internal/biginteger.h b/DFL_BOM_WL_TOERP/rapidjson/internal/biginteger.h new file mode 100644 index 0000000..af48738 --- /dev/null +++ b/DFL_BOM_WL_TOERP/rapidjson/internal/biginteger.h @@ -0,0 +1,297 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +#ifndef RAPIDJSON_BIGINTEGER_H_ +#define RAPIDJSON_BIGINTEGER_H_ + +#include "../rapidjson.h" + +#if defined(_MSC_VER) && !defined(__INTEL_COMPILER) && defined(_M_AMD64) +#include // for _umul128 +#if !defined(_ARM64EC_) +#pragma intrinsic(_umul128) +#else +#pragma comment(lib,"softintrin") +#endif +#endif + +RAPIDJSON_NAMESPACE_BEGIN +namespace internal { + +class BigInteger { +public: + typedef uint64_t Type; + + BigInteger(const BigInteger& rhs) : count_(rhs.count_) { + std::memcpy(digits_, rhs.digits_, count_ * sizeof(Type)); + } + + explicit BigInteger(uint64_t u) : count_(1) { + digits_[0] = u; + } + + template + BigInteger(const Ch* decimals, size_t length) : count_(1) { + RAPIDJSON_ASSERT(length > 0); + digits_[0] = 0; + size_t i = 0; + const size_t kMaxDigitPerIteration = 19; // 2^64 = 18446744073709551616 > 10^19 + while (length >= kMaxDigitPerIteration) { + AppendDecimal64(decimals + i, decimals + i + kMaxDigitPerIteration); + length -= kMaxDigitPerIteration; + i += kMaxDigitPerIteration; + } + + if (length > 0) + AppendDecimal64(decimals + i, decimals + i + length); + } + + BigInteger& operator=(const BigInteger &rhs) + { + if (this != &rhs) { + count_ = rhs.count_; + std::memcpy(digits_, rhs.digits_, count_ * sizeof(Type)); + } + return *this; + } + + BigInteger& operator=(uint64_t u) { + digits_[0] = u; + count_ = 1; + return *this; + } + + BigInteger& operator+=(uint64_t u) { + Type backup = digits_[0]; + digits_[0] += u; + for (size_t i = 0; i < count_ - 1; i++) { + if (digits_[i] >= backup) + return *this; // no carry + backup = digits_[i + 1]; + digits_[i + 1] += 1; + } + + // Last carry + if (digits_[count_ - 1] < backup) + PushBack(1); + + return *this; + } + + BigInteger& operator*=(uint64_t u) { + if (u == 0) return *this = 0; + if (u == 1) return *this; + if (*this == 1) return *this = u; + + uint64_t k = 0; + for (size_t i = 0; i < count_; i++) { + uint64_t hi; + digits_[i] = MulAdd64(digits_[i], u, k, &hi); + k = hi; + } + + if (k > 0) + PushBack(k); + + return *this; + } + + BigInteger& operator*=(uint32_t u) { + if (u == 0) return *this = 0; + if (u == 1) return *this; + if (*this == 1) return *this = u; + + uint64_t k = 0; + for (size_t i = 0; i < count_; i++) { + const uint64_t c = digits_[i] >> 32; + const uint64_t d = digits_[i] & 0xFFFFFFFF; + const uint64_t uc = u * c; + const uint64_t ud = u * d; + const uint64_t p0 = ud + k; + const uint64_t p1 = uc + (p0 >> 32); + digits_[i] = (p0 & 0xFFFFFFFF) | (p1 << 32); + k = p1 >> 32; + } + + if (k > 0) + PushBack(k); + + return *this; + } + + BigInteger& operator<<=(size_t shift) { + if (IsZero() || shift == 0) return *this; + + size_t offset = shift / kTypeBit; + size_t interShift = shift % kTypeBit; + RAPIDJSON_ASSERT(count_ + offset <= kCapacity); + + if (interShift == 0) { + std::memmove(digits_ + offset, digits_, count_ * sizeof(Type)); + count_ += offset; + } + else { + digits_[count_] = 0; + for (size_t i = count_; i > 0; i--) + digits_[i + offset] = (digits_[i] << interShift) | (digits_[i - 1] >> (kTypeBit - interShift)); + digits_[offset] = digits_[0] << interShift; + count_ += offset; + if (digits_[count_]) + count_++; + } + + std::memset(digits_, 0, offset * sizeof(Type)); + + return *this; + } + + bool operator==(const BigInteger& rhs) const { + return count_ == rhs.count_ && std::memcmp(digits_, rhs.digits_, count_ * sizeof(Type)) == 0; + } + + bool operator==(const Type rhs) const { + return count_ == 1 && digits_[0] == rhs; + } + + BigInteger& MultiplyPow5(unsigned exp) { + static const uint32_t kPow5[12] = { + 5, + 5 * 5, + 5 * 5 * 5, + 5 * 5 * 5 * 5, + 5 * 5 * 5 * 5 * 5, + 5 * 5 * 5 * 5 * 5 * 5, + 5 * 5 * 5 * 5 * 5 * 5 * 5, + 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5, + 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5, + 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5, + 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5, + 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 + }; + if (exp == 0) return *this; + for (; exp >= 27; exp -= 27) *this *= RAPIDJSON_UINT64_C2(0X6765C793, 0XFA10079D); // 5^27 + for (; exp >= 13; exp -= 13) *this *= static_cast(1220703125u); // 5^13 + if (exp > 0) *this *= kPow5[exp - 1]; + return *this; + } + + // Compute absolute difference of this and rhs. + // Assume this != rhs + bool Difference(const BigInteger& rhs, BigInteger* out) const { + int cmp = Compare(rhs); + RAPIDJSON_ASSERT(cmp != 0); + const BigInteger *a, *b; // Makes a > b + bool ret; + if (cmp < 0) { a = &rhs; b = this; ret = true; } + else { a = this; b = &rhs; ret = false; } + + Type borrow = 0; + for (size_t i = 0; i < a->count_; i++) { + Type d = a->digits_[i] - borrow; + if (i < b->count_) + d -= b->digits_[i]; + borrow = (d > a->digits_[i]) ? 1 : 0; + out->digits_[i] = d; + if (d != 0) + out->count_ = i + 1; + } + + return ret; + } + + int Compare(const BigInteger& rhs) const { + if (count_ != rhs.count_) + return count_ < rhs.count_ ? -1 : 1; + + for (size_t i = count_; i-- > 0;) + if (digits_[i] != rhs.digits_[i]) + return digits_[i] < rhs.digits_[i] ? -1 : 1; + + return 0; + } + + size_t GetCount() const { return count_; } + Type GetDigit(size_t index) const { RAPIDJSON_ASSERT(index < count_); return digits_[index]; } + bool IsZero() const { return count_ == 1 && digits_[0] == 0; } + +private: + template + void AppendDecimal64(const Ch* begin, const Ch* end) { + uint64_t u = ParseUint64(begin, end); + if (IsZero()) + *this = u; + else { + unsigned exp = static_cast(end - begin); + (MultiplyPow5(exp) <<= exp) += u; // *this = *this * 10^exp + u + } + } + + void PushBack(Type digit) { + RAPIDJSON_ASSERT(count_ < kCapacity); + digits_[count_++] = digit; + } + + template + static uint64_t ParseUint64(const Ch* begin, const Ch* end) { + uint64_t r = 0; + for (const Ch* p = begin; p != end; ++p) { + RAPIDJSON_ASSERT(*p >= Ch('0') && *p <= Ch('9')); + r = r * 10u + static_cast(*p - Ch('0')); + } + return r; + } + + // Assume a * b + k < 2^128 + static uint64_t MulAdd64(uint64_t a, uint64_t b, uint64_t k, uint64_t* outHigh) { +#if defined(_MSC_VER) && defined(_M_AMD64) + uint64_t low = _umul128(a, b, outHigh) + k; + if (low < k) + (*outHigh)++; + return low; +#elif (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) && defined(__x86_64__) + __extension__ typedef unsigned __int128 uint128; + uint128 p = static_cast(a) * static_cast(b); + p += k; + *outHigh = static_cast(p >> 64); + return static_cast(p); +#else + const uint64_t a0 = a & 0xFFFFFFFF, a1 = a >> 32, b0 = b & 0xFFFFFFFF, b1 = b >> 32; + uint64_t x0 = a0 * b0, x1 = a0 * b1, x2 = a1 * b0, x3 = a1 * b1; + x1 += (x0 >> 32); // can't give carry + x1 += x2; + if (x1 < x2) + x3 += (static_cast(1) << 32); + uint64_t lo = (x1 << 32) + (x0 & 0xFFFFFFFF); + uint64_t hi = x3 + (x1 >> 32); + + lo += k; + if (lo < k) + hi++; + *outHigh = hi; + return lo; +#endif + } + + static const size_t kBitCount = 3328; // 64bit * 54 > 10^1000 + static const size_t kCapacity = kBitCount / sizeof(Type); + static const size_t kTypeBit = sizeof(Type) * 8; + + Type digits_[kCapacity]; + size_t count_; +}; + +} // namespace internal +RAPIDJSON_NAMESPACE_END + +#endif // RAPIDJSON_BIGINTEGER_H_ diff --git a/DFL_BOM_WL_TOERP/rapidjson/internal/clzll.h b/DFL_BOM_WL_TOERP/rapidjson/internal/clzll.h new file mode 100644 index 0000000..8fc5118 --- /dev/null +++ b/DFL_BOM_WL_TOERP/rapidjson/internal/clzll.h @@ -0,0 +1,71 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +#ifndef RAPIDJSON_CLZLL_H_ +#define RAPIDJSON_CLZLL_H_ + +#include "../rapidjson.h" + +#if defined(_MSC_VER) && !defined(UNDER_CE) +#include +#if defined(_WIN64) +#pragma intrinsic(_BitScanReverse64) +#else +#pragma intrinsic(_BitScanReverse) +#endif +#endif + +RAPIDJSON_NAMESPACE_BEGIN +namespace internal { + +inline uint32_t clzll(uint64_t x) { + // Passing 0 to __builtin_clzll is UB in GCC and results in an + // infinite loop in the software implementation. + RAPIDJSON_ASSERT(x != 0); + +#if defined(_MSC_VER) && !defined(UNDER_CE) + unsigned long r = 0; +#if defined(_WIN64) + _BitScanReverse64(&r, x); +#else + // Scan the high 32 bits. + if (_BitScanReverse(&r, static_cast(x >> 32))) + return 63 - (r + 32); + + // Scan the low 32 bits. + _BitScanReverse(&r, static_cast(x & 0xFFFFFFFF)); +#endif // _WIN64 + + return 63 - r; +#elif (defined(__GNUC__) && __GNUC__ >= 4) || RAPIDJSON_HAS_BUILTIN(__builtin_clzll) + // __builtin_clzll wrapper + return static_cast(__builtin_clzll(x)); +#else + // naive version + uint32_t r = 0; + while (!(x & (static_cast(1) << 63))) { + x <<= 1; + ++r; + } + + return r; +#endif // _MSC_VER +} + +#define RAPIDJSON_CLZLL RAPIDJSON_NAMESPACE::internal::clzll + +} // namespace internal +RAPIDJSON_NAMESPACE_END + +#endif // RAPIDJSON_CLZLL_H_ diff --git a/DFL_BOM_WL_TOERP/rapidjson/internal/diyfp.h b/DFL_BOM_WL_TOERP/rapidjson/internal/diyfp.h new file mode 100644 index 0000000..f7d4653 --- /dev/null +++ b/DFL_BOM_WL_TOERP/rapidjson/internal/diyfp.h @@ -0,0 +1,261 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +// This is a C++ header-only implementation of Grisu2 algorithm from the publication: +// Loitsch, Florian. "Printing floating-point numbers quickly and accurately with +// integers." ACM Sigplan Notices 45.6 (2010): 233-243. + +#ifndef RAPIDJSON_DIYFP_H_ +#define RAPIDJSON_DIYFP_H_ + +#include "../rapidjson.h" +#include "clzll.h" +#include + +#if defined(_MSC_VER) && defined(_M_AMD64) && !defined(__INTEL_COMPILER) +#include +#if !defined(_ARM64EC_) +#pragma intrinsic(_umul128) +#else +#pragma comment(lib,"softintrin") +#endif +#endif + +RAPIDJSON_NAMESPACE_BEGIN +namespace internal { + +#ifdef __GNUC__ +RAPIDJSON_DIAG_PUSH +RAPIDJSON_DIAG_OFF(effc++) +#endif + +#ifdef __clang__ +RAPIDJSON_DIAG_PUSH +RAPIDJSON_DIAG_OFF(padded) +#endif + +struct DiyFp { + DiyFp() : f(), e() {} + + DiyFp(uint64_t fp, int exp) : f(fp), e(exp) {} + + explicit DiyFp(double d) { + union { + double d; + uint64_t u64; + } u = { d }; + + int biased_e = static_cast((u.u64 & kDpExponentMask) >> kDpSignificandSize); + uint64_t significand = (u.u64 & kDpSignificandMask); + if (biased_e != 0) { + f = significand + kDpHiddenBit; + e = biased_e - kDpExponentBias; + } + else { + f = significand; + e = kDpMinExponent + 1; + } + } + + DiyFp operator-(const DiyFp& rhs) const { + return DiyFp(f - rhs.f, e); + } + + DiyFp operator*(const DiyFp& rhs) const { +#if defined(_MSC_VER) && defined(_M_AMD64) + uint64_t h; + uint64_t l = _umul128(f, rhs.f, &h); + if (l & (uint64_t(1) << 63)) // rounding + h++; + return DiyFp(h, e + rhs.e + 64); +#elif (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) && defined(__x86_64__) + __extension__ typedef unsigned __int128 uint128; + uint128 p = static_cast(f) * static_cast(rhs.f); + uint64_t h = static_cast(p >> 64); + uint64_t l = static_cast(p); + if (l & (uint64_t(1) << 63)) // rounding + h++; + return DiyFp(h, e + rhs.e + 64); +#else + const uint64_t M32 = 0xFFFFFFFF; + const uint64_t a = f >> 32; + const uint64_t b = f & M32; + const uint64_t c = rhs.f >> 32; + const uint64_t d = rhs.f & M32; + const uint64_t ac = a * c; + const uint64_t bc = b * c; + const uint64_t ad = a * d; + const uint64_t bd = b * d; + uint64_t tmp = (bd >> 32) + (ad & M32) + (bc & M32); + tmp += 1U << 31; /// mult_round + return DiyFp(ac + (ad >> 32) + (bc >> 32) + (tmp >> 32), e + rhs.e + 64); +#endif + } + + DiyFp Normalize() const { + int s = static_cast(clzll(f)); + return DiyFp(f << s, e - s); + } + + DiyFp NormalizeBoundary() const { + DiyFp res = *this; + while (!(res.f & (kDpHiddenBit << 1))) { + res.f <<= 1; + res.e--; + } + res.f <<= (kDiySignificandSize - kDpSignificandSize - 2); + res.e = res.e - (kDiySignificandSize - kDpSignificandSize - 2); + return res; + } + + void NormalizedBoundaries(DiyFp* minus, DiyFp* plus) const { + DiyFp pl = DiyFp((f << 1) + 1, e - 1).NormalizeBoundary(); + DiyFp mi = (f == kDpHiddenBit) ? DiyFp((f << 2) - 1, e - 2) : DiyFp((f << 1) - 1, e - 1); + mi.f <<= mi.e - pl.e; + mi.e = pl.e; + *plus = pl; + *minus = mi; + } + + double ToDouble() const { + union { + double d; + uint64_t u64; + }u; + RAPIDJSON_ASSERT(f <= kDpHiddenBit + kDpSignificandMask); + if (e < kDpDenormalExponent) { + // Underflow. + return 0.0; + } + if (e >= kDpMaxExponent) { + // Overflow. + return std::numeric_limits::infinity(); + } + const uint64_t be = (e == kDpDenormalExponent && (f & kDpHiddenBit) == 0) ? 0 : + static_cast(e + kDpExponentBias); + u.u64 = (f & kDpSignificandMask) | (be << kDpSignificandSize); + return u.d; + } + + static const int kDiySignificandSize = 64; + static const int kDpSignificandSize = 52; + static const int kDpExponentBias = 0x3FF + kDpSignificandSize; + static const int kDpMaxExponent = 0x7FF - kDpExponentBias; + static const int kDpMinExponent = -kDpExponentBias; + static const int kDpDenormalExponent = -kDpExponentBias + 1; + static const uint64_t kDpExponentMask = RAPIDJSON_UINT64_C2(0x7FF00000, 0x00000000); + static const uint64_t kDpSignificandMask = RAPIDJSON_UINT64_C2(0x000FFFFF, 0xFFFFFFFF); + static const uint64_t kDpHiddenBit = RAPIDJSON_UINT64_C2(0x00100000, 0x00000000); + + uint64_t f; + int e; +}; + +inline DiyFp GetCachedPowerByIndex(size_t index) { + // 10^-348, 10^-340, ..., 10^340 + static const uint64_t kCachedPowers_F[] = { + RAPIDJSON_UINT64_C2(0xfa8fd5a0, 0x081c0288), RAPIDJSON_UINT64_C2(0xbaaee17f, 0xa23ebf76), + RAPIDJSON_UINT64_C2(0x8b16fb20, 0x3055ac76), RAPIDJSON_UINT64_C2(0xcf42894a, 0x5dce35ea), + RAPIDJSON_UINT64_C2(0x9a6bb0aa, 0x55653b2d), RAPIDJSON_UINT64_C2(0xe61acf03, 0x3d1a45df), + RAPIDJSON_UINT64_C2(0xab70fe17, 0xc79ac6ca), RAPIDJSON_UINT64_C2(0xff77b1fc, 0xbebcdc4f), + RAPIDJSON_UINT64_C2(0xbe5691ef, 0x416bd60c), RAPIDJSON_UINT64_C2(0x8dd01fad, 0x907ffc3c), + RAPIDJSON_UINT64_C2(0xd3515c28, 0x31559a83), RAPIDJSON_UINT64_C2(0x9d71ac8f, 0xada6c9b5), + RAPIDJSON_UINT64_C2(0xea9c2277, 0x23ee8bcb), RAPIDJSON_UINT64_C2(0xaecc4991, 0x4078536d), + RAPIDJSON_UINT64_C2(0x823c1279, 0x5db6ce57), RAPIDJSON_UINT64_C2(0xc2109436, 0x4dfb5637), + RAPIDJSON_UINT64_C2(0x9096ea6f, 0x3848984f), RAPIDJSON_UINT64_C2(0xd77485cb, 0x25823ac7), + RAPIDJSON_UINT64_C2(0xa086cfcd, 0x97bf97f4), RAPIDJSON_UINT64_C2(0xef340a98, 0x172aace5), + RAPIDJSON_UINT64_C2(0xb23867fb, 0x2a35b28e), RAPIDJSON_UINT64_C2(0x84c8d4df, 0xd2c63f3b), + RAPIDJSON_UINT64_C2(0xc5dd4427, 0x1ad3cdba), RAPIDJSON_UINT64_C2(0x936b9fce, 0xbb25c996), + RAPIDJSON_UINT64_C2(0xdbac6c24, 0x7d62a584), RAPIDJSON_UINT64_C2(0xa3ab6658, 0x0d5fdaf6), + RAPIDJSON_UINT64_C2(0xf3e2f893, 0xdec3f126), RAPIDJSON_UINT64_C2(0xb5b5ada8, 0xaaff80b8), + RAPIDJSON_UINT64_C2(0x87625f05, 0x6c7c4a8b), RAPIDJSON_UINT64_C2(0xc9bcff60, 0x34c13053), + RAPIDJSON_UINT64_C2(0x964e858c, 0x91ba2655), RAPIDJSON_UINT64_C2(0xdff97724, 0x70297ebd), + RAPIDJSON_UINT64_C2(0xa6dfbd9f, 0xb8e5b88f), RAPIDJSON_UINT64_C2(0xf8a95fcf, 0x88747d94), + RAPIDJSON_UINT64_C2(0xb9447093, 0x8fa89bcf), RAPIDJSON_UINT64_C2(0x8a08f0f8, 0xbf0f156b), + RAPIDJSON_UINT64_C2(0xcdb02555, 0x653131b6), RAPIDJSON_UINT64_C2(0x993fe2c6, 0xd07b7fac), + RAPIDJSON_UINT64_C2(0xe45c10c4, 0x2a2b3b06), RAPIDJSON_UINT64_C2(0xaa242499, 0x697392d3), + RAPIDJSON_UINT64_C2(0xfd87b5f2, 0x8300ca0e), RAPIDJSON_UINT64_C2(0xbce50864, 0x92111aeb), + RAPIDJSON_UINT64_C2(0x8cbccc09, 0x6f5088cc), RAPIDJSON_UINT64_C2(0xd1b71758, 0xe219652c), + RAPIDJSON_UINT64_C2(0x9c400000, 0x00000000), RAPIDJSON_UINT64_C2(0xe8d4a510, 0x00000000), + RAPIDJSON_UINT64_C2(0xad78ebc5, 0xac620000), RAPIDJSON_UINT64_C2(0x813f3978, 0xf8940984), + RAPIDJSON_UINT64_C2(0xc097ce7b, 0xc90715b3), RAPIDJSON_UINT64_C2(0x8f7e32ce, 0x7bea5c70), + RAPIDJSON_UINT64_C2(0xd5d238a4, 0xabe98068), RAPIDJSON_UINT64_C2(0x9f4f2726, 0x179a2245), + RAPIDJSON_UINT64_C2(0xed63a231, 0xd4c4fb27), RAPIDJSON_UINT64_C2(0xb0de6538, 0x8cc8ada8), + RAPIDJSON_UINT64_C2(0x83c7088e, 0x1aab65db), RAPIDJSON_UINT64_C2(0xc45d1df9, 0x42711d9a), + RAPIDJSON_UINT64_C2(0x924d692c, 0xa61be758), RAPIDJSON_UINT64_C2(0xda01ee64, 0x1a708dea), + RAPIDJSON_UINT64_C2(0xa26da399, 0x9aef774a), RAPIDJSON_UINT64_C2(0xf209787b, 0xb47d6b85), + RAPIDJSON_UINT64_C2(0xb454e4a1, 0x79dd1877), RAPIDJSON_UINT64_C2(0x865b8692, 0x5b9bc5c2), + RAPIDJSON_UINT64_C2(0xc83553c5, 0xc8965d3d), RAPIDJSON_UINT64_C2(0x952ab45c, 0xfa97a0b3), + RAPIDJSON_UINT64_C2(0xde469fbd, 0x99a05fe3), RAPIDJSON_UINT64_C2(0xa59bc234, 0xdb398c25), + RAPIDJSON_UINT64_C2(0xf6c69a72, 0xa3989f5c), RAPIDJSON_UINT64_C2(0xb7dcbf53, 0x54e9bece), + RAPIDJSON_UINT64_C2(0x88fcf317, 0xf22241e2), RAPIDJSON_UINT64_C2(0xcc20ce9b, 0xd35c78a5), + RAPIDJSON_UINT64_C2(0x98165af3, 0x7b2153df), RAPIDJSON_UINT64_C2(0xe2a0b5dc, 0x971f303a), + RAPIDJSON_UINT64_C2(0xa8d9d153, 0x5ce3b396), RAPIDJSON_UINT64_C2(0xfb9b7cd9, 0xa4a7443c), + RAPIDJSON_UINT64_C2(0xbb764c4c, 0xa7a44410), RAPIDJSON_UINT64_C2(0x8bab8eef, 0xb6409c1a), + RAPIDJSON_UINT64_C2(0xd01fef10, 0xa657842c), RAPIDJSON_UINT64_C2(0x9b10a4e5, 0xe9913129), + RAPIDJSON_UINT64_C2(0xe7109bfb, 0xa19c0c9d), RAPIDJSON_UINT64_C2(0xac2820d9, 0x623bf429), + RAPIDJSON_UINT64_C2(0x80444b5e, 0x7aa7cf85), RAPIDJSON_UINT64_C2(0xbf21e440, 0x03acdd2d), + RAPIDJSON_UINT64_C2(0x8e679c2f, 0x5e44ff8f), RAPIDJSON_UINT64_C2(0xd433179d, 0x9c8cb841), + RAPIDJSON_UINT64_C2(0x9e19db92, 0xb4e31ba9), RAPIDJSON_UINT64_C2(0xeb96bf6e, 0xbadf77d9), + RAPIDJSON_UINT64_C2(0xaf87023b, 0x9bf0ee6b) + }; + static const int16_t kCachedPowers_E[] = { + -1220, -1193, -1166, -1140, -1113, -1087, -1060, -1034, -1007, -980, + -954, -927, -901, -874, -847, -821, -794, -768, -741, -715, + -688, -661, -635, -608, -582, -555, -529, -502, -475, -449, + -422, -396, -369, -343, -316, -289, -263, -236, -210, -183, + -157, -130, -103, -77, -50, -24, 3, 30, 56, 83, + 109, 136, 162, 189, 216, 242, 269, 295, 322, 348, + 375, 402, 428, 455, 481, 508, 534, 561, 588, 614, + 641, 667, 694, 720, 747, 774, 800, 827, 853, 880, + 907, 933, 960, 986, 1013, 1039, 1066 + }; + RAPIDJSON_ASSERT(index < 87); + return DiyFp(kCachedPowers_F[index], kCachedPowers_E[index]); +} + +inline DiyFp GetCachedPower(int e, int* K) { + + //int k = static_cast(ceil((-61 - e) * 0.30102999566398114)) + 374; + double dk = (-61 - e) * 0.30102999566398114 + 347; // dk must be positive, so can do ceiling in positive + int k = static_cast(dk); + if (dk - k > 0.0) + k++; + + unsigned index = static_cast((k >> 3) + 1); + *K = -(-348 + static_cast(index << 3)); // decimal exponent no need lookup table + + return GetCachedPowerByIndex(index); +} + +inline DiyFp GetCachedPower10(int exp, int *outExp) { + RAPIDJSON_ASSERT(exp >= -348); + unsigned index = static_cast(exp + 348) / 8u; + *outExp = -348 + static_cast(index) * 8; + return GetCachedPowerByIndex(index); +} + +#ifdef __GNUC__ +RAPIDJSON_DIAG_POP +#endif + +#ifdef __clang__ +RAPIDJSON_DIAG_POP +RAPIDJSON_DIAG_OFF(padded) +#endif + +} // namespace internal +RAPIDJSON_NAMESPACE_END + +#endif // RAPIDJSON_DIYFP_H_ diff --git a/DFL_BOM_WL_TOERP/rapidjson/internal/dtoa.h b/DFL_BOM_WL_TOERP/rapidjson/internal/dtoa.h new file mode 100644 index 0000000..cd45672 --- /dev/null +++ b/DFL_BOM_WL_TOERP/rapidjson/internal/dtoa.h @@ -0,0 +1,249 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +// This is a C++ header-only implementation of Grisu2 algorithm from the publication: +// Loitsch, Florian. "Printing floating-point numbers quickly and accurately with +// integers." ACM Sigplan Notices 45.6 (2010): 233-243. + +#ifndef RAPIDJSON_DTOA_ +#define RAPIDJSON_DTOA_ + +#include "itoa.h" // GetDigitsLut() +#include "diyfp.h" +#include "ieee754.h" + +RAPIDJSON_NAMESPACE_BEGIN +namespace internal { + +#ifdef __GNUC__ +RAPIDJSON_DIAG_PUSH +RAPIDJSON_DIAG_OFF(effc++) +RAPIDJSON_DIAG_OFF(array-bounds) // some gcc versions generate wrong warnings https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59124 +#endif + +inline void GrisuRound(char* buffer, int len, uint64_t delta, uint64_t rest, uint64_t ten_kappa, uint64_t wp_w) { + while (rest < wp_w && delta - rest >= ten_kappa && + (rest + ten_kappa < wp_w || /// closer + wp_w - rest > rest + ten_kappa - wp_w)) { + buffer[len - 1]--; + rest += ten_kappa; + } +} + +inline int CountDecimalDigit32(uint32_t n) { + // Simple pure C++ implementation was faster than __builtin_clz version in this situation. + if (n < 10) return 1; + if (n < 100) return 2; + if (n < 1000) return 3; + if (n < 10000) return 4; + if (n < 100000) return 5; + if (n < 1000000) return 6; + if (n < 10000000) return 7; + if (n < 100000000) return 8; + // Will not reach 10 digits in DigitGen() + //if (n < 1000000000) return 9; + //return 10; + return 9; +} + +inline void DigitGen(const DiyFp& W, const DiyFp& Mp, uint64_t delta, char* buffer, int* len, int* K) { + static const uint64_t kPow10[] = { 1ULL, 10ULL, 100ULL, 1000ULL, 10000ULL, 100000ULL, 1000000ULL, 10000000ULL, 100000000ULL, + 1000000000ULL, 10000000000ULL, 100000000000ULL, 1000000000000ULL, + 10000000000000ULL, 100000000000000ULL, 1000000000000000ULL, + 10000000000000000ULL, 100000000000000000ULL, 1000000000000000000ULL, + 10000000000000000000ULL }; + const DiyFp one(uint64_t(1) << -Mp.e, Mp.e); + const DiyFp wp_w = Mp - W; + uint32_t p1 = static_cast(Mp.f >> -one.e); + uint64_t p2 = Mp.f & (one.f - 1); + int kappa = CountDecimalDigit32(p1); // kappa in [0, 9] + *len = 0; + + while (kappa > 0) { + uint32_t d = 0; + switch (kappa) { + case 9: d = p1 / 100000000; p1 %= 100000000; break; + case 8: d = p1 / 10000000; p1 %= 10000000; break; + case 7: d = p1 / 1000000; p1 %= 1000000; break; + case 6: d = p1 / 100000; p1 %= 100000; break; + case 5: d = p1 / 10000; p1 %= 10000; break; + case 4: d = p1 / 1000; p1 %= 1000; break; + case 3: d = p1 / 100; p1 %= 100; break; + case 2: d = p1 / 10; p1 %= 10; break; + case 1: d = p1; p1 = 0; break; + default:; + } + if (d || *len) + buffer[(*len)++] = static_cast('0' + static_cast(d)); + kappa--; + uint64_t tmp = (static_cast(p1) << -one.e) + p2; + if (tmp <= delta) { + *K += kappa; + GrisuRound(buffer, *len, delta, tmp, kPow10[kappa] << -one.e, wp_w.f); + return; + } + } + + // kappa = 0 + for (;;) { + p2 *= 10; + delta *= 10; + char d = static_cast(p2 >> -one.e); + if (d || *len) + buffer[(*len)++] = static_cast('0' + d); + p2 &= one.f - 1; + kappa--; + if (p2 < delta) { + *K += kappa; + int index = -kappa; + GrisuRound(buffer, *len, delta, p2, one.f, wp_w.f * (index < 20 ? kPow10[index] : 0)); + return; + } + } +} + +inline void Grisu2(double value, char* buffer, int* length, int* K) { + const DiyFp v(value); + DiyFp w_m, w_p; + v.NormalizedBoundaries(&w_m, &w_p); + + const DiyFp c_mk = GetCachedPower(w_p.e, K); + const DiyFp W = v.Normalize() * c_mk; + DiyFp Wp = w_p * c_mk; + DiyFp Wm = w_m * c_mk; + Wm.f++; + Wp.f--; + DigitGen(W, Wp, Wp.f - Wm.f, buffer, length, K); +} + +inline char* WriteExponent(int K, char* buffer) { + if (K < 0) { + *buffer++ = '-'; + K = -K; + } + + if (K >= 100) { + *buffer++ = static_cast('0' + static_cast(K / 100)); + K %= 100; + const char* d = GetDigitsLut() + K * 2; + *buffer++ = d[0]; + *buffer++ = d[1]; + } + else if (K >= 10) { + const char* d = GetDigitsLut() + K * 2; + *buffer++ = d[0]; + *buffer++ = d[1]; + } + else + *buffer++ = static_cast('0' + static_cast(K)); + + return buffer; +} + +inline char* Prettify(char* buffer, int length, int k, int maxDecimalPlaces) { + const int kk = length + k; // 10^(kk-1) <= v < 10^kk + + if (0 <= k && kk <= 21) { + // 1234e7 -> 12340000000 + for (int i = length; i < kk; i++) + buffer[i] = '0'; + buffer[kk] = '.'; + buffer[kk + 1] = '0'; + return &buffer[kk + 2]; + } + else if (0 < kk && kk <= 21) { + // 1234e-2 -> 12.34 + std::memmove(&buffer[kk + 1], &buffer[kk], static_cast(length - kk)); + buffer[kk] = '.'; + if (0 > k + maxDecimalPlaces) { + // When maxDecimalPlaces = 2, 1.2345 -> 1.23, 1.102 -> 1.1 + // Remove extra trailing zeros (at least one) after truncation. + for (int i = kk + maxDecimalPlaces; i > kk + 1; i--) + if (buffer[i] != '0') + return &buffer[i + 1]; + return &buffer[kk + 2]; // Reserve one zero + } + else + return &buffer[length + 1]; + } + else if (-6 < kk && kk <= 0) { + // 1234e-6 -> 0.001234 + const int offset = 2 - kk; + std::memmove(&buffer[offset], &buffer[0], static_cast(length)); + buffer[0] = '0'; + buffer[1] = '.'; + for (int i = 2; i < offset; i++) + buffer[i] = '0'; + if (length - kk > maxDecimalPlaces) { + // When maxDecimalPlaces = 2, 0.123 -> 0.12, 0.102 -> 0.1 + // Remove extra trailing zeros (at least one) after truncation. + for (int i = maxDecimalPlaces + 1; i > 2; i--) + if (buffer[i] != '0') + return &buffer[i + 1]; + return &buffer[3]; // Reserve one zero + } + else + return &buffer[length + offset]; + } + else if (kk < -maxDecimalPlaces) { + // Truncate to zero + buffer[0] = '0'; + buffer[1] = '.'; + buffer[2] = '0'; + return &buffer[3]; + } + else if (length == 1) { + // 1e30 + buffer[1] = 'e'; + return WriteExponent(kk - 1, &buffer[2]); + } + else { + // 1234e30 -> 1.234e33 + std::memmove(&buffer[2], &buffer[1], static_cast(length - 1)); + buffer[1] = '.'; + buffer[length + 1] = 'e'; + return WriteExponent(kk - 1, &buffer[0 + length + 2]); + } +} + +inline char* dtoa(double value, char* buffer, int maxDecimalPlaces = 324) { + RAPIDJSON_ASSERT(maxDecimalPlaces >= 1); + Double d(value); + if (d.IsZero()) { + if (d.Sign()) + *buffer++ = '-'; // -0.0, Issue #289 + buffer[0] = '0'; + buffer[1] = '.'; + buffer[2] = '0'; + return &buffer[3]; + } + else { + if (value < 0) { + *buffer++ = '-'; + value = -value; + } + int length, K; + Grisu2(value, buffer, &length, &K); + return Prettify(buffer, length, K, maxDecimalPlaces); + } +} + +#ifdef __GNUC__ +RAPIDJSON_DIAG_POP +#endif + +} // namespace internal +RAPIDJSON_NAMESPACE_END + +#endif // RAPIDJSON_DTOA_ diff --git a/DFL_BOM_WL_TOERP/rapidjson/internal/ieee754.h b/DFL_BOM_WL_TOERP/rapidjson/internal/ieee754.h new file mode 100644 index 0000000..68c9e96 --- /dev/null +++ b/DFL_BOM_WL_TOERP/rapidjson/internal/ieee754.h @@ -0,0 +1,78 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +#ifndef RAPIDJSON_IEEE754_ +#define RAPIDJSON_IEEE754_ + +#include "../rapidjson.h" + +RAPIDJSON_NAMESPACE_BEGIN +namespace internal { + +class Double { +public: + Double() {} + Double(double d) : d_(d) {} + Double(uint64_t u) : u_(u) {} + + double Value() const { return d_; } + uint64_t Uint64Value() const { return u_; } + + double NextPositiveDouble() const { + RAPIDJSON_ASSERT(!Sign()); + return Double(u_ + 1).Value(); + } + + bool Sign() const { return (u_ & kSignMask) != 0; } + uint64_t Significand() const { return u_ & kSignificandMask; } + int Exponent() const { return static_cast(((u_ & kExponentMask) >> kSignificandSize) - kExponentBias); } + + bool IsNan() const { return (u_ & kExponentMask) == kExponentMask && Significand() != 0; } + bool IsInf() const { return (u_ & kExponentMask) == kExponentMask && Significand() == 0; } + bool IsNanOrInf() const { return (u_ & kExponentMask) == kExponentMask; } + bool IsNormal() const { return (u_ & kExponentMask) != 0 || Significand() == 0; } + bool IsZero() const { return (u_ & (kExponentMask | kSignificandMask)) == 0; } + + uint64_t IntegerSignificand() const { return IsNormal() ? Significand() | kHiddenBit : Significand(); } + int IntegerExponent() const { return (IsNormal() ? Exponent() : kDenormalExponent) - kSignificandSize; } + uint64_t ToBias() const { return (u_ & kSignMask) ? ~u_ + 1 : u_ | kSignMask; } + + static int EffectiveSignificandSize(int order) { + if (order >= -1021) + return 53; + else if (order <= -1074) + return 0; + else + return order + 1074; + } + +private: + static const int kSignificandSize = 52; + static const int kExponentBias = 0x3FF; + static const int kDenormalExponent = 1 - kExponentBias; + static const uint64_t kSignMask = RAPIDJSON_UINT64_C2(0x80000000, 0x00000000); + static const uint64_t kExponentMask = RAPIDJSON_UINT64_C2(0x7FF00000, 0x00000000); + static const uint64_t kSignificandMask = RAPIDJSON_UINT64_C2(0x000FFFFF, 0xFFFFFFFF); + static const uint64_t kHiddenBit = RAPIDJSON_UINT64_C2(0x00100000, 0x00000000); + + union { + double d_; + uint64_t u_; + }; +}; + +} // namespace internal +RAPIDJSON_NAMESPACE_END + +#endif // RAPIDJSON_IEEE754_ diff --git a/DFL_BOM_WL_TOERP/rapidjson/internal/itoa.h b/DFL_BOM_WL_TOERP/rapidjson/internal/itoa.h new file mode 100644 index 0000000..9fe8c93 --- /dev/null +++ b/DFL_BOM_WL_TOERP/rapidjson/internal/itoa.h @@ -0,0 +1,308 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +#ifndef RAPIDJSON_ITOA_ +#define RAPIDJSON_ITOA_ + +#include "../rapidjson.h" + +RAPIDJSON_NAMESPACE_BEGIN +namespace internal { + +inline const char* GetDigitsLut() { + static const char cDigitsLut[200] = { + '0','0','0','1','0','2','0','3','0','4','0','5','0','6','0','7','0','8','0','9', + '1','0','1','1','1','2','1','3','1','4','1','5','1','6','1','7','1','8','1','9', + '2','0','2','1','2','2','2','3','2','4','2','5','2','6','2','7','2','8','2','9', + '3','0','3','1','3','2','3','3','3','4','3','5','3','6','3','7','3','8','3','9', + '4','0','4','1','4','2','4','3','4','4','4','5','4','6','4','7','4','8','4','9', + '5','0','5','1','5','2','5','3','5','4','5','5','5','6','5','7','5','8','5','9', + '6','0','6','1','6','2','6','3','6','4','6','5','6','6','6','7','6','8','6','9', + '7','0','7','1','7','2','7','3','7','4','7','5','7','6','7','7','7','8','7','9', + '8','0','8','1','8','2','8','3','8','4','8','5','8','6','8','7','8','8','8','9', + '9','0','9','1','9','2','9','3','9','4','9','5','9','6','9','7','9','8','9','9' + }; + return cDigitsLut; +} + +inline char* u32toa(uint32_t value, char* buffer) { + RAPIDJSON_ASSERT(buffer != 0); + + const char* cDigitsLut = GetDigitsLut(); + + if (value < 10000) { + const uint32_t d1 = (value / 100) << 1; + const uint32_t d2 = (value % 100) << 1; + + if (value >= 1000) + *buffer++ = cDigitsLut[d1]; + if (value >= 100) + *buffer++ = cDigitsLut[d1 + 1]; + if (value >= 10) + *buffer++ = cDigitsLut[d2]; + *buffer++ = cDigitsLut[d2 + 1]; + } + else if (value < 100000000) { + // value = bbbbcccc + const uint32_t b = value / 10000; + const uint32_t c = value % 10000; + + const uint32_t d1 = (b / 100) << 1; + const uint32_t d2 = (b % 100) << 1; + + const uint32_t d3 = (c / 100) << 1; + const uint32_t d4 = (c % 100) << 1; + + if (value >= 10000000) + *buffer++ = cDigitsLut[d1]; + if (value >= 1000000) + *buffer++ = cDigitsLut[d1 + 1]; + if (value >= 100000) + *buffer++ = cDigitsLut[d2]; + *buffer++ = cDigitsLut[d2 + 1]; + + *buffer++ = cDigitsLut[d3]; + *buffer++ = cDigitsLut[d3 + 1]; + *buffer++ = cDigitsLut[d4]; + *buffer++ = cDigitsLut[d4 + 1]; + } + else { + // value = aabbbbcccc in decimal + + const uint32_t a = value / 100000000; // 1 to 42 + value %= 100000000; + + if (a >= 10) { + const unsigned i = a << 1; + *buffer++ = cDigitsLut[i]; + *buffer++ = cDigitsLut[i + 1]; + } + else + *buffer++ = static_cast('0' + static_cast(a)); + + const uint32_t b = value / 10000; // 0 to 9999 + const uint32_t c = value % 10000; // 0 to 9999 + + const uint32_t d1 = (b / 100) << 1; + const uint32_t d2 = (b % 100) << 1; + + const uint32_t d3 = (c / 100) << 1; + const uint32_t d4 = (c % 100) << 1; + + *buffer++ = cDigitsLut[d1]; + *buffer++ = cDigitsLut[d1 + 1]; + *buffer++ = cDigitsLut[d2]; + *buffer++ = cDigitsLut[d2 + 1]; + *buffer++ = cDigitsLut[d3]; + *buffer++ = cDigitsLut[d3 + 1]; + *buffer++ = cDigitsLut[d4]; + *buffer++ = cDigitsLut[d4 + 1]; + } + return buffer; +} + +inline char* i32toa(int32_t value, char* buffer) { + RAPIDJSON_ASSERT(buffer != 0); + uint32_t u = static_cast(value); + if (value < 0) { + *buffer++ = '-'; + u = ~u + 1; + } + + return u32toa(u, buffer); +} + +inline char* u64toa(uint64_t value, char* buffer) { + RAPIDJSON_ASSERT(buffer != 0); + const char* cDigitsLut = GetDigitsLut(); + const uint64_t kTen8 = 100000000; + const uint64_t kTen9 = kTen8 * 10; + const uint64_t kTen10 = kTen8 * 100; + const uint64_t kTen11 = kTen8 * 1000; + const uint64_t kTen12 = kTen8 * 10000; + const uint64_t kTen13 = kTen8 * 100000; + const uint64_t kTen14 = kTen8 * 1000000; + const uint64_t kTen15 = kTen8 * 10000000; + const uint64_t kTen16 = kTen8 * kTen8; + + if (value < kTen8) { + uint32_t v = static_cast(value); + if (v < 10000) { + const uint32_t d1 = (v / 100) << 1; + const uint32_t d2 = (v % 100) << 1; + + if (v >= 1000) + *buffer++ = cDigitsLut[d1]; + if (v >= 100) + *buffer++ = cDigitsLut[d1 + 1]; + if (v >= 10) + *buffer++ = cDigitsLut[d2]; + *buffer++ = cDigitsLut[d2 + 1]; + } + else { + // value = bbbbcccc + const uint32_t b = v / 10000; + const uint32_t c = v % 10000; + + const uint32_t d1 = (b / 100) << 1; + const uint32_t d2 = (b % 100) << 1; + + const uint32_t d3 = (c / 100) << 1; + const uint32_t d4 = (c % 100) << 1; + + if (value >= 10000000) + *buffer++ = cDigitsLut[d1]; + if (value >= 1000000) + *buffer++ = cDigitsLut[d1 + 1]; + if (value >= 100000) + *buffer++ = cDigitsLut[d2]; + *buffer++ = cDigitsLut[d2 + 1]; + + *buffer++ = cDigitsLut[d3]; + *buffer++ = cDigitsLut[d3 + 1]; + *buffer++ = cDigitsLut[d4]; + *buffer++ = cDigitsLut[d4 + 1]; + } + } + else if (value < kTen16) { + const uint32_t v0 = static_cast(value / kTen8); + const uint32_t v1 = static_cast(value % kTen8); + + const uint32_t b0 = v0 / 10000; + const uint32_t c0 = v0 % 10000; + + const uint32_t d1 = (b0 / 100) << 1; + const uint32_t d2 = (b0 % 100) << 1; + + const uint32_t d3 = (c0 / 100) << 1; + const uint32_t d4 = (c0 % 100) << 1; + + const uint32_t b1 = v1 / 10000; + const uint32_t c1 = v1 % 10000; + + const uint32_t d5 = (b1 / 100) << 1; + const uint32_t d6 = (b1 % 100) << 1; + + const uint32_t d7 = (c1 / 100) << 1; + const uint32_t d8 = (c1 % 100) << 1; + + if (value >= kTen15) + *buffer++ = cDigitsLut[d1]; + if (value >= kTen14) + *buffer++ = cDigitsLut[d1 + 1]; + if (value >= kTen13) + *buffer++ = cDigitsLut[d2]; + if (value >= kTen12) + *buffer++ = cDigitsLut[d2 + 1]; + if (value >= kTen11) + *buffer++ = cDigitsLut[d3]; + if (value >= kTen10) + *buffer++ = cDigitsLut[d3 + 1]; + if (value >= kTen9) + *buffer++ = cDigitsLut[d4]; + + *buffer++ = cDigitsLut[d4 + 1]; + *buffer++ = cDigitsLut[d5]; + *buffer++ = cDigitsLut[d5 + 1]; + *buffer++ = cDigitsLut[d6]; + *buffer++ = cDigitsLut[d6 + 1]; + *buffer++ = cDigitsLut[d7]; + *buffer++ = cDigitsLut[d7 + 1]; + *buffer++ = cDigitsLut[d8]; + *buffer++ = cDigitsLut[d8 + 1]; + } + else { + const uint32_t a = static_cast(value / kTen16); // 1 to 1844 + value %= kTen16; + + if (a < 10) + *buffer++ = static_cast('0' + static_cast(a)); + else if (a < 100) { + const uint32_t i = a << 1; + *buffer++ = cDigitsLut[i]; + *buffer++ = cDigitsLut[i + 1]; + } + else if (a < 1000) { + *buffer++ = static_cast('0' + static_cast(a / 100)); + + const uint32_t i = (a % 100) << 1; + *buffer++ = cDigitsLut[i]; + *buffer++ = cDigitsLut[i + 1]; + } + else { + const uint32_t i = (a / 100) << 1; + const uint32_t j = (a % 100) << 1; + *buffer++ = cDigitsLut[i]; + *buffer++ = cDigitsLut[i + 1]; + *buffer++ = cDigitsLut[j]; + *buffer++ = cDigitsLut[j + 1]; + } + + const uint32_t v0 = static_cast(value / kTen8); + const uint32_t v1 = static_cast(value % kTen8); + + const uint32_t b0 = v0 / 10000; + const uint32_t c0 = v0 % 10000; + + const uint32_t d1 = (b0 / 100) << 1; + const uint32_t d2 = (b0 % 100) << 1; + + const uint32_t d3 = (c0 / 100) << 1; + const uint32_t d4 = (c0 % 100) << 1; + + const uint32_t b1 = v1 / 10000; + const uint32_t c1 = v1 % 10000; + + const uint32_t d5 = (b1 / 100) << 1; + const uint32_t d6 = (b1 % 100) << 1; + + const uint32_t d7 = (c1 / 100) << 1; + const uint32_t d8 = (c1 % 100) << 1; + + *buffer++ = cDigitsLut[d1]; + *buffer++ = cDigitsLut[d1 + 1]; + *buffer++ = cDigitsLut[d2]; + *buffer++ = cDigitsLut[d2 + 1]; + *buffer++ = cDigitsLut[d3]; + *buffer++ = cDigitsLut[d3 + 1]; + *buffer++ = cDigitsLut[d4]; + *buffer++ = cDigitsLut[d4 + 1]; + *buffer++ = cDigitsLut[d5]; + *buffer++ = cDigitsLut[d5 + 1]; + *buffer++ = cDigitsLut[d6]; + *buffer++ = cDigitsLut[d6 + 1]; + *buffer++ = cDigitsLut[d7]; + *buffer++ = cDigitsLut[d7 + 1]; + *buffer++ = cDigitsLut[d8]; + *buffer++ = cDigitsLut[d8 + 1]; + } + + return buffer; +} + +inline char* i64toa(int64_t value, char* buffer) { + RAPIDJSON_ASSERT(buffer != 0); + uint64_t u = static_cast(value); + if (value < 0) { + *buffer++ = '-'; + u = ~u + 1; + } + + return u64toa(u, buffer); +} + +} // namespace internal +RAPIDJSON_NAMESPACE_END + +#endif // RAPIDJSON_ITOA_ diff --git a/DFL_BOM_WL_TOERP/rapidjson/internal/meta.h b/DFL_BOM_WL_TOERP/rapidjson/internal/meta.h new file mode 100644 index 0000000..27092dc --- /dev/null +++ b/DFL_BOM_WL_TOERP/rapidjson/internal/meta.h @@ -0,0 +1,186 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +#ifndef RAPIDJSON_INTERNAL_META_H_ +#define RAPIDJSON_INTERNAL_META_H_ + +#include "../rapidjson.h" + +#ifdef __GNUC__ +RAPIDJSON_DIAG_PUSH +RAPIDJSON_DIAG_OFF(effc++) +#endif + +#if defined(_MSC_VER) && !defined(__clang__) +RAPIDJSON_DIAG_PUSH +RAPIDJSON_DIAG_OFF(6334) +#endif + +#if RAPIDJSON_HAS_CXX11_TYPETRAITS +#include +#endif + +//@cond RAPIDJSON_INTERNAL +RAPIDJSON_NAMESPACE_BEGIN +namespace internal { + +// Helper to wrap/convert arbitrary types to void, useful for arbitrary type matching +template struct Void { typedef void Type; }; + +/////////////////////////////////////////////////////////////////////////////// +// BoolType, TrueType, FalseType +// +template struct BoolType { + static const bool Value = Cond; + typedef BoolType Type; +}; +typedef BoolType TrueType; +typedef BoolType FalseType; + + +/////////////////////////////////////////////////////////////////////////////// +// SelectIf, BoolExpr, NotExpr, AndExpr, OrExpr +// + +template struct SelectIfImpl { template struct Apply { typedef T1 Type; }; }; +template <> struct SelectIfImpl { template struct Apply { typedef T2 Type; }; }; +template struct SelectIfCond : SelectIfImpl::template Apply {}; +template struct SelectIf : SelectIfCond {}; + +template struct AndExprCond : FalseType {}; +template <> struct AndExprCond : TrueType {}; +template struct OrExprCond : TrueType {}; +template <> struct OrExprCond : FalseType {}; + +template struct BoolExpr : SelectIf::Type {}; +template struct NotExpr : SelectIf::Type {}; +template struct AndExpr : AndExprCond::Type {}; +template struct OrExpr : OrExprCond::Type {}; + + +/////////////////////////////////////////////////////////////////////////////// +// AddConst, MaybeAddConst, RemoveConst +template struct AddConst { typedef const T Type; }; +template struct MaybeAddConst : SelectIfCond {}; +template struct RemoveConst { typedef T Type; }; +template struct RemoveConst { typedef T Type; }; + + +/////////////////////////////////////////////////////////////////////////////// +// IsSame, IsConst, IsMoreConst, IsPointer +// +template struct IsSame : FalseType {}; +template struct IsSame : TrueType {}; + +template struct IsConst : FalseType {}; +template struct IsConst : TrueType {}; + +template +struct IsMoreConst + : AndExpr::Type, typename RemoveConst::Type>, + BoolType::Value >= IsConst::Value> >::Type {}; + +template struct IsPointer : FalseType {}; +template struct IsPointer : TrueType {}; + +/////////////////////////////////////////////////////////////////////////////// +// IsBaseOf +// +#if RAPIDJSON_HAS_CXX11_TYPETRAITS + +template struct IsBaseOf + : BoolType< ::std::is_base_of::value> {}; + +#else // simplified version adopted from Boost + +template struct IsBaseOfImpl { + RAPIDJSON_STATIC_ASSERT(sizeof(B) != 0); + RAPIDJSON_STATIC_ASSERT(sizeof(D) != 0); + + typedef char (&Yes)[1]; + typedef char (&No) [2]; + + template + static Yes Check(const D*, T); + static No Check(const B*, int); + + struct Host { + operator const B*() const; + operator const D*(); + }; + + enum { Value = (sizeof(Check(Host(), 0)) == sizeof(Yes)) }; +}; + +template struct IsBaseOf + : OrExpr, BoolExpr > >::Type {}; + +#endif // RAPIDJSON_HAS_CXX11_TYPETRAITS + + +////////////////////////////////////////////////////////////////////////// +// EnableIf / DisableIf +// +template struct EnableIfCond { typedef T Type; }; +template struct EnableIfCond { /* empty */ }; + +template struct DisableIfCond { typedef T Type; }; +template struct DisableIfCond { /* empty */ }; + +template +struct EnableIf : EnableIfCond {}; + +template +struct DisableIf : DisableIfCond {}; + +// SFINAE helpers +struct SfinaeTag {}; +template struct RemoveSfinaeTag; +template struct RemoveSfinaeTag { typedef T Type; }; + +#define RAPIDJSON_REMOVEFPTR_(type) \ + typename ::RAPIDJSON_NAMESPACE::internal::RemoveSfinaeTag \ + < ::RAPIDJSON_NAMESPACE::internal::SfinaeTag&(*) type>::Type + +#define RAPIDJSON_ENABLEIF(cond) \ + typename ::RAPIDJSON_NAMESPACE::internal::EnableIf \ + ::Type * = NULL + +#define RAPIDJSON_DISABLEIF(cond) \ + typename ::RAPIDJSON_NAMESPACE::internal::DisableIf \ + ::Type * = NULL + +#define RAPIDJSON_ENABLEIF_RETURN(cond,returntype) \ + typename ::RAPIDJSON_NAMESPACE::internal::EnableIf \ + ::Type + +#define RAPIDJSON_DISABLEIF_RETURN(cond,returntype) \ + typename ::RAPIDJSON_NAMESPACE::internal::DisableIf \ + ::Type + +} // namespace internal +RAPIDJSON_NAMESPACE_END +//@endcond + +#if defined(_MSC_VER) && !defined(__clang__) +RAPIDJSON_DIAG_POP +#endif + +#ifdef __GNUC__ +RAPIDJSON_DIAG_POP +#endif + +#endif // RAPIDJSON_INTERNAL_META_H_ diff --git a/DFL_BOM_WL_TOERP/rapidjson/internal/pow10.h b/DFL_BOM_WL_TOERP/rapidjson/internal/pow10.h new file mode 100644 index 0000000..eae1a43 --- /dev/null +++ b/DFL_BOM_WL_TOERP/rapidjson/internal/pow10.h @@ -0,0 +1,55 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +#ifndef RAPIDJSON_POW10_ +#define RAPIDJSON_POW10_ + +#include "../rapidjson.h" + +RAPIDJSON_NAMESPACE_BEGIN +namespace internal { + +//! Computes integer powers of 10 in double (10.0^n). +/*! This function uses lookup table for fast and accurate results. + \param n non-negative exponent. Must <= 308. + \return 10.0^n +*/ +inline double Pow10(int n) { + static const double e[] = { // 1e-0...1e308: 309 * 8 bytes = 2472 bytes + 1e+0, + 1e+1, 1e+2, 1e+3, 1e+4, 1e+5, 1e+6, 1e+7, 1e+8, 1e+9, 1e+10, 1e+11, 1e+12, 1e+13, 1e+14, 1e+15, 1e+16, 1e+17, 1e+18, 1e+19, 1e+20, + 1e+21, 1e+22, 1e+23, 1e+24, 1e+25, 1e+26, 1e+27, 1e+28, 1e+29, 1e+30, 1e+31, 1e+32, 1e+33, 1e+34, 1e+35, 1e+36, 1e+37, 1e+38, 1e+39, 1e+40, + 1e+41, 1e+42, 1e+43, 1e+44, 1e+45, 1e+46, 1e+47, 1e+48, 1e+49, 1e+50, 1e+51, 1e+52, 1e+53, 1e+54, 1e+55, 1e+56, 1e+57, 1e+58, 1e+59, 1e+60, + 1e+61, 1e+62, 1e+63, 1e+64, 1e+65, 1e+66, 1e+67, 1e+68, 1e+69, 1e+70, 1e+71, 1e+72, 1e+73, 1e+74, 1e+75, 1e+76, 1e+77, 1e+78, 1e+79, 1e+80, + 1e+81, 1e+82, 1e+83, 1e+84, 1e+85, 1e+86, 1e+87, 1e+88, 1e+89, 1e+90, 1e+91, 1e+92, 1e+93, 1e+94, 1e+95, 1e+96, 1e+97, 1e+98, 1e+99, 1e+100, + 1e+101,1e+102,1e+103,1e+104,1e+105,1e+106,1e+107,1e+108,1e+109,1e+110,1e+111,1e+112,1e+113,1e+114,1e+115,1e+116,1e+117,1e+118,1e+119,1e+120, + 1e+121,1e+122,1e+123,1e+124,1e+125,1e+126,1e+127,1e+128,1e+129,1e+130,1e+131,1e+132,1e+133,1e+134,1e+135,1e+136,1e+137,1e+138,1e+139,1e+140, + 1e+141,1e+142,1e+143,1e+144,1e+145,1e+146,1e+147,1e+148,1e+149,1e+150,1e+151,1e+152,1e+153,1e+154,1e+155,1e+156,1e+157,1e+158,1e+159,1e+160, + 1e+161,1e+162,1e+163,1e+164,1e+165,1e+166,1e+167,1e+168,1e+169,1e+170,1e+171,1e+172,1e+173,1e+174,1e+175,1e+176,1e+177,1e+178,1e+179,1e+180, + 1e+181,1e+182,1e+183,1e+184,1e+185,1e+186,1e+187,1e+188,1e+189,1e+190,1e+191,1e+192,1e+193,1e+194,1e+195,1e+196,1e+197,1e+198,1e+199,1e+200, + 1e+201,1e+202,1e+203,1e+204,1e+205,1e+206,1e+207,1e+208,1e+209,1e+210,1e+211,1e+212,1e+213,1e+214,1e+215,1e+216,1e+217,1e+218,1e+219,1e+220, + 1e+221,1e+222,1e+223,1e+224,1e+225,1e+226,1e+227,1e+228,1e+229,1e+230,1e+231,1e+232,1e+233,1e+234,1e+235,1e+236,1e+237,1e+238,1e+239,1e+240, + 1e+241,1e+242,1e+243,1e+244,1e+245,1e+246,1e+247,1e+248,1e+249,1e+250,1e+251,1e+252,1e+253,1e+254,1e+255,1e+256,1e+257,1e+258,1e+259,1e+260, + 1e+261,1e+262,1e+263,1e+264,1e+265,1e+266,1e+267,1e+268,1e+269,1e+270,1e+271,1e+272,1e+273,1e+274,1e+275,1e+276,1e+277,1e+278,1e+279,1e+280, + 1e+281,1e+282,1e+283,1e+284,1e+285,1e+286,1e+287,1e+288,1e+289,1e+290,1e+291,1e+292,1e+293,1e+294,1e+295,1e+296,1e+297,1e+298,1e+299,1e+300, + 1e+301,1e+302,1e+303,1e+304,1e+305,1e+306,1e+307,1e+308 + }; + RAPIDJSON_ASSERT(n >= 0 && n <= 308); + return e[n]; +} + +} // namespace internal +RAPIDJSON_NAMESPACE_END + +#endif // RAPIDJSON_POW10_ diff --git a/DFL_BOM_WL_TOERP/rapidjson/internal/regex.h b/DFL_BOM_WL_TOERP/rapidjson/internal/regex.h new file mode 100644 index 0000000..6446c40 --- /dev/null +++ b/DFL_BOM_WL_TOERP/rapidjson/internal/regex.h @@ -0,0 +1,739 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +#ifndef RAPIDJSON_INTERNAL_REGEX_H_ +#define RAPIDJSON_INTERNAL_REGEX_H_ + +#include "../allocators.h" +#include "../stream.h" +#include "stack.h" + +#ifdef __clang__ +RAPIDJSON_DIAG_PUSH +RAPIDJSON_DIAG_OFF(padded) +RAPIDJSON_DIAG_OFF(switch-enum) +#elif defined(_MSC_VER) +RAPIDJSON_DIAG_PUSH +RAPIDJSON_DIAG_OFF(4512) // assignment operator could not be generated +#endif + +#ifdef __GNUC__ +RAPIDJSON_DIAG_PUSH +RAPIDJSON_DIAG_OFF(effc++) +#endif + +#ifndef RAPIDJSON_REGEX_VERBOSE +#define RAPIDJSON_REGEX_VERBOSE 0 +#endif + +RAPIDJSON_NAMESPACE_BEGIN +namespace internal { + +/////////////////////////////////////////////////////////////////////////////// +// DecodedStream + +template +class DecodedStream { +public: + DecodedStream(SourceStream& ss) : ss_(ss), codepoint_() { Decode(); } + unsigned Peek() { return codepoint_; } + unsigned Take() { + unsigned c = codepoint_; + if (c) // No further decoding when '\0' + Decode(); + return c; + } + +private: + void Decode() { + if (!Encoding::Decode(ss_, &codepoint_)) + codepoint_ = 0; + } + + SourceStream& ss_; + unsigned codepoint_; +}; + +/////////////////////////////////////////////////////////////////////////////// +// GenericRegex + +static const SizeType kRegexInvalidState = ~SizeType(0); //!< Represents an invalid index in GenericRegex::State::out, out1 +static const SizeType kRegexInvalidRange = ~SizeType(0); + +template +class GenericRegexSearch; + +//! Regular expression engine with subset of ECMAscript grammar. +/*! + Supported regular expression syntax: + - \c ab Concatenation + - \c a|b Alternation + - \c a? Zero or one + - \c a* Zero or more + - \c a+ One or more + - \c a{3} Exactly 3 times + - \c a{3,} At least 3 times + - \c a{3,5} 3 to 5 times + - \c (ab) Grouping + - \c ^a At the beginning + - \c a$ At the end + - \c . Any character + - \c [abc] Character classes + - \c [a-c] Character class range + - \c [a-z0-9_] Character class combination + - \c [^abc] Negated character classes + - \c [^a-c] Negated character class range + - \c [\b] Backspace (U+0008) + - \c \\| \\\\ ... Escape characters + - \c \\f Form feed (U+000C) + - \c \\n Line feed (U+000A) + - \c \\r Carriage return (U+000D) + - \c \\t Tab (U+0009) + - \c \\v Vertical tab (U+000B) + + \note This is a Thompson NFA engine, implemented with reference to + Cox, Russ. "Regular Expression Matching Can Be Simple And Fast (but is slow in Java, Perl, PHP, Python, Ruby,...).", + https://swtch.com/~rsc/regexp/regexp1.html +*/ +template +class GenericRegex { +public: + typedef Encoding EncodingType; + typedef typename Encoding::Ch Ch; + template friend class GenericRegexSearch; + + GenericRegex(const Ch* source, Allocator* allocator = 0) : + ownAllocator_(allocator ? 0 : RAPIDJSON_NEW(Allocator)()), allocator_(allocator ? allocator : ownAllocator_), + states_(allocator_, 256), ranges_(allocator_, 256), root_(kRegexInvalidState), stateCount_(), rangeCount_(), + anchorBegin_(), anchorEnd_() + { + GenericStringStream ss(source); + DecodedStream, Encoding> ds(ss); + Parse(ds); + } + + ~GenericRegex() + { + RAPIDJSON_DELETE(ownAllocator_); + } + + bool IsValid() const { + return root_ != kRegexInvalidState; + } + +private: + enum Operator { + kZeroOrOne, + kZeroOrMore, + kOneOrMore, + kConcatenation, + kAlternation, + kLeftParenthesis + }; + + static const unsigned kAnyCharacterClass = 0xFFFFFFFF; //!< For '.' + static const unsigned kRangeCharacterClass = 0xFFFFFFFE; + static const unsigned kRangeNegationFlag = 0x80000000; + + struct Range { + unsigned start; // + unsigned end; + SizeType next; + }; + + struct State { + SizeType out; //!< Equals to kInvalid for matching state + SizeType out1; //!< Equals to non-kInvalid for split + SizeType rangeStart; + unsigned codepoint; + }; + + struct Frag { + Frag(SizeType s, SizeType o, SizeType m) : start(s), out(o), minIndex(m) {} + SizeType start; + SizeType out; //!< link-list of all output states + SizeType minIndex; + }; + + State& GetState(SizeType index) { + RAPIDJSON_ASSERT(index < stateCount_); + return states_.template Bottom()[index]; + } + + const State& GetState(SizeType index) const { + RAPIDJSON_ASSERT(index < stateCount_); + return states_.template Bottom()[index]; + } + + Range& GetRange(SizeType index) { + RAPIDJSON_ASSERT(index < rangeCount_); + return ranges_.template Bottom()[index]; + } + + const Range& GetRange(SizeType index) const { + RAPIDJSON_ASSERT(index < rangeCount_); + return ranges_.template Bottom()[index]; + } + + template + void Parse(DecodedStream& ds) { + Stack operandStack(allocator_, 256); // Frag + Stack operatorStack(allocator_, 256); // Operator + Stack atomCountStack(allocator_, 256); // unsigned (Atom per parenthesis) + + *atomCountStack.template Push() = 0; + + unsigned codepoint; + while (ds.Peek() != 0) { + switch (codepoint = ds.Take()) { + case '^': + anchorBegin_ = true; + break; + + case '$': + anchorEnd_ = true; + break; + + case '|': + while (!operatorStack.Empty() && *operatorStack.template Top() < kAlternation) + if (!Eval(operandStack, *operatorStack.template Pop(1))) + return; + *operatorStack.template Push() = kAlternation; + *atomCountStack.template Top() = 0; + break; + + case '(': + *operatorStack.template Push() = kLeftParenthesis; + *atomCountStack.template Push() = 0; + break; + + case ')': + while (!operatorStack.Empty() && *operatorStack.template Top() != kLeftParenthesis) + if (!Eval(operandStack, *operatorStack.template Pop(1))) + return; + if (operatorStack.Empty()) + return; + operatorStack.template Pop(1); + atomCountStack.template Pop(1); + ImplicitConcatenation(atomCountStack, operatorStack); + break; + + case '?': + if (!Eval(operandStack, kZeroOrOne)) + return; + break; + + case '*': + if (!Eval(operandStack, kZeroOrMore)) + return; + break; + + case '+': + if (!Eval(operandStack, kOneOrMore)) + return; + break; + + case '{': + { + unsigned n, m; + if (!ParseUnsigned(ds, &n)) + return; + + if (ds.Peek() == ',') { + ds.Take(); + if (ds.Peek() == '}') + m = kInfinityQuantifier; + else if (!ParseUnsigned(ds, &m) || m < n) + return; + } + else + m = n; + + if (!EvalQuantifier(operandStack, n, m) || ds.Peek() != '}') + return; + ds.Take(); + } + break; + + case '.': + PushOperand(operandStack, kAnyCharacterClass); + ImplicitConcatenation(atomCountStack, operatorStack); + break; + + case '[': + { + SizeType range; + if (!ParseRange(ds, &range)) + return; + SizeType s = NewState(kRegexInvalidState, kRegexInvalidState, kRangeCharacterClass); + GetState(s).rangeStart = range; + *operandStack.template Push() = Frag(s, s, s); + } + ImplicitConcatenation(atomCountStack, operatorStack); + break; + + case '\\': // Escape character + if (!CharacterEscape(ds, &codepoint)) + return; // Unsupported escape character + // fall through to default + RAPIDJSON_DELIBERATE_FALLTHROUGH; + + default: // Pattern character + PushOperand(operandStack, codepoint); + ImplicitConcatenation(atomCountStack, operatorStack); + } + } + + while (!operatorStack.Empty()) + if (!Eval(operandStack, *operatorStack.template Pop(1))) + return; + + // Link the operand to matching state. + if (operandStack.GetSize() == sizeof(Frag)) { + Frag* e = operandStack.template Pop(1); + Patch(e->out, NewState(kRegexInvalidState, kRegexInvalidState, 0)); + root_ = e->start; + +#if RAPIDJSON_REGEX_VERBOSE + printf("root: %d\n", root_); + for (SizeType i = 0; i < stateCount_ ; i++) { + State& s = GetState(i); + printf("[%2d] out: %2d out1: %2d c: '%c'\n", i, s.out, s.out1, (char)s.codepoint); + } + printf("\n"); +#endif + } + } + + SizeType NewState(SizeType out, SizeType out1, unsigned codepoint) { + State* s = states_.template Push(); + s->out = out; + s->out1 = out1; + s->codepoint = codepoint; + s->rangeStart = kRegexInvalidRange; + return stateCount_++; + } + + void PushOperand(Stack& operandStack, unsigned codepoint) { + SizeType s = NewState(kRegexInvalidState, kRegexInvalidState, codepoint); + *operandStack.template Push() = Frag(s, s, s); + } + + void ImplicitConcatenation(Stack& atomCountStack, Stack& operatorStack) { + if (*atomCountStack.template Top()) + *operatorStack.template Push() = kConcatenation; + (*atomCountStack.template Top())++; + } + + SizeType Append(SizeType l1, SizeType l2) { + SizeType old = l1; + while (GetState(l1).out != kRegexInvalidState) + l1 = GetState(l1).out; + GetState(l1).out = l2; + return old; + } + + void Patch(SizeType l, SizeType s) { + for (SizeType next; l != kRegexInvalidState; l = next) { + next = GetState(l).out; + GetState(l).out = s; + } + } + + bool Eval(Stack& operandStack, Operator op) { + switch (op) { + case kConcatenation: + RAPIDJSON_ASSERT(operandStack.GetSize() >= sizeof(Frag) * 2); + { + Frag e2 = *operandStack.template Pop(1); + Frag e1 = *operandStack.template Pop(1); + Patch(e1.out, e2.start); + *operandStack.template Push() = Frag(e1.start, e2.out, Min(e1.minIndex, e2.minIndex)); + } + return true; + + case kAlternation: + if (operandStack.GetSize() >= sizeof(Frag) * 2) { + Frag e2 = *operandStack.template Pop(1); + Frag e1 = *operandStack.template Pop(1); + SizeType s = NewState(e1.start, e2.start, 0); + *operandStack.template Push() = Frag(s, Append(e1.out, e2.out), Min(e1.minIndex, e2.minIndex)); + return true; + } + return false; + + case kZeroOrOne: + if (operandStack.GetSize() >= sizeof(Frag)) { + Frag e = *operandStack.template Pop(1); + SizeType s = NewState(kRegexInvalidState, e.start, 0); + *operandStack.template Push() = Frag(s, Append(e.out, s), e.minIndex); + return true; + } + return false; + + case kZeroOrMore: + if (operandStack.GetSize() >= sizeof(Frag)) { + Frag e = *operandStack.template Pop(1); + SizeType s = NewState(kRegexInvalidState, e.start, 0); + Patch(e.out, s); + *operandStack.template Push() = Frag(s, s, e.minIndex); + return true; + } + return false; + + case kOneOrMore: + if (operandStack.GetSize() >= sizeof(Frag)) { + Frag e = *operandStack.template Pop(1); + SizeType s = NewState(kRegexInvalidState, e.start, 0); + Patch(e.out, s); + *operandStack.template Push() = Frag(e.start, s, e.minIndex); + return true; + } + return false; + + default: + // syntax error (e.g. unclosed kLeftParenthesis) + return false; + } + } + + bool EvalQuantifier(Stack& operandStack, unsigned n, unsigned m) { + RAPIDJSON_ASSERT(n <= m); + RAPIDJSON_ASSERT(operandStack.GetSize() >= sizeof(Frag)); + + if (n == 0) { + if (m == 0) // a{0} not support + return false; + else if (m == kInfinityQuantifier) + Eval(operandStack, kZeroOrMore); // a{0,} -> a* + else { + Eval(operandStack, kZeroOrOne); // a{0,5} -> a? + for (unsigned i = 0; i < m - 1; i++) + CloneTopOperand(operandStack); // a{0,5} -> a? a? a? a? a? + for (unsigned i = 0; i < m - 1; i++) + Eval(operandStack, kConcatenation); // a{0,5} -> a?a?a?a?a? + } + return true; + } + + for (unsigned i = 0; i < n - 1; i++) // a{3} -> a a a + CloneTopOperand(operandStack); + + if (m == kInfinityQuantifier) + Eval(operandStack, kOneOrMore); // a{3,} -> a a a+ + else if (m > n) { + CloneTopOperand(operandStack); // a{3,5} -> a a a a + Eval(operandStack, kZeroOrOne); // a{3,5} -> a a a a? + for (unsigned i = n; i < m - 1; i++) + CloneTopOperand(operandStack); // a{3,5} -> a a a a? a? + for (unsigned i = n; i < m; i++) + Eval(operandStack, kConcatenation); // a{3,5} -> a a aa?a? + } + + for (unsigned i = 0; i < n - 1; i++) + Eval(operandStack, kConcatenation); // a{3} -> aaa, a{3,} -> aaa+, a{3.5} -> aaaa?a? + + return true; + } + + static SizeType Min(SizeType a, SizeType b) { return a < b ? a : b; } + + void CloneTopOperand(Stack& operandStack) { + const Frag src = *operandStack.template Top(); // Copy constructor to prevent invalidation + SizeType count = stateCount_ - src.minIndex; // Assumes top operand contains states in [src->minIndex, stateCount_) + State* s = states_.template Push(count); + memcpy(s, &GetState(src.minIndex), count * sizeof(State)); + for (SizeType j = 0; j < count; j++) { + if (s[j].out != kRegexInvalidState) + s[j].out += count; + if (s[j].out1 != kRegexInvalidState) + s[j].out1 += count; + } + *operandStack.template Push() = Frag(src.start + count, src.out + count, src.minIndex + count); + stateCount_ += count; + } + + template + bool ParseUnsigned(DecodedStream& ds, unsigned* u) { + unsigned r = 0; + if (ds.Peek() < '0' || ds.Peek() > '9') + return false; + while (ds.Peek() >= '0' && ds.Peek() <= '9') { + if (r >= 429496729 && ds.Peek() > '5') // 2^32 - 1 = 4294967295 + return false; // overflow + r = r * 10 + (ds.Take() - '0'); + } + *u = r; + return true; + } + + template + bool ParseRange(DecodedStream& ds, SizeType* range) { + bool isBegin = true; + bool negate = false; + int step = 0; + SizeType start = kRegexInvalidRange; + SizeType current = kRegexInvalidRange; + unsigned codepoint; + while ((codepoint = ds.Take()) != 0) { + if (isBegin) { + isBegin = false; + if (codepoint == '^') { + negate = true; + continue; + } + } + + switch (codepoint) { + case ']': + if (start == kRegexInvalidRange) + return false; // Error: nothing inside [] + if (step == 2) { // Add trailing '-' + SizeType r = NewRange('-'); + RAPIDJSON_ASSERT(current != kRegexInvalidRange); + GetRange(current).next = r; + } + if (negate) + GetRange(start).start |= kRangeNegationFlag; + *range = start; + return true; + + case '\\': + if (ds.Peek() == 'b') { + ds.Take(); + codepoint = 0x0008; // Escape backspace character + } + else if (!CharacterEscape(ds, &codepoint)) + return false; + // fall through to default + RAPIDJSON_DELIBERATE_FALLTHROUGH; + + default: + switch (step) { + case 1: + if (codepoint == '-') { + step++; + break; + } + // fall through to step 0 for other characters + RAPIDJSON_DELIBERATE_FALLTHROUGH; + + case 0: + { + SizeType r = NewRange(codepoint); + if (current != kRegexInvalidRange) + GetRange(current).next = r; + if (start == kRegexInvalidRange) + start = r; + current = r; + } + step = 1; + break; + + default: + RAPIDJSON_ASSERT(step == 2); + GetRange(current).end = codepoint; + step = 0; + } + } + } + return false; + } + + SizeType NewRange(unsigned codepoint) { + Range* r = ranges_.template Push(); + r->start = r->end = codepoint; + r->next = kRegexInvalidRange; + return rangeCount_++; + } + + template + bool CharacterEscape(DecodedStream& ds, unsigned* escapedCodepoint) { + unsigned codepoint; + switch (codepoint = ds.Take()) { + case '^': + case '$': + case '|': + case '(': + case ')': + case '?': + case '*': + case '+': + case '.': + case '[': + case ']': + case '{': + case '}': + case '\\': + *escapedCodepoint = codepoint; return true; + case 'f': *escapedCodepoint = 0x000C; return true; + case 'n': *escapedCodepoint = 0x000A; return true; + case 'r': *escapedCodepoint = 0x000D; return true; + case 't': *escapedCodepoint = 0x0009; return true; + case 'v': *escapedCodepoint = 0x000B; return true; + default: + return false; // Unsupported escape character + } + } + + Allocator* ownAllocator_; + Allocator* allocator_; + Stack states_; + Stack ranges_; + SizeType root_; + SizeType stateCount_; + SizeType rangeCount_; + + static const unsigned kInfinityQuantifier = ~0u; + + // For SearchWithAnchoring() + bool anchorBegin_; + bool anchorEnd_; +}; + +template +class GenericRegexSearch { +public: + typedef typename RegexType::EncodingType Encoding; + typedef typename Encoding::Ch Ch; + + GenericRegexSearch(const RegexType& regex, Allocator* allocator = 0) : + regex_(regex), allocator_(allocator), ownAllocator_(0), + state0_(allocator, 0), state1_(allocator, 0), stateSet_() + { + RAPIDJSON_ASSERT(regex_.IsValid()); + if (!allocator_) + ownAllocator_ = allocator_ = RAPIDJSON_NEW(Allocator)(); + stateSet_ = static_cast(allocator_->Malloc(GetStateSetSize())); + state0_.template Reserve(regex_.stateCount_); + state1_.template Reserve(regex_.stateCount_); + } + + ~GenericRegexSearch() { + Allocator::Free(stateSet_); + RAPIDJSON_DELETE(ownAllocator_); + } + + template + bool Match(InputStream& is) { + return SearchWithAnchoring(is, true, true); + } + + bool Match(const Ch* s) { + GenericStringStream is(s); + return Match(is); + } + + template + bool Search(InputStream& is) { + return SearchWithAnchoring(is, regex_.anchorBegin_, regex_.anchorEnd_); + } + + bool Search(const Ch* s) { + GenericStringStream is(s); + return Search(is); + } + +private: + typedef typename RegexType::State State; + typedef typename RegexType::Range Range; + + template + bool SearchWithAnchoring(InputStream& is, bool anchorBegin, bool anchorEnd) { + DecodedStream ds(is); + + state0_.Clear(); + Stack *current = &state0_, *next = &state1_; + const size_t stateSetSize = GetStateSetSize(); + std::memset(stateSet_, 0, stateSetSize); + + bool matched = AddState(*current, regex_.root_); + unsigned codepoint; + while (!current->Empty() && (codepoint = ds.Take()) != 0) { + std::memset(stateSet_, 0, stateSetSize); + next->Clear(); + matched = false; + for (const SizeType* s = current->template Bottom(); s != current->template End(); ++s) { + const State& sr = regex_.GetState(*s); + if (sr.codepoint == codepoint || + sr.codepoint == RegexType::kAnyCharacterClass || + (sr.codepoint == RegexType::kRangeCharacterClass && MatchRange(sr.rangeStart, codepoint))) + { + matched = AddState(*next, sr.out) || matched; + if (!anchorEnd && matched) + return true; + } + if (!anchorBegin) + AddState(*next, regex_.root_); + } + internal::Swap(current, next); + } + + return matched; + } + + size_t GetStateSetSize() const { + return (regex_.stateCount_ + 31) / 32 * 4; + } + + // Return whether the added states is a match state + bool AddState(Stack& l, SizeType index) { + RAPIDJSON_ASSERT(index != kRegexInvalidState); + + const State& s = regex_.GetState(index); + if (s.out1 != kRegexInvalidState) { // Split + bool matched = AddState(l, s.out); + return AddState(l, s.out1) || matched; + } + else if (!(stateSet_[index >> 5] & (1u << (index & 31)))) { + stateSet_[index >> 5] |= (1u << (index & 31)); + *l.template PushUnsafe() = index; + } + return s.out == kRegexInvalidState; // by using PushUnsafe() above, we can ensure s is not validated due to reallocation. + } + + bool MatchRange(SizeType rangeIndex, unsigned codepoint) const { + bool yes = (regex_.GetRange(rangeIndex).start & RegexType::kRangeNegationFlag) == 0; + while (rangeIndex != kRegexInvalidRange) { + const Range& r = regex_.GetRange(rangeIndex); + if (codepoint >= (r.start & ~RegexType::kRangeNegationFlag) && codepoint <= r.end) + return yes; + rangeIndex = r.next; + } + return !yes; + } + + const RegexType& regex_; + Allocator* allocator_; + Allocator* ownAllocator_; + Stack state0_; + Stack state1_; + uint32_t* stateSet_; +}; + +typedef GenericRegex > Regex; +typedef GenericRegexSearch RegexSearch; + +} // namespace internal +RAPIDJSON_NAMESPACE_END + +#ifdef __GNUC__ +RAPIDJSON_DIAG_POP +#endif + +#if defined(__clang__) || defined(_MSC_VER) +RAPIDJSON_DIAG_POP +#endif + +#endif // RAPIDJSON_INTERNAL_REGEX_H_ diff --git a/DFL_BOM_WL_TOERP/rapidjson/internal/stack.h b/DFL_BOM_WL_TOERP/rapidjson/internal/stack.h new file mode 100644 index 0000000..73abd70 --- /dev/null +++ b/DFL_BOM_WL_TOERP/rapidjson/internal/stack.h @@ -0,0 +1,232 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +#ifndef RAPIDJSON_INTERNAL_STACK_H_ +#define RAPIDJSON_INTERNAL_STACK_H_ + +#include "../allocators.h" +#include "swap.h" +#include + +#if defined(__clang__) +RAPIDJSON_DIAG_PUSH +RAPIDJSON_DIAG_OFF(c++98-compat) +#endif + +RAPIDJSON_NAMESPACE_BEGIN +namespace internal { + +/////////////////////////////////////////////////////////////////////////////// +// Stack + +//! A type-unsafe stack for storing different types of data. +/*! \tparam Allocator Allocator for allocating stack memory. +*/ +template +class Stack { +public: + // Optimization note: Do not allocate memory for stack_ in constructor. + // Do it lazily when first Push() -> Expand() -> Resize(). + Stack(Allocator* allocator, size_t stackCapacity) : allocator_(allocator), ownAllocator_(0), stack_(0), stackTop_(0), stackEnd_(0), initialCapacity_(stackCapacity) { + } + +#if RAPIDJSON_HAS_CXX11_RVALUE_REFS + Stack(Stack&& rhs) + : allocator_(rhs.allocator_), + ownAllocator_(rhs.ownAllocator_), + stack_(rhs.stack_), + stackTop_(rhs.stackTop_), + stackEnd_(rhs.stackEnd_), + initialCapacity_(rhs.initialCapacity_) + { + rhs.allocator_ = 0; + rhs.ownAllocator_ = 0; + rhs.stack_ = 0; + rhs.stackTop_ = 0; + rhs.stackEnd_ = 0; + rhs.initialCapacity_ = 0; + } +#endif + + ~Stack() { + Destroy(); + } + +#if RAPIDJSON_HAS_CXX11_RVALUE_REFS + Stack& operator=(Stack&& rhs) { + if (&rhs != this) + { + Destroy(); + + allocator_ = rhs.allocator_; + ownAllocator_ = rhs.ownAllocator_; + stack_ = rhs.stack_; + stackTop_ = rhs.stackTop_; + stackEnd_ = rhs.stackEnd_; + initialCapacity_ = rhs.initialCapacity_; + + rhs.allocator_ = 0; + rhs.ownAllocator_ = 0; + rhs.stack_ = 0; + rhs.stackTop_ = 0; + rhs.stackEnd_ = 0; + rhs.initialCapacity_ = 0; + } + return *this; + } +#endif + + void Swap(Stack& rhs) RAPIDJSON_NOEXCEPT { + internal::Swap(allocator_, rhs.allocator_); + internal::Swap(ownAllocator_, rhs.ownAllocator_); + internal::Swap(stack_, rhs.stack_); + internal::Swap(stackTop_, rhs.stackTop_); + internal::Swap(stackEnd_, rhs.stackEnd_); + internal::Swap(initialCapacity_, rhs.initialCapacity_); + } + + void Clear() { stackTop_ = stack_; } + + void ShrinkToFit() { + if (Empty()) { + // If the stack is empty, completely deallocate the memory. + Allocator::Free(stack_); // NOLINT (+clang-analyzer-unix.Malloc) + stack_ = 0; + stackTop_ = 0; + stackEnd_ = 0; + } + else + Resize(GetSize()); + } + + // Optimization note: try to minimize the size of this function for force inline. + // Expansion is run very infrequently, so it is moved to another (probably non-inline) function. + template + RAPIDJSON_FORCEINLINE void Reserve(size_t count = 1) { + // Expand the stack if needed + if (RAPIDJSON_UNLIKELY(static_cast(sizeof(T) * count) > (stackEnd_ - stackTop_))) + Expand(count); + } + + template + RAPIDJSON_FORCEINLINE T* Push(size_t count = 1) { + Reserve(count); + return PushUnsafe(count); + } + + template + RAPIDJSON_FORCEINLINE T* PushUnsafe(size_t count = 1) { + RAPIDJSON_ASSERT(stackTop_); + RAPIDJSON_ASSERT(static_cast(sizeof(T) * count) <= (stackEnd_ - stackTop_)); + T* ret = reinterpret_cast(stackTop_); + stackTop_ += sizeof(T) * count; + return ret; + } + + template + T* Pop(size_t count) { + RAPIDJSON_ASSERT(GetSize() >= count * sizeof(T)); + stackTop_ -= count * sizeof(T); + return reinterpret_cast(stackTop_); + } + + template + T* Top() { + RAPIDJSON_ASSERT(GetSize() >= sizeof(T)); + return reinterpret_cast(stackTop_ - sizeof(T)); + } + + template + const T* Top() const { + RAPIDJSON_ASSERT(GetSize() >= sizeof(T)); + return reinterpret_cast(stackTop_ - sizeof(T)); + } + + template + T* End() { return reinterpret_cast(stackTop_); } + + template + const T* End() const { return reinterpret_cast(stackTop_); } + + template + T* Bottom() { return reinterpret_cast(stack_); } + + template + const T* Bottom() const { return reinterpret_cast(stack_); } + + bool HasAllocator() const { + return allocator_ != 0; + } + + Allocator& GetAllocator() { + RAPIDJSON_ASSERT(allocator_); + return *allocator_; + } + + bool Empty() const { return stackTop_ == stack_; } + size_t GetSize() const { return static_cast(stackTop_ - stack_); } + size_t GetCapacity() const { return static_cast(stackEnd_ - stack_); } + +private: + template + void Expand(size_t count) { + // Only expand the capacity if the current stack exists. Otherwise just create a stack with initial capacity. + size_t newCapacity; + if (stack_ == 0) { + if (!allocator_) + ownAllocator_ = allocator_ = RAPIDJSON_NEW(Allocator)(); + newCapacity = initialCapacity_; + } else { + newCapacity = GetCapacity(); + newCapacity += (newCapacity + 1) / 2; + } + size_t newSize = GetSize() + sizeof(T) * count; + if (newCapacity < newSize) + newCapacity = newSize; + + Resize(newCapacity); + } + + void Resize(size_t newCapacity) { + const size_t size = GetSize(); // Backup the current size + stack_ = static_cast(allocator_->Realloc(stack_, GetCapacity(), newCapacity)); + stackTop_ = stack_ + size; + stackEnd_ = stack_ + newCapacity; + } + + void Destroy() { + Allocator::Free(stack_); + RAPIDJSON_DELETE(ownAllocator_); // Only delete if it is owned by the stack + } + + // Prohibit copy constructor & assignment operator. + Stack(const Stack&); + Stack& operator=(const Stack&); + + Allocator* allocator_; + Allocator* ownAllocator_; + char *stack_; + char *stackTop_; + char *stackEnd_; + size_t initialCapacity_; +}; + +} // namespace internal +RAPIDJSON_NAMESPACE_END + +#if defined(__clang__) +RAPIDJSON_DIAG_POP +#endif + +#endif // RAPIDJSON_STACK_H_ diff --git a/DFL_BOM_WL_TOERP/rapidjson/internal/strfunc.h b/DFL_BOM_WL_TOERP/rapidjson/internal/strfunc.h new file mode 100644 index 0000000..b698a8f --- /dev/null +++ b/DFL_BOM_WL_TOERP/rapidjson/internal/strfunc.h @@ -0,0 +1,83 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +#ifndef RAPIDJSON_INTERNAL_STRFUNC_H_ +#define RAPIDJSON_INTERNAL_STRFUNC_H_ + +#include "../stream.h" +#include + +RAPIDJSON_NAMESPACE_BEGIN +namespace internal { + +//! Custom strlen() which works on different character types. +/*! \tparam Ch Character type (e.g. char, wchar_t, short) + \param s Null-terminated input string. + \return Number of characters in the string. + \note This has the same semantics as strlen(), the return value is not number of Unicode codepoints. +*/ +template +inline SizeType StrLen(const Ch* s) { + RAPIDJSON_ASSERT(s != 0); + const Ch* p = s; + while (*p) ++p; + return SizeType(p - s); +} + +template <> +inline SizeType StrLen(const char* s) { + return SizeType(std::strlen(s)); +} + +template <> +inline SizeType StrLen(const wchar_t* s) { + return SizeType(std::wcslen(s)); +} + +//! Custom strcmpn() which works on different character types. +/*! \tparam Ch Character type (e.g. char, wchar_t, short) + \param s1 Null-terminated input string. + \param s2 Null-terminated input string. + \return 0 if equal +*/ +template +inline int StrCmp(const Ch* s1, const Ch* s2) { + RAPIDJSON_ASSERT(s1 != 0); + RAPIDJSON_ASSERT(s2 != 0); + while(*s1 && (*s1 == *s2)) { s1++; s2++; } + return static_cast(*s1) < static_cast(*s2) ? -1 : static_cast(*s1) > static_cast(*s2); +} + +//! Returns number of code points in a encoded string. +template +bool CountStringCodePoint(const typename Encoding::Ch* s, SizeType length, SizeType* outCount) { + RAPIDJSON_ASSERT(s != 0); + RAPIDJSON_ASSERT(outCount != 0); + GenericStringStream is(s); + const typename Encoding::Ch* end = s + length; + SizeType count = 0; + while (is.src_ < end) { + unsigned codepoint; + if (!Encoding::Decode(is, &codepoint)) + return false; + count++; + } + *outCount = count; + return true; +} + +} // namespace internal +RAPIDJSON_NAMESPACE_END + +#endif // RAPIDJSON_INTERNAL_STRFUNC_H_ diff --git a/DFL_BOM_WL_TOERP/rapidjson/internal/strtod.h b/DFL_BOM_WL_TOERP/rapidjson/internal/strtod.h new file mode 100644 index 0000000..55f0e38 --- /dev/null +++ b/DFL_BOM_WL_TOERP/rapidjson/internal/strtod.h @@ -0,0 +1,293 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +#ifndef RAPIDJSON_STRTOD_ +#define RAPIDJSON_STRTOD_ + +#include "ieee754.h" +#include "biginteger.h" +#include "diyfp.h" +#include "pow10.h" +#include +#include + +RAPIDJSON_NAMESPACE_BEGIN +namespace internal { + +inline double FastPath(double significand, int exp) { + if (exp < -308) + return 0.0; + else if (exp >= 0) + return significand * internal::Pow10(exp); + else + return significand / internal::Pow10(-exp); +} + +inline double StrtodNormalPrecision(double d, int p) { + if (p < -308) { + // Prevent expSum < -308, making Pow10(p) = 0 + d = FastPath(d, -308); + d = FastPath(d, p + 308); + } + else + d = FastPath(d, p); + return d; +} + +template +inline T Min3(T a, T b, T c) { + T m = a; + if (m > b) m = b; + if (m > c) m = c; + return m; +} + +inline int CheckWithinHalfULP(double b, const BigInteger& d, int dExp) { + const Double db(b); + const uint64_t bInt = db.IntegerSignificand(); + const int bExp = db.IntegerExponent(); + const int hExp = bExp - 1; + + int dS_Exp2 = 0, dS_Exp5 = 0, bS_Exp2 = 0, bS_Exp5 = 0, hS_Exp2 = 0, hS_Exp5 = 0; + + // Adjust for decimal exponent + if (dExp >= 0) { + dS_Exp2 += dExp; + dS_Exp5 += dExp; + } + else { + bS_Exp2 -= dExp; + bS_Exp5 -= dExp; + hS_Exp2 -= dExp; + hS_Exp5 -= dExp; + } + + // Adjust for binary exponent + if (bExp >= 0) + bS_Exp2 += bExp; + else { + dS_Exp2 -= bExp; + hS_Exp2 -= bExp; + } + + // Adjust for half ulp exponent + if (hExp >= 0) + hS_Exp2 += hExp; + else { + dS_Exp2 -= hExp; + bS_Exp2 -= hExp; + } + + // Remove common power of two factor from all three scaled values + int common_Exp2 = Min3(dS_Exp2, bS_Exp2, hS_Exp2); + dS_Exp2 -= common_Exp2; + bS_Exp2 -= common_Exp2; + hS_Exp2 -= common_Exp2; + + BigInteger dS = d; + dS.MultiplyPow5(static_cast(dS_Exp5)) <<= static_cast(dS_Exp2); + + BigInteger bS(bInt); + bS.MultiplyPow5(static_cast(bS_Exp5)) <<= static_cast(bS_Exp2); + + BigInteger hS(1); + hS.MultiplyPow5(static_cast(hS_Exp5)) <<= static_cast(hS_Exp2); + + BigInteger delta(0); + dS.Difference(bS, &delta); + + return delta.Compare(hS); +} + +inline bool StrtodFast(double d, int p, double* result) { + // Use fast path for string-to-double conversion if possible + // see http://www.exploringbinary.com/fast-path-decimal-to-floating-point-conversion/ + if (p > 22 && p < 22 + 16) { + // Fast Path Cases In Disguise + d *= internal::Pow10(p - 22); + p = 22; + } + + if (p >= -22 && p <= 22 && d <= 9007199254740991.0) { // 2^53 - 1 + *result = FastPath(d, p); + return true; + } + else + return false; +} + +// Compute an approximation and see if it is within 1/2 ULP +template +inline bool StrtodDiyFp(const Ch* decimals, int dLen, int dExp, double* result) { + uint64_t significand = 0; + int i = 0; // 2^64 - 1 = 18446744073709551615, 1844674407370955161 = 0x1999999999999999 + for (; i < dLen; i++) { + if (significand > RAPIDJSON_UINT64_C2(0x19999999, 0x99999999) || + (significand == RAPIDJSON_UINT64_C2(0x19999999, 0x99999999) && decimals[i] > Ch('5'))) + break; + significand = significand * 10u + static_cast(decimals[i] - Ch('0')); + } + + if (i < dLen && decimals[i] >= Ch('5')) // Rounding + significand++; + + int remaining = dLen - i; + const int kUlpShift = 3; + const int kUlp = 1 << kUlpShift; + int64_t error = (remaining == 0) ? 0 : kUlp / 2; + + DiyFp v(significand, 0); + v = v.Normalize(); + error <<= -v.e; + + dExp += remaining; + + int actualExp; + DiyFp cachedPower = GetCachedPower10(dExp, &actualExp); + if (actualExp != dExp) { + static const DiyFp kPow10[] = { + DiyFp(RAPIDJSON_UINT64_C2(0xa0000000, 0x00000000), -60), // 10^1 + DiyFp(RAPIDJSON_UINT64_C2(0xc8000000, 0x00000000), -57), // 10^2 + DiyFp(RAPIDJSON_UINT64_C2(0xfa000000, 0x00000000), -54), // 10^3 + DiyFp(RAPIDJSON_UINT64_C2(0x9c400000, 0x00000000), -50), // 10^4 + DiyFp(RAPIDJSON_UINT64_C2(0xc3500000, 0x00000000), -47), // 10^5 + DiyFp(RAPIDJSON_UINT64_C2(0xf4240000, 0x00000000), -44), // 10^6 + DiyFp(RAPIDJSON_UINT64_C2(0x98968000, 0x00000000), -40) // 10^7 + }; + int adjustment = dExp - actualExp; + RAPIDJSON_ASSERT(adjustment >= 1 && adjustment < 8); + v = v * kPow10[adjustment - 1]; + if (dLen + adjustment > 19) // has more digits than decimal digits in 64-bit + error += kUlp / 2; + } + + v = v * cachedPower; + + error += kUlp + (error == 0 ? 0 : 1); + + const int oldExp = v.e; + v = v.Normalize(); + error <<= oldExp - v.e; + + const int effectiveSignificandSize = Double::EffectiveSignificandSize(64 + v.e); + int precisionSize = 64 - effectiveSignificandSize; + if (precisionSize + kUlpShift >= 64) { + int scaleExp = (precisionSize + kUlpShift) - 63; + v.f >>= scaleExp; + v.e += scaleExp; + error = (error >> scaleExp) + 1 + kUlp; + precisionSize -= scaleExp; + } + + DiyFp rounded(v.f >> precisionSize, v.e + precisionSize); + const uint64_t precisionBits = (v.f & ((uint64_t(1) << precisionSize) - 1)) * kUlp; + const uint64_t halfWay = (uint64_t(1) << (precisionSize - 1)) * kUlp; + if (precisionBits >= halfWay + static_cast(error)) { + rounded.f++; + if (rounded.f & (DiyFp::kDpHiddenBit << 1)) { // rounding overflows mantissa (issue #340) + rounded.f >>= 1; + rounded.e++; + } + } + + *result = rounded.ToDouble(); + + return halfWay - static_cast(error) >= precisionBits || precisionBits >= halfWay + static_cast(error); +} + +template +inline double StrtodBigInteger(double approx, const Ch* decimals, int dLen, int dExp) { + RAPIDJSON_ASSERT(dLen >= 0); + const BigInteger dInt(decimals, static_cast(dLen)); + Double a(approx); + int cmp = CheckWithinHalfULP(a.Value(), dInt, dExp); + if (cmp < 0) + return a.Value(); // within half ULP + else if (cmp == 0) { + // Round towards even + if (a.Significand() & 1) + return a.NextPositiveDouble(); + else + return a.Value(); + } + else // adjustment + return a.NextPositiveDouble(); +} + +template +inline double StrtodFullPrecision(double d, int p, const Ch* decimals, size_t length, size_t decimalPosition, int exp) { + RAPIDJSON_ASSERT(d >= 0.0); + RAPIDJSON_ASSERT(length >= 1); + + double result = 0.0; + if (StrtodFast(d, p, &result)) + return result; + + RAPIDJSON_ASSERT(length <= INT_MAX); + int dLen = static_cast(length); + + RAPIDJSON_ASSERT(length >= decimalPosition); + RAPIDJSON_ASSERT(length - decimalPosition <= INT_MAX); + int dExpAdjust = static_cast(length - decimalPosition); + + RAPIDJSON_ASSERT(exp >= INT_MIN + dExpAdjust); + int dExp = exp - dExpAdjust; + + // Make sure length+dExp does not overflow + RAPIDJSON_ASSERT(dExp <= INT_MAX - dLen); + + // Trim leading zeros + while (dLen > 0 && *decimals == '0') { + dLen--; + decimals++; + } + + // Trim trailing zeros + while (dLen > 0 && decimals[dLen - 1] == '0') { + dLen--; + dExp++; + } + + if (dLen == 0) { // Buffer only contains zeros. + return 0.0; + } + + // Trim right-most digits + const int kMaxDecimalDigit = 767 + 1; + if (dLen > kMaxDecimalDigit) { + dExp += dLen - kMaxDecimalDigit; + dLen = kMaxDecimalDigit; + } + + // If too small, underflow to zero. + // Any x <= 10^-324 is interpreted as zero. + if (dLen + dExp <= -324) + return 0.0; + + // If too large, overflow to infinity. + // Any x >= 10^309 is interpreted as +infinity. + if (dLen + dExp > 309) + return std::numeric_limits::infinity(); + + if (StrtodDiyFp(decimals, dLen, dExp, &result)) + return result; + + // Use approximation from StrtodDiyFp and make adjustment with BigInteger comparison + return StrtodBigInteger(result, decimals, dLen, dExp); +} + +} // namespace internal +RAPIDJSON_NAMESPACE_END + +#endif // RAPIDJSON_STRTOD_ diff --git a/DFL_BOM_WL_TOERP/rapidjson/internal/swap.h b/DFL_BOM_WL_TOERP/rapidjson/internal/swap.h new file mode 100644 index 0000000..2cf92f9 --- /dev/null +++ b/DFL_BOM_WL_TOERP/rapidjson/internal/swap.h @@ -0,0 +1,46 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +#ifndef RAPIDJSON_INTERNAL_SWAP_H_ +#define RAPIDJSON_INTERNAL_SWAP_H_ + +#include "../rapidjson.h" + +#if defined(__clang__) +RAPIDJSON_DIAG_PUSH +RAPIDJSON_DIAG_OFF(c++98-compat) +#endif + +RAPIDJSON_NAMESPACE_BEGIN +namespace internal { + +//! Custom swap() to avoid dependency on C++ header +/*! \tparam T Type of the arguments to swap, should be instantiated with primitive C++ types only. + \note This has the same semantics as std::swap(). +*/ +template +inline void Swap(T& a, T& b) RAPIDJSON_NOEXCEPT { + T tmp = a; + a = b; + b = tmp; +} + +} // namespace internal +RAPIDJSON_NAMESPACE_END + +#if defined(__clang__) +RAPIDJSON_DIAG_POP +#endif + +#endif // RAPIDJSON_INTERNAL_SWAP_H_ diff --git a/DFL_BOM_WL_TOERP/rapidjson/istreamwrapper.h b/DFL_BOM_WL_TOERP/rapidjson/istreamwrapper.h new file mode 100644 index 0000000..01437ec --- /dev/null +++ b/DFL_BOM_WL_TOERP/rapidjson/istreamwrapper.h @@ -0,0 +1,128 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +#ifndef RAPIDJSON_ISTREAMWRAPPER_H_ +#define RAPIDJSON_ISTREAMWRAPPER_H_ + +#include "stream.h" +#include +#include + +#ifdef __clang__ +RAPIDJSON_DIAG_PUSH +RAPIDJSON_DIAG_OFF(padded) +#elif defined(_MSC_VER) +RAPIDJSON_DIAG_PUSH +RAPIDJSON_DIAG_OFF(4351) // new behavior: elements of array 'array' will be default initialized +#endif + +RAPIDJSON_NAMESPACE_BEGIN + +//! Wrapper of \c std::basic_istream into RapidJSON's Stream concept. +/*! + The classes can be wrapped including but not limited to: + + - \c std::istringstream + - \c std::stringstream + - \c std::wistringstream + - \c std::wstringstream + - \c std::ifstream + - \c std::fstream + - \c std::wifstream + - \c std::wfstream + + \tparam StreamType Class derived from \c std::basic_istream. +*/ + +template +class BasicIStreamWrapper { +public: + typedef typename StreamType::char_type Ch; + + //! Constructor. + /*! + \param stream stream opened for read. + */ + BasicIStreamWrapper(StreamType &stream) : stream_(stream), buffer_(peekBuffer_), bufferSize_(4), bufferLast_(0), current_(buffer_), readCount_(0), count_(0), eof_(false) { + Read(); + } + + //! Constructor. + /*! + \param stream stream opened for read. + \param buffer user-supplied buffer. + \param bufferSize size of buffer in bytes. Must >=4 bytes. + */ + BasicIStreamWrapper(StreamType &stream, char* buffer, size_t bufferSize) : stream_(stream), buffer_(buffer), bufferSize_(bufferSize), bufferLast_(0), current_(buffer_), readCount_(0), count_(0), eof_(false) { + RAPIDJSON_ASSERT(bufferSize >= 4); + Read(); + } + + Ch Peek() const { return *current_; } + Ch Take() { Ch c = *current_; Read(); return c; } + size_t Tell() const { return count_ + static_cast(current_ - buffer_); } + + // Not implemented + void Put(Ch) { RAPIDJSON_ASSERT(false); } + void Flush() { RAPIDJSON_ASSERT(false); } + Ch* PutBegin() { RAPIDJSON_ASSERT(false); return 0; } + size_t PutEnd(Ch*) { RAPIDJSON_ASSERT(false); return 0; } + + // For encoding detection only. + const Ch* Peek4() const { + return (current_ + 4 - !eof_ <= bufferLast_) ? current_ : 0; + } + +private: + BasicIStreamWrapper(); + BasicIStreamWrapper(const BasicIStreamWrapper&); + BasicIStreamWrapper& operator=(const BasicIStreamWrapper&); + + void Read() { + if (current_ < bufferLast_) + ++current_; + else if (!eof_) { + count_ += readCount_; + readCount_ = bufferSize_; + bufferLast_ = buffer_ + readCount_ - 1; + current_ = buffer_; + + if (!stream_.read(buffer_, static_cast(bufferSize_))) { + readCount_ = static_cast(stream_.gcount()); + *(bufferLast_ = buffer_ + readCount_) = '\0'; + eof_ = true; + } + } + } + + StreamType &stream_; + Ch peekBuffer_[4], *buffer_; + size_t bufferSize_; + Ch *bufferLast_; + Ch *current_; + size_t readCount_; + size_t count_; //!< Number of characters read + bool eof_; +}; + +typedef BasicIStreamWrapper IStreamWrapper; +typedef BasicIStreamWrapper WIStreamWrapper; + +#if defined(__clang__) || defined(_MSC_VER) +RAPIDJSON_DIAG_POP +#endif + +RAPIDJSON_NAMESPACE_END + +#endif // RAPIDJSON_ISTREAMWRAPPER_H_ diff --git a/DFL_BOM_WL_TOERP/rapidjson/memorybuffer.h b/DFL_BOM_WL_TOERP/rapidjson/memorybuffer.h new file mode 100644 index 0000000..ffbc41e --- /dev/null +++ b/DFL_BOM_WL_TOERP/rapidjson/memorybuffer.h @@ -0,0 +1,70 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +#ifndef RAPIDJSON_MEMORYBUFFER_H_ +#define RAPIDJSON_MEMORYBUFFER_H_ + +#include "stream.h" +#include "internal/stack.h" + +RAPIDJSON_NAMESPACE_BEGIN + +//! Represents an in-memory output byte stream. +/*! + This class is mainly for being wrapped by EncodedOutputStream or AutoUTFOutputStream. + + It is similar to FileWriteBuffer but the destination is an in-memory buffer instead of a file. + + Differences between MemoryBuffer and StringBuffer: + 1. StringBuffer has Encoding but MemoryBuffer is only a byte buffer. + 2. StringBuffer::GetString() returns a null-terminated string. MemoryBuffer::GetBuffer() returns a buffer without terminator. + + \tparam Allocator type for allocating memory buffer. + \note implements Stream concept +*/ +template +struct GenericMemoryBuffer { + typedef char Ch; // byte + + GenericMemoryBuffer(Allocator* allocator = 0, size_t capacity = kDefaultCapacity) : stack_(allocator, capacity) {} + + void Put(Ch c) { *stack_.template Push() = c; } + void Flush() {} + + void Clear() { stack_.Clear(); } + void ShrinkToFit() { stack_.ShrinkToFit(); } + Ch* Push(size_t count) { return stack_.template Push(count); } + void Pop(size_t count) { stack_.template Pop(count); } + + const Ch* GetBuffer() const { + return stack_.template Bottom(); + } + + size_t GetSize() const { return stack_.GetSize(); } + + static const size_t kDefaultCapacity = 256; + mutable internal::Stack stack_; +}; + +typedef GenericMemoryBuffer<> MemoryBuffer; + +//! Implement specialized version of PutN() with memset() for better performance. +template<> +inline void PutN(MemoryBuffer& memoryBuffer, char c, size_t n) { + std::memset(memoryBuffer.stack_.Push(n), c, n * sizeof(c)); +} + +RAPIDJSON_NAMESPACE_END + +#endif // RAPIDJSON_MEMORYBUFFER_H_ diff --git a/DFL_BOM_WL_TOERP/rapidjson/memorystream.h b/DFL_BOM_WL_TOERP/rapidjson/memorystream.h new file mode 100644 index 0000000..77af6c9 --- /dev/null +++ b/DFL_BOM_WL_TOERP/rapidjson/memorystream.h @@ -0,0 +1,71 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +#ifndef RAPIDJSON_MEMORYSTREAM_H_ +#define RAPIDJSON_MEMORYSTREAM_H_ + +#include "stream.h" + +#ifdef __clang__ +RAPIDJSON_DIAG_PUSH +RAPIDJSON_DIAG_OFF(unreachable-code) +RAPIDJSON_DIAG_OFF(missing-noreturn) +#endif + +RAPIDJSON_NAMESPACE_BEGIN + +//! Represents an in-memory input byte stream. +/*! + This class is mainly for being wrapped by EncodedInputStream or AutoUTFInputStream. + + It is similar to FileReadBuffer but the source is an in-memory buffer instead of a file. + + Differences between MemoryStream and StringStream: + 1. StringStream has encoding but MemoryStream is a byte stream. + 2. MemoryStream needs size of the source buffer and the buffer don't need to be null terminated. StringStream assume null-terminated string as source. + 3. MemoryStream supports Peek4() for encoding detection. StringStream is specified with an encoding so it should not have Peek4(). + \note implements Stream concept +*/ +struct MemoryStream { + typedef char Ch; // byte + + MemoryStream(const Ch *src, size_t size) : src_(src), begin_(src), end_(src + size), size_(size) {} + + Ch Peek() const { return RAPIDJSON_UNLIKELY(src_ == end_) ? '\0' : *src_; } + Ch Take() { return RAPIDJSON_UNLIKELY(src_ == end_) ? '\0' : *src_++; } + size_t Tell() const { return static_cast(src_ - begin_); } + + Ch* PutBegin() { RAPIDJSON_ASSERT(false); return 0; } + void Put(Ch) { RAPIDJSON_ASSERT(false); } + void Flush() { RAPIDJSON_ASSERT(false); } + size_t PutEnd(Ch*) { RAPIDJSON_ASSERT(false); return 0; } + + // For encoding detection only. + const Ch* Peek4() const { + return Tell() + 4 <= size_ ? src_ : 0; + } + + const Ch* src_; //!< Current read position. + const Ch* begin_; //!< Original head of the string. + const Ch* end_; //!< End of stream. + size_t size_; //!< Size of the stream. +}; + +RAPIDJSON_NAMESPACE_END + +#ifdef __clang__ +RAPIDJSON_DIAG_POP +#endif + +#endif // RAPIDJSON_MEMORYBUFFER_H_ diff --git a/DFL_BOM_WL_TOERP/rapidjson/msinttypes/inttypes.h b/DFL_BOM_WL_TOERP/rapidjson/msinttypes/inttypes.h new file mode 100644 index 0000000..1811128 --- /dev/null +++ b/DFL_BOM_WL_TOERP/rapidjson/msinttypes/inttypes.h @@ -0,0 +1,316 @@ +// ISO C9x compliant inttypes.h for Microsoft Visual Studio +// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124 +// +// Copyright (c) 2006-2013 Alexander Chemeris +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the product nor the names of its contributors may +// be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED +// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +/////////////////////////////////////////////////////////////////////////////// + +// The above software in this distribution may have been modified by +// THL A29 Limited ("Tencent Modifications"). +// All Tencent Modifications are Copyright (C) 2015 THL A29 Limited. + +#ifndef _MSC_VER // [ +#error "Use this header only with Microsoft Visual C++ compilers!" +#endif // _MSC_VER ] + +#ifndef _MSC_INTTYPES_H_ // [ +#define _MSC_INTTYPES_H_ + +#if _MSC_VER > 1000 +#pragma once +#endif + +#include "stdint.h" + +// miloyip: VC supports inttypes.h since VC2013 +#if _MSC_VER >= 1800 +#include +#else + +// 7.8 Format conversion of integer types + +typedef struct { + intmax_t quot; + intmax_t rem; +} imaxdiv_t; + +// 7.8.1 Macros for format specifiers + +#if !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS) // [ See footnote 185 at page 198 + +// The fprintf macros for signed integers are: +#define PRId8 "d" +#define PRIi8 "i" +#define PRIdLEAST8 "d" +#define PRIiLEAST8 "i" +#define PRIdFAST8 "d" +#define PRIiFAST8 "i" + +#define PRId16 "hd" +#define PRIi16 "hi" +#define PRIdLEAST16 "hd" +#define PRIiLEAST16 "hi" +#define PRIdFAST16 "hd" +#define PRIiFAST16 "hi" + +#define PRId32 "I32d" +#define PRIi32 "I32i" +#define PRIdLEAST32 "I32d" +#define PRIiLEAST32 "I32i" +#define PRIdFAST32 "I32d" +#define PRIiFAST32 "I32i" + +#define PRId64 "I64d" +#define PRIi64 "I64i" +#define PRIdLEAST64 "I64d" +#define PRIiLEAST64 "I64i" +#define PRIdFAST64 "I64d" +#define PRIiFAST64 "I64i" + +#define PRIdMAX "I64d" +#define PRIiMAX "I64i" + +#define PRIdPTR "Id" +#define PRIiPTR "Ii" + +// The fprintf macros for unsigned integers are: +#define PRIo8 "o" +#define PRIu8 "u" +#define PRIx8 "x" +#define PRIX8 "X" +#define PRIoLEAST8 "o" +#define PRIuLEAST8 "u" +#define PRIxLEAST8 "x" +#define PRIXLEAST8 "X" +#define PRIoFAST8 "o" +#define PRIuFAST8 "u" +#define PRIxFAST8 "x" +#define PRIXFAST8 "X" + +#define PRIo16 "ho" +#define PRIu16 "hu" +#define PRIx16 "hx" +#define PRIX16 "hX" +#define PRIoLEAST16 "ho" +#define PRIuLEAST16 "hu" +#define PRIxLEAST16 "hx" +#define PRIXLEAST16 "hX" +#define PRIoFAST16 "ho" +#define PRIuFAST16 "hu" +#define PRIxFAST16 "hx" +#define PRIXFAST16 "hX" + +#define PRIo32 "I32o" +#define PRIu32 "I32u" +#define PRIx32 "I32x" +#define PRIX32 "I32X" +#define PRIoLEAST32 "I32o" +#define PRIuLEAST32 "I32u" +#define PRIxLEAST32 "I32x" +#define PRIXLEAST32 "I32X" +#define PRIoFAST32 "I32o" +#define PRIuFAST32 "I32u" +#define PRIxFAST32 "I32x" +#define PRIXFAST32 "I32X" + +#define PRIo64 "I64o" +#define PRIu64 "I64u" +#define PRIx64 "I64x" +#define PRIX64 "I64X" +#define PRIoLEAST64 "I64o" +#define PRIuLEAST64 "I64u" +#define PRIxLEAST64 "I64x" +#define PRIXLEAST64 "I64X" +#define PRIoFAST64 "I64o" +#define PRIuFAST64 "I64u" +#define PRIxFAST64 "I64x" +#define PRIXFAST64 "I64X" + +#define PRIoMAX "I64o" +#define PRIuMAX "I64u" +#define PRIxMAX "I64x" +#define PRIXMAX "I64X" + +#define PRIoPTR "Io" +#define PRIuPTR "Iu" +#define PRIxPTR "Ix" +#define PRIXPTR "IX" + +// The fscanf macros for signed integers are: +#define SCNd8 "d" +#define SCNi8 "i" +#define SCNdLEAST8 "d" +#define SCNiLEAST8 "i" +#define SCNdFAST8 "d" +#define SCNiFAST8 "i" + +#define SCNd16 "hd" +#define SCNi16 "hi" +#define SCNdLEAST16 "hd" +#define SCNiLEAST16 "hi" +#define SCNdFAST16 "hd" +#define SCNiFAST16 "hi" + +#define SCNd32 "ld" +#define SCNi32 "li" +#define SCNdLEAST32 "ld" +#define SCNiLEAST32 "li" +#define SCNdFAST32 "ld" +#define SCNiFAST32 "li" + +#define SCNd64 "I64d" +#define SCNi64 "I64i" +#define SCNdLEAST64 "I64d" +#define SCNiLEAST64 "I64i" +#define SCNdFAST64 "I64d" +#define SCNiFAST64 "I64i" + +#define SCNdMAX "I64d" +#define SCNiMAX "I64i" + +#ifdef _WIN64 // [ +# define SCNdPTR "I64d" +# define SCNiPTR "I64i" +#else // _WIN64 ][ +# define SCNdPTR "ld" +# define SCNiPTR "li" +#endif // _WIN64 ] + +// The fscanf macros for unsigned integers are: +#define SCNo8 "o" +#define SCNu8 "u" +#define SCNx8 "x" +#define SCNX8 "X" +#define SCNoLEAST8 "o" +#define SCNuLEAST8 "u" +#define SCNxLEAST8 "x" +#define SCNXLEAST8 "X" +#define SCNoFAST8 "o" +#define SCNuFAST8 "u" +#define SCNxFAST8 "x" +#define SCNXFAST8 "X" + +#define SCNo16 "ho" +#define SCNu16 "hu" +#define SCNx16 "hx" +#define SCNX16 "hX" +#define SCNoLEAST16 "ho" +#define SCNuLEAST16 "hu" +#define SCNxLEAST16 "hx" +#define SCNXLEAST16 "hX" +#define SCNoFAST16 "ho" +#define SCNuFAST16 "hu" +#define SCNxFAST16 "hx" +#define SCNXFAST16 "hX" + +#define SCNo32 "lo" +#define SCNu32 "lu" +#define SCNx32 "lx" +#define SCNX32 "lX" +#define SCNoLEAST32 "lo" +#define SCNuLEAST32 "lu" +#define SCNxLEAST32 "lx" +#define SCNXLEAST32 "lX" +#define SCNoFAST32 "lo" +#define SCNuFAST32 "lu" +#define SCNxFAST32 "lx" +#define SCNXFAST32 "lX" + +#define SCNo64 "I64o" +#define SCNu64 "I64u" +#define SCNx64 "I64x" +#define SCNX64 "I64X" +#define SCNoLEAST64 "I64o" +#define SCNuLEAST64 "I64u" +#define SCNxLEAST64 "I64x" +#define SCNXLEAST64 "I64X" +#define SCNoFAST64 "I64o" +#define SCNuFAST64 "I64u" +#define SCNxFAST64 "I64x" +#define SCNXFAST64 "I64X" + +#define SCNoMAX "I64o" +#define SCNuMAX "I64u" +#define SCNxMAX "I64x" +#define SCNXMAX "I64X" + +#ifdef _WIN64 // [ +# define SCNoPTR "I64o" +# define SCNuPTR "I64u" +# define SCNxPTR "I64x" +# define SCNXPTR "I64X" +#else // _WIN64 ][ +# define SCNoPTR "lo" +# define SCNuPTR "lu" +# define SCNxPTR "lx" +# define SCNXPTR "lX" +#endif // _WIN64 ] + +#endif // __STDC_FORMAT_MACROS ] + +// 7.8.2 Functions for greatest-width integer types + +// 7.8.2.1 The imaxabs function +#define imaxabs _abs64 + +// 7.8.2.2 The imaxdiv function + +// This is modified version of div() function from Microsoft's div.c found +// in %MSVC.NET%\crt\src\div.c +#ifdef STATIC_IMAXDIV // [ +static +#else // STATIC_IMAXDIV ][ +_inline +#endif // STATIC_IMAXDIV ] +imaxdiv_t __cdecl imaxdiv(intmax_t numer, intmax_t denom) +{ + imaxdiv_t result; + + result.quot = numer / denom; + result.rem = numer % denom; + + if (numer < 0 && result.rem > 0) { + // did division wrong; must fix up + ++result.quot; + result.rem -= denom; + } + + return result; +} + +// 7.8.2.3 The strtoimax and strtoumax functions +#define strtoimax _strtoi64 +#define strtoumax _strtoui64 + +// 7.8.2.4 The wcstoimax and wcstoumax functions +#define wcstoimax _wcstoi64 +#define wcstoumax _wcstoui64 + +#endif // _MSC_VER >= 1800 + +#endif // _MSC_INTTYPES_H_ ] diff --git a/DFL_BOM_WL_TOERP/rapidjson/msinttypes/stdint.h b/DFL_BOM_WL_TOERP/rapidjson/msinttypes/stdint.h new file mode 100644 index 0000000..3d4477b --- /dev/null +++ b/DFL_BOM_WL_TOERP/rapidjson/msinttypes/stdint.h @@ -0,0 +1,300 @@ +// ISO C9x compliant stdint.h for Microsoft Visual Studio +// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124 +// +// Copyright (c) 2006-2013 Alexander Chemeris +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the product nor the names of its contributors may +// be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED +// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +/////////////////////////////////////////////////////////////////////////////// + +// The above software in this distribution may have been modified by +// THL A29 Limited ("Tencent Modifications"). +// All Tencent Modifications are Copyright (C) 2015 THL A29 Limited. + +#ifndef _MSC_VER // [ +#error "Use this header only with Microsoft Visual C++ compilers!" +#endif // _MSC_VER ] + +#ifndef _MSC_STDINT_H_ // [ +#define _MSC_STDINT_H_ + +#if _MSC_VER > 1000 +#pragma once +#endif + +// miloyip: Originally Visual Studio 2010 uses its own stdint.h. However it generates warning with INT64_C(), so change to use this file for vs2010. +#if _MSC_VER >= 1600 // [ +#include + +#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) // [ See footnote 224 at page 260 + +#undef INT8_C +#undef INT16_C +#undef INT32_C +#undef INT64_C +#undef UINT8_C +#undef UINT16_C +#undef UINT32_C +#undef UINT64_C + +// 7.18.4.1 Macros for minimum-width integer constants + +#define INT8_C(val) val##i8 +#define INT16_C(val) val##i16 +#define INT32_C(val) val##i32 +#define INT64_C(val) val##i64 + +#define UINT8_C(val) val##ui8 +#define UINT16_C(val) val##ui16 +#define UINT32_C(val) val##ui32 +#define UINT64_C(val) val##ui64 + +// 7.18.4.2 Macros for greatest-width integer constants +// These #ifndef's are needed to prevent collisions with . +// Check out Issue 9 for the details. +#ifndef INTMAX_C // [ +# define INTMAX_C INT64_C +#endif // INTMAX_C ] +#ifndef UINTMAX_C // [ +# define UINTMAX_C UINT64_C +#endif // UINTMAX_C ] + +#endif // __STDC_CONSTANT_MACROS ] + +#else // ] _MSC_VER >= 1700 [ + +#include + +// For Visual Studio 6 in C++ mode and for many Visual Studio versions when +// compiling for ARM we have to wrap include with 'extern "C++" {}' +// or compiler would give many errors like this: +// error C2733: second C linkage of overloaded function 'wmemchr' not allowed +#if defined(__cplusplus) && !defined(_M_ARM) +extern "C" { +#endif +# include +#if defined(__cplusplus) && !defined(_M_ARM) +} +#endif + +// Define _W64 macros to mark types changing their size, like intptr_t. +#ifndef _W64 +# if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300 +# define _W64 __w64 +# else +# define _W64 +# endif +#endif + + +// 7.18.1 Integer types + +// 7.18.1.1 Exact-width integer types + +// Visual Studio 6 and Embedded Visual C++ 4 doesn't +// realize that, e.g. char has the same size as __int8 +// so we give up on __intX for them. +#if (_MSC_VER < 1300) + typedef signed char int8_t; + typedef signed short int16_t; + typedef signed int int32_t; + typedef unsigned char uint8_t; + typedef unsigned short uint16_t; + typedef unsigned int uint32_t; +#else + typedef signed __int8 int8_t; + typedef signed __int16 int16_t; + typedef signed __int32 int32_t; + typedef unsigned __int8 uint8_t; + typedef unsigned __int16 uint16_t; + typedef unsigned __int32 uint32_t; +#endif +typedef signed __int64 int64_t; +typedef unsigned __int64 uint64_t; + + +// 7.18.1.2 Minimum-width integer types +typedef int8_t int_least8_t; +typedef int16_t int_least16_t; +typedef int32_t int_least32_t; +typedef int64_t int_least64_t; +typedef uint8_t uint_least8_t; +typedef uint16_t uint_least16_t; +typedef uint32_t uint_least32_t; +typedef uint64_t uint_least64_t; + +// 7.18.1.3 Fastest minimum-width integer types +typedef int8_t int_fast8_t; +typedef int16_t int_fast16_t; +typedef int32_t int_fast32_t; +typedef int64_t int_fast64_t; +typedef uint8_t uint_fast8_t; +typedef uint16_t uint_fast16_t; +typedef uint32_t uint_fast32_t; +typedef uint64_t uint_fast64_t; + +// 7.18.1.4 Integer types capable of holding object pointers +#ifdef _WIN64 // [ + typedef signed __int64 intptr_t; + typedef unsigned __int64 uintptr_t; +#else // _WIN64 ][ + typedef _W64 signed int intptr_t; + typedef _W64 unsigned int uintptr_t; +#endif // _WIN64 ] + +// 7.18.1.5 Greatest-width integer types +typedef int64_t intmax_t; +typedef uint64_t uintmax_t; + + +// 7.18.2 Limits of specified-width integer types + +#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) // [ See footnote 220 at page 257 and footnote 221 at page 259 + +// 7.18.2.1 Limits of exact-width integer types +#define INT8_MIN ((int8_t)_I8_MIN) +#define INT8_MAX _I8_MAX +#define INT16_MIN ((int16_t)_I16_MIN) +#define INT16_MAX _I16_MAX +#define INT32_MIN ((int32_t)_I32_MIN) +#define INT32_MAX _I32_MAX +#define INT64_MIN ((int64_t)_I64_MIN) +#define INT64_MAX _I64_MAX +#define UINT8_MAX _UI8_MAX +#define UINT16_MAX _UI16_MAX +#define UINT32_MAX _UI32_MAX +#define UINT64_MAX _UI64_MAX + +// 7.18.2.2 Limits of minimum-width integer types +#define INT_LEAST8_MIN INT8_MIN +#define INT_LEAST8_MAX INT8_MAX +#define INT_LEAST16_MIN INT16_MIN +#define INT_LEAST16_MAX INT16_MAX +#define INT_LEAST32_MIN INT32_MIN +#define INT_LEAST32_MAX INT32_MAX +#define INT_LEAST64_MIN INT64_MIN +#define INT_LEAST64_MAX INT64_MAX +#define UINT_LEAST8_MAX UINT8_MAX +#define UINT_LEAST16_MAX UINT16_MAX +#define UINT_LEAST32_MAX UINT32_MAX +#define UINT_LEAST64_MAX UINT64_MAX + +// 7.18.2.3 Limits of fastest minimum-width integer types +#define INT_FAST8_MIN INT8_MIN +#define INT_FAST8_MAX INT8_MAX +#define INT_FAST16_MIN INT16_MIN +#define INT_FAST16_MAX INT16_MAX +#define INT_FAST32_MIN INT32_MIN +#define INT_FAST32_MAX INT32_MAX +#define INT_FAST64_MIN INT64_MIN +#define INT_FAST64_MAX INT64_MAX +#define UINT_FAST8_MAX UINT8_MAX +#define UINT_FAST16_MAX UINT16_MAX +#define UINT_FAST32_MAX UINT32_MAX +#define UINT_FAST64_MAX UINT64_MAX + +// 7.18.2.4 Limits of integer types capable of holding object pointers +#ifdef _WIN64 // [ +# define INTPTR_MIN INT64_MIN +# define INTPTR_MAX INT64_MAX +# define UINTPTR_MAX UINT64_MAX +#else // _WIN64 ][ +# define INTPTR_MIN INT32_MIN +# define INTPTR_MAX INT32_MAX +# define UINTPTR_MAX UINT32_MAX +#endif // _WIN64 ] + +// 7.18.2.5 Limits of greatest-width integer types +#define INTMAX_MIN INT64_MIN +#define INTMAX_MAX INT64_MAX +#define UINTMAX_MAX UINT64_MAX + +// 7.18.3 Limits of other integer types + +#ifdef _WIN64 // [ +# define PTRDIFF_MIN _I64_MIN +# define PTRDIFF_MAX _I64_MAX +#else // _WIN64 ][ +# define PTRDIFF_MIN _I32_MIN +# define PTRDIFF_MAX _I32_MAX +#endif // _WIN64 ] + +#define SIG_ATOMIC_MIN INT_MIN +#define SIG_ATOMIC_MAX INT_MAX + +#ifndef SIZE_MAX // [ +# ifdef _WIN64 // [ +# define SIZE_MAX _UI64_MAX +# else // _WIN64 ][ +# define SIZE_MAX _UI32_MAX +# endif // _WIN64 ] +#endif // SIZE_MAX ] + +// WCHAR_MIN and WCHAR_MAX are also defined in +#ifndef WCHAR_MIN // [ +# define WCHAR_MIN 0 +#endif // WCHAR_MIN ] +#ifndef WCHAR_MAX // [ +# define WCHAR_MAX _UI16_MAX +#endif // WCHAR_MAX ] + +#define WINT_MIN 0 +#define WINT_MAX _UI16_MAX + +#endif // __STDC_LIMIT_MACROS ] + + +// 7.18.4 Limits of other integer types + +#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) // [ See footnote 224 at page 260 + +// 7.18.4.1 Macros for minimum-width integer constants + +#define INT8_C(val) val##i8 +#define INT16_C(val) val##i16 +#define INT32_C(val) val##i32 +#define INT64_C(val) val##i64 + +#define UINT8_C(val) val##ui8 +#define UINT16_C(val) val##ui16 +#define UINT32_C(val) val##ui32 +#define UINT64_C(val) val##ui64 + +// 7.18.4.2 Macros for greatest-width integer constants +// These #ifndef's are needed to prevent collisions with . +// Check out Issue 9 for the details. +#ifndef INTMAX_C // [ +# define INTMAX_C INT64_C +#endif // INTMAX_C ] +#ifndef UINTMAX_C // [ +# define UINTMAX_C UINT64_C +#endif // UINTMAX_C ] + +#endif // __STDC_CONSTANT_MACROS ] + +#endif // _MSC_VER >= 1600 ] + +#endif // _MSC_STDINT_H_ ] diff --git a/DFL_BOM_WL_TOERP/rapidjson/ostreamwrapper.h b/DFL_BOM_WL_TOERP/rapidjson/ostreamwrapper.h new file mode 100644 index 0000000..11ed4d3 --- /dev/null +++ b/DFL_BOM_WL_TOERP/rapidjson/ostreamwrapper.h @@ -0,0 +1,81 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +#ifndef RAPIDJSON_OSTREAMWRAPPER_H_ +#define RAPIDJSON_OSTREAMWRAPPER_H_ + +#include "stream.h" +#include + +#ifdef __clang__ +RAPIDJSON_DIAG_PUSH +RAPIDJSON_DIAG_OFF(padded) +#endif + +RAPIDJSON_NAMESPACE_BEGIN + +//! Wrapper of \c std::basic_ostream into RapidJSON's Stream concept. +/*! + The classes can be wrapped including but not limited to: + + - \c std::ostringstream + - \c std::stringstream + - \c std::wpstringstream + - \c std::wstringstream + - \c std::ifstream + - \c std::fstream + - \c std::wofstream + - \c std::wfstream + + \tparam StreamType Class derived from \c std::basic_ostream. +*/ + +template +class BasicOStreamWrapper { +public: + typedef typename StreamType::char_type Ch; + BasicOStreamWrapper(StreamType& stream) : stream_(stream) {} + + void Put(Ch c) { + stream_.put(c); + } + + void Flush() { + stream_.flush(); + } + + // Not implemented + char Peek() const { RAPIDJSON_ASSERT(false); return 0; } + char Take() { RAPIDJSON_ASSERT(false); return 0; } + size_t Tell() const { RAPIDJSON_ASSERT(false); return 0; } + char* PutBegin() { RAPIDJSON_ASSERT(false); return 0; } + size_t PutEnd(char*) { RAPIDJSON_ASSERT(false); return 0; } + +private: + BasicOStreamWrapper(const BasicOStreamWrapper&); + BasicOStreamWrapper& operator=(const BasicOStreamWrapper&); + + StreamType& stream_; +}; + +typedef BasicOStreamWrapper OStreamWrapper; +typedef BasicOStreamWrapper WOStreamWrapper; + +#ifdef __clang__ +RAPIDJSON_DIAG_POP +#endif + +RAPIDJSON_NAMESPACE_END + +#endif // RAPIDJSON_OSTREAMWRAPPER_H_ diff --git a/DFL_BOM_WL_TOERP/rapidjson/pointer.h b/DFL_BOM_WL_TOERP/rapidjson/pointer.h new file mode 100644 index 0000000..67a9cb0 --- /dev/null +++ b/DFL_BOM_WL_TOERP/rapidjson/pointer.h @@ -0,0 +1,1482 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +#ifndef RAPIDJSON_POINTER_H_ +#define RAPIDJSON_POINTER_H_ + +#include "document.h" +#include "uri.h" +#include "internal/itoa.h" + +#ifdef __clang__ +RAPIDJSON_DIAG_PUSH +RAPIDJSON_DIAG_OFF(switch-enum) +#elif defined(_MSC_VER) +RAPIDJSON_DIAG_PUSH +RAPIDJSON_DIAG_OFF(4512) // assignment operator could not be generated +#endif + +RAPIDJSON_NAMESPACE_BEGIN + +static const SizeType kPointerInvalidIndex = ~SizeType(0); //!< Represents an invalid index in GenericPointer::Token + +//! Error code of parsing. +/*! \ingroup RAPIDJSON_ERRORS + \see GenericPointer::GenericPointer, GenericPointer::GetParseErrorCode +*/ +enum PointerParseErrorCode { + kPointerParseErrorNone = 0, //!< The parse is successful + + kPointerParseErrorTokenMustBeginWithSolidus, //!< A token must begin with a '/' + kPointerParseErrorInvalidEscape, //!< Invalid escape + kPointerParseErrorInvalidPercentEncoding, //!< Invalid percent encoding in URI fragment + kPointerParseErrorCharacterMustPercentEncode //!< A character must percent encoded in URI fragment +}; + +/////////////////////////////////////////////////////////////////////////////// +// GenericPointer + +//! Represents a JSON Pointer. Use Pointer for UTF8 encoding and default allocator. +/*! + This class implements RFC 6901 "JavaScript Object Notation (JSON) Pointer" + (https://tools.ietf.org/html/rfc6901). + + A JSON pointer is for identifying a specific value in a JSON document + (GenericDocument). It can simplify coding of DOM tree manipulation, because it + can access multiple-level depth of DOM tree with single API call. + + After it parses a string representation (e.g. "/foo/0" or URI fragment + representation (e.g. "#/foo/0") into its internal representation (tokens), + it can be used to resolve a specific value in multiple documents, or sub-tree + of documents. + + Contrary to GenericValue, Pointer can be copy constructed and copy assigned. + Apart from assignment, a Pointer cannot be modified after construction. + + Although Pointer is very convenient, please aware that constructing Pointer + involves parsing and dynamic memory allocation. A special constructor with user- + supplied tokens eliminates these. + + GenericPointer depends on GenericDocument and GenericValue. + + \tparam ValueType The value type of the DOM tree. E.g. GenericValue > + \tparam Allocator The allocator type for allocating memory for internal representation. + + \note GenericPointer uses same encoding of ValueType. + However, Allocator of GenericPointer is independent of Allocator of Value. +*/ +template +class GenericPointer { +public: + typedef typename ValueType::EncodingType EncodingType; //!< Encoding type from Value + typedef typename ValueType::Ch Ch; //!< Character type from Value + typedef GenericUri UriType; + + + //! A token is the basic units of internal representation. + /*! + A JSON pointer string representation "/foo/123" is parsed to two tokens: + "foo" and 123. 123 will be represented in both numeric form and string form. + They are resolved according to the actual value type (object or array). + + For token that are not numbers, or the numeric value is out of bound + (greater than limits of SizeType), they are only treated as string form + (i.e. the token's index will be equal to kPointerInvalidIndex). + + This struct is public so that user can create a Pointer without parsing and + allocation, using a special constructor. + */ + struct Token { + const Ch* name; //!< Name of the token. It has null character at the end but it can contain null character. + SizeType length; //!< Length of the name. + SizeType index; //!< A valid array index, if it is not equal to kPointerInvalidIndex. + }; + + //!@name Constructors and destructor. + //@{ + + //! Default constructor. + GenericPointer(Allocator* allocator = 0) : allocator_(allocator), ownAllocator_(), nameBuffer_(), tokens_(), tokenCount_(), parseErrorOffset_(), parseErrorCode_(kPointerParseErrorNone) {} + + //! Constructor that parses a string or URI fragment representation. + /*! + \param source A null-terminated, string or URI fragment representation of JSON pointer. + \param allocator User supplied allocator for this pointer. If no allocator is provided, it creates a self-owned one. + */ + explicit GenericPointer(const Ch* source, Allocator* allocator = 0) : allocator_(allocator), ownAllocator_(), nameBuffer_(), tokens_(), tokenCount_(), parseErrorOffset_(), parseErrorCode_(kPointerParseErrorNone) { + Parse(source, internal::StrLen(source)); + } + +#if RAPIDJSON_HAS_STDSTRING + //! Constructor that parses a string or URI fragment representation. + /*! + \param source A string or URI fragment representation of JSON pointer. + \param allocator User supplied allocator for this pointer. If no allocator is provided, it creates a self-owned one. + \note Requires the definition of the preprocessor symbol \ref RAPIDJSON_HAS_STDSTRING. + */ + explicit GenericPointer(const std::basic_string& source, Allocator* allocator = 0) : allocator_(allocator), ownAllocator_(), nameBuffer_(), tokens_(), tokenCount_(), parseErrorOffset_(), parseErrorCode_(kPointerParseErrorNone) { + Parse(source.c_str(), source.size()); + } +#endif + + //! Constructor that parses a string or URI fragment representation, with length of the source string. + /*! + \param source A string or URI fragment representation of JSON pointer. + \param length Length of source. + \param allocator User supplied allocator for this pointer. If no allocator is provided, it creates a self-owned one. + \note Slightly faster than the overload without length. + */ + GenericPointer(const Ch* source, size_t length, Allocator* allocator = 0) : allocator_(allocator), ownAllocator_(), nameBuffer_(), tokens_(), tokenCount_(), parseErrorOffset_(), parseErrorCode_(kPointerParseErrorNone) { + Parse(source, length); + } + + //! Constructor with user-supplied tokens. + /*! + This constructor let user supplies const array of tokens. + This prevents the parsing process and eliminates allocation. + This is preferred for memory constrained environments. + + \param tokens An constant array of tokens representing the JSON pointer. + \param tokenCount Number of tokens. + + \b Example + \code + #define NAME(s) { s, sizeof(s) / sizeof(s[0]) - 1, kPointerInvalidIndex } + #define INDEX(i) { #i, sizeof(#i) - 1, i } + + static const Pointer::Token kTokens[] = { NAME("foo"), INDEX(123) }; + static const Pointer p(kTokens, sizeof(kTokens) / sizeof(kTokens[0])); + // Equivalent to static const Pointer p("/foo/123"); + + #undef NAME + #undef INDEX + \endcode + */ + GenericPointer(const Token* tokens, size_t tokenCount) : allocator_(), ownAllocator_(), nameBuffer_(), tokens_(const_cast(tokens)), tokenCount_(tokenCount), parseErrorOffset_(), parseErrorCode_(kPointerParseErrorNone) {} + + //! Copy constructor. + GenericPointer(const GenericPointer& rhs) : allocator_(), ownAllocator_(), nameBuffer_(), tokens_(), tokenCount_(), parseErrorOffset_(), parseErrorCode_(kPointerParseErrorNone) { + *this = rhs; + } + + //! Copy constructor. + GenericPointer(const GenericPointer& rhs, Allocator* allocator) : allocator_(allocator), ownAllocator_(), nameBuffer_(), tokens_(), tokenCount_(), parseErrorOffset_(), parseErrorCode_(kPointerParseErrorNone) { + *this = rhs; + } + + //! Destructor. + ~GenericPointer() { + if (nameBuffer_) // If user-supplied tokens constructor is used, nameBuffer_ is nullptr and tokens_ are not deallocated. + Allocator::Free(tokens_); + RAPIDJSON_DELETE(ownAllocator_); + } + + //! Assignment operator. + GenericPointer& operator=(const GenericPointer& rhs) { + if (this != &rhs) { + // Do not delete ownAllcator + if (nameBuffer_) + Allocator::Free(tokens_); + + tokenCount_ = rhs.tokenCount_; + parseErrorOffset_ = rhs.parseErrorOffset_; + parseErrorCode_ = rhs.parseErrorCode_; + + if (rhs.nameBuffer_) + CopyFromRaw(rhs); // Normally parsed tokens. + else { + tokens_ = rhs.tokens_; // User supplied const tokens. + nameBuffer_ = 0; + } + } + return *this; + } + + //! Swap the content of this pointer with an other. + /*! + \param other The pointer to swap with. + \note Constant complexity. + */ + GenericPointer& Swap(GenericPointer& other) RAPIDJSON_NOEXCEPT { + internal::Swap(allocator_, other.allocator_); + internal::Swap(ownAllocator_, other.ownAllocator_); + internal::Swap(nameBuffer_, other.nameBuffer_); + internal::Swap(tokens_, other.tokens_); + internal::Swap(tokenCount_, other.tokenCount_); + internal::Swap(parseErrorOffset_, other.parseErrorOffset_); + internal::Swap(parseErrorCode_, other.parseErrorCode_); + return *this; + } + + //! free-standing swap function helper + /*! + Helper function to enable support for common swap implementation pattern based on \c std::swap: + \code + void swap(MyClass& a, MyClass& b) { + using std::swap; + swap(a.pointer, b.pointer); + // ... + } + \endcode + \see Swap() + */ + friend inline void swap(GenericPointer& a, GenericPointer& b) RAPIDJSON_NOEXCEPT { a.Swap(b); } + + //@} + + //!@name Append token + //@{ + + //! Append a token and return a new Pointer + /*! + \param token Token to be appended. + \param allocator Allocator for the newly return Pointer. + \return A new Pointer with appended token. + */ + GenericPointer Append(const Token& token, Allocator* allocator = 0) const { + GenericPointer r; + r.allocator_ = allocator; + Ch *p = r.CopyFromRaw(*this, 1, token.length + 1); + std::memcpy(p, token.name, (token.length + 1) * sizeof(Ch)); + r.tokens_[tokenCount_].name = p; + r.tokens_[tokenCount_].length = token.length; + r.tokens_[tokenCount_].index = token.index; + return r; + } + + //! Append a name token with length, and return a new Pointer + /*! + \param name Name to be appended. + \param length Length of name. + \param allocator Allocator for the newly return Pointer. + \return A new Pointer with appended token. + */ + GenericPointer Append(const Ch* name, SizeType length, Allocator* allocator = 0) const { + Token token = { name, length, kPointerInvalidIndex }; + return Append(token, allocator); + } + + //! Append a name token without length, and return a new Pointer + /*! + \param name Name (const Ch*) to be appended. + \param allocator Allocator for the newly return Pointer. + \return A new Pointer with appended token. + */ + template + RAPIDJSON_DISABLEIF_RETURN((internal::NotExpr::Type, Ch> >), (GenericPointer)) + Append(T* name, Allocator* allocator = 0) const { + return Append(name, internal::StrLen(name), allocator); + } + +#if RAPIDJSON_HAS_STDSTRING + //! Append a name token, and return a new Pointer + /*! + \param name Name to be appended. + \param allocator Allocator for the newly return Pointer. + \return A new Pointer with appended token. + */ + GenericPointer Append(const std::basic_string& name, Allocator* allocator = 0) const { + return Append(name.c_str(), static_cast(name.size()), allocator); + } +#endif + + //! Append a index token, and return a new Pointer + /*! + \param index Index to be appended. + \param allocator Allocator for the newly return Pointer. + \return A new Pointer with appended token. + */ + GenericPointer Append(SizeType index, Allocator* allocator = 0) const { + char buffer[21]; + char* end = sizeof(SizeType) == 4 ? internal::u32toa(index, buffer) : internal::u64toa(index, buffer); + SizeType length = static_cast(end - buffer); + buffer[length] = '\0'; + + if (sizeof(Ch) == 1) { + Token token = { reinterpret_cast(buffer), length, index }; + return Append(token, allocator); + } + else { + Ch name[21]; + for (size_t i = 0; i <= length; i++) + name[i] = static_cast(buffer[i]); + Token token = { name, length, index }; + return Append(token, allocator); + } + } + + //! Append a token by value, and return a new Pointer + /*! + \param token token to be appended. + \param allocator Allocator for the newly return Pointer. + \return A new Pointer with appended token. + */ + GenericPointer Append(const ValueType& token, Allocator* allocator = 0) const { + if (token.IsString()) + return Append(token.GetString(), token.GetStringLength(), allocator); + else { + RAPIDJSON_ASSERT(token.IsUint64()); + RAPIDJSON_ASSERT(token.GetUint64() <= SizeType(~0)); + return Append(static_cast(token.GetUint64()), allocator); + } + } + + //!@name Handling Parse Error + //@{ + + //! Check whether this is a valid pointer. + bool IsValid() const { return parseErrorCode_ == kPointerParseErrorNone; } + + //! Get the parsing error offset in code unit. + size_t GetParseErrorOffset() const { return parseErrorOffset_; } + + //! Get the parsing error code. + PointerParseErrorCode GetParseErrorCode() const { return parseErrorCode_; } + + //@} + + //! Get the allocator of this pointer. + Allocator& GetAllocator() { return *allocator_; } + + //!@name Tokens + //@{ + + //! Get the token array (const version only). + const Token* GetTokens() const { return tokens_; } + + //! Get the number of tokens. + size_t GetTokenCount() const { return tokenCount_; } + + //@} + + //!@name Equality/inequality operators + //@{ + + //! Equality operator. + /*! + \note When any pointers are invalid, always returns false. + */ + bool operator==(const GenericPointer& rhs) const { + if (!IsValid() || !rhs.IsValid() || tokenCount_ != rhs.tokenCount_) + return false; + + for (size_t i = 0; i < tokenCount_; i++) { + if (tokens_[i].index != rhs.tokens_[i].index || + tokens_[i].length != rhs.tokens_[i].length || + (tokens_[i].length != 0 && std::memcmp(tokens_[i].name, rhs.tokens_[i].name, sizeof(Ch)* tokens_[i].length) != 0)) + { + return false; + } + } + + return true; + } + + //! Inequality operator. + /*! + \note When any pointers are invalid, always returns true. + */ + bool operator!=(const GenericPointer& rhs) const { return !(*this == rhs); } + + //! Less than operator. + /*! + \note Invalid pointers are always greater than valid ones. + */ + bool operator<(const GenericPointer& rhs) const { + if (!IsValid()) + return false; + if (!rhs.IsValid()) + return true; + + if (tokenCount_ != rhs.tokenCount_) + return tokenCount_ < rhs.tokenCount_; + + for (size_t i = 0; i < tokenCount_; i++) { + if (tokens_[i].index != rhs.tokens_[i].index) + return tokens_[i].index < rhs.tokens_[i].index; + + if (tokens_[i].length != rhs.tokens_[i].length) + return tokens_[i].length < rhs.tokens_[i].length; + + if (int cmp = std::memcmp(tokens_[i].name, rhs.tokens_[i].name, sizeof(Ch) * tokens_[i].length)) + return cmp < 0; + } + + return false; + } + + //@} + + //!@name Stringify + //@{ + + //! Stringify the pointer into string representation. + /*! + \tparam OutputStream Type of output stream. + \param os The output stream. + */ + template + bool Stringify(OutputStream& os) const { + return Stringify(os); + } + + //! Stringify the pointer into URI fragment representation. + /*! + \tparam OutputStream Type of output stream. + \param os The output stream. + */ + template + bool StringifyUriFragment(OutputStream& os) const { + return Stringify(os); + } + + //@} + + //!@name Create value + //@{ + + //! Create a value in a subtree. + /*! + If the value is not exist, it creates all parent values and a JSON Null value. + So it always succeed and return the newly created or existing value. + + Remind that it may change types of parents according to tokens, so it + potentially removes previously stored values. For example, if a document + was an array, and "/foo" is used to create a value, then the document + will be changed to an object, and all existing array elements are lost. + + \param root Root value of a DOM subtree to be resolved. It can be any value other than document root. + \param allocator Allocator for creating the values if the specified value or its parents are not exist. + \param alreadyExist If non-null, it stores whether the resolved value is already exist. + \return The resolved newly created (a JSON Null value), or already exists value. + */ + ValueType& Create(ValueType& root, typename ValueType::AllocatorType& allocator, bool* alreadyExist = 0) const { + RAPIDJSON_ASSERT(IsValid()); + ValueType* v = &root; + bool exist = true; + for (const Token *t = tokens_; t != tokens_ + tokenCount_; ++t) { + if (v->IsArray() && t->name[0] == '-' && t->length == 1) { + v->PushBack(ValueType().Move(), allocator); + v = &((*v)[v->Size() - 1]); + exist = false; + } + else { + if (t->index == kPointerInvalidIndex) { // must be object name + if (!v->IsObject()) + v->SetObject(); // Change to Object + } + else { // object name or array index + if (!v->IsArray() && !v->IsObject()) + v->SetArray(); // Change to Array + } + + if (v->IsArray()) { + if (t->index >= v->Size()) { + v->Reserve(t->index + 1, allocator); + while (t->index >= v->Size()) + v->PushBack(ValueType().Move(), allocator); + exist = false; + } + v = &((*v)[t->index]); + } + else { + typename ValueType::MemberIterator m = v->FindMember(GenericValue(GenericStringRef(t->name, t->length))); + if (m == v->MemberEnd()) { + v->AddMember(ValueType(t->name, t->length, allocator).Move(), ValueType().Move(), allocator); + m = v->MemberEnd(); + v = &(--m)->value; // Assumes AddMember() appends at the end + exist = false; + } + else + v = &m->value; + } + } + } + + if (alreadyExist) + *alreadyExist = exist; + + return *v; + } + + //! Creates a value in a document. + /*! + \param document A document to be resolved. + \param alreadyExist If non-null, it stores whether the resolved value is already exist. + \return The resolved newly created, or already exists value. + */ + template + ValueType& Create(GenericDocument& document, bool* alreadyExist = 0) const { + return Create(document, document.GetAllocator(), alreadyExist); + } + + //@} + + //!@name Compute URI + //@{ + + //! Compute the in-scope URI for a subtree. + // For use with JSON pointers into JSON schema documents. + /*! + \param root Root value of a DOM sub-tree to be resolved. It can be any value other than document root. + \param rootUri Root URI + \param unresolvedTokenIndex If the pointer cannot resolve a token in the pointer, this parameter can obtain the index of unresolved token. + \param allocator Allocator for Uris + \return Uri if it can be resolved. Otherwise null. + + \note + There are only 3 situations when a URI cannot be resolved: + 1. A value in the path is not an array nor object. + 2. An object value does not contain the token. + 3. A token is out of range of an array value. + + Use unresolvedTokenIndex to retrieve the token index. + */ + UriType GetUri(ValueType& root, const UriType& rootUri, size_t* unresolvedTokenIndex = 0, Allocator* allocator = 0) const { + static const Ch kIdString[] = { 'i', 'd', '\0' }; + static const ValueType kIdValue(kIdString, 2); + UriType base = UriType(rootUri, allocator); + RAPIDJSON_ASSERT(IsValid()); + ValueType* v = &root; + for (const Token *t = tokens_; t != tokens_ + tokenCount_; ++t) { + switch (v->GetType()) { + case kObjectType: + { + // See if we have an id, and if so resolve with the current base + typename ValueType::MemberIterator m = v->FindMember(kIdValue); + if (m != v->MemberEnd() && (m->value).IsString()) { + UriType here = UriType(m->value, allocator).Resolve(base, allocator); + base = here; + } + m = v->FindMember(GenericValue(GenericStringRef(t->name, t->length))); + if (m == v->MemberEnd()) + break; + v = &m->value; + } + continue; + case kArrayType: + if (t->index == kPointerInvalidIndex || t->index >= v->Size()) + break; + v = &((*v)[t->index]); + continue; + default: + break; + } + + // Error: unresolved token + if (unresolvedTokenIndex) + *unresolvedTokenIndex = static_cast(t - tokens_); + return UriType(allocator); + } + return base; + } + + UriType GetUri(const ValueType& root, const UriType& rootUri, size_t* unresolvedTokenIndex = 0, Allocator* allocator = 0) const { + return GetUri(const_cast(root), rootUri, unresolvedTokenIndex, allocator); + } + + + //!@name Query value + //@{ + + //! Query a value in a subtree. + /*! + \param root Root value of a DOM sub-tree to be resolved. It can be any value other than document root. + \param unresolvedTokenIndex If the pointer cannot resolve a token in the pointer, this parameter can obtain the index of unresolved token. + \return Pointer to the value if it can be resolved. Otherwise null. + + \note + There are only 3 situations when a value cannot be resolved: + 1. A value in the path is not an array nor object. + 2. An object value does not contain the token. + 3. A token is out of range of an array value. + + Use unresolvedTokenIndex to retrieve the token index. + */ + ValueType* Get(ValueType& root, size_t* unresolvedTokenIndex = 0) const { + RAPIDJSON_ASSERT(IsValid()); + ValueType* v = &root; + for (const Token *t = tokens_; t != tokens_ + tokenCount_; ++t) { + switch (v->GetType()) { + case kObjectType: + { + typename ValueType::MemberIterator m = v->FindMember(GenericValue(GenericStringRef(t->name, t->length))); + if (m == v->MemberEnd()) + break; + v = &m->value; + } + continue; + case kArrayType: + if (t->index == kPointerInvalidIndex || t->index >= v->Size()) + break; + v = &((*v)[t->index]); + continue; + default: + break; + } + + // Error: unresolved token + if (unresolvedTokenIndex) + *unresolvedTokenIndex = static_cast(t - tokens_); + return 0; + } + return v; + } + + //! Query a const value in a const subtree. + /*! + \param root Root value of a DOM sub-tree to be resolved. It can be any value other than document root. + \return Pointer to the value if it can be resolved. Otherwise null. + */ + const ValueType* Get(const ValueType& root, size_t* unresolvedTokenIndex = 0) const { + return Get(const_cast(root), unresolvedTokenIndex); + } + + //@} + + //!@name Query a value with default + //@{ + + //! Query a value in a subtree with default value. + /*! + Similar to Get(), but if the specified value do not exists, it creates all parents and clone the default value. + So that this function always succeed. + + \param root Root value of a DOM sub-tree to be resolved. It can be any value other than document root. + \param defaultValue Default value to be cloned if the value was not exists. + \param allocator Allocator for creating the values if the specified value or its parents are not exist. + \see Create() + */ + ValueType& GetWithDefault(ValueType& root, const ValueType& defaultValue, typename ValueType::AllocatorType& allocator) const { + bool alreadyExist; + ValueType& v = Create(root, allocator, &alreadyExist); + return alreadyExist ? v : v.CopyFrom(defaultValue, allocator); + } + + //! Query a value in a subtree with default null-terminated string. + ValueType& GetWithDefault(ValueType& root, const Ch* defaultValue, typename ValueType::AllocatorType& allocator) const { + bool alreadyExist; + ValueType& v = Create(root, allocator, &alreadyExist); + return alreadyExist ? v : v.SetString(defaultValue, allocator); + } + +#if RAPIDJSON_HAS_STDSTRING + //! Query a value in a subtree with default std::basic_string. + ValueType& GetWithDefault(ValueType& root, const std::basic_string& defaultValue, typename ValueType::AllocatorType& allocator) const { + bool alreadyExist; + ValueType& v = Create(root, allocator, &alreadyExist); + return alreadyExist ? v : v.SetString(defaultValue, allocator); + } +#endif + + //! Query a value in a subtree with default primitive value. + /*! + \tparam T Either \ref Type, \c int, \c unsigned, \c int64_t, \c uint64_t, \c bool + */ + template + RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr, internal::IsGenericValue >), (ValueType&)) + GetWithDefault(ValueType& root, T defaultValue, typename ValueType::AllocatorType& allocator) const { + return GetWithDefault(root, ValueType(defaultValue).Move(), allocator); + } + + //! Query a value in a document with default value. + template + ValueType& GetWithDefault(GenericDocument& document, const ValueType& defaultValue) const { + return GetWithDefault(document, defaultValue, document.GetAllocator()); + } + + //! Query a value in a document with default null-terminated string. + template + ValueType& GetWithDefault(GenericDocument& document, const Ch* defaultValue) const { + return GetWithDefault(document, defaultValue, document.GetAllocator()); + } + +#if RAPIDJSON_HAS_STDSTRING + //! Query a value in a document with default std::basic_string. + template + ValueType& GetWithDefault(GenericDocument& document, const std::basic_string& defaultValue) const { + return GetWithDefault(document, defaultValue, document.GetAllocator()); + } +#endif + + //! Query a value in a document with default primitive value. + /*! + \tparam T Either \ref Type, \c int, \c unsigned, \c int64_t, \c uint64_t, \c bool + */ + template + RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr, internal::IsGenericValue >), (ValueType&)) + GetWithDefault(GenericDocument& document, T defaultValue) const { + return GetWithDefault(document, defaultValue, document.GetAllocator()); + } + + //@} + + //!@name Set a value + //@{ + + //! Set a value in a subtree, with move semantics. + /*! + It creates all parents if they are not exist or types are different to the tokens. + So this function always succeeds but potentially remove existing values. + + \param root Root value of a DOM sub-tree to be resolved. It can be any value other than document root. + \param value Value to be set. + \param allocator Allocator for creating the values if the specified value or its parents are not exist. + \see Create() + */ + ValueType& Set(ValueType& root, ValueType& value, typename ValueType::AllocatorType& allocator) const { + return Create(root, allocator) = value; + } + + //! Set a value in a subtree, with copy semantics. + ValueType& Set(ValueType& root, const ValueType& value, typename ValueType::AllocatorType& allocator) const { + return Create(root, allocator).CopyFrom(value, allocator); + } + + //! Set a null-terminated string in a subtree. + ValueType& Set(ValueType& root, const Ch* value, typename ValueType::AllocatorType& allocator) const { + return Create(root, allocator) = ValueType(value, allocator).Move(); + } + +#if RAPIDJSON_HAS_STDSTRING + //! Set a std::basic_string in a subtree. + ValueType& Set(ValueType& root, const std::basic_string& value, typename ValueType::AllocatorType& allocator) const { + return Create(root, allocator) = ValueType(value, allocator).Move(); + } +#endif + + //! Set a primitive value in a subtree. + /*! + \tparam T Either \ref Type, \c int, \c unsigned, \c int64_t, \c uint64_t, \c bool + */ + template + RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr, internal::IsGenericValue >), (ValueType&)) + Set(ValueType& root, T value, typename ValueType::AllocatorType& allocator) const { + return Create(root, allocator) = ValueType(value).Move(); + } + + //! Set a value in a document, with move semantics. + template + ValueType& Set(GenericDocument& document, ValueType& value) const { + return Create(document) = value; + } + + //! Set a value in a document, with copy semantics. + template + ValueType& Set(GenericDocument& document, const ValueType& value) const { + return Create(document).CopyFrom(value, document.GetAllocator()); + } + + //! Set a null-terminated string in a document. + template + ValueType& Set(GenericDocument& document, const Ch* value) const { + return Create(document) = ValueType(value, document.GetAllocator()).Move(); + } + +#if RAPIDJSON_HAS_STDSTRING + //! Sets a std::basic_string in a document. + template + ValueType& Set(GenericDocument& document, const std::basic_string& value) const { + return Create(document) = ValueType(value, document.GetAllocator()).Move(); + } +#endif + + //! Set a primitive value in a document. + /*! + \tparam T Either \ref Type, \c int, \c unsigned, \c int64_t, \c uint64_t, \c bool + */ + template + RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr, internal::IsGenericValue >), (ValueType&)) + Set(GenericDocument& document, T value) const { + return Create(document) = value; + } + + //@} + + //!@name Swap a value + //@{ + + //! Swap a value with a value in a subtree. + /*! + It creates all parents if they are not exist or types are different to the tokens. + So this function always succeeds but potentially remove existing values. + + \param root Root value of a DOM sub-tree to be resolved. It can be any value other than document root. + \param value Value to be swapped. + \param allocator Allocator for creating the values if the specified value or its parents are not exist. + \see Create() + */ + ValueType& Swap(ValueType& root, ValueType& value, typename ValueType::AllocatorType& allocator) const { + return Create(root, allocator).Swap(value); + } + + //! Swap a value with a value in a document. + template + ValueType& Swap(GenericDocument& document, ValueType& value) const { + return Create(document).Swap(value); + } + + //@} + + //! Erase a value in a subtree. + /*! + \param root Root value of a DOM sub-tree to be resolved. It can be any value other than document root. + \return Whether the resolved value is found and erased. + + \note Erasing with an empty pointer \c Pointer(""), i.e. the root, always fail and return false. + */ + bool Erase(ValueType& root) const { + RAPIDJSON_ASSERT(IsValid()); + if (tokenCount_ == 0) // Cannot erase the root + return false; + + ValueType* v = &root; + const Token* last = tokens_ + (tokenCount_ - 1); + for (const Token *t = tokens_; t != last; ++t) { + switch (v->GetType()) { + case kObjectType: + { + typename ValueType::MemberIterator m = v->FindMember(GenericValue(GenericStringRef(t->name, t->length))); + if (m == v->MemberEnd()) + return false; + v = &m->value; + } + break; + case kArrayType: + if (t->index == kPointerInvalidIndex || t->index >= v->Size()) + return false; + v = &((*v)[t->index]); + break; + default: + return false; + } + } + + switch (v->GetType()) { + case kObjectType: + return v->EraseMember(GenericStringRef(last->name, last->length)); + case kArrayType: + if (last->index == kPointerInvalidIndex || last->index >= v->Size()) + return false; + v->Erase(v->Begin() + last->index); + return true; + default: + return false; + } + } + +private: + //! Clone the content from rhs to this. + /*! + \param rhs Source pointer. + \param extraToken Extra tokens to be allocated. + \param extraNameBufferSize Extra name buffer size (in number of Ch) to be allocated. + \return Start of non-occupied name buffer, for storing extra names. + */ + Ch* CopyFromRaw(const GenericPointer& rhs, size_t extraToken = 0, size_t extraNameBufferSize = 0) { + if (!allocator_) // allocator is independently owned. + ownAllocator_ = allocator_ = RAPIDJSON_NEW(Allocator)(); + + size_t nameBufferSize = rhs.tokenCount_; // null terminators for tokens + for (Token *t = rhs.tokens_; t != rhs.tokens_ + rhs.tokenCount_; ++t) + nameBufferSize += t->length; + + tokenCount_ = rhs.tokenCount_ + extraToken; + tokens_ = static_cast(allocator_->Malloc(tokenCount_ * sizeof(Token) + (nameBufferSize + extraNameBufferSize) * sizeof(Ch))); + nameBuffer_ = reinterpret_cast(tokens_ + tokenCount_); + if (rhs.tokenCount_ > 0) { + std::memcpy(tokens_, rhs.tokens_, rhs.tokenCount_ * sizeof(Token)); + } + if (nameBufferSize > 0) { + std::memcpy(nameBuffer_, rhs.nameBuffer_, nameBufferSize * sizeof(Ch)); + } + + // Adjust pointers to name buffer + std::ptrdiff_t diff = nameBuffer_ - rhs.nameBuffer_; + for (Token *t = tokens_; t != tokens_ + rhs.tokenCount_; ++t) + t->name += diff; + + return nameBuffer_ + nameBufferSize; + } + + //! Check whether a character should be percent-encoded. + /*! + According to RFC 3986 2.3 Unreserved Characters. + \param c The character (code unit) to be tested. + */ + bool NeedPercentEncode(Ch c) const { + return !((c >= '0' && c <= '9') || (c >= 'A' && c <='Z') || (c >= 'a' && c <= 'z') || c == '-' || c == '.' || c == '_' || c =='~'); + } + + //! Parse a JSON String or its URI fragment representation into tokens. +#ifndef __clang__ // -Wdocumentation + /*! + \param source Either a JSON Pointer string, or its URI fragment representation. Not need to be null terminated. + \param length Length of the source string. + \note Source cannot be JSON String Representation of JSON Pointer, e.g. In "/\u0000", \u0000 will not be unescaped. + */ +#endif + void Parse(const Ch* source, size_t length) { + RAPIDJSON_ASSERT(source != NULL); + RAPIDJSON_ASSERT(nameBuffer_ == 0); + RAPIDJSON_ASSERT(tokens_ == 0); + + // Create own allocator if user did not supply. + if (!allocator_) + ownAllocator_ = allocator_ = RAPIDJSON_NEW(Allocator)(); + + // Count number of '/' as tokenCount + tokenCount_ = 0; + for (const Ch* s = source; s != source + length; s++) + if (*s == '/') + tokenCount_++; + + Token* token = tokens_ = static_cast(allocator_->Malloc(tokenCount_ * sizeof(Token) + length * sizeof(Ch))); + Ch* name = nameBuffer_ = reinterpret_cast(tokens_ + tokenCount_); + size_t i = 0; + + // Detect if it is a URI fragment + bool uriFragment = false; + if (source[i] == '#') { + uriFragment = true; + i++; + } + + if (i != length && source[i] != '/') { + parseErrorCode_ = kPointerParseErrorTokenMustBeginWithSolidus; + goto error; + } + + while (i < length) { + RAPIDJSON_ASSERT(source[i] == '/'); + i++; // consumes '/' + + token->name = name; + bool isNumber = true; + + while (i < length && source[i] != '/') { + Ch c = source[i]; + if (uriFragment) { + // Decoding percent-encoding for URI fragment + if (c == '%') { + PercentDecodeStream is(&source[i], source + length); + GenericInsituStringStream os(name); + Ch* begin = os.PutBegin(); + if (!Transcoder, EncodingType>().Validate(is, os) || !is.IsValid()) { + parseErrorCode_ = kPointerParseErrorInvalidPercentEncoding; + goto error; + } + size_t len = os.PutEnd(begin); + i += is.Tell() - 1; + if (len == 1) + c = *name; + else { + name += len; + isNumber = false; + i++; + continue; + } + } + else if (NeedPercentEncode(c)) { + parseErrorCode_ = kPointerParseErrorCharacterMustPercentEncode; + goto error; + } + } + + i++; + + // Escaping "~0" -> '~', "~1" -> '/' + if (c == '~') { + if (i < length) { + c = source[i]; + if (c == '0') c = '~'; + else if (c == '1') c = '/'; + else { + parseErrorCode_ = kPointerParseErrorInvalidEscape; + goto error; + } + i++; + } + else { + parseErrorCode_ = kPointerParseErrorInvalidEscape; + goto error; + } + } + + // First check for index: all of characters are digit + if (c < '0' || c > '9') + isNumber = false; + + *name++ = c; + } + token->length = static_cast(name - token->name); + if (token->length == 0) + isNumber = false; + *name++ = '\0'; // Null terminator + + // Second check for index: more than one digit cannot have leading zero + if (isNumber && token->length > 1 && token->name[0] == '0') + isNumber = false; + + // String to SizeType conversion + SizeType n = 0; + if (isNumber) { + for (size_t j = 0; j < token->length; j++) { + SizeType m = n * 10 + static_cast(token->name[j] - '0'); + if (m < n) { // overflow detection + isNumber = false; + break; + } + n = m; + } + } + + token->index = isNumber ? n : kPointerInvalidIndex; + token++; + } + + RAPIDJSON_ASSERT(name <= nameBuffer_ + length); // Should not overflow buffer + parseErrorCode_ = kPointerParseErrorNone; + return; + + error: + Allocator::Free(tokens_); + nameBuffer_ = 0; + tokens_ = 0; + tokenCount_ = 0; + parseErrorOffset_ = i; + return; + } + + //! Stringify to string or URI fragment representation. + /*! + \tparam uriFragment True for stringifying to URI fragment representation. False for string representation. + \tparam OutputStream type of output stream. + \param os The output stream. + */ + template + bool Stringify(OutputStream& os) const { + RAPIDJSON_ASSERT(IsValid()); + + if (uriFragment) + os.Put('#'); + + for (Token *t = tokens_; t != tokens_ + tokenCount_; ++t) { + os.Put('/'); + for (size_t j = 0; j < t->length; j++) { + Ch c = t->name[j]; + if (c == '~') { + os.Put('~'); + os.Put('0'); + } + else if (c == '/') { + os.Put('~'); + os.Put('1'); + } + else if (uriFragment && NeedPercentEncode(c)) { + // Transcode to UTF8 sequence + GenericStringStream source(&t->name[j]); + PercentEncodeStream target(os); + if (!Transcoder >().Validate(source, target)) + return false; + j += source.Tell() - 1; + } + else + os.Put(c); + } + } + return true; + } + + //! A helper stream for decoding a percent-encoded sequence into code unit. + /*! + This stream decodes %XY triplet into code unit (0-255). + If it encounters invalid characters, it sets output code unit as 0 and + mark invalid, and to be checked by IsValid(). + */ + class PercentDecodeStream { + public: + typedef typename ValueType::Ch Ch; + + //! Constructor + /*! + \param source Start of the stream + \param end Past-the-end of the stream. + */ + PercentDecodeStream(const Ch* source, const Ch* end) : src_(source), head_(source), end_(end), valid_(true) {} + + Ch Take() { + if (*src_ != '%' || src_ + 3 > end_) { // %XY triplet + valid_ = false; + return 0; + } + src_++; + Ch c = 0; + for (int j = 0; j < 2; j++) { + c = static_cast(c << 4); + Ch h = *src_; + if (h >= '0' && h <= '9') c = static_cast(c + h - '0'); + else if (h >= 'A' && h <= 'F') c = static_cast(c + h - 'A' + 10); + else if (h >= 'a' && h <= 'f') c = static_cast(c + h - 'a' + 10); + else { + valid_ = false; + return 0; + } + src_++; + } + return c; + } + + size_t Tell() const { return static_cast(src_ - head_); } + bool IsValid() const { return valid_; } + + private: + const Ch* src_; //!< Current read position. + const Ch* head_; //!< Original head of the string. + const Ch* end_; //!< Past-the-end position. + bool valid_; //!< Whether the parsing is valid. + }; + + //! A helper stream to encode character (UTF-8 code unit) into percent-encoded sequence. + template + class PercentEncodeStream { + public: + PercentEncodeStream(OutputStream& os) : os_(os) {} + void Put(char c) { // UTF-8 must be byte + unsigned char u = static_cast(c); + static const char hexDigits[16] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' }; + os_.Put('%'); + os_.Put(static_cast(hexDigits[u >> 4])); + os_.Put(static_cast(hexDigits[u & 15])); + } + private: + OutputStream& os_; + }; + + Allocator* allocator_; //!< The current allocator. It is either user-supplied or equal to ownAllocator_. + Allocator* ownAllocator_; //!< Allocator owned by this Pointer. + Ch* nameBuffer_; //!< A buffer containing all names in tokens. + Token* tokens_; //!< A list of tokens. + size_t tokenCount_; //!< Number of tokens in tokens_. + size_t parseErrorOffset_; //!< Offset in code unit when parsing fail. + PointerParseErrorCode parseErrorCode_; //!< Parsing error code. +}; + +//! GenericPointer for Value (UTF-8, default allocator). +typedef GenericPointer Pointer; + +//!@name Helper functions for GenericPointer +//@{ + +////////////////////////////////////////////////////////////////////////////// + +template +typename T::ValueType& CreateValueByPointer(T& root, const GenericPointer& pointer, typename T::AllocatorType& a) { + return pointer.Create(root, a); +} + +template +typename T::ValueType& CreateValueByPointer(T& root, const CharType(&source)[N], typename T::AllocatorType& a) { + return GenericPointer(source, N - 1).Create(root, a); +} + +// No allocator parameter + +template +typename DocumentType::ValueType& CreateValueByPointer(DocumentType& document, const GenericPointer& pointer) { + return pointer.Create(document); +} + +template +typename DocumentType::ValueType& CreateValueByPointer(DocumentType& document, const CharType(&source)[N]) { + return GenericPointer(source, N - 1).Create(document); +} + +////////////////////////////////////////////////////////////////////////////// + +template +typename T::ValueType* GetValueByPointer(T& root, const GenericPointer& pointer, size_t* unresolvedTokenIndex = 0) { + return pointer.Get(root, unresolvedTokenIndex); +} + +template +const typename T::ValueType* GetValueByPointer(const T& root, const GenericPointer& pointer, size_t* unresolvedTokenIndex = 0) { + return pointer.Get(root, unresolvedTokenIndex); +} + +template +typename T::ValueType* GetValueByPointer(T& root, const CharType (&source)[N], size_t* unresolvedTokenIndex = 0) { + return GenericPointer(source, N - 1).Get(root, unresolvedTokenIndex); +} + +template +const typename T::ValueType* GetValueByPointer(const T& root, const CharType(&source)[N], size_t* unresolvedTokenIndex = 0) { + return GenericPointer(source, N - 1).Get(root, unresolvedTokenIndex); +} + +////////////////////////////////////////////////////////////////////////////// + +template +typename T::ValueType& GetValueByPointerWithDefault(T& root, const GenericPointer& pointer, const typename T::ValueType& defaultValue, typename T::AllocatorType& a) { + return pointer.GetWithDefault(root, defaultValue, a); +} + +template +typename T::ValueType& GetValueByPointerWithDefault(T& root, const GenericPointer& pointer, const typename T::Ch* defaultValue, typename T::AllocatorType& a) { + return pointer.GetWithDefault(root, defaultValue, a); +} + +#if RAPIDJSON_HAS_STDSTRING +template +typename T::ValueType& GetValueByPointerWithDefault(T& root, const GenericPointer& pointer, const std::basic_string& defaultValue, typename T::AllocatorType& a) { + return pointer.GetWithDefault(root, defaultValue, a); +} +#endif + +template +RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr, internal::IsGenericValue >), (typename T::ValueType&)) +GetValueByPointerWithDefault(T& root, const GenericPointer& pointer, T2 defaultValue, typename T::AllocatorType& a) { + return pointer.GetWithDefault(root, defaultValue, a); +} + +template +typename T::ValueType& GetValueByPointerWithDefault(T& root, const CharType(&source)[N], const typename T::ValueType& defaultValue, typename T::AllocatorType& a) { + return GenericPointer(source, N - 1).GetWithDefault(root, defaultValue, a); +} + +template +typename T::ValueType& GetValueByPointerWithDefault(T& root, const CharType(&source)[N], const typename T::Ch* defaultValue, typename T::AllocatorType& a) { + return GenericPointer(source, N - 1).GetWithDefault(root, defaultValue, a); +} + +#if RAPIDJSON_HAS_STDSTRING +template +typename T::ValueType& GetValueByPointerWithDefault(T& root, const CharType(&source)[N], const std::basic_string& defaultValue, typename T::AllocatorType& a) { + return GenericPointer(source, N - 1).GetWithDefault(root, defaultValue, a); +} +#endif + +template +RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr, internal::IsGenericValue >), (typename T::ValueType&)) +GetValueByPointerWithDefault(T& root, const CharType(&source)[N], T2 defaultValue, typename T::AllocatorType& a) { + return GenericPointer(source, N - 1).GetWithDefault(root, defaultValue, a); +} + +// No allocator parameter + +template +typename DocumentType::ValueType& GetValueByPointerWithDefault(DocumentType& document, const GenericPointer& pointer, const typename DocumentType::ValueType& defaultValue) { + return pointer.GetWithDefault(document, defaultValue); +} + +template +typename DocumentType::ValueType& GetValueByPointerWithDefault(DocumentType& document, const GenericPointer& pointer, const typename DocumentType::Ch* defaultValue) { + return pointer.GetWithDefault(document, defaultValue); +} + +#if RAPIDJSON_HAS_STDSTRING +template +typename DocumentType::ValueType& GetValueByPointerWithDefault(DocumentType& document, const GenericPointer& pointer, const std::basic_string& defaultValue) { + return pointer.GetWithDefault(document, defaultValue); +} +#endif + +template +RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr, internal::IsGenericValue >), (typename DocumentType::ValueType&)) +GetValueByPointerWithDefault(DocumentType& document, const GenericPointer& pointer, T2 defaultValue) { + return pointer.GetWithDefault(document, defaultValue); +} + +template +typename DocumentType::ValueType& GetValueByPointerWithDefault(DocumentType& document, const CharType(&source)[N], const typename DocumentType::ValueType& defaultValue) { + return GenericPointer(source, N - 1).GetWithDefault(document, defaultValue); +} + +template +typename DocumentType::ValueType& GetValueByPointerWithDefault(DocumentType& document, const CharType(&source)[N], const typename DocumentType::Ch* defaultValue) { + return GenericPointer(source, N - 1).GetWithDefault(document, defaultValue); +} + +#if RAPIDJSON_HAS_STDSTRING +template +typename DocumentType::ValueType& GetValueByPointerWithDefault(DocumentType& document, const CharType(&source)[N], const std::basic_string& defaultValue) { + return GenericPointer(source, N - 1).GetWithDefault(document, defaultValue); +} +#endif + +template +RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr, internal::IsGenericValue >), (typename DocumentType::ValueType&)) +GetValueByPointerWithDefault(DocumentType& document, const CharType(&source)[N], T2 defaultValue) { + return GenericPointer(source, N - 1).GetWithDefault(document, defaultValue); +} + +////////////////////////////////////////////////////////////////////////////// + +template +typename T::ValueType& SetValueByPointer(T& root, const GenericPointer& pointer, typename T::ValueType& value, typename T::AllocatorType& a) { + return pointer.Set(root, value, a); +} + +template +typename T::ValueType& SetValueByPointer(T& root, const GenericPointer& pointer, const typename T::ValueType& value, typename T::AllocatorType& a) { + return pointer.Set(root, value, a); +} + +template +typename T::ValueType& SetValueByPointer(T& root, const GenericPointer& pointer, const typename T::Ch* value, typename T::AllocatorType& a) { + return pointer.Set(root, value, a); +} + +#if RAPIDJSON_HAS_STDSTRING +template +typename T::ValueType& SetValueByPointer(T& root, const GenericPointer& pointer, const std::basic_string& value, typename T::AllocatorType& a) { + return pointer.Set(root, value, a); +} +#endif + +template +RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr, internal::IsGenericValue >), (typename T::ValueType&)) +SetValueByPointer(T& root, const GenericPointer& pointer, T2 value, typename T::AllocatorType& a) { + return pointer.Set(root, value, a); +} + +template +typename T::ValueType& SetValueByPointer(T& root, const CharType(&source)[N], typename T::ValueType& value, typename T::AllocatorType& a) { + return GenericPointer(source, N - 1).Set(root, value, a); +} + +template +typename T::ValueType& SetValueByPointer(T& root, const CharType(&source)[N], const typename T::ValueType& value, typename T::AllocatorType& a) { + return GenericPointer(source, N - 1).Set(root, value, a); +} + +template +typename T::ValueType& SetValueByPointer(T& root, const CharType(&source)[N], const typename T::Ch* value, typename T::AllocatorType& a) { + return GenericPointer(source, N - 1).Set(root, value, a); +} + +#if RAPIDJSON_HAS_STDSTRING +template +typename T::ValueType& SetValueByPointer(T& root, const CharType(&source)[N], const std::basic_string& value, typename T::AllocatorType& a) { + return GenericPointer(source, N - 1).Set(root, value, a); +} +#endif + +template +RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr, internal::IsGenericValue >), (typename T::ValueType&)) +SetValueByPointer(T& root, const CharType(&source)[N], T2 value, typename T::AllocatorType& a) { + return GenericPointer(source, N - 1).Set(root, value, a); +} + +// No allocator parameter + +template +typename DocumentType::ValueType& SetValueByPointer(DocumentType& document, const GenericPointer& pointer, typename DocumentType::ValueType& value) { + return pointer.Set(document, value); +} + +template +typename DocumentType::ValueType& SetValueByPointer(DocumentType& document, const GenericPointer& pointer, const typename DocumentType::ValueType& value) { + return pointer.Set(document, value); +} + +template +typename DocumentType::ValueType& SetValueByPointer(DocumentType& document, const GenericPointer& pointer, const typename DocumentType::Ch* value) { + return pointer.Set(document, value); +} + +#if RAPIDJSON_HAS_STDSTRING +template +typename DocumentType::ValueType& SetValueByPointer(DocumentType& document, const GenericPointer& pointer, const std::basic_string& value) { + return pointer.Set(document, value); +} +#endif + +template +RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr, internal::IsGenericValue >), (typename DocumentType::ValueType&)) +SetValueByPointer(DocumentType& document, const GenericPointer& pointer, T2 value) { + return pointer.Set(document, value); +} + +template +typename DocumentType::ValueType& SetValueByPointer(DocumentType& document, const CharType(&source)[N], typename DocumentType::ValueType& value) { + return GenericPointer(source, N - 1).Set(document, value); +} + +template +typename DocumentType::ValueType& SetValueByPointer(DocumentType& document, const CharType(&source)[N], const typename DocumentType::ValueType& value) { + return GenericPointer(source, N - 1).Set(document, value); +} + +template +typename DocumentType::ValueType& SetValueByPointer(DocumentType& document, const CharType(&source)[N], const typename DocumentType::Ch* value) { + return GenericPointer(source, N - 1).Set(document, value); +} + +#if RAPIDJSON_HAS_STDSTRING +template +typename DocumentType::ValueType& SetValueByPointer(DocumentType& document, const CharType(&source)[N], const std::basic_string& value) { + return GenericPointer(source, N - 1).Set(document, value); +} +#endif + +template +RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr, internal::IsGenericValue >), (typename DocumentType::ValueType&)) +SetValueByPointer(DocumentType& document, const CharType(&source)[N], T2 value) { + return GenericPointer(source, N - 1).Set(document, value); +} + +////////////////////////////////////////////////////////////////////////////// + +template +typename T::ValueType& SwapValueByPointer(T& root, const GenericPointer& pointer, typename T::ValueType& value, typename T::AllocatorType& a) { + return pointer.Swap(root, value, a); +} + +template +typename T::ValueType& SwapValueByPointer(T& root, const CharType(&source)[N], typename T::ValueType& value, typename T::AllocatorType& a) { + return GenericPointer(source, N - 1).Swap(root, value, a); +} + +template +typename DocumentType::ValueType& SwapValueByPointer(DocumentType& document, const GenericPointer& pointer, typename DocumentType::ValueType& value) { + return pointer.Swap(document, value); +} + +template +typename DocumentType::ValueType& SwapValueByPointer(DocumentType& document, const CharType(&source)[N], typename DocumentType::ValueType& value) { + return GenericPointer(source, N - 1).Swap(document, value); +} + +////////////////////////////////////////////////////////////////////////////// + +template +bool EraseValueByPointer(T& root, const GenericPointer& pointer) { + return pointer.Erase(root); +} + +template +bool EraseValueByPointer(T& root, const CharType(&source)[N]) { + return GenericPointer(source, N - 1).Erase(root); +} + +//@} + +RAPIDJSON_NAMESPACE_END + +#if defined(__clang__) || defined(_MSC_VER) +RAPIDJSON_DIAG_POP +#endif + +#endif // RAPIDJSON_POINTER_H_ diff --git a/DFL_BOM_WL_TOERP/rapidjson/prettywriter.h b/DFL_BOM_WL_TOERP/rapidjson/prettywriter.h new file mode 100644 index 0000000..fe45df1 --- /dev/null +++ b/DFL_BOM_WL_TOERP/rapidjson/prettywriter.h @@ -0,0 +1,277 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +#ifndef RAPIDJSON_PRETTYWRITER_H_ +#define RAPIDJSON_PRETTYWRITER_H_ + +#include "writer.h" + +#ifdef __GNUC__ +RAPIDJSON_DIAG_PUSH +RAPIDJSON_DIAG_OFF(effc++) +#endif + +#if defined(__clang__) +RAPIDJSON_DIAG_PUSH +RAPIDJSON_DIAG_OFF(c++98-compat) +#endif + +RAPIDJSON_NAMESPACE_BEGIN + +//! Combination of PrettyWriter format flags. +/*! \see PrettyWriter::SetFormatOptions + */ +enum PrettyFormatOptions { + kFormatDefault = 0, //!< Default pretty formatting. + kFormatSingleLineArray = 1 //!< Format arrays on a single line. +}; + +//! Writer with indentation and spacing. +/*! + \tparam OutputStream Type of output os. + \tparam SourceEncoding Encoding of source string. + \tparam TargetEncoding Encoding of output stream. + \tparam StackAllocator Type of allocator for allocating memory of stack. +*/ +template, typename TargetEncoding = UTF8<>, typename StackAllocator = CrtAllocator, unsigned writeFlags = kWriteDefaultFlags> +class PrettyWriter : public Writer { +public: + typedef Writer Base; + typedef typename Base::Ch Ch; + + //! Constructor + /*! \param os Output stream. + \param allocator User supplied allocator. If it is null, it will create a private one. + \param levelDepth Initial capacity of stack. + */ + explicit PrettyWriter(OutputStream& os, StackAllocator* allocator = 0, size_t levelDepth = Base::kDefaultLevelDepth) : + Base(os, allocator, levelDepth), indentChar_(' '), indentCharCount_(4), formatOptions_(kFormatDefault) {} + + + explicit PrettyWriter(StackAllocator* allocator = 0, size_t levelDepth = Base::kDefaultLevelDepth) : + Base(allocator, levelDepth), indentChar_(' '), indentCharCount_(4), formatOptions_(kFormatDefault) {} + +#if RAPIDJSON_HAS_CXX11_RVALUE_REFS + PrettyWriter(PrettyWriter&& rhs) : + Base(std::forward(rhs)), indentChar_(rhs.indentChar_), indentCharCount_(rhs.indentCharCount_), formatOptions_(rhs.formatOptions_) {} +#endif + + //! Set custom indentation. + /*! \param indentChar Character for indentation. Must be whitespace character (' ', '\\t', '\\n', '\\r'). + \param indentCharCount Number of indent characters for each indentation level. + \note The default indentation is 4 spaces. + */ + PrettyWriter& SetIndent(Ch indentChar, unsigned indentCharCount) { + RAPIDJSON_ASSERT(indentChar == ' ' || indentChar == '\t' || indentChar == '\n' || indentChar == '\r'); + indentChar_ = indentChar; + indentCharCount_ = indentCharCount; + return *this; + } + + //! Set pretty writer formatting options. + /*! \param options Formatting options. + */ + PrettyWriter& SetFormatOptions(PrettyFormatOptions options) { + formatOptions_ = options; + return *this; + } + + /*! @name Implementation of Handler + \see Handler + */ + //@{ + + bool Null() { PrettyPrefix(kNullType); return Base::EndValue(Base::WriteNull()); } + bool Bool(bool b) { PrettyPrefix(b ? kTrueType : kFalseType); return Base::EndValue(Base::WriteBool(b)); } + bool Int(int i) { PrettyPrefix(kNumberType); return Base::EndValue(Base::WriteInt(i)); } + bool Uint(unsigned u) { PrettyPrefix(kNumberType); return Base::EndValue(Base::WriteUint(u)); } + bool Int64(int64_t i64) { PrettyPrefix(kNumberType); return Base::EndValue(Base::WriteInt64(i64)); } + bool Uint64(uint64_t u64) { PrettyPrefix(kNumberType); return Base::EndValue(Base::WriteUint64(u64)); } + bool Double(double d) { PrettyPrefix(kNumberType); return Base::EndValue(Base::WriteDouble(d)); } + + bool RawNumber(const Ch* str, SizeType length, bool copy = false) { + RAPIDJSON_ASSERT(str != 0); + (void)copy; + PrettyPrefix(kNumberType); + return Base::EndValue(Base::WriteString(str, length)); + } + + bool String(const Ch* str, SizeType length, bool copy = false) { + RAPIDJSON_ASSERT(str != 0); + (void)copy; + PrettyPrefix(kStringType); + return Base::EndValue(Base::WriteString(str, length)); + } + +#if RAPIDJSON_HAS_STDSTRING + bool String(const std::basic_string& str) { + return String(str.data(), SizeType(str.size())); + } +#endif + + bool StartObject() { + PrettyPrefix(kObjectType); + new (Base::level_stack_.template Push()) typename Base::Level(false); + return Base::WriteStartObject(); + } + + bool Key(const Ch* str, SizeType length, bool copy = false) { return String(str, length, copy); } + +#if RAPIDJSON_HAS_STDSTRING + bool Key(const std::basic_string& str) { + return Key(str.data(), SizeType(str.size())); + } +#endif + + bool EndObject(SizeType memberCount = 0) { + (void)memberCount; + RAPIDJSON_ASSERT(Base::level_stack_.GetSize() >= sizeof(typename Base::Level)); // not inside an Object + RAPIDJSON_ASSERT(!Base::level_stack_.template Top()->inArray); // currently inside an Array, not Object + RAPIDJSON_ASSERT(0 == Base::level_stack_.template Top()->valueCount % 2); // Object has a Key without a Value + + bool empty = Base::level_stack_.template Pop(1)->valueCount == 0; + + if (!empty) { + Base::os_->Put('\n'); + WriteIndent(); + } + bool ret = Base::EndValue(Base::WriteEndObject()); + (void)ret; + RAPIDJSON_ASSERT(ret == true); + if (Base::level_stack_.Empty()) // end of json text + Base::Flush(); + return true; + } + + bool StartArray() { + PrettyPrefix(kArrayType); + new (Base::level_stack_.template Push()) typename Base::Level(true); + return Base::WriteStartArray(); + } + + bool EndArray(SizeType memberCount = 0) { + (void)memberCount; + RAPIDJSON_ASSERT(Base::level_stack_.GetSize() >= sizeof(typename Base::Level)); + RAPIDJSON_ASSERT(Base::level_stack_.template Top()->inArray); + bool empty = Base::level_stack_.template Pop(1)->valueCount == 0; + + if (!empty && !(formatOptions_ & kFormatSingleLineArray)) { + Base::os_->Put('\n'); + WriteIndent(); + } + bool ret = Base::EndValue(Base::WriteEndArray()); + (void)ret; + RAPIDJSON_ASSERT(ret == true); + if (Base::level_stack_.Empty()) // end of json text + Base::Flush(); + return true; + } + + //@} + + /*! @name Convenience extensions */ + //@{ + + //! Simpler but slower overload. + bool String(const Ch* str) { return String(str, internal::StrLen(str)); } + bool Key(const Ch* str) { return Key(str, internal::StrLen(str)); } + + //@} + + //! Write a raw JSON value. + /*! + For user to write a stringified JSON as a value. + + \param json A well-formed JSON value. It should not contain null character within [0, length - 1] range. + \param length Length of the json. + \param type Type of the root of json. + \note When using PrettyWriter::RawValue(), the result json may not be indented correctly. + */ + bool RawValue(const Ch* json, size_t length, Type type) { + RAPIDJSON_ASSERT(json != 0); + PrettyPrefix(type); + return Base::EndValue(Base::WriteRawValue(json, length)); + } + +protected: + void PrettyPrefix(Type type) { + (void)type; + if (Base::level_stack_.GetSize() != 0) { // this value is not at root + typename Base::Level* level = Base::level_stack_.template Top(); + + if (level->inArray) { + if (level->valueCount > 0) { + Base::os_->Put(','); // add comma if it is not the first element in array + if (formatOptions_ & kFormatSingleLineArray) + Base::os_->Put(' '); + } + + if (!(formatOptions_ & kFormatSingleLineArray)) { + Base::os_->Put('\n'); + WriteIndent(); + } + } + else { // in object + if (level->valueCount > 0) { + if (level->valueCount % 2 == 0) { + Base::os_->Put(','); + Base::os_->Put('\n'); + } + else { + Base::os_->Put(':'); + Base::os_->Put(' '); + } + } + else + Base::os_->Put('\n'); + + if (level->valueCount % 2 == 0) + WriteIndent(); + } + if (!level->inArray && level->valueCount % 2 == 0) + RAPIDJSON_ASSERT(type == kStringType); // if it's in object, then even number should be a name + level->valueCount++; + } + else { + RAPIDJSON_ASSERT(!Base::hasRoot_); // Should only has one and only one root. + Base::hasRoot_ = true; + } + } + + void WriteIndent() { + size_t count = (Base::level_stack_.GetSize() / sizeof(typename Base::Level)) * indentCharCount_; + PutN(*Base::os_, static_cast(indentChar_), count); + } + + Ch indentChar_; + unsigned indentCharCount_; + PrettyFormatOptions formatOptions_; + +private: + // Prohibit copy constructor & assignment operator. + PrettyWriter(const PrettyWriter&); + PrettyWriter& operator=(const PrettyWriter&); +}; + +RAPIDJSON_NAMESPACE_END + +#if defined(__clang__) +RAPIDJSON_DIAG_POP +#endif + +#ifdef __GNUC__ +RAPIDJSON_DIAG_POP +#endif + +#endif // RAPIDJSON_RAPIDJSON_H_ diff --git a/DFL_BOM_WL_TOERP/rapidjson/rapidjson.h b/DFL_BOM_WL_TOERP/rapidjson/rapidjson.h new file mode 100644 index 0000000..a4e8953 --- /dev/null +++ b/DFL_BOM_WL_TOERP/rapidjson/rapidjson.h @@ -0,0 +1,741 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +#ifndef RAPIDJSON_RAPIDJSON_H_ +#define RAPIDJSON_RAPIDJSON_H_ + +/*!\file rapidjson.h + \brief common definitions and configuration + + \see RAPIDJSON_CONFIG + */ + +/*! \defgroup RAPIDJSON_CONFIG RapidJSON configuration + \brief Configuration macros for library features + + Some RapidJSON features are configurable to adapt the library to a wide + variety of platforms, environments and usage scenarios. Most of the + features can be configured in terms of overridden or predefined + preprocessor macros at compile-time. + + Some additional customization is available in the \ref RAPIDJSON_ERRORS APIs. + + \note These macros should be given on the compiler command-line + (where applicable) to avoid inconsistent values when compiling + different translation units of a single application. + */ + +#include // malloc(), realloc(), free(), size_t +#include // memset(), memcpy(), memmove(), memcmp() + +/////////////////////////////////////////////////////////////////////////////// +// RAPIDJSON_VERSION_STRING +// +// ALWAYS synchronize the following 3 macros with corresponding variables in /CMakeLists.txt. +// + +//!@cond RAPIDJSON_HIDDEN_FROM_DOXYGEN +// token stringification +#define RAPIDJSON_STRINGIFY(x) RAPIDJSON_DO_STRINGIFY(x) +#define RAPIDJSON_DO_STRINGIFY(x) #x + +// token concatenation +#define RAPIDJSON_JOIN(X, Y) RAPIDJSON_DO_JOIN(X, Y) +#define RAPIDJSON_DO_JOIN(X, Y) RAPIDJSON_DO_JOIN2(X, Y) +#define RAPIDJSON_DO_JOIN2(X, Y) X##Y +//!@endcond + +/*! \def RAPIDJSON_MAJOR_VERSION + \ingroup RAPIDJSON_CONFIG + \brief Major version of RapidJSON in integer. +*/ +/*! \def RAPIDJSON_MINOR_VERSION + \ingroup RAPIDJSON_CONFIG + \brief Minor version of RapidJSON in integer. +*/ +/*! \def RAPIDJSON_PATCH_VERSION + \ingroup RAPIDJSON_CONFIG + \brief Patch version of RapidJSON in integer. +*/ +/*! \def RAPIDJSON_VERSION_STRING + \ingroup RAPIDJSON_CONFIG + \brief Version of RapidJSON in ".." string format. +*/ +#define RAPIDJSON_MAJOR_VERSION 1 +#define RAPIDJSON_MINOR_VERSION 1 +#define RAPIDJSON_PATCH_VERSION 0 +#define RAPIDJSON_VERSION_STRING \ + RAPIDJSON_STRINGIFY(RAPIDJSON_MAJOR_VERSION.RAPIDJSON_MINOR_VERSION.RAPIDJSON_PATCH_VERSION) + +/////////////////////////////////////////////////////////////////////////////// +// RAPIDJSON_NAMESPACE_(BEGIN|END) +/*! \def RAPIDJSON_NAMESPACE + \ingroup RAPIDJSON_CONFIG + \brief provide custom rapidjson namespace + + In order to avoid symbol clashes and/or "One Definition Rule" errors + between multiple inclusions of (different versions of) RapidJSON in + a single binary, users can customize the name of the main RapidJSON + namespace. + + In case of a single nesting level, defining \c RAPIDJSON_NAMESPACE + to a custom name (e.g. \c MyRapidJSON) is sufficient. If multiple + levels are needed, both \ref RAPIDJSON_NAMESPACE_BEGIN and \ref + RAPIDJSON_NAMESPACE_END need to be defined as well: + + \code + // in some .cpp file + #define RAPIDJSON_NAMESPACE my::rapidjson + #define RAPIDJSON_NAMESPACE_BEGIN namespace my { namespace rapidjson { + #define RAPIDJSON_NAMESPACE_END } } + #include "rapidjson/..." + \endcode + + \see rapidjson + */ +/*! \def RAPIDJSON_NAMESPACE_BEGIN + \ingroup RAPIDJSON_CONFIG + \brief provide custom rapidjson namespace (opening expression) + \see RAPIDJSON_NAMESPACE +*/ +/*! \def RAPIDJSON_NAMESPACE_END + \ingroup RAPIDJSON_CONFIG + \brief provide custom rapidjson namespace (closing expression) + \see RAPIDJSON_NAMESPACE +*/ +#ifndef RAPIDJSON_NAMESPACE +#define RAPIDJSON_NAMESPACE rapidjson +#endif +#ifndef RAPIDJSON_NAMESPACE_BEGIN +#define RAPIDJSON_NAMESPACE_BEGIN namespace RAPIDJSON_NAMESPACE { +#endif +#ifndef RAPIDJSON_NAMESPACE_END +#define RAPIDJSON_NAMESPACE_END } +#endif + +/////////////////////////////////////////////////////////////////////////////// +// __cplusplus macro + +//!@cond RAPIDJSON_HIDDEN_FROM_DOXYGEN + +#if defined(_MSC_VER) +#define RAPIDJSON_CPLUSPLUS _MSVC_LANG +#else +#define RAPIDJSON_CPLUSPLUS __cplusplus +#endif + +//!@endcond + +/////////////////////////////////////////////////////////////////////////////// +// RAPIDJSON_HAS_STDSTRING + +#ifndef RAPIDJSON_HAS_STDSTRING +#ifdef RAPIDJSON_DOXYGEN_RUNNING +#define RAPIDJSON_HAS_STDSTRING 1 // force generation of documentation +#else +#define RAPIDJSON_HAS_STDSTRING 0 // no std::string support by default +#endif +/*! \def RAPIDJSON_HAS_STDSTRING + \ingroup RAPIDJSON_CONFIG + \brief Enable RapidJSON support for \c std::string + + By defining this preprocessor symbol to \c 1, several convenience functions for using + \ref rapidjson::GenericValue with \c std::string are enabled, especially + for construction and comparison. + + \hideinitializer +*/ +#endif // !defined(RAPIDJSON_HAS_STDSTRING) + +#if RAPIDJSON_HAS_STDSTRING +#include +#endif // RAPIDJSON_HAS_STDSTRING + +/////////////////////////////////////////////////////////////////////////////// +// RAPIDJSON_USE_MEMBERSMAP + +/*! \def RAPIDJSON_USE_MEMBERSMAP + \ingroup RAPIDJSON_CONFIG + \brief Enable RapidJSON support for object members handling in a \c std::multimap + + By defining this preprocessor symbol to \c 1, \ref rapidjson::GenericValue object + members are stored in a \c std::multimap for faster lookup and deletion times, a + trade off with a slightly slower insertion time and a small object allocat(or)ed + memory overhead. + + \hideinitializer +*/ +#ifndef RAPIDJSON_USE_MEMBERSMAP +#define RAPIDJSON_USE_MEMBERSMAP 0 // not by default +#endif + +/////////////////////////////////////////////////////////////////////////////// +// RAPIDJSON_NO_INT64DEFINE + +/*! \def RAPIDJSON_NO_INT64DEFINE + \ingroup RAPIDJSON_CONFIG + \brief Use external 64-bit integer types. + + RapidJSON requires the 64-bit integer types \c int64_t and \c uint64_t types + to be available at global scope. + + If users have their own definition, define RAPIDJSON_NO_INT64DEFINE to + prevent RapidJSON from defining its own types. +*/ +#ifndef RAPIDJSON_NO_INT64DEFINE +//!@cond RAPIDJSON_HIDDEN_FROM_DOXYGEN +#if defined(_MSC_VER) && (_MSC_VER < 1800) // Visual Studio 2013 +#include "msinttypes/stdint.h" +#include "msinttypes/inttypes.h" +#else +// Other compilers should have this. +#include +#include +#endif +//!@endcond +#ifdef RAPIDJSON_DOXYGEN_RUNNING +#define RAPIDJSON_NO_INT64DEFINE +#endif +#endif // RAPIDJSON_NO_INT64TYPEDEF + +/////////////////////////////////////////////////////////////////////////////// +// RAPIDJSON_FORCEINLINE + +#ifndef RAPIDJSON_FORCEINLINE +//!@cond RAPIDJSON_HIDDEN_FROM_DOXYGEN +#if defined(_MSC_VER) && defined(NDEBUG) +#define RAPIDJSON_FORCEINLINE __forceinline +#elif defined(__GNUC__) && __GNUC__ >= 4 && defined(NDEBUG) +#define RAPIDJSON_FORCEINLINE __attribute__((always_inline)) +#else +#define RAPIDJSON_FORCEINLINE +#endif +//!@endcond +#endif // RAPIDJSON_FORCEINLINE + +/////////////////////////////////////////////////////////////////////////////// +// RAPIDJSON_ENDIAN +#define RAPIDJSON_LITTLEENDIAN 0 //!< Little endian machine +#define RAPIDJSON_BIGENDIAN 1 //!< Big endian machine + +//! Endianness of the machine. +/*! + \def RAPIDJSON_ENDIAN + \ingroup RAPIDJSON_CONFIG + + GCC 4.6 provided macro for detecting endianness of the target machine. But other + compilers may not have this. User can define RAPIDJSON_ENDIAN to either + \ref RAPIDJSON_LITTLEENDIAN or \ref RAPIDJSON_BIGENDIAN. + + Default detection implemented with reference to + \li https://gcc.gnu.org/onlinedocs/gcc-4.6.0/cpp/Common-Predefined-Macros.html + \li http://www.boost.org/doc/libs/1_42_0/boost/detail/endian.hpp +*/ +#ifndef RAPIDJSON_ENDIAN +// Detect with GCC 4.6's macro +# ifdef __BYTE_ORDER__ +# if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ +# define RAPIDJSON_ENDIAN RAPIDJSON_LITTLEENDIAN +# elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ +# define RAPIDJSON_ENDIAN RAPIDJSON_BIGENDIAN +# else +# error Unknown machine endianness detected. User needs to define RAPIDJSON_ENDIAN. +# endif // __BYTE_ORDER__ +// Detect with GLIBC's endian.h +# elif defined(__GLIBC__) +# include +# if (__BYTE_ORDER == __LITTLE_ENDIAN) +# define RAPIDJSON_ENDIAN RAPIDJSON_LITTLEENDIAN +# elif (__BYTE_ORDER == __BIG_ENDIAN) +# define RAPIDJSON_ENDIAN RAPIDJSON_BIGENDIAN +# else +# error Unknown machine endianness detected. User needs to define RAPIDJSON_ENDIAN. +# endif // __GLIBC__ +// Detect with _LITTLE_ENDIAN and _BIG_ENDIAN macro +# elif defined(_LITTLE_ENDIAN) && !defined(_BIG_ENDIAN) +# define RAPIDJSON_ENDIAN RAPIDJSON_LITTLEENDIAN +# elif defined(_BIG_ENDIAN) && !defined(_LITTLE_ENDIAN) +# define RAPIDJSON_ENDIAN RAPIDJSON_BIGENDIAN +// Detect with architecture macros +# elif defined(__sparc) || defined(__sparc__) || defined(_POWER) || defined(__powerpc__) || defined(__ppc__) || defined(__hpux) || defined(__hppa) || defined(_MIPSEB) || defined(_POWER) || defined(__s390__) +# define RAPIDJSON_ENDIAN RAPIDJSON_BIGENDIAN +# elif defined(__i386__) || defined(__alpha__) || defined(__ia64) || defined(__ia64__) || defined(_M_IX86) || defined(_M_IA64) || defined(_M_ALPHA) || defined(__amd64) || defined(__amd64__) || defined(_M_AMD64) || defined(__x86_64) || defined(__x86_64__) || defined(_M_X64) || defined(__bfin__) +# define RAPIDJSON_ENDIAN RAPIDJSON_LITTLEENDIAN +# elif defined(_MSC_VER) && (defined(_M_ARM) || defined(_M_ARM64)) +# define RAPIDJSON_ENDIAN RAPIDJSON_LITTLEENDIAN +# elif defined(RAPIDJSON_DOXYGEN_RUNNING) +# define RAPIDJSON_ENDIAN +# else +# error Unknown machine endianness detected. User needs to define RAPIDJSON_ENDIAN. +# endif +#endif // RAPIDJSON_ENDIAN + +/////////////////////////////////////////////////////////////////////////////// +// RAPIDJSON_64BIT + +//! Whether using 64-bit architecture +#ifndef RAPIDJSON_64BIT +#if defined(__LP64__) || (defined(__x86_64__) && defined(__ILP32__)) || defined(_WIN64) || defined(__EMSCRIPTEN__) +#define RAPIDJSON_64BIT 1 +#else +#define RAPIDJSON_64BIT 0 +#endif +#endif // RAPIDJSON_64BIT + +/////////////////////////////////////////////////////////////////////////////// +// RAPIDJSON_ALIGN + +//! Data alignment of the machine. +/*! \ingroup RAPIDJSON_CONFIG + \param x pointer to align + + Some machines require strict data alignment. The default is 8 bytes. + User can customize by defining the RAPIDJSON_ALIGN function macro. +*/ +#ifndef RAPIDJSON_ALIGN +#define RAPIDJSON_ALIGN(x) (((x) + static_cast(7u)) & ~static_cast(7u)) +#endif + +/////////////////////////////////////////////////////////////////////////////// +// RAPIDJSON_UINT64_C2 + +//! Construct a 64-bit literal by a pair of 32-bit integer. +/*! + 64-bit literal with or without ULL suffix is prone to compiler warnings. + UINT64_C() is C macro which cause compilation problems. + Use this macro to define 64-bit constants by a pair of 32-bit integer. +*/ +#ifndef RAPIDJSON_UINT64_C2 +#define RAPIDJSON_UINT64_C2(high32, low32) ((static_cast(high32) << 32) | static_cast(low32)) +#endif + +/////////////////////////////////////////////////////////////////////////////// +// RAPIDJSON_48BITPOINTER_OPTIMIZATION + +//! Use only lower 48-bit address for some pointers. +/*! + \ingroup RAPIDJSON_CONFIG + + This optimization uses the fact that current X86-64 architecture only implement lower 48-bit virtual address. + The higher 16-bit can be used for storing other data. + \c GenericValue uses this optimization to reduce its size form 24 bytes to 16 bytes in 64-bit architecture. +*/ +#ifndef RAPIDJSON_48BITPOINTER_OPTIMIZATION +#if defined(__amd64__) || defined(__amd64) || defined(__x86_64__) || defined(__x86_64) || defined(_M_X64) || defined(_M_AMD64) +#define RAPIDJSON_48BITPOINTER_OPTIMIZATION 1 +#else +#define RAPIDJSON_48BITPOINTER_OPTIMIZATION 0 +#endif +#endif // RAPIDJSON_48BITPOINTER_OPTIMIZATION + +#if RAPIDJSON_48BITPOINTER_OPTIMIZATION == 1 +#if RAPIDJSON_64BIT != 1 +#error RAPIDJSON_48BITPOINTER_OPTIMIZATION can only be set to 1 when RAPIDJSON_64BIT=1 +#endif +#define RAPIDJSON_SETPOINTER(type, p, x) (p = reinterpret_cast((reinterpret_cast(p) & static_cast(RAPIDJSON_UINT64_C2(0xFFFF0000, 0x00000000))) | reinterpret_cast(reinterpret_cast(x)))) +#define RAPIDJSON_GETPOINTER(type, p) (reinterpret_cast(reinterpret_cast(p) & static_cast(RAPIDJSON_UINT64_C2(0x0000FFFF, 0xFFFFFFFF)))) +#else +#define RAPIDJSON_SETPOINTER(type, p, x) (p = (x)) +#define RAPIDJSON_GETPOINTER(type, p) (p) +#endif + +/////////////////////////////////////////////////////////////////////////////// +// RAPIDJSON_SSE2/RAPIDJSON_SSE42/RAPIDJSON_NEON/RAPIDJSON_SIMD + +/*! \def RAPIDJSON_SIMD + \ingroup RAPIDJSON_CONFIG + \brief Enable SSE2/SSE4.2/Neon optimization. + + RapidJSON supports optimized implementations for some parsing operations + based on the SSE2, SSE4.2 or NEon SIMD extensions on modern Intel + or ARM compatible processors. + + To enable these optimizations, three different symbols can be defined; + \code + // Enable SSE2 optimization. + #define RAPIDJSON_SSE2 + + // Enable SSE4.2 optimization. + #define RAPIDJSON_SSE42 + \endcode + + // Enable ARM Neon optimization. + #define RAPIDJSON_NEON + \endcode + + \c RAPIDJSON_SSE42 takes precedence over SSE2, if both are defined. + + If any of these symbols is defined, RapidJSON defines the macro + \c RAPIDJSON_SIMD to indicate the availability of the optimized code. +*/ +#if defined(RAPIDJSON_SSE2) || defined(RAPIDJSON_SSE42) \ + || defined(RAPIDJSON_NEON) || defined(RAPIDJSON_DOXYGEN_RUNNING) +#define RAPIDJSON_SIMD +#endif + +/////////////////////////////////////////////////////////////////////////////// +// RAPIDJSON_NO_SIZETYPEDEFINE + +#ifndef RAPIDJSON_NO_SIZETYPEDEFINE +/*! \def RAPIDJSON_NO_SIZETYPEDEFINE + \ingroup RAPIDJSON_CONFIG + \brief User-provided \c SizeType definition. + + In order to avoid using 32-bit size types for indexing strings and arrays, + define this preprocessor symbol and provide the type rapidjson::SizeType + before including RapidJSON: + \code + #define RAPIDJSON_NO_SIZETYPEDEFINE + namespace rapidjson { typedef ::std::size_t SizeType; } + #include "rapidjson/..." + \endcode + + \see rapidjson::SizeType +*/ +#ifdef RAPIDJSON_DOXYGEN_RUNNING +#define RAPIDJSON_NO_SIZETYPEDEFINE +#endif +RAPIDJSON_NAMESPACE_BEGIN +//! Size type (for string lengths, array sizes, etc.) +/*! RapidJSON uses 32-bit array/string indices even on 64-bit platforms, + instead of using \c size_t. Users may override the SizeType by defining + \ref RAPIDJSON_NO_SIZETYPEDEFINE. +*/ +typedef unsigned SizeType; +RAPIDJSON_NAMESPACE_END +#endif + +// always import std::size_t to rapidjson namespace +RAPIDJSON_NAMESPACE_BEGIN +using std::size_t; +RAPIDJSON_NAMESPACE_END + +/////////////////////////////////////////////////////////////////////////////// +// RAPIDJSON_ASSERT + +//! Assertion. +/*! \ingroup RAPIDJSON_CONFIG + By default, rapidjson uses C \c assert() for internal assertions. + User can override it by defining RAPIDJSON_ASSERT(x) macro. + + \note Parsing errors are handled and can be customized by the + \ref RAPIDJSON_ERRORS APIs. +*/ +#ifndef RAPIDJSON_ASSERT +#include +#define RAPIDJSON_ASSERT(x) assert(x) +#endif // RAPIDJSON_ASSERT + +/////////////////////////////////////////////////////////////////////////////// +// RAPIDJSON_STATIC_ASSERT + +// Prefer C++11 static_assert, if available +#ifndef RAPIDJSON_STATIC_ASSERT +#if RAPIDJSON_CPLUSPLUS >= 201103L || ( defined(_MSC_VER) && _MSC_VER >= 1800 ) +#define RAPIDJSON_STATIC_ASSERT(x) \ + static_assert(x, RAPIDJSON_STRINGIFY(x)) +#endif // C++11 +#endif // RAPIDJSON_STATIC_ASSERT + +// Adopt C++03 implementation from boost +#ifndef RAPIDJSON_STATIC_ASSERT +#ifndef __clang__ +//!@cond RAPIDJSON_HIDDEN_FROM_DOXYGEN +#endif +RAPIDJSON_NAMESPACE_BEGIN +template struct STATIC_ASSERTION_FAILURE; +template <> struct STATIC_ASSERTION_FAILURE { enum { value = 1 }; }; +template struct StaticAssertTest {}; +RAPIDJSON_NAMESPACE_END + +#if defined(__GNUC__) || defined(__clang__) +#define RAPIDJSON_STATIC_ASSERT_UNUSED_ATTRIBUTE __attribute__((unused)) +#else +#define RAPIDJSON_STATIC_ASSERT_UNUSED_ATTRIBUTE +#endif +#ifndef __clang__ +//!@endcond +#endif + +/*! \def RAPIDJSON_STATIC_ASSERT + \brief (Internal) macro to check for conditions at compile-time + \param x compile-time condition + \hideinitializer + */ +#define RAPIDJSON_STATIC_ASSERT(x) \ + typedef ::RAPIDJSON_NAMESPACE::StaticAssertTest< \ + sizeof(::RAPIDJSON_NAMESPACE::STATIC_ASSERTION_FAILURE)> \ + RAPIDJSON_JOIN(StaticAssertTypedef, __LINE__) RAPIDJSON_STATIC_ASSERT_UNUSED_ATTRIBUTE +#endif // RAPIDJSON_STATIC_ASSERT + +/////////////////////////////////////////////////////////////////////////////// +// RAPIDJSON_LIKELY, RAPIDJSON_UNLIKELY + +//! Compiler branching hint for expression with high probability to be true. +/*! + \ingroup RAPIDJSON_CONFIG + \param x Boolean expression likely to be true. +*/ +#ifndef RAPIDJSON_LIKELY +#if defined(__GNUC__) || defined(__clang__) +#define RAPIDJSON_LIKELY(x) __builtin_expect(!!(x), 1) +#else +#define RAPIDJSON_LIKELY(x) (x) +#endif +#endif + +//! Compiler branching hint for expression with low probability to be true. +/*! + \ingroup RAPIDJSON_CONFIG + \param x Boolean expression unlikely to be true. +*/ +#ifndef RAPIDJSON_UNLIKELY +#if defined(__GNUC__) || defined(__clang__) +#define RAPIDJSON_UNLIKELY(x) __builtin_expect(!!(x), 0) +#else +#define RAPIDJSON_UNLIKELY(x) (x) +#endif +#endif + +/////////////////////////////////////////////////////////////////////////////// +// Helpers + +//!@cond RAPIDJSON_HIDDEN_FROM_DOXYGEN + +#define RAPIDJSON_MULTILINEMACRO_BEGIN do { +#define RAPIDJSON_MULTILINEMACRO_END \ +} while((void)0, 0) + +// adopted from Boost +#define RAPIDJSON_VERSION_CODE(x,y,z) \ + (((x)*100000) + ((y)*100) + (z)) + +#if defined(__has_builtin) +#define RAPIDJSON_HAS_BUILTIN(x) __has_builtin(x) +#else +#define RAPIDJSON_HAS_BUILTIN(x) 0 +#endif + +/////////////////////////////////////////////////////////////////////////////// +// RAPIDJSON_DIAG_PUSH/POP, RAPIDJSON_DIAG_OFF + +#if defined(__GNUC__) +#define RAPIDJSON_GNUC \ + RAPIDJSON_VERSION_CODE(__GNUC__,__GNUC_MINOR__,__GNUC_PATCHLEVEL__) +#endif + +#if defined(__clang__) || (defined(RAPIDJSON_GNUC) && RAPIDJSON_GNUC >= RAPIDJSON_VERSION_CODE(4,2,0)) + +#define RAPIDJSON_PRAGMA(x) _Pragma(RAPIDJSON_STRINGIFY(x)) +#define RAPIDJSON_DIAG_PRAGMA(x) RAPIDJSON_PRAGMA(GCC diagnostic x) +#define RAPIDJSON_DIAG_OFF(x) \ + RAPIDJSON_DIAG_PRAGMA(ignored RAPIDJSON_STRINGIFY(RAPIDJSON_JOIN(-W,x))) + +// push/pop support in Clang and GCC>=4.6 +#if defined(__clang__) || (defined(RAPIDJSON_GNUC) && RAPIDJSON_GNUC >= RAPIDJSON_VERSION_CODE(4,6,0)) +#define RAPIDJSON_DIAG_PUSH RAPIDJSON_DIAG_PRAGMA(push) +#define RAPIDJSON_DIAG_POP RAPIDJSON_DIAG_PRAGMA(pop) +#else // GCC >= 4.2, < 4.6 +#define RAPIDJSON_DIAG_PUSH /* ignored */ +#define RAPIDJSON_DIAG_POP /* ignored */ +#endif + +#elif defined(_MSC_VER) + +// pragma (MSVC specific) +#define RAPIDJSON_PRAGMA(x) __pragma(x) +#define RAPIDJSON_DIAG_PRAGMA(x) RAPIDJSON_PRAGMA(warning(x)) + +#define RAPIDJSON_DIAG_OFF(x) RAPIDJSON_DIAG_PRAGMA(disable: x) +#define RAPIDJSON_DIAG_PUSH RAPIDJSON_DIAG_PRAGMA(push) +#define RAPIDJSON_DIAG_POP RAPIDJSON_DIAG_PRAGMA(pop) + +#else + +#define RAPIDJSON_DIAG_OFF(x) /* ignored */ +#define RAPIDJSON_DIAG_PUSH /* ignored */ +#define RAPIDJSON_DIAG_POP /* ignored */ + +#endif // RAPIDJSON_DIAG_* + +/////////////////////////////////////////////////////////////////////////////// +// C++11 features + +#ifndef RAPIDJSON_HAS_CXX11 +#define RAPIDJSON_HAS_CXX11 (RAPIDJSON_CPLUSPLUS >= 201103L) +#endif + +#ifndef RAPIDJSON_HAS_CXX11_RVALUE_REFS +#if RAPIDJSON_HAS_CXX11 +#define RAPIDJSON_HAS_CXX11_RVALUE_REFS 1 +#elif defined(__clang__) +#if __has_feature(cxx_rvalue_references) && \ + (defined(_MSC_VER) || defined(_LIBCPP_VERSION) || defined(__GLIBCXX__) && __GLIBCXX__ >= 20080306) +#define RAPIDJSON_HAS_CXX11_RVALUE_REFS 1 +#else +#define RAPIDJSON_HAS_CXX11_RVALUE_REFS 0 +#endif +#elif (defined(RAPIDJSON_GNUC) && (RAPIDJSON_GNUC >= RAPIDJSON_VERSION_CODE(4,3,0)) && defined(__GXX_EXPERIMENTAL_CXX0X__)) || \ + (defined(_MSC_VER) && _MSC_VER >= 1600) || \ + (defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x5140 && defined(__GXX_EXPERIMENTAL_CXX0X__)) + +#define RAPIDJSON_HAS_CXX11_RVALUE_REFS 1 +#else +#define RAPIDJSON_HAS_CXX11_RVALUE_REFS 0 +#endif +#endif // RAPIDJSON_HAS_CXX11_RVALUE_REFS + +#if RAPIDJSON_HAS_CXX11_RVALUE_REFS +#include // std::move +#endif + +#ifndef RAPIDJSON_HAS_CXX11_NOEXCEPT +#if RAPIDJSON_HAS_CXX11 +#define RAPIDJSON_HAS_CXX11_NOEXCEPT 1 +#elif defined(__clang__) +#define RAPIDJSON_HAS_CXX11_NOEXCEPT __has_feature(cxx_noexcept) +#elif (defined(RAPIDJSON_GNUC) && (RAPIDJSON_GNUC >= RAPIDJSON_VERSION_CODE(4,6,0)) && defined(__GXX_EXPERIMENTAL_CXX0X__)) || \ + (defined(_MSC_VER) && _MSC_VER >= 1900) || \ + (defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x5140 && defined(__GXX_EXPERIMENTAL_CXX0X__)) +#define RAPIDJSON_HAS_CXX11_NOEXCEPT 1 +#else +#define RAPIDJSON_HAS_CXX11_NOEXCEPT 0 +#endif +#endif +#ifndef RAPIDJSON_NOEXCEPT +#if RAPIDJSON_HAS_CXX11_NOEXCEPT +#define RAPIDJSON_NOEXCEPT noexcept +#else +#define RAPIDJSON_NOEXCEPT throw() +#endif // RAPIDJSON_HAS_CXX11_NOEXCEPT +#endif + +// no automatic detection, yet +#ifndef RAPIDJSON_HAS_CXX11_TYPETRAITS +#if (defined(_MSC_VER) && _MSC_VER >= 1700) +#define RAPIDJSON_HAS_CXX11_TYPETRAITS 1 +#else +#define RAPIDJSON_HAS_CXX11_TYPETRAITS 0 +#endif +#endif + +#ifndef RAPIDJSON_HAS_CXX11_RANGE_FOR +#if defined(__clang__) +#define RAPIDJSON_HAS_CXX11_RANGE_FOR __has_feature(cxx_range_for) +#elif (defined(RAPIDJSON_GNUC) && (RAPIDJSON_GNUC >= RAPIDJSON_VERSION_CODE(4,6,0)) && defined(__GXX_EXPERIMENTAL_CXX0X__)) || \ + (defined(_MSC_VER) && _MSC_VER >= 1700) || \ + (defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x5140 && defined(__GXX_EXPERIMENTAL_CXX0X__)) +#define RAPIDJSON_HAS_CXX11_RANGE_FOR 1 +#else +#define RAPIDJSON_HAS_CXX11_RANGE_FOR 0 +#endif +#endif // RAPIDJSON_HAS_CXX11_RANGE_FOR + +/////////////////////////////////////////////////////////////////////////////// +// C++17 features + +#ifndef RAPIDJSON_HAS_CXX17 +#define RAPIDJSON_HAS_CXX17 (RAPIDJSON_CPLUSPLUS >= 201703L) +#endif + +#if RAPIDJSON_HAS_CXX17 +# define RAPIDJSON_DELIBERATE_FALLTHROUGH [[fallthrough]] +#elif defined(__has_cpp_attribute) +# if __has_cpp_attribute(clang::fallthrough) +# define RAPIDJSON_DELIBERATE_FALLTHROUGH [[clang::fallthrough]] +# elif __has_cpp_attribute(fallthrough) +# define RAPIDJSON_DELIBERATE_FALLTHROUGH __attribute__((fallthrough)) +# else +# define RAPIDJSON_DELIBERATE_FALLTHROUGH +# endif +#else +# define RAPIDJSON_DELIBERATE_FALLTHROUGH +#endif + +//!@endcond + +//! Assertion (in non-throwing contexts). + /*! \ingroup RAPIDJSON_CONFIG + Some functions provide a \c noexcept guarantee, if the compiler supports it. + In these cases, the \ref RAPIDJSON_ASSERT macro cannot be overridden to + throw an exception. This macro adds a separate customization point for + such cases. + + Defaults to C \c assert() (as \ref RAPIDJSON_ASSERT), if \c noexcept is + supported, and to \ref RAPIDJSON_ASSERT otherwise. + */ + +/////////////////////////////////////////////////////////////////////////////// +// RAPIDJSON_NOEXCEPT_ASSERT + +#ifndef RAPIDJSON_NOEXCEPT_ASSERT +#ifdef RAPIDJSON_ASSERT_THROWS +#include +#define RAPIDJSON_NOEXCEPT_ASSERT(x) assert(x) +#else +#define RAPIDJSON_NOEXCEPT_ASSERT(x) RAPIDJSON_ASSERT(x) +#endif // RAPIDJSON_ASSERT_THROWS +#endif // RAPIDJSON_NOEXCEPT_ASSERT + +/////////////////////////////////////////////////////////////////////////////// +// malloc/realloc/free + +#ifndef RAPIDJSON_MALLOC +///! customization point for global \c malloc +#define RAPIDJSON_MALLOC(size) std::malloc(size) +#endif +#ifndef RAPIDJSON_REALLOC +///! customization point for global \c realloc +#define RAPIDJSON_REALLOC(ptr, new_size) std::realloc(ptr, new_size) +#endif +#ifndef RAPIDJSON_FREE +///! customization point for global \c free +#define RAPIDJSON_FREE(ptr) std::free(ptr) +#endif + +/////////////////////////////////////////////////////////////////////////////// +// new/delete + +#ifndef RAPIDJSON_NEW +///! customization point for global \c new +#define RAPIDJSON_NEW(TypeName) new TypeName +#endif +#ifndef RAPIDJSON_DELETE +///! customization point for global \c delete +#define RAPIDJSON_DELETE(x) delete x +#endif + +/////////////////////////////////////////////////////////////////////////////// +// Type + +/*! \namespace rapidjson + \brief main RapidJSON namespace + \see RAPIDJSON_NAMESPACE +*/ +RAPIDJSON_NAMESPACE_BEGIN + +//! Type of JSON value +enum Type { + kNullType = 0, //!< null + kFalseType = 1, //!< false + kTrueType = 2, //!< true + kObjectType = 3, //!< object + kArrayType = 4, //!< array + kStringType = 5, //!< string + kNumberType = 6 //!< number +}; + +RAPIDJSON_NAMESPACE_END + +#endif // RAPIDJSON_RAPIDJSON_H_ diff --git a/DFL_BOM_WL_TOERP/rapidjson/reader.h b/DFL_BOM_WL_TOERP/rapidjson/reader.h new file mode 100644 index 0000000..5554660 --- /dev/null +++ b/DFL_BOM_WL_TOERP/rapidjson/reader.h @@ -0,0 +1,2246 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +#ifndef RAPIDJSON_READER_H_ +#define RAPIDJSON_READER_H_ + +/*! \file reader.h */ + +#include "allocators.h" +#include "stream.h" +#include "encodedstream.h" +#include "internal/clzll.h" +#include "internal/meta.h" +#include "internal/stack.h" +#include "internal/strtod.h" +#include + +#if defined(RAPIDJSON_SIMD) && defined(_MSC_VER) +#include +#pragma intrinsic(_BitScanForward) +#endif +#ifdef RAPIDJSON_SSE42 +#include +#elif defined(RAPIDJSON_SSE2) +#include +#elif defined(RAPIDJSON_NEON) +#include +#endif + +#ifdef __clang__ +RAPIDJSON_DIAG_PUSH +RAPIDJSON_DIAG_OFF(old-style-cast) +RAPIDJSON_DIAG_OFF(padded) +RAPIDJSON_DIAG_OFF(switch-enum) +#elif defined(_MSC_VER) +RAPIDJSON_DIAG_PUSH +RAPIDJSON_DIAG_OFF(4127) // conditional expression is constant +RAPIDJSON_DIAG_OFF(4702) // unreachable code +#endif + +#ifdef __GNUC__ +RAPIDJSON_DIAG_PUSH +RAPIDJSON_DIAG_OFF(effc++) +#endif + +//!@cond RAPIDJSON_HIDDEN_FROM_DOXYGEN +#define RAPIDJSON_NOTHING /* deliberately empty */ +#ifndef RAPIDJSON_PARSE_ERROR_EARLY_RETURN +#define RAPIDJSON_PARSE_ERROR_EARLY_RETURN(value) \ + RAPIDJSON_MULTILINEMACRO_BEGIN \ + if (RAPIDJSON_UNLIKELY(HasParseError())) { return value; } \ + RAPIDJSON_MULTILINEMACRO_END +#endif +#define RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID \ + RAPIDJSON_PARSE_ERROR_EARLY_RETURN(RAPIDJSON_NOTHING) +//!@endcond + +/*! \def RAPIDJSON_PARSE_ERROR_NORETURN + \ingroup RAPIDJSON_ERRORS + \brief Macro to indicate a parse error. + \param parseErrorCode \ref rapidjson::ParseErrorCode of the error + \param offset position of the error in JSON input (\c size_t) + + This macros can be used as a customization point for the internal + error handling mechanism of RapidJSON. + + A common usage model is to throw an exception instead of requiring the + caller to explicitly check the \ref rapidjson::GenericReader::Parse's + return value: + + \code + #define RAPIDJSON_PARSE_ERROR_NORETURN(parseErrorCode,offset) \ + throw ParseException(parseErrorCode, #parseErrorCode, offset) + + #include // std::runtime_error + #include "rapidjson/error/error.h" // rapidjson::ParseResult + + struct ParseException : std::runtime_error, rapidjson::ParseResult { + ParseException(rapidjson::ParseErrorCode code, const char* msg, size_t offset) + : std::runtime_error(msg), ParseResult(code, offset) {} + }; + + #include "rapidjson/reader.h" + \endcode + + \see RAPIDJSON_PARSE_ERROR, rapidjson::GenericReader::Parse + */ +#ifndef RAPIDJSON_PARSE_ERROR_NORETURN +#define RAPIDJSON_PARSE_ERROR_NORETURN(parseErrorCode, offset) \ + RAPIDJSON_MULTILINEMACRO_BEGIN \ + RAPIDJSON_ASSERT(!HasParseError()); /* Error can only be assigned once */ \ + SetParseError(parseErrorCode, offset); \ + RAPIDJSON_MULTILINEMACRO_END +#endif + +/*! \def RAPIDJSON_PARSE_ERROR + \ingroup RAPIDJSON_ERRORS + \brief (Internal) macro to indicate and handle a parse error. + \param parseErrorCode \ref rapidjson::ParseErrorCode of the error + \param offset position of the error in JSON input (\c size_t) + + Invokes RAPIDJSON_PARSE_ERROR_NORETURN and stops the parsing. + + \see RAPIDJSON_PARSE_ERROR_NORETURN + \hideinitializer + */ +#ifndef RAPIDJSON_PARSE_ERROR +#define RAPIDJSON_PARSE_ERROR(parseErrorCode, offset) \ + RAPIDJSON_MULTILINEMACRO_BEGIN \ + RAPIDJSON_PARSE_ERROR_NORETURN(parseErrorCode, offset); \ + RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID; \ + RAPIDJSON_MULTILINEMACRO_END +#endif + +#include "error/error.h" // ParseErrorCode, ParseResult + +RAPIDJSON_NAMESPACE_BEGIN + +/////////////////////////////////////////////////////////////////////////////// +// ParseFlag + +/*! \def RAPIDJSON_PARSE_DEFAULT_FLAGS + \ingroup RAPIDJSON_CONFIG + \brief User-defined kParseDefaultFlags definition. + + User can define this as any \c ParseFlag combinations. +*/ +#ifndef RAPIDJSON_PARSE_DEFAULT_FLAGS +#define RAPIDJSON_PARSE_DEFAULT_FLAGS kParseNoFlags +#endif + +//! Combination of parseFlags +/*! \see Reader::Parse, Document::Parse, Document::ParseInsitu, Document::ParseStream + */ +enum ParseFlag { + kParseNoFlags = 0, //!< No flags are set. + kParseInsituFlag = 1, //!< In-situ(destructive) parsing. + kParseValidateEncodingFlag = 2, //!< Validate encoding of JSON strings. + kParseIterativeFlag = 4, //!< Iterative(constant complexity in terms of function call stack size) parsing. + kParseStopWhenDoneFlag = 8, //!< After parsing a complete JSON root from stream, stop further processing the rest of stream. When this flag is used, parser will not generate kParseErrorDocumentRootNotSingular error. + kParseFullPrecisionFlag = 16, //!< Parse number in full precision (but slower). + kParseCommentsFlag = 32, //!< Allow one-line (//) and multi-line (/**/) comments. + kParseNumbersAsStringsFlag = 64, //!< Parse all numbers (ints/doubles) as strings. + kParseTrailingCommasFlag = 128, //!< Allow trailing commas at the end of objects and arrays. + kParseNanAndInfFlag = 256, //!< Allow parsing NaN, Inf, Infinity, -Inf and -Infinity as doubles. + kParseEscapedApostropheFlag = 512, //!< Allow escaped apostrophe in strings. + kParseDefaultFlags = RAPIDJSON_PARSE_DEFAULT_FLAGS //!< Default parse flags. Can be customized by defining RAPIDJSON_PARSE_DEFAULT_FLAGS +}; + +/////////////////////////////////////////////////////////////////////////////// +// Handler + +/*! \class rapidjson::Handler + \brief Concept for receiving events from GenericReader upon parsing. + The functions return true if no error occurs. If they return false, + the event publisher should terminate the process. +\code +concept Handler { + typename Ch; + + bool Null(); + bool Bool(bool b); + bool Int(int i); + bool Uint(unsigned i); + bool Int64(int64_t i); + bool Uint64(uint64_t i); + bool Double(double d); + /// enabled via kParseNumbersAsStringsFlag, string is not null-terminated (use length) + bool RawNumber(const Ch* str, SizeType length, bool copy); + bool String(const Ch* str, SizeType length, bool copy); + bool StartObject(); + bool Key(const Ch* str, SizeType length, bool copy); + bool EndObject(SizeType memberCount); + bool StartArray(); + bool EndArray(SizeType elementCount); +}; +\endcode +*/ +/////////////////////////////////////////////////////////////////////////////// +// BaseReaderHandler + +//! Default implementation of Handler. +/*! This can be used as base class of any reader handler. + \note implements Handler concept +*/ +template, typename Derived = void> +struct BaseReaderHandler { + typedef typename Encoding::Ch Ch; + + typedef typename internal::SelectIf, BaseReaderHandler, Derived>::Type Override; + + bool Default() { return true; } + bool Null() { return static_cast(*this).Default(); } + bool Bool(bool) { return static_cast(*this).Default(); } + bool Int(int) { return static_cast(*this).Default(); } + bool Uint(unsigned) { return static_cast(*this).Default(); } + bool Int64(int64_t) { return static_cast(*this).Default(); } + bool Uint64(uint64_t) { return static_cast(*this).Default(); } + bool Double(double) { return static_cast(*this).Default(); } + /// enabled via kParseNumbersAsStringsFlag, string is not null-terminated (use length) + bool RawNumber(const Ch* str, SizeType len, bool copy) { return static_cast(*this).String(str, len, copy); } + bool String(const Ch*, SizeType, bool) { return static_cast(*this).Default(); } + bool StartObject() { return static_cast(*this).Default(); } + bool Key(const Ch* str, SizeType len, bool copy) { return static_cast(*this).String(str, len, copy); } + bool EndObject(SizeType) { return static_cast(*this).Default(); } + bool StartArray() { return static_cast(*this).Default(); } + bool EndArray(SizeType) { return static_cast(*this).Default(); } +}; + +/////////////////////////////////////////////////////////////////////////////// +// StreamLocalCopy + +namespace internal { + +template::copyOptimization> +class StreamLocalCopy; + +//! Do copy optimization. +template +class StreamLocalCopy { +public: + StreamLocalCopy(Stream& original) : s(original), original_(original) {} + ~StreamLocalCopy() { original_ = s; } + + Stream s; + +private: + StreamLocalCopy& operator=(const StreamLocalCopy&) /* = delete */; + + Stream& original_; +}; + +//! Keep reference. +template +class StreamLocalCopy { +public: + StreamLocalCopy(Stream& original) : s(original) {} + + Stream& s; + +private: + StreamLocalCopy& operator=(const StreamLocalCopy&) /* = delete */; +}; + +} // namespace internal + +/////////////////////////////////////////////////////////////////////////////// +// SkipWhitespace + +//! Skip the JSON white spaces in a stream. +/*! \param is A input stream for skipping white spaces. + \note This function has SSE2/SSE4.2 specialization. +*/ +template +void SkipWhitespace(InputStream& is) { + internal::StreamLocalCopy copy(is); + InputStream& s(copy.s); + + typename InputStream::Ch c; + while ((c = s.Peek()) == ' ' || c == '\n' || c == '\r' || c == '\t') + s.Take(); +} + +inline const char* SkipWhitespace(const char* p, const char* end) { + while (p != end && (*p == ' ' || *p == '\n' || *p == '\r' || *p == '\t')) + ++p; + return p; +} + +#ifdef RAPIDJSON_SSE42 +//! Skip whitespace with SSE 4.2 pcmpistrm instruction, testing 16 8-byte characters at once. +inline const char *SkipWhitespace_SIMD(const char* p) { + // Fast return for single non-whitespace + if (*p == ' ' || *p == '\n' || *p == '\r' || *p == '\t') + ++p; + else + return p; + + // 16-byte align to the next boundary + const char* nextAligned = reinterpret_cast((reinterpret_cast(p) + 15) & static_cast(~15)); + while (p != nextAligned) + if (*p == ' ' || *p == '\n' || *p == '\r' || *p == '\t') + ++p; + else + return p; + + // The rest of string using SIMD + static const char whitespace[16] = " \n\r\t"; + const __m128i w = _mm_loadu_si128(reinterpret_cast(&whitespace[0])); + + for (;; p += 16) { + const __m128i s = _mm_load_si128(reinterpret_cast(p)); + const int r = _mm_cmpistri(w, s, _SIDD_UBYTE_OPS | _SIDD_CMP_EQUAL_ANY | _SIDD_LEAST_SIGNIFICANT | _SIDD_NEGATIVE_POLARITY); + if (r != 16) // some of characters is non-whitespace + return p + r; + } +} + +inline const char *SkipWhitespace_SIMD(const char* p, const char* end) { + // Fast return for single non-whitespace + if (p != end && (*p == ' ' || *p == '\n' || *p == '\r' || *p == '\t')) + ++p; + else + return p; + + // The middle of string using SIMD + static const char whitespace[16] = " \n\r\t"; + const __m128i w = _mm_loadu_si128(reinterpret_cast(&whitespace[0])); + + for (; p <= end - 16; p += 16) { + const __m128i s = _mm_loadu_si128(reinterpret_cast(p)); + const int r = _mm_cmpistri(w, s, _SIDD_UBYTE_OPS | _SIDD_CMP_EQUAL_ANY | _SIDD_LEAST_SIGNIFICANT | _SIDD_NEGATIVE_POLARITY); + if (r != 16) // some of characters is non-whitespace + return p + r; + } + + return SkipWhitespace(p, end); +} + +#elif defined(RAPIDJSON_SSE2) + +//! Skip whitespace with SSE2 instructions, testing 16 8-byte characters at once. +inline const char *SkipWhitespace_SIMD(const char* p) { + // Fast return for single non-whitespace + if (*p == ' ' || *p == '\n' || *p == '\r' || *p == '\t') + ++p; + else + return p; + + // 16-byte align to the next boundary + const char* nextAligned = reinterpret_cast((reinterpret_cast(p) + 15) & static_cast(~15)); + while (p != nextAligned) + if (*p == ' ' || *p == '\n' || *p == '\r' || *p == '\t') + ++p; + else + return p; + + // The rest of string + #define C16(c) { c, c, c, c, c, c, c, c, c, c, c, c, c, c, c, c } + static const char whitespaces[4][16] = { C16(' '), C16('\n'), C16('\r'), C16('\t') }; + #undef C16 + + const __m128i w0 = _mm_loadu_si128(reinterpret_cast(&whitespaces[0][0])); + const __m128i w1 = _mm_loadu_si128(reinterpret_cast(&whitespaces[1][0])); + const __m128i w2 = _mm_loadu_si128(reinterpret_cast(&whitespaces[2][0])); + const __m128i w3 = _mm_loadu_si128(reinterpret_cast(&whitespaces[3][0])); + + for (;; p += 16) { + const __m128i s = _mm_load_si128(reinterpret_cast(p)); + __m128i x = _mm_cmpeq_epi8(s, w0); + x = _mm_or_si128(x, _mm_cmpeq_epi8(s, w1)); + x = _mm_or_si128(x, _mm_cmpeq_epi8(s, w2)); + x = _mm_or_si128(x, _mm_cmpeq_epi8(s, w3)); + unsigned short r = static_cast(~_mm_movemask_epi8(x)); + if (r != 0) { // some of characters may be non-whitespace +#ifdef _MSC_VER // Find the index of first non-whitespace + unsigned long offset; + _BitScanForward(&offset, r); + return p + offset; +#else + return p + __builtin_ffs(r) - 1; +#endif + } + } +} + +inline const char *SkipWhitespace_SIMD(const char* p, const char* end) { + // Fast return for single non-whitespace + if (p != end && (*p == ' ' || *p == '\n' || *p == '\r' || *p == '\t')) + ++p; + else + return p; + + // The rest of string + #define C16(c) { c, c, c, c, c, c, c, c, c, c, c, c, c, c, c, c } + static const char whitespaces[4][16] = { C16(' '), C16('\n'), C16('\r'), C16('\t') }; + #undef C16 + + const __m128i w0 = _mm_loadu_si128(reinterpret_cast(&whitespaces[0][0])); + const __m128i w1 = _mm_loadu_si128(reinterpret_cast(&whitespaces[1][0])); + const __m128i w2 = _mm_loadu_si128(reinterpret_cast(&whitespaces[2][0])); + const __m128i w3 = _mm_loadu_si128(reinterpret_cast(&whitespaces[3][0])); + + for (; p <= end - 16; p += 16) { + const __m128i s = _mm_loadu_si128(reinterpret_cast(p)); + __m128i x = _mm_cmpeq_epi8(s, w0); + x = _mm_or_si128(x, _mm_cmpeq_epi8(s, w1)); + x = _mm_or_si128(x, _mm_cmpeq_epi8(s, w2)); + x = _mm_or_si128(x, _mm_cmpeq_epi8(s, w3)); + unsigned short r = static_cast(~_mm_movemask_epi8(x)); + if (r != 0) { // some of characters may be non-whitespace +#ifdef _MSC_VER // Find the index of first non-whitespace + unsigned long offset; + _BitScanForward(&offset, r); + return p + offset; +#else + return p + __builtin_ffs(r) - 1; +#endif + } + } + + return SkipWhitespace(p, end); +} + +#elif defined(RAPIDJSON_NEON) + +//! Skip whitespace with ARM Neon instructions, testing 16 8-byte characters at once. +inline const char *SkipWhitespace_SIMD(const char* p) { + // Fast return for single non-whitespace + if (*p == ' ' || *p == '\n' || *p == '\r' || *p == '\t') + ++p; + else + return p; + + // 16-byte align to the next boundary + const char* nextAligned = reinterpret_cast((reinterpret_cast(p) + 15) & static_cast(~15)); + while (p != nextAligned) + if (*p == ' ' || *p == '\n' || *p == '\r' || *p == '\t') + ++p; + else + return p; + + const uint8x16_t w0 = vmovq_n_u8(' '); + const uint8x16_t w1 = vmovq_n_u8('\n'); + const uint8x16_t w2 = vmovq_n_u8('\r'); + const uint8x16_t w3 = vmovq_n_u8('\t'); + + for (;; p += 16) { + const uint8x16_t s = vld1q_u8(reinterpret_cast(p)); + uint8x16_t x = vceqq_u8(s, w0); + x = vorrq_u8(x, vceqq_u8(s, w1)); + x = vorrq_u8(x, vceqq_u8(s, w2)); + x = vorrq_u8(x, vceqq_u8(s, w3)); + + x = vmvnq_u8(x); // Negate + x = vrev64q_u8(x); // Rev in 64 + uint64_t low = vgetq_lane_u64(vreinterpretq_u64_u8(x), 0); // extract + uint64_t high = vgetq_lane_u64(vreinterpretq_u64_u8(x), 1); // extract + + if (low == 0) { + if (high != 0) { + uint32_t lz = internal::clzll(high); + return p + 8 + (lz >> 3); + } + } else { + uint32_t lz = internal::clzll(low); + return p + (lz >> 3); + } + } +} + +inline const char *SkipWhitespace_SIMD(const char* p, const char* end) { + // Fast return for single non-whitespace + if (p != end && (*p == ' ' || *p == '\n' || *p == '\r' || *p == '\t')) + ++p; + else + return p; + + const uint8x16_t w0 = vmovq_n_u8(' '); + const uint8x16_t w1 = vmovq_n_u8('\n'); + const uint8x16_t w2 = vmovq_n_u8('\r'); + const uint8x16_t w3 = vmovq_n_u8('\t'); + + for (; p <= end - 16; p += 16) { + const uint8x16_t s = vld1q_u8(reinterpret_cast(p)); + uint8x16_t x = vceqq_u8(s, w0); + x = vorrq_u8(x, vceqq_u8(s, w1)); + x = vorrq_u8(x, vceqq_u8(s, w2)); + x = vorrq_u8(x, vceqq_u8(s, w3)); + + x = vmvnq_u8(x); // Negate + x = vrev64q_u8(x); // Rev in 64 + uint64_t low = vgetq_lane_u64(vreinterpretq_u64_u8(x), 0); // extract + uint64_t high = vgetq_lane_u64(vreinterpretq_u64_u8(x), 1); // extract + + if (low == 0) { + if (high != 0) { + uint32_t lz = internal::clzll(high); + return p + 8 + (lz >> 3); + } + } else { + uint32_t lz = internal::clzll(low); + return p + (lz >> 3); + } + } + + return SkipWhitespace(p, end); +} + +#endif // RAPIDJSON_NEON + +#ifdef RAPIDJSON_SIMD +//! Template function specialization for InsituStringStream +template<> inline void SkipWhitespace(InsituStringStream& is) { + is.src_ = const_cast(SkipWhitespace_SIMD(is.src_)); +} + +//! Template function specialization for StringStream +template<> inline void SkipWhitespace(StringStream& is) { + is.src_ = SkipWhitespace_SIMD(is.src_); +} + +template<> inline void SkipWhitespace(EncodedInputStream, MemoryStream>& is) { + is.is_.src_ = SkipWhitespace_SIMD(is.is_.src_, is.is_.end_); +} +#endif // RAPIDJSON_SIMD + +/////////////////////////////////////////////////////////////////////////////// +// GenericReader + +//! SAX-style JSON parser. Use \ref Reader for UTF8 encoding and default allocator. +/*! GenericReader parses JSON text from a stream, and send events synchronously to an + object implementing Handler concept. + + It needs to allocate a stack for storing a single decoded string during + non-destructive parsing. + + For in-situ parsing, the decoded string is directly written to the source + text string, no temporary buffer is required. + + A GenericReader object can be reused for parsing multiple JSON text. + + \tparam SourceEncoding Encoding of the input stream. + \tparam TargetEncoding Encoding of the parse output. + \tparam StackAllocator Allocator type for stack. +*/ +template +class GenericReader { +public: + typedef typename SourceEncoding::Ch Ch; //!< SourceEncoding character type + + //! Constructor. + /*! \param stackAllocator Optional allocator for allocating stack memory. (Only use for non-destructive parsing) + \param stackCapacity stack capacity in bytes for storing a single decoded string. (Only use for non-destructive parsing) + */ + GenericReader(StackAllocator* stackAllocator = 0, size_t stackCapacity = kDefaultStackCapacity) : + stack_(stackAllocator, stackCapacity), parseResult_(), state_(IterativeParsingStartState) {} + + //! Parse JSON text. + /*! \tparam parseFlags Combination of \ref ParseFlag. + \tparam InputStream Type of input stream, implementing Stream concept. + \tparam Handler Type of handler, implementing Handler concept. + \param is Input stream to be parsed. + \param handler The handler to receive events. + \return Whether the parsing is successful. + */ + template + ParseResult Parse(InputStream& is, Handler& handler) { + if (parseFlags & kParseIterativeFlag) + return IterativeParse(is, handler); + + parseResult_.Clear(); + + ClearStackOnExit scope(*this); + + SkipWhitespaceAndComments(is); + RAPIDJSON_PARSE_ERROR_EARLY_RETURN(parseResult_); + + if (RAPIDJSON_UNLIKELY(is.Peek() == '\0')) { + RAPIDJSON_PARSE_ERROR_NORETURN(kParseErrorDocumentEmpty, is.Tell()); + RAPIDJSON_PARSE_ERROR_EARLY_RETURN(parseResult_); + } + else { + ParseValue(is, handler); + RAPIDJSON_PARSE_ERROR_EARLY_RETURN(parseResult_); + + if (!(parseFlags & kParseStopWhenDoneFlag)) { + SkipWhitespaceAndComments(is); + RAPIDJSON_PARSE_ERROR_EARLY_RETURN(parseResult_); + + if (RAPIDJSON_UNLIKELY(is.Peek() != '\0')) { + RAPIDJSON_PARSE_ERROR_NORETURN(kParseErrorDocumentRootNotSingular, is.Tell()); + RAPIDJSON_PARSE_ERROR_EARLY_RETURN(parseResult_); + } + } + } + + return parseResult_; + } + + //! Parse JSON text (with \ref kParseDefaultFlags) + /*! \tparam InputStream Type of input stream, implementing Stream concept + \tparam Handler Type of handler, implementing Handler concept. + \param is Input stream to be parsed. + \param handler The handler to receive events. + \return Whether the parsing is successful. + */ + template + ParseResult Parse(InputStream& is, Handler& handler) { + return Parse(is, handler); + } + + //! Initialize JSON text token-by-token parsing + /*! + */ + void IterativeParseInit() { + parseResult_.Clear(); + state_ = IterativeParsingStartState; + } + + //! Parse one token from JSON text + /*! \tparam InputStream Type of input stream, implementing Stream concept + \tparam Handler Type of handler, implementing Handler concept. + \param is Input stream to be parsed. + \param handler The handler to receive events. + \return Whether the parsing is successful. + */ + template + bool IterativeParseNext(InputStream& is, Handler& handler) { + while (RAPIDJSON_LIKELY(is.Peek() != '\0')) { + SkipWhitespaceAndComments(is); + + Token t = Tokenize(is.Peek()); + IterativeParsingState n = Predict(state_, t); + IterativeParsingState d = Transit(state_, t, n, is, handler); + + // If we've finished or hit an error... + if (RAPIDJSON_UNLIKELY(IsIterativeParsingCompleteState(d))) { + // Report errors. + if (d == IterativeParsingErrorState) { + HandleError(state_, is); + return false; + } + + // Transition to the finish state. + RAPIDJSON_ASSERT(d == IterativeParsingFinishState); + state_ = d; + + // If StopWhenDone is not set... + if (!(parseFlags & kParseStopWhenDoneFlag)) { + // ... and extra non-whitespace data is found... + SkipWhitespaceAndComments(is); + if (is.Peek() != '\0') { + // ... this is considered an error. + HandleError(state_, is); + return false; + } + } + + // Success! We are done! + return true; + } + + // Transition to the new state. + state_ = d; + + // If we parsed anything other than a delimiter, we invoked the handler, so we can return true now. + if (!IsIterativeParsingDelimiterState(n)) + return true; + } + + // We reached the end of file. + stack_.Clear(); + + if (state_ != IterativeParsingFinishState) { + HandleError(state_, is); + return false; + } + + return true; + } + + //! Check if token-by-token parsing JSON text is complete + /*! \return Whether the JSON has been fully decoded. + */ + RAPIDJSON_FORCEINLINE bool IterativeParseComplete() const { + return IsIterativeParsingCompleteState(state_); + } + + //! Whether a parse error has occurred in the last parsing. + bool HasParseError() const { return parseResult_.IsError(); } + + //! Get the \ref ParseErrorCode of last parsing. + ParseErrorCode GetParseErrorCode() const { return parseResult_.Code(); } + + //! Get the position of last parsing error in input, 0 otherwise. + size_t GetErrorOffset() const { return parseResult_.Offset(); } + +protected: + void SetParseError(ParseErrorCode code, size_t offset) { parseResult_.Set(code, offset); } + +private: + // Prohibit copy constructor & assignment operator. + GenericReader(const GenericReader&); + GenericReader& operator=(const GenericReader&); + + void ClearStack() { stack_.Clear(); } + + // clear stack on any exit from ParseStream, e.g. due to exception + struct ClearStackOnExit { + explicit ClearStackOnExit(GenericReader& r) : r_(r) {} + ~ClearStackOnExit() { r_.ClearStack(); } + private: + GenericReader& r_; + ClearStackOnExit(const ClearStackOnExit&); + ClearStackOnExit& operator=(const ClearStackOnExit&); + }; + + template + void SkipWhitespaceAndComments(InputStream& is) { + SkipWhitespace(is); + + if (parseFlags & kParseCommentsFlag) { + while (RAPIDJSON_UNLIKELY(Consume(is, '/'))) { + if (Consume(is, '*')) { + while (true) { + if (RAPIDJSON_UNLIKELY(is.Peek() == '\0')) + RAPIDJSON_PARSE_ERROR(kParseErrorUnspecificSyntaxError, is.Tell()); + else if (Consume(is, '*')) { + if (Consume(is, '/')) + break; + } + else + is.Take(); + } + } + else if (RAPIDJSON_LIKELY(Consume(is, '/'))) + while (is.Peek() != '\0' && is.Take() != '\n') {} + else + RAPIDJSON_PARSE_ERROR(kParseErrorUnspecificSyntaxError, is.Tell()); + + SkipWhitespace(is); + } + } + } + + // Parse object: { string : value, ... } + template + void ParseObject(InputStream& is, Handler& handler) { + RAPIDJSON_ASSERT(is.Peek() == '{'); + is.Take(); // Skip '{' + + if (RAPIDJSON_UNLIKELY(!handler.StartObject())) + RAPIDJSON_PARSE_ERROR(kParseErrorTermination, is.Tell()); + + SkipWhitespaceAndComments(is); + RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID; + + if (Consume(is, '}')) { + if (RAPIDJSON_UNLIKELY(!handler.EndObject(0))) // empty object + RAPIDJSON_PARSE_ERROR(kParseErrorTermination, is.Tell()); + return; + } + + for (SizeType memberCount = 0;;) { + if (RAPIDJSON_UNLIKELY(is.Peek() != '"')) + RAPIDJSON_PARSE_ERROR(kParseErrorObjectMissName, is.Tell()); + + ParseString(is, handler, true); + RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID; + + SkipWhitespaceAndComments(is); + RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID; + + if (RAPIDJSON_UNLIKELY(!Consume(is, ':'))) + RAPIDJSON_PARSE_ERROR(kParseErrorObjectMissColon, is.Tell()); + + SkipWhitespaceAndComments(is); + RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID; + + ParseValue(is, handler); + RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID; + + SkipWhitespaceAndComments(is); + RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID; + + ++memberCount; + + switch (is.Peek()) { + case ',': + is.Take(); + SkipWhitespaceAndComments(is); + RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID; + break; + case '}': + is.Take(); + if (RAPIDJSON_UNLIKELY(!handler.EndObject(memberCount))) + RAPIDJSON_PARSE_ERROR(kParseErrorTermination, is.Tell()); + return; + default: + RAPIDJSON_PARSE_ERROR(kParseErrorObjectMissCommaOrCurlyBracket, is.Tell()); break; // This useless break is only for making warning and coverage happy + } + + if (parseFlags & kParseTrailingCommasFlag) { + if (is.Peek() == '}') { + if (RAPIDJSON_UNLIKELY(!handler.EndObject(memberCount))) + RAPIDJSON_PARSE_ERROR(kParseErrorTermination, is.Tell()); + is.Take(); + return; + } + } + } + } + + // Parse array: [ value, ... ] + template + void ParseArray(InputStream& is, Handler& handler) { + RAPIDJSON_ASSERT(is.Peek() == '['); + is.Take(); // Skip '[' + + if (RAPIDJSON_UNLIKELY(!handler.StartArray())) + RAPIDJSON_PARSE_ERROR(kParseErrorTermination, is.Tell()); + + SkipWhitespaceAndComments(is); + RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID; + + if (Consume(is, ']')) { + if (RAPIDJSON_UNLIKELY(!handler.EndArray(0))) // empty array + RAPIDJSON_PARSE_ERROR(kParseErrorTermination, is.Tell()); + return; + } + + for (SizeType elementCount = 0;;) { + ParseValue(is, handler); + RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID; + + ++elementCount; + SkipWhitespaceAndComments(is); + RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID; + + if (Consume(is, ',')) { + SkipWhitespaceAndComments(is); + RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID; + } + else if (Consume(is, ']')) { + if (RAPIDJSON_UNLIKELY(!handler.EndArray(elementCount))) + RAPIDJSON_PARSE_ERROR(kParseErrorTermination, is.Tell()); + return; + } + else + RAPIDJSON_PARSE_ERROR(kParseErrorArrayMissCommaOrSquareBracket, is.Tell()); + + if (parseFlags & kParseTrailingCommasFlag) { + if (is.Peek() == ']') { + if (RAPIDJSON_UNLIKELY(!handler.EndArray(elementCount))) + RAPIDJSON_PARSE_ERROR(kParseErrorTermination, is.Tell()); + is.Take(); + return; + } + } + } + } + + template + void ParseNull(InputStream& is, Handler& handler) { + RAPIDJSON_ASSERT(is.Peek() == 'n'); + is.Take(); + + if (RAPIDJSON_LIKELY(Consume(is, 'u') && Consume(is, 'l') && Consume(is, 'l'))) { + if (RAPIDJSON_UNLIKELY(!handler.Null())) + RAPIDJSON_PARSE_ERROR(kParseErrorTermination, is.Tell()); + } + else + RAPIDJSON_PARSE_ERROR(kParseErrorValueInvalid, is.Tell()); + } + + template + void ParseTrue(InputStream& is, Handler& handler) { + RAPIDJSON_ASSERT(is.Peek() == 't'); + is.Take(); + + if (RAPIDJSON_LIKELY(Consume(is, 'r') && Consume(is, 'u') && Consume(is, 'e'))) { + if (RAPIDJSON_UNLIKELY(!handler.Bool(true))) + RAPIDJSON_PARSE_ERROR(kParseErrorTermination, is.Tell()); + } + else + RAPIDJSON_PARSE_ERROR(kParseErrorValueInvalid, is.Tell()); + } + + template + void ParseFalse(InputStream& is, Handler& handler) { + RAPIDJSON_ASSERT(is.Peek() == 'f'); + is.Take(); + + if (RAPIDJSON_LIKELY(Consume(is, 'a') && Consume(is, 'l') && Consume(is, 's') && Consume(is, 'e'))) { + if (RAPIDJSON_UNLIKELY(!handler.Bool(false))) + RAPIDJSON_PARSE_ERROR(kParseErrorTermination, is.Tell()); + } + else + RAPIDJSON_PARSE_ERROR(kParseErrorValueInvalid, is.Tell()); + } + + template + RAPIDJSON_FORCEINLINE static bool Consume(InputStream& is, typename InputStream::Ch expect) { + if (RAPIDJSON_LIKELY(is.Peek() == expect)) { + is.Take(); + return true; + } + else + return false; + } + + // Helper function to parse four hexadecimal digits in \uXXXX in ParseString(). + template + unsigned ParseHex4(InputStream& is, size_t escapeOffset) { + unsigned codepoint = 0; + for (int i = 0; i < 4; i++) { + Ch c = is.Peek(); + codepoint <<= 4; + codepoint += static_cast(c); + if (c >= '0' && c <= '9') + codepoint -= '0'; + else if (c >= 'A' && c <= 'F') + codepoint -= 'A' - 10; + else if (c >= 'a' && c <= 'f') + codepoint -= 'a' - 10; + else { + RAPIDJSON_PARSE_ERROR_NORETURN(kParseErrorStringUnicodeEscapeInvalidHex, escapeOffset); + RAPIDJSON_PARSE_ERROR_EARLY_RETURN(0); + } + is.Take(); + } + return codepoint; + } + + template + class StackStream { + public: + typedef CharType Ch; + + StackStream(internal::Stack& stack) : stack_(stack), length_(0) {} + RAPIDJSON_FORCEINLINE void Put(Ch c) { + *stack_.template Push() = c; + ++length_; + } + + RAPIDJSON_FORCEINLINE void* Push(SizeType count) { + length_ += count; + return stack_.template Push(count); + } + + size_t Length() const { return length_; } + + Ch* Pop() { + return stack_.template Pop(length_); + } + + private: + StackStream(const StackStream&); + StackStream& operator=(const StackStream&); + + internal::Stack& stack_; + SizeType length_; + }; + + // Parse string and generate String event. Different code paths for kParseInsituFlag. + template + void ParseString(InputStream& is, Handler& handler, bool isKey = false) { + internal::StreamLocalCopy copy(is); + InputStream& s(copy.s); + + RAPIDJSON_ASSERT(s.Peek() == '\"'); + s.Take(); // Skip '\"' + + bool success = false; + if (parseFlags & kParseInsituFlag) { + typename InputStream::Ch *head = s.PutBegin(); + ParseStringToStream(s, s); + RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID; + size_t length = s.PutEnd(head) - 1; + RAPIDJSON_ASSERT(length <= 0xFFFFFFFF); + const typename TargetEncoding::Ch* const str = reinterpret_cast(head); + success = (isKey ? handler.Key(str, SizeType(length), false) : handler.String(str, SizeType(length), false)); + } + else { + StackStream stackStream(stack_); + ParseStringToStream(s, stackStream); + RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID; + SizeType length = static_cast(stackStream.Length()) - 1; + const typename TargetEncoding::Ch* const str = stackStream.Pop(); + success = (isKey ? handler.Key(str, length, true) : handler.String(str, length, true)); + } + if (RAPIDJSON_UNLIKELY(!success)) + RAPIDJSON_PARSE_ERROR(kParseErrorTermination, s.Tell()); + } + + // Parse string to an output is + // This function handles the prefix/suffix double quotes, escaping, and optional encoding validation. + template + RAPIDJSON_FORCEINLINE void ParseStringToStream(InputStream& is, OutputStream& os) { +//!@cond RAPIDJSON_HIDDEN_FROM_DOXYGEN +#define Z16 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 + static const char escape[256] = { + Z16, Z16, 0, 0,'\"', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '/', + Z16, Z16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,'\\', 0, 0, 0, + 0, 0,'\b', 0, 0, 0,'\f', 0, 0, 0, 0, 0, 0, 0,'\n', 0, + 0, 0,'\r', 0,'\t', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + Z16, Z16, Z16, Z16, Z16, Z16, Z16, Z16 + }; +#undef Z16 +//!@endcond + + for (;;) { + // Scan and copy string before "\\\"" or < 0x20. This is an optional optimzation. + if (!(parseFlags & kParseValidateEncodingFlag)) + ScanCopyUnescapedString(is, os); + + Ch c = is.Peek(); + if (RAPIDJSON_UNLIKELY(c == '\\')) { // Escape + size_t escapeOffset = is.Tell(); // For invalid escaping, report the initial '\\' as error offset + is.Take(); + Ch e = is.Peek(); + if ((sizeof(Ch) == 1 || unsigned(e) < 256) && RAPIDJSON_LIKELY(escape[static_cast(e)])) { + is.Take(); + os.Put(static_cast(escape[static_cast(e)])); + } + else if ((parseFlags & kParseEscapedApostropheFlag) && RAPIDJSON_LIKELY(e == '\'')) { // Allow escaped apostrophe + is.Take(); + os.Put('\''); + } + else if (RAPIDJSON_LIKELY(e == 'u')) { // Unicode + is.Take(); + unsigned codepoint = ParseHex4(is, escapeOffset); + RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID; + if (RAPIDJSON_UNLIKELY(codepoint >= 0xD800 && codepoint <= 0xDFFF)) { + // high surrogate, check if followed by valid low surrogate + if (RAPIDJSON_LIKELY(codepoint <= 0xDBFF)) { + // Handle UTF-16 surrogate pair + if (RAPIDJSON_UNLIKELY(!Consume(is, '\\') || !Consume(is, 'u'))) + RAPIDJSON_PARSE_ERROR(kParseErrorStringUnicodeSurrogateInvalid, escapeOffset); + unsigned codepoint2 = ParseHex4(is, escapeOffset); + RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID; + if (RAPIDJSON_UNLIKELY(codepoint2 < 0xDC00 || codepoint2 > 0xDFFF)) + RAPIDJSON_PARSE_ERROR(kParseErrorStringUnicodeSurrogateInvalid, escapeOffset); + codepoint = (((codepoint - 0xD800) << 10) | (codepoint2 - 0xDC00)) + 0x10000; + } + // single low surrogate + else + { + RAPIDJSON_PARSE_ERROR(kParseErrorStringUnicodeSurrogateInvalid, escapeOffset); + } + } + TEncoding::Encode(os, codepoint); + } + else + RAPIDJSON_PARSE_ERROR(kParseErrorStringEscapeInvalid, escapeOffset); + } + else if (RAPIDJSON_UNLIKELY(c == '"')) { // Closing double quote + is.Take(); + os.Put('\0'); // null-terminate the string + return; + } + else if (RAPIDJSON_UNLIKELY(static_cast(c) < 0x20)) { // RFC 4627: unescaped = %x20-21 / %x23-5B / %x5D-10FFFF + if (c == '\0') + RAPIDJSON_PARSE_ERROR(kParseErrorStringMissQuotationMark, is.Tell()); + else + RAPIDJSON_PARSE_ERROR(kParseErrorStringInvalidEncoding, is.Tell()); + } + else { + size_t offset = is.Tell(); + if (RAPIDJSON_UNLIKELY((parseFlags & kParseValidateEncodingFlag ? + !Transcoder::Validate(is, os) : + !Transcoder::Transcode(is, os)))) + RAPIDJSON_PARSE_ERROR(kParseErrorStringInvalidEncoding, offset); + } + } + } + + template + static RAPIDJSON_FORCEINLINE void ScanCopyUnescapedString(InputStream&, OutputStream&) { + // Do nothing for generic version + } + +#if defined(RAPIDJSON_SSE2) || defined(RAPIDJSON_SSE42) + // StringStream -> StackStream + static RAPIDJSON_FORCEINLINE void ScanCopyUnescapedString(StringStream& is, StackStream& os) { + const char* p = is.src_; + + // Scan one by one until alignment (unaligned load may cross page boundary and cause crash) + const char* nextAligned = reinterpret_cast((reinterpret_cast(p) + 15) & static_cast(~15)); + while (p != nextAligned) + if (RAPIDJSON_UNLIKELY(*p == '\"') || RAPIDJSON_UNLIKELY(*p == '\\') || RAPIDJSON_UNLIKELY(static_cast(*p) < 0x20)) { + is.src_ = p; + return; + } + else + os.Put(*p++); + + // The rest of string using SIMD + static const char dquote[16] = { '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"' }; + static const char bslash[16] = { '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\' }; + static const char space[16] = { 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F }; + const __m128i dq = _mm_loadu_si128(reinterpret_cast(&dquote[0])); + const __m128i bs = _mm_loadu_si128(reinterpret_cast(&bslash[0])); + const __m128i sp = _mm_loadu_si128(reinterpret_cast(&space[0])); + + for (;; p += 16) { + const __m128i s = _mm_load_si128(reinterpret_cast(p)); + const __m128i t1 = _mm_cmpeq_epi8(s, dq); + const __m128i t2 = _mm_cmpeq_epi8(s, bs); + const __m128i t3 = _mm_cmpeq_epi8(_mm_max_epu8(s, sp), sp); // s < 0x20 <=> max(s, 0x1F) == 0x1F + const __m128i x = _mm_or_si128(_mm_or_si128(t1, t2), t3); + unsigned short r = static_cast(_mm_movemask_epi8(x)); + if (RAPIDJSON_UNLIKELY(r != 0)) { // some of characters is escaped + SizeType length; + #ifdef _MSC_VER // Find the index of first escaped + unsigned long offset; + _BitScanForward(&offset, r); + length = offset; + #else + length = static_cast(__builtin_ffs(r) - 1); + #endif + if (length != 0) { + char* q = reinterpret_cast(os.Push(length)); + for (size_t i = 0; i < length; i++) + q[i] = p[i]; + + p += length; + } + break; + } + _mm_storeu_si128(reinterpret_cast<__m128i *>(os.Push(16)), s); + } + + is.src_ = p; + } + + // InsituStringStream -> InsituStringStream + static RAPIDJSON_FORCEINLINE void ScanCopyUnescapedString(InsituStringStream& is, InsituStringStream& os) { + RAPIDJSON_ASSERT(&is == &os); + (void)os; + + if (is.src_ == is.dst_) { + SkipUnescapedString(is); + return; + } + + char* p = is.src_; + char *q = is.dst_; + + // Scan one by one until alignment (unaligned load may cross page boundary and cause crash) + const char* nextAligned = reinterpret_cast((reinterpret_cast(p) + 15) & static_cast(~15)); + while (p != nextAligned) + if (RAPIDJSON_UNLIKELY(*p == '\"') || RAPIDJSON_UNLIKELY(*p == '\\') || RAPIDJSON_UNLIKELY(static_cast(*p) < 0x20)) { + is.src_ = p; + is.dst_ = q; + return; + } + else + *q++ = *p++; + + // The rest of string using SIMD + static const char dquote[16] = { '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"' }; + static const char bslash[16] = { '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\' }; + static const char space[16] = { 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F }; + const __m128i dq = _mm_loadu_si128(reinterpret_cast(&dquote[0])); + const __m128i bs = _mm_loadu_si128(reinterpret_cast(&bslash[0])); + const __m128i sp = _mm_loadu_si128(reinterpret_cast(&space[0])); + + for (;; p += 16, q += 16) { + const __m128i s = _mm_load_si128(reinterpret_cast(p)); + const __m128i t1 = _mm_cmpeq_epi8(s, dq); + const __m128i t2 = _mm_cmpeq_epi8(s, bs); + const __m128i t3 = _mm_cmpeq_epi8(_mm_max_epu8(s, sp), sp); // s < 0x20 <=> max(s, 0x1F) == 0x1F + const __m128i x = _mm_or_si128(_mm_or_si128(t1, t2), t3); + unsigned short r = static_cast(_mm_movemask_epi8(x)); + if (RAPIDJSON_UNLIKELY(r != 0)) { // some of characters is escaped + size_t length; +#ifdef _MSC_VER // Find the index of first escaped + unsigned long offset; + _BitScanForward(&offset, r); + length = offset; +#else + length = static_cast(__builtin_ffs(r) - 1); +#endif + for (const char* pend = p + length; p != pend; ) + *q++ = *p++; + break; + } + _mm_storeu_si128(reinterpret_cast<__m128i *>(q), s); + } + + is.src_ = p; + is.dst_ = q; + } + + // When read/write pointers are the same for insitu stream, just skip unescaped characters + static RAPIDJSON_FORCEINLINE void SkipUnescapedString(InsituStringStream& is) { + RAPIDJSON_ASSERT(is.src_ == is.dst_); + char* p = is.src_; + + // Scan one by one until alignment (unaligned load may cross page boundary and cause crash) + const char* nextAligned = reinterpret_cast((reinterpret_cast(p) + 15) & static_cast(~15)); + for (; p != nextAligned; p++) + if (RAPIDJSON_UNLIKELY(*p == '\"') || RAPIDJSON_UNLIKELY(*p == '\\') || RAPIDJSON_UNLIKELY(static_cast(*p) < 0x20)) { + is.src_ = is.dst_ = p; + return; + } + + // The rest of string using SIMD + static const char dquote[16] = { '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"' }; + static const char bslash[16] = { '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\' }; + static const char space[16] = { 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F }; + const __m128i dq = _mm_loadu_si128(reinterpret_cast(&dquote[0])); + const __m128i bs = _mm_loadu_si128(reinterpret_cast(&bslash[0])); + const __m128i sp = _mm_loadu_si128(reinterpret_cast(&space[0])); + + for (;; p += 16) { + const __m128i s = _mm_load_si128(reinterpret_cast(p)); + const __m128i t1 = _mm_cmpeq_epi8(s, dq); + const __m128i t2 = _mm_cmpeq_epi8(s, bs); + const __m128i t3 = _mm_cmpeq_epi8(_mm_max_epu8(s, sp), sp); // s < 0x20 <=> max(s, 0x1F) == 0x1F + const __m128i x = _mm_or_si128(_mm_or_si128(t1, t2), t3); + unsigned short r = static_cast(_mm_movemask_epi8(x)); + if (RAPIDJSON_UNLIKELY(r != 0)) { // some of characters is escaped + size_t length; +#ifdef _MSC_VER // Find the index of first escaped + unsigned long offset; + _BitScanForward(&offset, r); + length = offset; +#else + length = static_cast(__builtin_ffs(r) - 1); +#endif + p += length; + break; + } + } + + is.src_ = is.dst_ = p; + } +#elif defined(RAPIDJSON_NEON) + // StringStream -> StackStream + static RAPIDJSON_FORCEINLINE void ScanCopyUnescapedString(StringStream& is, StackStream& os) { + const char* p = is.src_; + + // Scan one by one until alignment (unaligned load may cross page boundary and cause crash) + const char* nextAligned = reinterpret_cast((reinterpret_cast(p) + 15) & static_cast(~15)); + while (p != nextAligned) + if (RAPIDJSON_UNLIKELY(*p == '\"') || RAPIDJSON_UNLIKELY(*p == '\\') || RAPIDJSON_UNLIKELY(static_cast(*p) < 0x20)) { + is.src_ = p; + return; + } + else + os.Put(*p++); + + // The rest of string using SIMD + const uint8x16_t s0 = vmovq_n_u8('"'); + const uint8x16_t s1 = vmovq_n_u8('\\'); + const uint8x16_t s2 = vmovq_n_u8('\b'); + const uint8x16_t s3 = vmovq_n_u8(32); + + for (;; p += 16) { + const uint8x16_t s = vld1q_u8(reinterpret_cast(p)); + uint8x16_t x = vceqq_u8(s, s0); + x = vorrq_u8(x, vceqq_u8(s, s1)); + x = vorrq_u8(x, vceqq_u8(s, s2)); + x = vorrq_u8(x, vcltq_u8(s, s3)); + + x = vrev64q_u8(x); // Rev in 64 + uint64_t low = vgetq_lane_u64(vreinterpretq_u64_u8(x), 0); // extract + uint64_t high = vgetq_lane_u64(vreinterpretq_u64_u8(x), 1); // extract + + SizeType length = 0; + bool escaped = false; + if (low == 0) { + if (high != 0) { + uint32_t lz = internal::clzll(high); + length = 8 + (lz >> 3); + escaped = true; + } + } else { + uint32_t lz = internal::clzll(low); + length = lz >> 3; + escaped = true; + } + if (RAPIDJSON_UNLIKELY(escaped)) { // some of characters is escaped + if (length != 0) { + char* q = reinterpret_cast(os.Push(length)); + for (size_t i = 0; i < length; i++) + q[i] = p[i]; + + p += length; + } + break; + } + vst1q_u8(reinterpret_cast(os.Push(16)), s); + } + + is.src_ = p; + } + + // InsituStringStream -> InsituStringStream + static RAPIDJSON_FORCEINLINE void ScanCopyUnescapedString(InsituStringStream& is, InsituStringStream& os) { + RAPIDJSON_ASSERT(&is == &os); + (void)os; + + if (is.src_ == is.dst_) { + SkipUnescapedString(is); + return; + } + + char* p = is.src_; + char *q = is.dst_; + + // Scan one by one until alignment (unaligned load may cross page boundary and cause crash) + const char* nextAligned = reinterpret_cast((reinterpret_cast(p) + 15) & static_cast(~15)); + while (p != nextAligned) + if (RAPIDJSON_UNLIKELY(*p == '\"') || RAPIDJSON_UNLIKELY(*p == '\\') || RAPIDJSON_UNLIKELY(static_cast(*p) < 0x20)) { + is.src_ = p; + is.dst_ = q; + return; + } + else + *q++ = *p++; + + // The rest of string using SIMD + const uint8x16_t s0 = vmovq_n_u8('"'); + const uint8x16_t s1 = vmovq_n_u8('\\'); + const uint8x16_t s2 = vmovq_n_u8('\b'); + const uint8x16_t s3 = vmovq_n_u8(32); + + for (;; p += 16, q += 16) { + const uint8x16_t s = vld1q_u8(reinterpret_cast(p)); + uint8x16_t x = vceqq_u8(s, s0); + x = vorrq_u8(x, vceqq_u8(s, s1)); + x = vorrq_u8(x, vceqq_u8(s, s2)); + x = vorrq_u8(x, vcltq_u8(s, s3)); + + x = vrev64q_u8(x); // Rev in 64 + uint64_t low = vgetq_lane_u64(vreinterpretq_u64_u8(x), 0); // extract + uint64_t high = vgetq_lane_u64(vreinterpretq_u64_u8(x), 1); // extract + + SizeType length = 0; + bool escaped = false; + if (low == 0) { + if (high != 0) { + uint32_t lz = internal::clzll(high); + length = 8 + (lz >> 3); + escaped = true; + } + } else { + uint32_t lz = internal::clzll(low); + length = lz >> 3; + escaped = true; + } + if (RAPIDJSON_UNLIKELY(escaped)) { // some of characters is escaped + for (const char* pend = p + length; p != pend; ) { + *q++ = *p++; + } + break; + } + vst1q_u8(reinterpret_cast(q), s); + } + + is.src_ = p; + is.dst_ = q; + } + + // When read/write pointers are the same for insitu stream, just skip unescaped characters + static RAPIDJSON_FORCEINLINE void SkipUnescapedString(InsituStringStream& is) { + RAPIDJSON_ASSERT(is.src_ == is.dst_); + char* p = is.src_; + + // Scan one by one until alignment (unaligned load may cross page boundary and cause crash) + const char* nextAligned = reinterpret_cast((reinterpret_cast(p) + 15) & static_cast(~15)); + for (; p != nextAligned; p++) + if (RAPIDJSON_UNLIKELY(*p == '\"') || RAPIDJSON_UNLIKELY(*p == '\\') || RAPIDJSON_UNLIKELY(static_cast(*p) < 0x20)) { + is.src_ = is.dst_ = p; + return; + } + + // The rest of string using SIMD + const uint8x16_t s0 = vmovq_n_u8('"'); + const uint8x16_t s1 = vmovq_n_u8('\\'); + const uint8x16_t s2 = vmovq_n_u8('\b'); + const uint8x16_t s3 = vmovq_n_u8(32); + + for (;; p += 16) { + const uint8x16_t s = vld1q_u8(reinterpret_cast(p)); + uint8x16_t x = vceqq_u8(s, s0); + x = vorrq_u8(x, vceqq_u8(s, s1)); + x = vorrq_u8(x, vceqq_u8(s, s2)); + x = vorrq_u8(x, vcltq_u8(s, s3)); + + x = vrev64q_u8(x); // Rev in 64 + uint64_t low = vgetq_lane_u64(vreinterpretq_u64_u8(x), 0); // extract + uint64_t high = vgetq_lane_u64(vreinterpretq_u64_u8(x), 1); // extract + + if (low == 0) { + if (high != 0) { + uint32_t lz = internal::clzll(high); + p += 8 + (lz >> 3); + break; + } + } else { + uint32_t lz = internal::clzll(low); + p += lz >> 3; + break; + } + } + + is.src_ = is.dst_ = p; + } +#endif // RAPIDJSON_NEON + + template + class NumberStream; + + template + class NumberStream { + public: + typedef typename InputStream::Ch Ch; + + NumberStream(GenericReader& reader, InputStream& s) : is(s) { (void)reader; } + + RAPIDJSON_FORCEINLINE Ch Peek() const { return is.Peek(); } + RAPIDJSON_FORCEINLINE Ch TakePush() { return is.Take(); } + RAPIDJSON_FORCEINLINE Ch Take() { return is.Take(); } + RAPIDJSON_FORCEINLINE void Push(char) {} + + size_t Tell() { return is.Tell(); } + size_t Length() { return 0; } + const StackCharacter* Pop() { return 0; } + + protected: + NumberStream& operator=(const NumberStream&); + + InputStream& is; + }; + + template + class NumberStream : public NumberStream { + typedef NumberStream Base; + public: + NumberStream(GenericReader& reader, InputStream& s) : Base(reader, s), stackStream(reader.stack_) {} + + RAPIDJSON_FORCEINLINE Ch TakePush() { + stackStream.Put(static_cast(Base::is.Peek())); + return Base::is.Take(); + } + + RAPIDJSON_FORCEINLINE void Push(StackCharacter c) { + stackStream.Put(c); + } + + size_t Length() { return stackStream.Length(); } + + const StackCharacter* Pop() { + stackStream.Put('\0'); + return stackStream.Pop(); + } + + private: + StackStream stackStream; + }; + + template + class NumberStream : public NumberStream { + typedef NumberStream Base; + public: + NumberStream(GenericReader& reader, InputStream& s) : Base(reader, s) {} + + RAPIDJSON_FORCEINLINE Ch Take() { return Base::TakePush(); } + }; + + template + void ParseNumber(InputStream& is, Handler& handler) { + typedef typename internal::SelectIf, typename TargetEncoding::Ch, char>::Type NumberCharacter; + + internal::StreamLocalCopy copy(is); + NumberStream s(*this, copy.s); + + size_t startOffset = s.Tell(); + double d = 0.0; + bool useNanOrInf = false; + + // Parse minus + bool minus = Consume(s, '-'); + + // Parse int: zero / ( digit1-9 *DIGIT ) + unsigned i = 0; + uint64_t i64 = 0; + bool use64bit = false; + int significandDigit = 0; + if (RAPIDJSON_UNLIKELY(s.Peek() == '0')) { + i = 0; + s.TakePush(); + } + else if (RAPIDJSON_LIKELY(s.Peek() >= '1' && s.Peek() <= '9')) { + i = static_cast(s.TakePush() - '0'); + + if (minus) + while (RAPIDJSON_LIKELY(s.Peek() >= '0' && s.Peek() <= '9')) { + if (RAPIDJSON_UNLIKELY(i >= 214748364)) { // 2^31 = 2147483648 + if (RAPIDJSON_LIKELY(i != 214748364 || s.Peek() > '8')) { + i64 = i; + use64bit = true; + break; + } + } + i = i * 10 + static_cast(s.TakePush() - '0'); + significandDigit++; + } + else + while (RAPIDJSON_LIKELY(s.Peek() >= '0' && s.Peek() <= '9')) { + if (RAPIDJSON_UNLIKELY(i >= 429496729)) { // 2^32 - 1 = 4294967295 + if (RAPIDJSON_LIKELY(i != 429496729 || s.Peek() > '5')) { + i64 = i; + use64bit = true; + break; + } + } + i = i * 10 + static_cast(s.TakePush() - '0'); + significandDigit++; + } + } + // Parse NaN or Infinity here + else if ((parseFlags & kParseNanAndInfFlag) && RAPIDJSON_LIKELY((s.Peek() == 'I' || s.Peek() == 'N'))) { + if (Consume(s, 'N')) { + if (Consume(s, 'a') && Consume(s, 'N')) { + d = std::numeric_limits::quiet_NaN(); + useNanOrInf = true; + } + } + else if (RAPIDJSON_LIKELY(Consume(s, 'I'))) { + if (Consume(s, 'n') && Consume(s, 'f')) { + d = (minus ? -std::numeric_limits::infinity() : std::numeric_limits::infinity()); + useNanOrInf = true; + + if (RAPIDJSON_UNLIKELY(s.Peek() == 'i' && !(Consume(s, 'i') && Consume(s, 'n') + && Consume(s, 'i') && Consume(s, 't') && Consume(s, 'y')))) { + RAPIDJSON_PARSE_ERROR(kParseErrorValueInvalid, s.Tell()); + } + } + } + + if (RAPIDJSON_UNLIKELY(!useNanOrInf)) { + RAPIDJSON_PARSE_ERROR(kParseErrorValueInvalid, s.Tell()); + } + } + else + RAPIDJSON_PARSE_ERROR(kParseErrorValueInvalid, s.Tell()); + + // Parse 64bit int + bool useDouble = false; + if (use64bit) { + if (minus) + while (RAPIDJSON_LIKELY(s.Peek() >= '0' && s.Peek() <= '9')) { + if (RAPIDJSON_UNLIKELY(i64 >= RAPIDJSON_UINT64_C2(0x0CCCCCCC, 0xCCCCCCCC))) // 2^63 = 9223372036854775808 + if (RAPIDJSON_LIKELY(i64 != RAPIDJSON_UINT64_C2(0x0CCCCCCC, 0xCCCCCCCC) || s.Peek() > '8')) { + d = static_cast(i64); + useDouble = true; + break; + } + i64 = i64 * 10 + static_cast(s.TakePush() - '0'); + significandDigit++; + } + else + while (RAPIDJSON_LIKELY(s.Peek() >= '0' && s.Peek() <= '9')) { + if (RAPIDJSON_UNLIKELY(i64 >= RAPIDJSON_UINT64_C2(0x19999999, 0x99999999))) // 2^64 - 1 = 18446744073709551615 + if (RAPIDJSON_LIKELY(i64 != RAPIDJSON_UINT64_C2(0x19999999, 0x99999999) || s.Peek() > '5')) { + d = static_cast(i64); + useDouble = true; + break; + } + i64 = i64 * 10 + static_cast(s.TakePush() - '0'); + significandDigit++; + } + } + + // Force double for big integer + if (useDouble) { + while (RAPIDJSON_LIKELY(s.Peek() >= '0' && s.Peek() <= '9')) { + d = d * 10 + (s.TakePush() - '0'); + } + } + + // Parse frac = decimal-point 1*DIGIT + int expFrac = 0; + size_t decimalPosition; + if (Consume(s, '.')) { + decimalPosition = s.Length(); + + if (RAPIDJSON_UNLIKELY(!(s.Peek() >= '0' && s.Peek() <= '9'))) + RAPIDJSON_PARSE_ERROR(kParseErrorNumberMissFraction, s.Tell()); + + if (!useDouble) { +#if RAPIDJSON_64BIT + // Use i64 to store significand in 64-bit architecture + if (!use64bit) + i64 = i; + + while (RAPIDJSON_LIKELY(s.Peek() >= '0' && s.Peek() <= '9')) { + if (i64 > RAPIDJSON_UINT64_C2(0x1FFFFF, 0xFFFFFFFF)) // 2^53 - 1 for fast path + break; + else { + i64 = i64 * 10 + static_cast(s.TakePush() - '0'); + --expFrac; + if (i64 != 0) + significandDigit++; + } + } + + d = static_cast(i64); +#else + // Use double to store significand in 32-bit architecture + d = static_cast(use64bit ? i64 : i); +#endif + useDouble = true; + } + + while (RAPIDJSON_LIKELY(s.Peek() >= '0' && s.Peek() <= '9')) { + if (significandDigit < 17) { + d = d * 10.0 + (s.TakePush() - '0'); + --expFrac; + if (RAPIDJSON_LIKELY(d > 0.0)) + significandDigit++; + } + else + s.TakePush(); + } + } + else + decimalPosition = s.Length(); // decimal position at the end of integer. + + // Parse exp = e [ minus / plus ] 1*DIGIT + int exp = 0; + if (Consume(s, 'e') || Consume(s, 'E')) { + if (!useDouble) { + d = static_cast(use64bit ? i64 : i); + useDouble = true; + } + + bool expMinus = false; + if (Consume(s, '+')) + ; + else if (Consume(s, '-')) + expMinus = true; + + if (RAPIDJSON_LIKELY(s.Peek() >= '0' && s.Peek() <= '9')) { + exp = static_cast(s.Take() - '0'); + if (expMinus) { + // (exp + expFrac) must not underflow int => we're detecting when -exp gets + // dangerously close to INT_MIN (a pessimistic next digit 9 would push it into + // underflow territory): + // + // -(exp * 10 + 9) + expFrac >= INT_MIN + // <=> exp <= (expFrac - INT_MIN - 9) / 10 + RAPIDJSON_ASSERT(expFrac <= 0); + int maxExp = (expFrac + 2147483639) / 10; + + while (RAPIDJSON_LIKELY(s.Peek() >= '0' && s.Peek() <= '9')) { + exp = exp * 10 + static_cast(s.Take() - '0'); + if (RAPIDJSON_UNLIKELY(exp > maxExp)) { + while (RAPIDJSON_UNLIKELY(s.Peek() >= '0' && s.Peek() <= '9')) // Consume the rest of exponent + s.Take(); + } + } + } + else { // positive exp + int maxExp = 308 - expFrac; + while (RAPIDJSON_LIKELY(s.Peek() >= '0' && s.Peek() <= '9')) { + exp = exp * 10 + static_cast(s.Take() - '0'); + if (RAPIDJSON_UNLIKELY(exp > maxExp)) + RAPIDJSON_PARSE_ERROR(kParseErrorNumberTooBig, startOffset); + } + } + } + else + RAPIDJSON_PARSE_ERROR(kParseErrorNumberMissExponent, s.Tell()); + + if (expMinus) + exp = -exp; + } + + // Finish parsing, call event according to the type of number. + bool cont = true; + + if (parseFlags & kParseNumbersAsStringsFlag) { + if (parseFlags & kParseInsituFlag) { + s.Pop(); // Pop stack no matter if it will be used or not. + typename InputStream::Ch* head = is.PutBegin(); + const size_t length = s.Tell() - startOffset; + RAPIDJSON_ASSERT(length <= 0xFFFFFFFF); + // unable to insert the \0 character here, it will erase the comma after this number + const typename TargetEncoding::Ch* const str = reinterpret_cast(head); + cont = handler.RawNumber(str, SizeType(length), false); + } + else { + SizeType numCharsToCopy = static_cast(s.Length()); + GenericStringStream > srcStream(s.Pop()); + StackStream dstStream(stack_); + while (numCharsToCopy--) { + Transcoder, TargetEncoding>::Transcode(srcStream, dstStream); + } + dstStream.Put('\0'); + const typename TargetEncoding::Ch* str = dstStream.Pop(); + const SizeType length = static_cast(dstStream.Length()) - 1; + cont = handler.RawNumber(str, SizeType(length), true); + } + } + else { + size_t length = s.Length(); + const NumberCharacter* decimal = s.Pop(); // Pop stack no matter if it will be used or not. + + if (useDouble) { + int p = exp + expFrac; + if (parseFlags & kParseFullPrecisionFlag) + d = internal::StrtodFullPrecision(d, p, decimal, length, decimalPosition, exp); + else + d = internal::StrtodNormalPrecision(d, p); + + // Use > max, instead of == inf, to fix bogus warning -Wfloat-equal + if (d > (std::numeric_limits::max)()) { + // Overflow + // TODO: internal::StrtodX should report overflow (or underflow) + RAPIDJSON_PARSE_ERROR(kParseErrorNumberTooBig, startOffset); + } + + cont = handler.Double(minus ? -d : d); + } + else if (useNanOrInf) { + cont = handler.Double(d); + } + else { + if (use64bit) { + if (minus) + cont = handler.Int64(static_cast(~i64 + 1)); + else + cont = handler.Uint64(i64); + } + else { + if (minus) + cont = handler.Int(static_cast(~i + 1)); + else + cont = handler.Uint(i); + } + } + } + if (RAPIDJSON_UNLIKELY(!cont)) + RAPIDJSON_PARSE_ERROR(kParseErrorTermination, startOffset); + } + + // Parse any JSON value + template + void ParseValue(InputStream& is, Handler& handler) { + switch (is.Peek()) { + case 'n': ParseNull (is, handler); break; + case 't': ParseTrue (is, handler); break; + case 'f': ParseFalse (is, handler); break; + case '"': ParseString(is, handler); break; + case '{': ParseObject(is, handler); break; + case '[': ParseArray (is, handler); break; + default : + ParseNumber(is, handler); + break; + + } + } + + // Iterative Parsing + + // States + enum IterativeParsingState { + IterativeParsingFinishState = 0, // sink states at top + IterativeParsingErrorState, // sink states at top + IterativeParsingStartState, + + // Object states + IterativeParsingObjectInitialState, + IterativeParsingMemberKeyState, + IterativeParsingMemberValueState, + IterativeParsingObjectFinishState, + + // Array states + IterativeParsingArrayInitialState, + IterativeParsingElementState, + IterativeParsingArrayFinishState, + + // Single value state + IterativeParsingValueState, + + // Delimiter states (at bottom) + IterativeParsingElementDelimiterState, + IterativeParsingMemberDelimiterState, + IterativeParsingKeyValueDelimiterState, + + cIterativeParsingStateCount + }; + + // Tokens + enum Token { + LeftBracketToken = 0, + RightBracketToken, + + LeftCurlyBracketToken, + RightCurlyBracketToken, + + CommaToken, + ColonToken, + + StringToken, + FalseToken, + TrueToken, + NullToken, + NumberToken, + + kTokenCount + }; + + RAPIDJSON_FORCEINLINE Token Tokenize(Ch c) const { + +//!@cond RAPIDJSON_HIDDEN_FROM_DOXYGEN +#define N NumberToken +#define N16 N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N + // Maps from ASCII to Token + static const unsigned char tokenMap[256] = { + N16, // 00~0F + N16, // 10~1F + N, N, StringToken, N, N, N, N, N, N, N, N, N, CommaToken, N, N, N, // 20~2F + N, N, N, N, N, N, N, N, N, N, ColonToken, N, N, N, N, N, // 30~3F + N16, // 40~4F + N, N, N, N, N, N, N, N, N, N, N, LeftBracketToken, N, RightBracketToken, N, N, // 50~5F + N, N, N, N, N, N, FalseToken, N, N, N, N, N, N, N, NullToken, N, // 60~6F + N, N, N, N, TrueToken, N, N, N, N, N, N, LeftCurlyBracketToken, N, RightCurlyBracketToken, N, N, // 70~7F + N16, N16, N16, N16, N16, N16, N16, N16 // 80~FF + }; +#undef N +#undef N16 +//!@endcond + + if (sizeof(Ch) == 1 || static_cast(c) < 256) + return static_cast(tokenMap[static_cast(c)]); + else + return NumberToken; + } + + RAPIDJSON_FORCEINLINE IterativeParsingState Predict(IterativeParsingState state, Token token) const { + // current state x one lookahead token -> new state + static const char G[cIterativeParsingStateCount][kTokenCount] = { + // Finish(sink state) + { + IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, + IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, + IterativeParsingErrorState + }, + // Error(sink state) + { + IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, + IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, + IterativeParsingErrorState + }, + // Start + { + IterativeParsingArrayInitialState, // Left bracket + IterativeParsingErrorState, // Right bracket + IterativeParsingObjectInitialState, // Left curly bracket + IterativeParsingErrorState, // Right curly bracket + IterativeParsingErrorState, // Comma + IterativeParsingErrorState, // Colon + IterativeParsingValueState, // String + IterativeParsingValueState, // False + IterativeParsingValueState, // True + IterativeParsingValueState, // Null + IterativeParsingValueState // Number + }, + // ObjectInitial + { + IterativeParsingErrorState, // Left bracket + IterativeParsingErrorState, // Right bracket + IterativeParsingErrorState, // Left curly bracket + IterativeParsingObjectFinishState, // Right curly bracket + IterativeParsingErrorState, // Comma + IterativeParsingErrorState, // Colon + IterativeParsingMemberKeyState, // String + IterativeParsingErrorState, // False + IterativeParsingErrorState, // True + IterativeParsingErrorState, // Null + IterativeParsingErrorState // Number + }, + // MemberKey + { + IterativeParsingErrorState, // Left bracket + IterativeParsingErrorState, // Right bracket + IterativeParsingErrorState, // Left curly bracket + IterativeParsingErrorState, // Right curly bracket + IterativeParsingErrorState, // Comma + IterativeParsingKeyValueDelimiterState, // Colon + IterativeParsingErrorState, // String + IterativeParsingErrorState, // False + IterativeParsingErrorState, // True + IterativeParsingErrorState, // Null + IterativeParsingErrorState // Number + }, + // MemberValue + { + IterativeParsingErrorState, // Left bracket + IterativeParsingErrorState, // Right bracket + IterativeParsingErrorState, // Left curly bracket + IterativeParsingObjectFinishState, // Right curly bracket + IterativeParsingMemberDelimiterState, // Comma + IterativeParsingErrorState, // Colon + IterativeParsingErrorState, // String + IterativeParsingErrorState, // False + IterativeParsingErrorState, // True + IterativeParsingErrorState, // Null + IterativeParsingErrorState // Number + }, + // ObjectFinish(sink state) + { + IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, + IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, + IterativeParsingErrorState + }, + // ArrayInitial + { + IterativeParsingArrayInitialState, // Left bracket(push Element state) + IterativeParsingArrayFinishState, // Right bracket + IterativeParsingObjectInitialState, // Left curly bracket(push Element state) + IterativeParsingErrorState, // Right curly bracket + IterativeParsingErrorState, // Comma + IterativeParsingErrorState, // Colon + IterativeParsingElementState, // String + IterativeParsingElementState, // False + IterativeParsingElementState, // True + IterativeParsingElementState, // Null + IterativeParsingElementState // Number + }, + // Element + { + IterativeParsingErrorState, // Left bracket + IterativeParsingArrayFinishState, // Right bracket + IterativeParsingErrorState, // Left curly bracket + IterativeParsingErrorState, // Right curly bracket + IterativeParsingElementDelimiterState, // Comma + IterativeParsingErrorState, // Colon + IterativeParsingErrorState, // String + IterativeParsingErrorState, // False + IterativeParsingErrorState, // True + IterativeParsingErrorState, // Null + IterativeParsingErrorState // Number + }, + // ArrayFinish(sink state) + { + IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, + IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, + IterativeParsingErrorState + }, + // Single Value (sink state) + { + IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, + IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, + IterativeParsingErrorState + }, + // ElementDelimiter + { + IterativeParsingArrayInitialState, // Left bracket(push Element state) + IterativeParsingArrayFinishState, // Right bracket + IterativeParsingObjectInitialState, // Left curly bracket(push Element state) + IterativeParsingErrorState, // Right curly bracket + IterativeParsingErrorState, // Comma + IterativeParsingErrorState, // Colon + IterativeParsingElementState, // String + IterativeParsingElementState, // False + IterativeParsingElementState, // True + IterativeParsingElementState, // Null + IterativeParsingElementState // Number + }, + // MemberDelimiter + { + IterativeParsingErrorState, // Left bracket + IterativeParsingErrorState, // Right bracket + IterativeParsingErrorState, // Left curly bracket + IterativeParsingObjectFinishState, // Right curly bracket + IterativeParsingErrorState, // Comma + IterativeParsingErrorState, // Colon + IterativeParsingMemberKeyState, // String + IterativeParsingErrorState, // False + IterativeParsingErrorState, // True + IterativeParsingErrorState, // Null + IterativeParsingErrorState // Number + }, + // KeyValueDelimiter + { + IterativeParsingArrayInitialState, // Left bracket(push MemberValue state) + IterativeParsingErrorState, // Right bracket + IterativeParsingObjectInitialState, // Left curly bracket(push MemberValue state) + IterativeParsingErrorState, // Right curly bracket + IterativeParsingErrorState, // Comma + IterativeParsingErrorState, // Colon + IterativeParsingMemberValueState, // String + IterativeParsingMemberValueState, // False + IterativeParsingMemberValueState, // True + IterativeParsingMemberValueState, // Null + IterativeParsingMemberValueState // Number + }, + }; // End of G + + return static_cast(G[state][token]); + } + + // Make an advance in the token stream and state based on the candidate destination state which was returned by Transit(). + // May return a new state on state pop. + template + RAPIDJSON_FORCEINLINE IterativeParsingState Transit(IterativeParsingState src, Token token, IterativeParsingState dst, InputStream& is, Handler& handler) { + (void)token; + + switch (dst) { + case IterativeParsingErrorState: + return dst; + + case IterativeParsingObjectInitialState: + case IterativeParsingArrayInitialState: + { + // Push the state(Element or MemeberValue) if we are nested in another array or value of member. + // In this way we can get the correct state on ObjectFinish or ArrayFinish by frame pop. + IterativeParsingState n = src; + if (src == IterativeParsingArrayInitialState || src == IterativeParsingElementDelimiterState) + n = IterativeParsingElementState; + else if (src == IterativeParsingKeyValueDelimiterState) + n = IterativeParsingMemberValueState; + // Push current state. + *stack_.template Push(1) = n; + // Initialize and push the member/element count. + *stack_.template Push(1) = 0; + // Call handler + bool hr = (dst == IterativeParsingObjectInitialState) ? handler.StartObject() : handler.StartArray(); + // On handler short circuits the parsing. + if (!hr) { + RAPIDJSON_PARSE_ERROR_NORETURN(kParseErrorTermination, is.Tell()); + return IterativeParsingErrorState; + } + else { + is.Take(); + return dst; + } + } + + case IterativeParsingMemberKeyState: + ParseString(is, handler, true); + if (HasParseError()) + return IterativeParsingErrorState; + else + return dst; + + case IterativeParsingKeyValueDelimiterState: + RAPIDJSON_ASSERT(token == ColonToken); + is.Take(); + return dst; + + case IterativeParsingMemberValueState: + // Must be non-compound value. Or it would be ObjectInitial or ArrayInitial state. + ParseValue(is, handler); + if (HasParseError()) { + return IterativeParsingErrorState; + } + return dst; + + case IterativeParsingElementState: + // Must be non-compound value. Or it would be ObjectInitial or ArrayInitial state. + ParseValue(is, handler); + if (HasParseError()) { + return IterativeParsingErrorState; + } + return dst; + + case IterativeParsingMemberDelimiterState: + case IterativeParsingElementDelimiterState: + is.Take(); + // Update member/element count. + *stack_.template Top() = *stack_.template Top() + 1; + return dst; + + case IterativeParsingObjectFinishState: + { + // Transit from delimiter is only allowed when trailing commas are enabled + if (!(parseFlags & kParseTrailingCommasFlag) && src == IterativeParsingMemberDelimiterState) { + RAPIDJSON_PARSE_ERROR_NORETURN(kParseErrorObjectMissName, is.Tell()); + return IterativeParsingErrorState; + } + // Get member count. + SizeType c = *stack_.template Pop(1); + // If the object is not empty, count the last member. + if (src == IterativeParsingMemberValueState) + ++c; + // Restore the state. + IterativeParsingState n = static_cast(*stack_.template Pop(1)); + // Transit to Finish state if this is the topmost scope. + if (n == IterativeParsingStartState) + n = IterativeParsingFinishState; + // Call handler + bool hr = handler.EndObject(c); + // On handler short circuits the parsing. + if (!hr) { + RAPIDJSON_PARSE_ERROR_NORETURN(kParseErrorTermination, is.Tell()); + return IterativeParsingErrorState; + } + else { + is.Take(); + return n; + } + } + + case IterativeParsingArrayFinishState: + { + // Transit from delimiter is only allowed when trailing commas are enabled + if (!(parseFlags & kParseTrailingCommasFlag) && src == IterativeParsingElementDelimiterState) { + RAPIDJSON_PARSE_ERROR_NORETURN(kParseErrorValueInvalid, is.Tell()); + return IterativeParsingErrorState; + } + // Get element count. + SizeType c = *stack_.template Pop(1); + // If the array is not empty, count the last element. + if (src == IterativeParsingElementState) + ++c; + // Restore the state. + IterativeParsingState n = static_cast(*stack_.template Pop(1)); + // Transit to Finish state if this is the topmost scope. + if (n == IterativeParsingStartState) + n = IterativeParsingFinishState; + // Call handler + bool hr = handler.EndArray(c); + // On handler short circuits the parsing. + if (!hr) { + RAPIDJSON_PARSE_ERROR_NORETURN(kParseErrorTermination, is.Tell()); + return IterativeParsingErrorState; + } + else { + is.Take(); + return n; + } + } + + default: + // This branch is for IterativeParsingValueState actually. + // Use `default:` rather than + // `case IterativeParsingValueState:` is for code coverage. + + // The IterativeParsingStartState is not enumerated in this switch-case. + // It is impossible for that case. And it can be caught by following assertion. + + // The IterativeParsingFinishState is not enumerated in this switch-case either. + // It is a "derivative" state which cannot triggered from Predict() directly. + // Therefore it cannot happen here. And it can be caught by following assertion. + RAPIDJSON_ASSERT(dst == IterativeParsingValueState); + + // Must be non-compound value. Or it would be ObjectInitial or ArrayInitial state. + ParseValue(is, handler); + if (HasParseError()) { + return IterativeParsingErrorState; + } + return IterativeParsingFinishState; + } + } + + template + void HandleError(IterativeParsingState src, InputStream& is) { + if (HasParseError()) { + // Error flag has been set. + return; + } + + switch (src) { + case IterativeParsingStartState: RAPIDJSON_PARSE_ERROR(kParseErrorDocumentEmpty, is.Tell()); return; + case IterativeParsingFinishState: RAPIDJSON_PARSE_ERROR(kParseErrorDocumentRootNotSingular, is.Tell()); return; + case IterativeParsingObjectInitialState: + case IterativeParsingMemberDelimiterState: RAPIDJSON_PARSE_ERROR(kParseErrorObjectMissName, is.Tell()); return; + case IterativeParsingMemberKeyState: RAPIDJSON_PARSE_ERROR(kParseErrorObjectMissColon, is.Tell()); return; + case IterativeParsingMemberValueState: RAPIDJSON_PARSE_ERROR(kParseErrorObjectMissCommaOrCurlyBracket, is.Tell()); return; + case IterativeParsingKeyValueDelimiterState: + case IterativeParsingArrayInitialState: + case IterativeParsingElementDelimiterState: RAPIDJSON_PARSE_ERROR(kParseErrorValueInvalid, is.Tell()); return; + default: RAPIDJSON_ASSERT(src == IterativeParsingElementState); RAPIDJSON_PARSE_ERROR(kParseErrorArrayMissCommaOrSquareBracket, is.Tell()); return; + } + } + + RAPIDJSON_FORCEINLINE bool IsIterativeParsingDelimiterState(IterativeParsingState s) const { + return s >= IterativeParsingElementDelimiterState; + } + + RAPIDJSON_FORCEINLINE bool IsIterativeParsingCompleteState(IterativeParsingState s) const { + return s <= IterativeParsingErrorState; + } + + template + ParseResult IterativeParse(InputStream& is, Handler& handler) { + parseResult_.Clear(); + ClearStackOnExit scope(*this); + IterativeParsingState state = IterativeParsingStartState; + + SkipWhitespaceAndComments(is); + RAPIDJSON_PARSE_ERROR_EARLY_RETURN(parseResult_); + while (is.Peek() != '\0') { + Token t = Tokenize(is.Peek()); + IterativeParsingState n = Predict(state, t); + IterativeParsingState d = Transit(state, t, n, is, handler); + + if (d == IterativeParsingErrorState) { + HandleError(state, is); + break; + } + + state = d; + + // Do not further consume streams if a root JSON has been parsed. + if ((parseFlags & kParseStopWhenDoneFlag) && state == IterativeParsingFinishState) + break; + + SkipWhitespaceAndComments(is); + RAPIDJSON_PARSE_ERROR_EARLY_RETURN(parseResult_); + } + + // Handle the end of file. + if (state != IterativeParsingFinishState) + HandleError(state, is); + + return parseResult_; + } + + static const size_t kDefaultStackCapacity = 256; //!< Default stack capacity in bytes for storing a single decoded string. + internal::Stack stack_; //!< A stack for storing decoded string temporarily during non-destructive parsing. + ParseResult parseResult_; + IterativeParsingState state_; +}; // class GenericReader + +//! Reader with UTF8 encoding and default allocator. +typedef GenericReader, UTF8<> > Reader; + +RAPIDJSON_NAMESPACE_END + +#if defined(__clang__) || defined(_MSC_VER) +RAPIDJSON_DIAG_POP +#endif + + +#ifdef __GNUC__ +RAPIDJSON_DIAG_POP +#endif + +#endif // RAPIDJSON_READER_H_ diff --git a/DFL_BOM_WL_TOERP/rapidjson/schema.h b/DFL_BOM_WL_TOERP/rapidjson/schema.h new file mode 100644 index 0000000..188d659 --- /dev/null +++ b/DFL_BOM_WL_TOERP/rapidjson/schema.h @@ -0,0 +1,2816 @@ +// Tencent is pleased to support the open source community by making RapidJSON available-> +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip-> All rights reserved-> +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License-> You may obtain a copy of the License at +// +// http://opensource->org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied-> See the License for the +// specific language governing permissions and limitations under the License-> + +#ifndef RAPIDJSON_SCHEMA_H_ +#define RAPIDJSON_SCHEMA_H_ + +#include "document.h" +#include "pointer.h" +#include "stringbuffer.h" +#include "error/en.h" +#include "uri.h" +#include // abs, floor + +#if !defined(RAPIDJSON_SCHEMA_USE_INTERNALREGEX) +#define RAPIDJSON_SCHEMA_USE_INTERNALREGEX 1 +#else +#define RAPIDJSON_SCHEMA_USE_INTERNALREGEX 0 +#endif + +#if !RAPIDJSON_SCHEMA_USE_INTERNALREGEX && defined(RAPIDJSON_SCHEMA_USE_STDREGEX) && (__cplusplus >=201103L || (defined(_MSC_VER) && _MSC_VER >= 1800)) +#define RAPIDJSON_SCHEMA_USE_STDREGEX 1 +#else +#define RAPIDJSON_SCHEMA_USE_STDREGEX 0 +#endif + +#if RAPIDJSON_SCHEMA_USE_INTERNALREGEX +#include "internal/regex.h" +#elif RAPIDJSON_SCHEMA_USE_STDREGEX +#include +#endif + +#if RAPIDJSON_SCHEMA_USE_INTERNALREGEX || RAPIDJSON_SCHEMA_USE_STDREGEX +#define RAPIDJSON_SCHEMA_HAS_REGEX 1 +#else +#define RAPIDJSON_SCHEMA_HAS_REGEX 0 +#endif + +#ifndef RAPIDJSON_SCHEMA_VERBOSE +#define RAPIDJSON_SCHEMA_VERBOSE 0 +#endif + +#if RAPIDJSON_SCHEMA_VERBOSE +#include "stringbuffer.h" +#endif + +RAPIDJSON_DIAG_PUSH + +#if defined(__GNUC__) +RAPIDJSON_DIAG_OFF(effc++) +#endif + +#ifdef __clang__ +RAPIDJSON_DIAG_OFF(weak-vtables) +RAPIDJSON_DIAG_OFF(exit-time-destructors) +RAPIDJSON_DIAG_OFF(c++98-compat-pedantic) +RAPIDJSON_DIAG_OFF(variadic-macros) +#elif defined(_MSC_VER) +RAPIDJSON_DIAG_OFF(4512) // assignment operator could not be generated +#endif + +RAPIDJSON_NAMESPACE_BEGIN + +/////////////////////////////////////////////////////////////////////////////// +// Verbose Utilities + +#if RAPIDJSON_SCHEMA_VERBOSE + +namespace internal { + +inline void PrintInvalidKeyword(const char* keyword) { + printf("Fail keyword: %s\n", keyword); +} + +inline void PrintInvalidKeyword(const wchar_t* keyword) { + wprintf(L"Fail keyword: %ls\n", keyword); +} + +inline void PrintInvalidDocument(const char* document) { + printf("Fail document: %s\n\n", document); +} + +inline void PrintInvalidDocument(const wchar_t* document) { + wprintf(L"Fail document: %ls\n\n", document); +} + +inline void PrintValidatorPointers(unsigned depth, const char* s, const char* d) { + printf("S: %*s%s\nD: %*s%s\n\n", depth * 4, " ", s, depth * 4, " ", d); +} + +inline void PrintValidatorPointers(unsigned depth, const wchar_t* s, const wchar_t* d) { + wprintf(L"S: %*ls%ls\nD: %*ls%ls\n\n", depth * 4, L" ", s, depth * 4, L" ", d); +} + +} // namespace internal + +#endif // RAPIDJSON_SCHEMA_VERBOSE + +/////////////////////////////////////////////////////////////////////////////// +// RAPIDJSON_INVALID_KEYWORD_RETURN + +#if RAPIDJSON_SCHEMA_VERBOSE +#define RAPIDJSON_INVALID_KEYWORD_VERBOSE(keyword) internal::PrintInvalidKeyword(keyword) +#else +#define RAPIDJSON_INVALID_KEYWORD_VERBOSE(keyword) +#endif + +#define RAPIDJSON_INVALID_KEYWORD_RETURN(code)\ +RAPIDJSON_MULTILINEMACRO_BEGIN\ + context.invalidCode = code;\ + context.invalidKeyword = SchemaType::GetValidateErrorKeyword(code).GetString();\ + RAPIDJSON_INVALID_KEYWORD_VERBOSE(context.invalidKeyword);\ + return false;\ +RAPIDJSON_MULTILINEMACRO_END + +/////////////////////////////////////////////////////////////////////////////// +// ValidateFlag + +/*! \def RAPIDJSON_VALIDATE_DEFAULT_FLAGS + \ingroup RAPIDJSON_CONFIG + \brief User-defined kValidateDefaultFlags definition. + + User can define this as any \c ValidateFlag combinations. +*/ +#ifndef RAPIDJSON_VALIDATE_DEFAULT_FLAGS +#define RAPIDJSON_VALIDATE_DEFAULT_FLAGS kValidateNoFlags +#endif + +//! Combination of validate flags +/*! \see + */ +enum ValidateFlag { + kValidateNoFlags = 0, //!< No flags are set. + kValidateContinueOnErrorFlag = 1, //!< Don't stop after first validation error. + kValidateDefaultFlags = RAPIDJSON_VALIDATE_DEFAULT_FLAGS //!< Default validate flags. Can be customized by defining RAPIDJSON_VALIDATE_DEFAULT_FLAGS +}; + +/////////////////////////////////////////////////////////////////////////////// +// Forward declarations + +template +class GenericSchemaDocument; + +namespace internal { + +template +class Schema; + +/////////////////////////////////////////////////////////////////////////////// +// ISchemaValidator + +class ISchemaValidator { +public: + virtual ~ISchemaValidator() {} + virtual bool IsValid() const = 0; + virtual void SetValidateFlags(unsigned flags) = 0; + virtual unsigned GetValidateFlags() const = 0; +}; + +/////////////////////////////////////////////////////////////////////////////// +// ISchemaStateFactory + +template +class ISchemaStateFactory { +public: + virtual ~ISchemaStateFactory() {} + virtual ISchemaValidator* CreateSchemaValidator(const SchemaType&, const bool inheritContinueOnErrors) = 0; + virtual void DestroySchemaValidator(ISchemaValidator* validator) = 0; + virtual void* CreateHasher() = 0; + virtual uint64_t GetHashCode(void* hasher) = 0; + virtual void DestroryHasher(void* hasher) = 0; + virtual void* MallocState(size_t size) = 0; + virtual void FreeState(void* p) = 0; +}; + +/////////////////////////////////////////////////////////////////////////////// +// IValidationErrorHandler + +template +class IValidationErrorHandler { +public: + typedef typename SchemaType::Ch Ch; + typedef typename SchemaType::SValue SValue; + + virtual ~IValidationErrorHandler() {} + + virtual void NotMultipleOf(int64_t actual, const SValue& expected) = 0; + virtual void NotMultipleOf(uint64_t actual, const SValue& expected) = 0; + virtual void NotMultipleOf(double actual, const SValue& expected) = 0; + virtual void AboveMaximum(int64_t actual, const SValue& expected, bool exclusive) = 0; + virtual void AboveMaximum(uint64_t actual, const SValue& expected, bool exclusive) = 0; + virtual void AboveMaximum(double actual, const SValue& expected, bool exclusive) = 0; + virtual void BelowMinimum(int64_t actual, const SValue& expected, bool exclusive) = 0; + virtual void BelowMinimum(uint64_t actual, const SValue& expected, bool exclusive) = 0; + virtual void BelowMinimum(double actual, const SValue& expected, bool exclusive) = 0; + + virtual void TooLong(const Ch* str, SizeType length, SizeType expected) = 0; + virtual void TooShort(const Ch* str, SizeType length, SizeType expected) = 0; + virtual void DoesNotMatch(const Ch* str, SizeType length) = 0; + + virtual void DisallowedItem(SizeType index) = 0; + virtual void TooFewItems(SizeType actualCount, SizeType expectedCount) = 0; + virtual void TooManyItems(SizeType actualCount, SizeType expectedCount) = 0; + virtual void DuplicateItems(SizeType index1, SizeType index2) = 0; + + virtual void TooManyProperties(SizeType actualCount, SizeType expectedCount) = 0; + virtual void TooFewProperties(SizeType actualCount, SizeType expectedCount) = 0; + virtual void StartMissingProperties() = 0; + virtual void AddMissingProperty(const SValue& name) = 0; + virtual bool EndMissingProperties() = 0; + virtual void PropertyViolations(ISchemaValidator** subvalidators, SizeType count) = 0; + virtual void DisallowedProperty(const Ch* name, SizeType length) = 0; + + virtual void StartDependencyErrors() = 0; + virtual void StartMissingDependentProperties() = 0; + virtual void AddMissingDependentProperty(const SValue& targetName) = 0; + virtual void EndMissingDependentProperties(const SValue& sourceName) = 0; + virtual void AddDependencySchemaError(const SValue& souceName, ISchemaValidator* subvalidator) = 0; + virtual bool EndDependencyErrors() = 0; + + virtual void DisallowedValue(const ValidateErrorCode code) = 0; + virtual void StartDisallowedType() = 0; + virtual void AddExpectedType(const typename SchemaType::ValueType& expectedType) = 0; + virtual void EndDisallowedType(const typename SchemaType::ValueType& actualType) = 0; + virtual void NotAllOf(ISchemaValidator** subvalidators, SizeType count) = 0; + virtual void NoneOf(ISchemaValidator** subvalidators, SizeType count) = 0; + virtual void NotOneOf(ISchemaValidator** subvalidators, SizeType count, bool matched) = 0; + virtual void Disallowed() = 0; +}; + + +/////////////////////////////////////////////////////////////////////////////// +// Hasher + +// For comparison of compound value +template +class Hasher { +public: + typedef typename Encoding::Ch Ch; + + Hasher(Allocator* allocator = 0, size_t stackCapacity = kDefaultSize) : stack_(allocator, stackCapacity) {} + + bool Null() { return WriteType(kNullType); } + bool Bool(bool b) { return WriteType(b ? kTrueType : kFalseType); } + bool Int(int i) { Number n; n.u.i = i; n.d = static_cast(i); return WriteNumber(n); } + bool Uint(unsigned u) { Number n; n.u.u = u; n.d = static_cast(u); return WriteNumber(n); } + bool Int64(int64_t i) { Number n; n.u.i = i; n.d = static_cast(i); return WriteNumber(n); } + bool Uint64(uint64_t u) { Number n; n.u.u = u; n.d = static_cast(u); return WriteNumber(n); } + bool Double(double d) { + Number n; + if (d < 0) n.u.i = static_cast(d); + else n.u.u = static_cast(d); + n.d = d; + return WriteNumber(n); + } + + bool RawNumber(const Ch* str, SizeType len, bool) { + WriteBuffer(kNumberType, str, len * sizeof(Ch)); + return true; + } + + bool String(const Ch* str, SizeType len, bool) { + WriteBuffer(kStringType, str, len * sizeof(Ch)); + return true; + } + + bool StartObject() { return true; } + bool Key(const Ch* str, SizeType len, bool copy) { return String(str, len, copy); } + bool EndObject(SizeType memberCount) { + uint64_t h = Hash(0, kObjectType); + uint64_t* kv = stack_.template Pop(memberCount * 2); + for (SizeType i = 0; i < memberCount; i++) + h ^= Hash(kv[i * 2], kv[i * 2 + 1]); // Use xor to achieve member order insensitive + *stack_.template Push() = h; + return true; + } + + bool StartArray() { return true; } + bool EndArray(SizeType elementCount) { + uint64_t h = Hash(0, kArrayType); + uint64_t* e = stack_.template Pop(elementCount); + for (SizeType i = 0; i < elementCount; i++) + h = Hash(h, e[i]); // Use hash to achieve element order sensitive + *stack_.template Push() = h; + return true; + } + + bool IsValid() const { return stack_.GetSize() == sizeof(uint64_t); } + + uint64_t GetHashCode() const { + RAPIDJSON_ASSERT(IsValid()); + return *stack_.template Top(); + } + +private: + static const size_t kDefaultSize = 256; + struct Number { + union U { + uint64_t u; + int64_t i; + }u; + double d; + }; + + bool WriteType(Type type) { return WriteBuffer(type, 0, 0); } + + bool WriteNumber(const Number& n) { return WriteBuffer(kNumberType, &n, sizeof(n)); } + + bool WriteBuffer(Type type, const void* data, size_t len) { + // FNV-1a from http://isthe.com/chongo/tech/comp/fnv/ + uint64_t h = Hash(RAPIDJSON_UINT64_C2(0x84222325, 0xcbf29ce4), type); + const unsigned char* d = static_cast(data); + for (size_t i = 0; i < len; i++) + h = Hash(h, d[i]); + *stack_.template Push() = h; + return true; + } + + static uint64_t Hash(uint64_t h, uint64_t d) { + static const uint64_t kPrime = RAPIDJSON_UINT64_C2(0x00000100, 0x000001b3); + h ^= d; + h *= kPrime; + return h; + } + + Stack stack_; +}; + +/////////////////////////////////////////////////////////////////////////////// +// SchemaValidationContext + +template +struct SchemaValidationContext { + typedef Schema SchemaType; + typedef ISchemaStateFactory SchemaValidatorFactoryType; + typedef IValidationErrorHandler ErrorHandlerType; + typedef typename SchemaType::ValueType ValueType; + typedef typename ValueType::Ch Ch; + + enum PatternValidatorType { + kPatternValidatorOnly, + kPatternValidatorWithProperty, + kPatternValidatorWithAdditionalProperty + }; + + SchemaValidationContext(SchemaValidatorFactoryType& f, ErrorHandlerType& eh, const SchemaType* s) : + factory(f), + error_handler(eh), + schema(s), + valueSchema(), + invalidKeyword(), + invalidCode(), + hasher(), + arrayElementHashCodes(), + validators(), + validatorCount(), + patternPropertiesValidators(), + patternPropertiesValidatorCount(), + patternPropertiesSchemas(), + patternPropertiesSchemaCount(), + valuePatternValidatorType(kPatternValidatorOnly), + propertyExist(), + inArray(false), + valueUniqueness(false), + arrayUniqueness(false) + { + } + + ~SchemaValidationContext() { + if (hasher) + factory.DestroryHasher(hasher); + if (validators) { + for (SizeType i = 0; i < validatorCount; i++) { + if (validators[i]) { + factory.DestroySchemaValidator(validators[i]); + } + } + factory.FreeState(validators); + } + if (patternPropertiesValidators) { + for (SizeType i = 0; i < patternPropertiesValidatorCount; i++) { + if (patternPropertiesValidators[i]) { + factory.DestroySchemaValidator(patternPropertiesValidators[i]); + } + } + factory.FreeState(patternPropertiesValidators); + } + if (patternPropertiesSchemas) + factory.FreeState(patternPropertiesSchemas); + if (propertyExist) + factory.FreeState(propertyExist); + } + + SchemaValidatorFactoryType& factory; + ErrorHandlerType& error_handler; + const SchemaType* schema; + const SchemaType* valueSchema; + const Ch* invalidKeyword; + ValidateErrorCode invalidCode; + void* hasher; // Only validator access + void* arrayElementHashCodes; // Only validator access this + ISchemaValidator** validators; + SizeType validatorCount; + ISchemaValidator** patternPropertiesValidators; + SizeType patternPropertiesValidatorCount; + const SchemaType** patternPropertiesSchemas; + SizeType patternPropertiesSchemaCount; + PatternValidatorType valuePatternValidatorType; + PatternValidatorType objectPatternValidatorType; + SizeType arrayElementIndex; + bool* propertyExist; + bool inArray; + bool valueUniqueness; + bool arrayUniqueness; +}; + +/////////////////////////////////////////////////////////////////////////////// +// Schema + +template +class Schema { +public: + typedef typename SchemaDocumentType::ValueType ValueType; + typedef typename SchemaDocumentType::AllocatorType AllocatorType; + typedef typename SchemaDocumentType::PointerType PointerType; + typedef typename ValueType::EncodingType EncodingType; + typedef typename EncodingType::Ch Ch; + typedef SchemaValidationContext Context; + typedef Schema SchemaType; + typedef GenericValue SValue; + typedef IValidationErrorHandler ErrorHandler; + typedef GenericUri UriType; + friend class GenericSchemaDocument; + + Schema(SchemaDocumentType* schemaDocument, const PointerType& p, const ValueType& value, const ValueType& document, AllocatorType* allocator, const UriType& id = UriType()) : + allocator_(allocator), + uri_(schemaDocument->GetURI(), *allocator), + id_(id), + pointer_(p, allocator), + typeless_(schemaDocument->GetTypeless()), + enum_(), + enumCount_(), + not_(), + type_((1 << kTotalSchemaType) - 1), // typeless + validatorCount_(), + notValidatorIndex_(), + properties_(), + additionalPropertiesSchema_(), + patternProperties_(), + patternPropertyCount_(), + propertyCount_(), + minProperties_(), + maxProperties_(SizeType(~0)), + additionalProperties_(true), + hasDependencies_(), + hasRequired_(), + hasSchemaDependencies_(), + additionalItemsSchema_(), + itemsList_(), + itemsTuple_(), + itemsTupleCount_(), + minItems_(), + maxItems_(SizeType(~0)), + additionalItems_(true), + uniqueItems_(false), + pattern_(), + minLength_(0), + maxLength_(~SizeType(0)), + exclusiveMinimum_(false), + exclusiveMaximum_(false), + defaultValueLength_(0) + { + typedef typename ValueType::ConstValueIterator ConstValueIterator; + typedef typename ValueType::ConstMemberIterator ConstMemberIterator; + + // PR #1393 + // Early add this Schema and its $ref(s) in schemaDocument's map to avoid infinite + // recursion (with recursive schemas), since schemaDocument->getSchema() is always + // checked before creating a new one. Don't cache typeless_, though. + if (this != typeless_) { + typedef typename SchemaDocumentType::SchemaEntry SchemaEntry; + SchemaEntry *entry = schemaDocument->schemaMap_.template Push(); + new (entry) SchemaEntry(pointer_, this, true, allocator_); + schemaDocument->AddSchemaRefs(this); + } + + if (!value.IsObject()) + return; + + // If we have an id property, resolve it with the in-scope id + if (const ValueType* v = GetMember(value, GetIdString())) { + if (v->IsString()) { + UriType local(*v, allocator); + id_ = local.Resolve(id_, allocator); + } + } + + if (const ValueType* v = GetMember(value, GetTypeString())) { + type_ = 0; + if (v->IsString()) + AddType(*v); + else if (v->IsArray()) + for (ConstValueIterator itr = v->Begin(); itr != v->End(); ++itr) + AddType(*itr); + } + + if (const ValueType* v = GetMember(value, GetEnumString())) { + if (v->IsArray() && v->Size() > 0) { + enum_ = static_cast(allocator_->Malloc(sizeof(uint64_t) * v->Size())); + for (ConstValueIterator itr = v->Begin(); itr != v->End(); ++itr) { + typedef Hasher > EnumHasherType; + char buffer[256u + 24]; + MemoryPoolAllocator<> hasherAllocator(buffer, sizeof(buffer)); + EnumHasherType h(&hasherAllocator, 256); + itr->Accept(h); + enum_[enumCount_++] = h.GetHashCode(); + } + } + } + + if (schemaDocument) { + AssignIfExist(allOf_, *schemaDocument, p, value, GetAllOfString(), document); + AssignIfExist(anyOf_, *schemaDocument, p, value, GetAnyOfString(), document); + AssignIfExist(oneOf_, *schemaDocument, p, value, GetOneOfString(), document); + + if (const ValueType* v = GetMember(value, GetNotString())) { + schemaDocument->CreateSchema(¬_, p.Append(GetNotString(), allocator_), *v, document, id_); + notValidatorIndex_ = validatorCount_; + validatorCount_++; + } + } + + // Object + + const ValueType* properties = GetMember(value, GetPropertiesString()); + const ValueType* required = GetMember(value, GetRequiredString()); + const ValueType* dependencies = GetMember(value, GetDependenciesString()); + { + // Gather properties from properties/required/dependencies + SValue allProperties(kArrayType); + + if (properties && properties->IsObject()) + for (ConstMemberIterator itr = properties->MemberBegin(); itr != properties->MemberEnd(); ++itr) + AddUniqueElement(allProperties, itr->name); + + if (required && required->IsArray()) + for (ConstValueIterator itr = required->Begin(); itr != required->End(); ++itr) + if (itr->IsString()) + AddUniqueElement(allProperties, *itr); + + if (dependencies && dependencies->IsObject()) + for (ConstMemberIterator itr = dependencies->MemberBegin(); itr != dependencies->MemberEnd(); ++itr) { + AddUniqueElement(allProperties, itr->name); + if (itr->value.IsArray()) + for (ConstValueIterator i = itr->value.Begin(); i != itr->value.End(); ++i) + if (i->IsString()) + AddUniqueElement(allProperties, *i); + } + + if (allProperties.Size() > 0) { + propertyCount_ = allProperties.Size(); + properties_ = static_cast(allocator_->Malloc(sizeof(Property) * propertyCount_)); + for (SizeType i = 0; i < propertyCount_; i++) { + new (&properties_[i]) Property(); + properties_[i].name = allProperties[i]; + properties_[i].schema = typeless_; + } + } + } + + if (properties && properties->IsObject()) { + PointerType q = p.Append(GetPropertiesString(), allocator_); + for (ConstMemberIterator itr = properties->MemberBegin(); itr != properties->MemberEnd(); ++itr) { + SizeType index; + if (FindPropertyIndex(itr->name, &index)) + schemaDocument->CreateSchema(&properties_[index].schema, q.Append(itr->name, allocator_), itr->value, document, id_); + } + } + + if (const ValueType* v = GetMember(value, GetPatternPropertiesString())) { + PointerType q = p.Append(GetPatternPropertiesString(), allocator_); + patternProperties_ = static_cast(allocator_->Malloc(sizeof(PatternProperty) * v->MemberCount())); + patternPropertyCount_ = 0; + + for (ConstMemberIterator itr = v->MemberBegin(); itr != v->MemberEnd(); ++itr) { + new (&patternProperties_[patternPropertyCount_]) PatternProperty(); + patternProperties_[patternPropertyCount_].pattern = CreatePattern(itr->name); + schemaDocument->CreateSchema(&patternProperties_[patternPropertyCount_].schema, q.Append(itr->name, allocator_), itr->value, document, id_); + patternPropertyCount_++; + } + } + + if (required && required->IsArray()) + for (ConstValueIterator itr = required->Begin(); itr != required->End(); ++itr) + if (itr->IsString()) { + SizeType index; + if (FindPropertyIndex(*itr, &index)) { + properties_[index].required = true; + hasRequired_ = true; + } + } + + if (dependencies && dependencies->IsObject()) { + PointerType q = p.Append(GetDependenciesString(), allocator_); + hasDependencies_ = true; + for (ConstMemberIterator itr = dependencies->MemberBegin(); itr != dependencies->MemberEnd(); ++itr) { + SizeType sourceIndex; + if (FindPropertyIndex(itr->name, &sourceIndex)) { + if (itr->value.IsArray()) { + properties_[sourceIndex].dependencies = static_cast(allocator_->Malloc(sizeof(bool) * propertyCount_)); + std::memset(properties_[sourceIndex].dependencies, 0, sizeof(bool)* propertyCount_); + for (ConstValueIterator targetItr = itr->value.Begin(); targetItr != itr->value.End(); ++targetItr) { + SizeType targetIndex; + if (FindPropertyIndex(*targetItr, &targetIndex)) + properties_[sourceIndex].dependencies[targetIndex] = true; + } + } + else if (itr->value.IsObject()) { + hasSchemaDependencies_ = true; + schemaDocument->CreateSchema(&properties_[sourceIndex].dependenciesSchema, q.Append(itr->name, allocator_), itr->value, document, id_); + properties_[sourceIndex].dependenciesValidatorIndex = validatorCount_; + validatorCount_++; + } + } + } + } + + if (const ValueType* v = GetMember(value, GetAdditionalPropertiesString())) { + if (v->IsBool()) + additionalProperties_ = v->GetBool(); + else if (v->IsObject()) + schemaDocument->CreateSchema(&additionalPropertiesSchema_, p.Append(GetAdditionalPropertiesString(), allocator_), *v, document, id_); + } + + AssignIfExist(minProperties_, value, GetMinPropertiesString()); + AssignIfExist(maxProperties_, value, GetMaxPropertiesString()); + + // Array + if (const ValueType* v = GetMember(value, GetItemsString())) { + PointerType q = p.Append(GetItemsString(), allocator_); + if (v->IsObject()) // List validation + schemaDocument->CreateSchema(&itemsList_, q, *v, document, id_); + else if (v->IsArray()) { // Tuple validation + itemsTuple_ = static_cast(allocator_->Malloc(sizeof(const Schema*) * v->Size())); + SizeType index = 0; + for (ConstValueIterator itr = v->Begin(); itr != v->End(); ++itr, index++) + schemaDocument->CreateSchema(&itemsTuple_[itemsTupleCount_++], q.Append(index, allocator_), *itr, document, id_); + } + } + + AssignIfExist(minItems_, value, GetMinItemsString()); + AssignIfExist(maxItems_, value, GetMaxItemsString()); + + if (const ValueType* v = GetMember(value, GetAdditionalItemsString())) { + if (v->IsBool()) + additionalItems_ = v->GetBool(); + else if (v->IsObject()) + schemaDocument->CreateSchema(&additionalItemsSchema_, p.Append(GetAdditionalItemsString(), allocator_), *v, document, id_); + } + + AssignIfExist(uniqueItems_, value, GetUniqueItemsString()); + + // String + AssignIfExist(minLength_, value, GetMinLengthString()); + AssignIfExist(maxLength_, value, GetMaxLengthString()); + + if (const ValueType* v = GetMember(value, GetPatternString())) + pattern_ = CreatePattern(*v); + + // Number + if (const ValueType* v = GetMember(value, GetMinimumString())) + if (v->IsNumber()) + minimum_.CopyFrom(*v, *allocator_); + + if (const ValueType* v = GetMember(value, GetMaximumString())) + if (v->IsNumber()) + maximum_.CopyFrom(*v, *allocator_); + + AssignIfExist(exclusiveMinimum_, value, GetExclusiveMinimumString()); + AssignIfExist(exclusiveMaximum_, value, GetExclusiveMaximumString()); + + if (const ValueType* v = GetMember(value, GetMultipleOfString())) + if (v->IsNumber() && v->GetDouble() > 0.0) + multipleOf_.CopyFrom(*v, *allocator_); + + // Default + if (const ValueType* v = GetMember(value, GetDefaultValueString())) + if (v->IsString()) + defaultValueLength_ = v->GetStringLength(); + + } + + ~Schema() { + AllocatorType::Free(enum_); + if (properties_) { + for (SizeType i = 0; i < propertyCount_; i++) + properties_[i].~Property(); + AllocatorType::Free(properties_); + } + if (patternProperties_) { + for (SizeType i = 0; i < patternPropertyCount_; i++) + patternProperties_[i].~PatternProperty(); + AllocatorType::Free(patternProperties_); + } + AllocatorType::Free(itemsTuple_); +#if RAPIDJSON_SCHEMA_HAS_REGEX + if (pattern_) { + pattern_->~RegexType(); + AllocatorType::Free(pattern_); + } +#endif + } + + const SValue& GetURI() const { + return uri_; + } + + const UriType& GetId() const { + return id_; + } + + const PointerType& GetPointer() const { + return pointer_; + } + + bool BeginValue(Context& context) const { + if (context.inArray) { + if (uniqueItems_) + context.valueUniqueness = true; + + if (itemsList_) + context.valueSchema = itemsList_; + else if (itemsTuple_) { + if (context.arrayElementIndex < itemsTupleCount_) + context.valueSchema = itemsTuple_[context.arrayElementIndex]; + else if (additionalItemsSchema_) + context.valueSchema = additionalItemsSchema_; + else if (additionalItems_) + context.valueSchema = typeless_; + else { + context.error_handler.DisallowedItem(context.arrayElementIndex); + // Must set valueSchema for when kValidateContinueOnErrorFlag is set, else reports spurious type error + context.valueSchema = typeless_; + // Must bump arrayElementIndex for when kValidateContinueOnErrorFlag is set + context.arrayElementIndex++; + RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorAdditionalItems); + } + } + else + context.valueSchema = typeless_; + + context.arrayElementIndex++; + } + return true; + } + + RAPIDJSON_FORCEINLINE bool EndValue(Context& context) const { + // Only check pattern properties if we have validators + if (context.patternPropertiesValidatorCount > 0) { + bool otherValid = false; + SizeType count = context.patternPropertiesValidatorCount; + if (context.objectPatternValidatorType != Context::kPatternValidatorOnly) + otherValid = context.patternPropertiesValidators[--count]->IsValid(); + + bool patternValid = true; + for (SizeType i = 0; i < count; i++) + if (!context.patternPropertiesValidators[i]->IsValid()) { + patternValid = false; + break; + } + + if (context.objectPatternValidatorType == Context::kPatternValidatorOnly) { + if (!patternValid) { + context.error_handler.PropertyViolations(context.patternPropertiesValidators, count); + RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorPatternProperties); + } + } + else if (context.objectPatternValidatorType == Context::kPatternValidatorWithProperty) { + if (!patternValid || !otherValid) { + context.error_handler.PropertyViolations(context.patternPropertiesValidators, count + 1); + RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorPatternProperties); + } + } + else if (!patternValid && !otherValid) { // kPatternValidatorWithAdditionalProperty) + context.error_handler.PropertyViolations(context.patternPropertiesValidators, count + 1); + RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorPatternProperties); + } + } + + // For enums only check if we have a hasher + if (enum_ && context.hasher) { + const uint64_t h = context.factory.GetHashCode(context.hasher); + for (SizeType i = 0; i < enumCount_; i++) + if (enum_[i] == h) + goto foundEnum; + context.error_handler.DisallowedValue(kValidateErrorEnum); + RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorEnum); + foundEnum:; + } + + // Only check allOf etc if we have validators + if (context.validatorCount > 0) { + if (allOf_.schemas) + for (SizeType i = allOf_.begin; i < allOf_.begin + allOf_.count; i++) + if (!context.validators[i]->IsValid()) { + context.error_handler.NotAllOf(&context.validators[allOf_.begin], allOf_.count); + RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorAllOf); + } + + if (anyOf_.schemas) { + for (SizeType i = anyOf_.begin; i < anyOf_.begin + anyOf_.count; i++) + if (context.validators[i]->IsValid()) + goto foundAny; + context.error_handler.NoneOf(&context.validators[anyOf_.begin], anyOf_.count); + RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorAnyOf); + foundAny:; + } + + if (oneOf_.schemas) { + bool oneValid = false; + for (SizeType i = oneOf_.begin; i < oneOf_.begin + oneOf_.count; i++) + if (context.validators[i]->IsValid()) { + if (oneValid) { + context.error_handler.NotOneOf(&context.validators[oneOf_.begin], oneOf_.count, true); + RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorOneOfMatch); + } else + oneValid = true; + } + if (!oneValid) { + context.error_handler.NotOneOf(&context.validators[oneOf_.begin], oneOf_.count, false); + RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorOneOf); + } + } + + if (not_ && context.validators[notValidatorIndex_]->IsValid()) { + context.error_handler.Disallowed(); + RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorNot); + } + } + + return true; + } + + bool Null(Context& context) const { + if (!(type_ & (1 << kNullSchemaType))) { + DisallowedType(context, GetNullString()); + RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorType); + } + return CreateParallelValidator(context); + } + + bool Bool(Context& context, bool) const { + if (!(type_ & (1 << kBooleanSchemaType))) { + DisallowedType(context, GetBooleanString()); + RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorType); + } + return CreateParallelValidator(context); + } + + bool Int(Context& context, int i) const { + if (!CheckInt(context, i)) + return false; + return CreateParallelValidator(context); + } + + bool Uint(Context& context, unsigned u) const { + if (!CheckUint(context, u)) + return false; + return CreateParallelValidator(context); + } + + bool Int64(Context& context, int64_t i) const { + if (!CheckInt(context, i)) + return false; + return CreateParallelValidator(context); + } + + bool Uint64(Context& context, uint64_t u) const { + if (!CheckUint(context, u)) + return false; + return CreateParallelValidator(context); + } + + bool Double(Context& context, double d) const { + if (!(type_ & (1 << kNumberSchemaType))) { + DisallowedType(context, GetNumberString()); + RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorType); + } + + if (!minimum_.IsNull() && !CheckDoubleMinimum(context, d)) + return false; + + if (!maximum_.IsNull() && !CheckDoubleMaximum(context, d)) + return false; + + if (!multipleOf_.IsNull() && !CheckDoubleMultipleOf(context, d)) + return false; + + return CreateParallelValidator(context); + } + + bool String(Context& context, const Ch* str, SizeType length, bool) const { + if (!(type_ & (1 << kStringSchemaType))) { + DisallowedType(context, GetStringString()); + RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorType); + } + + if (minLength_ != 0 || maxLength_ != SizeType(~0)) { + SizeType count; + if (internal::CountStringCodePoint(str, length, &count)) { + if (count < minLength_) { + context.error_handler.TooShort(str, length, minLength_); + RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorMinLength); + } + if (count > maxLength_) { + context.error_handler.TooLong(str, length, maxLength_); + RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorMaxLength); + } + } + } + + if (pattern_ && !IsPatternMatch(pattern_, str, length)) { + context.error_handler.DoesNotMatch(str, length); + RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorPattern); + } + + return CreateParallelValidator(context); + } + + bool StartObject(Context& context) const { + if (!(type_ & (1 << kObjectSchemaType))) { + DisallowedType(context, GetObjectString()); + RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorType); + } + + if (hasDependencies_ || hasRequired_) { + context.propertyExist = static_cast(context.factory.MallocState(sizeof(bool) * propertyCount_)); + std::memset(context.propertyExist, 0, sizeof(bool) * propertyCount_); + } + + if (patternProperties_) { // pre-allocate schema array + SizeType count = patternPropertyCount_ + 1; // extra for valuePatternValidatorType + context.patternPropertiesSchemas = static_cast(context.factory.MallocState(sizeof(const SchemaType*) * count)); + context.patternPropertiesSchemaCount = 0; + std::memset(context.patternPropertiesSchemas, 0, sizeof(SchemaType*) * count); + } + + return CreateParallelValidator(context); + } + + bool Key(Context& context, const Ch* str, SizeType len, bool) const { + if (patternProperties_) { + context.patternPropertiesSchemaCount = 0; + for (SizeType i = 0; i < patternPropertyCount_; i++) + if (patternProperties_[i].pattern && IsPatternMatch(patternProperties_[i].pattern, str, len)) { + context.patternPropertiesSchemas[context.patternPropertiesSchemaCount++] = patternProperties_[i].schema; + context.valueSchema = typeless_; + } + } + + SizeType index = 0; + if (FindPropertyIndex(ValueType(str, len).Move(), &index)) { + if (context.patternPropertiesSchemaCount > 0) { + context.patternPropertiesSchemas[context.patternPropertiesSchemaCount++] = properties_[index].schema; + context.valueSchema = typeless_; + context.valuePatternValidatorType = Context::kPatternValidatorWithProperty; + } + else + context.valueSchema = properties_[index].schema; + + if (context.propertyExist) + context.propertyExist[index] = true; + + return true; + } + + if (additionalPropertiesSchema_) { + if (context.patternPropertiesSchemaCount > 0) { + context.patternPropertiesSchemas[context.patternPropertiesSchemaCount++] = additionalPropertiesSchema_; + context.valueSchema = typeless_; + context.valuePatternValidatorType = Context::kPatternValidatorWithAdditionalProperty; + } + else + context.valueSchema = additionalPropertiesSchema_; + return true; + } + else if (additionalProperties_) { + context.valueSchema = typeless_; + return true; + } + + if (context.patternPropertiesSchemaCount == 0) { // patternProperties are not additional properties + // Must set valueSchema for when kValidateContinueOnErrorFlag is set, else reports spurious type error + context.valueSchema = typeless_; + context.error_handler.DisallowedProperty(str, len); + RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorAdditionalProperties); + } + + return true; + } + + bool EndObject(Context& context, SizeType memberCount) const { + if (hasRequired_) { + context.error_handler.StartMissingProperties(); + for (SizeType index = 0; index < propertyCount_; index++) + if (properties_[index].required && !context.propertyExist[index]) + if (properties_[index].schema->defaultValueLength_ == 0 ) + context.error_handler.AddMissingProperty(properties_[index].name); + if (context.error_handler.EndMissingProperties()) + RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorRequired); + } + + if (memberCount < minProperties_) { + context.error_handler.TooFewProperties(memberCount, minProperties_); + RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorMinProperties); + } + + if (memberCount > maxProperties_) { + context.error_handler.TooManyProperties(memberCount, maxProperties_); + RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorMaxProperties); + } + + if (hasDependencies_) { + context.error_handler.StartDependencyErrors(); + for (SizeType sourceIndex = 0; sourceIndex < propertyCount_; sourceIndex++) { + const Property& source = properties_[sourceIndex]; + if (context.propertyExist[sourceIndex]) { + if (source.dependencies) { + context.error_handler.StartMissingDependentProperties(); + for (SizeType targetIndex = 0; targetIndex < propertyCount_; targetIndex++) + if (source.dependencies[targetIndex] && !context.propertyExist[targetIndex]) + context.error_handler.AddMissingDependentProperty(properties_[targetIndex].name); + context.error_handler.EndMissingDependentProperties(source.name); + } + else if (source.dependenciesSchema) { + ISchemaValidator* dependenciesValidator = context.validators[source.dependenciesValidatorIndex]; + if (!dependenciesValidator->IsValid()) + context.error_handler.AddDependencySchemaError(source.name, dependenciesValidator); + } + } + } + if (context.error_handler.EndDependencyErrors()) + RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorDependencies); + } + + return true; + } + + bool StartArray(Context& context) const { + context.arrayElementIndex = 0; + context.inArray = true; // Ensure we note that we are in an array + + if (!(type_ & (1 << kArraySchemaType))) { + DisallowedType(context, GetArrayString()); + RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorType); + } + + return CreateParallelValidator(context); + } + + bool EndArray(Context& context, SizeType elementCount) const { + context.inArray = false; + + if (elementCount < minItems_) { + context.error_handler.TooFewItems(elementCount, minItems_); + RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorMinItems); + } + + if (elementCount > maxItems_) { + context.error_handler.TooManyItems(elementCount, maxItems_); + RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorMaxItems); + } + + return true; + } + + static const ValueType& GetValidateErrorKeyword(ValidateErrorCode validateErrorCode) { + switch (validateErrorCode) { + case kValidateErrorMultipleOf: return GetMultipleOfString(); + case kValidateErrorMaximum: return GetMaximumString(); + case kValidateErrorExclusiveMaximum: return GetMaximumString(); // Same + case kValidateErrorMinimum: return GetMinimumString(); + case kValidateErrorExclusiveMinimum: return GetMinimumString(); // Same + + case kValidateErrorMaxLength: return GetMaxLengthString(); + case kValidateErrorMinLength: return GetMinLengthString(); + case kValidateErrorPattern: return GetPatternString(); + + case kValidateErrorMaxItems: return GetMaxItemsString(); + case kValidateErrorMinItems: return GetMinItemsString(); + case kValidateErrorUniqueItems: return GetUniqueItemsString(); + case kValidateErrorAdditionalItems: return GetAdditionalItemsString(); + + case kValidateErrorMaxProperties: return GetMaxPropertiesString(); + case kValidateErrorMinProperties: return GetMinPropertiesString(); + case kValidateErrorRequired: return GetRequiredString(); + case kValidateErrorAdditionalProperties: return GetAdditionalPropertiesString(); + case kValidateErrorPatternProperties: return GetPatternPropertiesString(); + case kValidateErrorDependencies: return GetDependenciesString(); + + case kValidateErrorEnum: return GetEnumString(); + case kValidateErrorType: return GetTypeString(); + + case kValidateErrorOneOf: return GetOneOfString(); + case kValidateErrorOneOfMatch: return GetOneOfString(); // Same + case kValidateErrorAllOf: return GetAllOfString(); + case kValidateErrorAnyOf: return GetAnyOfString(); + case kValidateErrorNot: return GetNotString(); + + default: return GetNullString(); + } + } + + + // Generate functions for string literal according to Ch +#define RAPIDJSON_STRING_(name, ...) \ + static const ValueType& Get##name##String() {\ + static const Ch s[] = { __VA_ARGS__, '\0' };\ + static const ValueType v(s, static_cast(sizeof(s) / sizeof(Ch) - 1));\ + return v;\ + } + + RAPIDJSON_STRING_(Null, 'n', 'u', 'l', 'l') + RAPIDJSON_STRING_(Boolean, 'b', 'o', 'o', 'l', 'e', 'a', 'n') + RAPIDJSON_STRING_(Object, 'o', 'b', 'j', 'e', 'c', 't') + RAPIDJSON_STRING_(Array, 'a', 'r', 'r', 'a', 'y') + RAPIDJSON_STRING_(String, 's', 't', 'r', 'i', 'n', 'g') + RAPIDJSON_STRING_(Number, 'n', 'u', 'm', 'b', 'e', 'r') + RAPIDJSON_STRING_(Integer, 'i', 'n', 't', 'e', 'g', 'e', 'r') + RAPIDJSON_STRING_(Type, 't', 'y', 'p', 'e') + RAPIDJSON_STRING_(Enum, 'e', 'n', 'u', 'm') + RAPIDJSON_STRING_(AllOf, 'a', 'l', 'l', 'O', 'f') + RAPIDJSON_STRING_(AnyOf, 'a', 'n', 'y', 'O', 'f') + RAPIDJSON_STRING_(OneOf, 'o', 'n', 'e', 'O', 'f') + RAPIDJSON_STRING_(Not, 'n', 'o', 't') + RAPIDJSON_STRING_(Properties, 'p', 'r', 'o', 'p', 'e', 'r', 't', 'i', 'e', 's') + RAPIDJSON_STRING_(Required, 'r', 'e', 'q', 'u', 'i', 'r', 'e', 'd') + RAPIDJSON_STRING_(Dependencies, 'd', 'e', 'p', 'e', 'n', 'd', 'e', 'n', 'c', 'i', 'e', 's') + RAPIDJSON_STRING_(PatternProperties, 'p', 'a', 't', 't', 'e', 'r', 'n', 'P', 'r', 'o', 'p', 'e', 'r', 't', 'i', 'e', 's') + RAPIDJSON_STRING_(AdditionalProperties, 'a', 'd', 'd', 'i', 't', 'i', 'o', 'n', 'a', 'l', 'P', 'r', 'o', 'p', 'e', 'r', 't', 'i', 'e', 's') + RAPIDJSON_STRING_(MinProperties, 'm', 'i', 'n', 'P', 'r', 'o', 'p', 'e', 'r', 't', 'i', 'e', 's') + RAPIDJSON_STRING_(MaxProperties, 'm', 'a', 'x', 'P', 'r', 'o', 'p', 'e', 'r', 't', 'i', 'e', 's') + RAPIDJSON_STRING_(Items, 'i', 't', 'e', 'm', 's') + RAPIDJSON_STRING_(MinItems, 'm', 'i', 'n', 'I', 't', 'e', 'm', 's') + RAPIDJSON_STRING_(MaxItems, 'm', 'a', 'x', 'I', 't', 'e', 'm', 's') + RAPIDJSON_STRING_(AdditionalItems, 'a', 'd', 'd', 'i', 't', 'i', 'o', 'n', 'a', 'l', 'I', 't', 'e', 'm', 's') + RAPIDJSON_STRING_(UniqueItems, 'u', 'n', 'i', 'q', 'u', 'e', 'I', 't', 'e', 'm', 's') + RAPIDJSON_STRING_(MinLength, 'm', 'i', 'n', 'L', 'e', 'n', 'g', 't', 'h') + RAPIDJSON_STRING_(MaxLength, 'm', 'a', 'x', 'L', 'e', 'n', 'g', 't', 'h') + RAPIDJSON_STRING_(Pattern, 'p', 'a', 't', 't', 'e', 'r', 'n') + RAPIDJSON_STRING_(Minimum, 'm', 'i', 'n', 'i', 'm', 'u', 'm') + RAPIDJSON_STRING_(Maximum, 'm', 'a', 'x', 'i', 'm', 'u', 'm') + RAPIDJSON_STRING_(ExclusiveMinimum, 'e', 'x', 'c', 'l', 'u', 's', 'i', 'v', 'e', 'M', 'i', 'n', 'i', 'm', 'u', 'm') + RAPIDJSON_STRING_(ExclusiveMaximum, 'e', 'x', 'c', 'l', 'u', 's', 'i', 'v', 'e', 'M', 'a', 'x', 'i', 'm', 'u', 'm') + RAPIDJSON_STRING_(MultipleOf, 'm', 'u', 'l', 't', 'i', 'p', 'l', 'e', 'O', 'f') + RAPIDJSON_STRING_(DefaultValue, 'd', 'e', 'f', 'a', 'u', 'l', 't') + RAPIDJSON_STRING_(Ref, '$', 'r', 'e', 'f') + RAPIDJSON_STRING_(Id, 'i', 'd') + + RAPIDJSON_STRING_(SchemeEnd, ':') + RAPIDJSON_STRING_(AuthStart, '/', '/') + RAPIDJSON_STRING_(QueryStart, '?') + RAPIDJSON_STRING_(FragStart, '#') + RAPIDJSON_STRING_(Slash, '/') + RAPIDJSON_STRING_(Dot, '.') + +#undef RAPIDJSON_STRING_ + +private: + enum SchemaValueType { + kNullSchemaType, + kBooleanSchemaType, + kObjectSchemaType, + kArraySchemaType, + kStringSchemaType, + kNumberSchemaType, + kIntegerSchemaType, + kTotalSchemaType + }; + +#if RAPIDJSON_SCHEMA_USE_INTERNALREGEX + typedef internal::GenericRegex RegexType; +#elif RAPIDJSON_SCHEMA_USE_STDREGEX + typedef std::basic_regex RegexType; +#else + typedef char RegexType; +#endif + + struct SchemaArray { + SchemaArray() : schemas(), count() {} + ~SchemaArray() { AllocatorType::Free(schemas); } + const SchemaType** schemas; + SizeType begin; // begin index of context.validators + SizeType count; + }; + + template + void AddUniqueElement(V1& a, const V2& v) { + for (typename V1::ConstValueIterator itr = a.Begin(); itr != a.End(); ++itr) + if (*itr == v) + return; + V1 c(v, *allocator_); + a.PushBack(c, *allocator_); + } + + static const ValueType* GetMember(const ValueType& value, const ValueType& name) { + typename ValueType::ConstMemberIterator itr = value.FindMember(name); + return itr != value.MemberEnd() ? &(itr->value) : 0; + } + + static void AssignIfExist(bool& out, const ValueType& value, const ValueType& name) { + if (const ValueType* v = GetMember(value, name)) + if (v->IsBool()) + out = v->GetBool(); + } + + static void AssignIfExist(SizeType& out, const ValueType& value, const ValueType& name) { + if (const ValueType* v = GetMember(value, name)) + if (v->IsUint64() && v->GetUint64() <= SizeType(~0)) + out = static_cast(v->GetUint64()); + } + + void AssignIfExist(SchemaArray& out, SchemaDocumentType& schemaDocument, const PointerType& p, const ValueType& value, const ValueType& name, const ValueType& document) { + if (const ValueType* v = GetMember(value, name)) { + if (v->IsArray() && v->Size() > 0) { + PointerType q = p.Append(name, allocator_); + out.count = v->Size(); + out.schemas = static_cast(allocator_->Malloc(out.count * sizeof(const Schema*))); + memset(out.schemas, 0, sizeof(Schema*)* out.count); + for (SizeType i = 0; i < out.count; i++) + schemaDocument.CreateSchema(&out.schemas[i], q.Append(i, allocator_), (*v)[i], document, id_); + out.begin = validatorCount_; + validatorCount_ += out.count; + } + } + } + +#if RAPIDJSON_SCHEMA_USE_INTERNALREGEX + template + RegexType* CreatePattern(const ValueType& value) { + if (value.IsString()) { + RegexType* r = new (allocator_->Malloc(sizeof(RegexType))) RegexType(value.GetString(), allocator_); + if (!r->IsValid()) { + r->~RegexType(); + AllocatorType::Free(r); + r = 0; + } + return r; + } + return 0; + } + + static bool IsPatternMatch(const RegexType* pattern, const Ch *str, SizeType) { + GenericRegexSearch rs(*pattern); + return rs.Search(str); + } +#elif RAPIDJSON_SCHEMA_USE_STDREGEX + template + RegexType* CreatePattern(const ValueType& value) { + if (value.IsString()) { + RegexType *r = static_cast(allocator_->Malloc(sizeof(RegexType))); + try { + return new (r) RegexType(value.GetString(), std::size_t(value.GetStringLength()), std::regex_constants::ECMAScript); + } + catch (const std::regex_error&) { + AllocatorType::Free(r); + } + } + return 0; + } + + static bool IsPatternMatch(const RegexType* pattern, const Ch *str, SizeType length) { + std::match_results r; + return std::regex_search(str, str + length, r, *pattern); + } +#else + template + RegexType* CreatePattern(const ValueType&) { return 0; } + + static bool IsPatternMatch(const RegexType*, const Ch *, SizeType) { return true; } +#endif // RAPIDJSON_SCHEMA_USE_STDREGEX + + void AddType(const ValueType& type) { + if (type == GetNullString() ) type_ |= 1 << kNullSchemaType; + else if (type == GetBooleanString()) type_ |= 1 << kBooleanSchemaType; + else if (type == GetObjectString() ) type_ |= 1 << kObjectSchemaType; + else if (type == GetArrayString() ) type_ |= 1 << kArraySchemaType; + else if (type == GetStringString() ) type_ |= 1 << kStringSchemaType; + else if (type == GetIntegerString()) type_ |= 1 << kIntegerSchemaType; + else if (type == GetNumberString() ) type_ |= (1 << kNumberSchemaType) | (1 << kIntegerSchemaType); + } + + bool CreateParallelValidator(Context& context) const { + if (enum_ || context.arrayUniqueness) + context.hasher = context.factory.CreateHasher(); + + if (validatorCount_) { + RAPIDJSON_ASSERT(context.validators == 0); + context.validators = static_cast(context.factory.MallocState(sizeof(ISchemaValidator*) * validatorCount_)); + std::memset(context.validators, 0, sizeof(ISchemaValidator*) * validatorCount_); + context.validatorCount = validatorCount_; + + // Always return after first failure for these sub-validators + if (allOf_.schemas) + CreateSchemaValidators(context, allOf_, false); + + if (anyOf_.schemas) + CreateSchemaValidators(context, anyOf_, false); + + if (oneOf_.schemas) + CreateSchemaValidators(context, oneOf_, false); + + if (not_) + context.validators[notValidatorIndex_] = context.factory.CreateSchemaValidator(*not_, false); + + if (hasSchemaDependencies_) { + for (SizeType i = 0; i < propertyCount_; i++) + if (properties_[i].dependenciesSchema) + context.validators[properties_[i].dependenciesValidatorIndex] = context.factory.CreateSchemaValidator(*properties_[i].dependenciesSchema, false); + } + } + + return true; + } + + void CreateSchemaValidators(Context& context, const SchemaArray& schemas, const bool inheritContinueOnErrors) const { + for (SizeType i = 0; i < schemas.count; i++) + context.validators[schemas.begin + i] = context.factory.CreateSchemaValidator(*schemas.schemas[i], inheritContinueOnErrors); + } + + // O(n) + bool FindPropertyIndex(const ValueType& name, SizeType* outIndex) const { + SizeType len = name.GetStringLength(); + const Ch* str = name.GetString(); + for (SizeType index = 0; index < propertyCount_; index++) + if (properties_[index].name.GetStringLength() == len && + (std::memcmp(properties_[index].name.GetString(), str, sizeof(Ch) * len) == 0)) + { + *outIndex = index; + return true; + } + return false; + } + + bool CheckInt(Context& context, int64_t i) const { + if (!(type_ & ((1 << kIntegerSchemaType) | (1 << kNumberSchemaType)))) { + DisallowedType(context, GetIntegerString()); + RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorType); + } + + if (!minimum_.IsNull()) { + if (minimum_.IsInt64()) { + if (exclusiveMinimum_ ? i <= minimum_.GetInt64() : i < minimum_.GetInt64()) { + context.error_handler.BelowMinimum(i, minimum_, exclusiveMinimum_); + RAPIDJSON_INVALID_KEYWORD_RETURN(exclusiveMinimum_ ? kValidateErrorExclusiveMinimum : kValidateErrorMinimum); + } + } + else if (minimum_.IsUint64()) { + context.error_handler.BelowMinimum(i, minimum_, exclusiveMinimum_); + RAPIDJSON_INVALID_KEYWORD_RETURN(exclusiveMinimum_ ? kValidateErrorExclusiveMinimum : kValidateErrorMinimum); // i <= max(int64_t) < minimum.GetUint64() + } + else if (!CheckDoubleMinimum(context, static_cast(i))) + return false; + } + + if (!maximum_.IsNull()) { + if (maximum_.IsInt64()) { + if (exclusiveMaximum_ ? i >= maximum_.GetInt64() : i > maximum_.GetInt64()) { + context.error_handler.AboveMaximum(i, maximum_, exclusiveMaximum_); + RAPIDJSON_INVALID_KEYWORD_RETURN(exclusiveMaximum_ ? kValidateErrorExclusiveMaximum : kValidateErrorMaximum); + } + } + else if (maximum_.IsUint64()) { } + /* do nothing */ // i <= max(int64_t) < maximum_.GetUint64() + else if (!CheckDoubleMaximum(context, static_cast(i))) + return false; + } + + if (!multipleOf_.IsNull()) { + if (multipleOf_.IsUint64()) { + if (static_cast(i >= 0 ? i : -i) % multipleOf_.GetUint64() != 0) { + context.error_handler.NotMultipleOf(i, multipleOf_); + RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorMultipleOf); + } + } + else if (!CheckDoubleMultipleOf(context, static_cast(i))) + return false; + } + + return true; + } + + bool CheckUint(Context& context, uint64_t i) const { + if (!(type_ & ((1 << kIntegerSchemaType) | (1 << kNumberSchemaType)))) { + DisallowedType(context, GetIntegerString()); + RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorType); + } + + if (!minimum_.IsNull()) { + if (minimum_.IsUint64()) { + if (exclusiveMinimum_ ? i <= minimum_.GetUint64() : i < minimum_.GetUint64()) { + context.error_handler.BelowMinimum(i, minimum_, exclusiveMinimum_); + RAPIDJSON_INVALID_KEYWORD_RETURN(exclusiveMinimum_ ? kValidateErrorExclusiveMinimum : kValidateErrorMinimum); + } + } + else if (minimum_.IsInt64()) + /* do nothing */; // i >= 0 > minimum.Getint64() + else if (!CheckDoubleMinimum(context, static_cast(i))) + return false; + } + + if (!maximum_.IsNull()) { + if (maximum_.IsUint64()) { + if (exclusiveMaximum_ ? i >= maximum_.GetUint64() : i > maximum_.GetUint64()) { + context.error_handler.AboveMaximum(i, maximum_, exclusiveMaximum_); + RAPIDJSON_INVALID_KEYWORD_RETURN(exclusiveMaximum_ ? kValidateErrorExclusiveMaximum : kValidateErrorMaximum); + } + } + else if (maximum_.IsInt64()) { + context.error_handler.AboveMaximum(i, maximum_, exclusiveMaximum_); + RAPIDJSON_INVALID_KEYWORD_RETURN(exclusiveMaximum_ ? kValidateErrorExclusiveMaximum : kValidateErrorMaximum); // i >= 0 > maximum_ + } + else if (!CheckDoubleMaximum(context, static_cast(i))) + return false; + } + + if (!multipleOf_.IsNull()) { + if (multipleOf_.IsUint64()) { + if (i % multipleOf_.GetUint64() != 0) { + context.error_handler.NotMultipleOf(i, multipleOf_); + RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorMultipleOf); + } + } + else if (!CheckDoubleMultipleOf(context, static_cast(i))) + return false; + } + + return true; + } + + bool CheckDoubleMinimum(Context& context, double d) const { + if (exclusiveMinimum_ ? d <= minimum_.GetDouble() : d < minimum_.GetDouble()) { + context.error_handler.BelowMinimum(d, minimum_, exclusiveMinimum_); + RAPIDJSON_INVALID_KEYWORD_RETURN(exclusiveMinimum_ ? kValidateErrorExclusiveMinimum : kValidateErrorMinimum); + } + return true; + } + + bool CheckDoubleMaximum(Context& context, double d) const { + if (exclusiveMaximum_ ? d >= maximum_.GetDouble() : d > maximum_.GetDouble()) { + context.error_handler.AboveMaximum(d, maximum_, exclusiveMaximum_); + RAPIDJSON_INVALID_KEYWORD_RETURN(exclusiveMaximum_ ? kValidateErrorExclusiveMaximum : kValidateErrorMaximum); + } + return true; + } + + bool CheckDoubleMultipleOf(Context& context, double d) const { + double a = std::abs(d), b = std::abs(multipleOf_.GetDouble()); + double q = std::floor(a / b); + double r = a - q * b; + if (r > 0.0) { + context.error_handler.NotMultipleOf(d, multipleOf_); + RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorMultipleOf); + } + return true; + } + + void DisallowedType(Context& context, const ValueType& actualType) const { + ErrorHandler& eh = context.error_handler; + eh.StartDisallowedType(); + + if (type_ & (1 << kNullSchemaType)) eh.AddExpectedType(GetNullString()); + if (type_ & (1 << kBooleanSchemaType)) eh.AddExpectedType(GetBooleanString()); + if (type_ & (1 << kObjectSchemaType)) eh.AddExpectedType(GetObjectString()); + if (type_ & (1 << kArraySchemaType)) eh.AddExpectedType(GetArrayString()); + if (type_ & (1 << kStringSchemaType)) eh.AddExpectedType(GetStringString()); + + if (type_ & (1 << kNumberSchemaType)) eh.AddExpectedType(GetNumberString()); + else if (type_ & (1 << kIntegerSchemaType)) eh.AddExpectedType(GetIntegerString()); + + eh.EndDisallowedType(actualType); + } + + struct Property { + Property() : schema(), dependenciesSchema(), dependenciesValidatorIndex(), dependencies(), required(false) {} + ~Property() { AllocatorType::Free(dependencies); } + SValue name; + const SchemaType* schema; + const SchemaType* dependenciesSchema; + SizeType dependenciesValidatorIndex; + bool* dependencies; + bool required; + }; + + struct PatternProperty { + PatternProperty() : schema(), pattern() {} + ~PatternProperty() { + if (pattern) { + pattern->~RegexType(); + AllocatorType::Free(pattern); + } + } + const SchemaType* schema; + RegexType* pattern; + }; + + AllocatorType* allocator_; + SValue uri_; + UriType id_; + PointerType pointer_; + const SchemaType* typeless_; + uint64_t* enum_; + SizeType enumCount_; + SchemaArray allOf_; + SchemaArray anyOf_; + SchemaArray oneOf_; + const SchemaType* not_; + unsigned type_; // bitmask of kSchemaType + SizeType validatorCount_; + SizeType notValidatorIndex_; + + Property* properties_; + const SchemaType* additionalPropertiesSchema_; + PatternProperty* patternProperties_; + SizeType patternPropertyCount_; + SizeType propertyCount_; + SizeType minProperties_; + SizeType maxProperties_; + bool additionalProperties_; + bool hasDependencies_; + bool hasRequired_; + bool hasSchemaDependencies_; + + const SchemaType* additionalItemsSchema_; + const SchemaType* itemsList_; + const SchemaType** itemsTuple_; + SizeType itemsTupleCount_; + SizeType minItems_; + SizeType maxItems_; + bool additionalItems_; + bool uniqueItems_; + + RegexType* pattern_; + SizeType minLength_; + SizeType maxLength_; + + SValue minimum_; + SValue maximum_; + SValue multipleOf_; + bool exclusiveMinimum_; + bool exclusiveMaximum_; + + SizeType defaultValueLength_; +}; + +template +struct TokenHelper { + RAPIDJSON_FORCEINLINE static void AppendIndexToken(Stack& documentStack, SizeType index) { + *documentStack.template Push() = '/'; + char buffer[21]; + size_t length = static_cast((sizeof(SizeType) == 4 ? u32toa(index, buffer) : u64toa(index, buffer)) - buffer); + for (size_t i = 0; i < length; i++) + *documentStack.template Push() = static_cast(buffer[i]); + } +}; + +// Partial specialized version for char to prevent buffer copying. +template +struct TokenHelper { + RAPIDJSON_FORCEINLINE static void AppendIndexToken(Stack& documentStack, SizeType index) { + if (sizeof(SizeType) == 4) { + char *buffer = documentStack.template Push(1 + 10); // '/' + uint + *buffer++ = '/'; + const char* end = internal::u32toa(index, buffer); + documentStack.template Pop(static_cast(10 - (end - buffer))); + } + else { + char *buffer = documentStack.template Push(1 + 20); // '/' + uint64 + *buffer++ = '/'; + const char* end = internal::u64toa(index, buffer); + documentStack.template Pop(static_cast(20 - (end - buffer))); + } + } +}; + +} // namespace internal + +/////////////////////////////////////////////////////////////////////////////// +// IGenericRemoteSchemaDocumentProvider + +template +class IGenericRemoteSchemaDocumentProvider { +public: + typedef typename SchemaDocumentType::Ch Ch; + typedef typename SchemaDocumentType::ValueType ValueType; + typedef typename SchemaDocumentType::AllocatorType AllocatorType; + + virtual ~IGenericRemoteSchemaDocumentProvider() {} + virtual const SchemaDocumentType* GetRemoteDocument(const Ch* uri, SizeType length) = 0; + virtual const SchemaDocumentType* GetRemoteDocument(GenericUri uri) { return GetRemoteDocument(uri.GetBaseString(), uri.GetBaseStringLength()); } +}; + +/////////////////////////////////////////////////////////////////////////////// +// GenericSchemaDocument + +//! JSON schema document. +/*! + A JSON schema document is a compiled version of a JSON schema. + It is basically a tree of internal::Schema. + + \note This is an immutable class (i.e. its instance cannot be modified after construction). + \tparam ValueT Type of JSON value (e.g. \c Value ), which also determine the encoding. + \tparam Allocator Allocator type for allocating memory of this document. +*/ +template +class GenericSchemaDocument { +public: + typedef ValueT ValueType; + typedef IGenericRemoteSchemaDocumentProvider IRemoteSchemaDocumentProviderType; + typedef Allocator AllocatorType; + typedef typename ValueType::EncodingType EncodingType; + typedef typename EncodingType::Ch Ch; + typedef internal::Schema SchemaType; + typedef GenericPointer PointerType; + typedef GenericValue SValue; + typedef GenericUri UriType; + friend class internal::Schema; + template + friend class GenericSchemaValidator; + + //! Constructor. + /*! + Compile a JSON document into schema document. + + \param document A JSON document as source. + \param uri The base URI of this schema document for purposes of violation reporting. + \param uriLength Length of \c name, in code points. + \param remoteProvider An optional remote schema document provider for resolving remote reference. Can be null. + \param allocator An optional allocator instance for allocating memory. Can be null. + \param pointer An optional JSON pointer to the start of the schema document + */ + explicit GenericSchemaDocument(const ValueType& document, const Ch* uri = 0, SizeType uriLength = 0, + IRemoteSchemaDocumentProviderType* remoteProvider = 0, Allocator* allocator = 0, + const PointerType& pointer = PointerType()) : // PR #1393 + remoteProvider_(remoteProvider), + allocator_(allocator), + ownAllocator_(), + root_(), + typeless_(), + schemaMap_(allocator, kInitialSchemaMapSize), + schemaRef_(allocator, kInitialSchemaRefSize) + { + if (!allocator_) + ownAllocator_ = allocator_ = RAPIDJSON_NEW(Allocator)(); + + Ch noUri[1] = {0}; + uri_.SetString(uri ? uri : noUri, uriLength, *allocator_); + docId_ = UriType(uri_, allocator_); + + typeless_ = static_cast(allocator_->Malloc(sizeof(SchemaType))); + new (typeless_) SchemaType(this, PointerType(), ValueType(kObjectType).Move(), ValueType(kObjectType).Move(), allocator_, docId_); + + // Generate root schema, it will call CreateSchema() to create sub-schemas, + // And call HandleRefSchema() if there are $ref. + // PR #1393 use input pointer if supplied + root_ = typeless_; + if (pointer.GetTokenCount() == 0) { + CreateSchemaRecursive(&root_, pointer, document, document, docId_); + } + else if (const ValueType* v = pointer.Get(document)) { + CreateSchema(&root_, pointer, *v, document, docId_); + } + + RAPIDJSON_ASSERT(root_ != 0); + + schemaRef_.ShrinkToFit(); // Deallocate all memory for ref + } + +#if RAPIDJSON_HAS_CXX11_RVALUE_REFS + //! Move constructor in C++11 + GenericSchemaDocument(GenericSchemaDocument&& rhs) RAPIDJSON_NOEXCEPT : + remoteProvider_(rhs.remoteProvider_), + allocator_(rhs.allocator_), + ownAllocator_(rhs.ownAllocator_), + root_(rhs.root_), + typeless_(rhs.typeless_), + schemaMap_(std::move(rhs.schemaMap_)), + schemaRef_(std::move(rhs.schemaRef_)), + uri_(std::move(rhs.uri_)), + docId_(rhs.docId_) + { + rhs.remoteProvider_ = 0; + rhs.allocator_ = 0; + rhs.ownAllocator_ = 0; + rhs.typeless_ = 0; + } +#endif + + //! Destructor + ~GenericSchemaDocument() { + while (!schemaMap_.Empty()) + schemaMap_.template Pop(1)->~SchemaEntry(); + + if (typeless_) { + typeless_->~SchemaType(); + Allocator::Free(typeless_); + } + + RAPIDJSON_DELETE(ownAllocator_); + } + + const SValue& GetURI() const { return uri_; } + + //! Get the root schema. + const SchemaType& GetRoot() const { return *root_; } + +private: + //! Prohibit copying + GenericSchemaDocument(const GenericSchemaDocument&); + //! Prohibit assignment + GenericSchemaDocument& operator=(const GenericSchemaDocument&); + + typedef const PointerType* SchemaRefPtr; // PR #1393 + + struct SchemaEntry { + SchemaEntry(const PointerType& p, SchemaType* s, bool o, Allocator* allocator) : pointer(p, allocator), schema(s), owned(o) {} + ~SchemaEntry() { + if (owned) { + schema->~SchemaType(); + Allocator::Free(schema); + } + } + PointerType pointer; + SchemaType* schema; + bool owned; + }; + + // Changed by PR #1393 + void CreateSchemaRecursive(const SchemaType** schema, const PointerType& pointer, const ValueType& v, const ValueType& document, const UriType& id) { + if (v.GetType() == kObjectType) { + UriType newid = UriType(CreateSchema(schema, pointer, v, document, id), allocator_); + + for (typename ValueType::ConstMemberIterator itr = v.MemberBegin(); itr != v.MemberEnd(); ++itr) + CreateSchemaRecursive(0, pointer.Append(itr->name, allocator_), itr->value, document, newid); + } + else if (v.GetType() == kArrayType) + for (SizeType i = 0; i < v.Size(); i++) + CreateSchemaRecursive(0, pointer.Append(i, allocator_), v[i], document, id); + } + + // Changed by PR #1393 + const UriType& CreateSchema(const SchemaType** schema, const PointerType& pointer, const ValueType& v, const ValueType& document, const UriType& id) { + RAPIDJSON_ASSERT(pointer.IsValid()); + if (v.IsObject()) { + if (const SchemaType* sc = GetSchema(pointer)) { + if (schema) + *schema = sc; + AddSchemaRefs(const_cast(sc)); + } + else if (!HandleRefSchema(pointer, schema, v, document, id)) { + // The new schema constructor adds itself and its $ref(s) to schemaMap_ + SchemaType* s = new (allocator_->Malloc(sizeof(SchemaType))) SchemaType(this, pointer, v, document, allocator_, id); + if (schema) + *schema = s; + return s->GetId(); + } + } + else { + if (schema) + *schema = typeless_; + AddSchemaRefs(typeless_); + } + return id; + } + + // Changed by PR #1393 + // TODO should this return a UriType& ? + bool HandleRefSchema(const PointerType& source, const SchemaType** schema, const ValueType& v, const ValueType& document, const UriType& id) { + typename ValueType::ConstMemberIterator itr = v.FindMember(SchemaType::GetRefString()); + if (itr == v.MemberEnd()) + return false; + + // Resolve the source pointer to the $ref'ed schema (finally) + new (schemaRef_.template Push()) SchemaRefPtr(&source); + + if (itr->value.IsString()) { + SizeType len = itr->value.GetStringLength(); + if (len > 0) { + // First resolve $ref against the in-scope id + UriType scopeId = UriType(id, allocator_); + UriType ref = UriType(itr->value, allocator_).Resolve(scopeId, allocator_); + // See if the resolved $ref minus the fragment matches a resolved id in this document + // Search from the root. Returns the subschema in the document and its absolute JSON pointer. + PointerType basePointer = PointerType(); + const ValueType *base = FindId(document, ref, basePointer, docId_, false); + if (!base) { + // Remote reference - call the remote document provider + if (remoteProvider_) { + if (const GenericSchemaDocument* remoteDocument = remoteProvider_->GetRemoteDocument(ref)) { + const Ch* s = ref.GetFragString(); + len = ref.GetFragStringLength(); + if (len <= 1 || s[1] == '/') { + // JSON pointer fragment, absolute in the remote schema + const PointerType pointer(s, len, allocator_); + if (pointer.IsValid()) { + // Get the subschema + if (const SchemaType *sc = remoteDocument->GetSchema(pointer)) { + if (schema) + *schema = sc; + AddSchemaRefs(const_cast(sc)); + return true; + } + } + } else { + // Plain name fragment, not allowed + } + } + } + } + else { // Local reference + const Ch* s = ref.GetFragString(); + len = ref.GetFragStringLength(); + if (len <= 1 || s[1] == '/') { + // JSON pointer fragment, relative to the resolved URI + const PointerType relPointer(s, len, allocator_); + if (relPointer.IsValid()) { + // Get the subschema + if (const ValueType *pv = relPointer.Get(*base)) { + // Now get the absolute JSON pointer by adding relative to base + PointerType pointer(basePointer); + for (SizeType i = 0; i < relPointer.GetTokenCount(); i++) + pointer = pointer.Append(relPointer.GetTokens()[i], allocator_); + //GenericStringBuffer sb; + //pointer.StringifyUriFragment(sb); + if (pointer.IsValid() && !IsCyclicRef(pointer)) { + // Call CreateSchema recursively, but first compute the in-scope id for the $ref target as we have jumped there + // TODO: cache pointer <-> id mapping + size_t unresolvedTokenIndex; + scopeId = pointer.GetUri(document, docId_, &unresolvedTokenIndex, allocator_); + CreateSchema(schema, pointer, *pv, document, scopeId); + return true; + } + } + } + } else { + // Plain name fragment, relative to the resolved URI + // See if the fragment matches an id in this document. + // Search from the base we just established. Returns the subschema in the document and its absolute JSON pointer. + PointerType pointer = PointerType(); + if (const ValueType *pv = FindId(*base, ref, pointer, UriType(ref.GetBaseString(), ref.GetBaseStringLength(), allocator_), true, basePointer)) { + if (!IsCyclicRef(pointer)) { + //GenericStringBuffer sb; + //pointer.StringifyUriFragment(sb); + // Call CreateSchema recursively, but first compute the in-scope id for the $ref target as we have jumped there + // TODO: cache pointer <-> id mapping + size_t unresolvedTokenIndex; + scopeId = pointer.GetUri(document, docId_, &unresolvedTokenIndex, allocator_); + CreateSchema(schema, pointer, *pv, document, scopeId); + return true; + } + } + } + } + } + } + + // Invalid/Unknown $ref + if (schema) + *schema = typeless_; + AddSchemaRefs(typeless_); + return true; + } + + //! Find the first subschema with a resolved 'id' that matches the specified URI. + // If full specified use all URI else ignore fragment. + // If found, return a pointer to the subschema and its JSON pointer. + // TODO cache pointer <-> id mapping + ValueType* FindId(const ValueType& doc, const UriType& finduri, PointerType& resptr, const UriType& baseuri, bool full, const PointerType& here = PointerType()) const { + SizeType i = 0; + ValueType* resval = 0; + UriType tempuri = UriType(finduri, allocator_); + UriType localuri = UriType(baseuri, allocator_); + if (doc.GetType() == kObjectType) { + // Establish the base URI of this object + typename ValueType::ConstMemberIterator m = doc.FindMember(SchemaType::GetIdString()); + if (m != doc.MemberEnd() && m->value.GetType() == kStringType) { + localuri = UriType(m->value, allocator_).Resolve(baseuri, allocator_); + } + // See if it matches + if (localuri.Match(finduri, full)) { + resval = const_cast(&doc); + resptr = here; + return resval; + } + // No match, continue looking + for (m = doc.MemberBegin(); m != doc.MemberEnd(); ++m) { + if (m->value.GetType() == kObjectType || m->value.GetType() == kArrayType) { + resval = FindId(m->value, finduri, resptr, localuri, full, here.Append(m->name.GetString(), m->name.GetStringLength(), allocator_)); + } + if (resval) break; + } + } else if (doc.GetType() == kArrayType) { + // Continue looking + for (typename ValueType::ConstValueIterator v = doc.Begin(); v != doc.End(); ++v) { + if (v->GetType() == kObjectType || v->GetType() == kArrayType) { + resval = FindId(*v, finduri, resptr, localuri, full, here.Append(i, allocator_)); + } + if (resval) break; + i++; + } + } + return resval; + } + + // Added by PR #1393 + void AddSchemaRefs(SchemaType* schema) { + while (!schemaRef_.Empty()) { + SchemaRefPtr *ref = schemaRef_.template Pop(1); + SchemaEntry *entry = schemaMap_.template Push(); + new (entry) SchemaEntry(**ref, schema, false, allocator_); + } + } + + // Added by PR #1393 + bool IsCyclicRef(const PointerType& pointer) const { + for (const SchemaRefPtr* ref = schemaRef_.template Bottom(); ref != schemaRef_.template End(); ++ref) + if (pointer == **ref) + return true; + return false; + } + + const SchemaType* GetSchema(const PointerType& pointer) const { + for (const SchemaEntry* target = schemaMap_.template Bottom(); target != schemaMap_.template End(); ++target) + if (pointer == target->pointer) + return target->schema; + return 0; + } + + PointerType GetPointer(const SchemaType* schema) const { + for (const SchemaEntry* target = schemaMap_.template Bottom(); target != schemaMap_.template End(); ++target) + if (schema == target->schema) + return target->pointer; + return PointerType(); + } + + const SchemaType* GetTypeless() const { return typeless_; } + + static const size_t kInitialSchemaMapSize = 64; + static const size_t kInitialSchemaRefSize = 64; + + IRemoteSchemaDocumentProviderType* remoteProvider_; + Allocator *allocator_; + Allocator *ownAllocator_; + const SchemaType* root_; //!< Root schema. + SchemaType* typeless_; + internal::Stack schemaMap_; // Stores created Pointer -> Schemas + internal::Stack schemaRef_; // Stores Pointer(s) from $ref(s) until resolved + SValue uri_; // Schema document URI + UriType docId_; +}; + +//! GenericSchemaDocument using Value type. +typedef GenericSchemaDocument SchemaDocument; +//! IGenericRemoteSchemaDocumentProvider using SchemaDocument. +typedef IGenericRemoteSchemaDocumentProvider IRemoteSchemaDocumentProvider; + +/////////////////////////////////////////////////////////////////////////////// +// GenericSchemaValidator + +//! JSON Schema Validator. +/*! + A SAX style JSON schema validator. + It uses a \c GenericSchemaDocument to validate SAX events. + It delegates the incoming SAX events to an output handler. + The default output handler does nothing. + It can be reused multiple times by calling \c Reset(). + + \tparam SchemaDocumentType Type of schema document. + \tparam OutputHandler Type of output handler. Default handler does nothing. + \tparam StateAllocator Allocator for storing the internal validation states. +*/ +template < + typename SchemaDocumentType, + typename OutputHandler = BaseReaderHandler, + typename StateAllocator = CrtAllocator> +class GenericSchemaValidator : + public internal::ISchemaStateFactory, + public internal::ISchemaValidator, + public internal::IValidationErrorHandler { +public: + typedef typename SchemaDocumentType::SchemaType SchemaType; + typedef typename SchemaDocumentType::PointerType PointerType; + typedef typename SchemaType::EncodingType EncodingType; + typedef typename SchemaType::SValue SValue; + typedef typename EncodingType::Ch Ch; + typedef GenericStringRef StringRefType; + typedef GenericValue ValueType; + + //! Constructor without output handler. + /*! + \param schemaDocument The schema document to conform to. + \param allocator Optional allocator for storing internal validation states. + \param schemaStackCapacity Optional initial capacity of schema path stack. + \param documentStackCapacity Optional initial capacity of document path stack. + */ + GenericSchemaValidator( + const SchemaDocumentType& schemaDocument, + StateAllocator* allocator = 0, + size_t schemaStackCapacity = kDefaultSchemaStackCapacity, + size_t documentStackCapacity = kDefaultDocumentStackCapacity) + : + schemaDocument_(&schemaDocument), + root_(schemaDocument.GetRoot()), + stateAllocator_(allocator), + ownStateAllocator_(0), + schemaStack_(allocator, schemaStackCapacity), + documentStack_(allocator, documentStackCapacity), + outputHandler_(0), + error_(kObjectType), + currentError_(), + missingDependents_(), + valid_(true), + flags_(kValidateDefaultFlags) +#if RAPIDJSON_SCHEMA_VERBOSE + , depth_(0) +#endif + { + } + + //! Constructor with output handler. + /*! + \param schemaDocument The schema document to conform to. + \param allocator Optional allocator for storing internal validation states. + \param schemaStackCapacity Optional initial capacity of schema path stack. + \param documentStackCapacity Optional initial capacity of document path stack. + */ + GenericSchemaValidator( + const SchemaDocumentType& schemaDocument, + OutputHandler& outputHandler, + StateAllocator* allocator = 0, + size_t schemaStackCapacity = kDefaultSchemaStackCapacity, + size_t documentStackCapacity = kDefaultDocumentStackCapacity) + : + schemaDocument_(&schemaDocument), + root_(schemaDocument.GetRoot()), + stateAllocator_(allocator), + ownStateAllocator_(0), + schemaStack_(allocator, schemaStackCapacity), + documentStack_(allocator, documentStackCapacity), + outputHandler_(&outputHandler), + error_(kObjectType), + currentError_(), + missingDependents_(), + valid_(true), + flags_(kValidateDefaultFlags) +#if RAPIDJSON_SCHEMA_VERBOSE + , depth_(0) +#endif + { + } + + //! Destructor. + ~GenericSchemaValidator() { + Reset(); + RAPIDJSON_DELETE(ownStateAllocator_); + } + + //! Reset the internal states. + void Reset() { + while (!schemaStack_.Empty()) + PopSchema(); + documentStack_.Clear(); + ResetError(); + } + + //! Reset the error state. + void ResetError() { + error_.SetObject(); + currentError_.SetNull(); + missingDependents_.SetNull(); + valid_ = true; + } + + //! Implementation of ISchemaValidator + void SetValidateFlags(unsigned flags) { + flags_ = flags; + } + virtual unsigned GetValidateFlags() const { + return flags_; + } + + //! Checks whether the current state is valid. + // Implementation of ISchemaValidator + virtual bool IsValid() const { + if (!valid_) return false; + if (GetContinueOnErrors() && !error_.ObjectEmpty()) return false; + return true; + } + + //! Gets the error object. + ValueType& GetError() { return error_; } + const ValueType& GetError() const { return error_; } + + //! Gets the JSON pointer pointed to the invalid schema. + // If reporting all errors, the stack will be empty. + PointerType GetInvalidSchemaPointer() const { + return schemaStack_.Empty() ? PointerType() : CurrentSchema().GetPointer(); + } + + //! Gets the keyword of invalid schema. + // If reporting all errors, the stack will be empty, so return "errors". + const Ch* GetInvalidSchemaKeyword() const { + if (!schemaStack_.Empty()) return CurrentContext().invalidKeyword; + if (GetContinueOnErrors() && !error_.ObjectEmpty()) return (const Ch*)GetErrorsString(); + return 0; + } + + //! Gets the error code of invalid schema. + // If reporting all errors, the stack will be empty, so return kValidateErrors. + ValidateErrorCode GetInvalidSchemaCode() const { + if (!schemaStack_.Empty()) return CurrentContext().invalidCode; + if (GetContinueOnErrors() && !error_.ObjectEmpty()) return kValidateErrors; + return kValidateErrorNone; + } + + //! Gets the JSON pointer pointed to the invalid value. + // If reporting all errors, the stack will be empty. + PointerType GetInvalidDocumentPointer() const { + if (documentStack_.Empty()) { + return PointerType(); + } + else { + return PointerType(documentStack_.template Bottom(), documentStack_.GetSize() / sizeof(Ch)); + } + } + + void NotMultipleOf(int64_t actual, const SValue& expected) { + AddNumberError(kValidateErrorMultipleOf, ValueType(actual).Move(), expected); + } + void NotMultipleOf(uint64_t actual, const SValue& expected) { + AddNumberError(kValidateErrorMultipleOf, ValueType(actual).Move(), expected); + } + void NotMultipleOf(double actual, const SValue& expected) { + AddNumberError(kValidateErrorMultipleOf, ValueType(actual).Move(), expected); + } + void AboveMaximum(int64_t actual, const SValue& expected, bool exclusive) { + AddNumberError(exclusive ? kValidateErrorExclusiveMaximum : kValidateErrorMaximum, ValueType(actual).Move(), expected, + exclusive ? &SchemaType::GetExclusiveMaximumString : 0); + } + void AboveMaximum(uint64_t actual, const SValue& expected, bool exclusive) { + AddNumberError(exclusive ? kValidateErrorExclusiveMaximum : kValidateErrorMaximum, ValueType(actual).Move(), expected, + exclusive ? &SchemaType::GetExclusiveMaximumString : 0); + } + void AboveMaximum(double actual, const SValue& expected, bool exclusive) { + AddNumberError(exclusive ? kValidateErrorExclusiveMaximum : kValidateErrorMaximum, ValueType(actual).Move(), expected, + exclusive ? &SchemaType::GetExclusiveMaximumString : 0); + } + void BelowMinimum(int64_t actual, const SValue& expected, bool exclusive) { + AddNumberError(exclusive ? kValidateErrorExclusiveMinimum : kValidateErrorMinimum, ValueType(actual).Move(), expected, + exclusive ? &SchemaType::GetExclusiveMinimumString : 0); + } + void BelowMinimum(uint64_t actual, const SValue& expected, bool exclusive) { + AddNumberError(exclusive ? kValidateErrorExclusiveMinimum : kValidateErrorMinimum, ValueType(actual).Move(), expected, + exclusive ? &SchemaType::GetExclusiveMinimumString : 0); + } + void BelowMinimum(double actual, const SValue& expected, bool exclusive) { + AddNumberError(exclusive ? kValidateErrorExclusiveMinimum : kValidateErrorMinimum, ValueType(actual).Move(), expected, + exclusive ? &SchemaType::GetExclusiveMinimumString : 0); + } + + void TooLong(const Ch* str, SizeType length, SizeType expected) { + AddNumberError(kValidateErrorMaxLength, + ValueType(str, length, GetStateAllocator()).Move(), SValue(expected).Move()); + } + void TooShort(const Ch* str, SizeType length, SizeType expected) { + AddNumberError(kValidateErrorMinLength, + ValueType(str, length, GetStateAllocator()).Move(), SValue(expected).Move()); + } + void DoesNotMatch(const Ch* str, SizeType length) { + currentError_.SetObject(); + currentError_.AddMember(GetActualString(), ValueType(str, length, GetStateAllocator()).Move(), GetStateAllocator()); + AddCurrentError(kValidateErrorPattern); + } + + void DisallowedItem(SizeType index) { + currentError_.SetObject(); + currentError_.AddMember(GetDisallowedString(), ValueType(index).Move(), GetStateAllocator()); + AddCurrentError(kValidateErrorAdditionalItems, true); + } + void TooFewItems(SizeType actualCount, SizeType expectedCount) { + AddNumberError(kValidateErrorMinItems, + ValueType(actualCount).Move(), SValue(expectedCount).Move()); + } + void TooManyItems(SizeType actualCount, SizeType expectedCount) { + AddNumberError(kValidateErrorMaxItems, + ValueType(actualCount).Move(), SValue(expectedCount).Move()); + } + void DuplicateItems(SizeType index1, SizeType index2) { + ValueType duplicates(kArrayType); + duplicates.PushBack(index1, GetStateAllocator()); + duplicates.PushBack(index2, GetStateAllocator()); + currentError_.SetObject(); + currentError_.AddMember(GetDuplicatesString(), duplicates, GetStateAllocator()); + AddCurrentError(kValidateErrorUniqueItems, true); + } + + void TooManyProperties(SizeType actualCount, SizeType expectedCount) { + AddNumberError(kValidateErrorMaxProperties, + ValueType(actualCount).Move(), SValue(expectedCount).Move()); + } + void TooFewProperties(SizeType actualCount, SizeType expectedCount) { + AddNumberError(kValidateErrorMinProperties, + ValueType(actualCount).Move(), SValue(expectedCount).Move()); + } + void StartMissingProperties() { + currentError_.SetArray(); + } + void AddMissingProperty(const SValue& name) { + currentError_.PushBack(ValueType(name, GetStateAllocator()).Move(), GetStateAllocator()); + } + bool EndMissingProperties() { + if (currentError_.Empty()) + return false; + ValueType error(kObjectType); + error.AddMember(GetMissingString(), currentError_, GetStateAllocator()); + currentError_ = error; + AddCurrentError(kValidateErrorRequired); + return true; + } + void PropertyViolations(ISchemaValidator** subvalidators, SizeType count) { + for (SizeType i = 0; i < count; ++i) + MergeError(static_cast(subvalidators[i])->GetError()); + } + void DisallowedProperty(const Ch* name, SizeType length) { + currentError_.SetObject(); + currentError_.AddMember(GetDisallowedString(), ValueType(name, length, GetStateAllocator()).Move(), GetStateAllocator()); + AddCurrentError(kValidateErrorAdditionalProperties, true); + } + + void StartDependencyErrors() { + currentError_.SetObject(); + } + void StartMissingDependentProperties() { + missingDependents_.SetArray(); + } + void AddMissingDependentProperty(const SValue& targetName) { + missingDependents_.PushBack(ValueType(targetName, GetStateAllocator()).Move(), GetStateAllocator()); + } + void EndMissingDependentProperties(const SValue& sourceName) { + if (!missingDependents_.Empty()) { + // Create equivalent 'required' error + ValueType error(kObjectType); + ValidateErrorCode code = kValidateErrorRequired; + error.AddMember(GetMissingString(), missingDependents_.Move(), GetStateAllocator()); + AddErrorCode(error, code); + AddErrorInstanceLocation(error, false); + // When appending to a pointer ensure its allocator is used + PointerType schemaRef = GetInvalidSchemaPointer().Append(SchemaType::GetValidateErrorKeyword(kValidateErrorDependencies), &GetInvalidSchemaPointer().GetAllocator()); + AddErrorSchemaLocation(error, schemaRef.Append(sourceName.GetString(), sourceName.GetStringLength(), &GetInvalidSchemaPointer().GetAllocator())); + ValueType wrapper(kObjectType); + wrapper.AddMember(ValueType(SchemaType::GetValidateErrorKeyword(code), GetStateAllocator()).Move(), error, GetStateAllocator()); + currentError_.AddMember(ValueType(sourceName, GetStateAllocator()).Move(), wrapper, GetStateAllocator()); + } + } + void AddDependencySchemaError(const SValue& sourceName, ISchemaValidator* subvalidator) { + currentError_.AddMember(ValueType(sourceName, GetStateAllocator()).Move(), + static_cast(subvalidator)->GetError(), GetStateAllocator()); + } + bool EndDependencyErrors() { + if (currentError_.ObjectEmpty()) + return false; + ValueType error(kObjectType); + error.AddMember(GetErrorsString(), currentError_, GetStateAllocator()); + currentError_ = error; + AddCurrentError(kValidateErrorDependencies); + return true; + } + + void DisallowedValue(const ValidateErrorCode code = kValidateErrorEnum) { + currentError_.SetObject(); + AddCurrentError(code); + } + void StartDisallowedType() { + currentError_.SetArray(); + } + void AddExpectedType(const typename SchemaType::ValueType& expectedType) { + currentError_.PushBack(ValueType(expectedType, GetStateAllocator()).Move(), GetStateAllocator()); + } + void EndDisallowedType(const typename SchemaType::ValueType& actualType) { + ValueType error(kObjectType); + error.AddMember(GetExpectedString(), currentError_, GetStateAllocator()); + error.AddMember(GetActualString(), ValueType(actualType, GetStateAllocator()).Move(), GetStateAllocator()); + currentError_ = error; + AddCurrentError(kValidateErrorType); + } + void NotAllOf(ISchemaValidator** subvalidators, SizeType count) { + // Treat allOf like oneOf and anyOf to match https://rapidjson.org/md_doc_schema.html#allOf-anyOf-oneOf + AddErrorArray(kValidateErrorAllOf, subvalidators, count); + //for (SizeType i = 0; i < count; ++i) { + // MergeError(static_cast(subvalidators[i])->GetError()); + //} + } + void NoneOf(ISchemaValidator** subvalidators, SizeType count) { + AddErrorArray(kValidateErrorAnyOf, subvalidators, count); + } + void NotOneOf(ISchemaValidator** subvalidators, SizeType count, bool matched = false) { + AddErrorArray(matched ? kValidateErrorOneOfMatch : kValidateErrorOneOf, subvalidators, count); + } + void Disallowed() { + currentError_.SetObject(); + AddCurrentError(kValidateErrorNot); + } + +#define RAPIDJSON_STRING_(name, ...) \ + static const StringRefType& Get##name##String() {\ + static const Ch s[] = { __VA_ARGS__, '\0' };\ + static const StringRefType v(s, static_cast(sizeof(s) / sizeof(Ch) - 1)); \ + return v;\ + } + + RAPIDJSON_STRING_(InstanceRef, 'i', 'n', 's', 't', 'a', 'n', 'c', 'e', 'R', 'e', 'f') + RAPIDJSON_STRING_(SchemaRef, 's', 'c', 'h', 'e', 'm', 'a', 'R', 'e', 'f') + RAPIDJSON_STRING_(Expected, 'e', 'x', 'p', 'e', 'c', 't', 'e', 'd') + RAPIDJSON_STRING_(Actual, 'a', 'c', 't', 'u', 'a', 'l') + RAPIDJSON_STRING_(Disallowed, 'd', 'i', 's', 'a', 'l', 'l', 'o', 'w', 'e', 'd') + RAPIDJSON_STRING_(Missing, 'm', 'i', 's', 's', 'i', 'n', 'g') + RAPIDJSON_STRING_(Errors, 'e', 'r', 'r', 'o', 'r', 's') + RAPIDJSON_STRING_(ErrorCode, 'e', 'r', 'r', 'o', 'r', 'C', 'o', 'd', 'e') + RAPIDJSON_STRING_(ErrorMessage, 'e', 'r', 'r', 'o', 'r', 'M', 'e', 's', 's', 'a', 'g', 'e') + RAPIDJSON_STRING_(Duplicates, 'd', 'u', 'p', 'l', 'i', 'c', 'a', 't', 'e', 's') + +#undef RAPIDJSON_STRING_ + +#if RAPIDJSON_SCHEMA_VERBOSE +#define RAPIDJSON_SCHEMA_HANDLE_BEGIN_VERBOSE_() \ +RAPIDJSON_MULTILINEMACRO_BEGIN\ + *documentStack_.template Push() = '\0';\ + documentStack_.template Pop(1);\ + internal::PrintInvalidDocument(documentStack_.template Bottom());\ +RAPIDJSON_MULTILINEMACRO_END +#else +#define RAPIDJSON_SCHEMA_HANDLE_BEGIN_VERBOSE_() +#endif + +#define RAPIDJSON_SCHEMA_HANDLE_BEGIN_(method, arg1)\ + if (!valid_) return false; \ + if ((!BeginValue() && !GetContinueOnErrors()) || (!CurrentSchema().method arg1 && !GetContinueOnErrors())) {\ + RAPIDJSON_SCHEMA_HANDLE_BEGIN_VERBOSE_();\ + valid_ = false;\ + return valid_;\ + } + +#define RAPIDJSON_SCHEMA_HANDLE_PARALLEL_(method, arg2)\ + for (Context* context = schemaStack_.template Bottom(); context != schemaStack_.template End(); context++) {\ + if (context->hasher)\ + static_cast(context->hasher)->method arg2;\ + if (context->validators)\ + for (SizeType i_ = 0; i_ < context->validatorCount; i_++)\ + static_cast(context->validators[i_])->method arg2;\ + if (context->patternPropertiesValidators)\ + for (SizeType i_ = 0; i_ < context->patternPropertiesValidatorCount; i_++)\ + static_cast(context->patternPropertiesValidators[i_])->method arg2;\ + } + +#define RAPIDJSON_SCHEMA_HANDLE_END_(method, arg2)\ + valid_ = (EndValue() || GetContinueOnErrors()) && (!outputHandler_ || outputHandler_->method arg2);\ + return valid_; + +#define RAPIDJSON_SCHEMA_HANDLE_VALUE_(method, arg1, arg2) \ + RAPIDJSON_SCHEMA_HANDLE_BEGIN_ (method, arg1);\ + RAPIDJSON_SCHEMA_HANDLE_PARALLEL_(method, arg2);\ + RAPIDJSON_SCHEMA_HANDLE_END_ (method, arg2) + + bool Null() { RAPIDJSON_SCHEMA_HANDLE_VALUE_(Null, (CurrentContext()), ( )); } + bool Bool(bool b) { RAPIDJSON_SCHEMA_HANDLE_VALUE_(Bool, (CurrentContext(), b), (b)); } + bool Int(int i) { RAPIDJSON_SCHEMA_HANDLE_VALUE_(Int, (CurrentContext(), i), (i)); } + bool Uint(unsigned u) { RAPIDJSON_SCHEMA_HANDLE_VALUE_(Uint, (CurrentContext(), u), (u)); } + bool Int64(int64_t i) { RAPIDJSON_SCHEMA_HANDLE_VALUE_(Int64, (CurrentContext(), i), (i)); } + bool Uint64(uint64_t u) { RAPIDJSON_SCHEMA_HANDLE_VALUE_(Uint64, (CurrentContext(), u), (u)); } + bool Double(double d) { RAPIDJSON_SCHEMA_HANDLE_VALUE_(Double, (CurrentContext(), d), (d)); } + bool RawNumber(const Ch* str, SizeType length, bool copy) + { RAPIDJSON_SCHEMA_HANDLE_VALUE_(String, (CurrentContext(), str, length, copy), (str, length, copy)); } + bool String(const Ch* str, SizeType length, bool copy) + { RAPIDJSON_SCHEMA_HANDLE_VALUE_(String, (CurrentContext(), str, length, copy), (str, length, copy)); } + + bool StartObject() { + RAPIDJSON_SCHEMA_HANDLE_BEGIN_(StartObject, (CurrentContext())); + RAPIDJSON_SCHEMA_HANDLE_PARALLEL_(StartObject, ()); + valid_ = !outputHandler_ || outputHandler_->StartObject(); + return valid_; + } + + bool Key(const Ch* str, SizeType len, bool copy) { + if (!valid_) return false; + AppendToken(str, len); + if (!CurrentSchema().Key(CurrentContext(), str, len, copy) && !GetContinueOnErrors()) { + valid_ = false; + return valid_; + } + RAPIDJSON_SCHEMA_HANDLE_PARALLEL_(Key, (str, len, copy)); + valid_ = !outputHandler_ || outputHandler_->Key(str, len, copy); + return valid_; + } + + bool EndObject(SizeType memberCount) { + if (!valid_) return false; + RAPIDJSON_SCHEMA_HANDLE_PARALLEL_(EndObject, (memberCount)); + if (!CurrentSchema().EndObject(CurrentContext(), memberCount) && !GetContinueOnErrors()) { + valid_ = false; + return valid_; + } + RAPIDJSON_SCHEMA_HANDLE_END_(EndObject, (memberCount)); + } + + bool StartArray() { + RAPIDJSON_SCHEMA_HANDLE_BEGIN_(StartArray, (CurrentContext())); + RAPIDJSON_SCHEMA_HANDLE_PARALLEL_(StartArray, ()); + valid_ = !outputHandler_ || outputHandler_->StartArray(); + return valid_; + } + + bool EndArray(SizeType elementCount) { + if (!valid_) return false; + RAPIDJSON_SCHEMA_HANDLE_PARALLEL_(EndArray, (elementCount)); + if (!CurrentSchema().EndArray(CurrentContext(), elementCount) && !GetContinueOnErrors()) { + valid_ = false; + return valid_; + } + RAPIDJSON_SCHEMA_HANDLE_END_(EndArray, (elementCount)); + } + +#undef RAPIDJSON_SCHEMA_HANDLE_BEGIN_VERBOSE_ +#undef RAPIDJSON_SCHEMA_HANDLE_BEGIN_ +#undef RAPIDJSON_SCHEMA_HANDLE_PARALLEL_ +#undef RAPIDJSON_SCHEMA_HANDLE_VALUE_ + + // Implementation of ISchemaStateFactory + virtual ISchemaValidator* CreateSchemaValidator(const SchemaType& root, const bool inheritContinueOnErrors) { + ISchemaValidator* sv = new (GetStateAllocator().Malloc(sizeof(GenericSchemaValidator))) GenericSchemaValidator(*schemaDocument_, root, documentStack_.template Bottom(), documentStack_.GetSize(), +#if RAPIDJSON_SCHEMA_VERBOSE + depth_ + 1, +#endif + &GetStateAllocator()); + sv->SetValidateFlags(inheritContinueOnErrors ? GetValidateFlags() : GetValidateFlags() & ~(unsigned)kValidateContinueOnErrorFlag); + return sv; + } + + virtual void DestroySchemaValidator(ISchemaValidator* validator) { + GenericSchemaValidator* v = static_cast(validator); + v->~GenericSchemaValidator(); + StateAllocator::Free(v); + } + + virtual void* CreateHasher() { + return new (GetStateAllocator().Malloc(sizeof(HasherType))) HasherType(&GetStateAllocator()); + } + + virtual uint64_t GetHashCode(void* hasher) { + return static_cast(hasher)->GetHashCode(); + } + + virtual void DestroryHasher(void* hasher) { + HasherType* h = static_cast(hasher); + h->~HasherType(); + StateAllocator::Free(h); + } + + virtual void* MallocState(size_t size) { + return GetStateAllocator().Malloc(size); + } + + virtual void FreeState(void* p) { + StateAllocator::Free(p); + } + +private: + typedef typename SchemaType::Context Context; + typedef GenericValue, StateAllocator> HashCodeArray; + typedef internal::Hasher HasherType; + + GenericSchemaValidator( + const SchemaDocumentType& schemaDocument, + const SchemaType& root, + const char* basePath, size_t basePathSize, +#if RAPIDJSON_SCHEMA_VERBOSE + unsigned depth, +#endif + StateAllocator* allocator = 0, + size_t schemaStackCapacity = kDefaultSchemaStackCapacity, + size_t documentStackCapacity = kDefaultDocumentStackCapacity) + : + schemaDocument_(&schemaDocument), + root_(root), + stateAllocator_(allocator), + ownStateAllocator_(0), + schemaStack_(allocator, schemaStackCapacity), + documentStack_(allocator, documentStackCapacity), + outputHandler_(0), + error_(kObjectType), + currentError_(), + missingDependents_(), + valid_(true), + flags_(kValidateDefaultFlags) +#if RAPIDJSON_SCHEMA_VERBOSE + , depth_(depth) +#endif + { + if (basePath && basePathSize) + memcpy(documentStack_.template Push(basePathSize), basePath, basePathSize); + } + + StateAllocator& GetStateAllocator() { + if (!stateAllocator_) + stateAllocator_ = ownStateAllocator_ = RAPIDJSON_NEW(StateAllocator)(); + return *stateAllocator_; + } + + bool GetContinueOnErrors() const { + return flags_ & kValidateContinueOnErrorFlag; + } + + bool BeginValue() { + if (schemaStack_.Empty()) + PushSchema(root_); + else { + if (CurrentContext().inArray) + internal::TokenHelper, Ch>::AppendIndexToken(documentStack_, CurrentContext().arrayElementIndex); + + if (!CurrentSchema().BeginValue(CurrentContext()) && !GetContinueOnErrors()) + return false; + + SizeType count = CurrentContext().patternPropertiesSchemaCount; + const SchemaType** sa = CurrentContext().patternPropertiesSchemas; + typename Context::PatternValidatorType patternValidatorType = CurrentContext().valuePatternValidatorType; + bool valueUniqueness = CurrentContext().valueUniqueness; + RAPIDJSON_ASSERT(CurrentContext().valueSchema); + PushSchema(*CurrentContext().valueSchema); + + if (count > 0) { + CurrentContext().objectPatternValidatorType = patternValidatorType; + ISchemaValidator**& va = CurrentContext().patternPropertiesValidators; + SizeType& validatorCount = CurrentContext().patternPropertiesValidatorCount; + va = static_cast(MallocState(sizeof(ISchemaValidator*) * count)); + std::memset(va, 0, sizeof(ISchemaValidator*) * count); + for (SizeType i = 0; i < count; i++) + va[validatorCount++] = CreateSchemaValidator(*sa[i], true); // Inherit continueOnError + } + + CurrentContext().arrayUniqueness = valueUniqueness; + } + return true; + } + + bool EndValue() { + if (!CurrentSchema().EndValue(CurrentContext()) && !GetContinueOnErrors()) + return false; + +#if RAPIDJSON_SCHEMA_VERBOSE + GenericStringBuffer sb; + schemaDocument_->GetPointer(&CurrentSchema()).Stringify(sb); + + *documentStack_.template Push() = '\0'; + documentStack_.template Pop(1); + internal::PrintValidatorPointers(depth_, sb.GetString(), documentStack_.template Bottom()); +#endif + void* hasher = CurrentContext().hasher; + uint64_t h = hasher && CurrentContext().arrayUniqueness ? static_cast(hasher)->GetHashCode() : 0; + + PopSchema(); + + if (!schemaStack_.Empty()) { + Context& context = CurrentContext(); + // Only check uniqueness if there is a hasher + if (hasher && context.valueUniqueness) { + HashCodeArray* a = static_cast(context.arrayElementHashCodes); + if (!a) + CurrentContext().arrayElementHashCodes = a = new (GetStateAllocator().Malloc(sizeof(HashCodeArray))) HashCodeArray(kArrayType); + for (typename HashCodeArray::ConstValueIterator itr = a->Begin(); itr != a->End(); ++itr) + if (itr->GetUint64() == h) { + DuplicateItems(static_cast(itr - a->Begin()), a->Size()); + // Cleanup before returning if continuing + if (GetContinueOnErrors()) { + a->PushBack(h, GetStateAllocator()); + while (!documentStack_.Empty() && *documentStack_.template Pop(1) != '/'); + } + RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorUniqueItems); + } + a->PushBack(h, GetStateAllocator()); + } + } + + // Remove the last token of document pointer + while (!documentStack_.Empty() && *documentStack_.template Pop(1) != '/') + ; + + return true; + } + + void AppendToken(const Ch* str, SizeType len) { + documentStack_.template Reserve(1 + len * 2); // worst case all characters are escaped as two characters + *documentStack_.template PushUnsafe() = '/'; + for (SizeType i = 0; i < len; i++) { + if (str[i] == '~') { + *documentStack_.template PushUnsafe() = '~'; + *documentStack_.template PushUnsafe() = '0'; + } + else if (str[i] == '/') { + *documentStack_.template PushUnsafe() = '~'; + *documentStack_.template PushUnsafe() = '1'; + } + else + *documentStack_.template PushUnsafe() = str[i]; + } + } + + RAPIDJSON_FORCEINLINE void PushSchema(const SchemaType& schema) { new (schemaStack_.template Push()) Context(*this, *this, &schema); } + + RAPIDJSON_FORCEINLINE void PopSchema() { + Context* c = schemaStack_.template Pop(1); + if (HashCodeArray* a = static_cast(c->arrayElementHashCodes)) { + a->~HashCodeArray(); + StateAllocator::Free(a); + } + c->~Context(); + } + + void AddErrorInstanceLocation(ValueType& result, bool parent) { + GenericStringBuffer sb; + PointerType instancePointer = GetInvalidDocumentPointer(); + ((parent && instancePointer.GetTokenCount() > 0) + ? PointerType(instancePointer.GetTokens(), instancePointer.GetTokenCount() - 1) + : instancePointer).StringifyUriFragment(sb); + ValueType instanceRef(sb.GetString(), static_cast(sb.GetSize() / sizeof(Ch)), + GetStateAllocator()); + result.AddMember(GetInstanceRefString(), instanceRef, GetStateAllocator()); + } + + void AddErrorSchemaLocation(ValueType& result, PointerType schema = PointerType()) { + GenericStringBuffer sb; + SizeType len = CurrentSchema().GetURI().GetStringLength(); + if (len) memcpy(sb.Push(len), CurrentSchema().GetURI().GetString(), len * sizeof(Ch)); + if (schema.GetTokenCount()) schema.StringifyUriFragment(sb); + else GetInvalidSchemaPointer().StringifyUriFragment(sb); + ValueType schemaRef(sb.GetString(), static_cast(sb.GetSize() / sizeof(Ch)), + GetStateAllocator()); + result.AddMember(GetSchemaRefString(), schemaRef, GetStateAllocator()); + } + + void AddErrorCode(ValueType& result, const ValidateErrorCode code) { + result.AddMember(GetErrorCodeString(), code, GetStateAllocator()); + } + + void AddError(ValueType& keyword, ValueType& error) { + typename ValueType::MemberIterator member = error_.FindMember(keyword); + if (member == error_.MemberEnd()) + error_.AddMember(keyword, error, GetStateAllocator()); + else { + if (member->value.IsObject()) { + ValueType errors(kArrayType); + errors.PushBack(member->value, GetStateAllocator()); + member->value = errors; + } + member->value.PushBack(error, GetStateAllocator()); + } + } + + void AddCurrentError(const ValidateErrorCode code, bool parent = false) { + AddErrorCode(currentError_, code); + AddErrorInstanceLocation(currentError_, parent); + AddErrorSchemaLocation(currentError_); + AddError(ValueType(SchemaType::GetValidateErrorKeyword(code), GetStateAllocator(), false).Move(), currentError_); + } + + void MergeError(ValueType& other) { + for (typename ValueType::MemberIterator it = other.MemberBegin(), end = other.MemberEnd(); it != end; ++it) { + AddError(it->name, it->value); + } + } + + void AddNumberError(const ValidateErrorCode code, ValueType& actual, const SValue& expected, + const typename SchemaType::ValueType& (*exclusive)() = 0) { + currentError_.SetObject(); + currentError_.AddMember(GetActualString(), actual, GetStateAllocator()); + currentError_.AddMember(GetExpectedString(), ValueType(expected, GetStateAllocator()).Move(), GetStateAllocator()); + if (exclusive) + currentError_.AddMember(ValueType(exclusive(), GetStateAllocator()).Move(), true, GetStateAllocator()); + AddCurrentError(code); + } + + void AddErrorArray(const ValidateErrorCode code, + ISchemaValidator** subvalidators, SizeType count) { + ValueType errors(kArrayType); + for (SizeType i = 0; i < count; ++i) + errors.PushBack(static_cast(subvalidators[i])->GetError(), GetStateAllocator()); + currentError_.SetObject(); + currentError_.AddMember(GetErrorsString(), errors, GetStateAllocator()); + AddCurrentError(code); + } + + const SchemaType& CurrentSchema() const { return *schemaStack_.template Top()->schema; } + Context& CurrentContext() { return *schemaStack_.template Top(); } + const Context& CurrentContext() const { return *schemaStack_.template Top(); } + + static const size_t kDefaultSchemaStackCapacity = 1024; + static const size_t kDefaultDocumentStackCapacity = 256; + const SchemaDocumentType* schemaDocument_; + const SchemaType& root_; + StateAllocator* stateAllocator_; + StateAllocator* ownStateAllocator_; + internal::Stack schemaStack_; //!< stack to store the current path of schema (BaseSchemaType *) + internal::Stack documentStack_; //!< stack to store the current path of validating document (Ch) + OutputHandler* outputHandler_; + ValueType error_; + ValueType currentError_; + ValueType missingDependents_; + bool valid_; + unsigned flags_; +#if RAPIDJSON_SCHEMA_VERBOSE + unsigned depth_; +#endif +}; + +typedef GenericSchemaValidator SchemaValidator; + +/////////////////////////////////////////////////////////////////////////////// +// SchemaValidatingReader + +//! A helper class for parsing with validation. +/*! + This helper class is a functor, designed as a parameter of \ref GenericDocument::Populate(). + + \tparam parseFlags Combination of \ref ParseFlag. + \tparam InputStream Type of input stream, implementing Stream concept. + \tparam SourceEncoding Encoding of the input stream. + \tparam SchemaDocumentType Type of schema document. + \tparam StackAllocator Allocator type for stack. +*/ +template < + unsigned parseFlags, + typename InputStream, + typename SourceEncoding, + typename SchemaDocumentType = SchemaDocument, + typename StackAllocator = CrtAllocator> +class SchemaValidatingReader { +public: + typedef typename SchemaDocumentType::PointerType PointerType; + typedef typename InputStream::Ch Ch; + typedef GenericValue ValueType; + + //! Constructor + /*! + \param is Input stream. + \param sd Schema document. + */ + SchemaValidatingReader(InputStream& is, const SchemaDocumentType& sd) : is_(is), sd_(sd), invalidSchemaKeyword_(), invalidSchemaCode_(kValidateErrorNone), error_(kObjectType), isValid_(true) {} + + template + bool operator()(Handler& handler) { + GenericReader reader; + GenericSchemaValidator validator(sd_, handler); + parseResult_ = reader.template Parse(is_, validator); + + isValid_ = validator.IsValid(); + if (isValid_) { + invalidSchemaPointer_ = PointerType(); + invalidSchemaKeyword_ = 0; + invalidDocumentPointer_ = PointerType(); + error_.SetObject(); + } + else { + invalidSchemaPointer_ = validator.GetInvalidSchemaPointer(); + invalidSchemaKeyword_ = validator.GetInvalidSchemaKeyword(); + invalidSchemaCode_ = validator.GetInvalidSchemaCode(); + invalidDocumentPointer_ = validator.GetInvalidDocumentPointer(); + error_.CopyFrom(validator.GetError(), allocator_); + } + + return parseResult_; + } + + const ParseResult& GetParseResult() const { return parseResult_; } + bool IsValid() const { return isValid_; } + const PointerType& GetInvalidSchemaPointer() const { return invalidSchemaPointer_; } + const Ch* GetInvalidSchemaKeyword() const { return invalidSchemaKeyword_; } + const PointerType& GetInvalidDocumentPointer() const { return invalidDocumentPointer_; } + const ValueType& GetError() const { return error_; } + ValidateErrorCode GetInvalidSchemaCode() const { return invalidSchemaCode_; } + +private: + InputStream& is_; + const SchemaDocumentType& sd_; + + ParseResult parseResult_; + PointerType invalidSchemaPointer_; + const Ch* invalidSchemaKeyword_; + PointerType invalidDocumentPointer_; + ValidateErrorCode invalidSchemaCode_; + StackAllocator allocator_; + ValueType error_; + bool isValid_; +}; + +RAPIDJSON_NAMESPACE_END +RAPIDJSON_DIAG_POP + +#endif // RAPIDJSON_SCHEMA_H_ diff --git a/DFL_BOM_WL_TOERP/rapidjson/stream.h b/DFL_BOM_WL_TOERP/rapidjson/stream.h new file mode 100644 index 0000000..1fd7091 --- /dev/null +++ b/DFL_BOM_WL_TOERP/rapidjson/stream.h @@ -0,0 +1,223 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +#include "rapidjson.h" + +#ifndef RAPIDJSON_STREAM_H_ +#define RAPIDJSON_STREAM_H_ + +#include "encodings.h" + +RAPIDJSON_NAMESPACE_BEGIN + +/////////////////////////////////////////////////////////////////////////////// +// Stream + +/*! \class rapidjson::Stream + \brief Concept for reading and writing characters. + + For read-only stream, no need to implement PutBegin(), Put(), Flush() and PutEnd(). + + For write-only stream, only need to implement Put() and Flush(). + +\code +concept Stream { + typename Ch; //!< Character type of the stream. + + //! Read the current character from stream without moving the read cursor. + Ch Peek() const; + + //! Read the current character from stream and moving the read cursor to next character. + Ch Take(); + + //! Get the current read cursor. + //! \return Number of characters read from start. + size_t Tell(); + + //! Begin writing operation at the current read pointer. + //! \return The begin writer pointer. + Ch* PutBegin(); + + //! Write a character. + void Put(Ch c); + + //! Flush the buffer. + void Flush(); + + //! End the writing operation. + //! \param begin The begin write pointer returned by PutBegin(). + //! \return Number of characters written. + size_t PutEnd(Ch* begin); +} +\endcode +*/ + +//! Provides additional information for stream. +/*! + By using traits pattern, this type provides a default configuration for stream. + For custom stream, this type can be specialized for other configuration. + See TEST(Reader, CustomStringStream) in readertest.cpp for example. +*/ +template +struct StreamTraits { + //! Whether to make local copy of stream for optimization during parsing. + /*! + By default, for safety, streams do not use local copy optimization. + Stream that can be copied fast should specialize this, like StreamTraits. + */ + enum { copyOptimization = 0 }; +}; + +//! Reserve n characters for writing to a stream. +template +inline void PutReserve(Stream& stream, size_t count) { + (void)stream; + (void)count; +} + +//! Write character to a stream, presuming buffer is reserved. +template +inline void PutUnsafe(Stream& stream, typename Stream::Ch c) { + stream.Put(c); +} + +//! Put N copies of a character to a stream. +template +inline void PutN(Stream& stream, Ch c, size_t n) { + PutReserve(stream, n); + for (size_t i = 0; i < n; i++) + PutUnsafe(stream, c); +} + +/////////////////////////////////////////////////////////////////////////////// +// GenericStreamWrapper + +//! A Stream Wrapper +/*! \tThis string stream is a wrapper for any stream by just forwarding any + \treceived message to the origin stream. + \note implements Stream concept +*/ + +#if defined(_MSC_VER) && _MSC_VER <= 1800 +RAPIDJSON_DIAG_PUSH +RAPIDJSON_DIAG_OFF(4702) // unreachable code +RAPIDJSON_DIAG_OFF(4512) // assignment operator could not be generated +#endif + +template > +class GenericStreamWrapper { +public: + typedef typename Encoding::Ch Ch; + GenericStreamWrapper(InputStream& is): is_(is) {} + + Ch Peek() const { return is_.Peek(); } + Ch Take() { return is_.Take(); } + size_t Tell() { return is_.Tell(); } + Ch* PutBegin() { return is_.PutBegin(); } + void Put(Ch ch) { is_.Put(ch); } + void Flush() { is_.Flush(); } + size_t PutEnd(Ch* ch) { return is_.PutEnd(ch); } + + // wrapper for MemoryStream + const Ch* Peek4() const { return is_.Peek4(); } + + // wrapper for AutoUTFInputStream + UTFType GetType() const { return is_.GetType(); } + bool HasBOM() const { return is_.HasBOM(); } + +protected: + InputStream& is_; +}; + +#if defined(_MSC_VER) && _MSC_VER <= 1800 +RAPIDJSON_DIAG_POP +#endif + +/////////////////////////////////////////////////////////////////////////////// +// StringStream + +//! Read-only string stream. +/*! \note implements Stream concept +*/ +template +struct GenericStringStream { + typedef typename Encoding::Ch Ch; + + GenericStringStream(const Ch *src) : src_(src), head_(src) {} + + Ch Peek() const { return *src_; } + Ch Take() { return *src_++; } + size_t Tell() const { return static_cast(src_ - head_); } + + Ch* PutBegin() { RAPIDJSON_ASSERT(false); return 0; } + void Put(Ch) { RAPIDJSON_ASSERT(false); } + void Flush() { RAPIDJSON_ASSERT(false); } + size_t PutEnd(Ch*) { RAPIDJSON_ASSERT(false); return 0; } + + const Ch* src_; //!< Current read position. + const Ch* head_; //!< Original head of the string. +}; + +template +struct StreamTraits > { + enum { copyOptimization = 1 }; +}; + +//! String stream with UTF8 encoding. +typedef GenericStringStream > StringStream; + +/////////////////////////////////////////////////////////////////////////////// +// InsituStringStream + +//! A read-write string stream. +/*! This string stream is particularly designed for in-situ parsing. + \note implements Stream concept +*/ +template +struct GenericInsituStringStream { + typedef typename Encoding::Ch Ch; + + GenericInsituStringStream(Ch *src) : src_(src), dst_(0), head_(src) {} + + // Read + Ch Peek() { return *src_; } + Ch Take() { return *src_++; } + size_t Tell() { return static_cast(src_ - head_); } + + // Write + void Put(Ch c) { RAPIDJSON_ASSERT(dst_ != 0); *dst_++ = c; } + + Ch* PutBegin() { return dst_ = src_; } + size_t PutEnd(Ch* begin) { return static_cast(dst_ - begin); } + void Flush() {} + + Ch* Push(size_t count) { Ch* begin = dst_; dst_ += count; return begin; } + void Pop(size_t count) { dst_ -= count; } + + Ch* src_; + Ch* dst_; + Ch* head_; +}; + +template +struct StreamTraits > { + enum { copyOptimization = 1 }; +}; + +//! Insitu string stream with UTF8 encoding. +typedef GenericInsituStringStream > InsituStringStream; + +RAPIDJSON_NAMESPACE_END + +#endif // RAPIDJSON_STREAM_H_ diff --git a/DFL_BOM_WL_TOERP/rapidjson/stringbuffer.h b/DFL_BOM_WL_TOERP/rapidjson/stringbuffer.h new file mode 100644 index 0000000..82ad3ca --- /dev/null +++ b/DFL_BOM_WL_TOERP/rapidjson/stringbuffer.h @@ -0,0 +1,121 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +#ifndef RAPIDJSON_STRINGBUFFER_H_ +#define RAPIDJSON_STRINGBUFFER_H_ + +#include "stream.h" +#include "internal/stack.h" + +#if RAPIDJSON_HAS_CXX11_RVALUE_REFS +#include // std::move +#endif + +#include "internal/stack.h" + +#if defined(__clang__) +RAPIDJSON_DIAG_PUSH +RAPIDJSON_DIAG_OFF(c++98-compat) +#endif + +RAPIDJSON_NAMESPACE_BEGIN + +//! Represents an in-memory output stream. +/*! + \tparam Encoding Encoding of the stream. + \tparam Allocator type for allocating memory buffer. + \note implements Stream concept +*/ +template +class GenericStringBuffer { +public: + typedef typename Encoding::Ch Ch; + + GenericStringBuffer(Allocator* allocator = 0, size_t capacity = kDefaultCapacity) : stack_(allocator, capacity) {} + +#if RAPIDJSON_HAS_CXX11_RVALUE_REFS + GenericStringBuffer(GenericStringBuffer&& rhs) : stack_(std::move(rhs.stack_)) {} + GenericStringBuffer& operator=(GenericStringBuffer&& rhs) { + if (&rhs != this) + stack_ = std::move(rhs.stack_); + return *this; + } +#endif + + void Put(Ch c) { *stack_.template Push() = c; } + void PutUnsafe(Ch c) { *stack_.template PushUnsafe() = c; } + void Flush() {} + + void Clear() { stack_.Clear(); } + void ShrinkToFit() { + // Push and pop a null terminator. This is safe. + *stack_.template Push() = '\0'; + stack_.ShrinkToFit(); + stack_.template Pop(1); + } + + void Reserve(size_t count) { stack_.template Reserve(count); } + Ch* Push(size_t count) { return stack_.template Push(count); } + Ch* PushUnsafe(size_t count) { return stack_.template PushUnsafe(count); } + void Pop(size_t count) { stack_.template Pop(count); } + + const Ch* GetString() const { + // Push and pop a null terminator. This is safe. + *stack_.template Push() = '\0'; + stack_.template Pop(1); + + return stack_.template Bottom(); + } + + //! Get the size of string in bytes in the string buffer. + size_t GetSize() const { return stack_.GetSize(); } + + //! Get the length of string in Ch in the string buffer. + size_t GetLength() const { return stack_.GetSize() / sizeof(Ch); } + + static const size_t kDefaultCapacity = 256; + mutable internal::Stack stack_; + +private: + // Prohibit copy constructor & assignment operator. + GenericStringBuffer(const GenericStringBuffer&); + GenericStringBuffer& operator=(const GenericStringBuffer&); +}; + +//! String buffer with UTF8 encoding +typedef GenericStringBuffer > StringBuffer; + +template +inline void PutReserve(GenericStringBuffer& stream, size_t count) { + stream.Reserve(count); +} + +template +inline void PutUnsafe(GenericStringBuffer& stream, typename Encoding::Ch c) { + stream.PutUnsafe(c); +} + +//! Implement specialized version of PutN() with memset() for better performance. +template<> +inline void PutN(GenericStringBuffer >& stream, char c, size_t n) { + std::memset(stream.stack_.Push(n), c, n * sizeof(c)); +} + +RAPIDJSON_NAMESPACE_END + +#if defined(__clang__) +RAPIDJSON_DIAG_POP +#endif + +#endif // RAPIDJSON_STRINGBUFFER_H_ diff --git a/DFL_BOM_WL_TOERP/rapidjson/uri.h b/DFL_BOM_WL_TOERP/rapidjson/uri.h new file mode 100644 index 0000000..f93e508 --- /dev/null +++ b/DFL_BOM_WL_TOERP/rapidjson/uri.h @@ -0,0 +1,481 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// (C) Copyright IBM Corporation 2021 +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +#ifndef RAPIDJSON_URI_H_ +#define RAPIDJSON_URI_H_ + +#include "internal/strfunc.h" + +#if defined(__clang__) +RAPIDJSON_DIAG_PUSH +RAPIDJSON_DIAG_OFF(c++98-compat) +#elif defined(_MSC_VER) +RAPIDJSON_DIAG_OFF(4512) // assignment operator could not be generated +#endif + +RAPIDJSON_NAMESPACE_BEGIN + +/////////////////////////////////////////////////////////////////////////////// +// GenericUri + +template +class GenericUri { +public: + typedef typename ValueType::Ch Ch; +#if RAPIDJSON_HAS_STDSTRING + typedef std::basic_string String; +#endif + + //! Constructors + GenericUri(Allocator* allocator = 0) : uri_(), base_(), scheme_(), auth_(), path_(), query_(), frag_(), allocator_(allocator), ownAllocator_() { + } + + GenericUri(const Ch* uri, SizeType len, Allocator* allocator = 0) : uri_(), base_(), scheme_(), auth_(), path_(), query_(), frag_(), allocator_(allocator), ownAllocator_() { + Parse(uri, len); + } + + GenericUri(const Ch* uri, Allocator* allocator = 0) : uri_(), base_(), scheme_(), auth_(), path_(), query_(), frag_(), allocator_(allocator), ownAllocator_() { + Parse(uri, internal::StrLen(uri)); + } + + // Use with specializations of GenericValue + template GenericUri(const T& uri, Allocator* allocator = 0) : uri_(), base_(), scheme_(), auth_(), path_(), query_(), frag_(), allocator_(allocator), ownAllocator_() { + const Ch* u = uri.template Get(); // TypeHelper from document.h + Parse(u, internal::StrLen(u)); + } + +#if RAPIDJSON_HAS_STDSTRING + GenericUri(const String& uri, Allocator* allocator = 0) : uri_(), base_(), scheme_(), auth_(), path_(), query_(), frag_(), allocator_(allocator), ownAllocator_() { + Parse(uri.c_str(), internal::StrLen(uri.c_str())); + } +#endif + + //! Copy constructor + GenericUri(const GenericUri& rhs) : uri_(), base_(), scheme_(), auth_(), path_(), query_(), frag_(), allocator_(), ownAllocator_() { + *this = rhs; + } + + //! Copy constructor + GenericUri(const GenericUri& rhs, Allocator* allocator) : uri_(), base_(), scheme_(), auth_(), path_(), query_(), frag_(), allocator_(allocator), ownAllocator_() { + *this = rhs; + } + + //! Destructor. + ~GenericUri() { + Free(); + RAPIDJSON_DELETE(ownAllocator_); + } + + //! Assignment operator + GenericUri& operator=(const GenericUri& rhs) { + if (this != &rhs) { + // Do not delete ownAllocator + Free(); + Allocate(rhs.GetStringLength()); + auth_ = CopyPart(scheme_, rhs.scheme_, rhs.GetSchemeStringLength()); + path_ = CopyPart(auth_, rhs.auth_, rhs.GetAuthStringLength()); + query_ = CopyPart(path_, rhs.path_, rhs.GetPathStringLength()); + frag_ = CopyPart(query_, rhs.query_, rhs.GetQueryStringLength()); + base_ = CopyPart(frag_, rhs.frag_, rhs.GetFragStringLength()); + uri_ = CopyPart(base_, rhs.base_, rhs.GetBaseStringLength()); + CopyPart(uri_, rhs.uri_, rhs.GetStringLength()); + } + return *this; + } + + //! Getters + // Use with specializations of GenericValue + template void Get(T& uri, Allocator& allocator) { + uri.template Set(this->GetString(), allocator); // TypeHelper from document.h + } + + const Ch* GetString() const { return uri_; } + SizeType GetStringLength() const { return uri_ == 0 ? 0 : internal::StrLen(uri_); } + const Ch* GetBaseString() const { return base_; } + SizeType GetBaseStringLength() const { return base_ == 0 ? 0 : internal::StrLen(base_); } + const Ch* GetSchemeString() const { return scheme_; } + SizeType GetSchemeStringLength() const { return scheme_ == 0 ? 0 : internal::StrLen(scheme_); } + const Ch* GetAuthString() const { return auth_; } + SizeType GetAuthStringLength() const { return auth_ == 0 ? 0 : internal::StrLen(auth_); } + const Ch* GetPathString() const { return path_; } + SizeType GetPathStringLength() const { return path_ == 0 ? 0 : internal::StrLen(path_); } + const Ch* GetQueryString() const { return query_; } + SizeType GetQueryStringLength() const { return query_ == 0 ? 0 : internal::StrLen(query_); } + const Ch* GetFragString() const { return frag_; } + SizeType GetFragStringLength() const { return frag_ == 0 ? 0 : internal::StrLen(frag_); } + +#if RAPIDJSON_HAS_STDSTRING + static String Get(const GenericUri& uri) { return String(uri.GetString(), uri.GetStringLength()); } + static String GetBase(const GenericUri& uri) { return String(uri.GetBaseString(), uri.GetBaseStringLength()); } + static String GetScheme(const GenericUri& uri) { return String(uri.GetSchemeString(), uri.GetSchemeStringLength()); } + static String GetAuth(const GenericUri& uri) { return String(uri.GetAuthString(), uri.GetAuthStringLength()); } + static String GetPath(const GenericUri& uri) { return String(uri.GetPathString(), uri.GetPathStringLength()); } + static String GetQuery(const GenericUri& uri) { return String(uri.GetQueryString(), uri.GetQueryStringLength()); } + static String GetFrag(const GenericUri& uri) { return String(uri.GetFragString(), uri.GetFragStringLength()); } +#endif + + //! Equality operators + bool operator==(const GenericUri& rhs) const { + return Match(rhs, true); + } + + bool operator!=(const GenericUri& rhs) const { + return !Match(rhs, true); + } + + bool Match(const GenericUri& uri, bool full = true) const { + Ch* s1; + Ch* s2; + if (full) { + s1 = uri_; + s2 = uri.uri_; + } else { + s1 = base_; + s2 = uri.base_; + } + if (s1 == s2) return true; + if (s1 == 0 || s2 == 0) return false; + return internal::StrCmp(s1, s2) == 0; + } + + //! Resolve this URI against another (base) URI in accordance with URI resolution rules. + // See https://tools.ietf.org/html/rfc3986 + // Use for resolving an id or $ref with an in-scope id. + // Returns a new GenericUri for the resolved URI. + GenericUri Resolve(const GenericUri& baseuri, Allocator* allocator = 0) { + GenericUri resuri; + resuri.allocator_ = allocator; + // Ensure enough space for combining paths + resuri.Allocate(GetStringLength() + baseuri.GetStringLength() + 1); // + 1 for joining slash + + if (!(GetSchemeStringLength() == 0)) { + // Use all of this URI + resuri.auth_ = CopyPart(resuri.scheme_, scheme_, GetSchemeStringLength()); + resuri.path_ = CopyPart(resuri.auth_, auth_, GetAuthStringLength()); + resuri.query_ = CopyPart(resuri.path_, path_, GetPathStringLength()); + resuri.frag_ = CopyPart(resuri.query_, query_, GetQueryStringLength()); + resuri.RemoveDotSegments(); + } else { + // Use the base scheme + resuri.auth_ = CopyPart(resuri.scheme_, baseuri.scheme_, baseuri.GetSchemeStringLength()); + if (!(GetAuthStringLength() == 0)) { + // Use this auth, path, query + resuri.path_ = CopyPart(resuri.auth_, auth_, GetAuthStringLength()); + resuri.query_ = CopyPart(resuri.path_, path_, GetPathStringLength()); + resuri.frag_ = CopyPart(resuri.query_, query_, GetQueryStringLength()); + resuri.RemoveDotSegments(); + } else { + // Use the base auth + resuri.path_ = CopyPart(resuri.auth_, baseuri.auth_, baseuri.GetAuthStringLength()); + if (GetPathStringLength() == 0) { + // Use the base path + resuri.query_ = CopyPart(resuri.path_, baseuri.path_, baseuri.GetPathStringLength()); + if (GetQueryStringLength() == 0) { + // Use the base query + resuri.frag_ = CopyPart(resuri.query_, baseuri.query_, baseuri.GetQueryStringLength()); + } else { + // Use this query + resuri.frag_ = CopyPart(resuri.query_, query_, GetQueryStringLength()); + } + } else { + if (path_[0] == '/') { + // Absolute path - use all of this path + resuri.query_ = CopyPart(resuri.path_, path_, GetPathStringLength()); + resuri.RemoveDotSegments(); + } else { + // Relative path - append this path to base path after base path's last slash + size_t pos = 0; + if (!(baseuri.GetAuthStringLength() == 0) && baseuri.GetPathStringLength() == 0) { + resuri.path_[pos] = '/'; + pos++; + } + size_t lastslashpos = baseuri.GetPathStringLength(); + while (lastslashpos > 0) { + if (baseuri.path_[lastslashpos - 1] == '/') break; + lastslashpos--; + } + std::memcpy(&resuri.path_[pos], baseuri.path_, lastslashpos * sizeof(Ch)); + pos += lastslashpos; + resuri.query_ = CopyPart(&resuri.path_[pos], path_, GetPathStringLength()); + resuri.RemoveDotSegments(); + } + // Use this query + resuri.frag_ = CopyPart(resuri.query_, query_, GetQueryStringLength()); + } + } + } + // Always use this frag + resuri.base_ = CopyPart(resuri.frag_, frag_, GetFragStringLength()); + + // Re-constitute base_ and uri_ + resuri.SetBase(); + resuri.uri_ = resuri.base_ + resuri.GetBaseStringLength() + 1; + resuri.SetUri(); + return resuri; + } + + //! Get the allocator of this GenericUri. + Allocator& GetAllocator() { return *allocator_; } + +private: + // Allocate memory for a URI + // Returns total amount allocated + std::size_t Allocate(std::size_t len) { + // Create own allocator if user did not supply. + if (!allocator_) + ownAllocator_ = allocator_ = RAPIDJSON_NEW(Allocator)(); + + // Allocate one block containing each part of the URI (5) plus base plus full URI, all null terminated. + // Order: scheme, auth, path, query, frag, base, uri + // Note need to set, increment, assign in 3 stages to avoid compiler warning bug. + size_t total = (3 * len + 7) * sizeof(Ch); + scheme_ = static_cast(allocator_->Malloc(total)); + *scheme_ = '\0'; + auth_ = scheme_; + auth_++; + *auth_ = '\0'; + path_ = auth_; + path_++; + *path_ = '\0'; + query_ = path_; + query_++; + *query_ = '\0'; + frag_ = query_; + frag_++; + *frag_ = '\0'; + base_ = frag_; + base_++; + *base_ = '\0'; + uri_ = base_; + uri_++; + *uri_ = '\0'; + return total; + } + + // Free memory for a URI + void Free() { + if (scheme_) { + Allocator::Free(scheme_); + scheme_ = 0; + } + } + + // Parse a URI into constituent scheme, authority, path, query, & fragment parts + // Supports URIs that match regex ^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))? as per + // https://tools.ietf.org/html/rfc3986 + void Parse(const Ch* uri, std::size_t len) { + std::size_t start = 0, pos1 = 0, pos2 = 0; + Allocate(len); + + // Look for scheme ([^:/?#]+):)? + if (start < len) { + while (pos1 < len) { + if (uri[pos1] == ':') break; + pos1++; + } + if (pos1 != len) { + while (pos2 < len) { + if (uri[pos2] == '/') break; + if (uri[pos2] == '?') break; + if (uri[pos2] == '#') break; + pos2++; + } + if (pos1 < pos2) { + pos1++; + std::memcpy(scheme_, &uri[start], pos1 * sizeof(Ch)); + scheme_[pos1] = '\0'; + start = pos1; + } + } + } + // Look for auth (//([^/?#]*))? + // Note need to set, increment, assign in 3 stages to avoid compiler warning bug. + auth_ = scheme_ + GetSchemeStringLength(); + auth_++; + *auth_ = '\0'; + if (start < len - 1 && uri[start] == '/' && uri[start + 1] == '/') { + pos2 = start + 2; + while (pos2 < len) { + if (uri[pos2] == '/') break; + if (uri[pos2] == '?') break; + if (uri[pos2] == '#') break; + pos2++; + } + std::memcpy(auth_, &uri[start], (pos2 - start) * sizeof(Ch)); + auth_[pos2 - start] = '\0'; + start = pos2; + } + // Look for path ([^?#]*) + // Note need to set, increment, assign in 3 stages to avoid compiler warning bug. + path_ = auth_ + GetAuthStringLength(); + path_++; + *path_ = '\0'; + if (start < len) { + pos2 = start; + while (pos2 < len) { + if (uri[pos2] == '?') break; + if (uri[pos2] == '#') break; + pos2++; + } + if (start != pos2) { + std::memcpy(path_, &uri[start], (pos2 - start) * sizeof(Ch)); + path_[pos2 - start] = '\0'; + if (path_[0] == '/') + RemoveDotSegments(); // absolute path - normalize + start = pos2; + } + } + // Look for query (\?([^#]*))? + // Note need to set, increment, assign in 3 stages to avoid compiler warning bug. + query_ = path_ + GetPathStringLength(); + query_++; + *query_ = '\0'; + if (start < len && uri[start] == '?') { + pos2 = start + 1; + while (pos2 < len) { + if (uri[pos2] == '#') break; + pos2++; + } + if (start != pos2) { + std::memcpy(query_, &uri[start], (pos2 - start) * sizeof(Ch)); + query_[pos2 - start] = '\0'; + start = pos2; + } + } + // Look for fragment (#(.*))? + // Note need to set, increment, assign in 3 stages to avoid compiler warning bug. + frag_ = query_ + GetQueryStringLength(); + frag_++; + *frag_ = '\0'; + if (start < len && uri[start] == '#') { + std::memcpy(frag_, &uri[start], (len - start) * sizeof(Ch)); + frag_[len - start] = '\0'; + } + + // Re-constitute base_ and uri_ + base_ = frag_ + GetFragStringLength() + 1; + SetBase(); + uri_ = base_ + GetBaseStringLength() + 1; + SetUri(); + } + + // Reconstitute base + void SetBase() { + Ch* next = base_; + std::memcpy(next, scheme_, GetSchemeStringLength() * sizeof(Ch)); + next+= GetSchemeStringLength(); + std::memcpy(next, auth_, GetAuthStringLength() * sizeof(Ch)); + next+= GetAuthStringLength(); + std::memcpy(next, path_, GetPathStringLength() * sizeof(Ch)); + next+= GetPathStringLength(); + std::memcpy(next, query_, GetQueryStringLength() * sizeof(Ch)); + next+= GetQueryStringLength(); + *next = '\0'; + } + + // Reconstitute uri + void SetUri() { + Ch* next = uri_; + std::memcpy(next, base_, GetBaseStringLength() * sizeof(Ch)); + next+= GetBaseStringLength(); + std::memcpy(next, frag_, GetFragStringLength() * sizeof(Ch)); + next+= GetFragStringLength(); + *next = '\0'; + } + + // Copy a part from one GenericUri to another + // Return the pointer to the next part to be copied to + Ch* CopyPart(Ch* to, Ch* from, std::size_t len) { + RAPIDJSON_ASSERT(to != 0); + RAPIDJSON_ASSERT(from != 0); + std::memcpy(to, from, len * sizeof(Ch)); + to[len] = '\0'; + Ch* next = to + len + 1; + return next; + } + + // Remove . and .. segments from the path_ member. + // https://tools.ietf.org/html/rfc3986 + // This is done in place as we are only removing segments. + void RemoveDotSegments() { + std::size_t pathlen = GetPathStringLength(); + std::size_t pathpos = 0; // Position in path_ + std::size_t newpos = 0; // Position in new path_ + + // Loop through each segment in original path_ + while (pathpos < pathlen) { + // Get next segment, bounded by '/' or end + size_t slashpos = 0; + while ((pathpos + slashpos) < pathlen) { + if (path_[pathpos + slashpos] == '/') break; + slashpos++; + } + // Check for .. and . segments + if (slashpos == 2 && path_[pathpos] == '.' && path_[pathpos + 1] == '.') { + // Backup a .. segment in the new path_ + // We expect to find a previously added slash at the end or nothing + RAPIDJSON_ASSERT(newpos == 0 || path_[newpos - 1] == '/'); + size_t lastslashpos = newpos; + // Make sure we don't go beyond the start segment + if (lastslashpos > 1) { + // Find the next to last slash and back up to it + lastslashpos--; + while (lastslashpos > 0) { + if (path_[lastslashpos - 1] == '/') break; + lastslashpos--; + } + // Set the new path_ position + newpos = lastslashpos; + } + } else if (slashpos == 1 && path_[pathpos] == '.') { + // Discard . segment, leaves new path_ unchanged + } else { + // Move any other kind of segment to the new path_ + RAPIDJSON_ASSERT(newpos <= pathpos); + std::memmove(&path_[newpos], &path_[pathpos], slashpos * sizeof(Ch)); + newpos += slashpos; + // Add slash if not at end + if ((pathpos + slashpos) < pathlen) { + path_[newpos] = '/'; + newpos++; + } + } + // Move to next segment + pathpos += slashpos + 1; + } + path_[newpos] = '\0'; + } + + Ch* uri_; // Everything + Ch* base_; // Everything except fragment + Ch* scheme_; // Includes the : + Ch* auth_; // Includes the // + Ch* path_; // Absolute if starts with / + Ch* query_; // Includes the ? + Ch* frag_; // Includes the # + + Allocator* allocator_; //!< The current allocator. It is either user-supplied or equal to ownAllocator_. + Allocator* ownAllocator_; //!< Allocator owned by this Uri. +}; + +//! GenericUri for Value (UTF-8, default allocator). +typedef GenericUri Uri; + +RAPIDJSON_NAMESPACE_END + +#if defined(__clang__) +RAPIDJSON_DIAG_POP +#endif + +#endif // RAPIDJSON_URI_H_ diff --git a/DFL_BOM_WL_TOERP/rapidjson/writer.h b/DFL_BOM_WL_TOERP/rapidjson/writer.h new file mode 100644 index 0000000..8b38921 --- /dev/null +++ b/DFL_BOM_WL_TOERP/rapidjson/writer.h @@ -0,0 +1,710 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +#ifndef RAPIDJSON_WRITER_H_ +#define RAPIDJSON_WRITER_H_ + +#include "stream.h" +#include "internal/clzll.h" +#include "internal/meta.h" +#include "internal/stack.h" +#include "internal/strfunc.h" +#include "internal/dtoa.h" +#include "internal/itoa.h" +#include "stringbuffer.h" +#include // placement new + +#if defined(RAPIDJSON_SIMD) && defined(_MSC_VER) +#include +#pragma intrinsic(_BitScanForward) +#endif +#ifdef RAPIDJSON_SSE42 +#include +#elif defined(RAPIDJSON_SSE2) +#include +#elif defined(RAPIDJSON_NEON) +#include +#endif + +#ifdef __clang__ +RAPIDJSON_DIAG_PUSH +RAPIDJSON_DIAG_OFF(padded) +RAPIDJSON_DIAG_OFF(unreachable-code) +RAPIDJSON_DIAG_OFF(c++98-compat) +#elif defined(_MSC_VER) +RAPIDJSON_DIAG_PUSH +RAPIDJSON_DIAG_OFF(4127) // conditional expression is constant +#endif + +RAPIDJSON_NAMESPACE_BEGIN + +/////////////////////////////////////////////////////////////////////////////// +// WriteFlag + +/*! \def RAPIDJSON_WRITE_DEFAULT_FLAGS + \ingroup RAPIDJSON_CONFIG + \brief User-defined kWriteDefaultFlags definition. + + User can define this as any \c WriteFlag combinations. +*/ +#ifndef RAPIDJSON_WRITE_DEFAULT_FLAGS +#define RAPIDJSON_WRITE_DEFAULT_FLAGS kWriteNoFlags +#endif + +//! Combination of writeFlags +enum WriteFlag { + kWriteNoFlags = 0, //!< No flags are set. + kWriteValidateEncodingFlag = 1, //!< Validate encoding of JSON strings. + kWriteNanAndInfFlag = 2, //!< Allow writing of Infinity, -Infinity and NaN. + kWriteDefaultFlags = RAPIDJSON_WRITE_DEFAULT_FLAGS //!< Default write flags. Can be customized by defining RAPIDJSON_WRITE_DEFAULT_FLAGS +}; + +//! JSON writer +/*! Writer implements the concept Handler. + It generates JSON text by events to an output os. + + User may programmatically calls the functions of a writer to generate JSON text. + + On the other side, a writer can also be passed to objects that generates events, + + for example Reader::Parse() and Document::Accept(). + + \tparam OutputStream Type of output stream. + \tparam SourceEncoding Encoding of source string. + \tparam TargetEncoding Encoding of output stream. + \tparam StackAllocator Type of allocator for allocating memory of stack. + \note implements Handler concept +*/ +template, typename TargetEncoding = UTF8<>, typename StackAllocator = CrtAllocator, unsigned writeFlags = kWriteDefaultFlags> +class Writer { +public: + typedef typename SourceEncoding::Ch Ch; + + static const int kDefaultMaxDecimalPlaces = 324; + + //! Constructor + /*! \param os Output stream. + \param stackAllocator User supplied allocator. If it is null, it will create a private one. + \param levelDepth Initial capacity of stack. + */ + explicit + Writer(OutputStream& os, StackAllocator* stackAllocator = 0, size_t levelDepth = kDefaultLevelDepth) : + os_(&os), level_stack_(stackAllocator, levelDepth * sizeof(Level)), maxDecimalPlaces_(kDefaultMaxDecimalPlaces), hasRoot_(false) {} + + explicit + Writer(StackAllocator* allocator = 0, size_t levelDepth = kDefaultLevelDepth) : + os_(0), level_stack_(allocator, levelDepth * sizeof(Level)), maxDecimalPlaces_(kDefaultMaxDecimalPlaces), hasRoot_(false) {} + +#if RAPIDJSON_HAS_CXX11_RVALUE_REFS + Writer(Writer&& rhs) : + os_(rhs.os_), level_stack_(std::move(rhs.level_stack_)), maxDecimalPlaces_(rhs.maxDecimalPlaces_), hasRoot_(rhs.hasRoot_) { + rhs.os_ = 0; + } +#endif + + //! Reset the writer with a new stream. + /*! + This function reset the writer with a new stream and default settings, + in order to make a Writer object reusable for output multiple JSONs. + + \param os New output stream. + \code + Writer writer(os1); + writer.StartObject(); + // ... + writer.EndObject(); + + writer.Reset(os2); + writer.StartObject(); + // ... + writer.EndObject(); + \endcode + */ + void Reset(OutputStream& os) { + os_ = &os; + hasRoot_ = false; + level_stack_.Clear(); + } + + //! Checks whether the output is a complete JSON. + /*! + A complete JSON has a complete root object or array. + */ + bool IsComplete() const { + return hasRoot_ && level_stack_.Empty(); + } + + int GetMaxDecimalPlaces() const { + return maxDecimalPlaces_; + } + + //! Sets the maximum number of decimal places for double output. + /*! + This setting truncates the output with specified number of decimal places. + + For example, + + \code + writer.SetMaxDecimalPlaces(3); + writer.StartArray(); + writer.Double(0.12345); // "0.123" + writer.Double(0.0001); // "0.0" + writer.Double(1.234567890123456e30); // "1.234567890123456e30" (do not truncate significand for positive exponent) + writer.Double(1.23e-4); // "0.0" (do truncate significand for negative exponent) + writer.EndArray(); + \endcode + + The default setting does not truncate any decimal places. You can restore to this setting by calling + \code + writer.SetMaxDecimalPlaces(Writer::kDefaultMaxDecimalPlaces); + \endcode + */ + void SetMaxDecimalPlaces(int maxDecimalPlaces) { + maxDecimalPlaces_ = maxDecimalPlaces; + } + + /*!@name Implementation of Handler + \see Handler + */ + //@{ + + bool Null() { Prefix(kNullType); return EndValue(WriteNull()); } + bool Bool(bool b) { Prefix(b ? kTrueType : kFalseType); return EndValue(WriteBool(b)); } + bool Int(int i) { Prefix(kNumberType); return EndValue(WriteInt(i)); } + bool Uint(unsigned u) { Prefix(kNumberType); return EndValue(WriteUint(u)); } + bool Int64(int64_t i64) { Prefix(kNumberType); return EndValue(WriteInt64(i64)); } + bool Uint64(uint64_t u64) { Prefix(kNumberType); return EndValue(WriteUint64(u64)); } + + //! Writes the given \c double value to the stream + /*! + \param d The value to be written. + \return Whether it is succeed. + */ + bool Double(double d) { Prefix(kNumberType); return EndValue(WriteDouble(d)); } + + bool RawNumber(const Ch* str, SizeType length, bool copy = false) { + RAPIDJSON_ASSERT(str != 0); + (void)copy; + Prefix(kNumberType); + return EndValue(WriteString(str, length)); + } + + bool String(const Ch* str, SizeType length, bool copy = false) { + RAPIDJSON_ASSERT(str != 0); + (void)copy; + Prefix(kStringType); + return EndValue(WriteString(str, length)); + } + +#if RAPIDJSON_HAS_STDSTRING + bool String(const std::basic_string& str) { + return String(str.data(), SizeType(str.size())); + } +#endif + + bool StartObject() { + Prefix(kObjectType); + new (level_stack_.template Push()) Level(false); + return WriteStartObject(); + } + + bool Key(const Ch* str, SizeType length, bool copy = false) { return String(str, length, copy); } + +#if RAPIDJSON_HAS_STDSTRING + bool Key(const std::basic_string& str) + { + return Key(str.data(), SizeType(str.size())); + } +#endif + + bool EndObject(SizeType memberCount = 0) { + (void)memberCount; + RAPIDJSON_ASSERT(level_stack_.GetSize() >= sizeof(Level)); // not inside an Object + RAPIDJSON_ASSERT(!level_stack_.template Top()->inArray); // currently inside an Array, not Object + RAPIDJSON_ASSERT(0 == level_stack_.template Top()->valueCount % 2); // Object has a Key without a Value + level_stack_.template Pop(1); + return EndValue(WriteEndObject()); + } + + bool StartArray() { + Prefix(kArrayType); + new (level_stack_.template Push()) Level(true); + return WriteStartArray(); + } + + bool EndArray(SizeType elementCount = 0) { + (void)elementCount; + RAPIDJSON_ASSERT(level_stack_.GetSize() >= sizeof(Level)); + RAPIDJSON_ASSERT(level_stack_.template Top()->inArray); + level_stack_.template Pop(1); + return EndValue(WriteEndArray()); + } + //@} + + /*! @name Convenience extensions */ + //@{ + + //! Simpler but slower overload. + bool String(const Ch* const& str) { return String(str, internal::StrLen(str)); } + bool Key(const Ch* const& str) { return Key(str, internal::StrLen(str)); } + + //@} + + //! Write a raw JSON value. + /*! + For user to write a stringified JSON as a value. + + \param json A well-formed JSON value. It should not contain null character within [0, length - 1] range. + \param length Length of the json. + \param type Type of the root of json. + */ + bool RawValue(const Ch* json, size_t length, Type type) { + RAPIDJSON_ASSERT(json != 0); + Prefix(type); + return EndValue(WriteRawValue(json, length)); + } + + //! Flush the output stream. + /*! + Allows the user to flush the output stream immediately. + */ + void Flush() { + os_->Flush(); + } + + static const size_t kDefaultLevelDepth = 32; + +protected: + //! Information for each nested level + struct Level { + Level(bool inArray_) : valueCount(0), inArray(inArray_) {} + size_t valueCount; //!< number of values in this level + bool inArray; //!< true if in array, otherwise in object + }; + + bool WriteNull() { + PutReserve(*os_, 4); + PutUnsafe(*os_, 'n'); PutUnsafe(*os_, 'u'); PutUnsafe(*os_, 'l'); PutUnsafe(*os_, 'l'); return true; + } + + bool WriteBool(bool b) { + if (b) { + PutReserve(*os_, 4); + PutUnsafe(*os_, 't'); PutUnsafe(*os_, 'r'); PutUnsafe(*os_, 'u'); PutUnsafe(*os_, 'e'); + } + else { + PutReserve(*os_, 5); + PutUnsafe(*os_, 'f'); PutUnsafe(*os_, 'a'); PutUnsafe(*os_, 'l'); PutUnsafe(*os_, 's'); PutUnsafe(*os_, 'e'); + } + return true; + } + + bool WriteInt(int i) { + char buffer[11]; + const char* end = internal::i32toa(i, buffer); + PutReserve(*os_, static_cast(end - buffer)); + for (const char* p = buffer; p != end; ++p) + PutUnsafe(*os_, static_cast(*p)); + return true; + } + + bool WriteUint(unsigned u) { + char buffer[10]; + const char* end = internal::u32toa(u, buffer); + PutReserve(*os_, static_cast(end - buffer)); + for (const char* p = buffer; p != end; ++p) + PutUnsafe(*os_, static_cast(*p)); + return true; + } + + bool WriteInt64(int64_t i64) { + char buffer[21]; + const char* end = internal::i64toa(i64, buffer); + PutReserve(*os_, static_cast(end - buffer)); + for (const char* p = buffer; p != end; ++p) + PutUnsafe(*os_, static_cast(*p)); + return true; + } + + bool WriteUint64(uint64_t u64) { + char buffer[20]; + char* end = internal::u64toa(u64, buffer); + PutReserve(*os_, static_cast(end - buffer)); + for (char* p = buffer; p != end; ++p) + PutUnsafe(*os_, static_cast(*p)); + return true; + } + + bool WriteDouble(double d) { + if (internal::Double(d).IsNanOrInf()) { + if (!(writeFlags & kWriteNanAndInfFlag)) + return false; + if (internal::Double(d).IsNan()) { + PutReserve(*os_, 3); + PutUnsafe(*os_, 'N'); PutUnsafe(*os_, 'a'); PutUnsafe(*os_, 'N'); + return true; + } + if (internal::Double(d).Sign()) { + PutReserve(*os_, 9); + PutUnsafe(*os_, '-'); + } + else + PutReserve(*os_, 8); + PutUnsafe(*os_, 'I'); PutUnsafe(*os_, 'n'); PutUnsafe(*os_, 'f'); + PutUnsafe(*os_, 'i'); PutUnsafe(*os_, 'n'); PutUnsafe(*os_, 'i'); PutUnsafe(*os_, 't'); PutUnsafe(*os_, 'y'); + return true; + } + + char buffer[25]; + char* end = internal::dtoa(d, buffer, maxDecimalPlaces_); + PutReserve(*os_, static_cast(end - buffer)); + for (char* p = buffer; p != end; ++p) + PutUnsafe(*os_, static_cast(*p)); + return true; + } + + bool WriteString(const Ch* str, SizeType length) { + static const typename OutputStream::Ch hexDigits[16] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' }; + static const char escape[256] = { +#define Z16 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 + //0 1 2 3 4 5 6 7 8 9 A B C D E F + 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'b', 't', 'n', 'u', 'f', 'r', 'u', 'u', // 00 + 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', // 10 + 0, 0, '"', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 20 + Z16, Z16, // 30~4F + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,'\\', 0, 0, 0, // 50 + Z16, Z16, Z16, Z16, Z16, Z16, Z16, Z16, Z16, Z16 // 60~FF +#undef Z16 + }; + + if (TargetEncoding::supportUnicode) + PutReserve(*os_, 2 + length * 6); // "\uxxxx..." + else + PutReserve(*os_, 2 + length * 12); // "\uxxxx\uyyyy..." + + PutUnsafe(*os_, '\"'); + GenericStringStream is(str); + while (ScanWriteUnescapedString(is, length)) { + const Ch c = is.Peek(); + if (!TargetEncoding::supportUnicode && static_cast(c) >= 0x80) { + // Unicode escaping + unsigned codepoint; + if (RAPIDJSON_UNLIKELY(!SourceEncoding::Decode(is, &codepoint))) + return false; + PutUnsafe(*os_, '\\'); + PutUnsafe(*os_, 'u'); + if (codepoint <= 0xD7FF || (codepoint >= 0xE000 && codepoint <= 0xFFFF)) { + PutUnsafe(*os_, hexDigits[(codepoint >> 12) & 15]); + PutUnsafe(*os_, hexDigits[(codepoint >> 8) & 15]); + PutUnsafe(*os_, hexDigits[(codepoint >> 4) & 15]); + PutUnsafe(*os_, hexDigits[(codepoint ) & 15]); + } + else { + RAPIDJSON_ASSERT(codepoint >= 0x010000 && codepoint <= 0x10FFFF); + // Surrogate pair + unsigned s = codepoint - 0x010000; + unsigned lead = (s >> 10) + 0xD800; + unsigned trail = (s & 0x3FF) + 0xDC00; + PutUnsafe(*os_, hexDigits[(lead >> 12) & 15]); + PutUnsafe(*os_, hexDigits[(lead >> 8) & 15]); + PutUnsafe(*os_, hexDigits[(lead >> 4) & 15]); + PutUnsafe(*os_, hexDigits[(lead ) & 15]); + PutUnsafe(*os_, '\\'); + PutUnsafe(*os_, 'u'); + PutUnsafe(*os_, hexDigits[(trail >> 12) & 15]); + PutUnsafe(*os_, hexDigits[(trail >> 8) & 15]); + PutUnsafe(*os_, hexDigits[(trail >> 4) & 15]); + PutUnsafe(*os_, hexDigits[(trail ) & 15]); + } + } + else if ((sizeof(Ch) == 1 || static_cast(c) < 256) && RAPIDJSON_UNLIKELY(escape[static_cast(c)])) { + is.Take(); + PutUnsafe(*os_, '\\'); + PutUnsafe(*os_, static_cast(escape[static_cast(c)])); + if (escape[static_cast(c)] == 'u') { + PutUnsafe(*os_, '0'); + PutUnsafe(*os_, '0'); + PutUnsafe(*os_, hexDigits[static_cast(c) >> 4]); + PutUnsafe(*os_, hexDigits[static_cast(c) & 0xF]); + } + } + else if (RAPIDJSON_UNLIKELY(!(writeFlags & kWriteValidateEncodingFlag ? + Transcoder::Validate(is, *os_) : + Transcoder::TranscodeUnsafe(is, *os_)))) + return false; + } + PutUnsafe(*os_, '\"'); + return true; + } + + bool ScanWriteUnescapedString(GenericStringStream& is, size_t length) { + return RAPIDJSON_LIKELY(is.Tell() < length); + } + + bool WriteStartObject() { os_->Put('{'); return true; } + bool WriteEndObject() { os_->Put('}'); return true; } + bool WriteStartArray() { os_->Put('['); return true; } + bool WriteEndArray() { os_->Put(']'); return true; } + + bool WriteRawValue(const Ch* json, size_t length) { + PutReserve(*os_, length); + GenericStringStream is(json); + while (RAPIDJSON_LIKELY(is.Tell() < length)) { + RAPIDJSON_ASSERT(is.Peek() != '\0'); + if (RAPIDJSON_UNLIKELY(!(writeFlags & kWriteValidateEncodingFlag ? + Transcoder::Validate(is, *os_) : + Transcoder::TranscodeUnsafe(is, *os_)))) + return false; + } + return true; + } + + void Prefix(Type type) { + (void)type; + if (RAPIDJSON_LIKELY(level_stack_.GetSize() != 0)) { // this value is not at root + Level* level = level_stack_.template Top(); + if (level->valueCount > 0) { + if (level->inArray) + os_->Put(','); // add comma if it is not the first element in array + else // in object + os_->Put((level->valueCount % 2 == 0) ? ',' : ':'); + } + if (!level->inArray && level->valueCount % 2 == 0) + RAPIDJSON_ASSERT(type == kStringType); // if it's in object, then even number should be a name + level->valueCount++; + } + else { + RAPIDJSON_ASSERT(!hasRoot_); // Should only has one and only one root. + hasRoot_ = true; + } + } + + // Flush the value if it is the top level one. + bool EndValue(bool ret) { + if (RAPIDJSON_UNLIKELY(level_stack_.Empty())) // end of json text + Flush(); + return ret; + } + + OutputStream* os_; + internal::Stack level_stack_; + int maxDecimalPlaces_; + bool hasRoot_; + +private: + // Prohibit copy constructor & assignment operator. + Writer(const Writer&); + Writer& operator=(const Writer&); +}; + +// Full specialization for StringStream to prevent memory copying + +template<> +inline bool Writer::WriteInt(int i) { + char *buffer = os_->Push(11); + const char* end = internal::i32toa(i, buffer); + os_->Pop(static_cast(11 - (end - buffer))); + return true; +} + +template<> +inline bool Writer::WriteUint(unsigned u) { + char *buffer = os_->Push(10); + const char* end = internal::u32toa(u, buffer); + os_->Pop(static_cast(10 - (end - buffer))); + return true; +} + +template<> +inline bool Writer::WriteInt64(int64_t i64) { + char *buffer = os_->Push(21); + const char* end = internal::i64toa(i64, buffer); + os_->Pop(static_cast(21 - (end - buffer))); + return true; +} + +template<> +inline bool Writer::WriteUint64(uint64_t u) { + char *buffer = os_->Push(20); + const char* end = internal::u64toa(u, buffer); + os_->Pop(static_cast(20 - (end - buffer))); + return true; +} + +template<> +inline bool Writer::WriteDouble(double d) { + if (internal::Double(d).IsNanOrInf()) { + // Note: This code path can only be reached if (RAPIDJSON_WRITE_DEFAULT_FLAGS & kWriteNanAndInfFlag). + if (!(kWriteDefaultFlags & kWriteNanAndInfFlag)) + return false; + if (internal::Double(d).IsNan()) { + PutReserve(*os_, 3); + PutUnsafe(*os_, 'N'); PutUnsafe(*os_, 'a'); PutUnsafe(*os_, 'N'); + return true; + } + if (internal::Double(d).Sign()) { + PutReserve(*os_, 9); + PutUnsafe(*os_, '-'); + } + else + PutReserve(*os_, 8); + PutUnsafe(*os_, 'I'); PutUnsafe(*os_, 'n'); PutUnsafe(*os_, 'f'); + PutUnsafe(*os_, 'i'); PutUnsafe(*os_, 'n'); PutUnsafe(*os_, 'i'); PutUnsafe(*os_, 't'); PutUnsafe(*os_, 'y'); + return true; + } + + char *buffer = os_->Push(25); + char* end = internal::dtoa(d, buffer, maxDecimalPlaces_); + os_->Pop(static_cast(25 - (end - buffer))); + return true; +} + +#if defined(RAPIDJSON_SSE2) || defined(RAPIDJSON_SSE42) +template<> +inline bool Writer::ScanWriteUnescapedString(StringStream& is, size_t length) { + if (length < 16) + return RAPIDJSON_LIKELY(is.Tell() < length); + + if (!RAPIDJSON_LIKELY(is.Tell() < length)) + return false; + + const char* p = is.src_; + const char* end = is.head_ + length; + const char* nextAligned = reinterpret_cast((reinterpret_cast(p) + 15) & static_cast(~15)); + const char* endAligned = reinterpret_cast(reinterpret_cast(end) & static_cast(~15)); + if (nextAligned > end) + return true; + + while (p != nextAligned) + if (*p < 0x20 || *p == '\"' || *p == '\\') { + is.src_ = p; + return RAPIDJSON_LIKELY(is.Tell() < length); + } + else + os_->PutUnsafe(*p++); + + // The rest of string using SIMD + static const char dquote[16] = { '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"' }; + static const char bslash[16] = { '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\' }; + static const char space[16] = { 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F }; + const __m128i dq = _mm_loadu_si128(reinterpret_cast(&dquote[0])); + const __m128i bs = _mm_loadu_si128(reinterpret_cast(&bslash[0])); + const __m128i sp = _mm_loadu_si128(reinterpret_cast(&space[0])); + + for (; p != endAligned; p += 16) { + const __m128i s = _mm_load_si128(reinterpret_cast(p)); + const __m128i t1 = _mm_cmpeq_epi8(s, dq); + const __m128i t2 = _mm_cmpeq_epi8(s, bs); + const __m128i t3 = _mm_cmpeq_epi8(_mm_max_epu8(s, sp), sp); // s < 0x20 <=> max(s, 0x1F) == 0x1F + const __m128i x = _mm_or_si128(_mm_or_si128(t1, t2), t3); + unsigned short r = static_cast(_mm_movemask_epi8(x)); + if (RAPIDJSON_UNLIKELY(r != 0)) { // some of characters is escaped + SizeType len; +#ifdef _MSC_VER // Find the index of first escaped + unsigned long offset; + _BitScanForward(&offset, r); + len = offset; +#else + len = static_cast(__builtin_ffs(r) - 1); +#endif + char* q = reinterpret_cast(os_->PushUnsafe(len)); + for (size_t i = 0; i < len; i++) + q[i] = p[i]; + + p += len; + break; + } + _mm_storeu_si128(reinterpret_cast<__m128i *>(os_->PushUnsafe(16)), s); + } + + is.src_ = p; + return RAPIDJSON_LIKELY(is.Tell() < length); +} +#elif defined(RAPIDJSON_NEON) +template<> +inline bool Writer::ScanWriteUnescapedString(StringStream& is, size_t length) { + if (length < 16) + return RAPIDJSON_LIKELY(is.Tell() < length); + + if (!RAPIDJSON_LIKELY(is.Tell() < length)) + return false; + + const char* p = is.src_; + const char* end = is.head_ + length; + const char* nextAligned = reinterpret_cast((reinterpret_cast(p) + 15) & static_cast(~15)); + const char* endAligned = reinterpret_cast(reinterpret_cast(end) & static_cast(~15)); + if (nextAligned > end) + return true; + + while (p != nextAligned) + if (*p < 0x20 || *p == '\"' || *p == '\\') { + is.src_ = p; + return RAPIDJSON_LIKELY(is.Tell() < length); + } + else + os_->PutUnsafe(*p++); + + // The rest of string using SIMD + const uint8x16_t s0 = vmovq_n_u8('"'); + const uint8x16_t s1 = vmovq_n_u8('\\'); + const uint8x16_t s2 = vmovq_n_u8('\b'); + const uint8x16_t s3 = vmovq_n_u8(32); + + for (; p != endAligned; p += 16) { + const uint8x16_t s = vld1q_u8(reinterpret_cast(p)); + uint8x16_t x = vceqq_u8(s, s0); + x = vorrq_u8(x, vceqq_u8(s, s1)); + x = vorrq_u8(x, vceqq_u8(s, s2)); + x = vorrq_u8(x, vcltq_u8(s, s3)); + + x = vrev64q_u8(x); // Rev in 64 + uint64_t low = vgetq_lane_u64(vreinterpretq_u64_u8(x), 0); // extract + uint64_t high = vgetq_lane_u64(vreinterpretq_u64_u8(x), 1); // extract + + SizeType len = 0; + bool escaped = false; + if (low == 0) { + if (high != 0) { + uint32_t lz = internal::clzll(high); + len = 8 + (lz >> 3); + escaped = true; + } + } else { + uint32_t lz = internal::clzll(low); + len = lz >> 3; + escaped = true; + } + if (RAPIDJSON_UNLIKELY(escaped)) { // some of characters is escaped + char* q = reinterpret_cast(os_->PushUnsafe(len)); + for (size_t i = 0; i < len; i++) + q[i] = p[i]; + + p += len; + break; + } + vst1q_u8(reinterpret_cast(os_->PushUnsafe(16)), s); + } + + is.src_ = p; + return RAPIDJSON_LIKELY(is.Tell() < length); +} +#endif // RAPIDJSON_NEON + +RAPIDJSON_NAMESPACE_END + +#if defined(_MSC_VER) || defined(__clang__) +RAPIDJSON_DIAG_POP +#endif + +#endif // RAPIDJSON_RAPIDJSON_H_ diff --git a/DFL_BOM_WL_TOERP/readBomMsg.cpp b/DFL_BOM_WL_TOERP/readBomMsg.cpp new file mode 100644 index 0000000..e69de29 diff --git a/DFL_BOM_WL_TOERP/soapC.cpp b/DFL_BOM_WL_TOERP/soapC.cpp new file mode 100644 index 0000000..6354803 --- /dev/null +++ b/DFL_BOM_WL_TOERP/soapC.cpp @@ -0,0 +1,7372 @@ +/* soapC.cpp + Generated by gSOAP 2.8.131 for total2.h + +gSOAP XML Web services tools +Copyright (C) 2000-2023, Robert van Engelen, Genivia Inc. All Rights Reserved. +The soapcpp2 tool and its generated software are released under the GPL. +This program is released under the GPL with the additional exemption that +compiling, linking, and/or using OpenSSL is allowed. +-------------------------------------------------------------------------------- +A commercial use license is available from Genivia Inc., contact@genivia.com +-------------------------------------------------------------------------------- +*/ + +#if defined(__BORLANDC__) +#pragma option push -w-8060 +#pragma option push -w-8004 +#endif + +#include "soapH.h" + +SOAP_SOURCE_STAMP("@(#) soapC.cpp ver 2.8.131 2023-11-28 03:27:13 GMT") + + +#ifndef WITH_NOGLOBAL + +SOAP_FMAC3 int SOAP_FMAC4 soap_getheader(struct soap *soap) +{ + soap->part = SOAP_IN_HEADER; + soap->header = soap_in_SOAP_ENV__Header(soap, "SOAP-ENV:Header", soap->header, NULL); + soap->part = SOAP_END_HEADER; + return soap->header == NULL; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_putheader(struct soap *soap) +{ + if (soap->version && soap->header) + { soap->part = SOAP_IN_HEADER; + if (soap_out_SOAP_ENV__Header(soap, "SOAP-ENV:Header", 0, soap->header, "")) + return soap->error; + soap->part = SOAP_END_HEADER; + } + return SOAP_OK; +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_serializeheader(struct soap *soap) +{ + if (soap->version && soap->header) + soap_serialize_SOAP_ENV__Header(soap, soap->header); +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_header(struct soap *soap) +{ + if (soap->header == NULL) + { if ((soap->header = soap_new_SOAP_ENV__Header(soap))) + soap_default_SOAP_ENV__Header(soap, soap->header); + } +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_fault(struct soap *soap) +{ + if (soap->fault == NULL) + { soap->fault = soap_new_SOAP_ENV__Fault(soap, -1); + if (soap->fault == NULL) + return; + } + if (soap->version == 2 && soap->fault->SOAP_ENV__Code == NULL) + soap->fault->SOAP_ENV__Code = soap_new_SOAP_ENV__Code(soap, -1); + if (soap->version == 2 && soap->fault->SOAP_ENV__Reason == NULL) + soap->fault->SOAP_ENV__Reason = soap_new_SOAP_ENV__Reason(soap, -1); +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_serializefault(struct soap *soap) +{ + if (soap->fault) + soap_serialize_SOAP_ENV__Fault(soap, soap->fault); +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_putfault(struct soap *soap) +{ + if (soap->fault) + return soap_put_SOAP_ENV__Fault(soap, soap->fault, "SOAP-ENV:Fault", ""); + return SOAP_OK; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_getfault(struct soap *soap) +{ + return (soap->fault = soap_get_SOAP_ENV__Fault(soap, NULL, "SOAP-ENV:Fault", NULL)) == NULL; +} + +SOAP_FMAC3 const char ** SOAP_FMAC4 soap_faultcode(struct soap *soap) +{ + soap_fault(soap); + if (soap->fault == NULL) + return NULL; + if (soap->version == 2 && soap->fault->SOAP_ENV__Code) + return (const char**)(void*)&soap->fault->SOAP_ENV__Code->SOAP_ENV__Value; + return (const char**)(void*)&soap->fault->faultcode; +} + +SOAP_FMAC3 const char ** SOAP_FMAC4 soap_faultsubcode(struct soap *soap) +{ + soap_fault(soap); + if (soap->fault == NULL) + return NULL; + if (soap->version == 2 && soap->fault->SOAP_ENV__Code) + { if (soap->fault->SOAP_ENV__Code->SOAP_ENV__Subcode == NULL) + { soap->fault->SOAP_ENV__Code->SOAP_ENV__Subcode = soap_new_SOAP_ENV__Code(soap, -1); + if (soap->fault->SOAP_ENV__Code->SOAP_ENV__Subcode == NULL) + return NULL; + } + return (const char**)(void*)&soap->fault->SOAP_ENV__Code->SOAP_ENV__Subcode->SOAP_ENV__Value; + } + return (const char**)(void*)&soap->fault->faultcode; +} + +SOAP_FMAC3 const char * SOAP_FMAC4 soap_fault_subcode(struct soap *soap) +{ + if (!soap->fault) + return NULL; + if (soap->version == 2) + return soap->fault->SOAP_ENV__Code && soap->fault->SOAP_ENV__Code->SOAP_ENV__Subcode ? soap->fault->SOAP_ENV__Code->SOAP_ENV__Subcode->SOAP_ENV__Value : NULL; + return soap->fault->faultcode; +} + +SOAP_FMAC3 const char ** SOAP_FMAC4 soap_faultstring(struct soap *soap) +{ + soap_fault(soap); + if (soap->fault == NULL) + return NULL; + if (soap->version == 2 && soap->fault->SOAP_ENV__Reason) + return (const char**)(void*)&soap->fault->SOAP_ENV__Reason->SOAP_ENV__Text; + return (const char**)(void*)&soap->fault->faultstring; +} + +SOAP_FMAC3 const char * SOAP_FMAC4 soap_fault_string(struct soap *soap) +{ + const char **s = soap_faultstring(soap); + return s ? *s : NULL; +} + +SOAP_FMAC3 const char ** SOAP_FMAC4 soap_faultdetail(struct soap *soap) +{ + soap_fault(soap); + if (soap->fault == NULL) + return NULL; + if (soap->version == 2) + { if (soap->fault->SOAP_ENV__Detail == NULL) + soap->fault->SOAP_ENV__Detail = soap_new_SOAP_ENV__Detail(soap, -1); + return (const char**)(void*)&soap->fault->SOAP_ENV__Detail->__any; + } + if (soap->fault->detail == NULL) + soap->fault->detail = soap_new_SOAP_ENV__Detail(soap, -1); + return (const char**)(void*)&soap->fault->detail->__any; +} + +SOAP_FMAC3 const char * SOAP_FMAC4 soap_fault_detail(struct soap *soap) +{ + const char **s = soap_faultdetail(soap); + return s ? *s : NULL; +} + +#endif + +#ifndef WITH_NOIDREF +SOAP_FMAC3 int SOAP_FMAC4 soap_getindependent(struct soap *soap) +{ + int t; + if (soap->version == 1) + { for (;;) + { if (!soap_getelement(soap, NULL, &t)) + if ((soap->error && soap->error != SOAP_TAG_MISMATCH) || soap_ignore_element(soap)) + break; + } + } + if (soap->error == SOAP_NO_TAG || soap->error == SOAP_EOF) + soap->error = SOAP_OK; + return soap->error; +} +#endif + +#ifdef __cplusplus +extern "C" { +#endif +SOAP_FMAC3 void * SOAP_FMAC4 soap_getelement(struct soap *soap, const char *tag, int *type) +{ (void)type; + if (soap_peek_element(soap)) + return NULL; +#ifndef WITH_NOIDREF + if (!*soap->id || !(*type = soap_lookup_type(soap, soap->id))) + *type = soap_lookup_type(soap, soap->href); + switch (*type) + { + case SOAP_TYPE_byte: + return soap_in_byte(soap, tag, NULL, "xsd:byte"); + case SOAP_TYPE_int: + return soap_in_int(soap, tag, NULL, "xsd:int"); + case SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ: + return soap_in_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(soap, tag, NULL, "ns1:DT_FACTORY_NUMBER_REQ"); + case SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP: + return soap_in_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP(soap, tag, NULL, "ns1:DT_FACTORY_NUMBER_RSP"); + case SOAP_TYPE_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ: + return soap_in_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ(soap, tag, NULL, "ns1:DT_PROCESSROUTE_S4_REQ"); + case SOAP_TYPE_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP: + return soap_in_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP(soap, tag, NULL, "ns1:DT_PROCESSROUTE_S4_RSP"); + case SOAP_TYPE_ns1__DT_USCOREBOM_USCORES4_USCOREREQ: + return soap_in_ns1__DT_USCOREBOM_USCORES4_USCOREREQ(soap, tag, NULL, "ns1:DT_BOM_S4_REQ"); + case SOAP_TYPE_PointerTons1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ: + return soap_in_PointerTons1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(soap, tag, NULL, "ns1:DT_FACTORY_NUMBER_REQ"); + case SOAP_TYPE_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS: + return soap_in_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(soap, tag, NULL, "ns1:DT_FACTORY_NUMBER_REQ-ITEMS"); + case SOAP_TYPE_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM: + return soap_in_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(soap, tag, NULL, "ns1:DT_FACTORY_NUMBER_REQ-ITEMS-ITEM"); + case SOAP_TYPE_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO: + return soap_in_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(soap, tag, NULL, "ns1:DT_FACTORY_NUMBER_REQ-BASEINFO"); + case SOAP_TYPE_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN: + return soap_in_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(soap, tag, NULL, "ns1:DT_FACTORY_NUMBER_RSP-ZTABLE_RETURN"); + case SOAP_TYPE_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO: + return soap_in_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(soap, tag, NULL, "ns1:DT_FACTORY_NUMBER_RSP-RSP_BASEINFO"); + case SOAP_TYPE_PointerTons1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ: + return soap_in_PointerTons1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ(soap, tag, NULL, "ns1:DT_PROCESSROUTE_S4_REQ"); + case SOAP_TYPE_PointerTo_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST: + return soap_in_PointerTo_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST(soap, tag, NULL, "ns1:DT_PROCESSROUTE_S4_REQ-LIST"); + case SOAP_TYPE_PointerTo_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM: + return soap_in_PointerTo_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(soap, tag, NULL, "ns1:DT_PROCESSROUTE_S4_REQ-LIST-ITEMS-ITEM"); + case SOAP_TYPE_PointerTo_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM: + return soap_in_PointerTo_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM(soap, tag, NULL, "ns1:DT_PROCESSROUTE_S4_REQ-LIST-ITEMS-ITEM-SUBITEMS-SUBITEM"); + case SOAP_TYPE_PointerTo_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN: + return soap_in_PointerTo_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN(soap, tag, NULL, "ns1:DT_PROCESSROUTE_S4_RSP-ZTABLE_RETURN"); + case SOAP_TYPE_PointerTons1__DT_USCOREBOM_USCORES4_USCOREREQ: + return soap_in_PointerTons1__DT_USCOREBOM_USCORES4_USCOREREQ(soap, tag, NULL, "ns1:DT_BOM_S4_REQ"); + case SOAP_TYPE_PointerTo_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST: + return soap_in_PointerTo_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST(soap, tag, NULL, "ns1:DT_BOM_S4_REQ-LIST"); + case SOAP_TYPE_PointerTo_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM: + return soap_in_PointerTo_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(soap, tag, NULL, "ns1:DT_BOM_S4_REQ-LIST-ITEMS-ITEM"); + case SOAP_TYPE_PointerTo_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO: + return soap_in_PointerTo_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO(soap, tag, NULL, "ns1:DT_BOM_S4_REQ-BASEINFO"); + case SOAP_TYPE__QName: + { char **s; + s = soap_in__QName(soap, tag, NULL, "xsd:QName"); + return s ? *s : NULL; + } + case SOAP_TYPE_string: + { char **s; + s = soap_in_string(soap, tag, NULL, "xsd:string"); + return s ? *s : NULL; + } + default: +#else + *type = 0; +#endif + { const char *t = soap->type; + if (!*t) + t = soap->tag; + if (!soap_match_tag(soap, t, "ns1:DT_FACTORY_NUMBER_REQ")) + { *type = SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ; + return soap_in_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(soap, tag, NULL, NULL); + } + if (!soap_match_tag(soap, t, "ns1:DT_FACTORY_NUMBER_RSP")) + { *type = SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP; + return soap_in_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP(soap, tag, NULL, NULL); + } + if (!soap_match_tag(soap, t, "ns1:DT_PROCESSROUTE_S4_REQ")) + { *type = SOAP_TYPE_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ; + return soap_in_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ(soap, tag, NULL, NULL); + } + if (!soap_match_tag(soap, t, "ns1:DT_PROCESSROUTE_S4_RSP")) + { *type = SOAP_TYPE_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP; + return soap_in_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP(soap, tag, NULL, NULL); + } + if (!soap_match_tag(soap, t, "ns1:DT_BOM_S4_REQ")) + { *type = SOAP_TYPE_ns1__DT_USCOREBOM_USCORES4_USCOREREQ; + return soap_in_ns1__DT_USCOREBOM_USCORES4_USCOREREQ(soap, tag, NULL, NULL); + } + if (!soap_match_tag(soap, t, "xsd:byte")) + { *type = SOAP_TYPE_byte; + return soap_in_byte(soap, tag, NULL, NULL); + } + if (!soap_match_tag(soap, t, "xsd:int")) + { *type = SOAP_TYPE_int; + return soap_in_int(soap, tag, NULL, NULL); + } + if (!soap_match_tag(soap, t, "xsd:QName")) + { char **s; + *type = SOAP_TYPE__QName; + s = soap_in__QName(soap, tag, NULL, NULL); + return s ? *s : NULL; + } + if (!soap_match_tag(soap, t, "xsd:string")) + { char **s; + *type = SOAP_TYPE_string; + s = soap_in_string(soap, tag, NULL, NULL); + return s ? *s : NULL; + } + t = soap->tag; + if (!soap_match_tag(soap, t, "ns1:DT_FACTORY_NUMBER_REQ-ITEMS-ITEM")) + { *type = SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM; + return soap_in__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(soap, NULL, NULL, NULL); + } + if (!soap_match_tag(soap, t, "ns1:DT_FACTORY_NUMBER_REQ-ITEMS")) + { *type = SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS; + return soap_in__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(soap, NULL, NULL, NULL); + } + if (!soap_match_tag(soap, t, "ns1:DT_FACTORY_NUMBER_REQ-BASEINFO")) + { *type = SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO; + return soap_in__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(soap, NULL, NULL, NULL); + } + if (!soap_match_tag(soap, t, "ns1:DT_FACTORY_NUMBER_RSP-ZTABLE_RETURN")) + { *type = SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN; + return soap_in__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(soap, NULL, NULL, NULL); + } + if (!soap_match_tag(soap, t, "ns1:DT_FACTORY_NUMBER_RSP-RSP_BASEINFO")) + { *type = SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO; + return soap_in__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(soap, NULL, NULL, NULL); + } + if (!soap_match_tag(soap, t, "ns1:DT_PROCESSROUTE_S4_REQ-LIST-ITEMS-ITEM-SUBITEMS-SUBITEM")) + { *type = SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM; + return soap_in__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM(soap, NULL, NULL, NULL); + } + if (!soap_match_tag(soap, t, "ns1:DT_PROCESSROUTE_S4_REQ-LIST-ITEMS-ITEM-SUBITEMS")) + { *type = SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS; + return soap_in__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS(soap, NULL, NULL, NULL); + } + if (!soap_match_tag(soap, t, "ns1:DT_PROCESSROUTE_S4_REQ-LIST-ITEMS-ITEM")) + { *type = SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM; + return soap_in__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(soap, NULL, NULL, NULL); + } + if (!soap_match_tag(soap, t, "ns1:DT_PROCESSROUTE_S4_REQ-LIST-ITEMS")) + { *type = SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS; + return soap_in__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS(soap, NULL, NULL, NULL); + } + if (!soap_match_tag(soap, t, "ns1:DT_PROCESSROUTE_S4_REQ-LIST-HEAD")) + { *type = SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD; + return soap_in__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD(soap, NULL, NULL, NULL); + } + if (!soap_match_tag(soap, t, "ns1:DT_PROCESSROUTE_S4_REQ-LIST")) + { *type = SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST; + return soap_in__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST(soap, NULL, NULL, NULL); + } + if (!soap_match_tag(soap, t, "ns1:DT_PROCESSROUTE_S4_REQ-BASEINFO")) + { *type = SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO; + return soap_in__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO(soap, NULL, NULL, NULL); + } + if (!soap_match_tag(soap, t, "ns1:DT_PROCESSROUTE_S4_RSP-ZTABLE_RETURN")) + { *type = SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN; + return soap_in__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN(soap, NULL, NULL, NULL); + } + if (!soap_match_tag(soap, t, "ns1:DT_PROCESSROUTE_S4_RSP-RSP_BASEINFO")) + { *type = SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO; + return soap_in__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO(soap, NULL, NULL, NULL); + } + if (!soap_match_tag(soap, t, "ns1:DT_BOM_S4_REQ-LIST-ITEMS-ITEM")) + { *type = SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM; + return soap_in__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(soap, NULL, NULL, NULL); + } + if (!soap_match_tag(soap, t, "ns1:DT_BOM_S4_REQ-LIST-ITEMS")) + { *type = SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS; + return soap_in__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS(soap, NULL, NULL, NULL); + } + if (!soap_match_tag(soap, t, "ns1:DT_BOM_S4_REQ-LIST-HEAD")) + { *type = SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD; + return soap_in__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD(soap, NULL, NULL, NULL); + } + if (!soap_match_tag(soap, t, "ns1:DT_BOM_S4_REQ-LIST")) + { *type = SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST; + return soap_in__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST(soap, NULL, NULL, NULL); + } + if (!soap_match_tag(soap, t, "ns1:DT_BOM_S4_REQ-BASEINFO")) + { *type = SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO; + return soap_in__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO(soap, NULL, NULL, NULL); + } +#ifndef WITH_NOIDREF + } +#endif + } + soap->error = SOAP_TAG_MISMATCH; + return NULL; +} + +#ifdef __cplusplus +} +#endif + +SOAP_FMAC3 int SOAP_FMAC4 soap_ignore_element(struct soap *soap) +{ + if (!soap_peek_element(soap)) + { int t; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Unexpected element '%s' in input at level = %u body = %d)\n", soap->tag, soap->level, soap->body)); + if (soap->mustUnderstand && !soap->other && !soap->fignore) + return soap->error = SOAP_MUSTUNDERSTAND; + if (((soap->mode & SOAP_XML_STRICT) && !soap->fignore && soap->part != SOAP_IN_HEADER) || !soap_match_tag(soap, soap->tag, "SOAP-ENV:")) + { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "REJECTING element '%s'\n", soap->tag)); + return soap->error = SOAP_TAG_MISMATCH; + } + if (!*soap->id || !soap_getelement(soap, NULL, &t)) + { soap->peeked = 0; + if (soap->fignore) + soap->error = soap->fignore(soap, soap->tag); + else + soap->error = SOAP_OK; + DBGLOG(TEST, if (!soap->error) SOAP_MESSAGE(fdebug, "IGNORING element '%s'\n", soap->tag)); + if (!soap->error && soap->body && soap_ignore(soap)) + return soap->error; + } + } + return soap->error; +} + +#ifndef WITH_NOIDREF +SOAP_FMAC3 int SOAP_FMAC4 soap_putindependent(struct soap *soap) +{ + int i; + struct soap_plist *pp; + if (soap->version == 1 && soap->encodingStyle && !(soap->mode & (SOAP_XML_TREE | SOAP_XML_GRAPH))) + for (i = 0; i < SOAP_PTRHASH; i++) + for (pp = soap->pht[i]; pp; pp = pp->next) + if (pp->mark1 == 2 || pp->mark2 == 2) + if (soap_putelement(soap, pp->ptr, SOAP_MULTIREFTAG, pp->id, pp->type)) + return soap->error; + return SOAP_OK; +} +#endif + +#ifdef __cplusplus +extern "C" { +#endif +SOAP_FMAC3 int SOAP_FMAC4 soap_putelement(struct soap *soap, const void *ptr, const char *tag, int id, int type) +{ (void)tag; + switch (type) + { + case SOAP_TYPE_byte: + return soap_out_byte(soap, tag, id, (const char *)ptr, "xsd:byte"); + case SOAP_TYPE_int: + return soap_out_int(soap, tag, id, (const int *)ptr, "xsd:int"); + case SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM: + return ((_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM *)ptr)->soap_out(soap, "ns1:DT_FACTORY_NUMBER_REQ-ITEMS-ITEM", id, ""); + case SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS: + return ((_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS *)ptr)->soap_out(soap, "ns1:DT_FACTORY_NUMBER_REQ-ITEMS", id, ""); + case SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO: + return ((_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO *)ptr)->soap_out(soap, "ns1:DT_FACTORY_NUMBER_REQ-BASEINFO", id, ""); + case SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN: + return ((_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN *)ptr)->soap_out(soap, "ns1:DT_FACTORY_NUMBER_RSP-ZTABLE_RETURN", id, ""); + case SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO: + return ((_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO *)ptr)->soap_out(soap, "ns1:DT_FACTORY_NUMBER_RSP-RSP_BASEINFO", id, ""); + case SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ: + return ((ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ *)ptr)->soap_out(soap, tag, id, "ns1:DT_FACTORY_NUMBER_REQ"); + case SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP: + return ((ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP *)ptr)->soap_out(soap, tag, id, "ns1:DT_FACTORY_NUMBER_RSP"); + case SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM: + return ((_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM *)ptr)->soap_out(soap, "ns1:DT_PROCESSROUTE_S4_REQ-LIST-ITEMS-ITEM-SUBITEMS-SUBITEM", id, ""); + case SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS: + return ((_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS *)ptr)->soap_out(soap, "ns1:DT_PROCESSROUTE_S4_REQ-LIST-ITEMS-ITEM-SUBITEMS", id, ""); + case SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM: + return ((_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM *)ptr)->soap_out(soap, "ns1:DT_PROCESSROUTE_S4_REQ-LIST-ITEMS-ITEM", id, ""); + case SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS: + return ((_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS *)ptr)->soap_out(soap, "ns1:DT_PROCESSROUTE_S4_REQ-LIST-ITEMS", id, ""); + case SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD: + return ((_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD *)ptr)->soap_out(soap, "ns1:DT_PROCESSROUTE_S4_REQ-LIST-HEAD", id, ""); + case SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST: + return ((_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST *)ptr)->soap_out(soap, "ns1:DT_PROCESSROUTE_S4_REQ-LIST", id, ""); + case SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO: + return ((_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO *)ptr)->soap_out(soap, "ns1:DT_PROCESSROUTE_S4_REQ-BASEINFO", id, ""); + case SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN: + return ((_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN *)ptr)->soap_out(soap, "ns1:DT_PROCESSROUTE_S4_RSP-ZTABLE_RETURN", id, ""); + case SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO: + return ((_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO *)ptr)->soap_out(soap, "ns1:DT_PROCESSROUTE_S4_RSP-RSP_BASEINFO", id, ""); + case SOAP_TYPE_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ: + return ((ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ *)ptr)->soap_out(soap, tag, id, "ns1:DT_PROCESSROUTE_S4_REQ"); + case SOAP_TYPE_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP: + return ((ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP *)ptr)->soap_out(soap, tag, id, "ns1:DT_PROCESSROUTE_S4_RSP"); + case SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM: + return ((_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM *)ptr)->soap_out(soap, "ns1:DT_BOM_S4_REQ-LIST-ITEMS-ITEM", id, ""); + case SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS: + return ((_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS *)ptr)->soap_out(soap, "ns1:DT_BOM_S4_REQ-LIST-ITEMS", id, ""); + case SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD: + return ((_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD *)ptr)->soap_out(soap, "ns1:DT_BOM_S4_REQ-LIST-HEAD", id, ""); + case SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST: + return ((_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST *)ptr)->soap_out(soap, "ns1:DT_BOM_S4_REQ-LIST", id, ""); + case SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO: + return ((_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO *)ptr)->soap_out(soap, "ns1:DT_BOM_S4_REQ-BASEINFO", id, ""); + case SOAP_TYPE_ns1__DT_USCOREBOM_USCORES4_USCOREREQ: + return ((ns1__DT_USCOREBOM_USCORES4_USCOREREQ *)ptr)->soap_out(soap, tag, id, "ns1:DT_BOM_S4_REQ"); + case SOAP_TYPE_PointerTons1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ: + return soap_out_PointerTons1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(soap, tag, id, (ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ *const*)ptr, "ns1:DT_FACTORY_NUMBER_REQ"); + case SOAP_TYPE_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS: + return soap_out_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(soap, tag, id, (_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS *const*)ptr, "ns1:DT_FACTORY_NUMBER_REQ-ITEMS"); + case SOAP_TYPE_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM: + return soap_out_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(soap, tag, id, (_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM *const*)ptr, "ns1:DT_FACTORY_NUMBER_REQ-ITEMS-ITEM"); + case SOAP_TYPE_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO: + return soap_out_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(soap, tag, id, (_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO *const*)ptr, "ns1:DT_FACTORY_NUMBER_REQ-BASEINFO"); + case SOAP_TYPE_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN: + return soap_out_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(soap, tag, id, (_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN *const*)ptr, "ns1:DT_FACTORY_NUMBER_RSP-ZTABLE_RETURN"); + case SOAP_TYPE_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO: + return soap_out_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(soap, tag, id, (_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO *const*)ptr, "ns1:DT_FACTORY_NUMBER_RSP-RSP_BASEINFO"); + case SOAP_TYPE_PointerTons1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ: + return soap_out_PointerTons1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ(soap, tag, id, (ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ *const*)ptr, "ns1:DT_PROCESSROUTE_S4_REQ"); + case SOAP_TYPE_PointerTo_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST: + return soap_out_PointerTo_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST(soap, tag, id, (_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST *const*)ptr, "ns1:DT_PROCESSROUTE_S4_REQ-LIST"); + case SOAP_TYPE_PointerTo_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM: + return soap_out_PointerTo_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(soap, tag, id, (_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM *const*)ptr, "ns1:DT_PROCESSROUTE_S4_REQ-LIST-ITEMS-ITEM"); + case SOAP_TYPE_PointerTo_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM: + return soap_out_PointerTo_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM(soap, tag, id, (_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM *const*)ptr, "ns1:DT_PROCESSROUTE_S4_REQ-LIST-ITEMS-ITEM-SUBITEMS-SUBITEM"); + case SOAP_TYPE_PointerTo_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN: + return soap_out_PointerTo_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN(soap, tag, id, (_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN *const*)ptr, "ns1:DT_PROCESSROUTE_S4_RSP-ZTABLE_RETURN"); + case SOAP_TYPE_PointerTons1__DT_USCOREBOM_USCORES4_USCOREREQ: + return soap_out_PointerTons1__DT_USCOREBOM_USCORES4_USCOREREQ(soap, tag, id, (ns1__DT_USCOREBOM_USCORES4_USCOREREQ *const*)ptr, "ns1:DT_BOM_S4_REQ"); + case SOAP_TYPE_PointerTo_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST: + return soap_out_PointerTo_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST(soap, tag, id, (_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST *const*)ptr, "ns1:DT_BOM_S4_REQ-LIST"); + case SOAP_TYPE_PointerTo_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM: + return soap_out_PointerTo_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(soap, tag, id, (_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM *const*)ptr, "ns1:DT_BOM_S4_REQ-LIST-ITEMS-ITEM"); + case SOAP_TYPE_PointerTo_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO: + return soap_out_PointerTo_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO(soap, tag, id, (_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO *const*)ptr, "ns1:DT_BOM_S4_REQ-BASEINFO"); + case SOAP_TYPE__QName: + return soap_out_string(soap, tag, id, (char*const*)(void*)&ptr, "xsd:QName"); + case SOAP_TYPE_string: + return soap_out_string(soap, tag, id, (char*const*)(void*)&ptr, "xsd:string"); + case 0: + return SOAP_OK; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "soap_putelement '%s' failed for type %d in soapC.cpp\n", tag ? tag : "", type)); + return soap_element_empty(soap, tag, 0, NULL); /* unknown type to serialize */ +} +#ifdef __cplusplus +} +#endif + +#ifndef WITH_NOIDREF + +#ifdef __cplusplus +extern "C" { +#endif +SOAP_FMAC3 void SOAP_FMAC4 soap_markelement(struct soap *soap, const void *ptr, int type) +{ + (void)soap; (void)ptr; (void)type; /* appease -Wall -Werror */ + switch (type) + { + case SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM: + ((_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM *)ptr)->soap_serialize(soap); + break; + case SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS: + ((_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS *)ptr)->soap_serialize(soap); + break; + case SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO: + ((_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO *)ptr)->soap_serialize(soap); + break; + case SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN: + ((_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN *)ptr)->soap_serialize(soap); + break; + case SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO: + ((_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO *)ptr)->soap_serialize(soap); + break; + case SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ: + ((ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ *)ptr)->soap_serialize(soap); + break; + case SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP: + ((ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP *)ptr)->soap_serialize(soap); + break; + case SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM: + ((_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM *)ptr)->soap_serialize(soap); + break; + case SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS: + ((_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS *)ptr)->soap_serialize(soap); + break; + case SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM: + ((_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM *)ptr)->soap_serialize(soap); + break; + case SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS: + ((_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS *)ptr)->soap_serialize(soap); + break; + case SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD: + ((_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD *)ptr)->soap_serialize(soap); + break; + case SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST: + ((_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST *)ptr)->soap_serialize(soap); + break; + case SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO: + ((_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO *)ptr)->soap_serialize(soap); + break; + case SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN: + ((_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN *)ptr)->soap_serialize(soap); + break; + case SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO: + ((_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO *)ptr)->soap_serialize(soap); + break; + case SOAP_TYPE_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ: + ((ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ *)ptr)->soap_serialize(soap); + break; + case SOAP_TYPE_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP: + ((ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP *)ptr)->soap_serialize(soap); + break; + case SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM: + ((_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM *)ptr)->soap_serialize(soap); + break; + case SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS: + ((_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS *)ptr)->soap_serialize(soap); + break; + case SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD: + ((_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD *)ptr)->soap_serialize(soap); + break; + case SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST: + ((_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST *)ptr)->soap_serialize(soap); + break; + case SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO: + ((_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO *)ptr)->soap_serialize(soap); + break; + case SOAP_TYPE_ns1__DT_USCOREBOM_USCORES4_USCOREREQ: + ((ns1__DT_USCOREBOM_USCORES4_USCOREREQ *)ptr)->soap_serialize(soap); + break; + case SOAP_TYPE___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN: + soap_serialize___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(soap, (const struct __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN *)ptr); + break; + case SOAP_TYPE___ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN: + soap_serialize___ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN(soap, (const struct __ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN *)ptr); + break; + case SOAP_TYPE___ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN: + soap_serialize___ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN(soap, (const struct __ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN *)ptr); + break; + case SOAP_TYPE_PointerTons1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ: + soap_serialize_PointerTons1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(soap, (ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ *const*)ptr); + break; + case SOAP_TYPE_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS: + soap_serialize_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(soap, (_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS *const*)ptr); + break; + case SOAP_TYPE_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM: + soap_serialize_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(soap, (_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM *const*)ptr); + break; + case SOAP_TYPE_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO: + soap_serialize_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(soap, (_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO *const*)ptr); + break; + case SOAP_TYPE_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN: + soap_serialize_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(soap, (_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN *const*)ptr); + break; + case SOAP_TYPE_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO: + soap_serialize_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(soap, (_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO *const*)ptr); + break; + case SOAP_TYPE_PointerTons1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ: + soap_serialize_PointerTons1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ(soap, (ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ *const*)ptr); + break; + case SOAP_TYPE_PointerTo_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST: + soap_serialize_PointerTo_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST(soap, (_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST *const*)ptr); + break; + case SOAP_TYPE_PointerTo_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM: + soap_serialize_PointerTo_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(soap, (_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM *const*)ptr); + break; + case SOAP_TYPE_PointerTo_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM: + soap_serialize_PointerTo_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM(soap, (_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM *const*)ptr); + break; + case SOAP_TYPE_PointerTo_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN: + soap_serialize_PointerTo_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN(soap, (_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN *const*)ptr); + break; + case SOAP_TYPE_PointerTons1__DT_USCOREBOM_USCORES4_USCOREREQ: + soap_serialize_PointerTons1__DT_USCOREBOM_USCORES4_USCOREREQ(soap, (ns1__DT_USCOREBOM_USCORES4_USCOREREQ *const*)ptr); + break; + case SOAP_TYPE_PointerTo_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST: + soap_serialize_PointerTo_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST(soap, (_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST *const*)ptr); + break; + case SOAP_TYPE_PointerTo_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM: + soap_serialize_PointerTo_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(soap, (_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM *const*)ptr); + break; + case SOAP_TYPE_PointerTo_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO: + soap_serialize_PointerTo_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO(soap, (_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO *const*)ptr); + break; + case SOAP_TYPE__QName: + soap_serialize_string(soap, (char*const*)(void*)&ptr); + break; + case SOAP_TYPE_string: + soap_serialize_string(soap, (char*const*)(void*)&ptr); + break; + } +} +#ifdef __cplusplus +} +#endif +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +SOAP_FMAC3 void * SOAP_FMAC4 soap_dupelement(struct soap *soap, const void *ptr, int type) +{(void)soap; (void)ptr; (void)type; /* appease -Wall -Werror */ + return NULL; +} +#ifdef __cplusplus +} +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +SOAP_FMAC3 void SOAP_FMAC4 soap_delelement(const void *ptr, int type) +{(void)ptr; (void)type; /* appease -Wall -Werror */ +} +#ifdef __cplusplus +} +#endif + +SOAP_FMAC3 void * SOAP_FMAC4 soap_instantiate(struct soap *soap, int t, const char *type, const char *arrayType, size_t *n) +{ (void)type; + switch (t) + { + case SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO: + return (void*)soap_instantiate__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO(soap, -1, type, arrayType, n); + case SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD: + return (void*)soap_instantiate__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD(soap, -1, type, arrayType, n); + case SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM: + return (void*)soap_instantiate__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(soap, -1, type, arrayType, n); + case SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS: + return (void*)soap_instantiate__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS(soap, -1, type, arrayType, n); + case SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST: + return (void*)soap_instantiate__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST(soap, -1, type, arrayType, n); + case SOAP_TYPE_ns1__DT_USCOREBOM_USCORES4_USCOREREQ: + return (void*)soap_instantiate_ns1__DT_USCOREBOM_USCORES4_USCOREREQ(soap, -1, type, arrayType, n); + case SOAP_TYPE___ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN: + return (void*)soap_instantiate___ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN(soap, -1, type, arrayType, n); + case SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO: + return (void*)soap_instantiate__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO(soap, -1, type, arrayType, n); + case SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN: + return (void*)soap_instantiate__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN(soap, -1, type, arrayType, n); + case SOAP_TYPE_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP: + return (void*)soap_instantiate_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP(soap, -1, type, arrayType, n); + case SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO: + return (void*)soap_instantiate__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO(soap, -1, type, arrayType, n); + case SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD: + return (void*)soap_instantiate__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD(soap, -1, type, arrayType, n); + case SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM: + return (void*)soap_instantiate__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM(soap, -1, type, arrayType, n); + case SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS: + return (void*)soap_instantiate__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS(soap, -1, type, arrayType, n); + case SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM: + return (void*)soap_instantiate__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(soap, -1, type, arrayType, n); + case SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS: + return (void*)soap_instantiate__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS(soap, -1, type, arrayType, n); + case SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST: + return (void*)soap_instantiate__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST(soap, -1, type, arrayType, n); + case SOAP_TYPE_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ: + return (void*)soap_instantiate_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ(soap, -1, type, arrayType, n); + case SOAP_TYPE___ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN: + return (void*)soap_instantiate___ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN(soap, -1, type, arrayType, n); + case SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO: + return (void*)soap_instantiate__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(soap, -1, type, arrayType, n); + case SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN: + return (void*)soap_instantiate__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(soap, -1, type, arrayType, n); + case SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP: + return (void*)soap_instantiate_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP(soap, -1, type, arrayType, n); + case SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO: + return (void*)soap_instantiate__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(soap, -1, type, arrayType, n); + case SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM: + return (void*)soap_instantiate__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(soap, -1, type, arrayType, n); + case SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS: + return (void*)soap_instantiate__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(soap, -1, type, arrayType, n); + case SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ: + return (void*)soap_instantiate_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(soap, -1, type, arrayType, n); + case SOAP_TYPE___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN: + return (void*)soap_instantiate___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(soap, -1, type, arrayType, n); +#ifndef WITH_NOGLOBAL + case SOAP_TYPE_SOAP_ENV__Header: + return (void*)soap_instantiate_SOAP_ENV__Header(soap, -1, type, arrayType, n); +#endif +#ifndef WITH_NOGLOBAL + case SOAP_TYPE_SOAP_ENV__Code: + return (void*)soap_instantiate_SOAP_ENV__Code(soap, -1, type, arrayType, n); +#endif +#ifndef WITH_NOGLOBAL + case SOAP_TYPE_SOAP_ENV__Detail: + return (void*)soap_instantiate_SOAP_ENV__Detail(soap, -1, type, arrayType, n); +#endif +#ifndef WITH_NOGLOBAL + case SOAP_TYPE_SOAP_ENV__Reason: + return (void*)soap_instantiate_SOAP_ENV__Reason(soap, -1, type, arrayType, n); +#endif +#ifndef WITH_NOGLOBAL + case SOAP_TYPE_SOAP_ENV__Fault: + return (void*)soap_instantiate_SOAP_ENV__Fault(soap, -1, type, arrayType, n); +#endif + } + return NULL; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_fdelete(struct soap *soap, struct soap_clist *p) +{ + (void)soap; /* appease -Wall -Werror */ + if (!p->ptr) + return SOAP_OK; + switch (p->type) + { + case SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO: + if (p->size < 0) + SOAP_DELETE(soap, static_cast<_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO*>(p->ptr), _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO); + else + SOAP_DELETE_ARRAY(soap, static_cast<_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO*>(p->ptr), _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO); + break; + case SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD: + if (p->size < 0) + SOAP_DELETE(soap, static_cast<_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD*>(p->ptr), _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD); + else + SOAP_DELETE_ARRAY(soap, static_cast<_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD*>(p->ptr), _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD); + break; + case SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM: + if (p->size < 0) + SOAP_DELETE(soap, static_cast<_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM*>(p->ptr), _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM); + else + SOAP_DELETE_ARRAY(soap, static_cast<_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM*>(p->ptr), _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM); + break; + case SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS: + if (p->size < 0) + SOAP_DELETE(soap, static_cast<_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS*>(p->ptr), _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS); + else + SOAP_DELETE_ARRAY(soap, static_cast<_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS*>(p->ptr), _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS); + break; + case SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST: + if (p->size < 0) + SOAP_DELETE(soap, static_cast<_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST*>(p->ptr), _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST); + else + SOAP_DELETE_ARRAY(soap, static_cast<_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST*>(p->ptr), _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST); + break; + case SOAP_TYPE_ns1__DT_USCOREBOM_USCORES4_USCOREREQ: + if (p->size < 0) + SOAP_DELETE(soap, static_cast(p->ptr), ns1__DT_USCOREBOM_USCORES4_USCOREREQ); + else + SOAP_DELETE_ARRAY(soap, static_cast(p->ptr), ns1__DT_USCOREBOM_USCORES4_USCOREREQ); + break; + case SOAP_TYPE___ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN: + if (p->size < 0) + SOAP_DELETE(soap, static_cast(p->ptr), struct __ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN); + else + SOAP_DELETE_ARRAY(soap, static_cast(p->ptr), struct __ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN); + break; + case SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO: + if (p->size < 0) + SOAP_DELETE(soap, static_cast<_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO*>(p->ptr), _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO); + else + SOAP_DELETE_ARRAY(soap, static_cast<_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO*>(p->ptr), _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO); + break; + case SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN: + if (p->size < 0) + SOAP_DELETE(soap, static_cast<_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN*>(p->ptr), _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN); + else + SOAP_DELETE_ARRAY(soap, static_cast<_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN*>(p->ptr), _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN); + break; + case SOAP_TYPE_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP: + if (p->size < 0) + SOAP_DELETE(soap, static_cast(p->ptr), ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP); + else + SOAP_DELETE_ARRAY(soap, static_cast(p->ptr), ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP); + break; + case SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO: + if (p->size < 0) + SOAP_DELETE(soap, static_cast<_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO*>(p->ptr), _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO); + else + SOAP_DELETE_ARRAY(soap, static_cast<_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO*>(p->ptr), _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO); + break; + case SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD: + if (p->size < 0) + SOAP_DELETE(soap, static_cast<_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD*>(p->ptr), _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD); + else + SOAP_DELETE_ARRAY(soap, static_cast<_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD*>(p->ptr), _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD); + break; + case SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM: + if (p->size < 0) + SOAP_DELETE(soap, static_cast<_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM*>(p->ptr), _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM); + else + SOAP_DELETE_ARRAY(soap, static_cast<_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM*>(p->ptr), _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM); + break; + case SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS: + if (p->size < 0) + SOAP_DELETE(soap, static_cast<_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS*>(p->ptr), _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS); + else + SOAP_DELETE_ARRAY(soap, static_cast<_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS*>(p->ptr), _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS); + break; + case SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM: + if (p->size < 0) + SOAP_DELETE(soap, static_cast<_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM*>(p->ptr), _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM); + else + SOAP_DELETE_ARRAY(soap, static_cast<_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM*>(p->ptr), _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM); + break; + case SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS: + if (p->size < 0) + SOAP_DELETE(soap, static_cast<_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS*>(p->ptr), _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS); + else + SOAP_DELETE_ARRAY(soap, static_cast<_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS*>(p->ptr), _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS); + break; + case SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST: + if (p->size < 0) + SOAP_DELETE(soap, static_cast<_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST*>(p->ptr), _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST); + else + SOAP_DELETE_ARRAY(soap, static_cast<_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST*>(p->ptr), _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST); + break; + case SOAP_TYPE_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ: + if (p->size < 0) + SOAP_DELETE(soap, static_cast(p->ptr), ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ); + else + SOAP_DELETE_ARRAY(soap, static_cast(p->ptr), ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ); + break; + case SOAP_TYPE___ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN: + if (p->size < 0) + SOAP_DELETE(soap, static_cast(p->ptr), struct __ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN); + else + SOAP_DELETE_ARRAY(soap, static_cast(p->ptr), struct __ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN); + break; + case SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO: + if (p->size < 0) + SOAP_DELETE(soap, static_cast<_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO*>(p->ptr), _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO); + else + SOAP_DELETE_ARRAY(soap, static_cast<_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO*>(p->ptr), _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO); + break; + case SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN: + if (p->size < 0) + SOAP_DELETE(soap, static_cast<_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN*>(p->ptr), _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN); + else + SOAP_DELETE_ARRAY(soap, static_cast<_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN*>(p->ptr), _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN); + break; + case SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP: + if (p->size < 0) + SOAP_DELETE(soap, static_cast(p->ptr), ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP); + else + SOAP_DELETE_ARRAY(soap, static_cast(p->ptr), ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP); + break; + case SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO: + if (p->size < 0) + SOAP_DELETE(soap, static_cast<_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO*>(p->ptr), _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO); + else + SOAP_DELETE_ARRAY(soap, static_cast<_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO*>(p->ptr), _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO); + break; + case SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM: + if (p->size < 0) + SOAP_DELETE(soap, static_cast<_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM*>(p->ptr), _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM); + else + SOAP_DELETE_ARRAY(soap, static_cast<_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM*>(p->ptr), _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM); + break; + case SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS: + if (p->size < 0) + SOAP_DELETE(soap, static_cast<_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS*>(p->ptr), _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS); + else + SOAP_DELETE_ARRAY(soap, static_cast<_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS*>(p->ptr), _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS); + break; + case SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ: + if (p->size < 0) + SOAP_DELETE(soap, static_cast(p->ptr), ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ); + else + SOAP_DELETE_ARRAY(soap, static_cast(p->ptr), ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ); + break; + case SOAP_TYPE___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN: + if (p->size < 0) + SOAP_DELETE(soap, static_cast(p->ptr), struct __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN); + else + SOAP_DELETE_ARRAY(soap, static_cast(p->ptr), struct __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN); + break; +#ifndef WITH_NOGLOBAL + case SOAP_TYPE_SOAP_ENV__Header: + if (p->size < 0) + SOAP_DELETE(soap, static_cast(p->ptr), struct SOAP_ENV__Header); + else + SOAP_DELETE_ARRAY(soap, static_cast(p->ptr), struct SOAP_ENV__Header); + break; +#endif +#ifndef WITH_NOGLOBAL + case SOAP_TYPE_SOAP_ENV__Code: + if (p->size < 0) + SOAP_DELETE(soap, static_cast(p->ptr), struct SOAP_ENV__Code); + else + SOAP_DELETE_ARRAY(soap, static_cast(p->ptr), struct SOAP_ENV__Code); + break; +#endif +#ifndef WITH_NOGLOBAL + case SOAP_TYPE_SOAP_ENV__Detail: + if (p->size < 0) + SOAP_DELETE(soap, static_cast(p->ptr), struct SOAP_ENV__Detail); + else + SOAP_DELETE_ARRAY(soap, static_cast(p->ptr), struct SOAP_ENV__Detail); + break; +#endif +#ifndef WITH_NOGLOBAL + case SOAP_TYPE_SOAP_ENV__Reason: + if (p->size < 0) + SOAP_DELETE(soap, static_cast(p->ptr), struct SOAP_ENV__Reason); + else + SOAP_DELETE_ARRAY(soap, static_cast(p->ptr), struct SOAP_ENV__Reason); + break; +#endif +#ifndef WITH_NOGLOBAL + case SOAP_TYPE_SOAP_ENV__Fault: + if (p->size < 0) + SOAP_DELETE(soap, static_cast(p->ptr), struct SOAP_ENV__Fault); + else + SOAP_DELETE_ARRAY(soap, static_cast(p->ptr), struct SOAP_ENV__Fault); + break; +#endif + default: + return SOAP_ERR; + } + return SOAP_OK; +} + +#ifdef WIN32 +#pragma warning(push) +// do not warn on switch w/o cases +#pragma warning(disable:4065) +#endif +SOAP_FMAC3 int SOAP_FMAC4 soap_fbase(int t, int b) +{ + (void)t; (void)b; /* appease -Wall -Werror */ + return 0; +} +#ifdef WIN32 +#pragma warning(pop) +#endif + +#ifndef WITH_NOIDREF +#ifdef WIN32 +#pragma warning(push) +// do not warn on switch w/o cases +#pragma warning(disable:4065) +#endif +SOAP_FMAC3 void SOAP_FMAC4 soap_finsert(struct soap *soap, int t, int tt, void *p, size_t index, const void *q, void **x) +{ + (void)soap; (void)t; (void)p; (void)index; (void)q; (void)x; /* appease -Wall -Werror */ + switch (tt) + { + case SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO type=%d location=%p object=%p\n", t, p, q)); + *(_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO*)p = *(_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO*)q; + break; + case SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD type=%d location=%p object=%p\n", t, p, q)); + *(_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD*)p = *(_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD*)q; + break; + case SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM type=%d location=%p object=%p\n", t, p, q)); + *(_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM*)p = *(_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM*)q; + break; + case SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS type=%d location=%p object=%p\n", t, p, q)); + *(_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS*)p = *(_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS*)q; + break; + case SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST type=%d location=%p object=%p\n", t, p, q)); + *(_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST*)p = *(_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST*)q; + break; + case SOAP_TYPE_ns1__DT_USCOREBOM_USCORES4_USCOREREQ: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy ns1__DT_USCOREBOM_USCORES4_USCOREREQ type=%d location=%p object=%p\n", t, p, q)); + *(ns1__DT_USCOREBOM_USCORES4_USCOREREQ*)p = *(ns1__DT_USCOREBOM_USCORES4_USCOREREQ*)q; + break; + case SOAP_TYPE___ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy struct __ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN type=%d location=%p object=%p\n", t, p, q)); + *(struct __ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN*)p = *(struct __ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN*)q; + break; + case SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO type=%d location=%p object=%p\n", t, p, q)); + *(_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO*)p = *(_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO*)q; + break; + case SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN type=%d location=%p object=%p\n", t, p, q)); + *(_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN*)p = *(_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN*)q; + break; + case SOAP_TYPE_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP type=%d location=%p object=%p\n", t, p, q)); + *(ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP*)p = *(ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP*)q; + break; + case SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO type=%d location=%p object=%p\n", t, p, q)); + *(_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO*)p = *(_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO*)q; + break; + case SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD type=%d location=%p object=%p\n", t, p, q)); + *(_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD*)p = *(_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD*)q; + break; + case SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM type=%d location=%p object=%p\n", t, p, q)); + *(_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM*)p = *(_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM*)q; + break; + case SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS type=%d location=%p object=%p\n", t, p, q)); + *(_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS*)p = *(_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS*)q; + break; + case SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM type=%d location=%p object=%p\n", t, p, q)); + *(_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM*)p = *(_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM*)q; + break; + case SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS type=%d location=%p object=%p\n", t, p, q)); + *(_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS*)p = *(_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS*)q; + break; + case SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST type=%d location=%p object=%p\n", t, p, q)); + *(_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST*)p = *(_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST*)q; + break; + case SOAP_TYPE_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ type=%d location=%p object=%p\n", t, p, q)); + *(ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ*)p = *(ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ*)q; + break; + case SOAP_TYPE___ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy struct __ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN type=%d location=%p object=%p\n", t, p, q)); + *(struct __ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN*)p = *(struct __ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN*)q; + break; + case SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO type=%d location=%p object=%p\n", t, p, q)); + *(_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO*)p = *(_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO*)q; + break; + case SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN type=%d location=%p object=%p\n", t, p, q)); + *(_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN*)p = *(_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN*)q; + break; + case SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP type=%d location=%p object=%p\n", t, p, q)); + *(ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP*)p = *(ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP*)q; + break; + case SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO type=%d location=%p object=%p\n", t, p, q)); + *(_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO*)p = *(_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO*)q; + break; + case SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM type=%d location=%p object=%p\n", t, p, q)); + *(_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM*)p = *(_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM*)q; + break; + case SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS type=%d location=%p object=%p\n", t, p, q)); + *(_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS*)p = *(_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS*)q; + break; + case SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ type=%d location=%p object=%p\n", t, p, q)); + *(ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ*)p = *(ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ*)q; + break; + case SOAP_TYPE___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy struct __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN type=%d location=%p object=%p\n", t, p, q)); + *(struct __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN*)p = *(struct __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN*)q; + break; +#ifndef WITH_NOGLOBAL + case SOAP_TYPE_SOAP_ENV__Header: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy struct SOAP_ENV__Header type=%d location=%p object=%p\n", t, p, q)); + *(struct SOAP_ENV__Header*)p = *(struct SOAP_ENV__Header*)q; + break; +#endif +#ifndef WITH_NOGLOBAL + case SOAP_TYPE_SOAP_ENV__Code: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy struct SOAP_ENV__Code type=%d location=%p object=%p\n", t, p, q)); + *(struct SOAP_ENV__Code*)p = *(struct SOAP_ENV__Code*)q; + break; +#endif +#ifndef WITH_NOGLOBAL + case SOAP_TYPE_SOAP_ENV__Detail: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy struct SOAP_ENV__Detail type=%d location=%p object=%p\n", t, p, q)); + *(struct SOAP_ENV__Detail*)p = *(struct SOAP_ENV__Detail*)q; + break; +#endif +#ifndef WITH_NOGLOBAL + case SOAP_TYPE_SOAP_ENV__Reason: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy struct SOAP_ENV__Reason type=%d location=%p object=%p\n", t, p, q)); + *(struct SOAP_ENV__Reason*)p = *(struct SOAP_ENV__Reason*)q; + break; +#endif +#ifndef WITH_NOGLOBAL + case SOAP_TYPE_SOAP_ENV__Fault: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy struct SOAP_ENV__Fault type=%d location=%p object=%p\n", t, p, q)); + *(struct SOAP_ENV__Fault*)p = *(struct SOAP_ENV__Fault*)q; + break; +#endif + default: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Could not insert type=%d in %d\n", t, tt)); + } +} +#ifdef WIN32 +#pragma warning(pop) +#endif +#endif + +SOAP_FMAC3 int SOAP_FMAC4 soap_out_byte(struct soap *soap, const char *tag, int id, const char *a, const char *type) +{ + return soap_outbyte(soap, tag, id, a, type, SOAP_TYPE_byte); +} + +SOAP_FMAC3 char * SOAP_FMAC4 soap_in_byte(struct soap *soap, const char *tag, char *a, const char *type) +{ + a = soap_inbyte(soap, tag, a, type, SOAP_TYPE_byte); + return a; +} + +SOAP_FMAC3 char * SOAP_FMAC4 soap_new_byte(struct soap *soap, int n) +{ + char *a = static_cast(soap_malloc(soap, (n = (n < 0 ? 1 : n)) * sizeof(char))); + for (char *p = a; p && n--; ++p) + soap_default_byte(soap, p); + return a; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_put_byte(struct soap *soap, const char *a, const char *tag, const char *type) +{ + if (soap_out_byte(soap, tag ? tag : "byte", -2, a, type)) + return soap->error; + return soap_putindependent(soap); +} + +SOAP_FMAC3 char * SOAP_FMAC4 soap_get_byte(struct soap *soap, char *p, const char *tag, const char *type) +{ + if ((p = soap_in_byte(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out_int(struct soap *soap, const char *tag, int id, const int *a, const char *type) +{ + return soap_outint(soap, tag, id, a, type, SOAP_TYPE_int); +} + +SOAP_FMAC3 int * SOAP_FMAC4 soap_in_int(struct soap *soap, const char *tag, int *a, const char *type) +{ + a = soap_inint(soap, tag, a, type, SOAP_TYPE_int); + return a; +} + +SOAP_FMAC3 int * SOAP_FMAC4 soap_new_int(struct soap *soap, int n) +{ + int *a = static_cast(soap_malloc(soap, (n = (n < 0 ? 1 : n)) * sizeof(int))); + for (int *p = a; p && n--; ++p) + soap_default_int(soap, p); + return a; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_put_int(struct soap *soap, const int *a, const char *tag, const char *type) +{ + if (soap_out_int(soap, tag ? tag : "int", -2, a, type)) + return soap->error; + return soap_putindependent(soap); +} + +SOAP_FMAC3 int * SOAP_FMAC4 soap_get_int(struct soap *soap, int *p, const char *tag, const char *type) +{ + if ((p = soap_in_int(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +void _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::soap_default(struct soap *soap) +{ + (void)soap; /* appease -Wall -Werror */ + soap_default_string(soap, &this->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::PSPID); + soap_default_string(soap, &this->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::ZPSPID); + soap_default_string(soap, &this->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::MATNR); + soap_default_string(soap, &this->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::ZZD); + soap_default_string(soap, &this->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::ZGH); + soap_default_string(soap, &this->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::SERNR); + soap_default_string(soap, &this->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::WERKS); + soap_default_string(soap, &this->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::RSPOS); +} + +void _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::soap_serialize(struct soap *soap) const +{ + (void)soap; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + soap_serialize_string(soap, (char*const*)&this->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::PSPID); + soap_serialize_string(soap, (char*const*)&this->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::ZPSPID); + soap_serialize_string(soap, (char*const*)&this->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::MATNR); + soap_serialize_string(soap, (char*const*)&this->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::ZZD); + soap_serialize_string(soap, (char*const*)&this->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::ZGH); + soap_serialize_string(soap, (char*const*)&this->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::SERNR); + soap_serialize_string(soap, (char*const*)&this->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::WERKS); + soap_serialize_string(soap, (char*const*)&this->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::RSPOS); +#endif +} + +int _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::soap_out(struct soap *soap, const char *tag, int id, const char *type) const +{ + return soap_out__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(soap, tag, id, this, type); +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(struct soap *soap, const char *tag, int id, const _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM *a, const char *type) +{ + (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM), type)) + return soap->error; + if (soap_out_string(soap, "PSPID", -1, (char*const*)&a->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::PSPID, "")) + return soap->error; + if (soap_out_string(soap, "ZPSPID", -1, (char*const*)&a->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::ZPSPID, "")) + return soap->error; + if (soap_out_string(soap, "MATNR", -1, (char*const*)&a->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::MATNR, "")) + return soap->error; + if (soap_out_string(soap, "ZZD", -1, (char*const*)&a->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::ZZD, "")) + return soap->error; + if (soap_out_string(soap, "ZGH", -1, (char*const*)&a->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::ZGH, "")) + return soap->error; + if (soap_out_string(soap, "SERNR", -1, (char*const*)&a->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::SERNR, "")) + return soap->error; + if (soap_out_string(soap, "WERKS", -1, (char*const*)&a->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::WERKS, "")) + return soap->error; + if (soap_out_string(soap, "RSPOS", -1, (char*const*)&a->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::RSPOS, "")) + return soap->error; + return soap_element_end_out(soap, tag); +} + +void *_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::soap_in(struct soap *soap, const char *tag, const char *type) +{ + return soap_in__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(soap, tag, this, type); +} + +SOAP_FMAC3 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM * SOAP_FMAC4 soap_in__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(struct soap *soap, const char *tag, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM *a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; + a = (_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM*)soap_id_enter(soap, soap->id, a, SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM, sizeof(_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM), soap->type, soap->arrayType, soap_instantiate, soap_fbase); + if (!a) + return NULL; + if (soap->alloced && soap->alloced != SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM) + { soap_revert(soap); + *soap->id = '\0'; + return (_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM *)a->soap_in(soap, tag, type); + } + if (soap->alloced) + a->soap_default(soap); + size_t soap_flag_PSPID1 = 1; + size_t soap_flag_ZPSPID1 = 1; + size_t soap_flag_MATNR1 = 1; + size_t soap_flag_ZZD1 = 1; + size_t soap_flag_ZGH1 = 1; + size_t soap_flag_SERNR1 = 1; + size_t soap_flag_WERKS1 = 1; + size_t soap_flag_RSPOS1 = 1; + if (soap->body && *soap->href != '#') + { + for (;;) + { soap->error = SOAP_TAG_MISMATCH; + if (soap_flag_PSPID1 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_string(soap, "PSPID", (char**)&a->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::PSPID, "xsd:string")) + { soap_flag_PSPID1--; + continue; + } + } + if (soap_flag_ZPSPID1 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_string(soap, "ZPSPID", (char**)&a->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::ZPSPID, "xsd:string")) + { soap_flag_ZPSPID1--; + continue; + } + } + if (soap_flag_MATNR1 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_string(soap, "MATNR", (char**)&a->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::MATNR, "xsd:string")) + { soap_flag_MATNR1--; + continue; + } + } + if (soap_flag_ZZD1 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_string(soap, "ZZD", (char**)&a->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::ZZD, "xsd:string")) + { soap_flag_ZZD1--; + continue; + } + } + if (soap_flag_ZGH1 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_string(soap, "ZGH", (char**)&a->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::ZGH, "xsd:string")) + { soap_flag_ZGH1--; + continue; + } + } + if (soap_flag_SERNR1 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_string(soap, "SERNR", (char**)&a->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::SERNR, "xsd:string")) + { soap_flag_SERNR1--; + continue; + } + } + if (soap_flag_WERKS1 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_string(soap, "WERKS", (char**)&a->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::WERKS, "xsd:string")) + { soap_flag_WERKS1--; + continue; + } + } + if (soap_flag_RSPOS1 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_string(soap, "RSPOS", (char**)&a->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::RSPOS, "xsd:string")) + { soap_flag_RSPOS1--; + continue; + } + } + if (soap->error == SOAP_TAG_MISMATCH) + soap->error = soap_ignore_element(soap); + if (soap->error == SOAP_NO_TAG) + break; + if (soap->error) + return NULL; + } + if (soap_element_end_in(soap, tag)) + return NULL; + } + else + { a = (_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM, SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM, sizeof(_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM), 0, soap_finsert, soap_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC1 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM * SOAP_FMAC2 soap_instantiate__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "soap_instantiate__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(%p, %d, %s, %s)\n", (void*)soap, n, type?type:"", arrayType?arrayType:"")); + (void)type; (void)arrayType; /* appease -Wall -Werror */ + _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM *p; + size_t k = sizeof(_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM); + struct soap_clist *cp = soap_link(soap, SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM, n, soap_fdelete); + if (!cp && soap && n != SOAP_NO_LINK_TO_DELETE) + return NULL; + if (n < 0) + { p = SOAP_NEW(soap, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM); + } + else + { p = SOAP_NEW_ARRAY(soap, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM, n); + k *= n; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM location=%p n=%d\n", (void*)p, n)); + if (size) + *size = k; + if (!p) + soap->error = SOAP_EOM; + else if (cp) + cp->ptr = (void*)p; + return p; +} + +int _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::soap_put(struct soap *soap, const char *tag, const char *type) const +{ + if (soap_out__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(soap, tag ? tag : "ns1:DT_FACTORY_NUMBER_REQ-ITEMS-ITEM", -2, this, type)) + return soap->error; + return soap_putindependent(soap); +} + +void *_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::soap_get(struct soap *soap, const char *tag, const char *type) +{ + return soap_get__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(soap, this, tag, type); +} + +SOAP_FMAC3 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM * SOAP_FMAC4 soap_get__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(struct soap *soap, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM *p, const char *tag, const char *type) +{ + if ((p = soap_in__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +void _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS::soap_default(struct soap *soap) +{ + (void)soap; /* appease -Wall -Werror */ + this->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS::__sizeITEM = 0; + this->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS::ITEM = NULL; +} + +void _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS::soap_serialize(struct soap *soap) const +{ + (void)soap; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + if (this->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS::ITEM) + { int i; + for (i = 0; i < (int)this->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS::__sizeITEM; i++) + { + soap_embedded(soap, this->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS::ITEM + i, SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM); + this->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS::ITEM[i].soap_serialize(soap); + } + } +#endif +} + +int _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS::soap_out(struct soap *soap, const char *tag, int id, const char *type) const +{ + return soap_out__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(soap, tag, id, this, type); +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(struct soap *soap, const char *tag, int id, const _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS *a, const char *type) +{ + (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS), type)) + return soap->error; + if (a->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS::ITEM) + { int i; + for (i = 0; i < (int)a->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS::__sizeITEM; i++) + if (a->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS::ITEM[i].soap_out(soap, "ITEM", -1, "")) + return soap->error; + } + return soap_element_end_out(soap, tag); +} + +void *_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS::soap_in(struct soap *soap, const char *tag, const char *type) +{ + return soap_in__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(soap, tag, this, type); +} + +SOAP_FMAC3 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS * SOAP_FMAC4 soap_in__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(struct soap *soap, const char *tag, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS *a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; + a = (_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS*)soap_id_enter(soap, soap->id, a, SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS, sizeof(_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS), soap->type, soap->arrayType, soap_instantiate, soap_fbase); + if (!a) + return NULL; + if (soap->alloced && soap->alloced != SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS) + { soap_revert(soap); + *soap->id = '\0'; + return (_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS *)a->soap_in(soap, tag, type); + } + if (soap->alloced) + a->soap_default(soap); + struct soap_blist *soap_blist_ITEM1 = NULL; + if (soap->body && *soap->href != '#') + { + for (;;) + { soap->error = SOAP_TAG_MISMATCH; + if (soap->error == SOAP_TAG_MISMATCH && !soap_element_begin_in(soap, "ITEM", 1, NULL)) + { if (a->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS::ITEM == NULL) + { if (soap_blist_ITEM1 == NULL) + soap_blist_ITEM1 = soap_alloc_block(soap); + a->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS::ITEM = soap_block<_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM>::push(soap, soap_blist_ITEM1); + if (a->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS::ITEM == NULL) + return NULL; + a->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS::ITEM->soap_default(soap); + } + soap_revert(soap); + if (soap_in__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(soap, "ITEM", a->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS::ITEM, "")) + { a->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS::__sizeITEM++; + a->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS::ITEM = NULL; + continue; + } + } + if (soap->error == SOAP_TAG_MISMATCH) + soap->error = soap_ignore_element(soap); + if (soap->error == SOAP_NO_TAG) + break; + if (soap->error) + return NULL; + } + if (a->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS::ITEM) + soap_block<_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM>::pop(soap, soap_blist_ITEM1); + if (a->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS::__sizeITEM) + { a->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS::ITEM = soap_new__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(soap, a->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS::__sizeITEM); + if (!a->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS::ITEM) + return NULL; + soap_block<_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM>::save(soap, soap_blist_ITEM1, a->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS::ITEM); + } + else + { a->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS::ITEM = NULL; + if (soap_blist_ITEM1) + soap_block<_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM>::end(soap, soap_blist_ITEM1); + } + if (soap_element_end_in(soap, tag)) + return NULL; + } + else + { a = (_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS, SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS, sizeof(_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS), 0, soap_finsert, soap_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC1 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS * SOAP_FMAC2 soap_instantiate__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "soap_instantiate__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(%p, %d, %s, %s)\n", (void*)soap, n, type?type:"", arrayType?arrayType:"")); + (void)type; (void)arrayType; /* appease -Wall -Werror */ + _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS *p; + size_t k = sizeof(_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS); + struct soap_clist *cp = soap_link(soap, SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS, n, soap_fdelete); + if (!cp && soap && n != SOAP_NO_LINK_TO_DELETE) + return NULL; + if (n < 0) + { p = SOAP_NEW(soap, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS); + } + else + { p = SOAP_NEW_ARRAY(soap, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS, n); + k *= n; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS location=%p n=%d\n", (void*)p, n)); + if (size) + *size = k; + if (!p) + soap->error = SOAP_EOM; + else if (cp) + cp->ptr = (void*)p; + return p; +} + +int _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS::soap_put(struct soap *soap, const char *tag, const char *type) const +{ + if (soap_out__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(soap, tag ? tag : "ns1:DT_FACTORY_NUMBER_REQ-ITEMS", -2, this, type)) + return soap->error; + return soap_putindependent(soap); +} + +void *_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS::soap_get(struct soap *soap, const char *tag, const char *type) +{ + return soap_get__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(soap, this, tag, type); +} + +SOAP_FMAC3 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS * SOAP_FMAC4 soap_get__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(struct soap *soap, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS *p, const char *tag, const char *type) +{ + if ((p = soap_in__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +void _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO::soap_default(struct soap *soap) +{ + (void)soap; /* appease -Wall -Werror */ + soap_default_string(soap, &this->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO::REQ_USCORETRACE_USCOREID); +} + +void _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO::soap_serialize(struct soap *soap) const +{ + (void)soap; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + soap_serialize_string(soap, (char*const*)&this->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO::REQ_USCORETRACE_USCOREID); +#endif +} + +int _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO::soap_out(struct soap *soap, const char *tag, int id, const char *type) const +{ + return soap_out__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(soap, tag, id, this, type); +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(struct soap *soap, const char *tag, int id, const _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO *a, const char *type) +{ + (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO), type)) + return soap->error; + if (soap_out_string(soap, "REQ_TRACE_ID", -1, (char*const*)&a->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO::REQ_USCORETRACE_USCOREID, "")) + return soap->error; + return soap_element_end_out(soap, tag); +} + +void *_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO::soap_in(struct soap *soap, const char *tag, const char *type) +{ + return soap_in__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(soap, tag, this, type); +} + +SOAP_FMAC3 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO * SOAP_FMAC4 soap_in__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(struct soap *soap, const char *tag, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO *a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; + a = (_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO*)soap_id_enter(soap, soap->id, a, SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO, sizeof(_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO), soap->type, soap->arrayType, soap_instantiate, soap_fbase); + if (!a) + return NULL; + if (soap->alloced && soap->alloced != SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO) + { soap_revert(soap); + *soap->id = '\0'; + return (_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO *)a->soap_in(soap, tag, type); + } + if (soap->alloced) + a->soap_default(soap); + size_t soap_flag_REQ_USCORETRACE_USCOREID1 = 1; + if (soap->body && *soap->href != '#') + { + for (;;) + { soap->error = SOAP_TAG_MISMATCH; + if (soap_flag_REQ_USCORETRACE_USCOREID1 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_string(soap, "REQ_TRACE_ID", (char**)&a->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO::REQ_USCORETRACE_USCOREID, "xsd:string")) + { soap_flag_REQ_USCORETRACE_USCOREID1--; + continue; + } + } + if (soap->error == SOAP_TAG_MISMATCH) + soap->error = soap_ignore_element(soap); + if (soap->error == SOAP_NO_TAG) + break; + if (soap->error) + return NULL; + } + if (soap_element_end_in(soap, tag)) + return NULL; + } + else + { a = (_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO, SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO, sizeof(_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO), 0, soap_finsert, soap_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC1 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO * SOAP_FMAC2 soap_instantiate__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "soap_instantiate__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(%p, %d, %s, %s)\n", (void*)soap, n, type?type:"", arrayType?arrayType:"")); + (void)type; (void)arrayType; /* appease -Wall -Werror */ + _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO *p; + size_t k = sizeof(_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO); + struct soap_clist *cp = soap_link(soap, SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO, n, soap_fdelete); + if (!cp && soap && n != SOAP_NO_LINK_TO_DELETE) + return NULL; + if (n < 0) + { p = SOAP_NEW(soap, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO); + } + else + { p = SOAP_NEW_ARRAY(soap, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO, n); + k *= n; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO location=%p n=%d\n", (void*)p, n)); + if (size) + *size = k; + if (!p) + soap->error = SOAP_EOM; + else if (cp) + cp->ptr = (void*)p; + return p; +} + +int _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO::soap_put(struct soap *soap, const char *tag, const char *type) const +{ + if (soap_out__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(soap, tag ? tag : "ns1:DT_FACTORY_NUMBER_REQ-BASEINFO", -2, this, type)) + return soap->error; + return soap_putindependent(soap); +} + +void *_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO::soap_get(struct soap *soap, const char *tag, const char *type) +{ + return soap_get__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(soap, this, tag, type); +} + +SOAP_FMAC3 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO * SOAP_FMAC4 soap_get__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(struct soap *soap, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO *p, const char *tag, const char *type) +{ + if ((p = soap_in__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +void _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN::soap_default(struct soap *soap) +{ + (void)soap; /* appease -Wall -Werror */ + soap_default_string(soap, &this->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN::SERNR); + soap_default_string(soap, &this->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN::TYPE); + soap_default_string(soap, &this->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN::MESSAGE); +} + +void _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN::soap_serialize(struct soap *soap) const +{ + (void)soap; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + soap_serialize_string(soap, (char*const*)&this->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN::SERNR); + soap_serialize_string(soap, (char*const*)&this->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN::TYPE); + soap_serialize_string(soap, (char*const*)&this->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN::MESSAGE); +#endif +} + +int _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN::soap_out(struct soap *soap, const char *tag, int id, const char *type) const +{ + return soap_out__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(soap, tag, id, this, type); +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(struct soap *soap, const char *tag, int id, const _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN *a, const char *type) +{ + (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN), type)) + return soap->error; + if (soap_out_string(soap, "SERNR", -1, (char*const*)&a->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN::SERNR, "")) + return soap->error; + if (soap_out_string(soap, "TYPE", -1, (char*const*)&a->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN::TYPE, "")) + return soap->error; + if (soap_out_string(soap, "MESSAGE", -1, (char*const*)&a->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN::MESSAGE, "")) + return soap->error; + return soap_element_end_out(soap, tag); +} + +void *_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN::soap_in(struct soap *soap, const char *tag, const char *type) +{ + return soap_in__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(soap, tag, this, type); +} + +SOAP_FMAC3 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN * SOAP_FMAC4 soap_in__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(struct soap *soap, const char *tag, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN *a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; + a = (_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN*)soap_id_enter(soap, soap->id, a, SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN, sizeof(_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN), soap->type, soap->arrayType, soap_instantiate, soap_fbase); + if (!a) + return NULL; + if (soap->alloced && soap->alloced != SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN) + { soap_revert(soap); + *soap->id = '\0'; + return (_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN *)a->soap_in(soap, tag, type); + } + if (soap->alloced) + a->soap_default(soap); + size_t soap_flag_SERNR1 = 1; + size_t soap_flag_TYPE1 = 1; + size_t soap_flag_MESSAGE1 = 1; + if (soap->body && *soap->href != '#') + { + for (;;) + { soap->error = SOAP_TAG_MISMATCH; + if (soap_flag_SERNR1 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_string(soap, "SERNR", (char**)&a->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN::SERNR, "xsd:string")) + { soap_flag_SERNR1--; + continue; + } + } + if (soap_flag_TYPE1 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_string(soap, "TYPE", (char**)&a->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN::TYPE, "xsd:string")) + { soap_flag_TYPE1--; + continue; + } + } + if (soap_flag_MESSAGE1 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_string(soap, "MESSAGE", (char**)&a->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN::MESSAGE, "xsd:string")) + { soap_flag_MESSAGE1--; + continue; + } + } + if (soap->error == SOAP_TAG_MISMATCH) + soap->error = soap_ignore_element(soap); + if (soap->error == SOAP_NO_TAG) + break; + if (soap->error) + return NULL; + } + if (soap_element_end_in(soap, tag)) + return NULL; + } + else + { a = (_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN, SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN, sizeof(_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN), 0, soap_finsert, soap_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC1 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN * SOAP_FMAC2 soap_instantiate__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "soap_instantiate__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(%p, %d, %s, %s)\n", (void*)soap, n, type?type:"", arrayType?arrayType:"")); + (void)type; (void)arrayType; /* appease -Wall -Werror */ + _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN *p; + size_t k = sizeof(_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN); + struct soap_clist *cp = soap_link(soap, SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN, n, soap_fdelete); + if (!cp && soap && n != SOAP_NO_LINK_TO_DELETE) + return NULL; + if (n < 0) + { p = SOAP_NEW(soap, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN); + } + else + { p = SOAP_NEW_ARRAY(soap, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN, n); + k *= n; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN location=%p n=%d\n", (void*)p, n)); + if (size) + *size = k; + if (!p) + soap->error = SOAP_EOM; + else if (cp) + cp->ptr = (void*)p; + return p; +} + +int _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN::soap_put(struct soap *soap, const char *tag, const char *type) const +{ + if (soap_out__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(soap, tag ? tag : "ns1:DT_FACTORY_NUMBER_RSP-ZTABLE_RETURN", -2, this, type)) + return soap->error; + return soap_putindependent(soap); +} + +void *_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN::soap_get(struct soap *soap, const char *tag, const char *type) +{ + return soap_get__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(soap, this, tag, type); +} + +SOAP_FMAC3 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN * SOAP_FMAC4 soap_get__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(struct soap *soap, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN *p, const char *tag, const char *type) +{ + if ((p = soap_in__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +void _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO::soap_default(struct soap *soap) +{ + (void)soap; /* appease -Wall -Werror */ + soap_default_string(soap, &this->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO::REQ_USCORETRACE_USCOREID); +} + +void _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO::soap_serialize(struct soap *soap) const +{ + (void)soap; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + soap_serialize_string(soap, (char*const*)&this->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO::REQ_USCORETRACE_USCOREID); +#endif +} + +int _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO::soap_out(struct soap *soap, const char *tag, int id, const char *type) const +{ + return soap_out__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(soap, tag, id, this, type); +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(struct soap *soap, const char *tag, int id, const _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO *a, const char *type) +{ + (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO), type)) + return soap->error; + if (soap_out_string(soap, "REQ_TRACE_ID", -1, (char*const*)&a->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO::REQ_USCORETRACE_USCOREID, "")) + return soap->error; + return soap_element_end_out(soap, tag); +} + +void *_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO::soap_in(struct soap *soap, const char *tag, const char *type) +{ + return soap_in__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(soap, tag, this, type); +} + +SOAP_FMAC3 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO * SOAP_FMAC4 soap_in__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(struct soap *soap, const char *tag, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO *a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; + a = (_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO*)soap_id_enter(soap, soap->id, a, SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO, sizeof(_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO), soap->type, soap->arrayType, soap_instantiate, soap_fbase); + if (!a) + return NULL; + if (soap->alloced && soap->alloced != SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO) + { soap_revert(soap); + *soap->id = '\0'; + return (_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO *)a->soap_in(soap, tag, type); + } + if (soap->alloced) + a->soap_default(soap); + size_t soap_flag_REQ_USCORETRACE_USCOREID1 = 1; + if (soap->body && *soap->href != '#') + { + for (;;) + { soap->error = SOAP_TAG_MISMATCH; + if (soap_flag_REQ_USCORETRACE_USCOREID1 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_string(soap, "REQ_TRACE_ID", (char**)&a->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO::REQ_USCORETRACE_USCOREID, "xsd:string")) + { soap_flag_REQ_USCORETRACE_USCOREID1--; + continue; + } + } + if (soap->error == SOAP_TAG_MISMATCH) + soap->error = soap_ignore_element(soap); + if (soap->error == SOAP_NO_TAG) + break; + if (soap->error) + return NULL; + } + if (soap_element_end_in(soap, tag)) + return NULL; + } + else + { a = (_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO, SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO, sizeof(_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO), 0, soap_finsert, soap_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC1 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO * SOAP_FMAC2 soap_instantiate__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "soap_instantiate__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(%p, %d, %s, %s)\n", (void*)soap, n, type?type:"", arrayType?arrayType:"")); + (void)type; (void)arrayType; /* appease -Wall -Werror */ + _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO *p; + size_t k = sizeof(_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO); + struct soap_clist *cp = soap_link(soap, SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO, n, soap_fdelete); + if (!cp && soap && n != SOAP_NO_LINK_TO_DELETE) + return NULL; + if (n < 0) + { p = SOAP_NEW(soap, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO); + } + else + { p = SOAP_NEW_ARRAY(soap, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO, n); + k *= n; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO location=%p n=%d\n", (void*)p, n)); + if (size) + *size = k; + if (!p) + soap->error = SOAP_EOM; + else if (cp) + cp->ptr = (void*)p; + return p; +} + +int _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO::soap_put(struct soap *soap, const char *tag, const char *type) const +{ + if (soap_out__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(soap, tag ? tag : "ns1:DT_FACTORY_NUMBER_RSP-RSP_BASEINFO", -2, this, type)) + return soap->error; + return soap_putindependent(soap); +} + +void *_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO::soap_get(struct soap *soap, const char *tag, const char *type) +{ + return soap_get__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(soap, this, tag, type); +} + +SOAP_FMAC3 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO * SOAP_FMAC4 soap_get__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(struct soap *soap, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO *p, const char *tag, const char *type) +{ + if ((p = soap_in__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +void ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ::soap_default(struct soap *soap) +{ + this->soap = soap; + this->ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ::BASEINFO = NULL; + this->ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ::ITEMS = NULL; +} + +void ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ::soap_serialize(struct soap *soap) const +{ + (void)soap; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + soap_serialize_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(soap, &this->ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ::BASEINFO); + soap_serialize_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(soap, &this->ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ::ITEMS); +#endif +} + +int ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ::soap_out(struct soap *soap, const char *tag, int id, const char *type) const +{ + return soap_out_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(soap, tag, id, this, type); +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(struct soap *soap, const char *tag, int id, const ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ *a, const char *type) +{ + (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ), type)) + return soap->error; + if (soap_out_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(soap, "BASEINFO", -1, &a->ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ::BASEINFO, "")) + return soap->error; + if (soap_out_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(soap, "ITEMS", -1, &a->ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ::ITEMS, "")) + return soap->error; + return soap_element_end_out(soap, tag); +} + +void *ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ::soap_in(struct soap *soap, const char *tag, const char *type) +{ + return soap_in_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(soap, tag, this, type); +} + +SOAP_FMAC3 ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ * SOAP_FMAC4 soap_in_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(struct soap *soap, const char *tag, ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ *a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; + a = (ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ*)soap_id_enter(soap, soap->id, a, SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ, sizeof(ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ), soap->type, soap->arrayType, soap_instantiate, soap_fbase); + if (!a) + return NULL; + if (soap->alloced && soap->alloced != SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ) + { soap_revert(soap); + *soap->id = '\0'; + return (ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ *)a->soap_in(soap, tag, type); + } + if (soap->alloced) + a->soap_default(soap); + size_t soap_flag_BASEINFO1 = 1; + size_t soap_flag_ITEMS1 = 1; + if (soap->body && *soap->href != '#') + { + for (;;) + { soap->error = SOAP_TAG_MISMATCH; + if (soap_flag_BASEINFO1 && soap->error == SOAP_TAG_MISMATCH) + { if (soap_in_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(soap, "BASEINFO", &a->ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ::BASEINFO, "")) + { soap_flag_BASEINFO1--; + continue; + } + } + if (soap_flag_ITEMS1 && soap->error == SOAP_TAG_MISMATCH) + { if (soap_in_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(soap, "ITEMS", &a->ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ::ITEMS, "")) + { soap_flag_ITEMS1--; + continue; + } + } + if (soap->error == SOAP_TAG_MISMATCH) + soap->error = soap_ignore_element(soap); + if (soap->error == SOAP_NO_TAG) + break; + if (soap->error) + return NULL; + } + if (soap_element_end_in(soap, tag)) + return NULL; + } + else + { a = (ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ, SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ, sizeof(ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ), 0, soap_finsert, soap_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC1 ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ * SOAP_FMAC2 soap_instantiate_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "soap_instantiate_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(%p, %d, %s, %s)\n", (void*)soap, n, type?type:"", arrayType?arrayType:"")); + (void)type; (void)arrayType; /* appease -Wall -Werror */ + ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ *p; + size_t k = sizeof(ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ); + struct soap_clist *cp = soap_link(soap, SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ, n, soap_fdelete); + if (!cp && soap && n != SOAP_NO_LINK_TO_DELETE) + return NULL; + if (n < 0) + { p = SOAP_NEW(soap, ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ); + if (p) + p->soap = soap; + } + else + { p = SOAP_NEW_ARRAY(soap, ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ, n); + k *= n; + if (p) + for (int i = 0; i < n; i++) + p[i].soap = soap; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ location=%p n=%d\n", (void*)p, n)); + if (size) + *size = k; + if (!p) + soap->error = SOAP_EOM; + else if (cp) + cp->ptr = (void*)p; + return p; +} + +int ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ::soap_put(struct soap *soap, const char *tag, const char *type) const +{ + if (soap_out_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(soap, tag ? tag : "ns1:DT_FACTORY_NUMBER_REQ", -2, this, type)) + return soap->error; + return soap_putindependent(soap); +} + +void *ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ::soap_get(struct soap *soap, const char *tag, const char *type) +{ + return soap_get_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(soap, this, tag, type); +} + +SOAP_FMAC3 ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ * SOAP_FMAC4 soap_get_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(struct soap *soap, ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ *p, const char *tag, const char *type) +{ + if ((p = soap_in_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +void ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP::soap_default(struct soap *soap) +{ + this->soap = soap; + this->ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP::RSP_USCOREBASEINFO = NULL; + this->ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP::__sizeZTABLE_USCORERETURN = 0; + this->ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP::ZTABLE_USCORERETURN = NULL; +} + +void ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP::soap_serialize(struct soap *soap) const +{ + (void)soap; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + soap_serialize_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(soap, &this->ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP::RSP_USCOREBASEINFO); + if (this->ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP::ZTABLE_USCORERETURN) + { int i; + for (i = 0; i < (int)this->ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP::__sizeZTABLE_USCORERETURN; i++) + { + soap_embedded(soap, this->ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP::ZTABLE_USCORERETURN + i, SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN); + this->ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP::ZTABLE_USCORERETURN[i].soap_serialize(soap); + } + } +#endif +} + +int ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP::soap_out(struct soap *soap, const char *tag, int id, const char *type) const +{ + return soap_out_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP(soap, tag, id, this, type); +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP(struct soap *soap, const char *tag, int id, const ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP *a, const char *type) +{ + (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP), type)) + return soap->error; + if (soap_out_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(soap, "RSP_BASEINFO", -1, &a->ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP::RSP_USCOREBASEINFO, "")) + return soap->error; + if (a->ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP::ZTABLE_USCORERETURN) + { int i; + for (i = 0; i < (int)a->ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP::__sizeZTABLE_USCORERETURN; i++) + if (a->ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP::ZTABLE_USCORERETURN[i].soap_out(soap, "ZTABLE_RETURN", -1, "")) + return soap->error; + } + return soap_element_end_out(soap, tag); +} + +void *ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP::soap_in(struct soap *soap, const char *tag, const char *type) +{ + return soap_in_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP(soap, tag, this, type); +} + +SOAP_FMAC3 ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP * SOAP_FMAC4 soap_in_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP(struct soap *soap, const char *tag, ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP *a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; + a = (ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP*)soap_id_enter(soap, soap->id, a, SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP, sizeof(ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP), soap->type, soap->arrayType, soap_instantiate, soap_fbase); + if (!a) + return NULL; + if (soap->alloced && soap->alloced != SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP) + { soap_revert(soap); + *soap->id = '\0'; + return (ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP *)a->soap_in(soap, tag, type); + } + if (soap->alloced) + a->soap_default(soap); + size_t soap_flag_RSP_USCOREBASEINFO1 = 1; + struct soap_blist *soap_blist_ZTABLE_USCORERETURN1 = NULL; + if (soap->body && *soap->href != '#') + { + for (;;) + { soap->error = SOAP_TAG_MISMATCH; + if (soap_flag_RSP_USCOREBASEINFO1 && soap->error == SOAP_TAG_MISMATCH) + { if (soap_in_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(soap, "RSP_BASEINFO", &a->ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP::RSP_USCOREBASEINFO, "")) + { soap_flag_RSP_USCOREBASEINFO1--; + continue; + } + } + if (soap->error == SOAP_TAG_MISMATCH && !soap_element_begin_in(soap, "ZTABLE_RETURN", 1, NULL)) + { if (a->ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP::ZTABLE_USCORERETURN == NULL) + { if (soap_blist_ZTABLE_USCORERETURN1 == NULL) + soap_blist_ZTABLE_USCORERETURN1 = soap_alloc_block(soap); + a->ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP::ZTABLE_USCORERETURN = soap_block<_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN>::push(soap, soap_blist_ZTABLE_USCORERETURN1); + if (a->ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP::ZTABLE_USCORERETURN == NULL) + return NULL; + a->ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP::ZTABLE_USCORERETURN->soap_default(soap); + } + soap_revert(soap); + if (soap_in__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(soap, "ZTABLE_RETURN", a->ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP::ZTABLE_USCORERETURN, "")) + { a->ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP::__sizeZTABLE_USCORERETURN++; + a->ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP::ZTABLE_USCORERETURN = NULL; + continue; + } + } + if (soap->error == SOAP_TAG_MISMATCH) + soap->error = soap_ignore_element(soap); + if (soap->error == SOAP_NO_TAG) + break; + if (soap->error) + return NULL; + } + if (a->ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP::ZTABLE_USCORERETURN) + soap_block<_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN>::pop(soap, soap_blist_ZTABLE_USCORERETURN1); + if (a->ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP::__sizeZTABLE_USCORERETURN) + { a->ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP::ZTABLE_USCORERETURN = soap_new__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(soap, a->ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP::__sizeZTABLE_USCORERETURN); + if (!a->ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP::ZTABLE_USCORERETURN) + return NULL; + soap_block<_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN>::save(soap, soap_blist_ZTABLE_USCORERETURN1, a->ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP::ZTABLE_USCORERETURN); + } + else + { a->ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP::ZTABLE_USCORERETURN = NULL; + if (soap_blist_ZTABLE_USCORERETURN1) + soap_block<_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN>::end(soap, soap_blist_ZTABLE_USCORERETURN1); + } + if (soap_element_end_in(soap, tag)) + return NULL; + } + else + { a = (ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP, SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP, sizeof(ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP), 0, soap_finsert, soap_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC1 ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP * SOAP_FMAC2 soap_instantiate_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "soap_instantiate_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP(%p, %d, %s, %s)\n", (void*)soap, n, type?type:"", arrayType?arrayType:"")); + (void)type; (void)arrayType; /* appease -Wall -Werror */ + ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP *p; + size_t k = sizeof(ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP); + struct soap_clist *cp = soap_link(soap, SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP, n, soap_fdelete); + if (!cp && soap && n != SOAP_NO_LINK_TO_DELETE) + return NULL; + if (n < 0) + { p = SOAP_NEW(soap, ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP); + if (p) + p->soap = soap; + } + else + { p = SOAP_NEW_ARRAY(soap, ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP, n); + k *= n; + if (p) + for (int i = 0; i < n; i++) + p[i].soap = soap; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP location=%p n=%d\n", (void*)p, n)); + if (size) + *size = k; + if (!p) + soap->error = SOAP_EOM; + else if (cp) + cp->ptr = (void*)p; + return p; +} + +int ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP::soap_put(struct soap *soap, const char *tag, const char *type) const +{ + if (soap_out_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP(soap, tag ? tag : "ns1:DT_FACTORY_NUMBER_RSP", -2, this, type)) + return soap->error; + return soap_putindependent(soap); +} + +void *ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP::soap_get(struct soap *soap, const char *tag, const char *type) +{ + return soap_get_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP(soap, this, tag, type); +} + +SOAP_FMAC3 ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP * SOAP_FMAC4 soap_get_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP(struct soap *soap, ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP *p, const char *tag, const char *type) +{ + if ((p = soap_in_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +void _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM::soap_default(struct soap *soap) +{ + (void)soap; /* appease -Wall -Werror */ + soap_default_string(soap, &this->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM::VORNR); + soap_default_string(soap, &this->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM::ARBPL); + soap_default_string(soap, &this->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM::STEUS); + soap_default_string(soap, &this->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM::LTXA1); + soap_default_string(soap, &this->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM::USR00); + soap_default_string(soap, &this->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM::BMSCH); + soap_default_string(soap, &this->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM::PLNME); + soap_default_string(soap, &this->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM::VGW01); + soap_default_string(soap, &this->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM::VGE01); + soap_default_string(soap, &this->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM::VGW02); + soap_default_string(soap, &this->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM::VGE02); + soap_default_string(soap, &this->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM::VGW05); + soap_default_string(soap, &this->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM::VGE05); +} + +void _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM::soap_serialize(struct soap *soap) const +{ + (void)soap; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + soap_serialize_string(soap, (char*const*)&this->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM::VORNR); + soap_serialize_string(soap, (char*const*)&this->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM::ARBPL); + soap_serialize_string(soap, (char*const*)&this->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM::STEUS); + soap_serialize_string(soap, (char*const*)&this->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM::LTXA1); + soap_serialize_string(soap, (char*const*)&this->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM::USR00); + soap_serialize_string(soap, (char*const*)&this->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM::BMSCH); + soap_serialize_string(soap, (char*const*)&this->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM::PLNME); + soap_serialize_string(soap, (char*const*)&this->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM::VGW01); + soap_serialize_string(soap, (char*const*)&this->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM::VGE01); + soap_serialize_string(soap, (char*const*)&this->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM::VGW02); + soap_serialize_string(soap, (char*const*)&this->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM::VGE02); + soap_serialize_string(soap, (char*const*)&this->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM::VGW05); + soap_serialize_string(soap, (char*const*)&this->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM::VGE05); +#endif +} + +int _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM::soap_out(struct soap *soap, const char *tag, int id, const char *type) const +{ + return soap_out__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM(soap, tag, id, this, type); +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM(struct soap *soap, const char *tag, int id, const _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM *a, const char *type) +{ + (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM), type)) + return soap->error; + if (soap_out_string(soap, "VORNR", -1, (char*const*)&a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM::VORNR, "")) + return soap->error; + if (soap_out_string(soap, "ARBPL", -1, (char*const*)&a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM::ARBPL, "")) + return soap->error; + if (soap_out_string(soap, "STEUS", -1, (char*const*)&a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM::STEUS, "")) + return soap->error; + if (soap_out_string(soap, "LTXA1", -1, (char*const*)&a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM::LTXA1, "")) + return soap->error; + if (soap_out_string(soap, "USR00", -1, (char*const*)&a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM::USR00, "")) + return soap->error; + if (!a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM::BMSCH) + { if (soap_element_empty(soap, "BMSCH", 0, NULL)) + return soap->error; + } + else if (soap_out_string(soap, "BMSCH", -1, (char*const*)&a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM::BMSCH, "")) + return soap->error; + if (soap_out_string(soap, "PLNME", -1, (char*const*)&a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM::PLNME, "")) + return soap->error; + if (!a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM::VGW01) + { if (soap_element_empty(soap, "VGW01", 0, NULL)) + return soap->error; + } + else if (soap_out_string(soap, "VGW01", -1, (char*const*)&a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM::VGW01, "")) + return soap->error; + if (!a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM::VGE01) + { if (soap_element_empty(soap, "VGE01", 0, NULL)) + return soap->error; + } + else if (soap_out_string(soap, "VGE01", -1, (char*const*)&a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM::VGE01, "")) + return soap->error; + if (!a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM::VGW02) + { if (soap_element_empty(soap, "VGW02", 0, NULL)) + return soap->error; + } + else if (soap_out_string(soap, "VGW02", -1, (char*const*)&a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM::VGW02, "")) + return soap->error; + if (!a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM::VGE02) + { if (soap_element_empty(soap, "VGE02", 0, NULL)) + return soap->error; + } + else if (soap_out_string(soap, "VGE02", -1, (char*const*)&a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM::VGE02, "")) + return soap->error; + if (soap_out_string(soap, "VGW05", -1, (char*const*)&a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM::VGW05, "")) + return soap->error; + if (soap_out_string(soap, "VGE05", -1, (char*const*)&a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM::VGE05, "")) + return soap->error; + return soap_element_end_out(soap, tag); +} + +void *_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM::soap_in(struct soap *soap, const char *tag, const char *type) +{ + return soap_in__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM(soap, tag, this, type); +} + +SOAP_FMAC3 _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM * SOAP_FMAC4 soap_in__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM(struct soap *soap, const char *tag, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM *a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; + a = (_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM*)soap_id_enter(soap, soap->id, a, SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM, sizeof(_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM), soap->type, soap->arrayType, soap_instantiate, soap_fbase); + if (!a) + return NULL; + if (soap->alloced && soap->alloced != SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM) + { soap_revert(soap); + *soap->id = '\0'; + return (_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM *)a->soap_in(soap, tag, type); + } + if (soap->alloced) + a->soap_default(soap); + size_t soap_flag_VORNR1 = 1; + size_t soap_flag_ARBPL1 = 1; + size_t soap_flag_STEUS1 = 1; + size_t soap_flag_LTXA11 = 1; + size_t soap_flag_USR001 = 1; + size_t soap_flag_BMSCH1 = 1; + size_t soap_flag_PLNME1 = 1; + size_t soap_flag_VGW011 = 1; + size_t soap_flag_VGE011 = 1; + size_t soap_flag_VGW021 = 1; + size_t soap_flag_VGE021 = 1; + size_t soap_flag_VGW051 = 1; + size_t soap_flag_VGE051 = 1; + if (soap->body && *soap->href != '#') + { + for (;;) + { soap->error = SOAP_TAG_MISMATCH; + if (soap_flag_VORNR1 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_string(soap, "VORNR", (char**)&a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM::VORNR, "xsd:string")) + { soap_flag_VORNR1--; + continue; + } + } + if (soap_flag_ARBPL1 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_string(soap, "ARBPL", (char**)&a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM::ARBPL, "xsd:string")) + { soap_flag_ARBPL1--; + continue; + } + } + if (soap_flag_STEUS1 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_string(soap, "STEUS", (char**)&a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM::STEUS, "xsd:string")) + { soap_flag_STEUS1--; + continue; + } + } + if (soap_flag_LTXA11 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_string(soap, "LTXA1", (char**)&a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM::LTXA1, "xsd:string")) + { soap_flag_LTXA11--; + continue; + } + } + if (soap_flag_USR001 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_string(soap, "USR00", (char**)&a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM::USR00, "xsd:string")) + { soap_flag_USR001--; + continue; + } + } + if (soap_flag_BMSCH1 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_string(soap, "BMSCH", (char**)&a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM::BMSCH, "xsd:string")) + { soap_flag_BMSCH1--; + continue; + } + } + if (soap_flag_PLNME1 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_string(soap, "PLNME", (char**)&a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM::PLNME, "xsd:string")) + { soap_flag_PLNME1--; + continue; + } + } + if (soap_flag_VGW011 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_string(soap, "VGW01", (char**)&a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM::VGW01, "xsd:string")) + { soap_flag_VGW011--; + continue; + } + } + if (soap_flag_VGE011 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_string(soap, "VGE01", (char**)&a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM::VGE01, "xsd:string")) + { soap_flag_VGE011--; + continue; + } + } + if (soap_flag_VGW021 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_string(soap, "VGW02", (char**)&a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM::VGW02, "xsd:string")) + { soap_flag_VGW021--; + continue; + } + } + if (soap_flag_VGE021 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_string(soap, "VGE02", (char**)&a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM::VGE02, "xsd:string")) + { soap_flag_VGE021--; + continue; + } + } + if (soap_flag_VGW051 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_string(soap, "VGW05", (char**)&a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM::VGW05, "xsd:string")) + { soap_flag_VGW051--; + continue; + } + } + if (soap_flag_VGE051 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_string(soap, "VGE05", (char**)&a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM::VGE05, "xsd:string")) + { soap_flag_VGE051--; + continue; + } + } + if (soap->error == SOAP_TAG_MISMATCH) + soap->error = soap_ignore_element(soap); + if (soap->error == SOAP_NO_TAG) + break; + if (soap->error) + return NULL; + } + if (soap_element_end_in(soap, tag)) + return NULL; + if ((soap->mode & SOAP_XML_STRICT) && (!a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM::BMSCH || !a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM::VGW01 || !a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM::VGE01 || !a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM::VGW02 || !a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM::VGE02)) + { soap->error = SOAP_OCCURS; + return NULL; + } + } + else if ((soap->mode & SOAP_XML_STRICT) && *soap->href != '#') + { soap->error = SOAP_OCCURS; + return NULL; + } + else + { a = (_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM, SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM, sizeof(_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM), 0, soap_finsert, soap_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC1 _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM * SOAP_FMAC2 soap_instantiate__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "soap_instantiate__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM(%p, %d, %s, %s)\n", (void*)soap, n, type?type:"", arrayType?arrayType:"")); + (void)type; (void)arrayType; /* appease -Wall -Werror */ + _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM *p; + size_t k = sizeof(_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM); + struct soap_clist *cp = soap_link(soap, SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM, n, soap_fdelete); + if (!cp && soap && n != SOAP_NO_LINK_TO_DELETE) + return NULL; + if (n < 0) + { p = SOAP_NEW(soap, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM); + } + else + { p = SOAP_NEW_ARRAY(soap, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM, n); + k *= n; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM location=%p n=%d\n", (void*)p, n)); + if (size) + *size = k; + if (!p) + soap->error = SOAP_EOM; + else if (cp) + cp->ptr = (void*)p; + return p; +} + +int _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM::soap_put(struct soap *soap, const char *tag, const char *type) const +{ + if (soap_out__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM(soap, tag ? tag : "ns1:DT_PROCESSROUTE_S4_REQ-LIST-ITEMS-ITEM-SUBITEMS-SUBITEM", -2, this, type)) + return soap->error; + return soap_putindependent(soap); +} + +void *_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM::soap_get(struct soap *soap, const char *tag, const char *type) +{ + return soap_get__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM(soap, this, tag, type); +} + +SOAP_FMAC3 _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM * SOAP_FMAC4 soap_get__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM(struct soap *soap, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM *p, const char *tag, const char *type) +{ + if ((p = soap_in__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +void _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS::soap_default(struct soap *soap) +{ + (void)soap; /* appease -Wall -Werror */ + this->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS::__sizeSUBITEM = 0; + this->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS::SUBITEM = NULL; +} + +void _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS::soap_serialize(struct soap *soap) const +{ + (void)soap; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + if (this->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS::SUBITEM) + { int i; + for (i = 0; i < (int)this->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS::__sizeSUBITEM; i++) + { + soap_embedded(soap, this->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS::SUBITEM + i, SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM); + this->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS::SUBITEM[i].soap_serialize(soap); + } + } +#endif +} + +int _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS::soap_out(struct soap *soap, const char *tag, int id, const char *type) const +{ + return soap_out__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS(soap, tag, id, this, type); +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS(struct soap *soap, const char *tag, int id, const _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS *a, const char *type) +{ + (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS), type)) + return soap->error; + if (a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS::SUBITEM) + { int i; + for (i = 0; i < (int)a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS::__sizeSUBITEM; i++) + if (a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS::SUBITEM[i].soap_out(soap, "SUBITEM", -1, "")) + return soap->error; + } + return soap_element_end_out(soap, tag); +} + +void *_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS::soap_in(struct soap *soap, const char *tag, const char *type) +{ + return soap_in__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS(soap, tag, this, type); +} + +SOAP_FMAC3 _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS * SOAP_FMAC4 soap_in__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS(struct soap *soap, const char *tag, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS *a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; + a = (_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS*)soap_id_enter(soap, soap->id, a, SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS, sizeof(_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS), soap->type, soap->arrayType, soap_instantiate, soap_fbase); + if (!a) + return NULL; + if (soap->alloced && soap->alloced != SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS) + { soap_revert(soap); + *soap->id = '\0'; + return (_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS *)a->soap_in(soap, tag, type); + } + if (soap->alloced) + a->soap_default(soap); + struct soap_blist *soap_blist_SUBITEM1 = NULL; + if (soap->body && *soap->href != '#') + { + for (;;) + { soap->error = SOAP_TAG_MISMATCH; + if (soap->error == SOAP_TAG_MISMATCH && !soap_element_begin_in(soap, "SUBITEM", 1, NULL)) + { if (a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS::SUBITEM == NULL) + { if (soap_blist_SUBITEM1 == NULL) + soap_blist_SUBITEM1 = soap_alloc_block(soap); + a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS::SUBITEM = soap_block<_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM>::push(soap, soap_blist_SUBITEM1); + if (a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS::SUBITEM == NULL) + return NULL; + a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS::SUBITEM->soap_default(soap); + } + soap_revert(soap); + if (soap_in__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM(soap, "SUBITEM", a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS::SUBITEM, "")) + { a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS::__sizeSUBITEM++; + a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS::SUBITEM = NULL; + continue; + } + } + if (soap->error == SOAP_TAG_MISMATCH) + soap->error = soap_ignore_element(soap); + if (soap->error == SOAP_NO_TAG) + break; + if (soap->error) + return NULL; + } + if (a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS::SUBITEM) + soap_block<_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM>::pop(soap, soap_blist_SUBITEM1); + if (a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS::__sizeSUBITEM) + { a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS::SUBITEM = soap_new__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM(soap, a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS::__sizeSUBITEM); + if (!a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS::SUBITEM) + return NULL; + soap_block<_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM>::save(soap, soap_blist_SUBITEM1, a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS::SUBITEM); + } + else + { a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS::SUBITEM = NULL; + if (soap_blist_SUBITEM1) + soap_block<_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM>::end(soap, soap_blist_SUBITEM1); + } + if (soap_element_end_in(soap, tag)) + return NULL; + } + else + { a = (_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS, SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS, sizeof(_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS), 0, soap_finsert, soap_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC1 _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS * SOAP_FMAC2 soap_instantiate__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "soap_instantiate__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS(%p, %d, %s, %s)\n", (void*)soap, n, type?type:"", arrayType?arrayType:"")); + (void)type; (void)arrayType; /* appease -Wall -Werror */ + _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS *p; + size_t k = sizeof(_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS); + struct soap_clist *cp = soap_link(soap, SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS, n, soap_fdelete); + if (!cp && soap && n != SOAP_NO_LINK_TO_DELETE) + return NULL; + if (n < 0) + { p = SOAP_NEW(soap, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS); + } + else + { p = SOAP_NEW_ARRAY(soap, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS, n); + k *= n; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS location=%p n=%d\n", (void*)p, n)); + if (size) + *size = k; + if (!p) + soap->error = SOAP_EOM; + else if (cp) + cp->ptr = (void*)p; + return p; +} + +int _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS::soap_put(struct soap *soap, const char *tag, const char *type) const +{ + if (soap_out__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS(soap, tag ? tag : "ns1:DT_PROCESSROUTE_S4_REQ-LIST-ITEMS-ITEM-SUBITEMS", -2, this, type)) + return soap->error; + return soap_putindependent(soap); +} + +void *_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS::soap_get(struct soap *soap, const char *tag, const char *type) +{ + return soap_get__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS(soap, this, tag, type); +} + +SOAP_FMAC3 _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS * SOAP_FMAC4 soap_get__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS(struct soap *soap, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS *p, const char *tag, const char *type) +{ + if ((p = soap_in__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +void _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::soap_default(struct soap *soap) +{ + (void)soap; /* appease -Wall -Werror */ + soap_default_string(soap, &this->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::PLNAL); + soap_default_string(soap, &this->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::PLNFL); + soap_default_string(soap, &this->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::DATUV); + soap_default_string(soap, &this->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::FLGAT); + soap_default_string(soap, &this->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::BEZFL); + soap_default_string(soap, &this->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::LTXA1); + soap_default_string(soap, &this->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::VORNR1); + soap_default_string(soap, &this->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::VORNR2); + this->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::SUBITEMS._ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS::soap_default(soap); +} + +void _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::soap_serialize(struct soap *soap) const +{ + (void)soap; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + soap_serialize_string(soap, (char*const*)&this->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::PLNAL); + soap_serialize_string(soap, (char*const*)&this->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::PLNFL); + soap_serialize_string(soap, (char*const*)&this->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::DATUV); + soap_serialize_string(soap, (char*const*)&this->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::FLGAT); + soap_serialize_string(soap, (char*const*)&this->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::BEZFL); + soap_serialize_string(soap, (char*const*)&this->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::LTXA1); + soap_serialize_string(soap, (char*const*)&this->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::VORNR1); + soap_serialize_string(soap, (char*const*)&this->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::VORNR2); + this->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::SUBITEMS.soap_serialize(soap); +#endif +} + +int _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::soap_out(struct soap *soap, const char *tag, int id, const char *type) const +{ + return soap_out__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(soap, tag, id, this, type); +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(struct soap *soap, const char *tag, int id, const _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM *a, const char *type) +{ + (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM), type)) + return soap->error; + if (soap_out_string(soap, "PLNAL", -1, (char*const*)&a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::PLNAL, "")) + return soap->error; + if (soap_out_string(soap, "PLNFL", -1, (char*const*)&a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::PLNFL, "")) + return soap->error; + if (soap_out_string(soap, "DATUV", -1, (char*const*)&a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::DATUV, "")) + return soap->error; + if (soap_out_string(soap, "FLGAT", -1, (char*const*)&a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::FLGAT, "")) + return soap->error; + if (soap_out_string(soap, "BEZFL", -1, (char*const*)&a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::BEZFL, "")) + return soap->error; + if (soap_out_string(soap, "LTXA1", -1, (char*const*)&a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::LTXA1, "")) + return soap->error; + if (soap_out_string(soap, "VORNR1", -1, (char*const*)&a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::VORNR1, "")) + return soap->error; + if (soap_out_string(soap, "VORNR2", -1, (char*const*)&a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::VORNR2, "")) + return soap->error; + if ((a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::SUBITEMS).soap_out(soap, "SUBITEMS", -1, "")) + return soap->error; + return soap_element_end_out(soap, tag); +} + +void *_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::soap_in(struct soap *soap, const char *tag, const char *type) +{ + return soap_in__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(soap, tag, this, type); +} + +SOAP_FMAC3 _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM * SOAP_FMAC4 soap_in__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(struct soap *soap, const char *tag, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM *a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; + a = (_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM*)soap_id_enter(soap, soap->id, a, SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM, sizeof(_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM), soap->type, soap->arrayType, soap_instantiate, soap_fbase); + if (!a) + return NULL; + if (soap->alloced && soap->alloced != SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM) + { soap_revert(soap); + *soap->id = '\0'; + return (_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM *)a->soap_in(soap, tag, type); + } + if (soap->alloced) + a->soap_default(soap); + size_t soap_flag_PLNAL1 = 1; + size_t soap_flag_PLNFL1 = 1; + size_t soap_flag_DATUV1 = 1; + size_t soap_flag_FLGAT1 = 1; + size_t soap_flag_BEZFL1 = 1; + size_t soap_flag_LTXA11 = 1; + size_t soap_flag_VORNR11 = 1; + size_t soap_flag_VORNR21 = 1; + size_t soap_flag_SUBITEMS1 = 1; + if (soap->body && *soap->href != '#') + { + for (;;) + { soap->error = SOAP_TAG_MISMATCH; + if (soap_flag_PLNAL1 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_string(soap, "PLNAL", (char**)&a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::PLNAL, "xsd:string")) + { soap_flag_PLNAL1--; + continue; + } + } + if (soap_flag_PLNFL1 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_string(soap, "PLNFL", (char**)&a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::PLNFL, "xsd:string")) + { soap_flag_PLNFL1--; + continue; + } + } + if (soap_flag_DATUV1 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_string(soap, "DATUV", (char**)&a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::DATUV, "xsd:string")) + { soap_flag_DATUV1--; + continue; + } + } + if (soap_flag_FLGAT1 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_string(soap, "FLGAT", (char**)&a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::FLGAT, "xsd:string")) + { soap_flag_FLGAT1--; + continue; + } + } + if (soap_flag_BEZFL1 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_string(soap, "BEZFL", (char**)&a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::BEZFL, "xsd:string")) + { soap_flag_BEZFL1--; + continue; + } + } + if (soap_flag_LTXA11 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_string(soap, "LTXA1", (char**)&a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::LTXA1, "xsd:string")) + { soap_flag_LTXA11--; + continue; + } + } + if (soap_flag_VORNR11 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_string(soap, "VORNR1", (char**)&a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::VORNR1, "xsd:string")) + { soap_flag_VORNR11--; + continue; + } + } + if (soap_flag_VORNR21 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_string(soap, "VORNR2", (char**)&a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::VORNR2, "xsd:string")) + { soap_flag_VORNR21--; + continue; + } + } + if (soap_flag_SUBITEMS1 && soap->error == SOAP_TAG_MISMATCH) + { if ((a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::SUBITEMS).soap_in(soap, "SUBITEMS", "")) + { soap_flag_SUBITEMS1--; + continue; + } + } + if (soap->error == SOAP_TAG_MISMATCH) + soap->error = soap_ignore_element(soap); + if (soap->error == SOAP_NO_TAG) + break; + if (soap->error) + return NULL; + } + if (soap_element_end_in(soap, tag)) + return NULL; + if ((soap->mode & SOAP_XML_STRICT) && (soap_flag_SUBITEMS1 > 0)) + { soap->error = SOAP_OCCURS; + return NULL; + } + } + else if ((soap->mode & SOAP_XML_STRICT) && *soap->href != '#') + { soap->error = SOAP_OCCURS; + return NULL; + } + else + { a = (_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM, SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM, sizeof(_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM), 0, soap_finsert, soap_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC1 _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM * SOAP_FMAC2 soap_instantiate__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "soap_instantiate__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(%p, %d, %s, %s)\n", (void*)soap, n, type?type:"", arrayType?arrayType:"")); + (void)type; (void)arrayType; /* appease -Wall -Werror */ + _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM *p; + size_t k = sizeof(_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM); + struct soap_clist *cp = soap_link(soap, SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM, n, soap_fdelete); + if (!cp && soap && n != SOAP_NO_LINK_TO_DELETE) + return NULL; + if (n < 0) + { p = SOAP_NEW(soap, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM); + } + else + { p = SOAP_NEW_ARRAY(soap, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM, n); + k *= n; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM location=%p n=%d\n", (void*)p, n)); + if (size) + *size = k; + if (!p) + soap->error = SOAP_EOM; + else if (cp) + cp->ptr = (void*)p; + return p; +} + +int _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::soap_put(struct soap *soap, const char *tag, const char *type) const +{ + if (soap_out__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(soap, tag ? tag : "ns1:DT_PROCESSROUTE_S4_REQ-LIST-ITEMS-ITEM", -2, this, type)) + return soap->error; + return soap_putindependent(soap); +} + +void *_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::soap_get(struct soap *soap, const char *tag, const char *type) +{ + return soap_get__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(soap, this, tag, type); +} + +SOAP_FMAC3 _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM * SOAP_FMAC4 soap_get__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(struct soap *soap, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM *p, const char *tag, const char *type) +{ + if ((p = soap_in__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +void _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS::soap_default(struct soap *soap) +{ + (void)soap; /* appease -Wall -Werror */ + this->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS::__sizeITEM = 0; + this->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS::ITEM = NULL; +} + +void _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS::soap_serialize(struct soap *soap) const +{ + (void)soap; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + if (this->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS::ITEM) + { int i; + for (i = 0; i < (int)this->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS::__sizeITEM; i++) + { + soap_embedded(soap, this->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS::ITEM + i, SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM); + this->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS::ITEM[i].soap_serialize(soap); + } + } +#endif +} + +int _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS::soap_out(struct soap *soap, const char *tag, int id, const char *type) const +{ + return soap_out__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS(soap, tag, id, this, type); +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS(struct soap *soap, const char *tag, int id, const _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS *a, const char *type) +{ + (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS), type)) + return soap->error; + if (a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS::ITEM) + { int i; + for (i = 0; i < (int)a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS::__sizeITEM; i++) + if (a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS::ITEM[i].soap_out(soap, "ITEM", -1, "")) + return soap->error; + } + return soap_element_end_out(soap, tag); +} + +void *_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS::soap_in(struct soap *soap, const char *tag, const char *type) +{ + return soap_in__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS(soap, tag, this, type); +} + +SOAP_FMAC3 _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS * SOAP_FMAC4 soap_in__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS(struct soap *soap, const char *tag, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS *a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; + a = (_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS*)soap_id_enter(soap, soap->id, a, SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS, sizeof(_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS), soap->type, soap->arrayType, soap_instantiate, soap_fbase); + if (!a) + return NULL; + if (soap->alloced && soap->alloced != SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS) + { soap_revert(soap); + *soap->id = '\0'; + return (_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS *)a->soap_in(soap, tag, type); + } + if (soap->alloced) + a->soap_default(soap); + struct soap_blist *soap_blist_ITEM1 = NULL; + if (soap->body && *soap->href != '#') + { + for (;;) + { soap->error = SOAP_TAG_MISMATCH; + if (soap->error == SOAP_TAG_MISMATCH && !soap_element_begin_in(soap, "ITEM", 1, NULL)) + { if (a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS::ITEM == NULL) + { if (soap_blist_ITEM1 == NULL) + soap_blist_ITEM1 = soap_alloc_block(soap); + a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS::ITEM = soap_block<_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM>::push(soap, soap_blist_ITEM1); + if (a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS::ITEM == NULL) + return NULL; + a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS::ITEM->soap_default(soap); + } + soap_revert(soap); + if (soap_in__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(soap, "ITEM", a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS::ITEM, "")) + { a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS::__sizeITEM++; + a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS::ITEM = NULL; + continue; + } + } + if (soap->error == SOAP_TAG_MISMATCH) + soap->error = soap_ignore_element(soap); + if (soap->error == SOAP_NO_TAG) + break; + if (soap->error) + return NULL; + } + if (a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS::ITEM) + soap_block<_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM>::pop(soap, soap_blist_ITEM1); + if (a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS::__sizeITEM) + { a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS::ITEM = soap_new__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(soap, a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS::__sizeITEM); + if (!a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS::ITEM) + return NULL; + soap_block<_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM>::save(soap, soap_blist_ITEM1, a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS::ITEM); + } + else + { a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS::ITEM = NULL; + if (soap_blist_ITEM1) + soap_block<_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM>::end(soap, soap_blist_ITEM1); + } + if (soap_element_end_in(soap, tag)) + return NULL; + } + else + { a = (_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS, SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS, sizeof(_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS), 0, soap_finsert, soap_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC1 _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS * SOAP_FMAC2 soap_instantiate__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "soap_instantiate__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS(%p, %d, %s, %s)\n", (void*)soap, n, type?type:"", arrayType?arrayType:"")); + (void)type; (void)arrayType; /* appease -Wall -Werror */ + _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS *p; + size_t k = sizeof(_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS); + struct soap_clist *cp = soap_link(soap, SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS, n, soap_fdelete); + if (!cp && soap && n != SOAP_NO_LINK_TO_DELETE) + return NULL; + if (n < 0) + { p = SOAP_NEW(soap, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS); + } + else + { p = SOAP_NEW_ARRAY(soap, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS, n); + k *= n; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS location=%p n=%d\n", (void*)p, n)); + if (size) + *size = k; + if (!p) + soap->error = SOAP_EOM; + else if (cp) + cp->ptr = (void*)p; + return p; +} + +int _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS::soap_put(struct soap *soap, const char *tag, const char *type) const +{ + if (soap_out__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS(soap, tag ? tag : "ns1:DT_PROCESSROUTE_S4_REQ-LIST-ITEMS", -2, this, type)) + return soap->error; + return soap_putindependent(soap); +} + +void *_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS::soap_get(struct soap *soap, const char *tag, const char *type) +{ + return soap_get__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS(soap, this, tag, type); +} + +SOAP_FMAC3 _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS * SOAP_FMAC4 soap_get__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS(struct soap *soap, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS *p, const char *tag, const char *type) +{ + if ((p = soap_in__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +void _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD::soap_default(struct soap *soap) +{ + (void)soap; /* appease -Wall -Werror */ + soap_default_string(soap, &this->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD::MATNR); + soap_default_string(soap, &this->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD::WERKS); + soap_default_string(soap, &this->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD::VERWE); + soap_default_string(soap, &this->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD::STATU); + soap_default_string(soap, &this->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD::DATUV); + soap_default_string(soap, &this->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD::PLNAL); + soap_default_string(soap, &this->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD::PSPNR); +} + +void _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD::soap_serialize(struct soap *soap) const +{ + (void)soap; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + soap_serialize_string(soap, (char*const*)&this->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD::MATNR); + soap_serialize_string(soap, (char*const*)&this->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD::WERKS); + soap_serialize_string(soap, (char*const*)&this->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD::VERWE); + soap_serialize_string(soap, (char*const*)&this->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD::STATU); + soap_serialize_string(soap, (char*const*)&this->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD::DATUV); + soap_serialize_string(soap, (char*const*)&this->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD::PLNAL); + soap_serialize_string(soap, (char*const*)&this->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD::PSPNR); +#endif +} + +int _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD::soap_out(struct soap *soap, const char *tag, int id, const char *type) const +{ + return soap_out__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD(soap, tag, id, this, type); +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD(struct soap *soap, const char *tag, int id, const _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD *a, const char *type) +{ + (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD), type)) + return soap->error; + if (!a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD::MATNR) + { if (soap_element_empty(soap, "MATNR", 0, NULL)) + return soap->error; + } + else if (soap_out_string(soap, "MATNR", -1, (char*const*)&a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD::MATNR, "")) + return soap->error; + if (!a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD::WERKS) + { if (soap_element_empty(soap, "WERKS", 0, NULL)) + return soap->error; + } + else if (soap_out_string(soap, "WERKS", -1, (char*const*)&a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD::WERKS, "")) + return soap->error; + if (!a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD::VERWE) + { if (soap_element_empty(soap, "VERWE", 0, NULL)) + return soap->error; + } + else if (soap_out_string(soap, "VERWE", -1, (char*const*)&a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD::VERWE, "")) + return soap->error; + if (!a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD::STATU) + { if (soap_element_empty(soap, "STATU", 0, NULL)) + return soap->error; + } + else if (soap_out_string(soap, "STATU", -1, (char*const*)&a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD::STATU, "")) + return soap->error; + if (soap_out_string(soap, "DATUV", -1, (char*const*)&a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD::DATUV, "")) + return soap->error; + if (soap_out_string(soap, "PLNAL", -1, (char*const*)&a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD::PLNAL, "")) + return soap->error; + if (soap_out_string(soap, "PSPNR", -1, (char*const*)&a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD::PSPNR, "")) + return soap->error; + return soap_element_end_out(soap, tag); +} + +void *_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD::soap_in(struct soap *soap, const char *tag, const char *type) +{ + return soap_in__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD(soap, tag, this, type); +} + +SOAP_FMAC3 _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD * SOAP_FMAC4 soap_in__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD(struct soap *soap, const char *tag, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD *a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; + a = (_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD*)soap_id_enter(soap, soap->id, a, SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD, sizeof(_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD), soap->type, soap->arrayType, soap_instantiate, soap_fbase); + if (!a) + return NULL; + if (soap->alloced && soap->alloced != SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD) + { soap_revert(soap); + *soap->id = '\0'; + return (_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD *)a->soap_in(soap, tag, type); + } + if (soap->alloced) + a->soap_default(soap); + size_t soap_flag_MATNR1 = 1; + size_t soap_flag_WERKS1 = 1; + size_t soap_flag_VERWE1 = 1; + size_t soap_flag_STATU1 = 1; + size_t soap_flag_DATUV1 = 1; + size_t soap_flag_PLNAL1 = 1; + size_t soap_flag_PSPNR1 = 1; + if (soap->body && *soap->href != '#') + { + for (;;) + { soap->error = SOAP_TAG_MISMATCH; + if (soap_flag_MATNR1 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_string(soap, "MATNR", (char**)&a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD::MATNR, "xsd:string")) + { soap_flag_MATNR1--; + continue; + } + } + if (soap_flag_WERKS1 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_string(soap, "WERKS", (char**)&a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD::WERKS, "xsd:string")) + { soap_flag_WERKS1--; + continue; + } + } + if (soap_flag_VERWE1 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_string(soap, "VERWE", (char**)&a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD::VERWE, "xsd:string")) + { soap_flag_VERWE1--; + continue; + } + } + if (soap_flag_STATU1 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_string(soap, "STATU", (char**)&a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD::STATU, "xsd:string")) + { soap_flag_STATU1--; + continue; + } + } + if (soap_flag_DATUV1 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_string(soap, "DATUV", (char**)&a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD::DATUV, "xsd:string")) + { soap_flag_DATUV1--; + continue; + } + } + if (soap_flag_PLNAL1 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_string(soap, "PLNAL", (char**)&a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD::PLNAL, "xsd:string")) + { soap_flag_PLNAL1--; + continue; + } + } + if (soap_flag_PSPNR1 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_string(soap, "PSPNR", (char**)&a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD::PSPNR, "xsd:string")) + { soap_flag_PSPNR1--; + continue; + } + } + if (soap->error == SOAP_TAG_MISMATCH) + soap->error = soap_ignore_element(soap); + if (soap->error == SOAP_NO_TAG) + break; + if (soap->error) + return NULL; + } + if (soap_element_end_in(soap, tag)) + return NULL; + if ((soap->mode & SOAP_XML_STRICT) && (!a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD::MATNR || !a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD::WERKS || !a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD::VERWE || !a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD::STATU)) + { soap->error = SOAP_OCCURS; + return NULL; + } + } + else if ((soap->mode & SOAP_XML_STRICT) && *soap->href != '#') + { soap->error = SOAP_OCCURS; + return NULL; + } + else + { a = (_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD, SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD, sizeof(_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD), 0, soap_finsert, soap_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC1 _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD * SOAP_FMAC2 soap_instantiate__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "soap_instantiate__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD(%p, %d, %s, %s)\n", (void*)soap, n, type?type:"", arrayType?arrayType:"")); + (void)type; (void)arrayType; /* appease -Wall -Werror */ + _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD *p; + size_t k = sizeof(_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD); + struct soap_clist *cp = soap_link(soap, SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD, n, soap_fdelete); + if (!cp && soap && n != SOAP_NO_LINK_TO_DELETE) + return NULL; + if (n < 0) + { p = SOAP_NEW(soap, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD); + } + else + { p = SOAP_NEW_ARRAY(soap, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD, n); + k *= n; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD location=%p n=%d\n", (void*)p, n)); + if (size) + *size = k; + if (!p) + soap->error = SOAP_EOM; + else if (cp) + cp->ptr = (void*)p; + return p; +} + +int _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD::soap_put(struct soap *soap, const char *tag, const char *type) const +{ + if (soap_out__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD(soap, tag ? tag : "ns1:DT_PROCESSROUTE_S4_REQ-LIST-HEAD", -2, this, type)) + return soap->error; + return soap_putindependent(soap); +} + +void *_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD::soap_get(struct soap *soap, const char *tag, const char *type) +{ + return soap_get__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD(soap, this, tag, type); +} + +SOAP_FMAC3 _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD * SOAP_FMAC4 soap_get__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD(struct soap *soap, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD *p, const char *tag, const char *type) +{ + if ((p = soap_in__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +void _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST::soap_default(struct soap *soap) +{ + (void)soap; /* appease -Wall -Werror */ + this->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST::HEAD._ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD::soap_default(soap); + this->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST::ITEMS._ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS::soap_default(soap); +} + +void _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST::soap_serialize(struct soap *soap) const +{ + (void)soap; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + this->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST::HEAD.soap_serialize(soap); + this->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST::ITEMS.soap_serialize(soap); +#endif +} + +int _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST::soap_out(struct soap *soap, const char *tag, int id, const char *type) const +{ + return soap_out__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST(soap, tag, id, this, type); +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST(struct soap *soap, const char *tag, int id, const _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST *a, const char *type) +{ + (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST), type)) + return soap->error; + if ((a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST::HEAD).soap_out(soap, "HEAD", -1, "")) + return soap->error; + if ((a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST::ITEMS).soap_out(soap, "ITEMS", -1, "")) + return soap->error; + return soap_element_end_out(soap, tag); +} + +void *_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST::soap_in(struct soap *soap, const char *tag, const char *type) +{ + return soap_in__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST(soap, tag, this, type); +} + +SOAP_FMAC3 _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST * SOAP_FMAC4 soap_in__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST(struct soap *soap, const char *tag, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST *a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; + a = (_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST*)soap_id_enter(soap, soap->id, a, SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST, sizeof(_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST), soap->type, soap->arrayType, soap_instantiate, soap_fbase); + if (!a) + return NULL; + if (soap->alloced && soap->alloced != SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST) + { soap_revert(soap); + *soap->id = '\0'; + return (_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST *)a->soap_in(soap, tag, type); + } + if (soap->alloced) + a->soap_default(soap); + size_t soap_flag_HEAD1 = 1; + size_t soap_flag_ITEMS1 = 1; + if (soap->body && *soap->href != '#') + { + for (;;) + { soap->error = SOAP_TAG_MISMATCH; + if (soap_flag_HEAD1 && soap->error == SOAP_TAG_MISMATCH) + { if ((a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST::HEAD).soap_in(soap, "HEAD", "")) + { soap_flag_HEAD1--; + continue; + } + } + if (soap_flag_ITEMS1 && soap->error == SOAP_TAG_MISMATCH) + { if ((a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST::ITEMS).soap_in(soap, "ITEMS", "")) + { soap_flag_ITEMS1--; + continue; + } + } + if (soap->error == SOAP_TAG_MISMATCH) + soap->error = soap_ignore_element(soap); + if (soap->error == SOAP_NO_TAG) + break; + if (soap->error) + return NULL; + } + if (soap_element_end_in(soap, tag)) + return NULL; + if ((soap->mode & SOAP_XML_STRICT) && (soap_flag_HEAD1 > 0 || soap_flag_ITEMS1 > 0)) + { soap->error = SOAP_OCCURS; + return NULL; + } + } + else if ((soap->mode & SOAP_XML_STRICT) && *soap->href != '#') + { soap->error = SOAP_OCCURS; + return NULL; + } + else + { a = (_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST, SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST, sizeof(_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST), 0, soap_finsert, soap_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC1 _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST * SOAP_FMAC2 soap_instantiate__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "soap_instantiate__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST(%p, %d, %s, %s)\n", (void*)soap, n, type?type:"", arrayType?arrayType:"")); + (void)type; (void)arrayType; /* appease -Wall -Werror */ + _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST *p; + size_t k = sizeof(_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST); + struct soap_clist *cp = soap_link(soap, SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST, n, soap_fdelete); + if (!cp && soap && n != SOAP_NO_LINK_TO_DELETE) + return NULL; + if (n < 0) + { p = SOAP_NEW(soap, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST); + } + else + { p = SOAP_NEW_ARRAY(soap, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST, n); + k *= n; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST location=%p n=%d\n", (void*)p, n)); + if (size) + *size = k; + if (!p) + soap->error = SOAP_EOM; + else if (cp) + cp->ptr = (void*)p; + return p; +} + +int _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST::soap_put(struct soap *soap, const char *tag, const char *type) const +{ + if (soap_out__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST(soap, tag ? tag : "ns1:DT_PROCESSROUTE_S4_REQ-LIST", -2, this, type)) + return soap->error; + return soap_putindependent(soap); +} + +void *_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST::soap_get(struct soap *soap, const char *tag, const char *type) +{ + return soap_get__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST(soap, this, tag, type); +} + +SOAP_FMAC3 _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST * SOAP_FMAC4 soap_get__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST(struct soap *soap, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST *p, const char *tag, const char *type) +{ + if ((p = soap_in__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +void _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO::soap_default(struct soap *soap) +{ + (void)soap; /* appease -Wall -Werror */ + soap_default_string(soap, &this->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO::REQ_USCORETRACE_USCOREID); +} + +void _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO::soap_serialize(struct soap *soap) const +{ + (void)soap; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + soap_serialize_string(soap, (char*const*)&this->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO::REQ_USCORETRACE_USCOREID); +#endif +} + +int _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO::soap_out(struct soap *soap, const char *tag, int id, const char *type) const +{ + return soap_out__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO(soap, tag, id, this, type); +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO(struct soap *soap, const char *tag, int id, const _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO *a, const char *type) +{ + (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO), type)) + return soap->error; + if (soap_out_string(soap, "REQ_TRACE_ID", -1, (char*const*)&a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO::REQ_USCORETRACE_USCOREID, "")) + return soap->error; + return soap_element_end_out(soap, tag); +} + +void *_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO::soap_in(struct soap *soap, const char *tag, const char *type) +{ + return soap_in__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO(soap, tag, this, type); +} + +SOAP_FMAC3 _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO * SOAP_FMAC4 soap_in__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO(struct soap *soap, const char *tag, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO *a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; + a = (_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO*)soap_id_enter(soap, soap->id, a, SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO, sizeof(_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO), soap->type, soap->arrayType, soap_instantiate, soap_fbase); + if (!a) + return NULL; + if (soap->alloced && soap->alloced != SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO) + { soap_revert(soap); + *soap->id = '\0'; + return (_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO *)a->soap_in(soap, tag, type); + } + if (soap->alloced) + a->soap_default(soap); + size_t soap_flag_REQ_USCORETRACE_USCOREID1 = 1; + if (soap->body && *soap->href != '#') + { + for (;;) + { soap->error = SOAP_TAG_MISMATCH; + if (soap_flag_REQ_USCORETRACE_USCOREID1 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_string(soap, "REQ_TRACE_ID", (char**)&a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO::REQ_USCORETRACE_USCOREID, "xsd:string")) + { soap_flag_REQ_USCORETRACE_USCOREID1--; + continue; + } + } + if (soap->error == SOAP_TAG_MISMATCH) + soap->error = soap_ignore_element(soap); + if (soap->error == SOAP_NO_TAG) + break; + if (soap->error) + return NULL; + } + if (soap_element_end_in(soap, tag)) + return NULL; + } + else + { a = (_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO, SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO, sizeof(_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO), 0, soap_finsert, soap_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC1 _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO * SOAP_FMAC2 soap_instantiate__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "soap_instantiate__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO(%p, %d, %s, %s)\n", (void*)soap, n, type?type:"", arrayType?arrayType:"")); + (void)type; (void)arrayType; /* appease -Wall -Werror */ + _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO *p; + size_t k = sizeof(_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO); + struct soap_clist *cp = soap_link(soap, SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO, n, soap_fdelete); + if (!cp && soap && n != SOAP_NO_LINK_TO_DELETE) + return NULL; + if (n < 0) + { p = SOAP_NEW(soap, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO); + } + else + { p = SOAP_NEW_ARRAY(soap, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO, n); + k *= n; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO location=%p n=%d\n", (void*)p, n)); + if (size) + *size = k; + if (!p) + soap->error = SOAP_EOM; + else if (cp) + cp->ptr = (void*)p; + return p; +} + +int _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO::soap_put(struct soap *soap, const char *tag, const char *type) const +{ + if (soap_out__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO(soap, tag ? tag : "ns1:DT_PROCESSROUTE_S4_REQ-BASEINFO", -2, this, type)) + return soap->error; + return soap_putindependent(soap); +} + +void *_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO::soap_get(struct soap *soap, const char *tag, const char *type) +{ + return soap_get__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO(soap, this, tag, type); +} + +SOAP_FMAC3 _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO * SOAP_FMAC4 soap_get__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO(struct soap *soap, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO *p, const char *tag, const char *type) +{ + if ((p = soap_in__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +void _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN::soap_default(struct soap *soap) +{ + (void)soap; /* appease -Wall -Werror */ + soap_default_string(soap, &this->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN::MATNR); + soap_default_string(soap, &this->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN::TYPE); + soap_default_string(soap, &this->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN::MESSAGE); +} + +void _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN::soap_serialize(struct soap *soap) const +{ + (void)soap; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + soap_serialize_string(soap, (char*const*)&this->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN::MATNR); + soap_serialize_string(soap, (char*const*)&this->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN::TYPE); + soap_serialize_string(soap, (char*const*)&this->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN::MESSAGE); +#endif +} + +int _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN::soap_out(struct soap *soap, const char *tag, int id, const char *type) const +{ + return soap_out__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN(soap, tag, id, this, type); +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN(struct soap *soap, const char *tag, int id, const _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN *a, const char *type) +{ + (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN), type)) + return soap->error; + if (soap_out_string(soap, "MATNR", -1, (char*const*)&a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN::MATNR, "")) + return soap->error; + if (soap_out_string(soap, "TYPE", -1, (char*const*)&a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN::TYPE, "")) + return soap->error; + if (soap_out_string(soap, "MESSAGE", -1, (char*const*)&a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN::MESSAGE, "")) + return soap->error; + return soap_element_end_out(soap, tag); +} + +void *_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN::soap_in(struct soap *soap, const char *tag, const char *type) +{ + return soap_in__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN(soap, tag, this, type); +} + +SOAP_FMAC3 _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN * SOAP_FMAC4 soap_in__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN(struct soap *soap, const char *tag, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN *a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; + a = (_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN*)soap_id_enter(soap, soap->id, a, SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN, sizeof(_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN), soap->type, soap->arrayType, soap_instantiate, soap_fbase); + if (!a) + return NULL; + if (soap->alloced && soap->alloced != SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN) + { soap_revert(soap); + *soap->id = '\0'; + return (_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN *)a->soap_in(soap, tag, type); + } + if (soap->alloced) + a->soap_default(soap); + size_t soap_flag_MATNR1 = 1; + size_t soap_flag_TYPE1 = 1; + size_t soap_flag_MESSAGE1 = 1; + if (soap->body && *soap->href != '#') + { + for (;;) + { soap->error = SOAP_TAG_MISMATCH; + if (soap_flag_MATNR1 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_string(soap, "MATNR", (char**)&a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN::MATNR, "xsd:string")) + { soap_flag_MATNR1--; + continue; + } + } + if (soap_flag_TYPE1 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_string(soap, "TYPE", (char**)&a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN::TYPE, "xsd:string")) + { soap_flag_TYPE1--; + continue; + } + } + if (soap_flag_MESSAGE1 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_string(soap, "MESSAGE", (char**)&a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN::MESSAGE, "xsd:string")) + { soap_flag_MESSAGE1--; + continue; + } + } + if (soap->error == SOAP_TAG_MISMATCH) + soap->error = soap_ignore_element(soap); + if (soap->error == SOAP_NO_TAG) + break; + if (soap->error) + return NULL; + } + if (soap_element_end_in(soap, tag)) + return NULL; + } + else + { a = (_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN, SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN, sizeof(_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN), 0, soap_finsert, soap_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC1 _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN * SOAP_FMAC2 soap_instantiate__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "soap_instantiate__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN(%p, %d, %s, %s)\n", (void*)soap, n, type?type:"", arrayType?arrayType:"")); + (void)type; (void)arrayType; /* appease -Wall -Werror */ + _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN *p; + size_t k = sizeof(_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN); + struct soap_clist *cp = soap_link(soap, SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN, n, soap_fdelete); + if (!cp && soap && n != SOAP_NO_LINK_TO_DELETE) + return NULL; + if (n < 0) + { p = SOAP_NEW(soap, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN); + } + else + { p = SOAP_NEW_ARRAY(soap, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN, n); + k *= n; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN location=%p n=%d\n", (void*)p, n)); + if (size) + *size = k; + if (!p) + soap->error = SOAP_EOM; + else if (cp) + cp->ptr = (void*)p; + return p; +} + +int _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN::soap_put(struct soap *soap, const char *tag, const char *type) const +{ + if (soap_out__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN(soap, tag ? tag : "ns1:DT_PROCESSROUTE_S4_RSP-ZTABLE_RETURN", -2, this, type)) + return soap->error; + return soap_putindependent(soap); +} + +void *_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN::soap_get(struct soap *soap, const char *tag, const char *type) +{ + return soap_get__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN(soap, this, tag, type); +} + +SOAP_FMAC3 _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN * SOAP_FMAC4 soap_get__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN(struct soap *soap, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN *p, const char *tag, const char *type) +{ + if ((p = soap_in__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +void _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO::soap_default(struct soap *soap) +{ + (void)soap; /* appease -Wall -Werror */ + soap_default_string(soap, &this->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO::REQ_USCORETRACE_USCOREID); +} + +void _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO::soap_serialize(struct soap *soap) const +{ + (void)soap; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + soap_serialize_string(soap, (char*const*)&this->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO::REQ_USCORETRACE_USCOREID); +#endif +} + +int _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO::soap_out(struct soap *soap, const char *tag, int id, const char *type) const +{ + return soap_out__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO(soap, tag, id, this, type); +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO(struct soap *soap, const char *tag, int id, const _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO *a, const char *type) +{ + (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO), type)) + return soap->error; + if (!a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO::REQ_USCORETRACE_USCOREID) + { if (soap_element_empty(soap, "REQ_TRACE_ID", 0, NULL)) + return soap->error; + } + else if (soap_out_string(soap, "REQ_TRACE_ID", -1, (char*const*)&a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO::REQ_USCORETRACE_USCOREID, "")) + return soap->error; + return soap_element_end_out(soap, tag); +} + +void *_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO::soap_in(struct soap *soap, const char *tag, const char *type) +{ + return soap_in__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO(soap, tag, this, type); +} + +SOAP_FMAC3 _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO * SOAP_FMAC4 soap_in__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO(struct soap *soap, const char *tag, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO *a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; + a = (_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO*)soap_id_enter(soap, soap->id, a, SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO, sizeof(_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO), soap->type, soap->arrayType, soap_instantiate, soap_fbase); + if (!a) + return NULL; + if (soap->alloced && soap->alloced != SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO) + { soap_revert(soap); + *soap->id = '\0'; + return (_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO *)a->soap_in(soap, tag, type); + } + if (soap->alloced) + a->soap_default(soap); + size_t soap_flag_REQ_USCORETRACE_USCOREID1 = 1; + if (soap->body && *soap->href != '#') + { + for (;;) + { soap->error = SOAP_TAG_MISMATCH; + if (soap_flag_REQ_USCORETRACE_USCOREID1 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_string(soap, "REQ_TRACE_ID", (char**)&a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO::REQ_USCORETRACE_USCOREID, "xsd:string")) + { soap_flag_REQ_USCORETRACE_USCOREID1--; + continue; + } + } + if (soap->error == SOAP_TAG_MISMATCH) + soap->error = soap_ignore_element(soap); + if (soap->error == SOAP_NO_TAG) + break; + if (soap->error) + return NULL; + } + if (soap_element_end_in(soap, tag)) + return NULL; + if ((soap->mode & SOAP_XML_STRICT) && (!a->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO::REQ_USCORETRACE_USCOREID)) + { soap->error = SOAP_OCCURS; + return NULL; + } + } + else if ((soap->mode & SOAP_XML_STRICT) && *soap->href != '#') + { soap->error = SOAP_OCCURS; + return NULL; + } + else + { a = (_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO, SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO, sizeof(_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO), 0, soap_finsert, soap_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC1 _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO * SOAP_FMAC2 soap_instantiate__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "soap_instantiate__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO(%p, %d, %s, %s)\n", (void*)soap, n, type?type:"", arrayType?arrayType:"")); + (void)type; (void)arrayType; /* appease -Wall -Werror */ + _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO *p; + size_t k = sizeof(_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO); + struct soap_clist *cp = soap_link(soap, SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO, n, soap_fdelete); + if (!cp && soap && n != SOAP_NO_LINK_TO_DELETE) + return NULL; + if (n < 0) + { p = SOAP_NEW(soap, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO); + } + else + { p = SOAP_NEW_ARRAY(soap, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO, n); + k *= n; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO location=%p n=%d\n", (void*)p, n)); + if (size) + *size = k; + if (!p) + soap->error = SOAP_EOM; + else if (cp) + cp->ptr = (void*)p; + return p; +} + +int _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO::soap_put(struct soap *soap, const char *tag, const char *type) const +{ + if (soap_out__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO(soap, tag ? tag : "ns1:DT_PROCESSROUTE_S4_RSP-RSP_BASEINFO", -2, this, type)) + return soap->error; + return soap_putindependent(soap); +} + +void *_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO::soap_get(struct soap *soap, const char *tag, const char *type) +{ + return soap_get__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO(soap, this, tag, type); +} + +SOAP_FMAC3 _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO * SOAP_FMAC4 soap_get__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO(struct soap *soap, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO *p, const char *tag, const char *type) +{ + if ((p = soap_in__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +void ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ::soap_default(struct soap *soap) +{ + this->soap = soap; + this->ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ::BASEINFO._ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO::soap_default(soap); + this->ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ::__sizeLIST = 0; + this->ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ::LIST = NULL; +} + +void ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ::soap_serialize(struct soap *soap) const +{ + (void)soap; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + this->ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ::BASEINFO.soap_serialize(soap); + if (this->ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ::LIST) + { int i; + for (i = 0; i < (int)this->ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ::__sizeLIST; i++) + { + soap_embedded(soap, this->ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ::LIST + i, SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST); + this->ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ::LIST[i].soap_serialize(soap); + } + } +#endif +} + +int ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ::soap_out(struct soap *soap, const char *tag, int id, const char *type) const +{ + return soap_out_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ(soap, tag, id, this, type); +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ(struct soap *soap, const char *tag, int id, const ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ *a, const char *type) +{ + (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ), type)) + return soap->error; + if ((a->ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ::BASEINFO).soap_out(soap, "BASEINFO", -1, "")) + return soap->error; + if (a->ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ::LIST) + { int i; + for (i = 0; i < (int)a->ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ::__sizeLIST; i++) + if (a->ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ::LIST[i].soap_out(soap, "LIST", -1, "")) + return soap->error; + } + return soap_element_end_out(soap, tag); +} + +void *ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ::soap_in(struct soap *soap, const char *tag, const char *type) +{ + return soap_in_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ(soap, tag, this, type); +} + +SOAP_FMAC3 ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ * SOAP_FMAC4 soap_in_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ(struct soap *soap, const char *tag, ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ *a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; + a = (ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ*)soap_id_enter(soap, soap->id, a, SOAP_TYPE_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ, sizeof(ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ), soap->type, soap->arrayType, soap_instantiate, soap_fbase); + if (!a) + return NULL; + if (soap->alloced && soap->alloced != SOAP_TYPE_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ) + { soap_revert(soap); + *soap->id = '\0'; + return (ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ *)a->soap_in(soap, tag, type); + } + if (soap->alloced) + a->soap_default(soap); + size_t soap_flag_BASEINFO1 = 1; + struct soap_blist *soap_blist_LIST1 = NULL; + if (soap->body && *soap->href != '#') + { + for (;;) + { soap->error = SOAP_TAG_MISMATCH; + if (soap_flag_BASEINFO1 && soap->error == SOAP_TAG_MISMATCH) + { if ((a->ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ::BASEINFO).soap_in(soap, "BASEINFO", "")) + { soap_flag_BASEINFO1--; + continue; + } + } + if (soap->error == SOAP_TAG_MISMATCH && !soap_element_begin_in(soap, "LIST", 1, NULL)) + { if (a->ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ::LIST == NULL) + { if (soap_blist_LIST1 == NULL) + soap_blist_LIST1 = soap_alloc_block(soap); + a->ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ::LIST = soap_block<_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST>::push(soap, soap_blist_LIST1); + if (a->ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ::LIST == NULL) + return NULL; + a->ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ::LIST->soap_default(soap); + } + soap_revert(soap); + if (soap_in__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST(soap, "LIST", a->ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ::LIST, "")) + { a->ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ::__sizeLIST++; + a->ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ::LIST = NULL; + continue; + } + } + if (soap->error == SOAP_TAG_MISMATCH) + soap->error = soap_ignore_element(soap); + if (soap->error == SOAP_NO_TAG) + break; + if (soap->error) + return NULL; + } + if (a->ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ::LIST) + soap_block<_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST>::pop(soap, soap_blist_LIST1); + if (a->ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ::__sizeLIST) + { a->ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ::LIST = soap_new__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST(soap, a->ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ::__sizeLIST); + if (!a->ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ::LIST) + return NULL; + soap_block<_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST>::save(soap, soap_blist_LIST1, a->ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ::LIST); + } + else + { a->ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ::LIST = NULL; + if (soap_blist_LIST1) + soap_block<_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST>::end(soap, soap_blist_LIST1); + } + if (soap_element_end_in(soap, tag)) + return NULL; + if ((soap->mode & SOAP_XML_STRICT) && (soap_flag_BASEINFO1 > 0)) + { soap->error = SOAP_OCCURS; + return NULL; + } + } + else if ((soap->mode & SOAP_XML_STRICT) && *soap->href != '#') + { soap->error = SOAP_OCCURS; + return NULL; + } + else + { a = (ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ, SOAP_TYPE_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ, sizeof(ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ), 0, soap_finsert, soap_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC1 ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ * SOAP_FMAC2 soap_instantiate_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "soap_instantiate_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ(%p, %d, %s, %s)\n", (void*)soap, n, type?type:"", arrayType?arrayType:"")); + (void)type; (void)arrayType; /* appease -Wall -Werror */ + ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ *p; + size_t k = sizeof(ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ); + struct soap_clist *cp = soap_link(soap, SOAP_TYPE_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ, n, soap_fdelete); + if (!cp && soap && n != SOAP_NO_LINK_TO_DELETE) + return NULL; + if (n < 0) + { p = SOAP_NEW(soap, ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ); + if (p) + p->soap = soap; + } + else + { p = SOAP_NEW_ARRAY(soap, ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ, n); + k *= n; + if (p) + for (int i = 0; i < n; i++) + p[i].soap = soap; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ location=%p n=%d\n", (void*)p, n)); + if (size) + *size = k; + if (!p) + soap->error = SOAP_EOM; + else if (cp) + cp->ptr = (void*)p; + return p; +} + +int ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ::soap_put(struct soap *soap, const char *tag, const char *type) const +{ + if (soap_out_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ(soap, tag ? tag : "ns1:DT_PROCESSROUTE_S4_REQ", -2, this, type)) + return soap->error; + return soap_putindependent(soap); +} + +void *ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ::soap_get(struct soap *soap, const char *tag, const char *type) +{ + return soap_get_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ(soap, this, tag, type); +} + +SOAP_FMAC3 ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ * SOAP_FMAC4 soap_get_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ(struct soap *soap, ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ *p, const char *tag, const char *type) +{ + if ((p = soap_in_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +void ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP::soap_default(struct soap *soap) +{ + this->soap = soap; + this->ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP::RSP_USCOREBASEINFO._ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO::soap_default(soap); + this->ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP::__sizeZTABLE_USCORERETURN = 0; + this->ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP::ZTABLE_USCORERETURN = NULL; +} + +void ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP::soap_serialize(struct soap *soap) const +{ + (void)soap; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + this->ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP::RSP_USCOREBASEINFO.soap_serialize(soap); + if (this->ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP::ZTABLE_USCORERETURN) + { int i; + for (i = 0; i < (int)this->ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP::__sizeZTABLE_USCORERETURN; i++) + { + soap_embedded(soap, this->ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP::ZTABLE_USCORERETURN + i, SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN); + this->ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP::ZTABLE_USCORERETURN[i].soap_serialize(soap); + } + } +#endif +} + +int ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP::soap_out(struct soap *soap, const char *tag, int id, const char *type) const +{ + return soap_out_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP(soap, tag, id, this, type); +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP(struct soap *soap, const char *tag, int id, const ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP *a, const char *type) +{ + (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP), type)) + return soap->error; + if ((a->ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP::RSP_USCOREBASEINFO).soap_out(soap, "RSP_BASEINFO", -1, "")) + return soap->error; + if (a->ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP::ZTABLE_USCORERETURN) + { int i; + for (i = 0; i < (int)a->ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP::__sizeZTABLE_USCORERETURN; i++) + if (a->ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP::ZTABLE_USCORERETURN[i].soap_out(soap, "ZTABLE_RETURN", -1, "")) + return soap->error; + } + return soap_element_end_out(soap, tag); +} + +void *ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP::soap_in(struct soap *soap, const char *tag, const char *type) +{ + return soap_in_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP(soap, tag, this, type); +} + +SOAP_FMAC3 ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP * SOAP_FMAC4 soap_in_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP(struct soap *soap, const char *tag, ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP *a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; + a = (ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP*)soap_id_enter(soap, soap->id, a, SOAP_TYPE_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP, sizeof(ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP), soap->type, soap->arrayType, soap_instantiate, soap_fbase); + if (!a) + return NULL; + if (soap->alloced && soap->alloced != SOAP_TYPE_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP) + { soap_revert(soap); + *soap->id = '\0'; + return (ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP *)a->soap_in(soap, tag, type); + } + if (soap->alloced) + a->soap_default(soap); + size_t soap_flag_RSP_USCOREBASEINFO1 = 1; + struct soap_blist *soap_blist_ZTABLE_USCORERETURN1 = NULL; + if (soap->body && *soap->href != '#') + { + for (;;) + { soap->error = SOAP_TAG_MISMATCH; + if (soap_flag_RSP_USCOREBASEINFO1 && soap->error == SOAP_TAG_MISMATCH) + { if ((a->ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP::RSP_USCOREBASEINFO).soap_in(soap, "RSP_BASEINFO", "")) + { soap_flag_RSP_USCOREBASEINFO1--; + continue; + } + } + if (soap->error == SOAP_TAG_MISMATCH && !soap_element_begin_in(soap, "ZTABLE_RETURN", 1, NULL)) + { if (a->ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP::ZTABLE_USCORERETURN == NULL) + { if (soap_blist_ZTABLE_USCORERETURN1 == NULL) + soap_blist_ZTABLE_USCORERETURN1 = soap_alloc_block(soap); + a->ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP::ZTABLE_USCORERETURN = soap_block<_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN>::push(soap, soap_blist_ZTABLE_USCORERETURN1); + if (a->ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP::ZTABLE_USCORERETURN == NULL) + return NULL; + a->ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP::ZTABLE_USCORERETURN->soap_default(soap); + } + soap_revert(soap); + if (soap_in__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN(soap, "ZTABLE_RETURN", a->ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP::ZTABLE_USCORERETURN, "")) + { a->ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP::__sizeZTABLE_USCORERETURN++; + a->ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP::ZTABLE_USCORERETURN = NULL; + continue; + } + } + if (soap->error == SOAP_TAG_MISMATCH) + soap->error = soap_ignore_element(soap); + if (soap->error == SOAP_NO_TAG) + break; + if (soap->error) + return NULL; + } + if (a->ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP::ZTABLE_USCORERETURN) + soap_block<_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN>::pop(soap, soap_blist_ZTABLE_USCORERETURN1); + if (a->ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP::__sizeZTABLE_USCORERETURN) + { a->ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP::ZTABLE_USCORERETURN = soap_new__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN(soap, a->ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP::__sizeZTABLE_USCORERETURN); + if (!a->ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP::ZTABLE_USCORERETURN) + return NULL; + soap_block<_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN>::save(soap, soap_blist_ZTABLE_USCORERETURN1, a->ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP::ZTABLE_USCORERETURN); + } + else + { a->ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP::ZTABLE_USCORERETURN = NULL; + if (soap_blist_ZTABLE_USCORERETURN1) + soap_block<_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN>::end(soap, soap_blist_ZTABLE_USCORERETURN1); + } + if (soap_element_end_in(soap, tag)) + return NULL; + if ((soap->mode & SOAP_XML_STRICT) && (soap_flag_RSP_USCOREBASEINFO1 > 0)) + { soap->error = SOAP_OCCURS; + return NULL; + } + } + else if ((soap->mode & SOAP_XML_STRICT) && *soap->href != '#') + { soap->error = SOAP_OCCURS; + return NULL; + } + else + { a = (ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP, SOAP_TYPE_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP, sizeof(ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP), 0, soap_finsert, soap_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC1 ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP * SOAP_FMAC2 soap_instantiate_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "soap_instantiate_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP(%p, %d, %s, %s)\n", (void*)soap, n, type?type:"", arrayType?arrayType:"")); + (void)type; (void)arrayType; /* appease -Wall -Werror */ + ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP *p; + size_t k = sizeof(ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP); + struct soap_clist *cp = soap_link(soap, SOAP_TYPE_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP, n, soap_fdelete); + if (!cp && soap && n != SOAP_NO_LINK_TO_DELETE) + return NULL; + if (n < 0) + { p = SOAP_NEW(soap, ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP); + if (p) + p->soap = soap; + } + else + { p = SOAP_NEW_ARRAY(soap, ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP, n); + k *= n; + if (p) + for (int i = 0; i < n; i++) + p[i].soap = soap; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP location=%p n=%d\n", (void*)p, n)); + if (size) + *size = k; + if (!p) + soap->error = SOAP_EOM; + else if (cp) + cp->ptr = (void*)p; + return p; +} + +int ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP::soap_put(struct soap *soap, const char *tag, const char *type) const +{ + if (soap_out_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP(soap, tag ? tag : "ns1:DT_PROCESSROUTE_S4_RSP", -2, this, type)) + return soap->error; + return soap_putindependent(soap); +} + +void *ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP::soap_get(struct soap *soap, const char *tag, const char *type) +{ + return soap_get_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP(soap, this, tag, type); +} + +SOAP_FMAC3 ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP * SOAP_FMAC4 soap_get_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP(struct soap *soap, ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP *p, const char *tag, const char *type) +{ + if ((p = soap_in_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +void _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::soap_default(struct soap *soap) +{ + (void)soap; /* appease -Wall -Werror */ + soap_default_string(soap, &this->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::DATUV); + soap_default_string(soap, &this->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::POSTP); + soap_default_string(soap, &this->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::POSNR); + soap_default_string(soap, &this->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::IDNRK); + soap_default_string(soap, &this->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::MENGE); + soap_default_string(soap, &this->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::MEINS); + soap_default_string(soap, &this->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::SORTF); + soap_default_string(soap, &this->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::POTX1); +} + +void _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::soap_serialize(struct soap *soap) const +{ + (void)soap; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + soap_serialize_string(soap, (char*const*)&this->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::DATUV); + soap_serialize_string(soap, (char*const*)&this->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::POSTP); + soap_serialize_string(soap, (char*const*)&this->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::POSNR); + soap_serialize_string(soap, (char*const*)&this->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::IDNRK); + soap_serialize_string(soap, (char*const*)&this->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::MENGE); + soap_serialize_string(soap, (char*const*)&this->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::MEINS); + soap_serialize_string(soap, (char*const*)&this->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::SORTF); + soap_serialize_string(soap, (char*const*)&this->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::POTX1); +#endif +} + +int _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::soap_out(struct soap *soap, const char *tag, int id, const char *type) const +{ + return soap_out__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(soap, tag, id, this, type); +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(struct soap *soap, const char *tag, int id, const _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM *a, const char *type) +{ + (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM), type)) + return soap->error; + if (soap_out_string(soap, "DATUV", -1, (char*const*)&a->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::DATUV, "")) + return soap->error; + if (!a->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::POSTP) + { if (soap_element_empty(soap, "POSTP", 0, NULL)) + return soap->error; + } + else if (soap_out_string(soap, "POSTP", -1, (char*const*)&a->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::POSTP, "")) + return soap->error; + if (!a->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::POSNR) + { if (soap_element_empty(soap, "POSNR", 0, NULL)) + return soap->error; + } + else if (soap_out_string(soap, "POSNR", -1, (char*const*)&a->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::POSNR, "")) + return soap->error; + if (!a->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::IDNRK) + { if (soap_element_empty(soap, "IDNRK", 0, NULL)) + return soap->error; + } + else if (soap_out_string(soap, "IDNRK", -1, (char*const*)&a->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::IDNRK, "")) + return soap->error; + if (!a->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::MENGE) + { if (soap_element_empty(soap, "MENGE", 0, NULL)) + return soap->error; + } + else if (soap_out_string(soap, "MENGE", -1, (char*const*)&a->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::MENGE, "")) + return soap->error; + if (soap_out_string(soap, "MEINS", -1, (char*const*)&a->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::MEINS, "")) + return soap->error; + if (soap_out_string(soap, "SORTF", -1, (char*const*)&a->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::SORTF, "")) + return soap->error; + if (soap_out_string(soap, "POTX1", -1, (char*const*)&a->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::POTX1, "")) + return soap->error; + return soap_element_end_out(soap, tag); +} + +void *_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::soap_in(struct soap *soap, const char *tag, const char *type) +{ + return soap_in__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(soap, tag, this, type); +} + +SOAP_FMAC3 _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM * SOAP_FMAC4 soap_in__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(struct soap *soap, const char *tag, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM *a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; + a = (_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM*)soap_id_enter(soap, soap->id, a, SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM, sizeof(_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM), soap->type, soap->arrayType, soap_instantiate, soap_fbase); + if (!a) + return NULL; + if (soap->alloced && soap->alloced != SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM) + { soap_revert(soap); + *soap->id = '\0'; + return (_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM *)a->soap_in(soap, tag, type); + } + if (soap->alloced) + a->soap_default(soap); + size_t soap_flag_DATUV1 = 1; + size_t soap_flag_POSTP1 = 1; + size_t soap_flag_POSNR1 = 1; + size_t soap_flag_IDNRK1 = 1; + size_t soap_flag_MENGE1 = 1; + size_t soap_flag_MEINS1 = 1; + size_t soap_flag_SORTF1 = 1; + size_t soap_flag_POTX11 = 1; + if (soap->body && *soap->href != '#') + { + for (;;) + { soap->error = SOAP_TAG_MISMATCH; + if (soap_flag_DATUV1 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_string(soap, "DATUV", (char**)&a->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::DATUV, "xsd:string")) + { soap_flag_DATUV1--; + continue; + } + } + if (soap_flag_POSTP1 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_string(soap, "POSTP", (char**)&a->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::POSTP, "xsd:string")) + { soap_flag_POSTP1--; + continue; + } + } + if (soap_flag_POSNR1 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_string(soap, "POSNR", (char**)&a->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::POSNR, "xsd:string")) + { soap_flag_POSNR1--; + continue; + } + } + if (soap_flag_IDNRK1 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_string(soap, "IDNRK", (char**)&a->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::IDNRK, "xsd:string")) + { soap_flag_IDNRK1--; + continue; + } + } + if (soap_flag_MENGE1 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_string(soap, "MENGE", (char**)&a->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::MENGE, "xsd:string")) + { soap_flag_MENGE1--; + continue; + } + } + if (soap_flag_MEINS1 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_string(soap, "MEINS", (char**)&a->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::MEINS, "xsd:string")) + { soap_flag_MEINS1--; + continue; + } + } + if (soap_flag_SORTF1 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_string(soap, "SORTF", (char**)&a->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::SORTF, "xsd:string")) + { soap_flag_SORTF1--; + continue; + } + } + if (soap_flag_POTX11 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_string(soap, "POTX1", (char**)&a->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::POTX1, "xsd:string")) + { soap_flag_POTX11--; + continue; + } + } + if (soap->error == SOAP_TAG_MISMATCH) + soap->error = soap_ignore_element(soap); + if (soap->error == SOAP_NO_TAG) + break; + if (soap->error) + return NULL; + } + if (soap_element_end_in(soap, tag)) + return NULL; + if ((soap->mode & SOAP_XML_STRICT) && (!a->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::POSTP || !a->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::POSNR || !a->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::IDNRK || !a->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::MENGE)) + { soap->error = SOAP_OCCURS; + return NULL; + } + } + else if ((soap->mode & SOAP_XML_STRICT) && *soap->href != '#') + { soap->error = SOAP_OCCURS; + return NULL; + } + else + { a = (_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM, SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM, sizeof(_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM), 0, soap_finsert, soap_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC1 _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM * SOAP_FMAC2 soap_instantiate__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "soap_instantiate__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(%p, %d, %s, %s)\n", (void*)soap, n, type?type:"", arrayType?arrayType:"")); + (void)type; (void)arrayType; /* appease -Wall -Werror */ + _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM *p; + size_t k = sizeof(_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM); + struct soap_clist *cp = soap_link(soap, SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM, n, soap_fdelete); + if (!cp && soap && n != SOAP_NO_LINK_TO_DELETE) + return NULL; + if (n < 0) + { p = SOAP_NEW(soap, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM); + } + else + { p = SOAP_NEW_ARRAY(soap, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM, n); + k *= n; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM location=%p n=%d\n", (void*)p, n)); + if (size) + *size = k; + if (!p) + soap->error = SOAP_EOM; + else if (cp) + cp->ptr = (void*)p; + return p; +} + +int _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::soap_put(struct soap *soap, const char *tag, const char *type) const +{ + if (soap_out__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(soap, tag ? tag : "ns1:DT_BOM_S4_REQ-LIST-ITEMS-ITEM", -2, this, type)) + return soap->error; + return soap_putindependent(soap); +} + +void *_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::soap_get(struct soap *soap, const char *tag, const char *type) +{ + return soap_get__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(soap, this, tag, type); +} + +SOAP_FMAC3 _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM * SOAP_FMAC4 soap_get__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(struct soap *soap, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM *p, const char *tag, const char *type) +{ + if ((p = soap_in__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +void _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS::soap_default(struct soap *soap) +{ + (void)soap; /* appease -Wall -Werror */ + this->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS::__sizeITEM = 0; + this->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS::ITEM = NULL; +} + +void _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS::soap_serialize(struct soap *soap) const +{ + (void)soap; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + if (this->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS::ITEM) + { int i; + for (i = 0; i < (int)this->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS::__sizeITEM; i++) + { + soap_embedded(soap, this->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS::ITEM + i, SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM); + this->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS::ITEM[i].soap_serialize(soap); + } + } +#endif +} + +int _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS::soap_out(struct soap *soap, const char *tag, int id, const char *type) const +{ + return soap_out__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS(soap, tag, id, this, type); +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS(struct soap *soap, const char *tag, int id, const _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS *a, const char *type) +{ + (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS), type)) + return soap->error; + if (a->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS::ITEM) + { int i; + for (i = 0; i < (int)a->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS::__sizeITEM; i++) + if (a->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS::ITEM[i].soap_out(soap, "ITEM", -1, "")) + return soap->error; + } + return soap_element_end_out(soap, tag); +} + +void *_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS::soap_in(struct soap *soap, const char *tag, const char *type) +{ + return soap_in__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS(soap, tag, this, type); +} + +SOAP_FMAC3 _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS * SOAP_FMAC4 soap_in__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS(struct soap *soap, const char *tag, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS *a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; + a = (_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS*)soap_id_enter(soap, soap->id, a, SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS, sizeof(_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS), soap->type, soap->arrayType, soap_instantiate, soap_fbase); + if (!a) + return NULL; + if (soap->alloced && soap->alloced != SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS) + { soap_revert(soap); + *soap->id = '\0'; + return (_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS *)a->soap_in(soap, tag, type); + } + if (soap->alloced) + a->soap_default(soap); + struct soap_blist *soap_blist_ITEM1 = NULL; + if (soap->body && *soap->href != '#') + { + for (;;) + { soap->error = SOAP_TAG_MISMATCH; + if (soap->error == SOAP_TAG_MISMATCH && !soap_element_begin_in(soap, "ITEM", 1, NULL)) + { if (a->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS::ITEM == NULL) + { if (soap_blist_ITEM1 == NULL) + soap_blist_ITEM1 = soap_alloc_block(soap); + a->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS::ITEM = soap_block<_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM>::push(soap, soap_blist_ITEM1); + if (a->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS::ITEM == NULL) + return NULL; + a->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS::ITEM->soap_default(soap); + } + soap_revert(soap); + if (soap_in__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(soap, "ITEM", a->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS::ITEM, "")) + { a->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS::__sizeITEM++; + a->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS::ITEM = NULL; + continue; + } + } + if (soap->error == SOAP_TAG_MISMATCH) + soap->error = soap_ignore_element(soap); + if (soap->error == SOAP_NO_TAG) + break; + if (soap->error) + return NULL; + } + if (a->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS::ITEM) + soap_block<_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM>::pop(soap, soap_blist_ITEM1); + if (a->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS::__sizeITEM) + { a->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS::ITEM = soap_new__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(soap, a->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS::__sizeITEM); + if (!a->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS::ITEM) + return NULL; + soap_block<_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM>::save(soap, soap_blist_ITEM1, a->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS::ITEM); + } + else + { a->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS::ITEM = NULL; + if (soap_blist_ITEM1) + soap_block<_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM>::end(soap, soap_blist_ITEM1); + } + if (soap_element_end_in(soap, tag)) + return NULL; + } + else + { a = (_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS, SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS, sizeof(_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS), 0, soap_finsert, soap_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC1 _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS * SOAP_FMAC2 soap_instantiate__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "soap_instantiate__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS(%p, %d, %s, %s)\n", (void*)soap, n, type?type:"", arrayType?arrayType:"")); + (void)type; (void)arrayType; /* appease -Wall -Werror */ + _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS *p; + size_t k = sizeof(_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS); + struct soap_clist *cp = soap_link(soap, SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS, n, soap_fdelete); + if (!cp && soap && n != SOAP_NO_LINK_TO_DELETE) + return NULL; + if (n < 0) + { p = SOAP_NEW(soap, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS); + } + else + { p = SOAP_NEW_ARRAY(soap, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS, n); + k *= n; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS location=%p n=%d\n", (void*)p, n)); + if (size) + *size = k; + if (!p) + soap->error = SOAP_EOM; + else if (cp) + cp->ptr = (void*)p; + return p; +} + +int _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS::soap_put(struct soap *soap, const char *tag, const char *type) const +{ + if (soap_out__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS(soap, tag ? tag : "ns1:DT_BOM_S4_REQ-LIST-ITEMS", -2, this, type)) + return soap->error; + return soap_putindependent(soap); +} + +void *_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS::soap_get(struct soap *soap, const char *tag, const char *type) +{ + return soap_get__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS(soap, this, tag, type); +} + +SOAP_FMAC3 _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS * SOAP_FMAC4 soap_get__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS(struct soap *soap, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS *p, const char *tag, const char *type) +{ + if ((p = soap_in__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +void _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD::soap_default(struct soap *soap) +{ + (void)soap; /* appease -Wall -Werror */ + soap_default_string(soap, &this->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD::PSPNR); + soap_default_string(soap, &this->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD::MATNR); + soap_default_string(soap, &this->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD::WERKS); + soap_default_string(soap, &this->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD::DATUV); + soap_default_string(soap, &this->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD::STLAN); + soap_default_string(soap, &this->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD::STLAL); + soap_default_string(soap, &this->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD::BMENG); + soap_default_string(soap, &this->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD::BMEIN); + soap_default_string(soap, &this->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD::STKTX); +} + +void _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD::soap_serialize(struct soap *soap) const +{ + (void)soap; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + soap_serialize_string(soap, (char*const*)&this->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD::PSPNR); + soap_serialize_string(soap, (char*const*)&this->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD::MATNR); + soap_serialize_string(soap, (char*const*)&this->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD::WERKS); + soap_serialize_string(soap, (char*const*)&this->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD::DATUV); + soap_serialize_string(soap, (char*const*)&this->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD::STLAN); + soap_serialize_string(soap, (char*const*)&this->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD::STLAL); + soap_serialize_string(soap, (char*const*)&this->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD::BMENG); + soap_serialize_string(soap, (char*const*)&this->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD::BMEIN); + soap_serialize_string(soap, (char*const*)&this->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD::STKTX); +#endif +} + +int _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD::soap_out(struct soap *soap, const char *tag, int id, const char *type) const +{ + return soap_out__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD(soap, tag, id, this, type); +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD(struct soap *soap, const char *tag, int id, const _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD *a, const char *type) +{ + (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD), type)) + return soap->error; + if (soap_out_string(soap, "PSPNR", -1, (char*const*)&a->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD::PSPNR, "")) + return soap->error; + if (!a->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD::MATNR) + { if (soap_element_empty(soap, "MATNR", 0, NULL)) + return soap->error; + } + else if (soap_out_string(soap, "MATNR", -1, (char*const*)&a->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD::MATNR, "")) + return soap->error; + if (!a->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD::WERKS) + { if (soap_element_empty(soap, "WERKS", 0, NULL)) + return soap->error; + } + else if (soap_out_string(soap, "WERKS", -1, (char*const*)&a->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD::WERKS, "")) + return soap->error; + if (soap_out_string(soap, "DATUV", -1, (char*const*)&a->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD::DATUV, "")) + return soap->error; + if (soap_out_string(soap, "STLAN", -1, (char*const*)&a->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD::STLAN, "")) + return soap->error; + if (soap_out_string(soap, "STLAL", -1, (char*const*)&a->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD::STLAL, "")) + return soap->error; + if (!a->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD::BMENG) + { if (soap_element_empty(soap, "BMENG", 0, NULL)) + return soap->error; + } + else if (soap_out_string(soap, "BMENG", -1, (char*const*)&a->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD::BMENG, "")) + return soap->error; + if (soap_out_string(soap, "BMEIN", -1, (char*const*)&a->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD::BMEIN, "")) + return soap->error; + if (soap_out_string(soap, "STKTX", -1, (char*const*)&a->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD::STKTX, "")) + return soap->error; + return soap_element_end_out(soap, tag); +} + +void *_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD::soap_in(struct soap *soap, const char *tag, const char *type) +{ + return soap_in__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD(soap, tag, this, type); +} + +SOAP_FMAC3 _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD * SOAP_FMAC4 soap_in__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD(struct soap *soap, const char *tag, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD *a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; + a = (_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD*)soap_id_enter(soap, soap->id, a, SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD, sizeof(_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD), soap->type, soap->arrayType, soap_instantiate, soap_fbase); + if (!a) + return NULL; + if (soap->alloced && soap->alloced != SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD) + { soap_revert(soap); + *soap->id = '\0'; + return (_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD *)a->soap_in(soap, tag, type); + } + if (soap->alloced) + a->soap_default(soap); + size_t soap_flag_PSPNR1 = 1; + size_t soap_flag_MATNR1 = 1; + size_t soap_flag_WERKS1 = 1; + size_t soap_flag_DATUV1 = 1; + size_t soap_flag_STLAN1 = 1; + size_t soap_flag_STLAL1 = 1; + size_t soap_flag_BMENG1 = 1; + size_t soap_flag_BMEIN1 = 1; + size_t soap_flag_STKTX1 = 1; + if (soap->body && *soap->href != '#') + { + for (;;) + { soap->error = SOAP_TAG_MISMATCH; + if (soap_flag_PSPNR1 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_string(soap, "PSPNR", (char**)&a->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD::PSPNR, "xsd:string")) + { soap_flag_PSPNR1--; + continue; + } + } + if (soap_flag_MATNR1 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_string(soap, "MATNR", (char**)&a->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD::MATNR, "xsd:string")) + { soap_flag_MATNR1--; + continue; + } + } + if (soap_flag_WERKS1 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_string(soap, "WERKS", (char**)&a->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD::WERKS, "xsd:string")) + { soap_flag_WERKS1--; + continue; + } + } + if (soap_flag_DATUV1 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_string(soap, "DATUV", (char**)&a->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD::DATUV, "xsd:string")) + { soap_flag_DATUV1--; + continue; + } + } + if (soap_flag_STLAN1 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_string(soap, "STLAN", (char**)&a->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD::STLAN, "xsd:string")) + { soap_flag_STLAN1--; + continue; + } + } + if (soap_flag_STLAL1 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_string(soap, "STLAL", (char**)&a->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD::STLAL, "xsd:string")) + { soap_flag_STLAL1--; + continue; + } + } + if (soap_flag_BMENG1 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_string(soap, "BMENG", (char**)&a->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD::BMENG, "xsd:string")) + { soap_flag_BMENG1--; + continue; + } + } + if (soap_flag_BMEIN1 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_string(soap, "BMEIN", (char**)&a->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD::BMEIN, "xsd:string")) + { soap_flag_BMEIN1--; + continue; + } + } + if (soap_flag_STKTX1 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_string(soap, "STKTX", (char**)&a->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD::STKTX, "xsd:string")) + { soap_flag_STKTX1--; + continue; + } + } + if (soap->error == SOAP_TAG_MISMATCH) + soap->error = soap_ignore_element(soap); + if (soap->error == SOAP_NO_TAG) + break; + if (soap->error) + return NULL; + } + if (soap_element_end_in(soap, tag)) + return NULL; + if ((soap->mode & SOAP_XML_STRICT) && (!a->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD::MATNR || !a->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD::WERKS || !a->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD::BMENG)) + { soap->error = SOAP_OCCURS; + return NULL; + } + } + else if ((soap->mode & SOAP_XML_STRICT) && *soap->href != '#') + { soap->error = SOAP_OCCURS; + return NULL; + } + else + { a = (_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD, SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD, sizeof(_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD), 0, soap_finsert, soap_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC1 _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD * SOAP_FMAC2 soap_instantiate__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "soap_instantiate__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD(%p, %d, %s, %s)\n", (void*)soap, n, type?type:"", arrayType?arrayType:"")); + (void)type; (void)arrayType; /* appease -Wall -Werror */ + _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD *p; + size_t k = sizeof(_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD); + struct soap_clist *cp = soap_link(soap, SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD, n, soap_fdelete); + if (!cp && soap && n != SOAP_NO_LINK_TO_DELETE) + return NULL; + if (n < 0) + { p = SOAP_NEW(soap, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD); + } + else + { p = SOAP_NEW_ARRAY(soap, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD, n); + k *= n; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD location=%p n=%d\n", (void*)p, n)); + if (size) + *size = k; + if (!p) + soap->error = SOAP_EOM; + else if (cp) + cp->ptr = (void*)p; + return p; +} + +int _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD::soap_put(struct soap *soap, const char *tag, const char *type) const +{ + if (soap_out__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD(soap, tag ? tag : "ns1:DT_BOM_S4_REQ-LIST-HEAD", -2, this, type)) + return soap->error; + return soap_putindependent(soap); +} + +void *_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD::soap_get(struct soap *soap, const char *tag, const char *type) +{ + return soap_get__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD(soap, this, tag, type); +} + +SOAP_FMAC3 _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD * SOAP_FMAC4 soap_get__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD(struct soap *soap, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD *p, const char *tag, const char *type) +{ + if ((p = soap_in__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +void _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST::soap_default(struct soap *soap) +{ + (void)soap; /* appease -Wall -Werror */ + this->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST::HEAD._ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD::soap_default(soap); + this->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST::ITEMS._ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS::soap_default(soap); +} + +void _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST::soap_serialize(struct soap *soap) const +{ + (void)soap; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + this->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST::HEAD.soap_serialize(soap); + this->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST::ITEMS.soap_serialize(soap); +#endif +} + +int _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST::soap_out(struct soap *soap, const char *tag, int id, const char *type) const +{ + return soap_out__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST(soap, tag, id, this, type); +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST(struct soap *soap, const char *tag, int id, const _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST *a, const char *type) +{ + (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST), type)) + return soap->error; + if ((a->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST::HEAD).soap_out(soap, "HEAD", -1, "")) + return soap->error; + if ((a->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST::ITEMS).soap_out(soap, "ITEMS", -1, "")) + return soap->error; + return soap_element_end_out(soap, tag); +} + +void *_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST::soap_in(struct soap *soap, const char *tag, const char *type) +{ + return soap_in__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST(soap, tag, this, type); +} + +SOAP_FMAC3 _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST * SOAP_FMAC4 soap_in__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST(struct soap *soap, const char *tag, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST *a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; + a = (_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST*)soap_id_enter(soap, soap->id, a, SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST, sizeof(_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST), soap->type, soap->arrayType, soap_instantiate, soap_fbase); + if (!a) + return NULL; + if (soap->alloced && soap->alloced != SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST) + { soap_revert(soap); + *soap->id = '\0'; + return (_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST *)a->soap_in(soap, tag, type); + } + if (soap->alloced) + a->soap_default(soap); + size_t soap_flag_HEAD1 = 1; + size_t soap_flag_ITEMS1 = 1; + if (soap->body && *soap->href != '#') + { + for (;;) + { soap->error = SOAP_TAG_MISMATCH; + if (soap_flag_HEAD1 && soap->error == SOAP_TAG_MISMATCH) + { if ((a->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST::HEAD).soap_in(soap, "HEAD", "")) + { soap_flag_HEAD1--; + continue; + } + } + if (soap_flag_ITEMS1 && soap->error == SOAP_TAG_MISMATCH) + { if ((a->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST::ITEMS).soap_in(soap, "ITEMS", "")) + { soap_flag_ITEMS1--; + continue; + } + } + if (soap->error == SOAP_TAG_MISMATCH) + soap->error = soap_ignore_element(soap); + if (soap->error == SOAP_NO_TAG) + break; + if (soap->error) + return NULL; + } + if (soap_element_end_in(soap, tag)) + return NULL; + if ((soap->mode & SOAP_XML_STRICT) && (soap_flag_HEAD1 > 0 || soap_flag_ITEMS1 > 0)) + { soap->error = SOAP_OCCURS; + return NULL; + } + } + else if ((soap->mode & SOAP_XML_STRICT) && *soap->href != '#') + { soap->error = SOAP_OCCURS; + return NULL; + } + else + { a = (_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST, SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST, sizeof(_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST), 0, soap_finsert, soap_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC1 _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST * SOAP_FMAC2 soap_instantiate__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "soap_instantiate__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST(%p, %d, %s, %s)\n", (void*)soap, n, type?type:"", arrayType?arrayType:"")); + (void)type; (void)arrayType; /* appease -Wall -Werror */ + _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST *p; + size_t k = sizeof(_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST); + struct soap_clist *cp = soap_link(soap, SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST, n, soap_fdelete); + if (!cp && soap && n != SOAP_NO_LINK_TO_DELETE) + return NULL; + if (n < 0) + { p = SOAP_NEW(soap, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST); + } + else + { p = SOAP_NEW_ARRAY(soap, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST, n); + k *= n; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST location=%p n=%d\n", (void*)p, n)); + if (size) + *size = k; + if (!p) + soap->error = SOAP_EOM; + else if (cp) + cp->ptr = (void*)p; + return p; +} + +int _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST::soap_put(struct soap *soap, const char *tag, const char *type) const +{ + if (soap_out__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST(soap, tag ? tag : "ns1:DT_BOM_S4_REQ-LIST", -2, this, type)) + return soap->error; + return soap_putindependent(soap); +} + +void *_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST::soap_get(struct soap *soap, const char *tag, const char *type) +{ + return soap_get__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST(soap, this, tag, type); +} + +SOAP_FMAC3 _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST * SOAP_FMAC4 soap_get__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST(struct soap *soap, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST *p, const char *tag, const char *type) +{ + if ((p = soap_in__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +void _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO::soap_default(struct soap *soap) +{ + (void)soap; /* appease -Wall -Werror */ + soap_default_string(soap, &this->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO::REQ_USCORETRACE_USCOREID); +} + +void _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO::soap_serialize(struct soap *soap) const +{ + (void)soap; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + soap_serialize_string(soap, (char*const*)&this->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO::REQ_USCORETRACE_USCOREID); +#endif +} + +int _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO::soap_out(struct soap *soap, const char *tag, int id, const char *type) const +{ + return soap_out__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO(soap, tag, id, this, type); +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO(struct soap *soap, const char *tag, int id, const _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO *a, const char *type) +{ + (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO), type)) + return soap->error; + if (soap_out_string(soap, "REQ_TRACE_ID", -1, (char*const*)&a->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO::REQ_USCORETRACE_USCOREID, "")) + return soap->error; + return soap_element_end_out(soap, tag); +} + +void *_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO::soap_in(struct soap *soap, const char *tag, const char *type) +{ + return soap_in__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO(soap, tag, this, type); +} + +SOAP_FMAC3 _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO * SOAP_FMAC4 soap_in__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO(struct soap *soap, const char *tag, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO *a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; + a = (_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO*)soap_id_enter(soap, soap->id, a, SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO, sizeof(_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO), soap->type, soap->arrayType, soap_instantiate, soap_fbase); + if (!a) + return NULL; + if (soap->alloced && soap->alloced != SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO) + { soap_revert(soap); + *soap->id = '\0'; + return (_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO *)a->soap_in(soap, tag, type); + } + if (soap->alloced) + a->soap_default(soap); + size_t soap_flag_REQ_USCORETRACE_USCOREID1 = 1; + if (soap->body && *soap->href != '#') + { + for (;;) + { soap->error = SOAP_TAG_MISMATCH; + if (soap_flag_REQ_USCORETRACE_USCOREID1 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_string(soap, "REQ_TRACE_ID", (char**)&a->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO::REQ_USCORETRACE_USCOREID, "xsd:string")) + { soap_flag_REQ_USCORETRACE_USCOREID1--; + continue; + } + } + if (soap->error == SOAP_TAG_MISMATCH) + soap->error = soap_ignore_element(soap); + if (soap->error == SOAP_NO_TAG) + break; + if (soap->error) + return NULL; + } + if (soap_element_end_in(soap, tag)) + return NULL; + } + else + { a = (_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO, SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO, sizeof(_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO), 0, soap_finsert, soap_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC1 _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO * SOAP_FMAC2 soap_instantiate__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "soap_instantiate__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO(%p, %d, %s, %s)\n", (void*)soap, n, type?type:"", arrayType?arrayType:"")); + (void)type; (void)arrayType; /* appease -Wall -Werror */ + _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO *p; + size_t k = sizeof(_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO); + struct soap_clist *cp = soap_link(soap, SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO, n, soap_fdelete); + if (!cp && soap && n != SOAP_NO_LINK_TO_DELETE) + return NULL; + if (n < 0) + { p = SOAP_NEW(soap, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO); + } + else + { p = SOAP_NEW_ARRAY(soap, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO, n); + k *= n; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO location=%p n=%d\n", (void*)p, n)); + if (size) + *size = k; + if (!p) + soap->error = SOAP_EOM; + else if (cp) + cp->ptr = (void*)p; + return p; +} + +int _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO::soap_put(struct soap *soap, const char *tag, const char *type) const +{ + if (soap_out__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO(soap, tag ? tag : "ns1:DT_BOM_S4_REQ-BASEINFO", -2, this, type)) + return soap->error; + return soap_putindependent(soap); +} + +void *_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO::soap_get(struct soap *soap, const char *tag, const char *type) +{ + return soap_get__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO(soap, this, tag, type); +} + +SOAP_FMAC3 _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO * SOAP_FMAC4 soap_get__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO(struct soap *soap, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO *p, const char *tag, const char *type) +{ + if ((p = soap_in__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +void ns1__DT_USCOREBOM_USCORES4_USCOREREQ::soap_default(struct soap *soap) +{ + this->soap = soap; + this->ns1__DT_USCOREBOM_USCORES4_USCOREREQ::BASEINFO = NULL; + this->ns1__DT_USCOREBOM_USCORES4_USCOREREQ::__sizeLIST = 0; + this->ns1__DT_USCOREBOM_USCORES4_USCOREREQ::LIST = NULL; +} + +void ns1__DT_USCOREBOM_USCORES4_USCOREREQ::soap_serialize(struct soap *soap) const +{ + (void)soap; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + soap_serialize_PointerTo_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO(soap, &this->ns1__DT_USCOREBOM_USCORES4_USCOREREQ::BASEINFO); + if (this->ns1__DT_USCOREBOM_USCORES4_USCOREREQ::LIST) + { int i; + for (i = 0; i < (int)this->ns1__DT_USCOREBOM_USCORES4_USCOREREQ::__sizeLIST; i++) + { + soap_embedded(soap, this->ns1__DT_USCOREBOM_USCORES4_USCOREREQ::LIST + i, SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST); + this->ns1__DT_USCOREBOM_USCORES4_USCOREREQ::LIST[i].soap_serialize(soap); + } + } +#endif +} + +int ns1__DT_USCOREBOM_USCORES4_USCOREREQ::soap_out(struct soap *soap, const char *tag, int id, const char *type) const +{ + return soap_out_ns1__DT_USCOREBOM_USCORES4_USCOREREQ(soap, tag, id, this, type); +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out_ns1__DT_USCOREBOM_USCORES4_USCOREREQ(struct soap *soap, const char *tag, int id, const ns1__DT_USCOREBOM_USCORES4_USCOREREQ *a, const char *type) +{ + (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE_ns1__DT_USCOREBOM_USCORES4_USCOREREQ), type)) + return soap->error; + if (soap_out_PointerTo_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO(soap, "BASEINFO", -1, &a->ns1__DT_USCOREBOM_USCORES4_USCOREREQ::BASEINFO, "")) + return soap->error; + if (a->ns1__DT_USCOREBOM_USCORES4_USCOREREQ::LIST) + { int i; + for (i = 0; i < (int)a->ns1__DT_USCOREBOM_USCORES4_USCOREREQ::__sizeLIST; i++) + if (a->ns1__DT_USCOREBOM_USCORES4_USCOREREQ::LIST[i].soap_out(soap, "LIST", -1, "")) + return soap->error; + } + return soap_element_end_out(soap, tag); +} + +void *ns1__DT_USCOREBOM_USCORES4_USCOREREQ::soap_in(struct soap *soap, const char *tag, const char *type) +{ + return soap_in_ns1__DT_USCOREBOM_USCORES4_USCOREREQ(soap, tag, this, type); +} + +SOAP_FMAC3 ns1__DT_USCOREBOM_USCORES4_USCOREREQ * SOAP_FMAC4 soap_in_ns1__DT_USCOREBOM_USCORES4_USCOREREQ(struct soap *soap, const char *tag, ns1__DT_USCOREBOM_USCORES4_USCOREREQ *a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; + a = (ns1__DT_USCOREBOM_USCORES4_USCOREREQ*)soap_id_enter(soap, soap->id, a, SOAP_TYPE_ns1__DT_USCOREBOM_USCORES4_USCOREREQ, sizeof(ns1__DT_USCOREBOM_USCORES4_USCOREREQ), soap->type, soap->arrayType, soap_instantiate, soap_fbase); + if (!a) + return NULL; + if (soap->alloced && soap->alloced != SOAP_TYPE_ns1__DT_USCOREBOM_USCORES4_USCOREREQ) + { soap_revert(soap); + *soap->id = '\0'; + return (ns1__DT_USCOREBOM_USCORES4_USCOREREQ *)a->soap_in(soap, tag, type); + } + if (soap->alloced) + a->soap_default(soap); + size_t soap_flag_BASEINFO1 = 1; + struct soap_blist *soap_blist_LIST1 = NULL; + if (soap->body && *soap->href != '#') + { + for (;;) + { soap->error = SOAP_TAG_MISMATCH; + if (soap_flag_BASEINFO1 && soap->error == SOAP_TAG_MISMATCH) + { if (soap_in_PointerTo_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO(soap, "BASEINFO", &a->ns1__DT_USCOREBOM_USCORES4_USCOREREQ::BASEINFO, "")) + { soap_flag_BASEINFO1--; + continue; + } + } + if (soap->error == SOAP_TAG_MISMATCH && !soap_element_begin_in(soap, "LIST", 1, NULL)) + { if (a->ns1__DT_USCOREBOM_USCORES4_USCOREREQ::LIST == NULL) + { if (soap_blist_LIST1 == NULL) + soap_blist_LIST1 = soap_alloc_block(soap); + a->ns1__DT_USCOREBOM_USCORES4_USCOREREQ::LIST = soap_block<_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST>::push(soap, soap_blist_LIST1); + if (a->ns1__DT_USCOREBOM_USCORES4_USCOREREQ::LIST == NULL) + return NULL; + a->ns1__DT_USCOREBOM_USCORES4_USCOREREQ::LIST->soap_default(soap); + } + soap_revert(soap); + if (soap_in__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST(soap, "LIST", a->ns1__DT_USCOREBOM_USCORES4_USCOREREQ::LIST, "")) + { a->ns1__DT_USCOREBOM_USCORES4_USCOREREQ::__sizeLIST++; + a->ns1__DT_USCOREBOM_USCORES4_USCOREREQ::LIST = NULL; + continue; + } + } + if (soap->error == SOAP_TAG_MISMATCH) + soap->error = soap_ignore_element(soap); + if (soap->error == SOAP_NO_TAG) + break; + if (soap->error) + return NULL; + } + if (a->ns1__DT_USCOREBOM_USCORES4_USCOREREQ::LIST) + soap_block<_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST>::pop(soap, soap_blist_LIST1); + if (a->ns1__DT_USCOREBOM_USCORES4_USCOREREQ::__sizeLIST) + { a->ns1__DT_USCOREBOM_USCORES4_USCOREREQ::LIST = soap_new__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST(soap, a->ns1__DT_USCOREBOM_USCORES4_USCOREREQ::__sizeLIST); + if (!a->ns1__DT_USCOREBOM_USCORES4_USCOREREQ::LIST) + return NULL; + soap_block<_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST>::save(soap, soap_blist_LIST1, a->ns1__DT_USCOREBOM_USCORES4_USCOREREQ::LIST); + } + else + { a->ns1__DT_USCOREBOM_USCORES4_USCOREREQ::LIST = NULL; + if (soap_blist_LIST1) + soap_block<_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST>::end(soap, soap_blist_LIST1); + } + if (soap_element_end_in(soap, tag)) + return NULL; + } + else + { a = (ns1__DT_USCOREBOM_USCORES4_USCOREREQ *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE_ns1__DT_USCOREBOM_USCORES4_USCOREREQ, SOAP_TYPE_ns1__DT_USCOREBOM_USCORES4_USCOREREQ, sizeof(ns1__DT_USCOREBOM_USCORES4_USCOREREQ), 0, soap_finsert, soap_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC1 ns1__DT_USCOREBOM_USCORES4_USCOREREQ * SOAP_FMAC2 soap_instantiate_ns1__DT_USCOREBOM_USCORES4_USCOREREQ(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "soap_instantiate_ns1__DT_USCOREBOM_USCORES4_USCOREREQ(%p, %d, %s, %s)\n", (void*)soap, n, type?type:"", arrayType?arrayType:"")); + (void)type; (void)arrayType; /* appease -Wall -Werror */ + ns1__DT_USCOREBOM_USCORES4_USCOREREQ *p; + size_t k = sizeof(ns1__DT_USCOREBOM_USCORES4_USCOREREQ); + struct soap_clist *cp = soap_link(soap, SOAP_TYPE_ns1__DT_USCOREBOM_USCORES4_USCOREREQ, n, soap_fdelete); + if (!cp && soap && n != SOAP_NO_LINK_TO_DELETE) + return NULL; + if (n < 0) + { p = SOAP_NEW(soap, ns1__DT_USCOREBOM_USCORES4_USCOREREQ); + if (p) + p->soap = soap; + } + else + { p = SOAP_NEW_ARRAY(soap, ns1__DT_USCOREBOM_USCORES4_USCOREREQ, n); + k *= n; + if (p) + for (int i = 0; i < n; i++) + p[i].soap = soap; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated ns1__DT_USCOREBOM_USCORES4_USCOREREQ location=%p n=%d\n", (void*)p, n)); + if (size) + *size = k; + if (!p) + soap->error = SOAP_EOM; + else if (cp) + cp->ptr = (void*)p; + return p; +} + +int ns1__DT_USCOREBOM_USCORES4_USCOREREQ::soap_put(struct soap *soap, const char *tag, const char *type) const +{ + if (soap_out_ns1__DT_USCOREBOM_USCORES4_USCOREREQ(soap, tag ? tag : "ns1:DT_BOM_S4_REQ", -2, this, type)) + return soap->error; + return soap_putindependent(soap); +} + +void *ns1__DT_USCOREBOM_USCORES4_USCOREREQ::soap_get(struct soap *soap, const char *tag, const char *type) +{ + return soap_get_ns1__DT_USCOREBOM_USCORES4_USCOREREQ(soap, this, tag, type); +} + +SOAP_FMAC3 ns1__DT_USCOREBOM_USCORES4_USCOREREQ * SOAP_FMAC4 soap_get_ns1__DT_USCOREBOM_USCORES4_USCOREREQ(struct soap *soap, ns1__DT_USCOREBOM_USCORES4_USCOREREQ *p, const char *tag, const char *type) +{ + if ((p = soap_in_ns1__DT_USCOREBOM_USCORES4_USCOREREQ(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +#ifndef WITH_NOGLOBAL + +SOAP_FMAC3 void SOAP_FMAC4 soap_default_SOAP_ENV__Fault(struct soap *soap, struct SOAP_ENV__Fault *a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ + soap_default__QName(soap, &a->faultcode); + soap_default_string(soap, &a->faultstring); + soap_default_string(soap, &a->faultactor); + a->detail = NULL; + a->SOAP_ENV__Code = NULL; + a->SOAP_ENV__Reason = NULL; + soap_default_string(soap, &a->SOAP_ENV__Node); + soap_default_string(soap, &a->SOAP_ENV__Role); + a->SOAP_ENV__Detail = NULL; +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_SOAP_ENV__Fault(struct soap *soap, const struct SOAP_ENV__Fault *a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + soap_serialize__QName(soap, (char*const*)&a->faultcode); + soap_serialize_string(soap, (char*const*)&a->faultstring); + soap_serialize_string(soap, (char*const*)&a->faultactor); + soap_serialize_PointerToSOAP_ENV__Detail(soap, &a->detail); + soap_serialize_PointerToSOAP_ENV__Code(soap, &a->SOAP_ENV__Code); + soap_serialize_PointerToSOAP_ENV__Reason(soap, &a->SOAP_ENV__Reason); + soap_serialize_string(soap, (char*const*)&a->SOAP_ENV__Node); + soap_serialize_string(soap, (char*const*)&a->SOAP_ENV__Role); + soap_serialize_PointerToSOAP_ENV__Detail(soap, &a->SOAP_ENV__Detail); +#endif +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out_SOAP_ENV__Fault(struct soap *soap, const char *tag, int id, const struct SOAP_ENV__Fault *a, const char *type) +{ + const char *soap_tmp_faultcode; + soap_tmp_faultcode = soap_QName2s(soap, a->faultcode); + (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE_SOAP_ENV__Fault), type)) + return soap->error; + if (soap_out__QName(soap, "faultcode", -1, (char*const*)(void*)&soap_tmp_faultcode, "")) + return soap->error; + if (soap_out_string(soap, "faultstring", -1, (char*const*)&a->faultstring, "")) + return soap->error; + if (soap_out_string(soap, "faultactor", -1, (char*const*)&a->faultactor, "")) + return soap->error; + if (soap_out_PointerToSOAP_ENV__Detail(soap, "detail", -1, &a->detail, "")) + return soap->error; + if (soap_out_PointerToSOAP_ENV__Code(soap, "SOAP-ENV:Code", -1, &a->SOAP_ENV__Code, "")) + return soap->error; + if (soap_out_PointerToSOAP_ENV__Reason(soap, "SOAP-ENV:Reason", -1, &a->SOAP_ENV__Reason, "")) + return soap->error; + if (soap_out_string(soap, "SOAP-ENV:Node", -1, (char*const*)&a->SOAP_ENV__Node, "")) + return soap->error; + if (soap_out_string(soap, "SOAP-ENV:Role", -1, (char*const*)&a->SOAP_ENV__Role, "")) + return soap->error; + if (soap_out_PointerToSOAP_ENV__Detail(soap, "SOAP-ENV:Detail", -1, &a->SOAP_ENV__Detail, "")) + return soap->error; + return soap_element_end_out(soap, tag); +} + +SOAP_FMAC3 struct SOAP_ENV__Fault * SOAP_FMAC4 soap_in_SOAP_ENV__Fault(struct soap *soap, const char *tag, struct SOAP_ENV__Fault *a, const char *type) +{ + size_t soap_flag_faultcode = 1; + size_t soap_flag_faultstring = 1; + size_t soap_flag_faultactor = 1; + size_t soap_flag_detail = 1; + size_t soap_flag_SOAP_ENV__Code = 1; + size_t soap_flag_SOAP_ENV__Reason = 1; + size_t soap_flag_SOAP_ENV__Node = 1; + size_t soap_flag_SOAP_ENV__Role = 1; + size_t soap_flag_SOAP_ENV__Detail = 1; + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; + (void)type; /* appease -Wall -Werror */ + a = (struct SOAP_ENV__Fault*)soap_id_enter(soap, soap->id, a, SOAP_TYPE_SOAP_ENV__Fault, sizeof(struct SOAP_ENV__Fault), NULL, NULL, NULL, NULL); + if (!a) + return NULL; + soap_default_SOAP_ENV__Fault(soap, a); + if (soap->body && *soap->href != '#') + { + for (;;) + { soap->error = SOAP_TAG_MISMATCH; + if (soap_flag_faultcode && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in__QName(soap, "faultcode", (char**)&a->faultcode, "xsd:QName")) + { soap_flag_faultcode--; + continue; + } + } + if (soap_flag_faultstring && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_string(soap, "faultstring", (char**)&a->faultstring, "xsd:string")) + { soap_flag_faultstring--; + continue; + } + } + if (soap_flag_faultactor && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_string(soap, "faultactor", (char**)&a->faultactor, "xsd:string")) + { soap_flag_faultactor--; + continue; + } + } + if (soap_flag_detail && soap->error == SOAP_TAG_MISMATCH) + { if (soap_in_PointerToSOAP_ENV__Detail(soap, "detail", &a->detail, "")) + { soap_flag_detail--; + continue; + } + } + if (soap_flag_SOAP_ENV__Code && soap->error == SOAP_TAG_MISMATCH) + { if (soap_in_PointerToSOAP_ENV__Code(soap, "SOAP-ENV:Code", &a->SOAP_ENV__Code, "")) + { soap_flag_SOAP_ENV__Code--; + continue; + } + } + if (soap_flag_SOAP_ENV__Reason && soap->error == SOAP_TAG_MISMATCH) + { if (soap_in_PointerToSOAP_ENV__Reason(soap, "SOAP-ENV:Reason", &a->SOAP_ENV__Reason, "")) + { soap_flag_SOAP_ENV__Reason--; + continue; + } + } + if (soap_flag_SOAP_ENV__Node && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_string(soap, "SOAP-ENV:Node", (char**)&a->SOAP_ENV__Node, "xsd:string")) + { soap_flag_SOAP_ENV__Node--; + continue; + } + } + if (soap_flag_SOAP_ENV__Role && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_string(soap, "SOAP-ENV:Role", (char**)&a->SOAP_ENV__Role, "xsd:string")) + { soap_flag_SOAP_ENV__Role--; + continue; + } + } + if (soap_flag_SOAP_ENV__Detail && soap->error == SOAP_TAG_MISMATCH) + { if (soap_in_PointerToSOAP_ENV__Detail(soap, "SOAP-ENV:Detail", &a->SOAP_ENV__Detail, "")) + { soap_flag_SOAP_ENV__Detail--; + continue; + } + } + if (soap->error == SOAP_TAG_MISMATCH) + soap->error = soap_ignore_element(soap); + if (soap->error == SOAP_NO_TAG) + break; + if (soap->error) + return NULL; + } + if (soap_element_end_in(soap, tag)) + return NULL; + } + else + { a = (struct SOAP_ENV__Fault *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE_SOAP_ENV__Fault, SOAP_TYPE_SOAP_ENV__Fault, sizeof(struct SOAP_ENV__Fault), 0, soap_finsert, NULL); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC1 struct SOAP_ENV__Fault * SOAP_FMAC2 soap_instantiate_SOAP_ENV__Fault(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "soap_instantiate_SOAP_ENV__Fault(%p, %d, %s, %s)\n", (void*)soap, n, type?type:"", arrayType?arrayType:"")); + (void)type; (void)arrayType; /* appease -Wall -Werror */ + struct SOAP_ENV__Fault *p; + size_t k = sizeof(struct SOAP_ENV__Fault); + struct soap_clist *cp = soap_link(soap, SOAP_TYPE_SOAP_ENV__Fault, n, soap_fdelete); + if (!cp && soap && n != SOAP_NO_LINK_TO_DELETE) + return NULL; + if (n < 0) + { p = SOAP_NEW(soap, struct SOAP_ENV__Fault); + } + else + { p = SOAP_NEW_ARRAY(soap, struct SOAP_ENV__Fault, n); + k *= n; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated struct SOAP_ENV__Fault location=%p n=%d\n", (void*)p, n)); + if (size) + *size = k; + if (!p) + soap->error = SOAP_EOM; + else if (cp) + cp->ptr = (void*)p; + return p; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_put_SOAP_ENV__Fault(struct soap *soap, const struct SOAP_ENV__Fault *a, const char *tag, const char *type) +{ + if (soap_out_SOAP_ENV__Fault(soap, tag ? tag : "SOAP-ENV:Fault", -2, a, type)) + return soap->error; + return soap_putindependent(soap); +} + +SOAP_FMAC3 struct SOAP_ENV__Fault * SOAP_FMAC4 soap_get_SOAP_ENV__Fault(struct soap *soap, struct SOAP_ENV__Fault *p, const char *tag, const char *type) +{ + if ((p = soap_in_SOAP_ENV__Fault(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +#endif + +#ifndef WITH_NOGLOBAL + +SOAP_FMAC3 void SOAP_FMAC4 soap_default_SOAP_ENV__Reason(struct soap *soap, struct SOAP_ENV__Reason *a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ + soap_default_string(soap, &a->SOAP_ENV__Text); +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_SOAP_ENV__Reason(struct soap *soap, const struct SOAP_ENV__Reason *a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + soap_serialize_string(soap, (char*const*)&a->SOAP_ENV__Text); +#endif +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out_SOAP_ENV__Reason(struct soap *soap, const char *tag, int id, const struct SOAP_ENV__Reason *a, const char *type) +{ + (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE_SOAP_ENV__Reason), type)) + return soap->error; + if (soap->lang) + soap_set_attr(soap, "xml:lang", soap->lang, 1); + if (soap_out_string(soap, "SOAP-ENV:Text", -1, (char*const*)&a->SOAP_ENV__Text, "")) + return soap->error; + return soap_element_end_out(soap, tag); +} + +SOAP_FMAC3 struct SOAP_ENV__Reason * SOAP_FMAC4 soap_in_SOAP_ENV__Reason(struct soap *soap, const char *tag, struct SOAP_ENV__Reason *a, const char *type) +{ + size_t soap_flag_SOAP_ENV__Text = 1; + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; + (void)type; /* appease -Wall -Werror */ + a = (struct SOAP_ENV__Reason*)soap_id_enter(soap, soap->id, a, SOAP_TYPE_SOAP_ENV__Reason, sizeof(struct SOAP_ENV__Reason), NULL, NULL, NULL, NULL); + if (!a) + return NULL; + soap_default_SOAP_ENV__Reason(soap, a); + if (soap->body && *soap->href != '#') + { + for (;;) + { soap->error = SOAP_TAG_MISMATCH; + if (soap_flag_SOAP_ENV__Text && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_string(soap, "SOAP-ENV:Text", (char**)&a->SOAP_ENV__Text, "xsd:string")) + { soap_flag_SOAP_ENV__Text--; + continue; + } + } + if (soap->error == SOAP_TAG_MISMATCH) + soap->error = soap_ignore_element(soap); + if (soap->error == SOAP_NO_TAG) + break; + if (soap->error) + return NULL; + } + if (soap_element_end_in(soap, tag)) + return NULL; + } + else + { a = (struct SOAP_ENV__Reason *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE_SOAP_ENV__Reason, SOAP_TYPE_SOAP_ENV__Reason, sizeof(struct SOAP_ENV__Reason), 0, soap_finsert, NULL); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC1 struct SOAP_ENV__Reason * SOAP_FMAC2 soap_instantiate_SOAP_ENV__Reason(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "soap_instantiate_SOAP_ENV__Reason(%p, %d, %s, %s)\n", (void*)soap, n, type?type:"", arrayType?arrayType:"")); + (void)type; (void)arrayType; /* appease -Wall -Werror */ + struct SOAP_ENV__Reason *p; + size_t k = sizeof(struct SOAP_ENV__Reason); + struct soap_clist *cp = soap_link(soap, SOAP_TYPE_SOAP_ENV__Reason, n, soap_fdelete); + if (!cp && soap && n != SOAP_NO_LINK_TO_DELETE) + return NULL; + if (n < 0) + { p = SOAP_NEW(soap, struct SOAP_ENV__Reason); + } + else + { p = SOAP_NEW_ARRAY(soap, struct SOAP_ENV__Reason, n); + k *= n; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated struct SOAP_ENV__Reason location=%p n=%d\n", (void*)p, n)); + if (size) + *size = k; + if (!p) + soap->error = SOAP_EOM; + else if (cp) + cp->ptr = (void*)p; + return p; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_put_SOAP_ENV__Reason(struct soap *soap, const struct SOAP_ENV__Reason *a, const char *tag, const char *type) +{ + if (soap_out_SOAP_ENV__Reason(soap, tag ? tag : "SOAP-ENV:Reason", -2, a, type)) + return soap->error; + return soap_putindependent(soap); +} + +SOAP_FMAC3 struct SOAP_ENV__Reason * SOAP_FMAC4 soap_get_SOAP_ENV__Reason(struct soap *soap, struct SOAP_ENV__Reason *p, const char *tag, const char *type) +{ + if ((p = soap_in_SOAP_ENV__Reason(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +#endif + +#ifndef WITH_NOGLOBAL + +SOAP_FMAC3 void SOAP_FMAC4 soap_default_SOAP_ENV__Detail(struct soap *soap, struct SOAP_ENV__Detail *a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ + a->__any = NULL; + a->__type = 0; + a->fault = NULL; +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_SOAP_ENV__Detail(struct soap *soap, const struct SOAP_ENV__Detail *a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + soap_markelement(soap, a->fault, a->__type); +#endif +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out_SOAP_ENV__Detail(struct soap *soap, const char *tag, int id, const struct SOAP_ENV__Detail *a, const char *type) +{ + (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE_SOAP_ENV__Detail), type)) + return soap->error; + if (soap_outliteral(soap, "-any", (char*const*)&a->__any, NULL)) + return soap->error; + if (soap_putelement(soap, a->fault, "fault", -1, a->__type)) + return soap->error; + return soap_element_end_out(soap, tag); +} + +SOAP_FMAC3 struct SOAP_ENV__Detail * SOAP_FMAC4 soap_in_SOAP_ENV__Detail(struct soap *soap, const char *tag, struct SOAP_ENV__Detail *a, const char *type) +{ + size_t soap_flag___any = 1; + size_t soap_flag_fault = 1; + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; + (void)type; /* appease -Wall -Werror */ + a = (struct SOAP_ENV__Detail*)soap_id_enter(soap, soap->id, a, SOAP_TYPE_SOAP_ENV__Detail, sizeof(struct SOAP_ENV__Detail), NULL, NULL, NULL, NULL); + if (!a) + return NULL; + soap_default_SOAP_ENV__Detail(soap, a); + if (soap->body && *soap->href != '#') + { + for (;;) + { soap->error = SOAP_TAG_MISMATCH; + if (soap_flag_fault && soap->error == SOAP_TAG_MISMATCH) + { if ((a->fault = soap_getelement(soap, "fault", &a->__type))) + { soap_flag_fault = 0; + continue; + } + } + if (soap_flag___any && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_inliteral(soap, "-any", (char**)&a->__any)) + { soap_flag___any--; + continue; + } + } + if (soap->error == SOAP_TAG_MISMATCH) + soap->error = soap_ignore_element(soap); + if (soap->error == SOAP_NO_TAG) + break; + if (soap->error) + return NULL; + } + if (soap_element_end_in(soap, tag)) + return NULL; + } + else + { a = (struct SOAP_ENV__Detail *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE_SOAP_ENV__Detail, SOAP_TYPE_SOAP_ENV__Detail, sizeof(struct SOAP_ENV__Detail), 0, soap_finsert, NULL); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC1 struct SOAP_ENV__Detail * SOAP_FMAC2 soap_instantiate_SOAP_ENV__Detail(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "soap_instantiate_SOAP_ENV__Detail(%p, %d, %s, %s)\n", (void*)soap, n, type?type:"", arrayType?arrayType:"")); + (void)type; (void)arrayType; /* appease -Wall -Werror */ + struct SOAP_ENV__Detail *p; + size_t k = sizeof(struct SOAP_ENV__Detail); + struct soap_clist *cp = soap_link(soap, SOAP_TYPE_SOAP_ENV__Detail, n, soap_fdelete); + if (!cp && soap && n != SOAP_NO_LINK_TO_DELETE) + return NULL; + if (n < 0) + { p = SOAP_NEW(soap, struct SOAP_ENV__Detail); + } + else + { p = SOAP_NEW_ARRAY(soap, struct SOAP_ENV__Detail, n); + k *= n; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated struct SOAP_ENV__Detail location=%p n=%d\n", (void*)p, n)); + if (size) + *size = k; + if (!p) + soap->error = SOAP_EOM; + else if (cp) + cp->ptr = (void*)p; + return p; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_put_SOAP_ENV__Detail(struct soap *soap, const struct SOAP_ENV__Detail *a, const char *tag, const char *type) +{ + if (soap_out_SOAP_ENV__Detail(soap, tag ? tag : "SOAP-ENV:Detail", -2, a, type)) + return soap->error; + return soap_putindependent(soap); +} + +SOAP_FMAC3 struct SOAP_ENV__Detail * SOAP_FMAC4 soap_get_SOAP_ENV__Detail(struct soap *soap, struct SOAP_ENV__Detail *p, const char *tag, const char *type) +{ + if ((p = soap_in_SOAP_ENV__Detail(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +#endif + +#ifndef WITH_NOGLOBAL + +SOAP_FMAC3 void SOAP_FMAC4 soap_default_SOAP_ENV__Code(struct soap *soap, struct SOAP_ENV__Code *a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ + soap_default__QName(soap, &a->SOAP_ENV__Value); + a->SOAP_ENV__Subcode = NULL; +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_SOAP_ENV__Code(struct soap *soap, const struct SOAP_ENV__Code *a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + soap_serialize__QName(soap, (char*const*)&a->SOAP_ENV__Value); + soap_serialize_PointerToSOAP_ENV__Code(soap, &a->SOAP_ENV__Subcode); +#endif +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out_SOAP_ENV__Code(struct soap *soap, const char *tag, int id, const struct SOAP_ENV__Code *a, const char *type) +{ + const char *soap_tmp_SOAP_ENV__Value; + soap_tmp_SOAP_ENV__Value = soap_QName2s(soap, a->SOAP_ENV__Value); + (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE_SOAP_ENV__Code), type)) + return soap->error; + if (soap_out__QName(soap, "SOAP-ENV:Value", -1, (char*const*)(void*)&soap_tmp_SOAP_ENV__Value, "")) + return soap->error; + if (soap_out_PointerToSOAP_ENV__Code(soap, "SOAP-ENV:Subcode", -1, &a->SOAP_ENV__Subcode, "")) + return soap->error; + return soap_element_end_out(soap, tag); +} + +SOAP_FMAC3 struct SOAP_ENV__Code * SOAP_FMAC4 soap_in_SOAP_ENV__Code(struct soap *soap, const char *tag, struct SOAP_ENV__Code *a, const char *type) +{ + size_t soap_flag_SOAP_ENV__Value = 1; + size_t soap_flag_SOAP_ENV__Subcode = 1; + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; + (void)type; /* appease -Wall -Werror */ + a = (struct SOAP_ENV__Code*)soap_id_enter(soap, soap->id, a, SOAP_TYPE_SOAP_ENV__Code, sizeof(struct SOAP_ENV__Code), NULL, NULL, NULL, NULL); + if (!a) + return NULL; + soap_default_SOAP_ENV__Code(soap, a); + if (soap->body && *soap->href != '#') + { + for (;;) + { soap->error = SOAP_TAG_MISMATCH; + if (soap_flag_SOAP_ENV__Value && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in__QName(soap, "SOAP-ENV:Value", (char**)&a->SOAP_ENV__Value, "xsd:QName")) + { soap_flag_SOAP_ENV__Value--; + continue; + } + } + if (soap_flag_SOAP_ENV__Subcode && soap->error == SOAP_TAG_MISMATCH) + { if (soap_in_PointerToSOAP_ENV__Code(soap, "SOAP-ENV:Subcode", &a->SOAP_ENV__Subcode, "")) + { soap_flag_SOAP_ENV__Subcode--; + continue; + } + } + if (soap->error == SOAP_TAG_MISMATCH) + soap->error = soap_ignore_element(soap); + if (soap->error == SOAP_NO_TAG) + break; + if (soap->error) + return NULL; + } + if (soap_element_end_in(soap, tag)) + return NULL; + } + else + { a = (struct SOAP_ENV__Code *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE_SOAP_ENV__Code, SOAP_TYPE_SOAP_ENV__Code, sizeof(struct SOAP_ENV__Code), 0, soap_finsert, NULL); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC1 struct SOAP_ENV__Code * SOAP_FMAC2 soap_instantiate_SOAP_ENV__Code(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "soap_instantiate_SOAP_ENV__Code(%p, %d, %s, %s)\n", (void*)soap, n, type?type:"", arrayType?arrayType:"")); + (void)type; (void)arrayType; /* appease -Wall -Werror */ + struct SOAP_ENV__Code *p; + size_t k = sizeof(struct SOAP_ENV__Code); + struct soap_clist *cp = soap_link(soap, SOAP_TYPE_SOAP_ENV__Code, n, soap_fdelete); + if (!cp && soap && n != SOAP_NO_LINK_TO_DELETE) + return NULL; + if (n < 0) + { p = SOAP_NEW(soap, struct SOAP_ENV__Code); + } + else + { p = SOAP_NEW_ARRAY(soap, struct SOAP_ENV__Code, n); + k *= n; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated struct SOAP_ENV__Code location=%p n=%d\n", (void*)p, n)); + if (size) + *size = k; + if (!p) + soap->error = SOAP_EOM; + else if (cp) + cp->ptr = (void*)p; + return p; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_put_SOAP_ENV__Code(struct soap *soap, const struct SOAP_ENV__Code *a, const char *tag, const char *type) +{ + if (soap_out_SOAP_ENV__Code(soap, tag ? tag : "SOAP-ENV:Code", -2, a, type)) + return soap->error; + return soap_putindependent(soap); +} + +SOAP_FMAC3 struct SOAP_ENV__Code * SOAP_FMAC4 soap_get_SOAP_ENV__Code(struct soap *soap, struct SOAP_ENV__Code *p, const char *tag, const char *type) +{ + if ((p = soap_in_SOAP_ENV__Code(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +#endif + +#ifndef WITH_NOGLOBAL + +SOAP_FMAC3 void SOAP_FMAC4 soap_default_SOAP_ENV__Header(struct soap *soap, struct SOAP_ENV__Header *a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_SOAP_ENV__Header(struct soap *soap, const struct SOAP_ENV__Header *a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF +#endif +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out_SOAP_ENV__Header(struct soap *soap, const char *tag, int id, const struct SOAP_ENV__Header *a, const char *type) +{ + (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE_SOAP_ENV__Header), type)) + return soap->error; + return soap_element_end_out(soap, tag); +} + +SOAP_FMAC3 struct SOAP_ENV__Header * SOAP_FMAC4 soap_in_SOAP_ENV__Header(struct soap *soap, const char *tag, struct SOAP_ENV__Header *a, const char *type) +{ + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; + (void)type; /* appease -Wall -Werror */ + a = (struct SOAP_ENV__Header*)soap_id_enter(soap, soap->id, a, SOAP_TYPE_SOAP_ENV__Header, sizeof(struct SOAP_ENV__Header), NULL, NULL, NULL, NULL); + if (!a) + return NULL; + soap_default_SOAP_ENV__Header(soap, a); + if (soap->body && *soap->href != '#') + { + for (;;) + { soap->error = SOAP_TAG_MISMATCH; + if (soap->error == SOAP_TAG_MISMATCH) + soap->error = soap_ignore_element(soap); + if (soap->error == SOAP_NO_TAG) + break; + if (soap->error) + return NULL; + } + if (soap_element_end_in(soap, tag)) + return NULL; + } + else + { a = (struct SOAP_ENV__Header *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE_SOAP_ENV__Header, SOAP_TYPE_SOAP_ENV__Header, sizeof(struct SOAP_ENV__Header), 0, soap_finsert, NULL); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC1 struct SOAP_ENV__Header * SOAP_FMAC2 soap_instantiate_SOAP_ENV__Header(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "soap_instantiate_SOAP_ENV__Header(%p, %d, %s, %s)\n", (void*)soap, n, type?type:"", arrayType?arrayType:"")); + (void)type; (void)arrayType; /* appease -Wall -Werror */ + struct SOAP_ENV__Header *p; + size_t k = sizeof(struct SOAP_ENV__Header); + struct soap_clist *cp = soap_link(soap, SOAP_TYPE_SOAP_ENV__Header, n, soap_fdelete); + if (!cp && soap && n != SOAP_NO_LINK_TO_DELETE) + return NULL; + if (n < 0) + { p = SOAP_NEW(soap, struct SOAP_ENV__Header); + } + else + { p = SOAP_NEW_ARRAY(soap, struct SOAP_ENV__Header, n); + k *= n; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated struct SOAP_ENV__Header location=%p n=%d\n", (void*)p, n)); + if (size) + *size = k; + if (!p) + soap->error = SOAP_EOM; + else if (cp) + cp->ptr = (void*)p; + return p; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_put_SOAP_ENV__Header(struct soap *soap, const struct SOAP_ENV__Header *a, const char *tag, const char *type) +{ + if (soap_out_SOAP_ENV__Header(soap, tag ? tag : "SOAP-ENV:Header", -2, a, type)) + return soap->error; + return soap_putindependent(soap); +} + +SOAP_FMAC3 struct SOAP_ENV__Header * SOAP_FMAC4 soap_get_SOAP_ENV__Header(struct soap *soap, struct SOAP_ENV__Header *p, const char *tag, const char *type) +{ + if ((p = soap_in_SOAP_ENV__Header(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +#endif + +SOAP_FMAC3 void SOAP_FMAC4 soap_default___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(struct soap *soap, struct __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN *a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ + a->ns1__MT_USCOREFACTORY_USCORENUMBER_USCOREREQ = NULL; +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(struct soap *soap, const struct __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN *a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + soap_serialize_PointerTons1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(soap, &a->ns1__MT_USCOREFACTORY_USCORENUMBER_USCOREREQ); +#endif +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(struct soap *soap, const char *tag, int id, const struct __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN *a, const char *type) +{ + (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */ + if (soap_out_PointerTons1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(soap, "ns1:MT_FACTORY_NUMBER_REQ", -1, &a->ns1__MT_USCOREFACTORY_USCORENUMBER_USCOREREQ, "")) + return soap->error; + return SOAP_OK; +} + +SOAP_FMAC3 struct __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN * SOAP_FMAC4 soap_in___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(struct soap *soap, const char *tag, struct __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN *a, const char *type) +{ + size_t soap_flag_ns1__MT_USCOREFACTORY_USCORENUMBER_USCOREREQ = 1; + short soap_flag; + (void)tag; (void)type; /* appease -Wall -Werror */ + a = (struct __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN*)soap_id_enter(soap, "", a, SOAP_TYPE___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN, sizeof(struct __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN), NULL, NULL, NULL, NULL); + if (!a) + return NULL; + soap_default___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(soap, a); + for (soap_flag = 0;; soap_flag = 1) + { soap->error = SOAP_TAG_MISMATCH; + if (soap_flag_ns1__MT_USCOREFACTORY_USCORENUMBER_USCOREREQ && soap->error == SOAP_TAG_MISMATCH) + { if (soap_in_PointerTons1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(soap, "ns1:MT_FACTORY_NUMBER_REQ", &a->ns1__MT_USCOREFACTORY_USCORENUMBER_USCOREREQ, "ns1:DT_FACTORY_NUMBER_REQ")) + { soap_flag_ns1__MT_USCOREFACTORY_USCORENUMBER_USCOREREQ--; + continue; + } + } + if (soap->error == SOAP_TAG_MISMATCH && soap_flag) + { soap->error = SOAP_OK; + break; + } + if (soap_flag && soap->error == SOAP_NO_TAG) + break; + if (soap->error) + return NULL; + } + return a; +} + +SOAP_FMAC1 struct __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN * SOAP_FMAC2 soap_instantiate___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "soap_instantiate___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(%p, %d, %s, %s)\n", (void*)soap, n, type?type:"", arrayType?arrayType:"")); + (void)type; (void)arrayType; /* appease -Wall -Werror */ + struct __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN *p; + size_t k = sizeof(struct __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN); + struct soap_clist *cp = soap_link(soap, SOAP_TYPE___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN, n, soap_fdelete); + if (!cp && soap && n != SOAP_NO_LINK_TO_DELETE) + return NULL; + if (n < 0) + { p = SOAP_NEW(soap, struct __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN); + } + else + { p = SOAP_NEW_ARRAY(soap, struct __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN, n); + k *= n; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated struct __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN location=%p n=%d\n", (void*)p, n)); + if (size) + *size = k; + if (!p) + soap->error = SOAP_EOM; + else if (cp) + cp->ptr = (void*)p; + return p; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_put___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(struct soap *soap, const struct __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN *a, const char *tag, const char *type) +{ + if (soap_out___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(soap, tag ? tag : "-ns1:SI_FACTORY_NUMBER_PLM_OUT_SYN", -2, a, type)) + return soap->error; + return SOAP_OK; +} + +SOAP_FMAC3 struct __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN * SOAP_FMAC4 soap_get___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(struct soap *soap, struct __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN *p, const char *tag, const char *type) +{ + if ((p = soap_in___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_default___ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN(struct soap *soap, struct __ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN *a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ + a->ns1__MT_USCOREPROCESSROUTE_USCORES4_USCOREREQ = NULL; +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize___ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN(struct soap *soap, const struct __ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN *a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + soap_serialize_PointerTons1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ(soap, &a->ns1__MT_USCOREPROCESSROUTE_USCORES4_USCOREREQ); +#endif +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out___ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN(struct soap *soap, const char *tag, int id, const struct __ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN *a, const char *type) +{ + (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */ + if (soap_out_PointerTons1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ(soap, "ns1:MT_PROCESSROUTE_S4_REQ", -1, &a->ns1__MT_USCOREPROCESSROUTE_USCORES4_USCOREREQ, "")) + return soap->error; + return SOAP_OK; +} + +SOAP_FMAC3 struct __ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN * SOAP_FMAC4 soap_in___ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN(struct soap *soap, const char *tag, struct __ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN *a, const char *type) +{ + size_t soap_flag_ns1__MT_USCOREPROCESSROUTE_USCORES4_USCOREREQ = 1; + short soap_flag; + (void)tag; (void)type; /* appease -Wall -Werror */ + a = (struct __ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN*)soap_id_enter(soap, "", a, SOAP_TYPE___ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN, sizeof(struct __ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN), NULL, NULL, NULL, NULL); + if (!a) + return NULL; + soap_default___ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN(soap, a); + for (soap_flag = 0;; soap_flag = 1) + { soap->error = SOAP_TAG_MISMATCH; + if (soap_flag_ns1__MT_USCOREPROCESSROUTE_USCORES4_USCOREREQ && soap->error == SOAP_TAG_MISMATCH) + { if (soap_in_PointerTons1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ(soap, "ns1:MT_PROCESSROUTE_S4_REQ", &a->ns1__MT_USCOREPROCESSROUTE_USCORES4_USCOREREQ, "ns1:DT_PROCESSROUTE_S4_REQ")) + { soap_flag_ns1__MT_USCOREPROCESSROUTE_USCORES4_USCOREREQ--; + continue; + } + } + if (soap->error == SOAP_TAG_MISMATCH && soap_flag) + { soap->error = SOAP_OK; + break; + } + if (soap_flag && soap->error == SOAP_NO_TAG) + break; + if (soap->error) + return NULL; + } + return a; +} + +SOAP_FMAC1 struct __ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN * SOAP_FMAC2 soap_instantiate___ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "soap_instantiate___ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN(%p, %d, %s, %s)\n", (void*)soap, n, type?type:"", arrayType?arrayType:"")); + (void)type; (void)arrayType; /* appease -Wall -Werror */ + struct __ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN *p; + size_t k = sizeof(struct __ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN); + struct soap_clist *cp = soap_link(soap, SOAP_TYPE___ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN, n, soap_fdelete); + if (!cp && soap && n != SOAP_NO_LINK_TO_DELETE) + return NULL; + if (n < 0) + { p = SOAP_NEW(soap, struct __ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN); + } + else + { p = SOAP_NEW_ARRAY(soap, struct __ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN, n); + k *= n; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated struct __ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN location=%p n=%d\n", (void*)p, n)); + if (size) + *size = k; + if (!p) + soap->error = SOAP_EOM; + else if (cp) + cp->ptr = (void*)p; + return p; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_put___ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN(struct soap *soap, const struct __ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN *a, const char *tag, const char *type) +{ + if (soap_out___ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN(soap, tag ? tag : "-ns1:SI_PROCESSROUTE_PLM_OUT_SYN", -2, a, type)) + return soap->error; + return SOAP_OK; +} + +SOAP_FMAC3 struct __ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN * SOAP_FMAC4 soap_get___ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN(struct soap *soap, struct __ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN *p, const char *tag, const char *type) +{ + if ((p = soap_in___ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_default___ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN(struct soap *soap, struct __ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN *a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ + a->ns1__MT_USCOREBOM_USCORES4_USCOREREQ = NULL; +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize___ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN(struct soap *soap, const struct __ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN *a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + soap_serialize_PointerTons1__DT_USCOREBOM_USCORES4_USCOREREQ(soap, &a->ns1__MT_USCOREBOM_USCORES4_USCOREREQ); +#endif +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out___ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN(struct soap *soap, const char *tag, int id, const struct __ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN *a, const char *type) +{ + (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */ + if (soap_out_PointerTons1__DT_USCOREBOM_USCORES4_USCOREREQ(soap, "ns1:MT_BOM_S4_REQ", -1, &a->ns1__MT_USCOREBOM_USCORES4_USCOREREQ, "")) + return soap->error; + return SOAP_OK; +} + +SOAP_FMAC3 struct __ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN * SOAP_FMAC4 soap_in___ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN(struct soap *soap, const char *tag, struct __ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN *a, const char *type) +{ + size_t soap_flag_ns1__MT_USCOREBOM_USCORES4_USCOREREQ = 1; + short soap_flag; + (void)tag; (void)type; /* appease -Wall -Werror */ + a = (struct __ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN*)soap_id_enter(soap, "", a, SOAP_TYPE___ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN, sizeof(struct __ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN), NULL, NULL, NULL, NULL); + if (!a) + return NULL; + soap_default___ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN(soap, a); + for (soap_flag = 0;; soap_flag = 1) + { soap->error = SOAP_TAG_MISMATCH; + if (soap_flag_ns1__MT_USCOREBOM_USCORES4_USCOREREQ && soap->error == SOAP_TAG_MISMATCH) + { if (soap_in_PointerTons1__DT_USCOREBOM_USCORES4_USCOREREQ(soap, "ns1:MT_BOM_S4_REQ", &a->ns1__MT_USCOREBOM_USCORES4_USCOREREQ, "ns1:DT_BOM_S4_REQ")) + { soap_flag_ns1__MT_USCOREBOM_USCORES4_USCOREREQ--; + continue; + } + } + if (soap->error == SOAP_TAG_MISMATCH && soap_flag) + { soap->error = SOAP_OK; + break; + } + if (soap_flag && soap->error == SOAP_NO_TAG) + break; + if (soap->error) + return NULL; + } + return a; +} + +SOAP_FMAC1 struct __ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN * SOAP_FMAC2 soap_instantiate___ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "soap_instantiate___ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN(%p, %d, %s, %s)\n", (void*)soap, n, type?type:"", arrayType?arrayType:"")); + (void)type; (void)arrayType; /* appease -Wall -Werror */ + struct __ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN *p; + size_t k = sizeof(struct __ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN); + struct soap_clist *cp = soap_link(soap, SOAP_TYPE___ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN, n, soap_fdelete); + if (!cp && soap && n != SOAP_NO_LINK_TO_DELETE) + return NULL; + if (n < 0) + { p = SOAP_NEW(soap, struct __ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN); + } + else + { p = SOAP_NEW_ARRAY(soap, struct __ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN, n); + k *= n; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated struct __ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN location=%p n=%d\n", (void*)p, n)); + if (size) + *size = k; + if (!p) + soap->error = SOAP_EOM; + else if (cp) + cp->ptr = (void*)p; + return p; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_put___ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN(struct soap *soap, const struct __ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN *a, const char *tag, const char *type) +{ + if (soap_out___ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN(soap, tag ? tag : "-ns1:SIO_BOM_PLM_ASYN", -2, a, type)) + return soap->error; + return SOAP_OK; +} + +SOAP_FMAC3 struct __ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN * SOAP_FMAC4 soap_get___ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN(struct soap *soap, struct __ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN *p, const char *tag, const char *type) +{ + if ((p = soap_in___ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +#ifndef WITH_NOGLOBAL + +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerToSOAP_ENV__Reason(struct soap *soap, struct SOAP_ENV__Reason *const*a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + if (!soap_reference(soap, *a, SOAP_TYPE_SOAP_ENV__Reason)) + soap_serialize_SOAP_ENV__Reason(soap, *a); +#endif +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerToSOAP_ENV__Reason(struct soap *soap, const char *tag, int id, struct SOAP_ENV__Reason *const*a, const char *type) +{ + id = soap_element_id(soap, tag, id, *a, NULL, 0, type, SOAP_TYPE_SOAP_ENV__Reason, NULL); + if (id < 0) + return soap->error; + return soap_out_SOAP_ENV__Reason(soap, tag, id, *a, type); +} + +SOAP_FMAC3 struct SOAP_ENV__Reason ** SOAP_FMAC4 soap_in_PointerToSOAP_ENV__Reason(struct soap *soap, const char *tag, struct SOAP_ENV__Reason **a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 1, NULL)) + return NULL; + if (!a) + if (!(a = (struct SOAP_ENV__Reason **)soap_malloc(soap, sizeof(struct SOAP_ENV__Reason *)))) + return NULL; + *a = NULL; + if (!soap->null && *soap->href != '#') + { soap_revert(soap); + if (!(*a = soap_in_SOAP_ENV__Reason(soap, tag, *a, type))) + return NULL; + } + else + { a = (struct SOAP_ENV__Reason **)soap_id_lookup(soap, soap->href, (void**)a, SOAP_TYPE_SOAP_ENV__Reason, sizeof(struct SOAP_ENV__Reason), 0, NULL); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerToSOAP_ENV__Reason(struct soap *soap, struct SOAP_ENV__Reason *const*a, const char *tag, const char *type) +{ + if (soap_out_PointerToSOAP_ENV__Reason(soap, tag ? tag : "SOAP-ENV:Reason", -2, a, type)) + return soap->error; + return soap_putindependent(soap); +} + +SOAP_FMAC3 struct SOAP_ENV__Reason ** SOAP_FMAC4 soap_get_PointerToSOAP_ENV__Reason(struct soap *soap, struct SOAP_ENV__Reason **p, const char *tag, const char *type) +{ + if ((p = soap_in_PointerToSOAP_ENV__Reason(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +#endif + +#ifndef WITH_NOGLOBAL + +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerToSOAP_ENV__Detail(struct soap *soap, struct SOAP_ENV__Detail *const*a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + if (!soap_reference(soap, *a, SOAP_TYPE_SOAP_ENV__Detail)) + soap_serialize_SOAP_ENV__Detail(soap, *a); +#endif +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerToSOAP_ENV__Detail(struct soap *soap, const char *tag, int id, struct SOAP_ENV__Detail *const*a, const char *type) +{ + id = soap_element_id(soap, tag, id, *a, NULL, 0, type, SOAP_TYPE_SOAP_ENV__Detail, NULL); + if (id < 0) + return soap->error; + return soap_out_SOAP_ENV__Detail(soap, tag, id, *a, type); +} + +SOAP_FMAC3 struct SOAP_ENV__Detail ** SOAP_FMAC4 soap_in_PointerToSOAP_ENV__Detail(struct soap *soap, const char *tag, struct SOAP_ENV__Detail **a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 1, NULL)) + return NULL; + if (!a) + if (!(a = (struct SOAP_ENV__Detail **)soap_malloc(soap, sizeof(struct SOAP_ENV__Detail *)))) + return NULL; + *a = NULL; + if (!soap->null && *soap->href != '#') + { soap_revert(soap); + if (!(*a = soap_in_SOAP_ENV__Detail(soap, tag, *a, type))) + return NULL; + } + else + { a = (struct SOAP_ENV__Detail **)soap_id_lookup(soap, soap->href, (void**)a, SOAP_TYPE_SOAP_ENV__Detail, sizeof(struct SOAP_ENV__Detail), 0, NULL); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerToSOAP_ENV__Detail(struct soap *soap, struct SOAP_ENV__Detail *const*a, const char *tag, const char *type) +{ + if (soap_out_PointerToSOAP_ENV__Detail(soap, tag ? tag : "SOAP-ENV:Detail", -2, a, type)) + return soap->error; + return soap_putindependent(soap); +} + +SOAP_FMAC3 struct SOAP_ENV__Detail ** SOAP_FMAC4 soap_get_PointerToSOAP_ENV__Detail(struct soap *soap, struct SOAP_ENV__Detail **p, const char *tag, const char *type) +{ + if ((p = soap_in_PointerToSOAP_ENV__Detail(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +#endif + +#ifndef WITH_NOGLOBAL + +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerToSOAP_ENV__Code(struct soap *soap, struct SOAP_ENV__Code *const*a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + if (!soap_reference(soap, *a, SOAP_TYPE_SOAP_ENV__Code)) + soap_serialize_SOAP_ENV__Code(soap, *a); +#endif +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerToSOAP_ENV__Code(struct soap *soap, const char *tag, int id, struct SOAP_ENV__Code *const*a, const char *type) +{ + char *mark; + id = soap_element_id(soap, tag, id, *a, NULL, 0, type, SOAP_TYPE_SOAP_ENV__Code, &mark); + if (id < 0) + return soap->error; + (void)soap_out_SOAP_ENV__Code(soap, tag, id, *a, type); + soap_unmark(soap, mark); + return soap->error; +} + +SOAP_FMAC3 struct SOAP_ENV__Code ** SOAP_FMAC4 soap_in_PointerToSOAP_ENV__Code(struct soap *soap, const char *tag, struct SOAP_ENV__Code **a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 1, NULL)) + return NULL; + if (!a) + if (!(a = (struct SOAP_ENV__Code **)soap_malloc(soap, sizeof(struct SOAP_ENV__Code *)))) + return NULL; + *a = NULL; + if (!soap->null && *soap->href != '#') + { soap_revert(soap); + if (!(*a = soap_in_SOAP_ENV__Code(soap, tag, *a, type))) + return NULL; + } + else + { a = (struct SOAP_ENV__Code **)soap_id_lookup(soap, soap->href, (void**)a, SOAP_TYPE_SOAP_ENV__Code, sizeof(struct SOAP_ENV__Code), 0, NULL); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerToSOAP_ENV__Code(struct soap *soap, struct SOAP_ENV__Code *const*a, const char *tag, const char *type) +{ + if (soap_out_PointerToSOAP_ENV__Code(soap, tag ? tag : "SOAP-ENV:Code", -2, a, type)) + return soap->error; + return soap_putindependent(soap); +} + +SOAP_FMAC3 struct SOAP_ENV__Code ** SOAP_FMAC4 soap_get_PointerToSOAP_ENV__Code(struct soap *soap, struct SOAP_ENV__Code **p, const char *tag, const char *type) +{ + if ((p = soap_in_PointerToSOAP_ENV__Code(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +#endif + +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerTons1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(struct soap *soap, ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ *const*a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + if (!soap_reference(soap, *a, SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ)) + (*a)->soap_serialize(soap); +#endif +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerTons1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(struct soap *soap, const char *tag, int id, ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ *const*a, const char *type) +{ + id = soap_element_id(soap, tag, id, *a, NULL, 0, type, SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ, NULL); + if (id < 0) + return soap->error; + return (*a)->soap_out(soap, tag, id, (*a)->soap_type() == SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ ? type : NULL); +} + +SOAP_FMAC3 ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ ** SOAP_FMAC4 soap_in_PointerTons1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(struct soap *soap, const char *tag, ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ **a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 1, NULL)) + return NULL; + if (!a) + if (!(a = (ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ **)soap_malloc(soap, sizeof(ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ *)))) + return NULL; + *a = NULL; + if (!soap->null && *soap->href != '#') + { soap_revert(soap); + if (!(*a = (ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ *)soap_instantiate_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(soap, -1, soap->type, soap->arrayType, NULL))) + return NULL; + (*a)->soap_default(soap); + if (!(*a)->soap_in(soap, tag, NULL)) + { *a = NULL; + return NULL; + } + } + else + { a = (ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ **)soap_id_lookup(soap, soap->href, (void**)a, SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ, sizeof(ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ), 0, soap_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerTons1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(struct soap *soap, ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ *const*a, const char *tag, const char *type) +{ + if (soap_out_PointerTons1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(soap, tag ? tag : "ns1:DT_FACTORY_NUMBER_REQ", -2, a, type)) + return soap->error; + return soap_putindependent(soap); +} + +SOAP_FMAC3 ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ ** SOAP_FMAC4 soap_get_PointerTons1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(struct soap *soap, ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ **p, const char *tag, const char *type) +{ + if ((p = soap_in_PointerTons1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(struct soap *soap, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS *const*a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + if (!soap_reference(soap, *a, SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS)) + (*a)->soap_serialize(soap); +#endif +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(struct soap *soap, const char *tag, int id, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS *const*a, const char *type) +{ + id = soap_element_id(soap, tag, id, *a, NULL, 0, type, SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS, NULL); + if (id < 0) + return soap->error; + return (*a)->soap_out(soap, tag, id, (*a)->soap_type() == SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS ? type : NULL); +} + +SOAP_FMAC3 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS ** SOAP_FMAC4 soap_in_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(struct soap *soap, const char *tag, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS **a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 1, NULL)) + return NULL; + if (!a) + if (!(a = (_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS **)soap_malloc(soap, sizeof(_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS *)))) + return NULL; + *a = NULL; + if (!soap->null && *soap->href != '#') + { soap_revert(soap); + if (!(*a = (_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS *)soap_instantiate__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(soap, -1, soap->type, soap->arrayType, NULL))) + return NULL; + (*a)->soap_default(soap); + if (!(*a)->soap_in(soap, tag, NULL)) + { *a = NULL; + return NULL; + } + } + else + { a = (_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS **)soap_id_lookup(soap, soap->href, (void**)a, SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS, sizeof(_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS), 0, soap_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(struct soap *soap, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS *const*a, const char *tag, const char *type) +{ + if (soap_out_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(soap, tag ? tag : "ns1:DT_FACTORY_NUMBER_REQ-ITEMS", -2, a, type)) + return soap->error; + return soap_putindependent(soap); +} + +SOAP_FMAC3 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS ** SOAP_FMAC4 soap_get_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(struct soap *soap, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS **p, const char *tag, const char *type) +{ + if ((p = soap_in_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(struct soap *soap, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM *const*a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + if (!soap_reference(soap, *a, SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM)) + (*a)->soap_serialize(soap); +#endif +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(struct soap *soap, const char *tag, int id, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM *const*a, const char *type) +{ + id = soap_element_id(soap, tag, id, *a, NULL, 0, type, SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM, NULL); + if (id < 0) + return soap->error; + return (*a)->soap_out(soap, tag, id, (*a)->soap_type() == SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM ? type : NULL); +} + +SOAP_FMAC3 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM ** SOAP_FMAC4 soap_in_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(struct soap *soap, const char *tag, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM **a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 1, NULL)) + return NULL; + if (!a) + if (!(a = (_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM **)soap_malloc(soap, sizeof(_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM *)))) + return NULL; + *a = NULL; + if (!soap->null && *soap->href != '#') + { soap_revert(soap); + if (!(*a = (_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM *)soap_instantiate__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(soap, -1, soap->type, soap->arrayType, NULL))) + return NULL; + (*a)->soap_default(soap); + if (!(*a)->soap_in(soap, tag, NULL)) + { *a = NULL; + return NULL; + } + } + else + { a = (_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM **)soap_id_lookup(soap, soap->href, (void**)a, SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM, sizeof(_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM), 0, soap_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(struct soap *soap, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM *const*a, const char *tag, const char *type) +{ + if (soap_out_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(soap, tag ? tag : "ns1:DT_FACTORY_NUMBER_REQ-ITEMS-ITEM", -2, a, type)) + return soap->error; + return soap_putindependent(soap); +} + +SOAP_FMAC3 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM ** SOAP_FMAC4 soap_get_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(struct soap *soap, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM **p, const char *tag, const char *type) +{ + if ((p = soap_in_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(struct soap *soap, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO *const*a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + if (!soap_reference(soap, *a, SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO)) + (*a)->soap_serialize(soap); +#endif +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(struct soap *soap, const char *tag, int id, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO *const*a, const char *type) +{ + id = soap_element_id(soap, tag, id, *a, NULL, 0, type, SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO, NULL); + if (id < 0) + return soap->error; + return (*a)->soap_out(soap, tag, id, (*a)->soap_type() == SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO ? type : NULL); +} + +SOAP_FMAC3 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO ** SOAP_FMAC4 soap_in_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(struct soap *soap, const char *tag, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO **a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 1, NULL)) + return NULL; + if (!a) + if (!(a = (_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO **)soap_malloc(soap, sizeof(_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO *)))) + return NULL; + *a = NULL; + if (!soap->null && *soap->href != '#') + { soap_revert(soap); + if (!(*a = (_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO *)soap_instantiate__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(soap, -1, soap->type, soap->arrayType, NULL))) + return NULL; + (*a)->soap_default(soap); + if (!(*a)->soap_in(soap, tag, NULL)) + { *a = NULL; + return NULL; + } + } + else + { a = (_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO **)soap_id_lookup(soap, soap->href, (void**)a, SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO, sizeof(_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO), 0, soap_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(struct soap *soap, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO *const*a, const char *tag, const char *type) +{ + if (soap_out_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(soap, tag ? tag : "ns1:DT_FACTORY_NUMBER_REQ-BASEINFO", -2, a, type)) + return soap->error; + return soap_putindependent(soap); +} + +SOAP_FMAC3 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO ** SOAP_FMAC4 soap_get_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(struct soap *soap, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO **p, const char *tag, const char *type) +{ + if ((p = soap_in_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(struct soap *soap, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN *const*a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + if (!soap_reference(soap, *a, SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN)) + (*a)->soap_serialize(soap); +#endif +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(struct soap *soap, const char *tag, int id, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN *const*a, const char *type) +{ + id = soap_element_id(soap, tag, id, *a, NULL, 0, type, SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN, NULL); + if (id < 0) + return soap->error; + return (*a)->soap_out(soap, tag, id, (*a)->soap_type() == SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN ? type : NULL); +} + +SOAP_FMAC3 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN ** SOAP_FMAC4 soap_in_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(struct soap *soap, const char *tag, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN **a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 1, NULL)) + return NULL; + if (!a) + if (!(a = (_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN **)soap_malloc(soap, sizeof(_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN *)))) + return NULL; + *a = NULL; + if (!soap->null && *soap->href != '#') + { soap_revert(soap); + if (!(*a = (_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN *)soap_instantiate__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(soap, -1, soap->type, soap->arrayType, NULL))) + return NULL; + (*a)->soap_default(soap); + if (!(*a)->soap_in(soap, tag, NULL)) + { *a = NULL; + return NULL; + } + } + else + { a = (_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN **)soap_id_lookup(soap, soap->href, (void**)a, SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN, sizeof(_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN), 0, soap_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(struct soap *soap, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN *const*a, const char *tag, const char *type) +{ + if (soap_out_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(soap, tag ? tag : "ns1:DT_FACTORY_NUMBER_RSP-ZTABLE_RETURN", -2, a, type)) + return soap->error; + return soap_putindependent(soap); +} + +SOAP_FMAC3 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN ** SOAP_FMAC4 soap_get_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(struct soap *soap, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN **p, const char *tag, const char *type) +{ + if ((p = soap_in_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(struct soap *soap, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO *const*a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + if (!soap_reference(soap, *a, SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO)) + (*a)->soap_serialize(soap); +#endif +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(struct soap *soap, const char *tag, int id, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO *const*a, const char *type) +{ + id = soap_element_id(soap, tag, id, *a, NULL, 0, type, SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO, NULL); + if (id < 0) + return soap->error; + return (*a)->soap_out(soap, tag, id, (*a)->soap_type() == SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO ? type : NULL); +} + +SOAP_FMAC3 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO ** SOAP_FMAC4 soap_in_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(struct soap *soap, const char *tag, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO **a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 1, NULL)) + return NULL; + if (!a) + if (!(a = (_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO **)soap_malloc(soap, sizeof(_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO *)))) + return NULL; + *a = NULL; + if (!soap->null && *soap->href != '#') + { soap_revert(soap); + if (!(*a = (_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO *)soap_instantiate__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(soap, -1, soap->type, soap->arrayType, NULL))) + return NULL; + (*a)->soap_default(soap); + if (!(*a)->soap_in(soap, tag, NULL)) + { *a = NULL; + return NULL; + } + } + else + { a = (_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO **)soap_id_lookup(soap, soap->href, (void**)a, SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO, sizeof(_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO), 0, soap_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(struct soap *soap, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO *const*a, const char *tag, const char *type) +{ + if (soap_out_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(soap, tag ? tag : "ns1:DT_FACTORY_NUMBER_RSP-RSP_BASEINFO", -2, a, type)) + return soap->error; + return soap_putindependent(soap); +} + +SOAP_FMAC3 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO ** SOAP_FMAC4 soap_get_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(struct soap *soap, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO **p, const char *tag, const char *type) +{ + if ((p = soap_in_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerTons1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ(struct soap *soap, ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ *const*a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + if (!soap_reference(soap, *a, SOAP_TYPE_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ)) + (*a)->soap_serialize(soap); +#endif +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerTons1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ(struct soap *soap, const char *tag, int id, ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ *const*a, const char *type) +{ + id = soap_element_id(soap, tag, id, *a, NULL, 0, type, SOAP_TYPE_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ, NULL); + if (id < 0) + return soap->error; + return (*a)->soap_out(soap, tag, id, (*a)->soap_type() == SOAP_TYPE_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ ? type : NULL); +} + +SOAP_FMAC3 ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ ** SOAP_FMAC4 soap_in_PointerTons1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ(struct soap *soap, const char *tag, ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ **a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 1, NULL)) + return NULL; + if (!a) + if (!(a = (ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ **)soap_malloc(soap, sizeof(ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ *)))) + return NULL; + *a = NULL; + if (!soap->null && *soap->href != '#') + { soap_revert(soap); + if (!(*a = (ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ *)soap_instantiate_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ(soap, -1, soap->type, soap->arrayType, NULL))) + return NULL; + (*a)->soap_default(soap); + if (!(*a)->soap_in(soap, tag, NULL)) + { *a = NULL; + return NULL; + } + } + else + { a = (ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ **)soap_id_lookup(soap, soap->href, (void**)a, SOAP_TYPE_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ, sizeof(ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ), 0, soap_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerTons1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ(struct soap *soap, ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ *const*a, const char *tag, const char *type) +{ + if (soap_out_PointerTons1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ(soap, tag ? tag : "ns1:DT_PROCESSROUTE_S4_REQ", -2, a, type)) + return soap->error; + return soap_putindependent(soap); +} + +SOAP_FMAC3 ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ ** SOAP_FMAC4 soap_get_PointerTons1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ(struct soap *soap, ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ **p, const char *tag, const char *type) +{ + if ((p = soap_in_PointerTons1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerTo_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST(struct soap *soap, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST *const*a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + if (!soap_reference(soap, *a, SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST)) + (*a)->soap_serialize(soap); +#endif +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerTo_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST(struct soap *soap, const char *tag, int id, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST *const*a, const char *type) +{ + id = soap_element_id(soap, tag, id, *a, NULL, 0, type, SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST, NULL); + if (id < 0) + return soap->error; + return (*a)->soap_out(soap, tag, id, (*a)->soap_type() == SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST ? type : NULL); +} + +SOAP_FMAC3 _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST ** SOAP_FMAC4 soap_in_PointerTo_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST(struct soap *soap, const char *tag, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST **a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 1, NULL)) + return NULL; + if (!a) + if (!(a = (_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST **)soap_malloc(soap, sizeof(_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST *)))) + return NULL; + *a = NULL; + if (!soap->null && *soap->href != '#') + { soap_revert(soap); + if (!(*a = (_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST *)soap_instantiate__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST(soap, -1, soap->type, soap->arrayType, NULL))) + return NULL; + (*a)->soap_default(soap); + if (!(*a)->soap_in(soap, tag, NULL)) + { *a = NULL; + return NULL; + } + } + else + { a = (_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST **)soap_id_lookup(soap, soap->href, (void**)a, SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST, sizeof(_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST), 0, soap_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerTo_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST(struct soap *soap, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST *const*a, const char *tag, const char *type) +{ + if (soap_out_PointerTo_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST(soap, tag ? tag : "ns1:DT_PROCESSROUTE_S4_REQ-LIST", -2, a, type)) + return soap->error; + return soap_putindependent(soap); +} + +SOAP_FMAC3 _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST ** SOAP_FMAC4 soap_get_PointerTo_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST(struct soap *soap, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST **p, const char *tag, const char *type) +{ + if ((p = soap_in_PointerTo_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerTo_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(struct soap *soap, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM *const*a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + if (!soap_reference(soap, *a, SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM)) + (*a)->soap_serialize(soap); +#endif +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerTo_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(struct soap *soap, const char *tag, int id, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM *const*a, const char *type) +{ + id = soap_element_id(soap, tag, id, *a, NULL, 0, type, SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM, NULL); + if (id < 0) + return soap->error; + return (*a)->soap_out(soap, tag, id, (*a)->soap_type() == SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM ? type : NULL); +} + +SOAP_FMAC3 _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM ** SOAP_FMAC4 soap_in_PointerTo_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(struct soap *soap, const char *tag, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM **a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 1, NULL)) + return NULL; + if (!a) + if (!(a = (_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM **)soap_malloc(soap, sizeof(_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM *)))) + return NULL; + *a = NULL; + if (!soap->null && *soap->href != '#') + { soap_revert(soap); + if (!(*a = (_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM *)soap_instantiate__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(soap, -1, soap->type, soap->arrayType, NULL))) + return NULL; + (*a)->soap_default(soap); + if (!(*a)->soap_in(soap, tag, NULL)) + { *a = NULL; + return NULL; + } + } + else + { a = (_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM **)soap_id_lookup(soap, soap->href, (void**)a, SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM, sizeof(_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM), 0, soap_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerTo_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(struct soap *soap, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM *const*a, const char *tag, const char *type) +{ + if (soap_out_PointerTo_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(soap, tag ? tag : "ns1:DT_PROCESSROUTE_S4_REQ-LIST-ITEMS-ITEM", -2, a, type)) + return soap->error; + return soap_putindependent(soap); +} + +SOAP_FMAC3 _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM ** SOAP_FMAC4 soap_get_PointerTo_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(struct soap *soap, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM **p, const char *tag, const char *type) +{ + if ((p = soap_in_PointerTo_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerTo_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM(struct soap *soap, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM *const*a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + if (!soap_reference(soap, *a, SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM)) + (*a)->soap_serialize(soap); +#endif +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerTo_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM(struct soap *soap, const char *tag, int id, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM *const*a, const char *type) +{ + id = soap_element_id(soap, tag, id, *a, NULL, 0, type, SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM, NULL); + if (id < 0) + return soap->error; + return (*a)->soap_out(soap, tag, id, (*a)->soap_type() == SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM ? type : NULL); +} + +SOAP_FMAC3 _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM ** SOAP_FMAC4 soap_in_PointerTo_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM(struct soap *soap, const char *tag, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM **a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 1, NULL)) + return NULL; + if (!a) + if (!(a = (_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM **)soap_malloc(soap, sizeof(_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM *)))) + return NULL; + *a = NULL; + if (!soap->null && *soap->href != '#') + { soap_revert(soap); + if (!(*a = (_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM *)soap_instantiate__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM(soap, -1, soap->type, soap->arrayType, NULL))) + return NULL; + (*a)->soap_default(soap); + if (!(*a)->soap_in(soap, tag, NULL)) + { *a = NULL; + return NULL; + } + } + else + { a = (_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM **)soap_id_lookup(soap, soap->href, (void**)a, SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM, sizeof(_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM), 0, soap_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerTo_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM(struct soap *soap, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM *const*a, const char *tag, const char *type) +{ + if (soap_out_PointerTo_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM(soap, tag ? tag : "ns1:DT_PROCESSROUTE_S4_REQ-LIST-ITEMS-ITEM-SUBITEMS-SUBITEM", -2, a, type)) + return soap->error; + return soap_putindependent(soap); +} + +SOAP_FMAC3 _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM ** SOAP_FMAC4 soap_get_PointerTo_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM(struct soap *soap, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM **p, const char *tag, const char *type) +{ + if ((p = soap_in_PointerTo_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerTo_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN(struct soap *soap, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN *const*a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + if (!soap_reference(soap, *a, SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN)) + (*a)->soap_serialize(soap); +#endif +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerTo_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN(struct soap *soap, const char *tag, int id, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN *const*a, const char *type) +{ + id = soap_element_id(soap, tag, id, *a, NULL, 0, type, SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN, NULL); + if (id < 0) + return soap->error; + return (*a)->soap_out(soap, tag, id, (*a)->soap_type() == SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN ? type : NULL); +} + +SOAP_FMAC3 _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN ** SOAP_FMAC4 soap_in_PointerTo_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN(struct soap *soap, const char *tag, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN **a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 1, NULL)) + return NULL; + if (!a) + if (!(a = (_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN **)soap_malloc(soap, sizeof(_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN *)))) + return NULL; + *a = NULL; + if (!soap->null && *soap->href != '#') + { soap_revert(soap); + if (!(*a = (_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN *)soap_instantiate__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN(soap, -1, soap->type, soap->arrayType, NULL))) + return NULL; + (*a)->soap_default(soap); + if (!(*a)->soap_in(soap, tag, NULL)) + { *a = NULL; + return NULL; + } + } + else + { a = (_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN **)soap_id_lookup(soap, soap->href, (void**)a, SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN, sizeof(_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN), 0, soap_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerTo_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN(struct soap *soap, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN *const*a, const char *tag, const char *type) +{ + if (soap_out_PointerTo_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN(soap, tag ? tag : "ns1:DT_PROCESSROUTE_S4_RSP-ZTABLE_RETURN", -2, a, type)) + return soap->error; + return soap_putindependent(soap); +} + +SOAP_FMAC3 _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN ** SOAP_FMAC4 soap_get_PointerTo_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN(struct soap *soap, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN **p, const char *tag, const char *type) +{ + if ((p = soap_in_PointerTo_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerTons1__DT_USCOREBOM_USCORES4_USCOREREQ(struct soap *soap, ns1__DT_USCOREBOM_USCORES4_USCOREREQ *const*a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + if (!soap_reference(soap, *a, SOAP_TYPE_ns1__DT_USCOREBOM_USCORES4_USCOREREQ)) + (*a)->soap_serialize(soap); +#endif +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerTons1__DT_USCOREBOM_USCORES4_USCOREREQ(struct soap *soap, const char *tag, int id, ns1__DT_USCOREBOM_USCORES4_USCOREREQ *const*a, const char *type) +{ + id = soap_element_id(soap, tag, id, *a, NULL, 0, type, SOAP_TYPE_ns1__DT_USCOREBOM_USCORES4_USCOREREQ, NULL); + if (id < 0) + return soap->error; + return (*a)->soap_out(soap, tag, id, (*a)->soap_type() == SOAP_TYPE_ns1__DT_USCOREBOM_USCORES4_USCOREREQ ? type : NULL); +} + +SOAP_FMAC3 ns1__DT_USCOREBOM_USCORES4_USCOREREQ ** SOAP_FMAC4 soap_in_PointerTons1__DT_USCOREBOM_USCORES4_USCOREREQ(struct soap *soap, const char *tag, ns1__DT_USCOREBOM_USCORES4_USCOREREQ **a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 1, NULL)) + return NULL; + if (!a) + if (!(a = (ns1__DT_USCOREBOM_USCORES4_USCOREREQ **)soap_malloc(soap, sizeof(ns1__DT_USCOREBOM_USCORES4_USCOREREQ *)))) + return NULL; + *a = NULL; + if (!soap->null && *soap->href != '#') + { soap_revert(soap); + if (!(*a = (ns1__DT_USCOREBOM_USCORES4_USCOREREQ *)soap_instantiate_ns1__DT_USCOREBOM_USCORES4_USCOREREQ(soap, -1, soap->type, soap->arrayType, NULL))) + return NULL; + (*a)->soap_default(soap); + if (!(*a)->soap_in(soap, tag, NULL)) + { *a = NULL; + return NULL; + } + } + else + { a = (ns1__DT_USCOREBOM_USCORES4_USCOREREQ **)soap_id_lookup(soap, soap->href, (void**)a, SOAP_TYPE_ns1__DT_USCOREBOM_USCORES4_USCOREREQ, sizeof(ns1__DT_USCOREBOM_USCORES4_USCOREREQ), 0, soap_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerTons1__DT_USCOREBOM_USCORES4_USCOREREQ(struct soap *soap, ns1__DT_USCOREBOM_USCORES4_USCOREREQ *const*a, const char *tag, const char *type) +{ + if (soap_out_PointerTons1__DT_USCOREBOM_USCORES4_USCOREREQ(soap, tag ? tag : "ns1:DT_BOM_S4_REQ", -2, a, type)) + return soap->error; + return soap_putindependent(soap); +} + +SOAP_FMAC3 ns1__DT_USCOREBOM_USCORES4_USCOREREQ ** SOAP_FMAC4 soap_get_PointerTons1__DT_USCOREBOM_USCORES4_USCOREREQ(struct soap *soap, ns1__DT_USCOREBOM_USCORES4_USCOREREQ **p, const char *tag, const char *type) +{ + if ((p = soap_in_PointerTons1__DT_USCOREBOM_USCORES4_USCOREREQ(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerTo_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST(struct soap *soap, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST *const*a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + if (!soap_reference(soap, *a, SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST)) + (*a)->soap_serialize(soap); +#endif +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerTo_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST(struct soap *soap, const char *tag, int id, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST *const*a, const char *type) +{ + id = soap_element_id(soap, tag, id, *a, NULL, 0, type, SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST, NULL); + if (id < 0) + return soap->error; + return (*a)->soap_out(soap, tag, id, (*a)->soap_type() == SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST ? type : NULL); +} + +SOAP_FMAC3 _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST ** SOAP_FMAC4 soap_in_PointerTo_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST(struct soap *soap, const char *tag, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST **a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 1, NULL)) + return NULL; + if (!a) + if (!(a = (_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST **)soap_malloc(soap, sizeof(_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST *)))) + return NULL; + *a = NULL; + if (!soap->null && *soap->href != '#') + { soap_revert(soap); + if (!(*a = (_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST *)soap_instantiate__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST(soap, -1, soap->type, soap->arrayType, NULL))) + return NULL; + (*a)->soap_default(soap); + if (!(*a)->soap_in(soap, tag, NULL)) + { *a = NULL; + return NULL; + } + } + else + { a = (_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST **)soap_id_lookup(soap, soap->href, (void**)a, SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST, sizeof(_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST), 0, soap_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerTo_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST(struct soap *soap, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST *const*a, const char *tag, const char *type) +{ + if (soap_out_PointerTo_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST(soap, tag ? tag : "ns1:DT_BOM_S4_REQ-LIST", -2, a, type)) + return soap->error; + return soap_putindependent(soap); +} + +SOAP_FMAC3 _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST ** SOAP_FMAC4 soap_get_PointerTo_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST(struct soap *soap, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST **p, const char *tag, const char *type) +{ + if ((p = soap_in_PointerTo_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerTo_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(struct soap *soap, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM *const*a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + if (!soap_reference(soap, *a, SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM)) + (*a)->soap_serialize(soap); +#endif +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerTo_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(struct soap *soap, const char *tag, int id, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM *const*a, const char *type) +{ + id = soap_element_id(soap, tag, id, *a, NULL, 0, type, SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM, NULL); + if (id < 0) + return soap->error; + return (*a)->soap_out(soap, tag, id, (*a)->soap_type() == SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM ? type : NULL); +} + +SOAP_FMAC3 _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM ** SOAP_FMAC4 soap_in_PointerTo_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(struct soap *soap, const char *tag, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM **a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 1, NULL)) + return NULL; + if (!a) + if (!(a = (_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM **)soap_malloc(soap, sizeof(_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM *)))) + return NULL; + *a = NULL; + if (!soap->null && *soap->href != '#') + { soap_revert(soap); + if (!(*a = (_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM *)soap_instantiate__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(soap, -1, soap->type, soap->arrayType, NULL))) + return NULL; + (*a)->soap_default(soap); + if (!(*a)->soap_in(soap, tag, NULL)) + { *a = NULL; + return NULL; + } + } + else + { a = (_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM **)soap_id_lookup(soap, soap->href, (void**)a, SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM, sizeof(_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM), 0, soap_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerTo_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(struct soap *soap, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM *const*a, const char *tag, const char *type) +{ + if (soap_out_PointerTo_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(soap, tag ? tag : "ns1:DT_BOM_S4_REQ-LIST-ITEMS-ITEM", -2, a, type)) + return soap->error; + return soap_putindependent(soap); +} + +SOAP_FMAC3 _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM ** SOAP_FMAC4 soap_get_PointerTo_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(struct soap *soap, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM **p, const char *tag, const char *type) +{ + if ((p = soap_in_PointerTo_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerTo_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO(struct soap *soap, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO *const*a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + if (!soap_reference(soap, *a, SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO)) + (*a)->soap_serialize(soap); +#endif +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerTo_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO(struct soap *soap, const char *tag, int id, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO *const*a, const char *type) +{ + id = soap_element_id(soap, tag, id, *a, NULL, 0, type, SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO, NULL); + if (id < 0) + return soap->error; + return (*a)->soap_out(soap, tag, id, (*a)->soap_type() == SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO ? type : NULL); +} + +SOAP_FMAC3 _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO ** SOAP_FMAC4 soap_in_PointerTo_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO(struct soap *soap, const char *tag, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO **a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 1, NULL)) + return NULL; + if (!a) + if (!(a = (_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO **)soap_malloc(soap, sizeof(_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO *)))) + return NULL; + *a = NULL; + if (!soap->null && *soap->href != '#') + { soap_revert(soap); + if (!(*a = (_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO *)soap_instantiate__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO(soap, -1, soap->type, soap->arrayType, NULL))) + return NULL; + (*a)->soap_default(soap); + if (!(*a)->soap_in(soap, tag, NULL)) + { *a = NULL; + return NULL; + } + } + else + { a = (_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO **)soap_id_lookup(soap, soap->href, (void**)a, SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO, sizeof(_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO), 0, soap_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerTo_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO(struct soap *soap, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO *const*a, const char *tag, const char *type) +{ + if (soap_out_PointerTo_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO(soap, tag ? tag : "ns1:DT_BOM_S4_REQ-BASEINFO", -2, a, type)) + return soap->error; + return soap_putindependent(soap); +} + +SOAP_FMAC3 _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO ** SOAP_FMAC4 soap_get_PointerTo_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO(struct soap *soap, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO **p, const char *tag, const char *type) +{ + if ((p = soap_in_PointerTo_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize__QName(struct soap *soap, char *const*a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + (void)soap_reference(soap, *a, SOAP_TYPE__QName); +#endif +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out__QName(struct soap *soap, const char *tag, int id, char *const*a, const char *type) +{ + return soap_outstring(soap, tag, id, a, type, SOAP_TYPE__QName); +} + +SOAP_FMAC3 char * * SOAP_FMAC4 soap_in__QName(struct soap *soap, const char *tag, char **a, const char *type) +{ + a = soap_instring(soap, tag, a, type, SOAP_TYPE__QName, 2, 0, -1, NULL); + return a; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_put__QName(struct soap *soap, char *const*a, const char *tag, const char *type) +{ + if (soap_out__QName(soap, tag ? tag : "QName", -2, a, type)) + return soap->error; + return soap_putindependent(soap); +} + +SOAP_FMAC3 char ** SOAP_FMAC4 soap_get__QName(struct soap *soap, char **p, const char *tag, const char *type) +{ + if ((p = soap_in__QName(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_string(struct soap *soap, char *const*a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + (void)soap_reference(soap, *a, SOAP_TYPE_string); +#endif +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out_string(struct soap *soap, const char *tag, int id, char *const*a, const char *type) +{ + return soap_outstring(soap, tag, id, a, type, SOAP_TYPE_string); +} + +SOAP_FMAC3 char * * SOAP_FMAC4 soap_in_string(struct soap *soap, const char *tag, char **a, const char *type) +{ + a = soap_instring(soap, tag, a, type, SOAP_TYPE_string, 1, 0, -1, NULL); + return a; +} + +SOAP_FMAC3 char * * SOAP_FMAC4 soap_new_string(struct soap *soap, int n) +{ + char * *a = static_cast(soap_malloc(soap, (n = (n < 0 ? 1 : n)) * sizeof(char *))); + for (char * *p = a; p && n--; ++p) + soap_default_string(soap, p); + return a; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_put_string(struct soap *soap, char *const*a, const char *tag, const char *type) +{ + if (soap_out_string(soap, tag ? tag : "string", -2, a, type)) + return soap->error; + return soap_putindependent(soap); +} + +SOAP_FMAC3 char ** SOAP_FMAC4 soap_get_string(struct soap *soap, char **p, const char *tag, const char *type) +{ + if ((p = soap_in_string(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +#if defined(__BORLANDC__) +#pragma option pop +#pragma option pop +#endif + +/* End of soapC.cpp */ diff --git a/DFL_BOM_WL_TOERP/soapH.h b/DFL_BOM_WL_TOERP/soapH.h new file mode 100644 index 0000000..b0bd878 --- /dev/null +++ b/DFL_BOM_WL_TOERP/soapH.h @@ -0,0 +1,3744 @@ +/* soapH.h + Generated by gSOAP 2.8.131 for total2.h + +gSOAP XML Web services tools +Copyright (C) 2000-2023, Robert van Engelen, Genivia Inc. All Rights Reserved. +The soapcpp2 tool and its generated software are released under the GPL. +This program is released under the GPL with the additional exemption that +compiling, linking, and/or using OpenSSL is allowed. +-------------------------------------------------------------------------------- +A commercial use license is available from Genivia Inc., contact@genivia.com +-------------------------------------------------------------------------------- +*/ + +#ifndef soapH_H +#define soapH_H +#include "soapStub.h" +#ifndef WITH_NOIDREF + +#ifdef __cplusplus +extern "C" { +#endif +SOAP_FMAC3 void SOAP_FMAC4 soap_markelement(struct soap*, const void*, int); + +#ifdef __cplusplus +} +#endif +SOAP_FMAC3 int SOAP_FMAC4 soap_putindependent(struct soap*); +SOAP_FMAC3 int SOAP_FMAC4 soap_getindependent(struct soap*); +#endif + +#ifdef __cplusplus +extern "C" { +#endif +SOAP_FMAC3 void * SOAP_FMAC4 soap_getelement(struct soap*, const char*, int*); +SOAP_FMAC3 int SOAP_FMAC4 soap_putelement(struct soap*, const void*, const char*, int, int); +SOAP_FMAC3 void * SOAP_FMAC4 soap_dupelement(struct soap*, const void*, int); +SOAP_FMAC3 void SOAP_FMAC4 soap_delelement(const void*, int); + +#ifdef __cplusplus +} +#endif +SOAP_FMAC3 int SOAP_FMAC4 soap_ignore_element(struct soap*); +SOAP_FMAC3 void * SOAP_FMAC4 soap_instantiate(struct soap*, int, const char*, const char*, size_t*); +SOAP_FMAC3 int SOAP_FMAC4 soap_fdelete(struct soap *soap, struct soap_clist*); +SOAP_FMAC3 int SOAP_FMAC4 soap_fbase(int, int); +SOAP_FMAC3 void SOAP_FMAC4 soap_finsert(struct soap*, int, int, void*, size_t, const void*, void**); + +#ifndef SOAP_TYPE_byte_DEFINED +#define SOAP_TYPE_byte_DEFINED + +inline void soap_default_byte(struct soap *soap, char *a) +{ + (void)soap; /* appease -Wall -Werror */ +#ifdef SOAP_DEFAULT_byte + *a = SOAP_DEFAULT_byte; +#else + *a = (char)0; +#endif +} +SOAP_FMAC3 int SOAP_FMAC4 soap_out_byte(struct soap*, const char*, int, const char *, const char*); +SOAP_FMAC3 char * SOAP_FMAC4 soap_in_byte(struct soap*, const char*, char *, const char*); + +SOAP_FMAC3 char * SOAP_FMAC4 soap_new_byte(struct soap *soap, int n = -1); +SOAP_FMAC3 int SOAP_FMAC4 soap_put_byte(struct soap*, const char *, const char*, const char*); + +inline int soap_write_byte(struct soap *soap, char const*p) +{ + soap_free_temp(soap); + if (p) + { if (soap_begin_send(soap) || ::soap_put_byte(soap, p, "byte", "") || soap_end_send(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_PUT_byte(struct soap *soap, const char *URL, char const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || ::soap_put_byte(soap, p, "byte", "") || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH_byte(struct soap *soap, const char *URL, char const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || ::soap_put_byte(soap, p, "byte", "") || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send_byte(struct soap *soap, const char *URL, char const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || ::soap_put_byte(soap, p, "byte", "") || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 char * SOAP_FMAC4 soap_get_byte(struct soap*, char *, const char*, const char*); + +inline int soap_read_byte(struct soap *soap, char *p) +{ + if (p) + { if (soap_begin_recv(soap) || ::soap_get_byte(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET_byte(struct soap *soap, const char *URL, char *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read_byte(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv_byte(struct soap *soap, char *p) +{ + if (::soap_read_byte(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#ifndef SOAP_TYPE_int_DEFINED +#define SOAP_TYPE_int_DEFINED + +inline void soap_default_int(struct soap *soap, int *a) +{ + (void)soap; /* appease -Wall -Werror */ +#ifdef SOAP_DEFAULT_int + *a = SOAP_DEFAULT_int; +#else + *a = (int)0; +#endif +} +SOAP_FMAC3 int SOAP_FMAC4 soap_out_int(struct soap*, const char*, int, const int *, const char*); +SOAP_FMAC3 int * SOAP_FMAC4 soap_in_int(struct soap*, const char*, int *, const char*); + +SOAP_FMAC3 int * SOAP_FMAC4 soap_new_int(struct soap *soap, int n = -1); +SOAP_FMAC3 int SOAP_FMAC4 soap_put_int(struct soap*, const int *, const char*, const char*); + +inline int soap_write_int(struct soap *soap, int const*p) +{ + soap_free_temp(soap); + if (p) + { if (soap_begin_send(soap) || ::soap_put_int(soap, p, "int", "") || soap_end_send(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_PUT_int(struct soap *soap, const char *URL, int const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || ::soap_put_int(soap, p, "int", "") || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH_int(struct soap *soap, const char *URL, int const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || ::soap_put_int(soap, p, "int", "") || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send_int(struct soap *soap, const char *URL, int const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || ::soap_put_int(soap, p, "int", "") || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 int * SOAP_FMAC4 soap_get_int(struct soap*, int *, const char*, const char*); + +inline int soap_read_int(struct soap *soap, int *p) +{ + if (p) + { if (soap_begin_recv(soap) || ::soap_get_int(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET_int(struct soap *soap, const char *URL, int *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read_int(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv_int(struct soap *soap, int *p) +{ + if (::soap_read_int(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#ifndef SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM_DEFINED +#define SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM_DEFINED +SOAP_FMAC3 int SOAP_FMAC4 soap_out__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(struct soap*, const char*, int, const _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM *, const char*); +SOAP_FMAC3 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM * SOAP_FMAC4 soap_in__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(struct soap*, const char*, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM *, const char*); +SOAP_FMAC1 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM * SOAP_FMAC2 soap_instantiate__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(struct soap*, int, const char*, const char*, size_t*); + +inline _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM * soap_new__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(struct soap *soap, int n = -1) +{ + return soap_instantiate__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(soap, n, NULL, NULL, NULL); +} + +inline _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM * soap_new_req__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM( + struct soap *soap) +{ + _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM *_p = ::soap_new__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(soap); + if (_p) + { _p->soap_default(soap); + } + return _p; +} + +inline _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM * soap_new_set__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM( + struct soap *soap, + char *PSPID, + char *ZPSPID, + char *MATNR, + char *ZZD, + char *ZGH, + char *SERNR, + char *WERKS, + char *RSPOS) +{ + _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM *_p = ::soap_new__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(soap); + if (_p) + { _p->soap_default(soap); + _p->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::PSPID = PSPID; + _p->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::ZPSPID = ZPSPID; + _p->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::MATNR = MATNR; + _p->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::ZZD = ZZD; + _p->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::ZGH = ZGH; + _p->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::SERNR = SERNR; + _p->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::WERKS = WERKS; + _p->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM::RSPOS = RSPOS; + } + return _p; +} + +inline int soap_write__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(struct soap *soap, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM const*p) +{ + soap_free_temp(soap); + if (soap_begin_send(soap) || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_FACTORY_NUMBER_REQ-ITEMS-ITEM", p->soap_type() == SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM ? "" : NULL) || soap_end_send(soap)) + return soap->error; + return SOAP_OK; +} + +inline int soap_PUT__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(struct soap *soap, const char *URL, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_FACTORY_NUMBER_REQ-ITEMS-ITEM", p->soap_type() == SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(struct soap *soap, const char *URL, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_FACTORY_NUMBER_REQ-ITEMS-ITEM", p->soap_type() == SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(struct soap *soap, const char *URL, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_FACTORY_NUMBER_REQ-ITEMS-ITEM", p->soap_type() == SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM ? "" : NULL) || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM * SOAP_FMAC4 soap_get__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(struct soap*, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM *, const char*, const char*); + +inline int soap_read__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(struct soap *soap, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM *p) +{ + if (p) + { p->soap_default(soap); + if (soap_begin_recv(soap) || ::soap_get__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(struct soap *soap, const char *URL, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(struct soap *soap, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM *p) +{ + if (::soap_read__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#ifndef SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_DEFINED +#define SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_DEFINED +SOAP_FMAC3 int SOAP_FMAC4 soap_out__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(struct soap*, const char*, int, const _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS *, const char*); +SOAP_FMAC3 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS * SOAP_FMAC4 soap_in__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(struct soap*, const char*, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS *, const char*); +SOAP_FMAC1 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS * SOAP_FMAC2 soap_instantiate__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(struct soap*, int, const char*, const char*, size_t*); + +inline _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS * soap_new__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(struct soap *soap, int n = -1) +{ + return soap_instantiate__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(soap, n, NULL, NULL, NULL); +} + +inline _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS * soap_new_req__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS( + struct soap *soap, + int __sizeITEM, + _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM *ITEM) +{ + _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS *_p = ::soap_new__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(soap); + if (_p) + { _p->soap_default(soap); + _p->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS::__sizeITEM = __sizeITEM; + _p->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS::ITEM = ITEM; + } + return _p; +} + +inline _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS * soap_new_set__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS( + struct soap *soap, + int __sizeITEM, + _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM *ITEM) +{ + _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS *_p = ::soap_new__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(soap); + if (_p) + { _p->soap_default(soap); + _p->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS::__sizeITEM = __sizeITEM; + _p->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS::ITEM = ITEM; + } + return _p; +} + +inline int soap_write__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(struct soap *soap, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS const*p) +{ + soap_free_temp(soap); + if (soap_begin_send(soap) || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_FACTORY_NUMBER_REQ-ITEMS", p->soap_type() == SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS ? "" : NULL) || soap_end_send(soap)) + return soap->error; + return SOAP_OK; +} + +inline int soap_PUT__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(struct soap *soap, const char *URL, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_FACTORY_NUMBER_REQ-ITEMS", p->soap_type() == SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(struct soap *soap, const char *URL, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_FACTORY_NUMBER_REQ-ITEMS", p->soap_type() == SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(struct soap *soap, const char *URL, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_FACTORY_NUMBER_REQ-ITEMS", p->soap_type() == SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS ? "" : NULL) || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS * SOAP_FMAC4 soap_get__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(struct soap*, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS *, const char*, const char*); + +inline int soap_read__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(struct soap *soap, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS *p) +{ + if (p) + { p->soap_default(soap); + if (soap_begin_recv(soap) || ::soap_get__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(struct soap *soap, const char *URL, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(struct soap *soap, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS *p) +{ + if (::soap_read__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#ifndef SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO_DEFINED +#define SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO_DEFINED +SOAP_FMAC3 int SOAP_FMAC4 soap_out__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(struct soap*, const char*, int, const _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO *, const char*); +SOAP_FMAC3 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO * SOAP_FMAC4 soap_in__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(struct soap*, const char*, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO *, const char*); +SOAP_FMAC1 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO * SOAP_FMAC2 soap_instantiate__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(struct soap*, int, const char*, const char*, size_t*); + +inline _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO * soap_new__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(struct soap *soap, int n = -1) +{ + return soap_instantiate__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(soap, n, NULL, NULL, NULL); +} + +inline _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO * soap_new_req__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO( + struct soap *soap) +{ + _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO *_p = ::soap_new__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(soap); + if (_p) + { _p->soap_default(soap); + } + return _p; +} + +inline _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO * soap_new_set__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO( + struct soap *soap, + char *REQ_USCORETRACE_USCOREID) +{ + _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO *_p = ::soap_new__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(soap); + if (_p) + { _p->soap_default(soap); + _p->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO::REQ_USCORETRACE_USCOREID = REQ_USCORETRACE_USCOREID; + } + return _p; +} + +inline int soap_write__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(struct soap *soap, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO const*p) +{ + soap_free_temp(soap); + if (soap_begin_send(soap) || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_FACTORY_NUMBER_REQ-BASEINFO", p->soap_type() == SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO ? "" : NULL) || soap_end_send(soap)) + return soap->error; + return SOAP_OK; +} + +inline int soap_PUT__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(struct soap *soap, const char *URL, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_FACTORY_NUMBER_REQ-BASEINFO", p->soap_type() == SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(struct soap *soap, const char *URL, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_FACTORY_NUMBER_REQ-BASEINFO", p->soap_type() == SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(struct soap *soap, const char *URL, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_FACTORY_NUMBER_REQ-BASEINFO", p->soap_type() == SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO ? "" : NULL) || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO * SOAP_FMAC4 soap_get__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(struct soap*, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO *, const char*, const char*); + +inline int soap_read__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(struct soap *soap, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO *p) +{ + if (p) + { p->soap_default(soap); + if (soap_begin_recv(soap) || ::soap_get__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(struct soap *soap, const char *URL, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(struct soap *soap, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO *p) +{ + if (::soap_read__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#ifndef SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN_DEFINED +#define SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN_DEFINED +SOAP_FMAC3 int SOAP_FMAC4 soap_out__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(struct soap*, const char*, int, const _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN *, const char*); +SOAP_FMAC3 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN * SOAP_FMAC4 soap_in__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(struct soap*, const char*, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN *, const char*); +SOAP_FMAC1 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN * SOAP_FMAC2 soap_instantiate__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(struct soap*, int, const char*, const char*, size_t*); + +inline _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN * soap_new__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(struct soap *soap, int n = -1) +{ + return soap_instantiate__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(soap, n, NULL, NULL, NULL); +} + +inline _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN * soap_new_req__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN( + struct soap *soap) +{ + _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN *_p = ::soap_new__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(soap); + if (_p) + { _p->soap_default(soap); + } + return _p; +} + +inline _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN * soap_new_set__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN( + struct soap *soap, + char *SERNR, + char *TYPE, + char *MESSAGE) +{ + _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN *_p = ::soap_new__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(soap); + if (_p) + { _p->soap_default(soap); + _p->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN::SERNR = SERNR; + _p->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN::TYPE = TYPE; + _p->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN::MESSAGE = MESSAGE; + } + return _p; +} + +inline int soap_write__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(struct soap *soap, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN const*p) +{ + soap_free_temp(soap); + if (soap_begin_send(soap) || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_FACTORY_NUMBER_RSP-ZTABLE_RETURN", p->soap_type() == SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN ? "" : NULL) || soap_end_send(soap)) + return soap->error; + return SOAP_OK; +} + +inline int soap_PUT__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(struct soap *soap, const char *URL, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_FACTORY_NUMBER_RSP-ZTABLE_RETURN", p->soap_type() == SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(struct soap *soap, const char *URL, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_FACTORY_NUMBER_RSP-ZTABLE_RETURN", p->soap_type() == SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(struct soap *soap, const char *URL, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_FACTORY_NUMBER_RSP-ZTABLE_RETURN", p->soap_type() == SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN ? "" : NULL) || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN * SOAP_FMAC4 soap_get__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(struct soap*, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN *, const char*, const char*); + +inline int soap_read__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(struct soap *soap, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN *p) +{ + if (p) + { p->soap_default(soap); + if (soap_begin_recv(soap) || ::soap_get__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(struct soap *soap, const char *URL, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(struct soap *soap, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN *p) +{ + if (::soap_read__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#ifndef SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO_DEFINED +#define SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO_DEFINED +SOAP_FMAC3 int SOAP_FMAC4 soap_out__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(struct soap*, const char*, int, const _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO *, const char*); +SOAP_FMAC3 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO * SOAP_FMAC4 soap_in__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(struct soap*, const char*, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO *, const char*); +SOAP_FMAC1 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO * SOAP_FMAC2 soap_instantiate__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(struct soap*, int, const char*, const char*, size_t*); + +inline _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO * soap_new__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(struct soap *soap, int n = -1) +{ + return soap_instantiate__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(soap, n, NULL, NULL, NULL); +} + +inline _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO * soap_new_req__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO( + struct soap *soap) +{ + _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO *_p = ::soap_new__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(soap); + if (_p) + { _p->soap_default(soap); + } + return _p; +} + +inline _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO * soap_new_set__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO( + struct soap *soap, + char *REQ_USCORETRACE_USCOREID) +{ + _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO *_p = ::soap_new__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(soap); + if (_p) + { _p->soap_default(soap); + _p->_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO::REQ_USCORETRACE_USCOREID = REQ_USCORETRACE_USCOREID; + } + return _p; +} + +inline int soap_write__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(struct soap *soap, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO const*p) +{ + soap_free_temp(soap); + if (soap_begin_send(soap) || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_FACTORY_NUMBER_RSP-RSP_BASEINFO", p->soap_type() == SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO ? "" : NULL) || soap_end_send(soap)) + return soap->error; + return SOAP_OK; +} + +inline int soap_PUT__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(struct soap *soap, const char *URL, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_FACTORY_NUMBER_RSP-RSP_BASEINFO", p->soap_type() == SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(struct soap *soap, const char *URL, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_FACTORY_NUMBER_RSP-RSP_BASEINFO", p->soap_type() == SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(struct soap *soap, const char *URL, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_FACTORY_NUMBER_RSP-RSP_BASEINFO", p->soap_type() == SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO ? "" : NULL) || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO * SOAP_FMAC4 soap_get__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(struct soap*, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO *, const char*, const char*); + +inline int soap_read__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(struct soap *soap, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO *p) +{ + if (p) + { p->soap_default(soap); + if (soap_begin_recv(soap) || ::soap_get__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(struct soap *soap, const char *URL, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(struct soap *soap, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO *p) +{ + if (::soap_read__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#ifndef SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_DEFINED +#define SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_DEFINED +SOAP_FMAC3 int SOAP_FMAC4 soap_out_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(struct soap*, const char*, int, const ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ *, const char*); +SOAP_FMAC3 ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ * SOAP_FMAC4 soap_in_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(struct soap*, const char*, ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ *, const char*); +SOAP_FMAC1 ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ * SOAP_FMAC2 soap_instantiate_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(struct soap*, int, const char*, const char*, size_t*); + +inline ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ * soap_new_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(struct soap *soap, int n = -1) +{ + return soap_instantiate_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(soap, n, NULL, NULL, NULL); +} + +inline ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ * soap_new_req_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ( + struct soap *soap) +{ + ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ *_p = ::soap_new_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(soap); + if (_p) + { _p->soap_default(soap); + } + return _p; +} + +inline ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ * soap_new_set_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ( + struct soap *soap, + _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO *BASEINFO, + _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS *ITEMS) +{ + ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ *_p = ::soap_new_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(soap); + if (_p) + { _p->soap_default(soap); + _p->ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ::BASEINFO = BASEINFO; + _p->ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ::ITEMS = ITEMS; + } + return _p; +} + +inline int soap_write_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(struct soap *soap, ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ const*p) +{ + soap_free_temp(soap); + if (soap_begin_send(soap) || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_FACTORY_NUMBER_REQ", p->soap_type() == SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ ? "" : NULL) || soap_end_send(soap)) + return soap->error; + return SOAP_OK; +} + +inline int soap_PUT_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(struct soap *soap, const char *URL, ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_FACTORY_NUMBER_REQ", p->soap_type() == SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(struct soap *soap, const char *URL, ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_FACTORY_NUMBER_REQ", p->soap_type() == SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(struct soap *soap, const char *URL, ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_FACTORY_NUMBER_REQ", p->soap_type() == SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ ? "" : NULL) || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ * SOAP_FMAC4 soap_get_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(struct soap*, ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ *, const char*, const char*); + +inline int soap_read_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(struct soap *soap, ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ *p) +{ + if (p) + { p->soap_default(soap); + if (soap_begin_recv(soap) || ::soap_get_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(struct soap *soap, const char *URL, ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(struct soap *soap, ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ *p) +{ + if (::soap_read_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#ifndef SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_DEFINED +#define SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_DEFINED +SOAP_FMAC3 int SOAP_FMAC4 soap_out_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP(struct soap*, const char*, int, const ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP *, const char*); +SOAP_FMAC3 ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP * SOAP_FMAC4 soap_in_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP(struct soap*, const char*, ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP *, const char*); +SOAP_FMAC1 ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP * SOAP_FMAC2 soap_instantiate_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP(struct soap*, int, const char*, const char*, size_t*); + +inline ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP * soap_new_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP(struct soap *soap, int n = -1) +{ + return soap_instantiate_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP(soap, n, NULL, NULL, NULL); +} + +inline ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP * soap_new_req_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP( + struct soap *soap, + int __sizeZTABLE_USCORERETURN, + _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN *ZTABLE_USCORERETURN) +{ + ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP *_p = ::soap_new_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP(soap); + if (_p) + { _p->soap_default(soap); + _p->ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP::__sizeZTABLE_USCORERETURN = __sizeZTABLE_USCORERETURN; + _p->ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP::ZTABLE_USCORERETURN = ZTABLE_USCORERETURN; + } + return _p; +} + +inline ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP * soap_new_set_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP( + struct soap *soap, + _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO *RSP_USCOREBASEINFO, + int __sizeZTABLE_USCORERETURN, + _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN *ZTABLE_USCORERETURN) +{ + ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP *_p = ::soap_new_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP(soap); + if (_p) + { _p->soap_default(soap); + _p->ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP::RSP_USCOREBASEINFO = RSP_USCOREBASEINFO; + _p->ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP::__sizeZTABLE_USCORERETURN = __sizeZTABLE_USCORERETURN; + _p->ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP::ZTABLE_USCORERETURN = ZTABLE_USCORERETURN; + } + return _p; +} + +inline int soap_write_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP(struct soap *soap, ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP const*p) +{ + soap_free_temp(soap); + if (soap_begin_send(soap) || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_FACTORY_NUMBER_RSP", p->soap_type() == SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP ? "" : NULL) || soap_end_send(soap)) + return soap->error; + return SOAP_OK; +} + +inline int soap_PUT_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP(struct soap *soap, const char *URL, ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_FACTORY_NUMBER_RSP", p->soap_type() == SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP(struct soap *soap, const char *URL, ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_FACTORY_NUMBER_RSP", p->soap_type() == SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP(struct soap *soap, const char *URL, ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_FACTORY_NUMBER_RSP", p->soap_type() == SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP ? "" : NULL) || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP * SOAP_FMAC4 soap_get_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP(struct soap*, ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP *, const char*, const char*); + +inline int soap_read_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP(struct soap *soap, ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP *p) +{ + if (p) + { p->soap_default(soap); + if (soap_begin_recv(soap) || ::soap_get_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP(struct soap *soap, const char *URL, ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP(struct soap *soap, ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP *p) +{ + if (::soap_read_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#ifndef SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM_DEFINED +#define SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM_DEFINED +SOAP_FMAC3 int SOAP_FMAC4 soap_out__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM(struct soap*, const char*, int, const _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM *, const char*); +SOAP_FMAC3 _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM * SOAP_FMAC4 soap_in__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM(struct soap*, const char*, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM *, const char*); +SOAP_FMAC1 _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM * SOAP_FMAC2 soap_instantiate__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM(struct soap*, int, const char*, const char*, size_t*); + +inline _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM * soap_new__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM(struct soap *soap, int n = -1) +{ + return soap_instantiate__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM(soap, n, NULL, NULL, NULL); +} + +inline _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM * soap_new_req__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM( + struct soap *soap, + char *BMSCH, + char *VGW01, + char *VGE01, + char *VGW02, + char *VGE02) +{ + _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM *_p = ::soap_new__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM(soap); + if (_p) + { _p->soap_default(soap); + _p->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM::BMSCH = BMSCH; + _p->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM::VGW01 = VGW01; + _p->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM::VGE01 = VGE01; + _p->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM::VGW02 = VGW02; + _p->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM::VGE02 = VGE02; + } + return _p; +} + +inline _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM * soap_new_set__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM( + struct soap *soap, + char *VORNR, + char *ARBPL, + char *STEUS, + char *LTXA1, + char *USR00, + char *BMSCH, + char *PLNME, + char *VGW01, + char *VGE01, + char *VGW02, + char *VGE02, + char *VGW05, + char *VGE05) +{ + _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM *_p = ::soap_new__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM(soap); + if (_p) + { _p->soap_default(soap); + _p->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM::VORNR = VORNR; + _p->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM::ARBPL = ARBPL; + _p->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM::STEUS = STEUS; + _p->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM::LTXA1 = LTXA1; + _p->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM::USR00 = USR00; + _p->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM::BMSCH = BMSCH; + _p->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM::PLNME = PLNME; + _p->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM::VGW01 = VGW01; + _p->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM::VGE01 = VGE01; + _p->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM::VGW02 = VGW02; + _p->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM::VGE02 = VGE02; + _p->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM::VGW05 = VGW05; + _p->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM::VGE05 = VGE05; + } + return _p; +} + +inline int soap_write__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM(struct soap *soap, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM const*p) +{ + soap_free_temp(soap); + if (soap_begin_send(soap) || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_PROCESSROUTE_S4_REQ-LIST-ITEMS-ITEM-SUBITEMS-SUBITEM", p->soap_type() == SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM ? "" : NULL) || soap_end_send(soap)) + return soap->error; + return SOAP_OK; +} + +inline int soap_PUT__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM(struct soap *soap, const char *URL, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_PROCESSROUTE_S4_REQ-LIST-ITEMS-ITEM-SUBITEMS-SUBITEM", p->soap_type() == SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM(struct soap *soap, const char *URL, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_PROCESSROUTE_S4_REQ-LIST-ITEMS-ITEM-SUBITEMS-SUBITEM", p->soap_type() == SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM(struct soap *soap, const char *URL, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_PROCESSROUTE_S4_REQ-LIST-ITEMS-ITEM-SUBITEMS-SUBITEM", p->soap_type() == SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM ? "" : NULL) || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM * SOAP_FMAC4 soap_get__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM(struct soap*, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM *, const char*, const char*); + +inline int soap_read__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM(struct soap *soap, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM *p) +{ + if (p) + { p->soap_default(soap); + if (soap_begin_recv(soap) || ::soap_get__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM(struct soap *soap, const char *URL, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM(struct soap *soap, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM *p) +{ + if (::soap_read__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#ifndef SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_DEFINED +#define SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_DEFINED +SOAP_FMAC3 int SOAP_FMAC4 soap_out__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS(struct soap*, const char*, int, const _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS *, const char*); +SOAP_FMAC3 _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS * SOAP_FMAC4 soap_in__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS(struct soap*, const char*, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS *, const char*); +SOAP_FMAC1 _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS * SOAP_FMAC2 soap_instantiate__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS(struct soap*, int, const char*, const char*, size_t*); + +inline _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS * soap_new__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS(struct soap *soap, int n = -1) +{ + return soap_instantiate__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS(soap, n, NULL, NULL, NULL); +} + +inline _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS * soap_new_req__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS( + struct soap *soap, + int __sizeSUBITEM, + _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM *SUBITEM) +{ + _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS *_p = ::soap_new__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS(soap); + if (_p) + { _p->soap_default(soap); + _p->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS::__sizeSUBITEM = __sizeSUBITEM; + _p->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS::SUBITEM = SUBITEM; + } + return _p; +} + +inline _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS * soap_new_set__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS( + struct soap *soap, + int __sizeSUBITEM, + _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM *SUBITEM) +{ + _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS *_p = ::soap_new__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS(soap); + if (_p) + { _p->soap_default(soap); + _p->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS::__sizeSUBITEM = __sizeSUBITEM; + _p->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS::SUBITEM = SUBITEM; + } + return _p; +} + +inline int soap_write__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS(struct soap *soap, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS const*p) +{ + soap_free_temp(soap); + if (soap_begin_send(soap) || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_PROCESSROUTE_S4_REQ-LIST-ITEMS-ITEM-SUBITEMS", p->soap_type() == SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS ? "" : NULL) || soap_end_send(soap)) + return soap->error; + return SOAP_OK; +} + +inline int soap_PUT__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS(struct soap *soap, const char *URL, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_PROCESSROUTE_S4_REQ-LIST-ITEMS-ITEM-SUBITEMS", p->soap_type() == SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS(struct soap *soap, const char *URL, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_PROCESSROUTE_S4_REQ-LIST-ITEMS-ITEM-SUBITEMS", p->soap_type() == SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS(struct soap *soap, const char *URL, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_PROCESSROUTE_S4_REQ-LIST-ITEMS-ITEM-SUBITEMS", p->soap_type() == SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS ? "" : NULL) || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS * SOAP_FMAC4 soap_get__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS(struct soap*, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS *, const char*, const char*); + +inline int soap_read__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS(struct soap *soap, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS *p) +{ + if (p) + { p->soap_default(soap); + if (soap_begin_recv(soap) || ::soap_get__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS(struct soap *soap, const char *URL, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS(struct soap *soap, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS *p) +{ + if (::soap_read__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#ifndef SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_DEFINED +#define SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_DEFINED +SOAP_FMAC3 int SOAP_FMAC4 soap_out__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(struct soap*, const char*, int, const _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM *, const char*); +SOAP_FMAC3 _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM * SOAP_FMAC4 soap_in__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(struct soap*, const char*, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM *, const char*); +SOAP_FMAC1 _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM * SOAP_FMAC2 soap_instantiate__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(struct soap*, int, const char*, const char*, size_t*); + +inline _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM * soap_new__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(struct soap *soap, int n = -1) +{ + return soap_instantiate__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(soap, n, NULL, NULL, NULL); +} + +inline _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM * soap_new_req__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM( + struct soap *soap, + const _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS& SUBITEMS) +{ + _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM *_p = ::soap_new__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(soap); + if (_p) + { _p->soap_default(soap); + _p->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::SUBITEMS = SUBITEMS; + } + return _p; +} + +inline _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM * soap_new_set__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM( + struct soap *soap, + char *PLNAL, + char *PLNFL, + char *DATUV, + char *FLGAT, + char *BEZFL, + char *LTXA1, + char *VORNR1, + char *VORNR2, + const _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS& SUBITEMS) +{ + _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM *_p = ::soap_new__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(soap); + if (_p) + { _p->soap_default(soap); + _p->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::PLNAL = PLNAL; + _p->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::PLNFL = PLNFL; + _p->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::DATUV = DATUV; + _p->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::FLGAT = FLGAT; + _p->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::BEZFL = BEZFL; + _p->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::LTXA1 = LTXA1; + _p->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::VORNR1 = VORNR1; + _p->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::VORNR2 = VORNR2; + _p->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::SUBITEMS = SUBITEMS; + } + return _p; +} + +inline int soap_write__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(struct soap *soap, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM const*p) +{ + soap_free_temp(soap); + if (soap_begin_send(soap) || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_PROCESSROUTE_S4_REQ-LIST-ITEMS-ITEM", p->soap_type() == SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM ? "" : NULL) || soap_end_send(soap)) + return soap->error; + return SOAP_OK; +} + +inline int soap_PUT__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(struct soap *soap, const char *URL, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_PROCESSROUTE_S4_REQ-LIST-ITEMS-ITEM", p->soap_type() == SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(struct soap *soap, const char *URL, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_PROCESSROUTE_S4_REQ-LIST-ITEMS-ITEM", p->soap_type() == SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(struct soap *soap, const char *URL, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_PROCESSROUTE_S4_REQ-LIST-ITEMS-ITEM", p->soap_type() == SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM ? "" : NULL) || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM * SOAP_FMAC4 soap_get__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(struct soap*, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM *, const char*, const char*); + +inline int soap_read__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(struct soap *soap, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM *p) +{ + if (p) + { p->soap_default(soap); + if (soap_begin_recv(soap) || ::soap_get__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(struct soap *soap, const char *URL, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(struct soap *soap, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM *p) +{ + if (::soap_read__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#ifndef SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_DEFINED +#define SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_DEFINED +SOAP_FMAC3 int SOAP_FMAC4 soap_out__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS(struct soap*, const char*, int, const _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS *, const char*); +SOAP_FMAC3 _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS * SOAP_FMAC4 soap_in__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS(struct soap*, const char*, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS *, const char*); +SOAP_FMAC1 _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS * SOAP_FMAC2 soap_instantiate__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS(struct soap*, int, const char*, const char*, size_t*); + +inline _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS * soap_new__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS(struct soap *soap, int n = -1) +{ + return soap_instantiate__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS(soap, n, NULL, NULL, NULL); +} + +inline _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS * soap_new_req__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS( + struct soap *soap, + int __sizeITEM, + _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM *ITEM) +{ + _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS *_p = ::soap_new__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS(soap); + if (_p) + { _p->soap_default(soap); + _p->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS::__sizeITEM = __sizeITEM; + _p->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS::ITEM = ITEM; + } + return _p; +} + +inline _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS * soap_new_set__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS( + struct soap *soap, + int __sizeITEM, + _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM *ITEM) +{ + _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS *_p = ::soap_new__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS(soap); + if (_p) + { _p->soap_default(soap); + _p->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS::__sizeITEM = __sizeITEM; + _p->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS::ITEM = ITEM; + } + return _p; +} + +inline int soap_write__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS(struct soap *soap, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS const*p) +{ + soap_free_temp(soap); + if (soap_begin_send(soap) || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_PROCESSROUTE_S4_REQ-LIST-ITEMS", p->soap_type() == SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS ? "" : NULL) || soap_end_send(soap)) + return soap->error; + return SOAP_OK; +} + +inline int soap_PUT__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS(struct soap *soap, const char *URL, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_PROCESSROUTE_S4_REQ-LIST-ITEMS", p->soap_type() == SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS(struct soap *soap, const char *URL, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_PROCESSROUTE_S4_REQ-LIST-ITEMS", p->soap_type() == SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS(struct soap *soap, const char *URL, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_PROCESSROUTE_S4_REQ-LIST-ITEMS", p->soap_type() == SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS ? "" : NULL) || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS * SOAP_FMAC4 soap_get__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS(struct soap*, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS *, const char*, const char*); + +inline int soap_read__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS(struct soap *soap, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS *p) +{ + if (p) + { p->soap_default(soap); + if (soap_begin_recv(soap) || ::soap_get__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS(struct soap *soap, const char *URL, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS(struct soap *soap, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS *p) +{ + if (::soap_read__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#ifndef SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD_DEFINED +#define SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD_DEFINED +SOAP_FMAC3 int SOAP_FMAC4 soap_out__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD(struct soap*, const char*, int, const _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD *, const char*); +SOAP_FMAC3 _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD * SOAP_FMAC4 soap_in__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD(struct soap*, const char*, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD *, const char*); +SOAP_FMAC1 _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD * SOAP_FMAC2 soap_instantiate__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD(struct soap*, int, const char*, const char*, size_t*); + +inline _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD * soap_new__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD(struct soap *soap, int n = -1) +{ + return soap_instantiate__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD(soap, n, NULL, NULL, NULL); +} + +inline _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD * soap_new_req__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD( + struct soap *soap, + char *MATNR, + char *WERKS, + char *VERWE, + char *STATU) +{ + _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD *_p = ::soap_new__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD(soap); + if (_p) + { _p->soap_default(soap); + _p->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD::MATNR = MATNR; + _p->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD::WERKS = WERKS; + _p->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD::VERWE = VERWE; + _p->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD::STATU = STATU; + } + return _p; +} + +inline _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD * soap_new_set__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD( + struct soap *soap, + char *MATNR, + char *WERKS, + char *VERWE, + char *STATU, + char *DATUV, + char *PLNAL, + char *PSPNR) +{ + _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD *_p = ::soap_new__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD(soap); + if (_p) + { _p->soap_default(soap); + _p->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD::MATNR = MATNR; + _p->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD::WERKS = WERKS; + _p->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD::VERWE = VERWE; + _p->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD::STATU = STATU; + _p->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD::DATUV = DATUV; + _p->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD::PLNAL = PLNAL; + _p->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD::PSPNR = PSPNR; + } + return _p; +} + +inline int soap_write__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD(struct soap *soap, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD const*p) +{ + soap_free_temp(soap); + if (soap_begin_send(soap) || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_PROCESSROUTE_S4_REQ-LIST-HEAD", p->soap_type() == SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD ? "" : NULL) || soap_end_send(soap)) + return soap->error; + return SOAP_OK; +} + +inline int soap_PUT__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD(struct soap *soap, const char *URL, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_PROCESSROUTE_S4_REQ-LIST-HEAD", p->soap_type() == SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD(struct soap *soap, const char *URL, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_PROCESSROUTE_S4_REQ-LIST-HEAD", p->soap_type() == SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD(struct soap *soap, const char *URL, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_PROCESSROUTE_S4_REQ-LIST-HEAD", p->soap_type() == SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD ? "" : NULL) || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD * SOAP_FMAC4 soap_get__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD(struct soap*, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD *, const char*, const char*); + +inline int soap_read__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD(struct soap *soap, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD *p) +{ + if (p) + { p->soap_default(soap); + if (soap_begin_recv(soap) || ::soap_get__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD(struct soap *soap, const char *URL, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD(struct soap *soap, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD *p) +{ + if (::soap_read__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#ifndef SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_DEFINED +#define SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_DEFINED +SOAP_FMAC3 int SOAP_FMAC4 soap_out__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST(struct soap*, const char*, int, const _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST *, const char*); +SOAP_FMAC3 _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST * SOAP_FMAC4 soap_in__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST(struct soap*, const char*, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST *, const char*); +SOAP_FMAC1 _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST * SOAP_FMAC2 soap_instantiate__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST(struct soap*, int, const char*, const char*, size_t*); + +inline _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST * soap_new__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST(struct soap *soap, int n = -1) +{ + return soap_instantiate__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST(soap, n, NULL, NULL, NULL); +} + +inline _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST * soap_new_req__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST( + struct soap *soap, + const _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD& HEAD, + const _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS& ITEMS) +{ + _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST *_p = ::soap_new__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST(soap); + if (_p) + { _p->soap_default(soap); + _p->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST::HEAD = HEAD; + _p->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST::ITEMS = ITEMS; + } + return _p; +} + +inline _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST * soap_new_set__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST( + struct soap *soap, + const _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD& HEAD, + const _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS& ITEMS) +{ + _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST *_p = ::soap_new__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST(soap); + if (_p) + { _p->soap_default(soap); + _p->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST::HEAD = HEAD; + _p->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST::ITEMS = ITEMS; + } + return _p; +} + +inline int soap_write__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST(struct soap *soap, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST const*p) +{ + soap_free_temp(soap); + if (soap_begin_send(soap) || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_PROCESSROUTE_S4_REQ-LIST", p->soap_type() == SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST ? "" : NULL) || soap_end_send(soap)) + return soap->error; + return SOAP_OK; +} + +inline int soap_PUT__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST(struct soap *soap, const char *URL, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_PROCESSROUTE_S4_REQ-LIST", p->soap_type() == SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST(struct soap *soap, const char *URL, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_PROCESSROUTE_S4_REQ-LIST", p->soap_type() == SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST(struct soap *soap, const char *URL, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_PROCESSROUTE_S4_REQ-LIST", p->soap_type() == SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST ? "" : NULL) || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST * SOAP_FMAC4 soap_get__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST(struct soap*, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST *, const char*, const char*); + +inline int soap_read__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST(struct soap *soap, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST *p) +{ + if (p) + { p->soap_default(soap); + if (soap_begin_recv(soap) || ::soap_get__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST(struct soap *soap, const char *URL, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST(struct soap *soap, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST *p) +{ + if (::soap_read__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#ifndef SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO_DEFINED +#define SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO_DEFINED +SOAP_FMAC3 int SOAP_FMAC4 soap_out__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO(struct soap*, const char*, int, const _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO *, const char*); +SOAP_FMAC3 _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO * SOAP_FMAC4 soap_in__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO(struct soap*, const char*, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO *, const char*); +SOAP_FMAC1 _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO * SOAP_FMAC2 soap_instantiate__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO(struct soap*, int, const char*, const char*, size_t*); + +inline _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO * soap_new__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO(struct soap *soap, int n = -1) +{ + return soap_instantiate__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO(soap, n, NULL, NULL, NULL); +} + +inline _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO * soap_new_req__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO( + struct soap *soap) +{ + _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO *_p = ::soap_new__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO(soap); + if (_p) + { _p->soap_default(soap); + } + return _p; +} + +inline _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO * soap_new_set__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO( + struct soap *soap, + char *REQ_USCORETRACE_USCOREID) +{ + _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO *_p = ::soap_new__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO(soap); + if (_p) + { _p->soap_default(soap); + _p->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO::REQ_USCORETRACE_USCOREID = REQ_USCORETRACE_USCOREID; + } + return _p; +} + +inline int soap_write__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO(struct soap *soap, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO const*p) +{ + soap_free_temp(soap); + if (soap_begin_send(soap) || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_PROCESSROUTE_S4_REQ-BASEINFO", p->soap_type() == SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO ? "" : NULL) || soap_end_send(soap)) + return soap->error; + return SOAP_OK; +} + +inline int soap_PUT__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO(struct soap *soap, const char *URL, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_PROCESSROUTE_S4_REQ-BASEINFO", p->soap_type() == SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO(struct soap *soap, const char *URL, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_PROCESSROUTE_S4_REQ-BASEINFO", p->soap_type() == SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO(struct soap *soap, const char *URL, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_PROCESSROUTE_S4_REQ-BASEINFO", p->soap_type() == SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO ? "" : NULL) || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO * SOAP_FMAC4 soap_get__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO(struct soap*, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO *, const char*, const char*); + +inline int soap_read__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO(struct soap *soap, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO *p) +{ + if (p) + { p->soap_default(soap); + if (soap_begin_recv(soap) || ::soap_get__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO(struct soap *soap, const char *URL, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO(struct soap *soap, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO *p) +{ + if (::soap_read__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#ifndef SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN_DEFINED +#define SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN_DEFINED +SOAP_FMAC3 int SOAP_FMAC4 soap_out__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN(struct soap*, const char*, int, const _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN *, const char*); +SOAP_FMAC3 _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN * SOAP_FMAC4 soap_in__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN(struct soap*, const char*, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN *, const char*); +SOAP_FMAC1 _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN * SOAP_FMAC2 soap_instantiate__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN(struct soap*, int, const char*, const char*, size_t*); + +inline _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN * soap_new__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN(struct soap *soap, int n = -1) +{ + return soap_instantiate__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN(soap, n, NULL, NULL, NULL); +} + +inline _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN * soap_new_req__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN( + struct soap *soap) +{ + _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN *_p = ::soap_new__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN(soap); + if (_p) + { _p->soap_default(soap); + } + return _p; +} + +inline _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN * soap_new_set__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN( + struct soap *soap, + char *MATNR, + char *TYPE, + char *MESSAGE) +{ + _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN *_p = ::soap_new__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN(soap); + if (_p) + { _p->soap_default(soap); + _p->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN::MATNR = MATNR; + _p->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN::TYPE = TYPE; + _p->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN::MESSAGE = MESSAGE; + } + return _p; +} + +inline int soap_write__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN(struct soap *soap, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN const*p) +{ + soap_free_temp(soap); + if (soap_begin_send(soap) || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_PROCESSROUTE_S4_RSP-ZTABLE_RETURN", p->soap_type() == SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN ? "" : NULL) || soap_end_send(soap)) + return soap->error; + return SOAP_OK; +} + +inline int soap_PUT__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN(struct soap *soap, const char *URL, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_PROCESSROUTE_S4_RSP-ZTABLE_RETURN", p->soap_type() == SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN(struct soap *soap, const char *URL, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_PROCESSROUTE_S4_RSP-ZTABLE_RETURN", p->soap_type() == SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN(struct soap *soap, const char *URL, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_PROCESSROUTE_S4_RSP-ZTABLE_RETURN", p->soap_type() == SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN ? "" : NULL) || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN * SOAP_FMAC4 soap_get__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN(struct soap*, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN *, const char*, const char*); + +inline int soap_read__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN(struct soap *soap, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN *p) +{ + if (p) + { p->soap_default(soap); + if (soap_begin_recv(soap) || ::soap_get__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN(struct soap *soap, const char *URL, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN(struct soap *soap, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN *p) +{ + if (::soap_read__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#ifndef SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO_DEFINED +#define SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO_DEFINED +SOAP_FMAC3 int SOAP_FMAC4 soap_out__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO(struct soap*, const char*, int, const _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO *, const char*); +SOAP_FMAC3 _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO * SOAP_FMAC4 soap_in__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO(struct soap*, const char*, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO *, const char*); +SOAP_FMAC1 _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO * SOAP_FMAC2 soap_instantiate__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO(struct soap*, int, const char*, const char*, size_t*); + +inline _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO * soap_new__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO(struct soap *soap, int n = -1) +{ + return soap_instantiate__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO(soap, n, NULL, NULL, NULL); +} + +inline _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO * soap_new_req__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO( + struct soap *soap, + char *REQ_USCORETRACE_USCOREID) +{ + _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO *_p = ::soap_new__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO(soap); + if (_p) + { _p->soap_default(soap); + _p->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO::REQ_USCORETRACE_USCOREID = REQ_USCORETRACE_USCOREID; + } + return _p; +} + +inline _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO * soap_new_set__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO( + struct soap *soap, + char *REQ_USCORETRACE_USCOREID) +{ + _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO *_p = ::soap_new__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO(soap); + if (_p) + { _p->soap_default(soap); + _p->_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO::REQ_USCORETRACE_USCOREID = REQ_USCORETRACE_USCOREID; + } + return _p; +} + +inline int soap_write__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO(struct soap *soap, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO const*p) +{ + soap_free_temp(soap); + if (soap_begin_send(soap) || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_PROCESSROUTE_S4_RSP-RSP_BASEINFO", p->soap_type() == SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO ? "" : NULL) || soap_end_send(soap)) + return soap->error; + return SOAP_OK; +} + +inline int soap_PUT__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO(struct soap *soap, const char *URL, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_PROCESSROUTE_S4_RSP-RSP_BASEINFO", p->soap_type() == SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO(struct soap *soap, const char *URL, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_PROCESSROUTE_S4_RSP-RSP_BASEINFO", p->soap_type() == SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO(struct soap *soap, const char *URL, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_PROCESSROUTE_S4_RSP-RSP_BASEINFO", p->soap_type() == SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO ? "" : NULL) || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO * SOAP_FMAC4 soap_get__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO(struct soap*, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO *, const char*, const char*); + +inline int soap_read__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO(struct soap *soap, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO *p) +{ + if (p) + { p->soap_default(soap); + if (soap_begin_recv(soap) || ::soap_get__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO(struct soap *soap, const char *URL, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO(struct soap *soap, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO *p) +{ + if (::soap_read__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#ifndef SOAP_TYPE_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_DEFINED +#define SOAP_TYPE_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_DEFINED +SOAP_FMAC3 int SOAP_FMAC4 soap_out_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ(struct soap*, const char*, int, const ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ *, const char*); +SOAP_FMAC3 ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ * SOAP_FMAC4 soap_in_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ(struct soap*, const char*, ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ *, const char*); +SOAP_FMAC1 ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ * SOAP_FMAC2 soap_instantiate_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ(struct soap*, int, const char*, const char*, size_t*); + +inline ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ * soap_new_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ(struct soap *soap, int n = -1) +{ + return soap_instantiate_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ(soap, n, NULL, NULL, NULL); +} + +inline ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ * soap_new_req_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ( + struct soap *soap, + const _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO& BASEINFO, + int __sizeLIST, + _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST *LIST) +{ + ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ *_p = ::soap_new_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ(soap); + if (_p) + { _p->soap_default(soap); + _p->ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ::BASEINFO = BASEINFO; + _p->ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ::__sizeLIST = __sizeLIST; + _p->ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ::LIST = LIST; + } + return _p; +} + +inline ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ * soap_new_set_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ( + struct soap *soap, + const _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO& BASEINFO, + int __sizeLIST, + _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST *LIST) +{ + ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ *_p = ::soap_new_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ(soap); + if (_p) + { _p->soap_default(soap); + _p->ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ::BASEINFO = BASEINFO; + _p->ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ::__sizeLIST = __sizeLIST; + _p->ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ::LIST = LIST; + } + return _p; +} + +inline int soap_write_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ(struct soap *soap, ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ const*p) +{ + soap_free_temp(soap); + if (soap_begin_send(soap) || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_PROCESSROUTE_S4_REQ", p->soap_type() == SOAP_TYPE_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ ? "" : NULL) || soap_end_send(soap)) + return soap->error; + return SOAP_OK; +} + +inline int soap_PUT_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ(struct soap *soap, const char *URL, ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_PROCESSROUTE_S4_REQ", p->soap_type() == SOAP_TYPE_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ(struct soap *soap, const char *URL, ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_PROCESSROUTE_S4_REQ", p->soap_type() == SOAP_TYPE_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ(struct soap *soap, const char *URL, ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_PROCESSROUTE_S4_REQ", p->soap_type() == SOAP_TYPE_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ ? "" : NULL) || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ * SOAP_FMAC4 soap_get_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ(struct soap*, ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ *, const char*, const char*); + +inline int soap_read_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ(struct soap *soap, ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ *p) +{ + if (p) + { p->soap_default(soap); + if (soap_begin_recv(soap) || ::soap_get_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ(struct soap *soap, const char *URL, ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ(struct soap *soap, ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ *p) +{ + if (::soap_read_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#ifndef SOAP_TYPE_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_DEFINED +#define SOAP_TYPE_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_DEFINED +SOAP_FMAC3 int SOAP_FMAC4 soap_out_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP(struct soap*, const char*, int, const ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP *, const char*); +SOAP_FMAC3 ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP * SOAP_FMAC4 soap_in_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP(struct soap*, const char*, ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP *, const char*); +SOAP_FMAC1 ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP * SOAP_FMAC2 soap_instantiate_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP(struct soap*, int, const char*, const char*, size_t*); + +inline ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP * soap_new_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP(struct soap *soap, int n = -1) +{ + return soap_instantiate_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP(soap, n, NULL, NULL, NULL); +} + +inline ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP * soap_new_req_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP( + struct soap *soap, + const _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO& RSP_USCOREBASEINFO, + int __sizeZTABLE_USCORERETURN, + _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN *ZTABLE_USCORERETURN) +{ + ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP *_p = ::soap_new_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP(soap); + if (_p) + { _p->soap_default(soap); + _p->ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP::RSP_USCOREBASEINFO = RSP_USCOREBASEINFO; + _p->ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP::__sizeZTABLE_USCORERETURN = __sizeZTABLE_USCORERETURN; + _p->ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP::ZTABLE_USCORERETURN = ZTABLE_USCORERETURN; + } + return _p; +} + +inline ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP * soap_new_set_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP( + struct soap *soap, + const _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO& RSP_USCOREBASEINFO, + int __sizeZTABLE_USCORERETURN, + _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN *ZTABLE_USCORERETURN) +{ + ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP *_p = ::soap_new_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP(soap); + if (_p) + { _p->soap_default(soap); + _p->ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP::RSP_USCOREBASEINFO = RSP_USCOREBASEINFO; + _p->ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP::__sizeZTABLE_USCORERETURN = __sizeZTABLE_USCORERETURN; + _p->ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP::ZTABLE_USCORERETURN = ZTABLE_USCORERETURN; + } + return _p; +} + +inline int soap_write_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP(struct soap *soap, ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP const*p) +{ + soap_free_temp(soap); + if (soap_begin_send(soap) || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_PROCESSROUTE_S4_RSP", p->soap_type() == SOAP_TYPE_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP ? "" : NULL) || soap_end_send(soap)) + return soap->error; + return SOAP_OK; +} + +inline int soap_PUT_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP(struct soap *soap, const char *URL, ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_PROCESSROUTE_S4_RSP", p->soap_type() == SOAP_TYPE_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP(struct soap *soap, const char *URL, ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_PROCESSROUTE_S4_RSP", p->soap_type() == SOAP_TYPE_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP(struct soap *soap, const char *URL, ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_PROCESSROUTE_S4_RSP", p->soap_type() == SOAP_TYPE_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP ? "" : NULL) || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP * SOAP_FMAC4 soap_get_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP(struct soap*, ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP *, const char*, const char*); + +inline int soap_read_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP(struct soap *soap, ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP *p) +{ + if (p) + { p->soap_default(soap); + if (soap_begin_recv(soap) || ::soap_get_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP(struct soap *soap, const char *URL, ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP(struct soap *soap, ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP *p) +{ + if (::soap_read_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#ifndef SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_DEFINED +#define SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_DEFINED +SOAP_FMAC3 int SOAP_FMAC4 soap_out__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(struct soap*, const char*, int, const _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM *, const char*); +SOAP_FMAC3 _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM * SOAP_FMAC4 soap_in__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(struct soap*, const char*, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM *, const char*); +SOAP_FMAC1 _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM * SOAP_FMAC2 soap_instantiate__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(struct soap*, int, const char*, const char*, size_t*); + +inline _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM * soap_new__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(struct soap *soap, int n = -1) +{ + return soap_instantiate__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(soap, n, NULL, NULL, NULL); +} + +inline _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM * soap_new_req__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM( + struct soap *soap, + char *POSTP, + char *POSNR, + char *IDNRK, + char *MENGE) +{ + _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM *_p = ::soap_new__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(soap); + if (_p) + { _p->soap_default(soap); + _p->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::POSTP = POSTP; + _p->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::POSNR = POSNR; + _p->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::IDNRK = IDNRK; + _p->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::MENGE = MENGE; + } + return _p; +} + +inline _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM * soap_new_set__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM( + struct soap *soap, + char *DATUV, + char *POSTP, + char *POSNR, + char *IDNRK, + char *MENGE, + char *MEINS, + char *SORTF, + char *POTX1) +{ + _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM *_p = ::soap_new__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(soap); + if (_p) + { _p->soap_default(soap); + _p->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::DATUV = DATUV; + _p->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::POSTP = POSTP; + _p->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::POSNR = POSNR; + _p->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::IDNRK = IDNRK; + _p->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::MENGE = MENGE; + _p->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::MEINS = MEINS; + _p->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::SORTF = SORTF; + _p->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM::POTX1 = POTX1; + } + return _p; +} + +inline int soap_write__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(struct soap *soap, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM const*p) +{ + soap_free_temp(soap); + if (soap_begin_send(soap) || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_BOM_S4_REQ-LIST-ITEMS-ITEM", p->soap_type() == SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM ? "" : NULL) || soap_end_send(soap)) + return soap->error; + return SOAP_OK; +} + +inline int soap_PUT__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(struct soap *soap, const char *URL, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_BOM_S4_REQ-LIST-ITEMS-ITEM", p->soap_type() == SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(struct soap *soap, const char *URL, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_BOM_S4_REQ-LIST-ITEMS-ITEM", p->soap_type() == SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(struct soap *soap, const char *URL, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_BOM_S4_REQ-LIST-ITEMS-ITEM", p->soap_type() == SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM ? "" : NULL) || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM * SOAP_FMAC4 soap_get__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(struct soap*, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM *, const char*, const char*); + +inline int soap_read__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(struct soap *soap, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM *p) +{ + if (p) + { p->soap_default(soap); + if (soap_begin_recv(soap) || ::soap_get__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(struct soap *soap, const char *URL, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(struct soap *soap, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM *p) +{ + if (::soap_read__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#ifndef SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_DEFINED +#define SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_DEFINED +SOAP_FMAC3 int SOAP_FMAC4 soap_out__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS(struct soap*, const char*, int, const _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS *, const char*); +SOAP_FMAC3 _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS * SOAP_FMAC4 soap_in__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS(struct soap*, const char*, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS *, const char*); +SOAP_FMAC1 _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS * SOAP_FMAC2 soap_instantiate__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS(struct soap*, int, const char*, const char*, size_t*); + +inline _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS * soap_new__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS(struct soap *soap, int n = -1) +{ + return soap_instantiate__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS(soap, n, NULL, NULL, NULL); +} + +inline _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS * soap_new_req__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS( + struct soap *soap, + int __sizeITEM, + _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM *ITEM) +{ + _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS *_p = ::soap_new__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS(soap); + if (_p) + { _p->soap_default(soap); + _p->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS::__sizeITEM = __sizeITEM; + _p->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS::ITEM = ITEM; + } + return _p; +} + +inline _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS * soap_new_set__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS( + struct soap *soap, + int __sizeITEM, + _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM *ITEM) +{ + _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS *_p = ::soap_new__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS(soap); + if (_p) + { _p->soap_default(soap); + _p->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS::__sizeITEM = __sizeITEM; + _p->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS::ITEM = ITEM; + } + return _p; +} + +inline int soap_write__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS(struct soap *soap, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS const*p) +{ + soap_free_temp(soap); + if (soap_begin_send(soap) || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_BOM_S4_REQ-LIST-ITEMS", p->soap_type() == SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS ? "" : NULL) || soap_end_send(soap)) + return soap->error; + return SOAP_OK; +} + +inline int soap_PUT__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS(struct soap *soap, const char *URL, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_BOM_S4_REQ-LIST-ITEMS", p->soap_type() == SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS(struct soap *soap, const char *URL, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_BOM_S4_REQ-LIST-ITEMS", p->soap_type() == SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS(struct soap *soap, const char *URL, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_BOM_S4_REQ-LIST-ITEMS", p->soap_type() == SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS ? "" : NULL) || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS * SOAP_FMAC4 soap_get__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS(struct soap*, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS *, const char*, const char*); + +inline int soap_read__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS(struct soap *soap, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS *p) +{ + if (p) + { p->soap_default(soap); + if (soap_begin_recv(soap) || ::soap_get__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS(struct soap *soap, const char *URL, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS(struct soap *soap, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS *p) +{ + if (::soap_read__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#ifndef SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD_DEFINED +#define SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD_DEFINED +SOAP_FMAC3 int SOAP_FMAC4 soap_out__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD(struct soap*, const char*, int, const _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD *, const char*); +SOAP_FMAC3 _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD * SOAP_FMAC4 soap_in__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD(struct soap*, const char*, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD *, const char*); +SOAP_FMAC1 _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD * SOAP_FMAC2 soap_instantiate__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD(struct soap*, int, const char*, const char*, size_t*); + +inline _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD * soap_new__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD(struct soap *soap, int n = -1) +{ + return soap_instantiate__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD(soap, n, NULL, NULL, NULL); +} + +inline _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD * soap_new_req__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD( + struct soap *soap, + char *MATNR, + char *WERKS, + char *BMENG) +{ + _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD *_p = ::soap_new__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD(soap); + if (_p) + { _p->soap_default(soap); + _p->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD::MATNR = MATNR; + _p->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD::WERKS = WERKS; + _p->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD::BMENG = BMENG; + } + return _p; +} + +inline _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD * soap_new_set__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD( + struct soap *soap, + char *PSPNR, + char *MATNR, + char *WERKS, + char *DATUV, + char *STLAN, + char *STLAL, + char *BMENG, + char *BMEIN, + char *STKTX) +{ + _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD *_p = ::soap_new__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD(soap); + if (_p) + { _p->soap_default(soap); + _p->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD::PSPNR = PSPNR; + _p->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD::MATNR = MATNR; + _p->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD::WERKS = WERKS; + _p->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD::DATUV = DATUV; + _p->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD::STLAN = STLAN; + _p->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD::STLAL = STLAL; + _p->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD::BMENG = BMENG; + _p->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD::BMEIN = BMEIN; + _p->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD::STKTX = STKTX; + } + return _p; +} + +inline int soap_write__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD(struct soap *soap, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD const*p) +{ + soap_free_temp(soap); + if (soap_begin_send(soap) || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_BOM_S4_REQ-LIST-HEAD", p->soap_type() == SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD ? "" : NULL) || soap_end_send(soap)) + return soap->error; + return SOAP_OK; +} + +inline int soap_PUT__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD(struct soap *soap, const char *URL, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_BOM_S4_REQ-LIST-HEAD", p->soap_type() == SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD(struct soap *soap, const char *URL, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_BOM_S4_REQ-LIST-HEAD", p->soap_type() == SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD(struct soap *soap, const char *URL, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_BOM_S4_REQ-LIST-HEAD", p->soap_type() == SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD ? "" : NULL) || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD * SOAP_FMAC4 soap_get__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD(struct soap*, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD *, const char*, const char*); + +inline int soap_read__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD(struct soap *soap, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD *p) +{ + if (p) + { p->soap_default(soap); + if (soap_begin_recv(soap) || ::soap_get__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD(struct soap *soap, const char *URL, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD(struct soap *soap, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD *p) +{ + if (::soap_read__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#ifndef SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_DEFINED +#define SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_DEFINED +SOAP_FMAC3 int SOAP_FMAC4 soap_out__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST(struct soap*, const char*, int, const _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST *, const char*); +SOAP_FMAC3 _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST * SOAP_FMAC4 soap_in__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST(struct soap*, const char*, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST *, const char*); +SOAP_FMAC1 _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST * SOAP_FMAC2 soap_instantiate__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST(struct soap*, int, const char*, const char*, size_t*); + +inline _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST * soap_new__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST(struct soap *soap, int n = -1) +{ + return soap_instantiate__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST(soap, n, NULL, NULL, NULL); +} + +inline _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST * soap_new_req__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST( + struct soap *soap, + const _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD& HEAD, + const _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS& ITEMS) +{ + _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST *_p = ::soap_new__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST(soap); + if (_p) + { _p->soap_default(soap); + _p->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST::HEAD = HEAD; + _p->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST::ITEMS = ITEMS; + } + return _p; +} + +inline _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST * soap_new_set__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST( + struct soap *soap, + const _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD& HEAD, + const _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS& ITEMS) +{ + _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST *_p = ::soap_new__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST(soap); + if (_p) + { _p->soap_default(soap); + _p->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST::HEAD = HEAD; + _p->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST::ITEMS = ITEMS; + } + return _p; +} + +inline int soap_write__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST(struct soap *soap, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST const*p) +{ + soap_free_temp(soap); + if (soap_begin_send(soap) || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_BOM_S4_REQ-LIST", p->soap_type() == SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST ? "" : NULL) || soap_end_send(soap)) + return soap->error; + return SOAP_OK; +} + +inline int soap_PUT__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST(struct soap *soap, const char *URL, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_BOM_S4_REQ-LIST", p->soap_type() == SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST(struct soap *soap, const char *URL, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_BOM_S4_REQ-LIST", p->soap_type() == SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST(struct soap *soap, const char *URL, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_BOM_S4_REQ-LIST", p->soap_type() == SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST ? "" : NULL) || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST * SOAP_FMAC4 soap_get__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST(struct soap*, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST *, const char*, const char*); + +inline int soap_read__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST(struct soap *soap, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST *p) +{ + if (p) + { p->soap_default(soap); + if (soap_begin_recv(soap) || ::soap_get__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST(struct soap *soap, const char *URL, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST(struct soap *soap, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST *p) +{ + if (::soap_read__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#ifndef SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO_DEFINED +#define SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO_DEFINED +SOAP_FMAC3 int SOAP_FMAC4 soap_out__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO(struct soap*, const char*, int, const _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO *, const char*); +SOAP_FMAC3 _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO * SOAP_FMAC4 soap_in__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO(struct soap*, const char*, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO *, const char*); +SOAP_FMAC1 _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO * SOAP_FMAC2 soap_instantiate__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO(struct soap*, int, const char*, const char*, size_t*); + +inline _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO * soap_new__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO(struct soap *soap, int n = -1) +{ + return soap_instantiate__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO(soap, n, NULL, NULL, NULL); +} + +inline _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO * soap_new_req__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO( + struct soap *soap) +{ + _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO *_p = ::soap_new__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO(soap); + if (_p) + { _p->soap_default(soap); + } + return _p; +} + +inline _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO * soap_new_set__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO( + struct soap *soap, + char *REQ_USCORETRACE_USCOREID) +{ + _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO *_p = ::soap_new__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO(soap); + if (_p) + { _p->soap_default(soap); + _p->_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO::REQ_USCORETRACE_USCOREID = REQ_USCORETRACE_USCOREID; + } + return _p; +} + +inline int soap_write__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO(struct soap *soap, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO const*p) +{ + soap_free_temp(soap); + if (soap_begin_send(soap) || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_BOM_S4_REQ-BASEINFO", p->soap_type() == SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO ? "" : NULL) || soap_end_send(soap)) + return soap->error; + return SOAP_OK; +} + +inline int soap_PUT__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO(struct soap *soap, const char *URL, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_BOM_S4_REQ-BASEINFO", p->soap_type() == SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO(struct soap *soap, const char *URL, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_BOM_S4_REQ-BASEINFO", p->soap_type() == SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO(struct soap *soap, const char *URL, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_BOM_S4_REQ-BASEINFO", p->soap_type() == SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO ? "" : NULL) || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO * SOAP_FMAC4 soap_get__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO(struct soap*, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO *, const char*, const char*); + +inline int soap_read__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO(struct soap *soap, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO *p) +{ + if (p) + { p->soap_default(soap); + if (soap_begin_recv(soap) || ::soap_get__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO(struct soap *soap, const char *URL, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO(struct soap *soap, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO *p) +{ + if (::soap_read__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#ifndef SOAP_TYPE_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_DEFINED +#define SOAP_TYPE_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_DEFINED +SOAP_FMAC3 int SOAP_FMAC4 soap_out_ns1__DT_USCOREBOM_USCORES4_USCOREREQ(struct soap*, const char*, int, const ns1__DT_USCOREBOM_USCORES4_USCOREREQ *, const char*); +SOAP_FMAC3 ns1__DT_USCOREBOM_USCORES4_USCOREREQ * SOAP_FMAC4 soap_in_ns1__DT_USCOREBOM_USCORES4_USCOREREQ(struct soap*, const char*, ns1__DT_USCOREBOM_USCORES4_USCOREREQ *, const char*); +SOAP_FMAC1 ns1__DT_USCOREBOM_USCORES4_USCOREREQ * SOAP_FMAC2 soap_instantiate_ns1__DT_USCOREBOM_USCORES4_USCOREREQ(struct soap*, int, const char*, const char*, size_t*); + +inline ns1__DT_USCOREBOM_USCORES4_USCOREREQ * soap_new_ns1__DT_USCOREBOM_USCORES4_USCOREREQ(struct soap *soap, int n = -1) +{ + return soap_instantiate_ns1__DT_USCOREBOM_USCORES4_USCOREREQ(soap, n, NULL, NULL, NULL); +} + +inline ns1__DT_USCOREBOM_USCORES4_USCOREREQ * soap_new_req_ns1__DT_USCOREBOM_USCORES4_USCOREREQ( + struct soap *soap, + int __sizeLIST, + _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST *LIST) +{ + ns1__DT_USCOREBOM_USCORES4_USCOREREQ *_p = ::soap_new_ns1__DT_USCOREBOM_USCORES4_USCOREREQ(soap); + if (_p) + { _p->soap_default(soap); + _p->ns1__DT_USCOREBOM_USCORES4_USCOREREQ::__sizeLIST = __sizeLIST; + _p->ns1__DT_USCOREBOM_USCORES4_USCOREREQ::LIST = LIST; + } + return _p; +} + +inline ns1__DT_USCOREBOM_USCORES4_USCOREREQ * soap_new_set_ns1__DT_USCOREBOM_USCORES4_USCOREREQ( + struct soap *soap, + _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO *BASEINFO, + int __sizeLIST, + _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST *LIST) +{ + ns1__DT_USCOREBOM_USCORES4_USCOREREQ *_p = ::soap_new_ns1__DT_USCOREBOM_USCORES4_USCOREREQ(soap); + if (_p) + { _p->soap_default(soap); + _p->ns1__DT_USCOREBOM_USCORES4_USCOREREQ::BASEINFO = BASEINFO; + _p->ns1__DT_USCOREBOM_USCORES4_USCOREREQ::__sizeLIST = __sizeLIST; + _p->ns1__DT_USCOREBOM_USCORES4_USCOREREQ::LIST = LIST; + } + return _p; +} + +inline int soap_write_ns1__DT_USCOREBOM_USCORES4_USCOREREQ(struct soap *soap, ns1__DT_USCOREBOM_USCORES4_USCOREREQ const*p) +{ + soap_free_temp(soap); + if (soap_begin_send(soap) || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_BOM_S4_REQ", p->soap_type() == SOAP_TYPE_ns1__DT_USCOREBOM_USCORES4_USCOREREQ ? "" : NULL) || soap_end_send(soap)) + return soap->error; + return SOAP_OK; +} + +inline int soap_PUT_ns1__DT_USCOREBOM_USCORES4_USCOREREQ(struct soap *soap, const char *URL, ns1__DT_USCOREBOM_USCORES4_USCOREREQ const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_BOM_S4_REQ", p->soap_type() == SOAP_TYPE_ns1__DT_USCOREBOM_USCORES4_USCOREREQ ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH_ns1__DT_USCOREBOM_USCORES4_USCOREREQ(struct soap *soap, const char *URL, ns1__DT_USCOREBOM_USCORES4_USCOREREQ const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_BOM_S4_REQ", p->soap_type() == SOAP_TYPE_ns1__DT_USCOREBOM_USCORES4_USCOREREQ ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send_ns1__DT_USCOREBOM_USCORES4_USCOREREQ(struct soap *soap, const char *URL, ns1__DT_USCOREBOM_USCORES4_USCOREREQ const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "ns1:DT_BOM_S4_REQ", p->soap_type() == SOAP_TYPE_ns1__DT_USCOREBOM_USCORES4_USCOREREQ ? "" : NULL) || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 ns1__DT_USCOREBOM_USCORES4_USCOREREQ * SOAP_FMAC4 soap_get_ns1__DT_USCOREBOM_USCORES4_USCOREREQ(struct soap*, ns1__DT_USCOREBOM_USCORES4_USCOREREQ *, const char*, const char*); + +inline int soap_read_ns1__DT_USCOREBOM_USCORES4_USCOREREQ(struct soap *soap, ns1__DT_USCOREBOM_USCORES4_USCOREREQ *p) +{ + if (p) + { p->soap_default(soap); + if (soap_begin_recv(soap) || ::soap_get_ns1__DT_USCOREBOM_USCORES4_USCOREREQ(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET_ns1__DT_USCOREBOM_USCORES4_USCOREREQ(struct soap *soap, const char *URL, ns1__DT_USCOREBOM_USCORES4_USCOREREQ *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read_ns1__DT_USCOREBOM_USCORES4_USCOREREQ(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv_ns1__DT_USCOREBOM_USCORES4_USCOREREQ(struct soap *soap, ns1__DT_USCOREBOM_USCORES4_USCOREREQ *p) +{ + if (::soap_read_ns1__DT_USCOREBOM_USCORES4_USCOREREQ(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#ifndef WITH_NOGLOBAL + +#ifndef SOAP_TYPE_SOAP_ENV__Fault_DEFINED +#define SOAP_TYPE_SOAP_ENV__Fault_DEFINED +SOAP_FMAC3 void SOAP_FMAC4 soap_default_SOAP_ENV__Fault(struct soap*, struct SOAP_ENV__Fault *); +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_SOAP_ENV__Fault(struct soap*, const struct SOAP_ENV__Fault *); +SOAP_FMAC3 int SOAP_FMAC4 soap_out_SOAP_ENV__Fault(struct soap*, const char*, int, const struct SOAP_ENV__Fault *, const char*); +SOAP_FMAC3 struct SOAP_ENV__Fault * SOAP_FMAC4 soap_in_SOAP_ENV__Fault(struct soap*, const char*, struct SOAP_ENV__Fault *, const char*); +SOAP_FMAC1 struct SOAP_ENV__Fault * SOAP_FMAC2 soap_instantiate_SOAP_ENV__Fault(struct soap*, int, const char*, const char*, size_t*); + +inline struct SOAP_ENV__Fault * soap_new_SOAP_ENV__Fault(struct soap *soap, int n = -1) +{ + return soap_instantiate_SOAP_ENV__Fault(soap, n, NULL, NULL, NULL); +} + +inline struct SOAP_ENV__Fault * soap_new_req_SOAP_ENV__Fault( + struct soap *soap) +{ + struct SOAP_ENV__Fault *_p = ::soap_new_SOAP_ENV__Fault(soap); + if (_p) + { ::soap_default_SOAP_ENV__Fault(soap, _p); + } + return _p; +} + +inline struct SOAP_ENV__Fault * soap_new_set_SOAP_ENV__Fault( + struct soap *soap, + char *faultcode, + char *faultstring, + char *faultactor, + struct SOAP_ENV__Detail *detail, + struct SOAP_ENV__Code *SOAP_ENV__Code, + struct SOAP_ENV__Reason *SOAP_ENV__Reason, + char *SOAP_ENV__Node, + char *SOAP_ENV__Role, + struct SOAP_ENV__Detail *SOAP_ENV__Detail) +{ + struct SOAP_ENV__Fault *_p = ::soap_new_SOAP_ENV__Fault(soap); + if (_p) + { ::soap_default_SOAP_ENV__Fault(soap, _p); + _p->faultcode = faultcode; + _p->faultstring = faultstring; + _p->faultactor = faultactor; + _p->detail = detail; + _p->SOAP_ENV__Code = SOAP_ENV__Code; + _p->SOAP_ENV__Reason = SOAP_ENV__Reason; + _p->SOAP_ENV__Node = SOAP_ENV__Node; + _p->SOAP_ENV__Role = SOAP_ENV__Role; + _p->SOAP_ENV__Detail = SOAP_ENV__Detail; + } + return _p; +} +SOAP_FMAC3 int SOAP_FMAC4 soap_put_SOAP_ENV__Fault(struct soap*, const struct SOAP_ENV__Fault *, const char*, const char*); + +inline int soap_write_SOAP_ENV__Fault(struct soap *soap, struct SOAP_ENV__Fault const*p) +{ + soap_free_temp(soap); + if (soap_begin_send(soap) || (::soap_serialize_SOAP_ENV__Fault(soap, p), 0) || ::soap_put_SOAP_ENV__Fault(soap, p, "SOAP-ENV:Fault", "") || soap_end_send(soap)) + return soap->error; + return SOAP_OK; +} + +inline int soap_PUT_SOAP_ENV__Fault(struct soap *soap, const char *URL, struct SOAP_ENV__Fault const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize_SOAP_ENV__Fault(soap, p), 0) || ::soap_put_SOAP_ENV__Fault(soap, p, "SOAP-ENV:Fault", "") || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH_SOAP_ENV__Fault(struct soap *soap, const char *URL, struct SOAP_ENV__Fault const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize_SOAP_ENV__Fault(soap, p), 0) || ::soap_put_SOAP_ENV__Fault(soap, p, "SOAP-ENV:Fault", "") || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send_SOAP_ENV__Fault(struct soap *soap, const char *URL, struct SOAP_ENV__Fault const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize_SOAP_ENV__Fault(soap, p), 0) || ::soap_put_SOAP_ENV__Fault(soap, p, "SOAP-ENV:Fault", "") || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 struct SOAP_ENV__Fault * SOAP_FMAC4 soap_get_SOAP_ENV__Fault(struct soap*, struct SOAP_ENV__Fault *, const char*, const char*); + +inline int soap_read_SOAP_ENV__Fault(struct soap *soap, struct SOAP_ENV__Fault *p) +{ + if (p) + { ::soap_default_SOAP_ENV__Fault(soap, p); + if (soap_begin_recv(soap) || ::soap_get_SOAP_ENV__Fault(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET_SOAP_ENV__Fault(struct soap *soap, const char *URL, struct SOAP_ENV__Fault *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read_SOAP_ENV__Fault(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv_SOAP_ENV__Fault(struct soap *soap, struct SOAP_ENV__Fault *p) +{ + if (::soap_read_SOAP_ENV__Fault(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#endif + +#ifndef WITH_NOGLOBAL + +#ifndef SOAP_TYPE_SOAP_ENV__Reason_DEFINED +#define SOAP_TYPE_SOAP_ENV__Reason_DEFINED +SOAP_FMAC3 void SOAP_FMAC4 soap_default_SOAP_ENV__Reason(struct soap*, struct SOAP_ENV__Reason *); +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_SOAP_ENV__Reason(struct soap*, const struct SOAP_ENV__Reason *); +SOAP_FMAC3 int SOAP_FMAC4 soap_out_SOAP_ENV__Reason(struct soap*, const char*, int, const struct SOAP_ENV__Reason *, const char*); +SOAP_FMAC3 struct SOAP_ENV__Reason * SOAP_FMAC4 soap_in_SOAP_ENV__Reason(struct soap*, const char*, struct SOAP_ENV__Reason *, const char*); +SOAP_FMAC1 struct SOAP_ENV__Reason * SOAP_FMAC2 soap_instantiate_SOAP_ENV__Reason(struct soap*, int, const char*, const char*, size_t*); + +inline struct SOAP_ENV__Reason * soap_new_SOAP_ENV__Reason(struct soap *soap, int n = -1) +{ + return soap_instantiate_SOAP_ENV__Reason(soap, n, NULL, NULL, NULL); +} + +inline struct SOAP_ENV__Reason * soap_new_req_SOAP_ENV__Reason( + struct soap *soap) +{ + struct SOAP_ENV__Reason *_p = ::soap_new_SOAP_ENV__Reason(soap); + if (_p) + { ::soap_default_SOAP_ENV__Reason(soap, _p); + } + return _p; +} + +inline struct SOAP_ENV__Reason * soap_new_set_SOAP_ENV__Reason( + struct soap *soap, + char *SOAP_ENV__Text) +{ + struct SOAP_ENV__Reason *_p = ::soap_new_SOAP_ENV__Reason(soap); + if (_p) + { ::soap_default_SOAP_ENV__Reason(soap, _p); + _p->SOAP_ENV__Text = SOAP_ENV__Text; + } + return _p; +} +SOAP_FMAC3 int SOAP_FMAC4 soap_put_SOAP_ENV__Reason(struct soap*, const struct SOAP_ENV__Reason *, const char*, const char*); + +inline int soap_write_SOAP_ENV__Reason(struct soap *soap, struct SOAP_ENV__Reason const*p) +{ + soap_free_temp(soap); + if (soap_begin_send(soap) || (::soap_serialize_SOAP_ENV__Reason(soap, p), 0) || ::soap_put_SOAP_ENV__Reason(soap, p, "SOAP-ENV:Reason", "") || soap_end_send(soap)) + return soap->error; + return SOAP_OK; +} + +inline int soap_PUT_SOAP_ENV__Reason(struct soap *soap, const char *URL, struct SOAP_ENV__Reason const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize_SOAP_ENV__Reason(soap, p), 0) || ::soap_put_SOAP_ENV__Reason(soap, p, "SOAP-ENV:Reason", "") || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH_SOAP_ENV__Reason(struct soap *soap, const char *URL, struct SOAP_ENV__Reason const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize_SOAP_ENV__Reason(soap, p), 0) || ::soap_put_SOAP_ENV__Reason(soap, p, "SOAP-ENV:Reason", "") || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send_SOAP_ENV__Reason(struct soap *soap, const char *URL, struct SOAP_ENV__Reason const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize_SOAP_ENV__Reason(soap, p), 0) || ::soap_put_SOAP_ENV__Reason(soap, p, "SOAP-ENV:Reason", "") || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 struct SOAP_ENV__Reason * SOAP_FMAC4 soap_get_SOAP_ENV__Reason(struct soap*, struct SOAP_ENV__Reason *, const char*, const char*); + +inline int soap_read_SOAP_ENV__Reason(struct soap *soap, struct SOAP_ENV__Reason *p) +{ + if (p) + { ::soap_default_SOAP_ENV__Reason(soap, p); + if (soap_begin_recv(soap) || ::soap_get_SOAP_ENV__Reason(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET_SOAP_ENV__Reason(struct soap *soap, const char *URL, struct SOAP_ENV__Reason *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read_SOAP_ENV__Reason(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv_SOAP_ENV__Reason(struct soap *soap, struct SOAP_ENV__Reason *p) +{ + if (::soap_read_SOAP_ENV__Reason(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#endif + +#ifndef WITH_NOGLOBAL + +#ifndef SOAP_TYPE_SOAP_ENV__Detail_DEFINED +#define SOAP_TYPE_SOAP_ENV__Detail_DEFINED +SOAP_FMAC3 void SOAP_FMAC4 soap_default_SOAP_ENV__Detail(struct soap*, struct SOAP_ENV__Detail *); +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_SOAP_ENV__Detail(struct soap*, const struct SOAP_ENV__Detail *); +SOAP_FMAC3 int SOAP_FMAC4 soap_out_SOAP_ENV__Detail(struct soap*, const char*, int, const struct SOAP_ENV__Detail *, const char*); +SOAP_FMAC3 struct SOAP_ENV__Detail * SOAP_FMAC4 soap_in_SOAP_ENV__Detail(struct soap*, const char*, struct SOAP_ENV__Detail *, const char*); +SOAP_FMAC1 struct SOAP_ENV__Detail * SOAP_FMAC2 soap_instantiate_SOAP_ENV__Detail(struct soap*, int, const char*, const char*, size_t*); + +inline struct SOAP_ENV__Detail * soap_new_SOAP_ENV__Detail(struct soap *soap, int n = -1) +{ + return soap_instantiate_SOAP_ENV__Detail(soap, n, NULL, NULL, NULL); +} + +inline struct SOAP_ENV__Detail * soap_new_req_SOAP_ENV__Detail( + struct soap *soap, + int __type, + void *fault) +{ + struct SOAP_ENV__Detail *_p = ::soap_new_SOAP_ENV__Detail(soap); + if (_p) + { ::soap_default_SOAP_ENV__Detail(soap, _p); + _p->__type = __type; + _p->fault = fault; + } + return _p; +} + +inline struct SOAP_ENV__Detail * soap_new_set_SOAP_ENV__Detail( + struct soap *soap, + char *__any, + int __type, + void *fault) +{ + struct SOAP_ENV__Detail *_p = ::soap_new_SOAP_ENV__Detail(soap); + if (_p) + { ::soap_default_SOAP_ENV__Detail(soap, _p); + _p->__any = __any; + _p->__type = __type; + _p->fault = fault; + } + return _p; +} +SOAP_FMAC3 int SOAP_FMAC4 soap_put_SOAP_ENV__Detail(struct soap*, const struct SOAP_ENV__Detail *, const char*, const char*); + +inline int soap_write_SOAP_ENV__Detail(struct soap *soap, struct SOAP_ENV__Detail const*p) +{ + soap_free_temp(soap); + if (soap_begin_send(soap) || (::soap_serialize_SOAP_ENV__Detail(soap, p), 0) || ::soap_put_SOAP_ENV__Detail(soap, p, "SOAP-ENV:Detail", "") || soap_end_send(soap)) + return soap->error; + return SOAP_OK; +} + +inline int soap_PUT_SOAP_ENV__Detail(struct soap *soap, const char *URL, struct SOAP_ENV__Detail const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize_SOAP_ENV__Detail(soap, p), 0) || ::soap_put_SOAP_ENV__Detail(soap, p, "SOAP-ENV:Detail", "") || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH_SOAP_ENV__Detail(struct soap *soap, const char *URL, struct SOAP_ENV__Detail const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize_SOAP_ENV__Detail(soap, p), 0) || ::soap_put_SOAP_ENV__Detail(soap, p, "SOAP-ENV:Detail", "") || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send_SOAP_ENV__Detail(struct soap *soap, const char *URL, struct SOAP_ENV__Detail const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize_SOAP_ENV__Detail(soap, p), 0) || ::soap_put_SOAP_ENV__Detail(soap, p, "SOAP-ENV:Detail", "") || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 struct SOAP_ENV__Detail * SOAP_FMAC4 soap_get_SOAP_ENV__Detail(struct soap*, struct SOAP_ENV__Detail *, const char*, const char*); + +inline int soap_read_SOAP_ENV__Detail(struct soap *soap, struct SOAP_ENV__Detail *p) +{ + if (p) + { ::soap_default_SOAP_ENV__Detail(soap, p); + if (soap_begin_recv(soap) || ::soap_get_SOAP_ENV__Detail(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET_SOAP_ENV__Detail(struct soap *soap, const char *URL, struct SOAP_ENV__Detail *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read_SOAP_ENV__Detail(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv_SOAP_ENV__Detail(struct soap *soap, struct SOAP_ENV__Detail *p) +{ + if (::soap_read_SOAP_ENV__Detail(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#endif + +#ifndef WITH_NOGLOBAL + +#ifndef SOAP_TYPE_SOAP_ENV__Code_DEFINED +#define SOAP_TYPE_SOAP_ENV__Code_DEFINED +SOAP_FMAC3 void SOAP_FMAC4 soap_default_SOAP_ENV__Code(struct soap*, struct SOAP_ENV__Code *); +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_SOAP_ENV__Code(struct soap*, const struct SOAP_ENV__Code *); +SOAP_FMAC3 int SOAP_FMAC4 soap_out_SOAP_ENV__Code(struct soap*, const char*, int, const struct SOAP_ENV__Code *, const char*); +SOAP_FMAC3 struct SOAP_ENV__Code * SOAP_FMAC4 soap_in_SOAP_ENV__Code(struct soap*, const char*, struct SOAP_ENV__Code *, const char*); +SOAP_FMAC1 struct SOAP_ENV__Code * SOAP_FMAC2 soap_instantiate_SOAP_ENV__Code(struct soap*, int, const char*, const char*, size_t*); + +inline struct SOAP_ENV__Code * soap_new_SOAP_ENV__Code(struct soap *soap, int n = -1) +{ + return soap_instantiate_SOAP_ENV__Code(soap, n, NULL, NULL, NULL); +} + +inline struct SOAP_ENV__Code * soap_new_req_SOAP_ENV__Code( + struct soap *soap) +{ + struct SOAP_ENV__Code *_p = ::soap_new_SOAP_ENV__Code(soap); + if (_p) + { ::soap_default_SOAP_ENV__Code(soap, _p); + } + return _p; +} + +inline struct SOAP_ENV__Code * soap_new_set_SOAP_ENV__Code( + struct soap *soap, + char *SOAP_ENV__Value, + struct SOAP_ENV__Code *SOAP_ENV__Subcode) +{ + struct SOAP_ENV__Code *_p = ::soap_new_SOAP_ENV__Code(soap); + if (_p) + { ::soap_default_SOAP_ENV__Code(soap, _p); + _p->SOAP_ENV__Value = SOAP_ENV__Value; + _p->SOAP_ENV__Subcode = SOAP_ENV__Subcode; + } + return _p; +} +SOAP_FMAC3 int SOAP_FMAC4 soap_put_SOAP_ENV__Code(struct soap*, const struct SOAP_ENV__Code *, const char*, const char*); + +inline int soap_write_SOAP_ENV__Code(struct soap *soap, struct SOAP_ENV__Code const*p) +{ + soap_free_temp(soap); + if (soap_begin_send(soap) || (::soap_serialize_SOAP_ENV__Code(soap, p), 0) || ::soap_put_SOAP_ENV__Code(soap, p, "SOAP-ENV:Code", "") || soap_end_send(soap)) + return soap->error; + return SOAP_OK; +} + +inline int soap_PUT_SOAP_ENV__Code(struct soap *soap, const char *URL, struct SOAP_ENV__Code const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize_SOAP_ENV__Code(soap, p), 0) || ::soap_put_SOAP_ENV__Code(soap, p, "SOAP-ENV:Code", "") || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH_SOAP_ENV__Code(struct soap *soap, const char *URL, struct SOAP_ENV__Code const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize_SOAP_ENV__Code(soap, p), 0) || ::soap_put_SOAP_ENV__Code(soap, p, "SOAP-ENV:Code", "") || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send_SOAP_ENV__Code(struct soap *soap, const char *URL, struct SOAP_ENV__Code const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize_SOAP_ENV__Code(soap, p), 0) || ::soap_put_SOAP_ENV__Code(soap, p, "SOAP-ENV:Code", "") || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 struct SOAP_ENV__Code * SOAP_FMAC4 soap_get_SOAP_ENV__Code(struct soap*, struct SOAP_ENV__Code *, const char*, const char*); + +inline int soap_read_SOAP_ENV__Code(struct soap *soap, struct SOAP_ENV__Code *p) +{ + if (p) + { ::soap_default_SOAP_ENV__Code(soap, p); + if (soap_begin_recv(soap) || ::soap_get_SOAP_ENV__Code(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET_SOAP_ENV__Code(struct soap *soap, const char *URL, struct SOAP_ENV__Code *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read_SOAP_ENV__Code(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv_SOAP_ENV__Code(struct soap *soap, struct SOAP_ENV__Code *p) +{ + if (::soap_read_SOAP_ENV__Code(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#endif + +#ifndef WITH_NOGLOBAL + +#ifndef SOAP_TYPE_SOAP_ENV__Header_DEFINED +#define SOAP_TYPE_SOAP_ENV__Header_DEFINED +SOAP_FMAC3 void SOAP_FMAC4 soap_default_SOAP_ENV__Header(struct soap*, struct SOAP_ENV__Header *); +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_SOAP_ENV__Header(struct soap*, const struct SOAP_ENV__Header *); +SOAP_FMAC3 int SOAP_FMAC4 soap_out_SOAP_ENV__Header(struct soap*, const char*, int, const struct SOAP_ENV__Header *, const char*); +SOAP_FMAC3 struct SOAP_ENV__Header * SOAP_FMAC4 soap_in_SOAP_ENV__Header(struct soap*, const char*, struct SOAP_ENV__Header *, const char*); +SOAP_FMAC1 struct SOAP_ENV__Header * SOAP_FMAC2 soap_instantiate_SOAP_ENV__Header(struct soap*, int, const char*, const char*, size_t*); + +inline struct SOAP_ENV__Header * soap_new_SOAP_ENV__Header(struct soap *soap, int n = -1) +{ + return soap_instantiate_SOAP_ENV__Header(soap, n, NULL, NULL, NULL); +} + +inline struct SOAP_ENV__Header * soap_new_req_SOAP_ENV__Header( + struct soap *soap) +{ + struct SOAP_ENV__Header *_p = ::soap_new_SOAP_ENV__Header(soap); + if (_p) + { ::soap_default_SOAP_ENV__Header(soap, _p); + } + return _p; +} + +inline struct SOAP_ENV__Header * soap_new_set_SOAP_ENV__Header( + struct soap *soap) +{ + struct SOAP_ENV__Header *_p = ::soap_new_SOAP_ENV__Header(soap); + if (_p) + { ::soap_default_SOAP_ENV__Header(soap, _p); + } + return _p; +} +SOAP_FMAC3 int SOAP_FMAC4 soap_put_SOAP_ENV__Header(struct soap*, const struct SOAP_ENV__Header *, const char*, const char*); + +inline int soap_write_SOAP_ENV__Header(struct soap *soap, struct SOAP_ENV__Header const*p) +{ + soap_free_temp(soap); + if (soap_begin_send(soap) || (::soap_serialize_SOAP_ENV__Header(soap, p), 0) || ::soap_put_SOAP_ENV__Header(soap, p, "SOAP-ENV:Header", "") || soap_end_send(soap)) + return soap->error; + return SOAP_OK; +} + +inline int soap_PUT_SOAP_ENV__Header(struct soap *soap, const char *URL, struct SOAP_ENV__Header const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize_SOAP_ENV__Header(soap, p), 0) || ::soap_put_SOAP_ENV__Header(soap, p, "SOAP-ENV:Header", "") || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH_SOAP_ENV__Header(struct soap *soap, const char *URL, struct SOAP_ENV__Header const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize_SOAP_ENV__Header(soap, p), 0) || ::soap_put_SOAP_ENV__Header(soap, p, "SOAP-ENV:Header", "") || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send_SOAP_ENV__Header(struct soap *soap, const char *URL, struct SOAP_ENV__Header const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize_SOAP_ENV__Header(soap, p), 0) || ::soap_put_SOAP_ENV__Header(soap, p, "SOAP-ENV:Header", "") || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 struct SOAP_ENV__Header * SOAP_FMAC4 soap_get_SOAP_ENV__Header(struct soap*, struct SOAP_ENV__Header *, const char*, const char*); + +inline int soap_read_SOAP_ENV__Header(struct soap *soap, struct SOAP_ENV__Header *p) +{ + if (p) + { ::soap_default_SOAP_ENV__Header(soap, p); + if (soap_begin_recv(soap) || ::soap_get_SOAP_ENV__Header(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET_SOAP_ENV__Header(struct soap *soap, const char *URL, struct SOAP_ENV__Header *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read_SOAP_ENV__Header(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv_SOAP_ENV__Header(struct soap *soap, struct SOAP_ENV__Header *p) +{ + if (::soap_read_SOAP_ENV__Header(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#endif + +#ifndef SOAP_TYPE___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN_DEFINED +#define SOAP_TYPE___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN_DEFINED +SOAP_FMAC3 void SOAP_FMAC4 soap_default___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(struct soap*, struct __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN *); +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(struct soap*, const struct __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN *); +SOAP_FMAC3 int SOAP_FMAC4 soap_out___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(struct soap*, const char*, int, const struct __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN *, const char*); +SOAP_FMAC3 struct __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN * SOAP_FMAC4 soap_in___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(struct soap*, const char*, struct __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN *, const char*); +SOAP_FMAC1 struct __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN * SOAP_FMAC2 soap_instantiate___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(struct soap*, int, const char*, const char*, size_t*); + +inline struct __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN * soap_new___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(struct soap *soap, int n = -1) +{ + return soap_instantiate___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(soap, n, NULL, NULL, NULL); +} + +inline struct __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN * soap_new_req___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN( + struct soap *soap) +{ + struct __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN *_p = ::soap_new___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(soap); + if (_p) + { ::soap_default___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(soap, _p); + } + return _p; +} + +inline struct __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN * soap_new_set___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN( + struct soap *soap, + ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ *ns1__MT_USCOREFACTORY_USCORENUMBER_USCOREREQ) +{ + struct __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN *_p = ::soap_new___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(soap); + if (_p) + { ::soap_default___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(soap, _p); + _p->ns1__MT_USCOREFACTORY_USCORENUMBER_USCOREREQ = ns1__MT_USCOREFACTORY_USCORENUMBER_USCOREREQ; + } + return _p; +} +SOAP_FMAC3 int SOAP_FMAC4 soap_put___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(struct soap*, const struct __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN *, const char*, const char*); + +inline int soap_write___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(struct soap *soap, struct __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN const*p) +{ + soap_free_temp(soap); + if (soap_begin_send(soap) || (::soap_serialize___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(soap, p), 0) || ::soap_put___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(soap, p, "-ns1:SI_FACTORY_NUMBER_PLM_OUT_SYN", "") || soap_end_send(soap)) + return soap->error; + return SOAP_OK; +} + +inline int soap_PUT___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(struct soap *soap, const char *URL, struct __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(soap, p), 0) || ::soap_put___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(soap, p, "-ns1:SI_FACTORY_NUMBER_PLM_OUT_SYN", "") || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(struct soap *soap, const char *URL, struct __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(soap, p), 0) || ::soap_put___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(soap, p, "-ns1:SI_FACTORY_NUMBER_PLM_OUT_SYN", "") || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(struct soap *soap, const char *URL, struct __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(soap, p), 0) || ::soap_put___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(soap, p, "-ns1:SI_FACTORY_NUMBER_PLM_OUT_SYN", "") || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 struct __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN * SOAP_FMAC4 soap_get___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(struct soap*, struct __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN *, const char*, const char*); + +inline int soap_read___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(struct soap *soap, struct __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN *p) +{ + if (p) + { ::soap_default___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(soap, p); + if (soap_begin_recv(soap) || ::soap_get___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(struct soap *soap, const char *URL, struct __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(struct soap *soap, struct __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN *p) +{ + if (::soap_read___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#ifndef SOAP_TYPE___ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN_DEFINED +#define SOAP_TYPE___ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN_DEFINED +SOAP_FMAC3 void SOAP_FMAC4 soap_default___ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN(struct soap*, struct __ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN *); +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize___ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN(struct soap*, const struct __ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN *); +SOAP_FMAC3 int SOAP_FMAC4 soap_out___ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN(struct soap*, const char*, int, const struct __ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN *, const char*); +SOAP_FMAC3 struct __ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN * SOAP_FMAC4 soap_in___ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN(struct soap*, const char*, struct __ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN *, const char*); +SOAP_FMAC1 struct __ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN * SOAP_FMAC2 soap_instantiate___ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN(struct soap*, int, const char*, const char*, size_t*); + +inline struct __ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN * soap_new___ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN(struct soap *soap, int n = -1) +{ + return soap_instantiate___ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN(soap, n, NULL, NULL, NULL); +} + +inline struct __ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN * soap_new_req___ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN( + struct soap *soap) +{ + struct __ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN *_p = ::soap_new___ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN(soap); + if (_p) + { ::soap_default___ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN(soap, _p); + } + return _p; +} + +inline struct __ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN * soap_new_set___ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN( + struct soap *soap, + ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ *ns1__MT_USCOREPROCESSROUTE_USCORES4_USCOREREQ) +{ + struct __ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN *_p = ::soap_new___ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN(soap); + if (_p) + { ::soap_default___ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN(soap, _p); + _p->ns1__MT_USCOREPROCESSROUTE_USCORES4_USCOREREQ = ns1__MT_USCOREPROCESSROUTE_USCORES4_USCOREREQ; + } + return _p; +} +SOAP_FMAC3 int SOAP_FMAC4 soap_put___ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN(struct soap*, const struct __ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN *, const char*, const char*); + +inline int soap_write___ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN(struct soap *soap, struct __ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN const*p) +{ + soap_free_temp(soap); + if (soap_begin_send(soap) || (::soap_serialize___ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN(soap, p), 0) || ::soap_put___ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN(soap, p, "-ns1:SI_PROCESSROUTE_PLM_OUT_SYN", "") || soap_end_send(soap)) + return soap->error; + return SOAP_OK; +} + +inline int soap_PUT___ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN(struct soap *soap, const char *URL, struct __ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize___ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN(soap, p), 0) || ::soap_put___ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN(soap, p, "-ns1:SI_PROCESSROUTE_PLM_OUT_SYN", "") || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH___ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN(struct soap *soap, const char *URL, struct __ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize___ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN(soap, p), 0) || ::soap_put___ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN(soap, p, "-ns1:SI_PROCESSROUTE_PLM_OUT_SYN", "") || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send___ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN(struct soap *soap, const char *URL, struct __ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize___ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN(soap, p), 0) || ::soap_put___ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN(soap, p, "-ns1:SI_PROCESSROUTE_PLM_OUT_SYN", "") || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 struct __ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN * SOAP_FMAC4 soap_get___ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN(struct soap*, struct __ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN *, const char*, const char*); + +inline int soap_read___ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN(struct soap *soap, struct __ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN *p) +{ + if (p) + { ::soap_default___ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN(soap, p); + if (soap_begin_recv(soap) || ::soap_get___ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET___ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN(struct soap *soap, const char *URL, struct __ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read___ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv___ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN(struct soap *soap, struct __ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN *p) +{ + if (::soap_read___ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#ifndef SOAP_TYPE___ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN_DEFINED +#define SOAP_TYPE___ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN_DEFINED +SOAP_FMAC3 void SOAP_FMAC4 soap_default___ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN(struct soap*, struct __ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN *); +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize___ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN(struct soap*, const struct __ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN *); +SOAP_FMAC3 int SOAP_FMAC4 soap_out___ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN(struct soap*, const char*, int, const struct __ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN *, const char*); +SOAP_FMAC3 struct __ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN * SOAP_FMAC4 soap_in___ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN(struct soap*, const char*, struct __ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN *, const char*); +SOAP_FMAC1 struct __ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN * SOAP_FMAC2 soap_instantiate___ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN(struct soap*, int, const char*, const char*, size_t*); + +inline struct __ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN * soap_new___ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN(struct soap *soap, int n = -1) +{ + return soap_instantiate___ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN(soap, n, NULL, NULL, NULL); +} + +inline struct __ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN * soap_new_req___ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN( + struct soap *soap) +{ + struct __ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN *_p = ::soap_new___ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN(soap); + if (_p) + { ::soap_default___ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN(soap, _p); + } + return _p; +} + +inline struct __ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN * soap_new_set___ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN( + struct soap *soap, + ns1__DT_USCOREBOM_USCORES4_USCOREREQ *ns1__MT_USCOREBOM_USCORES4_USCOREREQ) +{ + struct __ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN *_p = ::soap_new___ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN(soap); + if (_p) + { ::soap_default___ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN(soap, _p); + _p->ns1__MT_USCOREBOM_USCORES4_USCOREREQ = ns1__MT_USCOREBOM_USCORES4_USCOREREQ; + } + return _p; +} +SOAP_FMAC3 int SOAP_FMAC4 soap_put___ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN(struct soap*, const struct __ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN *, const char*, const char*); + +inline int soap_write___ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN(struct soap *soap, struct __ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN const*p) +{ + soap_free_temp(soap); + if (soap_begin_send(soap) || (::soap_serialize___ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN(soap, p), 0) || ::soap_put___ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN(soap, p, "-ns1:SIO_BOM_PLM_ASYN", "") || soap_end_send(soap)) + return soap->error; + return SOAP_OK; +} + +inline int soap_PUT___ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN(struct soap *soap, const char *URL, struct __ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize___ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN(soap, p), 0) || ::soap_put___ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN(soap, p, "-ns1:SIO_BOM_PLM_ASYN", "") || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH___ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN(struct soap *soap, const char *URL, struct __ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize___ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN(soap, p), 0) || ::soap_put___ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN(soap, p, "-ns1:SIO_BOM_PLM_ASYN", "") || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send___ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN(struct soap *soap, const char *URL, struct __ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize___ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN(soap, p), 0) || ::soap_put___ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN(soap, p, "-ns1:SIO_BOM_PLM_ASYN", "") || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 struct __ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN * SOAP_FMAC4 soap_get___ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN(struct soap*, struct __ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN *, const char*, const char*); + +inline int soap_read___ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN(struct soap *soap, struct __ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN *p) +{ + if (p) + { ::soap_default___ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN(soap, p); + if (soap_begin_recv(soap) || ::soap_get___ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET___ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN(struct soap *soap, const char *URL, struct __ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read___ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv___ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN(struct soap *soap, struct __ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN *p) +{ + if (::soap_read___ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#ifndef WITH_NOGLOBAL + +#ifndef SOAP_TYPE_PointerToSOAP_ENV__Reason_DEFINED +#define SOAP_TYPE_PointerToSOAP_ENV__Reason_DEFINED +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerToSOAP_ENV__Reason(struct soap*, struct SOAP_ENV__Reason *const*); +SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerToSOAP_ENV__Reason(struct soap*, const char *, int, struct SOAP_ENV__Reason *const*, const char *); +SOAP_FMAC3 struct SOAP_ENV__Reason ** SOAP_FMAC4 soap_in_PointerToSOAP_ENV__Reason(struct soap*, const char*, struct SOAP_ENV__Reason **, const char*); +SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerToSOAP_ENV__Reason(struct soap*, struct SOAP_ENV__Reason *const*, const char*, const char*); +SOAP_FMAC3 struct SOAP_ENV__Reason ** SOAP_FMAC4 soap_get_PointerToSOAP_ENV__Reason(struct soap*, struct SOAP_ENV__Reason **, const char*, const char*); +#endif + +#endif + +#ifndef WITH_NOGLOBAL + +#ifndef SOAP_TYPE_PointerToSOAP_ENV__Detail_DEFINED +#define SOAP_TYPE_PointerToSOAP_ENV__Detail_DEFINED +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerToSOAP_ENV__Detail(struct soap*, struct SOAP_ENV__Detail *const*); +SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerToSOAP_ENV__Detail(struct soap*, const char *, int, struct SOAP_ENV__Detail *const*, const char *); +SOAP_FMAC3 struct SOAP_ENV__Detail ** SOAP_FMAC4 soap_in_PointerToSOAP_ENV__Detail(struct soap*, const char*, struct SOAP_ENV__Detail **, const char*); +SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerToSOAP_ENV__Detail(struct soap*, struct SOAP_ENV__Detail *const*, const char*, const char*); +SOAP_FMAC3 struct SOAP_ENV__Detail ** SOAP_FMAC4 soap_get_PointerToSOAP_ENV__Detail(struct soap*, struct SOAP_ENV__Detail **, const char*, const char*); +#endif + +#endif + +#ifndef WITH_NOGLOBAL + +#ifndef SOAP_TYPE_PointerToSOAP_ENV__Code_DEFINED +#define SOAP_TYPE_PointerToSOAP_ENV__Code_DEFINED +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerToSOAP_ENV__Code(struct soap*, struct SOAP_ENV__Code *const*); +SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerToSOAP_ENV__Code(struct soap*, const char *, int, struct SOAP_ENV__Code *const*, const char *); +SOAP_FMAC3 struct SOAP_ENV__Code ** SOAP_FMAC4 soap_in_PointerToSOAP_ENV__Code(struct soap*, const char*, struct SOAP_ENV__Code **, const char*); +SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerToSOAP_ENV__Code(struct soap*, struct SOAP_ENV__Code *const*, const char*, const char*); +SOAP_FMAC3 struct SOAP_ENV__Code ** SOAP_FMAC4 soap_get_PointerToSOAP_ENV__Code(struct soap*, struct SOAP_ENV__Code **, const char*, const char*); +#endif + +#endif + +#ifndef SOAP_TYPE_PointerTons1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_DEFINED +#define SOAP_TYPE_PointerTons1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_DEFINED +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerTons1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(struct soap*, ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ *const*); +SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerTons1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(struct soap*, const char *, int, ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ *const*, const char *); +SOAP_FMAC3 ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ ** SOAP_FMAC4 soap_in_PointerTons1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(struct soap*, const char*, ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ **, const char*); +SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerTons1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(struct soap*, ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ *const*, const char*, const char*); +SOAP_FMAC3 ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ ** SOAP_FMAC4 soap_get_PointerTons1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(struct soap*, ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ **, const char*, const char*); +#endif + +#ifndef SOAP_TYPE_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_DEFINED +#define SOAP_TYPE_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_DEFINED +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(struct soap*, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS *const*); +SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(struct soap*, const char *, int, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS *const*, const char *); +SOAP_FMAC3 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS ** SOAP_FMAC4 soap_in_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(struct soap*, const char*, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS **, const char*); +SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(struct soap*, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS *const*, const char*, const char*); +SOAP_FMAC3 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS ** SOAP_FMAC4 soap_get_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(struct soap*, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS **, const char*, const char*); +#endif + +#ifndef SOAP_TYPE_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM_DEFINED +#define SOAP_TYPE_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM_DEFINED +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(struct soap*, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM *const*); +SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(struct soap*, const char *, int, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM *const*, const char *); +SOAP_FMAC3 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM ** SOAP_FMAC4 soap_in_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(struct soap*, const char*, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM **, const char*); +SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(struct soap*, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM *const*, const char*, const char*); +SOAP_FMAC3 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM ** SOAP_FMAC4 soap_get_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(struct soap*, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM **, const char*, const char*); +#endif + +#ifndef SOAP_TYPE_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO_DEFINED +#define SOAP_TYPE_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO_DEFINED +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(struct soap*, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO *const*); +SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(struct soap*, const char *, int, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO *const*, const char *); +SOAP_FMAC3 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO ** SOAP_FMAC4 soap_in_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(struct soap*, const char*, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO **, const char*); +SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(struct soap*, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO *const*, const char*, const char*); +SOAP_FMAC3 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO ** SOAP_FMAC4 soap_get_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(struct soap*, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO **, const char*, const char*); +#endif + +#ifndef SOAP_TYPE_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN_DEFINED +#define SOAP_TYPE_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN_DEFINED +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(struct soap*, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN *const*); +SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(struct soap*, const char *, int, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN *const*, const char *); +SOAP_FMAC3 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN ** SOAP_FMAC4 soap_in_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(struct soap*, const char*, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN **, const char*); +SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(struct soap*, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN *const*, const char*, const char*); +SOAP_FMAC3 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN ** SOAP_FMAC4 soap_get_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(struct soap*, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN **, const char*, const char*); +#endif + +#ifndef SOAP_TYPE_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO_DEFINED +#define SOAP_TYPE_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO_DEFINED +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(struct soap*, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO *const*); +SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(struct soap*, const char *, int, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO *const*, const char *); +SOAP_FMAC3 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO ** SOAP_FMAC4 soap_in_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(struct soap*, const char*, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO **, const char*); +SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(struct soap*, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO *const*, const char*, const char*); +SOAP_FMAC3 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO ** SOAP_FMAC4 soap_get_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(struct soap*, _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO **, const char*, const char*); +#endif + +#ifndef SOAP_TYPE_PointerTons1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_DEFINED +#define SOAP_TYPE_PointerTons1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_DEFINED +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerTons1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ(struct soap*, ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ *const*); +SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerTons1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ(struct soap*, const char *, int, ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ *const*, const char *); +SOAP_FMAC3 ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ ** SOAP_FMAC4 soap_in_PointerTons1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ(struct soap*, const char*, ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ **, const char*); +SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerTons1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ(struct soap*, ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ *const*, const char*, const char*); +SOAP_FMAC3 ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ ** SOAP_FMAC4 soap_get_PointerTons1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ(struct soap*, ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ **, const char*, const char*); +#endif + +#ifndef SOAP_TYPE_PointerTo_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_DEFINED +#define SOAP_TYPE_PointerTo_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_DEFINED +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerTo_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST(struct soap*, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST *const*); +SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerTo_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST(struct soap*, const char *, int, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST *const*, const char *); +SOAP_FMAC3 _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST ** SOAP_FMAC4 soap_in_PointerTo_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST(struct soap*, const char*, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST **, const char*); +SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerTo_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST(struct soap*, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST *const*, const char*, const char*); +SOAP_FMAC3 _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST ** SOAP_FMAC4 soap_get_PointerTo_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST(struct soap*, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST **, const char*, const char*); +#endif + +#ifndef SOAP_TYPE_PointerTo_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_DEFINED +#define SOAP_TYPE_PointerTo_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_DEFINED +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerTo_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(struct soap*, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM *const*); +SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerTo_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(struct soap*, const char *, int, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM *const*, const char *); +SOAP_FMAC3 _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM ** SOAP_FMAC4 soap_in_PointerTo_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(struct soap*, const char*, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM **, const char*); +SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerTo_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(struct soap*, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM *const*, const char*, const char*); +SOAP_FMAC3 _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM ** SOAP_FMAC4 soap_get_PointerTo_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(struct soap*, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM **, const char*, const char*); +#endif + +#ifndef SOAP_TYPE_PointerTo_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM_DEFINED +#define SOAP_TYPE_PointerTo_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM_DEFINED +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerTo_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM(struct soap*, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM *const*); +SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerTo_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM(struct soap*, const char *, int, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM *const*, const char *); +SOAP_FMAC3 _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM ** SOAP_FMAC4 soap_in_PointerTo_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM(struct soap*, const char*, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM **, const char*); +SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerTo_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM(struct soap*, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM *const*, const char*, const char*); +SOAP_FMAC3 _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM ** SOAP_FMAC4 soap_get_PointerTo_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM(struct soap*, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM **, const char*, const char*); +#endif + +#ifndef SOAP_TYPE_PointerTo_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN_DEFINED +#define SOAP_TYPE_PointerTo_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN_DEFINED +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerTo_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN(struct soap*, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN *const*); +SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerTo_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN(struct soap*, const char *, int, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN *const*, const char *); +SOAP_FMAC3 _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN ** SOAP_FMAC4 soap_in_PointerTo_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN(struct soap*, const char*, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN **, const char*); +SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerTo_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN(struct soap*, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN *const*, const char*, const char*); +SOAP_FMAC3 _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN ** SOAP_FMAC4 soap_get_PointerTo_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN(struct soap*, _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN **, const char*, const char*); +#endif + +#ifndef SOAP_TYPE_PointerTons1__DT_USCOREBOM_USCORES4_USCOREREQ_DEFINED +#define SOAP_TYPE_PointerTons1__DT_USCOREBOM_USCORES4_USCOREREQ_DEFINED +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerTons1__DT_USCOREBOM_USCORES4_USCOREREQ(struct soap*, ns1__DT_USCOREBOM_USCORES4_USCOREREQ *const*); +SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerTons1__DT_USCOREBOM_USCORES4_USCOREREQ(struct soap*, const char *, int, ns1__DT_USCOREBOM_USCORES4_USCOREREQ *const*, const char *); +SOAP_FMAC3 ns1__DT_USCOREBOM_USCORES4_USCOREREQ ** SOAP_FMAC4 soap_in_PointerTons1__DT_USCOREBOM_USCORES4_USCOREREQ(struct soap*, const char*, ns1__DT_USCOREBOM_USCORES4_USCOREREQ **, const char*); +SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerTons1__DT_USCOREBOM_USCORES4_USCOREREQ(struct soap*, ns1__DT_USCOREBOM_USCORES4_USCOREREQ *const*, const char*, const char*); +SOAP_FMAC3 ns1__DT_USCOREBOM_USCORES4_USCOREREQ ** SOAP_FMAC4 soap_get_PointerTons1__DT_USCOREBOM_USCORES4_USCOREREQ(struct soap*, ns1__DT_USCOREBOM_USCORES4_USCOREREQ **, const char*, const char*); +#endif + +#ifndef SOAP_TYPE_PointerTo_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_DEFINED +#define SOAP_TYPE_PointerTo_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_DEFINED +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerTo_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST(struct soap*, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST *const*); +SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerTo_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST(struct soap*, const char *, int, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST *const*, const char *); +SOAP_FMAC3 _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST ** SOAP_FMAC4 soap_in_PointerTo_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST(struct soap*, const char*, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST **, const char*); +SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerTo_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST(struct soap*, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST *const*, const char*, const char*); +SOAP_FMAC3 _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST ** SOAP_FMAC4 soap_get_PointerTo_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST(struct soap*, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST **, const char*, const char*); +#endif + +#ifndef SOAP_TYPE_PointerTo_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_DEFINED +#define SOAP_TYPE_PointerTo_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_DEFINED +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerTo_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(struct soap*, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM *const*); +SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerTo_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(struct soap*, const char *, int, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM *const*, const char *); +SOAP_FMAC3 _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM ** SOAP_FMAC4 soap_in_PointerTo_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(struct soap*, const char*, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM **, const char*); +SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerTo_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(struct soap*, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM *const*, const char*, const char*); +SOAP_FMAC3 _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM ** SOAP_FMAC4 soap_get_PointerTo_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(struct soap*, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM **, const char*, const char*); +#endif + +#ifndef SOAP_TYPE_PointerTo_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO_DEFINED +#define SOAP_TYPE_PointerTo_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO_DEFINED +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerTo_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO(struct soap*, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO *const*); +SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerTo_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO(struct soap*, const char *, int, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO *const*, const char *); +SOAP_FMAC3 _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO ** SOAP_FMAC4 soap_in_PointerTo_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO(struct soap*, const char*, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO **, const char*); +SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerTo_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO(struct soap*, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO *const*, const char*, const char*); +SOAP_FMAC3 _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO ** SOAP_FMAC4 soap_get_PointerTo_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO(struct soap*, _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO **, const char*, const char*); +#endif + +#ifndef SOAP_TYPE__QName_DEFINED +#define SOAP_TYPE__QName_DEFINED + +inline void soap_default__QName(struct soap *soap, char **a) +{ + (void)soap; /* appease -Wall -Werror */ +#ifdef SOAP_DEFAULT__QName + *a = SOAP_DEFAULT__QName; +#else + *a = (char *)0; +#endif +} +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize__QName(struct soap*, char *const*); + +#define soap__QName2s(soap, a) soap_QName2s(soap, (a)) +SOAP_FMAC3 int SOAP_FMAC4 soap_out__QName(struct soap*, const char*, int, char*const*, const char*); + +#define soap_s2_QName(soap, s, a) soap_s2QName((soap), (s), (char**)(a), 0, -1, NULL) +SOAP_FMAC3 char * * SOAP_FMAC4 soap_in__QName(struct soap*, const char*, char **, const char*); + +#define soap_instantiate__QName soap_instantiate_string + + +#define soap_new__QName soap_new_string + +SOAP_FMAC3 int SOAP_FMAC4 soap_put__QName(struct soap*, char *const*, const char*, const char*); + +inline int soap_write__QName(struct soap *soap, char *const*p) +{ + soap_free_temp(soap); + if (p) + { if (soap_begin_send(soap) || ::soap_put__QName(soap, p, "QName", "") || soap_end_send(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_PUT__QName(struct soap *soap, const char *URL, char *const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || ::soap_put__QName(soap, p, "QName", "") || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH__QName(struct soap *soap, const char *URL, char *const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || ::soap_put__QName(soap, p, "QName", "") || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send__QName(struct soap *soap, const char *URL, char *const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || ::soap_put__QName(soap, p, "QName", "") || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 char ** SOAP_FMAC4 soap_get__QName(struct soap*, char **, const char*, const char*); + +inline int soap_read__QName(struct soap *soap, char **p) +{ + if (p) + { if (soap_begin_recv(soap) || ::soap_get__QName(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET__QName(struct soap *soap, const char *URL, char **p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read__QName(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv__QName(struct soap *soap, char **p) +{ + if (::soap_read__QName(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#ifndef SOAP_TYPE__XML_DEFINED +#define SOAP_TYPE__XML_DEFINED +#endif + +#ifndef SOAP_TYPE_string_DEFINED +#define SOAP_TYPE_string_DEFINED + +inline void soap_default_string(struct soap *soap, char **a) +{ + (void)soap; /* appease -Wall -Werror */ +#ifdef SOAP_DEFAULT_string + *a = SOAP_DEFAULT_string; +#else + *a = (char *)0; +#endif +} +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_string(struct soap*, char *const*); + +#define soap_string2s(soap, a) (a) +SOAP_FMAC3 int SOAP_FMAC4 soap_out_string(struct soap*, const char*, int, char*const*, const char*); + +#define soap_s2string(soap, s, a) soap_s2char((soap), (s), (char**)(a), 1, 0, -1, NULL) +SOAP_FMAC3 char * * SOAP_FMAC4 soap_in_string(struct soap*, const char*, char **, const char*); + +SOAP_FMAC3 char * * SOAP_FMAC4 soap_new_string(struct soap *soap, int n = -1); +SOAP_FMAC3 int SOAP_FMAC4 soap_put_string(struct soap*, char *const*, const char*, const char*); + +inline int soap_write_string(struct soap *soap, char *const*p) +{ + soap_free_temp(soap); + if (p) + { if (soap_begin_send(soap) || ::soap_put_string(soap, p, "string", "") || soap_end_send(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_PUT_string(struct soap *soap, const char *URL, char *const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || ::soap_put_string(soap, p, "string", "") || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH_string(struct soap *soap, const char *URL, char *const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || ::soap_put_string(soap, p, "string", "") || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send_string(struct soap *soap, const char *URL, char *const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || ::soap_put_string(soap, p, "string", "") || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 char ** SOAP_FMAC4 soap_get_string(struct soap*, char **, const char*, const char*); + +inline int soap_read_string(struct soap *soap, char **p) +{ + if (p) + { if (soap_begin_recv(soap) || ::soap_get_string(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET_string(struct soap *soap, const char *URL, char **p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read_string(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv_string(struct soap *soap, char **p) +{ + if (::soap_read_string(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#endif + +/* End of soapH.h */ diff --git a/DFL_BOM_WL_TOERP/soapSIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy.cpp b/DFL_BOM_WL_TOERP/soapSIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy.cpp new file mode 100644 index 0000000..f9c517b --- /dev/null +++ b/DFL_BOM_WL_TOERP/soapSIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy.cpp @@ -0,0 +1,227 @@ +/* soapSIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy.cpp + Generated by gSOAP 2.8.131 for bomtest.h + +gSOAP XML Web services tools +Copyright (C) 2000-2023, Robert van Engelen, Genivia Inc. All Rights Reserved. +The soapcpp2 tool and its generated software are released under the GPL. +This program is released under the GPL with the additional exemption that +compiling, linking, and/or using OpenSSL is allowed. +-------------------------------------------------------------------------------- +A commercial use license is available from Genivia Inc., contact@genivia.com +-------------------------------------------------------------------------------- +*/ + +#include "soapSIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy.h" + +SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy::SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy() : soap(SOAP_IO_DEFAULT) +{ + SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy_init(SOAP_IO_DEFAULT, SOAP_IO_DEFAULT); +} + +SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy::SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy(const SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy& rhs) +{ + soap_copy_context(this, &rhs); + this->soap_endpoint = rhs.soap_endpoint; +} + +SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy::SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy(const struct soap& _soap) : soap(_soap) +{ } + +SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy::SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy(const struct soap& _soap, const char* soap_endpoint_url) : soap(_soap) +{ + soap_endpoint = soap_endpoint_url; +} + +SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy::SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy(const char* soap_endpoint_url) : soap(SOAP_IO_DEFAULT) +{ + SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy_init(SOAP_IO_DEFAULT, SOAP_IO_DEFAULT); + soap_endpoint = soap_endpoint_url; +} + +SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy::SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy(soap_mode iomode) : soap(iomode) +{ + SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy_init(iomode, iomode); +} + +SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy::SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy(const char* soap_endpoint_url, soap_mode iomode) : soap(iomode) +{ + SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy_init(iomode, iomode); + soap_endpoint = soap_endpoint_url; +} + +SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy::SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy(soap_mode imode, soap_mode omode) : soap(imode, omode) +{ + SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy_init(imode, omode); +} + +SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy::~SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy() +{ + SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy::destroy(); +} + +void SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy::SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy_init(soap_mode imode, soap_mode omode) +{ + soap_imode(this, imode); + soap_omode(this, omode); + soap_endpoint = NULL; + static const struct Namespace namespaces[] = { + { "SOAP-ENV", "http://schemas.xmlsoap.org/soap/envelope/", "http://www.w3.org/*/soap-envelope", NULL }, + { "SOAP-ENC", "http://schemas.xmlsoap.org/soap/encoding/", "http://www.w3.org/*/soap-encoding", NULL }, + { "xsi", "http://www.w3.org/2001/XMLSchema-instance", "http://www.w3.org/*/XMLSchema-instance", NULL }, + { "xsd", "http://www.w3.org/2001/XMLSchema", "http://www.w3.org/*/XMLSchema", NULL }, + { "ns1", "urn:chintelectric.com:xi:plm", NULL, NULL }, + { NULL, NULL, NULL, NULL} /* end of namespaces[] */ + }; + soap_set_namespaces(this, namespaces); +} + +SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy* SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy::copy() +{ + SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy* dup = SOAP_NEW_UNMANAGED(SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy(*(struct soap*)this)); + return dup; +} + +SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy& SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy::operator=(const SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy& rhs) +{ + soap_done(this); + soap_copy_context(this, &rhs); + this->soap_endpoint = rhs.soap_endpoint; + return *this; +} + +void SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy::destroy() +{ + soap_destroy(this); + soap_end(this); +} + +void SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy::reset() +{ + this->destroy(); + soap_done(this); + soap_initialize(this); + SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy_init(SOAP_IO_DEFAULT, SOAP_IO_DEFAULT); +} + +void SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy::soap_noheader() +{ + this->header = NULL; +} + +::SOAP_ENV__Header* SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy::soap_header() +{ + return this->header; +} + +::SOAP_ENV__Fault* SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy::soap_fault() +{ + return this->fault; +} + +const char* SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy::soap_fault_subcode() +{ + return ::soap_fault_subcode(this); +} + +const char* SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy::soap_fault_string() +{ + return ::soap_fault_string(this); +} + +const char* SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy::soap_fault_detail() +{ + return ::soap_fault_detail(this); +} + +int SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy::soap_close_socket() +{ + return ::soap_closesock(this); +} + +int SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy::soap_force_close_socket() +{ + return ::soap_force_closesock(this); +} + +void SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy::soap_print_fault(FILE* fd) +{ + ::soap_print_fault(this, fd); +} + +#ifndef WITH_LEAN +#ifndef WITH_COMPAT +void SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy::soap_stream_fault(std::ostream& os) +{ + ::soap_stream_fault(this, os); +} +#endif + +char* SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy::soap_sprint_fault(char* buf, size_t len) +{ + return ::soap_sprint_fault(this, buf, len); +} +#endif + +int SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy::send_SIO_USCOREBOM_USCOREPLM_USCOREASYN(const char* soap_endpoint_url, const char* soap_action, ns1__DT_USCOREBOM_USCORES4_USCOREREQ* ns1__MT_USCOREBOM_USCORES4_USCOREREQ) +{ + struct soap* soap = this; + struct __ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN soap_tmp___ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN; + if (soap_endpoint_url != NULL) + soap_endpoint = soap_endpoint_url; + if (soap_endpoint == NULL) + soap_endpoint = "http://192.168.0.184:50100/XISOAPAdapter/MessageServlet?senderParty=&senderService=BC_CHINT_ELECTRIC&receiverParty=&receiverService=&interface=SIO_BOM_PLM_ASYN&interfaceNamespace=urn%3Achintelectric.com%3Axi%3Aplm"; + if (soap_action == NULL) + soap_action = "http://sap.com/xi/WebService/soap1.1"; + soap_tmp___ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN.ns1__MT_USCOREBOM_USCORES4_USCOREREQ = ns1__MT_USCOREBOM_USCORES4_USCOREREQ; + soap_begin(soap); + soap->encodingStyle = NULL; /* use SOAP literal style */ + soap_serializeheader(soap); + soap_serialize___ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN(soap, &soap_tmp___ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN); + if (soap_begin_count(soap)) + return soap->error; + if ((soap->mode & SOAP_IO_LENGTH)) + { + if (soap_envelope_begin_out(soap) + || soap_putheader(soap) + || soap_body_begin_out(soap) + || soap_put___ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN(soap, &soap_tmp___ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN, "-ns1:SIO_BOM_PLM_ASYN", "") + || soap_body_end_out(soap) + || soap_envelope_end_out(soap)) + return soap->error; + } + if (soap_end_count(soap)) + return soap->error; + if (soap_connect(soap, soap_endpoint, soap_action) + || soap_envelope_begin_out(soap) + || soap_putheader(soap) + || soap_body_begin_out(soap) + || soap_put___ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN(soap, &soap_tmp___ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN, "-ns1:SIO_BOM_PLM_ASYN", "") + || soap_body_end_out(soap) + || soap_envelope_end_out(soap) + || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +int SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy::recv_SIO_USCOREBOM_USCOREPLM_USCOREASYN(struct __ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN& tmp) +{ + struct soap* soap = this; + struct __ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN* _param_1 = &tmp; + soap_default___ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN(soap, _param_1); + soap_begin(soap); + if (soap_begin_recv(soap) + || soap_envelope_begin_in(soap) + || soap_recv_header(soap) + || soap_body_begin_in(soap)) + return soap_closesock(soap); + soap_get___ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN(soap, _param_1, "-ns1:SIO_BOM_PLM_ASYN", NULL); + if (soap->error == SOAP_TAG_MISMATCH && soap->level == 2) + soap->error = SOAP_OK; + if (soap->error + || soap_body_end_in(soap) + || soap_envelope_end_in(soap) + || soap_end_recv(soap)) + return soap_closesock(soap); + return soap_closesock(soap); +} +/* End of client proxy code */ diff --git a/DFL_BOM_WL_TOERP/soapSIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy.h b/DFL_BOM_WL_TOERP/soapSIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy.h new file mode 100644 index 0000000..c0104ef --- /dev/null +++ b/DFL_BOM_WL_TOERP/soapSIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy.h @@ -0,0 +1,91 @@ +/* soapSIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy.h + Generated by gSOAP 2.8.131 for bomtest.h + +gSOAP XML Web services tools +Copyright (C) 2000-2023, Robert van Engelen, Genivia Inc. All Rights Reserved. +The soapcpp2 tool and its generated software are released under the GPL. +This program is released under the GPL with the additional exemption that +compiling, linking, and/or using OpenSSL is allowed. +-------------------------------------------------------------------------------- +A commercial use license is available from Genivia Inc., contact@genivia.com +-------------------------------------------------------------------------------- +*/ + +#ifndef soapSIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy_H +#define soapSIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy_H +#include "soapH.h" + +class SOAP_CMAC SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy : public soap { +public: + /// Endpoint URL of service 'SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy' (change as needed) + const char* soap_endpoint; + /// Variables globally declared in bomtest.h, if any + /// Construct a proxy with new managing context + SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy(); + /// Copy constructor + SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy(const SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy& rhs); + /// Construct proxy given a managing context + SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy(const struct soap&); + /// Construct proxy given a managing context and endpoint URL + SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy(const struct soap&, const char* soap_endpoint_url); + /// Constructor taking an endpoint URL + SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy(const char* soap_endpoint_url); + /// Constructor taking input and output mode flags for the new managing context + SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy(soap_mode iomode); + /// Constructor taking endpoint URL and input and output mode flags for the new managing context + SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy(const char* soap_endpoint_url, soap_mode iomode); + /// Constructor taking input and output mode flags for the new managing context + SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy(soap_mode imode, soap_mode omode); + /// Destructor deletes deserialized data and its managing context + virtual ~SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy(); + /// Initializer used by constructors + virtual void SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy_init(soap_mode imode, soap_mode omode); + /// Return a copy that has a new managing context with the same engine state + virtual SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy* copy(); + /// Copy assignment + SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy& operator=(const SIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy&); + /// Delete all deserialized data (uses soap_destroy() and soap_end()) + virtual void destroy(); + /// Delete all deserialized data and reset to default + virtual void reset(); + /// Disables and removes SOAP Header from message by setting soap->header = NULL + virtual void soap_noheader(); + /// Get SOAP Header structure (i.e. soap->header, which is NULL when absent) + virtual ::SOAP_ENV__Header* soap_header(); + /// Get SOAP Fault structure (i.e. soap->fault, which is NULL when absent) + virtual ::SOAP_ENV__Fault* soap_fault(); + /// Get SOAP Fault subcode QName string (NULL when absent) + virtual const char* soap_fault_subcode(); + /// Get SOAP Fault string/reason (NULL when absent) + virtual const char* soap_fault_string(); + /// Get SOAP Fault detail XML string (NULL when absent) + virtual const char* soap_fault_detail(); + /// Close connection (normally automatic, except for send_X ops) + virtual int soap_close_socket(); + /// Force close connection (can kill a thread blocked on IO) + virtual int soap_force_close_socket(); + /// Print fault + virtual void soap_print_fault(FILE*); +#ifndef WITH_LEAN +#ifndef WITH_COMPAT + /// Print fault to stream + virtual void soap_stream_fault(std::ostream&); +#endif + /// Write fault to buffer + virtual char* soap_sprint_fault(char* buf, size_t len); +#endif + // + /// Web service one-way synchronous send operation 'SIO_BOM_PLM_ASYN' to the default endpoint with the default SOAP Action header then wait for HTTP OK/Accept response, returns SOAP_OK or error code + virtual int SIO_USCOREBOM_USCOREPLM_USCOREASYN(ns1__DT_USCOREBOM_USCORES4_USCOREREQ* ns1__MT_USCOREBOM_USCORES4_USCOREREQ) { return this->SIO_USCOREBOM_USCOREPLM_USCOREASYN(NULL, NULL, ns1__MT_USCOREBOM_USCORES4_USCOREREQ); } + /// Web service one-way synchronous send operation 'SIO_BOM_PLM_ASYN' to the specified endpoint and SOAP Action header then wait for HTTP OK/Accept response, returns SOAP_OK or error code + virtual int SIO_USCOREBOM_USCOREPLM_USCOREASYN(const char* soap_endpoint_url, const char* soap_action, ns1__DT_USCOREBOM_USCORES4_USCOREREQ* ns1__MT_USCOREBOM_USCORES4_USCOREREQ) { return (this->send_SIO_USCOREBOM_USCOREPLM_USCOREASYN(soap_endpoint_url, soap_action, ns1__MT_USCOREBOM_USCORES4_USCOREREQ) || soap_recv_empty_response(this)) ? this->error : SOAP_OK; } + /// Web service one-way asynchronous send operation 'send_SIO_BOM_PLM_ASYN' with default endpoint and default SOAP Action header, returns SOAP_OK or error code + virtual int send_SIO_USCOREBOM_USCOREPLM_USCOREASYN(ns1__DT_USCOREBOM_USCORES4_USCOREREQ* ns1__MT_USCOREBOM_USCORES4_USCOREREQ) { return this->send_SIO_USCOREBOM_USCOREPLM_USCOREASYN(NULL, NULL, ns1__MT_USCOREBOM_USCORES4_USCOREREQ); } + /// Web service one-way asynchronous send operation 'send_SIO_BOM_PLM_ASYN' to the specified endpoint and SOAP Action header, returns SOAP_OK or error code + virtual int send_SIO_USCOREBOM_USCOREPLM_USCOREASYN(const char* soap_endpoint_url, const char* soap_action, ns1__DT_USCOREBOM_USCORES4_USCOREREQ* ns1__MT_USCOREBOM_USCORES4_USCOREREQ); + /// Web service one-way asynchronous receive operation 'recv_SIO_BOM_PLM_ASYN', returns SOAP_OK or error code; + virtual int recv_SIO_USCOREBOM_USCOREPLM_USCOREASYN(struct __ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN&); + /// Web service asynchronous receive of HTTP Accept acknowledgment for one-way asynchronous send operation 'send_SIO_BOM_PLM_ASYN', returns SOAP_OK or error code + virtual int recv_SIO_USCOREBOM_USCOREPLM_USCOREASYN_empty_response() { return soap_recv_empty_response(this); } +}; +#endif diff --git a/DFL_BOM_WL_TOERP/soapSI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy.cpp b/DFL_BOM_WL_TOERP/soapSI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy.cpp new file mode 100644 index 0000000..764da31 --- /dev/null +++ b/DFL_BOM_WL_TOERP/soapSI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy.cpp @@ -0,0 +1,202 @@ +/* soapSI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy.cpp + Generated by gSOAP 2.8.131 for factory.h + +gSOAP XML Web services tools +Copyright (C) 2000-2023, Robert van Engelen, Genivia Inc. All Rights Reserved. +The soapcpp2 tool and its generated software are released under the GPL. +This program is released under the GPL with the additional exemption that +compiling, linking, and/or using OpenSSL is allowed. +-------------------------------------------------------------------------------- +A commercial use license is available from Genivia Inc., contact@genivia.com +-------------------------------------------------------------------------------- +*/ + +#include "soapSI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy.h" + +SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy() : soap(SOAP_IO_DEFAULT) +{ SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy_init(SOAP_IO_DEFAULT, SOAP_IO_DEFAULT); +} + +SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy(const SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy& rhs) +{ soap_copy_context(this, &rhs); + this->soap_endpoint = rhs.soap_endpoint; +} + +SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy(const struct soap &_soap) : soap(_soap) +{ } + +SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy(const struct soap &_soap, const char *soap_endpoint_url) : soap(_soap) +{ + soap_endpoint = soap_endpoint_url; +} + +SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy(const char *soap_endpoint_url) : soap(SOAP_IO_DEFAULT) +{ SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy_init(SOAP_IO_DEFAULT, SOAP_IO_DEFAULT); + soap_endpoint = soap_endpoint_url; +} + +SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy(soap_mode iomode) : soap(iomode) +{ SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy_init(iomode, iomode); +} + +SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy(const char *soap_endpoint_url, soap_mode iomode) : soap(iomode) +{ SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy_init(iomode, iomode); + soap_endpoint = soap_endpoint_url; +} + +SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy(soap_mode imode, soap_mode omode) : soap(imode, omode) +{ SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy_init(imode, omode); +} + +SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::~SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy() +{ + SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::destroy(); +} + +void SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy_init(soap_mode imode, soap_mode omode) +{ soap_imode(this, imode); + soap_omode(this, omode); + soap_endpoint = NULL; + static const struct Namespace namespaces[] = { + { "SOAP-ENV", "http://schemas.xmlsoap.org/soap/envelope/", "http://www.w3.org/*/soap-envelope", NULL }, + { "SOAP-ENC", "http://schemas.xmlsoap.org/soap/encoding/", "http://www.w3.org/*/soap-encoding", NULL }, + { "xsi", "http://www.w3.org/2001/XMLSchema-instance", "http://www.w3.org/*/XMLSchema-instance", NULL }, + { "xsd", "http://www.w3.org/2001/XMLSchema", "http://www.w3.org/*/XMLSchema", NULL }, + { "ns1", "urn:chintelectric.com:xi:plm", NULL, NULL }, + { NULL, NULL, NULL, NULL} /* end of namespaces[] */ + }; + soap_set_namespaces(this, namespaces); +} + +SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy *SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::copy() +{ SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy *dup = SOAP_NEW_UNMANAGED(SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy(*(struct soap*)this)); + return dup; +} + +SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy& SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::operator=(const SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy& rhs) +{ soap_done(this); + soap_copy_context(this, &rhs); + this->soap_endpoint = rhs.soap_endpoint; + return *this; +} + +void SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::destroy() +{ soap_destroy(this); + soap_end(this); +} + +void SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::reset() +{ this->destroy(); + soap_done(this); + soap_initialize(this); + SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy_init(SOAP_IO_DEFAULT, SOAP_IO_DEFAULT); +} + +void SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::soap_noheader() +{ this->header = NULL; +} + +::SOAP_ENV__Header *SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::soap_header() +{ return this->header; +} + +::SOAP_ENV__Fault *SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::soap_fault() +{ return this->fault; +} + +const char *SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::soap_fault_subcode() +{ return ::soap_fault_subcode(this); +} + +const char *SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::soap_fault_string() +{ return ::soap_fault_string(this); +} + +const char *SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::soap_fault_detail() +{ return ::soap_fault_detail(this); +} + +int SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::soap_close_socket() +{ return ::soap_closesock(this); +} + +int SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::soap_force_close_socket() +{ return ::soap_force_closesock(this); +} + +void SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::soap_print_fault(FILE *fd) +{ ::soap_print_fault(this, fd); +} + +#ifndef WITH_LEAN +#ifndef WITH_COMPAT +void SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::soap_stream_fault(std::ostream& os) +{ ::soap_stream_fault(this, os); +} +#endif + +char *SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::soap_sprint_fault(char *buf, size_t len) +{ return ::soap_sprint_fault(this, buf, len); +} +#endif + +//http://192.168.0.184: 10.10.101.219 +int SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::send_SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(const char *soap_endpoint_url, const char *soap_action, ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ *ns1__MT_USCOREFACTORY_USCORENUMBER_USCOREREQ) +{ + struct soap *soap = this; + struct __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN soap_tmp___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN; + if (soap_endpoint_url != NULL) + soap_endpoint = soap_endpoint_url; + if (soap_endpoint == NULL) + soap_endpoint = "http://10.10.101.219:50100/XISOAPAdapter/MessageServlet?senderParty=&senderService=BC_CHINT_ELECTRIC&receiverParty=&receiverService=&interface=SI_FACTORY_NUMBER_PLM_OUT_SYN&interfaceNamespace=urn%3Achintelectric.com%3Axi%3Aplm https://gfpoapp:50101/XISOAPAdapter/MessageServlet?senderParty=&senderService=BC_CHINT_ELECTRIC&receiverParty=&receiverService=&interface=SI_FACTORY_NUMBER_PLM_OUT_SYN&interfaceNamespace=urn%3Achintelectric.com%3Axi%3Aplm"; + if (soap_action == NULL) + soap_action = "http://sap.com/xi/WebService/soap1.1"; + soap_tmp___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN.ns1__MT_USCOREFACTORY_USCORENUMBER_USCOREREQ = ns1__MT_USCOREFACTORY_USCORENUMBER_USCOREREQ; + soap_begin(soap); + soap->encodingStyle = NULL; /* use SOAP literal style */ + soap_serializeheader(soap); + soap_serialize___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(soap, &soap_tmp___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN); + if (soap_begin_count(soap)) + return soap->error; + if ((soap->mode & SOAP_IO_LENGTH)) + { if (soap_envelope_begin_out(soap) + || soap_putheader(soap) + || soap_body_begin_out(soap) + || soap_put___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(soap, &soap_tmp___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN, "-ns1:SI_FACTORY_NUMBER_PLM_OUT_SYN", "") + || soap_body_end_out(soap) + || soap_envelope_end_out(soap)) + return soap->error; + } + if (soap_end_count(soap)) + return soap->error; + if (soap_connect(soap, soap_endpoint, soap_action) + || soap_envelope_begin_out(soap) + || soap_putheader(soap) + || soap_body_begin_out(soap) + || soap_put___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(soap, &soap_tmp___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN, "-ns1:SI_FACTORY_NUMBER_PLM_OUT_SYN", "") + || soap_body_end_out(soap) + || soap_envelope_end_out(soap) + || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +int SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::recv_SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP &ns1__MT_USCOREFACTORY_USCORENUMBER_USCORERSP) +{ + struct soap *soap = this; + ns1__MT_USCOREFACTORY_USCORENUMBER_USCORERSP.soap_default(soap); + if (soap_begin_recv(soap) + || soap_envelope_begin_in(soap) + || soap_recv_header(soap) + || soap_body_begin_in(soap)) + return soap_closesock(soap); + ns1__MT_USCOREFACTORY_USCORENUMBER_USCORERSP.soap_get(soap, "ns1:MT_FACTORY_NUMBER_RSP", NULL); + if (soap->error) + return soap_recv_fault(soap, 0); + if (soap_body_end_in(soap) + || soap_envelope_end_in(soap) + || soap_end_recv(soap)) + return soap_closesock(soap); + return soap_closesock(soap); +} +/* End of client proxy code */ diff --git a/DFL_BOM_WL_TOERP/soapSI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy.h b/DFL_BOM_WL_TOERP/soapSI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy.h new file mode 100644 index 0000000..7cca54e --- /dev/null +++ b/DFL_BOM_WL_TOERP/soapSI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy.h @@ -0,0 +1,87 @@ +/* soapSI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy.h + Generated by gSOAP 2.8.131 for factory.h + +gSOAP XML Web services tools +Copyright (C) 2000-2023, Robert van Engelen, Genivia Inc. All Rights Reserved. +The soapcpp2 tool and its generated software are released under the GPL. +This program is released under the GPL with the additional exemption that +compiling, linking, and/or using OpenSSL is allowed. +-------------------------------------------------------------------------------- +A commercial use license is available from Genivia Inc., contact@genivia.com +-------------------------------------------------------------------------------- +*/ + +#ifndef soapSI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy_H +#define soapSI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy_H +#include "soapH.h" + + class SOAP_CMAC SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy : public soap { + public: + /// Endpoint URL of service 'SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy' (change as needed) + const char *soap_endpoint; + /// Variables globally declared in factory.h, if any + /// Construct a proxy with new managing context + SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy(); + /// Copy constructor + SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy(const SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy& rhs); + /// Construct proxy given a managing context + SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy(const struct soap&); + /// Construct proxy given a managing context and endpoint URL + SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy(const struct soap&, const char *soap_endpoint_url); + /// Constructor taking an endpoint URL + SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy(const char *soap_endpoint_url); + /// Constructor taking input and output mode flags for the new managing context + SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy(soap_mode iomode); + /// Constructor taking endpoint URL and input and output mode flags for the new managing context + SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy(const char *soap_endpoint_url, soap_mode iomode); + /// Constructor taking input and output mode flags for the new managing context + SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy(soap_mode imode, soap_mode omode); + /// Destructor deletes deserialized data and its managing context + virtual ~SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy(); + /// Initializer used by constructors + virtual void SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy_init(soap_mode imode, soap_mode omode); + /// Return a copy that has a new managing context with the same engine state + virtual SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy *copy(); + /// Copy assignment + SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy& operator=(const SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy&); + /// Delete all deserialized data (uses soap_destroy() and soap_end()) + virtual void destroy(); + /// Delete all deserialized data and reset to default + virtual void reset(); + /// Disables and removes SOAP Header from message by setting soap->header = NULL + virtual void soap_noheader(); + /// Get SOAP Header structure (i.e. soap->header, which is NULL when absent) + virtual ::SOAP_ENV__Header *soap_header(); + /// Get SOAP Fault structure (i.e. soap->fault, which is NULL when absent) + virtual ::SOAP_ENV__Fault *soap_fault(); + /// Get SOAP Fault subcode QName string (NULL when absent) + virtual const char *soap_fault_subcode(); + /// Get SOAP Fault string/reason (NULL when absent) + virtual const char *soap_fault_string(); + /// Get SOAP Fault detail XML string (NULL when absent) + virtual const char *soap_fault_detail(); + /// Close connection (normally automatic, except for send_X ops) + virtual int soap_close_socket(); + /// Force close connection (can kill a thread blocked on IO) + virtual int soap_force_close_socket(); + /// Print fault + virtual void soap_print_fault(FILE*); + #ifndef WITH_LEAN + #ifndef WITH_COMPAT + /// Print fault to stream + virtual void soap_stream_fault(std::ostream&); + #endif + /// Write fault to buffer + virtual char *soap_sprint_fault(char *buf, size_t len); + #endif + // + /// Web service synchronous operation 'SI_FACTORY_NUMBER_PLM_OUT_SYN' with default endpoint and default SOAP Action header, returns SOAP_OK or error code + virtual int SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ *ns1__MT_USCOREFACTORY_USCORENUMBER_USCOREREQ, ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP &ns1__MT_USCOREFACTORY_USCORENUMBER_USCORERSP) { return this->SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(NULL, NULL, ns1__MT_USCOREFACTORY_USCORENUMBER_USCOREREQ, ns1__MT_USCOREFACTORY_USCORENUMBER_USCORERSP); } + /// Web service synchronous operation 'SI_FACTORY_NUMBER_PLM_OUT_SYN' to the specified endpoint and SOAP Action header, returns SOAP_OK or error code + virtual int SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(const char *soap_endpoint_url, const char *soap_action, ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ *ns1__MT_USCOREFACTORY_USCORENUMBER_USCOREREQ, ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP &ns1__MT_USCOREFACTORY_USCORENUMBER_USCORERSP) { return this->send_SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(soap_endpoint_url, soap_action, ns1__MT_USCOREFACTORY_USCORENUMBER_USCOREREQ) || this->recv_SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(ns1__MT_USCOREFACTORY_USCORENUMBER_USCORERSP) ? this->error : SOAP_OK; } + /// Web service asynchronous operation 'send_SI_FACTORY_NUMBER_PLM_OUT_SYN' to send a request message to the specified endpoint and SOAP Action header, returns SOAP_OK or error code + virtual int send_SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(const char *soap_endpoint_url, const char *soap_action, ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ *ns1__MT_USCOREFACTORY_USCORENUMBER_USCOREREQ); + /// Web service asynchronous operation 'recv_SI_FACTORY_NUMBER_PLM_OUT_SYN' to receive a response message from the connected endpoint, returns SOAP_OK or error code + virtual int recv_SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP &ns1__MT_USCOREFACTORY_USCORENUMBER_USCORERSP); + }; +#endif diff --git a/DFL_BOM_WL_TOERP/soapSI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy.cpp b/DFL_BOM_WL_TOERP/soapSI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy.cpp new file mode 100644 index 0000000..da8616a --- /dev/null +++ b/DFL_BOM_WL_TOERP/soapSI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy.cpp @@ -0,0 +1,201 @@ +/* soapSI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy.cpp + Generated by gSOAP 2.8.131 for BOP.h + +gSOAP XML Web services tools +Copyright (C) 2000-2023, Robert van Engelen, Genivia Inc. All Rights Reserved. +The soapcpp2 tool and its generated software are released under the GPL. +This program is released under the GPL with the additional exemption that +compiling, linking, and/or using OpenSSL is allowed. +-------------------------------------------------------------------------------- +A commercial use license is available from Genivia Inc., contact@genivia.com +-------------------------------------------------------------------------------- +*/ + +#include "soapSI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy.h" + +SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy() : soap(SOAP_IO_DEFAULT) +{ SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy_init(SOAP_IO_DEFAULT, SOAP_IO_DEFAULT); +} + +SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy(const SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy& rhs) +{ soap_copy_context(this, &rhs); + this->soap_endpoint = rhs.soap_endpoint; +} + +SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy(const struct soap &_soap) : soap(_soap) +{ } + +SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy(const struct soap &_soap, const char *soap_endpoint_url) : soap(_soap) +{ + soap_endpoint = soap_endpoint_url; +} + +SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy(const char *soap_endpoint_url) : soap(SOAP_IO_DEFAULT) +{ SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy_init(SOAP_IO_DEFAULT, SOAP_IO_DEFAULT); + soap_endpoint = soap_endpoint_url; +} + +SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy(soap_mode iomode) : soap(iomode) +{ SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy_init(iomode, iomode); +} + +SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy(const char *soap_endpoint_url, soap_mode iomode) : soap(iomode) +{ SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy_init(iomode, iomode); + soap_endpoint = soap_endpoint_url; +} + +SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy(soap_mode imode, soap_mode omode) : soap(imode, omode) +{ SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy_init(imode, omode); +} + +SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::~SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy() +{ + SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::destroy(); +} + +void SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy_init(soap_mode imode, soap_mode omode) +{ soap_imode(this, imode); + soap_omode(this, omode); + soap_endpoint = NULL; + static const struct Namespace namespaces[] = { + { "SOAP-ENV", "http://schemas.xmlsoap.org/soap/envelope/", "http://www.w3.org/*/soap-envelope", NULL }, + { "SOAP-ENC", "http://schemas.xmlsoap.org/soap/encoding/", "http://www.w3.org/*/soap-encoding", NULL }, + { "xsi", "http://www.w3.org/2001/XMLSchema-instance", "http://www.w3.org/*/XMLSchema-instance", NULL }, + { "xsd", "http://www.w3.org/2001/XMLSchema", "http://www.w3.org/*/XMLSchema", NULL }, + { "ns1", "urn:chintelectric.com:xi:plm", NULL, NULL }, + { NULL, NULL, NULL, NULL} /* end of namespaces[] */ + }; + soap_set_namespaces(this, namespaces); +} + +SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy *SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::copy() +{ SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy *dup = SOAP_NEW_UNMANAGED(SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy(*(struct soap*)this)); + return dup; +} + +SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy& SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::operator=(const SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy& rhs) +{ soap_done(this); + soap_copy_context(this, &rhs); + this->soap_endpoint = rhs.soap_endpoint; + return *this; +} + +void SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::destroy() +{ soap_destroy(this); + soap_end(this); +} + +void SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::reset() +{ this->destroy(); + soap_done(this); + soap_initialize(this); + SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy_init(SOAP_IO_DEFAULT, SOAP_IO_DEFAULT); +} + +void SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::soap_noheader() +{ this->header = NULL; +} + +::SOAP_ENV__Header *SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::soap_header() +{ return this->header; +} + +::SOAP_ENV__Fault *SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::soap_fault() +{ return this->fault; +} + +const char *SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::soap_fault_subcode() +{ return ::soap_fault_subcode(this); +} + +const char *SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::soap_fault_string() +{ return ::soap_fault_string(this); +} + +const char *SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::soap_fault_detail() +{ return ::soap_fault_detail(this); +} + +int SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::soap_close_socket() +{ return ::soap_closesock(this); +} + +int SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::soap_force_close_socket() +{ return ::soap_force_closesock(this); +} + +void SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::soap_print_fault(FILE *fd) +{ ::soap_print_fault(this, fd); +} + +#ifndef WITH_LEAN +#ifndef WITH_COMPAT +void SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::soap_stream_fault(std::ostream& os) +{ ::soap_stream_fault(this, os); +} +#endif + +char *SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::soap_sprint_fault(char *buf, size_t len) +{ return ::soap_sprint_fault(this, buf, len); +} +#endif +//192.168.0.184 10.10.101.219 +int SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::send_SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN(const char *soap_endpoint_url, const char *soap_action, ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ *ns1__MT_USCOREPROCESSROUTE_USCORES4_USCOREREQ) +{ + struct soap *soap = this; + struct __ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN soap_tmp___ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN; + if (soap_endpoint_url != NULL) + soap_endpoint = soap_endpoint_url; + if (soap_endpoint == NULL) + soap_endpoint = "http://10.10.101.219:50100/XISOAPAdapter/MessageServlet?senderParty=&senderService=BC_CHINT_ELECTRIC&receiverParty=&receiverService=&interface=SI_PROCESSROUTE_PLM_OUT_SYN&interfaceNamespace=urn%3Achintelectric.com%3Axi%3Aplm"; + if (soap_action == NULL) + soap_action = "http://sap.com/xi/WebService/soap1.1"; + soap_tmp___ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN.ns1__MT_USCOREPROCESSROUTE_USCORES4_USCOREREQ = ns1__MT_USCOREPROCESSROUTE_USCORES4_USCOREREQ; + soap_begin(soap); + soap->encodingStyle = NULL; /* use SOAP literal style */ + soap_serializeheader(soap); + soap_serialize___ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN(soap, &soap_tmp___ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN); + if (soap_begin_count(soap)) + return soap->error; + if ((soap->mode & SOAP_IO_LENGTH)) + { if (soap_envelope_begin_out(soap) + || soap_putheader(soap) + || soap_body_begin_out(soap) + || soap_put___ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN(soap, &soap_tmp___ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN, "-ns1:SI_PROCESSROUTE_PLM_OUT_SYN", "") + || soap_body_end_out(soap) + || soap_envelope_end_out(soap)) + return soap->error; + } + if (soap_end_count(soap)) + return soap->error; + if (soap_connect(soap, soap_endpoint, soap_action) + || soap_envelope_begin_out(soap) + || soap_putheader(soap) + || soap_body_begin_out(soap) + || soap_put___ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN(soap, &soap_tmp___ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN, "-ns1:SI_PROCESSROUTE_PLM_OUT_SYN", "") + || soap_body_end_out(soap) + || soap_envelope_end_out(soap) + || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +int SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy::recv_SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN(ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP &ns1__MT_USCOREPROCESSROUTE_USCORES4_USCORERSP) +{ + struct soap *soap = this; + ns1__MT_USCOREPROCESSROUTE_USCORES4_USCORERSP.soap_default(soap); + if (soap_begin_recv(soap) + || soap_envelope_begin_in(soap) + || soap_recv_header(soap) + || soap_body_begin_in(soap)) + return soap_closesock(soap); + ns1__MT_USCOREPROCESSROUTE_USCORES4_USCORERSP.soap_get(soap, "ns1:MT_PROCESSROUTE_S4_RSP", NULL); + if (soap->error) + return soap_recv_fault(soap, 0); + if (soap_body_end_in(soap) + || soap_envelope_end_in(soap) + || soap_end_recv(soap)) + return soap_closesock(soap); + return soap_closesock(soap); +} +/* End of client proxy code */ diff --git a/DFL_BOM_WL_TOERP/soapSI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy.h b/DFL_BOM_WL_TOERP/soapSI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy.h new file mode 100644 index 0000000..9dfe1a1 --- /dev/null +++ b/DFL_BOM_WL_TOERP/soapSI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy.h @@ -0,0 +1,87 @@ +/* soapSI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy.h + Generated by gSOAP 2.8.131 for BOP.h + +gSOAP XML Web services tools +Copyright (C) 2000-2023, Robert van Engelen, Genivia Inc. All Rights Reserved. +The soapcpp2 tool and its generated software are released under the GPL. +This program is released under the GPL with the additional exemption that +compiling, linking, and/or using OpenSSL is allowed. +-------------------------------------------------------------------------------- +A commercial use license is available from Genivia Inc., contact@genivia.com +-------------------------------------------------------------------------------- +*/ + +#ifndef soapSI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy_H +#define soapSI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy_H +#include "soapH.h" + + class SOAP_CMAC SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy : public soap { + public: + /// Endpoint URL of service 'SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy' (change as needed) + const char *soap_endpoint; + /// Variables globally declared in BOP.h, if any + /// Construct a proxy with new managing context + SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy(); + /// Copy constructor + SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy(const SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy& rhs); + /// Construct proxy given a managing context + SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy(const struct soap&); + /// Construct proxy given a managing context and endpoint URL + SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy(const struct soap&, const char *soap_endpoint_url); + /// Constructor taking an endpoint URL + SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy(const char *soap_endpoint_url); + /// Constructor taking input and output mode flags for the new managing context + SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy(soap_mode iomode); + /// Constructor taking endpoint URL and input and output mode flags for the new managing context + SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy(const char *soap_endpoint_url, soap_mode iomode); + /// Constructor taking input and output mode flags for the new managing context + SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy(soap_mode imode, soap_mode omode); + /// Destructor deletes deserialized data and its managing context + virtual ~SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy(); + /// Initializer used by constructors + virtual void SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy_init(soap_mode imode, soap_mode omode); + /// Return a copy that has a new managing context with the same engine state + virtual SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy *copy(); + /// Copy assignment + SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy& operator=(const SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy&); + /// Delete all deserialized data (uses soap_destroy() and soap_end()) + virtual void destroy(); + /// Delete all deserialized data and reset to default + virtual void reset(); + /// Disables and removes SOAP Header from message by setting soap->header = NULL + virtual void soap_noheader(); + /// Get SOAP Header structure (i.e. soap->header, which is NULL when absent) + virtual ::SOAP_ENV__Header *soap_header(); + /// Get SOAP Fault structure (i.e. soap->fault, which is NULL when absent) + virtual ::SOAP_ENV__Fault *soap_fault(); + /// Get SOAP Fault subcode QName string (NULL when absent) + virtual const char *soap_fault_subcode(); + /// Get SOAP Fault string/reason (NULL when absent) + virtual const char *soap_fault_string(); + /// Get SOAP Fault detail XML string (NULL when absent) + virtual const char *soap_fault_detail(); + /// Close connection (normally automatic, except for send_X ops) + virtual int soap_close_socket(); + /// Force close connection (can kill a thread blocked on IO) + virtual int soap_force_close_socket(); + /// Print fault + virtual void soap_print_fault(FILE*); + #ifndef WITH_LEAN + #ifndef WITH_COMPAT + /// Print fault to stream + virtual void soap_stream_fault(std::ostream&); + #endif + /// Write fault to buffer + virtual char *soap_sprint_fault(char *buf, size_t len); + #endif + // + /// Web service synchronous operation 'SI_PROCESSROUTE_PLM_OUT_SYN' with default endpoint and default SOAP Action header, returns SOAP_OK or error code + virtual int SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN(ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ *ns1__MT_USCOREPROCESSROUTE_USCORES4_USCOREREQ, ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP &ns1__MT_USCOREPROCESSROUTE_USCORES4_USCORERSP) { return this->SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN(NULL, NULL, ns1__MT_USCOREPROCESSROUTE_USCORES4_USCOREREQ, ns1__MT_USCOREPROCESSROUTE_USCORES4_USCORERSP); } + /// Web service synchronous operation 'SI_PROCESSROUTE_PLM_OUT_SYN' to the specified endpoint and SOAP Action header, returns SOAP_OK or error code + virtual int SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN(const char *soap_endpoint_url, const char *soap_action, ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ *ns1__MT_USCOREPROCESSROUTE_USCORES4_USCOREREQ, ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP &ns1__MT_USCOREPROCESSROUTE_USCORES4_USCORERSP) { return this->send_SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN(soap_endpoint_url, soap_action, ns1__MT_USCOREPROCESSROUTE_USCORES4_USCOREREQ) || this->recv_SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN(ns1__MT_USCOREPROCESSROUTE_USCORES4_USCORERSP) ? this->error : SOAP_OK; } + /// Web service asynchronous operation 'send_SI_PROCESSROUTE_PLM_OUT_SYN' to send a request message to the specified endpoint and SOAP Action header, returns SOAP_OK or error code + virtual int send_SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN(const char *soap_endpoint_url, const char *soap_action, ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ *ns1__MT_USCOREPROCESSROUTE_USCORES4_USCOREREQ); + /// Web service asynchronous operation 'recv_SI_PROCESSROUTE_PLM_OUT_SYN' to receive a response message from the connected endpoint, returns SOAP_OK or error code + virtual int recv_SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN(ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP &ns1__MT_USCOREPROCESSROUTE_USCORES4_USCORERSP); + }; +#endif diff --git a/DFL_BOM_WL_TOERP/soapStub.h b/DFL_BOM_WL_TOERP/soapStub.h new file mode 100644 index 0000000..a9ca095 --- /dev/null +++ b/DFL_BOM_WL_TOERP/soapStub.h @@ -0,0 +1,1509 @@ +/* soapStub.h + Generated by gSOAP 2.8.131 for total2.h + +gSOAP XML Web services tools +Copyright (C) 2000-2023, Robert van Engelen, Genivia Inc. All Rights Reserved. +The soapcpp2 tool and its generated software are released under the GPL. +This program is released under the GPL with the additional exemption that +compiling, linking, and/or using OpenSSL is allowed. +-------------------------------------------------------------------------------- +A commercial use license is available from Genivia Inc., contact@genivia.com +-------------------------------------------------------------------------------- +*/ + +#define SOAP_NAMESPACE_OF_ns1 "urn:chintelectric.com:xi:plm" + +#ifndef soapStub_H +#define soapStub_H +#include "stdsoap2.h" +#if GSOAP_VERSION != 208131 +# error "GSOAP VERSION 208131 MISMATCH IN GENERATED CODE VERSUS LIBRARY CODE: PLEASE REINSTALL PACKAGE" +#endif + + +/******************************************************************************\ + * * + * Types with Custom Serializers * + * * +\******************************************************************************/ + + +/******************************************************************************\ + * * + * Classes, Structs and Unions * + * * +\******************************************************************************/ + +class _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO; /* total2.h:200 */ +class _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD; /* total2.h:231 */ +class _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM; /* total2.h:309 */ +class _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS; /* total2.h:294 */ +class _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST; /* total2.h:218 */ +class ns1__DT_USCOREBOM_USCORES4_USCOREREQ; /* total2.h:152 */ +struct __ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN; /* total2.h:508 */ +class _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO; /* total2.h:771 */ +class _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN; /* total2.h:789 */ +class ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP; /* total2.h:721 */ +class _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO; /* total2.h:841 */ +class _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD; /* total2.h:872 */ +class _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM; /* total2.h:1005 */ +class _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS; /* total2.h:990 */ +class _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM; /* total2.h:937 */ +class _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS; /* total2.h:922 */ +class _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST; /* total2.h:859 */ +class ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ; /* total2.h:723 */ +struct __ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN; /* total2.h:1241 */ +class _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO; /* total2.h:1506 */ +class _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN; /* total2.h:1524 */ +class ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP; /* total2.h:1456 */ +class _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO; /* total2.h:1567 */ +class _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM; /* total2.h:1598 */ +class _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS; /* total2.h:1583 */ +class ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ; /* total2.h:1458 */ +struct __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN; /* total2.h:1801 */ + +/* total2.h:200 */ +#ifndef SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO +#define SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO (8) +/* complex XML schema type 'ns1:DT_BOM_S4_REQ-BASEINFO': */ +class SOAP_CMAC _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO { + public: + /// Optional element 'REQ_TRACE_ID' of XML schema type 'xsd:string' + char *REQ_USCORETRACE_USCOREID; + public: + /// Return unique type id SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO + virtual long soap_type(void) const { return SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO; } + /// (Re)set members to default values + virtual void soap_default(struct soap*); + /// Serialize object to prepare for SOAP 1.1/1.2 encoded output (or with SOAP_XML_GRAPH) by analyzing its (cyclic) structures + virtual void soap_serialize(struct soap*) const; + /// Output object in XML, compliant with SOAP 1.1 encoding style, return error code or SOAP_OK + virtual int soap_put(struct soap*, const char *tag, const char *type) const; + /// Output object in XML, with tag and optional id attribute and xsi:type, return error code or SOAP_OK + virtual int soap_out(struct soap*, const char *tag, int id, const char *type) const; + /// Get object from XML, compliant with SOAP 1.1 encoding style, return pointer to object or NULL on error + virtual void *soap_get(struct soap*, const char *tag, const char *type); + /// Get object from XML, with matching tag and type (NULL matches any tag and type), return pointer to object or NULL on error + virtual void *soap_in(struct soap*, const char *tag, const char *type); + /// Return a new object of type _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO, default initialized and not managed by a soap context + virtual _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO *soap_alloc(void) const { return SOAP_NEW_UNMANAGED(_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO); } + public: + /// Constructor with default initializations + _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO() : REQ_USCORETRACE_USCOREID() { } + /// Destructor + virtual ~_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO() { } + /// Friend allocator used by soap_new__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO(struct soap*, int) + friend SOAP_FMAC1 _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO * SOAP_FMAC2 soap_instantiate__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO(struct soap*, int, const char*, const char*, size_t*); +}; +#endif + +/* total2.h:231 */ +#ifndef SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD +#define SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD (11) +/* complex XML schema type 'ns1:DT_BOM_S4_REQ-LIST-HEAD': */ +class SOAP_CMAC _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD { + public: + /// Optional element 'PSPNR' of XML schema type 'xsd:string' + char *PSPNR; + /// Required element 'MATNR' of XML schema type 'xsd:string' + char *MATNR; + /// Required element 'WERKS' of XML schema type 'xsd:string' + char *WERKS; + /// Optional element 'DATUV' of XML schema type 'xsd:string' + char *DATUV; + /// Optional element 'STLAN' of XML schema type 'xsd:string' + char *STLAN; + /// Optional element 'STLAL' of XML schema type 'xsd:string' + char *STLAL; + /// Required element 'BMENG' of XML schema type 'xsd:string' + char *BMENG; + /// Optional element 'BMEIN' of XML schema type 'xsd:string' + char *BMEIN; + /// Optional element 'STKTX' of XML schema type 'xsd:string' + char *STKTX; + public: + /// Return unique type id SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD + virtual long soap_type(void) const { return SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD; } + /// (Re)set members to default values + virtual void soap_default(struct soap*); + /// Serialize object to prepare for SOAP 1.1/1.2 encoded output (or with SOAP_XML_GRAPH) by analyzing its (cyclic) structures + virtual void soap_serialize(struct soap*) const; + /// Output object in XML, compliant with SOAP 1.1 encoding style, return error code or SOAP_OK + virtual int soap_put(struct soap*, const char *tag, const char *type) const; + /// Output object in XML, with tag and optional id attribute and xsi:type, return error code or SOAP_OK + virtual int soap_out(struct soap*, const char *tag, int id, const char *type) const; + /// Get object from XML, compliant with SOAP 1.1 encoding style, return pointer to object or NULL on error + virtual void *soap_get(struct soap*, const char *tag, const char *type); + /// Get object from XML, with matching tag and type (NULL matches any tag and type), return pointer to object or NULL on error + virtual void *soap_in(struct soap*, const char *tag, const char *type); + /// Return a new object of type _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD, default initialized and not managed by a soap context + virtual _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD *soap_alloc(void) const { return SOAP_NEW_UNMANAGED(_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD); } + public: + /// Constructor with default initializations + _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD() : PSPNR(), MATNR(), WERKS(), DATUV(), STLAN(), STLAL(), BMENG(), BMEIN(), STKTX() { } + /// Destructor + virtual ~_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD() { } + /// Friend allocator used by soap_new__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD(struct soap*, int) + friend SOAP_FMAC1 _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD * SOAP_FMAC2 soap_instantiate__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD(struct soap*, int, const char*, const char*, size_t*); +}; +#endif + +/* total2.h:309 */ +#ifndef SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM +#define SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM (13) +/* complex XML schema type 'ns1:DT_BOM_S4_REQ-LIST-ITEMS-ITEM': */ +class SOAP_CMAC _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM { + public: + /// Optional element 'DATUV' of XML schema type 'xsd:string' + char *DATUV; + /// Required element 'POSTP' of XML schema type 'xsd:string' + char *POSTP; + /// Required element 'POSNR' of XML schema type 'xsd:string' + char *POSNR; + /// Required element 'IDNRK' of XML schema type 'xsd:string' + char *IDNRK; + /// Required element 'MENGE' of XML schema type 'xsd:string' + char *MENGE; + /// Optional element 'MEINS' of XML schema type 'xsd:string' + char *MEINS; + /// Optional element 'SORTF' of XML schema type 'xsd:string' + char *SORTF; + /// Optional element 'POTX1' of XML schema type 'xsd:string' + char *POTX1; + public: + /// Return unique type id SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM + virtual long soap_type(void) const { return SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM; } + /// (Re)set members to default values + virtual void soap_default(struct soap*); + /// Serialize object to prepare for SOAP 1.1/1.2 encoded output (or with SOAP_XML_GRAPH) by analyzing its (cyclic) structures + virtual void soap_serialize(struct soap*) const; + /// Output object in XML, compliant with SOAP 1.1 encoding style, return error code or SOAP_OK + virtual int soap_put(struct soap*, const char *tag, const char *type) const; + /// Output object in XML, with tag and optional id attribute and xsi:type, return error code or SOAP_OK + virtual int soap_out(struct soap*, const char *tag, int id, const char *type) const; + /// Get object from XML, compliant with SOAP 1.1 encoding style, return pointer to object or NULL on error + virtual void *soap_get(struct soap*, const char *tag, const char *type); + /// Get object from XML, with matching tag and type (NULL matches any tag and type), return pointer to object or NULL on error + virtual void *soap_in(struct soap*, const char *tag, const char *type); + /// Return a new object of type _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM, default initialized and not managed by a soap context + virtual _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM *soap_alloc(void) const { return SOAP_NEW_UNMANAGED(_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM); } + public: + /// Constructor with default initializations + _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM() : DATUV(), POSTP(), POSNR(), IDNRK(), MENGE(), MEINS(), SORTF(), POTX1() { } + /// Destructor + virtual ~_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM() { } + /// Friend allocator used by soap_new__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(struct soap*, int) + friend SOAP_FMAC1 _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM * SOAP_FMAC2 soap_instantiate__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(struct soap*, int, const char*, const char*, size_t*); +}; +#endif + +/* total2.h:294 */ +#ifndef SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS +#define SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS (12) +/* complex XML schema type 'ns1:DT_BOM_S4_REQ-LIST-ITEMS': */ +class SOAP_CMAC _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS { + public: + /// Sequence of elements 'ITEM' of XML schema type 'ns1:DT_BOM_S4_REQ-LIST-ITEMS-ITEM' stored in dynamic array ITEM of length __sizeITEM + int __sizeITEM; + _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM *ITEM; + public: + /// Return unique type id SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS + virtual long soap_type(void) const { return SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS; } + /// (Re)set members to default values + virtual void soap_default(struct soap*); + /// Serialize object to prepare for SOAP 1.1/1.2 encoded output (or with SOAP_XML_GRAPH) by analyzing its (cyclic) structures + virtual void soap_serialize(struct soap*) const; + /// Output object in XML, compliant with SOAP 1.1 encoding style, return error code or SOAP_OK + virtual int soap_put(struct soap*, const char *tag, const char *type) const; + /// Output object in XML, with tag and optional id attribute and xsi:type, return error code or SOAP_OK + virtual int soap_out(struct soap*, const char *tag, int id, const char *type) const; + /// Get object from XML, compliant with SOAP 1.1 encoding style, return pointer to object or NULL on error + virtual void *soap_get(struct soap*, const char *tag, const char *type); + /// Get object from XML, with matching tag and type (NULL matches any tag and type), return pointer to object or NULL on error + virtual void *soap_in(struct soap*, const char *tag, const char *type); + /// Return a new object of type _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS, default initialized and not managed by a soap context + virtual _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS *soap_alloc(void) const { return SOAP_NEW_UNMANAGED(_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS); } + public: + /// Constructor with default initializations + _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS() : __sizeITEM(), ITEM() { } + /// Destructor + virtual ~_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS() { } + /// Friend allocator used by soap_new__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS(struct soap*, int) + friend SOAP_FMAC1 _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS * SOAP_FMAC2 soap_instantiate__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS(struct soap*, int, const char*, const char*, size_t*); +}; +#endif + +/* total2.h:218 */ +#ifndef SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST +#define SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST (10) +/* complex XML schema type 'ns1:DT_BOM_S4_REQ-LIST': */ +class SOAP_CMAC _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST { + public: + /// Required element 'HEAD' of XML schema type 'ns1:DT_BOM_S4_REQ-LIST-HEAD' + _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD HEAD; + /// Required element 'ITEMS' of XML schema type 'ns1:DT_BOM_S4_REQ-LIST-ITEMS' + _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS ITEMS; + public: + /// Return unique type id SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST + virtual long soap_type(void) const { return SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST; } + /// (Re)set members to default values + virtual void soap_default(struct soap*); + /// Serialize object to prepare for SOAP 1.1/1.2 encoded output (or with SOAP_XML_GRAPH) by analyzing its (cyclic) structures + virtual void soap_serialize(struct soap*) const; + /// Output object in XML, compliant with SOAP 1.1 encoding style, return error code or SOAP_OK + virtual int soap_put(struct soap*, const char *tag, const char *type) const; + /// Output object in XML, with tag and optional id attribute and xsi:type, return error code or SOAP_OK + virtual int soap_out(struct soap*, const char *tag, int id, const char *type) const; + /// Get object from XML, compliant with SOAP 1.1 encoding style, return pointer to object or NULL on error + virtual void *soap_get(struct soap*, const char *tag, const char *type); + /// Get object from XML, with matching tag and type (NULL matches any tag and type), return pointer to object or NULL on error + virtual void *soap_in(struct soap*, const char *tag, const char *type); + /// Return a new object of type _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST, default initialized and not managed by a soap context + virtual _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST *soap_alloc(void) const { return SOAP_NEW_UNMANAGED(_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST); } + public: + /// Constructor with default initializations + _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST() : HEAD(), ITEMS() { } + /// Destructor + virtual ~_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST() { } + /// Friend allocator used by soap_new__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST(struct soap*, int) + friend SOAP_FMAC1 _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST * SOAP_FMAC2 soap_instantiate__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST(struct soap*, int, const char*, const char*, size_t*); +}; +#endif + +/* total2.h:152 */ +#ifndef SOAP_TYPE_ns1__DT_USCOREBOM_USCORES4_USCOREREQ +#define SOAP_TYPE_ns1__DT_USCOREBOM_USCORES4_USCOREREQ (7) +/* complex XML schema type 'ns1:DT_BOM_S4_REQ': */ +class SOAP_CMAC ns1__DT_USCOREBOM_USCORES4_USCOREREQ { + public: + /// Optional element 'BASEINFO' of XML schema type 'ns1:DT_BOM_S4_REQ-BASEINFO' + _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO *BASEINFO; + /// Sequence of elements 'LIST' of XML schema type 'ns1:DT_BOM_S4_REQ-LIST' stored in dynamic array LIST of length __sizeLIST + int __sizeLIST; + _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST *LIST; + /// Context that manages this object + struct soap *soap; + public: + /// Return unique type id SOAP_TYPE_ns1__DT_USCOREBOM_USCORES4_USCOREREQ + virtual long soap_type(void) const { return SOAP_TYPE_ns1__DT_USCOREBOM_USCORES4_USCOREREQ; } + /// (Re)set members to default values + virtual void soap_default(struct soap*); + /// Serialize object to prepare for SOAP 1.1/1.2 encoded output (or with SOAP_XML_GRAPH) by analyzing its (cyclic) structures + virtual void soap_serialize(struct soap*) const; + /// Output object in XML, compliant with SOAP 1.1 encoding style, return error code or SOAP_OK + virtual int soap_put(struct soap*, const char *tag, const char *type) const; + /// Output object in XML, with tag and optional id attribute and xsi:type, return error code or SOAP_OK + virtual int soap_out(struct soap*, const char *tag, int id, const char *type) const; + /// Get object from XML, compliant with SOAP 1.1 encoding style, return pointer to object or NULL on error + virtual void *soap_get(struct soap*, const char *tag, const char *type); + /// Get object from XML, with matching tag and type (NULL matches any tag and type), return pointer to object or NULL on error + virtual void *soap_in(struct soap*, const char *tag, const char *type); + /// Return a new object of type ns1__DT_USCOREBOM_USCORES4_USCOREREQ, default initialized and not managed by a soap context + virtual ns1__DT_USCOREBOM_USCORES4_USCOREREQ *soap_alloc(void) const { return SOAP_NEW_UNMANAGED(ns1__DT_USCOREBOM_USCORES4_USCOREREQ); } + public: + /// Constructor with default initializations + ns1__DT_USCOREBOM_USCORES4_USCOREREQ() : BASEINFO(), __sizeLIST(), LIST(), soap() { } + /// Destructor + virtual ~ns1__DT_USCOREBOM_USCORES4_USCOREREQ() { } + /// Friend allocator used by soap_new_ns1__DT_USCOREBOM_USCORES4_USCOREREQ(struct soap*, int) + friend SOAP_FMAC1 ns1__DT_USCOREBOM_USCORES4_USCOREREQ * SOAP_FMAC2 soap_instantiate_ns1__DT_USCOREBOM_USCORES4_USCOREREQ(struct soap*, int, const char*, const char*, size_t*); +}; +#endif + +/* total2.h:508 */ +#ifndef SOAP_TYPE___ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN +#define SOAP_TYPE___ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN (20) +/* Wrapper: */ +struct SOAP_CMAC __ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN { + public: + /** Optional element 'ns1:MT_BOM_S4_REQ' of XML schema type 'ns1:DT_BOM_S4_REQ' */ + ns1__DT_USCOREBOM_USCORES4_USCOREREQ *ns1__MT_USCOREBOM_USCORES4_USCOREREQ; + public: + /** Return unique type id SOAP_TYPE___ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN */ + long soap_type() const { return SOAP_TYPE___ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN; } + /** Constructor with member initializations */ + __ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN() : ns1__MT_USCOREBOM_USCORES4_USCOREREQ() { } + /** Friend allocator */ + friend SOAP_FMAC1 __ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN * SOAP_FMAC2 soap_instantiate___ns1__SIO_USCOREBOM_USCOREPLM_USCOREASYN(struct soap*, int, const char*, const char*, size_t*); +}; +#endif + +/* total2.h:771 */ +#ifndef SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO +#define SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO (23) +/* complex XML schema type 'ns1:DT_PROCESSROUTE_S4_RSP-RSP_BASEINFO': */ +class SOAP_CMAC _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO { + public: + /// Required element 'REQ_TRACE_ID' of XML schema type 'xsd:string' + char *REQ_USCORETRACE_USCOREID; + public: + /// Return unique type id SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO + virtual long soap_type(void) const { return SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO; } + /// (Re)set members to default values + virtual void soap_default(struct soap*); + /// Serialize object to prepare for SOAP 1.1/1.2 encoded output (or with SOAP_XML_GRAPH) by analyzing its (cyclic) structures + virtual void soap_serialize(struct soap*) const; + /// Output object in XML, compliant with SOAP 1.1 encoding style, return error code or SOAP_OK + virtual int soap_put(struct soap*, const char *tag, const char *type) const; + /// Output object in XML, with tag and optional id attribute and xsi:type, return error code or SOAP_OK + virtual int soap_out(struct soap*, const char *tag, int id, const char *type) const; + /// Get object from XML, compliant with SOAP 1.1 encoding style, return pointer to object or NULL on error + virtual void *soap_get(struct soap*, const char *tag, const char *type); + /// Get object from XML, with matching tag and type (NULL matches any tag and type), return pointer to object or NULL on error + virtual void *soap_in(struct soap*, const char *tag, const char *type); + /// Return a new object of type _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO, default initialized and not managed by a soap context + virtual _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO *soap_alloc(void) const { return SOAP_NEW_UNMANAGED(_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO); } + public: + /// Constructor with default initializations + _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO() : REQ_USCORETRACE_USCOREID() { } + /// Destructor + virtual ~_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO() { } + /// Friend allocator used by soap_new__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO(struct soap*, int) + friend SOAP_FMAC1 _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO * SOAP_FMAC2 soap_instantiate__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO(struct soap*, int, const char*, const char*, size_t*); +}; +#endif + +/* total2.h:789 */ +#ifndef SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN +#define SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN (24) +/* complex XML schema type 'ns1:DT_PROCESSROUTE_S4_RSP-ZTABLE_RETURN': */ +class SOAP_CMAC _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN { + public: + /// Optional element 'MATNR' of XML schema type 'xsd:string' + char *MATNR; + /// Optional element 'TYPE' of XML schema type 'xsd:string' + char *TYPE; + /// Optional element 'MESSAGE' of XML schema type 'xsd:string' + char *MESSAGE; + public: + /// Return unique type id SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN + virtual long soap_type(void) const { return SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN; } + /// (Re)set members to default values + virtual void soap_default(struct soap*); + /// Serialize object to prepare for SOAP 1.1/1.2 encoded output (or with SOAP_XML_GRAPH) by analyzing its (cyclic) structures + virtual void soap_serialize(struct soap*) const; + /// Output object in XML, compliant with SOAP 1.1 encoding style, return error code or SOAP_OK + virtual int soap_put(struct soap*, const char *tag, const char *type) const; + /// Output object in XML, with tag and optional id attribute and xsi:type, return error code or SOAP_OK + virtual int soap_out(struct soap*, const char *tag, int id, const char *type) const; + /// Get object from XML, compliant with SOAP 1.1 encoding style, return pointer to object or NULL on error + virtual void *soap_get(struct soap*, const char *tag, const char *type); + /// Get object from XML, with matching tag and type (NULL matches any tag and type), return pointer to object or NULL on error + virtual void *soap_in(struct soap*, const char *tag, const char *type); + /// Return a new object of type _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN, default initialized and not managed by a soap context + virtual _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN *soap_alloc(void) const { return SOAP_NEW_UNMANAGED(_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN); } + public: + /// Constructor with default initializations + _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN() : MATNR(), TYPE(), MESSAGE() { } + /// Destructor + virtual ~_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN() { } + /// Friend allocator used by soap_new__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN(struct soap*, int) + friend SOAP_FMAC1 _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN * SOAP_FMAC2 soap_instantiate__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN(struct soap*, int, const char*, const char*, size_t*); +}; +#endif + +/* total2.h:721 */ +#ifndef SOAP_TYPE_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP +#define SOAP_TYPE_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP (21) +/* complex XML schema type 'ns1:DT_PROCESSROUTE_S4_RSP': */ +class SOAP_CMAC ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP { + public: + /// Required element 'RSP_BASEINFO' of XML schema type 'ns1:DT_PROCESSROUTE_S4_RSP-RSP_BASEINFO' + _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO RSP_USCOREBASEINFO; + /// Sequence of elements 'ZTABLE_RETURN' of XML schema type 'ns1:DT_PROCESSROUTE_S4_RSP-ZTABLE_RETURN' stored in dynamic array ZTABLE_USCORERETURN of length __sizeZTABLE_USCORERETURN + int __sizeZTABLE_USCORERETURN; + _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN *ZTABLE_USCORERETURN; + /// Context that manages this object + struct soap *soap; + public: + /// Return unique type id SOAP_TYPE_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP + virtual long soap_type(void) const { return SOAP_TYPE_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP; } + /// (Re)set members to default values + virtual void soap_default(struct soap*); + /// Serialize object to prepare for SOAP 1.1/1.2 encoded output (or with SOAP_XML_GRAPH) by analyzing its (cyclic) structures + virtual void soap_serialize(struct soap*) const; + /// Output object in XML, compliant with SOAP 1.1 encoding style, return error code or SOAP_OK + virtual int soap_put(struct soap*, const char *tag, const char *type) const; + /// Output object in XML, with tag and optional id attribute and xsi:type, return error code or SOAP_OK + virtual int soap_out(struct soap*, const char *tag, int id, const char *type) const; + /// Get object from XML, compliant with SOAP 1.1 encoding style, return pointer to object or NULL on error + virtual void *soap_get(struct soap*, const char *tag, const char *type); + /// Get object from XML, with matching tag and type (NULL matches any tag and type), return pointer to object or NULL on error + virtual void *soap_in(struct soap*, const char *tag, const char *type); + /// Return a new object of type ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP, default initialized and not managed by a soap context + virtual ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP *soap_alloc(void) const { return SOAP_NEW_UNMANAGED(ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP); } + public: + /// Constructor with default initializations + ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP() : RSP_USCOREBASEINFO(), __sizeZTABLE_USCORERETURN(), ZTABLE_USCORERETURN(), soap() { } + /// Destructor + virtual ~ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP() { } + /// Friend allocator used by soap_new_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP(struct soap*, int) + friend SOAP_FMAC1 ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP * SOAP_FMAC2 soap_instantiate_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP(struct soap*, int, const char*, const char*, size_t*); +}; +#endif + +/* total2.h:841 */ +#ifndef SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO +#define SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO (26) +/* complex XML schema type 'ns1:DT_PROCESSROUTE_S4_REQ-BASEINFO': */ +class SOAP_CMAC _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO { + public: + /// Optional element 'REQ_TRACE_ID' of XML schema type 'xsd:string' + char *REQ_USCORETRACE_USCOREID; + public: + /// Return unique type id SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO + virtual long soap_type(void) const { return SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO; } + /// (Re)set members to default values + virtual void soap_default(struct soap*); + /// Serialize object to prepare for SOAP 1.1/1.2 encoded output (or with SOAP_XML_GRAPH) by analyzing its (cyclic) structures + virtual void soap_serialize(struct soap*) const; + /// Output object in XML, compliant with SOAP 1.1 encoding style, return error code or SOAP_OK + virtual int soap_put(struct soap*, const char *tag, const char *type) const; + /// Output object in XML, with tag and optional id attribute and xsi:type, return error code or SOAP_OK + virtual int soap_out(struct soap*, const char *tag, int id, const char *type) const; + /// Get object from XML, compliant with SOAP 1.1 encoding style, return pointer to object or NULL on error + virtual void *soap_get(struct soap*, const char *tag, const char *type); + /// Get object from XML, with matching tag and type (NULL matches any tag and type), return pointer to object or NULL on error + virtual void *soap_in(struct soap*, const char *tag, const char *type); + /// Return a new object of type _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO, default initialized and not managed by a soap context + virtual _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO *soap_alloc(void) const { return SOAP_NEW_UNMANAGED(_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO); } + public: + /// Constructor with default initializations + _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO() : REQ_USCORETRACE_USCOREID() { } + /// Destructor + virtual ~_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO() { } + /// Friend allocator used by soap_new__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO(struct soap*, int) + friend SOAP_FMAC1 _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO * SOAP_FMAC2 soap_instantiate__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO(struct soap*, int, const char*, const char*, size_t*); +}; +#endif + +/* total2.h:872 */ +#ifndef SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD +#define SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD (28) +/* complex XML schema type 'ns1:DT_PROCESSROUTE_S4_REQ-LIST-HEAD': */ +class SOAP_CMAC _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD { + public: + /// Required element 'MATNR' of XML schema type 'xsd:string' + char *MATNR; + /// Required element 'WERKS' of XML schema type 'xsd:string' + char *WERKS; + /// Required element 'VERWE' of XML schema type 'xsd:string' + char *VERWE; + /// Required element 'STATU' of XML schema type 'xsd:string' + char *STATU; + /// Optional element 'DATUV' of XML schema type 'xsd:string' + char *DATUV; + /// Optional element 'PLNAL' of XML schema type 'xsd:string' + char *PLNAL; + /// Optional element 'PSPNR' of XML schema type 'xsd:string' + char *PSPNR; + public: + /// Return unique type id SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD + virtual long soap_type(void) const { return SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD; } + /// (Re)set members to default values + virtual void soap_default(struct soap*); + /// Serialize object to prepare for SOAP 1.1/1.2 encoded output (or with SOAP_XML_GRAPH) by analyzing its (cyclic) structures + virtual void soap_serialize(struct soap*) const; + /// Output object in XML, compliant with SOAP 1.1 encoding style, return error code or SOAP_OK + virtual int soap_put(struct soap*, const char *tag, const char *type) const; + /// Output object in XML, with tag and optional id attribute and xsi:type, return error code or SOAP_OK + virtual int soap_out(struct soap*, const char *tag, int id, const char *type) const; + /// Get object from XML, compliant with SOAP 1.1 encoding style, return pointer to object or NULL on error + virtual void *soap_get(struct soap*, const char *tag, const char *type); + /// Get object from XML, with matching tag and type (NULL matches any tag and type), return pointer to object or NULL on error + virtual void *soap_in(struct soap*, const char *tag, const char *type); + /// Return a new object of type _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD, default initialized and not managed by a soap context + virtual _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD *soap_alloc(void) const { return SOAP_NEW_UNMANAGED(_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD); } + public: + /// Constructor with default initializations + _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD() : MATNR(), WERKS(), VERWE(), STATU(), DATUV(), PLNAL(), PSPNR() { } + /// Destructor + virtual ~_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD() { } + /// Friend allocator used by soap_new__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD(struct soap*, int) + friend SOAP_FMAC1 _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD * SOAP_FMAC2 soap_instantiate__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD(struct soap*, int, const char*, const char*, size_t*); +}; +#endif + +/* total2.h:1005 */ +#ifndef SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM +#define SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM (32) +/* complex XML schema type 'ns1:DT_PROCESSROUTE_S4_REQ-LIST-ITEMS-ITEM-SUBITEMS-SUBITEM': */ +class SOAP_CMAC _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM { + public: + /// Optional element 'VORNR' of XML schema type 'xsd:string' + char *VORNR; + /// Optional element 'ARBPL' of XML schema type 'xsd:string' + char *ARBPL; + /// Optional element 'STEUS' of XML schema type 'xsd:string' + char *STEUS; + /// Optional element 'LTXA1' of XML schema type 'xsd:string' + char *LTXA1; + /// Optional element 'USR00' of XML schema type 'xsd:string' + char *USR00; + /// Required element 'BMSCH' of XML schema type 'xsd:string' + char *BMSCH; + /// Optional element 'PLNME' of XML schema type 'xsd:string' + char *PLNME; + /// Required element 'VGW01' of XML schema type 'xsd:string' + char *VGW01; + /// Required element 'VGE01' of XML schema type 'xsd:string' + char *VGE01; + /// Required element 'VGW02' of XML schema type 'xsd:string' + char *VGW02; + /// Required element 'VGE02' of XML schema type 'xsd:string' + char *VGE02; + /// Optional element 'VGW05' of XML schema type 'xsd:string' + char *VGW05; + /// Optional element 'VGE05' of XML schema type 'xsd:string' + char *VGE05; + public: + /// Return unique type id SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM + virtual long soap_type(void) const { return SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM; } + /// (Re)set members to default values + virtual void soap_default(struct soap*); + /// Serialize object to prepare for SOAP 1.1/1.2 encoded output (or with SOAP_XML_GRAPH) by analyzing its (cyclic) structures + virtual void soap_serialize(struct soap*) const; + /// Output object in XML, compliant with SOAP 1.1 encoding style, return error code or SOAP_OK + virtual int soap_put(struct soap*, const char *tag, const char *type) const; + /// Output object in XML, with tag and optional id attribute and xsi:type, return error code or SOAP_OK + virtual int soap_out(struct soap*, const char *tag, int id, const char *type) const; + /// Get object from XML, compliant with SOAP 1.1 encoding style, return pointer to object or NULL on error + virtual void *soap_get(struct soap*, const char *tag, const char *type); + /// Get object from XML, with matching tag and type (NULL matches any tag and type), return pointer to object or NULL on error + virtual void *soap_in(struct soap*, const char *tag, const char *type); + /// Return a new object of type _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM, default initialized and not managed by a soap context + virtual _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM *soap_alloc(void) const { return SOAP_NEW_UNMANAGED(_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM); } + public: + /// Constructor with default initializations + _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM() : VORNR(), ARBPL(), STEUS(), LTXA1(), USR00(), BMSCH(), PLNME(), VGW01(), VGE01(), VGW02(), VGE02(), VGW05(), VGE05() { } + /// Destructor + virtual ~_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM() { } + /// Friend allocator used by soap_new__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM(struct soap*, int) + friend SOAP_FMAC1 _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM * SOAP_FMAC2 soap_instantiate__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM(struct soap*, int, const char*, const char*, size_t*); +}; +#endif + +/* total2.h:990 */ +#ifndef SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS +#define SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS (31) +/* complex XML schema type 'ns1:DT_PROCESSROUTE_S4_REQ-LIST-ITEMS-ITEM-SUBITEMS': */ +class SOAP_CMAC _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS { + public: + /// Sequence of elements 'SUBITEM' of XML schema type 'ns1:DT_PROCESSROUTE_S4_REQ-LIST-ITEMS-ITEM-SUBITEMS-SUBITEM' stored in dynamic array SUBITEM of length __sizeSUBITEM + int __sizeSUBITEM; + _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM *SUBITEM; + public: + /// Return unique type id SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS + virtual long soap_type(void) const { return SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS; } + /// (Re)set members to default values + virtual void soap_default(struct soap*); + /// Serialize object to prepare for SOAP 1.1/1.2 encoded output (or with SOAP_XML_GRAPH) by analyzing its (cyclic) structures + virtual void soap_serialize(struct soap*) const; + /// Output object in XML, compliant with SOAP 1.1 encoding style, return error code or SOAP_OK + virtual int soap_put(struct soap*, const char *tag, const char *type) const; + /// Output object in XML, with tag and optional id attribute and xsi:type, return error code or SOAP_OK + virtual int soap_out(struct soap*, const char *tag, int id, const char *type) const; + /// Get object from XML, compliant with SOAP 1.1 encoding style, return pointer to object or NULL on error + virtual void *soap_get(struct soap*, const char *tag, const char *type); + /// Get object from XML, with matching tag and type (NULL matches any tag and type), return pointer to object or NULL on error + virtual void *soap_in(struct soap*, const char *tag, const char *type); + /// Return a new object of type _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS, default initialized and not managed by a soap context + virtual _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS *soap_alloc(void) const { return SOAP_NEW_UNMANAGED(_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS); } + public: + /// Constructor with default initializations + _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS() : __sizeSUBITEM(), SUBITEM() { } + /// Destructor + virtual ~_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS() { } + /// Friend allocator used by soap_new__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS(struct soap*, int) + friend SOAP_FMAC1 _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS * SOAP_FMAC2 soap_instantiate__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS(struct soap*, int, const char*, const char*, size_t*); +}; +#endif + +/* total2.h:937 */ +#ifndef SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM +#define SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM (30) +/* complex XML schema type 'ns1:DT_PROCESSROUTE_S4_REQ-LIST-ITEMS-ITEM': */ +class SOAP_CMAC _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM { + public: + /// Optional element 'PLNAL' of XML schema type 'xsd:string' + char *PLNAL; + /// Optional element 'PLNFL' of XML schema type 'xsd:string' + char *PLNFL; + /// Optional element 'DATUV' of XML schema type 'xsd:string' + char *DATUV; + /// Optional element 'FLGAT' of XML schema type 'xsd:string' + char *FLGAT; + /// Optional element 'BEZFL' of XML schema type 'xsd:string' + char *BEZFL; + /// Optional element 'LTXA1' of XML schema type 'xsd:string' + char *LTXA1; + /// Optional element 'VORNR1' of XML schema type 'xsd:string' + char *VORNR1; + /// Optional element 'VORNR2' of XML schema type 'xsd:string' + char *VORNR2; + /// Required element 'SUBITEMS' of XML schema type 'ns1:DT_PROCESSROUTE_S4_REQ-LIST-ITEMS-ITEM-SUBITEMS' + _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS SUBITEMS; + public: + /// Return unique type id SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM + virtual long soap_type(void) const { return SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM; } + /// (Re)set members to default values + virtual void soap_default(struct soap*); + /// Serialize object to prepare for SOAP 1.1/1.2 encoded output (or with SOAP_XML_GRAPH) by analyzing its (cyclic) structures + virtual void soap_serialize(struct soap*) const; + /// Output object in XML, compliant with SOAP 1.1 encoding style, return error code or SOAP_OK + virtual int soap_put(struct soap*, const char *tag, const char *type) const; + /// Output object in XML, with tag and optional id attribute and xsi:type, return error code or SOAP_OK + virtual int soap_out(struct soap*, const char *tag, int id, const char *type) const; + /// Get object from XML, compliant with SOAP 1.1 encoding style, return pointer to object or NULL on error + virtual void *soap_get(struct soap*, const char *tag, const char *type); + /// Get object from XML, with matching tag and type (NULL matches any tag and type), return pointer to object or NULL on error + virtual void *soap_in(struct soap*, const char *tag, const char *type); + /// Return a new object of type _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM, default initialized and not managed by a soap context + virtual _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM *soap_alloc(void) const { return SOAP_NEW_UNMANAGED(_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM); } + public: + /// Constructor with default initializations + _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM() : PLNAL(), PLNFL(), DATUV(), FLGAT(), BEZFL(), LTXA1(), VORNR1(), VORNR2(), SUBITEMS() { } + /// Destructor + virtual ~_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM() { } + /// Friend allocator used by soap_new__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(struct soap*, int) + friend SOAP_FMAC1 _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM * SOAP_FMAC2 soap_instantiate__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM(struct soap*, int, const char*, const char*, size_t*); +}; +#endif + +/* total2.h:922 */ +#ifndef SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS +#define SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS (29) +/* complex XML schema type 'ns1:DT_PROCESSROUTE_S4_REQ-LIST-ITEMS': */ +class SOAP_CMAC _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS { + public: + /// Sequence of elements 'ITEM' of XML schema type 'ns1:DT_PROCESSROUTE_S4_REQ-LIST-ITEMS-ITEM' stored in dynamic array ITEM of length __sizeITEM + int __sizeITEM; + _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM *ITEM; + public: + /// Return unique type id SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS + virtual long soap_type(void) const { return SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS; } + /// (Re)set members to default values + virtual void soap_default(struct soap*); + /// Serialize object to prepare for SOAP 1.1/1.2 encoded output (or with SOAP_XML_GRAPH) by analyzing its (cyclic) structures + virtual void soap_serialize(struct soap*) const; + /// Output object in XML, compliant with SOAP 1.1 encoding style, return error code or SOAP_OK + virtual int soap_put(struct soap*, const char *tag, const char *type) const; + /// Output object in XML, with tag and optional id attribute and xsi:type, return error code or SOAP_OK + virtual int soap_out(struct soap*, const char *tag, int id, const char *type) const; + /// Get object from XML, compliant with SOAP 1.1 encoding style, return pointer to object or NULL on error + virtual void *soap_get(struct soap*, const char *tag, const char *type); + /// Get object from XML, with matching tag and type (NULL matches any tag and type), return pointer to object or NULL on error + virtual void *soap_in(struct soap*, const char *tag, const char *type); + /// Return a new object of type _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS, default initialized and not managed by a soap context + virtual _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS *soap_alloc(void) const { return SOAP_NEW_UNMANAGED(_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS); } + public: + /// Constructor with default initializations + _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS() : __sizeITEM(), ITEM() { } + /// Destructor + virtual ~_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS() { } + /// Friend allocator used by soap_new__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS(struct soap*, int) + friend SOAP_FMAC1 _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS * SOAP_FMAC2 soap_instantiate__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS(struct soap*, int, const char*, const char*, size_t*); +}; +#endif + +/* total2.h:859 */ +#ifndef SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST +#define SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST (27) +/* complex XML schema type 'ns1:DT_PROCESSROUTE_S4_REQ-LIST': */ +class SOAP_CMAC _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST { + public: + /// Required element 'HEAD' of XML schema type 'ns1:DT_PROCESSROUTE_S4_REQ-LIST-HEAD' + _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD HEAD; + /// Required element 'ITEMS' of XML schema type 'ns1:DT_PROCESSROUTE_S4_REQ-LIST-ITEMS' + _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS ITEMS; + public: + /// Return unique type id SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST + virtual long soap_type(void) const { return SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST; } + /// (Re)set members to default values + virtual void soap_default(struct soap*); + /// Serialize object to prepare for SOAP 1.1/1.2 encoded output (or with SOAP_XML_GRAPH) by analyzing its (cyclic) structures + virtual void soap_serialize(struct soap*) const; + /// Output object in XML, compliant with SOAP 1.1 encoding style, return error code or SOAP_OK + virtual int soap_put(struct soap*, const char *tag, const char *type) const; + /// Output object in XML, with tag and optional id attribute and xsi:type, return error code or SOAP_OK + virtual int soap_out(struct soap*, const char *tag, int id, const char *type) const; + /// Get object from XML, compliant with SOAP 1.1 encoding style, return pointer to object or NULL on error + virtual void *soap_get(struct soap*, const char *tag, const char *type); + /// Get object from XML, with matching tag and type (NULL matches any tag and type), return pointer to object or NULL on error + virtual void *soap_in(struct soap*, const char *tag, const char *type); + /// Return a new object of type _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST, default initialized and not managed by a soap context + virtual _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST *soap_alloc(void) const { return SOAP_NEW_UNMANAGED(_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST); } + public: + /// Constructor with default initializations + _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST() : HEAD(), ITEMS() { } + /// Destructor + virtual ~_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST() { } + /// Friend allocator used by soap_new__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST(struct soap*, int) + friend SOAP_FMAC1 _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST * SOAP_FMAC2 soap_instantiate__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST(struct soap*, int, const char*, const char*, size_t*); +}; +#endif + +/* total2.h:723 */ +#ifndef SOAP_TYPE_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ +#define SOAP_TYPE_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ (22) +/* complex XML schema type 'ns1:DT_PROCESSROUTE_S4_REQ': */ +class SOAP_CMAC ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ { + public: + /// Required element 'BASEINFO' of XML schema type 'ns1:DT_PROCESSROUTE_S4_REQ-BASEINFO' + _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO BASEINFO; + /// Sequence of elements 'LIST' of XML schema type 'ns1:DT_PROCESSROUTE_S4_REQ-LIST' stored in dynamic array LIST of length __sizeLIST + int __sizeLIST; + _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST *LIST; + /// Context that manages this object + struct soap *soap; + public: + /// Return unique type id SOAP_TYPE_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ + virtual long soap_type(void) const { return SOAP_TYPE_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ; } + /// (Re)set members to default values + virtual void soap_default(struct soap*); + /// Serialize object to prepare for SOAP 1.1/1.2 encoded output (or with SOAP_XML_GRAPH) by analyzing its (cyclic) structures + virtual void soap_serialize(struct soap*) const; + /// Output object in XML, compliant with SOAP 1.1 encoding style, return error code or SOAP_OK + virtual int soap_put(struct soap*, const char *tag, const char *type) const; + /// Output object in XML, with tag and optional id attribute and xsi:type, return error code or SOAP_OK + virtual int soap_out(struct soap*, const char *tag, int id, const char *type) const; + /// Get object from XML, compliant with SOAP 1.1 encoding style, return pointer to object or NULL on error + virtual void *soap_get(struct soap*, const char *tag, const char *type); + /// Get object from XML, with matching tag and type (NULL matches any tag and type), return pointer to object or NULL on error + virtual void *soap_in(struct soap*, const char *tag, const char *type); + /// Return a new object of type ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ, default initialized and not managed by a soap context + virtual ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ *soap_alloc(void) const { return SOAP_NEW_UNMANAGED(ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ); } + public: + /// Constructor with default initializations + ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ() : BASEINFO(), __sizeLIST(), LIST(), soap() { } + /// Destructor + virtual ~ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ() { } + /// Friend allocator used by soap_new_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ(struct soap*, int) + friend SOAP_FMAC1 ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ * SOAP_FMAC2 soap_instantiate_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ(struct soap*, int, const char*, const char*, size_t*); +}; +#endif + +/* total2.h:1241 */ +#ifndef SOAP_TYPE___ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN +#define SOAP_TYPE___ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN (39) +/* Wrapper: */ +struct SOAP_CMAC __ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN { + public: + /** Optional element 'ns1:MT_PROCESSROUTE_S4_REQ' of XML schema type 'ns1:DT_PROCESSROUTE_S4_REQ' */ + ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ *ns1__MT_USCOREPROCESSROUTE_USCORES4_USCOREREQ; + public: + /** Return unique type id SOAP_TYPE___ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN */ + long soap_type() const { return SOAP_TYPE___ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN; } + /** Constructor with member initializations */ + __ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN() : ns1__MT_USCOREPROCESSROUTE_USCORES4_USCOREREQ() { } + /** Friend allocator */ + friend SOAP_FMAC1 __ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN * SOAP_FMAC2 soap_instantiate___ns1__SI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYN(struct soap*, int, const char*, const char*, size_t*); +}; +#endif + +/* total2.h:1506 */ +#ifndef SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO +#define SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO (42) +/* complex XML schema type 'ns1:DT_FACTORY_NUMBER_RSP-RSP_BASEINFO': */ +class SOAP_CMAC _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO { + public: + /// Optional element 'REQ_TRACE_ID' of XML schema type 'xsd:string' + char *REQ_USCORETRACE_USCOREID; + public: + /// Return unique type id SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO + virtual long soap_type(void) const { return SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO; } + /// (Re)set members to default values + virtual void soap_default(struct soap*); + /// Serialize object to prepare for SOAP 1.1/1.2 encoded output (or with SOAP_XML_GRAPH) by analyzing its (cyclic) structures + virtual void soap_serialize(struct soap*) const; + /// Output object in XML, compliant with SOAP 1.1 encoding style, return error code or SOAP_OK + virtual int soap_put(struct soap*, const char *tag, const char *type) const; + /// Output object in XML, with tag and optional id attribute and xsi:type, return error code or SOAP_OK + virtual int soap_out(struct soap*, const char *tag, int id, const char *type) const; + /// Get object from XML, compliant with SOAP 1.1 encoding style, return pointer to object or NULL on error + virtual void *soap_get(struct soap*, const char *tag, const char *type); + /// Get object from XML, with matching tag and type (NULL matches any tag and type), return pointer to object or NULL on error + virtual void *soap_in(struct soap*, const char *tag, const char *type); + /// Return a new object of type _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO, default initialized and not managed by a soap context + virtual _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO *soap_alloc(void) const { return SOAP_NEW_UNMANAGED(_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO); } + public: + /// Constructor with default initializations + _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO() : REQ_USCORETRACE_USCOREID() { } + /// Destructor + virtual ~_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO() { } + /// Friend allocator used by soap_new__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(struct soap*, int) + friend SOAP_FMAC1 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO * SOAP_FMAC2 soap_instantiate__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO(struct soap*, int, const char*, const char*, size_t*); +}; +#endif + +/* total2.h:1524 */ +#ifndef SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN +#define SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN (44) +/* complex XML schema type 'ns1:DT_FACTORY_NUMBER_RSP-ZTABLE_RETURN': */ +class SOAP_CMAC _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN { + public: + /// Optional element 'SERNR' of XML schema type 'xsd:string' + char *SERNR; + /// Optional element 'TYPE' of XML schema type 'xsd:string' + char *TYPE; + /// Optional element 'MESSAGE' of XML schema type 'xsd:string' + char *MESSAGE; + public: + /// Return unique type id SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN + virtual long soap_type(void) const { return SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN; } + /// (Re)set members to default values + virtual void soap_default(struct soap*); + /// Serialize object to prepare for SOAP 1.1/1.2 encoded output (or with SOAP_XML_GRAPH) by analyzing its (cyclic) structures + virtual void soap_serialize(struct soap*) const; + /// Output object in XML, compliant with SOAP 1.1 encoding style, return error code or SOAP_OK + virtual int soap_put(struct soap*, const char *tag, const char *type) const; + /// Output object in XML, with tag and optional id attribute and xsi:type, return error code or SOAP_OK + virtual int soap_out(struct soap*, const char *tag, int id, const char *type) const; + /// Get object from XML, compliant with SOAP 1.1 encoding style, return pointer to object or NULL on error + virtual void *soap_get(struct soap*, const char *tag, const char *type); + /// Get object from XML, with matching tag and type (NULL matches any tag and type), return pointer to object or NULL on error + virtual void *soap_in(struct soap*, const char *tag, const char *type); + /// Return a new object of type _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN, default initialized and not managed by a soap context + virtual _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN *soap_alloc(void) const { return SOAP_NEW_UNMANAGED(_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN); } + public: + /// Constructor with default initializations + _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN() : SERNR(), TYPE(), MESSAGE() { } + /// Destructor + virtual ~_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN() { } + /// Friend allocator used by soap_new__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(struct soap*, int) + friend SOAP_FMAC1 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN * SOAP_FMAC2 soap_instantiate__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN(struct soap*, int, const char*, const char*, size_t*); +}; +#endif + +/* total2.h:1456 */ +#ifndef SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP +#define SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP (40) +/* complex XML schema type 'ns1:DT_FACTORY_NUMBER_RSP': */ +class SOAP_CMAC ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP { + public: + /// Optional element 'RSP_BASEINFO' of XML schema type 'ns1:DT_FACTORY_NUMBER_RSP-RSP_BASEINFO' + _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO *RSP_USCOREBASEINFO; + /// Sequence of elements 'ZTABLE_RETURN' of XML schema type 'ns1:DT_FACTORY_NUMBER_RSP-ZTABLE_RETURN' stored in dynamic array ZTABLE_USCORERETURN of length __sizeZTABLE_USCORERETURN + int __sizeZTABLE_USCORERETURN; + _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN *ZTABLE_USCORERETURN; + /// Context that manages this object + struct soap *soap; + public: + /// Return unique type id SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP + virtual long soap_type(void) const { return SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP; } + /// (Re)set members to default values + virtual void soap_default(struct soap*); + /// Serialize object to prepare for SOAP 1.1/1.2 encoded output (or with SOAP_XML_GRAPH) by analyzing its (cyclic) structures + virtual void soap_serialize(struct soap*) const; + /// Output object in XML, compliant with SOAP 1.1 encoding style, return error code or SOAP_OK + virtual int soap_put(struct soap*, const char *tag, const char *type) const; + /// Output object in XML, with tag and optional id attribute and xsi:type, return error code or SOAP_OK + virtual int soap_out(struct soap*, const char *tag, int id, const char *type) const; + /// Get object from XML, compliant with SOAP 1.1 encoding style, return pointer to object or NULL on error + virtual void *soap_get(struct soap*, const char *tag, const char *type); + /// Get object from XML, with matching tag and type (NULL matches any tag and type), return pointer to object or NULL on error + virtual void *soap_in(struct soap*, const char *tag, const char *type); + /// Return a new object of type ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP, default initialized and not managed by a soap context + virtual ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP *soap_alloc(void) const { return SOAP_NEW_UNMANAGED(ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP); } + public: + /// Constructor with default initializations + ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP() : RSP_USCOREBASEINFO(), __sizeZTABLE_USCORERETURN(), ZTABLE_USCORERETURN(), soap() { } + /// Destructor + virtual ~ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP() { } + /// Friend allocator used by soap_new_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP(struct soap*, int) + friend SOAP_FMAC1 ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP * SOAP_FMAC2 soap_instantiate_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP(struct soap*, int, const char*, const char*, size_t*); +}; +#endif + +/* total2.h:1567 */ +#ifndef SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO +#define SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO (46) +/* complex XML schema type 'ns1:DT_FACTORY_NUMBER_REQ-BASEINFO': */ +class SOAP_CMAC _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO { + public: + /// Optional element 'REQ_TRACE_ID' of XML schema type 'xsd:string' + char *REQ_USCORETRACE_USCOREID; + public: + /// Return unique type id SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO + virtual long soap_type(void) const { return SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO; } + /// (Re)set members to default values + virtual void soap_default(struct soap*); + /// Serialize object to prepare for SOAP 1.1/1.2 encoded output (or with SOAP_XML_GRAPH) by analyzing its (cyclic) structures + virtual void soap_serialize(struct soap*) const; + /// Output object in XML, compliant with SOAP 1.1 encoding style, return error code or SOAP_OK + virtual int soap_put(struct soap*, const char *tag, const char *type) const; + /// Output object in XML, with tag and optional id attribute and xsi:type, return error code or SOAP_OK + virtual int soap_out(struct soap*, const char *tag, int id, const char *type) const; + /// Get object from XML, compliant with SOAP 1.1 encoding style, return pointer to object or NULL on error + virtual void *soap_get(struct soap*, const char *tag, const char *type); + /// Get object from XML, with matching tag and type (NULL matches any tag and type), return pointer to object or NULL on error + virtual void *soap_in(struct soap*, const char *tag, const char *type); + /// Return a new object of type _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO, default initialized and not managed by a soap context + virtual _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO *soap_alloc(void) const { return SOAP_NEW_UNMANAGED(_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO); } + public: + /// Constructor with default initializations + _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO() : REQ_USCORETRACE_USCOREID() { } + /// Destructor + virtual ~_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO() { } + /// Friend allocator used by soap_new__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(struct soap*, int) + friend SOAP_FMAC1 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO * SOAP_FMAC2 soap_instantiate__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO(struct soap*, int, const char*, const char*, size_t*); +}; +#endif + +/* total2.h:1598 */ +#ifndef SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM +#define SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM (49) +/* complex XML schema type 'ns1:DT_FACTORY_NUMBER_REQ-ITEMS-ITEM': */ +class SOAP_CMAC _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM { + public: + /// Optional element 'PSPID' of XML schema type 'xsd:string' + char *PSPID; + /// Optional element 'ZPSPID' of XML schema type 'xsd:string' + char *ZPSPID; + /// Optional element 'MATNR' of XML schema type 'xsd:string' + char *MATNR; + /// Optional element 'ZZD' of XML schema type 'xsd:string' + char *ZZD; + /// Optional element 'ZGH' of XML schema type 'xsd:string' + char *ZGH; + /// Optional element 'SERNR' of XML schema type 'xsd:string' + char *SERNR; + /// Optional element 'WERKS' of XML schema type 'xsd:string' + char *WERKS; + /// Optional element 'RSPOS' of XML schema type 'xsd:string' + char *RSPOS; + public: + /// Return unique type id SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM + virtual long soap_type(void) const { return SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM; } + /// (Re)set members to default values + virtual void soap_default(struct soap*); + /// Serialize object to prepare for SOAP 1.1/1.2 encoded output (or with SOAP_XML_GRAPH) by analyzing its (cyclic) structures + virtual void soap_serialize(struct soap*) const; + /// Output object in XML, compliant with SOAP 1.1 encoding style, return error code or SOAP_OK + virtual int soap_put(struct soap*, const char *tag, const char *type) const; + /// Output object in XML, with tag and optional id attribute and xsi:type, return error code or SOAP_OK + virtual int soap_out(struct soap*, const char *tag, int id, const char *type) const; + /// Get object from XML, compliant with SOAP 1.1 encoding style, return pointer to object or NULL on error + virtual void *soap_get(struct soap*, const char *tag, const char *type); + /// Get object from XML, with matching tag and type (NULL matches any tag and type), return pointer to object or NULL on error + virtual void *soap_in(struct soap*, const char *tag, const char *type); + /// Return a new object of type _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM, default initialized and not managed by a soap context + virtual _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM *soap_alloc(void) const { return SOAP_NEW_UNMANAGED(_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM); } + public: + /// Constructor with default initializations + _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM() : PSPID(), ZPSPID(), MATNR(), ZZD(), ZGH(), SERNR(), WERKS(), RSPOS() { } + /// Destructor + virtual ~_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM() { } + /// Friend allocator used by soap_new__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(struct soap*, int) + friend SOAP_FMAC1 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM * SOAP_FMAC2 soap_instantiate__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM(struct soap*, int, const char*, const char*, size_t*); +}; +#endif + +/* total2.h:1583 */ +#ifndef SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS +#define SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS (48) +/* complex XML schema type 'ns1:DT_FACTORY_NUMBER_REQ-ITEMS': */ +class SOAP_CMAC _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS { + public: + /// Sequence of elements 'ITEM' of XML schema type 'ns1:DT_FACTORY_NUMBER_REQ-ITEMS-ITEM' stored in dynamic array ITEM of length __sizeITEM + int __sizeITEM; + _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM *ITEM; + public: + /// Return unique type id SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS + virtual long soap_type(void) const { return SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS; } + /// (Re)set members to default values + virtual void soap_default(struct soap*); + /// Serialize object to prepare for SOAP 1.1/1.2 encoded output (or with SOAP_XML_GRAPH) by analyzing its (cyclic) structures + virtual void soap_serialize(struct soap*) const; + /// Output object in XML, compliant with SOAP 1.1 encoding style, return error code or SOAP_OK + virtual int soap_put(struct soap*, const char *tag, const char *type) const; + /// Output object in XML, with tag and optional id attribute and xsi:type, return error code or SOAP_OK + virtual int soap_out(struct soap*, const char *tag, int id, const char *type) const; + /// Get object from XML, compliant with SOAP 1.1 encoding style, return pointer to object or NULL on error + virtual void *soap_get(struct soap*, const char *tag, const char *type); + /// Get object from XML, with matching tag and type (NULL matches any tag and type), return pointer to object or NULL on error + virtual void *soap_in(struct soap*, const char *tag, const char *type); + /// Return a new object of type _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS, default initialized and not managed by a soap context + virtual _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS *soap_alloc(void) const { return SOAP_NEW_UNMANAGED(_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS); } + public: + /// Constructor with default initializations + _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS() : __sizeITEM(), ITEM() { } + /// Destructor + virtual ~_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS() { } + /// Friend allocator used by soap_new__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(struct soap*, int) + friend SOAP_FMAC1 _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS * SOAP_FMAC2 soap_instantiate__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS(struct soap*, int, const char*, const char*, size_t*); +}; +#endif + +/* total2.h:1458 */ +#ifndef SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ +#define SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ (41) +/* complex XML schema type 'ns1:DT_FACTORY_NUMBER_REQ': */ +class SOAP_CMAC ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ { + public: + /// Optional element 'BASEINFO' of XML schema type 'ns1:DT_FACTORY_NUMBER_REQ-BASEINFO' + _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO *BASEINFO; + /// Optional element 'ITEMS' of XML schema type 'ns1:DT_FACTORY_NUMBER_REQ-ITEMS' + _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS *ITEMS; + /// Context that manages this object + struct soap *soap; + public: + /// Return unique type id SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ + virtual long soap_type(void) const { return SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ; } + /// (Re)set members to default values + virtual void soap_default(struct soap*); + /// Serialize object to prepare for SOAP 1.1/1.2 encoded output (or with SOAP_XML_GRAPH) by analyzing its (cyclic) structures + virtual void soap_serialize(struct soap*) const; + /// Output object in XML, compliant with SOAP 1.1 encoding style, return error code or SOAP_OK + virtual int soap_put(struct soap*, const char *tag, const char *type) const; + /// Output object in XML, with tag and optional id attribute and xsi:type, return error code or SOAP_OK + virtual int soap_out(struct soap*, const char *tag, int id, const char *type) const; + /// Get object from XML, compliant with SOAP 1.1 encoding style, return pointer to object or NULL on error + virtual void *soap_get(struct soap*, const char *tag, const char *type); + /// Get object from XML, with matching tag and type (NULL matches any tag and type), return pointer to object or NULL on error + virtual void *soap_in(struct soap*, const char *tag, const char *type); + /// Return a new object of type ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ, default initialized and not managed by a soap context + virtual ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ *soap_alloc(void) const { return SOAP_NEW_UNMANAGED(ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ); } + public: + /// Constructor with default initializations + ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ() : BASEINFO(), ITEMS(), soap() { } + /// Destructor + virtual ~ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ() { } + /// Friend allocator used by soap_new_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(struct soap*, int) + friend SOAP_FMAC1 ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ * SOAP_FMAC2 soap_instantiate_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ(struct soap*, int, const char*, const char*, size_t*); +}; +#endif + +/* total2.h:1801 */ +#ifndef SOAP_TYPE___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN +#define SOAP_TYPE___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN (55) +/* Wrapper: */ +struct SOAP_CMAC __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN { + public: + /** Optional element 'ns1:MT_FACTORY_NUMBER_REQ' of XML schema type 'ns1:DT_FACTORY_NUMBER_REQ' */ + ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ *ns1__MT_USCOREFACTORY_USCORENUMBER_USCOREREQ; + public: + /** Return unique type id SOAP_TYPE___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN */ + long soap_type() const { return SOAP_TYPE___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN; } + /** Constructor with member initializations */ + __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN() : ns1__MT_USCOREFACTORY_USCORENUMBER_USCOREREQ() { } + /** Friend allocator */ + friend SOAP_FMAC1 __ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN * SOAP_FMAC2 soap_instantiate___ns1__SI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYN(struct soap*, int, const char*, const char*, size_t*); +}; +#endif + +/* total2.h:1866 */ +#ifndef WITH_NOGLOBAL +#ifndef SOAP_TYPE_SOAP_ENV__Header +#define SOAP_TYPE_SOAP_ENV__Header (56) +/* SOAP_ENV__Header: */ +struct SOAP_CMAC SOAP_ENV__Header { + public: + /** Return unique type id SOAP_TYPE_SOAP_ENV__Header */ + long soap_type() const { return SOAP_TYPE_SOAP_ENV__Header; } + /** Constructor with member initializations */ + SOAP_ENV__Header() { } + /** Friend allocator */ + friend SOAP_FMAC1 SOAP_ENV__Header * SOAP_FMAC2 soap_instantiate_SOAP_ENV__Header(struct soap*, int, const char*, const char*, size_t*); +}; +#endif +#endif + +/* total2.h:1866 */ +#ifndef WITH_NOGLOBAL +#ifndef SOAP_TYPE_SOAP_ENV__Code +#define SOAP_TYPE_SOAP_ENV__Code (57) +/* Type SOAP_ENV__Code is a recursive data type, (in)directly referencing itself through its (base or derived class) members */ +/* SOAP_ENV__Code: */ +struct SOAP_CMAC SOAP_ENV__Code { + public: + /** Optional element 'SOAP-ENV:Value' of XML schema type 'xsd:QName' */ + char *SOAP_ENV__Value; + /** Optional element 'SOAP-ENV:Subcode' of XML schema type 'SOAP-ENV:Code' */ + struct SOAP_ENV__Code *SOAP_ENV__Subcode; + public: + /** Return unique type id SOAP_TYPE_SOAP_ENV__Code */ + long soap_type() const { return SOAP_TYPE_SOAP_ENV__Code; } + /** Constructor with member initializations */ + SOAP_ENV__Code() : SOAP_ENV__Value(), SOAP_ENV__Subcode() { } + /** Friend allocator */ + friend SOAP_FMAC1 SOAP_ENV__Code * SOAP_FMAC2 soap_instantiate_SOAP_ENV__Code(struct soap*, int, const char*, const char*, size_t*); +}; +#endif +#endif + +/* total2.h:1866 */ +#ifndef WITH_NOGLOBAL +#ifndef SOAP_TYPE_SOAP_ENV__Detail +#define SOAP_TYPE_SOAP_ENV__Detail (59) +/* SOAP_ENV__Detail: */ +struct SOAP_CMAC SOAP_ENV__Detail { + public: + char *__any; + /** Any type of element 'fault' assigned to fault with its SOAP_TYPE_ assigned to __type */ + /** Do not create a cyclic data structure through this member unless SOAP encoding or SOAP_XML_GRAPH are used for id-ref serialization */ + int __type; + void *fault; + public: + /** Return unique type id SOAP_TYPE_SOAP_ENV__Detail */ + long soap_type() const { return SOAP_TYPE_SOAP_ENV__Detail; } + /** Constructor with member initializations */ + SOAP_ENV__Detail() : __any(), __type(), fault() { } + /** Friend allocator */ + friend SOAP_FMAC1 SOAP_ENV__Detail * SOAP_FMAC2 soap_instantiate_SOAP_ENV__Detail(struct soap*, int, const char*, const char*, size_t*); +}; +#endif +#endif + +/* total2.h:1866 */ +#ifndef WITH_NOGLOBAL +#ifndef SOAP_TYPE_SOAP_ENV__Reason +#define SOAP_TYPE_SOAP_ENV__Reason (61) +/* SOAP_ENV__Reason: */ +struct SOAP_CMAC SOAP_ENV__Reason { + public: + /** Optional element 'SOAP-ENV:Text' of XML schema type 'xsd:string' */ + char *SOAP_ENV__Text; + public: + /** Return unique type id SOAP_TYPE_SOAP_ENV__Reason */ + long soap_type() const { return SOAP_TYPE_SOAP_ENV__Reason; } + /** Constructor with member initializations */ + SOAP_ENV__Reason() : SOAP_ENV__Text() { } + /** Friend allocator */ + friend SOAP_FMAC1 SOAP_ENV__Reason * SOAP_FMAC2 soap_instantiate_SOAP_ENV__Reason(struct soap*, int, const char*, const char*, size_t*); +}; +#endif +#endif + +/* total2.h:1866 */ +#ifndef WITH_NOGLOBAL +#ifndef SOAP_TYPE_SOAP_ENV__Fault +#define SOAP_TYPE_SOAP_ENV__Fault (62) +/* SOAP_ENV__Fault: */ +struct SOAP_CMAC SOAP_ENV__Fault { + public: + /** Optional element 'faultcode' of XML schema type 'xsd:QName' */ + char *faultcode; + /** Optional element 'faultstring' of XML schema type 'xsd:string' */ + char *faultstring; + /** Optional element 'faultactor' of XML schema type 'xsd:string' */ + char *faultactor; + /** Optional element 'detail' of XML schema type 'SOAP-ENV:Detail' */ + struct SOAP_ENV__Detail *detail; + /** Optional element 'SOAP-ENV:Code' of XML schema type 'SOAP-ENV:Code' */ + struct SOAP_ENV__Code *SOAP_ENV__Code; + /** Optional element 'SOAP-ENV:Reason' of XML schema type 'SOAP-ENV:Reason' */ + struct SOAP_ENV__Reason *SOAP_ENV__Reason; + /** Optional element 'SOAP-ENV:Node' of XML schema type 'xsd:string' */ + char *SOAP_ENV__Node; + /** Optional element 'SOAP-ENV:Role' of XML schema type 'xsd:string' */ + char *SOAP_ENV__Role; + /** Optional element 'SOAP-ENV:Detail' of XML schema type 'SOAP-ENV:Detail' */ + struct SOAP_ENV__Detail *SOAP_ENV__Detail; + public: + /** Return unique type id SOAP_TYPE_SOAP_ENV__Fault */ + long soap_type() const { return SOAP_TYPE_SOAP_ENV__Fault; } + /** Constructor with member initializations */ + SOAP_ENV__Fault() : faultcode(), faultstring(), faultactor(), detail(), SOAP_ENV__Code(), SOAP_ENV__Reason(), SOAP_ENV__Node(), SOAP_ENV__Role(), SOAP_ENV__Detail() { } + /** Friend allocator */ + friend SOAP_FMAC1 SOAP_ENV__Fault * SOAP_FMAC2 soap_instantiate_SOAP_ENV__Fault(struct soap*, int, const char*, const char*, size_t*); +}; +#endif +#endif + +/******************************************************************************\ + * * + * Typedefs * + * * +\******************************************************************************/ + + +/* (built-in):0 */ +#ifndef SOAP_TYPE__XML +#define SOAP_TYPE__XML (5) +typedef char *_XML; +#endif + +/* (built-in):0 */ +#ifndef SOAP_TYPE__QName +#define SOAP_TYPE__QName (6) +typedef char *_QName; +#endif + +/******************************************************************************\ + * * + * Serializable Types * + * * +\******************************************************************************/ + + +/* char has binding name 'byte' for type 'xsd:byte' */ +#ifndef SOAP_TYPE_byte +#define SOAP_TYPE_byte (3) +#endif + +/* int has binding name 'int' for type 'xsd:int' */ +#ifndef SOAP_TYPE_int +#define SOAP_TYPE_int (1) +#endif + +/* _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM has binding name '_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM' for type '' */ +#ifndef SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM +#define SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM (49) +#endif + +/* _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS has binding name '_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS' for type '' */ +#ifndef SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS +#define SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS (48) +#endif + +/* _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO has binding name '_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO' for type '' */ +#ifndef SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO +#define SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO (46) +#endif + +/* _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN has binding name '_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN' for type '' */ +#ifndef SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN +#define SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN (44) +#endif + +/* _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO has binding name '_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO' for type '' */ +#ifndef SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO +#define SOAP_TYPE__ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO (42) +#endif + +/* ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ has binding name 'ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ' for type 'ns1:DT_FACTORY_NUMBER_REQ' */ +#ifndef SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ +#define SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ (41) +#endif + +/* ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP has binding name 'ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP' for type 'ns1:DT_FACTORY_NUMBER_RSP' */ +#ifndef SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP +#define SOAP_TYPE_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP (40) +#endif + +/* _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM has binding name '_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM' for type '' */ +#ifndef SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM +#define SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM (32) +#endif + +/* _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS has binding name '_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS' for type '' */ +#ifndef SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS +#define SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS (31) +#endif + +/* _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM has binding name '_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM' for type '' */ +#ifndef SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM +#define SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM (30) +#endif + +/* _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS has binding name '_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS' for type '' */ +#ifndef SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS +#define SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS (29) +#endif + +/* _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD has binding name '_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD' for type '' */ +#ifndef SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD +#define SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_HEAD (28) +#endif + +/* _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST has binding name '_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST' for type '' */ +#ifndef SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST +#define SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST (27) +#endif + +/* _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO has binding name '_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO' for type '' */ +#ifndef SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO +#define SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_BASEINFO (26) +#endif + +/* _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN has binding name '_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN' for type '' */ +#ifndef SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN +#define SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN (24) +#endif + +/* _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO has binding name '_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO' for type '' */ +#ifndef SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO +#define SOAP_TYPE__ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_RSP_USCOREBASEINFO (23) +#endif + +/* ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ has binding name 'ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ' for type 'ns1:DT_PROCESSROUTE_S4_REQ' */ +#ifndef SOAP_TYPE_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ +#define SOAP_TYPE_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ (22) +#endif + +/* ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP has binding name 'ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP' for type 'ns1:DT_PROCESSROUTE_S4_RSP' */ +#ifndef SOAP_TYPE_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP +#define SOAP_TYPE_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP (21) +#endif + +/* _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM has binding name '_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM' for type '' */ +#ifndef SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM +#define SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM (13) +#endif + +/* _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS has binding name '_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS' for type '' */ +#ifndef SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS +#define SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS (12) +#endif + +/* _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD has binding name '_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD' for type '' */ +#ifndef SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD +#define SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_HEAD (11) +#endif + +/* _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST has binding name '_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST' for type '' */ +#ifndef SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST +#define SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST (10) +#endif + +/* _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO has binding name '_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO' for type '' */ +#ifndef SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO +#define SOAP_TYPE__ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO (8) +#endif + +/* ns1__DT_USCOREBOM_USCORES4_USCOREREQ has binding name 'ns1__DT_USCOREBOM_USCORES4_USCOREREQ' for type 'ns1:DT_BOM_S4_REQ' */ +#ifndef SOAP_TYPE_ns1__DT_USCOREBOM_USCORES4_USCOREREQ +#define SOAP_TYPE_ns1__DT_USCOREBOM_USCORES4_USCOREREQ (7) +#endif + +/* struct SOAP_ENV__Fault has binding name 'SOAP_ENV__Fault' for type '' */ +#ifndef SOAP_TYPE_SOAP_ENV__Fault +#define SOAP_TYPE_SOAP_ENV__Fault (62) +#endif + +/* struct SOAP_ENV__Reason has binding name 'SOAP_ENV__Reason' for type '' */ +#ifndef SOAP_TYPE_SOAP_ENV__Reason +#define SOAP_TYPE_SOAP_ENV__Reason (61) +#endif + +/* struct SOAP_ENV__Detail has binding name 'SOAP_ENV__Detail' for type '' */ +#ifndef SOAP_TYPE_SOAP_ENV__Detail +#define SOAP_TYPE_SOAP_ENV__Detail (59) +#endif + +/* struct SOAP_ENV__Code has binding name 'SOAP_ENV__Code' for type '' */ +#ifndef SOAP_TYPE_SOAP_ENV__Code +#define SOAP_TYPE_SOAP_ENV__Code (57) +#endif + +/* struct SOAP_ENV__Header has binding name 'SOAP_ENV__Header' for type '' */ +#ifndef SOAP_TYPE_SOAP_ENV__Header +#define SOAP_TYPE_SOAP_ENV__Header (56) +#endif + +/* struct SOAP_ENV__Reason * has binding name 'PointerToSOAP_ENV__Reason' for type '' */ +#ifndef SOAP_TYPE_PointerToSOAP_ENV__Reason +#define SOAP_TYPE_PointerToSOAP_ENV__Reason (64) +#endif + +/* struct SOAP_ENV__Detail * has binding name 'PointerToSOAP_ENV__Detail' for type '' */ +#ifndef SOAP_TYPE_PointerToSOAP_ENV__Detail +#define SOAP_TYPE_PointerToSOAP_ENV__Detail (63) +#endif + +/* struct SOAP_ENV__Code * has binding name 'PointerToSOAP_ENV__Code' for type '' */ +#ifndef SOAP_TYPE_PointerToSOAP_ENV__Code +#define SOAP_TYPE_PointerToSOAP_ENV__Code (58) +#endif + +/* ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ * has binding name 'PointerTons1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ' for type 'ns1:DT_FACTORY_NUMBER_REQ' */ +#ifndef SOAP_TYPE_PointerTons1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ +#define SOAP_TYPE_PointerTons1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ (52) +#endif + +/* _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS * has binding name 'PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS' for type '' */ +#ifndef SOAP_TYPE_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS +#define SOAP_TYPE_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS (51) +#endif + +/* _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM * has binding name 'PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM' for type '' */ +#ifndef SOAP_TYPE_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM +#define SOAP_TYPE_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_ITEMS_ITEM (50) +#endif + +/* _ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO * has binding name 'PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO' for type '' */ +#ifndef SOAP_TYPE_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO +#define SOAP_TYPE_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCOREREQ_BASEINFO (47) +#endif + +/* _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN * has binding name 'PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN' for type '' */ +#ifndef SOAP_TYPE_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN +#define SOAP_TYPE_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_ZTABLE_USCORERETURN (45) +#endif + +/* _ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO * has binding name 'PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO' for type '' */ +#ifndef SOAP_TYPE_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO +#define SOAP_TYPE_PointerTo_ns1__DT_USCOREFACTORY_USCORENUMBER_USCORERSP_RSP_USCOREBASEINFO (43) +#endif + +/* ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ * has binding name 'PointerTons1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ' for type 'ns1:DT_PROCESSROUTE_S4_REQ' */ +#ifndef SOAP_TYPE_PointerTons1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ +#define SOAP_TYPE_PointerTons1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ (36) +#endif + +/* _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST * has binding name 'PointerTo_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST' for type '' */ +#ifndef SOAP_TYPE_PointerTo_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST +#define SOAP_TYPE_PointerTo_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST (35) +#endif + +/* _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM * has binding name 'PointerTo_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM' for type '' */ +#ifndef SOAP_TYPE_PointerTo_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM +#define SOAP_TYPE_PointerTo_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM (34) +#endif + +/* _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM * has binding name 'PointerTo_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM' for type '' */ +#ifndef SOAP_TYPE_PointerTo_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM +#define SOAP_TYPE_PointerTo_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCOREREQ_LIST_ITEMS_ITEM_SUBITEMS_SUBITEM (33) +#endif + +/* _ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN * has binding name 'PointerTo_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN' for type '' */ +#ifndef SOAP_TYPE_PointerTo_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN +#define SOAP_TYPE_PointerTo_ns1__DT_USCOREPROCESSROUTE_USCORES4_USCORERSP_ZTABLE_USCORERETURN (25) +#endif + +/* ns1__DT_USCOREBOM_USCORES4_USCOREREQ * has binding name 'PointerTons1__DT_USCOREBOM_USCORES4_USCOREREQ' for type 'ns1:DT_BOM_S4_REQ' */ +#ifndef SOAP_TYPE_PointerTons1__DT_USCOREBOM_USCORES4_USCOREREQ +#define SOAP_TYPE_PointerTons1__DT_USCOREBOM_USCORES4_USCOREREQ (17) +#endif + +/* _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST * has binding name 'PointerTo_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST' for type '' */ +#ifndef SOAP_TYPE_PointerTo_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST +#define SOAP_TYPE_PointerTo_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST (15) +#endif + +/* _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM * has binding name 'PointerTo_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM' for type '' */ +#ifndef SOAP_TYPE_PointerTo_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM +#define SOAP_TYPE_PointerTo_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_LIST_ITEMS_ITEM (14) +#endif + +/* _ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO * has binding name 'PointerTo_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO' for type '' */ +#ifndef SOAP_TYPE_PointerTo_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO +#define SOAP_TYPE_PointerTo_ns1__DT_USCOREBOM_USCORES4_USCOREREQ_BASEINFO (9) +#endif + +/* _QName has binding name '_QName' for type 'xsd:QName' */ +#ifndef SOAP_TYPE__QName +#define SOAP_TYPE__QName (6) +#endif + +/* _XML has binding name '_XML' for type '' */ +#ifndef SOAP_TYPE__XML +#define SOAP_TYPE__XML (5) +#endif + +/* char * has binding name 'string' for type 'xsd:string' */ +#ifndef SOAP_TYPE_string +#define SOAP_TYPE_string (4) +#endif + +/******************************************************************************\ + * * + * Externals * + * * +\******************************************************************************/ + + +#endif + +/* End of soapStub.h */ diff --git a/DFL_BOM_WL_TOERP/stdsoap2.cpp b/DFL_BOM_WL_TOERP/stdsoap2.cpp new file mode 100644 index 0000000..277a223 --- /dev/null +++ b/DFL_BOM_WL_TOERP/stdsoap2.cpp @@ -0,0 +1,23697 @@ +/* + stdsoap2.c[pp] 2.8.131 + + gSOAP runtime engine + +gSOAP XML Web services tools +Copyright (C) 2000-2023, Robert van Engelen, Genivia Inc., All Rights Reserved. +This part of the software is released under ONE of the following licenses: +GPL or the gSOAP public license. +-------------------------------------------------------------------------------- +Contributors: + +Wind River Systems, Inc., for the following addition licensed under the gSOAP +public license: + - vxWorks compatible, enabled with compiler option -DVXWORKS +-------------------------------------------------------------------------------- +gSOAP public license. + +The contents of this file are subject to the gSOAP Public License Version 1.3 +(the "License"); you may not use this file except in compliance with the +License. You may obtain a copy of the License at +http://www.cs.fsu.edu/~engelen/soaplicense.html +Software distributed under the License is distributed on an "AS IS" basis, +WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +for the specific language governing rights and limitations under the License. + +The Initial Developer of the Original Code is Robert A. van Engelen. +Copyright (C) 2000-2023, Robert van Engelen, Genivia Inc., All Rights Reserved. +-------------------------------------------------------------------------------- +GPL license. + +This program is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free Software +Foundation; either version 2 of the License, or (at your option) any later +version. + +This program is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A +PARTICULAR PURPOSE. See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along with +this program; if not, write to the Free Software Foundation, Inc., 59 Temple +Place, Suite 330, Boston, MA 02111-1307 USA + +Author contact information: +engelen@genivia.com / engelen@acm.org + +This program is released under the GPL with the additional exemption that +compiling, linking, and/or using OpenSSL is allowed. +-------------------------------------------------------------------------------- +A commercial use license is available from Genivia, Inc., contact@genivia.com +-------------------------------------------------------------------------------- +*/ + +#define GSOAP_LIB_VERSION 208131 + +/* silence GNU's warnings on format nonliteral strings and truncation (snprintf truncates on purpose for safety) */ +#ifdef __GNUC__ +# define GCC_VERSION_AT_LEAST(major, minor, patch) (GCC_VERSION >= (major * 10000 + minor * 100 + patch)) +# pragma GCC diagnostic ignored "-Wformat-nonliteral" +# if GCC_VERSION_AT_LEAST(7, 0, 0) +# pragma GCC diagnostic ignored "-Wformat-truncation" +# endif +#endif + +/* convert EBCDIC to ASCII */ +#ifdef AS400 +# pragma convert(819) +#endif + +#if defined(__gnu_linux__) && !defined(_GNU_SOURCE) +# define _GNU_SOURCE 1 +#endif + +#include "stdsoap2.h" + +#if GSOAP_VERSION != GSOAP_LIB_VERSION +# error "GSOAP VERSION MISMATCH IN LIBRARY: PLEASE REINSTALL PACKAGE" +#endif + +#if defined(VXWORKS) && defined(WM_SECURE_KEY_STORAGE) +# include /* vxWorks compatible */ +#endif + +#ifdef __BORLANDC__ +# pragma warn -8060 +#else +# ifdef WIN32 +# ifdef UNDER_CE +# pragma comment(lib, "ws2.lib") /* WinCE */ +# else +# pragma comment(lib, "Ws2_32.lib") +# endif +# pragma warning(disable : 4996) /* disable visual studio POSIX deprecation warnings */ +# endif +#endif + +#ifdef __cplusplus +SOAP_SOURCE_STAMP("@(#) stdsoap2.cpp ver 2.8.131 2023-09-23 00:00:00 GMT") +extern "C" { +#else +SOAP_SOURCE_STAMP("@(#) stdsoap2.c ver 2.8.131 2023-09-23 00:00:00 GMT") +#endif + +/* 8bit character representing unknown character entity or multibyte data */ +#ifndef SOAP_UNKNOWN_CHAR +# define SOAP_UNKNOWN_CHAR (0x7F) +#endif + +/* unicode character representing unknown characters outside the XML 1.0 UTF8 unicode space */ +#ifdef WITH_REPLACE_ILLEGAL_UTF8 +# ifndef SOAP_UNKNOWN_UNICODE_CHAR +# define SOAP_UNKNOWN_UNICODE_CHAR (0xFFFD) +# endif +#endif + +/* EOF=-1 */ +#define SOAP_LT (soap_wchar)(-2) /* XML-specific '<' */ +#define SOAP_TT (soap_wchar)(-3) /* XML-specific '' */ +#define SOAP_QT (soap_wchar)(-5) /* XML-specific '"' */ +#define SOAP_AP (soap_wchar)(-6) /* XML-specific ''' */ + +#define soap_coblank(c) ((c)+1 > 0 && (c) <= 32) + +#if defined(WIN32) && !defined(UNDER_CE) +#define soap_hash_ptr(p) ((size_t)((PtrToUlong(p) >> 3) & (SOAP_PTRHASH - 1))) +#else +#define soap_hash_ptr(p) ((size_t)(((unsigned long)(p) >> 3) & (SOAP_PTRHASH-1))) +#endif + +#ifdef SOAP_DEBUG +static void soap_init_logs(struct soap*); +static void soap_close_logfile(struct soap*, int); +static void soap_set_logfile(struct soap*, int, const char*); +#endif + +#ifdef SOAP_MEM_DEBUG +static void soap_init_mht(struct soap*); +static void soap_free_mht(struct soap*); +static void soap_track_unlink(struct soap*, const void*); +#endif + +static int soap_set_error(struct soap*, const char*, const char*, const char*, const char*, int); +static int soap_copy_fault(struct soap*, const char*, const char*, const char*, const char*); +static int soap_getattrval(struct soap*, char*, size_t*, soap_wchar); +static void soap_version(struct soap*); +static void soap_free_ns(struct soap*); +static soap_wchar soap_char(struct soap*); +static soap_wchar soap_getpi(struct soap*); +static int soap_isxdigit(int); +static void *fplugin(struct soap*, const char*); +static ULONG64 soap_count_attachments(struct soap*); +static int soap_try_connect_command(struct soap*, int http_command, const char *endpoint, const char *action); +static int soap_init_send(struct soap*); + +#ifdef WITH_NTLM +static int soap_ntlm_handshake(struct soap *soap, int command, const char *endpoint, const char *host, int port); +#endif + +#ifndef WITH_NOIDREF +static int soap_has_copies(struct soap*, const char*, const char*); +static int soap_type_punned(struct soap*, const struct soap_ilist*); +static int soap_is_shaky(struct soap*, void*); +static void soap_init_iht(struct soap*); +static void soap_free_iht(struct soap*); +#endif +static void soap_init_pht(struct soap*); +static void soap_free_pht(struct soap*); + +#ifndef WITH_LEAN +static const char *soap_set_validation_fault(struct soap*, const char*, const char*); +static int soap_isnumeric(struct soap*, const char*); +static struct soap_nlist *soap_push_ns(struct soap *soap, const char *id, const char *ns, short utilized, short isearly); +static void soap_utilize_ns(struct soap *soap, const char *tag, short isearly); +static const wchar_t* soap_wstring(struct soap *soap, const char *s, int flag, long minlen, long maxlen, const char *pattern); +static wchar_t* soap_wcollapse(struct soap *soap, wchar_t *s, int flag, int insitu); +#endif + +static const char* soap_string(struct soap *soap, const char *s, int flag, long minlen, long maxlen, const char *pattern); +static char* soap_collapse(struct soap *soap, char *s, int flag, int insitu); +static const char* soap_QName(struct soap *soap, const char *s, long minlen, long maxlen, const char *pattern); + +#ifndef WITH_LEANER +static int soap_begin_attachments(struct soap*); +static int soap_end_attachments(struct soap *soap); +static struct soap_multipart *soap_alloc_multipart(struct soap*, struct soap_multipart**, struct soap_multipart**, const char*, size_t); +static int soap_putdimefield(struct soap*, const char*, size_t); +static char *soap_getdimefield(struct soap*, size_t); +static void soap_select_mime_boundary(struct soap*); +static int soap_valid_mime_boundary(struct soap*); +static void soap_resolve_attachment(struct soap*, struct soap_multipart*); +#endif + +#ifdef WITH_GZIP +static int soap_getgziphdr(struct soap*); +#endif + +#ifdef WITH_OPENSSL +# ifndef SOAP_SSL_RSA_BITS +# define SOAP_SSL_RSA_BITS 2048 +# endif +static int soap_ssl_init_done = 0; +static int ssl_auth_init(struct soap*); +static int ssl_verify_callback(int, X509_STORE_CTX*); +static int ssl_verify_callback_allow_expired_certificate(int, X509_STORE_CTX*); +static int ssl_password(char*, int, int, void*); +#endif + +#ifdef WITH_GNUTLS +# ifndef SOAP_SSL_RSA_BITS +# define SOAP_SSL_RSA_BITS 2048 +# endif +static int soap_ssl_init_done = 0; +static int ssl_auth_init(struct soap*); +static const char *ssl_verify(struct soap *soap, const char *host); +# if GNUTLS_VERSION_NUMBER < 0x020b00 +# if defined(HAVE_PTHREAD_H) +# include + /* make GNUTLS thread safe with pthreads */ + GCRY_THREAD_OPTION_PTHREAD_IMPL; +# elif defined(HAVE_PTH_H) + #include + /* make GNUTLS thread safe with PTH */ + GCRY_THREAD_OPTION_PTH_IMPL; +# endif +# endif +#endif + +#ifdef WITH_WOLFSSL +static int soap_ssl_init_done = 0; +static int ssl_auth_init(struct soap*); +static int ssl_verify_callback(int, WOLFSSL_X509_STORE_CTX*); +static int ssl_verify_callback_allow_expired_certificate(int, WOLFSSL_X509_STORE_CTX*); +static int ssl_password(char*, int, int, void*); +#endif + +#ifdef WITH_SYSTEMSSL +static int soap_ssl_init_done = 0; +static int ssl_auth_init(struct soap*); +static int ssl_recv(int sk, void *s, int n, char *user); +static int ssl_send(int sk, void *s, int n, char *user); +#endif + +#if !defined(WITH_NOHTTP) || !defined(WITH_LEANER) +static const char * soap_decode(char*, size_t, const char*, const char*); +#endif + +#ifndef WITH_NOHTTP +static soap_wchar soap_getchunkchar(struct soap*); +static const char *http_error(struct soap*, int); +static int http_get(struct soap*); +static int http_put(struct soap*); +static int http_patch(struct soap*); +static int http_del(struct soap*); +static int http_200(struct soap*); +static int http_post(struct soap*, const char*, const char*, int, const char*, const char*, ULONG64); +static int http_send_header(struct soap*, const char*); +static int http_post_header(struct soap*, const char*, const char*); +static int http_response(struct soap*, int, ULONG64); +static int http_parse(struct soap*); +static int http_parse_header(struct soap*, const char*, const char*); +#endif + +#ifndef WITH_NOIO + +static int fsend(struct soap*, const char*, size_t); +static size_t frecv(struct soap*, char*, size_t); +static int tcp_init(struct soap*); +static const char *tcp_error(struct soap*); + +#if !defined(WITH_IPV6) +static int tcp_gethost(struct soap*, const char *addr, struct in_addr *inaddr); +#endif +#if !defined(WITH_IPV6) || defined(WITH_COOKIES) +static int tcp_gethostbyname(struct soap*, const char *addr, struct hostent *hostent, struct in_addr *inaddr); +#endif + +static SOAP_SOCKET tcp_connect(struct soap*, const char *endpoint, const char *host, int port); +static SOAP_SOCKET tcp_accept(struct soap*, SOAP_SOCKET, struct sockaddr*, int*); +static int tcp_select(struct soap*, SOAP_SOCKET, int, int); +static int tcp_disconnect(struct soap*); +static int tcp_closesocket(struct soap*, SOAP_SOCKET); +static int tcp_shutdownsocket(struct soap*, SOAP_SOCKET, int); +static const char *soap_strerror(struct soap*); + +#define SOAP_TCP_SELECT_RCV 0x1 +#define SOAP_TCP_SELECT_SND 0x2 +#define SOAP_TCP_SELECT_ERR 0x4 +#define SOAP_TCP_SELECT_ALL 0x7 +#define SOAP_TCP_SELECT_PIP 0x8 + +#if defined(WIN32) + #define SOAP_SOCKBLOCK(fd) \ + { \ + u_long blocking = 0; \ + ioctlsocket(fd, FIONBIO, &blocking); \ + } + #define SOAP_SOCKNONBLOCK(fd) \ + { \ + u_long nonblocking = 1; \ + ioctlsocket(fd, FIONBIO, &nonblocking); \ + } +#elif defined(VXWORKS) + #define SOAP_SOCKBLOCK(fd) \ + { \ + u_long blocking = 0; \ + ioctl(fd, FIONBIO, (void*)(&blocking)); \ + } + #define SOAP_SOCKNONBLOCK(fd) \ + { \ + u_long nonblocking = 1; \ + ioctl(fd, FIONBIO, (void*)(&nonblocking)); \ + } +#elif defined(__VMS) + #define SOAP_SOCKBLOCK(fd) \ + { \ + int blocking = 0; \ + ioctl(fd, FIONBIO, &blocking); \ + } + #define SOAP_SOCKNONBLOCK(fd) \ + { \ + int nonblocking = 1; \ + ioctl(fd, FIONBIO, &nonblocking); \ + } +#elif defined(SYMBIAN) + #define SOAP_SOCKBLOCK(fd) \ + { \ + long blocking = 0; \ + ioctl(fd, 0/*FIONBIO*/, &blocking); \ + } + #define SOAP_SOCKNONBLOCK(fd) \ + { \ + long nonblocking = 1; \ + ioctl(fd, 0/*FIONBIO*/, &nonblocking); \ + } +#else + #define SOAP_SOCKBLOCK(fd) (void)fcntl(fd, F_SETFL, fcntl(fd, F_GETFL)&~O_NONBLOCK); + #define SOAP_SOCKNONBLOCK(fd) (void)fcntl(fd, F_SETFL, fcntl(fd, F_GETFL)|O_NONBLOCK); +#endif + +#endif + +static const char soap_env1[42] = "http://schemas.xmlsoap.org/soap/envelope/"; +static const char soap_enc1[42] = "http://schemas.xmlsoap.org/soap/encoding/"; +static const char soap_env2[40] = "http://www.w3.org/2003/05/soap-envelope"; +static const char soap_enc2[40] = "http://www.w3.org/2003/05/soap-encoding"; +static const char soap_rpc[35] = "http://www.w3.org/2003/05/soap-rpc"; + +const union soap_double_nan soap_double_nan = {{0xFFFFFFFF, 0xFFFFFFFF}}; +const char soap_base64o[65] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; +const char soap_base64i[81] = "\76XXX\77\64\65\66\67\70\71\72\73\74\75XXXXXXX\00\01\02\03\04\05\06\07\10\11\12\13\14\15\16\17\20\21\22\23\24\25\26\27\30\31XXXXXX\32\33\34\35\36\37\40\41\42\43\44\45\46\47\50\51\52\53\54\55\56\57\60\61\62\63"; + +#ifndef WITH_LEAN +static const char soap_indent[21] = "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t"; +/* Alternative indentation form for SOAP_XML_INDENT with spaces instead of tabs: +static const char soap_indent[41] = "\n "; +*/ +#endif + +#ifndef SOAP_CANARY +# define SOAP_CANARY (0xC0DE) +#endif + +static const char soap_padding[4] = "\0\0\0"; +#define SOAP_STR_PADDING (soap_padding) +#define SOAP_STR_EOS (soap_padding) +#define SOAP_NON_NULL (soap_padding) + +#ifndef WITH_LEAN +static const struct soap_code_map html_entity_codes[] = /* entities for XHTML parsing */ +{ + { 160, "nbsp" }, + { 161, "iexcl" }, + { 162, "cent" }, + { 163, "pound" }, + { 164, "curren" }, + { 165, "yen" }, + { 166, "brvbar" }, + { 167, "sect" }, + { 168, "uml" }, + { 169, "copy" }, + { 170, "ordf" }, + { 171, "laquo" }, + { 172, "not" }, + { 173, "shy" }, + { 174, "reg" }, + { 175, "macr" }, + { 176, "deg" }, + { 177, "plusmn" }, + { 178, "sup2" }, + { 179, "sup3" }, + { 180, "acute" }, + { 181, "micro" }, + { 182, "para" }, + { 183, "middot" }, + { 184, "cedil" }, + { 185, "sup1" }, + { 186, "ordm" }, + { 187, "raquo" }, + { 188, "frac14" }, + { 189, "frac12" }, + { 190, "frac34" }, + { 191, "iquest" }, + { 192, "Agrave" }, + { 193, "Aacute" }, + { 194, "Acirc" }, + { 195, "Atilde" }, + { 196, "Auml" }, + { 197, "Aring" }, + { 198, "AElig" }, + { 199, "Ccedil" }, + { 200, "Egrave" }, + { 201, "Eacute" }, + { 202, "Ecirc" }, + { 203, "Euml" }, + { 204, "Igrave" }, + { 205, "Iacute" }, + { 206, "Icirc" }, + { 207, "Iuml" }, + { 208, "ETH" }, + { 209, "Ntilde" }, + { 210, "Ograve" }, + { 211, "Oacute" }, + { 212, "Ocirc" }, + { 213, "Otilde" }, + { 214, "Ouml" }, + { 215, "times" }, + { 216, "Oslash" }, + { 217, "Ugrave" }, + { 218, "Uacute" }, + { 219, "Ucirc" }, + { 220, "Uuml" }, + { 221, "Yacute" }, + { 222, "THORN" }, + { 223, "szlig" }, + { 224, "agrave" }, + { 225, "aacute" }, + { 226, "acirc" }, + { 227, "atilde" }, + { 228, "auml" }, + { 229, "aring" }, + { 230, "aelig" }, + { 231, "ccedil" }, + { 232, "egrave" }, + { 233, "eacute" }, + { 234, "ecirc" }, + { 235, "euml" }, + { 236, "igrave" }, + { 237, "iacute" }, + { 238, "icirc" }, + { 239, "iuml" }, + { 240, "eth" }, + { 241, "ntilde" }, + { 242, "ograve" }, + { 243, "oacute" }, + { 244, "ocirc" }, + { 245, "otilde" }, + { 246, "ouml" }, + { 247, "divide" }, + { 248, "oslash" }, + { 249, "ugrave" }, + { 250, "uacute" }, + { 251, "ucirc" }, + { 252, "uuml" }, + { 253, "yacute" }, + { 254, "thorn" }, + { 255, "yuml" }, + { 0, NULL } +}; +#endif + +#ifndef WITH_NOIO +#ifndef WITH_LEAN +static const struct soap_code_map h_error_codes[] = +{ +#ifdef HOST_NOT_FOUND + { HOST_NOT_FOUND, "Host not found" }, +#endif +#ifdef TRY_AGAIN + { TRY_AGAIN, "Try Again" }, +#endif +#ifdef NO_RECOVERY + { NO_RECOVERY, "No Recovery" }, +#endif +#ifdef NO_DATA + { NO_DATA, "No Data" }, +#endif +#ifdef NO_ADDRESS + { NO_ADDRESS, "No Address" }, +#endif + { 0, NULL } +}; +#endif +#endif + +#ifndef WITH_NOHTTP +#ifndef WITH_LEAN +static const struct soap_code_map h_http_error_codes[] = +{ + { 100, "Continue" }, + { 101, "Switching Protocols" }, + { 200, "OK" }, + { 201, "Created" }, + { 202, "Accepted" }, + { 203, "Non-Authoritative Information" }, + { 204, "No Content" }, + { 205, "Reset Content" }, + { 206, "Partial Content" }, + { 300, "Multiple Choices" }, + { 301, "Moved Permanently" }, + { 302, "Found" }, + { 303, "See Other" }, + { 304, "Not Modified" }, + { 305, "Use Proxy" }, + { 307, "Temporary Redirect" }, + { 400, "Bad Request" }, + { 401, "Unauthorized" }, + { 402, "Payment Required" }, + { 403, "Forbidden" }, + { 404, "Not Found" }, + { 405, "Method Not Allowed" }, + { 406, "Not Acceptable" }, + { 407, "Proxy Authentication Required" }, + { 408, "Request Time-out" }, + { 409, "Conflict" }, + { 410, "Gone" }, + { 411, "Length Required" }, + { 412, "Precondition Failed" }, + { 413, "Request Entity Too Large" }, + { 414, "Request-URI Too Large" }, + { 415, "Unsupported Media Type" }, + { 416, "Requested range not satisfiable" }, + { 417, "Expectation Failed" }, + { 422, "Unprocessable Entity" }, + { 426, "Upgrade Required" }, + { 428, "Precondition Required" }, + { 429, "Too Many Requests" }, + { 431, "Request Header Fields Too Large" }, + { 500, "Internal Server Error" }, + { 501, "Not Implemented" }, + { 502, "Bad Gateway" }, + { 503, "Service Unavailable" }, + { 504, "Gateway Time-out" }, + { 505, "HTTP Version not supported" }, + { 511, "Network Authentication Required" }, + { 0, NULL } +}; +#endif +#endif + +#ifdef WITH_OPENSSL +static const struct soap_code_map h_ssl_error_codes[] = +{ +#define _SSL_ERROR(e) { e, #e } + _SSL_ERROR(SSL_ERROR_SSL), + _SSL_ERROR(SSL_ERROR_ZERO_RETURN), + _SSL_ERROR(SSL_ERROR_WANT_READ), + _SSL_ERROR(SSL_ERROR_WANT_WRITE), + _SSL_ERROR(SSL_ERROR_WANT_CONNECT), + _SSL_ERROR(SSL_ERROR_WANT_X509_LOOKUP), + _SSL_ERROR(SSL_ERROR_SYSCALL), + { 0, NULL } +}; +#endif + +#ifndef WITH_LEANER +static const struct soap_code_map mime_codes[] = +{ + { SOAP_MIME_7BIT, "7bit" }, + { SOAP_MIME_8BIT, "8bit" }, + { SOAP_MIME_BINARY, "binary" }, + { SOAP_MIME_QUOTED_PRINTABLE, "quoted-printable" }, + { SOAP_MIME_BASE64, "base64" }, + { SOAP_MIME_IETF_TOKEN, "ietf-token" }, + { SOAP_MIME_X_TOKEN, "x-token" }, + { 0, NULL } +}; +#endif + +#ifdef WIN32 +static int tcp_done = 0; +#endif + +#if (defined(_AIX43) || defined(TRU64) || defined(HP_UX)) && defined(HAVE_GETHOSTBYNAME_R) +#ifndef h_errno +extern int h_errno; +#endif +#endif + +/******************************************************************************/ + +#ifndef WITH_NOIO +static int +fsend(struct soap *soap, const char *s, size_t n) +{ + int nwritten, err; + SOAP_SOCKET sk; + soap->errnum = 0; +#if defined(__cplusplus) && !defined(WITH_COMPAT) + if (soap->os) + { + soap->os->write(s, (std::streamsize)n); + if (soap->os->good()) + return SOAP_OK; + return SOAP_EOF; + } +#endif + sk = soap->sendsk; + if (!soap_valid_socket(sk)) + sk = soap->socket; + while (n) + { + if (soap_valid_socket(sk)) + { + if (soap->send_timeout) + { + for (;;) + { + int r; +#ifdef WITH_SELF_PIPE +#ifdef WITH_OPENSSL + if (soap->ssl) + r = tcp_select(soap, sk, SOAP_TCP_SELECT_ALL | SOAP_TCP_SELECT_PIP, soap->send_timeout); + else +#endif +#ifdef WITH_GNUTLS + if (soap->session) + r = tcp_select(soap, sk, SOAP_TCP_SELECT_ALL | SOAP_TCP_SELECT_PIP, soap->send_timeout); + else +#endif +#ifdef WITH_WOLFSSL + if (soap->ssl) + r = tcp_select(soap, sk, SOAP_TCP_SELECT_ALL | SOAP_TCP_SELECT_PIP, soap->send_timeout); + else +#endif +#ifdef WITH_SYSTEMSSL + if (soap->ssl) + r = tcp_select(soap, sk, SOAP_TCP_SELECT_ALL | SOAP_TCP_SELECT_PIP, soap->send_timeout); + else +#endif + r = tcp_select(soap, sk, SOAP_TCP_SELECT_SND | SOAP_TCP_SELECT_ERR | SOAP_TCP_SELECT_PIP, soap->send_timeout); + if ((r & SOAP_TCP_SELECT_PIP)) /* abort if data is pending on pipe */ + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Connection closed by self pipe\n")); + return SOAP_EOF; + } +#else +#ifdef WITH_OPENSSL + if (soap->ssl) + r = tcp_select(soap, sk, SOAP_TCP_SELECT_ALL, soap->send_timeout); + else +#endif +#ifdef WITH_GNUTLS + if (soap->session) + r = tcp_select(soap, sk, SOAP_TCP_SELECT_ALL, soap->send_timeout); + else +#endif +#ifdef WITH_WOLFSSL + if (soap->ssl) + r = tcp_select(soap, sk, SOAP_TCP_SELECT_ALL, soap->send_timeout); + else +#endif +#ifdef WITH_SYSTEMSSL + if (soap->ssl) + r = tcp_select(soap, sk, SOAP_TCP_SELECT_ALL, soap->send_timeout); + else +#endif + r = tcp_select(soap, sk, SOAP_TCP_SELECT_SND | SOAP_TCP_SELECT_ERR, soap->send_timeout); +#endif + if (r > 0) + break; + if (!r) + return SOAP_EOF; + err = soap->errnum; + if (!err) + return soap->error; + if (err != SOAP_EAGAIN && err != SOAP_EWOULDBLOCK) + return SOAP_EOF; + } + } +#ifndef WITH_LEAN + if (soap->transfer_timeout) + { + time_t now = time(NULL); + if ((soap->transfer_timeout > 0 && difftime(now, (time_t)soap->start) > (double)soap->transfer_timeout) + || (soap->transfer_timeout < 0 && difftime(now, (time_t)soap->start) > -1000000.0 * (double)soap->transfer_timeout)) + return SOAP_EOF; + } +#endif +#ifdef WITH_OPENSSL + if (soap->ssl) + nwritten = SSL_write(soap->ssl, s, (int)n); + else if (soap->bio) + nwritten = BIO_write(soap->bio, s, (int)n); + else +#endif +#ifdef WITH_GNUTLS + if (soap->session) + nwritten = gnutls_record_send(soap->session, s, n); + else +#endif +#ifdef WITH_WOLFSSL + if (soap->ssl) + nwritten = wolfSSL_write(soap->ssl, s, n); + else +#endif +#ifdef WITH_SYSTEMSSL + if (soap->ssl) + { + err = gsk_secure_socket_write(soap->ssl, (char*)s, n, &nwritten); + if (err != GSK_OK) + nwritten = 0; + } + else +#endif +#ifndef WITH_LEAN + if ((soap->omode & SOAP_IO_UDP)) + { + if (soap->peerlen) + nwritten = sendto(sk, (char*)s, (SOAP_WINSOCKINT)n, soap->socket_flags, &soap->peer.addr, (SOAP_WINSOCKINT)soap->peerlen); + else + nwritten = send(sk, s, (SOAP_WINSOCKINT)n, soap->socket_flags); + /* retry and back-off algorithm */ + /* TODO: this is not very clear from specs so verify and limit conditions under which we should loop (e.g. ENOBUFS) */ + if (nwritten < 0) + { + int udp_repeat; + int udp_delay; + if ((soap->connect_flags & SO_BROADCAST)) + udp_repeat = 2; /* SOAP-over-UDP MULTICAST_UDP_REPEAT - 1 */ + else + udp_repeat = 1; /* SOAP-over-UDP UNICAST_UDP_REPEAT - 1 */ + udp_delay = ((unsigned int)soap_random % 201) + 50; /* UDP_MIN_DELAY .. UDP_MAX_DELAY */ + do + { + tcp_select(soap, sk, SOAP_TCP_SELECT_ERR, -1000 * udp_delay); + if (soap->peerlen) + nwritten = sendto(sk, (char*)s, (SOAP_WINSOCKINT)n, soap->socket_flags, &soap->peer.addr, (SOAP_WINSOCKINT)soap->peerlen); + else + nwritten = send(sk, s, (SOAP_WINSOCKINT)n, soap->socket_flags); + udp_delay <<= 1; + if (udp_delay > 500) /* UDP_UPPER_DELAY */ + udp_delay = 500; + } while (nwritten < 0 && udp_repeat-- > 1); + } + if (nwritten < 0) + { + err = soap_socket_errno; + if (err && err != SOAP_EINTR) + { + soap->errnum = err; + return SOAP_EOF; + } + nwritten = 0; /* and call write() again */ + } + } + else +#endif +#if !defined(AS400) + nwritten = send(sk, s, (int)n, soap->socket_flags); +#else + nwritten = send(sk, (void*)s, n, soap->socket_flags); +#endif + if (nwritten <= 0) + { + int r = 0; + err = soap_socket_errno; +#ifdef WITH_OPENSSL + if (soap->ssl && (r = SSL_get_error(soap->ssl, nwritten)) != SSL_ERROR_NONE && r != SSL_ERROR_WANT_READ && r != SSL_ERROR_WANT_WRITE) + { + soap->errnum = err; + return SOAP_EOF; + } +#endif +#ifdef WITH_GNUTLS + if (soap->session) + { + if (nwritten == GNUTLS_E_INTERRUPTED) + err = SOAP_EINTR; + else if (nwritten == GNUTLS_E_AGAIN) + err = SOAP_EAGAIN; + } +#endif +#ifdef WITH_WOLFSSL + if (soap->ssl && (r = wolfSSL_get_error(soap->ssl, nwritten)) != SSL_ERROR_NONE && r != SSL_ERROR_WANT_READ && r != SSL_ERROR_WANT_WRITE) + { + soap->errnum = err; + return SOAP_EOF; + } +#endif + if (err == SOAP_EWOULDBLOCK || err == SOAP_EAGAIN) + { +#ifdef WITH_OPENSSL + if (soap->ssl && r == SSL_ERROR_WANT_READ) + r = tcp_select(soap, sk, SOAP_TCP_SELECT_RCV | SOAP_TCP_SELECT_ERR, soap->send_timeout ? soap->send_timeout : -10000); + else +#endif +#ifdef WITH_GNUTLS + if (soap->session && !gnutls_record_get_direction(soap->session)) + r = tcp_select(soap, sk, SOAP_TCP_SELECT_RCV | SOAP_TCP_SELECT_ERR, soap->send_timeout ? soap->send_timeout : -10000); + else +#endif +#ifdef WITH_WOLFSSL + if (soap->ssl && r == SSL_ERROR_WANT_READ) + r = tcp_select(soap, sk, SOAP_TCP_SELECT_RCV | SOAP_TCP_SELECT_ERR, soap->send_timeout ? soap->send_timeout : -10000); + else +#endif + r = tcp_select(soap, sk, SOAP_TCP_SELECT_SND | SOAP_TCP_SELECT_ERR, soap->send_timeout ? soap->send_timeout : -10000); + if (!r && soap->send_timeout) + return SOAP_EOF; + if (r < 0) + return SOAP_EOF; + } + else if (err && err != SOAP_EINTR) + { + soap->errnum = err; + return SOAP_EOF; + } + nwritten = 0; /* and call write() again */ + } + } + else + { +#ifdef WITH_FASTCGI + nwritten = fwrite((void*)s, 1, n, stdout); + fflush(stdout); +#else +#ifdef UNDER_CE + nwritten = fwrite(s, 1, n, soap->sendfd); +#else +#ifdef WMW_RPM_IO + /* vxWorks compatible */ + if (soap->rpmreqid) + nwritten = (httpBlockPut(soap->rpmreqid, (char*)s, n) == 0) ? n : -1; + else +#endif +#ifdef WIN32 + nwritten = _write(soap->sendfd, s, (unsigned int)n); +#else + nwritten = write(soap->sendfd, s, (unsigned int)n); +#endif +#endif +#endif + if (nwritten <= 0) + { +#ifndef WITH_FASTCGI + err = soap_errno; +#else + err = EOF; +#endif + if (err && err != SOAP_EINTR && err != SOAP_EWOULDBLOCK && err != SOAP_EAGAIN) + { + soap->errnum = err; + return SOAP_EOF; + } + nwritten = 0; /* and call write() again */ + } + } + n -= nwritten; + s += nwritten; + } + return SOAP_OK; +} +#endif + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_send_raw(struct soap *soap, const char *s, size_t n) +{ + if (!s || !n) + return SOAP_OK; +#ifndef WITH_LEANER + if (soap->fpreparesend && (soap->mode & SOAP_IO) != SOAP_IO_STORE && (soap->mode & SOAP_IO_LENGTH) && (soap->error = soap->fpreparesend(soap, s, n)) != SOAP_OK) + return soap->error; + if (soap->ffiltersend && (soap->error = soap->ffiltersend(soap, &s, &n)) != SOAP_OK) + return soap->error; +#endif + if ((soap->mode & SOAP_IO_LENGTH)) + { + soap->count += n; + } + else if ((soap->mode & SOAP_IO)) + { + size_t i = sizeof(soap->buf) - soap->bufidx; + while (n >= i) + { + (void)soap_memcpy((void*)(soap->buf + soap->bufidx), i, (const void*)s, i); + soap->bufidx = sizeof(soap->buf); + if (soap_flush(soap)) + return soap->error; + s += i; + n -= i; + i = sizeof(soap->buf); + } + (void)soap_memcpy((void*)(soap->buf + soap->bufidx), sizeof(soap->buf) - soap->bufidx, (const void*)s, n); + soap->bufidx += n; + } + else + { + return soap_flush_raw(soap, s, n); + } + return SOAP_OK; +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_flush(struct soap *soap) +{ + size_t n = soap->bufidx; + if (!n) + return soap->error = soap->fsend(soap, SOAP_STR_EOS, 0); /* force a zero send for HTTP GET and DELETE */ +#ifndef WITH_LEANER + if ((soap->mode & SOAP_IO) == SOAP_IO_STORE) + { + int r; + if (soap->fpreparesend && (r = soap->fpreparesend(soap, soap->buf, n)) != SOAP_OK) + return soap->error = r; + } +#endif + soap->bufidx = 0; +#ifdef WITH_ZLIB + if ((soap->mode & SOAP_ENC_ZLIB) && soap->d_stream) + { + soap->d_stream->next_in = (Byte*)soap->buf; + soap->d_stream->avail_in = (unsigned int)n; +#ifdef WITH_GZIP + soap->z_crc = crc32(soap->z_crc, (Byte*)soap->buf, (unsigned int)n); +#endif + do + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Deflating %u bytes\n", soap->d_stream->avail_in)); + if (deflate(soap->d_stream, Z_NO_FLUSH) != Z_OK) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Unable to deflate: %s\n", soap->d_stream->msg ? soap->d_stream->msg : SOAP_STR_EOS)); + return soap->error = SOAP_ZLIB_ERROR; + } + if (!soap->d_stream->avail_out) + { + if (soap_flush_raw(soap, soap->z_buf, sizeof(soap->buf))) + return soap->error; + soap->d_stream->next_out = (Byte*)soap->z_buf; + soap->d_stream->avail_out = sizeof(soap->buf); + } + } while (soap->d_stream->avail_in); + return SOAP_OK; + } +#endif + return soap_flush_raw(soap, soap->buf, n); +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_flush_raw(struct soap *soap, const char *s, size_t n) +{ + if ((soap->mode & SOAP_IO) == SOAP_IO_STORE) + { + void *t; + t = soap_push_block(soap, NULL, n); + if (!t) + return soap->error = SOAP_EOM; + (void)soap_memcpy(t, n, (const void*)s, n); + return SOAP_OK; + } +#ifndef WITH_LEANER + if ((soap->mode & SOAP_IO) == SOAP_IO_CHUNK) + { + char t[24]; /* note: actually the value of n <= SOAP_BUFLEN, which is 65536 or smaller */ + (SOAP_SNPRINTF(t, sizeof(t), 20), &"\r\n%lX\r\n"[soap->chunksize ? 0 : 2], (unsigned long)n); + DBGMSG(SENT, t, strlen(t)); + soap->error = soap->fsend(soap, t, strlen(t)); + if (soap->error) + return soap->error; + soap->chunksize += n; + } + DBGMSG(SENT, s, n); + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Send %lu bytes to socket=%d/fd=%d\n", (unsigned long)n, (int)soap->socket, soap->sendfd)); +#endif + return soap->error = soap->fsend(soap, s, n); +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_send(struct soap *soap, const char *s) +{ + if (!s) + return SOAP_OK; + return soap_send_raw(soap, s, strlen(s)); +} + +/******************************************************************************/ + +#ifndef WITH_LEANER +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_send2(struct soap *soap, const char *s1, const char *s2) +{ + if (soap_send(soap, s1)) + return soap->error; + return soap_send(soap, s2); +} +#endif + +/******************************************************************************/ + +#ifndef WITH_LEANER +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_send3(struct soap *soap, const char *s1, const char *s2, const char *s3) +{ + if (soap_send(soap, s1) + || soap_send(soap, s2)) + return soap->error; + return soap_send(soap, s3); +} +#endif + +/******************************************************************************/ + +#ifndef WITH_LEANER +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_query_send_key(struct soap *soap, const char *s) +{ + if (!s) + return SOAP_OK; + if (!soap->body && soap_send_raw(soap, "&", 1)) + return soap->error; + soap->body = 0; + (void)soap_encode_url(s, soap->msgbuf, (int)sizeof(soap->msgbuf)); /* msgbuf length is max SOAP_TMPLEN or just 1024 bytes */ + return soap_send(soap, soap->msgbuf); +} +#endif + +/******************************************************************************/ + +#ifndef WITH_LEANER +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_query_send_val(struct soap *soap, const char *s) +{ + if (!s) + return SOAP_OK; + if (soap_send_raw(soap, "=", 1)) + return soap->error; + (void)soap_encode_url(s, soap->msgbuf, (int)sizeof(soap->msgbuf)); /* msgbuf length is max SOAP_TMPLEN or just 1024 bytes */ + return soap_send(soap, soap->msgbuf); +} +#endif + +/******************************************************************************/ + +#ifndef WITH_LEANER +SOAP_FMAC1 +char * +SOAP_FMAC2 +soap_query(struct soap *soap) +{ + return strchr(soap->path, '?'); +} +#endif + +/******************************************************************************/ + +#ifndef WITH_LEANER +SOAP_FMAC1 +char * +SOAP_FMAC2 +soap_query_key(struct soap *soap, char **s) +{ + char *t = *s; + (void)soap; + if (t && *t) + { + *s = (char*)soap_query_decode(t, strlen(t), t + 1); + return t; + } + return *s = NULL; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_LEANER +SOAP_FMAC1 +char * +SOAP_FMAC2 +soap_query_val(struct soap *soap, char **s) +{ + char *t = *s; + (void)soap; + if (t && *t == '=') + { + *s = (char*)soap_query_decode(t, strlen(t), t + 1); + return t; + } + return NULL; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_LEANER +SOAP_FMAC1 +const char * +SOAP_FMAC2 +soap_query_decode(char *buf, size_t len, const char *val) +{ + const char *s; + char *t; + for (s = val; *s; s++) + if (*s != ' ' && *s != '=') + break; + if (*s == '"') + { + t = buf; + s++; + while (*s && *s != '"' && len-- > 1) + *t++ = *s++; + *t = '\0'; + do s++; + while (*s && *s != '&' && *s != '='); + } + else + { + t = buf; + while (*s && *s != '&' && *s != '=' && len-- > 1) + { + switch (*s) + { + case '+': + *t++ = ' '; + s++; + break; + case '\t': + case '\n': + case '\r': + case ' ': + s++; + break; + case '%': + *t++ = ((s[1] >= 'A' ? (s[1]&0x7) + 9 : s[1] - '0') << 4) + (s[2] >= 'A' ? (s[2]&0x7) + 9 : s[2] - '0'); + s += 3; + break; + default: + *t++ = *s++; + } + } + *t = '\0'; + } + return s; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_NOIO +static size_t +frecv(struct soap *soap, char *s, size_t n) +{ + int r; + int retries = 100; /* max 100 retries with non-blocking sockets */ + SOAP_SOCKET sk; + soap->errnum = 0; +#if defined(__cplusplus) && !defined(WITH_COMPAT) + if (soap->is) /* recv from C++ stream */ + { + if (soap->is->good()) + return (size_t)soap->is->read(s, (std::streamsize)n).gcount(); /* downcast to std::streamsize is OK: gcount() returns how much we got in s[] */ + return 0; + } +#else + if (soap->is) /* recv from C buffer until NUL */ + { + size_t l = strlen(soap->is); + if (l > n) + l = n; + (void)soap_memcpy((void*)s, n, soap->is, l); + soap->is += l; + return l; + } +#endif + sk = soap->recvsk; + if (!soap_valid_socket(sk)) + sk = soap->socket; + if (soap_valid_socket(sk)) + { + for (;;) + { +#if defined(WITH_OPENSSL) || defined(WITH_SYSTEMSSL) + int err = 0; +#endif +#ifdef WITH_OPENSSL + if (soap->recv_timeout && !soap->ssl) /* OpenSSL: sockets are nonblocking so go ahead to read */ +#else + if (soap->recv_timeout) +#endif + { + for (;;) + { +#ifdef WITH_SELF_PIPE + r = tcp_select(soap, sk, SOAP_TCP_SELECT_RCV | SOAP_TCP_SELECT_ERR | SOAP_TCP_SELECT_PIP, soap->recv_timeout); + if ((r & SOAP_TCP_SELECT_PIP)) /* abort if data is pending on pipe */ + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Connection closed by self pipe\n")); + return 0; + } +#else + r = tcp_select(soap, sk, SOAP_TCP_SELECT_RCV | SOAP_TCP_SELECT_ERR, soap->recv_timeout); +#endif + if (r > 0) + break; + if (!r) + return 0; + r = soap->errnum; + if (r != SOAP_EAGAIN && r != SOAP_EWOULDBLOCK) + return 0; + } + } +#ifndef WITH_LEAN + if (soap->transfer_timeout) + { + time_t now = time(NULL); + if ((soap->transfer_timeout > 0 && difftime(now, (time_t)soap->start) > (double)soap->transfer_timeout) + || (soap->transfer_timeout < 0 && difftime(now, (time_t)soap->start) > -1000000.0 * (double)soap->transfer_timeout)) + return 0; + } +#endif +#ifdef WITH_OPENSSL + if (soap->ssl) + { + r = SSL_read(soap->ssl, s, (int)n); + if (r > 0) + return (size_t)r; + err = SSL_get_error(soap->ssl, r); + if (err != SSL_ERROR_NONE && err != SSL_ERROR_WANT_READ && err != SSL_ERROR_WANT_WRITE) + return 0; + } + else if (soap->bio) + { + r = BIO_read(soap->bio, s, (int)n); + if (r > 0) + return (size_t)r; + return 0; + } + else +#endif +#ifdef WITH_GNUTLS + if (soap->session) + { + r = (int)gnutls_record_recv(soap->session, s, n); + if (r >= 0) + return (size_t)r; + } + else +#endif +#ifdef WITH_WOLFSSL + if (soap->ssl) + { + r = wolfSSL_read(soap->ssl, s, n); + if (r >= 0) + return (size_t)r; + } + else +#endif +#ifdef WITH_SYSTEMSSL + if (soap->ssl) + { + err = gsk_secure_socket_read(soap->ssl, s, n, &r); + if (err == GSK_OK && r > 0) + return (size_t)r; + if (err != GSK_OK && err != GSK_WOULD_BLOCK && err != GSK_WOULD_BLOCK_WRITE) + return 0; + } + else +#endif + { +#ifndef WITH_LEAN + if ((soap->omode & SOAP_IO_UDP)) + { + SOAP_SOCKLEN_T k = (SOAP_SOCKLEN_T)sizeof(soap->peer); + memset((void*)&soap->peer, 0, sizeof(soap->peer)); + r = recvfrom(sk, s, (SOAP_WINSOCKINT)n, soap->socket_flags, &soap->peer.addr, &k); /* portability note: see SOAP_SOCKLEN_T definition in stdsoap2.h, SOAP_WINSOCKINT cast is safe due to limited range of n in the engine (64K) */ + soap->peerlen = (size_t)k; +#ifdef WITH_IPV6 + soap->ip = 0; + soap->ip6[0] = 0; + soap->ip6[1] = 0; + soap->ip6[2] = 0; + soap->ip6[3] = 0; +#else + soap->ip = ntohl(soap->peer.in.sin_addr.s_addr); + soap->ip6[0] = 0; + soap->ip6[1] = 0; + soap->ip6[2] = 0xFFFF; + soap->ip6[3] = soap->ip; +#endif + } + else +#endif + r = recv(sk, s, (SOAP_WINSOCKINT)n, soap->socket_flags); /* SOAP_WINSOCKINT cast is safe due to limited range of n in the engine (64K) */ + if (r >= 0) + return (size_t)r; + r = soap_socket_errno; + if (r != SOAP_EINTR && r != SOAP_EAGAIN && r != SOAP_EWOULDBLOCK) + { + soap->errnum = r; + return 0; + } + } +#if defined(WITH_OPENSSL) + if (soap->ssl && err == SSL_ERROR_WANT_WRITE) + r = tcp_select(soap, sk, SOAP_TCP_SELECT_SND | SOAP_TCP_SELECT_ERR, soap->recv_timeout ? soap->recv_timeout : 5); + else +#elif defined(WITH_GNUTLS) + if (soap->session && gnutls_record_get_direction(soap->session)) + r = tcp_select(soap, sk, SOAP_TCP_SELECT_SND | SOAP_TCP_SELECT_ERR, soap->recv_timeout ? soap->recv_timeout : 5); + else +#ifdef WITH_WOLFSSL + if (soap->ssl && err == SSL_ERROR_WANT_WRITE) + r = tcp_select(soap, sk, SOAP_TCP_SELECT_SND | SOAP_TCP_SELECT_ERR, soap->recv_timeout ? soap->recv_timeout : 5); + else +#endif +#elif defined(WITH_SYSTEMSSL) + if (soap->ssl && err == GSK_WOULD_BLOCK_WRITE) + r = tcp_select(soap, sk, SOAP_TCP_SELECT_SND | SOAP_TCP_SELECT_ERR, soap->recv_timeout ? soap->recv_timeout : 5); + else +#endif + r = tcp_select(soap, sk, SOAP_TCP_SELECT_RCV | SOAP_TCP_SELECT_ERR, soap->recv_timeout ? soap->recv_timeout : 5); + if (!r && soap->recv_timeout) + return 0; + if (r < 0) + { + r = soap->errnum; + if (r != SOAP_EAGAIN && r != SOAP_EWOULDBLOCK) + return 0; + } + if (retries-- <= 0) + return 0; + } + } +#ifdef WITH_FASTCGI + return fread(s, 1, n, stdin); +#else +#ifdef UNDER_CE + return fread(s, 1, n, soap->recvfd); +#else +#ifdef WMW_RPM_IO + if (soap->rpmreqid) + r = httpBlockRead(soap->rpmreqid, s, n); + else +#endif +#ifdef WIN32 + r = _read(soap->recvfd, s, (unsigned int)n); +#else + r = read(soap->recvfd, s, n); +#endif + if (r >= 0) + return (size_t)r; + soap->errnum = soap_errno; + return 0; +#endif +#endif +} +#endif + +/******************************************************************************/ + +#ifndef WITH_NOHTTP +static soap_wchar +soap_getchunkchar(struct soap *soap) +{ + if (soap->bufidx < soap->buflen) + return soap->buf[soap->bufidx++]; + soap->bufidx = 0; + soap->buflen = soap->chunkbuflen = soap->frecv(soap, soap->buf, sizeof(soap->buf)); + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Read %u bytes from socket=%d/fd=%d\n", (unsigned int)soap->buflen, (int)soap->socket, soap->recvfd)); + DBGMSG(RECV, soap->buf, soap->buflen); + if (soap->buflen) + return soap->buf[soap->bufidx++]; + return EOF; +} +#endif + +/******************************************************************************/ + +static int +soap_isxdigit(int c) +{ + return (c >= '0' && c <= '9') || (c >= 'A' && c <= 'F') || (c >= 'a' && c <= 'f'); +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_recv_raw(struct soap *soap) +{ + size_t ret; +#if !defined(WITH_LEANER) || defined(WITH_ZLIB) + int r; +#endif +#ifdef WITH_ZLIB + if ((soap->mode & SOAP_ENC_ZLIB) && soap->d_stream) + { + if (soap->d_stream->next_out == Z_NULL) + { + soap->bufidx = soap->buflen = 0; + return EOF; + } + if (soap->d_stream->avail_in || !soap->d_stream->avail_out) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Inflating\n")); + soap->d_stream->next_out = (Byte*)soap->buf; + soap->d_stream->avail_out = sizeof(soap->buf); + r = inflate(soap->d_stream, Z_NO_FLUSH); + if (r == Z_NEED_DICT && soap->z_dict) + r = inflateSetDictionary(soap->d_stream, (const Bytef*)soap->z_dict, soap->z_dict_len); + if (r == Z_OK || r == Z_STREAM_END) + { + soap->bufidx = 0; + ret = soap->buflen = sizeof(soap->buf) - soap->d_stream->avail_out; + if (soap->zlib_in == SOAP_ZLIB_GZIP) + soap->z_crc = crc32(soap->z_crc, (Byte*)soap->buf, (unsigned int)ret); + if (r == Z_STREAM_END) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Inflated %lu->%lu bytes\n", soap->d_stream->total_in, soap->d_stream->total_out)); + soap->d_stream->next_out = Z_NULL; + } + if (ret || r == Z_STREAM_END) + { + if (soap->count + ret < soap->count) + return soap->error = SOAP_EOF; + soap->count += ret; + if (soap->recv_maxlength && soap->count > soap->recv_maxlength) + return soap->error = SOAP_EOF; + soap->z_ratio_in = (float)soap->d_stream->total_in / (float)soap->d_stream->total_out; + if (soap->count > SOAP_MAXINFLATESIZE && soap->z_ratio_in < SOAP_MINDEFLATERATIO) + { + soap->d_stream->msg = (char*)"caught SOAP_MINDEFLATERATIO explosive decompression guard (remedy: increase SOAP_MAXINFLATESIZE and/or decrease SOAP_MINDEFLATERATIO)"; + return soap->error = SOAP_ZLIB_ERROR; + } + DBGLOG(RECV, SOAP_MESSAGE(fdebug, "\n---- decompressed ----\n")); + DBGMSG(RECV, soap->buf, ret); + DBGLOG(RECV, SOAP_MESSAGE(fdebug, "\n----\n")); +#ifndef WITH_LEANER + if (soap->fpreparerecv && (r = soap->fpreparerecv(soap, soap->buf, ret)) != SOAP_OK) + return soap->error = r; +#endif + return SOAP_OK; + } + } + else if (r != Z_BUF_ERROR) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Inflate error: %s\n", soap->d_stream->msg ? soap->d_stream->msg : SOAP_STR_EOS)); + soap->d_stream->next_out = Z_NULL; + return soap->error = SOAP_ZLIB_ERROR; + } + } +zlib_again: + if ((soap->mode & SOAP_IO) == SOAP_IO_CHUNK && !soap->chunksize) + { + (void)soap_memcpy((void*)soap->buf, sizeof(soap->buf), (const void*)soap->z_buf, sizeof(soap->buf)); + soap->buflen = soap->z_buflen; + } + DBGLOG(RECV, SOAP_MESSAGE(fdebug, "\n---- compressed ----\n")); + } +#endif +#ifndef WITH_NOHTTP + if ((soap->mode & SOAP_IO) == SOAP_IO_CHUNK) /* read HTTP chunked transfer */ + { + for (;;) + { + soap_wchar c; + char *t, tmp[17]; + unsigned long chunksize; + if (soap->chunksize) + { + soap->buflen = ret = soap->frecv(soap, soap->buf, soap->chunksize > sizeof(soap->buf) ? sizeof(soap->buf) : soap->chunksize); + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Getting chunk: read %u bytes\n", (unsigned int)ret)); + DBGMSG(RECV, soap->buf, ret); + soap->bufidx = 0; + if (!ret) + { + soap->ahead = EOF; + return EOF; + } + soap->chunksize -= ret; + break; + } + if (!soap->chunkbuflen) + { + soap->chunkbuflen = ret = soap->frecv(soap, soap->buf, sizeof(soap->buf)); + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Read %u bytes (chunked) from socket=%d\n", (unsigned int)ret, (int)soap->socket)); + DBGMSG(RECV, soap->buf, ret); + soap->bufidx = 0; + if (!ret) + { + soap->ahead = EOF; + return EOF; + } + } + else + { + soap->bufidx = soap->buflen; + } + soap->buflen = soap->chunkbuflen; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Getting chunk size (idx=%u len=%u)\n", (unsigned int)soap->bufidx, (unsigned int)soap->buflen)); + while (!soap_isxdigit((int)(c = soap_getchunkchar(soap)))) + { + if ((int)c == EOF) + { + soap->ahead = EOF; + return EOF; + } + } + t = tmp; + do + { + *t++ = (char)c; + } while (soap_isxdigit((int)(c = soap_getchunkchar(soap))) && (size_t)(t - tmp) < sizeof(tmp)-1); + while ((int)c != EOF && c != '\n') + c = soap_getchunkchar(soap); + if ((int)c == EOF) + { + soap->ahead = EOF; + return EOF; + } + *t = '\0'; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Chunk size = %s (hex)\n", tmp)); + chunksize = soap_strtoul(tmp, &t, 16); + if (*t || chunksize > SOAP_MAXHTTPCHUNK || (soap->recv_maxlength && chunksize > soap->recv_maxlength)) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Chunk size %lu exceeds max\n", chunksize)); + return soap->error = SOAP_HTTP_ERROR; + } + soap->chunksize = (size_t)chunksize; + soap->buflen = soap->bufidx + soap->chunksize; + if (soap->buflen <= soap->bufidx) + { + soap->bufidx = soap->buflen = soap->chunkbuflen = 0; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "End of chunked message\n")); + ret = 0; + soap->ahead = EOF; + break; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Moving buf len to idx=%u len=%u (%s)\n", (unsigned int)soap->bufidx, (unsigned int)soap->buflen, tmp)); + if (soap->buflen > soap->chunkbuflen) + { + soap->buflen = soap->chunkbuflen; + soap->chunksize -= soap->buflen - soap->bufidx; + soap->chunkbuflen = 0; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Passed end of buffer for chunked HTTP (%u bytes left)\n", (unsigned int)(soap->buflen - soap->bufidx))); + } + else if (soap->chunkbuflen) + { + soap->chunksize = 0; + } + ret = soap->buflen - soap->bufidx; + if (ret) + break; + } + } + else +#endif + { + soap->bufidx = 0; + soap->buflen = ret = soap->frecv(soap, soap->buf, sizeof(soap->buf)); + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Read %u bytes from socket=%d/fd=%d\n", (unsigned int)ret, (int)soap->socket, soap->recvfd)); + DBGMSG(RECV, soap->buf, ret); + } +#ifdef WITH_ZLIB + if ((soap->mode & SOAP_ENC_ZLIB) && soap->d_stream) + { + (void)soap_memcpy((void*)soap->z_buf, sizeof(soap->buf), (const void*)soap->buf, sizeof(soap->buf)); + soap->d_stream->next_in = (Byte*)(soap->z_buf + soap->bufidx); + soap->d_stream->avail_in = (unsigned int)ret; + soap->d_stream->next_out = (Byte*)soap->buf; + soap->d_stream->avail_out = sizeof(soap->buf); + r = inflate(soap->d_stream, Z_NO_FLUSH); + if (r == Z_NEED_DICT && soap->z_dict) + r = inflateSetDictionary(soap->d_stream, (const Bytef*)soap->z_dict, soap->z_dict_len); + if (r == Z_OK || r == Z_STREAM_END) + { + soap->bufidx = 0; + soap->z_buflen = soap->buflen; + soap->buflen = sizeof(soap->buf) - soap->d_stream->avail_out; + if (soap->zlib_in == SOAP_ZLIB_GZIP) + soap->z_crc = crc32(soap->z_crc, (Byte*)soap->buf, (unsigned int)soap->buflen); + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Inflated %u bytes\n", (unsigned int)soap->buflen)); + if (ret && !soap->buflen && r != Z_STREAM_END) + goto zlib_again; + ret = soap->buflen; + if (r == Z_STREAM_END) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Inflated total %lu->%lu bytes\n", soap->d_stream->total_in, soap->d_stream->total_out)); + soap->d_stream->next_out = Z_NULL; + } + soap->z_ratio_in = (float)soap->d_stream->total_in / (float)soap->d_stream->total_out; + if (soap->count + ret > SOAP_MAXINFLATESIZE && soap->z_ratio_in < SOAP_MINDEFLATERATIO) + { + soap->d_stream->msg = (char*)"caught SOAP_MINDEFLATERATIO explosive decompression guard (remedy: increase SOAP_MAXINFLATESIZE and/or decrease SOAP_MINDEFLATERATIO)"; + return soap->error = SOAP_ZLIB_ERROR; + } + DBGLOG(RECV, SOAP_MESSAGE(fdebug, "\n---- decompressed ----\n")); + DBGMSG(RECV, soap->buf, ret); +#ifndef WITH_LEANER + if (soap->fpreparerecv && (r = soap->fpreparerecv(soap, soap->buf, ret)) != SOAP_OK) + return soap->error = r; +#endif + } + else + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Unable to inflate: (%d) %s\n", r, soap->d_stream->msg ? soap->d_stream->msg : SOAP_STR_EOS)); + soap->d_stream->next_out = Z_NULL; + return soap->error = SOAP_ZLIB_ERROR; + } + } +#endif +#ifndef WITH_LEANER + if (soap->fpreparerecv +#ifdef WITH_ZLIB + && soap->zlib_in == SOAP_ZLIB_NONE +#endif + && (r = soap->fpreparerecv(soap, soap->buf + soap->bufidx, ret))) + return soap->error = r; +#endif + if (ret) + { + if (soap->count + ret < soap->count) + return EOF; + soap->count += ret; + if (soap->recv_maxlength && soap->count > soap->recv_maxlength) + return EOF; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Read count=" SOAP_ULONG_FORMAT " (+%lu)\n", soap->count, (unsigned long)ret)); + return SOAP_OK; + } + return EOF; +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_recv(struct soap *soap) +{ +#ifndef WITH_LEANER + if ((soap->mode & SOAP_ENC_DIME)) + { + if (soap->dime.buflen) + { + char *s; + int i; + unsigned char tmp[12]; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "DIME hdr for chunked SOAP in DIME is in buffer\n")); + soap->buflen = soap->dime.buflen; + soap->dime.buflen = 0; + soap->dime.chunksize = 0; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Skip padding (%ld bytes)\n", -(long)soap->dime.size&3)); + for (i = -(long)soap->dime.size&3; i > 0; i--) + { + soap->bufidx++; + if (soap->bufidx >= soap->buflen) + if (soap_recv_raw(soap)) + return EOF; + } + if (!(soap->dime.flags & SOAP_DIME_CF)) + return SOAP_OK; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Get DIME hdr for next SOAP in DIME chunk\n")); + s = (char*)tmp; + for (i = 12; i > 0; i--) + { + *s++ = soap->buf[soap->bufidx++]; + if (soap->bufidx >= soap->buflen) + if (soap_recv_raw(soap)) + return EOF; + } + if ((tmp[0] & 0xF8) != SOAP_DIME_VERSION) + return soap->error = SOAP_DIME_MISMATCH; + soap->dime.flags = (tmp[0] & 0x7) | (tmp[1] & 0xF0); + soap->dime.size = ((size_t)tmp[8] << 24) | ((size_t)tmp[9] << 16) | ((size_t)tmp[10] << 8) | ((size_t)tmp[11]); + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Get SOAP in DIME chunk (%u bytes)\n", (unsigned int)soap->dime.size)); + soap->dime.chunksize = soap->dime.size; + if (soap->buflen - soap->bufidx >= soap->dime.size) + { + if ((soap->dime.flags & SOAP_DIME_ME)) + { + soap->mode &= ~SOAP_ENC_DIME; + } + else + { + soap->dime.buflen = soap->buflen; + soap->buflen = soap->bufidx + soap->dime.chunksize; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Chunked SOAP in DIME (%u bytes buffered)\n", (unsigned int)soap->buflen)); + } + } + else + { + soap->dime.chunksize -= soap->buflen - soap->bufidx; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Chunked SOAP in DIME (%u bytes in chunk left)\n", (unsigned int)soap->dime.chunksize)); + } + return SOAP_OK; + } + if (soap->dime.chunksize) + { + if (soap_recv_raw(soap)) + return EOF; + if (soap->buflen - soap->bufidx >= soap->dime.chunksize) + { + if ((soap->dime.flags & SOAP_DIME_ME)) + { + soap->dime.chunksize = 0; + soap->mode &= ~SOAP_ENC_DIME; + } + else + { + soap->dime.buflen = soap->buflen; + soap->buflen = soap->bufidx + soap->dime.chunksize; + soap->dime.chunksize = 0; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Chunked SOAP in DIME (%u bytes buffered)\n", (unsigned int)soap->buflen)); + } + } + else + { + soap->dime.chunksize -= soap->buflen - soap->bufidx; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Chunked SOAP in DIME (%u bytes in chunk left)\n", (unsigned int)soap->dime.chunksize)); + } + return SOAP_OK; + } + } + if (soap->ffilterrecv) + { + int err; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Filter recverror = %d bufidx = %lu buflen = %lu\n", soap->recverror, (unsigned long)soap->bufidx, (unsigned long)soap->buflen)); + if (soap->recverror) + { + soap->bufidx = soap->buflen = 0; + } + else + { + soap->bufidx = soap->buflen = 0; + err = soap->ffilterrecv(soap, soap->buf, &soap->buflen, sizeof(soap->buf)); + if (err) + { + if (err == SOAP_EOF) + return SOAP_EOF; + return soap->error = err; + } + if (soap->buflen) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Filtered output continued %lu bytes\n", (unsigned long)soap->buflen)); + return SOAP_OK; + } + soap->recverror = soap_recv_raw(soap); + soap->buflen -= soap->bufidx; /* chunked may set bufidx > 0 to skip hex chunk length */ + } + while (soap->ffilterrecv) + { + err = soap->ffilterrecv(soap, soap->buf + soap->bufidx, &soap->buflen, sizeof(soap->buf) - soap->bufidx); + if (err) + { + if (err == SOAP_EOF) + return SOAP_EOF; + return soap->error = err; + } + if (soap->buflen) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Filtered output %lu bytes\n", (unsigned long)soap->buflen)); + soap->buflen += soap->bufidx; + return SOAP_OK; + } + if (soap->recverror) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Returning postponed error %d\n", soap->recverror)); + return soap->recverror; + } + soap->recverror = soap_recv_raw(soap); + soap->buflen -= soap->bufidx; /* chunked may set bufidx > 0 to skip hex chunk length */ + } + } + return soap->recverror = soap_recv_raw(soap); +#else + return soap_recv_raw(soap); +#endif +} + +/******************************************************************************/ + +SOAP_FMAC1 +const struct soap_code_map* +SOAP_FMAC2 +soap_code(const struct soap_code_map *code_map, const char *str) +{ + if (code_map && str) + { + while (code_map->string) + { + if (!strcmp(str, code_map->string)) /* case sensitive */ + return code_map; + code_map++; + } + } + return NULL; +} + +/******************************************************************************/ + +SOAP_FMAC1 +LONG64 +SOAP_FMAC2 +soap_code_int(const struct soap_code_map *code_map, const char *str, LONG64 other) +{ + if (code_map) + { + while (code_map->string) + { + if (!soap_tag_cmp(str, code_map->string)) /* case insensitive */ + return code_map->code; + code_map++; + } + } + return other; +} + +/******************************************************************************/ + +SOAP_FMAC1 +const char* +SOAP_FMAC2 +soap_code_str(const struct soap_code_map *code_map, long code) +{ + if (!code_map) + return NULL; + while (code_map->code != code && code_map->string) + code_map++; + return code_map->string; +} + +/******************************************************************************/ + +SOAP_FMAC1 +LONG64 +SOAP_FMAC2 +soap_code_bits(const struct soap_code_map *code_map, const char *str) +{ + LONG64 bits = 0; + if (code_map) + { + while (str && *str) + { + const struct soap_code_map *p; + for (p = code_map; p->string; p++) + { + size_t n = strlen(p->string); + if (!strncmp(p->string, str, n) && soap_coblank((soap_wchar)str[n])) + { + bits |= p->code; + str += n; + while (*str > 0 && *str <= 32) + str++; + break; + } + } + if (!p->string) + return 0; + } + } + return bits; +} + +/******************************************************************************/ + +SOAP_FMAC1 +const char* +SOAP_FMAC2 +soap_code_list(struct soap *soap, const struct soap_code_map *code_map, long code) +{ + char *t = soap->tmpbuf; + if (code_map) + { + while (code_map->string) + { + if ((code_map->code & code)) + { + const char *s = code_map->string; + if (t != soap->tmpbuf) + *t++ = ' '; + while (*s && t < soap->tmpbuf + sizeof(soap->tmpbuf) - 1) + *t++ = *s++; + if (t == soap->tmpbuf + sizeof(soap->tmpbuf) - 1) + break; + } + code_map++; + } + } + *t = '\0'; + return soap->tmpbuf; +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_binary_search_string(const char **a, int n, const char *s) +{ + int min = 0, max = n-1; + while (min <= max) + { + int mid = (min+max)/2; + int r = strcmp(s, a[mid]); + if (r < 0) + max = mid - 1; + else if (r > 0) + min = mid + 1; + else + return mid; + } + return -1; +} + +/******************************************************************************/ + +static soap_wchar +soap_char(struct soap *soap) +{ + char tmp[8]; + int i; + soap_wchar c; + char *s = tmp; + for (i = 0; i < (int)sizeof(tmp)-1; i++) + { + c = soap_get1(soap); + if (c == ';' || (int)c == EOF) + break; + *s++ = (char)c; + } + *s = '\0'; + if (*tmp == '#') + { + if (tmp[1] == 'x' || tmp[1] == 'X') + return (soap_wchar)soap_strtol(tmp + 2, NULL, 16); + return (soap_wchar)soap_strtol(tmp + 1, NULL, 10); + } + if (!strcmp(tmp, "lt")) + return '<'; + if (!strcmp(tmp, "gt")) + return '>'; + if (!strcmp(tmp, "amp")) + return '&'; + if (!strcmp(tmp, "quot")) + return '"'; + if (!strcmp(tmp, "apos")) + return '\''; +#ifndef WITH_LEAN + return (soap_wchar)soap_code_int(html_entity_codes, tmp, (LONG64)SOAP_UNKNOWN_CHAR); +#else + return SOAP_UNKNOWN_CHAR; /* use this to represent unknown code */ +#endif +} + +/******************************************************************************/ + +#ifdef WITH_LEAN +soap_wchar +soap_get0(struct soap *soap) +{ + return (soap->bufidx >= soap->buflen && soap_recv(soap)) ? EOF : (unsigned char)soap->buf[soap->bufidx]; +} +#endif + +/******************************************************************************/ + +#ifdef WITH_LEAN +soap_wchar +soap_get1(struct soap *soap) +{ + return (soap->bufidx >= soap->buflen && soap_recv(soap)) ? EOF : (unsigned char)soap->buf[soap->bufidx++]; +} +#endif + +/******************************************************************************/ + +#ifdef WITH_LEAN +SOAP_FMAC1 +soap_wchar +SOAP_FMAC2 +soap_getchar(struct soap *soap) +{ + soap_wchar c; + c = soap->ahead; + if (c) + { + if ((int)c != EOF) + soap->ahead = 0; + return c; + } + return soap_get1(soap); +} +#else +SOAP_FMAC1 +soap_wchar +SOAP_FMAC2 +soap_getahead(struct soap *soap) +{ + soap_wchar c = soap->ahead; + if ((int)c != EOF) + soap->ahead = 0; + return c; +} +#endif + +/******************************************************************************/ + +SOAP_FMAC1 +soap_wchar +SOAP_FMAC2 +soap_get(struct soap *soap) +{ + soap_wchar c; + c = soap->ahead; + if (c) + { + if ((int)c != EOF) + soap->ahead = 0; + } + else + { + c = soap_get1(soap); + } + while ((int)c != EOF) + { + if (soap->cdata) + { + if (c == ']') + { + c = soap_get1(soap); + if (c == ']') + { + c = soap_get0(soap); + if (c == '>') + { + soap->cdata = 0; + c = soap_get1(soap); + c = soap_get1(soap); + } + else + { + soap_unget(soap, ']'); + return ']'; + } + } + else + { + soap_revget1(soap); + return ']'; + } + } + else + { + return c; + } + } + switch (c) + { + case '<': + do + { + c = soap_get1(soap); + } while (soap_coblank(c)); + if (c == '!' || c == '?' || c == '%') + { + int k = 1; + if (c == '!') + { + c = soap_get1(soap); + if (c == '[') + { + do + { + c = soap_get1(soap); + } while ((int)c != EOF && c != '['); + if ((int)c == EOF) + break; + soap->cdata = 1; + c = soap_get1(soap); + continue; + } + if (c == '-' && (c = soap_get1(soap)) == '-') + { + do + { + c = soap_get1(soap); + if (c == '-' && (c = soap_get1(soap)) == '-') + break; + } while ((int)c != EOF); + } + } + else if (c == '?') + { + c = soap_getpi(soap); + } + while ((int)c != EOF) + { + if (c == '<') + { + k++; + } + else if (c == '>') + { + if (--k <= 0) + break; + } + c = soap_get1(soap); + } + if ((int)c == EOF) + break; + c = soap_get1(soap); + continue; + } + if (c == '/') + return SOAP_TT; + soap_revget1(soap); + return SOAP_LT; + case '>': + return SOAP_GT; + case '"': + return SOAP_QT; + case '\'': + return SOAP_AP; + case '&': + return soap_char(soap) | 0x80000000; + } + break; + } + return c; +} + +/******************************************************************************/ + +static soap_wchar +soap_getpi(struct soap *soap) +{ + char buf[64]; + char *s = buf; + size_t i = sizeof(buf); + soap_wchar c; + while ((int)(c = soap_getchar(soap)) != EOF && c != '?') + { + if (i > 1) + { + if (soap_coblank(c)) + c = ' '; + *s++ = (char)c; + i--; + } + } + *s = '\0'; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "XML PI \n", buf)); + if (!strncmp(buf, "xml ", 4)) + { + s = strstr(buf, " encoding="); + if (s && s[10]) + { + int err; + if (!soap_tag_cmp(s + 11, "iso-8859-*") + || !soap_tag_cmp(s + 11, "latin*")) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Switching to latin encoding\n")); + soap->mode |= SOAP_ENC_LATIN; + } + else if (!soap_tag_cmp(s + 11, "utf-8*")) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Switching to utf-8 encoding\n")); + soap->mode &= ~SOAP_ENC_LATIN; + } + else if (soap->fencoding && ((err = soap->fencoding(soap, s + 11)) != SOAP_OK)) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Callback fencoding returned %d\n", err)); + soap->error = err; + c = EOF; + } + } + } + if ((int)c != EOF) + c = soap_getchar(soap); + return c; +} + +/******************************************************************************/ + +#ifndef WITH_LEANER +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_move(struct soap *soap, ULONG64 n) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Moving " SOAP_ULONG_FORMAT " bytes forward\n", n)); + for (; n; n--) + if ((int)soap_getchar(soap) == EOF) + return SOAP_EOF; + return SOAP_OK; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_LEANER +SOAP_FMAC1 +ULONG64 +SOAP_FMAC2 +soap_tell(struct soap *soap) +{ + return soap->count - soap->buflen + soap->bufidx - (soap->ahead != 0); +} +#endif + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_pututf8(struct soap *soap, unsigned long c) +{ + char tmp[24]; + if ((c < 0x7F && c > 0x1F)) + { + *tmp = (char)c; + return soap_send_raw(soap, tmp, 1); + } +#ifdef WITH_REPLACE_ILLEGAL_UTF8 + if (!(c == 0x09 || c == 0x0A || c == 0x0D || (c >= 0x80 && c <= 0xD7FF) || (c >= 0xE000 && c <= 0xFFFD) || (c >= 0x10000 && c <= 0x10FFFF))) + c = SOAP_UNKNOWN_UNICODE_CHAR; +#endif +#ifndef WITH_LEAN + if (c > 0x9F) + { + char *t = tmp; + if (c < 0x0800) + { + *t++ = (char)(0xC0 | ((c >> 6) & 0x1F)); + } + else + { + if (c < 0x010000) + { + *t++ = (char)(0xE0 | ((c >> 12) & 0x0F)); + } + else + { + if (c < 0x200000) + { + *t++ = (char)(0xF0 | ((c >> 18) & 0x07)); + } + else + { + if (c < 0x04000000) + { + *t++ = (char)(0xF8 | ((c >> 24) & 0x03)); + } + else + { + *t++ = (char)(0xFC | ((c >> 30) & 0x01)); + *t++ = (char)(0x80 | ((c >> 24) & 0x3F)); + } + *t++ = (char)(0x80 | ((c >> 18) & 0x3F)); + } + *t++ = (char)(0x80 | ((c >> 12) & 0x3F)); + } + *t++ = (char)(0x80 | ((c >> 6) & 0x3F)); + } + *t++ = (char)(0x80 | (c & 0x3F)); + *t = '\0'; + } + else +#endif + (SOAP_SNPRINTF(tmp, sizeof(tmp), 20), "&#x%lX;", c); + return soap_send(soap, tmp); +} + +/******************************************************************************/ + +SOAP_FMAC1 +soap_wchar +SOAP_FMAC2 +soap_getutf8(struct soap *soap) +{ +#ifdef WITH_REPLACE_ILLEGAL_UTF8 + soap_wchar c, c1, c2, c3; +#else + soap_wchar c, c1, c2, c3, c4; +#endif + c = soap->ahead; + if (c >= 0x80) + soap->ahead = 0; + else + c = (soap_wchar)soap_get(soap); + if (c < 0x80 || c > 0xFF || (soap->mode & SOAP_ENC_LATIN)) + return c; +#ifdef WITH_REPLACE_ILLEGAL_UTF8 + c1 = (soap_wchar)soap_get1(soap); + if (c <= 0xC1 || (c1 & 0xC0) != 0x80) + { + soap_revget1(soap); + return SOAP_UNKNOWN_UNICODE_CHAR; + } + c1 &= 0x3F; + if (c < 0xE0) + return (((c & 0x1F) << 6) | c1); + c2 = (soap_wchar)soap_get1(soap); + if ((c == 0xE0 && c1 < 0x20) || (c2 & 0xC0) != 0x80) + { + soap_revget1(soap); + return SOAP_UNKNOWN_UNICODE_CHAR; + } + c2 &= 0x3F; + if (c < 0xF0) + return (((c & 0x0F) << 12) | (c1 << 6) | c2); + c3 = (soap_wchar)soap_get1(soap); + if ((c == 0xF0 && c1 < 0x10) || (c == 0xF4 && c1 >= 0x10) || c >= 0xF5 || (c3 & 0xC0) != 0x80) + { + soap_revget1(soap); + return SOAP_UNKNOWN_UNICODE_CHAR; + } + return (((c & 0x07) << 18) | (c1 << 12) | (c2 << 6) | (c3 & 0x3F)); +#else + c1 = (soap_wchar)soap_get1(soap); + if (c < 0xC0 || (c1 & 0xC0) != 0x80) + { + soap_revget1(soap); + /* doesn't look like this is UTF-8, try continue as if ISO-8859-1 */ + return c; + } + c1 &= 0x3F; + if (c < 0xE0) + return ((soap_wchar)(c & 0x1F) << 6) | c1; + c2 = (soap_wchar)soap_get1(soap) & 0x3F; + if (c < 0xF0) + return ((soap_wchar)(c & 0x0F) << 12) | (c1 << 6) | c2; + c3 = (soap_wchar)soap_get1(soap) & 0x3F; + if (c < 0xF8) + return ((soap_wchar)(c & 0x07) << 18) | (c1 << 12) | (c2 << 6) | c3; + c4 = (soap_wchar)soap_get1(soap) & 0x3F; + if (c < 0xFC) + return ((soap_wchar)(c & 0x03) << 24) | (c1 << 18) | (c2 << 12) | (c3 << 6) | c4; + return ((soap_wchar)(c & 0x01) << 30) | (c1 << 24) | (c2 << 18) | (c3 << 12) | (c4 << 6) | (soap_wchar)(soap_get1(soap) & 0x3F); +#endif +} + +/******************************************************************************/ + +SOAP_FMAC1 +size_t +SOAP_FMAC2 +soap_utf8len(const char *s) +{ + size_t l = 0; + while (*s) + if ((*s++ & 0xC0) != 0x80) + l++; + return l; +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_puthex(struct soap *soap, const unsigned char *s, int n) +{ + char d[2 * SOAP_BINARY_BUFLEN], *p = d; +#ifdef WITH_DOM + if ((soap->mode & SOAP_XML_DOM) && soap->dom) + { + soap->dom->text = soap_s2hex(soap, s, NULL, n); + if (!soap->dom->text) + return soap->error; + return SOAP_OK; + } +#endif + for (; n > 0; n--) + { + int m = *s++; + p[0] = (char)((m >> 4) + (m > 159 ? '7' : '0')); + m &= 0x0F; + p[1] = (char)(m + (m > 9 ? '7' : '0')); + p += 2; + if (p - d == sizeof(d)) + { + if (soap_send_raw(soap, d, sizeof(d))) + return soap->error; + p = d; + } + } + if (p != d && soap_send_raw(soap, d, p - d)) + return soap->error; + return SOAP_OK; +} + +/******************************************************************************/ + +SOAP_FMAC1 +unsigned char* +SOAP_FMAC2 +soap_gethex(struct soap *soap, int *n) +{ + size_t l = 0; +#ifdef WITH_DOM + if ((soap->mode & SOAP_XML_DOM) && soap->dom) + { + soap->dom->text = soap_string_in(soap, 1, -1, -1, NULL); + return (unsigned char*)soap_hex2s(soap, soap->dom->text, NULL, 0, n); + } +#endif +#ifdef WITH_FAST + soap->labidx = 0; + for (;;) + { + char *s; + size_t i, k; + if (soap_append_lab(soap, NULL, 0)) + return NULL; + s = soap->labbuf + soap->labidx; + k = soap->lablen - soap->labidx; + soap->labidx = soap->lablen; + for (i = 0; i < k; i++) + { + char d1, d2; + soap_wchar c; + c = soap_get(soap); + if (soap_isxdigit(c)) + { + d1 = (char)c; + c = soap_get(soap); + if (soap_isxdigit(c)) + { + d2 = (char)c; + } + else + { + soap->error = SOAP_TYPE; + return NULL; + } + } + else + { + unsigned char *p = NULL; + l = soap->lablen + i - k; + soap_unget(soap, c); + if (n) + *n = (int)l; + if (soap->maxlength > 0 && l > (size_t)soap->maxlength) + { + soap->error = SOAP_LENGTH; + } + else + { + p = (unsigned char*)soap_malloc(soap, l); + if (p) + (void)soap_memcpy((void*)p, l, (const void*)soap->labbuf, l); + } + return p; + } + *s++ = (char)(((d1 >= 'A' ? (d1 & 0x7) + 9 : d1 - '0') << 4) + (d2 >= 'A' ? (d2 & 0x7) + 9 : d2 - '0')); + } + l = soap->lablen; + if (soap->maxlength > 0 && l > (size_t)soap->maxlength) + { + soap->error = SOAP_LENGTH; + return NULL; + } + } +#else + if (soap_alloc_block(soap) == NULL) + return NULL; + for (;;) + { + int i; + char *s = (char*)soap_push_block(soap, NULL, SOAP_BLKLEN); + if (!s) + { + soap_end_block(soap, NULL); + return NULL; + } + for (i = 0; i < SOAP_BLKLEN; i++) + { + char d1, d2; + soap_wchar c = soap_get(soap); + if (soap_isxdigit(c)) + { + d1 = (char)c; + c = soap_get(soap); + if (soap_isxdigit(c)) + d2 = (char)c; + else + { + soap_end_block(soap, NULL); + soap->error = SOAP_TYPE; + return NULL; + } + } + else + { + unsigned char *p; + soap_unget(soap, c); + if (soap->maxlength > 0 && l > (size_t)soap->maxlength) + { + soap->error = SOAP_LENGTH; + soap_end_block(soap, NULL); + return NULL; + } + if (n) + *n = (int)soap_size_block(soap, NULL, i); + p = (unsigned char*)soap_save_block(soap, NULL, NULL, 0); + return p; + } + *s++ = ((d1 >= 'A' ? (d1 & 0x7) + 9 : d1 - '0') << 4) + (d2 >= 'A' ? (d2 & 0x7) + 9 : d2 - '0'); + l++; + } + if (soap->maxlength > 0 && l > (size_t)soap->maxlength) + { + soap->error = SOAP_LENGTH; + soap_end_block(soap, NULL); + return NULL; + } + } +#endif +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_putbase64(struct soap *soap, const unsigned char *s, int n) +{ + char d[4 * SOAP_BINARY_BUFLEN], *p = d; + if (!s) + return SOAP_OK; +#ifdef WITH_DOM + if ((soap->mode & SOAP_XML_DOM) && soap->dom) + { + soap->dom->text = soap_s2base64(soap, s, NULL, n); + if (!soap->dom->text) + return soap->error; + return SOAP_OK; + } +#endif + for (; n > 2; n -= 3, s += 3) + { + p[0] = soap_base64o[(s[0] & 0xFC) >> 2]; + p[1] = soap_base64o[((s[0] & 0x03) << 4) | ((s[1] & 0xF0) >> 4)]; + p[2] = soap_base64o[((s[1] & 0x0F) << 2) | ((s[2] & 0xC0) >> 6)]; + p[3] = soap_base64o[s[2] & 0x3F]; + p += 4; + if (p - d == sizeof(d)) + { + if (soap_send_raw(soap, d, sizeof(d))) + return soap->error; + p = d; + } + } + if (n == 2) + { + p[0] = soap_base64o[(s[0] & 0xFC) >> 2]; + p[1] = soap_base64o[((s[0] & 0x03) << 4) | ((s[1] & 0xF0) >> 4)]; + p[2] = soap_base64o[(s[1] & 0x0F) << 2]; + p[3] = '='; + p += 4; + } + else if (n == 1) + { + p[0] = soap_base64o[(s[0] & 0xFC) >> 2]; + p[1] = soap_base64o[(s[0] & 0x03) << 4]; + p[2] = '='; + p[3] = '='; + p += 4; + } + if (p != d && soap_send_raw(soap, d, p - d)) + return soap->error; + return SOAP_OK; +} + +/******************************************************************************/ + +SOAP_FMAC1 +unsigned char* +SOAP_FMAC2 +soap_getbase64(struct soap *soap, int *n, int malloc_flag) +{ + size_t l = 0; + (void)malloc_flag; +#ifdef WITH_DOM + if ((soap->mode & SOAP_XML_DOM) && soap->dom) + { + soap->dom->text = soap_string_in(soap, 1, -1, -1, NULL); + return (unsigned char*)soap_base642s(soap, soap->dom->text, NULL, 0, n); + } +#endif +#ifdef WITH_FAST + soap->labidx = 0; + for (;;) + { + size_t i, k; + char *s; + if (soap_append_lab(soap, NULL, 2)) + return NULL; + s = soap->labbuf + soap->labidx; + k = soap->lablen - soap->labidx; + soap->labidx = 3 * (soap->lablen / 3); + if (k > 2) + { + for (i = 0; i < k - 2; i += 3) + { + unsigned long m = 0; + int j = 0; + do + { + soap_wchar c = soap_get(soap); + if (c < SOAP_AP) + c &= 0x7FFFFFFF; + if (c == '=' || c < 0) + { + unsigned char *p = NULL; + switch (j) + { + case 2: + *s++ = (char)((m >> 4) & 0xFF); + i++; + break; + case 3: + *s++ = (char)((m >> 10) & 0xFF); + *s++ = (char)((m >> 2) & 0xFF); + i += 2; + } + l = soap->lablen + i - k; + if (n) + *n = (int)l; + if (soap->maxlength > 0 && l > (size_t)soap->maxlength) + soap->error = SOAP_LENGTH; + else + { + p = (unsigned char*)soap_malloc(soap, l); + if (p) + (void)soap_memcpy((void*)p, l, (const void*)soap->labbuf, l); + } + if (c >= 0) + { + while ((int)((c = soap_get(soap)) != EOF) && c != SOAP_LT && c != SOAP_TT) + continue; + } + soap_unget(soap, c); + return p; + } + c -= '+'; + if (c >= 0 && c <= 79) + { + int b = soap_base64i[c]; + if (b >= 64) + { + soap->error = SOAP_TYPE; + return NULL; + } + m = (m << 6) + b; + j++; + } + else if (!soap_coblank(c + '+')) + { + soap->error = SOAP_TYPE; + return NULL; + } + } while (j < 4); + *s++ = (char)((m >> 16) & 0xFF); + *s++ = (char)((m >> 8) & 0xFF); + *s++ = (char)(m & 0xFF); + } + l = soap->lablen; + if (soap->maxlength > 0 && l > (size_t)soap->maxlength) + { + soap->error = SOAP_LENGTH; + return NULL; + } + } + } +#else + if (soap_alloc_block(soap) == NULL) + return NULL; + for (;;) + { + int i; + char *s = (char*)soap_push_block(soap, NULL, 3 * SOAP_BLKLEN); /* must be multiple of 3 */ + if (!s) + { + soap_end_block(soap, NULL); + return NULL; + } + for (i = 0; i < SOAP_BLKLEN; i++) + { + unsigned long m = 0; + int j = 0; + do + { + soap_wchar c = soap_get(soap); + if (c < SOAP_AP) + c &= 0x7FFFFFFF; + if (c == '=' || c < 0) + { + unsigned char *p; + i *= 3; + switch (j) + { + case 2: + *s++ = (char)((m >> 4) & 0xFF); + i++; + l++; + break; + case 3: + *s++ = (char)((m >> 10) & 0xFF); + *s++ = (char)((m >> 2) & 0xFF); + l += 2; + i += 2; + } + if (n) + *n = (int)soap_size_block(soap, NULL, i); + if (soap->maxlength > 0 && l > (size_t)soap->maxlength) + { + soap->error = SOAP_LENGTH; + soap_end_block(soap, NULL); + return NULL; + } + p = (unsigned char*)soap_save_block(soap, NULL, NULL, 0); + if (c >= 0) + { + while ((int)((c = soap_get(soap)) != EOF) && c != SOAP_LT && c != SOAP_TT) + continue; + } + soap_unget(soap, c); + return p; + } + c -= '+'; + if (c >= 0 && c <= 79) + { + int b = soap_base64i[c]; + if (b >= 64) + { + soap->error = SOAP_TYPE; + return NULL; + } + m = (m << 6) + b; + j++; + } + else if (!soap_coblank(c + '+')) + { + soap->error = SOAP_TYPE; + return NULL; + } + } while (j < 4); + *s++ = (char)((m >> 16) & 0xFF); + *s++ = (char)((m >> 8) & 0xFF); + *s++ = (char)(m & 0xFF); + l += 3; + } + if (soap->maxlength > 0 && l > (size_t)soap->maxlength) + { + soap->error = SOAP_LENGTH; + soap_end_block(soap, NULL); + return NULL; + } + } +#endif +} + +/******************************************************************************/ + +#ifndef WITH_LEANER +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_xop_forward(struct soap *soap, unsigned char **ptr, int *size, char **id, char **type, char **options) +{ + /* Check MTOM xop:Include element (within hex/base64Binary) */ + /* TODO: this code to be obsoleted with new import/xop.h conventions */ + short body = soap->body; /* should save type too? */ + if (!soap_peek_element(soap)) + { + if (!soap_element_begin_in(soap, ":Include", 0, NULL)) + { + if (soap_attachment_forward(soap, ptr, size, id, type, options) + || (soap->body && soap_element_end_in(soap, ":Include"))) + return soap->error; + } + else if (soap->error == SOAP_TAG_MISMATCH) + soap_retry(soap); + else + return soap->error; + } + soap->body = body; + return SOAP_OK; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_LEANER +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_attachment_forward(struct soap *soap, unsigned char **ptr, int *size, char **id, char **type, char **options) +{ + struct soap_xlist *xp; + *ptr = NULL; + *size = 0; + *id = NULL; + *type = NULL; + *options = NULL; + if (!*soap->href) + return SOAP_OK; + *id = soap_strdup(soap, soap->href); + xp = (struct soap_xlist*)SOAP_MALLOC(soap, sizeof(struct soap_xlist)); + if (!xp) + return soap->error = SOAP_EOM; + xp->next = soap->xlist; + xp->ptr = ptr; + xp->size = size; + xp->id = *id; + xp->type = type; + xp->options = options; + soap->xlist = xp; + return SOAP_OK; +} +#endif + +/******************************************************************************/ + +SOAP_FMAC1 +void * +SOAP_FMAC2 +soap_memdup(struct soap *soap, const void *s, size_t n) +{ + void *t = NULL; + if (s) + { + t = soap_malloc(soap, n); + if (t) + (void)soap_memcpy(t, n, s, n); + } + return t; +} + +/******************************************************************************/ + +SOAP_FMAC1 +char * +SOAP_FMAC2 +soap_strdup(struct soap *soap, const char *s) +{ + char *t = NULL; + if (s) + { + size_t n = strlen(s) + 1; + if (n > 0) + { + t = (char*)soap_malloc(soap, n); + if (t) + { + (void)soap_memcpy((void*)t, n, (const void*)s, n); + t[n - 1] = '\0'; + } + } + } + return t; +} + +/******************************************************************************/ + +SOAP_FMAC1 +wchar_t * +SOAP_FMAC2 +soap_wstrdup(struct soap *soap, const wchar_t *s) +{ + wchar_t *t = NULL; + if (s) + { + size_t n = 0, m; + while (s[n]) + n++; + n++; + m = sizeof(wchar_t) * n; + if (n > 0) + { + t = (wchar_t*)soap_malloc(soap, m); + if (t) + { + (void)soap_memcpy((void*)t, m, (const void*)s, m); + t[n - 1] = L'\0'; + } + } + } + return t; +} + +/******************************************************************************/ + +SOAP_FMAC1 +char * +SOAP_FMAC2 +soap_strtrim(struct soap *soap, char *s) +{ + (void)soap; + if (s) + { + char *t; + while ((*s >= 9 && *s <= 13) || *s == 32) + s++; + t = s; + while (*t) + t++; + while (--t > s && ((*t >= 9 && *t <= 13) || *t == 32)) + continue; + t[1] = '\0'; + } + return s; +} + +/******************************************************************************/ + +SOAP_FMAC1 +wchar_t * +SOAP_FMAC2 +soap_wstrtrim(struct soap *soap, wchar_t *s) +{ + (void)soap; + if (s) + { + wchar_t *t; + while ((*s >= 9 && *s <= 13) || *s == 32) + s++; + t = s; + while (*t) + t++; + while (--t > s && ((*t >= 9 && *t <= 13) || *t == 32)) + continue; + t[1] = L'\0'; + } + return s; +} + +/******************************************************************************/ + +SOAP_FMAC1 +struct soap_blist* +SOAP_FMAC2 +soap_alloc_block(struct soap *soap) +{ + struct soap_blist *p; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "New block sequence (prev=%p)\n", (void*)soap->blist)); + p = (struct soap_blist*)SOAP_MALLOC(soap, sizeof(struct soap_blist)); + if (!p) + { + soap->error = SOAP_EOM; + return NULL; + } + p->next = soap->blist; + p->head = NULL; + p->size = 0; + p->item = 0; + soap->blist = p; + return p; +} + +/******************************************************************************/ + +SOAP_FMAC1 +void* +SOAP_FMAC2 +soap_push_block(struct soap *soap, struct soap_blist *b, size_t n) +{ + struct soap_bhead *p; + if (!b) + b = soap->blist; + if (!b + || b->size + n < b->size + || sizeof(struct soap_bhead) + n < n + || (SOAP_MAXALLOCSIZE > 0 && sizeof(struct soap_bhead) + n > SOAP_MAXALLOCSIZE)) + { + soap->error = SOAP_EOM; + return NULL; + } + p = (struct soap_bhead*)SOAP_MALLOC(soap, sizeof(struct soap_bhead) + n); + if (!p) + { + soap->error = SOAP_EOM; + return NULL; + } + p->next = b->head; + b->head = p; + p->size = n; + b->size += n; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Push block %p of %u bytes on %lu previous blocks (%lu bytes total)\n", (void*)p, (unsigned int)n, (unsigned long)b->item, (unsigned long)b->size)); + b->item++; + return (void*)(p + 1); /* skip block header and point to n allocated bytes */ +} + +/******************************************************************************/ + +SOAP_FMAC1 +void* +SOAP_FMAC2 +soap_push_block_max(struct soap *soap, struct soap_blist *b, size_t n) +{ + if (b && b->item >= soap->maxoccurs) /* restrict block array length */ + { + soap->error = SOAP_OCCURS; + return NULL; + } + return soap_push_block(soap, b, n); +} + +/******************************************************************************/ + +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_pop_block(struct soap *soap, struct soap_blist *b) +{ + struct soap_bhead *p; + if (!b) + b = soap->blist; + if (!b || !b->head) + return; + p = b->head; + b->size -= p->size; + b->head = p->next; + b->item--; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Pop block %p (%lu items of %lu bytes total)\n", (void*)p, (unsigned long)b->item, (unsigned long)b->size)); + SOAP_FREE(soap, p); +} + +/******************************************************************************/ + +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_update_pointers(struct soap *soap, const char *dst, const char *src, size_t len) +{ + const void *start = src, *end = src + len; +#ifndef WITH_LEANER + struct soap_xlist *xp; +#endif +#ifndef WITH_NOIDREF + if ((soap->version && !(soap->imode & SOAP_XML_TREE)) || (soap->mode & SOAP_XML_GRAPH)) + { + int i; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Update pointers %p (%lu bytes) -> %p\n", (void*)src, (unsigned long)len, (void*)dst)); + for (i = 0; i < SOAP_IDHASH; i++) + { + struct soap_ilist *ip; + for (ip = soap->iht[i]; ip; ip = ip->next) + { + struct soap_flist *fp; + void *p, **q; + if (ip->shaky) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Update shaky id='%s'\n", ip->id)); + if (ip->ptr && ip->ptr >= start && ip->ptr < end) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Update ptr %p -> %p\n", ip->ptr, (void*)((const char*)ip->ptr + (dst-src)))); + ip->ptr = (void*)((const char*)ip->ptr + (dst-src)); + } + for (q = &ip->link; q; q = (void**)p) + { + p = *q; + if (p && p >= start && p < end) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Link update id='%s' %p -> %p\n", ip->id, p, (void*)((const char*)p + (dst-src)))); + *q = (void*)((const char*)p + (dst-src)); + } + } + for (q = &ip->copy; q; q = (void**)p) + { + p = *q; + if (p && p >= start && p < end) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy chain update id='%s' %p -> %p\n", ip->id, p, (void*)((const char*)p + (dst-src)))); + *q = (void*)((const char*)p + (dst-src)); + } + } + for (fp = ip->flist; fp; fp = fp->next) + { + if (fp->ptr >= start && fp->ptr < end) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy list update id='%s' target type=%d %p -> %p\n", ip->id, fp->type, fp->ptr, (void*)((char*)fp->ptr + (dst-src)))); + fp->ptr = (void*)((const char*)fp->ptr + (dst-src)); + } + } + if (ip->smart && ip->smart >= start && ip->smart < end) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Smart shared pointer update %p -> %p\n", ip->smart, (void*)((const char*)ip->smart + (dst-src)))); + ip->smart = (void*)((const char*)ip->smart + (dst-src)); + } + } + } + } + } +#else + (void)soap; (void)start; (void)end; (void)dst; (void)src; +#endif +#ifndef WITH_LEANER + for (xp = soap->xlist; xp; xp = xp->next) + { + if (xp->ptr && (void*)xp->ptr >= start && (void*)xp->ptr < end) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Update attachment id='%s' %p -> %p\n", xp->id ? xp->id : SOAP_STR_EOS, (void*)xp->ptr, (void*)((char*)xp->ptr + (dst-src)))); + xp->ptr = (unsigned char**)((char*)xp->ptr + (dst-src)); + xp->size = (int*)((char*)xp->size + (dst-src)); + xp->type = (char**)((char*)xp->type + (dst-src)); + xp->options = (char**)((char*)xp->options + (dst-src)); + } + } +#endif +} + +/******************************************************************************/ + +#ifndef WITH_NOIDREF +static int +soap_has_copies(struct soap *soap, const char *start, const char *end) +{ + int i; + struct soap_ilist *ip = NULL; + struct soap_flist *fp = NULL; + const char *p; + for (i = 0; i < SOAP_IDHASH; i++) + { + for (ip = soap->iht[i]; ip; ip = ip->next) + { + for (p = (const char*)ip->copy; p; p = *(const char**)p) + if (p >= start && p < end) + return SOAP_ERR; + for (fp = ip->flist; fp; fp = fp->next) + if (fp->type == ip->type && (const char*)fp->ptr >= start && (const char*)fp->ptr < end) + return SOAP_ERR; + } + } + return SOAP_OK; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_NOIDREF +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_resolve(struct soap *soap) +{ + int i; + short flag; + const char *id; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Resolving forwarded refs\n")); + for (i = 0; i < SOAP_IDHASH; i++) + { + struct soap_ilist *ip; + for (ip = soap->iht[i]; ip; ip = ip->next) + { + if (ip->ptr) + { + void **q; + struct soap_flist *fp, **fpp = &ip->flist; + if (ip->spine) + ip->spine[0] = ip->ptr; + q = (void**)ip->link; + ip->link = NULL; + DBGLOG(TEST, if (q) SOAP_MESSAGE(fdebug, "Traversing link chain to resolve id='%s' type=%d\n", ip->id, ip->type)); + while (q) + { + void *p = *q; + *q = ip->ptr; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "... link %p -> %p\n", (void*)q, ip->ptr)); + q = (void**)p; + } + while ((fp = *fpp)) + { + if (fp->level > 0 && fp->finsert) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "... insert type=%d link %p -> %p\n", fp->type, fp->ptr, ip->ptr)); + if (ip->spine && fp->level <= SOAP_MAXPTRS) + fp->finsert(soap, ip->type, fp->type, fp->ptr, fp->index, &ip->spine[fp->level - 1], &ip->smart); + else if (fp->level == 1) + fp->finsert(soap, ip->type, fp->type, fp->ptr, fp->index, &ip->ptr, &ip->smart); + else if (fp->level <= SOAP_MAXPTRS) + { + int i; + ip->spine = (void**)soap_malloc(soap, SOAP_MAXPTRS * sizeof(void*)); + if (!ip->spine) + return soap->error = SOAP_EOM; + ip->spine[0] = ip->ptr; + for (i = 1; i < SOAP_MAXPTRS; i++) + ip->spine[i] = &ip->spine[i - 1]; + fp->finsert(soap, ip->type, fp->type, fp->ptr, fp->index, &ip->spine[fp->level - 1], &ip->smart); + } + *fpp = fp->next; + SOAP_FREE(soap, fp); + } + else + fpp = &fp->next; + } + } + else if (*ip->id == '#') + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Missing id='%s'\n", ip->id)); + soap_strcpy(soap->id, sizeof(soap->id), ip->id + 1); + return soap->error = SOAP_MISSING_ID; + } + } + } + do + { + flag = 0; + id = NULL; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Resolution phase\n")); + for (i = 0; i < SOAP_IDHASH; i++) + { + struct soap_ilist *ip; + for (ip = soap->iht[i]; ip; ip = ip->next) + { + if (ip->copy || ip->flist) + { + if (ip->ptr && !soap_has_copies(soap, (const char*)ip->ptr, (const char*)ip->ptr + ip->size)) + { + struct soap_flist *fp; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Resolving id='%s' type=%d ptr=%p size=%lu ...\n", ip->id, ip->type, ip->ptr, (unsigned long)ip->size)); + if (ip->copy) + { + void *p, **q = (void**)ip->copy; + DBGLOG(TEST, if (q) SOAP_MESSAGE(fdebug, "Traversing copy chain to resolve id='%s'\n", ip->id)); + ip->copy = NULL; + do + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "... copy %p -> %p (%u bytes)\n", ip->ptr, (void*)q, (unsigned int)ip->size)); + p = *q; + (void)soap_memcpy((void*)q, ip->size, (const void*)ip->ptr, ip->size); + q = (void**)p; + } while (q); + flag = 1; + } + while ((fp = ip->flist)) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Resolving forwarded data type=%d target type=%d location=%p level=%u id='%s'\n", ip->type, fp->type, ip->ptr, fp->level, ip->id)); + if (fp->level == 0) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "... copy %p -> %p (%lu bytes)\n", ip->ptr, fp->ptr, (unsigned long)ip->size)); + if (fp->finsert) + fp->finsert(soap, ip->type, fp->type, fp->ptr, fp->index, ip->ptr, &ip->smart); + else + (void)soap_memcpy((void*)fp->ptr, ip->size, (const void*)ip->ptr, ip->size); + } + ip->flist = fp->next; + SOAP_FREE(soap, fp); + flag = 1; + } + } + else if (*ip->id == '#') + id = ip->id; + } + } + } + } while (flag); + if (id) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Resolution error: forwarded data for id='%s' could not be propagated, please report this problem to the gSOAP developers\n", id)); + return soap_id_nullify(soap, id); + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Resolution done\n")); + return SOAP_OK; +} +#endif + +/******************************************************************************/ + +SOAP_FMAC1 +size_t +SOAP_FMAC2 +soap_size_block(struct soap *soap, struct soap_blist *b, size_t n) +{ + if (!b) + b = soap->blist; + if (b->head) + { + b->size -= b->head->size - n; + b->head->size = n; + } + return b->size; +} + +/******************************************************************************/ + +SOAP_FMAC1 +char* +SOAP_FMAC2 +soap_first_block(struct soap *soap, struct soap_blist *b) +{ + struct soap_bhead *p, *q, *r; + if (!b) + b = soap->blist; + p = b->head; + if (!p) + return NULL; + r = NULL; + do + { + q = p->next; + p->next = r; + r = p; + p = q; + } while (p); + b->head = r; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "First block %p\n", (void*)(r + 1))); + return (char*)(r + 1); +} + +/******************************************************************************/ + +SOAP_FMAC1 +char* +SOAP_FMAC2 +soap_next_block(struct soap *soap, struct soap_blist *b) +{ + struct soap_bhead *p; + if (!b) + b = soap->blist; + p = b->head; + if (p) + { + b->head = p->next; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Next block %p, deleting current block\n", (void*)(b->head ? b->head + 1 : NULL))); + SOAP_FREE(soap, p); + if (b->head) + return (char*)(b->head + 1); + } + return NULL; +} + +/******************************************************************************/ + +SOAP_FMAC1 +size_t +SOAP_FMAC2 +soap_block_size(struct soap *soap, struct soap_blist *b) +{ + if (!b) + b = soap->blist; + return b->head->size; +} + +/******************************************************************************/ + +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_end_block(struct soap *soap, struct soap_blist *b) +{ + struct soap_bhead *p, *q; + if (!b) + b = soap->blist; + if (b) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "End of block sequence, free all remaining blocks\n")); + for (p = b->head; p; p = q) + { + q = p->next; + SOAP_FREE(soap, p); + } + if (soap->blist == b) + soap->blist = b->next; + else + { + struct soap_blist *bp; + for (bp = soap->blist; bp; bp = bp->next) + { + if (bp->next == b) + { + bp->next = b->next; + break; + } + } + } + SOAP_FREE(soap, b); + } + DBGLOG(TEST, if (soap->blist) SOAP_MESSAGE(fdebug, "Restored previous block sequence\n")); +#ifndef WITH_NOIDREF + if (!soap->blist && ((soap->version && !(soap->imode & SOAP_XML_TREE)) || (soap->mode & SOAP_XML_GRAPH))) + { + int i; + struct soap_ilist *ip = NULL; + for (i = 0; i < SOAP_IDHASH; i++) + for (ip = soap->iht[i]; ip; ip = ip->next) + ip->shaky = 0; + } +#endif +} + +/******************************************************************************/ + +SOAP_FMAC1 +void* +SOAP_FMAC2 +soap_save_block(struct soap *soap, struct soap_blist *b, char *p, int flag) +{ + size_t n; + char *q, *s; + if (!b) + b = soap->blist; + if (b->size) + { + if (!p) + p = (char*)soap_malloc(soap, b->size); + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Save all %lu blocks in contiguous memory space of %u bytes (%p->%p)\n", (unsigned long)b->item, (unsigned int)b->size, (void*)b->head, (void*)p)); + if (p) + { + s = p; + for (q = soap_first_block(soap, b); q; q = soap_next_block(soap, b)) + { + n = soap_block_size(soap, b); + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy %u bytes from %p to %p\n", (unsigned int)n, (void*)q, (void*)s)); + if (flag) + soap_update_pointers(soap, s, q, n); + (void)soap_memcpy((void*)s, n, (const void*)q, n); + s += n; + } + } + else + soap->error = SOAP_EOM; + } + soap_end_block(soap, b); + return p; +} + +/******************************************************************************/ + +SOAP_FMAC1 +char * +SOAP_FMAC2 +soap_putsizesoffsets(struct soap *soap, const char *type, const int *size, const int *offset, int dim) +{ + int i; + const char *t = ",%d"; + if (!type) + return NULL; + if (soap->version == 2) + t = " %d"; + if (soap->version != 2 && offset) + { + (SOAP_SNPRINTF(soap->type, sizeof(soap->type) - 1, strlen(type) + 20), "%s[%d", type, size[0] + offset[0]); + for (i = 1; i < dim; i++) + { + size_t l = strlen(soap->type); + (SOAP_SNPRINTF(soap->type + l, sizeof(soap->type) - l - 1, 20), t, size[i] + offset[i]); + } + } + else + { + (SOAP_SNPRINTF(soap->type, sizeof(soap->type) - 1, strlen(type) + 20), "%s[%d", type, size[0]); + for (i = 1; i < dim; i++) + { + size_t l = strlen(soap->type); + (SOAP_SNPRINTF(soap->type + l, sizeof(soap->type) - l - 1, 20), t, size[i]); + } + } + soap_strcat(soap->type, sizeof(soap->type), "]"); + return soap->type; +} + +/******************************************************************************/ + +SOAP_FMAC1 +char * +SOAP_FMAC2 +soap_putoffsets(struct soap *soap, const int *offset, int dim) +{ + int i; + soap->arrayOffset[0] = '\0'; + if (soap->version == 1) + { + (SOAP_SNPRINTF(soap->arrayOffset, sizeof(soap->arrayOffset) - 1, 20), "[%d", offset[0]); + for (i = 1; i < dim; i++) + { + size_t l = strlen(soap->arrayOffset); + (SOAP_SNPRINTF(soap->arrayOffset + l, sizeof(soap->arrayOffset) - l - 1, 20), ",%d", offset[i]); + } + soap_strcat(soap->arrayOffset, sizeof(soap->arrayOffset), "]"); + } + return soap->arrayOffset; +} + +/******************************************************************************/ + +SOAP_FMAC1 +size_t +SOAP_FMAC2 +soap_size(const int *size, int dim) +{ + int i; + size_t n = 0; + if (size[0] <= 0) + return 0; + n = (size_t)size[0]; + for (i = 1; i < dim; i++) + { + if (size[i] <= 0) + return 0; + n *= (size_t)size[i]; + } + return (size_t)n; +} + +/******************************************************************************/ + +SOAP_FMAC1 +size_t +SOAP_FMAC2 +soap_getsizes(const char *attr, int *size, int dim) +{ + size_t i, k, n; + if (!attr || !*attr || dim < 1) /* actually attr != NULL and dim is guaranteed >= 1 by soapcpp2-generated code */ + return 0; + i = strlen(attr); + n = 1; + do + { + for (; i > 0; i--) + if (attr[i - 1] == '[' || attr[i - 1] == ',' || attr[i - 1] == ' ') + break; + n *= k = (size_t)soap_strtoul(attr + i, NULL, 10); + size[--dim] = (int)k; + if (n > SOAP_MAXARRAYSIZE) + return 0; + } while (dim > 0 && i-- > 1 && attr[i] != '['); + return n; +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_getoffsets(const char *attr, const int *size, int *offset, int dim) +{ + int i, j = 0; + if (offset) + { + for (i = 0; i < dim && attr && *attr; i++) + { + attr++; + j *= size[i]; + j += offset[i] = (int)soap_strtol(attr, NULL, 10); + attr = strchr(attr, ','); + } + } + else + { + for (i = 0; i < dim && attr && *attr; i++) + { + attr++; + j *= size[i]; + j += (int)soap_strtol(attr, NULL, 10); + attr = strchr(attr, ','); + } + } + return j; +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_getposition(const char *attr, int *pos) +{ + int i, n; + if (!*attr) + return -1; + n = 0; + i = 1; + do + { + pos[n++] = (int)soap_strtol(attr + i, NULL, 10); + while (attr[i] && attr[i] != ',' && attr[i] != ']') + i++; + if (attr[i] == ',') + i++; + } while (n < SOAP_MAXDIMS && attr[i] && attr[i] != ']'); + return n; +} + +/******************************************************************************/ + +SOAP_FMAC1 +struct soap_nlist * +SOAP_FMAC2 +soap_push_namespace(struct soap *soap, const char *id, const char *ns) +{ + struct soap_nlist *np = NULL; + struct Namespace *p; + short i = -1; + size_t n, k; + n = strlen(id); + k = strlen(ns) + 1; + p = soap->local_namespaces; + if (p) + { + for (i = 0; p->id; p++, i++) + { + if (p->ns && !strcmp(ns, p->ns)) + break; + if (p->out) + { + if (!strcmp(ns, p->out)) + break; + } + else if (p->in) + { + if (!soap_tag_cmp(ns, p->in)) + { + if (SOAP_MAXALLOCSIZE <= 0 || k <= SOAP_MAXALLOCSIZE) + p->out = (char*)SOAP_MALLOC(soap, k); + if (p->out) + soap_strcpy(p->out, k, ns); + break; + } + } + } + if (!p->id) + i = -1; + } + if (i >= 0) + k = 0; + if (sizeof(struct soap_nlist) + n + k > n && (SOAP_MAXALLOCSIZE <= 0 || sizeof(struct soap_nlist) + n + k <= SOAP_MAXALLOCSIZE)) + np = (struct soap_nlist*)SOAP_MALLOC(soap, sizeof(struct soap_nlist) + n + k); + if (!np) + { + soap->error = SOAP_EOM; + return NULL; + } + np->next = soap->nlist; + soap->nlist = np; + np->level = soap->level; + np->index = i; + soap_strcpy((char*)np->id, n + 1, id); + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Push namespace binding (level=%u,index=%hd) '%s'='%s'\n", soap->level, i, id, ns)); + if (i < 0) + { + np->ns = np->id + n + 1; + soap_strcpy((char*)np->ns, k, ns); + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Push NOT OK: no match found for '%s' in namespace mapping table (added to stack anyway)\n", ns)); + } + else + { + np->ns = NULL; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Push OK ('%s' matches '%s' in namespace table)\n", id, p->id)); + } + return np; +} + +/******************************************************************************/ + +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_pop_namespace(struct soap *soap) +{ + struct soap_nlist *np, *nq; + for (np = soap->nlist; np && np->level >= soap->level; np = nq) + { + nq = np->next; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Pop namespace binding (level=%u) '%s' level=%u\n", soap->level, np->id, np->level)); + SOAP_FREE(soap, np); + } + soap->nlist = np; +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_match_namespace(struct soap *soap, const char *id1, const char *id2, size_t n1, size_t n2) +{ + struct soap_nlist *np = soap->nlist; + const char *s; + while (np && (strncmp(np->id, id1, n1) || np->id[n1])) + np = np->next; + if (np) + { + if (!(soap->mode & SOAP_XML_IGNORENS) && (n2 > 0 || !np->ns || *np->ns)) + { + if (np->index < 0 + || ((s = soap->local_namespaces[np->index].id) && (strncmp(s, id2, n2) || (s[n2] && s[n2] != '_')))) + return SOAP_NAMESPACE; + } + return SOAP_OK; + } + if (n1 == 0) + return n2 == 0 || (soap->mode & SOAP_XML_IGNORENS) ? SOAP_OK : SOAP_NAMESPACE; + if ((n1 == 3 && n1 == n2 && !strncmp(id1, "xml", 3) && !strncmp(id1, id2, 3)) + || (soap->mode & SOAP_XML_IGNORENS)) + return SOAP_OK; + return soap->error = SOAP_SYNTAX_ERROR; +} + +/******************************************************************************/ + +SOAP_FMAC1 +const char* +SOAP_FMAC2 +soap_current_namespace_tag(struct soap *soap, const char *tag) +{ + struct soap_nlist *np; + const char *s; + if (!tag || !strncmp(tag, "xml", 3)) + return NULL; + np = soap->nlist; + s = strchr(tag, ':'); + if (!s) + { + while (np && *np->id) /* find default namespace, if present */ + np = np->next; + } + else + { + while (np && (strncmp(np->id, tag, s - tag) || np->id[s - tag])) + np = np->next; + if (!np) + soap->error = SOAP_NAMESPACE; + } + if (np) + { + if (np->index >= 0) + return soap->namespaces[np->index].ns; + if (np->ns) + { + s = np->ns; + if (*s) + return soap_strdup(soap, s); + do + np = np->next; + while (np && *np->id); /* find if there is any other default namespace */ + if (np) + return soap_strdup(soap, s); + } + } + return NULL; +} + +/******************************************************************************/ + +SOAP_FMAC1 +const char* +SOAP_FMAC2 +soap_current_namespace_att(struct soap *soap, const char *tag) +{ + struct soap_nlist *np; + const char *s; + if (!tag || !strncmp(tag, "xml", 3)) + return NULL; + s = strchr(tag, ':'); + if (!s) + return NULL; + np = soap->nlist; + while (np && (strncmp(np->id, tag, s - tag) || np->id[s - tag])) + np = np->next; + if (!np) + soap->error = SOAP_NAMESPACE; + if (np) + { + if (np->index >= 0) + return soap->namespaces[np->index].ns; + if (np->ns && *np->ns) + return soap_strdup(soap, np->ns); + } + return NULL; +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_tag_cmp(const char *s, const char *t) +{ + const char *a = NULL; + const char *b = NULL; + for (;;) + { + int c1 = *s; + int c2 = *t; + if (!c1 || c1 == '"') + break; + if (c2 != '-') + { + if (c1 < c2) + { + if (c1 >= 'A' && c1 <= 'Z') + c1 += 'a' - 'A'; + } + else if (c1 > c2) + { + if (c2 >= 'A' && c2 <= 'Z') + c2 += 'a' - 'A'; + } + if (c2 == '*') + { + c2 = *++t; + if (!c2) + return 0; + a = s; + b = t; + continue; + } + if (c1 != c2) + { + if (!a) + return 1; + s = ++a; + t = b; + continue; + } + } + s++; + t++; + } + if (*t == '*' && !t[1]) + return 0; + return *t; +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_match_tag(struct soap *soap, const char *tag1, const char *tag2) +{ + const char *s, *t; + int err; + if (!tag1 || !tag2 || !*tag2) + return SOAP_OK; + s = strchr(tag1, ':'); + t = strchr(tag2, ':'); + if (t) + { + if (s) + { + if (t[1] && SOAP_STRCMP(s + 1, t + 1)) + return SOAP_TAG_MISMATCH; + if (t != tag2 && !(soap->mode & SOAP_XML_IGNORENS)) + { + err = soap_match_namespace(soap, tag1, tag2, s - tag1, t - tag2); + if (err) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Tags '%s' and '%s' match but namespaces differ\n", tag1, tag2)); + if (err == SOAP_NAMESPACE) + return SOAP_TAG_MISMATCH; + return err; + } + } + } + else if (!t[1]) + { + if ((soap->mode & SOAP_XML_IGNORENS) || soap_match_namespace(soap, tag1, tag2, 0, t - tag2)) + return SOAP_TAG_MISMATCH; + } + else if (SOAP_STRCMP(tag1, t + 1)) + { + return SOAP_TAG_MISMATCH; + } + else if (t != tag2) + { + err = soap_match_namespace(soap, tag1, tag2, 0, t - tag2); + if (err) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Tags '%s' and '%s' match but namespaces differ\n", tag1, tag2)); + if (err == SOAP_NAMESPACE) + return SOAP_TAG_MISMATCH; + return err; + } + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Tags and (default) namespaces match: '%s' '%s'\n", tag1, tag2)); + return SOAP_OK; + } + if (s) + { + if (!(soap->mode & SOAP_XML_IGNORENS) || SOAP_STRCMP(s + 1, tag2)) /* always fails (except when ignoring ns) */ + return SOAP_TAG_MISMATCH; + } + else if (SOAP_STRCMP(tag1, tag2) +#ifndef WITH_NOEMPTYNAMESPACES + || ((soap->mode & SOAP_XML_STRICT) && !(soap->mode & SOAP_XML_IGNORENS) && soap_match_namespace(soap, tag1, tag2, 0, 0)) /* strict checking: default namespace must be null namespace */ +#endif + ) + { + return SOAP_TAG_MISMATCH; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Tags match: '%s' '%s'\n", tag1, tag2)); + return SOAP_OK; +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_match_att(struct soap *soap, const char *tag1, const char *tag2) +{ + const char *s, *t; + int err; + if (!tag1 || !tag2 || !*tag2) + return SOAP_OK; + s = strchr(tag1, ':'); + t = strchr(tag2, ':'); + if (t) + { + if (s) + { + if (t[1] && SOAP_STRCMP(s + 1, t + 1)) + return SOAP_TAG_MISMATCH; + if (t != tag2 && !(soap->mode & SOAP_XML_IGNORENS)) + { + err = soap_match_namespace(soap, tag1, tag2, s - tag1, t - tag2); + if (err) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Atts '%s' and '%s' match but namespaces differ\n", tag1, tag2)); + if (err == SOAP_NAMESPACE) + return SOAP_TAG_MISMATCH; + return err; + } + } + } + else if (!t[1] || t != tag2 || SOAP_STRCMP(tag1, t + 1)) + return SOAP_TAG_MISMATCH; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Atts and (default) namespaces match: '%s' '%s'\n", tag1, tag2)); + return SOAP_OK; + } + if (s) + { + if (!(soap->mode & SOAP_XML_IGNORENS) || SOAP_STRCMP(s + 1, tag2)) /* always fails (except when ignoring ns) */ + return SOAP_TAG_MISMATCH; + } + else if (SOAP_STRCMP(tag1, tag2)) + return SOAP_TAG_MISMATCH; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Atts match: '%s' '%s'\n", tag1, tag2)); + return SOAP_OK; +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_match_array(struct soap *soap, const char *type) +{ + if (type && *soap->arrayType) + { + if (soap->version == 1 || !strchr(type, '[')) + { + if (soap_match_tag(soap, soap->arrayType, type) + && soap_match_tag(soap, soap->arrayType, "xsd:anyType") + && soap_match_tag(soap, soap->arrayType, "xsd:ur-type")) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "SOAP array type mismatch: '%s' '%s'\n", soap->arrayType, type)); + return SOAP_TAG_MISMATCH; + } + } + } + return SOAP_OK; +} + +/******************************************************************************\ + * + * SSL/TLS + * +\******************************************************************************/ + +#ifdef WITH_OPENSSL +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_rand() +{ + int r; + if (!soap_ssl_init_done) + soap_ssl_init(); +#if OPENSSL_VERSION_NUMBER < 0x10100000L + RAND_pseudo_bytes((unsigned char*)&r, sizeof(int)); +#else + RAND_bytes((unsigned char*)&r, sizeof(int)); +#endif + return r; +} +#endif + +/******************************************************************************/ + +#if defined(WITH_OPENSSL) || defined(WITH_GNUTLS) || defined(WITH_WOLFSSL) || defined(WITH_SYSTEMSSL) +SOAP_FMAC1 +int +SOAP_FMAC2 +#if defined(VXWORKS) && defined(WM_SECURE_KEY_STORAGE) +soap_ssl_server_context(struct soap *soap, unsigned short flags, const char *keyfile, const char *keyid, const char *password, const char *cafile, const char *capath, const char *dhfile, const char *randfile, const char *sid) +#else +soap_ssl_server_context(struct soap *soap, unsigned short flags, const char *keyfile, const char *password, const char *cafile, const char *capath, const char *dhfile, const char *randfile, const char *sid) +#endif +{ + int err; + soap->keyfile = keyfile; +#if defined(VXWORKS) && defined(WM_SECURE_KEY_STORAGE) + soap->keyid = keyid; /* vxWorks compatible */ +#endif + soap->password = password; + soap->cafile = cafile; + soap->capath = capath; +#ifdef WITH_OPENSSL + soap->dhfile = dhfile; + soap->randfile = randfile; + if (!soap->fsslverify) + soap->fsslverify = ssl_verify_callback; +#endif + soap->ssl_flags = flags | (dhfile == NULL ? SOAP_SSL_RSA : 0); +#ifdef WITH_GNUTLS + (void)randfile; (void)sid; + if (dhfile) + { + char *s = NULL; + int n = (int)soap_strtoul(dhfile, &s, 10); + if (!soap->dh_params) + gnutls_dh_params_init(&soap->dh_params); + /* if dhfile is numeric, treat it as a key length to generate DH params which can take a while */ + if (n >= 512 && s && *s == '\0') + gnutls_dh_params_generate2(soap->dh_params, (unsigned int)n); + else + { + unsigned int dparams_len; + unsigned char dparams_buf[1024]; + FILE *fd = fopen(dhfile, "r"); + if (!fd) + return soap_set_receiver_error(soap, "SSL/TLS error", "Invalid DH file", SOAP_SSL_ERROR); + dparams_len = (unsigned int)fread(dparams_buf, 1, sizeof(dparams_buf), fd); + fclose(fd); + gnutls_datum_t dparams = { + dparams_buf, dparams_len }; + if (gnutls_dh_params_import_pkcs3(soap->dh_params, &dparams, GNUTLS_X509_FMT_PEM)) + return soap_set_receiver_error(soap, "SSL/TLS error", "Invalid DH file", SOAP_SSL_ERROR); + } + } + else + { +#if GNUTLS_VERSION_NUMBER < 0x030300 + if (!soap->rsa_params) + gnutls_rsa_params_init(&soap->rsa_params); + gnutls_rsa_params_generate2(soap->rsa_params, SOAP_SSL_RSA_BITS); +#endif + } + if (soap->session) + { + gnutls_deinit(soap->session); + soap->session = NULL; + } + if (soap->xcred) + { + gnutls_certificate_free_credentials(soap->xcred); + soap->xcred = NULL; + } +#endif +#ifdef WITH_WOLFSSL + (void)randfile; (void)sid; + if (!soap->fsslverify) + soap->fsslverify = ssl_verify_callback; + if (soap->ctx) + wolfSSL_CTX_free(soap->ctx); + soap->ctx = NULL; +#endif +#ifdef WITH_SYSTEMSSL + (void)randfile; (void)sid; + if (soap->ctx) + gsk_environment_close(&soap->ctx); + soap->ctx = NULL; +#endif + err = soap->fsslauth(soap); +#ifdef WITH_OPENSSL + if (!err) + { + if (sid) + SSL_CTX_set_session_id_context(soap->ctx, (unsigned char*)sid, (unsigned int)strlen(sid)); + else + SSL_CTX_set_session_cache_mode(soap->ctx, SSL_SESS_CACHE_OFF); + } +#endif + return err; +} +#endif + +/******************************************************************************/ + +#if defined(WITH_OPENSSL) || defined(WITH_GNUTLS) || defined(WITH_WOLFSSL) || defined(WITH_SYSTEMSSL) +SOAP_FMAC1 +int +SOAP_FMAC2 +#if defined(VXWORKS) && defined(WM_SECURE_KEY_STORAGE) +soap_ssl_client_context(struct soap *soap, unsigned short flags, const char *keyfile, const char *keyid, const char *password, const char *cafile, const char *capath, const char *randfile) +#else +soap_ssl_client_context(struct soap *soap, unsigned short flags, const char *keyfile, const char *password, const char *cafile, const char *capath, const char *randfile) +#endif +{ + soap->keyfile = keyfile; +#if defined(VXWORKS) && defined(WM_SECURE_KEY_STORAGE) + soap->keyid = keyid; /* vxWorks compatible */ +#endif + soap->password = password; + soap->cafile = cafile; + soap->capath = capath; + soap->ssl_flags = SOAP_SSL_CLIENT | flags; +#ifdef WITH_OPENSSL + soap->dhfile = NULL; + soap->randfile = randfile; + if (!soap->fsslverify) + soap->fsslverify = (flags & SOAP_SSL_ALLOW_EXPIRED_CERTIFICATE) == 0 ? ssl_verify_callback : ssl_verify_callback_allow_expired_certificate; +#endif +#ifdef WITH_GNUTLS + (void)randfile; + if (soap->session) + { + gnutls_deinit(soap->session); + soap->session = NULL; + } + if (soap->xcred) + { + gnutls_certificate_free_credentials(soap->xcred); + soap->xcred = NULL; + } +#endif +#ifdef WITH_WOLFSSL + (void)randfile; + if (!soap->fsslverify) + soap->fsslverify = (flags & SOAP_SSL_ALLOW_EXPIRED_CERTIFICATE) == 0 ? ssl_verify_callback : ssl_verify_callback_allow_expired_certificate; + if (soap->ctx) + wolfSSL_CTX_free(soap->ctx); + soap->ctx = NULL; +#endif +#ifdef WITH_SYSTEMSSL + (void)randfile; + if (soap->ctx) + gsk_environment_close(&soap->ctx); + soap->ctx = NULL; +#endif + return soap->fsslauth(soap); +} +#endif + +/******************************************************************************/ + +#if defined(WITH_OPENSSL) || defined(WITH_GNUTLS) || defined(WITH_WOLFSSL) || defined(WITH_SYSTEMSSL) +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_ssl_crl(struct soap *soap, const char *crlfile) +{ +#ifdef WITH_OPENSSL + if (crlfile && soap->ctx) + { +#if OPENSSL_VERSION_NUMBER > 0x00907000L + X509_STORE *store = SSL_CTX_get_cert_store(soap->ctx); + if (*crlfile) + { + int ret; + X509_LOOKUP *lookup = X509_STORE_add_lookup(store, X509_LOOKUP_file()); + if (!lookup) + return soap_set_receiver_error(soap, "SSL/TLS error", "Can't create X509_LOOKUP object", SOAP_SSL_ERROR); + ret = X509_load_crl_file(lookup, crlfile, X509_FILETYPE_PEM); + if (ret <= 0) + return soap_set_receiver_error(soap, "SSL/TLS error", "Can't read CRL PEM file", SOAP_SSL_ERROR); + } + X509_STORE_set_flags(store, X509_V_FLAG_CRL_CHECK | X509_V_FLAG_CRL_CHECK_ALL); +#endif + } + else + { + soap->crlfile = crlfile; /* activate later when store is available */ + } +#endif +#ifdef WITH_GNUTLS + if (crlfile && soap->xcred) + { + if (*crlfile) + { + if (gnutls_certificate_set_x509_crl_file(soap->xcred, crlfile, GNUTLS_X509_FMT_PEM) < 0) + return soap_set_receiver_error(soap, "SSL/TLS error", "Can't read CRL PEM file", SOAP_SSL_ERROR); + } + } + else + { + soap->crlfile = crlfile; /* activate later when xcred is available */ + } +#endif +#ifdef WITH_WOLFSSL + if (crlfile && soap->ctx) + { + if (*crlfile) + { +#if defined(HAVE_CRL) && !defined(NO_FILESYSTEM) + if (wolfSSL_X509_load_crl_file(soap->ctx, crlfile) != SSL_SUCCESS) +#endif + return soap_set_receiver_error(soap, "SSL/TLS error", "Can't read CRL PEM file", SOAP_SSL_ERROR); + } + } + else + { + soap->crlfile = crlfile; /* activate later when store is available */ + } +#endif + return SOAP_OK; +} +#endif + +/******************************************************************************/ + +#if defined(WITH_OPENSSL) || defined(WITH_GNUTLS) || defined(WITH_WOLFSSL) || defined(WITH_SYSTEMSSL) +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_ssl_init() +{ + /* Note: for multi-threaded applications, the main program should call soap_ssl_init() before any threads are started */ + if (!soap_ssl_init_done) + { + soap_ssl_init_done = 1; +#ifdef WITH_OPENSSL +#if OPENSSL_VERSION_NUMBER < 0x10100000L + SSL_library_init(); + OpenSSL_add_all_algorithms(); /* we keep ciphers and digests for the program's lifetime */ +#ifndef WITH_LEAN + SSL_load_error_strings(); +#endif +#endif +#if !defined(WIN32) && !defined(CYGWIN) && !defined(__MINGW32__) && !defined(__MINGW64__) && !defined(VXWORKS) + if (!RAND_load_file("/dev/urandom", 1024)) +#else + if (1) +#endif + { + /* if /dev/urandom does not exist we need to do at least some pertubations to seed the OpenSSL PRNG */ + char buf[1024]; + RAND_seed(buf, sizeof(buf)); +#ifdef HAVE_RANDOM + srandom((unsigned long)time(NULL)); +#else + srand((unsigned int)time(NULL)); +#endif + do + { +#ifdef HAVE_RANDOM + long r = random(); /* we actually do no use random() anywhere, except to further seed the OpenSSL PRNG */ + RAND_seed(&r, sizeof(long)); +#else + int r = rand(); /* we actually do no use rand() anywhere, except when random() is not available and to further seed the OpenSSL PRNG */ + RAND_seed(&r, sizeof(int)); +#endif + } while (!RAND_status()); + } +#endif +#ifdef WITH_GNUTLS +# if GNUTLS_VERSION_NUMBER < 0x020b00 +# if defined(HAVE_PTHREAD_H) + gcry_control(GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread); +# elif defined(HAVE_PTH_H) + gcry_control(GCRYCTL_SET_THREAD_CBS, &gcry_threads_pth); +# endif + gcry_control(GCRYCTL_ENABLE_QUICK_RANDOM, 0); + gcry_control(GCRYCTL_DISABLE_SECMEM, 0); + gcry_control(GCRYCTL_INITIALIZATION_FINISHED, 0); /* libgcrypt init done */ +# endif +# if GNUTLS_VERSION_NUMBER < 0x030300 + gnutls_global_init(); +# endif +#endif +#ifdef WITH_WOLFSSL + wolfSSL_Init(); +#endif + } +} +#endif + +/******************************************************************************/ + +#if defined(WITH_OPENSSL) || defined(WITH_GNUTLS) || defined(WITH_WOLFSSL) || defined(WITH_SYSTEMSSL) +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_ssl_noinit() +{ + /* Call this first to bypass SSL init is SSL is already initialized elsewhere */ + soap_ssl_init_done = 1; +} +#endif + +/******************************************************************************/ + +#if defined(WITH_OPENSSL) || defined(WITH_GNUTLS) || defined(WITH_WOLFSSL) +SOAP_FMAC1 +const char * +SOAP_FMAC2 +soap_ssl_error(struct soap *soap, int ret, int err) +{ +#ifdef WITH_OPENSSL + const char *msg = soap_code_str(h_ssl_error_codes, err); + if (!msg) + return ERR_error_string(err, soap->msgbuf); + (SOAP_SNPRINTF(soap->msgbuf, sizeof(soap->msgbuf), strlen(msg) + 1), "%s\n", msg); + if (ERR_peek_error()) + { + unsigned long r; + while ((r = ERR_get_error())) + { + size_t l = strlen(soap->msgbuf); + ERR_error_string_n(r, soap->msgbuf + l, sizeof(soap->msgbuf) - l); + l = strlen(soap->msgbuf); + if (l + 1 < sizeof(soap->msgbuf)) + { + soap->msgbuf[l++] = '\n'; + soap->msgbuf[l] = '\0'; + } + if (ERR_GET_REASON(r) == SSL_R_CERTIFICATE_VERIFY_FAILED && l < sizeof(soap->msgbuf)) + { + const char *s = X509_verify_cert_error_string(SSL_get_verify_result(soap->ssl)); + (SOAP_SNPRINTF(soap->msgbuf + l, sizeof(soap->msgbuf) - l, strlen(s)), "%s", s); + } + } + } + else + { + size_t l = strlen(soap->msgbuf); + switch (ret) + { + case 0: + soap_strcpy(soap->msgbuf + l, sizeof(soap->msgbuf) - l, "EOF was observed that violates the SSL/TLS protocol. The client probably provided invalid authentication information."); + break; + case -1: + { + const char *s = strerror(soap_errno); + (SOAP_SNPRINTF(soap->msgbuf + l, sizeof(soap->msgbuf) - l, strlen(s) + 42), "Error observed by underlying SSL/TLS BIO: %s", s); + } + break; + } + } + ERR_clear_error(); + return soap->msgbuf; +#endif +#ifdef WITH_GNUTLS + (void)soap; + (void)err; + return gnutls_strerror(ret); +#endif +#ifdef WITH_WOLFSSL + err = wolfSSL_get_error(soap->ssl, ret); + return wolfSSL_ERR_error_string(err, soap->msgbuf); /* msgbuf size is at least 80 bytes (>=1024) */ +#endif +} +#endif + +/******************************************************************************/ + +#ifdef WITH_SYSTEMSSL +static int +ssl_recv(int sk, void *s, int n, char *user) +{ + (void)user; + return recv(sk, s, n, 0); +} +#endif + +/******************************************************************************/ + +#ifdef WITH_SYSTEMSSL +static int +ssl_send(int sk, void *s, int n, char *user) +{ + (void)user; + return send(sk, s, n, 0); +} +#endif + +/******************************************************************************/ + +#if defined(WITH_OPENSSL) || defined(WITH_GNUTLS) || defined(WITH_WOLFSSL) || defined(WITH_SYSTEMSSL) +static int +ssl_auth_init(struct soap *soap) +{ +#ifdef WITH_OPENSSL +#if OPENSSL_VERSION_NUMBER >= 0x10101000L + int minv = 0, maxv = 0; +#endif + long flags = SSL_OP_ALL; + int mode; +#if defined(VXWORKS) && defined(WM_SECURE_KEY_STORAGE) + EVP_PKEY* pkey; /* vxWorks compatible */ +#endif + if (!soap_ssl_init_done) + soap_ssl_init(); + ERR_clear_error(); + if (!soap->ctx) + { +#if OPENSSL_VERSION_NUMBER >= 0x10100000L + /* TLS_method: a TLS/SSL connection established may understand the SSLv3, TLSv1, TLSv1.1, TLSv1.2 and TLSv1.3 protocols. */ + soap->ctx = SSL_CTX_new(TLS_method()); +#else + /* SSLv23_method: a TLS/SSL connection established may understand the SSLv3, TLSv1, TLSv1.1 and TLSv1.2 protocols. */ + soap->ctx = SSL_CTX_new(SSLv23_method()); +#endif + if (!soap->ctx) + return soap_set_receiver_error(soap, "SSL/TLS error", "Can't setup context", SOAP_SSL_ERROR); + /* The following alters the behavior of SSL read/write: */ +#if 0 + SSL_CTX_set_mode(soap->ctx, SSL_MODE_ENABLE_PARTIAL_WRITE | SSL_MODE_AUTO_RETRY); +#endif + } + if (soap->randfile) + { + if (!RAND_load_file(soap->randfile, -1)) + return soap_set_receiver_error(soap, "SSL/TLS error", "Can't load randomness", SOAP_SSL_ERROR); + } + if (soap->cafile || soap->capath) + { + if (!SSL_CTX_load_verify_locations(soap->ctx, soap->cafile, soap->capath)) + return soap_set_receiver_error(soap, "SSL/TLS error", "Can't read CA PEM file", SOAP_SSL_ERROR); + if (soap->cafile && (soap->ssl_flags & SOAP_SSL_REQUIRE_CLIENT_AUTHENTICATION)) + SSL_CTX_set_client_CA_list(soap->ctx, SSL_load_client_CA_file(soap->cafile)); + } + if (!(soap->ssl_flags & SOAP_SSL_NO_DEFAULT_CA_PATH)) + { + if (!SSL_CTX_set_default_verify_paths(soap->ctx)) + return soap_set_receiver_error(soap, "SSL/TLS error", "Can't read default CA PEM file and/or directory", SOAP_SSL_ERROR); + } + if (soap->crlfile) + { + if (soap_ssl_crl(soap, soap->crlfile)) + return soap->error; + } +/* This code assumes a typical scenario with key and cert combined in one PEM file */ +#if 1 + if (soap->keyfile) + { + if (SSL_CTX_use_certificate_chain_file(soap->ctx, soap->keyfile) != 1) + return soap_set_receiver_error(soap, "SSL/TLS error", "Can't find or read certificate in private key PEM file", SOAP_SSL_ERROR); + if (soap->password) + { + SSL_CTX_set_default_passwd_cb_userdata(soap->ctx, (void*)soap->password); + SSL_CTX_set_default_passwd_cb(soap->ctx, ssl_password); + } +#ifndef WM_SECURE_KEY_STORAGE + if (SSL_CTX_use_PrivateKey_file(soap->ctx, soap->keyfile, SSL_FILETYPE_PEM) != 1) + return soap_set_receiver_error(soap, "SSL/TLS error", "Can't read private key PEM file", SOAP_SSL_ERROR); +#endif + } +#else +/* Alternative approach to check the key file for cert only when cafile==NULL */ +#ifndef WM_SECURE_KEY_STORAGE + if (soap->password) + { + SSL_CTX_set_default_passwd_cb_userdata(soap->ctx, (void*)soap->password); + SSL_CTX_set_default_passwd_cb(soap->ctx, ssl_password); + } +#endif + if (!soap->cafile) + { + if (soap->keyfile) + { + if (SSL_CTX_use_certificate_chain_file(soap->ctx, soap->keyfile) != 1) + return soap_set_receiver_error(soap, "SSL/TLS error", "Can't find or read certificate in private key PEM file", SOAP_SSL_ERROR); +#ifndef WM_SECURE_KEY_STORAGE + if (SSL_CTX_use_PrivateKey_file(soap->ctx, soap->keyfile, SSL_FILETYPE_PEM) != 1) + return soap_set_receiver_error(soap, "SSL/TLS error", "Can't read private key PEM file", SOAP_SSL_ERROR); +#endif + } + } + else /* use cafile for the root CA and (server) cert, and keyfile for (server) key */ + { + if (SSL_CTX_use_certificate_chain_file(soap->ctx, soap->cafile) != 1) + return soap_set_receiver_error(soap, "SSL/TLS error", "Can't read CA PEM file", SOAP_SSL_ERROR); +#ifndef WM_SECURE_KEY_STORAGE + if (soap->keyfile) + if (SSL_CTX_use_PrivateKey_file(soap->ctx, soap->keyfile, SSL_FILETYPE_PEM) != 1) + return soap_set_receiver_error(soap, "SSL/TLS error", "Can't read private key PEM file", SOAP_SSL_ERROR); +#endif + } +#endif +#if defined(VXWORKS) && defined(WM_SECURE_KEY_STORAGE) + /* vxWorks compatible */ + pkey = ipcom_key_db_pkey_get(soap->keyid); + if (!pkey) + return soap_set_receiver_error(soap, "SSL error", "Can't find key", SOAP_SSL_ERROR); + if (!SSL_CTX_use_PrivateKey(soap->ctx, pkey)) + return soap_set_receiver_error(soap, "SSL error", "Can't read key", SOAP_SSL_ERROR); +#endif + if ((soap->ssl_flags & SOAP_SSL_RSA)) + { + /* OpenSSL v3 deprecated low-level RSA key generation: ignore SOAP_SSL_RSA flag */ +#if OPENSSL_VERSION_NUMBER < 0x30000000L +#if OPENSSL_VERSION_NUMBER >= 0x10002000L + if (SSL_CTX_need_tmp_RSA(soap->ctx)) + { + unsigned long e = RSA_F4; + BIGNUM *bne = BN_new(); + RSA *rsa = RSA_new(); + if (!bne || !rsa || !BN_set_word(bne, e) || !RSA_generate_key_ex(rsa, SOAP_SSL_RSA_BITS, bne, NULL) || !SSL_CTX_set_tmp_rsa(soap->ctx, rsa)) + { + if (bne) + BN_free(bne); + if (rsa) + RSA_free(rsa); + return soap_set_receiver_error(soap, "SSL/TLS error", "Can't generate RSA key", SOAP_SSL_ERROR); + } + BN_free(bne); + RSA_free(rsa); + } +#else + RSA *rsa = RSA_generate_key(SOAP_SSL_RSA_BITS, RSA_F4, NULL, NULL); + if (!rsa || !SSL_CTX_set_tmp_rsa(soap->ctx, rsa)) + { + if (rsa) + RSA_free(rsa); + return soap_set_receiver_error(soap, "SSL/TLS error", "Can't generate RSA key", SOAP_SSL_ERROR); + } + RSA_free(rsa); +#endif +#endif + } + else if (soap->dhfile) + { + char *s = (char*)soap->dhfile; + int n = (int)soap_strtoul(soap->dhfile, &s, 10); +#if OPENSSL_VERSION_NUMBER >= 0x30000000L + /* if dhfile is numeric, set auto DH selection regardless of the value of n */ + if (n >= 1 && *s == '\0') + { + if (!SSL_CTX_set_dh_auto(soap->ctx, 1)) + return soap_set_receiver_error(soap, "SSL/TLS error", "Can't generate DH parameters", SOAP_SSL_ERROR); + } + else + { + EVP_PKEY *dh; + BIO *bio = BIO_new_file(soap->dhfile, "r"); + if (!bio) + return soap_set_receiver_error(soap, "SSL/TLS error", "Can't read DH PEM file", SOAP_SSL_ERROR); + dh = PEM_read_bio_Parameters(bio, NULL); + BIO_free(bio); + if (!dh || !SSL_CTX_set0_tmp_dh_pkey(soap->ctx, dh)) + { + if (dh) + EVP_PKEY_free(dh); + return soap_set_receiver_error(soap, "SSL/TLS error", "Can't set DH parameters", SOAP_SSL_ERROR); + } + } +#else + DH *dh = NULL; + /* if dhfile is numeric, treat it as a key length to generate DH params which can take a while */ + if (n >= 512 && *s == '\0') + { +#if OPENSSL_VERSION_NUMBER >= 0x10002000L + dh = DH_new(); + if (!DH_generate_parameters_ex(dh, n, 2/*or 5*/, NULL)) + { + DH_free(dh); + return soap_set_receiver_error(soap, "SSL/TLS error", "Can't generate DH parameters", SOAP_SSL_ERROR); + } +#elif defined(VXWORKS) + dh = DH_new(); + DH_generate_parameters_ex(dh, n, 2/*or 5*/, NULL); +#else + dh = DH_generate_parameters(n, 2/*or 5*/, NULL, NULL); +#endif + } + else + { + BIO *bio; + bio = BIO_new_file(soap->dhfile, "r"); + if (!bio) + return soap_set_receiver_error(soap, "SSL/TLS error", "Can't read DH PEM file", SOAP_SSL_ERROR); + dh = PEM_read_bio_DHparams(bio, NULL, NULL, NULL); + BIO_free(bio); + } + if (!dh || !DH_check(dh, &n) || !SSL_CTX_set_tmp_dh(soap->ctx, dh)) + { + if (dh) + DH_free(dh); + return soap_set_receiver_error(soap, "SSL/TLS error", "Can't set DH parameters", SOAP_SSL_ERROR); + } + DH_free(dh); +#endif + } + /* enable all TSLv1 protocols and disable SSLv3 by default if no SSL/TLS flags are set */ + if ((soap->ssl_flags & SOAP_SSLv3_TLSv1) == 0) + soap->ssl_flags |= SOAP_TLSv1; +#if OPENSSL_VERSION_NUMBER >= 0x10101000L + if ((soap->ssl_flags & SOAP_SSLv3)) + minv = SSL3_VERSION; + else if ((soap->ssl_flags & SOAP_TLSv1_0)) + minv = TLS1_VERSION; + else if ((soap->ssl_flags & SOAP_TLSv1_1)) + minv = TLS1_1_VERSION; + else if ((soap->ssl_flags & SOAP_TLSv1_2)) + minv = TLS1_2_VERSION; + else if ((soap->ssl_flags & SOAP_TLSv1_3)) + minv = TLS1_3_VERSION; + if ((soap->ssl_flags & SOAP_TLSv1_3) && OpenSSL_version_num() >= 0x10101000L) + maxv = TLS1_3_VERSION; + else if ((soap->ssl_flags & SOAP_TLSv1_2)) + maxv = TLS1_2_VERSION; + else if ((soap->ssl_flags & SOAP_TLSv1_1)) + maxv = TLS1_1_VERSION; + else if ((soap->ssl_flags & SOAP_TLSv1_0)) + maxv = TLS1_VERSION; + else + maxv = SSL3_VERSION; + if (!SSL_CTX_set_min_proto_version(soap->ctx, minv) + || !SSL_CTX_set_max_proto_version(soap->ctx, maxv)) + return soap_set_receiver_error(soap, "SSL/TLS error", "Can't set protocol version", SOAP_SSL_ERROR); +#else + /* disable SSL v2 by default and enable specific protos */ + flags = SSL_OP_NO_SSLv2; + if (!(soap->ssl_flags & SOAP_SSLv3)) + flags |= SSL_OP_NO_SSLv3; +#if OPENSSL_VERSION_NUMBER >= 0x10001000L + if (!(soap->ssl_flags & SOAP_TLSv1_0)) + flags |= SSL_OP_NO_TLSv1; + if (!(soap->ssl_flags & SOAP_TLSv1_1)) + flags |= SSL_OP_NO_TLSv1_1; + if (!(soap->ssl_flags & SOAP_TLSv1_2)) + flags |= SSL_OP_NO_TLSv1_2; +#endif +#endif +#ifdef SSL_OP_NO_TICKET + /* TLS extension is enabled by default in OPENSSL v0.9.8k disable it by */ + flags |= SSL_OP_NO_TICKET; +#endif + SSL_CTX_set_options(soap->ctx, flags); + if ((soap->ssl_flags & SOAP_SSL_REQUIRE_CLIENT_AUTHENTICATION)) + mode = (SSL_VERIFY_PEER | SSL_VERIFY_FAIL_IF_NO_PEER_CERT); + else if ((soap->ssl_flags & SOAP_SSL_REQUIRE_SERVER_AUTHENTICATION)) + mode = SSL_VERIFY_PEER; + else + mode = SSL_VERIFY_NONE; + SSL_CTX_set_verify(soap->ctx, mode, soap->fsslverify); +#if OPENSSL_VERSION_NUMBER < 0x00905100L + SSL_CTX_set_verify_depth(soap->ctx, 1); +#else + SSL_CTX_set_verify_depth(soap->ctx, 9); +#endif +#endif +#ifdef WITH_GNUTLS + int ret; + char priority[80]; + soap_strcpy(priority, sizeof(priority), "PERFORMANCE"); + if (!soap_ssl_init_done) + soap_ssl_init(); + if (!soap->xcred) + { + if (gnutls_certificate_allocate_credentials(&soap->xcred) != GNUTLS_E_SUCCESS) + return soap_set_receiver_error(soap, "SSL/TLS error", "Can't allocate credentials or trust", SOAP_SSL_ERROR); +#if GNUTLS_VERSION_NUMBER >= 0x030300 + gnutls_certificate_set_x509_system_trust(soap->xcred); +#endif + if (soap->cafile) + { + if (gnutls_certificate_set_x509_trust_file(soap->xcred, soap->cafile, GNUTLS_X509_FMT_PEM) < 0) + return soap_set_receiver_error(soap, "SSL/TLS error", "Can't read CA PEM file", SOAP_SSL_ERROR); + } + if (soap->crlfile) + { + if (soap_ssl_crl(soap, soap->crlfile)) + return soap->error; + } + if (soap->keyfile) + { + if (gnutls_certificate_set_x509_key_file2(soap->xcred, soap->keyfile, soap->keyfile, GNUTLS_X509_FMT_PEM, soap->password, GNUTLS_PKCS_PKCS12_3DES | GNUTLS_PKCS_PKCS12_ARCFOUR | GNUTLS_PKCS_PKCS12_RC2_40 | GNUTLS_PKCS_PBES2_AES_128 | GNUTLS_PKCS_PBES2_AES_192 | GNUTLS_PKCS_PBES2_AES_256 | GNUTLS_PKCS_PBES2_DES) < 0) /* Assumes that key and cert(s) are concatenated in the keyfile and the key is encrypted with one of these algorithms */ + return soap_set_receiver_error(soap, "SSL/TLS error", "Can't read private key PEM file", SOAP_SSL_ERROR); + } + } + if ((soap->ssl_flags & SOAP_SSL_CLIENT)) + { + gnutls_init(&soap->session, GNUTLS_CLIENT); + if (soap->cafile || soap->crlfile || soap->keyfile) + { + ret = gnutls_priority_set_direct(soap->session, "PERFORMANCE", NULL); + if (ret != GNUTLS_E_SUCCESS) + return soap_set_receiver_error(soap, soap_ssl_error(soap, ret, 0), "SSL/TLS set priority error", SOAP_SSL_ERROR); + gnutls_credentials_set(soap->session, GNUTLS_CRD_CERTIFICATE, soap->xcred); + } + else + { + if (!soap->acred) + gnutls_anon_allocate_client_credentials(&soap->acred); + ret = gnutls_priority_set_direct(soap->session, "PERFORMANCE:+ANON-DH:!ARCFOUR-128", NULL); + if (ret != GNUTLS_E_SUCCESS) + return soap_set_receiver_error(soap, soap_ssl_error(soap, ret, 0), "SSL/TLS set priority error", SOAP_SSL_ERROR); + gnutls_credentials_set(soap->session, GNUTLS_CRD_ANON, soap->acred); + } + } + else if (!soap->keyfile) + { + return soap_set_receiver_error(soap, "SSL/TLS error", "No key file: anonymous server authentication not supported in this release", SOAP_SSL_ERROR); + } + else + { +#if GNUTLS_VERSION_NUMBER < 0x030300 + int protocol_priority[] = { 0, 0, 0, 0, 0 }; + int *protocol = protocol_priority; + if ((soap->ssl_flags & SOAP_SSL_RSA) && soap->rsa_params) + gnutls_certificate_set_rsa_export_params(soap->xcred, soap->rsa_params); +#endif + if (!(soap->ssl_flags & SOAP_SSL_RSA) && soap->dh_params) + gnutls_certificate_set_dh_params(soap->xcred, soap->dh_params); + if (!soap->cache) + gnutls_priority_init(&soap->cache, "NORMAL", NULL); + gnutls_init(&soap->session, GNUTLS_SERVER); + gnutls_priority_set(soap->session, soap->cache); + gnutls_credentials_set(soap->session, GNUTLS_CRD_CERTIFICATE, soap->xcred); + if ((soap->ssl_flags & SOAP_SSL_REQUIRE_CLIENT_AUTHENTICATION)) + gnutls_certificate_server_set_request(soap->session, GNUTLS_CERT_REQUEST); + gnutls_session_enable_compatibility_mode(soap->session); + /* enable all TSLv1 protocols and disable SSLv3 by default if no SSL/TLS flags are set */ + if ((soap->ssl_flags & SOAP_SSLv3_TLSv1) == 0) + soap->ssl_flags |= SOAP_TLSv1; +#if GNUTLS_VERSION_NUMBER < 0x030300 + if ((soap->ssl_flags & SOAP_SSLv3)) + *protocol++ = GNUTLS_SSL3; + if ((soap->ssl_flags & SOAP_TLSv1_0)) + *protocol++ = GNUTLS_TLS1_0; + if ((soap->ssl_flags & SOAP_TLSv1_1)) + *protocol++ = GNUTLS_TLS1_1; + if ((soap->ssl_flags & SOAP_TLSv1_2)) + *protocol++ = GNUTLS_TLS1_2; + if (gnutls_protocol_set_priority(soap->session, protocol_priority) != GNUTLS_E_SUCCESS) + return soap_set_receiver_error(soap, "SSL/TLS error", "Can't set protocol", SOAP_SSL_ERROR); +#else + soap_strcpy(soap->tmpbuf, sizeof(soap->tmpbuf), "NORMAL:+VERS-ALL"); + if (!(soap->ssl_flags & SOAP_TLSv1_0)) + soap_strcat(soap->tmpbuf, sizeof(soap->tmpbuf), ":-VERS-TLS1.0"); + if (!(soap->ssl_flags & SOAP_TLSv1_1)) + soap_strcat(soap->tmpbuf, sizeof(soap->tmpbuf), ":-VERS-TLS1.1"); + if (!(soap->ssl_flags & SOAP_TLSv1_2)) + soap_strcat(soap->tmpbuf, sizeof(soap->tmpbuf), ":-VERS-TLS1.2"); + if (gnutls_priority_set_direct(soap->session, soap->tmpbuf, NULL) != GNUTLS_E_SUCCESS) + return soap_set_receiver_error(soap, "SSL/TLS error", "Can't set protocol priority", SOAP_SSL_ERROR); +#endif + } +#endif +#ifdef WITH_WOLFSSL + WOLFSSL_METHOD *method = NULL; + int verify = WOLFSSL_VERIFY_PEER; + if (soap->ssl_flags & SOAP_SSL_CLIENT) + verify = (soap->ssl_flags & SOAP_SSL_REQUIRE_SERVER_AUTHENTICATION) ? WOLFSSL_VERIFY_PEER : SSL_VERIFY_NONE; + else + verify = (soap->ssl_flags & SOAP_SSL_REQUIRE_CLIENT_AUTHENTICATION) ? SSL_VERIFY_PEER | WOLFSSL_VERIFY_FAIL_IF_NO_PEER_CERT : SSL_VERIFY_NONE; + /* enable all TSLv1 protocols and disable SSLv3 by default if no SSL/TLS flags are set */ + if ((soap->ssl_flags & SOAP_SSLv3_TLSv1) == 0) + soap->ssl_flags |= SOAP_SSLv3_TLSv1; + if ((soap->ssl_flags & SOAP_SSL_CLIENT)) + { + if ((soap->ssl_flags & SOAP_SSLv3_TLSv1) == SOAP_SSLv3_TLSv1) + method = wolfSSLv23_client_method(); /* select all available protocols */ +#ifdef WOLFSSL_TLS13 + else if ((soap->ssl_flags & SOAP_TLSv1_3)) + method = wolfTLSv1_3_client_method(); /* TLSv1.3 only or upgrade to TLSv1.3 */ +#endif +#ifndef WOLFSSL_NO_TLS12 + else if ((soap->ssl_flags & SOAP_TLSv1_2)) + method = wolfTLSv1_2_client_method(); /* TLSv1.2 only or upgrade to TLSv1.2 */ +#endif +#ifndef NO_OLD_TLS + else if ((soap->ssl_flags & SOAP_TLSv1_1)) + method = wolfTLSv1_1_client_method(); /* TLSv1.1 only or upgrade to TLSv1.1 */ +#endif +#ifdef WOLFSSL_ALLOW_TLSV10 + else if ((soap->ssl_flags & SOAP_TLSv1_0)) + method = wolfTLSv1_client_method(); /* TLSv1.0 only or upgrade to TLSv1.0 */ +#endif +#ifdef WOLFSSL_ALLOW_SSLV3 + else if ((soap->ssl_flags & SOAP_SSLv3)) + method = wolfSSLv3_client_method(); /* SSLv3 only */ +#endif + } + else + { + if ((soap->ssl_flags & SOAP_SSLv3_TLSv1) == SOAP_SSLv3_TLSv1) + method = wolfSSLv23_server_method(); /* select all available protocols */ +#ifdef WOLFSSL_TLS13 + else if ((soap->ssl_flags & SOAP_TLSv1_3)) + method = wolfTLSv1_3_server_method(); /* TLSv1.3 only or upgrade to TLSv1.3 */ +#endif +#ifndef WOLFSSL_NO_TLS12 + else if ((soap->ssl_flags & SOAP_TLSv1_2)) + method = wolfTLSv1_2_server_method(); /* TLSv1.2 only or upgrade to TLSv1.2 */ +#endif +#ifndef NO_OLD_TLS + else if ((soap->ssl_flags & SOAP_TLSv1_1)) + method = wolfTLSv1_1_server_method(); /* TLSv1.1 only or upgrade to TLSv1.1 */ +#endif +#ifdef WOLFSSL_ALLOW_TLSV10 + else if ((soap->ssl_flags & SOAP_TLSv1_0)) + method = wolfTLSv1_server_method(); /* TLSv1.0 only or upgrade to TLSv1.0 */ +#endif +#ifdef WOLFSSL_ALLOW_SSLV3 + else if ((soap->ssl_flags & SOAP_SSLv3)) + method = wolfSSLv3_server_method(); /* SSLv3 only */ +#endif + } + if (!method) + return soap_set_receiver_error(soap, "SSL/TLS error", "Can't setup method, the specified TLS protocol is unsupported", SOAP_SSL_ERROR); + if (soap->ctx) + { + wolfSSL_CTX_free(soap->ctx); + soap->ctx = NULL; + } + soap->ctx = wolfSSL_CTX_new(method); + if (!soap->ctx) + return soap_set_receiver_error(soap, "SSL/TLS error", "Can't setup context", SOAP_SSL_ERROR); + if (soap->cafile || soap->capath) + { + if (wolfSSL_CTX_load_verify_locations(soap->ctx, soap->cafile, soap->capath) != SSL_SUCCESS) + return soap_set_receiver_error(soap, "SSL/TLS error", "Can't read CA PEM file", SOAP_SSL_ERROR); + } + if (soap->keyfile) + { + if (wolfSSL_CTX_use_certificate_file(soap->ctx, soap->keyfile, SSL_FILETYPE_PEM) != SSL_SUCCESS) + return soap_set_receiver_error(soap, "SSL/TLS error", "Can't read server CA PEM file", SOAP_SSL_ERROR); +#ifdef WOLFSSL_ENCRYPTED_KEYS + if (soap->password) + { + wolfSSL_CTX_set_default_passwd_cb_userdata(soap->ctx, (void*)soap->password); + wolfSSL_CTX_set_default_passwd_cb(soap->ctx, ssl_password); + } +#else +#warning "Encrypted private keys are not supported, define WOLFSSL_ENCRYPTED_KEYS in WolfSSL build settings to enable" +#endif + if (wolfSSL_CTX_use_PrivateKey_file(soap->ctx, soap->keyfile, SSL_FILETYPE_PEM) != SSL_SUCCESS) + return soap_set_receiver_error(soap, "SSL/TLS error", "Can't read private key PEM file", SOAP_SSL_ERROR); +#if defined(WOLFSSL_TLS13) && defined(WOLFSSL_POST_HANDSHAKE_AUTH) + /* post handshake authentication sets a flag in the ClientHello message, which is required for post-handshake authentication, only when we are connecting as a client */ + if ((soap->ssl_flags & SOAP_TLSv1_3) && (soap->ssl_flags & SOAP_SSL_CLIENT) && wolfSSL_CTX_allow_post_handshake_auth(soap->ctx)) + return soap_set_receiver_error(soap, "SSL/TLS error", "Can't enable post-handshake authentication", SOAP_SSL_ERROR); +#endif + } + if (soap->crlfile) + { + if (soap_ssl_crl(soap, soap->crlfile)) + return soap->error; + } + wolfSSL_CTX_set_verify(soap->ctx, verify, soap->fsslverify); +#endif +#ifdef WITH_SYSTEMSSL + if (!soap->ctx) + { + int err; + err = gsk_environment_open(&soap->ctx); + if (err == GSK_OK) + err = gsk_attribute_set_enum(soap->ctx, GSK_PROTOCOL_SSLV2, GSK_PROTOCOL_SSLV2_OFF); + /* enable all TSLv1 protocols and disable SSLv3 by default if no SSL/TLS flags are set */ + if ((soap->ssl_flags & SOAP_SSLv3_TLSv1) == 0) + soap->ssl_flags |= SOAP_TLSv1; + if (err == GSK_OK) + { + if ((soap->ssl_flags & SOAP_SSLv3)) + err = gsk_attribute_set_enum(soap->ctx, GSK_PROTOCOL_SSLV3, GSK_PROTOCOL_SSLV3_ON); + else + err = gsk_attribute_set_enum(soap->ctx, GSK_PROTOCOL_SSLV3, GSK_PROTOCOL_SSLV3_OFF); + } + if (err == GSK_OK) + { + if ((soap->ssl_flags & SOAP_TLSv1_0)) + err = gsk_attribute_set_enum(soap->ctx, GSK_PROTOCOL_TLSV1, GSK_PROTOCOL_TLSV1_ON); + else + err = gsk_attribute_set_enum(soap->ctx, GSK_PROTOCOL_TLSV1, GSK_PROTOCOL_TLSV1_OFF); + } + if (err == GSK_OK) + { + if ((soap->ssl_flags & SOAP_TLSv1_1)) + err = gsk_attribute_set_enum(soap->ctx, GSK_PROTOCOL_TLSV1, GSK_PROTOCOL_TLSV1_1_ON); + else + err = gsk_attribute_set_enum(soap->ctx, GSK_PROTOCOL_TLSV1, GSK_PROTOCOL_TLSV1_1_OFF); + } + if (err == GSK_OK) + { + if ((soap->ssl_flags & SOAP_TLSv1_2)) + err = gsk_attribute_set_enum(soap->ctx, GSK_PROTOCOL_TLSV1, GSK_PROTOCOL_TLSV1_2_ON); + else + err = gsk_attribute_set_enum(soap->ctx, GSK_PROTOCOL_TLSV1, GSK_PROTOCOL_TLSV1_2_OFF); + } + if (err == GSK_OK) + err = gsk_attribute_set_buffer(soap->ctx, GSK_KEYRING_FILE, soap->keyfile, 0); /* keyfile is a keyring .kdb file */ + if (err == GSK_OK) + err = gsk_attribute_set_buffer(soap->ctx, GSK_KEYRING_PW, soap->password, 0); /* locked by password */ + if (err == GSK_OK) + err = gsk_environment_init(soap->ctx); + if (err != GSK_OK) + return soap_set_receiver_error(soap, gsk_strerror(err), "SYSTEM SSL error in ssl_auth_init()", SOAP_SSL_ERROR); + } +#endif + return SOAP_OK; +} +#endif + +/******************************************************************************/ + +#if defined(WITH_OPENSSL) || defined(WITH_WOLFSSL) +static int +ssl_password(char *buf, int num, int rwflag, void *userdata) +{ + (void)rwflag; + if (!buf || !userdata) + return 0; + soap_strcpy(buf, (size_t)num, (char*)userdata); + return (int)strlen(buf); +} +#endif + +/******************************************************************************/ + +#ifdef WITH_OPENSSL +static int +ssl_verify_callback(int ok, X509_STORE_CTX *store) +{ + (void)store; +#ifdef SOAP_DEBUG + if (!ok) + { + int err = X509_STORE_CTX_get_error(store); + X509 *cert = X509_STORE_CTX_get_current_cert(store); + fprintf(stderr, "\nDEBUG mode TLS/SSL warnings:\nSSL verify error %d or warning with certificate at depth %d: %s\n", err, X509_STORE_CTX_get_error_depth(store), X509_verify_cert_error_string(err)); + if (cert) + { + char buf[1024]; + X509_NAME_oneline(X509_get_issuer_name(cert), buf, sizeof(buf)-1); + fprintf(stderr, " certificate issuer: %s\n", buf); + X509_NAME_oneline(X509_get_subject_name(cert), buf, sizeof(buf)-1); + fprintf(stderr, " certificate subject: %s\n", buf); + /* accept self-signed certificates and certificates out of date */ + switch (err) + { + case X509_V_ERR_CERT_NOT_YET_VALID: + case X509_V_ERR_CERT_HAS_EXPIRED: + case X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT: + case X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN: + case X509_V_ERR_UNABLE_TO_GET_CRL: + case X509_V_ERR_CRL_NOT_YET_VALID: + case X509_V_ERR_CRL_HAS_EXPIRED: + X509_STORE_CTX_set_error(store, X509_V_OK); + ok = 1; + fprintf(stderr, "Initialize soap_ssl_client_context with SOAP_SSL_ALLOW_EXPIRED_CERTIFICATE to allow this verification error to pass without DEBUG mode enabled\n"); + } + } + else + { + fprintf(stderr, " no certificate in store\n"); + } + } +#endif + /* Note: return 1 to continue, whether it is safe or not to do so is up to you to verify, or 0 to cancel the handshake */ + return ok; +} +#endif + +/******************************************************************************/ + +#ifdef WITH_OPENSSL +static int +ssl_verify_callback_allow_expired_certificate(int ok, X509_STORE_CTX *store) +{ + ok = ssl_verify_callback(ok, store); + if (!ok) + { + /* accept self signed certificates, expired certificates, and certficiates w/o CRL */ + switch (X509_STORE_CTX_get_error(store)) + { + case X509_V_ERR_CERT_NOT_YET_VALID: + case X509_V_ERR_CERT_HAS_EXPIRED: + case X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT: + case X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN: + case X509_V_ERR_UNABLE_TO_GET_CRL: + case X509_V_ERR_CRL_NOT_YET_VALID: + case X509_V_ERR_CRL_HAS_EXPIRED: + X509_STORE_CTX_set_error(store, X509_V_OK); + ok = 1; + } + } + /* Note: return 1 to continue, but unsafe progress will be terminated by SSL */ + return ok; +} +#endif + +/******************************************************************************/ + +#ifdef WITH_GNUTLS +static const char * +ssl_verify(struct soap *soap, const char *host) +{ + unsigned int status; + const char *err = NULL; + int r = gnutls_certificate_verify_peers2(soap->session, &status); + if (r < 0) + err = "Certificate verify error"; + else if ((status & GNUTLS_CERT_INVALID)) + err = "The certificate is not trusted"; + else if ((status & GNUTLS_CERT_SIGNER_NOT_FOUND)) + err = "The certificate hasn't got a known issuer"; + else if ((status & GNUTLS_CERT_REVOKED)) + err = "The certificate has been revoked"; + else if (gnutls_certificate_type_get(soap->session) == GNUTLS_CRT_X509) + { + gnutls_x509_crt_t cert; + const gnutls_datum_t *cert_list; + unsigned int cert_list_size; + if (gnutls_x509_crt_init(&cert) < 0) + err = "Could not get X509 certificates"; + else if ((cert_list = gnutls_certificate_get_peers(soap->session, &cert_list_size)) == NULL) + err = "Could not get X509 certificates"; + else if (gnutls_x509_crt_import(cert, &cert_list[0], GNUTLS_X509_FMT_DER) < 0) + err = "Error parsing X509 certificate"; + else if (!(soap->ssl_flags & SOAP_SSL_ALLOW_EXPIRED_CERTIFICATE) && gnutls_x509_crt_get_expiration_time(cert) < time(NULL)) + err = "The certificate has expired"; + else if (!(soap->ssl_flags & SOAP_SSL_ALLOW_EXPIRED_CERTIFICATE) && gnutls_x509_crt_get_activation_time(cert) > time(NULL)) + err = "The certificate is not yet activated"; + else if (host && !(soap->ssl_flags & SOAP_SSL_SKIP_HOST_CHECK)) + { + if (!gnutls_x509_crt_check_hostname(cert, host)) + err = "Certificate host name mismatch"; + } + gnutls_x509_crt_deinit(cert); + } + return err; +} +#endif + +/******************************************************************************/ + +#ifdef WITH_WOLFSSL +static int +ssl_verify_callback(int ok, WOLFSSL_X509_STORE_CTX *store) +{ + (void)store; +#ifdef SOAP_DEBUG + if (!ok) + { + int err = store->error; +#if defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL) + WOLFSSL_X509 *cert = store->current_cert; + fprintf(stderr, "\nDEBUG mode TLS/SSL warnings:\nSSL verify error %d or warning with certificate at depth %d: %s\n", err, store->error_depth, wolfSSL_X509_verify_cert_error_string(err)); + if (cert) + { + char buf[1024]; + wolfSSL_X509_NAME_oneline(wolfSSL_X509_get_issuer_name(cert), buf, sizeof(buf)-1); + fprintf(stderr, " certificate issuer: %s\n", buf); + wolfSSL_X509_NAME_oneline(wolfSSL_X509_get_subject_name(cert), buf, sizeof(buf)-1); + fprintf(stderr, " certificate subject: %s\n", buf); + } + else + { + fprintf(stderr, " no certificate in store\n"); + } +#else + fprintf(stderr, "\nDEBUG mode TLS/SSL warnings:\nSSL verify error %d or warning with certificate at depth %d\n", err, store->error_depth); +#endif + } +#endif + /* Note: return 1 to continue, whether it is safe or not to do so is up to you to verify, or 0 to cancel the handshake */ + return ok; +} +#endif + +/******************************************************************************/ + +#ifdef WITH_WOLFSSL +static int +ssl_verify_callback_allow_expired_certificate(int ok, WOLFSSL_X509_STORE_CTX *store) +{ + ok = ssl_verify_callback(ok, store); + if (!ok) + { + /* accept expired certificates */ + switch (store->error) + { + case ASN_BEFORE_DATE_E: + case ASN_AFTER_DATE_E: + ok = 1; + } + } + /* Note: return 1 to continue, whether it is safe or not to do so is up to you to verify, or 0 to cancel the handshake */ + return ok; +} +#endif + +/******************************************************************************/ + +#if defined(WITH_OPENSSL) || defined(WITH_GNUTLS) || defined(WITH_WOLFSSL) || defined(WITH_SYSTEMSSL) +#ifndef WITH_NOIO +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_ssl_accept(struct soap *soap) +{ + SOAP_SOCKET sk = soap->socket; +#ifdef WITH_OPENSSL + BIO *bio; + int err = SSL_ERROR_NONE; + int retries, r, s; + ERR_clear_error(); + if (!soap_valid_socket(sk)) + return soap_set_receiver_error(soap, "SSL/TLS error", "No socket in soap_ssl_accept()", SOAP_SSL_ERROR); + soap->ssl_flags &= ~SOAP_SSL_CLIENT; + if (!soap->ctx && (soap->error = soap->fsslauth(soap)) != SOAP_OK) + return soap_closesock(soap); + if (!soap->ssl) + { + soap->ssl = SSL_new(soap->ctx); + if (!soap->ssl) + { + (void)soap_closesock(soap); + return soap_set_receiver_error(soap, "SSL/TLS error", "SSL_new() failed in soap_ssl_accept()", SOAP_SSL_ERROR); + } + } + else + { + SSL_clear(soap->ssl); + } + bio = BIO_new_socket((int)sk, BIO_NOCLOSE); + SSL_set_bio(soap->ssl, bio, bio); + /* Default timeout: 10 sec retries, 100 times 0.1 sec */ + retries = 100; + if (soap->recv_timeout || soap->send_timeout) + { + int t = soap->recv_timeout > soap->send_timeout ? soap->recv_timeout : soap->send_timeout; + if (t > 0) + retries = 10 * t; + else if (t > -100000) + retries = 1; + else + retries = t/-100000; + } + SOAP_SOCKNONBLOCK(sk) + while ((r = SSL_accept(soap->ssl)) <= 0) + { + err = SSL_get_error(soap->ssl, r); + if (err == SSL_ERROR_WANT_ACCEPT || err == SSL_ERROR_WANT_READ || err == SSL_ERROR_WANT_WRITE) + { + if (err == SSL_ERROR_WANT_READ) + s = tcp_select(soap, sk, SOAP_TCP_SELECT_RCV | SOAP_TCP_SELECT_ERR, -100000); + else + s = tcp_select(soap, sk, SOAP_TCP_SELECT_SND | SOAP_TCP_SELECT_ERR, -100000); + if (s < 0) + break; + } + else + { + soap->errnum = soap_socket_errno; + break; + } + if (retries-- <= 0) + break; + } + if (!soap->recv_timeout && !soap->send_timeout) + SOAP_SOCKBLOCK(sk) + if (r <= 0) + { + (void)soap_set_receiver_error(soap, soap_ssl_error(soap, r, err), "SSL_accept() failed in soap_ssl_accept()", SOAP_SSL_ERROR); + return soap_closesock(soap); + } + if ((soap->ssl_flags & SOAP_SSL_REQUIRE_CLIENT_AUTHENTICATION)) + { + X509 *peer; + int err; + if ((err = SSL_get_verify_result(soap->ssl)) != X509_V_OK) + { + (void)soap_closesock(soap); + return soap_set_sender_error(soap, X509_verify_cert_error_string(err), "SSL certificate presented by peer cannot be verified in soap_ssl_accept()", SOAP_SSL_ERROR); + } + peer = SSL_get_peer_certificate(soap->ssl); + if (!peer) + { + (void)soap_closesock(soap); + return soap_set_sender_error(soap, "SSL/TLS error", "No SSL certificate was presented by the peer in soap_ssl_accept()", SOAP_SSL_ERROR); + } + X509_free(peer); + } +#endif +#ifdef WITH_GNUTLS + int retries, r, s; + if (!soap_valid_socket(sk)) + return soap_set_receiver_error(soap, "SSL/TLS error", "No socket in soap_ssl_accept()", SOAP_SSL_ERROR); + soap->ssl_flags &= ~SOAP_SSL_CLIENT; + if (!soap->session && (soap->error = soap->fsslauth(soap)) != SOAP_OK) + return soap_closesock(soap); + gnutls_transport_set_ptr(soap->session, (gnutls_transport_ptr_t)(long)sk); + /* default timeout: 10 sec retries, 100 times 0.1 sec */ + retries = 100; + if (soap->recv_timeout || soap->send_timeout) + { + int t = soap->recv_timeout > soap->send_timeout ? soap->recv_timeout : soap->send_timeout; + if (t > 0) + retries = 10 * t; + else if (t > -100000) + retries = 1; + else + retries = t/-100000; + } + SOAP_SOCKNONBLOCK(sk) + while ((r = gnutls_handshake(soap->session))) + { + /* GNUTLS repeat handhake when GNUTLS_E_AGAIN */ + if (r == GNUTLS_E_AGAIN || r == GNUTLS_E_INTERRUPTED) + { + if (!gnutls_record_get_direction(soap->session)) + s = tcp_select(soap, sk, SOAP_TCP_SELECT_RCV | SOAP_TCP_SELECT_ERR, -100000); + else + s = tcp_select(soap, sk, SOAP_TCP_SELECT_SND | SOAP_TCP_SELECT_ERR, -100000); + if (s < 0) + break; + } + else + { + soap->errnum = soap_socket_errno; + break; + } + if (retries-- <= 0) + break; + } + if (!soap->recv_timeout && !soap->send_timeout) + SOAP_SOCKBLOCK(sk) + if (r) + { + (void)soap_set_receiver_error(soap, soap_ssl_error(soap, r, 0), "SSL/TLS handshake failed", SOAP_SSL_ERROR); + return soap_closesock(soap); + } + if ((soap->ssl_flags & SOAP_SSL_REQUIRE_CLIENT_AUTHENTICATION)) + { + const char *err = ssl_verify(soap, NULL); + if (err) + { + (void)soap_closesock(soap); + return soap_set_receiver_error(soap, "SSL/TLS error", err, SOAP_SSL_ERROR); + } + } +#endif +#ifdef WITH_WOLFSSL + int err = SSL_ERROR_NONE; + int retries, r, s; + if (!soap_valid_socket(sk)) + return soap_set_receiver_error(soap, "SSL/TLS error", "No socket in soap_ssl_accept()", SOAP_SSL_ERROR); + if (!soap->ssl) + { + soap->ssl = wolfSSL_new(soap->ctx); + if (!soap->ssl) + { + (void)soap_closesock(soap); + return soap_set_receiver_error(soap, "SSL/TLS error", "wolfSSL_new() failed in soap_ssl_accept()", SOAP_SSL_ERROR); + } + } + soap->ssl_flags &= ~SOAP_SSL_CLIENT; + /* default timeout: 10 sec retries, 100 times 0.1 sec */ + retries = 100; + if (soap->recv_timeout || soap->send_timeout) + { + int t = soap->recv_timeout > soap->send_timeout ? soap->recv_timeout : soap->send_timeout; + if (t > 0) + retries = 10 * t; + else if (t > -100000) + retries = 1; + else + retries = t/-100000; + } + wolfSSL_set_fd(soap->ssl, sk); + SOAP_SOCKNONBLOCK(sk) + while ((r = wolfSSL_accept(soap->ssl)) != SSL_SUCCESS) + { + err = wolfSSL_get_error(soap->ssl, r); + if (err == SSL_ERROR_WANT_ACCEPT || err == SSL_ERROR_WANT_READ || err == SSL_ERROR_WANT_WRITE) + { + if (err == SSL_ERROR_WANT_READ) + s = tcp_select(soap, sk, SOAP_TCP_SELECT_RCV | SOAP_TCP_SELECT_ERR, -100000); + else + s = tcp_select(soap, sk, SOAP_TCP_SELECT_SND | SOAP_TCP_SELECT_ERR, -100000); + if (s < 0) + break; + } + else + { + soap->errnum = soap_socket_errno; + break; + } + if (retries-- <= 0) + break; + } + if (!soap->recv_timeout && !soap->send_timeout) + SOAP_SOCKBLOCK(sk) + if (r != SSL_SUCCESS) + { + (void)soap_set_receiver_error(soap, soap_ssl_error(soap, r, 0), "SSL/TLS handshake failed", SOAP_SSL_ERROR); + return soap_closesock(soap); + } +#endif +#ifdef WITH_SYSTEMSSL + gsk_iocallback local_io = { ssl_recv, ssl_send, NULL, NULL, NULL, NULL }; + int retries, r, s; + if (!soap_valid_socket(sk)) + return soap_set_receiver_error(soap, "SSL/TLS error", "No socket in soap_ssl_accept()", SOAP_SSL_ERROR); + soap->ssl_flags &= ~SOAP_SSL_CLIENT; + /* default timeout: 10 sec retries, 100 times 0.1 sec */ + retries = 100; + if (soap->recv_timeout || soap->send_timeout) + { + int t = soap->recv_timeout > soap->send_timeout ? soap->recv_timeout : soap->send_timeout; + if (t > 0) + retries = 10 * t; + else if (t > -100000) + retries = 1; + else + retries = t/-100000; + } + SOAP_SOCKNONBLOCK(sk) + r = gsk_secure_socket_open(soap->ctx, &soap->ssl); + if (r == GSK_OK) + r = gsk_attribute_set_numeric_value(soap->ssl, GSK_FD, sk); + if (r == GSK_OK) + r = gsk_attribute_set_buffer(soap->ssl, GSK_KEYRING_LABEL, soap->cafile, 0); + if (r == GSK_OK) + r = gsk_attribute_set_enum(soap->ssl, GSK_SESSION_TYPE, GSK_SERVER_SESSION); + if (r == GSK_OK) + r = gsk_attribute_set_buffer(soap->ssl, GSK_V3_CIPHER_SPECS_EXPANDED, "0035002F000A", 0); + if (r == GSK_OK) + r = gsk_attribute_set_enum(soap->ssl, GSK_V3_CIPHERS, GSK_V3_CIPHERS_CHAR4); + if (r == GSK_OK) + r = gsk_attribute_set_callback(soap->ssl, GSK_IO_CALLBACK, &local_io); + if (r != GSK_OK) + return soap_set_receiver_error(soap, gsk_strerror(r), "SYSTEM SSL error in soap_ssl_accept()", SOAP_SSL_ERROR); + while ((r = gsk_secure_socket_init(soap->ssl)) != GSK_OK) + { + if (r == GSK_WOULD_BLOCK_READ || r == GSK_WOULD_BLOCK_WRITE) + { + if (r == GSK_WOULD_BLOCK_READ) + s = tcp_select(soap, sk, SOAP_TCP_SELECT_RCV | SOAP_TCP_SELECT_ERR, -100000); + else + s = tcp_select(soap, sk, SOAP_TCP_SELECT_SND | SOAP_TCP_SELECT_ERR, -100000); + if (s < 0) + break; + } + else + { + soap->errnum = soap_socket_errno; + break; + } + if (retries-- <= 0) + break; + } + if (!soap->recv_timeout && !soap->send_timeout) + SOAP_SOCKBLOCK(sk) + if (r != GSK_OK) + { + (void)soap_set_receiver_error(soap, gsk_strerror(r), "gsk_secure_socket_init() failed in soap_ssl_accept()", SOAP_SSL_ERROR); + return soap_closesock(soap); + } +#endif + soap->imode |= SOAP_ENC_SSL; + soap->omode |= SOAP_ENC_SSL; + return SOAP_OK; +} +#endif +#endif + +/******************************************************************************\ + * + * TCP/UDP [SSL/TLS] IPv4 and IPv6 + * +\******************************************************************************/ + +#ifndef WITH_NOIO +static int +tcp_init(struct soap *soap) +{ + soap->errmode = 1; +#ifdef WIN32 + if (tcp_done) + return 0; + else + { + WSADATA w; + if (WSAStartup(MAKEWORD(1, 1), &w)) + return -1; + tcp_done = 1; + } +#endif + return 0; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_NOIO +static const char* +tcp_error(struct soap *soap) +{ + const char *msg = NULL; + switch (soap->errmode) + { + case 0: + msg = soap_strerror(soap); + break; + case 1: + msg = "WSAStartup failed"; + break; + case 2: + { +#ifndef WITH_LEAN + msg = soap_code_str(h_error_codes, soap->errnum); + if (!msg) +#endif + { + (SOAP_SNPRINTF(soap->msgbuf, sizeof(soap->msgbuf), 37), "TCP/UDP IP error %d", soap->errnum); + msg = soap->msgbuf; + } + } + } + return msg; +} +#endif + +/******************************************************************************/ + +#if !defined(WITH_IPV6) || defined(WITH_COOKIES) +#ifndef WITH_NOIO +static int +tcp_gethostbyname(struct soap *soap, const char *addr, struct hostent *hostent, struct in_addr *inaddr) +{ +#if (defined(_AIX43) || defined(TRU64) || defined(HP_UX)) && defined(HAVE_GETHOSTBYNAME_R) + struct hostent_data ht_data; +#elif (!defined(_GNU_SOURCE) || (!(~_GNU_SOURCE+1) && !defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)) || _POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600 || defined(__ANDROID__) || defined(FREEBSD) || defined(__FreeBSD__)) && defined(HAVE_GETHOSTBYNAME_R) + int r; + char *tmpbuf = soap->tmpbuf; + size_t tmplen = sizeof(soap->tmpbuf); +#elif defined(HAVE_GETHOSTBYNAME_R) + char *tmpbuf = soap->tmpbuf; + size_t tmplen = sizeof(soap->tmpbuf); +#endif +#ifdef VXWORKS + int hostint; /* vxWorks compatible */ +#endif + if (inaddr) + { + soap_int32 iadd = -1; +#ifdef AS400 + iadd = inet_addr((void*)addr); +#else + iadd = inet_addr((char*)addr); +#endif + if (iadd != -1) + { + if (soap_memcpy((void*)inaddr, sizeof(struct in_addr), (const void*)&iadd, sizeof(iadd))) + return soap->error = SOAP_EOM; + return SOAP_OK; + } + } +#if (defined(_AIX43) || defined(TRU64) || defined(HP_UX)) && defined(HAVE_GETHOSTBYNAME_R) + memset((void*)&ht_data, 0, sizeof(ht_data)); + if (gethostbyname_r(addr, hostent, &ht_data) < 0) + { + hostent = NULL; + soap->errnum = h_errno; + } +#elif (!defined(_GNU_SOURCE) || (!(~_GNU_SOURCE+1) && !defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)) || _POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600 || defined(__ANDROID__) || defined(FREEBSD) || defined(__FreeBSD__)) && !defined(SUN_OS) && !defined(__QNX__) && !defined(QNX) && defined(HAVE_GETHOSTBYNAME_R) + while ((r = gethostbyname_r(addr, hostent, tmpbuf, tmplen, &hostent, &soap->errnum)) < 0) + { + if (tmpbuf != soap->tmpbuf) + SOAP_FREE(soap, tmpbuf); + if (r != SOAP_ERANGE) + { + hostent = NULL; + break; + } + tmplen *= 2; + tmpbuf = (char*)SOAP_MALLOC(soap, tmplen); + if (!tmpbuf) + break; + } +#elif defined(HAVE_GETHOSTBYNAME_R) + hostent = gethostbyname_r(addr, hostent, tmpbuf, tmplen, &soap->errnum); +#elif defined(VXWORKS) + /* vxWorks compatible */ + /* If the DNS resolver library resolvLib has been configured in the vxWorks + * image, a query for the host IP address is sent to the DNS server, if the + * name was not found in the local host table. */ + hostint = hostGetByName((char*)addr); + if (hostint == ERROR) + { + hostent = NULL; + soap->errnum = soap_errno; + } +#else + { + struct hostent *temp; +#ifdef AS400 + temp = gethostbyname((void*)addr); +#else + temp = gethostbyname((char*)addr); +#endif + if (!temp) + { + soap->errnum = h_errno; + hostent = NULL; + } + else + { + *hostent = *temp; + } + } +#endif + if (!hostent) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Host name not found\n")); + return SOAP_ERR; + } + if (inaddr) + { +#ifdef VXWORKS + inaddr->s_addr = hostint; /* vxWorks compatible */ +#else + if (soap_memcpy((void*)inaddr, sizeof(struct in_addr), (const void*)hostent->h_addr, (size_t)hostent->h_length)) + { +#if (!defined(_AIX43) && !defined(TRU64) && !defined(HP_UX)) || !defined(HAVE_GETHOSTBYNAME_R) +#if (!defined(_GNU_SOURCE) || (!(~_GNU_SOURCE+1) && !defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)) || _POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600 || defined(__ANDROID__) || defined(FREEBSD) || defined(__FreeBSD__)) && defined(HAVE_GETHOSTBYNAME_R) + if (tmpbuf && tmpbuf != soap->tmpbuf) + SOAP_FREE(soap, tmpbuf); +#endif +#endif + return soap->error = SOAP_EOM; + } +#endif + } +#if (!defined(_GNU_SOURCE) || (!(~_GNU_SOURCE+1) && !defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)) || _POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600 || defined(__ANDROID__) || defined(FREEBSD) || defined(__FreeBSD__)) && defined(HAVE_GETHOSTBYNAME_R) + if (tmpbuf && tmpbuf != soap->tmpbuf) + SOAP_FREE(soap, tmpbuf); +#endif + return SOAP_OK; +} +#endif +#endif + +/******************************************************************************/ + +#if !defined(WITH_IPV6) +#ifndef WITH_NOIO +static int +tcp_gethost(struct soap *soap, const char *addr, struct in_addr *inaddr) +{ + struct hostent hostent; + return tcp_gethostbyname(soap, addr, &hostent, inaddr); +} +#endif +#endif + +/******************************************************************************/ + +#ifndef WITH_NOIO +static SOAP_SOCKET +tcp_connect(struct soap *soap, const char *endpoint, const char *host, int port) +{ +#ifdef WITH_IPV6 + struct addrinfo hints, *res, *ressave; +#endif + SOAP_SOCKET sk; + int err = 0; +#ifndef WITH_LEAN + int set = 1; +#endif +#if !defined(WITH_LEAN) || defined(WITH_OPENSSL) || defined(WITH_GNUTLS) || defined(WITH_WOLFSSL) || defined(WITH_SYSTEMSSL) + int retries; +#endif + soap->errnum = 0; + soap->errmode = 0; + if (soap_valid_socket(soap->socket)) + { + if ((soap->omode & SOAP_IO_UDP) && soap->socket == soap->master) + { +#ifdef IP_MULTICAST_TTL +#ifndef WITH_IPV6 + soap->errmode = 2; + if (soap->fresolve(soap, host, &soap->peer.in.sin_addr)) + { + (void)soap_set_receiver_error(soap, tcp_error(soap), "get host by name failed in tcp_connect()", SOAP_TCP_ERROR); + (void)soap->fclosesocket(soap, soap->socket); + return soap->socket = SOAP_INVALID_SOCKET; + } + soap->peer.in.sin_port = htons((short)port); + soap->peer.in.sin_family = AF_INET; + soap->errmode = 0; +#else + memset((void*)&hints, 0, sizeof(hints)); + err = getaddrinfo(host, soap_int2s(soap, port), &hints, &res); + if (err || !res) + { + (void)soap_set_receiver_error(soap, SOAP_GAI_STRERROR(err), "getaddrinfo failed in tcp_connect()", SOAP_TCP_ERROR); + (void)soap->fclosesocket(soap, soap->socket); + return soap->socket = SOAP_INVALID_SOCKET; + } + if (soap_memcpy((void*)&soap->peer.storage, sizeof(soap->peer.storage), (const void*)res->ai_addr, res->ai_addrlen)) + { + soap->error = SOAP_EOM; + (void)soap->fclosesocket(soap, soap->socket); + freeaddrinfo(res); + return soap->socket = SOAP_INVALID_SOCKET; + } + soap->peerlen = res->ai_addrlen; + freeaddrinfo(res); +#endif + if (soap->ipv4_multicast_ttl) + { + unsigned char ttl = soap->ipv4_multicast_ttl; + if (setsockopt(soap->socket, IPPROTO_IP, IP_MULTICAST_TTL, (char*)&ttl, sizeof(ttl))) + { + soap->errnum = soap_socket_errno; + (void)soap_set_receiver_error(soap, tcp_error(soap), "setsockopt IP_MULTICAST_TTL failed in tcp_connect()", SOAP_TCP_ERROR); + (void)soap->fclosesocket(soap, soap->socket); + return soap->socket = SOAP_INVALID_SOCKET; + } + } + if (soap->ipv4_multicast_if && !soap->ipv6_multicast_if) + { + if (setsockopt(soap->socket, IPPROTO_IP, IP_MULTICAST_IF, (char*)soap->ipv4_multicast_if, sizeof(struct in_addr))) + { + soap->errnum = soap_socket_errno; + (void)soap_set_receiver_error(soap, tcp_error(soap), "setsockopt IP_MULTICAST_IF failed in tcp_connect()", SOAP_TCP_ERROR); + (void)soap->fclosesocket(soap, soap->socket); + return soap->socket = SOAP_INVALID_SOCKET; + } + } +#endif + return soap->socket; + } + (void)soap->fclosesocket(soap, soap->socket); + soap->socket = SOAP_INVALID_SOCKET; + } + if (tcp_init(soap)) + { + (void)soap_set_receiver_error(soap, tcp_error(soap), "TCP init failed in tcp_connect()", SOAP_TCP_ERROR); + return SOAP_INVALID_SOCKET; + } + soap->errmode = 0; +#ifdef WITH_IPV6 + memset((void*)&hints, 0, sizeof(hints)); + hints.ai_family = PF_UNSPEC; +#ifndef WITH_LEAN + if ((soap->omode & SOAP_IO_UDP)) + hints.ai_socktype = SOCK_DGRAM; + else +#endif + hints.ai_socktype = SOCK_STREAM; + soap->errmode = 2; + if (soap->proxy_host) + err = getaddrinfo(soap->proxy_host, soap_int2s(soap, soap->proxy_port), &hints, &res); + else + err = getaddrinfo(host, soap_int2s(soap, port), &hints, &res); + if (err || !res) + { + (void)soap_set_receiver_error(soap, SOAP_GAI_STRERROR(err), "getaddrinfo failed in tcp_connect()", SOAP_TCP_ERROR); + return SOAP_INVALID_SOCKET; + } + ressave = res; +again: + sk = soap->socket = socket(res->ai_family, res->ai_socktype, res->ai_protocol); + soap->error = SOAP_OK; + soap->errmode = 0; +#else +#ifndef WITH_LEAN +again: +#endif +#ifndef WITH_LEAN + if ((soap->omode & SOAP_IO_UDP)) + sk = soap->socket = socket(AF_INET, SOCK_DGRAM, 0); + else +#endif + sk = soap->socket = socket(AF_INET, SOCK_STREAM, 0); +#endif + if (!soap_valid_socket(sk)) + { +#ifdef WITH_IPV6 + if (res->ai_next) + { + res = res->ai_next; + goto again; + } +#endif + soap->errnum = soap_socket_errno; + (void)soap_set_receiver_error(soap, tcp_error(soap), "socket failed in tcp_connect()", SOAP_TCP_ERROR); +#ifdef WITH_IPV6 + freeaddrinfo(ressave); +#endif + return SOAP_INVALID_SOCKET; + } +#ifdef WITH_SOCKET_CLOSE_ON_EXIT +#ifdef WIN32 +#ifndef UNDER_CE + SetHandleInformation((HANDLE)sk, HANDLE_FLAG_INHERIT, 0); +#endif +#else + fcntl(sk, F_SETFD, 1); +#endif +#endif +#ifndef WITH_LEAN + if ((soap->connect_flags & SO_LINGER)) + { + struct linger linger; + memset((void*)&linger, 0, sizeof(linger)); + linger.l_onoff = 1; + linger.l_linger = soap->linger_time; + if (setsockopt(sk, SOL_SOCKET, SO_LINGER, (char*)&linger, sizeof(struct linger))) + { + soap->errnum = soap_socket_errno; + (void)soap_set_receiver_error(soap, tcp_error(soap), "setsockopt SO_LINGER failed in tcp_connect()", SOAP_TCP_ERROR); + (void)soap->fclosesocket(soap, sk); +#ifdef WITH_IPV6 + freeaddrinfo(ressave); +#endif + return soap->socket = SOAP_INVALID_SOCKET; + } + } + if ((soap->connect_flags & ~SO_LINGER) && setsockopt(sk, SOL_SOCKET, soap->connect_flags & ~SO_LINGER, (char*)&set, sizeof(int))) + { + soap->errnum = soap_socket_errno; +#ifdef WITH_IPV6 + freeaddrinfo(ressave); +#endif + (void)soap_set_receiver_error(soap, tcp_error(soap), "setsockopt failed in tcp_connect()", SOAP_TCP_ERROR); + (void)soap->fclosesocket(soap, sk); + return soap->socket = SOAP_INVALID_SOCKET; + } +#ifndef UNDER_CE + if ((soap->keep_alive || soap->tcp_keep_alive) && setsockopt(sk, SOL_SOCKET, SO_KEEPALIVE, (char*)&set, sizeof(int))) + { + soap->errnum = soap_socket_errno; +#ifdef WITH_IPV6 + freeaddrinfo(ressave); +#endif + (void)soap_set_receiver_error(soap, tcp_error(soap), "setsockopt SO_KEEPALIVE failed in tcp_connect()", SOAP_TCP_ERROR); + (void)soap->fclosesocket(soap, sk); + return soap->socket = SOAP_INVALID_SOCKET; + } + if (soap->sndbuf > 0 && setsockopt(sk, SOL_SOCKET, SO_SNDBUF, (char*)&soap->sndbuf, sizeof(int))) + { + soap->errnum = soap_socket_errno; +#ifdef WITH_IPV6 + freeaddrinfo(ressave); +#endif + (void)soap_set_receiver_error(soap, tcp_error(soap), "setsockopt SO_SNDBUF failed in tcp_connect()", SOAP_TCP_ERROR); + (void)soap->fclosesocket(soap, sk); + return soap->socket = SOAP_INVALID_SOCKET; + } + if (soap->rcvbuf > 0 && setsockopt(sk, SOL_SOCKET, SO_RCVBUF, (char*)&soap->rcvbuf, sizeof(int))) + { + soap->errnum = soap_socket_errno; +#ifdef WITH_IPV6 + freeaddrinfo(ressave); +#endif + (void)soap_set_receiver_error(soap, tcp_error(soap), "setsockopt SO_RCVBUF failed in tcp_connect()", SOAP_TCP_ERROR); + (void)soap->fclosesocket(soap, sk); + return soap->socket = SOAP_INVALID_SOCKET; + } +#ifdef TCP_KEEPIDLE + if (soap->tcp_keep_idle && setsockopt(sk, IPPROTO_TCP, TCP_KEEPIDLE, (char*)&(soap->tcp_keep_idle), sizeof(int))) + { + soap->errnum = soap_socket_errno; +#ifdef WITH_IPV6 + freeaddrinfo(ressave); +#endif + (void)soap_set_receiver_error(soap, tcp_error(soap), "setsockopt TCP_KEEPIDLE failed in tcp_connect()", SOAP_TCP_ERROR); + (void)soap->fclosesocket(soap, sk); + return soap->socket = SOAP_INVALID_SOCKET; + } +#endif +#ifdef TCP_KEEPINTVL + if (soap->tcp_keep_intvl && setsockopt(sk, IPPROTO_TCP, TCP_KEEPINTVL, (char*)&(soap->tcp_keep_intvl), sizeof(int))) + { + soap->errnum = soap_socket_errno; +#ifdef WITH_IPV6 + freeaddrinfo(ressave); +#endif + (void)soap_set_receiver_error(soap, tcp_error(soap), "setsockopt TCP_KEEPINTVL failed in tcp_connect()", SOAP_TCP_ERROR); + (void)soap->fclosesocket(soap, sk); + return soap->socket = SOAP_INVALID_SOCKET; + } +#endif +#ifdef TCP_KEEPCNT + if (soap->tcp_keep_cnt && setsockopt(sk, IPPROTO_TCP, TCP_KEEPCNT, (char*)&(soap->tcp_keep_cnt), sizeof(int))) + { + soap->errnum = soap_socket_errno; +#ifdef WITH_IPV6 + freeaddrinfo(ressave); +#endif + (void)soap_set_receiver_error(soap, tcp_error(soap), "setsockopt TCP_KEEPCNT failed in tcp_connect()", SOAP_TCP_ERROR); + (void)soap->fclosesocket(soap, sk); + return soap->socket = SOAP_INVALID_SOCKET; + } +#endif +#ifdef TCP_NODELAY + if (!(soap->omode & SOAP_IO_UDP) && setsockopt(sk, IPPROTO_TCP, TCP_NODELAY, (char*)&set, sizeof(int))) + { + soap->errnum = soap_socket_errno; +#ifdef WITH_IPV6 + freeaddrinfo(ressave); +#endif + (void)soap_set_receiver_error(soap, tcp_error(soap), "setsockopt TCP_NODELAY failed in tcp_connect()", SOAP_TCP_ERROR); + (void)soap->fclosesocket(soap, sk); + return soap->socket = SOAP_INVALID_SOCKET; + } +#endif +#ifdef WITH_IPV6 + if ((soap->omode & SOAP_IO_UDP) && soap->ipv6_multicast_if) + { + struct sockaddr_in6 *in6addr = (struct sockaddr_in6*)res->ai_addr; + in6addr->sin6_scope_id = soap->ipv6_multicast_if; + } +#endif +#endif +#ifdef IP_MULTICAST_TTL + if ((soap->omode & SOAP_IO_UDP)) + { + if (soap->ipv4_multicast_ttl) + { + unsigned char ttl = soap->ipv4_multicast_ttl; + if (setsockopt(sk, IPPROTO_IP, IP_MULTICAST_TTL, (char*)&ttl, sizeof(ttl))) + { + soap->errnum = soap_socket_errno; +#ifdef WITH_IPV6 + freeaddrinfo(ressave); +#endif + (void)soap_set_receiver_error(soap, tcp_error(soap), "setsockopt IP_MULTICAST_TTL failed in tcp_connect()", SOAP_TCP_ERROR); + (void)soap->fclosesocket(soap, sk); + return soap->socket = SOAP_INVALID_SOCKET; + } + } + if (soap->ipv4_multicast_if && !soap->ipv6_multicast_if) + { + if (setsockopt(sk, IPPROTO_IP, IP_MULTICAST_IF, (char*)soap->ipv4_multicast_if, sizeof(struct in_addr))) + { + soap->errnum = soap_socket_errno; +#ifdef WITH_IPV6 + freeaddrinfo(ressave); +#endif + (void)soap_set_receiver_error(soap, tcp_error(soap), "setsockopt IP_MULTICAST_IF failed in tcp_connect()", SOAP_TCP_ERROR); + (void)soap->fclosesocket(soap, sk); + return soap->socket = SOAP_INVALID_SOCKET; + } + } + } +#endif +#endif + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Opening socket=%d to host='%s' port=%d\n", (int)sk, host, port)); +#ifndef WITH_IPV6 + soap->peerlen = sizeof(soap->peer.in); + memset((void*)&soap->peer.in, 0, sizeof(soap->peer.in)); + soap->peer.in.sin_family = AF_INET; +#ifndef WIN32 + if (soap->client_addr) + { + struct sockaddr_in addr; + memset((void*)&addr, 0, sizeof(addr)); + addr.sin_family = AF_INET; + if (soap->client_port >= 0) + addr.sin_port = htons(soap->client_port); + if (inet_pton(AF_INET, soap->client_addr, (void*)&addr.sin_addr) != 1 || bind(sk, (struct sockaddr*)&addr, sizeof(addr))) + { + soap->errnum = soap_socket_errno; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Could not bind before connect\n")); + (void)soap_set_receiver_error(soap, tcp_error(soap), "bind failed in tcp_connect()", SOAP_TCP_ERROR); + (void)soap->fclosesocket(soap, sk); + soap->client_addr = NULL; + soap->client_port = -1; + return soap->socket = SOAP_INVALID_SOCKET; + } + soap->client_addr = NULL; /* disable bind before connect, so need to set it again before the next connect */ + soap->client_port = -1; /* disable bind before connect, so need to set it again before the next connect */ + } + else +#endif + if (soap->client_port >= 0) + { + struct sockaddr_in addr; + memset((void*)&addr, 0, sizeof(addr)); + addr.sin_family = AF_INET; + addr.sin_port = htons(soap->client_port); + if (bind(sk, (struct sockaddr*)&addr, sizeof(addr))) + { + soap->errnum = soap_socket_errno; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Could not bind before connect\n")); + (void)soap_set_receiver_error(soap, tcp_error(soap), "bind failed in tcp_connect()", SOAP_TCP_ERROR); + (void)soap->fclosesocket(soap, sk); + soap->client_port = -1; + return soap->socket = SOAP_INVALID_SOCKET; + } + soap->client_port = -1; /* disable bind before connect, so need to set it again before the next connect */ + } +#ifndef WIN32 + if (soap->client_interface) + { + if (inet_pton(AF_INET, soap->client_interface, &soap->peer.in.sin_addr) != 1) + { + soap->errnum = soap_socket_errno; + (void)soap_set_receiver_error(soap, tcp_error(soap), "inet_pton() failed in tcp_connect()", SOAP_TCP_ERROR); + (void)soap->fclosesocket(soap, sk); + soap->client_interface = NULL; + return soap->socket = SOAP_INVALID_SOCKET; + } + soap->client_interface = NULL; /* disable client interface, so need to set it again before the next connect */ + } +#endif + soap->errmode = 2; + if (soap->proxy_host) + { + if (soap->fresolve(soap, soap->proxy_host, &soap->peer.in.sin_addr)) + { + (void)soap_set_receiver_error(soap, tcp_error(soap), "get proxy host by name failed in tcp_connect()", SOAP_TCP_ERROR); + (void)soap->fclosesocket(soap, sk); + return soap->socket = SOAP_INVALID_SOCKET; + } + soap->peer.in.sin_port = htons((short)soap->proxy_port); + } + else + { + if (soap->fresolve(soap, host, &soap->peer.in.sin_addr)) + { + (void)soap_set_receiver_error(soap, tcp_error(soap), "get host by name failed in tcp_connect()", SOAP_TCP_ERROR); + (void)soap->fclosesocket(soap, sk); + return soap->socket = SOAP_INVALID_SOCKET; + } + soap->peer.in.sin_port = htons((short)port); + } + soap->errmode = 0; +#ifndef WITH_LEAN + if ((soap->omode & SOAP_IO_UDP)) + return sk; +#endif +#else +#ifndef WIN32 + if (soap->client_addr) + { + struct sockaddr_in6 addr; + memset((void*)&addr, 0, sizeof(addr)); + addr.sin6_family = AF_INET6; + if ((soap->client_addr_ipv6 && res->ai_family == AF_INET6 && inet_pton(AF_INET6, soap->client_addr_ipv6, (void*)&addr.sin6_addr.s6_addr) == 1) + || (!soap->client_addr_ipv6 && inet_pton(AF_INET6, soap->client_addr, (void*)&addr.sin6_addr.s6_addr) == 1) + ) + { + if (soap->client_port >= 0) + addr.sin6_port = htons(soap->client_port); + if (bind(sk, (struct sockaddr*)&addr, sizeof(addr))) + { + soap->errnum = soap_socket_errno; + freeaddrinfo(ressave); + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Could not bind before connect\n")); + (void)soap_set_receiver_error(soap, tcp_error(soap), "bind failed in tcp_connect()", SOAP_TCP_ERROR); + (void)soap->fclosesocket(soap, sk); + soap->client_addr = NULL; + soap->client_addr_ipv6 = NULL; + soap->client_port = -1; + return soap->socket = SOAP_INVALID_SOCKET; + } + } + else /* not an IPv6 address, must be IPv4 */ + { + struct sockaddr_in addr; + memset((void*)&addr, 0, sizeof(addr)); + addr.sin_family = AF_INET; + if (soap->client_port >= 0) + addr.sin_port = htons(soap->client_port); + if (inet_pton(AF_INET, soap->client_addr, (void*)&addr.sin_addr) != 1 || bind(sk, (struct sockaddr*)&addr, sizeof(addr))) + { + soap->errnum = soap_socket_errno; + freeaddrinfo(ressave); + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Could not bind before connect\n")); + (void)soap_set_receiver_error(soap, tcp_error(soap), "bind failed in tcp_connect()", SOAP_TCP_ERROR); + (void)soap->fclosesocket(soap, sk); + soap->client_addr = NULL; + soap->client_addr_ipv6 = NULL; + soap->client_port = -1; + return soap->socket = SOAP_INVALID_SOCKET; + } + } + soap->client_addr = NULL; /* disable bind before connect, so need to set it again before the next connect */ + soap->client_addr_ipv6 = NULL; /* disable bind before connect, so need to set it again before the next connect */ + soap->client_port = -1; /* disable bind before connect, so need to set it again before the next connect */ + } + else +#endif + if (soap->client_port >= 0) + { + struct sockaddr_in6 addr; + memset((void*)&addr, 0, sizeof(addr)); + addr.sin6_family = AF_INET6; + addr.sin6_port = htons(soap->client_port); + if (bind(sk, (struct sockaddr*)&addr, sizeof(addr))) + { + soap->errnum = soap_socket_errno; + freeaddrinfo(ressave); + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Could not bind before connect\n")); + (void)soap_set_receiver_error(soap, tcp_error(soap), "bind failed in tcp_connect()", SOAP_TCP_ERROR); + (void)soap->fclosesocket(soap, sk); + soap->client_port = -1; + return soap->socket = SOAP_INVALID_SOCKET; + } + soap->client_port = -1; /* disable bind before connect, so need to set it again before the next connect */ + } +#ifndef WIN32 + if (soap->client_interface) + { + if (inet_pton(AF_INET6, soap->client_interface, res->ai_addr) != 1) + { + if (inet_pton(AF_INET, soap->client_interface, res->ai_addr) != 1) + { + soap->errnum = soap_socket_errno; + freeaddrinfo(ressave); + (void)soap_set_receiver_error(soap, tcp_error(soap), "inet_pton() failed in tcp_connect()", SOAP_TCP_ERROR); + (void)soap->fclosesocket(soap, sk); + soap->client_interface = NULL; + return soap->socket = SOAP_INVALID_SOCKET; + } + } + soap->client_interface = NULL; /* disable client interface, so need to set it again before the next connect */ + } +#endif +#ifndef WITH_LEAN + if ((soap->omode & SOAP_IO_UDP)) + { + if (soap_memcpy((void*)&soap->peer.storage, sizeof(soap->peer.storage), (const void*)res->ai_addr, res->ai_addrlen)) + { + soap->error = SOAP_EOM; + (void)soap->fclosesocket(soap, sk); + soap->socket = sk = SOAP_INVALID_SOCKET; + } + soap->peerlen = res->ai_addrlen; + freeaddrinfo(ressave); + return sk; + } +#endif +#endif +#ifndef WITH_LEAN + if (soap->connect_timeout) + SOAP_SOCKNONBLOCK(sk) + else + SOAP_SOCKBLOCK(sk) + retries = 10; +#endif + for (;;) + { +#ifdef WITH_IPV6 + if (connect(sk, res->ai_addr, (int)res->ai_addrlen)) +#else + if (connect(sk, &soap->peer.addr, sizeof(soap->peer.in))) +#endif + { + err = soap_socket_errno; +#ifdef WITH_IPV6 + if (err == SOAP_ECONNREFUSED && res->ai_next) + { + (void)soap->fclosesocket(soap, sk); + res = res->ai_next; + goto again; + } +#endif +#ifndef WITH_LEAN + if (err == SOAP_EADDRINUSE) + { + (void)soap->fclosesocket(soap, sk); + if (retries-- > 0) + goto again; + } + else if (soap->connect_timeout && (err == SOAP_EINPROGRESS || err == SOAP_EAGAIN || err == SOAP_EWOULDBLOCK)) + { + SOAP_SOCKLEN_T k; + for (;;) + { + int r; +#ifdef WITH_SELF_PIPE + r = tcp_select(soap, sk, SOAP_TCP_SELECT_SND | SOAP_TCP_SELECT_PIP, soap->connect_timeout); + if ((r & SOAP_TCP_SELECT_PIP)) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Connection closed by self pipe\n")); + (void)soap->fclosesocket(soap, sk); + return soap->socket = SOAP_INVALID_SOCKET; + } +#else + r = tcp_select(soap, sk, SOAP_TCP_SELECT_SND, soap->connect_timeout); +#endif + if (r > 0) + break; + if (!r) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Connect timeout\n")); + (void)soap_set_receiver_error(soap, "Timeout", "connect failed in tcp_connect()", SOAP_TCP_ERROR); + (void)soap->fclosesocket(soap, sk); +#ifdef WITH_IPV6 + if (res->ai_next) + { + res = res->ai_next; + goto again; + } + freeaddrinfo(ressave); +#endif + return soap->socket = SOAP_INVALID_SOCKET; + } + r = soap->errnum = soap_socket_errno; + if (r != SOAP_EINTR) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Could not connect to host\n")); + (void)soap_set_receiver_error(soap, tcp_error(soap), "connect failed in tcp_connect()", SOAP_TCP_ERROR); + (void)soap->fclosesocket(soap, sk); +#ifdef WITH_IPV6 + if (res->ai_next) + { + res = res->ai_next; + goto again; + } + freeaddrinfo(ressave); +#endif + return soap->socket = SOAP_INVALID_SOCKET; + } + } + k = (SOAP_SOCKLEN_T)sizeof(soap->errnum); + if (!getsockopt(sk, SOL_SOCKET, SO_ERROR, (char*)&soap->errnum, &k) && !soap->errnum) /* portability note: see SOAP_SOCKLEN_T definition in stdsoap2.h */ + break; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Could not connect to host\n")); + if (!soap->errnum) + soap->errnum = soap_socket_errno; + (void)soap_set_receiver_error(soap, tcp_error(soap), "connect failed in tcp_connect()", SOAP_TCP_ERROR); + (void)soap->fclosesocket(soap, sk); +#ifdef WITH_IPV6 + if (res->ai_next) + { + res = res->ai_next; + goto again; + } + freeaddrinfo(ressave); +#endif + return soap->socket = SOAP_INVALID_SOCKET; + } +#endif +#ifdef WITH_IPV6 + if (res->ai_next) + { + res = res->ai_next; + (void)soap->fclosesocket(soap, sk); + goto again; + } +#endif + if (err && err != SOAP_EINTR) + { + soap->errnum = err; +#ifdef WITH_IPV6 + freeaddrinfo(ressave); +#endif + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Could not connect to host\n")); + (void)soap_set_receiver_error(soap, tcp_error(soap), "connect failed in tcp_connect()", SOAP_TCP_ERROR); + (void)soap->fclosesocket(soap, sk); + return soap->socket = SOAP_INVALID_SOCKET; + } + } + else + { + break; + } + } +#ifdef WITH_IPV6 + soap->peerlen = 0; /* IPv6: already connected so use send() */ + freeaddrinfo(ressave); +#endif + soap->imode &= ~SOAP_ENC_SSL; + soap->omode &= ~SOAP_ENC_SSL; + if (endpoint && !soap_tag_cmp(endpoint, "https:*")) + { +#if defined(WITH_OPENSSL) || defined(WITH_GNUTLS) || defined(WITH_WOLFSSL) || defined(WITH_SYSTEMSSL) +#ifdef WITH_OPENSSL + BIO *bio; +#endif +#ifdef WITH_SYSTEMSSL + gsk_iocallback local_io = { ssl_recv, ssl_send, NULL, NULL, NULL, NULL }; +#endif + int r; + if (soap->proxy_host) + { + soap_mode m = soap->mode; /* preserve settings */ + soap_mode om = soap->omode; /* make sure we only parse HTTP */ + ULONG64 count = soap->count; /* save the content length */ + const char *http_content = soap->http_content; /* save http_content when set */ + const char *http_extra_header = soap->http_extra_header; /* save http_extra_header when set */ + const char *bearer = soap->bearer; /* save bearer when set */ + int status = soap->status; /* save the current status/command */ + int keep_alive = soap->keep_alive; /* save the KA status */ + const char *userid, *passwd; + soap->omode &= ~SOAP_ENC; /* mask IO and ENC */ + soap->omode |= SOAP_IO_BUFFER; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Connecting to %s proxy server %s for destination endpoint %s\n", soap->proxy_http_version, soap->proxy_host, endpoint)); +#ifdef WITH_NTLM + if (soap->ntlm_challenge && soap_ntlm_handshake(soap, SOAP_CONNECT, endpoint, host, port)) + { + (void)soap->fclosesocket(soap, sk); + return soap->socket = SOAP_INVALID_SOCKET; + } +#endif + if (soap_init_send(soap)) + { + (void)soap->fclosesocket(soap, sk); + return soap->socket = SOAP_INVALID_SOCKET; + } + soap->status = SOAP_CONNECT; + if (!soap->keep_alive) + soap->keep_alive = -1; /* must keep alive */ + soap->error = soap->fpost(soap, endpoint, host, port, NULL, NULL, 0); + if (soap->error || soap_end_send_flush(soap)) + { + (void)soap->fclosesocket(soap, sk); + return soap->socket = SOAP_INVALID_SOCKET; + } + soap->keep_alive = keep_alive; + soap->omode = om; + om = soap->imode; /* preserve */ + soap->imode &= ~SOAP_ENC; /* mask IO and ENC */ + userid = soap->userid; /* preserve */ + passwd = soap->passwd; /* preserve */ + soap->error = soap->fparse(soap); + if (soap->error) + { + (void)soap->fclosesocket(soap, sk); + return soap->socket = SOAP_INVALID_SOCKET; + } + soap->status = status; /* restore */ + soap->userid = userid; /* restore */ + soap->passwd = passwd; /* restore */ + soap->imode = om; /* restore */ + soap->count = count; /* restore */ + soap->http_content = http_content; /* restore */ + soap->http_extra_header = http_extra_header; /* restore */ + soap->bearer = bearer; /* restore */ + if (soap_init_send(soap)) + { + (void)soap->fclosesocket(soap, sk); + return soap->socket = SOAP_INVALID_SOCKET; + } + if (endpoint) + soap_strcpy(soap->endpoint, sizeof(soap->endpoint), endpoint); /* restore */ + soap->mode = m; + } +#ifdef WITH_OPENSSL + ERR_clear_error(); + soap->ssl_flags |= SOAP_SSL_CLIENT; + if (!soap->ctx && (soap->error = soap->fsslauth(soap)) != SOAP_OK) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "SSL required, but no ctx set\n")); + (void)soap->fclosesocket(soap, sk); + soap->error = SOAP_SSL_ERROR; + return soap->socket = SOAP_INVALID_SOCKET; + } + if (!soap->ssl) + { + soap->ssl = SSL_new(soap->ctx); + if (!soap->ssl) + { + (void)soap->fclosesocket(soap, sk); + soap->error = SOAP_SSL_ERROR; + return soap->socket = SOAP_INVALID_SOCKET; + } + } + else + { + SSL_clear(soap->ssl); + } + if (soap->session) + { + if (!strcmp(soap->session_host, host) && soap->session_port == port) + SSL_set_session(soap->ssl, soap->session); + SSL_SESSION_free(soap->session); + soap->session = NULL; + } +#if OPENSSL_VERSION_NUMBER >= 0x1000000aL + if (!(soap->ssl_flags & SOAP_SSLv3)) + { + const char *name = host; + if ((soap->ssl_flags & SOAP_SSL_SNI_HOST_CHECK)) + { + /* do not use IP address with SNI (RFC 6066), perform a host check */ + const size_t MAX_LABEL_LEN = 63; + size_t i; + size_t len = strlen(host); + size_t label_len = 0; + int ip = 1; + for (i = 0; i < len && label_len < MAX_LABEL_LEN; ++i) + { + int c = host[i]; + if (c >= '0' && c <= '9') + { + label_len += 1; + continue; + } + if (i > 0 && i < len - 1) + { + if (c == '-') + { + label_len += 1; + continue; + } + if (c == '.' && host[i + 1] != '.' && host[i - 1] != '-' && host[i + 1] != '-') + { + label_len = 0; + continue; + } + } + if (c >= '\0' && c <= '@') + { + name = NULL; + break; + } + label_len += 1; + ip = 0; + } + if (ip || label_len >= MAX_LABEL_LEN) + name = NULL; + } + if (name != NULL && !SSL_set_tlsext_host_name(soap->ssl, name)) + { + (void)soap_set_receiver_error(soap, "SSL/TLS error", "SNI failed", SOAP_SSL_ERROR); + (void)soap->fclosesocket(soap, sk); + return soap->socket = SOAP_INVALID_SOCKET; + } + } +#elif (OPENSSL_VERSION_NUMBER >= 0x0090800fL) && defined(SSL_CTRL_SET_TLSEXT_HOSTNAME) + if (!SSL_ctrl(soap->ssl, SSL_CTRL_SET_TLSEXT_HOSTNAME, TLSEXT_NAMETYPE_host_name, (void*)host)) + { + (void)soap_set_receiver_error(soap, "SSL/TLS error", "SNI failed", SOAP_SSL_ERROR); + (void)soap->fclosesocket(soap, sk); + return soap->socket = SOAP_INVALID_SOCKET; + } +#endif + bio = BIO_new_socket((int)sk, BIO_NOCLOSE); + SSL_set_bio(soap->ssl, bio, bio); + if (soap->connect_timeout || soap->recv_timeout || soap->send_timeout) + { + /* Set SSL connect timeout and set SSL sockets to non-blocking */ + int t = soap->recv_timeout > soap->send_timeout ? soap->recv_timeout : soap->send_timeout; + if (soap->connect_timeout > 0 && t < soap->connect_timeout) + t = soap->connect_timeout; + if (t > 0) + retries = 10 * t; + else if (t > -100000) + retries = 1; + else + retries = t/-100000; + SOAP_SOCKNONBLOCK(sk) + } + else + { + /* Set sockets to blocking */ + retries = 1; + SOAP_SOCKBLOCK(sk) + } + err = SSL_ERROR_NONE; + /* Try connecting until success or timeout */ + do + { + if ((r = SSL_connect(soap->ssl)) <= 0) + { + err = SSL_get_error(soap->ssl, r); + if (err == SSL_ERROR_WANT_CONNECT || err == SSL_ERROR_WANT_READ || err == SSL_ERROR_WANT_WRITE) + { + int s; + if (err == SSL_ERROR_WANT_READ) + s = tcp_select(soap, sk, SOAP_TCP_SELECT_RCV | SOAP_TCP_SELECT_ERR, -100000); + else + s = tcp_select(soap, sk, SOAP_TCP_SELECT_SND | SOAP_TCP_SELECT_ERR, -100000); + if (s < 0) + break; + if (s == 0 && retries-- <= 0) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "SSL/TLS connect timeout\n")); + (void)soap_set_receiver_error(soap, "Timeout", "SSL_connect() failed in tcp_connect()", SOAP_TCP_ERROR); + (void)soap->fclosesocket(soap, sk); + return soap->socket = SOAP_INVALID_SOCKET; + } + } + else + { + soap->errnum = soap_socket_errno; + break; + } + } + } while (!SSL_is_init_finished(soap->ssl)); + if (r <= 0) + { + (void)soap_set_sender_error(soap, soap_ssl_error(soap, r, err), "SSL/TLS handshake failed", SOAP_SSL_ERROR); + (void)soap->fclosesocket(soap, sk); + return soap->socket = SOAP_INVALID_SOCKET; + } + /* Check server credentials when required */ + if ((soap->ssl_flags & SOAP_SSL_REQUIRE_SERVER_AUTHENTICATION)) + { + if ((err = SSL_get_verify_result(soap->ssl)) != X509_V_OK) + { + (void)soap_set_sender_error(soap, X509_verify_cert_error_string(err), "SSL/TLS certificate presented by peer cannot be verified in tcp_connect()", SOAP_SSL_ERROR); + (void)soap->fclosesocket(soap, sk); + return soap->socket = SOAP_INVALID_SOCKET; + } + if (!(soap->ssl_flags & SOAP_SSL_SKIP_HOST_CHECK)) + { + X509_NAME *subj; + STACK_OF(CONF_VALUE) *val = NULL; +#if OPENSSL_VERSION_NUMBER >= 0x0090800fL + GENERAL_NAMES *names = NULL; +#else + int ext_count; +#endif + int ok = 0; + X509 *peer = SSL_get_peer_certificate(soap->ssl); + if (!peer) + { + (void)soap_set_sender_error(soap, "SSL/TLS error", "No SSL/TLS certificate was presented by the peer in tcp_connect()", SOAP_SSL_ERROR); + (void)soap->fclosesocket(soap, sk); + return soap->socket = SOAP_INVALID_SOCKET; + } +#if OPENSSL_VERSION_NUMBER < 0x0090800fL + ext_count = X509_get_ext_count(peer); + if (ext_count > 0) + { + int i; + for (i = 0; i < ext_count; i++) + { + X509_EXTENSION *ext = X509_get_ext(peer, i); + const char *ext_str = OBJ_nid2sn(OBJ_obj2nid(X509_EXTENSION_get_object(ext))); + if (ext_str && !strcmp(ext_str, "subjectAltName")) + { + X509V3_EXT_METHOD *meth = (X509V3_EXT_METHOD*)X509V3_EXT_get(ext); + unsigned char *data; + if (!meth) + break; + data = ext->value->data; + if (data) + { +#if OPENSSL_VERSION_NUMBER > 0x00907000L + void *ext_data; + if (meth->it) + ext_data = ASN1_item_d2i(NULL, &data, ext->value->length, ASN1_ITEM_ptr(meth->it)); + else + { +#if OPENSSL_VERSION_NUMBER > 0x0090800fL + ext_data = meth->d2i(NULL, (const unsigned char **)&data, ext->value->length); +#else + ext_data = meth->d2i(NULL, &data, ext->value->length); +#endif + } + if (ext_data) + val = meth->i2v(meth, ext_data, NULL); + else + val = NULL; + if (meth->it) + ASN1_item_free((ASN1_VALUE*)ext_data, ASN1_ITEM_ptr(meth->it)); + else + meth->ext_free(ext_data); +#else + void *ext_data = meth->d2i(NULL, &data, ext->value->length); + if (ext_data) + val = meth->i2v(meth, ext_data, NULL); + meth->ext_free(ext_data); +#endif + if (val) + { + int j; + for (j = 0; j < sk_CONF_VALUE_num(val); j++) + { + CONF_VALUE *nval = sk_CONF_VALUE_value(val, j); + if (nval && nval->name && && (!strcmp(nval->name, "DNS") || !strcmp(nval->name, "IP Address")) && !soap_tag_cmp(host, nval->value)) + { + ok = 1; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "SSL: host name %s match with certificate %s %s\n", host, nval->name, nval->value)); + break; + } + else + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "SSL: host name %s mismatch with certificate %s %s\n", host, nval->name, nval->value)); + } + } + sk_CONF_VALUE_pop_free(val, X509V3_conf_free); + } + } + } + if (ok) + break; + } + } +#else + names = (GENERAL_NAMES*)X509_get_ext_d2i(peer, NID_subject_alt_name, NULL, NULL); + if (names) + { + val = i2v_GENERAL_NAMES(NULL, names, val); + sk_GENERAL_NAME_pop_free(names, GENERAL_NAME_free); + } + if (val) + { + int j; + for (j = 0; j < sk_CONF_VALUE_num(val); j++) + { + CONF_VALUE *nval = sk_CONF_VALUE_value(val, j); + if (nval && nval->name && (!strcmp(nval->name, "DNS") || !strcmp(nval->name, "IP Address")) && !soap_tag_cmp(host, nval->value)) + { + ok = 1; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "SSL: host name %s match with certificate %s %s\n", host, nval->name, nval->value)); + break; + } + else + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "SSL: host name %s mismatch with certificate %s %s\n", host, nval->name, nval->value)); + } + } + sk_CONF_VALUE_pop_free(val, X509V3_conf_free); + } +#endif + if (!ok && (subj = X509_get_subject_name(peer)) != 0) + { + int i = -1; + do + { + ASN1_STRING *name; + i = X509_NAME_get_index_by_NID(subj, NID_commonName, i); + if (i == -1) + break; + name = X509_NAME_ENTRY_get_data(X509_NAME_get_entry(subj, i)); + if (name) + { +#if OPENSSL_VERSION_NUMBER < 0x10100000L + const char *tmp = (const char*)ASN1_STRING_data(name); +#else + const char *tmp = (const char*)ASN1_STRING_get0_data(name); +#endif + if (!soap_tag_cmp(host, tmp)) + { + ok = 1; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "SSL: host name %s match with certificate subject %s\n", host, tmp)); + } + else + { + unsigned char *tmp = NULL; + ASN1_STRING_to_UTF8(&tmp, name); + if (tmp) + { + if (!soap_tag_cmp(host, (const char*)tmp)) + { + ok = 1; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "SSL: host name %s match with certificate subject %s\n", host, tmp)); + } + else if (tmp[0] == '*') /* wildcard domain */ + { + const char *t = strchr(host, '.'); + if (t && !soap_tag_cmp(t, (const char*)tmp + 1)) + { + ok = 1; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "SSL: host name %s match with certificate subject %s\n", host, tmp)); + } + } + else + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "SSL: host name %s mismatch with certificate %s\n", host, tmp)); + } + OPENSSL_free(tmp); + } + } + } + } while (!ok); + } + X509_free(peer); + if (!ok) + { + (void)soap_set_sender_error(soap, "SSL/TLS error", "SSL/TLS certificate host name mismatch in tcp_connect()", SOAP_SSL_ERROR); + (void)soap->fclosesocket(soap, sk); + return soap->socket = SOAP_INVALID_SOCKET; + } + } + } +#endif +#ifdef WITH_GNUTLS + soap->ssl_flags |= SOAP_SSL_CLIENT; + if (!soap->session && (soap->error = soap->fsslauth(soap)) != SOAP_OK) + { + (void)soap->fclosesocket(soap, sk); + return soap->socket = SOAP_INVALID_SOCKET; + } + gnutls_transport_set_ptr(soap->session, (gnutls_transport_ptr_t)(long)sk); + if (soap->connect_timeout || soap->recv_timeout || soap->send_timeout) + { + /* Set SSL connect timeout and set SSL sockets to non-blocking */ + int t = soap->recv_timeout > soap->send_timeout ? soap->recv_timeout : soap->send_timeout; + if (soap->connect_timeout > 0 && t < soap->connect_timeout) + t = soap->connect_timeout; + if (t > 0) + retries = 10 * t; + else if (t > -100000) + retries = 1; + else + retries = t/-100000; + SOAP_SOCKNONBLOCK(sk) + } + else + { + /* Set sockets to blocking */ + retries = 1; + SOAP_SOCKBLOCK(sk) + } + /* Try connecting until success or timeout */ + while ((r = gnutls_handshake(soap->session))) + { + /* GNUTLS repeat handhake when GNUTLS_E_AGAIN */ + if (r == GNUTLS_E_AGAIN || r == GNUTLS_E_INTERRUPTED) + { + int s; + if (!gnutls_record_get_direction(soap->session)) + s = tcp_select(soap, sk, SOAP_TCP_SELECT_RCV | SOAP_TCP_SELECT_ERR, -100000); + else + s = tcp_select(soap, sk, SOAP_TCP_SELECT_SND | SOAP_TCP_SELECT_ERR, -100000); + if (s < 0) + break; + if (s == 0 && retries-- <= 0) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "SSL/TLS connect timeout\n")); + (void)soap_set_receiver_error(soap, "Timeout", "SSL_connect() failed in tcp_connect()", SOAP_TCP_ERROR); + (void)soap->fclosesocket(soap, sk); + return soap->socket = SOAP_INVALID_SOCKET; + } + } + else + { + soap->errnum = soap_socket_errno; + break; + } + } + if (r) + { + (void)soap_set_sender_error(soap, soap_ssl_error(soap, r, 0), "SSL/TLS handshake failed", SOAP_SSL_ERROR); + (void)soap->fclosesocket(soap, sk); + return soap->socket = SOAP_INVALID_SOCKET; + } + if ((soap->ssl_flags & SOAP_SSL_REQUIRE_SERVER_AUTHENTICATION)) + { + const char *s = ssl_verify(soap, host); + if (s) + { + (void)soap->fclosesocket(soap, sk); + soap->error = soap_set_sender_error(soap, "SSL/TLS verify error", s, SOAP_SSL_ERROR); + return soap->socket = SOAP_INVALID_SOCKET; + } + } +#endif +#ifdef WITH_WOLFSSL + soap->ssl_flags |= SOAP_SSL_CLIENT; + if (!soap->session && (soap->error = soap->fsslauth(soap)) != SOAP_OK) + { + (void)soap->fclosesocket(soap, sk); + return soap->socket = SOAP_INVALID_SOCKET; + } + if (!soap->ssl) + { + soap->ssl = wolfSSL_new(soap->ctx); + if (!soap->ssl) + { + (void)soap->fclosesocket(soap, sk); + soap->error = SOAP_SSL_ERROR; + return soap->socket = SOAP_INVALID_SOCKET; + } +#ifdef HAVE_SECURE_RENEGOTIATION +#warning "Client-side secure renegotiation not recommended, undefine HAVE_SECURE_RENEGOTIATION to disable" + if (wolfSSL_UseSecureRenegotiation(soap->ssl) != SSL_SUCCESS) + { + (void)soap->fclosesocket(soap, sk); + (void)soap_set_receiver_error(soap, "SSL/TLS error", "failed to enable secure renegotiation in soap_ssl_accept()", SOAP_SSL_ERROR); + wolfSSL_free(soap->ssl); + soap->ssl = NULL; + return soap->socket = SOAP_INVALID_SOCKET; + } +#endif + /* Set the expected domain name so that the peer server's can be verified when we connect. */ + if (!(soap->ssl_flags & SOAP_SSL_SKIP_HOST_CHECK)) + { + if (wolfSSL_check_domain_name(soap->ssl, host) != SSL_SUCCESS) + { + (void)soap->fclosesocket(soap, sk); + (void)soap_set_receiver_error(soap, "SSL/TLS error", "wolfSSL_check_domain_name() failed in tcp_connect()", SOAP_TCP_ERROR); + wolfSSL_free(soap->ssl); + soap->ssl = NULL; + return soap->socket = SOAP_INVALID_SOCKET; + } + } + } + wolfSSL_set_fd(soap->ssl, sk); + if (soap->connect_timeout || soap->recv_timeout || soap->send_timeout) + { + /* Set SSL connect timeout and set SSL sockets to non-blocking */ + int t = soap->recv_timeout > soap->send_timeout ? soap->recv_timeout : soap->send_timeout; + if (soap->connect_timeout > 0 && t < soap->connect_timeout) + t = soap->connect_timeout; + if (t > 0) + retries = 10 * t; + else if (t > -100000) + retries = 1; + else + retries = t/-100000; + SOAP_SOCKNONBLOCK(sk) + } + else + { + /* Set sockets to blocking */ + retries = 1; + SOAP_SOCKBLOCK(sk) + } + err = SSL_ERROR_NONE; + /* Try connecting until success or timeout */ + do + { + if ((r = wolfSSL_connect(soap->ssl)) <= 0) + { + err = wolfSSL_get_error(soap->ssl, r); + if (err == SSL_ERROR_WANT_CONNECT || err == SSL_ERROR_WANT_READ || err == SSL_ERROR_WANT_WRITE) + { + int s; + if (err == SSL_ERROR_WANT_READ) + s = tcp_select(soap, sk, SOAP_TCP_SELECT_RCV | SOAP_TCP_SELECT_ERR, -100000); + else + s = tcp_select(soap, sk, SOAP_TCP_SELECT_SND | SOAP_TCP_SELECT_ERR, -100000); + if (s < 0) + break; + if (s == 0 && retries-- <= 0) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "SSL/TLS connect timeout\n")); + (void)soap_set_receiver_error(soap, "Timeout", "wolfSSL_connect() failed in tcp_connect()", SOAP_TCP_ERROR); + (void)soap->fclosesocket(soap, sk); + return soap->socket = SOAP_INVALID_SOCKET; + } + } + else + { + soap->errnum = soap_socket_errno; + break; + } + } + } while (!wolfSSL_is_init_finished(soap->ssl)); + if (r != SSL_SUCCESS) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "SSL_connect/select error in tcp_connect\n")); + (void)soap_set_receiver_error(soap, soap_ssl_error(soap, r, 0), "SSL/TLS handshake failed", SOAP_SSL_ERROR); + (void)soap->fclosesocket(soap, sk); + return soap->socket = SOAP_INVALID_SOCKET; + } +#endif +#ifdef WITH_SYSTEMSSL + soap->ssl_flags |= SOAP_SSL_CLIENT; + if (!soap->ctx && (soap->error = soap->fsslauth(soap)) != SOAP_OK) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "SSL required, but no ctx set\n")); + (void)soap->fclosesocket(soap, sk); + soap->error = SOAP_SSL_ERROR; + return soap->socket = SOAP_INVALID_SOCKET; + } + if (soap->connect_timeout || soap->recv_timeout || soap->send_timeout) + { + /* Set SSL connect timeout and set SSL sockets to non-blocking */ + int t = soap->recv_timeout > soap->send_timeout ? soap->recv_timeout : soap->send_timeout; + if (soap->connect_timeout > 0 && t < soap->connect_timeout) + t = soap->connect_timeout; + if (t > 0) + retries = 10 * t; + else if (t > -100000) + retries = 1; + else + retries = t/-100000; + SOAP_SOCKNONBLOCK(sk) + } + else + { + /* Set sockets to blocking */ + retries = 1; + SOAP_SOCKBLOCK(sk) + } + r = gsk_secure_socket_open(soap->ctx, &soap->ssl); + if (r == GSK_OK) + r = gsk_attribute_set_numeric_value(soap->ssl, GSK_FD, sk); + if (r == GSK_OK) + r = gsk_attribute_set_buffer(soap->ssl, GSK_KEYRING_LABEL, soap->cafile, 0); /* Certificate label */ + if (r == GSK_OK) + r = gsk_attribute_set_enum(soap->ssl, GSK_SESSION_TYPE, GSK_CLIENT_SESSION); + if (r == GSK_OK) + r = gsk_attribute_set_buffer(soap->ssl, GSK_V3_CIPHER_SPECS_EXPANDED, "0035002F000A", 0); + if (r == GSK_OK) + r = gsk_attribute_set_enum(soap->ssl, GSK_V3_CIPHERS, GSK_V3_CIPHERS_CHAR4); + if (r == GSK_OK) + r = gsk_attribute_set_callback(soap->ssl, GSK_IO_CALLBACK, &local_io); + if (r != GSK_OK) + { + (void)soap_set_receiver_error(soap, gsk_strerror(r), "SYSTEM SSL error in tcp_connect()", SOAP_SSL_ERROR); + return soap->socket = SOAP_INVALID_SOCKET; + } + /* Try connecting until success or timeout */ + while ((r = gsk_secure_socket_init(soap->ssl)) != GSK_OK) + { + if (r == GSK_WOULD_BLOCK_READ || r == GSK_WOULD_BLOCK_WRITE) + { + int s; + if (r == GSK_WOULD_BLOCK_READ) + s = tcp_select(soap, sk, SOAP_TCP_SELECT_RCV | SOAP_TCP_SELECT_ERR, -100000); + else + s = tcp_select(soap, sk, SOAP_TCP_SELECT_SND | SOAP_TCP_SELECT_ERR, -100000); + if (s < 0) + break; + if (s == 0 && retries-- <= 0) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "SSL/TLS connect timeout\n")); + (void)soap_set_receiver_error(soap, "Timeout", "SSL_connect() failed in tcp_connect()", SOAP_TCP_ERROR); + (void)soap->fclosesocket(soap, sk); + return soap->socket = SOAP_INVALID_SOCKET; + } + } + else + { + soap->errnum = soap_socket_errno; + break; + } + } + if (r != GSK_OK) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "SSL_connect/select error in tcp_connect\n")); + (void)soap_set_receiver_error(soap, gsk_strerror(r), "SSL/TLS handshake failed", SOAP_SSL_ERROR); + (void)soap->fclosesocket(soap, sk); + return soap->socket = SOAP_INVALID_SOCKET; + } +#endif + soap->imode |= SOAP_ENC_SSL; + soap->omode |= SOAP_ENC_SSL; +#else + (void)soap->fclosesocket(soap, sk); + soap->error = SOAP_SSL_ERROR; + return soap->socket = SOAP_INVALID_SOCKET; +#endif + } + if (soap->recv_timeout || soap->send_timeout) + SOAP_SOCKNONBLOCK(sk) + else + SOAP_SOCKBLOCK(sk) + return sk; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_NOIO +static int +tcp_select(struct soap *soap, SOAP_SOCKET sk, int flags, int timeout) +{ + int r; + struct timeval tv; + fd_set fd[3], *rfd, *sfd, *efd; + int retries = 0; + int eintr = SOAP_MAXEINTR; + soap->errnum = 0; + if (!soap_valid_socket(sk)) + { + soap->error = SOAP_EOF; + return -1; + } +#ifndef WIN32 +#if !defined(FD_SETSIZE) || defined(__QNX__) || defined(QNX) + /* no FD_SETSIZE or select() is not MT safe on some QNX: always poll */ + if (1) +#else + /* if fd max set size exceeded, use poll() when available */ + if ((int)sk >= (int)FD_SETSIZE) +#endif +#ifdef HAVE_POLL + { +#ifdef WITH_SELF_PIPE + struct pollfd pollfd[2]; + pollfd[1].fd = soap->pipe_fd[0]; + pollfd[1].events = POLLIN; +#else + struct pollfd pollfd[1]; +#endif + pollfd[0].fd = (int)sk; + pollfd[0].events = 0; + if ((flags & SOAP_TCP_SELECT_RCV)) + pollfd[0].events |= POLLIN; + if ((flags & SOAP_TCP_SELECT_SND)) + pollfd[0].events |= POLLOUT; + if ((flags & SOAP_TCP_SELECT_ERR)) + pollfd[0].events |= POLLERR; + if (timeout <= 0) + timeout /= -1000; /* -usec -> ms */ + else + { + retries = timeout - 1; + timeout = 1000; + } + do + { +#ifdef WITH_SELF_PIPE + r = poll(pollfd, 2, timeout); +#else + r = poll(pollfd, 1, timeout); +#endif + if (r < 0 && (soap->errnum = soap_socket_errno) == SOAP_EINTR && eintr > 0) + { + eintr--; + r = 0; + } + else if (retries-- <= 0) + { + break; + } + } while (r == 0); + if (r > 0) + { + r = 0; + if ((flags & SOAP_TCP_SELECT_RCV) && (pollfd[0].revents & POLLIN)) + r |= SOAP_TCP_SELECT_RCV; + if ((flags & SOAP_TCP_SELECT_SND) && (pollfd[0].revents & POLLOUT)) + r |= SOAP_TCP_SELECT_SND; + if ((flags & SOAP_TCP_SELECT_ERR) && (pollfd[0].revents & POLLERR)) + r |= SOAP_TCP_SELECT_ERR; +#ifdef WITH_SELF_PIPE + if ((flags & SOAP_TCP_SELECT_PIP) && (pollfd[1].revents & POLLIN)) + { + char ch; + for (;;) + { + if (read(soap->pipe_fd[0], &ch, 1) == -1) + { + if (soap_socket_errno == SOAP_EAGAIN) + break; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Self pipe read error\n")); + return -1; + } + } + r |= SOAP_TCP_SELECT_PIP; + } +#endif + } + else if (r == 0) + { + soap->errnum = 0; + } + return r; + } +#else + { + soap->error = SOAP_FD_EXCEEDED; + return -1; + } +#endif +#endif + if (timeout > 0) + retries = timeout - 1; + do + { + rfd = sfd = efd = NULL; +#ifdef WITH_SELF_PIPE + if ((flags & SOAP_TCP_SELECT_PIP) || (flags & SOAP_TCP_SELECT_RCV)) + { + rfd = &fd[0]; + FD_ZERO(rfd); + if ((flags & SOAP_TCP_SELECT_PIP)) + FD_SET(soap->pipe_fd[0], rfd); + if ((flags & SOAP_TCP_SELECT_RCV)) + FD_SET(sk, rfd); + } +#else + if ((flags & SOAP_TCP_SELECT_RCV)) + { + rfd = &fd[0]; + FD_ZERO(rfd); + FD_SET(sk, rfd); + } +#endif + if ((flags & SOAP_TCP_SELECT_SND)) + { + sfd = &fd[1]; + FD_ZERO(sfd); + FD_SET(sk, sfd); + } + if ((flags & SOAP_TCP_SELECT_ERR)) + { + efd = &fd[2]; + FD_ZERO(efd); + FD_SET(sk, efd); + } + if (timeout <= 0) + { + tv.tv_sec = -timeout / 1000000; + tv.tv_usec = -timeout % 1000000; + } + else + { + tv.tv_sec = 1; + tv.tv_usec = 0; + } +#ifdef WITH_SELF_PIPE + r = select((int)(sk > soap->pipe_fd[0] ? sk : soap->pipe_fd[0]) + 1, rfd, sfd, efd, &tv); +#else + r = select((int)sk + 1, rfd, sfd, efd, &tv); +#endif + if (r < 0 && (soap->errnum = soap_socket_errno) == SOAP_EINTR && eintr > 0) + { + eintr--; + r = 0; + } + else if (retries-- <= 0) + { + break; + } + } while (r == 0); + if (r > 0) + { + r = 0; + if ((flags & SOAP_TCP_SELECT_RCV) && FD_ISSET(sk, rfd)) + r |= SOAP_TCP_SELECT_RCV; + if ((flags & SOAP_TCP_SELECT_SND) && FD_ISSET(sk, sfd)) + r |= SOAP_TCP_SELECT_SND; + if ((flags & SOAP_TCP_SELECT_ERR) && FD_ISSET(sk, efd)) + r |= SOAP_TCP_SELECT_ERR; +#ifdef WITH_SELF_PIPE + if ((flags & SOAP_TCP_SELECT_PIP) && FD_ISSET(soap->pipe_fd[0], rfd)) + { + char ch; + for (;;) + { + if (read(soap->pipe_fd[0], &ch, 1) == -1) + { + if (soap_socket_errno == SOAP_EAGAIN) + break; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Self pipe read error\n")); + return -1; + } + } + r |= SOAP_TCP_SELECT_PIP; + } +#endif + } + else if (r == 0) + { + soap->errnum = 0; + } + return r; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_NOIO +static SOAP_SOCKET +tcp_accept(struct soap *soap, SOAP_SOCKET sk, struct sockaddr *addr, int *len) +{ + SOAP_SOCKET s; + (void)soap; + s = accept(sk, addr, (SOAP_SOCKLEN_T*)len); /* portability note: see SOAP_SOCKLEN_T definition in stdsoap2.h */ +#ifdef WITH_SOCKET_CLOSE_ON_EXIT +#ifdef WIN32 +#ifndef UNDER_CE + SetHandleInformation((HANDLE)s, HANDLE_FLAG_INHERIT, 0); +#endif +#else + fcntl(s, F_SETFD, FD_CLOEXEC); +#endif +#endif + return s; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_NOIO +static int +tcp_disconnect(struct soap *soap) +{ +#ifdef WITH_OPENSSL + if (soap->ssl) + { + int r; + if (soap->session) + { + SSL_SESSION_free(soap->session); + soap->session = NULL; + } + if (*soap->host) + { + soap->session = SSL_get1_session(soap->ssl); + if (soap->session) + { + soap_strcpy(soap->session_host, sizeof(soap->session_host), soap->host); + soap->session_port = soap->port; + } + } + if (soap_valid_socket(soap->socket)) + { + r = SSL_shutdown(soap->ssl); + /* SSL shutdown does not work when reads are pending, non-blocking */ + if (r == 0) + { + while (SSL_want_read(soap->ssl)) + { + if (SSL_read(soap->ssl, NULL, 0) + || soap_socket_errno != SOAP_EAGAIN) + { + r = SSL_shutdown(soap->ssl); + break; + } + } + } + if (r == 0 && !soap->fshutdownsocket(soap, soap->socket, SOAP_SHUT_WR)) + { +#if !defined(WITH_LEAN) && !defined(WIN32) + /* + wait up to 5 seconds for close_notify to be sent by peer (if peer not + present, this avoids calling SSL_shutdown() which has a lengthy return + timeout) + */ + r = tcp_select(soap, soap->socket, SOAP_TCP_SELECT_RCV | SOAP_TCP_SELECT_ERR, 5); + if (r <= 0) + { + soap->errnum = 0; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Connection lost...\n")); + (void)soap->fclosesocket(soap, soap->socket); + soap->socket = SOAP_INVALID_SOCKET; + ERR_clear_error(); + SSL_free(soap->ssl); + soap->ssl = NULL; + return SOAP_OK; + } +#ifdef WITH_SSL_FULL_SHUTDOWN + if (!SSL_want_read(soap->ssl) || SSL_read(soap->ssl, NULL, 0)) + { + r = SSL_shutdown(soap->ssl); + if (r <= 0) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Shutdown failed: %d\n", SSL_get_error(soap->ssl, r))); + if (soap_valid_socket(soap->socket) && !(soap->omode & SOAP_IO_UDP)) + { + (void)soap->fclosesocket(soap, soap->socket); + soap->socket = SOAP_INVALID_SOCKET; + } + } + } +#endif +#else + r = SSL_shutdown(soap->ssl); + if (r <= 0) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Shutdown failed: %d\n", SSL_get_error(soap->ssl, r))); + if (soap_valid_socket(soap->socket) && !(soap->omode & SOAP_IO_UDP)) + { + (void)soap->fclosesocket(soap, soap->socket); + soap->socket = SOAP_INVALID_SOCKET; + } + } +#endif + } + } + SSL_free(soap->ssl); + soap->ssl = NULL; + ERR_clear_error(); + } +#endif +#ifdef WITH_GNUTLS + if (soap->session) + { + gnutls_bye(soap->session, GNUTLS_SHUT_RDWR); + gnutls_deinit(soap->session); + soap->session = NULL; + } +#endif +#ifdef WITH_WOLFSSL + if (soap->ssl) + { + wolfSSL_free(soap->ssl); + soap->ssl = NULL; + } +#endif +#ifdef WITH_SYSTEMSSL + if (soap->ssl) + { + gsk_secure_socket_shutdown(soap->ssl); + gsk_secure_socket_close(&soap->ssl); + } +#endif + if (soap_valid_socket(soap->socket) && !(soap->omode & SOAP_IO_UDP)) + { + (void)soap->fshutdownsocket(soap, soap->socket, SOAP_SHUT_RDWR); + (void)soap->fclosesocket(soap, soap->socket); + soap->socket = SOAP_INVALID_SOCKET; + } + return SOAP_OK; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_NOIO +static int +tcp_closesocket(struct soap *soap, SOAP_SOCKET sk) +{ + (void)soap; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Close socket=%d\n", (int)sk)); + return soap_closesocket(sk); +} +#endif + +/******************************************************************************/ + +#ifndef WITH_NOIO +static int +tcp_shutdownsocket(struct soap *soap, SOAP_SOCKET sk, int how) +{ + (void)soap; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Shutdown socket=%d how=%d\n", (int)sk, how)); + return shutdown(sk, how); +} +#endif + +/******************************************************************************/ + +#ifndef WITH_NOIO +SOAP_FMAC1 +SOAP_SOCKET +SOAP_FMAC2 +soap_bind(struct soap *soap, const char *host, int port, int backlog) +{ +#if defined(WITH_IPV6) + struct addrinfo *addrinfo = NULL; + struct addrinfo hints; + struct addrinfo res; + int err; + int set = 1; + int unset = 0; +#elif !defined(WITH_LEAN) + int set = 1; +#endif + if (soap_valid_socket(soap->master)) + { + (void)soap->fclosesocket(soap, soap->master); + soap->master = SOAP_INVALID_SOCKET; + } + soap->socket = SOAP_INVALID_SOCKET; + soap->errnum = 0; + soap->errmode = 1; + if (tcp_init(soap)) + { + (void)soap_set_receiver_error(soap, tcp_error(soap), "TCP init failed in soap_bind()", SOAP_TCP_ERROR); + return SOAP_INVALID_SOCKET; + } +#ifdef WITH_IPV6 + memset((void*)&hints, 0, sizeof(hints)); + hints.ai_family = soap->bind_inet6 ? AF_INET6 : PF_UNSPEC; +#ifndef WITH_LEAN + if ((soap->omode & SOAP_IO_UDP)) + hints.ai_socktype = SOCK_DGRAM; + else +#endif + hints.ai_socktype = SOCK_STREAM; + hints.ai_flags = AI_PASSIVE; + soap->errmode = 2; + err = getaddrinfo(host, soap_int2s(soap, port), &hints, &addrinfo); + if (err || !addrinfo) + { + (void)soap_set_receiver_error(soap, SOAP_GAI_STRERROR(err), "getaddrinfo failed in soap_bind()", SOAP_TCP_ERROR); + if (addrinfo) + freeaddrinfo(addrinfo); + return SOAP_INVALID_SOCKET; + } + res = *addrinfo; + if (soap_memcpy((void*)&soap->peer.storage, sizeof(soap->peer.storage), (const void*)addrinfo->ai_addr, addrinfo->ai_addrlen)) + { + freeaddrinfo(addrinfo); + soap->error = SOAP_EOM; + return SOAP_INVALID_SOCKET; + } + soap->peerlen = addrinfo->ai_addrlen; + res.ai_addr = &soap->peer.addr; + res.ai_addrlen = soap->peerlen; + freeaddrinfo(addrinfo); + soap->master = (int)socket(res.ai_family, res.ai_socktype, res.ai_protocol); +#else +#ifndef WITH_LEAN + if ((soap->omode & SOAP_IO_UDP)) + soap->master = (int)socket(AF_INET, SOCK_DGRAM, 0); + else +#endif + soap->master = (int)socket(AF_INET, SOCK_STREAM, 0); +#endif + soap->errmode = 0; + if (!soap_valid_socket(soap->master)) + { + soap->errnum = soap_socket_errno; + (void)soap_set_receiver_error(soap, tcp_error(soap), "socket failed in soap_bind()", SOAP_TCP_ERROR); + return SOAP_INVALID_SOCKET; + } + soap->port = port; +#ifndef WITH_LEAN + if ((soap->omode & SOAP_IO_UDP)) + soap->socket = soap->master; +#endif +#ifdef WITH_SOCKET_CLOSE_ON_EXIT +#ifdef WIN32 +#ifndef UNDER_CE + SetHandleInformation((HANDLE)soap->master, HANDLE_FLAG_INHERIT, 0); +#endif +#else + fcntl(soap->master, F_SETFD, 1); +#endif +#endif +#ifndef WITH_LEAN + if (soap->bind_flags && setsockopt(soap->master, SOL_SOCKET, soap->bind_flags, (char*)&set, sizeof(int))) + { + soap->errnum = soap_socket_errno; + (void)soap_set_receiver_error(soap, tcp_error(soap), "setsockopt failed in soap_bind()", SOAP_TCP_ERROR); + return SOAP_INVALID_SOCKET; + } +#ifndef UNDER_CE + if (((soap->imode | soap->omode) & SOAP_IO_KEEPALIVE) && (!((soap->imode | soap->omode) & SOAP_IO_UDP)) && setsockopt(soap->master, SOL_SOCKET, SO_KEEPALIVE, (char*)&set, sizeof(int))) + { + soap->errnum = soap_socket_errno; + (void)soap_set_receiver_error(soap, tcp_error(soap), "setsockopt SO_KEEPALIVE failed in soap_bind()", SOAP_TCP_ERROR); + return SOAP_INVALID_SOCKET; + } + if (soap->sndbuf > 0 && setsockopt(soap->master, SOL_SOCKET, SO_SNDBUF, (char*)&soap->sndbuf, sizeof(int))) + { + soap->errnum = soap_socket_errno; + (void)soap_set_receiver_error(soap, tcp_error(soap), "setsockopt SO_SNDBUF failed in soap_bind()", SOAP_TCP_ERROR); + return SOAP_INVALID_SOCKET; + } + if (soap->rcvbuf > 0 && setsockopt(soap->master, SOL_SOCKET, SO_RCVBUF, (char*)&soap->rcvbuf, sizeof(int))) + { + soap->errnum = soap_socket_errno; + (void)soap_set_receiver_error(soap, tcp_error(soap), "setsockopt SO_RCVBUF failed in soap_bind()", SOAP_TCP_ERROR); + return SOAP_INVALID_SOCKET; + } +#ifdef TCP_NODELAY + if (!(soap->omode & SOAP_IO_UDP) && setsockopt(soap->master, IPPROTO_TCP, TCP_NODELAY, (char*)&set, sizeof(int))) + { + soap->errnum = soap_socket_errno; + (void)soap_set_receiver_error(soap, tcp_error(soap), "setsockopt TCP_NODELAY failed in soap_bind()", SOAP_TCP_ERROR); + return SOAP_INVALID_SOCKET; + } +#endif +#ifdef TCP_FASTOPEN + if (!(soap->omode & SOAP_IO_UDP) && setsockopt(soap->master, IPPROTO_TCP, TCP_FASTOPEN, (char*)&set, sizeof(int))) + { + /* silently ignore */ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "setsockopt TCP_FASTOPEN failed in soap_bind()\n")); + } +#endif +#endif +#endif +#ifdef WITH_IPV6 + if (res.ai_family == AF_INET6 && setsockopt(soap->master, IPPROTO_IPV6, IPV6_V6ONLY, soap->bind_v6only ? (char*)&set : (char*)&unset, sizeof(int))) + { + soap->errnum = soap_socket_errno; + (void)soap_set_receiver_error(soap, tcp_error(soap), "setsockopt IPV6_V6ONLY failed in soap_bind()", SOAP_TCP_ERROR); + return SOAP_INVALID_SOCKET; + } + soap->errmode = 0; + if (bind(soap->master, res.ai_addr, (int)res.ai_addrlen)) + { + soap->errnum = soap_socket_errno; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Could not bind to host, bind failed\n")); + (void)soap_closesock(soap); + (void)soap_set_receiver_error(soap, tcp_error(soap), "bind failed in soap_bind()", SOAP_TCP_ERROR); + return SOAP_INVALID_SOCKET; + } +#else + soap->peerlen = sizeof(soap->peer.in); + memset((void*)&soap->peer.in, 0, sizeof(soap->peer.in)); + soap->peer.in.sin_family = AF_INET; + soap->errmode = 2; + if (host) + { + if (soap->fresolve(soap, host, &soap->peer.in.sin_addr)) + { + (void)soap_set_receiver_error(soap, tcp_error(soap), "get host by name failed in soap_bind()", SOAP_TCP_ERROR); + return SOAP_INVALID_SOCKET; + } + } + else + { + soap->peer.in.sin_addr.s_addr = htonl(INADDR_ANY); + } + soap->peer.in.sin_port = htons((short)port); + soap->errmode = 0; + if (bind(soap->master, &soap->peer.addr, (int)soap->peerlen)) + { + soap->errnum = soap_socket_errno; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Could not bind to host, bind failed\n")); + (void)soap_closesock(soap); + (void)soap_set_receiver_error(soap, tcp_error(soap), "bind failed in soap_bind()", SOAP_TCP_ERROR); + return SOAP_INVALID_SOCKET; + } +#endif + if (!(soap->omode & SOAP_IO_UDP) && listen(soap->master, backlog)) + { + soap->errnum = soap_socket_errno; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Could not bind to host, listen failed\n")); + (void)soap_closesock(soap); + (void)soap_set_receiver_error(soap, tcp_error(soap), "listen failed in soap_bind()", SOAP_TCP_ERROR); + return SOAP_INVALID_SOCKET; + } + return soap->master; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_NOIO +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_poll(struct soap *soap) +{ +#ifndef WITH_LEAN + int r; + if (soap_valid_socket(soap->socket)) + { + r = tcp_select(soap, soap->socket, SOAP_TCP_SELECT_ALL, 0); + if (r > 0 && (r & SOAP_TCP_SELECT_ERR)) + r = -1; + } + else if (soap_valid_socket(soap->master)) + { + r = tcp_select(soap, soap->master, SOAP_TCP_SELECT_SND | SOAP_TCP_SELECT_ERR, 0); + } + else + { + return SOAP_OK; /* OK when no socket! */ + } + if (r > 0) + { + int t; +#ifdef WITH_OPENSSL + if ((soap->imode & SOAP_ENC_SSL) && soap->ssl) + { + if (soap_valid_socket(soap->socket) + && (r & SOAP_TCP_SELECT_SND) + && (!(r & SOAP_TCP_SELECT_RCV) + || SSL_peek(soap->ssl, (char*)&t, 1) > 0)) + return SOAP_OK; + } + else +#endif + { + if (soap_valid_socket(soap->socket) + && (r & SOAP_TCP_SELECT_SND) + && (!(r & SOAP_TCP_SELECT_RCV) + || recv(soap->socket, (char*)&t, 1, MSG_PEEK) > 0)) + return SOAP_OK; + } + } + else if (r < 0) + { + if ((soap_valid_socket(soap->master) && soap_socket_errno != SOAP_EINTR) + || (soap_valid_socket(soap->socket) && soap_socket_errno != SOAP_EINTR)) + return soap_set_receiver_error(soap, tcp_error(soap), "select failed in soap_poll()", SOAP_TCP_ERROR); + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "soap_poll: other end down on socket=%d select=%d\n", (int)soap->socket, r)); + return SOAP_EOF; +#else + (void)soap; + return SOAP_OK; +#endif +} +#endif + +/******************************************************************************/ + +#ifndef WITH_NOIO +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_ready(struct soap *soap) +{ +#ifndef WITH_LEAN + int r; + if (!soap_valid_socket(soap->socket)) + return SOAP_OK; /* OK when no socket! */ + r = tcp_select(soap, soap->socket, SOAP_TCP_SELECT_RCV | SOAP_TCP_SELECT_ERR, 0); + if (r > 0 && (r & SOAP_TCP_SELECT_ERR)) + r = -1; + if (r < 0 && soap_socket_errno != SOAP_EINTR) + return soap_set_receiver_error(soap, tcp_error(soap), "select failed in soap_ready()", SOAP_TCP_ERROR); + if (r > 0) + { + char t; +#ifdef WITH_OPENSSL + if ((soap->imode & SOAP_ENC_SSL) && soap->ssl) + { + if (SSL_peek(soap->ssl, &t, 1) > 0) + return SOAP_OK; + } + else +#endif + { + if (recv(soap->socket, &t, 1, MSG_PEEK) > 0) + return SOAP_OK; + } + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "soap_ready: other end not ready to send on socket=%d select=%d\n", (int)soap->socket, r)); + return SOAP_EOF; +#else + (void)soap; + return SOAP_OK; +#endif +} +#endif +/******************************************************************************/ + +#ifndef WITH_NOIO +SOAP_FMAC1 +SOAP_SOCKET +SOAP_FMAC2 +soap_accept(struct soap *soap) +{ + int n = (int)sizeof(soap->peer); + int err; +#ifndef WITH_LEAN + int set = 1; +#endif + soap->error = SOAP_OK; + memset((void*)&soap->peer, 0, sizeof(soap->peer)); + soap->socket = SOAP_INVALID_SOCKET; + soap->errmode = 0; + soap_reset_errno; + soap->errnum = 0; + soap->keep_alive = 0; + if (!soap_valid_socket(soap->master)) + { + (void)soap_set_receiver_error(soap, tcp_error(soap), "no master socket in soap_accept()", SOAP_TCP_ERROR); + return SOAP_INVALID_SOCKET; + } +#ifndef WITH_LEAN + if ((soap->omode & SOAP_IO_UDP)) + return soap->socket = soap->master; +#endif + for (;;) + { + if (soap->accept_timeout) + { + for (;;) + { + int r; + r = tcp_select(soap, soap->master, SOAP_TCP_SELECT_ALL, soap->accept_timeout); + if (r > 0) + break; + if (!r) + { + (void)soap_set_receiver_error(soap, "Timeout", "accept failed in soap_accept()", SOAP_TCP_ERROR); + return SOAP_INVALID_SOCKET; + } + if (r < 0) + { + r = soap->errnum; + if (r != SOAP_EINTR) + { + (void)soap_closesock(soap); + (void)soap_set_receiver_error(soap, tcp_error(soap), "accept failed in soap_accept()", SOAP_TCP_ERROR); + return SOAP_INVALID_SOCKET; + } + } + } + } + n = (int)sizeof(soap->peer); + soap->socket = soap->faccept(soap, soap->master, &soap->peer.addr, &n); + soap->peerlen = (size_t)n; + if (soap_valid_socket(soap->socket)) + { +#ifdef WITH_IPV6 + char port[16]; + struct addrinfo *res = NULL; + struct addrinfo hints; + memset(&hints, 0, sizeof(struct addrinfo)); + hints.ai_family = PF_UNSPEC; + hints.ai_socktype = SOCK_STREAM; + hints.ai_flags = AI_NUMERICHOST | AI_NUMERICSERV; + getnameinfo(&soap->peer.addr, n, soap->host, sizeof(soap->host), port, sizeof(port), NI_NUMERICHOST | NI_NUMERICSERV); + soap->ip = 0; + soap->ip6[0] = 0; + soap->ip6[1] = 0; + soap->ip6[2] = 0; + soap->ip6[3] = 0; + if (getaddrinfo(soap->host, NULL, &hints, &res) == 0 && res) + { + struct sockaddr_storage result; + memset((void*)&result, 0, sizeof(result)); + (void)soap_memcpy(&result, sizeof(result), res->ai_addr, res->ai_addrlen); + freeaddrinfo(res); + if (result.ss_family == AF_INET6) + { + struct sockaddr_in6 *addr = (struct sockaddr_in6*)&result; + struct in6_addr *inaddr = &addr->sin6_addr; + int i; + for (i = 0; i < 16; i++) + soap->ip6[i/4] = (soap->ip6[i/4] << 8) + inaddr->s6_addr[i]; + } + else if (result.ss_family == AF_INET) + { + struct sockaddr_in *addr = (struct sockaddr_in*)&result; + soap->ip = ntohl(addr->sin_addr.s_addr); + soap->ip6[2] = 0xFFFF; + soap->ip6[3] = soap->ip; + } + } + soap->port = soap_strtol(port, NULL, 10); +#else + soap->ip = ntohl(soap->peer.in.sin_addr.s_addr); + soap->ip6[0] = 0; + soap->ip6[1] = 0; + soap->ip6[2] = 0xFFFF; + soap->ip6[3] = soap->ip; + (SOAP_SNPRINTF(soap->host, sizeof(soap->host), 80), "%u.%u.%u.%u", (int)(soap->ip>>24)&0xFF, (int)(soap->ip>>16)&0xFF, (int)(soap->ip>>8)&0xFF, (int)soap->ip&0xFF); + soap->port = (int)ntohs(soap->peer.in.sin_port); /* does not return port number on some systems */ +#endif + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Accept socket=%d at port=%d from IP='%s'\n", (int)soap->socket, soap->port, soap->host)); +#ifndef WITH_LEAN + if ((soap->accept_flags & SO_LINGER)) + { + struct linger linger; + memset((void*)&linger, 0, sizeof(linger)); + linger.l_onoff = 1; + linger.l_linger = soap->linger_time; + if (setsockopt(soap->socket, SOL_SOCKET, SO_LINGER, (char*)&linger, sizeof(struct linger))) + { + soap->errnum = soap_socket_errno; + (void)soap_set_receiver_error(soap, tcp_error(soap), "setsockopt SO_LINGER failed in soap_accept()", SOAP_TCP_ERROR); + (void)soap_closesock(soap); + return SOAP_INVALID_SOCKET; + } + } + if ((soap->accept_flags & ~SO_LINGER) && setsockopt(soap->socket, SOL_SOCKET, soap->accept_flags & ~SO_LINGER, (char*)&set, sizeof(int))) + { + soap->errnum = soap_socket_errno; + (void)soap_set_receiver_error(soap, tcp_error(soap), "setsockopt failed in soap_accept()", SOAP_TCP_ERROR); + (void)soap_closesock(soap); + return SOAP_INVALID_SOCKET; + } +#ifndef UNDER_CE + if (((soap->imode | soap->omode) & SOAP_IO_KEEPALIVE) && setsockopt(soap->socket, SOL_SOCKET, SO_KEEPALIVE, (char*)&set, sizeof(int))) + { + soap->errnum = soap_socket_errno; + (void)soap_set_receiver_error(soap, tcp_error(soap), "setsockopt SO_KEEPALIVE failed in soap_accept()", SOAP_TCP_ERROR); + (void)soap_closesock(soap); + return SOAP_INVALID_SOCKET; + } + if (soap->sndbuf > 0 && setsockopt(soap->socket, SOL_SOCKET, SO_SNDBUF, (char*)&soap->sndbuf, sizeof(int))) + { + soap->errnum = soap_socket_errno; + (void)soap_set_receiver_error(soap, tcp_error(soap), "setsockopt SO_SNDBUF failed in soap_accept()", SOAP_TCP_ERROR); + (void)soap_closesock(soap); + return SOAP_INVALID_SOCKET; + } + if (soap->rcvbuf > 0 && setsockopt(soap->socket, SOL_SOCKET, SO_RCVBUF, (char*)&soap->rcvbuf, sizeof(int))) + { + soap->errnum = soap_socket_errno; + (void)soap_set_receiver_error(soap, tcp_error(soap), "setsockopt SO_RCVBUF failed in soap_accept()", SOAP_TCP_ERROR); + (void)soap_closesock(soap); + return SOAP_INVALID_SOCKET; + } +#ifdef TCP_NODELAY + if (setsockopt(soap->socket, IPPROTO_TCP, TCP_NODELAY, (char*)&set, sizeof(int))) + { + soap->errnum = soap_socket_errno; + (void)soap_set_receiver_error(soap, tcp_error(soap), "setsockopt TCP_NODELAY failed in soap_accept()", SOAP_TCP_ERROR); + (void)soap_closesock(soap); + return SOAP_INVALID_SOCKET; + } +#endif +#endif +#endif + soap->keep_alive = -(((soap->imode | soap->omode) & SOAP_IO_KEEPALIVE) != 0); + if (soap->send_timeout || soap->recv_timeout) + SOAP_SOCKNONBLOCK(soap->socket) + else + SOAP_SOCKBLOCK(soap->socket) + return soap->socket; + } + err = soap_socket_errno; + if (err != 0 && err != SOAP_EINTR && err != SOAP_EAGAIN && err != SOAP_EWOULDBLOCK) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Accept failed from %s\n", soap->host)); + soap->errnum = err; + (void)soap_set_receiver_error(soap, tcp_error(soap), "accept failed in soap_accept()", SOAP_TCP_ERROR); + (void)soap_closesock(soap); + return SOAP_INVALID_SOCKET; + } + } +} +#endif + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_closesock(struct soap *soap) +{ + int status = soap->error; + int err = SOAP_OK; + soap->part = SOAP_END; +#ifndef WITH_LEANER + if (status && status < 200) /* attachment state is not to be trusted */ + { + soap->mime.first = NULL; + soap->mime.last = NULL; + soap->dime.first = NULL; + soap->dime.last = NULL; + } +#endif + if (soap->fdisconnect) + err = soap->fdisconnect(soap); + if (err || status == SOAP_EOF || status == SOAP_TCP_ERROR || status == SOAP_SSL_ERROR || !soap->keep_alive) + { + soap->keep_alive = 0; + if (soap->fclose && (soap->error = soap->fclose(soap)) != SOAP_OK) + return soap->error; + if (err) + return soap->error = err; + } +#ifdef WITH_ZLIB + if (!(soap->mode & SOAP_MIME_POSTCHECK)) + { + if (soap->zlib_state == SOAP_ZLIB_DEFLATE) + deflateEnd(soap->d_stream); + else if (soap->zlib_state == SOAP_ZLIB_INFLATE) + inflateEnd(soap->d_stream); + soap->zlib_state = SOAP_ZLIB_NONE; + } +#endif + return soap->error = status; +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_force_closesock(struct soap *soap) +{ + soap->keep_alive = 0; + if (soap_valid_socket(soap->socket) && soap->fclosesocket) + { + (void)soap->fclosesocket(soap, soap->socket); + soap->socket = SOAP_INVALID_SOCKET; + } + return soap->error; +} + +/******************************************************************************/ + +#ifdef WITH_SELF_PIPE +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_close_connection(struct soap *soap) +{ + if (soap_valid_socket(soap->socket)) + write(soap->pipe_fd[1], "1", 1); +} +#endif + +/******************************************************************************/ + +#ifndef WITH_NOIO +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_cleanup(struct soap *soap) +{ + soap_done(soap); +#ifdef WIN32 + if (!tcp_done) + return; + tcp_done = 0; + WSACleanup(); +#endif +} +#endif + +/******************************************************************************/ + +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_done(struct soap *soap) +{ +#ifdef SOAP_DEBUG + int i; +#endif + if (soap_check_state(soap)) + return; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Done with context%s\n", soap->state == SOAP_COPY ? " copy" : "")); + soap_free_temp(soap); +#ifdef SOAP_DEBUG + if (soap->clist) + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Warning: managed C++ data was not deallocated with soap_destroy() from the heap managed by context %p\n", (void*)soap)); + if (soap->alist) + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Warning: managed C data was not deallocated with soap_end() from the heap managed by context %p\n", (void*)soap)); +#endif + soap->alist = NULL; + while (soap->clist) + { + struct soap_clist *p = soap->clist->next; + SOAP_FREE(soap, soap->clist); + soap->clist = p; + } + if (soap->state == SOAP_INIT) + soap->omode &= ~SOAP_IO_UDP; /* to force close the socket */ + soap->keep_alive = 0; /* to force close the socket */ + if (soap->master == soap->socket) /* do not close twice */ + soap->master = SOAP_INVALID_SOCKET; + (void)soap_closesock(soap); +#ifdef WITH_COOKIES + soap_free_cookies(soap); +#endif + while (soap->plugins) + { + struct soap_plugin *p = soap->plugins->next; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Removing plugin '%s'\n", soap->plugins->id)); + if (soap->plugins->fcopy || soap->state == SOAP_INIT) + soap->plugins->fdelete(soap, soap->plugins); + SOAP_FREE(soap, soap->plugins); + soap->plugins = p; + } + soap->fplugin = fplugin; +#ifndef WITH_NOHTTP + soap->fpost = http_post; + soap->fget = http_get; + soap->fput = http_put; + soap->fpatch = http_patch; + soap->fdel = http_del; + soap->fopt = http_200; + soap->fhead = http_200; + soap->fform = NULL; + soap->fposthdr = http_post_header; + soap->fresponse = http_response; + soap->fparse = http_parse; + soap->fparsehdr = http_parse_header; +#endif + soap->fheader = NULL; +#ifndef WITH_NOIO +#ifndef WITH_IPV6 + soap->fresolve = tcp_gethost; +#else + soap->fresolve = NULL; +#endif + soap->faccept = tcp_accept; + soap->fopen = tcp_connect; + soap->fclose = tcp_disconnect; + soap->fclosesocket = tcp_closesocket; + soap->fshutdownsocket = tcp_shutdownsocket; + soap->fsend = fsend; + soap->frecv = frecv; + soap->fpoll = soap_poll; +#else + soap->fopen = NULL; + soap->fclose = NULL; + soap->fpoll = NULL; +#endif +#ifndef WITH_LEANER + soap->fsvalidate = NULL; + soap->fwvalidate = NULL; + soap->feltbegin = NULL; + soap->feltendin = NULL; + soap->feltbegout = NULL; + soap->feltendout = NULL; + soap->fprepareinitsend = NULL; + soap->fprepareinitrecv = NULL; + soap->fpreparesend = NULL; + soap->fpreparerecv = NULL; + soap->fpreparefinalsend = NULL; + soap->fpreparefinalrecv = NULL; + soap->ffiltersend = NULL; + soap->ffilterrecv = NULL; +#endif + soap->fseterror = NULL; + soap->fignore = NULL; + soap->fencoding = NULL; + soap->fserveloop = NULL; +#ifdef WITH_OPENSSL + if (soap->session) + { + SSL_SESSION_free(soap->session); + soap->session = NULL; + } +#endif + if (soap->state == SOAP_INIT) + { + if (soap_valid_socket(soap->master)) + { + (void)soap->fclosesocket(soap, soap->master); + soap->master = SOAP_INVALID_SOCKET; + } + } +#ifdef WITH_OPENSSL + if (soap->ssl) + { + SSL_free(soap->ssl); + soap->ssl = NULL; + } + if (soap->state == SOAP_INIT) + { + if (soap->ctx) + { + SSL_CTX_free(soap->ctx); + soap->ctx = NULL; + } + } + ERR_clear_error(); +# if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER) + /* OpenSSL libraries handle thread init and deinit */ +# elif OPENSSL_VERSION_NUMBER >= 0x10000000L + ERR_remove_thread_state(NULL); +# else + ERR_remove_state(0); +# endif +#endif +#ifdef WITH_GNUTLS + if (soap->state == SOAP_INIT) + { + if (soap->xcred) + { + gnutls_certificate_free_credentials(soap->xcred); + soap->xcred = NULL; + } + if (soap->acred) + { + gnutls_anon_free_client_credentials(soap->acred); + soap->acred = NULL; + } + if (soap->cache) + { + gnutls_priority_deinit(soap->cache); + soap->cache = NULL; + } + if (soap->dh_params) + { + gnutls_dh_params_deinit(soap->dh_params); + soap->dh_params = NULL; + } +# if GNUTLS_VERSION_NUMBER < 0x030300 + if (soap->rsa_params) + { + gnutls_rsa_params_deinit(soap->rsa_params); + soap->rsa_params = NULL; + } +#endif + } + if (soap->session) + { + gnutls_deinit(soap->session); + soap->session = NULL; + } +#endif +#ifdef WITH_WOLFSSL + if (soap->ssl) + { + wolfSSL_free(soap->ssl); + soap->ssl = NULL; + } + if (soap->state == SOAP_INIT) + { + if (soap->ctx) + { + wolfSSL_CTX_free(soap->ctx); + soap->ctx = NULL; + } + } +#endif +#ifdef WITH_SYSTEMSSL + if (soap->ssl) + gsk_secure_socket_close(&soap->ssl); + if (soap->state == SOAP_INIT) + if (soap->ctx) + gsk_environment_close(&soap->ctx); +#endif +#ifdef WITH_C_LOCALE + SOAP_FREELOCALE(soap); +#endif +#ifdef WITH_ZLIB + if (soap->d_stream) + { + SOAP_FREE(soap, soap->d_stream); + soap->d_stream = NULL; + } + if (soap->z_buf) + { + SOAP_FREE(soap, soap->z_buf); + soap->z_buf = NULL; + } +#endif +#ifdef SOAP_DEBUG + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Free logfiles\n")); + for (i = 0; i < SOAP_MAXLOGS; i++) + { + soap_close_logfile(soap, i); + if (soap->logfile[i]) + { + SOAP_FREE_UNMANAGED(soap->logfile[i]); + soap->logfile[i] = NULL; + } + } +#endif +#ifdef WITH_SELF_PIPE + close(soap->pipe_fd[0]); + close(soap->pipe_fd[1]); +#endif +#ifdef SOAP_MEM_DEBUG + soap_free_mht(soap); +#endif + soap->state = SOAP_NONE; +} + +/******************************************************************************\ + * + * HTTP + * +\******************************************************************************/ + +#ifndef WITH_NOHTTP +static int +http_parse(struct soap *soap) +{ + char header[SOAP_HDRLEN], *s; + int err = SOAP_OK; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Waiting for HTTP request/response...\n")); + soap->fform = NULL; + *soap->endpoint = '\0'; + soap->bearer = NULL; +#ifdef WITH_NTLM + if (!soap->ntlm_challenge) +#endif + { + soap->userid = NULL; + soap->passwd = NULL; + soap->authrealm = NULL; + } +#ifdef WITH_NTLM + soap->ntlm_challenge = NULL; +#endif + soap->proxy_from = NULL; + soap->cors_origin = NULL; + soap->cors_method = NULL; + soap->cors_header = NULL; + do + { + soap->length = 0; + soap->http_content = NULL; + soap->action = NULL; + soap->status = 0; + soap->body = 1; + if (soap_getline(soap, soap->msgbuf, sizeof(soap->msgbuf))) + { + if (soap->error == SOAP_EOF) + return SOAP_EOF; + return soap->error = 414; + } + s = strchr(soap->msgbuf, ' '); + if (s) + { + soap->status = (unsigned short)soap_strtoul(s, &s, 10); + if (!soap_coblank((soap_wchar)*s)) + soap->status = 0; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "HTTP status: %s\n", soap->msgbuf)); + for (;;) + { + if (soap_getline(soap, header, SOAP_HDRLEN)) + { + if (soap->error == SOAP_EOF) + { + soap->error = SOAP_OK; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "EOF in HTTP header, try to continue anyway\n")); + break; + } + return soap->error; + } + if (!*header) + break; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "HTTP header: %s\n", header)); + s = strchr(header, ':'); + if (s) + { + char *t; + *s = '\0'; + while (*++s && *s <= 32) + continue; + t = s + strlen(s) - 1; + while (t > s && *t <= 32) + t--; + if (t > s && *s == '"' && *t == '"') + s++,t--; + t[1] = '\0'; + soap->error = soap->fparsehdr(soap, header, s); + if (soap->error) + { + if (soap->error < SOAP_STOP) + return soap->error; + err = soap->error; + soap->error = SOAP_OK; + } + } + } + } while (soap->status == 100); + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Finished HTTP header parsing, status = %d\n", soap->status)); + s = strstr(soap->msgbuf, "HTTP/"); + if (s && s[5] == '1' && s[6] == '.' && s[7] == '0') + { + soap->keep_alive = 0; /* HTTP 1.0 does not support keep-alive */ + if (soap->status == 0 && (soap->omode & SOAP_IO) == SOAP_IO_CHUNK) /* soap->status == 0 for HTTP request */ + soap->omode = (soap->omode & ~SOAP_IO) | SOAP_IO_STORE; /* HTTP 1.0 does not support chunked transfers */ + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Keep alive connection = %d\n", soap->keep_alive)); + if (soap->status == 0) + { + size_t l = 0; + if (s) + { + if (!strncmp(soap->msgbuf, "POST ", l = 5)) + soap->status = SOAP_POST; + else if (!strncmp(soap->msgbuf, "GET ", l = 4)) + soap->status = SOAP_GET; + else if (!strncmp(soap->msgbuf, "PUT ", l = 4)) + soap->status = SOAP_PUT; + else if (!strncmp(soap->msgbuf, "PATCH ", l = 4)) + soap->status = SOAP_PATCH; + else if (!strncmp(soap->msgbuf, "DELETE ", l = 7)) + soap->status = SOAP_DEL; + else if (!strncmp(soap->msgbuf, "HEAD ", l = 5)) + soap->status = SOAP_HEAD; + else if (!strncmp(soap->msgbuf, "OPTIONS ", l = 8)) + soap->status = SOAP_OPTIONS; + } + if (s && soap->status) + { + size_t m, n, k; + int r; + while (soap->msgbuf[l] && soap_coblank((soap_wchar)soap->msgbuf[l])) + l++; + m = strlen(soap->endpoint); + n = m + (s - soap->msgbuf) - l - 1; + if (n >= sizeof(soap->endpoint)) + n = sizeof(soap->endpoint) - 1; + if (m > n) + m = n; + k = n - m + 1; + if (k >= sizeof(soap->path)) + k = sizeof(soap->path) - 1; + while (k > 0 && soap_coblank((soap_wchar)soap->msgbuf[l + k - 1])) + k--; + if (soap_strncpy(soap->path, sizeof(soap->path), soap->msgbuf + l, k)) + return soap->error = 414; + if (*soap->path && *soap->path != '/') + r = soap_strncpy(soap->endpoint, sizeof(soap->endpoint), soap->path, k); + else + r = soap_strncat(soap->endpoint, sizeof(soap->endpoint), soap->path, k); + if (r) + return soap->error = 414; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Target endpoint='%s' path='%s'\n", soap->endpoint, soap->path)); + if (err) + return soap->error = err; + } + else if (err) + { + return soap->error = err; + } + else if (s) + { + return soap->error = 405; + } + return SOAP_OK; + } + if ((soap->status >= 200 && soap->status <= 299) /* OK, Accepted, etc */ + || soap->status == 400 /* Bad Request */ + || soap->status == 500) /* Internal Server Error */ + return soap->error = SOAP_OK; + return soap->error = soap->status; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_NOHTTP +static int +http_parse_header(struct soap *soap, const char *key, const char *val) +{ + if (!soap_tag_cmp(key, "Host")) + { +#if defined(WITH_OPENSSL) || defined(WITH_GNUTLS) || defined(WITH_WOLFSSL) + if ((soap->imode & SOAP_ENC_SSL)) + soap_strcpy(soap->endpoint, sizeof(soap->endpoint), "https://"); + else +#endif + soap_strcpy(soap->endpoint, sizeof(soap->endpoint), "http://"); + if (soap_strncat(soap->endpoint, sizeof(soap->endpoint), val, sizeof(soap->endpoint) - 9)) + return soap->error = SOAP_HDR; + } +#ifndef WITH_LEANER + else if (!soap_tag_cmp(key, "Content-Type")) + { + const char *action; + soap->http_content = soap_strdup(soap, val); + if (soap_http_header_attribute(soap, val, "application/dime")) + soap->imode |= SOAP_ENC_DIME; + else if (soap_http_header_attribute(soap, val, "multipart/related") + || soap_http_header_attribute(soap, val, "multipart/form-data")) + { + const char *type; + soap->mime.boundary = soap_strdup(soap, soap_http_header_attribute(soap, val, "boundary")); + soap->mime.start = soap_strdup(soap, soap_http_header_attribute(soap, val, "start")); + soap->imode |= SOAP_ENC_MIME; + type = soap_http_header_attribute(soap, val, "type"); + if (type && !strcmp(type, "application/xop+xml")) + soap->imode |= SOAP_ENC_MTOM; + } + action = soap_http_header_attribute(soap, val, "action"); + if (action) + { + if (*action == '"') + { + soap->action = soap_strdup(soap, action + 1); + if (soap->action && *soap->action) + soap->action[strlen(soap->action) - 1] = '\0'; + } + else + soap->action = soap_strdup(soap, action); + } + } +#endif + else if (!soap_tag_cmp(key, "Content-Length")) + { + soap->length = soap_strtoull(val, NULL, 10); + if (soap->length == 0) + soap->body = 0; + } + else if (!soap_tag_cmp(key, "Content-Encoding")) + { + if (!soap_tag_cmp(val, "deflate")) +#ifdef WITH_ZLIB + soap->zlib_in = SOAP_ZLIB_DEFLATE; +#else + return SOAP_ZLIB_ERROR; +#endif + else if (!soap_tag_cmp(val, "gzip")) +#ifdef WITH_GZIP + soap->zlib_in = SOAP_ZLIB_GZIP; +#else + return SOAP_ZLIB_ERROR; +#endif + } +#ifdef WITH_ZLIB + else if (!soap_tag_cmp(key, "Accept-Encoding")) + { +#ifdef WITH_GZIP + if (strchr(val, '*') || soap_http_header_attribute(soap, val, "gzip")) + soap->zlib_out = SOAP_ZLIB_GZIP; + else +#endif + if (strchr(val, '*') || soap_http_header_attribute(soap, val, "deflate")) + soap->zlib_out = SOAP_ZLIB_DEFLATE; + else + soap->zlib_out = SOAP_ZLIB_NONE; + } +#endif + else if (!soap_tag_cmp(key, "Transfer-Encoding")) + { + soap->imode &= ~SOAP_IO; + if (!soap_tag_cmp(val, "chunked")) + soap->imode |= SOAP_IO_CHUNK; + } + else if (!soap_tag_cmp(key, "Connection")) + { + if (!soap_tag_cmp(val, "close")) + soap->keep_alive = 0; + } +#if !defined(WITH_LEAN) || defined(WITH_NTLM) + else if (!soap_tag_cmp(key, "Authorization") || !soap_tag_cmp(key, "Proxy-Authorization")) + { +#ifdef WITH_NTLM + if (!soap_tag_cmp(val, "NTLM*")) + { + soap->ntlm_challenge = soap_strdup(soap, val + 4); + } + else +#endif + if (!soap_tag_cmp(val, "Bearer *")) + { + soap->bearer = soap_strdup(soap, val + 7); + } + else if (!soap_tag_cmp(val, "Basic *")) + { + int n; + char *s; + soap_base642s(soap, val + 6, soap->tmpbuf, sizeof(soap->tmpbuf) - 1, &n); + soap->tmpbuf[n] = '\0'; + s = strchr(soap->tmpbuf, ':'); + if (s) + { + *s = '\0'; + soap->userid = soap_strdup(soap, soap->tmpbuf); + soap->passwd = soap_strdup(soap, s + 1); + } + } + } + else if (!soap_tag_cmp(key, "WWW-Authenticate") || !soap_tag_cmp(key, "Proxy-Authenticate")) + { +#ifdef WITH_NTLM + if (!soap_tag_cmp(val, "NTLM*")) + soap->ntlm_challenge = soap_strdup(soap, val + 4); + else +#endif + soap->authrealm = soap_strdup(soap, soap_http_header_attribute(soap, val + 6, "realm")); + } + else if (!soap_tag_cmp(key, "Expect")) + { + if (!soap_tag_cmp(val, "100-continue")) + { + if ((soap->error = soap->fposthdr(soap, "HTTP/1.1 100 Continue", NULL)) != SOAP_OK + || (soap->error = soap->fposthdr(soap, NULL, NULL)) != SOAP_OK) + return soap->error; + } + } +#endif + else if (!soap_tag_cmp(key, "SOAPAction")) + { + if (*val == '"') + { + soap->action = soap_strdup(soap, val + 1); + if (*soap->action) + soap->action[strlen(soap->action) - 1] = '\0'; + } + else + soap->action = soap_strdup(soap, val); + } + else if (!soap_tag_cmp(key, "Location")) + { + soap_strcpy(soap->endpoint, sizeof(soap->endpoint), val); + } + else if (!soap_tag_cmp(key, "X-Forwarded-For")) + { + soap->proxy_from = soap_strdup(soap, val); + } + else if (!soap_tag_cmp(key, "Origin")) + { + soap->origin = soap_strdup(soap, val); + soap->cors_origin = soap->cors_allow; + } + else if (!soap_tag_cmp(key, "Access-Control-Request-Method")) + { + soap->cors_method = soap_strdup(soap, val); + } + else if (!soap_tag_cmp(key, "Access-Control-Request-Headers")) + { + soap->cors_header = soap_strdup(soap, val); + } +#ifdef WITH_COOKIES + else if (!soap_tag_cmp(key, "Cookie") + || !soap_tag_cmp(key, "Cookie2") + || !soap_tag_cmp(key, "Set-Cookie") + || !soap_tag_cmp(key, "Set-Cookie2")) + { + soap_getcookies(soap, val); + } +#endif + return SOAP_OK; +} +#endif + +/******************************************************************************/ + +#if !defined(WITH_NOHTTP) || !defined(WITH_LEANER) +SOAP_FMAC1 +const char* +SOAP_FMAC2 +soap_http_header_attribute(struct soap *soap, const char *line, const char *key) +{ + const char *s = line; + if (s) + { + while (*s) + { + short flag; + s = soap_decode_key(soap->tmpbuf, sizeof(soap->tmpbuf), s); + flag = soap_tag_cmp(soap->tmpbuf, key); + s = soap_decode_val(soap->tmpbuf, sizeof(soap->tmpbuf), s); + if (!flag) + return soap->tmpbuf; + } + } + return NULL; +} +#endif + +/******************************************************************************/ + +#if !defined(WITH_NOHTTP) || !defined(WITH_LEANER) +SOAP_FMAC1 +const char* +SOAP_FMAC2 +soap_decode_key(char *buf, size_t len, const char *val) +{ + return soap_decode(buf, len, val, "=,;"); +} +#endif + +/******************************************************************************/ + +#if !defined(WITH_NOHTTP) || !defined(WITH_LEANER) +SOAP_FMAC1 +const char* +SOAP_FMAC2 +soap_decode_val(char *buf, size_t len, const char *val) +{ + if (*val != '=') + { + *buf = '\0'; + return val; + } + return soap_decode(buf, len, val + 1, ",;"); +} +#endif + +/******************************************************************************/ + +#if !defined(WITH_NOHTTP) || !defined(WITH_LEANER) +static const char * +soap_decode(char *buf, size_t len, const char *val, const char *sep) +{ + const char *s; + char *t = buf; + size_t i = len; + if (!buf || !val || !sep || len == 0) + return val; + for (s = val; *s; s++) + if (*s != ' ' && *s != '\t' && !strchr(sep, *s)) + break; + if (*s == '"') + { + s++; + while (*s && *s != '"' && i-- > 1) + *t++ = *s++; + } + else + { + while (*s && !strchr(sep, *s) && i-- > 1) + { + if (*s == '%' && s[1] && s[2]) + { + *t++ = ((s[1] >= 'A' ? (s[1] & 0x7) + 9 : s[1] - '0') << 4) + + (s[2] >= 'A' ? (s[2] & 0x7) + 9 : s[2] - '0'); + s += 3; + } + else + *t++ = *s++; + } + } + buf[len - 1] = '\0'; /* appease static checkers that get confused */ + *t = '\0'; + while (*s && !strchr(sep, *s)) + s++; + return s; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_NOHTTP +static const char* +http_error(struct soap *soap, int status) +{ + const char *msg = SOAP_STR_EOS; + (void)soap; + (void)status; +#ifndef WITH_LEAN + msg = soap_code_str(h_http_error_codes, status); + if (!msg) + msg = SOAP_STR_EOS; +#endif + return msg; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_NOHTTP +static int +http_get(struct soap *soap) +{ + (void)soap; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "HTTP GET request\n")); + return SOAP_GET_METHOD; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_NOHTTP +static int +http_put(struct soap *soap) +{ + (void)soap; + return SOAP_PUT_METHOD; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_NOHTTP +static int +http_patch(struct soap *soap) +{ + (void)soap; + return SOAP_PATCH_METHOD; +} +#endif +/******************************************************************************/ + +#ifndef WITH_NOHTTP +static int +http_del(struct soap *soap) +{ + (void)soap; + return SOAP_DEL_METHOD; +} +#endif +/******************************************************************************/ + +#ifndef WITH_NOHTTP +static int +http_200(struct soap *soap) +{ + if (soap->origin && soap->cors_method) /* CORS Origin and Access-Control-Request-Method headers */ + { + soap->cors_origin = soap->cors_allow; /* modify this code or hook your own soap->fopt() callback with logic */ + soap->cors_methods = "GET, PUT, PATCH, POST, HEAD, OPTIONS"; + soap->cors_headers = soap->cors_header; + } + return soap_send_empty_response(soap, 200); +} +#endif + +/******************************************************************************/ + +#ifndef WITH_NOHTTP +static int +http_post(struct soap *soap, const char *endpoint, const char *host, int port, const char *path, const char *action, ULONG64 count) +{ + const char *s; + int err; + size_t l; + switch (soap->status) + { + case SOAP_GET: + s = "GET"; + break; + case SOAP_PUT: + s = "PUT"; + break; + case SOAP_PATCH: + s = "PATCH"; + break; + case SOAP_DEL: + s = "DELETE"; + break; + case SOAP_CONNECT: + s = "CONNECT"; + break; + case SOAP_HEAD: + s = "HEAD"; + break; + case SOAP_OPTIONS: + s = "OPTIONS"; + break; + default: + s = "POST"; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "HTTP %s to %s\n", s, endpoint ? endpoint : "(null)")); + if (!endpoint || (soap_tag_cmp(endpoint, "http:*") && soap_tag_cmp(endpoint, "https:*") && soap_tag_cmp(endpoint, "httpg:*"))) + return SOAP_OK; + /* set l to prevent overruns ('host' and 'soap->host' are substrings of 'endpoint') */ + l = strlen(endpoint) + strlen(soap->http_version) + 80; + if (l > sizeof(soap->tmpbuf)) + return soap->error = SOAP_EOM; + if (soap->status == SOAP_CONNECT) + (SOAP_SNPRINTF(soap->tmpbuf, sizeof(soap->tmpbuf), l), "%s %s:%d HTTP/%s", s, soap->host, soap->port, soap->http_version); + else if (soap->proxy_host && endpoint) + (SOAP_SNPRINTF(soap->tmpbuf, sizeof(soap->tmpbuf), l), "%s %s HTTP/%s", s, endpoint, soap->http_version); + else + (SOAP_SNPRINTF(soap->tmpbuf, sizeof(soap->tmpbuf), l), "%s /%s HTTP/%s", s, (*path == '/' ? path + 1 : path), soap->http_version); + err = soap->fposthdr(soap, soap->tmpbuf, NULL); + if (err) + return err; +#if defined(WITH_OPENSSL) || defined(WITH_WOLFSSL) + if ((soap->ssl && port != 443) || (!soap->ssl && port != 80)) +#else + if (port != 80) +#endif + { +#ifdef WITH_IPV6 + if (*host != '[' && strchr(host, ':')) + (SOAP_SNPRINTF(soap->tmpbuf, sizeof(soap->tmpbuf), l), "[%s]:%d", host, port); /* RFC 2732 */ + else +#endif + (SOAP_SNPRINTF(soap->tmpbuf, sizeof(soap->tmpbuf), l), "%s:%d", host, port); + } + else + { +#ifdef WITH_IPV6 + if (*host != '[' && strchr(host, ':')) + (SOAP_SNPRINTF(soap->tmpbuf, sizeof(soap->tmpbuf), l), "[%s]", host); /* RFC 2732 */ + else +#endif + soap_strcpy(soap->tmpbuf, sizeof(soap->tmpbuf), host); + } + err = soap->fposthdr(soap, "Host", soap->tmpbuf); + if (err) + return err; + err = soap->fposthdr(soap, "User-Agent", "gSOAP/2.8"); + if (err) + return err; + if (soap->origin) + { + err = soap->fposthdr(soap, "Origin", soap->origin); + if (err) + return err; + if (soap->status == SOAP_OPTIONS) + { + err = soap->fposthdr(soap, "Access-Control-Request-Method", soap->cors_method ? soap->cors_method : "POST"); + if (err) + return err; + if (soap->cors_header) + { + err = soap->fposthdr(soap, "Access-Control-Request-Headers", soap->cors_header); + if (err) + return err; + } + } + } + err = soap_puthttphdr(soap, SOAP_OK, count); + if (err) + return err; +#ifndef WITH_LEANER + if ((soap->imode & SOAP_ENC_MTOM)) + { + err = soap->fposthdr(soap, "Accept", "multipart/related,application/xop+xml,*/*;q=0.8"); + if (err) + return err; + } +#endif +#ifdef WITH_ZLIB +#ifdef WITH_GZIP + err = soap->fposthdr(soap, "Accept-Encoding", "gzip,deflate"); +#else + err = soap->fposthdr(soap, "Accept-Encoding", "deflate"); +#endif + if (err) + return err; +#endif +#if !defined(WITH_LEAN) || defined(WITH_NTLM) + if (soap->bearer) + { + l = strlen(soap->bearer); + (SOAP_SNPRINTF(soap->tmpbuf, sizeof(soap->tmpbuf), l + 7), "Bearer %s", soap->bearer); + err = soap->fposthdr(soap, "Authorization", soap->tmpbuf); + if (err) + return err; + } +#ifdef WITH_NTLM + if (soap->ntlm_challenge) + { + l = strlen(soap->ntlm_challenge); + if (l) + { + (SOAP_SNPRINTF(soap->tmpbuf, sizeof(soap->tmpbuf), l + 5), "NTLM %s", soap->ntlm_challenge); + if (soap->proxy_host) + { + err = soap->fposthdr(soap, "Proxy-Authorization", soap->tmpbuf); + if (err) + return err; + } + else + { + err = soap->fposthdr(soap, "Authorization", soap->tmpbuf); + if (err) + return err; + } + } + } + else + { +#endif + if (soap->userid && soap->passwd) + { + soap_strcpy(soap->tmpbuf, sizeof(soap->tmpbuf), "Basic "); + (SOAP_SNPRINTF(soap->tmpbuf + 262, sizeof(soap->tmpbuf) - 262, strlen(soap->userid) + strlen(soap->passwd) + 1), "%s:%s", soap->userid, soap->passwd); + soap_s2base64(soap, (const unsigned char*)(soap->tmpbuf + 262), soap->tmpbuf + 6, (int)strlen(soap->tmpbuf + 262)); + err = soap->fposthdr(soap, "Authorization", soap->tmpbuf); + if (err) + return err; + } + if (soap->proxy_userid && soap->proxy_passwd) + { + soap_strcpy(soap->tmpbuf, sizeof(soap->tmpbuf), "Basic "); + (SOAP_SNPRINTF(soap->tmpbuf + 262, sizeof(soap->tmpbuf) - 262, strlen(soap->proxy_userid) + strlen(soap->proxy_passwd) + 1), "%s:%s", soap->proxy_userid, soap->proxy_passwd); + soap_s2base64(soap, (const unsigned char*)(soap->tmpbuf + 262), soap->tmpbuf + 6, (int)strlen(soap->tmpbuf + 262)); + err = soap->fposthdr(soap, "Proxy-Authorization", soap->tmpbuf); + if (err) + return err; + } +#ifdef WITH_NTLM + } +#endif +#endif +#ifdef WITH_COOKIES +#if defined(WITH_OPENSSL) || defined(WITH_WOLFSSL) + if (soap_putcookies(soap, host, path, soap->ssl != NULL)) + return soap->error; +#else + if (soap_putcookies(soap, host, path, 0)) + return soap->error; +#endif +#endif + if (action && soap->status != SOAP_GET && soap->status != SOAP_DEL) + { + (SOAP_SNPRINTF(soap->tmpbuf, sizeof(soap->tmpbuf), strlen(action) + 2), "\"%s\"", action); + err = soap->fposthdr(soap, "SOAPAction", soap->tmpbuf); + if (err) + return err; + } + return soap->fposthdr(soap, NULL, NULL); +} +#endif + +/******************************************************************************/ + +#ifndef WITH_NOHTTP +static int +http_send_header(struct soap *soap, const char *s) +{ + const char *t; + do + { + t = strchr(s, '\n'); /* disallow \n in HTTP headers */ + if (!t) + t = s + strlen(s); + if (soap_send_raw(soap, s, t - s)) + return soap->error; + s = t + 1; + } while (*t); + return SOAP_OK; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_NOHTTP +static int +http_post_header(struct soap *soap, const char *key, const char *val) +{ + if (key) + { + if (http_send_header(soap, key)) + return soap->error; + if (val && (soap_send_raw(soap, ": ", 2) || http_send_header(soap, val))) + return soap->error; + } + return soap_send_raw(soap, "\r\n", 2); +} +#endif + +/******************************************************************************/ + +#ifndef WITH_NOHTTP +static int +http_response(struct soap *soap, int status, ULONG64 count) +{ + int err; + char http[32]; + int code = status; + const char *line; +#ifdef WMW_RPM_IO + if (soap->rpmreqid) + httpOutputEnable(soap->rpmreqid); + if (soap->rpmreqid + || soap_valid_socket(soap->master) + || soap_valid_socket(soap->socket) + || soap->recvfd != 0 + || soap->sendfd != 1 + || soap->os) /* RPM behaves as if standalone */ +#else + if (soap_valid_socket(soap->master) + || soap_valid_socket(soap->socket) +#ifndef UNDER_CE + || soap->recvfd != 0 + || soap->sendfd != 1 +#else + || soap->recvfd != stdin + || soap->sendfd != stdout +#endif + || soap->os) /* standalone server application (over sockets), not CGI (over stdin/out) */ +#endif + (SOAP_SNPRINTF(http, sizeof(http), strlen(soap->http_version) + 5), "HTTP/%s", soap->http_version); + else + soap_strcpy(http, sizeof(http), "Status:"); + if (status >= SOAP_FILE && status < SOAP_FILE + 600) + { + code = status - SOAP_FILE; + if (code == 0) + code = 200; + } + else if (!status || status == SOAP_HTML) + { + if (count || ((soap->omode & SOAP_IO) == SOAP_IO_CHUNK)) + code = 200; + else + code = 202; + } + else if (status < 200 || status >= 600) + { + const char *s = *soap_faultcode(soap); + if (status >= SOAP_GET_METHOD && status <= SOAP_HTTP_METHOD) + code = 405; + else if (soap->version == 2 && (!s || !strcmp(s, "SOAP-ENV:Sender"))) + code = 400; + else + code = 500; + } + line = http_error(soap, code); + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "HTTP Status = %d %s\n", code, line)); + (SOAP_SNPRINTF(soap->tmpbuf, sizeof(soap->tmpbuf), sizeof(http) + 22 + strlen(line)), "%s %d %s", http, code, line); + err = soap->fposthdr(soap, soap->tmpbuf, NULL); + if (err) + return err; +#ifndef WITH_LEAN + if (status == 401) + { + (SOAP_SNPRINTF_SAFE(soap->tmpbuf, sizeof(soap->tmpbuf)), "Basic realm=\"%s\"", (soap->authrealm && strlen(soap->authrealm) + 14 < sizeof(soap->tmpbuf)) ? soap->authrealm : "gSOAP Web Service"); + err = soap->fposthdr(soap, "WWW-Authenticate", soap->tmpbuf); + if (err) + return err; + } + else if ((status >= 301 && status <= 303) || status == 307) + { + err = soap->fposthdr(soap, "Location", soap->endpoint); + if (err) + return err; + } +#endif + err = soap->fposthdr(soap, "Server", "gSOAP/2.8"); + if (err) + return err; + if (soap->cors_origin) + { + err = soap->fposthdr(soap, "Access-Control-Allow-Origin", soap->cors_origin); + if (err) + return err; + err = soap->fposthdr(soap, "Access-Control-Allow-Credentials", "true"); + if (err) + return err; + if (soap->cors_methods) + { + err = soap->fposthdr(soap, "Access-Control-Allow-Methods", soap->cors_methods); + if (err) + return err; + if (soap->cors_headers) + { + err = soap->fposthdr(soap, "Access-Control-Allow-Headers", soap->cors_headers); + if (err) + return err; + } + } + } + if (soap->x_frame_options) + { + err = soap->fposthdr(soap, "X-Frame-Options", soap->x_frame_options); + if (err) + return err; + } + soap->cors_origin = NULL; + soap->cors_methods = NULL; + soap->cors_headers = NULL; + err = soap_puthttphdr(soap, status, count); + if (err) + return err; +#ifdef WITH_COOKIES + if (soap_putsetcookies(soap)) + return soap->error; + soap_free_cookies(soap); +#endif + return soap->fposthdr(soap, NULL, NULL); +} +#endif + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_response(struct soap *soap, int status) +{ + ULONG64 count; + if (!(soap->omode & (SOAP_ENC_PLAIN | SOAP_IO_STORE /* this tests for chunking too */)) + && (status == SOAP_HTML || (status >= SOAP_FILE && status < SOAP_FILE + 600))) + soap->omode = (soap->omode & ~SOAP_IO) | SOAP_IO_STORE; + soap->status = status; + count = soap_count_attachments(soap); + if (soap_init_send(soap)) + return soap->error; +#ifndef WITH_NOHTTP + if ((soap->mode & SOAP_IO) != SOAP_IO_STORE && !(soap->mode & SOAP_ENC_PLAIN)) + { + int k = soap->mode; + soap->mode &= ~(SOAP_IO | SOAP_ENC_ZLIB); + if ((k & SOAP_IO) != SOAP_IO_FLUSH) + soap->mode |= SOAP_IO_BUFFER; + soap->error = soap->fresponse(soap, status, count); + if (soap->error) + return soap->error; +#ifndef WITH_LEANER + if ((k & SOAP_IO) == SOAP_IO_CHUNK) + { + if (soap_flush(soap)) + return soap->error; + } +#endif + soap->mode = k; + } +#endif +#ifndef WITH_LEANER + if (soap_begin_attachments(soap)) + return soap->error; +#endif + return SOAP_OK; +} + +/******************************************************************************/ + +SOAP_FMAC1 +const char* +SOAP_FMAC2 +soap_extend_url(struct soap *soap, const char *s, const char *t) +{ + if (s) + soap_strcpy(soap->msgbuf, sizeof(soap->msgbuf), s); + else + *soap->msgbuf = '\0'; + if (t && (*t == '/' || *t == '?')) + { + char *r = strchr(soap->msgbuf, '?'); + if (r) + { + if (*t == '?') + { + soap_strcat(soap->msgbuf, sizeof(soap->msgbuf), "&"); + soap_strcat(soap->msgbuf, sizeof(soap->msgbuf), t + 1); + } + else /* *t == '/' */ + { + size_t l = r - soap->msgbuf; + *r = '\0'; + soap_strcat(soap->msgbuf, sizeof(soap->msgbuf), t); + if (s) + soap_strcat(soap->msgbuf, sizeof(soap->msgbuf), s + l); + } + } + else + { + soap_strcat(soap->msgbuf, sizeof(soap->msgbuf), t); + } + } + return soap->msgbuf; +} + +/******************************************************************************/ + +SOAP_FMAC1 +const char* +SOAP_FMAC2 +soap_extend_url_query(struct soap *soap, const char *s, const char *t) +{ + (void)soap_extend_url(soap, s, t); /* fills and returns soap->msgbuf */ + if (strchr(soap->msgbuf, '?')) + soap_strcat(soap->msgbuf, sizeof(soap->msgbuf), "&"); + else + soap_strcat(soap->msgbuf, sizeof(soap->msgbuf), "?"); + return soap->msgbuf; +} + +/******************************************************************************/ + +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_url_query(struct soap *soap, const char *s, const char *t) +{ + size_t n = strlen(s); + if (n) + { + char *r = soap->msgbuf; + size_t k = n - (s[n-1] == '='); + while ((r = strchr(r, '{')) != NULL) + if (!strncmp(++r, s, k) && r[k] == '}') + break; + if (r) + { + size_t m = t ? strlen(t) : 0; + (void)soap_memmove(r + m - 1, soap->msgbuf + sizeof(soap->msgbuf) - (r + n + 1), r + k + 1, strlen(r + k + 1) + 1); + if (m) + (void)soap_memmove(r - 1, soap->msgbuf + sizeof(soap->msgbuf) - (r - 1), t, m); + } + else + { + soap_strcat(soap->msgbuf, sizeof(soap->msgbuf), s); + if (t) + { + int m = (int)strlen(soap->msgbuf); /* msgbuf length is max SOAP_TMPLEN or just 1024 bytes */ + (void)soap_encode_url(t, soap->msgbuf + m, (int)sizeof(soap->msgbuf) - m); + } + soap_strcat(soap->msgbuf, sizeof(soap->msgbuf), "&"); + } + } +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_encode_url(const char *s, char *t, int len) +{ + int c; + int n = len; + if (s && n > 0) + { + while ((c = *s++) && n-- > 1) + { + if (c == '-' + || c == '.' + || (c >= '0' && c <= '9') + || (c >= 'A' && c <= 'Z') + || c == '_' + || (c >= 'a' && c <= 'z') + || c == '~') + { + *t++ = c; + } + else if (n > 2) + { + *t++ = '%'; + *t++ = (c >> 4) + (c > 159 ? '7' : '0'); + c &= 0xF; + *t++ = c + (c > 9 ? '7' : '0'); + n -= 2; + } + else + { + break; + } + } + *t = '\0'; + } + return len - n; +} + +/******************************************************************************/ + +SOAP_FMAC1 +const char* +SOAP_FMAC2 +soap_encode_url_string(struct soap *soap, const char *s) +{ + if (s) + { + int n = 3 * (int)strlen(s) + 1; + char *t = (char*)soap_malloc(soap, n); + if (t) + { + (void)soap_encode_url(s, t, n); + return t; + } + } + return SOAP_STR_EOS; +} + +/******************************************************************************\ + * + * HTTP Cookies RFC 6265 + * +\******************************************************************************/ + +#ifdef WITH_COOKIES + +SOAP_FMAC1 +struct soap_cookie* +SOAP_FMAC2 +soap_cookie(struct soap *soap, const char *name, const char *domain, const char *path) +{ + return soap_cookie_env(soap, name, domain, path, 0); +} + +/******************************************************************************/ + +SOAP_FMAC1 +struct soap_cookie* +SOAP_FMAC2 +soap_cookie_env(struct soap *soap, const char *name, const char *domain, const char *path, short env) +{ + struct soap_cookie *p; + if (!domain && !env) + domain = soap->cookie_domain; + if (!path) + path = soap->cookie_path; + if (!path) + path = SOAP_STR_EOS; + else if (*path == '/') + path++; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Search cookie='%s' domain='%s' path='%s' env=%hd\n", name, domain ? domain : "(null)", path ? path : "(null)", env)); + for (p = soap->cookies; p; p = p->next) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Cookie in database: %s='%s' domain='%s' path='%s' env=%hd\n", p->name, p->value ? p->value : "(null)", p->domain ? p->domain : "(null)", p->path ? p->path : "(null)", p->env)); + if ((!env || p->env) + && !strcmp(p->name, name) + && (!domain || (domain && p->domain && !strcmp(p->domain, domain))) + && (!path || (path && p->path && !strncmp(p->path, path, strlen(p->path))))) + break; + } + return p; +} + +/******************************************************************************/ + +SOAP_FMAC1 +struct soap_cookie* +SOAP_FMAC2 +soap_set_cookie(struct soap *soap, const char *name, const char *value, const char *domain, const char *path) +{ + struct soap_cookie **p, *q; + int n; + if (!domain) + domain = soap->cookie_domain; + if (!path) + path = soap->cookie_path; + if (!path) + path = SOAP_STR_EOS; + else if (*path == '/') + path++; + q = soap_cookie(soap, name, domain, path); + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Set %scookie: %s='%s' domain='%s' path='%s'\n", q ? SOAP_STR_EOS : "new ", name, value ? value : "(null)", domain ? domain : "(null)", path ? path : "(null)")); + if (!q) + { + q = (struct soap_cookie*)SOAP_MALLOC(soap, sizeof(struct soap_cookie)); + if (q) + { + size_t l = strlen(name) + 1; + q->name = NULL; + if (SOAP_MAXALLOCSIZE <= 0 || l <= SOAP_MAXALLOCSIZE) + q->name = (char*)SOAP_MALLOC(soap, l); + if (q->name) + (void)soap_memcpy(q->name, l, name, l); + q->value = NULL; + q->domain = NULL; + q->path = NULL; + q->expire = 0; + q->maxage = -1; + q->version = 1; + q->secure = 0; + q->modified = 0; + for (p = &soap->cookies, n = soap->cookie_max; *p && n; p = &(*p)->next, n--) + if ((*p)->name && !strcmp((*p)->name, name) && (*p)->path && path && strcmp((*p)->path, path) < 0) + break; + if (n) + { + q->next = *p; + *p = q; + } + else + { + if (q->name) + SOAP_FREE(soap, q->name); + SOAP_FREE(soap, q); + q = NULL; + } + } + } + else + { + q->modified = 1; + } + if (q) + { + if (q->value) + { + if (!value || strcmp(value, q->value)) + { + SOAP_FREE(soap, q->value); + q->value = NULL; + } + } + if (value && *value && !q->value) + { + size_t l = strlen(value) + 1; + q->value = NULL; + if (SOAP_MAXALLOCSIZE <= 0 || l <= SOAP_MAXALLOCSIZE) + q->value = (char*)SOAP_MALLOC(soap, l); + if (q->value) + soap_strcpy(q->value, l, value); + } + if (q->domain) + { + if (!domain || strcmp(domain, q->domain)) + { + SOAP_FREE(soap, q->domain); + q->domain = NULL; + } + } + if (domain && !q->domain) + { + size_t l = strlen(domain) + 1; + q->domain = NULL; + if (SOAP_MAXALLOCSIZE <= 0 || l <= SOAP_MAXALLOCSIZE) + q->domain = (char*)SOAP_MALLOC(soap, l); + if (q->domain) + soap_strcpy(q->domain, l, domain); + } + if (q->path) + { + if (!path || strncmp(path, q->path, strlen(q->path))) + { + SOAP_FREE(soap, q->path); + q->path = NULL; + } + } + if (path && !q->path) + { + size_t l = strlen(path) + 1; + q->path = NULL; + if (SOAP_MAXALLOCSIZE <= 0 || l <= SOAP_MAXALLOCSIZE) + q->path = (char*)SOAP_MALLOC(soap, l); + if (q->path) + soap_strcpy(q->path, l, path); + } + q->session = 1; + q->env = 0; + } + return q; +} + +/******************************************************************************/ + +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_clr_cookie(struct soap *soap, const char *name, const char *domain, const char *path) +{ + struct soap_cookie **p, *q; + if (!domain) + domain = soap->cookie_domain; + if (!domain) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Error in clear cookie='%s': cookie domain not set\n", name ? name : "(null)")); + return; + } + if (!path) + path = soap->cookie_path; + if (!path) + path = SOAP_STR_EOS; + else if (*path == '/') + path++; + for (p = &soap->cookies, q = *p; q; q = *p) + { + if (q->name && !strcmp(q->name, name) && (!q->domain || !strcmp(q->domain, domain)) && (!q->path || !strncmp(q->path, path, strlen(q->path)))) + { + SOAP_FREE(soap, q->name); + if (q->value) + SOAP_FREE(soap, q->value); + if (q->domain) + SOAP_FREE(soap, q->domain); + if (q->path) + SOAP_FREE(soap, q->path); + *p = q->next; + SOAP_FREE(soap, q); + } + else + { + p = &q->next; + } + } +} + +/******************************************************************************/ + +SOAP_FMAC1 +const char * +SOAP_FMAC2 +soap_cookie_value(struct soap *soap, const char *name, const char *domain, const char *path) +{ + struct soap_cookie *p; + p = soap_cookie(soap, name, domain, path); + if (p) + return p->value; + return NULL; +} + +/******************************************************************************/ + +SOAP_FMAC1 +const char * +SOAP_FMAC2 +soap_env_cookie_value(struct soap *soap, const char *name, const char *domain, const char *path) +{ + struct soap_cookie *p; + p = soap_cookie(soap, name, domain, path); + if (p && p->env) + return p->value; + return NULL; +} + +/******************************************************************************/ + +SOAP_FMAC1 +time_t +SOAP_FMAC2 +soap_cookie_expire(struct soap *soap, const char *name, const char *domain, const char *path) +{ + struct soap_cookie *p; + p = soap_cookie(soap, name, domain, path); + if (p) + return (time_t)p->expire; + return -1; +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_set_cookie_expire(struct soap *soap, const char *name, long maxage, const char *domain, const char *path) +{ + struct soap_cookie *p; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Set cookie expiration max-age=%ld: cookie='%s' domain='%s' path='%s'\n", maxage, name, domain ? domain : "(null)", path ? path : "(null)")); + p = soap_cookie(soap, name, domain, path); + if (p) + { + p->maxage = maxage; + p->modified = 1; + return SOAP_OK; + } + return SOAP_ERR; +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_set_cookie_secure(struct soap *soap, const char *name, const char *domain, const char *path) +{ + struct soap_cookie *p; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Set cookie secure: cookie='%s' domain='%s' path='%s'\n", name, domain ? domain : "(null)", path ? path : "(null)")); + p = soap_cookie(soap, name, domain, path); + if (p) + { + p->secure = 1; + p->modified = 1; + return SOAP_OK; + } + return SOAP_ERR; +} +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_set_cookie_session(struct soap *soap, const char *name, const char *domain, const char *path) +{ + struct soap_cookie *p; + p = soap_cookie(soap, name, domain, path); + if (p) + { + p->session = 1; + p->modified = 1; + return SOAP_OK; + } + return SOAP_ERR; +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_clr_cookie_session(struct soap *soap, const char *name, const char *domain, const char *path) +{ + struct soap_cookie *p; + p = soap_cookie(soap, name, domain, path); + if (p) + { + p->session = 0; + p->modified = 1; + return SOAP_OK; + } + return SOAP_ERR; +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_putsetcookies(struct soap *soap) +{ + char tmp[4096]; + struct soap_cookie *p; + for (p = soap->cookies; p; p = p->next) + { + if ((p->modified +#if defined(WITH_OPENSSL) || defined(WITH_WOLFSSL) + || (!p->env && !soap->ssl == !p->secure) +#endif + ) && p->name && p->value && *p->name && *p->value) + { + char *s = tmp; + const char *t; + s += soap_encode_url(p->name, s, 3967); + *s++ = '='; + s += soap_encode_url(p->value, s, 3968 - (int)(s-tmp)); + t = p->domain ? p->domain : soap->cookie_domain; + if (t && (int)strlen(t) < 3968 - (int)(s-tmp)) + { + soap_strcpy(s, 4096 - (s-tmp), ";Domain="); + s += 8; + soap_strcpy(s, 4096 - (s-tmp), t); + s += strlen(s); + } + t = p->path ? p->path : soap->cookie_path; + if (t && (int)strlen(t) < 3976 - (int)(s-tmp)) + { + soap_strcpy(s, 4096 - (s-tmp), ";Path=/"); + s += 7; + if (*t == '/') + t++; + if (strchr(t, '%')) /* already URL encoded? */ + { + soap_strcpy(s, 4096 - (s-tmp), t); + s += strlen(s); + } + else + { + s += soap_encode_url(t, s, 4096 - (int)(s-tmp)); + } + } + if (p->version > 0 && s-tmp < 3983) + { + (SOAP_SNPRINTF(s, 4096 - (s-tmp), 29), ";Version=%u", p->version); + s += strlen(s); + } + if (p->maxage >= 0 && s-tmp < 4012) + { + (SOAP_SNPRINTF(s, 4096 - (s-tmp), 29), ";Max-Age=%ld", p->maxage); + s += strlen(s); + } +#if !defined(WITH_LEAN) +#if defined(HAVE_GMTIME_R) || defined(HAVE_GMTIME) + if (p->maxage >= 0 && s-tmp < 4041) + { + time_t n = time(NULL) + p->maxage; + struct tm T, *pT = &T; + size_t l = 0; + /* format is Wed, 09 Jun 2021 10:18:14 GMT */ +#if defined(HAVE_GMTIME_R) + if (gmtime_r(&n, pT) != SOAP_FUNC_R_ERR) + l = strftime(s, 4096 - (s-tmp), ";Expires=%a, %d %b %Y %H:%M:%S GMT", pT); +#else + pT = gmtime(&n); + if (pT) + l = strftime(s, 4096 - (s-tmp), ";Expires=%a, %d %b %Y %H:%M:%S GMT", pT); +#endif + s += l; + } +#endif +#endif + if (s-tmp < 4079 + && (p->secure +#if defined(WITH_OPENSSL) || defined(WITH_WOLFSSL) + || soap->ssl +#endif + )) + { + soap_strcpy(s, 4096 - (s-tmp), ";Secure"); + s += strlen(s); + } + if (s-tmp < 4086) + soap_strcpy(s, 4096 - (s-tmp), ";HttpOnly"); + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Set-Cookie: %s\n", tmp)); + soap->error = soap->fposthdr(soap, "Set-Cookie", tmp); + if (soap->error) + return soap->error; + } + } + return SOAP_OK; +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_putcookies(struct soap *soap, const char *domain, const char *path, int secure) +{ + struct soap_cookie **p, *q; + char tmp[4096]; + unsigned int version = 0; + time_t now = time(NULL); + char *s = tmp; + if (!domain || !path) + return SOAP_OK; + p = &soap->cookies; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Sending cookies for domain='%s' path='%s'\n", domain, path)); + if (*path == '/') + path++; + while ((q = *p)) + { + if (q->expire && now >= (time_t)q->expire) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Cookie %s expired\n", q->name)); + SOAP_FREE(soap, q->name); + if (q->value) + SOAP_FREE(soap, q->value); + if (q->domain) + SOAP_FREE(soap, q->domain); + if (q->path) + SOAP_FREE(soap, q->path); + *p = q->next; + SOAP_FREE(soap, q); + } + else + { + int flag; + char *t = q->domain; + size_t n = 0; + if (!t) + { + flag = 1; + } + else + { + const char *r = strchr(t, ':'); + if (r) + n = r - t; + else + n = strlen(t); + flag = !strncmp(t, domain, n); + } + /* domain-level cookies, cannot compile when WITH_NOIO set */ +#ifndef WITH_NOIO + if (!flag) + { + struct hostent hostent; + if (!tcp_gethostbyname(soap, (char*)domain, &hostent, NULL)) + { + const char *r = hostent.h_name; + if (*t == '.') + { + size_t k = strlen(hostent.h_name); + if (k >= n) + r = hostent.h_name + k - n; + } + flag = !strncmp(t, r, n); + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Domain cookie %s host %s (match=%d)\n", t, r, flag)); + } + } +#endif + if (flag + && (!q->path || !strncmp(q->path, path, strlen(q->path))) +#ifndef WITH_INSECURE_COOKIES + && (!q->secure || secure) +#endif + ) + { + size_t n = 12; + if (q->name) + n += 3*strlen(q->name); + if (q->value && *q->value) + n += 3*strlen(q->value) + 1; + if (q->path && *q->path) + n += strlen(q->path) + 9; + if (q->domain) + n += strlen(q->domain) + 11; + if (s + n >= tmp + sizeof(tmp)) + { + if (s == tmp) + return SOAP_OK; /* header too big, cannot split */ + /* split up HTTP header */ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Cookie: %s\n", tmp)); + soap->error = soap->fposthdr(soap, "Cookie", tmp); + if (soap->error) + return soap->error; + s = tmp; + } + else if (s != tmp) + { + *s++ = ';'; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Sending cookie %s=%s path=\"/%s\" domain=\"%s\"\n", q->name ? q->name : "(null)", q->value ? q->value : "(null)", q->path ? q->path : "(null)", q->domain ? q->domain : "(null)")); + if (q->version != version && (s-tmp) + (size_t)36 < sizeof(tmp)) + { + (SOAP_SNPRINTF_SAFE(s, sizeof(tmp) - (s-tmp)), "$Version=%u;", q->version); + version = q->version; + s += strlen(s); + } + if (q->name && (s-tmp) + strlen(q->name) + (size_t)15 < sizeof(tmp)) + { + s += soap_encode_url(q->name, s, (int)(tmp+sizeof(tmp)-s)-15); + } + if (q->value && *q->value && (s-tmp) + strlen(q->value) + (size_t)16 < sizeof(tmp)) + { + *s++ = '='; + s += soap_encode_url(q->value, s, (int)(tmp+sizeof(tmp)-s)-16); + } + if (q->path && (s-tmp) + strlen(q->path) + (size_t)36 < sizeof(tmp)) + { + (SOAP_SNPRINTF_SAFE(s, sizeof(tmp) - (s-tmp)), ";$Path=\"/%s\"", (*q->path == '/' ? q->path + 1 : q->path)); + s += strlen(s); + } + if (q->domain && (s-tmp) + strlen(q->domain) + (size_t)36 < sizeof(tmp)) + { + (SOAP_SNPRINTF_SAFE(s, sizeof(tmp) - (s-tmp)), ";$Domain=\"%s\"", q->domain); + s += strlen(s); + } + } + p = &q->next; + } + } + if (s != tmp) + { + soap->error = soap->fposthdr(soap, "Cookie", tmp); + if (soap->error) + return soap->error; + } + return SOAP_OK; +} + +/******************************************************************************/ + +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_getcookies(struct soap *soap, const char *val) +{ + struct soap_cookie *p = NULL, *q = NULL; + const char *s = val; + char tmp[4096]; /* cookie size is up to 4096 bytes [RFC2109] */ + char *domain = NULL; + char *path = NULL; + unsigned int version = 0; + time_t now = time(NULL); + if (!s) + return; + while (*s) + { + s = soap_decode_key(tmp, sizeof(tmp), s); + if (!soap_tag_cmp(tmp, "$Version")) + { + s = soap_decode_val(tmp, sizeof(tmp), s); + if (s) + { + if (p) + p->version = (int)soap_strtol(tmp, NULL, 10); + else + version = (int)soap_strtol(tmp, NULL, 10); + } + } + else if (!soap_tag_cmp(tmp, "$Path")) + { + char *t = NULL; + s = soap_decode_val(tmp, sizeof(tmp), s); + if (*tmp) + { + size_t l = strlen(tmp) + 1; + if (SOAP_MAXALLOCSIZE <= 0 || l <= SOAP_MAXALLOCSIZE) + t = (char*)SOAP_MALLOC(soap, l); + if (t) + (void)soap_memcpy((void*)t, l, (const void*)tmp, l); + } + if (p) + { + if (p->path) + SOAP_FREE(soap, p->path); + p->path = t; + } + else + { + if (path) + SOAP_FREE(soap, path); + path = t; + } + } + else if (!soap_tag_cmp(tmp, "$Domain")) + { + char *t = NULL; + s = soap_decode_val(tmp, sizeof(tmp), s); + if (*tmp) + { + size_t l = strlen(tmp) + 1; + if (SOAP_MAXALLOCSIZE <= 0 || l <= SOAP_MAXALLOCSIZE) + t = (char*)SOAP_MALLOC(soap, l); + if (t) + (void)soap_memcpy((void*)t, l, (const void*)tmp, l); + } + if (p) + { + if (p->domain) + SOAP_FREE(soap, p->domain); + p->domain = t; + } + else + { + if (domain) + SOAP_FREE(soap, domain); + domain = t; + } + } + else if (p && !soap_tag_cmp(tmp, "Path")) + { + if (p->path) + SOAP_FREE(soap, p->path); + p->path = NULL; + s = soap_decode_val(tmp, sizeof(tmp), s); + if (*tmp) + { + size_t l = strlen(tmp) + 1; + if (SOAP_MAXALLOCSIZE <= 0 || l <= SOAP_MAXALLOCSIZE) + p->path = (char*)SOAP_MALLOC(soap, l); + if (p->path) + (void)soap_memcpy((void*)p->path, l, (const void*)tmp, l); + } + } + else if (p && !soap_tag_cmp(tmp, "Domain")) + { + if (p->domain) + SOAP_FREE(soap, p->domain); + p->domain = NULL; + s = soap_decode_val(tmp, sizeof(tmp), s); + if (*tmp) + { + size_t l = strlen(tmp) + 1; + if (SOAP_MAXALLOCSIZE <= 0 || l <= SOAP_MAXALLOCSIZE) + p->domain = (char*)SOAP_MALLOC(soap, l); + if (p->domain) + (void)soap_memcpy((void*)p->domain, l, (const void*)tmp, l); + } + } + else if (p && !soap_tag_cmp(tmp, "Version")) + { + s = soap_decode_val(tmp, sizeof(tmp), s); + p->version = (unsigned int)soap_strtoul(tmp, NULL, 10); + } + else if (p && !soap_tag_cmp(tmp, "Max-Age")) + { + s = soap_decode_val(tmp, sizeof(tmp), s); + p->expire = (ULONG64)(now + soap_strtol(tmp, NULL, 10)); + } + else if (p && !soap_tag_cmp(tmp, "Expires")) + { + if (*s == '=') + { + s = soap_decode(tmp, sizeof(tmp), s + 1, ";"); + if (!p->expire && strlen(tmp) >= 23) + { + char a[3]; + struct tm T; + static const char mns[] = "anebarprayunulugepctovec"; + const char *t = strchr(tmp, ' '); + if (t) + { + a[2] = '\0'; + memset((void*)&T, 0, sizeof(T)); + if (t[1] >= 'A') + { + /* format is Sun Nov 6 08:49:37 94 */ + a[0] = t[2]; + a[1] = t[3]; + T.tm_mon = (int)(strstr(mns, a) - mns) / 2; + a[0] = t[5]; + a[1] = t[6]; + T.tm_mday = (int)soap_strtol(a, NULL, 10); + if (t[17] && t[18] && t[19] != ' ') + t += 2; /* format is Sun Nov 6 08:49:37 2017 - ANSI-C */ + a[0] = t[17]; + a[1] = t[18]; + T.tm_year = 100 + (int)soap_strtol(a, NULL, 10); + t += 6; + } + else + { + /* format is Sunday, 06-Nov-17 08:49:37 GMT - RFC 850 */ + a[0] = t[1]; + a[1] = t[2]; + T.tm_mday = (int)soap_strtol(a, NULL, 10); + a[0] = t[5]; + a[1] = t[6]; + T.tm_mon = (int)(strstr(mns, a) - mns) / 2; + if (t[10] != ' ') + t += 2; /* format is Wed, 09 Jun 2021 10:18:14 GMT - RFC 822 */ + a[0] = t[8]; + a[1] = t[9]; + T.tm_year = 100 + (int)soap_strtol(a, NULL, 10); + t += 11; + } + a[0] = t[0]; + a[1] = t[1]; + T.tm_hour = (int)soap_strtol(a, NULL, 10); + a[0] = t[3]; + a[1] = t[4]; + T.tm_min = (int)soap_strtol(a, NULL, 10); + a[0] = t[6]; + a[1] = t[7]; + T.tm_sec = (int)soap_strtol(a, NULL, 10); + p->expire = (ULONG64)soap_timegm(&T); + } + } + } + } + else if (p && !soap_tag_cmp(tmp, "Secure")) + { + p->secure = 1; + s = soap_decode_val(tmp, sizeof(tmp), s); + } + else if (p && !soap_tag_cmp(tmp, "HttpOnly")) + { + s = soap_decode_val(tmp, sizeof(tmp), s); + } + else if (p && !soap_tag_cmp(tmp, "Comment")) + { + s = soap_decode_val(tmp, sizeof(tmp), s); + } + else if (*tmp) + { + if (p) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Got environment cookie='%s' value='%s' domain='%s' path='%s' expire=" SOAP_ULONG_FORMAT " secure=%d\n", p->name, p->value ? p->value : "(null)", p->domain ? p->domain : "(null)", p->path ? p->path : "(null)", p->expire, p->secure)); + q = soap_set_cookie(soap, p->name, p->value, p->domain, p->path); + if (q) + { + q->version = p->version; + q->expire = p->expire; + q->secure = p->secure; + q->env = 1; + } + if (p->name) + SOAP_FREE(soap, p->name); + if (p->value) + SOAP_FREE(soap, p->value); + if (p->domain) + SOAP_FREE(soap, p->domain); + if (p->path) + SOAP_FREE(soap, p->path); + SOAP_FREE(soap, p); + } + p = (struct soap_cookie*)SOAP_MALLOC(soap, sizeof(struct soap_cookie)); + if (p) + { + size_t l = strlen(tmp) + 1; + p->name = NULL; + if (SOAP_MAXALLOCSIZE <= 0 || l <= SOAP_MAXALLOCSIZE) + p->name = (char*)SOAP_MALLOC(soap, l); + if (p->name) + (void)soap_memcpy(p->name, l, tmp, l); + s = soap_decode_val(tmp, sizeof(tmp), s); + p->value = NULL; + if (*tmp) + { + l = strlen(tmp) + 1; + if (SOAP_MAXALLOCSIZE <= 0 || l <= SOAP_MAXALLOCSIZE) + p->value = (char*)SOAP_MALLOC(soap, l); + if (p->value) + (void)soap_memcpy((void*)p->value, l, (const void*)tmp, l); + } + if (domain) + { + p->domain = domain; + domain = NULL; + } + else + { + p->domain = NULL; + } + if (path) + { + p->path = path; + path = NULL; + } + else if (*soap->path) + { + l = strlen(soap->path) + 1; + p->path = NULL; + if (SOAP_MAXALLOCSIZE <= 0 || l <= SOAP_MAXALLOCSIZE) + p->path = (char*)SOAP_MALLOC(soap, l); + if (p->path) + (void)soap_memcpy((void*)p->path, l, (const void*)soap->path, l); + } + else + { + p->path = (char*)SOAP_MALLOC(soap, 2); + if (p->path) + (void)soap_memcpy((void*)p->path, 2, (const void*)"/", 2); + } + p->expire = 0; + p->secure = 0; + p->version = version; + } + } + } + if (p) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Got environment cookie='%s' value='%s' domain='%s' path='%s' expire=" SOAP_ULONG_FORMAT " secure=%d\n", p->name, p->value ? p->value : "(null)", p->domain ? p->domain : "(null)", p->path ? p->path : "(null)", p->expire, p->secure)); + q = soap_set_cookie(soap, p->name, p->value, p->domain, p->path); + if (q) + { + q->version = p->version; + q->expire = p->expire; + q->secure = p->secure; + q->env = 1; + } + if (p->name) + SOAP_FREE(soap, p->name); + if (p->value) + SOAP_FREE(soap, p->value); + if (p->domain) + SOAP_FREE(soap, p->domain); + if (p->path) + SOAP_FREE(soap, p->path); + SOAP_FREE(soap, p); + } + if (domain) + SOAP_FREE(soap, domain); + if (path) + SOAP_FREE(soap, path); +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_getenv_cookies(struct soap *soap) +{ + struct soap_cookie *p; + const char *s; + char key[4096], val[4096]; /* cookie size is up to 4096 bytes [RFC2109] */ + s = getenv("HTTP_COOKIE"); + if (!s) + return SOAP_ERR; + do + { + s = soap_decode_key(key, sizeof(key), s); + s = soap_decode_val(val, sizeof(val), s); + p = soap_set_cookie(soap, key, val, NULL, NULL); + if (p) + p->env = 1; + } while (*s); + return SOAP_OK; +} + +/******************************************************************************/ + +SOAP_FMAC1 +struct soap_cookie* +SOAP_FMAC2 +soap_copy_cookies(struct soap *copy, const struct soap *soap) +{ + struct soap_cookie *p, **q, *r; + (void)copy; + q = &r; + for (p = soap->cookies; p; p = p->next) + { + *q = (struct soap_cookie*)SOAP_MALLOC(copy, sizeof(struct soap_cookie)); + if (!*q) + return r; + **q = *p; + if (p->name) + { + size_t l = strlen(p->name) + 1; + (*q)->name = NULL; + if (SOAP_MAXALLOCSIZE <= 0 || l <= SOAP_MAXALLOCSIZE) + (*q)->name = (char*)SOAP_MALLOC(copy, l); + if ((*q)->name) + (void)soap_memcpy((*q)->name, l, p->name, l); + } + if (p->value) + { + size_t l = strlen(p->value) + 1; + (*q)->value = NULL; + if (SOAP_MAXALLOCSIZE <= 0 || l <= SOAP_MAXALLOCSIZE) + (*q)->value = (char*)SOAP_MALLOC(copy, l); + if ((*q)->value) + (void)soap_memcpy((*q)->value, l, p->value, l); + } + if (p->domain) + { + size_t l = strlen(p->domain) + 1; + (*q)->domain = NULL; + if (SOAP_MAXALLOCSIZE <= 0 || l <= SOAP_MAXALLOCSIZE) + (*q)->domain = (char*)SOAP_MALLOC(copy, l); + if ((*q)->domain) + (void)soap_memcpy((*q)->domain, l, p->domain, l); + } + if (p->path) + { + size_t l = strlen(p->path) + 1; + (*q)->path = NULL; + if (SOAP_MAXALLOCSIZE <= 0 || l <= SOAP_MAXALLOCSIZE) + (*q)->path = (char*)SOAP_MALLOC(copy, l); + if ((*q)->path) + (void)soap_memcpy((*q)->path, l, p->path, l); + } + q = &(*q)->next; + } + *q = NULL; + return r; +} + +/******************************************************************************/ + +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_free_cookies(struct soap *soap) +{ + struct soap_cookie *p; + for (p = soap->cookies; p; p = soap->cookies) + { + soap->cookies = p->next; + SOAP_FREE(soap, p->name); + if (p->value) + SOAP_FREE(soap, p->value); + if (p->domain) + SOAP_FREE(soap, p->domain); + if (p->path) + SOAP_FREE(soap, p->path); + SOAP_FREE(soap, p); + } +} + +/******************************************************************************/ + +#endif /* WITH_COOKIES */ + +/******************************************************************************/ + +SOAP_FMAC1 +size_t +SOAP_FMAC2 +soap_hash(const char *s) +{ + size_t h = 0; + while (*s) + h = *s++ + (h << 6) + (h << 16) - h; /* Red Dragon book h = 65599*h + c */ + return h % SOAP_IDHASH; +} + +/******************************************************************************/ + +static void +soap_init_pht(struct soap *soap) +{ + int i; + soap->pblk = NULL; + soap->pidx = 0; + for (i = 0; i < (int)SOAP_PTRHASH; i++) + soap->pht[i] = NULL; +} + +/******************************************************************************/ + +SOAP_FMAC1 +struct soap* +SOAP_FMAC2 +soap_versioning(soap_new)(soap_mode imode, soap_mode omode) +{ + struct soap *soap; +#ifdef __cplusplus + soap = SOAP_NEW_UNMANAGED(struct soap); +#else + soap = (struct soap*)SOAP_MALLOC_UNMANAGED(sizeof(struct soap)); +#endif + if (soap) + soap_versioning(soap_init)(soap, imode, omode); + return soap; +} + +/******************************************************************************/ + +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_free(struct soap *soap) +{ + soap_done(soap); +#ifdef __cplusplus + SOAP_DELETE_UNMANAGED(soap); +#else + SOAP_FREE_UNMANAGED(soap); +#endif +} + +/******************************************************************************/ + +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_del(struct soap *soap) +{ + free(soap); +} + +/******************************************************************************/ + +static void +soap_free_pht(struct soap *soap) +{ + struct soap_pblk *pb, *next; + int i; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Free pointer hashtable\n")); + for (pb = soap->pblk; pb; pb = next) + { + next = pb->next; + SOAP_FREE(soap, pb); + } + soap->pblk = NULL; + soap->pidx = 0; + for (i = 0; i < (int)SOAP_PTRHASH; i++) + soap->pht[i] = NULL; +} + +/******************************************************************************/ + +#ifndef WITH_NOIDREF +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_embed(struct soap *soap, const void *p, const void *a, int n, int t) +{ + int id; + struct soap_plist *pp; + if (soap->version == 2) + soap->encoding = 1; + if (!p || (!soap->encodingStyle && !(soap->mode & SOAP_XML_GRAPH)) || (soap->mode & SOAP_XML_TREE)) + return 0; + if (a) + id = soap_array_pointer_lookup(soap, p, a, n, t, &pp); + else + id = soap_pointer_lookup(soap, p, t, &pp); + if (id) + { + if (soap_is_embedded(soap, pp) || soap_is_single(soap, pp)) + return 0; + soap_set_embedded(soap, pp); + } + return id; +} +#endif + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_pointer_lookup(struct soap *soap, const void *p, int type, struct soap_plist **ppp) +{ + struct soap_plist *pp; + *ppp = NULL; + if (p) + { + for (pp = soap->pht[soap_hash_ptr(p)]; pp; pp = pp->next) + { + if (pp->ptr == p && pp->type == type) + { + *ppp = pp; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Lookup location=%p type=%d id=%d\n", p, type, pp->id)); + return pp->id; + } + } + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Lookup location=%p type=%d: not found\n", p, type)); + return 0; +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_pointer_enter(struct soap *soap, const void *p, const void *a, int n, int type, struct soap_plist **ppp) +{ + size_t h; + struct soap_plist *pp; + (void)n; + if (!soap->pblk || soap->pidx >= SOAP_PTRBLK) + { + struct soap_pblk *pb = (struct soap_pblk*)SOAP_MALLOC(soap, sizeof(struct soap_pblk)); + if (!pb) + { + soap->error = SOAP_EOM; + return 0; + } + pb->next = soap->pblk; + soap->pblk = pb; + soap->pidx = 0; + } + *ppp = pp = &soap->pblk->plist[soap->pidx++]; + if (a) + h = soap_hash_ptr(a); + else + h = soap_hash_ptr(p); + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Pointer enter location=%p array=%p size=%lu type=%d id=%d\n", p, a, (unsigned long)n, type, soap->idnum+1)); + pp->next = soap->pht[h]; + pp->type = type; + pp->mark1 = 0; + pp->mark2 = 0; + pp->ptr = p; + pp->dup = NULL; + pp->array = a; + pp->size = n; + soap->pht[h] = pp; + pp->id = ++soap->idnum; + return pp->id; +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_array_pointer_lookup(struct soap *soap, const void *p, const void *a, int n, int type, struct soap_plist **ppp) +{ + struct soap_plist *pp; + *ppp = NULL; + if (!p || !a) + return 0; + for (pp = soap->pht[soap_hash_ptr(a)]; pp; pp = pp->next) + { + if (pp->type == type && pp->array == a && pp->size == n) + { + *ppp = pp; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Array lookup location=%p type=%d id=%d\n", a, type, pp->id)); + return pp->id; + } + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Array lookup location=%p type=%d: not found\n", a, type)); + return 0; +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_begin_count(struct soap *soap) +{ + soap_free_ns(soap); + soap->error = SOAP_OK; +#ifndef WITH_LEANER + if ((soap->mode & SOAP_ENC_DIME) || (soap->omode & SOAP_ENC_DIME)) + { + soap->mode = soap->omode | SOAP_IO_LENGTH | SOAP_ENC_DIME; + } + else +#endif + { + soap->mode = soap->omode; + if ((soap->mode & SOAP_IO_UDP)) + { + soap->mode &= SOAP_IO; + soap->mode |= SOAP_IO_BUFFER | SOAP_ENC_PLAIN; + } + if ((soap->mode & SOAP_IO) == SOAP_IO_STORE + || (((soap->mode & SOAP_IO) == SOAP_IO_CHUNK || (soap->mode & SOAP_ENC_PLAIN)) +#ifndef WITH_LEANER + && !soap->fpreparesend +#endif + )) + soap->mode &= ~SOAP_IO_LENGTH; + else + soap->mode |= SOAP_IO_LENGTH; + } +#ifdef WITH_ZLIB + if ((soap->mode & SOAP_ENC_ZLIB) && (soap->mode & SOAP_IO) == SOAP_IO_FLUSH) + { + if (!(soap->mode & SOAP_ENC_DIME)) + soap->mode &= ~SOAP_IO_LENGTH; + if ((soap->mode & SOAP_ENC_PLAIN)) + soap->mode |= SOAP_IO_BUFFER; + else + soap->mode |= SOAP_IO_STORE; + } +#endif +#ifndef WITH_LEANER + if ((soap->mode & SOAP_ENC_MTOM) && (soap->mode & SOAP_ENC_DIME)) + soap->mode |= SOAP_ENC_MIME; + else if (!(soap->mode & SOAP_ENC_MIME)) + soap->mode &= ~SOAP_ENC_MTOM; + if ((soap->mode & SOAP_ENC_MIME)) + soap_select_mime_boundary(soap); + soap->dime.list = soap->dime.last; /* keep track of last DIME attachment */ +#endif + soap->count = 0; + soap->ns = 0; + soap->null = 0; + soap->position = 0; + soap->mustUnderstand = 0; + soap->encoding = 0; + soap->part = SOAP_BEGIN_SEND; + soap->event = 0; + soap->evlev = 0; + soap->idnum = 0; + soap->body = 1; + soap->level = 0; + soap_clr_attr(soap); + soap_set_local_namespaces(soap); +#ifndef WITH_LEANER + soap->dime.size = 0; /* accumulate total size of attachments */ + if (soap->fprepareinitsend && (soap->mode & SOAP_IO) != SOAP_IO_STORE && (soap->error = soap->fprepareinitsend(soap)) != SOAP_OK) + return soap->error; +#endif + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Begin count phase (socket=%d mode=0x%x count=" SOAP_ULONG_FORMAT ")\n", (int)soap->socket, (unsigned int)soap->mode, soap->count)); +#ifndef WITH_LEANER + if ((soap->mode & SOAP_IO_LENGTH)) + return soap_begin_attachments(soap); +#endif + return SOAP_OK; +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_end_count(struct soap *soap) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "End of count phase\n")); +#ifndef WITH_LEANER + if ((soap->mode & SOAP_IO_LENGTH)) + { + if (soap_end_attachments(soap)) + return soap->error; + if (soap->fpreparefinalsend && (soap->error = soap->fpreparefinalsend(soap)) != SOAP_OK) + return soap->error; + } +#else + (void)soap; +#endif + return SOAP_OK; +} + +/******************************************************************************/ + +static int +soap_init_send(struct soap *soap) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Initializing for output to socket=%d/fd=%d\n", (int)soap->socket, soap->sendfd)); + *soap->tag = '\0'; + soap_free_ns(soap); + soap->error = SOAP_OK; + soap->mode = soap->omode | (soap->mode & (SOAP_IO_LENGTH | SOAP_ENC_DIME)); +#ifndef WITH_LEAN + if ((soap->mode & SOAP_IO_UDP)) + { + soap->mode &= ~SOAP_IO; + soap->mode |= SOAP_IO_BUFFER | SOAP_ENC_PLAIN; + if ((soap->mode & SOAP_IO_LENGTH) && soap->count > sizeof(soap->buf)) + return soap->error = SOAP_UDP_ERROR; + } +#endif +#ifdef WITH_ZLIB + if ((soap->mode & SOAP_ENC_ZLIB) && (soap->mode & SOAP_IO) == SOAP_IO_FLUSH) + { + if ((soap->mode & SOAP_ENC_PLAIN)) + soap->mode |= SOAP_IO_BUFFER; + else + soap->mode |= SOAP_IO_STORE; + } +#endif +#if !defined(__cplusplus) || defined(WITH_COMPAT) + if (soap->os) + { + *soap->os = NULL; + soap->mode = (soap->mode & ~SOAP_IO) | SOAP_IO_STORE; + } + else +#endif + if ((soap->mode & SOAP_IO) == SOAP_IO_FLUSH && soap_valid_socket(soap->socket)) + { + if ((soap->mode & SOAP_IO_LENGTH) || (soap->mode & SOAP_ENC_PLAIN)) + soap->mode |= SOAP_IO_BUFFER; + else + soap->mode |= SOAP_IO_STORE; + } + soap->mode &= ~SOAP_IO_LENGTH; + if ((soap->mode & SOAP_IO) == SOAP_IO_STORE && soap_alloc_block(soap) == NULL) + return soap->error; + if (!(soap->mode & SOAP_IO_KEEPALIVE)) + soap->keep_alive = 0; +#ifndef WITH_LEANER + if ((soap->mode & SOAP_ENC_MTOM) && (soap->mode & SOAP_ENC_DIME)) + { + soap->mode |= SOAP_ENC_MIME; + soap->mode &= ~SOAP_ENC_DIME; + } + else if (!(soap->mode & SOAP_ENC_MIME)) + { + soap->mode &= ~SOAP_ENC_MTOM; + } + if ((soap->mode & SOAP_ENC_MIME)) + soap_select_mime_boundary(soap); +#ifdef WIN32 +#ifndef UNDER_CE +#ifndef WITH_FASTCGI + if (!soap_valid_socket(soap->socket) && !soap->os && soap->sendfd >= 0) /* Set win32 stdout or soap->sendfd to BINARY, e.g. to support DIME */ +#ifdef __BORLANDC__ + setmode(soap->sendfd, _O_BINARY); +#else + _setmode(soap->sendfd, _O_BINARY); +#endif +#endif +#endif +#endif +#endif + if ((soap->mode & SOAP_IO)) + soap->buflen = soap->bufidx = 0; + soap->chunksize = 0; + soap->ns = 0; + soap->null = 0; + soap->position = 0; + soap->mustUnderstand = 0; + soap->encoding = 0; + soap->event = 0; + soap->evlev = 0; + soap->idnum = 0; + soap->body = 1; + soap->level = 0; + soap_clr_attr(soap); + soap_set_local_namespaces(soap); +#ifdef WITH_ZLIB + soap->z_ratio_out = 1.0; + if ((soap->mode & SOAP_ENC_ZLIB) && soap->zlib_state != SOAP_ZLIB_DEFLATE) + { + if (!soap->d_stream) + { + soap->d_stream = (z_stream*)SOAP_MALLOC(soap, sizeof(z_stream)); + if (!soap->d_stream) + return soap->error = SOAP_EOM; + soap->d_stream->zalloc = Z_NULL; + soap->d_stream->zfree = Z_NULL; + soap->d_stream->opaque = Z_NULL; + soap->d_stream->next_in = Z_NULL; + } + if (!soap->z_buf) + soap->z_buf = (char*)SOAP_MALLOC(soap, sizeof(soap->buf)); + if (!soap->z_buf) + return soap->error = SOAP_EOM; + soap->d_stream->next_out = (Byte*)soap->z_buf; + soap->d_stream->avail_out = sizeof(soap->buf); +#ifdef WITH_GZIP + if (soap->zlib_out != SOAP_ZLIB_DEFLATE) + { + (void)soap_memcpy((void*)soap->z_buf, sizeof(soap->buf), (const void*)"\37\213\10\0\0\0\0\0\0\377", 10); + soap->d_stream->next_out = (Byte*)soap->z_buf + 10; + soap->d_stream->avail_out = sizeof(soap->buf) - 10; + soap->z_crc = crc32(0L, NULL, 0); + soap->zlib_out = SOAP_ZLIB_GZIP; + if (soap->z_dict) + *((Byte*)soap->z_buf + 2) = 0xff; + if (deflateInit2(soap->d_stream, soap->z_level, Z_DEFLATED, -MAX_WBITS, 8, Z_DEFAULT_STRATEGY) != Z_OK) + return soap->error = SOAP_ZLIB_ERROR; + } + else +#endif + if (deflateInit(soap->d_stream, soap->z_level) != Z_OK) + return soap->error = SOAP_ZLIB_ERROR; + if (soap->z_dict) + { + if (deflateSetDictionary(soap->d_stream, (const Bytef*)soap->z_dict, soap->z_dict_len) != Z_OK) + return soap->error = SOAP_ZLIB_ERROR; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Deflate initialized\n")); + soap->zlib_state = SOAP_ZLIB_DEFLATE; + } +#endif +#ifdef WITH_OPENSSL + if (soap->ssl) + ERR_clear_error(); +#endif + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Begin send phase (socket=%d mode=0x%x count=" SOAP_ULONG_FORMAT ")\n", (int)soap->socket, soap->mode, soap->count)); + soap->part = SOAP_BEGIN_SEND; +#ifndef WITH_LEANER + if (soap->fprepareinitsend && (soap->mode & SOAP_IO) == SOAP_IO_STORE && (soap->error = soap->fprepareinitsend(soap)) != SOAP_OK) + return soap->error; +#endif +#ifndef WITH_LEAN + soap->start = (ULONG64)time(NULL); +#endif + return SOAP_OK; +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_begin_send(struct soap *soap) +{ +#ifndef WITH_LEANER + if (soap_init_send(soap)) + return soap->error; + return soap_begin_attachments(soap); +#else + return soap_init_send(soap); +#endif +} + +/******************************************************************************/ + +#ifndef WITH_NOIDREF +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_embedded(struct soap *soap, const void *p, int t) +{ + struct soap_plist *pp; + if (soap_pointer_lookup(soap, p, t, &pp)) + { + pp->mark1 = 1; + pp->mark2 = 1; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Embedded %p type=%d mark set to 1\n", p, t)); + } +} +#endif + +/******************************************************************************/ + +#ifndef WITH_NOIDREF +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_reference(struct soap *soap, const void *p, int t) +{ + struct soap_plist *pp; + if (!p || (!soap->encodingStyle && !(soap->omode & (SOAP_ENC_DIME | SOAP_ENC_MIME | SOAP_ENC_MTOM | SOAP_XML_GRAPH))) || (soap->omode & SOAP_XML_TREE)) + return 1; + if (soap_pointer_lookup(soap, p, t, &pp)) + { + if (pp->mark1 == 0) + { + pp->mark1 = 2; + pp->mark2 = 2; + } + } + else if (!soap_pointer_enter(soap, p, NULL, 0, t, &pp)) + { + return 1; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Reference %p type=%d (%d %d)\n", p, t, (int)pp->mark1, (int)pp->mark2)); + return pp->mark1; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_NOIDREF +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_array_reference(struct soap *soap, const void *p, const void *a, int n, int t) +{ + struct soap_plist *pp; + if (!p || !a || (!soap->encodingStyle && !(soap->omode & SOAP_XML_GRAPH)) || (soap->omode & SOAP_XML_TREE)) + return 1; + if (soap_array_pointer_lookup(soap, p, a, n, t, &pp)) + { + if (pp->mark1 == 0) + { + pp->mark1 = 2; + pp->mark2 = 2; + } + } + else if (!soap_pointer_enter(soap, p, a, n, t, &pp)) + { + return 1; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Array reference %p ptr=%p n=%lu t=%d (%d %d)\n", p, a, (unsigned long)n, t, (int)pp->mark1, (int)pp->mark2)); + return pp->mark1; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_NOIDREF +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_attachment_reference(struct soap *soap, const void *p, const void *a, int n, int t, const char *id, const char *type) +{ + struct soap_plist *pp; + if (!p || !a || (!soap->encodingStyle && !(soap->omode & SOAP_XML_GRAPH) && !id && !type) || (soap->omode & SOAP_XML_TREE)) + return 1; + if (soap_array_pointer_lookup(soap, p, a, n, t, &pp)) + { + if (pp->mark1 == 0) + { + pp->mark1 = 2; + pp->mark2 = 2; + } + } + else if (!soap_pointer_enter(soap, p, a, n, t, &pp)) + { + return 1; + } + if (id || type) + soap->mode |= SOAP_ENC_DIME; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Attachment reference %p ptr=%p n=%lu t=%d (%d %d)\n", p, a, (unsigned long)n, t, (int)pp->mark1, (int)pp->mark2)); + return pp->mark1; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_NOIDREF +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_embedded_id(struct soap *soap, int id, const void *p, int t) +{ + struct soap_plist *pp = NULL; + if (id >= 0 || (!soap->encodingStyle && !(soap->omode & SOAP_XML_GRAPH)) || (soap->omode & SOAP_XML_TREE)) + return id; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Embedded_id %p type=%d id=%d\n", p, t, id)); + if (id < -1) + return soap_embed(soap, p, NULL, 0, t); + if (id < 0) + { + id = soap_pointer_lookup(soap, p, t, &pp); + if (soap->version == 1 && soap->part != SOAP_IN_HEADER) + { + if (id) + { + if ((soap->mode & SOAP_IO_LENGTH)) + pp->mark1 = 2; + else + pp->mark2 = 2; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Embedded_id multiref id=%d %p type=%d = (%d %d)\n", id, p, t, (int)pp->mark1, (int)pp->mark2)); + } + return -1; + } + else if (id) + { + if ((soap->mode & SOAP_IO_LENGTH)) + pp->mark1 = 1; + else + pp->mark2 = 1; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Embedded_id embedded ref id=%d %p type=%d = (%d %d)\n", id, p, t, (int)pp->mark1, (int)pp->mark2)); + } + } + return id; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_NOIDREF +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_is_embedded(struct soap *soap, struct soap_plist *pp) +{ + if (!pp) + return 0; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Is embedded? %d %d\n", (int)pp->mark1, (int)pp->mark2)); + if (soap->version == 1 && soap->encodingStyle && !(soap->omode & SOAP_XML_GRAPH) && soap->part != SOAP_IN_HEADER) + { + if ((soap->mode & SOAP_IO_LENGTH)) + return pp->mark1 != 0; + return pp->mark2 != 0; + } + if ((soap->mode & SOAP_IO_LENGTH)) + return pp->mark1 == 1; + return pp->mark2 == 1; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_NOIDREF +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_is_single(struct soap *soap, struct soap_plist *pp) +{ + if (soap->part == SOAP_IN_HEADER) + return 1; + if (!pp) + return 0; + if ((soap->mode & SOAP_IO_LENGTH)) + return pp->mark1 == 0; + return pp->mark2 == 0; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_NOIDREF +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_set_embedded(struct soap *soap, struct soap_plist *pp) +{ + if (!pp) + return; + if ((soap->mode & SOAP_IO_LENGTH)) + pp->mark1 = 1; + else + pp->mark2 = 1; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_LEANER +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_attachment(struct soap *soap, const char *tag, int id, const void *p, const void *a, int n, const char *aid, const char *atype, const char *aoptions, const char *type, int t) +{ + struct soap_plist *pp; + int i; + if (!p || !a || (!aid && !atype) || (!soap->encodingStyle && !(soap->omode & (SOAP_ENC_DIME | SOAP_ENC_MIME | SOAP_ENC_MTOM | SOAP_XML_GRAPH))) || (soap->omode & SOAP_XML_TREE)) + return soap_element_id(soap, tag, id, p, a, n, type, t, NULL); + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Attachment tag='%s' id='%s' (%d) type='%s'\n", tag, aid ? aid : SOAP_STR_EOS, id, atype ? atype : SOAP_STR_EOS)); + i = soap_array_pointer_lookup(soap, p, a, n, t, &pp); + if (!i) + { + i = soap_pointer_enter(soap, p, a, n, t, &pp); + if (!i) + { + soap->error = SOAP_EOM; + return -1; + } + } + if (id <= 0) + id = i; + if (!aid) + { + (SOAP_SNPRINTF(soap->tmpbuf, sizeof(soap->tmpbuf), strlen(soap->dime_id_format) + 20), soap->dime_id_format, id); + aid = soap_strdup(soap, soap->tmpbuf); + if (!aid) + return -1; + } + /* Add MTOM xop:Include element when necessary */ + /* TODO: this code to be obsoleted with new import/xop.h conventions */ + if ((soap->omode & SOAP_ENC_MTOM) && strcmp(tag, "xop:Include")) + { + if (soap_element_begin_out(soap, tag, 0, type) + || soap_element_href(soap, "xop:Include", 0, "xmlns:xop=\"http://www.w3.org/2004/08/xop/include\" href", aid) + || soap_element_end_out(soap, tag)) + return soap->error; + } + else if (soap_element_href(soap, tag, 0, "href", aid)) + { + return soap->error; + } + if ((soap->mode & SOAP_IO_LENGTH)) + { + if (pp->mark1 != 3) + { + struct soap_multipart *content; + if ((soap->omode & SOAP_ENC_MTOM)) + content = soap_alloc_multipart(soap, &soap->mime.first, &soap->mime.last, (const char*)a, n); + else + content = soap_alloc_multipart(soap, &soap->dime.first, &soap->dime.last, (const char*)a, n); + if (!content) + { + soap->error = SOAP_EOM; + return -1; + } + if (!strncmp(aid, "cid:", 4)) /* RFC 2111 */ + { + if ((soap->omode & SOAP_ENC_MTOM)) + { + size_t l = strlen(aid) - 1; + char *s = (char*)soap_malloc(soap, l); + if (s) + { + s[0] = '<'; + (void)soap_strncpy(s + 1, l - 1, aid + 4, l - 3); + s[l - 2] = '>'; + s[l - 1] = '\0'; + content->id = s; + } + } + else + { + content->id = aid + 4; + } + } + else + { + content->id = aid; + } + content->type = atype; + content->options = aoptions; + content->encoding = SOAP_MIME_BINARY; + pp->mark1 = 3; + } + } + else + { + pp->mark2 = 3; + } + return -1; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_NOIDREF +static void +soap_init_iht(struct soap *soap) +{ + int i; + for (i = 0; i < SOAP_IDHASH; i++) + soap->iht[i] = NULL; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_NOIDREF +static void +soap_free_iht(struct soap *soap) +{ + int i; + struct soap_ilist *ip = NULL, *p = NULL; + struct soap_flist *fp = NULL, *fq = NULL; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Free ID hashtable\n")); + for (i = 0; i < SOAP_IDHASH; i++) + { + for (ip = soap->iht[i]; ip; ip = p) + { + for (fp = ip->flist; fp; fp = fq) + { + fq = fp->next; + SOAP_FREE(soap, fp); + } + p = ip->next; + SOAP_FREE(soap, ip); + } + soap->iht[i] = NULL; + } +} +#endif + +/******************************************************************************/ + +#ifndef WITH_NOIDREF +SOAP_FMAC1 +struct soap_ilist * +SOAP_FMAC2 +soap_lookup(struct soap *soap, const char *id) +{ + struct soap_ilist *ip = NULL; + for (ip = soap->iht[soap_hash(id)]; ip; ip = ip->next) + if (!strcmp(ip->id, id)) + return ip; + return NULL; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_NOIDREF +SOAP_FMAC1 +struct soap_ilist * +SOAP_FMAC2 +soap_enter(struct soap *soap, const char *id, int t, size_t n) +{ + size_t h; + struct soap_ilist *ip = NULL; + size_t l = strlen(id); + if (sizeof(struct soap_ilist) + l > l && (SOAP_MAXALLOCSIZE <= 0 || sizeof(struct soap_ilist) + l <= SOAP_MAXALLOCSIZE)) + ip = (struct soap_ilist*)SOAP_MALLOC(soap, sizeof(struct soap_ilist) + l); + if (ip) + { + ip->type = t; + ip->size = n; + ip->ptr = NULL; + ip->spine = NULL; + ip->link = NULL; + ip->copy = NULL; + ip->flist = NULL; + ip->smart = NULL; + ip->shaky = 0; + (void)soap_memcpy((char*)ip->id, l + 1, id, l + 1); + h = soap_hash(id); /* h = (HASH(id) % SOAP_IDHASH) so soap->iht[h] is safe */ + ip->next = soap->iht[h]; + soap->iht[h] = ip; + } + return ip; +} +#endif + +/******************************************************************************/ + +SOAP_FMAC1 +void* +SOAP_FMAC2 +soap_malloc(struct soap *soap, size_t n) +{ + char *p; + size_t k = n; + if (SOAP_MAXALLOCSIZE > 0 && n > SOAP_MAXALLOCSIZE) + { + if (soap) + soap->error = SOAP_EOM; + return NULL; + } + if (!soap) + return SOAP_MALLOC(soap, n); + n += sizeof(short); + n += (~n+1) & (sizeof(void*)-1); /* align at 4-, 8- or 16-byte boundary by rounding up */ + if (n + sizeof(void*) + sizeof(size_t) < k) + { + soap->error = SOAP_EOM; + return NULL; + } + p = (char*)SOAP_MALLOC(soap, n + sizeof(void*) + sizeof(size_t)); + if (!p) + { + soap->error = SOAP_EOM; + return NULL; + } + /* set a canary word to detect memory overruns and data corruption */ + *(unsigned short*)(p + n - sizeof(unsigned short)) = (unsigned short)SOAP_CANARY; + /* keep chain of alloced cells for destruction */ + *(void**)(p + n) = soap->alist; + *(size_t*)(p + n + sizeof(void*)) = n; + soap->alist = p + n; + return p; +} + +/******************************************************************************/ + +#ifdef SOAP_MEM_DEBUG +static void +soap_init_mht(struct soap *soap) +{ + int i; + for (i = 0; i < (int)SOAP_PTRHASH; i++) + soap->mht[i] = NULL; +} +#endif + +/******************************************************************************/ + +#ifdef SOAP_MEM_DEBUG +static void +soap_free_mht(struct soap *soap) +{ + int i; + struct soap_mlist *mp, *mq; + for (i = 0; i < (int)SOAP_PTRHASH; i++) + { + for (mp = soap->mht[i]; mp; mp = mq) + { + mq = mp->next; + if (mp->live) + fprintf(stderr, "%s(%d): malloc() = %p not freed (memory leak or forgot to call soap_end()?)\n", mp->file, mp->line, mp->ptr); + free(mp); + } + soap->mht[i] = NULL; + } +} +#endif + +/******************************************************************************/ + +#ifdef SOAP_MEM_DEBUG +SOAP_FMAC1 +void* +SOAP_FMAC2 +soap_track_malloc(struct soap *soap, const char *file, int line, size_t size) +{ + void *p = malloc(size); + if (soap) + { + size_t h = soap_hash_ptr(p); + struct soap_mlist *mp = (struct soap_mlist*)malloc(sizeof(struct soap_mlist)); + if (soap->fdebug[SOAP_INDEX_TEST]) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "%s(%d): malloc(%lu) = %p\n", file, line, (unsigned long)size, p)); + } + mp->next = soap->mht[h]; + mp->ptr = p; + mp->file = file; + mp->line = line; + mp->live = 1; + soap->mht[h] = mp; + } + return p; +} +#endif + +/******************************************************************************/ + +#ifdef SOAP_MEM_DEBUG +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_track_free(struct soap *soap, const char *file, int line, void *p) +{ + if (!soap) + { + free(p); + } + else + { + size_t h = soap_hash_ptr(p); + struct soap_mlist *mp; + for (mp = soap->mht[h]; mp; mp = mp->next) + if (mp->ptr == p) + break; + if (mp) + { + if (mp->live) + { + if (soap->fdebug[SOAP_INDEX_TEST]) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "%s(%d): free(%p)\n", file, line, p)); + } + free(p); + mp->live = 0; + } + else + { + fprintf(stderr, "%s(%d): free(%p) double free of pointer malloced at %s(%d)\n", file, line, p, mp->file, mp->line); + } + } + else + { + fprintf(stderr, "%s(%d): free(%p) pointer not malloced\n", file, line, p); + } + } +} +#endif + +/******************************************************************************/ + +#ifdef SOAP_MEM_DEBUG +static void +soap_track_unlink(struct soap *soap, const void *p) +{ + size_t h = soap_hash_ptr(p); + struct soap_mlist *mp; + for (mp = soap->mht[h]; mp; mp = mp->next) + if (mp->ptr == p) + break; + if (mp) + mp->live = 0; +} +#endif + +/******************************************************************************/ + +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_dealloc(struct soap *soap, void *p) +{ + if (soap_check_state(soap)) + return; + if (p) + { + char **q; + for (q = (char**)(void*)&soap->alist; *q; q = *(char***)q) + { + if (*(unsigned short*)(char*)(*q - sizeof(unsigned short)) != (unsigned short)SOAP_CANARY) + { +#ifdef SOAP_MEM_DEBUG + fprintf(stderr, "Data corruption in dynamic allocation (see logs)\n"); +#endif + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Data corruption:\n")); + DBGHEX(TEST, *q - 200, 200); + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "\n")); + soap->error = SOAP_MOE; + return; + } + if (p == (void*)(*q - *(size_t*)(*q + sizeof(void*)))) + { + *q = **(char***)q; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Freed data at %p\n", p)); + SOAP_FREE(soap, p); + return; + } + } + soap_delete(soap, p); + } + else + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Free all soap_malloc() data\n")); + while (soap->alist) + { + char *q = (char*)soap->alist; + if (*(unsigned short*)(char*)(q - sizeof(unsigned short)) != (unsigned short)SOAP_CANARY) + { +#ifdef SOAP_MEM_DEBUG + fprintf(stderr, "Data corruption in dynamic allocation (see logs)\n"); +#endif + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Data corruption:\n")); + DBGHEX(TEST, q - 200, 200); + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "\n")); + soap->error = SOAP_MOE; + return; + } + soap->alist = *(void**)q; + q -= *(size_t*)(q + sizeof(void*)); + SOAP_FREE(soap, q); + } + /* assume these were deallocated: */ + soap->http_content = NULL; + soap->action = NULL; + soap->fault = NULL; + soap->header = NULL; + soap->bearer = NULL; + soap->userid = NULL; + soap->passwd = NULL; + soap->authrealm = NULL; +#ifdef WITH_NTLM + soap->ntlm_challenge = NULL; +#endif +#ifndef WITH_LEANER + soap_clr_mime(soap); +#endif + } +} + +/******************************************************************************/ + +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_delete(struct soap *soap, void *p) +{ + struct soap_clist **cp; + if (soap_check_state(soap)) + return; + cp = &soap->clist; + if (p) + { + while (*cp) + { + if (p == (*cp)->ptr) + { + struct soap_clist *q = *cp; + *cp = q->next; + if (q->fdelete(soap, q)) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Could not dealloc data %p: deletion callback failed for object type=%d\n", q->ptr, q->type)); +#ifdef SOAP_MEM_DEBUG + fprintf(stderr, "new(object type=%d) = %p not freed: deletion callback failed\n", q->type, q->ptr); +#endif + } + SOAP_FREE(soap, q); + return; + } + cp = &(*cp)->next; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Could not dealloc data %p: address not in list\n", p)); + } + else + { + while (*cp) + { + struct soap_clist *q = *cp; + *cp = q->next; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Delete %p type=%d (cp=%p)\n", q->ptr, q->type, (void*)q)); + if (q->fdelete(soap, q)) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Could not dealloc data %p: deletion callback failed for object type=%d\n", q->ptr, q->type)); +#ifdef SOAP_MEM_DEBUG + fprintf(stderr, "new(object type=%d) = %p not freed: deletion callback failed\n", q->type, q->ptr); +#endif + } + SOAP_FREE(soap, q); + } + } + soap->fault = NULL; /* assume this was deallocated */ + soap->header = NULL; /* assume this was deallocated */ +} + +/******************************************************************************/ + +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_delegate_deletion(struct soap *soap, struct soap *soap_to) +{ + struct soap_clist *cp; + char **q; +#ifdef SOAP_MEM_DEBUG + void *p; + struct soap_mlist **mp, *mq; + size_t h; +#endif + for (q = (char**)(void*)&soap->alist; *q; q = *(char***)q) + { + if (*(unsigned short*)(char*)(*q - sizeof(unsigned short)) != (unsigned short)SOAP_CANARY) + { +#ifdef SOAP_MEM_DEBUG + fprintf(stderr, "Data corruption in dynamic allocation (see logs)\n"); +#endif + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Data corruption:\n")); + DBGHEX(TEST, *q - 200, 200); + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "\n")); + soap->error = SOAP_MOE; + return; + } +#ifdef SOAP_MEM_DEBUG + p = (void*)(*q - *(size_t*)(*q + sizeof(void*))); + h = soap_hash_ptr(p); + for (mp = &soap->mht[h]; *mp; mp = &(*mp)->next) + { + if ((*mp)->ptr == p) + { + mq = *mp; + *mp = mq->next; + mq->next = soap_to->mht[h]; + soap_to->mht[h] = mq; + break; + } + } +#endif + } + *q = (char*)soap_to->alist; + soap_to->alist = soap->alist; + soap->alist = NULL; +#ifdef SOAP_MEM_DEBUG + cp = soap->clist; + while (cp) + { + h = soap_hash_ptr(cp); + for (mp = &soap->mht[h]; *mp; mp = &(*mp)->next) + { + if ((*mp)->ptr == cp) + { + mq = *mp; + *mp = mq->next; + mq->next = soap_to->mht[h]; + soap_to->mht[h] = mq; + break; + } + } + cp = cp->next; + } +#endif + cp = soap_to->clist; + if (cp) + { + while (cp->next) + cp = cp->next; + cp->next = soap->clist; + } + else + { + soap_to->clist = soap->clist; + } + soap->clist = NULL; +} + +/******************************************************************************/ + +SOAP_FMAC1 +struct soap_clist * +SOAP_FMAC2 +soap_link(struct soap *soap, int t, int n, int (*fdelete)(struct soap*, struct soap_clist*)) +{ + struct soap_clist *cp = NULL; + if (soap) + { + if (n != SOAP_NO_LINK_TO_DELETE) + { + cp = (struct soap_clist*)SOAP_MALLOC(soap, sizeof(struct soap_clist)); + if (!cp) + { + soap->error = SOAP_EOM; + } + else + { + cp->next = soap->clist; + cp->type = t; + cp->size = n; + cp->ptr = NULL; + cp->fdelete = fdelete; + soap->clist = cp; + } + } + soap->alloced = t; + } + return cp; +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_unlink(struct soap *soap, const void *p) +{ + if (soap && p) + { + char **q; + struct soap_clist **cp; + for (q = (char**)(void*)&soap->alist; *q; q = *(char***)q) + { + if (p == (void*)(*q - *(size_t*)(*q + sizeof(void*)))) + { + *q = **(char***)q; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Unlinked data %p\n", p)); +#ifdef SOAP_MEM_DEBUG + soap_track_unlink(soap, p); +#endif + return SOAP_OK; /* found and removed from dealloc chain */ + } + } + for (cp = &soap->clist; *cp; cp = &(*cp)->next) + { + if (p == (*cp)->ptr) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Unlinked class instance %p\n", p)); + q = (char**)*cp; + *cp = (*cp)->next; + SOAP_FREE(soap, q); + return SOAP_OK; /* found and removed from dealloc chain */ + } + } + } + return SOAP_ERR; +} + +/******************************************************************************/ + +#ifndef WITH_NOIDREF +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_lookup_type(struct soap *soap, const char *id) +{ + struct soap_ilist *ip; + if (id && *id) + { + ip = soap_lookup(soap, id); + if (ip) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Lookup id='%s' type=%d\n", id, ip->type)); + return ip->type; + } + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "lookup type id='%s' NOT FOUND! Need to get it from xsi:type\n", id)); + return 0; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_NOIDREF +SOAP_FMAC1 +short +SOAP_FMAC2 +soap_begin_shaky(struct soap *soap) +{ + short f = soap->shaky; + soap->shaky = 1; + return f; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_NOIDREF +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_end_shaky(struct soap *soap, short f) +{ + soap->shaky = f; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_NOIDREF +static int +soap_is_shaky(struct soap *soap, void *p) +{ + (void)p; + if (!soap->blist && !soap->shaky) + return 0; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Shaky %p\n", p)); + return 1; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_NOIDREF +SOAP_FMAC1 +void* +SOAP_FMAC2 +soap_id_lookup(struct soap *soap, const char *id, void **p, int t, size_t n, unsigned int k, int (*fbase)(int, int)) +{ + struct soap_ilist *ip; + if (!p || !id || !*id) + return p; + ip = soap_lookup(soap, id); /* lookup pointer to hash table entry for string id */ + if (!ip) + { + ip = soap_enter(soap, id, t, n); /* new hash table entry for string id */ + if (!ip) + return NULL; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Forwarding first href='%s' type=%d location=%p (%u bytes) level=%u\n", id, t, (void*)p, (unsigned int)n, k)); + *p = NULL; + if (k) + { + int i; + if (k > SOAP_MAXPTRS) + return NULL; + ip->spine = (void**)soap_malloc(soap, SOAP_MAXPTRS * sizeof(void*)); + if (!ip->spine) + return NULL; + ip->spine[0] = NULL; + for (i = 1; i < SOAP_MAXPTRS; i++) + ip->spine[i] = &ip->spine[i - 1]; + *p = &ip->spine[k - 1]; + } + else + { + ip->link = p; + ip->shaky = soap_is_shaky(soap, (void*)p); + } + } + else if (ip->type != t && (!fbase || !fbase(ip->type, t)) && (!fbase || !fbase(t, ip->type) || soap_type_punned(soap, ip))) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Lookup type incompatibility: ref='%s' id-type=%d ref-type=%d\n", id, ip->type, t)); + (void)soap_id_nullify(soap, id); + return NULL; + } + else if (k == 0 && ip->ptr && !ip->shaky) /* when block lists are in use, ip->ptr will change */ + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Resolved href='%s' type=%d location=%p (%u bytes) level=%u\n", id, t, ip->ptr, (unsigned int)n, k)); + *p = ip->ptr; + } + else + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Forwarded href='%s' type=%d location=%p (%u bytes) level=%u\n", id, t, (void*)p, (unsigned int)n, k)); + if (fbase && fbase(t, ip->type) && !soap_type_punned(soap, ip)) + { + ip->type = t; + ip->size = n; + } + *p = NULL; + if (k) + { + if (!ip->spine) + { + int i; + if (k > SOAP_MAXPTRS) + return NULL; + ip->spine = (void**)soap_malloc(soap, SOAP_MAXPTRS * sizeof(void*)); + if (!ip->spine) + return NULL; + ip->spine[0] = NULL; + for (i = 1; i < SOAP_MAXPTRS; i++) + ip->spine[i] = &ip->spine[i - 1]; + } + *p = &ip->spine[k - 1]; + if (ip->ptr && !ip->shaky) + ip->spine[0] = ip->ptr; + } + else + { + void *q = ip->link; + ip->link = p; + ip->shaky = soap_is_shaky(soap, (void*)p); + *p = q; + } + } + return p; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_NOIDREF +SOAP_FMAC1 +void* +SOAP_FMAC2 +soap_id_forward(struct soap *soap, const char *href, void *p, size_t i, int t, int tt, size_t n, unsigned int k, void (*finsert)(struct soap*, int, int, void*, size_t, const void*, void**), int (*fbase)(int, int)) +{ + struct soap_ilist *ip; + if (!p || !href || !*href) + return p; + ip = soap_lookup(soap, href); /* lookup pointer to hash table entry for string id */ + if (!ip) + { + ip = soap_enter(soap, href, t, n); /* new hash table entry for string id */ + if (!ip) + return NULL; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "New entry href='%s' type=%d size=%lu level=%d location=%p\n", href, t, (unsigned long)n, k, p)); + } + else if ((ip->type != t || ip->size != n) && k == 0) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Forward type incompatibility id='%s' expect type=%d size=%lu level=%u got type=%d size=%lu\n", href, ip->type, (unsigned long)ip->size, k, t, (unsigned long)n)); + (void)soap_id_nullify(soap, href); + return NULL; + } + if (finsert || n < sizeof(void*)) + { + struct soap_flist *fp = (struct soap_flist*)SOAP_MALLOC(soap, sizeof(struct soap_flist)); + if (!fp) + { + soap->error = SOAP_EOM; + return NULL; + } + if (fbase && fbase(t, ip->type) && !soap_type_punned(soap, ip)) + { + ip->type = t; + ip->size = n; + } + if ((ip->type != t || ip->size != n) && (!fbase || !fbase(ip->type, t))) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Forward type incompatibility id='%s' expect type=%d size=%lu level=%u got type=%d size=%lu\n", href, ip->type, (unsigned long)ip->size, k, t, (unsigned long)n)); + SOAP_FREE(soap, fp); + (void)soap_id_nullify(soap, href); + return NULL; + } + fp->next = ip->flist; + fp->type = tt; + fp->ptr = p; + fp->level = k; + fp->index = i; + fp->finsert = finsert; + ip->flist = fp; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Forwarding type=%d (target type=%d) size=%lu location=%p level=%u index=%lu href='%s'\n", t, tt, (unsigned long)n, p, k, (unsigned long)i, href)); + } + else + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Forwarding copying address %p for type=%d href='%s'\n", p, t, href)); + *(void**)p = ip->copy; + ip->copy = p; + } + ip->shaky = soap_is_shaky(soap, p); + return p; +} +#endif + +/******************************************************************************/ + +SOAP_FMAC1 +void* +SOAP_FMAC2 +soap_id_enter(struct soap *soap, const char *id, void *p, int t, size_t n, const char *type, const char *arrayType, void *(*finstantiate)(struct soap*, int, const char*, const char*, size_t*), int (*fbase)(int, int)) +{ +#ifndef WITH_NOIDREF + struct soap_ilist *ip; +#endif + (void)id; (void)fbase; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Enter id='%s' type=%d location=%p size=%lu\n", id, t, p, (unsigned long)n)); + soap->alloced = 0; + if (!p) + { + if (finstantiate) + { + p = finstantiate(soap, t, type, arrayType, &n); /* soap->alloced is set in soap_link() */ + t = soap->alloced; + } + else + { + p = soap_malloc(soap, n); + soap->alloced = t; + } + } +#ifndef WITH_NOIDREF + if (!id || !*id) +#endif + return p; +#ifndef WITH_NOIDREF + ip = soap_lookup(soap, id); /* lookup pointer to hash table entry for string id */ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Lookup entry id='%s' for location=%p type=%d\n", id, p, t)); + if (!ip) + { + ip = soap_enter(soap, id, t, n); /* new hash table entry for string id */ + if (!ip) + return NULL; + ip->ptr = p; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "New entry id='%s' type=%d size=%lu location=%p\n", id, t, (unsigned long)n, p)); + if (!soap->alloced) + ip->shaky = soap_is_shaky(soap, p); + } + else if (ip->ptr) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Multiply defined id='%s'\n", id)); + soap_strcpy(soap->id, sizeof(soap->id), id); + soap->error = SOAP_DUPLICATE_ID; + return NULL; + } + else if ((ip->type != t && (!fbase || !fbase(t, ip->type) || soap_type_punned(soap, ip))) + || (ip->type == t && ip->size != n && soap_type_punned(soap, ip))) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Enter type incompatibility id='%s' expect type=%d size=%lu got type=%d size=%lu\n", id, ip->type, (unsigned long)ip->size, t, (unsigned long)n)); + (void)soap_id_nullify(soap, id); + return NULL; + } + else + { + ip->type = t; + ip->size = n; + ip->ptr = p; + if (!soap->alloced) + ip->shaky = soap_is_shaky(soap, p); + if (soap->alloced || !ip->shaky) + { + void **q; /* ptr will not change later, so resolve links now */ + if (ip->spine) + ip->spine[0] = p; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Traversing link chain to resolve id='%s' type=%d\n", ip->id, ip->type)); + q = (void**)ip->link; + while (q) + { + void *r = *q; + *q = p; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "... link %p -> %p\n", (void*)q, p)); + q = (void**)r; + } + ip->link = NULL; + } + } + return ip->ptr; +#endif +} + +/******************************************************************************/ + +SOAP_FMAC1 +void** +SOAP_FMAC2 +soap_id_smart(struct soap *soap, const char *id, int t, size_t n) +{ + (void)soap; (void)id; (void)t; (void)n; +#ifndef WITH_NOIDREF + if (id && *id) + { + struct soap_ilist *ip = soap_lookup(soap, id); /* lookup pointer to hash table entry for string id */ + if (!ip) + { + ip = soap_enter(soap, id, t, n); /* new hash table entry for string id */ + if (!ip) + return NULL; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "New smart shared pointer entry id='%s' type=%d size=%lu smart=%p\n", id, t, (unsigned long)n, ip->smart)); + return &ip->smart; + } +#endif + return NULL; +} + +/******************************************************************************/ + +#ifndef WITH_NOIDREF +static int +soap_type_punned(struct soap *soap, const struct soap_ilist *ip) +{ + const struct soap_flist *fp; + (void)soap; + if (ip->ptr || ip->copy) + return 1; + for (fp = ip->flist; fp; fp = fp->next) + if (fp->level == 0) + return 1; + return 0; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_NOIDREF +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_id_nullify(struct soap *soap, const char *id) +{ + int i; + for (i = 0; i < SOAP_IDHASH; i++) + { + struct soap_ilist *ip; + for (ip = soap->iht[i]; ip; ip = ip->next) + { + void *p, *q; + for (p = ip->link; p; p = q) + { + q = *(void**)p; + *(void**)p = NULL; + } + ip->link = NULL; + } + } + soap_strcpy(soap->id, sizeof(soap->id), id); + return soap->error = SOAP_HREF; +} +#endif + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_end_send(struct soap *soap) +{ +#ifndef WITH_LEANER + int err = soap_end_attachments(soap); + if (soap->dime.list) + { + /* SOAP body referenced attachments must appear first */ + soap->dime.last->next = soap->dime.first; + soap->dime.first = soap->dime.list->next; + soap->dime.list->next = NULL; + soap->dime.last = soap->dime.list; + } + if (!err) + err = soap_putdime(soap); + if (!err) + err = soap_putmime(soap); + soap->mime.list = NULL; + soap->mime.first = NULL; + soap->mime.last = NULL; + soap->dime.list = NULL; + soap->dime.first = NULL; + soap->dime.last = NULL; + if (err) + return err; +#endif + return soap_end_send_flush(soap); +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_end_send_flush(struct soap *soap) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "End send mode=0x%x\n", soap->mode)); + if ((soap->mode & SOAP_IO)) /* need to flush the remaining data in buffer */ + { + if (soap_flush(soap)) +#ifdef WITH_ZLIB + { + if ((soap->mode & SOAP_ENC_ZLIB) && soap->zlib_state == SOAP_ZLIB_DEFLATE) + { + soap->zlib_state = SOAP_ZLIB_NONE; + deflateEnd(soap->d_stream); + } + return soap->error; + } +#else + return soap->error; +#endif +#ifdef WITH_ZLIB + if ((soap->mode & SOAP_ENC_ZLIB) && soap->d_stream) + { + int r; + soap->d_stream->avail_in = 0; + do + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Deflating remainder\n")); + r = deflate(soap->d_stream, Z_FINISH); + if (soap->d_stream->avail_out != sizeof(soap->buf)) + { + if (soap_flush_raw(soap, soap->z_buf, sizeof(soap->buf) - soap->d_stream->avail_out)) + { + soap->zlib_state = SOAP_ZLIB_NONE; + deflateEnd(soap->d_stream); + return soap->error; + } + soap->d_stream->next_out = (Byte*)soap->z_buf; + soap->d_stream->avail_out = sizeof(soap->buf); + } + } while (r == Z_OK); + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Deflated total %lu->%lu bytes\n", soap->d_stream->total_in, soap->d_stream->total_out)); + soap->z_ratio_out = (float)soap->d_stream->total_out / (float)soap->d_stream->total_in; + soap->mode &= ~SOAP_ENC_ZLIB; + soap->zlib_state = SOAP_ZLIB_NONE; + if (deflateEnd(soap->d_stream) != Z_OK || r != Z_STREAM_END) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Unable to end deflate: %s\n", soap->d_stream->msg ? soap->d_stream->msg : SOAP_STR_EOS)); + return soap->error = SOAP_ZLIB_ERROR; + } +#ifdef WITH_GZIP + if (soap->zlib_out != SOAP_ZLIB_DEFLATE) + { + soap->z_buf[0] = soap->z_crc & 0xFF; + soap->z_buf[1] = (soap->z_crc >> 8) & 0xFF; + soap->z_buf[2] = (soap->z_crc >> 16) & 0xFF; + soap->z_buf[3] = (soap->z_crc >> 24) & 0xFF; + soap->z_buf[4] = soap->d_stream->total_in & 0xFF; + soap->z_buf[5] = (soap->d_stream->total_in >> 8) & 0xFF; + soap->z_buf[6] = (soap->d_stream->total_in >> 16) & 0xFF; + soap->z_buf[7] = (soap->d_stream->total_in >> 24) & 0xFF; + if (soap_flush_raw(soap, soap->z_buf, 8)) + return soap->error; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "gzip crc32=%lu\n", (unsigned long)soap->z_crc)); + } +#endif + } +#endif + if ((soap->mode & SOAP_IO) == SOAP_IO_STORE) + { +#if !defined(__cplusplus) || defined(WITH_COMPAT) + if (soap->os) + { + char *b = (char*)soap_push_block(soap, NULL, 1); + if (b) + { + *b = '\0'; + *soap->os = (char*)soap_save_block(soap, NULL, NULL, 0); + } + } + else +#endif + { + char *p; +#ifndef WITH_NOHTTP + if (!(soap->mode & SOAP_ENC_PLAIN)) + { + soap->mode--; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Sending buffered message of length %u\n", (unsigned int)soap->blist->size)); + if (soap->status >= SOAP_POST) + soap->error = soap->fpost(soap, soap->endpoint, soap->host, soap->port, soap->path, soap->action, soap->blist->size); + else if (soap->status != SOAP_STOP) + soap->error = soap->fresponse(soap, soap->status, soap->blist->size); + if (soap->error || soap_flush(soap)) + return soap->error; + soap->mode++; + } +#endif + for (p = soap_first_block(soap, NULL); p; p = soap_next_block(soap, NULL)) + { + DBGMSG(SENT, p, soap_block_size(soap, NULL)); + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Send %u bytes to socket=%d/fd=%d\n", (unsigned int)soap_block_size(soap, NULL), (int)soap->socket, soap->sendfd)); + soap->error = soap->fsend(soap, p, soap_block_size(soap, NULL)); + if (soap->error) + { + soap_end_block(soap, NULL); + return soap->error; + } + } + soap_end_block(soap, NULL); + } +#ifndef WITH_LEANER + if (soap->fpreparefinalsend && (soap->error = soap->fpreparefinalsend(soap)) != SOAP_OK) + return soap->error; +#endif + if ((soap->omode & SOAP_IO) == SOAP_IO_STORE && (soap->imode & SOAP_IO) != SOAP_IO_STORE) + soap->omode = (soap->omode & ~SOAP_IO) | (soap->imode & SOAP_IO); + } +#ifndef WITH_LEANER + else if ((soap->mode & SOAP_IO) == SOAP_IO_CHUNK) + { + DBGMSG(SENT, "\r\n0\r\n\r\n", 7); + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Send 7 bytes to socket=%d/fd=%d\n", (int)soap->socket, soap->sendfd)); + soap->error = soap->fsend(soap, "\r\n0\r\n\r\n", 7); + if (soap->error) + return soap->error; + } +#endif + } +#ifdef WITH_TCPFIN +#if defined(WITH_OPENSSL) || defined(WITH_WOLFSSL) || defined(WITH_SYSTEMSSL) + if (!soap->ssl) +#endif + if (soap_valid_socket(soap->socket) && !soap->keep_alive && !(soap->omode & SOAP_IO_UDP)) + (void)soap->fshutdownsocket(soap, soap->socket, SOAP_SHUT_WR); /* Send TCP FIN */ +#endif +#if defined(__cplusplus) && !defined(WITH_COMPAT) + if (soap->os) + soap->os->flush(); +#endif + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "End of send phase\n")); + soap->omode &= ~SOAP_SEC_WSUID; + soap->count = 0; + soap->part = SOAP_END; + return SOAP_OK; +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_end_recv(struct soap *soap) +{ + soap->part = SOAP_END; +#ifndef WITH_LEAN + soap->wsuid = NULL; /* reset before next send */ + soap->c14nexclude = NULL; /* reset before next send */ + soap->c14ninclude = NULL; /* reset before next send */ +#endif +#ifndef WITH_LEANER + soap->ffilterrecv = NULL; + if ((soap->mode & SOAP_ENC_DIME) && soap_getdime(soap)) + { + soap->dime.first = NULL; + soap->dime.last = NULL; + return soap->error; + } + soap->dime.list = soap->dime.first; + soap->dime.first = NULL; + soap->dime.last = NULL; + /* Check if MIME attachments and mime-post-check flag is set, if so call soap_resolve() and return */ + if ((soap->mode & SOAP_ENC_MIME)) + { + if ((soap->mode & SOAP_MIME_POSTCHECK)) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Post checking MIME attachments\n")); + if (!soap->keep_alive) + soap->keep_alive = -2; /* special case to keep alive */ +#ifndef WITH_NOIDREF + soap_resolve(soap); +#endif + return SOAP_OK; + } + if (soap_getmime(soap)) + return soap->error; + } + soap->mime.list = soap->mime.first; + soap->mime.first = NULL; + soap->mime.last = NULL; + soap->mime.boundary = NULL; + if (soap->xlist) + { + struct soap_multipart *content; + for (content = soap->mime.list; content; content = content->next) + soap_resolve_attachment(soap, content); + } +#endif + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "End of receive message ok\n")); +#ifdef WITH_ZLIB + if ((soap->mode & SOAP_ENC_ZLIB) && soap->d_stream) + { + /* Make sure end of compressed content is reached */ + while (soap->d_stream->next_out != Z_NULL) + if ((int)soap_get1(soap) == EOF) + break; + soap->mode &= ~SOAP_ENC_ZLIB; + (void)soap_memcpy((void*)soap->buf, sizeof(soap->buf), (const void*)soap->z_buf, sizeof(soap->buf)); + soap->bufidx = (char*)soap->d_stream->next_in - soap->z_buf; + soap->buflen = soap->z_buflen; + soap->zlib_state = SOAP_ZLIB_NONE; + if (inflateEnd(soap->d_stream) != Z_OK) + return soap->error = SOAP_ZLIB_ERROR; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Inflate end ok\n")); +#ifdef WITH_GZIP + if (soap->zlib_in == SOAP_ZLIB_GZIP) + { + soap_wchar c; + short i; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Inflate gzip crc check\n")); + for (i = 0; i < 8; i++) + { + if ((int)(c = soap_get1(soap)) == EOF) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Gzip error: unable to read crc value\n")); + return soap->error = SOAP_ZLIB_ERROR; + } + soap->z_buf[i] = (char)c; + } + if (soap->z_crc != ((uLong)(unsigned char)soap->z_buf[0] | ((uLong)(unsigned char)soap->z_buf[1] << 8) | ((uLong)(unsigned char)soap->z_buf[2] << 16) | ((uLong)(unsigned char)soap->z_buf[3] << 24))) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Gzip inflate error: crc check failed, message corrupted? (crc32=%lu)\n", (unsigned long)soap->z_crc)); + return soap->error = SOAP_ZLIB_ERROR; + } + if (soap->d_stream->total_out != ((uLong)(unsigned char)soap->z_buf[4] | ((uLong)(unsigned char)soap->z_buf[5] << 8) | ((uLong)(unsigned char)soap->z_buf[6] << 16) | ((uLong)(unsigned char)soap->z_buf[7] << 24))) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Gzip inflate error: incorrect message length\n")); + return soap->error = SOAP_ZLIB_ERROR; + } + } + soap->zlib_in = SOAP_ZLIB_NONE; +#endif + } +#endif + if ((soap->mode & SOAP_IO) == SOAP_IO_CHUNK) + while ((int)soap->ahead != EOF && !soap_recv_raw(soap)) + continue; +#ifndef WITH_NOIDREF + if (soap_resolve(soap)) + return soap->error; +#endif +#ifndef WITH_LEANER + if (soap->xlist) + { + if ((soap->mode & SOAP_ENC_MTOM)) + return soap->error = SOAP_MIME_HREF; + return soap->error = SOAP_DIME_HREF; + } +#endif + soap_free_ns(soap); +#ifndef WITH_LEANER + if (soap->fpreparefinalrecv) + return soap->error = soap->fpreparefinalrecv(soap); +#endif + return SOAP_OK; +} + +/******************************************************************************/ + +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_free_temp(struct soap *soap) +{ + struct soap_attribute *tp, *tq; + struct Namespace *ns; + soap_free_ns(soap); + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Free any remaining temp blocks\n")); + while (soap->blist) + soap_end_block(soap, NULL); + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Free attribute storage\n")); + for (tp = soap->attributes; tp; tp = tq) + { + tq = tp->next; + if (tp->value) + SOAP_FREE(soap, tp->value); + SOAP_FREE(soap, tp); + } + soap->attributes = NULL; +#ifdef WITH_FAST + if (soap->labbuf) + SOAP_FREE(soap, soap->labbuf); + soap->labbuf = NULL; + soap->lablen = 0; + soap->labidx = 0; +#endif + ns = soap->local_namespaces; + if (ns) + { + for (; ns->id; ns++) + { + if (ns->out) + { + SOAP_FREE(soap, ns->out); + ns->out = NULL; + } + } + SOAP_FREE(soap, soap->local_namespaces); + soap->local_namespaces = NULL; + } +#ifndef WITH_LEANER + while (soap->xlist) + { + struct soap_xlist *xp = soap->xlist->next; + SOAP_FREE(soap, soap->xlist); + soap->xlist = xp; + } +#endif +#ifndef WITH_NOIDREF + soap_free_iht(soap); +#endif + soap_free_pht(soap); +} + +/******************************************************************************/ + +static void +soap_free_ns(struct soap *soap) +{ + struct soap_nlist *np, *nq; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Free namespace stack\n")); + for (np = soap->nlist; np; np = nq) + { + nq = np->next; + SOAP_FREE(soap, np); + } + soap->nlist = NULL; +} + +/******************************************************************************/ + +#ifdef SOAP_DEBUG +static void +soap_init_logs(struct soap *soap) +{ + int i; + for (i = 0; i < SOAP_MAXLOGS; i++) + { + soap->logfile[i] = NULL; + soap->fdebug[i] = NULL; + } +} +#endif + +/******************************************************************************/ + +#ifdef SOAP_DEBUG +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_open_logfile(struct soap *soap, int i) +{ + if (soap->logfile[i]) + soap->fdebug[i] = fopen(soap->logfile[i], i < 2 ? "ab" : "a"); +} +#endif + +/******************************************************************************/ + +#ifdef SOAP_DEBUG +static void +soap_close_logfile(struct soap *soap, int i) +{ + if (soap->fdebug[i]) + { + fclose(soap->fdebug[i]); + soap->fdebug[i] = NULL; + } +} +#endif + +/******************************************************************************/ + +#ifdef SOAP_DEBUG +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_close_logfiles(struct soap *soap) +{ + int i; + for (i = 0; i < SOAP_MAXLOGS; i++) + soap_close_logfile(soap, i); +} +#endif + +/******************************************************************************/ + +#ifdef SOAP_DEBUG +static void +soap_set_logfile(struct soap *soap, int i, const char *logfile) +{ + const char *s; + char *t = NULL; + soap_close_logfile(soap, i); + s = soap->logfile[i]; + if (s) + SOAP_FREE_UNMANAGED(s); + if (logfile) + { + size_t l = strlen(logfile) + 1; + t = (char*)SOAP_MALLOC_UNMANAGED(l); + if (t) + (void)soap_memcpy((void*)t, l, (const void*)logfile, l); + } + soap->logfile[i] = t; +} +#endif + +/******************************************************************************/ + +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_set_recv_logfile(struct soap *soap, const char *logfile) +{ + (void)soap; (void)logfile; +#ifdef SOAP_DEBUG + soap_set_logfile(soap, SOAP_INDEX_RECV, logfile); +#endif +} + +/******************************************************************************/ + +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_set_sent_logfile(struct soap *soap, const char *logfile) +{ + (void)soap; (void)logfile; +#ifdef SOAP_DEBUG + soap_set_logfile(soap, SOAP_INDEX_SENT, logfile); +#endif +} + +/******************************************************************************/ + +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_set_test_logfile(struct soap *soap, const char *logfile) +{ + (void)soap; (void)logfile; +#ifdef SOAP_DEBUG + soap_set_logfile(soap, SOAP_INDEX_TEST, logfile); +#endif +} + +/******************************************************************************/ + +SOAP_FMAC1 +struct soap* +SOAP_FMAC2 +soap_copy(const struct soap *soap) +{ + struct soap *copy = soap_versioning(soap_new)(SOAP_IO_DEFAULT, SOAP_IO_DEFAULT); + soap_set_test_logfile(copy, NULL); + soap_set_sent_logfile(copy, NULL); + soap_set_recv_logfile(copy, NULL); + soap_done(copy); + if (soap_copy_context(copy, soap) != NULL) + return copy; + soap_free(copy); + return NULL; +} + +/******************************************************************************/ + +SOAP_FMAC1 +struct soap* +SOAP_FMAC2 +soap_copy_context(struct soap *copy, const struct soap *soap) +{ + if (copy == soap) + return copy; + if (soap_check_state(soap)) + return NULL; + if (copy) + { + struct soap_plugin *p = NULL; + (void)soap_memcpy((void*)copy, sizeof(struct soap), (const void*)soap, sizeof(struct soap)); + copy->state = SOAP_COPY; +#ifdef SOAP_MEM_DEBUG + soap_init_mht(copy); +#endif +#ifdef SOAP_DEBUG + soap_init_logs(copy); + soap_set_test_logfile(copy, soap->logfile[SOAP_INDEX_TEST]); + soap_set_sent_logfile(copy, soap->logfile[SOAP_INDEX_SENT]); + soap_set_recv_logfile(copy, soap->logfile[SOAP_INDEX_RECV]); +#endif + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copying context\n")); + copy->error = SOAP_OK; + copy->bearer = NULL; + copy->userid = NULL; + copy->passwd = NULL; +#ifdef WITH_NTLM + copy->ntlm_challenge = NULL; +#endif + copy->nlist = NULL; + copy->blist = NULL; + copy->clist = NULL; + copy->alist = NULL; + copy->attributes = NULL; + copy->labbuf = NULL; + copy->lablen = 0; + copy->labidx = 0; + copy->namespaces = soap->local_namespaces; + copy->local_namespaces = NULL; + soap_set_local_namespaces(copy); /* copy content of soap->local_namespaces */ + copy->namespaces = soap->namespaces; /* point to shared read-only namespaces table */ + copy->c_locale = NULL; +#ifdef WITH_OPENSSL + copy->bio = NULL; + copy->ssl = NULL; + copy->session = NULL; + copy->session_host[0] = '\0'; + copy->session_port = 443; +#endif +#ifdef WITH_WOLFSSL + copy->ssl = NULL; +#endif +#ifdef WITH_GNUTLS + copy->session = NULL; +#endif +#ifdef WITH_ZLIB + copy->d_stream = NULL; + copy->z_buf = NULL; +#endif +#ifndef WITH_NOIDREF + soap_init_iht(copy); +#endif + soap_init_pht(copy); + copy->header = NULL; + copy->fault = NULL; + copy->action = NULL; +#ifndef WITH_LEAN +#ifdef WITH_COOKIES + copy->cookies = soap_copy_cookies(copy, soap); +#else + copy->cookies = NULL; +#endif +#endif + copy->plugins = NULL; + for (p = soap->plugins; p; p = p->next) + { + struct soap_plugin *q = (struct soap_plugin*)SOAP_MALLOC(copy, sizeof(struct soap_plugin)); + if (!q) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Could not allocate plugin '%s'\n", p->id)); + soap_end(copy); + soap_done(copy); + return NULL; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copying plugin '%s'\n", p->id)); + *q = *p; + if (p->fcopy && (copy->error = p->fcopy(copy, q, p)) != SOAP_OK) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Could not copy plugin '%s' error = %d\n", p->id, copy->error)); + SOAP_FREE(copy, q); + soap_end(copy); + soap_done(copy); + return NULL; + } + q->next = copy->plugins; + copy->plugins = q; + } + } +#ifdef WITH_SELF_PIPE + pipe(copy->pipe_fd); + SOAP_SOCKNONBLOCK(copy->pipe_fd[0]) + SOAP_SOCKNONBLOCK(copy->pipe_fd[1]) +#endif + return copy; +} + +/******************************************************************************/ + +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_copy_stream(struct soap *copy, struct soap *soap) +{ + struct soap_attribute *tp = NULL, *tq; + if (copy == soap) + return; + copy->header = soap->header; + copy->mode = soap->mode; + copy->imode = soap->imode; + copy->omode = soap->omode; + copy->socket = soap->socket; + copy->sendsk = soap->sendsk; + copy->recvsk = soap->recvsk; + copy->transfer_timeout = soap->transfer_timeout; + copy->recv_maxlength = soap->recv_maxlength; + copy->recv_timeout = soap->recv_timeout; + copy->send_timeout = soap->send_timeout; + copy->connect_timeout = soap->connect_timeout; + copy->accept_timeout = soap->accept_timeout; + copy->socket_flags = soap->socket_flags; + copy->connect_flags = soap->connect_flags; + copy->connect_retry = soap->connect_retry; + copy->bind_flags = soap->bind_flags; + copy->bind_inet6 = soap->bind_inet6; + copy->bind_v6only = soap->bind_v6only; + copy->accept_flags = soap->accept_flags; + copy->sndbuf = soap->sndbuf; + copy->rcvbuf = soap->rcvbuf; + copy->linger_time = soap->linger_time; + copy->maxlevel = soap->maxlevel; + copy->maxlength = soap->maxlength; + copy->maxoccurs = soap->maxoccurs; + copy->os = soap->os; + copy->is = soap->is; + copy->sendfd = soap->sendfd; + copy->recvfd = soap->recvfd; + copy->bufidx = soap->bufidx; + copy->buflen = soap->buflen; + copy->ahead = soap->ahead; + copy->cdata = soap->cdata; + copy->chunksize = soap->chunksize; + copy->chunkbuflen = soap->chunkbuflen; + copy->keep_alive = soap->keep_alive; + copy->tcp_keep_alive = soap->tcp_keep_alive; + copy->tcp_keep_idle = soap->tcp_keep_idle; + copy->tcp_keep_intvl = soap->tcp_keep_intvl; + copy->tcp_keep_cnt = soap->tcp_keep_cnt; + copy->max_keep_alive = soap->max_keep_alive; +#ifndef WITH_NOIO + copy->peer = soap->peer; + copy->peerlen = soap->peerlen; + copy->ip = soap->ip; + copy->ip6[0] = soap->ip6[0]; + copy->ip6[1] = soap->ip6[1]; + copy->ip6[2] = soap->ip6[2]; + copy->ip6[3] = soap->ip6[3]; + copy->port = soap->port; + (void)soap_memcpy((void*)copy->host, sizeof(copy->host), (const void*)soap->host, sizeof(soap->host)); + (void)soap_memcpy((void*)copy->endpoint, sizeof(copy->endpoint), (const void*)soap->endpoint, sizeof(soap->endpoint)); +#endif +#ifdef WITH_OPENSSL + copy->bio = soap->bio; + copy->ssl = soap->ssl; + copy->ctx = soap->ctx; +#endif +#ifdef WITH_GNUTLS + copy->session = soap->session; +#endif +#ifdef WITH_WOLFSSL + copy->ssl = soap->ssl; + copy->ctx = soap->ctx; +#endif +#ifdef WITH_SYSTEMSSL + copy->ssl = soap->ssl; + copy->ctx = soap->ctx; +#endif +#ifdef WITH_ZLIB + copy->zlib_state = soap->zlib_state; + copy->zlib_in = soap->zlib_in; + copy->zlib_out = soap->zlib_out; + if (soap->d_stream && soap->zlib_state != SOAP_ZLIB_NONE) + { + if (!copy->d_stream) + copy->d_stream = (z_stream*)SOAP_MALLOC(copy, sizeof(z_stream)); + if (copy->d_stream) + (void)soap_memcpy((void*)copy->d_stream, sizeof(z_stream), (const void*)soap->d_stream, sizeof(z_stream)); + } + copy->z_crc = soap->z_crc; + copy->z_ratio_in = soap->z_ratio_in; + copy->z_ratio_out = soap->z_ratio_out; + copy->z_level = soap->z_level; + if (soap->z_buf && soap->zlib_state != SOAP_ZLIB_NONE) + { + if (!copy->z_buf) + copy->z_buf = (char*)SOAP_MALLOC(copy, sizeof(soap->buf)); + if (copy->z_buf) + (void)soap_memcpy((void*)copy->z_buf, sizeof(soap->buf), (const void*)soap->z_buf, sizeof(soap->buf)); + else + copy->z_buflen = 0; + } + else + { + copy->z_buf = NULL; + copy->z_buflen = 0; + } + copy->z_dict = soap->z_dict; + copy->z_dict_len = soap->z_dict_len; +#endif + (void)soap_memcpy((void*)copy->buf, sizeof(copy->buf), (const void*)soap->buf, sizeof(soap->buf)); + /* copy XML parser state */ + soap_free_ns(copy); + soap_set_local_namespaces(copy); + copy->version = soap->version; + if (soap->nlist && soap->local_namespaces) + { + struct soap_nlist *np = NULL, *nq; + /* copy reversed nlist */ + for (nq = soap->nlist; nq; nq = nq->next) + { + struct soap_nlist *nr = np; + size_t n = sizeof(struct soap_nlist) + strlen(nq->id); + np = (struct soap_nlist*)SOAP_MALLOC(copy, n); + if (!np) + { + np = nr; + break; + } + (void)soap_memcpy((void*)np, n, (const void*)nq, n); + np->next = nr; + } + while (np) + { + const char *s = np->ns; + copy->level = np->level; /* preserve element nesting level */ + if (!s && np->index >= 0) + { + s = soap->local_namespaces[np->index].out; + if (!s) + s = soap->local_namespaces[np->index].ns; + } + if (s) + (void)soap_push_namespace(copy, np->id, s); + nq = np; + np = np->next; + SOAP_FREE(copy, nq); + } + } + (void)soap_memcpy((void*)copy->tag, sizeof(copy->tag), (const void*)soap->tag, sizeof(soap->tag)); + (void)soap_memcpy((void*)copy->id, sizeof(copy->id), (const void*)soap->id, sizeof(soap->id)); + (void)soap_memcpy((void*)copy->href, sizeof(copy->href), (const void*)soap->href, sizeof(soap->href)); + (void)soap_memcpy((void*)copy->type, sizeof(copy->type), (const void*)soap->type, sizeof(soap->type)); + copy->other = soap->other; + copy->root = soap->root; + copy->null = soap->null; + copy->body = soap->body; + copy->part = soap->part; + copy->mustUnderstand = soap->mustUnderstand; + copy->level = soap->level; + copy->peeked = soap->peeked; + /* copy attributes */ + for (tq = soap->attributes; tq; tq = tq->next) + { + struct soap_attribute *tr = tp; + size_t n = sizeof(struct soap_attribute) + strlen(tq->name); + tp = (struct soap_attribute*)SOAP_MALLOC(copy, n); + (void)soap_memcpy((void*)tp, n, (const void*)tq, n); + if (tp->size) + { + tp->value = (char*)SOAP_MALLOC(copy, tp->size); + if (tp->value) + (void)soap_memcpy((void*)tp->value, tp->size, (const void*)tq->value, tp->size); + } + tp->ns = NULL; + tp->next = tr; + } + copy->attributes = tp; +} + +/******************************************************************************/ + +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_free_stream(struct soap *soap) +{ + soap->socket = SOAP_INVALID_SOCKET; + soap->sendsk = SOAP_INVALID_SOCKET; + soap->recvsk = SOAP_INVALID_SOCKET; +#ifdef WITH_OPENSSL + soap->bio = NULL; + soap->ssl = NULL; + soap->ctx = NULL; +#endif +#ifdef WITH_GNUTLS + soap->xcred = NULL; + soap->acred = NULL; + soap->cache = NULL; + soap->session = NULL; + soap->dh_params = NULL; + soap->rsa_params = NULL; +#endif +#ifdef WITH_WOLFSSL + soap->ssl = NULL; + soap->ctx = NULL; +#endif +#ifdef WITH_SYSTEMSSL + soap->ssl = (gsk_handle)NULL; + soap->ctx = (gsk_handle)NULL; +#endif +#ifdef WITH_ZLIB + if (soap->z_buf) + SOAP_FREE(soap, soap->z_buf); + soap->z_buf = NULL; +#endif +} + +/******************************************************************************/ + +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_initialize(struct soap *soap) +{ + soap_versioning(soap_init)(soap, SOAP_IO_DEFAULT, SOAP_IO_DEFAULT); +} + +/******************************************************************************/ + +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_versioning(soap_init)(struct soap *soap, soap_mode imode, soap_mode omode) +{ + size_t i; + soap->state = SOAP_INIT; +#ifdef SOAP_MEM_DEBUG + soap_init_mht(soap); +#endif +#ifdef SOAP_DEBUG + soap_init_logs(soap); +#endif +#ifdef TANDEM_NONSTOP + soap_set_test_logfile(soap, "TESTLOG"); + soap_set_sent_logfile(soap, "SENTLOG"); + soap_set_recv_logfile(soap, "RECVLOG"); +#else + soap_set_test_logfile(soap, "TEST.log"); + soap_set_sent_logfile(soap, "SENT.log"); + soap_set_recv_logfile(soap, "RECV.log"); +#endif +#ifdef WITH_SELF_PIPE + pipe(soap->pipe_fd); + SOAP_SOCKNONBLOCK(soap->pipe_fd[0]) + SOAP_SOCKNONBLOCK(soap->pipe_fd[1]) +#endif + soap->version = 0; + soap->imode = imode; + soap->omode = omode; + soap->mode = imode; + soap->plugins = NULL; + soap->user = NULL; + for (i = 0; i < sizeof(soap->data)/sizeof(*soap->data); i++) + soap->data[i] = NULL; + soap->bearer = NULL; + soap->userid = NULL; + soap->passwd = NULL; + soap->authrealm = NULL; +#ifdef WITH_NTLM + soap->ntlm_challenge = NULL; +#endif +#ifndef WITH_NOHTTP + soap->fpost = http_post; + soap->fget = http_get; + soap->fput = http_put; + soap->fpatch = http_patch; + soap->fdel = http_del; + soap->fopt = http_200; + soap->fhead = http_200; + soap->fform = NULL; + soap->fposthdr = http_post_header; + soap->fresponse = http_response; + soap->fparse = http_parse; + soap->fparsehdr = http_parse_header; +#endif + soap->fheader = NULL; + soap->fconnect = NULL; + soap->fdisconnect = NULL; +#ifndef WITH_NOIO + soap->ipv6_multicast_if = 0; /* in_addr_t value */ + soap->ipv4_multicast_if = NULL; /* points to struct in_addr or in_addr_t */ + soap->ipv4_multicast_ttl = 0; /* 0: use default */ + soap->client_addr = NULL; /* client address (IPv4 or IPv6 or host name) to bind before connect, NULL for none */ + soap->client_addr_ipv6 = NULL; /* client address IPv6 or host name to bind before connect, NULL for none */ + soap->client_port = -1; /* client port to bind before connect, -1 for none */ + soap->client_interface = NULL; /* client interface address, NULL for none */ +#ifndef WITH_IPV6 + soap->fresolve = tcp_gethost; +#else + soap->fresolve = NULL; +#endif + soap->faccept = tcp_accept; + soap->fopen = tcp_connect; + soap->fclose = tcp_disconnect; + soap->fclosesocket = tcp_closesocket; + soap->fshutdownsocket = tcp_shutdownsocket; + soap->fsend = fsend; + soap->frecv = frecv; + soap->fpoll = soap_poll; +#else + soap->fopen = NULL; + soap->fclose = NULL; + soap->fpoll = NULL; +#endif + soap->fseterror = NULL; + soap->fignore = NULL; + soap->fencoding = NULL; + soap->fserveloop = NULL; + soap->fplugin = fplugin; +#ifndef WITH_LEANER + soap->fsvalidate = NULL; + soap->fwvalidate = NULL; + soap->feltbegin = NULL; + soap->feltendin = NULL; + soap->feltbegout = NULL; + soap->feltendout = NULL; + soap->fprepareinitsend = NULL; + soap->fprepareinitrecv = NULL; + soap->fpreparesend = NULL; + soap->fpreparerecv = NULL; + soap->fpreparefinalsend = NULL; + soap->fpreparefinalrecv = NULL; + soap->ffiltersend = NULL; + soap->ffilterrecv = NULL; + soap->fdimereadopen = NULL; + soap->fdimewriteopen = NULL; + soap->fdimereadclose = NULL; + soap->fdimewriteclose = NULL; + soap->fdimeread = NULL; + soap->fdimewrite = NULL; + soap->fmimereadopen = NULL; + soap->fmimewriteopen = NULL; + soap->fmimereadclose = NULL; + soap->fmimewriteclose = NULL; + soap->fmimeread = NULL; + soap->fmimewrite = NULL; +#endif + soap->float_format = "%.9G"; /* Alternative: use "%G" */ + soap->double_format = "%.17lG"; /* Alternative: use "%lG" */ + soap->long_double_format = NULL; /* Defined in custom serializer custom/long_double.c */ + soap->dime_id_format = "cid:id%d"; /* default DIME id format for int id index */ + soap->recv_maxlength = 0x7FFFFFFF; /* default max length of messages received (2GB) */ + soap->recv_timeout = 0; + soap->send_timeout = 0; + soap->transfer_timeout = 0; + soap->connect_timeout = 0; + soap->accept_timeout = 0; + soap->socket_flags = 0; + soap->connect_flags = 0; + soap->connect_retry = 0; + soap->bind_flags = 0; +#ifdef WITH_IPV6_V6ONLY + soap->bind_inet6 = 1; + soap->bind_v6only = 1; +#else + soap->bind_inet6 = 0; + soap->bind_v6only = 0; +#endif + soap->accept_flags = 0; +#ifdef WIN32 + soap->sndbuf = SOAP_BUFLEN + 1; /* this size speeds up windows xfer */ + soap->rcvbuf = SOAP_BUFLEN + 1; +#else + soap->sndbuf = SOAP_BUFLEN; + soap->rcvbuf = SOAP_BUFLEN; +#endif + soap->linger_time = 0; + soap->maxlevel = SOAP_MAXLEVEL; + soap->maxlength = SOAP_MAXLENGTH; + soap->maxoccurs = SOAP_MAXOCCURS; + soap->http_version = "1.1"; + soap->proxy_http_version = "1.0"; + soap->http_content = NULL; + soap->http_extra_header = NULL; + soap->actor = NULL; + soap->lang = "en"; + soap->keep_alive = 0; + soap->tcp_keep_alive = 0; + soap->tcp_keep_idle = 0; + soap->tcp_keep_intvl = 0; + soap->tcp_keep_cnt = 0; + soap->max_keep_alive = SOAP_MAXKEEPALIVE; + soap->ip = 0; + soap->ip6[0] = 0; + soap->ip6[1] = 0; + soap->ip6[2] = 0; + soap->ip6[3] = 0; + soap->labbuf = NULL; + soap->lablen = 0; + soap->labidx = 0; + soap->encodingStyle = NULL; +#ifndef WITH_NONAMESPACES + soap->namespaces = namespaces; +#else + soap->namespaces = NULL; +#endif + soap->local_namespaces = NULL; + soap->nlist = NULL; + soap->blist = NULL; + soap->clist = NULL; + soap->alist = NULL; + soap->shaky = 0; + soap->attributes = NULL; + soap->header = NULL; + soap->fault = NULL; + soap->master = SOAP_INVALID_SOCKET; + soap->socket = SOAP_INVALID_SOCKET; + soap->sendsk = SOAP_INVALID_SOCKET; + soap->recvsk = SOAP_INVALID_SOCKET; + soap->os = NULL; + soap->is = NULL; +#ifndef WITH_LEANER + soap->dom = NULL; + soap->dime.list = NULL; + soap->dime.first = NULL; + soap->dime.last = NULL; + soap->mime.list = NULL; + soap->mime.first = NULL; + soap->mime.last = NULL; + soap->mime.boundary = NULL; + soap->mime.start = NULL; + soap->xlist = NULL; +#endif +#ifndef UNDER_CE + soap->recvfd = 0; + soap->sendfd = 1; +#else + soap->recvfd = stdin; + soap->sendfd = stdout; +#endif + soap->tag[0] = '\0'; + soap->id[0] = '\0'; + soap->href[0] = '\0'; + soap->type[0] = '\0'; + soap->arrayType[0] = '\0'; + soap->arraySize[0] = '\0'; + soap->arrayOffset[0] = '\0'; + soap->endpoint[0] = '\0'; + soap->host[0] = '\0'; + soap->path[0] = '\0'; + soap->port = 0; + soap->override_host = NULL; + soap->override_port = 0; + soap->action = NULL; + soap->proxy_host = NULL; + soap->proxy_port = 8080; + soap->proxy_userid = NULL; + soap->proxy_passwd = NULL; + soap->proxy_from = NULL; + soap->origin = NULL; + soap->cors_origin = NULL; + soap->cors_allow = "*"; + soap->cors_method = NULL; + soap->cors_header = NULL; + soap->cors_methods = NULL; + soap->cors_headers = NULL; + soap->x_frame_options = "SAMEORIGIN"; + soap->prolog = "\n"; + soap->zlib_state = SOAP_ZLIB_NONE; + soap->zlib_in = SOAP_ZLIB_NONE; + soap->zlib_out = SOAP_ZLIB_NONE; + soap->d_stream = NULL; + soap->z_buf = NULL; + soap->z_level = 6; + soap->z_dict = NULL; + soap->z_dict_len = 0; +#ifndef WITH_LEAN + soap->wsuid = NULL; + soap->c14nexclude = NULL; + soap->c14ninclude = NULL; + soap->cookies = NULL; + soap->cookie_domain = NULL; + soap->cookie_path = NULL; + soap->cookie_max = 32; +#endif +#ifdef WMW_RPM_IO + soap->rpmreqid = NULL; +#endif +#ifndef WITH_NOIDREF + soap_init_iht(soap); +#endif + soap_init_pht(soap); +#ifdef WITH_OPENSSL + if (!soap_ssl_init_done) + soap_ssl_init(); + soap->fsslauth = ssl_auth_init; + soap->fsslverify = NULL; + soap->bio = NULL; + soap->ssl = NULL; + soap->ctx = NULL; + soap->session = NULL; + soap->dhfile = NULL; + soap->randfile = NULL; + soap->session_host[0] = '\0'; + soap->session_port = 443; + soap->ssl_flags = SOAP_SSL_DEFAULT; + soap->keyfile = NULL; + soap->keyid = NULL; + soap->password = NULL; + soap->cafile = NULL; + soap->capath = NULL; + soap->crlfile = NULL; +#endif +#ifdef WITH_GNUTLS + if (!soap_ssl_init_done) + soap_ssl_init(); + soap->fsslauth = ssl_auth_init; + soap->fsslverify = NULL; + soap->xcred = NULL; + soap->acred = NULL; + soap->cache = NULL; + soap->session = NULL; + soap->dh_params = NULL; + soap->rsa_params = NULL; + soap->ssl_flags = SOAP_SSL_DEFAULT; + soap->keyfile = NULL; + soap->keyid = NULL; + soap->password = NULL; + soap->cafile = NULL; + soap->capath = NULL; + soap->crlfile = NULL; +#endif +#ifdef WITH_WOLFSSL + if (!soap_ssl_init_done) + soap_ssl_init(); + soap->fsslauth = ssl_auth_init; + soap->fsslverify = NULL; + soap->ssl = NULL; + soap->ctx = NULL; + soap->session = NULL; + soap->dhfile = NULL; + soap->randfile = NULL; + soap->ssl_flags = SOAP_SSL_DEFAULT; + soap->keyfile = NULL; + soap->keyid = NULL; + soap->password = NULL; + soap->cafile = NULL; + soap->capath = NULL; + soap->crlfile = NULL; +#endif +#ifdef WITH_SYSTEMSSL + soap->fsslauth = ssl_auth_init; + soap->fsslverify = NULL; + soap->bio = NULL; + soap->ssl = (gsk_handle)NULL; + soap->ctx = (gsk_handle)NULL; + soap->session = NULL; + soap->ssl_flags = SOAP_SSL_DEFAULT; + soap->keyfile = NULL; + soap->keyid = NULL; + soap->password = NULL; + soap->cafile = NULL; + soap->capath = NULL; + soap->crlfile = NULL; + soap->dhfile = NULL; + soap->randfile = NULL; +#endif + soap->c_locale = NULL; + soap->buflen = 0; + soap->bufidx = 0; +#ifndef WITH_LEANER + soap->dime.chunksize = 0; + soap->dime.buflen = 0; +#endif + soap->other = 0; + soap->root = -1; + soap->null = 0; + soap->position = 0; + soap->encoding = 0; + soap->mustUnderstand = 0; + soap->ns = 0; + soap->part = SOAP_END; + soap->event = 0; + soap->evlev = 0; + soap->alloced = 0; + soap->count = 0; + soap->length = 0; + soap->cdata = 0; + soap->peeked = 0; + soap->ahead = 0; + soap->idnum = 0; + soap->level = 0; + soap->status = 0; + soap->error = SOAP_OK; + soap->errmode = 0; + soap->errnum = 0; +} + +/******************************************************************************/ + +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_begin(struct soap *soap) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Clean up for input/output\n")); + soap->error = SOAP_OK; + if (!soap->keep_alive) + { + soap->buflen = 0; + soap->bufidx = 0; + } + soap->encoding = 0; + soap->mode = 0; + soap->part = SOAP_END; + soap->peeked = 0; + soap->ahead = 0; + soap->level = 0; + soap->encodingStyle = SOAP_STR_EOS; + soap_free_temp(soap); +} + +/******************************************************************************/ + +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_end(struct soap *soap) +{ + if (soap_check_state(soap)) + return; + soap_free_temp(soap); + soap_dealloc(soap, NULL); + while (soap->clist) + { + struct soap_clist *cp = soap->clist->next; + SOAP_FREE(soap, soap->clist); + soap->clist = cp; + } + (void)soap_closesock(soap); +#ifdef SOAP_DEBUG + soap_close_logfiles(soap); +#endif +} + +/******************************************************************************/ + +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_set_version(struct soap *soap, short version) +{ + soap_set_local_namespaces(soap); + if (soap->version != version && soap->local_namespaces && soap->local_namespaces[0].id && soap->local_namespaces[1].id) + { + if (version == 1) + { + soap->local_namespaces[0].ns = soap_env1; + soap->local_namespaces[1].ns = soap_enc1; + } + else if (version == 2) + { + soap->local_namespaces[0].ns = soap_env2; + soap->local_namespaces[1].ns = soap_enc2; + } + soap->version = version; + } + if (version == 0) + soap->encodingStyle = SOAP_STR_EOS; + else + soap->encodingStyle = NULL; +} + +/******************************************************************************/ + +static void +soap_version(struct soap *soap) +{ + struct Namespace *p = soap->local_namespaces; + if (p) + { + const char *ns = p[0].out; + if (!ns) + ns = p[0].ns; + if (ns) + { + if (!strcmp(ns, soap_env1)) + { + soap->version = 1; /* make sure we use SOAP 1.1 */ + if (p[1].out) + SOAP_FREE(soap, p[1].out); + p[1].out = (char*)SOAP_MALLOC(soap, sizeof(soap_enc1)); + if (p[1].out) + (void)soap_memcpy(p[1].out, sizeof(soap_enc1), soap_enc1, sizeof(soap_enc1)); + } + else if (!strcmp(ns, soap_env2)) + { + soap->version = 2; /* make sure we use SOAP 1.2 */ + if (p[1].out) + SOAP_FREE(soap, p[1].out); + p[1].out = (char*)SOAP_MALLOC(soap, sizeof(soap_enc2)); + if (p[1].out) + (void)soap_memcpy(p[1].out, sizeof(soap_enc2), soap_enc2, sizeof(soap_enc2)); + } + } + } +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_set_namespaces(struct soap *soap, const struct Namespace *p) +{ + struct Namespace *ns = soap->local_namespaces; + struct soap_nlist *np, *nq, *nr; + unsigned int level = soap->level; + soap->namespaces = p; + soap->local_namespaces = NULL; + soap_set_local_namespaces(soap); + /* reverse the namespace list */ + np = soap->nlist; + soap->nlist = NULL; + if (np) + { + nq = np->next; + np->next = NULL; + while (nq) + { + nr = nq->next; + nq->next = np; + np = nq; + nq = nr; + } + } + /* then push on new stack */ + while (np) + { + const char *s; + soap->level = np->level; /* preserve element nesting level */ + s = np->ns; + if (!s && np->index >= 0 && ns) + { + s = ns[np->index].out; + if (!s) + s = ns[np->index].ns; + } + if (s) + (void)soap_push_namespace(soap, np->id, s); + nq = np; + np = np->next; + SOAP_FREE(soap, nq); + } + if (ns) + { + int i; + for (i = 0; ns[i].id; i++) + { + if (ns[i].out) + { + SOAP_FREE(soap, ns[i].out); + ns[i].out = NULL; + } + } + SOAP_FREE(soap, ns); + } + soap->level = level; /* restore level */ + return SOAP_OK; +} + +/******************************************************************************/ + +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_set_local_namespaces(struct soap *soap) +{ + if (soap->namespaces && !soap->local_namespaces) + { + const struct Namespace *ns1; + struct Namespace *ns2; + size_t n = 1; + for (ns1 = soap->namespaces; ns1->id; ns1++) + n++; + n *= sizeof(struct Namespace); + ns2 = (struct Namespace*)SOAP_MALLOC(soap, n); + if (ns2) + { + (void)soap_memcpy((void*)ns2, n, (const void*)soap->namespaces, n); + if (ns2[0].ns) + { + if (!strcmp(ns2[0].ns, soap_env1)) + soap->version = 1; + else if (!strcmp(ns2[0].ns, soap_env2)) + soap->version = 2; + } + soap->local_namespaces = ns2; + for (; ns2->id; ns2++) + ns2->out = NULL; + } + } +} + +/******************************************************************************/ + +#ifndef WITH_LEAN +SOAP_FMAC1 +const char * +SOAP_FMAC2 +soap_tagsearch(const char *big, const char *little) +{ + if (big && little) + { + size_t n = strlen(little); + const char *s = big; + while (s) + { + const char *t = s; + size_t i; + for (i = 0; i < n; i++, t++) + { + if (*t != little[i]) + break; + } + if (*t == '\0' || *t == ' ') + { + if (i == n || (i > 0 && little[i-1] == ':')) + return s; + } + s = strchr(t, ' '); + if (s) + s++; + } + } + return NULL; +} +#endif + +/******************************************************************************/ + +SOAP_FMAC1 +struct soap_nlist * +SOAP_FMAC2 +soap_lookup_ns(struct soap *soap, const char *tag, size_t n) +{ + struct soap_nlist *np; + for (np = soap->nlist; np; np = np->next) + if (!strncmp(np->id, tag, n) && !np->id[n]) + return np; + return NULL; +} + +/******************************************************************************/ + +#ifndef WITH_LEAN +static struct soap_nlist * +soap_push_ns(struct soap *soap, const char *id, const char *ns, short utilized, short isearly) +{ + struct soap_nlist *np = NULL; + size_t n, k; + unsigned int level = soap->level + isearly; + if (soap_tagsearch(soap->c14nexclude, id)) + return NULL; + if (!utilized) + { + for (np = soap->nlist; np; np = np->next) + { + if (!strcmp(np->id, id) && ((!np->ns && *id) || (ns && np->ns && !strcmp(np->ns, ns)))) + break; + } + if (np) + { + if ((np->level < level || (!np->ns && *id)) && np->index == 1) + utilized = 1; + else + return NULL; + } + } + else if (!*id) + { + for (np = soap->nlist; np; np = np->next) + { + if (!*np->id && np->level == level && np->index != 1) + return NULL; + } + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Adding namespace binding (level=%u) '%s' '%s' utilized=%d\n", level, id, ns ? ns : "(null)", utilized)); + n = strlen(id); + if (ns) + k = strlen(ns) + 1; + else + k = 0; + if (sizeof(struct soap_nlist) + n + k > n && (SOAP_MAXALLOCSIZE <= 0 || sizeof(struct soap_nlist) + n + k <= SOAP_MAXALLOCSIZE)) + np = (struct soap_nlist*)SOAP_MALLOC(soap, sizeof(struct soap_nlist) + n + k); + if (!np) + { + soap->error = SOAP_EOM; + return NULL; + } + np->next = soap->nlist; + soap->nlist = np; + soap_strcpy((char*)np->id, n + 1, id); + if (ns) + { + np->ns = np->id + n + 1; + soap_strcpy((char*)np->ns, k, ns); + } + else + { + np->ns = NULL; + } + np->level = level; + np->index = utilized; + return np; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_LEAN +static void +soap_utilize_ns(struct soap *soap, const char *tag, short isearly) +{ + struct soap_nlist *np; + size_t n = 0; + if (!strncmp(tag, "xmlns:", 6)) + { + tag += 6; + n = strlen(tag); + } + else + { + const char *t = strchr(tag, ':'); + if (t) + n = t - tag; + } + np = soap_lookup_ns(soap, tag, n); + if (np) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Utilizing namespace '%s' of '%s' at level %u utilized=%d at level=%u\n", np->ns ? np->ns : "", tag, soap->level + isearly, np->index, np->level)); + if (np->index <= 0) + { + if (np->level == soap->level + isearly) + np->index = 1; + else + (void)soap_push_ns(soap, np->id, np->ns, 1, isearly); + } + } + else if (strncmp(tag, "xml", 3)) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Utilizing default namespace of '%s' at level %u\n", tag, soap->level + isearly)); + (void)soap_strncpy(soap->tag, sizeof(soap->tag), tag, n); + (void)soap_push_ns(soap, soap->tag, NULL, 1, isearly); + } +} +#endif + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_element(struct soap *soap, const char *tag, int id, const char *type) +{ +#ifndef WITH_LEAN + const char *s; +#endif + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Element begin tag='%s' level='%u' id='%d' type='%s'\n", tag, soap->level, id, type ? type : SOAP_STR_EOS)); +#ifndef WITH_LEAN + if (soap_tagsearch(soap->wsuid, tag)) + { + size_t i; + for (s = tag, i = 0; *s && i < sizeof(soap->href) - 1; s++, i++) + soap->href[i] = *s == ':' ? '-' : *s; + soap->href[i] = '\0'; + if (soap_set_attr(soap, "wsu:Id", soap->href, 1)) + return soap->error; + } +#endif + soap->level++; + if (soap->level > soap->maxlevel) + return soap->error = SOAP_LEVEL; +#ifndef WITH_LEAN + if ((soap->mode & SOAP_XML_CANONICAL) && !(soap->mode & SOAP_DOM_ASIS)) + { + if (soap->evlev >= soap->level) + soap->evlev = 0; + if (soap->event == SOAP_SEC_BEGIN && !soap->evlev) + { + struct soap_nlist *np; + /* non-nested wsu:Id found: clear xmlns, re-emit them for exc-c14n */ + for (np = soap->nlist; np; np = np->next) + { + int p = soap->c14ninclude ? *soap->c14ninclude == '+' || soap_tagsearch(soap->c14ninclude, np->id) != NULL : 0; + if (np->index == 2 || p) + { + struct soap_nlist *np1 = soap_push_ns(soap, np->id, np->ns, 1, 0); + if (np1 && !p) + np1->index = 0; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Reset binding %s='%s' utilized=%d to utilized=%d\n", np->id, np->ns ? np->ns : SOAP_STR_EOS, np->index, np1 ? np1->index : np->index)); + } + } + soap->evlev = soap->level; + } + } +#endif +#ifdef WITH_DOM + if ((soap->mode & SOAP_XML_DOM)) + { + struct soap_dom_element *elt = (struct soap_dom_element*)soap_malloc(soap, sizeof(struct soap_dom_element)); + if (!elt) + return soap->error = SOAP_EOM; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Adding DOM element tag='%s' %p (parent='%s' %p)\n", tag, elt, soap->dom ? soap->dom->name : "(null)", soap->dom)); + elt->soap = soap; + elt->next = NULL; + elt->prnt = soap->dom; + elt->elts = NULL; + elt->atts = NULL; + elt->nstr = NULL; + elt->name = soap_strdup(soap, tag); + elt->lead = NULL; + elt->text = NULL; + elt->code = NULL; + elt->tail = NULL; + elt->node = NULL; + elt->type = 0; + if (soap->dom) + { + struct soap_dom_element *p = soap->dom->elts; + if (p) + { + while (p->next) + p = p->next; + p->next = elt; + } + else + { + soap->dom->elts = elt; + } + } + soap->dom = elt; + if (!elt->name) + return soap->error = SOAP_EOM; + } + else + { +#endif +#ifndef WITH_LEAN + if (!soap->ns) + { + if (!(soap->mode & SOAP_XML_CANONICAL) && soap_send(soap, soap->prolog)) + return soap->error; + } + else if ((soap->mode & SOAP_XML_INDENT)) + { + if (soap->ns == 1 && soap_send_raw(soap, soap_indent, soap->level < sizeof(soap_indent) ? soap->level : sizeof(soap_indent) - 1)) + return soap->error; + soap->body = 1; + } + if ((soap->mode & SOAP_XML_DEFAULTNS)) + { + size_t n = 0; + s = strchr(tag, ':'); + if (s) + { + n = s++ - tag; + if (type && !strncmp(type, tag, n + 1)) + type += n + 1; + } + else + { + s = tag; + } + if (soap_send_raw(soap, "<", 1) + || soap_send(soap, s)) + return soap->error; + if (n) + { + struct Namespace *ns = soap->local_namespaces; + for (; ns && ns->id; ns++) + { + if (*ns->id && ns->ns && !strncmp(ns->id, tag, n) && !ns->id[n]) + { + if (!soap->nlist || *soap->nlist->id || (soap->nlist->ns && strcmp(soap->nlist->ns, ns->ns))) + { + (void)soap_push_ns(soap, SOAP_STR_EOS, ns->out ? ns->out : ns->ns, 0, 0); + if (soap_attribute(soap, "xmlns", ns->out ? ns->out : ns->ns)) + return soap->error; + } + break; + } + } + } +#ifndef WITH_NOEMPTYNAMESPACES + else if (!soap->nlist || *soap->nlist->id || (soap->nlist->ns && *soap->nlist->ns)) + { + (void)soap_push_ns(soap, SOAP_STR_EOS, SOAP_STR_EOS, 0, 0); + if (soap_attribute(soap, "xmlns", SOAP_STR_EOS)) + return soap->error; + } +#endif + } + else +#endif + if (soap_send_raw(soap, "<", 1) + || soap_send(soap, tag)) + return soap->error; +#ifdef WITH_DOM + } +#endif + if (!soap->ns) + { + struct Namespace *ns = soap->local_namespaces; + for (; ns && ns->id; ns++) + { + const char *t = ns->out; + if (!t) + t = ns->ns; + if (*ns->id && t && *t) + { + (SOAP_SNPRINTF(soap->tmpbuf, sizeof(soap->tmpbuf), strlen(ns->id) + 6), "xmlns:%s", ns->id); + if (soap_attribute(soap, soap->tmpbuf, t)) + return soap->error; + } + } + } + soap->ns = 1; /* namespace table control: ns = 0 or 2 to start, then 1 to stop dumping the table */ +#ifndef WITH_LEAN + if ((soap->mode & SOAP_XML_CANONICAL)) + { + if ((soap->mode & SOAP_XML_DEFAULTNS)) + soap_utilize_ns(soap, SOAP_STR_EOS, 0); + else + soap_utilize_ns(soap, tag, 0); + } +#endif + if (id > 0) + { + (SOAP_SNPRINTF(soap->tmpbuf, sizeof(soap->tmpbuf), sizeof(SOAP_BASEREFNAME) + 20), SOAP_BASEREFNAME "%d", id); + if (soap->version == 2) + { + if (soap_attribute(soap, "SOAP-ENC:id", soap->tmpbuf)) + return soap->error; + } + else if (soap_attribute(soap, "id", soap->tmpbuf)) + { + return soap->error; + } + } + if (type && *type && !(soap->mode & SOAP_XML_NOTYPE)) + { +#ifndef WITH_LEAN + if ((soap->mode & SOAP_XML_CANONICAL) && !(soap->mode & SOAP_XML_CANONICAL_NA)) + soap_utilize_ns(soap, type, 0); +#endif + if (soap_attribute(soap, "xsi:type", type)) + return soap->error; + } + if (soap->null && soap->position > 0 && soap->version == 1) + { + int i; + (SOAP_SNPRINTF(soap->tmpbuf, sizeof(soap->tmpbuf) - 1, 20), "[%d", soap->positions[0]); + for (i = 1; i < soap->position; i++) + { + size_t l = strlen(soap->tmpbuf); + (SOAP_SNPRINTF(soap->tmpbuf + l, sizeof(soap->tmpbuf) - l - 1, 20), ",%d", soap->positions[i]); + } + soap_strcat(soap->tmpbuf, sizeof(soap->tmpbuf), "]"); + if (soap_attribute(soap, "SOAP-ENC:position", soap->tmpbuf)) + return soap->error; + } + if (soap->mustUnderstand) + { + if (soap->actor && *soap->actor) + { + if (soap_attribute(soap, soap->version == 2 ? "SOAP-ENV:role" : "SOAP-ENV:actor", soap->actor)) + return soap->error; + } + if (soap_attribute(soap, "SOAP-ENV:mustUnderstand", soap->version == 2 ? "true" : "1")) + return soap->error; + soap->mustUnderstand = 0; + } + if (soap->encoding) + { + if (soap->encodingStyle && soap->local_namespaces && soap->local_namespaces[0].id && soap->local_namespaces[1].id) + { + if (!*soap->encodingStyle) + { + if (soap->local_namespaces[1].out) + soap->encodingStyle = soap->local_namespaces[1].out; + else + soap->encodingStyle = soap->local_namespaces[1].ns; + } + if (soap->encodingStyle && soap_attribute(soap, "SOAP-ENV:encodingStyle", soap->encodingStyle)) + return soap->error; + } + else + { + soap->encodingStyle = NULL; + } + soap->encoding = 0; + } + soap->null = 0; + soap->position = 0; + return SOAP_OK; +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_element_begin_out(struct soap *soap, const char *tag, int id, const char *type) +{ + if (*tag == '-') + return SOAP_OK; +#ifdef WITH_DOM + if (soap->feltbegout) + return soap->error = soap->feltbegout(soap, tag, id, type); +#endif + if (soap_element(soap, tag, id, type)) + return soap->error; + return soap_element_start_end_out(soap, NULL); +} + +/******************************************************************************/ + +#if _MSC_VER < 1400 && !defined(HAVE_STRLCAT) +/* concat string (truncating the result, strings must not be NULL) */ +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_strcat(char *t, size_t n, const char *s) +{ + size_t k = strlen(t); + if (k < n) + { + t += k; + n -= k; + while (n-- > 1 && *s) + *t++ = *s++; + *t = '\0'; + } +} +#endif + +/******************************************************************************/ + +#if _MSC_VER < 1400 +/* concat string up to m chars (leaves destination intact on overrun and returns nonzero, zero if OK) */ +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_strncat(char *t, size_t n, const char *s, size_t m) +{ + size_t k; + if (!t || !s) + return 1; + k = strlen(t); + if (n <= k + m) + return 1; + t += k; + n -= k; + while (n-- > 1 && *s) + *t++ = *s++; + *t = '\0'; + return 0; +} +#endif + +/******************************************************************************/ + +#ifndef HAVE_STRRCHR +SOAP_FMAC1 +char* +SOAP_FMAC2 +soap_strrchr(const char *s, int t) +{ + char *r = NULL; + while (*s) + if (*s++ == t) + r = (char*)s - 1; + return r; +} +#endif + +/******************************************************************************/ + +#ifndef HAVE_STRTOL +SOAP_FMAC1 +long +SOAP_FMAC2 +soap_strtol(const char *s, char **t, int b) +{ + long n = 0; + int c; + while (*s > 0 && *s <= 32) + s++; + if (b == 10) + { + short neg = 0; + if (*s == '-') + { + s++; + neg = 1; + } + else if (*s == '+') + { + s++; + } + while ((c = *s) && c >= '0' && c <= '9') + { + if (n >= 214748364 && (n > 214748364 || c >= '8')) + { + if (neg && n == 214748364 && c == '8') + { + if (t) + *t = (char*)(s + 1); + return -2147483648; + } + break; + } + n *= 10; + n += c - '0'; + s++; + } + if (neg) + n = -n; + } + else /* assume b == 16 and value is always positive */ + { + while ((c = *s)) + { + if (c >= '0' && c <= '9') + c -= '0'; + else if (c >= 'A' && c <= 'F') + c -= 'A' - 10; + else if (c >= 'a' && c <= 'f') + c -= 'a' - 10; + if (n > 0x07FFFFFF) + break; + n <<= 4; + n += c; + s++; + } + } + if (t) + *t = (char*)s; + return n; +} +#endif + +/******************************************************************************/ + +#ifndef HAVE_STRTOUL +SOAP_FMAC1 +unsigned long +SOAP_FMAC2 +soap_strtoul(const char *s, char **t, int b) +{ + unsigned long n = 0; + int c; + while (*s > 0 && *s <= 32) + s++; + if (b == 10) + { + short neg = 0; + if (*s == '-') + { + s++; + neg = 1; + } + else if (*s == '+') + { + s++; + } + while ((c = *s) && c >= '0' && c <= '9') + { + if (n >= 429496729 && (n > 429496729 || c >= '6')) + break; + n *= 10; + n += c - '0'; + s++; + } + if (neg && n > 0) + s--; + } + else /* b == 16 */ + { + while ((c = *s)) + { + if (c >= '0' && c <= '9') + c -= '0'; + else if (c >= 'A' && c <= 'F') + c -= 'A' - 10; + else if (c >= 'a' && c <= 'f') + c -= 'a' - 10; + if (n > 0x0FFFFFFF) + break; + n <<= 4; + n += c; + s++; + } + } + if (t) + *t = (char*)s; + return n; +} +#endif + +/******************************************************************************/ + +#ifndef soap_strtoll +SOAP_FMAC1 +LONG64 +SOAP_FMAC2 +soap_strtoll(const char *s, char **t, int b) +{ + LONG64 n = 0LL; + int c; + while (*s > 0 && *s <= 32) + s++; + if (b == 10) + { + short neg = 0; + if (*s == '-') + { + s++; + neg = 1; + } + else if (*s == '+') + { + s++; + } + while ((c = *s) && c >= '0' && c <= '9') + { + if (n >= 922337203685477580LL && (n > 922337203685477580LL || c >= '8')) + { + if (neg && n == 922337203685477580LL && c == '8') + { + if (t) + *t = (char*)(s + 1); + return -9223372036854775807LL - 1LL; /* appease compilers that complain */ + } + break; + } + n *= 10LL; + n += c - '0'; + s++; + } + if (neg) + n = -n; + } + else /* assume b == 16 and value is always positive */ + { + while ((c = *s)) + { + if (c >= '0' && c <= '9') + c -= '0'; + else if (c >= 'A' && c <= 'F') + c -= 'A' - 10; + else if (c >= 'a' && c <= 'f') + c -= 'a' - 10; + if (n > 0x07FFFFFFFFFFFFFFLL) + break; + n <<= 4; + n += c; + s++; + } + } + if (t) + *t = (char*)s; + return n; +} +#endif + +/******************************************************************************/ + +#ifndef soap_strtoull +SOAP_FMAC1 +ULONG64 +SOAP_FMAC2 +soap_strtoull(const char *s, char **t, int b) +{ + ULONG64 n = 0UL; + int c; + while (*s > 0 && *s <= 32) + s++; + if (b == 10) + { + short neg = 0; + if (*s == '-') + { + s++; + neg = 1; + } + else if (*s == '+') + { + s++; + } + while ((c = *s) && c >= '0' && c <= '9') + { + if (n >= 1844674407370955161ULL && (n > 1844674407370955161ULL || c >= '6')) + break; + n *= 10UL; + n += c - '0'; + s++; + } + if (neg && n > 0UL) + s--; + } + else /* b == 16 */ + { + while ((c = *s)) + { + if (c >= '0' && c <= '9') + c -= '0'; + else if (c >= 'A' && c <= 'F') + c -= 'A' - 10; + else if (c >= 'a' && c <= 'f') + c -= 'a' - 10; + if (n > 0x0FFFFFFFFFFFFFFFULL) + break; + n <<= 4; + n += c; + s++; + } + } + if (t) + *t = (char*)s; + return n; +} +#endif + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_array_begin_out(struct soap *soap, const char *tag, int id, const char *type, const char *offset) +{ + if (!type || !*type || soap->version == 0) + return soap_element_begin_out(soap, tag, id, NULL); + if (soap_element(soap, tag, id, NULL)) + return soap->error; + if (soap->version == 1) + { + if (offset && soap_attribute(soap, "SOAP-ENC:offset", offset)) + return soap->error; + if (soap_attribute(soap, "SOAP-ENC:arrayType", type)) + return soap->error; + } + else + { + const char *s; + s = strchr(type, '['); + if (s && (size_t)(s - type) < sizeof(soap->tmpbuf)) + { + (void)soap_strncpy(soap->tmpbuf, sizeof(soap->tmpbuf), type, s - type); + if (soap_attribute(soap, "SOAP-ENC:itemType", soap->tmpbuf)) + return soap->error; + s++; + if (*s && *s != ']') + { + soap_strcpy(soap->tmpbuf, sizeof(soap->tmpbuf), s); + soap->tmpbuf[strlen(soap->tmpbuf) - 1] = '\0'; + if (soap_attribute(soap, "SOAP-ENC:arraySize", soap->tmpbuf)) + return soap->error; + } + } + } +#ifndef WITH_LEAN + if ((soap->mode & SOAP_XML_CANONICAL) && !(soap->mode & SOAP_XML_CANONICAL_NA)) + soap_utilize_ns(soap, type, 0); +#endif + return soap_element_start_end_out(soap, NULL); +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_element_start_end_out(struct soap *soap, const char *tag) +{ + struct soap_attribute *tp; +#ifndef WITH_LEAN + if ((soap->mode & SOAP_XML_CANONICAL)) + { + struct soap_nlist *np; + for (tp = soap->attributes; tp; tp = tp->next) + { + if (tp->visible && *tp->name && strchr(tp->name, ':')) + soap_utilize_ns(soap, tp->name, 0); + } + if (soap->event == SOAP_SEC_BEGIN) + { + for (np = soap->nlist; np; np = np->next) + if (soap_tagsearch(soap->c14ninclude, np->id)) + (void)soap_push_ns(soap, np->id, np->ns, 1, 0); + soap->event = 0; + soap->evlev = 0; + } + for (np = soap->nlist; np; np = np->next) + { + if (np->ns && np->index == 1) + { + if (*np->id) + (SOAP_SNPRINTF(soap->tmpbuf, sizeof(soap->tmpbuf), strlen(np->id) + 6), "xmlns:%s", np->id); + else + soap_strcpy(soap->tmpbuf, sizeof(soap->tmpbuf), "xmlns"); + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Enabling utilized binding (level=%u) %s='%s' SEC-BEGIN=%d c14ninclude='%s'\n", np->level, soap->tmpbuf, np->ns, soap->event == SOAP_SEC_BEGIN, soap->c14ninclude ? soap->c14ninclude : "(null)")); + np->index = 2; + soap->level--; + if (*np->id || *np->ns || soap->level > 1) + if (soap_set_attr(soap, soap->tmpbuf, np->ns, 1)) + return soap->error; + soap->level++; + } + else + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Binding (level=%u) %s='%s' utilized=%d\n", np->level, np->id, np->ns ? np->ns : SOAP_STR_EOS, np->index)); + } + } + } +#endif +#ifdef WITH_DOM + if ((soap->mode & SOAP_XML_DOM) && soap->dom) + { + struct soap_dom_attribute **att; + att = &soap->dom->atts; + for (tp = soap->attributes; tp; tp = tp->next) + { + if (tp->visible) + { + *att = (struct soap_dom_attribute*)soap_malloc(soap, sizeof(struct soap_dom_attribute)); + if (!*att) + return soap->error; + (*att)->next = NULL; + (*att)->nstr = NULL; + (*att)->name = soap_strdup(soap, tp->name); + (*att)->text = soap_strdup(soap, tp->value); + (*att)->soap = soap; + if (!(*att)->name || (tp->value && !(*att)->text)) + return soap->error = SOAP_EOM; + att = &(*att)->next; + tp->visible = 0; + } + } + return SOAP_OK; + } +#endif + for (tp = soap->attributes; tp; tp = tp->next) + { + if (tp->visible) + { + if (soap_send_raw(soap, " ", 1) || soap_send(soap, tp->name)) + return soap->error; + if (tp->visible == 2 && tp->value) + { + if (soap_send_raw(soap, "=\"", 2) + || soap_string_out(soap, tp->value, tp->flag) + || soap_send_raw(soap, "\"", 1)) + return soap->error; + } + else + { + if (soap_send_raw(soap, "=\"\"", 3)) + return soap->error; + } + tp->visible = 0; + } + } + if (tag) + { +#ifndef WITH_LEAN + if ((soap->mode & SOAP_XML_CANONICAL)) + { + if (soap_send_raw(soap, ">", 1) + || soap_element_end_out(soap, tag)) + return soap->error; + return SOAP_OK; + } +#endif + if (soap->nlist) + soap_pop_namespace(soap); + soap->level--; /* decrement level just before /> */ + soap->body = 0; + return soap_send_raw(soap, "/>", 2); + } + return soap_send_raw(soap, ">", 1); +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_element_end_out(struct soap *soap, const char *tag) +{ + if (*tag == '-') + return SOAP_OK; +#ifdef WITH_DOM + if (soap->feltendout) + return soap->error = soap->feltendout(soap, tag); +#endif + return soap_element_end(soap, tag); +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_element_end(struct soap *soap, const char *tag) +{ +#ifndef WITH_LEAN + const char *s; +#endif + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Element ending tag='%s'\n", tag)); +#ifdef WITH_DOM + if ((soap->mode & SOAP_XML_DOM) && soap->dom) + { + if (soap->dom->prnt) + soap->dom = soap->dom->prnt; + return SOAP_OK; + } +#endif +#ifndef WITH_LEAN + if (soap->nlist) + soap_pop_namespace(soap); + if ((soap->mode & SOAP_XML_INDENT)) + { + if (!soap->body) + { + if (soap_send_raw(soap, soap_indent, soap->level < sizeof(soap_indent) ? soap->level : sizeof(soap_indent) - 1)) + return soap->error; + } + soap->body = 0; + } + if ((soap->mode & SOAP_XML_DEFAULTNS) && (s = strchr(tag, ':')) != NULL) + tag = s + 1; +#endif + if (soap_send_raw(soap, "error; + soap->level--; /* decrement level just before > */ + return soap_send_raw(soap, ">", 1); +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_element_ref(struct soap *soap, const char *tag, int id, int href) +{ + const char *s = "ref"; + int n = 1; + if (soap->version == 1) + { + s = "href"; + n = 0; + } + else if (soap->version == 2) + { + s = "SOAP-ENC:ref"; + } + (SOAP_SNPRINTF(soap->href, sizeof(soap->href), sizeof(SOAP_BASEREFNAME) + 21), "#" SOAP_BASEREFNAME "%d", href); + return soap_element_href(soap, tag, id, s, soap->href + n); +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_element_href(struct soap *soap, const char *tag, int id, const char *ref, const char *val) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Element '%s' reference %s='%s'\n", tag, ref, val)); + if (soap_element(soap, tag, id, NULL) + || soap_attribute(soap, ref, val) + || soap_element_start_end_out(soap, tag)) + return soap->error; + soap->body = 0; + return SOAP_OK; +} + + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_element_null(struct soap *soap, const char *tag, int id, const char *type) +{ + struct soap_attribute *tp = NULL; + for (tp = soap->attributes; tp; tp = tp->next) + if (tp->visible) + break; + if (tp || (soap->version == 2 && soap->position > 0) || id > 0 || (soap->mode & SOAP_XML_NIL)) + { + if (soap_element(soap, tag, id, type) + || (!tp && soap_attribute(soap, "xsi:nil", "true")) + || soap_element_start_end_out(soap, tag)) + return soap->error; + soap->body = 0; + } + else + { + soap->null = 1; + soap->position = 0; + soap->mustUnderstand = 0; + } + return SOAP_OK; +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_element_empty(struct soap *soap, const char *tag, int id, const char *type) +{ + if (!tag || *tag == '-') + return SOAP_OK; +#ifdef WITH_DOM + if (soap->feltbegout) + return soap->error = soap->feltbegout(soap, tag, id, type); +#endif + if (soap_element(soap, tag, id, type)) + return soap->error; + return soap_element_start_end_out(soap, tag); +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_element_nil(struct soap *soap, const char *tag) +{ + if (soap_element(soap, tag, -1, NULL) + || (soap_attribute(soap, "xsi:nil", "true"))) + return soap->error; + return soap_element_start_end_out(soap, tag); +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_element_id(struct soap *soap, const char *tag, int id, const void *p, const void *a, int n, const char *type, int t, char **mark) +{ + (void)a; (void)n; + if (!p) + { + soap->error = soap_element_null(soap, tag, id, type); + return -1; + } +#ifndef WITH_NOIDREF + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Element_id %p type=%d id=%d\n", p, t, id)); + if ((!soap->encodingStyle && !(soap->mode & SOAP_XML_GRAPH)) || (soap->mode & SOAP_XML_TREE)) + return soap_check_and_mark(soap, p, t, mark); + if (mark) + *mark = NULL; + if (id < -1) + return soap_embed(soap, p, a, n, t); + else if (id <= 0) + { + struct soap_plist *pp; + if (a) + id = soap_array_pointer_lookup(soap, p, a, n, t, &pp); + else + id = soap_pointer_lookup(soap, p, t, &pp); + if (id) + { + if (soap_is_embedded(soap, pp)) + { + soap_element_ref(soap, tag, 0, id); + return -1; + } + if (soap_is_single(soap, pp)) + return 0; + soap_set_embedded(soap, pp); + } + } + return id; +#else + return soap_check_and_mark(soap, p, t, mark); +#endif +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_check_and_mark(struct soap *soap, const void *p, int t, char **mark) +{ + if (mark) + { + struct soap_plist *pp; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Check %p and mark %p\n", p, (void*)mark)); + if (!soap_pointer_lookup(soap, p, t, &pp)) + if (!soap_pointer_enter(soap, p, NULL, 0, t, &pp)) + return -1; + if ((soap->mode & SOAP_IO_LENGTH)) + { + if (pp->mark1 > 0) + return -1; + pp->mark1 = 1; + *mark = &pp->mark1; + } + else + { + if (pp->mark2 > 0) + return -1; + pp->mark2 = 1; + *mark = &pp->mark2; + } + } + return 0; +} + +/******************************************************************************/ + +SOAP_FMAC1 +void * +SOAP_FMAC2 +soap_mark_lookup(struct soap *soap, const void *p, int t, struct soap_plist **ppp, char **mark) +{ + if (!soap) + return NULL; + if (mark || !(soap->mode & SOAP_XML_TREE)) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Mark lookup %p type=%d\n", p, t)); + if (!soap_pointer_lookup(soap, p, t, ppp)) + { + if (!soap_pointer_enter(soap, p, NULL, 0, t, ppp)) + return NULL; + } + else if (!(soap->mode & SOAP_XML_TREE)) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Mark found %p\n", (*ppp)->dup)); + return (*ppp)->dup; + } + if (mark) + { + if ((*ppp)->mark1 > 0) + (*ppp)->mark1 = 2; /* cycle */ + else + (*ppp)->mark1 = 1; /* cycle detection */ + *mark = &(*ppp)->mark1; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Mark cycle %d\n", (*ppp)->mark1)); + } + } + return NULL; +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_mark_cycle(struct soap *soap, struct soap_plist *pp) +{ + (void)soap; + return pp && pp->mark1 == 2 && (soap->mode & SOAP_XML_TREE); +} + +/******************************************************************************/ + +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_mark_dup(struct soap *soap, void *a, struct soap_plist *pp) +{ + (void)soap; + if (pp) + pp->dup = a; +} + +/******************************************************************************/ + +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_unmark(struct soap *soap, char *mark) +{ + (void)soap; + if (mark) + *mark = 0; /* release detection */ +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_element_result(struct soap *soap, const char *tag) +{ + if (soap->version == 2 && soap->encodingStyle) + { + if (soap_element(soap, "SOAP-RPC:result", 0, NULL) + || soap_attribute(soap, "xmlns:SOAP-RPC", soap_rpc) + || soap_element_start_end_out(soap, NULL) + || soap_string_out(soap, tag, 0) + || soap_element_end_out(soap, "SOAP-RPC:result")) + return soap->error; + } + return SOAP_OK; +} + +/******************************************************************************/ + +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_check_result(struct soap *soap, const char *tag) +{ + (void)tag; + if (soap->version == 2 && soap->encodingStyle) + { + soap_instring(soap, ":result", NULL, NULL, 0, 2, -1, -1, NULL); + /* just ignore content for compliance reasons, but should compare tag to element's QName value? */ + } +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_attribute(struct soap *soap, const char *name, const char *value) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Attribute '%s'='%s'\n", name, value)); +#ifdef WITH_DOM + if ((soap->mode & SOAP_XML_DOM) && !(soap->mode & SOAP_XML_CANONICAL) && soap->dom) + { + struct soap_dom_attribute *a = (struct soap_dom_attribute*)soap_malloc(soap, sizeof(struct soap_dom_attribute)); + if (!a) + return soap->error; + a->next = soap->dom->atts; + a->nstr = NULL; + a->name = soap_strdup(soap, name); + a->text = soap_strdup(soap, value); + a->soap = soap; + soap->dom->atts = a; + if (!a->name || (value && !a->text)) + return soap->error = SOAP_EOM; + return SOAP_OK; + } +#endif +#ifndef WITH_LEAN + if ((soap->mode & SOAP_XML_CANONICAL)) + { + /* push namespace */ + if (value && !strncmp(name, "xmlns", 5) && ((name[5] == ':') || name[5] == '\0')) + { + (void)soap_push_ns(soap, name + 5 + (name[5] == ':'), value, 0, 0); + if (name[5] == '\0') + soap_utilize_ns(soap, SOAP_STR_EOS, 0); + else if (soap->c14ninclude && ((*soap->c14ninclude == '*' || soap_tagsearch(soap->c14ninclude, name + 6)))) + soap_utilize_ns(soap, name, 0); + } + else + { + soap->level--; + if (soap_set_attr(soap, name, value, 1)) + return soap->error; + soap->level++; + } + } + else +#endif + { + if (soap_send_raw(soap, " ", 1) + || soap_send(soap, name)) + return soap->error; + if (value) + if (soap_send_raw(soap, "=\"", 2) + || soap_string_out(soap, value, 1) + || soap_send_raw(soap, "\"", 1)) + return soap->error; + } + return SOAP_OK; +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_element_begin_in(struct soap *soap, const char *tag, int nillable, const char *type) +{ + if (!soap_peek_element(soap)) + { + if (soap->other) + return soap->error = SOAP_TAG_MISMATCH; + if (tag && *tag == '-') + return SOAP_OK; + soap->error = soap_match_tag(soap, soap->tag, tag); + if (!soap->error) + { + if (type && *soap->type && soap_match_tag(soap, soap->type, type)) + return soap->error = SOAP_TYPE; + soap->peeked = 0; + if (!nillable && soap->null && (soap->mode & SOAP_XML_STRICT)) + return soap->error = SOAP_NULL; + if (soap->body) + { + soap->level++; + if (soap->level > soap->maxlevel) + return soap->error = SOAP_LEVEL; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Begin tag found (level=%u) '%s'='%s'\n", soap->level, soap->tag, tag ? tag : SOAP_STR_EOS)); + soap->error = SOAP_OK; + } + } + else if (soap->error == SOAP_NO_TAG && tag && *tag == '-') + { + soap->error = SOAP_OK; + } + return soap->error; +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_element_end_in(struct soap *soap, const char *tag) +{ + soap_wchar c; + char *s = NULL; + int n = 0; + if (soap->error == SOAP_NO_TAG) + soap->error = SOAP_OK; +#ifdef WITH_DOM + /* this whitespace or mixed content is significant for DOM "as-is" */ + if ((soap->mode & SOAP_XML_DOM) && soap->dom) + { + s = soap_string_in(soap, 0, -1, -1, NULL); + if (!soap->peeked && !s) + return soap->error; + if (soap->dom->prnt) + soap->dom = soap->dom->prnt; + if (s && (soap->mode & SOAP_XML_STRICT)) + { + for (; *s; s++) + if (!soap_coblank((soap_wchar)*s)) + return soap->error = SOAP_END_TAG; /* reject mixed content before ending tag */ + } + } +#endif + if (tag && *tag == '-') + return SOAP_OK; + if (soap->peeked) + { + if (*soap->tag) + n++; + soap->peeked = 0; + } + do + { + while (((c = soap_get(soap)) != SOAP_TT)) + { + if ((int)c == EOF) + return soap->error = SOAP_CHK_EOF; + if (!soap_coblank(c)) + { + if ((soap->mode & SOAP_XML_STRICT)) + return soap->error = SOAP_END_TAG; /* reject mixed content before ending tag */ + if (c == SOAP_LT) + n++; + else if (c == '/') + { + c = soap_get(soap); + if (c == SOAP_GT && n > 0) + n--; + else + soap_unget(soap, c); + } + } + } + } while (n-- > 0); + s = soap->tag; + n = sizeof(soap->tag); + while ((c = soap_get(soap)) > 32) + { + if (n > 1) + { + *s++ = (char)c; + n--; + } + } + *s = '\0'; + if ((int)c == EOF) + return soap->error = SOAP_CHK_EOF; + while (soap_coblank(c)) + c = soap_get(soap); + if (c != SOAP_GT) + return soap->error = SOAP_SYNTAX_ERROR; +#ifndef WITH_LEAN +#ifdef WITH_DOM + if (soap->feltendin) + { + int err = soap->error; + soap->error = soap->feltendin(soap, soap->tag, tag); + if (soap->error) + return soap->error; + if (err) + return soap->error = err; /* restore error */ + } +#endif +#endif + if (tag && (soap->mode & SOAP_XML_STRICT)) + { + soap_pop_namespace(soap); + if (soap_match_tag(soap, soap->tag, tag)) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "End tag '%s' does not match '%s'\n", soap->tag, tag ? tag : SOAP_STR_EOS)); + return soap->error = SOAP_SYNTAX_ERROR; + } + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "End tag found (level=%u) '%s'='%s'\n", soap->level, soap->tag, tag ? tag : SOAP_STR_EOS)); + soap->level--; + return SOAP_OK; +} + +/******************************************************************************/ + +SOAP_FMAC1 +const char * +SOAP_FMAC2 +soap_attr_value(struct soap *soap, const char *name, int flag, int occurs) +{ + struct soap_attribute *tp; + if (*name == '-') + return SOAP_STR_EOS; + for (tp = soap->attributes; tp; tp = tp->next) + { + if (tp->visible == 2 && !soap_match_att(soap, tp->name, name)) + break; + } + if (tp) + { + if (occurs == 4 || (occurs == 2 && (soap->mode & SOAP_XML_STRICT))) + soap->error = SOAP_PROHIBITED; + else if (flag >= 4) + return soap_collapse(soap, tp->value, flag, 1); + else + return tp->value; + } + else if (occurs == 3 || (occurs == 1 && (soap->mode & SOAP_XML_STRICT))) + { + soap->error = SOAP_REQUIRED; + } + else + { + soap->error = SOAP_OK; + } + return NULL; +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_set_attr(struct soap *soap, const char *name, const char *value, int flag) +{ + struct soap_attribute *tp, *tq; + if (*name == '-') + return SOAP_OK; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Set attribute %s='%s'\n", name, value ? value : SOAP_STR_EOS)); + tq = NULL; + for (tp = soap->attributes; tp; tq = tp, tp = tp->next) + { + if (!strcmp(tp->name, name)) + break; + } + if (!tp) + { + size_t l = strlen(name); + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Allocate attribute %s\n", name)); + if (sizeof(struct soap_attribute) + l > l && (SOAP_MAXALLOCSIZE <= 0 || sizeof(struct soap_attribute) + l <= SOAP_MAXALLOCSIZE)) + tp = (struct soap_attribute*)SOAP_MALLOC(soap, sizeof(struct soap_attribute) + l); + if (!tp) + return soap->error = SOAP_EOM; + tp->ns = NULL; +#ifndef WITH_LEAN + if ((soap->mode & SOAP_XML_CANONICAL)) + { + struct soap_attribute **tpp = &soap->attributes; + const char *s = strchr(name, ':'); + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Inserting attribute %s for c14n\n", name)); + if (!strncmp(name, "xmlns", 5)) + { + for (; *tpp; tpp = &(*tpp)->next) + if (strncmp((*tpp)->name, "xmlns", 5) || strcmp((*tpp)->name + 5, name + 5) > 0) + break; + } + else if (!s) + { + for (; *tpp; tpp = &(*tpp)->next) + if (strncmp((*tpp)->name, "xmlns", 5) && ((*tpp)->ns || strcmp((*tpp)->name, name) > 0)) + break; + } + else + { + struct soap_nlist *np = soap_lookup_ns(soap, name, s - name); + if (np) + { + tp->ns = np->ns; + } + else + { + struct soap_attribute *tq; + for (tq = soap->attributes; tq; tq = tq->next) + { + if (!strncmp(tq->name, "xmlns:", 6) && !strncmp(tq->name + 6, name, s - name) && !tq->name[6 + s - name]) + { + tp->ns = tq->ns; + break; + } + } + } + for (; *tpp; tpp = &(*tpp)->next) + { + int k; + if (strncmp((*tpp)->name, "xmlns", 5) && (*tpp)->ns && tp->ns && ((k = strcmp((*tpp)->ns, tp->ns)) > 0 || (!k && strcmp((*tpp)->name, name) > 0))) + break; + } + } + tp->next = *tpp; + *tpp = tp; + } + else +#endif + if (tq) + { + tq->next = tp; + tp->next = NULL; + } + else + { + tp->next = soap->attributes; + soap->attributes = tp; + } + soap_strcpy((char*)tp->name, l + 1, name); + tp->value = NULL; + } + else if (tp->visible) + { + return SOAP_OK; + } + else if (value && tp->value && tp->size <= strlen(value)) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Free attribute value of %s (free %p)\n", name, (void*)tp->value)); + SOAP_FREE(soap, tp->value); + tp->value = NULL; + tp->ns = NULL; + } + if (value) + { + if (!tp->value) + { + tp->size = strlen(value) + 1; + if (SOAP_MAXALLOCSIZE <= 0 || tp->size <= SOAP_MAXALLOCSIZE) + tp->value = (char*)SOAP_MALLOC(soap, tp->size); + if (!tp->value) + return soap->error = SOAP_EOM; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Allocate attribute value for %s (%p)\n", tp->name, (void*)tp->value)); + } + soap_strcpy(tp->value, tp->size, value); + if (!strncmp(tp->name, "xmlns:", 6)) + tp->ns = tp->value; + tp->visible = 2; + tp->flag = (short)flag; +#ifndef WITH_LEAN + if (!strcmp(name, "wsu:Id")) + { + soap->event = SOAP_SEC_BEGIN; + soap_strcpy(soap->id, sizeof(soap->id), value); + } + if ((soap->mode & SOAP_XML_CANONICAL) && !(soap->mode & SOAP_XML_CANONICAL_NA)) + { + const char *s = strchr(name, ':'); + if (s && strchr(value, ':')) + { + struct soap_nlist *np = soap_lookup_ns(soap, name, s - name); + if (np && np->ns && soap->local_namespaces) + { + if ((!strcmp(s + 1, "type") && !strcmp(np->ns, soap->local_namespaces[2].ns)) /* xsi:type QName */ + || ((!strcmp(s + 1, "arrayType") || !strcmp(s + 1, "itemType")) && !strcmp(np->ns, soap->local_namespaces[1].ns))) /* SOAP-ENC:arrayType and SOAP-ENC:itemType QName */ + soap_utilize_ns(soap, value, 1); + } + } + } +#endif + } + else + { + tp->visible = 1; + } + return SOAP_OK; +} + +/******************************************************************************/ + +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_clr_attr(struct soap *soap) +{ + struct soap_attribute *tp; +#ifndef WITH_LEAN + if ((soap->mode & SOAP_XML_CANONICAL)) + { + while (soap->attributes) + { + tp = soap->attributes->next; + if (soap->attributes->value) + SOAP_FREE(soap, soap->attributes->value); + SOAP_FREE(soap, soap->attributes); + soap->attributes = tp; + } + } + else +#endif + { + for (tp = soap->attributes; tp; tp = tp->next) + tp->visible = 0; + } +} + +/******************************************************************************/ + +static int +soap_getattrval(struct soap *soap, char *s, size_t *n, soap_wchar d) +{ + char buf[8]; + size_t i; + size_t k = *n; + size_t m = 0; + char *t = buf; + for (i = 0; i < k; i++) + { + soap_wchar c; + if (m) + { + *s++ = *t++; + m--; + continue; + } + if ((soap->mode & SOAP_C_UTFSTRING)) + { + c = soap_get(soap); + if ((c & 0x80000000) && c >= -0x7FFFFF80 && c < SOAP_AP) + { + t = buf; + c &= 0x7FFFFFFF; + if (c < 0x0800) + *t++ = (char)(0xC0 | ((c >> 6) & 0x1F)); + else + { +#ifdef WITH_REPLACE_ILLEGAL_UTF8 + if (!((c >= 0x80 && c <= 0xD7FF) || (c >= 0xE000 && c <= 0xFFFD) || (c >= 0x10000 && c <= 0x10FFFF))) + c = SOAP_UNKNOWN_UNICODE_CHAR; +#endif + if (c < 0x010000) + { + *t++ = (char)(0xE0 | ((c >> 12) & 0x0F)); + } + else + { + if (c < 0x200000) + { + *t++ = (char)(0xF0 | ((c >> 18) & 0x07)); + } + else + { + if (c < 0x04000000) + { + *t++ = (char)(0xF8 | ((c >> 24) & 0x03)); + } + else + { + *t++ = (char)(0xFC | ((c >> 30) & 0x01)); + *t++ = (char)(0x80 | ((c >> 24) & 0x3F)); + } + *t++ = (char)(0x80 | ((c >> 18) & 0x3F)); + } + *t++ = (char)(0x80 | ((c >> 12) & 0x3F)); + } + *t++ = (char)(0x80 | ((c >> 6) & 0x3F)); + } + *t++ = (char)(0x80 | (c & 0x3F)); + m = t - buf - 1; + if (i + m >= k) + { + soap_unget(soap, c | 0x80000000); + *n = i; + return soap->error = SOAP_EOM; + } + t = buf; + *s++ = *t++; + continue; + } + } + else + { + c = soap_getutf8(soap); + } + switch (c) + { + case SOAP_TT: + *s++ = '<'; + soap_unget(soap, '/'); + break; + case SOAP_LT: + *s++ = '<'; + break; + case SOAP_GT: + if (d == ' ') + { + soap_unget(soap, c); + *s = '\0'; + *n = i + 1; + return SOAP_OK; + } + *s++ = '>'; + break; + case SOAP_QT: + if (c == d) + { + *s = '\0'; + *n = i + 1; + return SOAP_OK; + } + *s++ = '"'; + break; + case SOAP_AP: + if (c == d) + { + *s = '\0'; + *n = i + 1; + return SOAP_OK; + } + *s++ = '\''; + break; + case '\t': + case '\n': + case '\r': + case ' ': + case '/': + if (d == ' ') + { + soap_unget(soap, c); + *s = '\0'; + *n = i + 1; + return SOAP_OK; + } + *s++ = (char)c; + break; + default: + if ((int)c == EOF) + { + *s = '\0'; + *n = i + 1; + return soap->error = SOAP_CHK_EOF; + } + *s++ = (char)c; + } + } + return soap->error = SOAP_EOM; +} + +/******************************************************************************/ + +#ifdef WITH_FAST +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_store_lab(struct soap *soap, const char *s, size_t n) +{ + soap->labidx = 0; + return soap_append_lab(soap, s, n); +} +#endif + +/******************************************************************************/ + +#ifdef WITH_FAST +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_append_lab(struct soap *soap, const char *s, size_t n) +{ + if (soap->labidx + n < soap->labidx) + return soap->error = SOAP_EOM; + if (soap->labidx + n >= soap->lablen) + { + char *t = soap->labbuf; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Enlarging look-aside buffer to append data, size=%lu\n", (unsigned long)soap->lablen)); + if (soap->lablen == 0) + soap->lablen = SOAP_LABLEN; + while (soap->labidx + n >= soap->lablen) + { + if (soap->lablen << 1 < soap->lablen) + return soap->error = SOAP_EOM; + soap->lablen <<= 1; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "New look-aside buffer size=%lu\n", (unsigned long)soap->lablen)); + if (SOAP_MAXALLOCSIZE > 0 && soap->lablen > SOAP_MAXALLOCSIZE) + return soap->error = SOAP_EOM; + soap->labbuf = (char*)SOAP_MALLOC(soap, soap->lablen); + if (!soap->labbuf) + { + if (t) + SOAP_FREE(soap, t); + return soap->error = SOAP_EOM; + } + if (t) + { + (void)soap_memcpy((void*)soap->labbuf, soap->lablen, (const void*)t, soap->labidx); + SOAP_FREE(soap, t); + } + } + if (s) + { + (void)soap_memcpy((void*)(soap->labbuf + soap->labidx), soap->lablen - soap->labidx, (const void*)s, n); + soap->labidx += n; + } + return SOAP_OK; +} +#endif + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_peek_element(struct soap *soap) +{ +#ifdef WITH_DOM + struct soap_dom_attribute **att = NULL; + char *lead = NULL; +#endif + struct soap_attribute *tp, *tq = NULL; + const char *t; + char *s; + soap_wchar c; + int i; + if (soap->peeked) + { + if (!*soap->tag) + return soap->error = SOAP_NO_TAG; + return SOAP_OK; + } + soap->peeked = 1; + soap->id[0] = '\0'; + soap->href[0] = '\0'; + soap->type[0] = '\0'; + soap->arrayType[0] = '\0'; + soap->arraySize[0] = '\0'; + soap->arrayOffset[0] = '\0'; + soap->other = 0; + soap->root = -1; + soap->position = 0; + soap->null = 0; + soap->mustUnderstand = 0; + /* UTF-8 BOM? */ + c = soap_getchar(soap); + if (c == 0xEF && soap_get0(soap) == 0xBB) + { + soap_get1(soap); + c = soap_get1(soap); + if (c == 0xBF) + soap->mode &= ~SOAP_ENC_LATIN; + else + soap_unget(soap, (0x0F << 12) | (0xBB << 6) | (c & 0x3F)); /* UTF-8 */ + } + else if ((c == 0xFE && soap_get0(soap) == 0xFF) /* UTF-16 BE */ + || (c == 0xFF && soap_get0(soap) == 0xFE)) /* UTF-16 LE */ + { + return soap->error = SOAP_UTF_ERROR; + } + else + { + soap_unget(soap, c); + } + c = soap_get(soap); +#ifdef WITH_DOM + /* whitespace leading up to the start tag is significant for DOM as-is (but comments and PIs are removed from this lead) */ + if (soap_coblank(c)) + { + soap->labidx = 0; + do + { + if (soap_append_lab(soap, NULL, 0)) + return soap->error; + s = soap->labbuf + soap->labidx; + i = soap->lablen - soap->labidx; + soap->labidx = soap->lablen; + while (soap_coblank(c)) + { + if (c != '\r') + { + if (i-- <= 0) + break; + *s++ = c; + } + c = soap_get(soap); + } + } while (soap_coblank(c) || i == 0); + *s = '\0'; + lead = soap->labbuf; + } +#else + /* skip space */ + while (soap_coblank(c)) + c = soap_get(soap); +#endif + if (c != SOAP_LT) + { + *soap->tag = '\0'; + if ((int)c == EOF) + return soap->error = SOAP_CHK_EOF; + soap_unget(soap, c); +#ifdef WITH_DOM + /* whitespace leading up to the end tag is significant for DOM as-is */ + if ((soap->mode & SOAP_XML_DOM) && soap->dom) + { + if (lead && *lead) + soap->dom->tail = soap_strdup(soap, lead); + else + soap->dom->tail = SOAP_STR_EOS; /* body with closing tag instead of */ + } +#endif + return soap->error = SOAP_NO_TAG; + } + do + { + c = soap_get1(soap); + } while (soap_coblank(c)); + s = soap->tag; + i = sizeof(soap->tag); + while (c != '>' && c != '/' && c > 32 && (int)c != EOF) + { + if (i > 1) + { + *s++ = (char)c; + i--; + } + c = soap_get1(soap); + } + *s = '\0'; + while (soap_coblank(c)) + c = soap_get1(soap); +#ifdef WITH_DOM + if ((soap->mode & SOAP_XML_DOM)) + { + struct soap_dom_element *elt; + elt = (struct soap_dom_element*)soap_malloc(soap, sizeof(struct soap_dom_element)); + if (!elt) + return soap->error; + elt->next = NULL; + elt->prnt = soap->dom; + elt->elts = NULL; + elt->atts = NULL; + elt->nstr = NULL; + elt->name = soap_strdup(soap, soap->tag); + elt->text = NULL; + elt->code = NULL; + elt->tail = NULL; + elt->node = NULL; + elt->type = 0; + if (lead && *lead) + elt->lead = soap_strdup(soap, lead); + else + elt->lead = NULL; + elt->soap = soap; + if (soap->dom) + { + struct soap_dom_element *p = soap->dom->elts; + if (p) + { + while (p->next) + p = p->next; + p->next = elt; + } + else + { + soap->dom->elts = elt; + } + } + soap->dom = elt; + att = &elt->atts; + if (!elt->name) + return soap->error = SOAP_EOM; + } +#endif + soap_pop_namespace(soap); + for (tp = soap->attributes; tp; tp = tp->next) + tp->visible = 0; + while ((int)c != EOF && c != '>' && c != '/') + { + s = soap->tmpbuf; + i = sizeof(soap->tmpbuf); + while (c != '=' && c != '>' && c != '/' && c > 32 && (int)c != EOF) + { + if (i > 1) + { + *s++ = (char)c; + i--; + } + c = soap_get1(soap); + } + *s = '\0'; + if (i == sizeof(soap->tmpbuf)) + return soap->error = SOAP_SYNTAX_ERROR; +#ifdef WITH_DOM + /* add attribute name to dom */ + if (att) + { + *att = (struct soap_dom_attribute*)soap_malloc(soap, sizeof(struct soap_dom_attribute)); + if (!*att) + return soap->error; + (*att)->next = NULL; + (*att)->nstr = NULL; + (*att)->name = soap_strdup(soap, soap->tmpbuf); + (*att)->text = NULL; + (*att)->soap = soap; + if (!(*att)->name) + return soap->error = SOAP_EOM; + } +#endif + if (!strncmp(soap->tmpbuf, "xmlns", 5)) + { + if (soap->tmpbuf[5] == ':') + t = soap->tmpbuf + 6; + else if (soap->tmpbuf[5]) + t = NULL; + else + t = SOAP_STR_EOS; + } + else + { + t = NULL; + } + tq = NULL; + for (tp = soap->attributes; tp; tq = tp, tp = tp->next) + { + if (!SOAP_STRCMP(tp->name, soap->tmpbuf)) + break; + } + if (!tp) + { + size_t l = strlen(soap->tmpbuf); + tp = (struct soap_attribute*)SOAP_MALLOC(soap, sizeof(struct soap_attribute) + l); + if (!tp) + return soap->error = SOAP_EOM; + (void)soap_memcpy((char*)tp->name, l + 1, soap->tmpbuf, l + 1); + tp->value = NULL; + tp->size = 0; + tp->ns = NULL; + tp->visible = 0; + /* append attribute to the end of the list */ + if (tq) + { + tq->next = tp; + tp->next = NULL; + } + else + { + tp->next = soap->attributes; + soap->attributes = tp; + } + } + else if (tp->visible) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Duplicate attribute in %s\n", soap->tag)); + return soap->error = SOAP_SYNTAX_ERROR; /* redefined (duplicate) attribute */ + } + while (soap_coblank(c)) + c = soap_get1(soap); + if (c == '=') + { + size_t k; + do + { + c = soap_getutf8(soap); + } while (soap_coblank(c)); + if (c != SOAP_QT && c != SOAP_AP) + { + if ((soap->mode & SOAP_XML_STRICT)) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Unquoted attribute value in %s\n", soap->tag)); + return soap->error = SOAP_SYNTAX_ERROR; + } + soap_unget(soap, c); + c = ' '; /* allow blank delimiter for non-well formed XML like HTML */ + } + k = tp->size; + if (soap_getattrval(soap, tp->value, &k, c)) + { +#ifdef WITH_FAST + if (soap->error != SOAP_EOM) + return soap->error; + soap->error = SOAP_OK; + if (soap_store_lab(soap, tp->value, k)) + return soap->error; + if (tp->value) + SOAP_FREE(soap, tp->value); + tp->value = NULL; + for (;;) + { + k = soap->lablen - soap->labidx; + if (soap_getattrval(soap, soap->labbuf + soap->labidx, &k, c)) + { + if (soap->error != SOAP_EOM) + return soap->error; + soap->error = SOAP_OK; + soap->labidx = soap->lablen; + if (soap_append_lab(soap, NULL, 0)) + return soap->error; + } + else + { + break; + } + } + if (soap->labidx) + { + tp->size = soap->lablen; + } + else + { + tp->size = strlen(soap->labbuf) + 1; + if (tp->size < SOAP_LABLEN) + tp->size = SOAP_LABLEN; + } + tp->value = (char*)SOAP_MALLOC(soap, tp->size); + if (!tp->value) + return soap->error = SOAP_EOM; + soap_strcpy(tp->value, tp->size, soap->labbuf); +#else + tp->size = k; + if (soap->error != SOAP_EOM) + return soap->error; + soap->error = SOAP_OK; + if (soap_alloc_block(soap) == NULL) + return soap->error; + for (;;) + { + s = (char*)soap_push_block(soap, NULL, SOAP_BLKLEN); + if (!s) + return soap->error; + k = SOAP_BLKLEN; + if (soap_getattrval(soap, s, &k, c)) + { + if (soap->error != SOAP_EOM) + return soap->error; + soap->error = SOAP_OK; + soap_size_block(soap, NULL, k); + } + else + { + break; + } + } + k = tp->size + soap->blist->size; + if (SOAP_MAXALLOCSIZE > 0 && k > SOAP_MAXALLOCSIZE) + return soap->error = SOAP_EOM; + s = (char*)SOAP_MALLOC(soap, k); + if (!s) + return soap->error = SOAP_EOM; + if (tp->value) + { + (void)soap_memcpy((void*)s, k, (const void*)tp->value, tp->size); + SOAP_FREE(soap, tp->value); + } + (void)soap_save_block(soap, NULL, s + tp->size, 0); + tp->value = s; + tp->size = k; +#endif + } + tp->visible = 2; /* seen this attribute w/ value */ + do + { + c = soap_get1(soap); + } while (soap_coblank(c)); +#ifdef WITH_DOM + if (att && tp->value) + { + (*att)->text = soap_strdup(soap, tp->value); + if (!(*att)->text) + return soap->error = SOAP_EOM; + } +#endif + } + else + { + if ((soap->mode & SOAP_XML_STRICT)) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Attribute withput a value in %s\n", soap->tag)); + return soap->error = SOAP_SYNTAX_ERROR; + } + tp->visible = 1; /* seen this attribute w/o value */ + } +#ifdef WITH_DOM + if (att) + att = &(*att)->next; +#endif + if (t && tp->value) + { + if (soap_push_namespace(soap, t, tp->value) == NULL) + return soap->error; + } + } +#ifdef WITH_DOM + if (att) + { + soap->dom->nstr = soap_current_namespace_tag(soap, soap->tag); + for (att = &soap->dom->atts; *att; att = &(*att)->next) + (*att)->nstr = soap_current_namespace_att(soap, (*att)->name); + } +#endif + if ((int)c == EOF) + return soap->error = SOAP_CHK_EOF; + soap->body = (c != '/'); + if (!soap->body) + { + do + { + c = soap_get1(soap); + } while (soap_coblank(c)); + } +#ifdef WITH_DOM + if ((soap->mode & SOAP_XML_DOM)) + { + if (!soap->body && soap->dom->prnt) + soap->dom = soap->dom->prnt; + } +#endif + for (tp = soap->attributes; tp; tp = tp->next) + { + if (tp->visible && tp->value) + { +#ifndef WITH_NOIDREF + if (!strcmp(tp->name, "id")) + { + if ((soap->version > 0 && !(soap->imode & SOAP_XML_TREE)) + || (soap->mode & SOAP_XML_GRAPH)) + { + *soap->id = '#'; + soap_strcpy(soap->id + 1, sizeof(soap->id) - 1, tp->value); + } + } + else if (!strcmp(tp->name, "href")) + { + if ((soap->version == 1 && !(soap->imode & SOAP_XML_TREE)) + || (soap->mode & SOAP_XML_GRAPH) + || ((soap->mode & (SOAP_ENC_MTOM | SOAP_ENC_DIME)) && *tp->value != '#')) + soap_strcpy(soap->href, sizeof(soap->href), tp->value); + } + else if (!strcmp(tp->name, "ref")) + { + if ((soap->version == 2 && !(soap->imode & SOAP_XML_TREE)) + || (soap->mode & SOAP_XML_GRAPH)) + { + *soap->href = '#'; + soap_strcpy(soap->href + (*tp->value != '#'), sizeof(soap->href) - 1, tp->value); + } + } +#else + if (!strcmp(tp->name, "href")) + { + if ((soap->mode & (SOAP_ENC_MTOM | SOAP_ENC_DIME)) && *tp->value != '#') + soap_strcpy(soap->href, sizeof(soap->href), tp->value); + } +#endif + else if (!soap_match_tag(soap, tp->name, "xsi:type")) + { + soap_strcpy(soap->type, sizeof(soap->type), tp->value); + } + else if ((!soap_match_tag(soap, tp->name, "xsi:null") + || !soap_match_tag(soap, tp->name, "xsi:nil")) + && (!strcmp(tp->value, "1") + || !strcmp(tp->value, "true"))) + { + soap->null = 1; + } + else if (!soap_match_tag(soap, tp->name, "SOAP-ENV:encodingStyle")) + { + if (!soap->encodingStyle) + soap->encodingStyle = SOAP_STR_EOS; + soap_version(soap); + } + else if (soap->version == 1) + { + if (!soap_match_tag(soap, tp->name, "SOAP-ENC:arrayType")) + { + s = soap_strrchr(tp->value, '['); + if (s && (size_t)(s - tp->value) < sizeof(soap->arrayType)) + { + (void)soap_strncpy(soap->arrayType, sizeof(soap->arrayType), tp->value, s - tp->value); + soap_strcpy(soap->arraySize, sizeof(soap->arraySize), s); + } + else + soap_strcpy(soap->arrayType, sizeof(soap->arrayType), tp->value); + } + else if (!soap_match_tag(soap, tp->name, "SOAP-ENC:offset")) + { + soap_strcpy(soap->arrayOffset, sizeof(soap->arrayOffset), tp->value); + } + else if (!soap_match_tag(soap, tp->name, "SOAP-ENC:position")) + { + soap->position = soap_getposition(tp->value, soap->positions); + } + else if (!soap_match_tag(soap, tp->name, "SOAP-ENC:root")) + { + soap->root = ((!strcmp(tp->value, "1") || !strcmp(tp->value, "true"))); + } + else if (!soap_match_tag(soap, tp->name, "SOAP-ENV:mustUnderstand") + && (!strcmp(tp->value, "1") || !strcmp(tp->value, "true"))) + { + soap->mustUnderstand = 1; + } + else if (!soap_match_tag(soap, tp->name, "SOAP-ENV:actor")) + { + if ((!soap->actor || strcmp(soap->actor, tp->value)) + && strcmp(tp->value, "http://schemas.xmlsoap.org/soap/actor/next")) + soap->other = 1; + } + } + else if (soap->version == 2) + { +#ifndef WITH_NOIDREF + if (!soap_match_tag(soap, tp->name, "SOAP-ENC:id")) + { + *soap->id = '#'; + soap_strcpy(soap->id + 1, sizeof(soap->id) - 1, tp->value); + } + else if (!soap_match_tag(soap, tp->name, "SOAP-ENC:ref")) + { + *soap->href = '#'; + soap_strcpy(soap->href + (*tp->value != '#'), sizeof(soap->href) - 1, tp->value); + } + else +#endif + if (!soap_match_tag(soap, tp->name, "SOAP-ENC:itemType")) + { + soap_strcpy(soap->arrayType, sizeof(soap->arrayType), tp->value); + } + else if (!soap_match_tag(soap, tp->name, "SOAP-ENC:arraySize")) + { + soap_strcpy(soap->arraySize, sizeof(soap->arraySize), tp->value); + } + else if (!soap_match_tag(soap, tp->name, "SOAP-ENV:mustUnderstand") + && (!strcmp(tp->value, "1") || !strcmp(tp->value, "true"))) + { + soap->mustUnderstand = 1; + } + else if (!soap_match_tag(soap, tp->name, "SOAP-ENV:role")) + { + if ((!soap->actor || strcmp(soap->actor, tp->value)) + && strcmp(tp->value, "http://www.w3.org/2003/05/soap-envelope/role/next")) + soap->other = 1; + } + } + else + { + if (!soap_match_tag(soap, tp->name, "wsdl:required") && !strcmp(tp->value, "true")) + soap->mustUnderstand = 1; + } + } + } +#ifdef WITH_DOM + if (soap->feltbegin) + return soap->error = soap->feltbegin(soap, soap->tag); +#endif + return soap->error = SOAP_OK; +} + +/******************************************************************************/ + +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_retry(struct soap *soap) +{ + soap->error = SOAP_OK; + soap_revert(soap); +} + +/******************************************************************************/ + +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_revert(struct soap *soap) +{ + if (!soap->peeked) + { + soap->peeked = 1; + if (soap->body) + soap->level--; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Reverting to last element '%s' (level=%u)\n", soap->tag, soap->level)); +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_ignore(struct soap *soap) +{ + int n = 0; + soap_wchar c; + soap->level++; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Ignoring XML content at level=%u\n", soap->level)); +#ifdef WITH_DOM + if ((soap->mode & SOAP_XML_DOM) && soap->dom) + { + if (!soap_string_in(soap, -1, -1, -1, NULL)) + return soap->error; + } + else +#endif + { + for (;;) + { + c = soap_get(soap); + switch (c) + { + case SOAP_TT: + if (n == 0) + goto end; + n--; + break; + case SOAP_LT: + n++; + break; + case '/': + if (n > 0) + { + c = soap_get0(soap); + if (c == '>') + n--; + } + break; + default: + if ((int)c == EOF) + return soap->error = SOAP_EOF; + } + } +end: + soap_unget(soap, c); + } + return soap_element_end_in(soap, NULL); +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_string_out(struct soap *soap, const char *s, int flag) +{ + const char *t; + soap_wchar c; + soap_wchar mask = (soap_wchar)0xFFFFFF80UL; +#ifdef WITH_DOM + if ((soap->mode & SOAP_XML_DOM) && soap->dom) + { + soap->dom->text = soap_strdup(soap, s); + if (!soap->dom->text) + return soap->error = SOAP_EOM; + return SOAP_OK; + } +#endif + if (flag == 2 || (soap->mode & SOAP_C_UTFSTRING)) + mask = 0; + t = s; + while ((c = *t++)) + { + switch (c) + { + case 0x09: + if (flag) + { + if (soap_send_raw(soap, s, t - s - 1) || soap_send_raw(soap, " ", 5)) + return soap->error; + s = t; + } + break; + case 0x0A: + if (flag) + { + if (soap_send_raw(soap, s, t - s - 1) || soap_send_raw(soap, " ", 5)) + return soap->error; + s = t; + } + break; +#ifdef WITH_CRTOLF + case 0x0D: + if (*t == 0x0A) + { + if (soap_send_raw(soap, s, t - s - 1)) + return soap->error; + s = t; + } + else if (flag) + { + if (soap_send_raw(soap, s, t - s - 1) || soap_send_raw(soap, " ", 5)) + return soap->error; + s = t; + } + else + { + if (soap_send_raw(soap, s, t - s - 1) || soap_send_raw(soap, "\n", 1)) + return soap->error; + s = t; + } + break; +#endif + case '&': + if (soap_send_raw(soap, s, t - s - 1) || soap_send_raw(soap, "&", 5)) + return soap->error; + s = t; + break; + case '<': + if (soap_send_raw(soap, s, t - s - 1) || soap_send_raw(soap, "<", 4)) + return soap->error; + s = t; + break; + case '>': + if (!flag) + { + if (soap_send_raw(soap, s, t - s - 1) || soap_send_raw(soap, ">", 4)) + return soap->error; + s = t; + } + break; + case '"': + if (flag) + { + if (soap_send_raw(soap, s, t - s - 1) || soap_send_raw(soap, """, 6)) + return soap->error; + s = t; + } + break; + case 0x7F: + if (soap_send_raw(soap, s, t - s - 1) || soap_send_raw(soap, "", 6)) + return soap->error; + s = t; + break; + default: +#ifndef WITH_LEANER +#ifdef HAVE_MBTOWC + if ((soap->mode & SOAP_C_MBSTRING)) + { + wchar_t wc; + int m = mbtowc(&wc, t - 1, MB_CUR_MAX); + if (m > 0 && !((soap_wchar)wc == c && m == 1 && c < 0x80)) + { + if (soap_send_raw(soap, s, t - s - 1) || soap_pututf8(soap, (unsigned long)wc)) + return soap->error; + s = t += m - 1; + continue; + } + } +#endif +#endif +#ifndef WITH_NOSTRINGTOUTF8 + if ((c & mask) || !(c & 0xFFFFFFE0UL)) + { + if (soap_send_raw(soap, s, t - s - 1) || soap_pututf8(soap, (unsigned char)c)) + return soap->error; + s = t; + } +#endif + } + } + return soap_send_raw(soap, s, t - s - 1); +} + +/******************************************************************************/ + +SOAP_FMAC1 +char * +SOAP_FMAC2 +soap_string_in(struct soap *soap, int flag, long minlen, long maxlen, const char *pattern) +{ + char *s = NULL; + char *t = NULL; + size_t i; + ULONG64 l = 0; + int n = 0, f = 0, m = 0; + soap_wchar c; +#if !defined(WITH_LEANER) && defined(HAVE_WCTOMB) + char buf[MB_LEN_MAX > 8 ? MB_LEN_MAX : 8]; +#else + char buf[8]; +#endif + if (maxlen < 0 && soap->maxlength > 0) + maxlen = soap->maxlength; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Reading string content, flag=%d\n", flag)); + if (flag <= 0 && soap->peeked && *soap->tag) + { +#ifndef WITH_LEAN + struct soap_attribute *tp; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "String content includes tag '%s' and attributes\n", soap->tag)); + t = soap->tmpbuf; + *t = '<'; + soap_strcpy(t + 1, sizeof(soap->tmpbuf) - 1, soap->tag); + t += strlen(t); + for (tp = soap->attributes; tp; tp = tp->next) + { + if (tp->visible) + { + size_t k = strlen(tp->name); + if (t + k + 1 >= soap->tmpbuf + sizeof(soap->tmpbuf)) + break; /* too many or attribute values to large */ + *t++ = ' '; + (void)soap_strncpy(t, sizeof(soap->tmpbuf) - (t - soap->tmpbuf), tp->name, k); + t += k; + if (tp->value) + { + k = strlen(tp->value); + if (t + k + 3 >= soap->tmpbuf + sizeof(soap->tmpbuf)) + break; /* too many or attribute values to large */ + *t++ = '='; + *t++ = '"'; + (void)soap_strncpy(t, sizeof(soap->tmpbuf) - (t - soap->tmpbuf), tp->value, k); + t += k; + *t++ = '"'; + } + } + } + if (!soap->body) + *t++ = '/'; + *t++ = '>'; + *t = '\0'; + t = soap->tmpbuf; + m = (int)strlen(soap->tmpbuf); +#endif + if (soap->body) + n = 1; + f = 1; + soap->peeked = 0; + } +#ifdef WITH_CDATA + if (flag <= 0) + { + int state = 0; +#ifdef WITH_FAST + soap->labidx = 0; /* use look-aside buffer */ +#else + if (soap_alloc_block(soap) == NULL) + return NULL; +#endif + for (;;) + { +#ifdef WITH_FAST + size_t k; + if (soap_append_lab(soap, NULL, 0)) /* allocate more space in look-aside buffer if necessary */ + return NULL; + s = soap->labbuf + soap->labidx; /* space to populate */ + k = soap->lablen - soap->labidx; /* number of bytes available */ + soap->labidx = soap->lablen; /* claim this space */ +#else + size_t k = SOAP_BLKLEN; + s = (char*)soap_push_block(soap, NULL, k); + if (!s) + return NULL; +#endif + for (i = 0; i < k; i++) + { + if (m > 0) + { + *s++ = *t++; /* copy multibyte characters */ + m--; + continue; + } + c = soap_getchar(soap); + if ((int)c == EOF) + goto end; + if ((c >= 0x80 || c < SOAP_AP) && state != 1) + { + if ((c & 0x7FFFFFFF) >= 0x80) + { + soap_unget(soap, c); + c = soap_getutf8(soap); + } + if ((c & 0x7FFFFFFF) >= 0x80 && (flag <= 0 || (soap->mode & SOAP_C_UTFSTRING))) + { + c &= 0x7FFFFFFF; + t = buf; + if (c < 0x0800) + *t++ = (char)(0xC0 | ((c >> 6) & 0x1F)); + else + { +#ifdef WITH_REPLACE_ILLEGAL_UTF8 + if (!((c >= 0x80 && c <= 0xD7FF) || (c >= 0xE000 && c <= 0xFFFD) || (c >= 0x10000 && c <= 0x10FFFF))) + c = SOAP_UNKNOWN_UNICODE_CHAR; +#endif + if (c < 0x010000) + { + *t++ = (char)(0xE0 | ((c >> 12) & 0x0F)); + } + else + { + if (c < 0x200000) + { + *t++ = (char)(0xF0 | ((c >> 18) & 0x07)); + } + else + { + if (c < 0x04000000) + { + *t++ = (char)(0xF8 | ((c >> 24) & 0x03)); + } + else + { + *t++ = (char)(0xFC | ((c >> 30) & 0x01)); + *t++ = (char)(0x80 | ((c >> 24) & 0x3F)); + } + *t++ = (char)(0x80 | ((c >> 18) & 0x3F)); + } + *t++ = (char)(0x80 | ((c >> 12) & 0x3F)); + } + *t++ = (char)(0x80 | ((c >> 6) & 0x3F)); + } + *t++ = (char)(0x80 | (c & 0x3F)); + m = (int)(t - buf) - 1; + t = buf; + *s++ = *t++; + continue; + } + } + switch (state) + { + case 1: + if (c == ']') + state = 4; + *s++ = (char)c; + continue; + case 2: + if (c == '-') + state = 6; + *s++ = (char)c; + continue; + case 3: + if (c == '?') + state = 8; + *s++ = (char)c; + continue; + /* CDATA */ + case 4: + if (c == ']') + state = 5; + else + state = 1; + *s++ = (char)c; + continue; + case 5: + if (c == '>') + state = 0; + else if (c != ']') + state = 1; + *s++ = (char)c; + continue; + /* comment */ + case 6: + if (c == '-') + state = 7; + else + state = 2; + *s++ = (char)c; + continue; + case 7: + if (c == '>') + state = 0; + else if (c != '-') + state = 2; + *s++ = (char)c; + continue; + /* PI */ + case 8: + if (c == '>') + state = 0; + else if (c != '?') + state = 3; + *s++ = (char)c; + continue; + } + switch (c) + { + case SOAP_TT: + if (n == 0) + goto end; + n--; + *s++ = '<'; + t = (char*)"/"; + m = 1; + break; + case SOAP_LT: + if (flag == 3 || (f && n == 0)) + goto end; + n++; + *s++ = '<'; + break; + case SOAP_GT: + *s++ = '>'; + break; + case SOAP_QT: + *s++ = '"'; + break; + case SOAP_AP: + *s++ = '\''; + break; + case '/': + if (n > 0) + { + c = soap_getchar(soap); + if (c == '>') + n--; + soap_unget(soap, c); + } + *s++ = '/'; + break; + case '<': + c = soap_getchar(soap); + if (c == '/') + { + if (n == 0) + { + c = SOAP_TT; + goto end; + } + n--; + } + else if (c == '!') + { + c = soap_getchar(soap); + if (c == '[') + { + do + { + c = soap_getchar(soap); + } while ((int)c != EOF && c != '['); + if ((int)c == EOF) + goto end; + t = (char*)"![CDATA["; + m = 8; + state = 1; + } + else if (c == '-') + { + c = soap_getchar(soap); + if (c == '-') + state = 2; + t = (char*)"!-"; + m = 2; + soap_unget(soap, c); + } + else + { + t = (char*)"!"; + m = 1; + soap_unget(soap, c); + } + *s++ = '<'; + break; + } + else if (c == '?') + { + state = 3; + } + else if (flag == 3 || (f && n == 0)) + { + soap_revget1(soap); + c = '<'; + goto end; + } + else + n++; + soap_unget(soap, c); + *s++ = '<'; + break; + case '>': + *s++ = '>'; + break; + case '"': + *s++ = '"'; + break; + default: +#ifndef WITH_LEANER +#ifdef HAVE_WCTOMB + if ((soap->mode & SOAP_C_MBSTRING)) + { +#if defined(WIN32) && !defined(CYGWIN) && !defined(__MINGW32__) && !defined(__MINGW64__) && !defined(__BORLANDC__) + m = 0; + wctomb_s(&m, buf, sizeof(buf), (wchar_t)(c & 0x7FFFFFFF)); +#else + m = wctomb(buf, (wchar_t)(c & 0x7FFFFFFF)); +#endif + if (m >= 1 && m <= (int)MB_CUR_MAX) + { + t = buf; + *s++ = *t++; + m--; + } + else + { + *s++ = SOAP_UNKNOWN_CHAR; + m = 0; + } + } + else +#endif +#endif + *s++ = (char)(c & 0xFF); + } + l++; + if (maxlen >= 0 && l > (size_t)maxlen) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "String too long: maxlen=%ld\n", maxlen)); + soap->error = SOAP_LENGTH; + return NULL; + } + } + } + } +#endif +#ifdef WITH_FAST + soap->labidx = 0; /* use look-aside buffer */ +#else + if (soap_alloc_block(soap) == NULL) + return NULL; +#endif + for (;;) + { +#ifdef WITH_FAST + size_t k; + if (soap_append_lab(soap, NULL, 0)) /* allocate more space in look-aside buffer if necessary */ + return NULL; + s = soap->labbuf + soap->labidx; /* space to populate */ + k = soap->lablen - soap->labidx; /* number of bytes available */ + soap->labidx = soap->lablen; /* claim this space */ +#else + size_t k = SOAP_BLKLEN; + s = (char*)soap_push_block(soap, NULL, k); + if (!s) + return NULL; +#endif + for (i = 0; i < k; i++) + { + if (m > 0) + { + *s++ = *t++; /* copy multibyte characters */ + m--; + continue; + } +#ifndef WITH_CDATA + if (flag <= 0) + c = soap_getchar(soap); + else +#endif + { + c = soap_getutf8(soap); + if ((soap->mode & SOAP_C_UTFSTRING)) + { + if (c >= 0x80 || (c < SOAP_AP && c >= -0x7FFFFF80)) + { + c &= 0x7FFFFFFF; + t = buf; + if (c < 0x0800) + { + *t++ = (char)(0xC0 | ((c >> 6) & 0x1F)); + } + else + { +#ifdef WITH_REPLACE_ILLEGAL_UTF8 + if (!((c >= 0x80 && c <= 0xD7FF) || (c >= 0xE000 && c <= 0xFFFD) || (c >= 0x10000 && c <= 0x10FFFF))) + c = SOAP_UNKNOWN_UNICODE_CHAR; +#endif + if (c < 0x010000) + { + *t++ = (char)(0xE0 | ((c >> 12) & 0x0F)); + } + else + { + if (c < 0x200000) + { + *t++ = (char)(0xF0 | ((c >> 18) & 0x07)); + } + else + { + if (c < 0x04000000) + { + *t++ = (char)(0xF8 | ((c >> 24) & 0x03)); + } + else + { + *t++ = (char)(0xFC | ((c >> 30) & 0x01)); + *t++ = (char)(0x80 | ((c >> 24) & 0x3F)); + } + *t++ = (char)(0x80 | ((c >> 18) & 0x3F)); + } + *t++ = (char)(0x80 | ((c >> 12) & 0x3F)); + } + *t++ = (char)(0x80 | ((c >> 6) & 0x3F)); + } + *t++ = (char)(0x80 | (c & 0x3F)); + m = (int)(t - buf) - 1; + t = buf; + *s++ = *t++; + l++; + if (maxlen >= 0 && l > (size_t)maxlen) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "String too long: maxlen=%ld\n", maxlen)); + soap->error = SOAP_LENGTH; + return NULL; + } + continue; + } + } + } + switch (c) + { + case SOAP_TT: + if (n == 0) + goto end; + n--; + *s++ = '<'; + t = (char*)"/"; + m = 1; + break; + case SOAP_LT: + if (flag == 3 || (f && n == 0)) + goto end; + n++; + *s++ = '<'; + break; + case SOAP_GT: + *s++ = '>'; + break; + case SOAP_QT: + *s++ = '"'; + break; + case SOAP_AP: + *s++ = '\''; + break; + case '/': + if (n > 0) + { + if (flag > 0) + { + c = soap_get(soap); + if (c == SOAP_GT) + n--; + } + else + { + c = soap_getchar(soap); + if (c == '>') + n--; + } + soap_unget(soap, c); + } + *s++ = '/'; + break; + case (soap_wchar)('<' | 0x80000000): + if (flag > 0) + { + *s++ = '<'; + } + else + { + *s++ = '&'; + t = (char*)"lt;"; + m = 3; + } + break; + case (soap_wchar)('>' | 0x80000000): + if (flag > 0) + { + *s++ = '>'; + } + else + { + *s++ = '&'; + t = (char*)"gt;"; + m = 3; + } + break; + case (soap_wchar)('&' | 0x80000000): + if (flag > 0) + { + *s++ = '&'; + } + else + { + *s++ = '&'; + t = (char*)"amp;"; + m = 4; + } + break; + case (soap_wchar)('"' | 0x80000000): + if (flag > 0) + { + *s++ = '"'; + } + else + { + *s++ = '&'; + t = (char*)"quot;"; + m = 5; + } + break; + case (soap_wchar)('\'' | 0x80000000): + if (flag > 0) + { + *s++ = '\''; + } + else + { + *s++ = '&'; + t = (char*)"apos;"; + m = 5; + } + break; + default: + if ((int)c == EOF) + goto end; +#ifndef WITH_CDATA + if (c == '<') + { + c = soap_getchar(soap); + soap_unget(soap, c); + if (c == '/') + { + c = SOAP_TT; + if (n == 0) + goto end; + n--; + } + else + { + n++; + } + *s++ = '<'; + } + else +#endif +#ifndef WITH_LEANER +#ifdef HAVE_WCTOMB + if ((soap->mode & SOAP_C_MBSTRING)) + { +#if defined(WIN32) && !defined(CYGWIN) && !defined(__MINGW32__) && !defined(__MINGW64__) && !defined(__BORLANDC__) + m = 0; + wctomb_s(&m, buf, sizeof(buf), (wchar_t)(c & 0x7FFFFFFF)); +#else + m = wctomb(buf, (wchar_t)(c & 0x7FFFFFFF)); +#endif + if (m >= 1 && m <= (int)MB_CUR_MAX) + { + t = buf; + *s++ = *t++; + m--; + } + else + { + *s++ = SOAP_UNKNOWN_CHAR; + m = 0; + } + } + else +#endif +#endif + *s++ = (char)(c & 0xFF); + } + l++; + if (maxlen >= 0 && l > (size_t)maxlen) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "String too long: maxlen=%ld\n", maxlen)); + soap->error = SOAP_LENGTH; + return NULL; + } + } + } +end: + soap_unget(soap, c); + *s = '\0'; +#ifdef WITH_FAST + t = soap_strdup(soap, soap->labbuf); + if (!t) + return NULL; +#else + soap_size_block(soap, NULL, i + 1); + t = (char*)soap_save_block(soap, NULL, NULL, 0); +#endif + if (minlen > 0 && l < (size_t)minlen) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "String too short: %lu chars, minlen=%ld\n", (unsigned long)l, minlen)); + soap->error = SOAP_LENGTH; + return NULL; + } +#ifdef WITH_DOM + if ((soap->mode & SOAP_XML_DOM) && soap->dom && *t) + { + if (flag > 0) + { + soap->dom->text = t; + } + else + { + soap->dom->code = t; + if (flag < 0) + { + /* the tag URI and name are already in the XML code string */ + soap->dom->nstr = NULL; + soap->dom->name = NULL; + } + } + } +#endif + if (flag == 2) + { + if (soap_s2QName(soap, t, &t, minlen, maxlen, pattern)) + return NULL; + } + else if (flag >= 4 && t) + { + t = soap_collapse(soap, t, flag, 1); + } +#ifndef WITH_LEANER + else if (pattern && soap->fsvalidate) + { + soap->error = soap->fsvalidate(soap, pattern, t); + if (soap->error) + return NULL; + } +#endif + return t; +} + +/******************************************************************************/ + +#ifndef WITH_LEANER +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_wstring_out(struct soap *soap, const wchar_t *s, int flag) +{ + const char *t; + char tmp; + soap_wchar c; +#ifdef WITH_DOM + if ((soap->mode & SOAP_XML_DOM) && soap->dom) + { + soap->dom->text = soap_wchar2s(soap, s); + return SOAP_OK; + } +#endif + while ((c = *s++)) + { + switch (c) + { + case 0x09: + if (flag) + t = " "; + else + t = "\t"; + break; + case 0x0A: + if (flag) + t = " "; + else + t = "\n"; + break; +#ifdef WITH_CR_TO_LF + case 0x0D: + if (*s == 0x0A) + continue; + if (flag) + t = " "; + else + t = "\n"; + break; +#endif + case '&': + t = "&"; + break; + case '<': + t = "<"; + break; + case '>': + if (flag) + t = ">"; + else + t = ">"; + break; + case '"': + if (flag) + t = """; + else + t = "\""; + break; + default: + if (c >= 0x20 && c < 0x80) + { + tmp = (char)c; + if (soap_send_raw(soap, &tmp, 1)) + return soap->error; + } + else + { + /* check for UTF16 encoding when wchar_t is too small to hold UCS */ + if (sizeof(wchar_t) < 4 && (c & 0xFC00) == 0xD800) + { + soap_wchar d = *s; + if ((d & 0xFC00) == 0xDC00) + { + c = ((c - 0xD800) << 10) + (d - 0xDC00) + 0x10000; + s++; + } +#ifdef WITH_REPLACE_ILLEGAL_UTF8 + else + { + c = SOAP_UNKNOWN_UNICODE_CHAR; /* Malformed UTF-16 */ + } +#endif + } + if (soap_pututf8(soap, (unsigned long)c)) + return soap->error; + } + continue; + } + if (soap_send(soap, t)) + return soap->error; + } + return SOAP_OK; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_LEANER +SOAP_FMAC1 +wchar_t * +SOAP_FMAC2 +soap_wstring_in(struct soap *soap, int flag, long minlen, long maxlen, const char *pattern) +{ + wchar_t *s; + int i, n = 0, f = 0; + ULONG64 l = 0; + soap_wchar c; + char *t = NULL; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Reading wide string content\n")); + if (maxlen < 0 && soap->maxlength > 0) + maxlen = soap->maxlength; + if (flag <= 0 && soap->peeked && *soap->tag) + { +#ifndef WITH_LEAN + struct soap_attribute *tp; + t = soap->tmpbuf; + *t = '<'; + soap_strcpy(t + 1, sizeof(soap->tmpbuf) - 1, soap->tag); + t += strlen(t); + for (tp = soap->attributes; tp; tp = tp->next) + { + if (tp->visible) + { + size_t k = strlen(tp->name); + if (t + k + 1 >= soap->tmpbuf + sizeof(soap->tmpbuf)) + break; + *t++ = ' '; + (void)soap_strncpy(t, sizeof(soap->tmpbuf) - (t - soap->tmpbuf), tp->name, k); + t += k; + if (tp->value) + { + k = strlen(tp->value); + if (t + k + 3 >= soap->tmpbuf + sizeof(soap->tmpbuf)) + break; + *t++ = '='; + *t++ = '"'; + (void)soap_strncpy(t, sizeof(soap->tmpbuf) - (t - soap->tmpbuf), tp->value, k); + t += k; + *t++ = '"'; + } + } + } + if (!soap->body) + *t++ = '/'; + *t++ = '>'; + *t = '\0'; + t = soap->tmpbuf; +#endif + if (soap->body) + n = 1; + f = 1; + soap->peeked = 0; + } + if (soap_alloc_block(soap) == NULL) + return NULL; + for (;;) + { + s = (wchar_t*)soap_push_block(soap, NULL, sizeof(wchar_t)*SOAP_BLKLEN); + if (!s) + return NULL; + for (i = 0; i < SOAP_BLKLEN; i++) + { + if (t) + { + *s++ = (wchar_t)*t++; + if (!*t) + t = NULL; + continue; + } + c = soap_getutf8(soap); + switch (c) + { + case SOAP_TT: + if (n == 0) + goto end; + n--; + *s++ = L'<'; + soap_unget(soap, '/'); + break; + case SOAP_LT: + if (flag == 3 || (f && n == 0)) + goto end; + n++; + *s++ = L'<'; + break; + case SOAP_GT: + *s++ = L'>'; + break; + case SOAP_QT: + *s++ = L'"'; + break; + case SOAP_AP: + *s++ = L'\''; + break; + case '/': + if (n > 0) + { + c = soap_getutf8(soap); + if (c == SOAP_GT) + n--; + soap_unget(soap, c); + } + *s++ = L'/'; + break; + case '<': + if (flag > 0) + { + *s++ = L'<'; + } + else + { + *s++ = L'&'; + t = (char*)"lt;"; + } + break; + case '>': + if (flag > 0) + { + *s++ = L'>'; + } + else + { + *s++ = (wchar_t)'&'; + t = (char*)"gt;"; + } + break; + case '"': + if (flag > 0) + { + *s++ = L'"'; + } + else + { + *s++ = L'&'; + t = (char*)"quot;"; + } + break; + default: + if ((int)c == EOF) + goto end; + /* use UTF16 encoding when wchar_t is too small to hold UCS */ + if (sizeof(wchar_t) < 4 && c > 0xFFFF) + { + soap_wchar c1, c2; + c1 = 0xD800 - (0x10000 >> 10) + (c >> 10); + c2 = 0xDC00 + (c & 0x3FF); + c = c1; + soap_unget(soap, c2); + } + *s++ = (wchar_t)(c & 0x7FFFFFFF); + } + l++; + if (maxlen >= 0 && l > (size_t)maxlen) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "String too long: maxlen=%ld\n", maxlen)); + soap->error = SOAP_LENGTH; + return NULL; + } + } + } +end: + soap_unget(soap, c); + *s = L'\0'; + soap_size_block(soap, NULL, sizeof(wchar_t) * (i + 1)); + if (minlen > 0 && l < (size_t)minlen) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "String too short: %lu chars, minlen=%ld\n", (unsigned long)l, minlen)); + soap->error = SOAP_LENGTH; + return NULL; + } + s = (wchar_t*)soap_save_block(soap, NULL, NULL, 0); +#ifndef WITH_LEAN + if (flag >= 4 && s) + s = soap_wcollapse(soap, s, flag, 1); +#endif +#ifndef WITH_LEANER + if (pattern && soap->fwvalidate) + { + soap->error = soap->fwvalidate(soap, pattern, s); + if (soap->error) + return NULL; + } +#endif +#ifdef WITH_DOM + if ((soap->mode & SOAP_XML_DOM) && soap->dom) + soap->dom->text = soap_wchar2s(soap, s); +#endif + return s; +} +#endif + +/******************************************************************************/ + +SOAP_FMAC1 +const char* +SOAP_FMAC2 +soap_int2s(struct soap *soap, int n) +{ + return soap_long2s(soap, (long)n); +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_outint(struct soap *soap, const char *tag, int id, const int *p, const char *type, int n) +{ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, p, n), type) + || soap_string_out(soap, soap_long2s(soap, (long)*p), 0)) + return soap->error; + return soap_element_end_out(soap, tag); +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_s2int(struct soap *soap, const char *s, int *p) +{ + if (s) + { + long n; + char *r; + if (!*s) + return soap->error = SOAP_EMPTY; +#ifndef WITH_NOIO +#ifndef WITH_LEAN + soap_reset_errno; +#endif +#endif + n = soap_strtol(s, &r, 10); + if (s == r || *r +#ifndef WITH_LEAN + || n != (int)n +#endif +#ifndef WITH_NOIO +#ifndef WITH_LEAN + || soap_errno == SOAP_ERANGE +#endif +#endif + ) + soap->error = SOAP_TYPE; + *p = (int)n; + } + return soap->error; +} + +/******************************************************************************/ + +SOAP_FMAC1 +int * +SOAP_FMAC2 +soap_inint(struct soap *soap, const char *tag, int *p, const char *type, int t) +{ + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; +#ifndef WITH_LEAN + if (*soap->type + && soap_match_tag(soap, soap->type, type) + && soap_match_tag(soap, soap->type, ":int") + && soap_match_tag(soap, soap->type, ":short") + && soap_match_tag(soap, soap->type, ":byte")) + { + soap->error = SOAP_TYPE; + soap_revert(soap); + return NULL; + } +#else + (void)type; +#endif + p = (int*)soap_id_enter(soap, soap->id, p, t, sizeof(int), NULL, NULL, NULL, NULL); + if (!p) + return NULL; + if (*soap->href != '#') + { + int err = soap_s2int(soap, soap_value(soap), p); + if ((soap->body && soap_element_end_in(soap, tag)) || err) + return NULL; + } + else + { + p = (int*)soap_id_forward(soap, soap->href, p, 0, t, t, sizeof(int), 0, NULL, NULL); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return p; +} + +/******************************************************************************/ + +SOAP_FMAC1 +const char* +SOAP_FMAC2 +soap_long2s(struct soap *soap, long n) +{ + (SOAP_SNPRINTF(soap->tmpbuf, sizeof(soap->tmpbuf), 20), "%ld", n); + return soap->tmpbuf; +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_outlong(struct soap *soap, const char *tag, int id, const long *p, const char *type, int n) +{ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, p, n), type) + || soap_string_out(soap, soap_long2s(soap, *p), 0)) + return soap->error; + return soap_element_end_out(soap, tag); +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_s2long(struct soap *soap, const char *s, long *p) +{ + if (s) + { + char *r; + if (!*s) + return soap->error = SOAP_EMPTY; +#ifndef WITH_NOIO +#ifndef WITH_LEAN + soap_reset_errno; +#endif +#endif + *p = soap_strtol(s, &r, 10); + if (s == r || *r +#ifndef WITH_NOIO +#ifndef WITH_LEAN + || soap_errno == SOAP_ERANGE +#endif +#endif + ) + soap->error = SOAP_TYPE; + } + return soap->error; +} + +/******************************************************************************/ + +SOAP_FMAC1 +long * +SOAP_FMAC2 +soap_inlong(struct soap *soap, const char *tag, long *p, const char *type, int t) +{ + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; +#ifndef WITH_LEAN + if (*soap->type + && soap_match_tag(soap, soap->type, type) + && soap_match_tag(soap, soap->type, ":int") + && soap_match_tag(soap, soap->type, ":short") + && soap_match_tag(soap, soap->type, ":byte")) + { + soap->error = SOAP_TYPE; + soap_revert(soap); + return NULL; + } +#else + (void)type; +#endif + p = (long*)soap_id_enter(soap, soap->id, p, t, sizeof(long), NULL, NULL, NULL, NULL); + if (!p) + return NULL; + if (*soap->href != '#') + { + int err = soap_s2long(soap, soap_value(soap), p); + if ((soap->body && soap_element_end_in(soap, tag)) || err) + return NULL; + } + else + { + p = (long*)soap_id_forward(soap, soap->href, p, 0, t, t, sizeof(long), 0, NULL, NULL); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return p; +} + +/******************************************************************************/ + +SOAP_FMAC1 +const char* +SOAP_FMAC2 +soap_LONG642s(struct soap *soap, LONG64 n) +{ + (SOAP_SNPRINTF(soap->tmpbuf, sizeof(soap->tmpbuf), 20), SOAP_LONG_FORMAT, n); + return soap->tmpbuf; +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_outLONG64(struct soap *soap, const char *tag, int id, const LONG64 *p, const char *type, int n) +{ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, p, n), type) + || soap_string_out(soap, soap_LONG642s(soap, *p), 0)) + return soap->error; + return soap_element_end_out(soap, tag); +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_s2LONG64(struct soap *soap, const char *s, LONG64 *p) +{ + if (s) + { + char *r; + if (!*s) + return soap->error = SOAP_EMPTY; +#ifndef WITH_NOIO +#ifndef WITH_LEAN + soap_reset_errno; +#endif +#endif + *p = soap_strtoll(s, &r, 10); + if (s == r || *r +#ifndef WITH_NOIO +#ifndef WITH_LEAN + || soap_errno == SOAP_ERANGE +#endif +#endif + ) + soap->error = SOAP_TYPE; + } + return soap->error; +} + +/******************************************************************************/ + +SOAP_FMAC1 +LONG64 * +SOAP_FMAC2 +soap_inLONG64(struct soap *soap, const char *tag, LONG64 *p, const char *type, int t) +{ + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; +#ifndef WITH_LEAN + if (*soap->type + && soap_match_tag(soap, soap->type, type) + && soap_match_tag(soap, soap->type, ":integer") + && soap_match_tag(soap, soap->type, ":positiveInteger") + && soap_match_tag(soap, soap->type, ":negativeInteger") + && soap_match_tag(soap, soap->type, ":nonPositiveInteger") + && soap_match_tag(soap, soap->type, ":nonNegativeInteger") + && soap_match_tag(soap, soap->type, ":long") + && soap_match_tag(soap, soap->type, ":int") + && soap_match_tag(soap, soap->type, ":short") + && soap_match_tag(soap, soap->type, ":byte")) + { + soap->error = SOAP_TYPE; + soap_revert(soap); + return NULL; + } +#else + (void)type; +#endif + p = (LONG64*)soap_id_enter(soap, soap->id, p, t, sizeof(LONG64), NULL, NULL, NULL, NULL); + if (!p) + return NULL; + if (*soap->href != '#') + { + int err = soap_s2LONG64(soap, soap_value(soap), p); + if ((soap->body && soap_element_end_in(soap, tag)) || err) + return NULL; + } + else + { + p = (LONG64*)soap_id_forward(soap, soap->href, p, 0, t, t, sizeof(LONG64), 0, NULL, NULL); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return p; +} + +/******************************************************************************/ + +SOAP_FMAC1 +const char* +SOAP_FMAC2 +soap_byte2s(struct soap *soap, char n) +{ + return soap_long2s(soap, (long)n); +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_outbyte(struct soap *soap, const char *tag, int id, const char *p, const char *type, int n) +{ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, p, n), type) + || soap_string_out(soap, soap_long2s(soap, (long)*p), 0)) + return soap->error; + return soap_element_end_out(soap, tag); +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_s2byte(struct soap *soap, const char *s, char *p) +{ + if (s) + { + long n; + char *r; + if (!*s) + return soap->error = SOAP_EMPTY; + n = soap_strtol(s, &r, 10); + if (s == r || *r || n < -128 || n > 127) + soap->error = SOAP_TYPE; + *p = (char)n; + } + return soap->error; +} + +/******************************************************************************/ + +SOAP_FMAC1 +char * +SOAP_FMAC2 +soap_inbyte(struct soap *soap, const char *tag, char *p, const char *type, int t) +{ + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; +#ifndef WITH_LEAN + if (*soap->type + && soap_match_tag(soap, soap->type, type) + && soap_match_tag(soap, soap->type, ":byte")) + { + soap->error = SOAP_TYPE; + soap_revert(soap); + return NULL; + } +#else + (void)type; +#endif + p = (char*)soap_id_enter(soap, soap->id, p, t, sizeof(char), NULL, NULL, NULL, NULL); + if (!p) + return NULL; + if (*soap->href != '#') + { + int err = soap_s2byte(soap, soap_value(soap), p); + if ((soap->body && soap_element_end_in(soap, tag)) || err) + return NULL; + } + else + { + p = (char*)soap_id_forward(soap, soap->href, p, 0, t, t, sizeof(char), 0, NULL, NULL); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return p; +} + +/******************************************************************************/ + +SOAP_FMAC1 +const char* +SOAP_FMAC2 +soap_short2s(struct soap *soap, short n) +{ + return soap_long2s(soap, (long)n); +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_outshort(struct soap *soap, const char *tag, int id, const short *p, const char *type, int n) +{ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, p, n), type) + || soap_string_out(soap, soap_long2s(soap, (long)*p), 0)) + return soap->error; + return soap_element_end_out(soap, tag); +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_s2short(struct soap *soap, const char *s, short *p) +{ + if (s) + { + long n; + char *r; + if (!*s) + return soap->error = SOAP_EMPTY; + n = soap_strtol(s, &r, 10); + if (s == r || *r || n < -32768 || n > 32767) + soap->error = SOAP_TYPE; + *p = (short)n; + } + return soap->error; +} + +/******************************************************************************/ + +SOAP_FMAC1 +short * +SOAP_FMAC2 +soap_inshort(struct soap *soap, const char *tag, short *p, const char *type, int t) +{ + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; +#ifndef WITH_LEAN + if (*soap->type + && soap_match_tag(soap, soap->type, type) + && soap_match_tag(soap, soap->type, ":short") + && soap_match_tag(soap, soap->type, ":byte")) + { + soap->error = SOAP_TYPE; + soap_revert(soap); + return NULL; + } +#else + (void)type; +#endif + p = (short*)soap_id_enter(soap, soap->id, p, t, sizeof(short), NULL, NULL, NULL, NULL); + if (!p) + return NULL; + if (*soap->href != '#') + { + int err = soap_s2short(soap, soap_value(soap), p); + if ((soap->body && soap_element_end_in(soap, tag)) || err) + return NULL; + } + else + { + p = (short*)soap_id_forward(soap, soap->href, p, 0, t, t, sizeof(short), 0, NULL, NULL); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return p; +} + +/******************************************************************************/ + +SOAP_FMAC1 +const char* +SOAP_FMAC2 +soap_float2s(struct soap *soap, float n) +{ +#if defined(WITH_C_LOCALE) +# if !defined(WIN32) + SOAP_LOCALE_T locale; +# endif +#else + char *s; +#endif + if (soap_isnan((double)n)) + return "NaN"; + if (soap_ispinff(n)) + return "INF"; + if (soap_isninff(n)) + return "-INF"; +#if defined(WITH_C_LOCALE) +# ifdef WIN32 + _sprintf_s_l(soap->tmpbuf, _countof(soap->tmpbuf), soap->float_format, SOAP_LOCALE(soap), n); +# else + locale = uselocale(SOAP_LOCALE(soap)); + (SOAP_SNPRINTF(soap->tmpbuf, sizeof(soap->tmpbuf), 80), soap->float_format, n); + uselocale(locale); +# endif +#else + (SOAP_SNPRINTF(soap->tmpbuf, sizeof(soap->tmpbuf), 80), soap->float_format, n); + s = strchr(soap->tmpbuf, ','); /* convert decimal comma to DP */ + if (s) + *s = '.'; +#endif + return soap->tmpbuf; +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_outfloat(struct soap *soap, const char *tag, int id, const float *p, const char *type, int n) +{ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, p, n), type) + || soap_string_out(soap, soap_float2s(soap, *p), 0)) + return soap->error; + return soap_element_end_out(soap, tag); +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_s2float(struct soap *soap, const char *s, float *p) +{ + if (s) + { + if (!*s) + return soap->error = SOAP_EMPTY; + if (!soap_tag_cmp(s, "INF")) + { + *p = FLT_PINFTY; + } + else if (!soap_tag_cmp(s, "+INF")) + { + *p = FLT_PINFTY; + } + else if (!soap_tag_cmp(s, "-INF")) + { + *p = FLT_NINFTY; + } + else if (!soap_tag_cmp(s, "NaN")) + { + *p = FLT_NAN; + } + else + { +/* On some systems strtof requires -std=c99 or does not even link: so we try strtod first */ +#if defined(WITH_C_LOCALE) +# if defined(HAVE_STRTOD_L) + char *r; +# ifdef WIN32 + *p = (float)_strtod_l(s, &r, SOAP_LOCALE(soap)); +# else + *p = (float)strtod_l(s, &r, SOAP_LOCALE(soap)); +# endif + if (*r) + soap->error = SOAP_TYPE; +# elif defined(HAVE_STRTOF_L) + char *r; + *p = strtof_l((char*)s, &r, SOAP_LOCALE(soap)); + if (*r) + soap->error = SOAP_TYPE; +# elif defined(HAVE_SSCANF_L) + double n; + if (sscanf_l(s, SOAP_LOCALE(soap), "%lf", &n) != 1) + soap->error = SOAP_TYPE; + *p = (float)n; +# elif defined(HAVE_STRTOD) + char *r; + SOAP_LOCALE_T locale = uselocale(SOAP_LOCALE(soap)); + *p = (float)strtod((char*)s, &r); + uselocale(locale); + if (*r) + soap->error = SOAP_TYPE; +# elif defined(HAVE_STRTOF) + char *r; + SOAP_LOCALE_T locale = uselocale(SOAP_LOCALE(soap)); + *p = strtof((char*)s, &r); + uselocale(locale); + if (*r) + soap->error = SOAP_TYPE; +# elif defined(HAVE_SSCANF) + double n; + SOAP_LOCALE_T locale = uselocale(SOAP_LOCALE(soap)); + if (sscanf(s, "%lf", &n) != 1) + soap->error = SOAP_TYPE; + uselocale(locale); + *p = (float)n; +# else + soap->error = SOAP_TYPE; +# endif +#elif defined(HAVE_STRTOD) + char *r; + *p = (float)strtod(s, &r); + if (*r) + soap->error = SOAP_TYPE; +#elif defined(HAVE_STRTOF) + char *r; + *p = strtof((char*)s, &r); + if (*r) + soap->error = SOAP_TYPE; +#elif defined(HAVE_SSCANF) + double n; + if (sscanf(s, "%lf", &n) != 1) + soap->error = SOAP_TYPE; + *p = (float)n; +#else + soap->error = SOAP_TYPE; +#endif + } + } + return soap->error; +} + +/******************************************************************************/ + +#ifndef WITH_LEAN +static int soap_isnumeric(struct soap *soap, const char *type) +{ + if (soap_match_tag(soap, soap->type, type) + && soap_match_tag(soap, soap->type, ":float") + && soap_match_tag(soap, soap->type, ":double") + && soap_match_tag(soap, soap->type, ":decimal") + && soap_match_tag(soap, soap->type, ":integer") + && soap_match_tag(soap, soap->type, ":positiveInteger") + && soap_match_tag(soap, soap->type, ":negativeInteger") + && soap_match_tag(soap, soap->type, ":nonPositiveInteger") + && soap_match_tag(soap, soap->type, ":nonNegativeInteger") + && soap_match_tag(soap, soap->type, ":long") + && soap_match_tag(soap, soap->type, ":int") + && soap_match_tag(soap, soap->type, ":short") + && soap_match_tag(soap, soap->type, ":byte") + && soap_match_tag(soap, soap->type, ":unsignedLong") + && soap_match_tag(soap, soap->type, ":unsignedInt") + && soap_match_tag(soap, soap->type, ":unsignedShort") + && soap_match_tag(soap, soap->type, ":unsignedByte")) + { + soap->error = SOAP_TYPE; + soap_revert(soap); + return SOAP_ERR; + } + return SOAP_OK; +} +#endif + +/******************************************************************************/ + +SOAP_FMAC1 +float * +SOAP_FMAC2 +soap_infloat(struct soap *soap, const char *tag, float *p, const char *type, int t) +{ + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; +#ifndef WITH_LEAN + if (*soap->type != '\0' && soap_isnumeric(soap, type)) + return NULL; +#else + (void)type; +#endif + p = (float*)soap_id_enter(soap, soap->id, p, t, sizeof(float), NULL, NULL, NULL, NULL); + if (!p) + return NULL; + if (*soap->href != '#') + { + int err = soap_s2float(soap, soap_value(soap), p); + if ((soap->body && soap_element_end_in(soap, tag)) || err) + return NULL; + } + else + { + p = (float*)soap_id_forward(soap, soap->href, p, 0, t, t, sizeof(float), 0, NULL, NULL); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return p; +} + +/******************************************************************************/ + +SOAP_FMAC1 +const char* +SOAP_FMAC2 +soap_double2s(struct soap *soap, double n) +{ +#if defined(WITH_C_LOCALE) +# if !defined(WIN32) + SOAP_LOCALE_T locale; +# endif +#else + char *s; +#endif + if (soap_isnan(n)) + return "NaN"; + if (soap_ispinfd(n)) + return "INF"; + if (soap_isninfd(n)) + return "-INF"; +#if defined(WITH_C_LOCALE) +# ifdef WIN32 + _sprintf_s_l(soap->tmpbuf, _countof(soap->tmpbuf), soap->double_format, SOAP_LOCALE(soap), n); +# else + locale = uselocale(SOAP_LOCALE(soap)); + (SOAP_SNPRINTF(soap->tmpbuf, sizeof(soap->tmpbuf), 80), soap->double_format, n); + uselocale(locale); +# endif +#else + (SOAP_SNPRINTF(soap->tmpbuf, sizeof(soap->tmpbuf), 80), soap->double_format, n); + s = strchr(soap->tmpbuf, ','); /* convert decimal comma to DP */ + if (s) + *s = '.'; +#endif + return soap->tmpbuf; +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_outdouble(struct soap *soap, const char *tag, int id, const double *p, const char *type, int n) +{ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, p, n), type) + || soap_string_out(soap, soap_double2s(soap, *p), 0)) + return soap->error; + return soap_element_end_out(soap, tag); +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_s2double(struct soap *soap, const char *s, double *p) +{ + if (s) + { + if (!*s) + return soap->error = SOAP_EMPTY; + if (!soap_tag_cmp(s, "INF")) + { + *p = DBL_PINFTY; + } + else if (!soap_tag_cmp(s, "+INF")) + { + *p = DBL_PINFTY; + } + else if (!soap_tag_cmp(s, "-INF")) + { + *p = DBL_NINFTY; + } + else if (!soap_tag_cmp(s, "NaN")) + { + *p = DBL_NAN; + } + else + { +#if defined(WITH_C_LOCALE) +# if defined(HAVE_STRTOD_L) + char *r; +# ifdef WIN32 + *p = _strtod_l(s, &r, SOAP_LOCALE(soap)); +# else + *p = strtod_l(s, &r, SOAP_LOCALE(soap)); +# endif + if (*r) + soap->error = SOAP_TYPE; +# elif defined(HAVE_STRTOD) + char *r; + SOAP_LOCALE_T locale = uselocale(SOAP_LOCALE(soap)); + *p = strtod(s, &r); + uselocale(locale); + if (*r) + soap->error = SOAP_TYPE; +# elif defined(HAVE_SSCANF_L) + SOAP_LOCALE_T locale = uselocale(SOAP_LOCALE(soap)); + if (sscanf_l(s, SOAP_LOCALE(soap), "%lf", p) != 1) + soap->error = SOAP_TYPE; + uselocale(locale); +# else + soap->error = SOAP_TYPE; +# endif +#elif defined(HAVE_STRTOD) + char *r; + *p = strtod(s, &r); + if (*r) + soap->error = SOAP_TYPE; +#elif defined(HAVE_SSCANF) + if (sscanf(s, "%lf", p) != 1) + soap->error = SOAP_TYPE; +#else + soap->error = SOAP_TYPE; +#endif + } + } + return soap->error; +} + +/******************************************************************************/ + +SOAP_FMAC1 +double * +SOAP_FMAC2 +soap_indouble(struct soap *soap, const char *tag, double *p, const char *type, int t) +{ + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; +#ifndef WITH_LEAN + if (*soap->type != '\0' && soap_isnumeric(soap, type)) + return NULL; +#else + (void)type; +#endif + p = (double*)soap_id_enter(soap, soap->id, p, t, sizeof(double), NULL, NULL, NULL, NULL); + if (!p) + return NULL; + if (*soap->href != '#') + { + int err = soap_s2double(soap, soap_value(soap), p); + if ((soap->body && soap_element_end_in(soap, tag)) || err) + return NULL; + } + else + { + p = (double*)soap_id_forward(soap, soap->href, p, 0, t, t, sizeof(double), 0, NULL, NULL); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return p; +} + +/******************************************************************************/ + +SOAP_FMAC1 +const char* +SOAP_FMAC2 +soap_unsignedByte2s(struct soap *soap, unsigned char n) +{ + return soap_unsignedLong2s(soap, (unsigned long)n); +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_outunsignedByte(struct soap *soap, const char *tag, int id, const unsigned char *p, const char *type, int n) +{ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, p, n), type) + || soap_string_out(soap, soap_unsignedLong2s(soap, (unsigned long)*p), 0)) + return soap->error; + return soap_element_end_out(soap, tag); +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_s2unsignedByte(struct soap *soap, const char *s, unsigned char *p) +{ + if (s) + { + long n; + char *r; + if (!*s) + return soap->error = SOAP_EMPTY; + n = soap_strtol(s, &r, 10); + if (s == r || *r || n < 0 || n > 255) + soap->error = SOAP_TYPE; + *p = (unsigned char)n; + } + return soap->error; +} + +/******************************************************************************/ + +SOAP_FMAC1 +unsigned char * +SOAP_FMAC2 +soap_inunsignedByte(struct soap *soap, const char *tag, unsigned char *p, const char *type, int t) +{ + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; +#ifndef WITH_LEAN + if (*soap->type + && soap_match_tag(soap, soap->type, type) + && soap_match_tag(soap, soap->type, ":unsignedByte")) + { + soap->error = SOAP_TYPE; + soap_revert(soap); + return NULL; + } +#else + (void)type; +#endif + p = (unsigned char*)soap_id_enter(soap, soap->id, p, t, sizeof(unsigned char), NULL, NULL, NULL, NULL); + if (!p) + return NULL; + if (*soap->href != '#') + { + int err = soap_s2unsignedByte(soap, soap_value(soap), p); + if ((soap->body && soap_element_end_in(soap, tag)) || err) + return NULL; + } + else + { + p = (unsigned char*)soap_id_forward(soap, soap->href, p, 0, t, t, sizeof(unsigned char), 0, NULL, NULL); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return p; +} + +/******************************************************************************/ + +SOAP_FMAC1 +const char* +SOAP_FMAC2 +soap_unsignedShort2s(struct soap *soap, unsigned short n) +{ + return soap_unsignedLong2s(soap, (unsigned long)n); +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_outunsignedShort(struct soap *soap, const char *tag, int id, const unsigned short *p, const char *type, int n) +{ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, p, n), type) + || soap_string_out(soap, soap_unsignedLong2s(soap, (unsigned long)*p), 0)) + return soap->error; + return soap_element_end_out(soap, tag); +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_s2unsignedShort(struct soap *soap, const char *s, unsigned short *p) +{ + if (s) + { + long n; + char *r; + if (!*s) + return soap->error = SOAP_EMPTY; + n = soap_strtol(s, &r, 10); + if (s == r || *r || n < 0 || n > 65535) + soap->error = SOAP_TYPE; + *p = (unsigned short)n; + } + return soap->error; +} + +/******************************************************************************/ + +SOAP_FMAC1 +unsigned short * +SOAP_FMAC2 +soap_inunsignedShort(struct soap *soap, const char *tag, unsigned short *p, const char *type, int t) +{ + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; +#ifndef WITH_LEAN + if (*soap->type + && soap_match_tag(soap, soap->type, type) + && soap_match_tag(soap, soap->type, ":unsignedShort") + && soap_match_tag(soap, soap->type, ":unsignedByte")) + { + soap->error = SOAP_TYPE; + soap_revert(soap); + return NULL; + } +#else + (void)type; +#endif + p = (unsigned short*)soap_id_enter(soap, soap->id, p, t, sizeof(unsigned short), NULL, NULL, NULL, NULL); + if (!p) + return NULL; + if (*soap->href != '#') + { + int err = soap_s2unsignedShort(soap, soap_value(soap), p); + if ((soap->body && soap_element_end_in(soap, tag)) || err) + return NULL; + } + else + { + p = (unsigned short*)soap_id_forward(soap, soap->href, p, 0, t, t, sizeof(unsigned short), 0, NULL, NULL); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return p; +} + +/******************************************************************************/ + +SOAP_FMAC1 +const char* +SOAP_FMAC2 +soap_unsignedInt2s(struct soap *soap, unsigned int n) +{ + return soap_unsignedLong2s(soap, (unsigned long)n); +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_outunsignedInt(struct soap *soap, const char *tag, int id, const unsigned int *p, const char *type, int n) +{ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, p, n), type) + || soap_string_out(soap, soap_unsignedLong2s(soap, (unsigned long)*p), 0)) + return soap->error; + return soap_element_end_out(soap, tag); +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_s2unsignedInt(struct soap *soap, const char *s, unsigned int *p) +{ + if (s) + { + unsigned long n; + char *r; + if (!*s) + return soap->error = SOAP_EMPTY; +#ifndef WITH_NOIO +#ifndef WITH_LEAN + soap_reset_errno; +#endif +#endif + n = soap_strtoul(s, &r, 10); + if (s == r || *r +#ifndef WITH_LEAN + || n != (unsigned int)n +#endif +#ifndef WITH_NOIO +#ifndef WITH_LEAN + || soap_errno == SOAP_ERANGE +#endif +#endif + ) + soap->error = SOAP_TYPE; +#ifdef HAVE_STRTOUL + if (n > 0 && strchr(s, '-')) + return soap->error = SOAP_TYPE; +#endif + *p = (unsigned int)n; + } + return soap->error; +} + +/******************************************************************************/ + +SOAP_FMAC1 +unsigned int * +SOAP_FMAC2 +soap_inunsignedInt(struct soap *soap, const char *tag, unsigned int *p, const char *type, int t) +{ + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; +#ifndef WITH_LEAN + if (*soap->type + && soap_match_tag(soap, soap->type, type) + && soap_match_tag(soap, soap->type, ":unsignedInt") + && soap_match_tag(soap, soap->type, ":unsignedShort") + && soap_match_tag(soap, soap->type, ":unsignedByte")) + { + soap->error = SOAP_TYPE; + soap_revert(soap); + return NULL; + } +#else + (void)type; +#endif + p = (unsigned int*)soap_id_enter(soap, soap->id, p, t, sizeof(unsigned int), NULL, NULL, NULL, NULL); + if (!p) + return NULL; + if (*soap->href != '#') + { + int err = soap_s2unsignedInt(soap, soap_value(soap), p); + if ((soap->body && soap_element_end_in(soap, tag)) || err) + return NULL; + } + else + { + p = (unsigned int*)soap_id_forward(soap, soap->href, p, 0, t, t, sizeof(unsigned int), 0, NULL, NULL); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return p; +} + +/******************************************************************************/ + +SOAP_FMAC1 +const char* +SOAP_FMAC2 +soap_unsignedLong2s(struct soap *soap, unsigned long n) +{ + (SOAP_SNPRINTF(soap->tmpbuf, sizeof(soap->tmpbuf), 20), "%lu", n); + return soap->tmpbuf; +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_outunsignedLong(struct soap *soap, const char *tag, int id, const unsigned long *p, const char *type, int n) +{ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, p, n), type) + || soap_string_out(soap, soap_unsignedLong2s(soap, *p), 0)) + return soap->error; + return soap_element_end_out(soap, tag); +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_s2unsignedLong(struct soap *soap, const char *s, unsigned long *p) +{ + if (s) + { + char *r; + if (!*s) + return soap->error = SOAP_EMPTY; +#ifndef WITH_NOIO +#ifndef WITH_LEAN + soap_reset_errno; +#endif +#endif + *p = soap_strtoul(s, &r, 10); + if (s == r || *r +#ifndef WITH_NOIO +#ifndef WITH_LEAN + || soap_errno == SOAP_ERANGE +#endif +#endif + ) + soap->error = SOAP_TYPE; +#ifdef HAVE_STRTOUL + if (*p > 0 && strchr(s, '-')) + return soap->error = SOAP_TYPE; +#endif + } + return soap->error; +} + +/******************************************************************************/ + +SOAP_FMAC1 +unsigned long * +SOAP_FMAC2 +soap_inunsignedLong(struct soap *soap, const char *tag, unsigned long *p, const char *type, int t) +{ + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; +#ifndef WITH_LEAN + if (*soap->type + && soap_match_tag(soap, soap->type, type) + && soap_match_tag(soap, soap->type, ":unsignedInt") + && soap_match_tag(soap, soap->type, ":unsignedShort") + && soap_match_tag(soap, soap->type, ":unsignedByte")) + { + soap->error = SOAP_TYPE; + soap_revert(soap); + return NULL; + } +#else + (void)type; +#endif + p = (unsigned long*)soap_id_enter(soap, soap->id, p, t, sizeof(unsigned long), NULL, NULL, NULL, NULL); + if (!p) + return NULL; + if (*soap->href != '#') + { + int err = soap_s2unsignedLong(soap, soap_value(soap), p); + if ((soap->body && soap_element_end_in(soap, tag)) || err) + return NULL; + } + else + { + p = (unsigned long*)soap_id_forward(soap, soap->href, p, 0, t, t, sizeof(unsigned long), 0, NULL, NULL); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return p; +} + +/******************************************************************************/ + +SOAP_FMAC1 +const char* +SOAP_FMAC2 +soap_ULONG642s(struct soap *soap, ULONG64 n) +{ + (SOAP_SNPRINTF(soap->tmpbuf, sizeof(soap->tmpbuf), 20), SOAP_ULONG_FORMAT, n); + return soap->tmpbuf; +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_outULONG64(struct soap *soap, const char *tag, int id, const ULONG64 *p, const char *type, int n) +{ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, p, n), type) + || soap_string_out(soap, soap_ULONG642s(soap, *p), 0)) + return soap->error; + return soap_element_end_out(soap, tag); +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_s2ULONG64(struct soap *soap, const char *s, ULONG64 *p) +{ + if (s) + { + char *r; + if (!*s) + return soap->error = SOAP_EMPTY; +#ifndef WITH_NOIO +#ifndef WITH_LEAN + soap_reset_errno; +#endif +#endif + *p = soap_strtoull(s, &r, 10); + if (s == r || *r +#ifndef WITH_NOIO +#ifndef WITH_LEAN + || soap_errno == SOAP_ERANGE +#endif +#endif + ) + soap->error = SOAP_TYPE; + if (*p > 0 && strchr(s, '-')) + return soap->error = SOAP_TYPE; + } + return soap->error; +} + +/******************************************************************************/ + +SOAP_FMAC1 +ULONG64 * +SOAP_FMAC2 +soap_inULONG64(struct soap *soap, const char *tag, ULONG64 *p, const char *type, int t) +{ + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; +#ifndef WITH_LEAN + if (*soap->type + && soap_match_tag(soap, soap->type, type) + && soap_match_tag(soap, soap->type, ":positiveInteger") + && soap_match_tag(soap, soap->type, ":nonNegativeInteger") + && soap_match_tag(soap, soap->type, ":unsignedLong") + && soap_match_tag(soap, soap->type, ":unsignedInt") + && soap_match_tag(soap, soap->type, ":unsignedShort") + && soap_match_tag(soap, soap->type, ":unsignedByte")) + { + soap->error = SOAP_TYPE; + soap_revert(soap); + return NULL; + } +#else + (void)type; +#endif + p = (ULONG64*)soap_id_enter(soap, soap->id, p, t, sizeof(ULONG64), NULL, NULL, NULL, NULL); + if (!p) + return NULL; + if (*soap->href != '#') + { + int err = soap_s2ULONG64(soap, soap_value(soap), p); + if ((soap->body && soap_element_end_in(soap, tag)) || err) + return NULL; + } + else + { + p = (ULONG64*)soap_id_forward(soap, soap->href, p, 0, t, t, sizeof(ULONG64), 0, NULL, NULL); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return p; +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_s2char(struct soap *soap, const char *s, char **t, int flag, long minlen, long maxlen, const char *pattern) +{ + if (s) + { + const char *r = soap_string(soap, s, flag, minlen, maxlen, pattern); + if (r && (*t = soap_strdup(soap, r)) == NULL) + return soap->error = SOAP_EOM; + } + return soap->error; +} + +/******************************************************************************/ + +#ifndef WITH_COMPAT +#ifdef __cplusplus +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_s2stdchar(struct soap *soap, const char *s, std::string *t, int flag, long minlen, long maxlen, const char *pattern) +{ + if (s) + { + const char *r = soap_string(soap, s, flag, minlen, maxlen, pattern); + if (r) + t->assign(r); + } + return soap->error; +} +#endif +#endif + +/******************************************************************************/ + +static const char* +soap_string(struct soap *soap, const char *s, int flag, long minlen, long maxlen, const char *pattern) +{ + if (s) + { + if (maxlen < 0 && soap->maxlength > 0) + maxlen = soap->maxlength; + if (minlen > 0 || maxlen >= 0) + { + size_t l; + if ((soap->mode & SOAP_C_UTFSTRING)) + l = soap_utf8len(s); + else + l = strlen(s); + if ((maxlen >= 0 && l > (size_t)maxlen) || (minlen > 0 && l < (size_t)minlen)) + { + soap->error = SOAP_LENGTH; + return NULL; + } + } + if (flag >= 4) + s = soap_collapse(soap, (char*)s, flag, 0); +#ifndef WITH_LEANER + if (pattern && soap->fsvalidate) + { + soap->error = soap->fsvalidate(soap, pattern, s); + if (soap->error) + return NULL; + } +#else + (void)pattern; +#endif + } + return s; +} + +/******************************************************************************/ + +static char* +soap_collapse(struct soap *soap, char *s, int flag, int insitu) +{ + /* flag 4=normalizedString (replace), 5=token (collapse) */ + char *t; + size_t n; + if (!s) + return NULL; + if (flag == 4) + { + for (t = s; *t && (!soap_coblank((soap_wchar)*t) || *t == 32); t++) + continue; + if (*t) + { + /* replace white space and control chars by blanks */ + if (!insitu) + s = soap_strdup(soap, s); + for (t = s; *t; t++) + if (soap_coblank((soap_wchar)*t)) + *t = ' '; + } + return s; + } + /* collapse white space */ + for (t = s; *t && soap_coblank((soap_wchar)*t); t++) + continue; + n = strlen(t); + if (insitu && s < t) + (void)soap_memmove(s, n + 1, t, n + 1); + else + s = t; + if (n > 0) + { + if (!soap_coblank((soap_wchar)s[n-1])) + { + for (t = s; (*t && !soap_coblank((soap_wchar)*t)) || (*t == 32 && (!t[1] || !soap_coblank((soap_wchar)t[1]))); t++) + continue; + if (!*t) + return s; + } + if (!insitu) + s = soap_strdup(soap, s); + for (t = s; *t; t++) + { + if (soap_coblank((soap_wchar)*t)) + { + char *r; + *t = ' '; + for (r = t + 1; *r && soap_coblank((soap_wchar)*r); r++) + continue; + if (r > t + 1) + (void)soap_memmove(t + 1, n - (t-s), r, n - (r-s) + 1); + } + } + t--; + if (t >= s && *t == 32) + *t = '\0'; + } + return s; +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_s2QName(struct soap *soap, const char *s, char **t, long minlen, long maxlen, const char *pattern) +{ + *t = NULL; + if (s) + { + const char *r = soap_QName(soap, s, minlen, maxlen, pattern); + if (r && (*t = soap_strdup(soap, r)) == NULL) + return soap->error = SOAP_EOM; + } + return soap->error; +} + +/******************************************************************************/ + +#ifndef WITH_COMPAT +#ifdef __cplusplus +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_s2stdQName(struct soap *soap, const char *s, std::string *t, long minlen, long maxlen, const char *pattern) +{ + t->clear(); + if (s) + { + const char *r = soap_QName(soap, s, minlen, maxlen, pattern); + if (r) + t->assign(r); + } + return soap->error; +} +#endif +#endif + +/******************************************************************************/ + +static const char* +soap_QName(struct soap *soap, const char *s, long minlen, long maxlen, const char *pattern) +{ + if (s) + { + char *b; + if (maxlen < 0 && soap->maxlength > 0) + maxlen = soap->maxlength; + if (minlen > 0 || maxlen >= 0) + { + size_t l; + if ((soap->mode & SOAP_C_UTFSTRING)) + l = soap_utf8len(s); + else + l = strlen(s); + if ((maxlen >= 0 && l > (size_t)maxlen) || (minlen > 0 && l < (size_t)minlen)) + { + soap->error = SOAP_LENGTH; + return NULL; + } + } +#ifdef WITH_FAST + soap->labidx = 0; +#else + if (soap_alloc_block(soap) == NULL) + return NULL; +#endif + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Normalized namespace(s) of QNames '%s'", s)); + /* convert (by prefix normalize prefix) all QNames in s */ + for (;;) + { + size_t n; + struct soap_nlist *np; + const char *p = NULL; + short flag = 0; + const char *r = NULL; + size_t m = 0; +#ifndef WITH_FAST + size_t k = 0; +#endif + /* skip blanks */ + while (*s && soap_coblank((soap_wchar)*s)) + s++; + if (!*s) + break; + /* find next QName */ + n = 1; + while (s[n] && !soap_coblank((soap_wchar)s[n])) + n++; + np = soap->nlist; + /* if there is no namespace stack, or prefix is "#" or "xml" then copy string */ + if (!np || *s == '#' || !strncmp(s, "xml:", 4)) + { + r = s; + m = n; + } + else /* we normalize the QName by replacing its prefix */ + { + const char *q; + for (p = s; *p && p < s + n; p++) + if (*p == ':') + break; + if (*p == ':') + { + size_t k = p - s; + while (np && (strncmp(np->id, s, k) || np->id[k])) + np = np->next; + p++; + } + else + { + while (np && *np->id) + np = np->next; + p = s; + } + /* replace prefix */ + if (np) + { + if (np->index >= 0 && soap->local_namespaces && (q = soap->local_namespaces[np->index].id) != NULL) + { + size_t k = strlen(q); + if (q[k-1] != '_') + { + r = q; + m = k; + } + else + { + flag = 1; + r = soap->local_namespaces[np->index].ns; + m = strlen(r); + } + } + else if (np->ns) + { + flag = 1; + r = np->ns; + m = strlen(r); + } + else + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "\nNamespace prefix of '%s' not defined (index=%d, URI='%s')\n", s, np->index, np->ns ? np->ns : SOAP_STR_EOS)); + soap->error = SOAP_NAMESPACE; + return NULL; + } + } + else if (s[n]) /* no namespace, part of string */ + { + r = s; + m = n; + } + else /* no namespace: assume "" namespace */ + { + flag = 1; + } + } +#ifdef WITH_FAST + if ((flag && soap_append_lab(soap, "\"", 1)) + || (m && soap_append_lab(soap, r, m)) + || (flag && soap_append_lab(soap, "\"", 1)) + || (p && (soap_append_lab(soap, ":", 1) || soap_append_lab(soap, p, n - (p-s))))) + return NULL; +#else + k = 2*flag + m + (p ? n - (p-s) + 1 : 0) + (s[n] != '\0'); + b = (char*)soap_push_block(soap, NULL, k); + if (!b) + return NULL; + if (flag) + *b++ = '"'; + if (m) + { + if (soap_memcpy((void*)b, k, (const void*)r, m)) + { + soap->error = SOAP_EOM; + return NULL; + } + b += m; + } + if (flag) + *b++ = '"'; + if (p) + { + *b++ = ':'; + if (soap_memcpy((void*)b, k - m - flag - 1, (const void*)p, n - (p-s))) + { + soap->error = SOAP_EOM; + return NULL; + } + b += n - (p-s); + } +#endif + /* advance to next and add spacing */ + s += n; + while (*s && soap_coblank(*s)) + s++; + if (*s) + { +#ifdef WITH_FAST + if (soap_append_lab(soap, " ", 1)) + return NULL; +#else + *b = ' '; +#endif + } + } +#ifdef WITH_FAST + if (soap_append_lab(soap, SOAP_STR_EOS, 1)) + return NULL; + b = soap->labbuf; +#else + b = (char*)soap_push_block(soap, NULL, 1); + if (!b) + return NULL; + *b = '\0'; + b = (char*)soap_save_block(soap, NULL, NULL, 0); +#endif +#ifndef WITH_LEANER + if (pattern && soap->fsvalidate) + { + soap->error = soap->fsvalidate(soap, pattern, b); + if (soap->error) + return NULL; + } +#else + (void)pattern; +#endif + return b; + } + return NULL; +} + +/******************************************************************************/ + +SOAP_FMAC1 +const char* +SOAP_FMAC2 +soap_QName2s(struct soap *soap, const char *s) +{ + const char *t = NULL; + if (s) + { +#ifdef WITH_FAST + soap_store_lab(soap, SOAP_STR_EOS, 1); + soap->labidx = 0; +#else + char *b = NULL; + if (soap_alloc_block(soap) == NULL) + return NULL; +#endif + for (;;) + { + size_t n; + const char *q = NULL; + const char *r = NULL; + size_t m = 0; +#ifndef WITH_FAST + size_t k = 0; +#endif + /* skip blanks */ + while (*s && soap_coblank((soap_wchar)*s)) + s++; + if (!*s) + { +#ifdef WITH_FAST + soap->labbuf[soap->labidx > 0 ? soap->labidx - 1 : 0] = '\0'; +#else + if (!b) + return soap_strdup(soap, SOAP_STR_EOS); + --b; + *b = '\0'; +#endif + break; + } + /* find next QName */ + n = 0; + while (s[n] && !soap_coblank((soap_wchar)s[n])) + { + if (s[n] == ':') + r = s; + n++; + } + if (*s != '"') /* non-quoted: pass string as is */ + { +#ifndef WITH_LEAN + if (r && (soap->mode & SOAP_XML_CANONICAL) && !(soap->mode & SOAP_XML_CANONICAL_NA)) + soap_utilize_ns(soap, s, 1); +#endif + r = s; + m = n + 1; + } + else /* prefix quoted URI-based string */ + { + q = strchr(s + 1, '"'); + if (q) + { + struct Namespace *p = soap->local_namespaces; + if (p) + { + for (; p->id; p++) + { + if (p->ns) + if (!soap_tag_cmp(s + 1, p->ns)) + break; + if (p->in) + if (!soap_tag_cmp(s + 1, p->in)) + break; + } + } + q++; + /* URL is in the namespace table? */ + if (p && p->id) + { + r = p->id; + m = strlen(r); + } + else /* not in namespace table: create xmlns binding */ + { + char *x = soap_strdup(soap, s + 1); + if (!x) + return NULL; + x[q - s - 2] = '\0'; + (SOAP_SNPRINTF(soap->tmpbuf, sizeof(soap->tmpbuf), 27), "xmlns:_%d", soap->idnum++); + soap_set_attr(soap, soap->tmpbuf, x, 1); + r = soap->tmpbuf + 6; + m = strlen(r); + } + } + } + /* copy normalized QName into buffer, including the ending blank or NUL */ +#ifdef WITH_FAST + if ((m && soap_append_lab(soap, r, m)) + || (q && soap_append_lab(soap, q, n - (q - s) + 1))) + return NULL; +#else + k = m + (q ? n - (q - s) + 1 : 0); + b = (char*)soap_push_block(soap, NULL, k); + if (!b) + { + soap->error = SOAP_EOM; + return NULL; + } + if (soap_memcpy((void*)b, k, (const void*)r, m)) + { + soap->error = SOAP_EOM; + return NULL; + } + b += m; + if (q) + { + if (soap_memcpy((void*)b, k - m, (const void*)q, n - (q - s) + 1)) + { + soap->error = SOAP_EOM; + return NULL; + } + b += n - (q - s) + 1; + } +#endif + /* advance to next */ + s += n; + } +#ifdef WITH_FAST + t = soap_strdup(soap, soap->labbuf); + if (!t) + soap->error = SOAP_EOM; +#else + t = (char*)soap_save_block(soap, NULL, NULL, 0); +#endif + } + return t; +} + +/******************************************************************************/ + +#ifndef WITH_LEAN +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_s2wchar(struct soap *soap, const char *s, wchar_t **t, int flag, long minlen, long maxlen, const char *pattern) +{ + if (s) + { + const wchar_t *r = soap_wstring(soap, s, flag, minlen, maxlen, pattern); + if (r && (*t = soap_wstrdup(soap, r)) == NULL) + return soap->error = SOAP_EOM; + } + return soap->error; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_COMPAT +#ifdef __cplusplus +#ifndef WITH_LEAN +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_s2stdwchar(struct soap *soap, const char *s, std::wstring *t, int flag, long minlen, long maxlen, const char *pattern) +{ + if (s) + { + const wchar_t *r = soap_wstring(soap, s, flag, minlen, maxlen, pattern); + if (r) + t->assign(r); + } + return soap->error; +} +#endif +#endif +#endif + +/******************************************************************************/ + +#ifndef WITH_LEAN +static const wchar_t* +soap_wstring(struct soap *soap, const char *s, int flag, long minlen, long maxlen, const char *pattern) +{ + if (s) + { + size_t l; + soap_wchar c; + wchar_t *t; + if (maxlen < 0 && soap->maxlength > 0) + maxlen = soap->maxlength; + soap->labidx = 0; + if ((soap->mode & SOAP_ENC_LATIN)) + { + wchar_t *r; + if (soap_append_lab(soap, NULL, sizeof(wchar_t) * (strlen(s) + 1))) + return NULL; + r = (wchar_t*)(void*)soap->labbuf; + while (*s) + *r++ = (wchar_t)*s++; + } + else + { + /* Convert UTF8 to wchar_t */ + while (*s) + { + c = (unsigned char)*s++; + if (c >= 0x80) + { +#ifdef WITH_REPLACE_ILLEGAL_UTF8 + soap_wchar c1, c2, c3; + c1 = (unsigned char)*s; + if (c <= 0xC1 || (c1 & 0xC0) != 0x80) + { + c = SOAP_UNKNOWN_UNICODE_CHAR; + } + else + { + ++s; + c1 &= 0x3F; + if (c < 0xE0) + { + c = (((c & 0x1F) << 6) | c1); + } + else + { + c2 = (unsigned char)*s; + if ((c == 0xE0 && c1 < 0x20) || (c2 & 0xC0) != 0x80) + { + c = SOAP_UNKNOWN_UNICODE_CHAR; + } + else + { + ++s; + c2 &= 0x3F; + if (c < 0xF0) + { + c = (((c & 0x0F) << 12) | (c1 << 6) | c2); + } + else + { + c3 = (unsigned char)*s; + if ((c == 0xF0 && c1 < 0x10) || (c == 0xF4 && c1 >= 0x10) || c >= 0xF5 || (c3 & 0xC0) != 0x80) + { + c = SOAP_UNKNOWN_UNICODE_CHAR; + } + else + { + ++s; + c = (((c & 0x07) << 18) | (c1 << 12) | (c2 << 6) | (c3 & 0x3F)); + } + } + } + } + } +#else + soap_wchar c1, c2, c3, c4; + c1 = (unsigned char)*s; + if (c1) + { + s++; + c1 &= 0x3F; + if (c < 0xE0) + { + c = (wchar_t)(((soap_wchar)(c & 0x1F) << 6) | c1); + } + else + { + c2 = (unsigned char)*s; + if (c2) + { + s++; + c2 &= 0x3F; + if (c < 0xF0) + { + c = (wchar_t)(((soap_wchar)(c & 0x0F) << 12) | (c1 << 6) | c2); + } + else + { + c3 = (unsigned char)*s; + if (c3) + { + s++; + c3 &= 0x3F; + if (c < 0xF8) + { + c = (wchar_t)(((soap_wchar)(c & 0x07) << 18) | (c1 << 12) | (c2 << 6) | c3); + } + else + { + c4 = (unsigned char)*s; + if (c4) + { + s++; + c4 &= 0x3F; + if (c < 0xFC) + { + c = (wchar_t)(((soap_wchar)(c & 0x03) << 24) | (c1 << 18) | (c2 << 12) | (c3 << 6) | c4); + } + else + { + c = (wchar_t)(((soap_wchar)(c & 0x01) << 30) | (c1 << 24) | (c2 << 18) | (c3 << 12) | (c4 << 6) | (unsigned char)(*s & 0x3F)); + if (*s) + s++; + } + } + } + } + } + } + } + } +#endif + } + /* use UTF16 encoding when wchar_t is too small to hold UCS */ + if (sizeof(wchar_t) < 4 && c > 0xFFFF) + { + wchar_t c1, c2; + c1 = 0xD800 - (0x10000 >> 10) + (c >> 10); + c2 = 0xDC00 + (c & 0x3FF); + if (soap_append_lab(soap, (const char*)&c1, sizeof(wchar_t)) || soap_append_lab(soap, (const char*)&c2, sizeof(wchar_t))) + return NULL; + } + else if (soap_append_lab(soap, (const char*)&c, sizeof(wchar_t))) + { + return NULL; + } + } + } + l = soap->labidx / sizeof(wchar_t); + c = L'\0'; + if (soap_append_lab(soap, (const char*)&c, sizeof(wchar_t))) + return NULL; + if ((maxlen >= 0 && l > (size_t)maxlen) || (minlen > 0 && l < (size_t)minlen)) + { + soap->error = SOAP_LENGTH; + return NULL; + } + t = (wchar_t*)(void*)soap->labbuf; +#ifndef WITH_LEAN + if (flag >= 4 && t) + t = soap_wcollapse(soap, t, flag, 1); +#endif +#ifndef WITH_LEANER + if (pattern && soap->fwvalidate) + { + soap->error = soap->fwvalidate(soap, pattern, t); + if (soap->error) + return NULL; + } +#endif + return t; + } + return NULL; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_LEAN +static wchar_t* +soap_wcollapse(struct soap *soap, wchar_t *s, int flag, int insitu) +{ + /* flag 4=normalizedString (replace), 5=token (collapse) */ + wchar_t *t; + size_t n; + if (!s) + return NULL; + if (flag == 4) + { + for (t = s; *t && (!soap_coblank((soap_wchar)*t) || *t == 32); t++) + continue; + if (*t) + { + /* replace blanks and control char by space */ + if (!insitu) + s = soap_wstrdup(soap, s); + if (s) + for (t = s; *t; t++) + if (soap_coblank((soap_wchar)*t)) + *t = L' '; + } + return s; + } + /* collapse white space */ + for (t = s; *t && soap_coblank((soap_wchar)*t); t++) + continue; + n = 0; + while (t[n]) + n++; + if (insitu && s < t) + (void)soap_memmove(s, n + 1, t, n + 1); + else + s = t; + if (n > 0) + { + if (!soap_coblank((soap_wchar)s[n-1])) + { + for (t = s; (*t && !soap_coblank((soap_wchar)*t)) || (*t == 32 && (!t[1] || !soap_coblank((soap_wchar)t[1]))); t++) + continue; + if (!*t) + return s; + } + if (!insitu) + s = soap_wstrdup(soap, s); + if (s) + { + for (t = s; *t; t++) + { + if (soap_coblank((soap_wchar)*t)) + { + wchar_t *r; + *t = L' '; + for (r = t + 1; *r && soap_coblank((soap_wchar)*r); r++) + continue; + if (r > t + 1) + (void)soap_memmove(t + 1, sizeof(wchar_t) * (n - (t-s)), r, sizeof(wchar_t) * (n - (r-s) + 1)); + } + } + t--; + if (t >= s && *t == 32) + *t = L'\0'; + } + } + return s; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_LEAN +SOAP_FMAC1 +const char* +SOAP_FMAC2 +soap_wchar2s(struct soap *soap, const wchar_t *s) +{ + soap_wchar c; + char *r, *t; + const wchar_t *q = s; + size_t n = 0; + if (!s) + return NULL; + while ((c = *q++)) + { + if (c > 0 && c < 0x80) + n++; + else +#ifdef WITH_REPLACE_ILLEGAL_UTF8 + n += 4; +#else + n += 6; +#endif + } + r = t = (char*)soap_malloc(soap, n + 1); + if (r) + { + /* Convert wchar to UTF8 (chars above U+10FFFF are silently converted, but should not be used) */ + while ((c = *s++)) + { + if (c > 0 && c < 0x80) + { + *t++ = (char)c; + } + else + { + /* check for UTF16 encoding when wchar_t is too small to hold UCS */ + if (sizeof(wchar_t) < 4 && (c & 0xFC00) == 0xD800) + { + soap_wchar d = *s; + if ((d & 0xFC00) == 0xDC00) + { + c = ((c - 0xD800) << 10) + (d - 0xDC00) + 0x10000; + s++; + } +#ifdef WITH_REPLACE_ILLEGAL_UTF8 + else + { + c = SOAP_UNKNOWN_UNICODE_CHAR; /* Malformed UTF-16 */ + } +#endif + } + if (c < 0x0800) + { + *t++ = (char)(0xC0 | ((c >> 6) & 0x1F)); + } + else + { +#ifdef WITH_REPLACE_ILLEGAL_UTF8 + if (!((c >= 0x80 && c <= 0xD7FF) || (c >= 0xE000 && c <= 0xFFFD) || (c >= 0x10000 && c <= 0x10FFFF))) + c = SOAP_UNKNOWN_UNICODE_CHAR; +#endif + if (c < 0x010000) + { + *t++ = (char)(0xE0 | ((c >> 12) & 0x0F)); + } + else + { + if (c < 0x200000) + { + *t++ = (char)(0xF0 | ((c >> 18) & 0x07)); + } + else + { + if (c < 0x04000000) + { + *t++ = (char)(0xF8 | ((c >> 24) & 0x03)); + } + else + { + *t++ = (char)(0xFC | ((c >> 30) & 0x01)); + *t++ = (char)(0x80 | ((c >> 24) & 0x3F)); + } + *t++ = (char)(0x80 | ((c >> 18) & 0x3F)); + } + *t++ = (char)(0x80 | ((c >> 12) & 0x3F)); + } + *t++ = (char)(0x80 | ((c >> 6) & 0x3F)); + } + *t++ = (char)(0x80 | (c & 0x3F)); + } + } + *t = '\0'; + } + return r; +} +#endif + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_outstring(struct soap *soap, const char *tag, int id, char *const*p, const char *type, int n) +{ + id = soap_element_id(soap, tag, id, *p, NULL, 0, type, n, NULL); + if (id < 0) + return soap->error; + if (!**p) + { + if ((soap->mode & SOAP_C_NILSTRING)) + return soap_element_null(soap, tag, id, type); + return soap_element_empty(soap, tag, id, type); + } + if (soap_element_begin_out(soap, tag, id, type) + || soap_string_out(soap, *p, 0) + || soap_element_end_out(soap, tag)) + return soap->error; + return SOAP_OK; +} + +/******************************************************************************/ + +SOAP_FMAC1 +char ** +SOAP_FMAC2 +soap_instring(struct soap *soap, const char *tag, char **p, const char *type, int t, int flag, long minlen, long maxlen, const char *pattern) +{ + (void)type; + if (soap_element_begin_in(soap, tag, 1, NULL)) + { + if (!tag || *tag != '-' || soap->error != SOAP_NO_TAG) + return NULL; + soap->error = SOAP_OK; + } + if (!p) + { + p = (char**)soap_malloc(soap, sizeof(char*)); + if (!p) + return NULL; + } + if (soap->null) + { + *p = NULL; + } + else if (soap->body) + { + *p = soap_string_in(soap, flag, minlen, maxlen, pattern); + if (!*p || !(char*)soap_id_enter(soap, soap->id, *p, t, sizeof(char*), NULL, NULL, NULL, NULL)) + return NULL; + if (!**p && tag && *tag == '-') + { + soap->error = SOAP_NO_TAG; + return NULL; + } + } + else if (tag && *tag == '-') + { + soap->error = SOAP_NO_TAG; + return NULL; + } + else if (*soap->href != '#') + { + if (minlen > 0) + { + soap->error = SOAP_LENGTH; + return NULL; + } + *p = soap_strdup(soap, SOAP_STR_EOS); + if (!*p) + return NULL; + } + if (*soap->href == '#') + p = (char**)soap_id_lookup(soap, soap->href, (void**)p, t, sizeof(char**), 0, NULL); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + return p; +} + +/******************************************************************************/ + +#ifndef WITH_LEANER +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_outwstring(struct soap *soap, const char *tag, int id, wchar_t *const*p, const char *type, int n) +{ + id = soap_element_id(soap, tag, id, *p, NULL, 0, type, n, NULL); + if (id < 0) + return soap->error; + if (!**p) + { + if ((soap->mode & SOAP_C_NILSTRING)) + return soap_element_null(soap, tag, id, type); + return soap_element_empty(soap, tag, id, type); + } + if (soap_element_begin_out(soap, tag, id, type) + || soap_wstring_out(soap, *p, 0) + || soap_element_end_out(soap, tag)) + return soap->error; + return SOAP_OK; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_LEANER +SOAP_FMAC1 +wchar_t ** +SOAP_FMAC2 +soap_inwstring(struct soap *soap, const char *tag, wchar_t **p, const char *type, int t, int flag, long minlen, long maxlen, const char *pattern) +{ + (void)type; + if (soap_element_begin_in(soap, tag, 1, NULL)) + { + if (!tag || *tag != '-' || soap->error != SOAP_NO_TAG) + return NULL; + soap->error = SOAP_OK; + } + if (!p) + { + p = (wchar_t**)soap_malloc(soap, sizeof(wchar_t*)); + if (!p) + return NULL; + } + if (soap->null) + { + *p = NULL; + } + else if (soap->body) + { + *p = soap_wstring_in(soap, flag, minlen, maxlen, pattern); + if (!*p || !(wchar_t*)soap_id_enter(soap, soap->id, *p, t, sizeof(wchar_t*), NULL, NULL, NULL, NULL)) + return NULL; + if (!**p && tag && *tag == '-') + { + soap->error = SOAP_NO_TAG; + return NULL; + } + } + else if (tag && *tag == '-') + { + soap->error = SOAP_NO_TAG; + return NULL; + } + else if (*soap->href != '#') + { + if (minlen > 0) + { + soap->error = SOAP_LENGTH; + return NULL; + } + *p = soap_wstrdup(soap, L""); + } + if (*soap->href == '#') + p = (wchar_t**)soap_id_lookup(soap, soap->href, (void**)p, t, sizeof(wchar_t**), 0, NULL); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + return p; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_LEAN +#ifdef UNDER_CE +/* WinCE mktime (based on the mingw-runtime, public domain) */ +#define __FILETIME_to_ll(f) ((long long)(f).dwHighDateTime << 32 | (long long)(f).dwLowDateTime) +static time_t +mktime(struct tm *pt) +{ + SYSTEMTIME s, s1, s2; + FILETIME f, f1, f2; + long long diff; + GetSystemTime(&s1); + GetLocalTime(&s2); + SystemTimeToFileTime(&s1, &f1); + SystemTimeToFileTime(&s2, &f2); + diff = (__FILETIME_to_ll(f2) - __FILETIME_to_ll(f1)) / 10000000LL; + s.wYear = pt->tm_year + 1900; + s.wMonth = pt->tm_mon + 1; + s.wDayOfWeek = pt->tm_wday; + s.wDay = pt->tm_mday; + s.wHour = pt->tm_hour; + s.wMinute = pt->tm_min; + s.wSecond = pt->tm_sec; + s.wMilliseconds = 0; + SystemTimeToFileTime(&s, &f); + return (time_t)((__FILETIME_to_ll(f) - 116444736000000000LL) / 10000000LL) - (time_t)diff; +} +#endif +#endif + +/******************************************************************************/ + +#ifndef WITH_LEAN +#ifdef UNDER_CE +/* WinCE gmtime_r (based on the mingw-runtime, public domain) */ +#define HAVE_GMTIME_R +static struct tm* +gmtime_r(const time_t *t, struct tm *pt) +{ + FILETIME f, f1, f2; + SYSTEMTIME s, s1 = {0}; + long long time = (long long)(*t) * 10000000LL + 116444736000000000LL; + f.dwHighDateTime = (DWORD)((time >> 32) & 0x00000000FFFFFFFF); + f.dwLowDateTime = (DWORD)(time & 0x00000000FFFFFFFF); + FileTimeToSystemTime(&f, &s); + pt->tm_year = s.wYear - 1900; + pt->tm_mon = s.wMonth - 1; + pt->tm_wday = s.wDayOfWeek; + pt->tm_mday = s.wDay; + s1.wYear = s.wYear; + s1.wMonth = 1; + s1.wDayOfWeek = 1; + s1.wDay = 1; + SystemTimeToFileTime(&s1, &f1); + SystemTimeToFileTime(&s, &f2); + pt->tm_yday = (((__FILETIME_to_ll(f2) - __FILETIME_to_ll(f1)) / 10000000LL) / (60 * 60 * 24)); + pt->tm_hour = s.wHour; + pt->tm_min = s.wMinute; + pt->tm_sec = s.wSecond; + pt->tm_isdst = 0; + return pt; +} +#endif +#endif + +/******************************************************************************/ + +#ifndef WITH_LEAN +#ifdef UNDER_CE +/* WinCE very simple strftime for format "%Y-%m-%dT%H:%M:%SZ", note: %F and %T not supported by MS */ +static size_t +strftime(char *buf, size_t len, const char *format, const struct tm *pT) +{ + (void)len; (void)format; +#ifndef WITH_NOZONE + (SOAP_SNPRINTF(buf, len, 20), "%04d-%02d-%02dT%02d:%02d:%02dZ", pT->tm_year + 1900, pT->tm_mon + 1, pT->tm_mday, pT->tm_hour, pT->tm_min, pT->tm_sec); +#else + (SOAP_SNPRINTF(buf, len, 20), "%04d-%02d-%02dT%02d:%02d:%02d", pT->tm_year + 1900, pT->tm_mon + 1, pT->tm_mday, pT->tm_hour, pT->tm_min, pT->tm_sec); +#endif + return len; +} +#endif +#endif + +/******************************************************************************/ + +#if !defined(WITH_LEAN) || defined(WITH_COOKIES) +SOAP_FMAC1 +time_t +SOAP_FMAC2 +soap_timegm(struct tm *T) +{ +#if defined(HAVE_TIMEGM) + return timegm(T); +#else + time_t t, g, z; + struct tm tm; +#ifndef HAVE_GMTIME_R + struct tm *tp; +#endif + t = mktime(T); + if (t == (time_t)-1) + return (time_t)-1; +#ifdef HAVE_GMTIME_R + if (gmtime_r(&t, &tm) == SOAP_FUNC_R_ERR) + return (time_t)-1; +#else + tp = gmtime(&t); + if (!tp) + return (time_t)-1; + tm = *tp; +#endif + tm.tm_isdst = 0; + g = mktime(&tm); + if (g == (time_t)-1) + return (time_t)-1; + z = g - t; + return t - z; +#endif +} +#endif + +/******************************************************************************/ + +#ifndef WITH_LEAN +SOAP_FMAC1 +const char* +SOAP_FMAC2 +soap_dateTime2s(struct soap *soap, time_t n) +{ + struct tm T, *pT = &T; + size_t l = 0; +#if defined(HAVE_GMTIME_R) && !defined(WITH_NOZONE) + if (gmtime_r(&n, pT) != SOAP_FUNC_R_ERR) + l = strftime(soap->tmpbuf, sizeof(soap->tmpbuf), "%Y-%m-%dT%H:%M:%SZ", pT); +#elif defined(HAVE_GMTIME) && !defined(WITH_NOZONE) + pT = gmtime(&n); + if (pT) + l = strftime(soap->tmpbuf, sizeof(soap->tmpbuf), "%Y-%m-%dT%H:%M:%SZ", pT); +#elif (defined(HAVE_TM_GMTOFF) || defined(HAVE_STRUCT_TM_TM_GMTOFF) || defined(HAVE_STRUCT_TM___TM_GMTOFF)) && !defined(WITH_NOZONE) +#if defined(HAVE_LOCALTIME_R) + if (localtime_r(&n, pT) != SOAP_FUNC_R_ERR) + { + l = strftime(soap->tmpbuf, sizeof(soap->tmpbuf), "%Y-%m-%dT%H:%M:%S%z", pT); + if (l) + { + (void)soap_memmove(soap->tmpbuf + 23, sizeof(soap->tmpbuf) - 23, soap->tmpbuf + 22, 3); /* 2000-03-01T02:00:00+0300 */ + soap->tmpbuf[22] = ':'; /* 2000-03-01T02:00:00+03:00 */ + } + } +#else + pT = localtime(&n); + if (pT) + { + l = strftime(soap->tmpbuf, sizeof(soap->tmpbuf), "%Y-%m-%dT%H:%M:%S%z", pT); + if (l) + { + (void)soap_memmove(soap->tmpbuf + 23, sizeof(soap->tmpbuf) - 23, soap->tmpbuf + 22, 3); /* 2000-03-01T02:00:00+0300 */ + soap->tmpbuf[22] = ':'; /* 2000-03-01T02:00:00+03:00 */ + } + } +#endif +#elif defined(HAVE_GETTIMEOFDAY) && !defined(WITH_NOZONE) +#if defined(HAVE_LOCALTIME_R) + if (localtime_r(&n, pT) != SOAP_FUNC_R_ERR) + { + struct timeval tv; + struct timezone tz; + memset((void*)&tz, 0, sizeof(tz)); + gettimeofday(&tv, &tz); + l = strftime(soap->tmpbuf, sizeof(soap->tmpbuf), "%Y-%m-%dT%H:%M:%S", pT); + if (l) + (SOAP_SNPRINTF(soap->tmpbuf + l, sizeof(soap->tmpbuf) - l, 7), "%+03d:%02d", -tz.tz_minuteswest/60+(pT->tm_isdst!=0), abs(tz.tz_minuteswest)%60); + } +#else + pT = localtime(&n); + if (pT) + { + struct timeval tv; + struct timezone tz; + memset((void*)&tz, 0, sizeof(tz)); + gettimeofday(&tv, &tz); + l = strftime(soap->tmpbuf, sizeof(soap->tmpbuf), "%Y-%m-%dT%H:%M:%S", pT); + if (l) + (SOAP_SNPRINTF(soap->tmpbuf + l, sizeof(soap->tmpbuf) - l, 7), "%+03d:%02d", -tz.tz_minuteswest/60+(pT->tm_isdst!=0), abs(tz.tz_minuteswest)%60); + } +#endif +#elif defined(HAVE_FTIME) && !defined(WITH_NOZONE) +#if defined(HAVE_LOCALTIME_R) + if (localtime_r(&n, pT) != SOAP_FUNC_R_ERR) + { + struct timeb t; + memset((void*)&t, 0, sizeof(t)); +#ifdef __BORLANDC__ + ::ftime(&t); +#else + ftime(&t); +#endif + l = strftime(soap->tmpbuf, sizeof(soap->tmpbuf), "%Y-%m-%dT%H:%M:%S", pT); + if (l) + (SOAP_SNPRINTF(soap->tmpbuf + l, sizeof(soap->tmpbuf) - l, 7), "%+03d:%02d", -t.timezone/60+(pT->tm_isdst!=0), abs(t.timezone)%60); + } +#else + pT = localtime(&n); + if (pT) + { + struct timeb t; + memset((void*)&t, 0, sizeof(t)); +#ifdef __BORLANDC__ + ::ftime(&t); +#else + ftime(&t); +#endif + l = strftime(soap->tmpbuf, sizeof(soap->tmpbuf), "%Y-%m-%dT%H:%M:%S", pT); + if (l) + (SOAP_SNPRINTF(soap->tmpbuf + l, sizeof(soap->tmpbuf) - l, 7), "%+03d:%02d", -t.timezone/60+(pT->tm_isdst!=0), abs(t.timezone)%60); + } +#endif +#elif defined(HAVE_LOCALTIME_R) + if (localtime_r(&n, pT) != SOAP_FUNC_R_ERR) + l = strftime(soap->tmpbuf, sizeof(soap->tmpbuf), "%Y-%m-%dT%H:%M:%S", pT); +#else + pT = localtime(&n); + if (pT) + l = strftime(soap->tmpbuf, sizeof(soap->tmpbuf), "%Y-%m-%dT%H:%M:%S", pT); +#endif + if (!l) + soap_strcpy(soap->tmpbuf, sizeof(soap->tmpbuf), "1969-12-31T23:59:59Z"); + return soap->tmpbuf; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_LEAN +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_outdateTime(struct soap *soap, const char *tag, int id, const time_t *p, const char *type, int n) +{ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, p, n), type) + || soap_string_out(soap, soap_dateTime2s(soap, *p), 0)) + return soap->error; + return soap_element_end_out(soap, tag); +} +#endif + +/******************************************************************************/ + +#ifndef WITH_LEAN +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_s2dateTime(struct soap *soap, const char *s, time_t *p) +{ + *p = 0; + if (s) + { + unsigned long d; + struct tm T; + char *t; + if (!*s) + return soap->error = SOAP_EMPTY; + memset((void*)&T, 0, sizeof(T)); + d = soap_strtoul(s, &t, 10); + if (*t == '-') + { + /* YYYY-MM-DD */ + T.tm_year = (int)d; + T.tm_mon = (int)soap_strtoul(t + 1, &t, 10); + T.tm_mday = (int)soap_strtoul(t + 1, &t, 10); + } + else if (!(soap->mode & SOAP_XML_STRICT)) + { + /* YYYYMMDD */ + T.tm_year = (int)(d / 10000); + T.tm_mon = (int)(d / 100 % 100); + T.tm_mday = (int)(d % 100); + } + else + { + return soap->error = SOAP_TYPE; + } + if (*t == 'T' || ((*t == 't' || *t == ' ') && !(soap->mode & SOAP_XML_STRICT))) + { + d = soap_strtoul(t + 1, &t, 10); + if (*t == ':') + { + /* Thh:mm:ss */ + T.tm_hour = (int)d; + T.tm_min = (int)soap_strtoul(t + 1, &t, 10); + T.tm_sec = (int)soap_strtoul(t + 1, &t, 10); + } + else if (!(soap->mode & SOAP_XML_STRICT)) + { + /* Thhmmss */ + T.tm_hour = (int)(d / 10000); + T.tm_min = (int)(d / 100 % 100); + T.tm_sec = (int)(d % 100); + } + else + { + return soap->error = SOAP_TYPE; + } + } + if (T.tm_year == 1) + T.tm_year = 70; + else + T.tm_year -= 1900; + T.tm_mon--; + if (*t == '.') + { + for (t++; *t; t++) + if (*t < '0' || *t > '9') + break; + } + if (*t == ' ' && !(soap->mode & SOAP_XML_STRICT)) + t++; + if (*t) + { +#ifndef WITH_NOZONE + if (*t == '+' || *t == '-') + { + int h, m; + m = (int)soap_strtol(t, &t, 10); + if (*t == ':') + { + /* +hh:mm */ + h = m; + m = (int)soap_strtol(t + 1, &t, 10); + if (h < 0) + m = -m; + } + else if (!(soap->mode & SOAP_XML_STRICT)) + { + /* +hhmm */ + h = m / 100; + m = m % 100; + } + else + { + /* +hh */ + h = m; + m = 0; + } + if (*t) + return soap->error = SOAP_TYPE; + T.tm_min -= m; + T.tm_hour -= h; + /* put hour and min in range */ + T.tm_hour += T.tm_min / 60; + T.tm_min %= 60; + if (T.tm_min < 0) + { + T.tm_min += 60; + T.tm_hour--; + } + T.tm_mday += T.tm_hour / 24; + T.tm_hour %= 24; + if (T.tm_hour < 0) + { + T.tm_hour += 24; + T.tm_mday--; + } + /* note: day of the month may be out of range, timegm() handles it */ + } + else if (*t != 'Z') + { + return soap->error = SOAP_TYPE; + } +#endif + *p = soap_timegm(&T); + } + else /* no UTC or timezone, so assume we got a localtime */ + { + T.tm_isdst = -1; + *p = mktime(&T); + } + } + return soap->error; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_LEAN +SOAP_FMAC1 +time_t * +SOAP_FMAC2 +soap_indateTime(struct soap *soap, const char *tag, time_t *p, const char *type, int t) +{ + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; + if (*soap->type + && soap_match_tag(soap, soap->type, type) + && soap_match_tag(soap, soap->type, ":dateTime")) + { + soap->error = SOAP_TYPE; + soap_revert(soap); + return NULL; + } + p = (time_t*)soap_id_enter(soap, soap->id, p, t, sizeof(time_t), NULL, NULL, NULL, NULL); + if (!p) + return NULL; + if (*soap->href != '#') + { + int err = soap_s2dateTime(soap, soap_value(soap), p); + if ((soap->body && soap_element_end_in(soap, tag)) || err) + return NULL; + } + else + { + p = (time_t*)soap_id_forward(soap, soap->href, p, 0, t, t, sizeof(time_t), 0, NULL, NULL); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return p; +} +#endif + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_outliteral(struct soap *soap, const char *tag, char *const*p, const char *type) +{ + if (tag && *tag != '-') + if (soap_element_begin_out(soap, tag, 0, type)) + return soap->error; + if (p && *p) + if (soap_send(soap, *p)) /* send as-is */ + return soap->error; + if (tag && *tag != '-') + return soap_element_end_out(soap, tag); + return SOAP_OK; +} + +/******************************************************************************/ + +SOAP_FMAC1 +char ** +SOAP_FMAC2 +soap_inliteral(struct soap *soap, const char *tag, char **p) +{ + if (soap_element_begin_in(soap, tag, 1, NULL)) + { + if (soap->error != SOAP_NO_TAG || soap_peek(soap) == SOAP_TT) + return NULL; + soap->error = SOAP_OK; + } + if (!p) + { + p = (char**)soap_malloc(soap, sizeof(char*)); + if (!p) + return NULL; + } + if (soap->body || (tag && *tag == '-')) + { + if (tag && *tag != '-') + *p = soap_string_in(soap, 0, -1, -1, NULL); + else + *p = soap_string_in(soap, -1, -1, -1, NULL); + if (!*p) + return NULL; + if (!**p && tag && *tag == '-') + { + soap->error = SOAP_NO_TAG; + return NULL; + } + } + else if (soap->null) + { + *p = NULL; + } + else + { + *p = soap_strdup(soap, SOAP_STR_EOS); + } + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + return p; +} + +/******************************************************************************/ + +#ifndef WITH_LEANER +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_outwliteral(struct soap *soap, const char *tag, wchar_t *const*p, const char *type) +{ + if (tag && *tag != '-') + if (soap_element_begin_out(soap, tag, 0, type)) + return soap->error; + if (p) + { + wchar_t c; + const wchar_t *s = *p; + while ((c = *s++)) + { + if (soap_pututf8(soap, (unsigned long)c)) /* send as-is in UTF8 */ + return soap->error; + } + } + if (tag && *tag != '-') + return soap_element_end_out(soap, tag); + return SOAP_OK; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_LEANER +SOAP_FMAC1 +wchar_t ** +SOAP_FMAC2 +soap_inwliteral(struct soap *soap, const char *tag, wchar_t **p) +{ + if (soap_element_begin_in(soap, tag, 1, NULL)) + { + if (soap->error != SOAP_NO_TAG || soap_peek(soap) == SOAP_TT) + return NULL; + soap->error = SOAP_OK; + } + if (!p) + { + p = (wchar_t**)soap_malloc(soap, sizeof(wchar_t*)); + if (!p) + return NULL; + } + if (soap->body) + { + if (tag && *tag != '-') + *p = soap_wstring_in(soap, 0, -1, -1, NULL); + else + *p = soap_wstring_in(soap, -1, -1, -1, NULL); + if (!*p) + return NULL; + if (!**p && tag && *tag == '-') + { + soap->error = SOAP_NO_TAG; + return NULL; + } + } + else if (tag && *tag == '-') + { + soap->error = SOAP_NO_TAG; + return NULL; + } + else if (soap->null) + { + *p = NULL; + } + else + { + *p = soap_wstrdup(soap, L""); + } + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + return p; +} +#endif + +/******************************************************************************/ + +SOAP_FMAC1 +const char * +SOAP_FMAC2 +soap_value(struct soap *soap) +{ + size_t i; + soap_wchar c = 0; + char *s = soap->tmpbuf; + if (!soap->body) + return SOAP_STR_EOS; + do + { + c = soap_get(soap); + } while (soap_coblank(c)); + for (i = 0; i < sizeof(soap->tmpbuf) - 1; i++) + { + if (c == SOAP_TT || c == SOAP_LT || (int)c == EOF) + break; + *s++ = (char)c; + c = soap_get(soap); + } + for (s--; i > 0; i--, s--) + { + if (!soap_coblank((soap_wchar)*s)) + break; + } + s[1] = '\0'; + soap->tmpbuf[sizeof(soap->tmpbuf) - 1] = '\0'; /* appease */ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Element content value='%s'\n", soap->tmpbuf)); + if (c == SOAP_TT || c == SOAP_LT || (int)c == EOF) + { + soap_unget(soap, c); + } + else + { + soap->error = SOAP_LENGTH; + return NULL; + } +#ifdef WITH_DOM + if ((soap->mode & SOAP_XML_DOM) && soap->dom) + { + soap->dom->text = soap_strdup(soap, soap->tmpbuf); + if (!soap->dom->text) + return NULL; + } +#endif + return soap->tmpbuf; /* return non-null pointer */ +} + +/******************************************************************************/ + +#if !defined(WITH_LEANER) || !defined(WITH_NOHTTP) +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_getline(struct soap *soap, char *buf, int len) +{ + char *s = buf; + int i = len; + soap_wchar c = 0; + for (;;) + { + while (i > 1) + { + c = soap_getchar(soap); + if (c == '\r' || c == '\n') + break; + if ((int)c == EOF) + return soap->error = SOAP_CHK_EOF; + *s++ = (char)c; + i--; + } + *s = '\0'; + if (c != '\n') + c = soap_getchar(soap); /* got \r or something else, now get \n */ + if (c == '\n') + { + if (i == len) /* empty line: end of HTTP/MIME header */ + break; + c = soap_get0(soap); + if (c != ' ' && c != '\t') /* HTTP line continuation? */ + break; + } + else if ((int)c == EOF) + { + return soap->error = SOAP_CHK_EOF; + } + else if (i <= 1) + { + return soap->error = SOAP_HDR; + } + } + return SOAP_OK; +} +#endif + +/******************************************************************************/ + +static ULONG64 +soap_count_attachments(struct soap *soap) +{ +#ifndef WITH_LEANER + struct soap_multipart *content; + ULONG64 count = soap->count; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Calculating the message size with attachments, current count=" SOAP_ULONG_FORMAT "\n", count)); + if ((soap->mode & SOAP_ENC_DIME) && !(soap->mode & SOAP_ENC_MTOM)) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Calculating the size of DIME attachments\n")); + for (content = soap->dime.first; content; content = content->next) + { + count += 12 + ((content->size+3)&(~3)); + if (content->id) + count += ((strlen(content->id)+3)&(~3)); + if (content->type) + count += ((strlen(content->type)+3)&(~3)); + if (content->options) + count += ((((unsigned char)content->options[2] << 8) | ((unsigned char)content->options[3]))+7)&(~3); + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Size of DIME attachment content is %lu bytes\n", (unsigned long)content->size)); + } + } + if ((soap->mode & SOAP_ENC_MIME) && soap->mime.boundary) + { + size_t n = strlen(soap->mime.boundary); + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Calculating the size of MIME attachments\n")); + for (content = soap->mime.first; content; content = content->next) + { + const char *s; + /* count \r\n--boundary\r\n */ + count += 6 + n; + /* count Content-Type: ...\r\n */ + if (content->type) + count += 16 + strlen(content->type); + /* count Content-Transfer-Encoding: ...\r\n */ + s = soap_code_str(mime_codes, content->encoding); + if (s) + count += 29 + strlen(s); + /* count Content-ID: ...\r\n */ + if (content->id) + count += 14 + strlen(content->id); + /* count Content-Location: ...\r\n */ + if (content->location) + count += 20 + strlen(content->location); + /* count Content-Description: ...\r\n */ + if (content->description) + count += 23 + strlen(content->description); + /* count \r\n...content */ + count += 2 + content->size; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Size of MIME attachment content is %lu bytes\n", (unsigned long)content->size)); + } + /* count \r\n--boundary-- */ + count += 6 + n; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "New count=" SOAP_ULONG_FORMAT "\n", count)); + return count; +#else + return soap->count; +#endif +} + +/******************************************************************************/ + +#ifndef WITH_LEANER +static int +soap_putdimefield(struct soap *soap, const char *s, size_t n) +{ + if (soap_send_raw(soap, s, n)) + return soap->error; + return soap_send_raw(soap, SOAP_STR_PADDING, -(long)n&3); +} +#endif + +/******************************************************************************/ + +#ifndef WITH_LEANER +SOAP_FMAC1 +char * +SOAP_FMAC2 +soap_dime_option(struct soap *soap, unsigned short optype, const char *option) +{ + size_t n; + char *s = NULL; + if (option) + { + n = strlen(option); + s = (char*)soap_malloc(soap, n + 5); + if (s) + { + s[0] = (char)(optype >> 8); + s[1] = (char)(optype & 0xFF); + s[2] = (char)(n >> 8); + s[3] = (char)(n & 0xFF); + soap_strcpy(s + 4, n + 1, option); + } + } + return s; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_LEANER +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_putdimehdr(struct soap *soap) +{ + unsigned char tmp[12]; + size_t optlen = 0, idlen = 0, typelen = 0; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Put DIME header id='%s'\n", soap->dime.id ? soap->dime.id : SOAP_STR_EOS)); + if (soap->dime.options) + optlen = (((unsigned char)soap->dime.options[2] << 8) | ((unsigned char)soap->dime.options[3])) + 4; + if (soap->dime.id) + { + idlen = strlen(soap->dime.id); + if (idlen > 0x0000FFFF) + idlen = 0x0000FFFF; + } + if (soap->dime.type) + { + typelen = strlen(soap->dime.type); + if (typelen > 0x0000FFFF) + typelen = 0x0000FFFF; + } + tmp[0] = SOAP_DIME_VERSION | (soap->dime.flags & 0x7); + tmp[1] = soap->dime.flags & 0xF0; + tmp[2] = (char)(optlen >> 8); + tmp[3] = (char)(optlen & 0xFF); + tmp[4] = (char)(idlen >> 8); + tmp[5] = (char)(idlen & 0xFF); + tmp[6] = (char)(typelen >> 8); + tmp[7] = (char)(typelen & 0xFF); + tmp[8] = (char)(soap->dime.size >> 24); + tmp[9] = (char)((soap->dime.size >> 16) & 0xFF); + tmp[10] = (char)((soap->dime.size >> 8) & 0xFF); + tmp[11] = (char)(soap->dime.size & 0xFF); + if (soap_send_raw(soap, (char*)tmp, 12) + || soap_putdimefield(soap, soap->dime.options, optlen) + || soap_putdimefield(soap, soap->dime.id, idlen) + || soap_putdimefield(soap, soap->dime.type, typelen)) + return soap->error; + return SOAP_OK; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_LEANER +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_putdime(struct soap *soap) +{ + struct soap_multipart *content; + if (!(soap->mode & SOAP_ENC_DIME)) + return SOAP_OK; + for (content = soap->dime.first; content; content = content->next) + { + void *handle; + soap->dime.size = content->size; + soap->dime.id = content->id; + soap->dime.type = content->type; + soap->dime.options = content->options; + soap->dime.flags = SOAP_DIME_VERSION | SOAP_DIME_MEDIA; + if (soap->fdimereadopen && ((handle = soap->fdimereadopen(soap, (void*)content->ptr, content->id, content->type, content->options)) != NULL || soap->error)) + { + size_t size = content->size; + if (!handle) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "fdimereadopen failed\n")); + return soap->error; + } + if (!size && ((soap->mode & SOAP_ENC_PLAIN) || (soap->mode & SOAP_IO) == SOAP_IO_CHUNK || (soap->mode & SOAP_IO) == SOAP_IO_STORE)) + { + size_t chunksize = sizeof(soap->tmpbuf); + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Chunked streaming DIME\n")); + do + { + size = soap->fdimeread(soap, handle, soap->tmpbuf, chunksize); + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "fdimeread returned %lu bytes\n", (unsigned long)size)); + if (size < chunksize) + { + soap->dime.flags &= ~SOAP_DIME_CF; + if (!content->next) + soap->dime.flags |= SOAP_DIME_ME; + } + else + { + soap->dime.flags |= SOAP_DIME_CF; + } + soap->dime.size = size; + if (soap_putdimehdr(soap) + || soap_putdimefield(soap, soap->tmpbuf, size)) + break; + if (soap->dime.id) + { + soap->dime.flags &= ~(SOAP_DIME_MB | SOAP_DIME_MEDIA); + soap->dime.id = NULL; + soap->dime.type = NULL; + soap->dime.options = NULL; + } + } while (size >= chunksize); + } + else + { + if (!content->next) + soap->dime.flags |= SOAP_DIME_ME; + if (soap_putdimehdr(soap)) + return soap->error; + do + { + size_t bufsize; + if (size < sizeof(soap->tmpbuf)) + bufsize = size; + else + bufsize = sizeof(soap->tmpbuf); + bufsize = soap->fdimeread(soap, handle, soap->tmpbuf, bufsize); + if (!bufsize) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "fdimeread failed: insufficient data (%lu bytes remaining from %lu bytes)\n", (unsigned long)size, (unsigned long)content->size)); + soap->error = SOAP_CHK_EOF; + break; + } + if (soap_send_raw(soap, soap->tmpbuf, bufsize)) + break; + size -= bufsize; + } while (size); + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "fdimereadclose\n")); + if (soap_send_raw(soap, SOAP_STR_PADDING, -(long)soap->dime.size&3)) + return soap->error; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "fdimereadclose\n")); + if (soap->fdimereadclose) + soap->fdimereadclose(soap, handle); + } + else + { + if (!content->next) + soap->dime.flags |= SOAP_DIME_ME; + if (soap_putdimehdr(soap) + || soap_putdimefield(soap, (char*)content->ptr, content->size)) + return soap->error; + } + } + return SOAP_OK; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_LEANER +static char * +soap_getdimefield(struct soap *soap, size_t n) +{ + char *p = NULL; + if (n > 0) + { + p = (char*)soap_malloc(soap, n + 1 > n ? n + 1 : n); + if (p) + { + char *s = p; + size_t i; + for (i = n; i > 0; i--) + { + soap_wchar c = soap_get1(soap); + if ((int)c == EOF) + { + soap->error = SOAP_CHK_EOF; + return NULL; + } + *s++ = (char)c; + } + if (n + 1 > n) + *s = '\0'; /* force NUL terminated */ + soap->error = soap_move(soap, (size_t)(-(long)n&3)); + if (soap->error) + return NULL; + } + else + { + soap->error = SOAP_EOM; + } + } + return p; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_LEANER +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_getdimehdr(struct soap *soap) +{ + soap_wchar c; + char *s; + int i; + unsigned char tmp[12]; + size_t optlen, idlen, typelen; + if (!(soap->mode & SOAP_ENC_DIME)) + return soap->error = SOAP_DIME_END; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Get DIME header\n")); + s = (char*)tmp; + for (i = 12; i > 0; i--) + { + c = soap_getchar(soap); + if ((int)c == EOF) + return soap->error = SOAP_CHK_EOF; + *s++ = (char)c; + } + if ((tmp[0] & 0xF8) != SOAP_DIME_VERSION) + return soap->error = SOAP_DIME_MISMATCH; + soap->dime.flags = (tmp[0] & 0x7) | (tmp[1] & 0xF0); + optlen = (tmp[2] << 8) | tmp[3]; + idlen = (tmp[4] << 8) | tmp[5]; + typelen = (tmp[6] << 8) | tmp[7]; + soap->dime.size = ((size_t)tmp[8] << 24) | ((size_t)tmp[9] << 16) | ((size_t)tmp[10] << 8) | ((size_t)tmp[11]); + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "DIME size=%lu flags=0x%X\n", (unsigned long)soap->dime.size, soap->dime.flags)); + soap->dime.options = soap_getdimefield(soap, optlen); + if (!soap->dime.options && soap->error) + return soap->error; + soap->dime.id = soap_getdimefield(soap, idlen); + if (!soap->dime.id && soap->error) + return soap->error; + soap->dime.type = soap_getdimefield(soap, typelen); + if (!soap->dime.type && soap->error) + return soap->error; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "DIME flags=%x id='%s', type='%s', options='%s'\n", soap->dime.flags, soap->dime.id ? soap->dime.id : SOAP_STR_EOS, soap->dime.type ? soap->dime.type : "", soap->dime.options ? soap->dime.options+4 : SOAP_STR_EOS)); + if ((soap->dime.flags & SOAP_DIME_ME)) + soap->mode &= ~SOAP_ENC_DIME; + return SOAP_OK; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_LEANER +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_getdime(struct soap *soap) +{ + if (soap->dime.buflen || soap->dime.chunksize) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Skip remainder of SOAP in DIME (%u bytes or %u bytes in chunk left)\n", (unsigned int)soap->dime.buflen, (unsigned int)soap->dime.chunksize)); + do + if (soap_get1(soap) == (int)EOF) + return soap->error = SOAP_CHK_EOF; + while (soap->dime.buflen || soap->dime.chunksize); + if (soap_move(soap, (size_t)(-(long)soap->dime.size&3))) + return soap->error = SOAP_CHK_EOF; + if (!(soap->mode & SOAP_ENC_DIME)) + return SOAP_OK; + } + else + { + if (soap_move(soap, (size_t)(((soap->dime.size+3)&(~3)) - soap_tell(soap)))) + return soap->error = SOAP_CHK_EOF; + } + for (;;) + { + struct soap_multipart *content; + if (soap_getdimehdr(soap)) + break; + if (soap->fdimewriteopen && ((soap->dime.ptr = (char*)soap->fdimewriteopen(soap, soap->dime.id, soap->dime.type, soap->dime.options)) != NULL || soap->error)) + { + const char *id, *type, *options; + size_t size, n; + if (!soap->dime.ptr) + return soap->error; + id = soap->dime.id; + type = soap->dime.type; + options = soap->dime.options; + for (;;) + { + size = soap->dime.size; + for (;;) + { + n = soap->buflen - soap->bufidx; + if (size < n) + n = size; + soap->error = soap->fdimewrite(soap, (void*)soap->dime.ptr, soap->buf + soap->bufidx, n); + if (soap->error) + break; + size -= n; + if (!size) + { + soap->bufidx += n; + break; + } + if (soap_recv(soap)) + { + soap->error = SOAP_EOF; + goto end; + } + } + if (soap_move(soap, (size_t)(-(long)soap->dime.size&3))) + { + soap->error = SOAP_EOF; + break; + } + if (!(soap->dime.flags & SOAP_DIME_CF)) + break; + if (soap_getdimehdr(soap)) + break; + } +end: + if (soap->fdimewriteclose) + soap->fdimewriteclose(soap, (void*)soap->dime.ptr); + soap->dime.size = 0; + soap->dime.id = id; + soap->dime.type = type; + soap->dime.options = options; + } + else if ((soap->dime.flags & SOAP_DIME_CF)) + { + const char *id, *type, *options; + id = soap->dime.id; + type = soap->dime.type; + options = soap->dime.options; + if (soap_alloc_block(soap) == NULL) + return soap->error = SOAP_EOM; + for (;;) + { + soap_wchar c; + size_t i; + char *s; + if (soap->dime.size > SOAP_MAXDIMESIZE) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "DIME size=%lu exceeds SOAP_MAXDIMESIZE=%lu\n", (unsigned long)soap->dime.size, (unsigned long)SOAP_MAXDIMESIZE)); + return soap->error = SOAP_DIME_ERROR; + } + s = (char*)soap_push_block(soap, NULL, soap->dime.size); + if (!s) + return soap->error = SOAP_EOM; + for (i = soap->dime.size; i > 0; i--) + { + c = soap_get1(soap); + if ((int)c == EOF) + return soap->error = SOAP_EOF; + *s++ = (char)c; + } + if (soap_move(soap, (size_t)(-(long)soap->dime.size&3))) + return soap->error = SOAP_EOF; + if (!(soap->dime.flags & SOAP_DIME_CF)) + break; + if (soap_getdimehdr(soap)) + return soap->error; + } + soap->dime.size = soap->blist->size; + if (soap->dime.size + 1 > soap->dime.size) + soap->blist->size++; /* allocate one more byte in blist for the terminating '\0' */ + soap->dime.ptr = (char*)soap_save_block(soap, NULL, NULL, 0); + if (!soap->dime.ptr) + return soap->error; + if (soap->dime.size + 1 > soap->dime.size) + soap->dime.ptr[soap->dime.size] = '\0'; /* make 0-terminated, just in case even though this is binary data */ + soap->dime.id = id; + soap->dime.type = type; + soap->dime.options = options; + } + else + { + soap->dime.ptr = soap_getdimefield(soap, soap->dime.size); + } + content = soap_alloc_multipart(soap, &soap->dime.first, &soap->dime.last, soap->dime.ptr, soap->dime.size); + if (!content) + return soap->error = SOAP_EOM; + content->id = soap->dime.id; + content->type = soap->dime.type; + content->options = soap->dime.options; + if (soap->error) + return soap->error; + soap_resolve_attachment(soap, content); + } + if (soap->error != SOAP_DIME_END) + return soap->error; + return soap->error = SOAP_OK; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_LEANER +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_getmimehdr(struct soap *soap) +{ + struct soap_multipart *content; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Get MIME header\n")); + do + { + if (soap_getline(soap, soap->msgbuf, sizeof(soap->msgbuf))) + return soap->error; + } while (!*soap->msgbuf); + if (soap->msgbuf[0] == '-' && soap->msgbuf[1] == '-') + { + char *s = soap->msgbuf + strlen(soap->msgbuf) - 1; + /* remove white space */ + while (soap_coblank((soap_wchar)*s)) + s--; + s[1] = '\0'; + if (soap->mime.boundary) + { + if (strcmp(soap->msgbuf + 2, soap->mime.boundary)) + return soap->error = SOAP_MIME_ERROR; + } + else + { + soap->mime.boundary = soap_strdup(soap, soap->msgbuf + 2); + if (!soap->mime.boundary) + return soap->error = SOAP_EOM; + } + if (soap_getline(soap, soap->msgbuf, sizeof(soap->msgbuf))) + return soap->error; + } + if (soap_set_mime_attachment(soap, NULL, 0, SOAP_MIME_NONE, NULL, NULL, NULL, NULL)) + return soap->error = SOAP_EOM; + content = soap->mime.last; + for (;;) + { + char *key = soap->msgbuf; + char *val; + if (!*key) + break; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "MIME header: %s\n", key)); + val = strchr(soap->msgbuf, ':'); + if (val) + { + *val = '\0'; + do + { + val++; + } while (*val && *val <= 32); + if (!soap_tag_cmp(key, "Content-ID")) + content->id = soap_strdup(soap, val); + else if (!soap_tag_cmp(key, "Content-Location")) + content->location = soap_strdup(soap, val); + else if (!content->id && !soap_tag_cmp(key, "Content-Disposition")) + content->id = soap_strdup(soap, soap_http_header_attribute(soap, val, "name")); + else if (!soap_tag_cmp(key, "Content-Type")) + content->type = soap_strdup(soap, val); + else if (!soap_tag_cmp(key, "Content-Description")) + content->description = soap_strdup(soap, val); + else if (!soap_tag_cmp(key, "Content-Transfer-Encoding")) + content->encoding = (enum soap_mime_encoding)soap_code_int(mime_codes, val, (LONG64)SOAP_MIME_NONE); + } + if (soap_getline(soap, key, sizeof(soap->msgbuf))) + return soap->error; + } + return SOAP_OK; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_LEANER +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_getmime(struct soap *soap) +{ + while (soap_recv_mime_attachment(soap, NULL)) + continue; + return soap->error; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_LEANER +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_post_check_mime_attachments(struct soap *soap) +{ + soap->imode |= SOAP_MIME_POSTCHECK; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_LEANER +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_check_mime_attachments(struct soap *soap) +{ + if ((soap->mode & SOAP_MIME_POSTCHECK)) + return soap_recv_mime_attachment(soap, NULL) != NULL; + return 0; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_LEANER +SOAP_FMAC1 +struct soap_multipart * +SOAP_FMAC2 +soap_recv_mime_attachment(struct soap *soap, void *handle) +{ + soap_wchar c = 0; + size_t i, m = 0; + char *s, *t = NULL; + struct soap_multipart *content; + short flag = 0; + if (!(soap->mode & SOAP_ENC_MIME)) + goto post_check_exit; + content = soap->mime.last; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Get MIME (%p)\n", (void*)content)); + if (!content) + { + if (soap_getmimehdr(soap)) + goto post_check_exit; + content = soap->mime.last; + } + else if (content != soap->mime.first) + { + if (soap->fmimewriteopen && ((content->ptr = (char*)soap->fmimewriteopen(soap, (void*)handle, content->id, content->type, content->description, content->encoding)) != NULL || soap->error)) + { + if (!content->ptr) + goto post_check_exit; + } + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Parsing MIME content id='%s' type='%s'\n", content->id ? content->id : SOAP_STR_EOS, content->type ? content->type : SOAP_STR_EOS)); + if (!content->ptr && soap_alloc_block(soap) == NULL) + { + soap->error = SOAP_EOM; + goto post_check_exit; + } + for (;;) + { + if (content->ptr) + { + s = soap->tmpbuf; + } + else + { + s = (char*)soap_push_block(soap, NULL, sizeof(soap->tmpbuf)); + if (!s) + { + soap->error = SOAP_EOM; + goto post_check_exit; + } + } + for (i = 0; i < sizeof(soap->tmpbuf); i++) + { + if (m > 0) + { + *s++ = *t++; + m--; + } + else + { + if (!flag) + { + c = soap_getchar(soap); + if ((int)c == EOF) + { + if (content->ptr && soap->fmimewriteclose) + soap->fmimewriteclose(soap, (void*)content->ptr); + soap->error = SOAP_CHK_EOF; + goto post_check_exit; + } + } + if (flag || c == '\r') + { + memset((void*)soap->msgbuf, 0, sizeof(soap->msgbuf)); + soap_strcpy(soap->msgbuf, sizeof(soap->msgbuf), "\n--"); + if (soap->mime.boundary) + { + if (soap_strncat(soap->msgbuf, sizeof(soap->msgbuf), soap->mime.boundary, sizeof(soap->msgbuf) - 4)) + { + soap->error = SOAP_MIME_ERROR; + goto post_check_exit; + } + } + t = soap->msgbuf; + do + { + c = soap_getchar(soap); + } while (c == *t++); + if ((int)c == EOF) + { + if (content->ptr && soap->fmimewriteclose) + soap->fmimewriteclose(soap, (void*)content->ptr); + soap->error = SOAP_CHK_EOF; + goto post_check_exit; + } + if (!*--t) + goto end; + *t = (char)c; + flag = (c == '\r'); + m = t - soap->msgbuf + 1 - flag; + t = soap->msgbuf; + c = '\r'; + } + *s++ = (char)c; + } + } + if (content->ptr && soap->fmimewrite) + { + soap->error = soap->fmimewrite(soap, (void*)content->ptr, soap->tmpbuf, i); + if (soap->error) + break; + } + } +end: + if (content->ptr) + { + if (!soap->error && soap->fmimewrite) + soap->error = soap->fmimewrite(soap, (void*)content->ptr, soap->tmpbuf, i); + if (soap->fmimewriteclose) + soap->fmimewriteclose(soap, (void*)content->ptr); + if (soap->error) + goto post_check_exit; + } + else + { + *s = '\0'; /* make 0-terminated, just in case even though this is binary data */ + content->size = soap_size_block(soap, NULL, i + 1) - 1; /* last block with '\0' */ + content->ptr = (char*)soap_save_block(soap, NULL, NULL, 0); + } + soap_resolve_attachment(soap, content); + if (c == '-' && soap_getchar(soap) == '-') + { + soap->mode &= ~SOAP_ENC_MIME; + if ((soap->mode & SOAP_MIME_POSTCHECK)) + { + if (soap_end_recv(soap)) + goto post_check_exit; + if (soap->keep_alive == -2) /* special case to keep alive */ + soap->keep_alive = 0; + (void)soap_closesock(soap); + } + } + else + { + while (c != '\r' && (int)c != EOF && soap_coblank(c)) + c = soap_getchar(soap); + if (c != '\r' || soap_getchar(soap) != '\n') + { + soap->error = SOAP_MIME_ERROR; + goto post_check_exit; + } + if (soap_getmimehdr(soap)) + goto post_check_exit; + } + return content; +post_check_exit: + if ((soap->mode & SOAP_MIME_POSTCHECK)) + { + if (soap->keep_alive == -2) /* special case to keep alive */ + soap->keep_alive = 0; + (void)soap_closesock(soap); + } + return NULL; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_LEANER +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_match_cid(struct soap *soap, const char *s, const char *t) +{ + size_t n; + if (!s) + return 1; + if (!strcmp(s, t)) + return 0; + if (!strncmp(s, "cid:", 4)) + s += 4; + n = strlen(t); + if (*t == '<') + { + t++; + n -= 2; + } + if (!strncmp(s, t, n) && !s[n]) + return 0; + (void)soap_decode(soap->tmpbuf, sizeof(soap->tmpbuf), s, SOAP_STR_EOS); + if (!strncmp(soap->tmpbuf, t, n) && !soap->tmpbuf[n]) + return 0; + return 1; +} +#endif + +/******************************************************************************/ + +/* return UUID "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx" in a temporary buffer */ +SOAP_FMAC1 +const char* +SOAP_FMAC2 +soap_rand_uuid(struct soap *soap, const char *prefix) +{ + int r1, r2, r3, r4; +#ifdef WITH_OPENSSL + r1 = soap_random; + r2 = soap_random; +#else + size_t i; + static int k = 0xFACEB00C; + int lo = k % 127773; + int hi = k / 127773; +# if defined(HAVE_GETTIMEOFDAY) + struct timeval tv; + gettimeofday(&tv, NULL); + r1 = 10000000 * tv.tv_sec + tv.tv_usec; +# elif defined(UNDER_CE) + r1 = (int)Random(); +# elif !defined(WITH_LEAN) + r1 = (int)time(NULL); +# else + r1 = k; +# endif + k = 16807 * lo - 2836 * hi; + if (k <= 0) + k += 0x7FFFFFFF; + r2 = k; + /* k &= 0x8FFFFFFF; */ + for (i = 0; i < (sizeof(soap->buf) < 16UL ? sizeof(soap->buf) : 16UL); i++) + r2 += soap->buf[i]; +#endif + r3 = soap_random; + r4 = soap_random; + (SOAP_SNPRINTF(soap->tmpbuf, sizeof(soap->tmpbuf), prefix ? strlen(prefix) + 37 : 37), "%s%8.8x-%4.4hx-4%3.3hx-%4.4hx-%4.4hx%8.8x", prefix ? prefix : SOAP_STR_EOS, r1, (short)(r2 >> 16), (short)(((short)r2 >> 4) & 0x0FFF), (short)(((short)(r3 >> 16) & 0x3FFF) | 0x8000), (short)r3, r4); + return soap->tmpbuf; +} + +/******************************************************************************/ + +#ifndef WITH_LEANER +static void +soap_resolve_attachment(struct soap *soap, struct soap_multipart *content) +{ + if (content->id) + { + struct soap_xlist **xp = &soap->xlist; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Resolving attachment data for id='%s'\n", content->id)); + while (*xp) + { + struct soap_xlist *xq = *xp; + if (!soap_match_cid(soap, xq->id, content->id)) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Found matching attachment id='%s' for content id='%s'\n", xq->id, content->id)); + *xp = xq->next; + *xq->ptr = (unsigned char*)content->ptr; + *xq->size = (int)content->size; + *xq->type = (char*)content->type; + if (content->options) + *xq->options = (char*)content->options; + else + *xq->options = (char*)content->description; + SOAP_FREE(soap, xq); + } + else + { + xp = &(*xp)->next; + } + } + } +} +#endif + +/******************************************************************************/ + +#ifndef WITH_LEANER +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_putmimehdr(struct soap *soap, struct soap_multipart *content) +{ + const char *s; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "MIME attachment type='%s'\n", content->type ? content->type : SOAP_STR_EOS)); + if (soap_send3(soap, "\r\n--", soap->mime.boundary, "\r\n")) + return soap->error; + if (content->type && soap_send3(soap, "Content-Type: ", content->type, "\r\n")) + return soap->error; + s = soap_code_str(mime_codes, content->encoding); + if (s && soap_send3(soap, "Content-Transfer-Encoding: ", s, "\r\n")) + return soap->error; + if (content->id && soap_send3(soap, "Content-ID: ", content->id, "\r\n")) + return soap->error; + if (content->location && soap_send3(soap, "Content-Location: ", content->location, "\r\n")) + return soap->error; + if (content->description && soap_send3(soap, "Content-Description: ", content->description, "\r\n")) + return soap->error; + return soap_send_raw(soap, "\r\n", 2); +} +#endif + +/******************************************************************************/ + +#ifndef WITH_LEANER +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_putmime(struct soap *soap) +{ + struct soap_multipart *content; + if (!(soap->mode & SOAP_ENC_MIME) || !soap->mime.boundary) + return SOAP_OK; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Sending MIME attachments\n")); + for (content = soap->mime.first; content; content = content->next) + { + int err = SOAP_OK; + void *handle; + if (soap->fmimereadopen && ((handle = soap->fmimereadopen(soap, (void*)content->ptr, content->id, content->type, content->description)) != NULL || soap->error)) + { + size_t size = content->size; + if (!handle) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "fmimereadopen failed\n")); + if (!soap->error) + soap->error = SOAP_MIME_ERROR; + return soap->error; + } + if (soap_putmimehdr(soap, content)) + return soap->error; + if (!size) /* streaming MIME is indicated by size zero content size when streaming MIME callbacks are set */ + { + if ((soap->mode & SOAP_ENC_PLAIN) || (soap->mode & SOAP_IO) == SOAP_IO_CHUNK || (soap->mode & SOAP_IO) == SOAP_IO_STORE) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Chunked streaming MIME\n")); + do + { + size = soap->fmimeread(soap, handle, soap->tmpbuf, sizeof(soap->tmpbuf)); + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "fmimeread returned %lu bytes\n", (unsigned long)size)); + err = soap_send_raw(soap, soap->tmpbuf, size); + } while (!err && size); + } + else + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Error: cannot chunk streaming MIME (no HTTP chunking)\n")); + } + } + else + { + do + { + size_t bufsize; + if (size < sizeof(soap->tmpbuf)) + bufsize = size; + else + bufsize = sizeof(soap->tmpbuf); + bufsize = soap->fmimeread(soap, handle, soap->tmpbuf, bufsize); + if (!bufsize) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "fmimeread failed: insufficient data (%lu bytes remaining from %lu bytes)\n", (unsigned long)size, (unsigned long)content->size)); + err = SOAP_MIME_ERROR; /* used to be EOF, SOAP_MIME_ERROR is more appropriaate */ + break; + } + err = soap_send_raw(soap, soap->tmpbuf, bufsize); + size -= bufsize; + } while (!err && size); + } + if (soap->fmimereadclose) + soap->fmimereadclose(soap, handle); + if (err) + return soap->error = err; + } + else + { + if (soap_putmimehdr(soap, content) + || soap_send_raw(soap, content->ptr, content->size)) + return soap->error; + } + } + return soap_send3(soap, "\r\n--", soap->mime.boundary, "--"); +} +#endif + +/******************************************************************************/ + +#ifndef WITH_LEANER +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_set_dime(struct soap *soap) +{ + soap->omode |= SOAP_ENC_DIME; + soap->dime.first = NULL; + soap->dime.last = NULL; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_LEANER +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_set_mime(struct soap *soap, const char *boundary, const char *start) +{ + soap->omode |= SOAP_ENC_MIME; + soap->mime.first = NULL; + soap->mime.last = NULL; + soap->mime.boundary = soap_strdup(soap, boundary); + soap->mime.start = soap_strdup(soap, start); +} +#endif + +/******************************************************************************/ + +#ifndef WITH_LEANER +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_clr_dime(struct soap *soap) +{ + soap->omode &= ~SOAP_ENC_DIME; + soap->dime.first = NULL; + soap->dime.last = NULL; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_LEANER +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_clr_mime(struct soap *soap) +{ + soap->omode &= ~SOAP_ENC_MIME; + soap->mime.first = NULL; + soap->mime.last = NULL; + soap->mime.boundary = NULL; + soap->mime.start = NULL; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_LEANER +static int +soap_begin_attachments(struct soap *soap) +{ + if ((soap->mode & SOAP_ENC_MIME) && soap->mime.boundary && soap->mime.start) + { + const char *s; + if (strlen(soap->mime.boundary) + strlen(soap->mime.start) + 140 > sizeof(soap->tmpbuf)) + return soap->error = SOAP_EOM; + if ((soap->mode & SOAP_ENC_DIME) && !(soap->mode & SOAP_ENC_MTOM)) + { + s = "application/dime"; + } + else if (soap->version == 2) + { + if ((soap->mode & SOAP_ENC_MTOM)) + s = "application/xop+xml; charset=utf-8; type=\"application/soap+xml\""; + else + s = "application/soap+xml; charset=utf-8"; + } + else if ((soap->mode & SOAP_ENC_MTOM)) + { + s = "application/xop+xml; charset=utf-8; type=\"text/xml\""; + } + else + { + s = "text/xml; charset=utf-8"; + } + (SOAP_SNPRINTF_SAFE(soap->tmpbuf, sizeof(soap->tmpbuf)), "--%s\r\nContent-Type: %s\r\nContent-Transfer-Encoding: binary\r\nContent-ID: %s\r\n\r\n", soap->mime.boundary, s, soap->mime.start); + if (soap_send(soap, soap->tmpbuf)) + return soap->error; + } + if ((soap->mode & SOAP_IO_LENGTH)) + soap->dime.size = (size_t)soap->count; /* DIME in MIME correction, soap->count is small */ + if (!(soap->mode & SOAP_IO_LENGTH) && (soap->mode & SOAP_ENC_DIME)) + { + if (soap_putdimehdr(soap)) + return soap->error; + } + return SOAP_OK; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_LEANER +static int +soap_end_attachments(struct soap *soap) +{ + if ((soap->mode & SOAP_IO_LENGTH) && (soap->mode & SOAP_ENC_DIME) && !(soap->mode & SOAP_ENC_MTOM)) + { + if (soap->count > 0xFFFFFFFF) + return soap->error = SOAP_DIME_ERROR; + soap->dime.size = (size_t)soap->count - soap->dime.size; /* DIME in MIME correction */ + (SOAP_SNPRINTF(soap->id, sizeof(soap->id), strlen(soap->dime_id_format) + 20), soap->dime_id_format, 0); + soap->dime.id = soap->id; + if (soap->local_namespaces && soap->local_namespaces[0].id) + { + if (soap->local_namespaces[0].out) + soap->dime.type = (char*)soap->local_namespaces[0].out; + else + soap->dime.type = (char*)soap->local_namespaces[0].ns; + } + soap->dime.options = NULL; + soap->dime.flags = SOAP_DIME_MB | SOAP_DIME_ABSURI; + if (!soap->dime.first) + soap->dime.flags |= SOAP_DIME_ME; + soap->count += 12 + ((strlen(soap->dime.id)+3)&(~3)) + (soap->dime.type ? ((strlen(soap->dime.type)+3)&(~3)) : 0); + } + if ((soap->mode & SOAP_ENC_DIME) && !(soap->mode & SOAP_ENC_MTOM)) + return soap_send_raw(soap, SOAP_STR_PADDING, -(long)soap->dime.size&3); + return SOAP_OK; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_LEANER +static struct soap_multipart* +soap_alloc_multipart(struct soap *soap, struct soap_multipart **first, struct soap_multipart **last, const char *ptr, size_t size) +{ + struct soap_multipart *content; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "New DIME/MIME attachment %p (%lu)\n", (void*)ptr, (unsigned long)size)); + content = (struct soap_multipart*)soap_malloc(soap, sizeof(struct soap_multipart)); + if (content) + { + content->next = NULL; + content->ptr = ptr; + content->size = size; + content->id = NULL; + content->type = NULL; + content->options = NULL; + content->encoding = SOAP_MIME_NONE; + content->location = NULL; + content->description = NULL; + if (!*first) + *first = content; + if (*last) + (*last)->next = content; + *last = content; + } + return content; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_LEANER +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_set_dime_attachment(struct soap *soap, const char *ptr, size_t size, const char *type, const char *id, unsigned short optype, const char *option) +{ + struct soap_multipart *content = soap_alloc_multipart(soap, &soap->dime.first, &soap->dime.last, ptr, size); + if (!content) + return SOAP_EOM; + content->id = soap_strdup(soap, id); + content->type = soap_strdup(soap, type); + content->options = soap_dime_option(soap, optype, option); + return SOAP_OK; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_LEANER +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_set_mime_attachment(struct soap *soap, const char *ptr, size_t size, enum soap_mime_encoding encoding, const char *type, const char *id, const char *location, const char *description) +{ + struct soap_multipart *content = soap_alloc_multipart(soap, &soap->mime.first, &soap->mime.last, ptr, size); + if (!content) + return SOAP_EOM; + content->id = soap_strdup(soap, id); + content->type = soap_strdup(soap, type); + content->encoding = encoding; + content->location = soap_strdup(soap, location); + content->description = soap_strdup(soap, description); + return SOAP_OK; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_LEANER +SOAP_FMAC1 +struct soap_multipart* +SOAP_FMAC2 +soap_next_multipart(struct soap_multipart *content) +{ + if (content) + return content->next; + return NULL; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_LEANER +static void +soap_select_mime_boundary(struct soap *soap) +{ + while (!soap->mime.boundary || soap_valid_mime_boundary(soap)) + { + char *s = soap->mime.boundary; + size_t n = 0; + if (s) + n = strlen(s); + if (n < 16) + { + n = 64; + s = soap->mime.boundary = (char*)soap_malloc(soap, n + 1); + if (!s) + return; + } + *s++ = '='; + *s++ = '='; + n -= 4; + while (n) + { + *s++ = soap_base64o[soap_random & 0x3F]; + n--; + } + *s++ = '='; + *s++ = '='; + *s = '\0'; + } + if (!soap->mime.start) + soap->mime.start = ""; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_LEANER +static int +soap_valid_mime_boundary(struct soap *soap) +{ + struct soap_multipart *content; + size_t k; + if (soap->fmimeread) + return SOAP_OK; + k = strlen(soap->mime.boundary); + for (content = soap->mime.first; content; content = content->next) + { + if (content->ptr && content->size >= k) + { + const char *p = (const char*)content->ptr; + size_t i; + for (i = 0; i < content->size - k; i++, p++) + { + if (!strncmp(p, soap->mime.boundary, k)) + return SOAP_ERR; + } + } + } + return SOAP_OK; +} +#endif + +/******************************************************************************/ + +#ifdef WITH_GZIP +static int +soap_getgziphdr(struct soap *soap) +{ + int i; + soap_wchar c = 0, f = 0; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Get gzip header\n")); + for (i = 0; i < 9; i++) + { + c = soap_get1(soap); + if (i == 1 && c == 8) + soap->z_dict = 0; + if (i == 2) + f = c; + } + if (f & 0x04) /* FEXTRA */ + { + i = soap_get1(soap); + i |= soap_get1(soap) << 8; + while (i-- > 0) + { + if ((int)soap_get1(soap) == EOF) + return soap->error = SOAP_ZLIB_ERROR; + } + } + if (f & 0x08) /* skip FNAME */ + { + do + { + c = soap_get1(soap); + } while (c && (int)c != EOF); + } + if ((int)c != EOF && (f & 0x10)) /* skip FCOMMENT */ + { + do + { + c = soap_get1(soap); + } while (c && (int)c != EOF); + } + if ((int)c != EOF && (f & 0x02)) /* skip FHCRC (CRC32 is used) */ + { + c = soap_get1(soap); + if ((int)c != EOF) + c = soap_get1(soap); + } + if ((int)c == EOF) + return soap->error = SOAP_ZLIB_ERROR; + return SOAP_OK; +} +#endif + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_begin_serve(struct soap *soap) +{ +#ifdef WITH_FASTCGI + if (FCGI_Accept() < 0) + { + soap->error = SOAP_EOF; + return soap_send_fault(soap); + } +#endif + soap_begin(soap); + if (soap_begin_recv(soap) + || soap_envelope_begin_in(soap) + || soap_recv_header(soap) + || soap_body_begin_in(soap)) + { + if (soap->error < SOAP_STOP) + { +#ifdef WITH_FASTCGI + (void)soap_send_fault(soap); +#else + return soap_send_fault(soap); +#endif + } + return soap_closesock(soap); + } + return SOAP_OK; +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_begin_recv(struct soap *soap) +{ + soap_wchar c; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Initializing for input from socket=%d/fd=%d\n", (int)soap->socket, soap->recvfd)); + soap->error = SOAP_OK; +#ifndef WITH_LEANER + soap->recverror = SOAP_OK; +#endif + soap_free_temp(soap); + soap_set_local_namespaces(soap); + soap->version = 0; /* don't assume we're parsing SOAP content by default */ +#ifndef WITH_NOIDREF + soap_free_iht(soap); +#endif + if ((soap->imode & SOAP_IO) == SOAP_IO_CHUNK) + { + soap->imode &= ~SOAP_IO; + soap->omode = (soap->omode & ~SOAP_IO) | SOAP_IO_CHUNK; + } + soap->imode &= ~(SOAP_ENC_DIME | SOAP_ENC_MIME | SOAP_ENC_ZLIB); + soap->mode = soap->imode; + if (!(soap->mode & SOAP_IO_KEEPALIVE)) + soap->keep_alive = 0; + if (!soap->keep_alive) + soap->buflen = soap->bufidx = 0; + soap->null = 0; + soap->position = 0; + soap->mustUnderstand = 0; + soap->shaky = 0; + soap->ahead = 0; + soap->peeked = 0; + soap->level = 0; + soap->part = SOAP_BEGIN_RECV; + soap->count = 0; + soap->length = 0; + soap->cdata = 0; + if (!(soap->mode & SOAP_ENC_PLAIN)) + { + *soap->endpoint = '\0'; + soap->action = NULL; + soap->fform = NULL; + } + soap->header = NULL; + soap->fault = NULL; + soap->status = 0; + soap->body = 1; +#ifndef WITH_LEANER + soap->dom = NULL; + soap->dime.count = 0; + soap->dime.chunksize = 0; + soap->dime.buflen = 0; + soap->dime.list = NULL; + soap->dime.first = NULL; + soap->dime.last = NULL; + soap->mime.list = NULL; + soap->mime.first = NULL; + soap->mime.last = NULL; + soap->mime.boundary = NULL; + soap->mime.start = NULL; +#endif +#ifdef WIN32 +#ifndef UNDER_CE +#ifndef WITH_FASTCGI + if (!soap_valid_socket(soap->socket) && !soap->is && soap->recvfd >= 0) /* Set win32 stdin or soap->recvfd to BINARY, e.g. to support DIME */ +#ifdef __BORLANDC__ + setmode(soap->recvfd, _O_BINARY); +#else + _setmode(soap->recvfd, _O_BINARY); +#endif +#endif +#endif +#endif +#ifdef WITH_ZLIB + soap->zlib_in = SOAP_ZLIB_NONE; + soap->zlib_out = SOAP_ZLIB_NONE; + if (!soap->d_stream) + { + soap->d_stream = (z_stream*)SOAP_MALLOC(soap, sizeof(z_stream)); + if (!soap->d_stream) + return soap->error = SOAP_EOM; + soap->d_stream->zalloc = Z_NULL; + soap->d_stream->zfree = Z_NULL; + soap->d_stream->opaque = Z_NULL; + soap->d_stream->next_in = Z_NULL; + soap->d_stream->msg = Z_NULL; + } + soap->d_stream->avail_in = 0; + soap->d_stream->next_out = (Byte*)soap->buf; + soap->d_stream->avail_out = sizeof(soap->buf); + soap->z_ratio_in = 1.0; +#endif +#ifdef WITH_OPENSSL + if (soap->ssl) + ERR_clear_error(); +#endif +#ifndef WITH_LEAN + soap->start = (ULONG64)time(NULL); +#endif +#ifndef WITH_LEANER + if (soap->fprepareinitrecv && (soap->error = soap->fprepareinitrecv(soap)) != SOAP_OK) + return soap->error; +#endif + c = soap_getchar(soap); +#ifdef WITH_GZIP + if (c == 0x1F) + { + if (soap_getgziphdr(soap)) + return soap->error; + if (inflateInit2(soap->d_stream, -MAX_WBITS) != Z_OK) + return soap->error = SOAP_ZLIB_ERROR; + if (soap->z_dict) + { + if (inflateSetDictionary(soap->d_stream, (const Bytef*)soap->z_dict, soap->z_dict_len) != Z_OK) + return soap->error = SOAP_ZLIB_ERROR; + } + soap->zlib_state = SOAP_ZLIB_INFLATE; + soap->mode |= SOAP_ENC_ZLIB; + soap->zlib_in = SOAP_ZLIB_GZIP; + soap->z_crc = crc32(0L, NULL, 0); + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "gzip initialized\n")); + if (!soap->z_buf) + soap->z_buf = (char*)SOAP_MALLOC(soap, sizeof(soap->buf)); + (void)soap_memcpy((void*)soap->z_buf, sizeof(soap->buf), (const void*)soap->buf, sizeof(soap->buf)); + /* should not chunk over plain transport, so why bother to check? */ + /* if ((soap->mode & SOAP_IO) == SOAP_IO_CHUNK) */ + /* soap->z_buflen = soap->bufidx; */ + /* else */ + soap->d_stream->next_in = (Byte*)(soap->z_buf + soap->bufidx); + soap->d_stream->avail_in = (unsigned int)(soap->buflen - soap->bufidx); + soap->z_buflen = soap->buflen; + soap->buflen = soap->bufidx; + c = ' '; + } +#endif + while (soap_coblank(c)) + c = soap_getchar(soap); +#ifndef WITH_LEANER + if (c == '-' && soap_get0(soap) == '-') + { + soap->mode |= SOAP_ENC_MIME; + } + else if ((c & 0xFFFC) == (SOAP_DIME_VERSION | SOAP_DIME_MB) && (soap_get0(soap) & 0xFFF0) == 0x20) + { + soap->mode |= SOAP_ENC_DIME; + } + else +#endif + { + /* skip BOM */ + if (c == 0xEF && soap_get0(soap) == 0xBB) + { + soap_get1(soap); + c = soap_get1(soap); + if (c == 0xBF) + { + soap->mode &= ~SOAP_ENC_LATIN; + c = soap_getchar(soap); + } + else + { + c = (0x0F << 12) | (0xBB << 6) | (c & 0x3F); /* UTF-8 */ + } + } + else if ((c == 0xFE && soap_get0(soap) == 0xFF) /* UTF-16 BE */ + || (c == 0xFF && soap_get0(soap) == 0xFE)) /* UTF-16 LE */ + { + return soap->error = SOAP_UTF_ERROR; + } + /* skip space */ + while (soap_coblank(c)) + c = soap_getchar(soap); + } + if ((int)c == EOF) + return soap->error = SOAP_CHK_EOF; + soap_unget(soap, c); +#ifndef WITH_NOHTTP + /* if not XML/MIME/DIME/ZLIB, assume HTTP method or status line */ + if (((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z')) && !(soap->mode & (SOAP_ENC_MIME | SOAP_ENC_DIME | SOAP_ENC_ZLIB | SOAP_ENC_PLAIN))) + { + soap_mode m = soap->imode; + soap->error = soap->fparse(soap); + soap->mode = soap->imode; /* if imode is changed, effectuate */ + soap->imode = m; /* restore imode */ + if ((soap->mode & SOAP_IO) == SOAP_IO_CHUNK) + { + soap->chunkbuflen = soap->buflen; + soap->buflen = soap->bufidx; + soap->chunksize = 0; + } +#ifdef WITH_ZLIB + soap->mode &= ~SOAP_ENC_ZLIB; + if (soap->zlib_in != SOAP_ZLIB_NONE) + { +#ifdef WITH_GZIP + if (soap->zlib_in != SOAP_ZLIB_DEFLATE) + { + c = soap_get1(soap); + if (c == (int)EOF) + return soap->error = SOAP_EOF; + if (c == 0x1F) + { + if (soap_getgziphdr(soap)) + return soap->error; + if (inflateInit2(soap->d_stream, -MAX_WBITS) != Z_OK) + return soap->error = SOAP_ZLIB_ERROR; + soap->z_crc = crc32(0L, NULL, 0); + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "gzip initialized\n")); + } + else + { + soap_revget1(soap); + if (inflateInit(soap->d_stream) != Z_OK) + return soap->error = SOAP_ZLIB_ERROR; + soap->zlib_in = SOAP_ZLIB_DEFLATE; + } + } + else +#endif + if (inflateInit(soap->d_stream) != Z_OK) + return soap->error = SOAP_ZLIB_ERROR; + if (soap->z_dict) + { + if (inflateSetDictionary(soap->d_stream, (const Bytef*)soap->z_dict, soap->z_dict_len) != Z_OK) + return soap->error = SOAP_ZLIB_ERROR; + } + soap->zlib_state = SOAP_ZLIB_INFLATE; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Inflate initialized\n")); + soap->mode |= SOAP_ENC_ZLIB; + if (!soap->z_buf) + soap->z_buf = (char*)SOAP_MALLOC(soap, sizeof(soap->buf)); + (void)soap_memcpy((void*)soap->z_buf, sizeof(soap->buf), (const void*)soap->buf, sizeof(soap->buf)); + soap->d_stream->next_in = (Byte*)(soap->z_buf + soap->bufidx); + soap->d_stream->avail_in = (unsigned int)(soap->buflen - soap->bufidx); + soap->z_buflen = soap->buflen; + soap->buflen = soap->bufidx; + } +#endif +#ifndef WITH_LEANER + if (soap->fpreparerecv && (soap->mode & SOAP_IO) != SOAP_IO_CHUNK && soap->buflen > soap->bufidx) + { + int r; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Invoking fpreparerecv\n")); + r = soap->fpreparerecv(soap, soap->buf + soap->bufidx, soap->buflen - soap->bufidx); + if (r) + return soap->error = r; + } +#endif + if (soap->error && soap->error < SOAP_STOP) + { + if (soap->status >= 200 && soap->status < 600) + { + const char *s = soap_http_get_body(soap, NULL); + (void)soap_end_recv(soap); + if (soap->status >= 300) + soap->keep_alive = 0; /* to force close */ + return soap_set_receiver_error(soap, "HTTP Error", s, soap->status); + } + return soap->error; + } + if (!soap->body && soap->status >= 200 && soap->status < 600) + return soap->error = soap->status; /* client side received HTTP status code */ + if (soap->status > SOAP_POST) + { + soap->fform = NULL; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Invoking http method handler\n")); + switch (soap->status) + { + case SOAP_GET: + if (soap_http_skip_body(soap) || soap_end_recv(soap)) + return soap->error; + soap->error = soap->fget(soap); + break; + case SOAP_PUT: + soap->error = soap->fput(soap); + break; + case SOAP_PATCH: + soap->error = soap->fpatch(soap); + break; + case SOAP_DEL: + if (soap_http_skip_body(soap) || soap_end_recv(soap)) + return soap->error; + soap->error = soap->fdel(soap); + break; + case SOAP_HEAD: + if (soap_http_skip_body(soap) || soap_end_recv(soap)) + return soap->error; + soap->error = soap->fhead(soap); + break; + case SOAP_OPTIONS: + if (soap_http_skip_body(soap) || soap_end_recv(soap)) + return soap->error; + soap->error = soap->fopt(soap); + break; + default: + if (soap_http_skip_body(soap) || soap_end_recv(soap)) + return soap->error; + return 405; + } + if (soap->error == SOAP_OK) + return soap->error = SOAP_STOP; /* prevents further processing and calls soap_closesock() */ + if (soap->error != SOAP_FORM || !soap->fform) /* continue if handler returned SOAP_FORM */ + return soap->error; + soap->error = SOAP_OK; + } + if (soap->fform) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Invoking http post/form handler\n")); + soap->error = soap->fform(soap); + soap->fform = NULL; + if (soap->error == SOAP_OK) + return soap->error = SOAP_STOP; /* prevents further processing */ + if (soap->status != SOAP_POST || soap->error != 404) /* continue with POST if handler returned HTTP not found */ + return soap->error; + soap->error = SOAP_OK; + } + if (!soap->body) + return soap->error = SOAP_NO_DATA; + } + else if (soap->fform) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Invoking http form handler\n")); + soap->error = soap->fform(soap); + soap->fform = NULL; + if (soap->error == SOAP_OK) + return soap->error = SOAP_STOP; /* prevents further processing */ + if (soap->error != 404) /* continue with POST if handler returned HTTP not found */ + return soap->error; + soap->error = SOAP_OK; + } +#endif +#ifndef WITH_LEANER + if ((soap->mode & SOAP_ENC_MIME)) + { + do /* skip preamble */ + { + c = soap_getchar(soap); + if ((int)c == EOF) + return soap->error = SOAP_CHK_EOF; + } while (c != '-' || soap_get0(soap) != '-'); + soap_unget(soap, c); + if (soap_getmimehdr(soap)) + return soap->error; + if (soap->mime.start) + { + do + { + if (!soap->mime.last->id) + break; + if (!soap_match_cid(soap, soap->mime.start, soap->mime.last->id)) + break; + } while (soap_recv_mime_attachment(soap, NULL)); + } + if (soap_http_header_attribute(soap, soap->mime.first->type, "application/dime")) + soap->mode |= SOAP_ENC_DIME; + } + if ((soap->mode & SOAP_ENC_DIME)) + { + if (soap_getdimehdr(soap)) + return soap->error; + if ((soap->dime.flags & SOAP_DIME_CF)) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Chunked SOAP in DIME message\n")); + soap->dime.chunksize = soap->dime.size; + if (soap->buflen - soap->bufidx >= soap->dime.chunksize) + { + soap->dime.buflen = soap->buflen; + soap->buflen = soap->bufidx + soap->dime.chunksize; + } + else + { + soap->dime.chunksize -= soap->buflen - soap->bufidx; + } + } + soap->count = soap->buflen - soap->bufidx; + if (soap->recv_maxlength && soap->count > soap->recv_maxlength) + return soap->error = SOAP_EOF; + } +#endif + return SOAP_OK; +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_envelope_begin_out(struct soap *soap) +{ + if (soap->version == 0) + return SOAP_OK; + soap->part = SOAP_IN_ENVELOPE; + return soap_element_begin_out(soap, "SOAP-ENV:Envelope", 0, NULL); +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_envelope_end_out(struct soap *soap) +{ + if (soap->version == 0) + return SOAP_OK; + if (soap_element_end_out(soap, "SOAP-ENV:Envelope") + || soap_send_raw(soap, "\r\n", 2)) /* 2.8: always emit \r\n */ + return soap->error; + soap->part = SOAP_END_ENVELOPE; + return SOAP_OK; +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_http_has_body(struct soap *soap) +{ + return soap->length || (soap->mode & SOAP_ENC_ZLIB) || (soap->mode & SOAP_IO) == SOAP_IO_CHUNK; +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_http_skip_body(struct soap *soap) +{ + ULONG64 k = soap->length; + /* check HTTP body, return "" if none */ + if (!k && !(soap->mode & SOAP_ENC_ZLIB) && (soap->mode & SOAP_IO) != SOAP_IO_CHUNK) + return SOAP_OK; + /* do not consume DIME or MIME attachments, leave this to soap_end_recv */ + if ((soap->mode & SOAP_ENC_DIME) || (soap->mode & SOAP_ENC_MIME)) + return SOAP_OK; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Skipping HTTP body (mode=0x%x)\n", soap->mode)); + if (k && !(soap->mode & SOAP_ENC_ZLIB)) + { + ULONG64 i; + soap->length = 0; + for (i = 0; i < k; i++) + { + soap_wchar c = soap_get1(soap); + if ((int)c == EOF) + break; + } + } + else + { + for (;;) + { + soap_wchar c = soap_get1(soap); + if ((int)c == EOF) + break; + } + } + return SOAP_OK; +} + +/******************************************************************************/ + +SOAP_FMAC1 +char * +SOAP_FMAC2 +soap_http_get_body(struct soap *soap, size_t *len) +{ + return soap_http_get_body_prefix(soap, len, NULL); +} + +/******************************************************************************/ + +SOAP_FMAC1 +char * +SOAP_FMAC2 +soap_http_get_form(struct soap *soap) +{ + return soap_http_get_body_prefix(soap, NULL, "?"); +} + +/******************************************************************************/ + +SOAP_FMAC1 +char * +SOAP_FMAC2 +soap_http_get_body_prefix(struct soap *soap, size_t *len, const char *prefix) +{ + char *s; + ULONG64 k = soap->length; + size_t n = 0; + if (!prefix) + prefix = SOAP_STR_EOS; + else + n = strlen(prefix); + if (len) + *len = 0; + /* check HTTP body, return "" if none */ + if (!k && !(soap->mode & SOAP_ENC_PLAIN) && !(soap->mode & SOAP_ENC_ZLIB) && (soap->mode & SOAP_IO) != SOAP_IO_CHUNK) + return soap_strdup(soap, prefix); + /* do not consume DIME or MIME attachments, leave this to soap_end_recv */ + if ((soap->mode & SOAP_ENC_DIME) || (soap->mode & SOAP_ENC_MIME)) + return soap_strdup(soap, prefix); + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Parsing HTTP body, prefixed with '%s' (mode=0x%x)\n", prefix, soap->mode)); + if (k && !(soap->mode & SOAP_ENC_ZLIB)) + { + char *t; + size_t j; + soap->length = 0; + /* http content length != 0 and uncompressed body and body length does not exceed size_t max size */ + if ((SOAP_MAXALLOCSIZE != 0 && n + k > SOAP_MAXALLOCSIZE) || n + k > (ULONG64)((size_t)-2)) + { + soap->error = SOAP_EOM; + return NULL; + } + j = (size_t)k; /* safe cast: k is in size_t range as guarded above */ + s = t = (char*)soap_malloc(soap, j + n + 1); + if (s) + { + size_t i = 0; + if (n) + { + (void)soap_memcpy(t, n, prefix, n); + t += n; + } + if (soap->ahead && j > 0) + { + *t++ = soap->ahead; + ++i; + soap->ahead = 0; + } + while (i < j) + { + size_t m; + if (soap->bufidx >= soap->buflen) + if (soap_recv(soap)) + break; + if (soap->buflen - soap->bufidx > j - i) + m = j - i; + else + m = soap->buflen - soap->bufidx; + (void)soap_memcpy(t, j + n + 1 - i, soap->buf + soap->bufidx, m); + soap->bufidx += m; + t += m; + i += m; + } + *t = '\0'; + if (len) + *len = n + i; + } + else + { + soap->error = SOAP_EOM; + return NULL; + } + } + else + { + size_t i, l = 0; + if (soap_alloc_block(soap) == NULL) + return NULL; + if (n) + { + s = (char*)soap_push_block(soap, NULL, n); + if (!s) + return NULL; + (void)soap_memcpy(s, n, prefix, n); + l += n; + } + if (soap->ahead) + { + s = (char*)soap_push_block(soap, NULL, 1); + if (!s) + return NULL; + *s = soap->ahead; + ++l; + soap->ahead = 0; + } + for (;;) + { + size_t k = SOAP_BLKLEN; + s = (char*)soap_push_block(soap, NULL, k); + if (!s) + return NULL; + i = 0; + while (i < k) + { + size_t m; + if (soap->bufidx >= soap->buflen) + if (soap_recv(soap)) + goto end; + if (soap->buflen - soap->bufidx > k - i) + m = k - i; + else + m = soap->buflen - soap->bufidx; + (void)soap_memcpy(s, k - i, soap->buf + soap->bufidx, m); + soap->bufidx += m; + s += m; + i += m; + if (l + m < l) + { + soap->error = SOAP_EOM; + return NULL; + } + l += m; + } + } +end: + *s = '\0'; + if (len) + *len = l; + soap_size_block(soap, NULL, i + 1); + s = (char*)soap_save_block(soap, NULL, NULL, 0); + } + return s; +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_envelope_begin_in(struct soap *soap) +{ + soap->part = SOAP_IN_ENVELOPE; + if (soap_element_begin_in(soap, "SOAP-ENV:Envelope", 0, NULL)) + { + if (soap->error == SOAP_TAG_MISMATCH) + { + if (!soap_element_begin_in(soap, ":Envelope", 0, NULL)) + return soap->error = SOAP_VERSIONMISMATCH; + if (soap->status == 0 + || (soap->status >= 200 && soap->status <= 299) + || soap->status == 400 + || soap->status == 500) + return soap->error = SOAP_OK; /* allow non-SOAP (REST) XML content to be captured */ + soap->error = soap->status; + } + else if (soap->status) + { + soap->error = soap->status; + } + return soap->error; + } + soap_version(soap); + return SOAP_OK; +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_envelope_end_in(struct soap *soap) +{ + if (soap->version == 0) + return SOAP_OK; + soap->part = SOAP_END_ENVELOPE; + return soap_element_end_in(soap, "SOAP-ENV:Envelope"); +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_body_begin_out(struct soap *soap) +{ + if (soap->version == 1) + soap->encoding = 1; +#ifndef WITH_LEAN + if ((soap->mode & SOAP_SEC_WSUID) && soap_set_attr(soap, "wsu:Id", "Body", 1)) + return soap->error; +#endif + if (soap->version == 0) + return SOAP_OK; + soap->part = SOAP_IN_BODY; + return soap_element_begin_out(soap, "SOAP-ENV:Body", 0, NULL); +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_body_end_out(struct soap *soap) +{ + if (soap->version == 0) + return SOAP_OK; + if (soap_element_end_out(soap, "SOAP-ENV:Body")) + return soap->error; + soap->part = SOAP_END_BODY; + return SOAP_OK; +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_body_begin_in(struct soap *soap) +{ + if (soap->version == 0) + return SOAP_OK; + soap->part = SOAP_IN_BODY; + if (soap_element_begin_in(soap, "SOAP-ENV:Body", 0, NULL)) + return soap->error; + if (!soap->body) + soap->part = SOAP_NO_BODY; + return SOAP_OK; +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_body_end_in(struct soap *soap) +{ + if (soap->version == 0) + return SOAP_OK; + if (soap->part == SOAP_NO_BODY) + return soap->error = SOAP_OK; + soap->part = SOAP_END_BODY; + return soap_element_end_in(soap, "SOAP-ENV:Body"); +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_recv_header(struct soap *soap) +{ + if (soap_getheader(soap) && soap->error == SOAP_TAG_MISMATCH) + soap->error = SOAP_OK; + if (soap->error == SOAP_OK && soap->fheader) + soap->error = soap->fheader(soap); + return soap->error; +} + +/******************************************************************************/ + +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_set_endpoint(struct soap *soap, const char *endpoint) +{ + const char *s, *t; + size_t i, n; + soap->endpoint[0] = '\0'; + soap->host[0] = '\0'; + soap->path[0] = '/'; + soap->path[1] = '\0'; + soap->port = 80; + if (!endpoint || !*endpoint) + return; +#if defined(WITH_OPENSSL) || defined(WITH_GNUTLS) || defined(WITH_WOLFSSL) || defined(WITH_SYSTEMSSL) + if (!soap_tag_cmp(endpoint, "https:*")) + soap->port = 443; +#endif + soap_strcpy(soap->endpoint, sizeof(soap->endpoint), endpoint); + s = strchr(endpoint, ':'); + if (s && s[1] == '/' && s[2] == '/') + s += 3; + else + s = endpoint; +#if !defined(WITH_NOHTTP) || !defined(WITH_LEANER) + t = strchr(s, '@'); + if (t && *s != ':' && *s != '@') + { + size_t l = t - s + 1; + char *r = (char*)soap_malloc(soap, l); + n = s - endpoint; + if (r) + { + s = soap_decode(r, l, s, ":@"); + soap->userid = r; + soap->passwd = SOAP_STR_EOS; + if (*s == ':') + { + s++; + if (*s != '@' && s < t) + { + l = t - s + 1; + r = r + strlen(r) + 1; + s = soap_decode(r, l, s, "@"); + soap->passwd = r; + } + } + } + s++; + soap_strcpy(soap->endpoint + n, sizeof(soap->endpoint) - n, s); + } +#endif + n = strlen(s); + if (n >= sizeof(soap->host)) + n = sizeof(soap->host) - 1; +#ifdef WITH_IPV6 + if (s[0] == '[') + { + s++; + for (i = 0; i < n; i++) + { + if (s[i] == ']') + { + s++; + --n; + break; + } + soap->host[i] = s[i]; + } + } + else + { + for (i = 0; i < n; i++) + { + soap->host[i] = s[i]; + if (s[i] == '/' || s[i] == ':' || s[i] == '?') + break; + } + } +#else + for (i = 0; i < n; i++) + { + soap->host[i] = s[i]; + if (s[i] == '/' || s[i] == ':' || s[i] == '?') + break; + } +#endif + soap->host[i] = '\0'; + if (s[i] == ':') + { + soap->port = (int)soap_strtol(s + i + 1, NULL, 10); + for (i++; i < n; i++) + if (s[i] == '/') + break; + } + if (i < n && s[i]) + soap_strcpy(soap->path, sizeof(soap->path), s + i); + if (soap->override_host && *soap->override_host) + { + soap_strcpy(soap->host, sizeof(soap->host), soap->override_host); + if (soap->override_port) + soap->port = soap->override_port; + } + if (soap->userid && !soap->authrealm) + soap->authrealm = soap->host; +} + +/******************************************************************************/ + +#ifndef WITH_NOHTTP +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_GET(struct soap *soap, const char *endpoint, const char *action) +{ + return soap_connect_command(soap, SOAP_GET, endpoint, action); +} +#endif + +/******************************************************************************/ + +#ifndef WITH_NOHTTP +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_PUT(struct soap *soap, const char *endpoint, const char *action, const char *type) +{ + if (!soap->http_content) + soap->http_content = type; + if ((soap->omode & SOAP_IO) != SOAP_IO_CHUNK) + { + soap->omode &= ~SOAP_IO; + soap->omode |= SOAP_IO_STORE; + } + return soap_connect_command(soap, SOAP_PUT, endpoint, action); +} +#endif + +/******************************************************************************/ + +#ifndef WITH_NOHTTP +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_POST(struct soap *soap, const char *endpoint, const char *action, const char *type) +{ + if (!soap->http_content) + soap->http_content = type; + if ((soap->omode & SOAP_IO) != SOAP_IO_CHUNK) + { + soap->omode &= ~SOAP_IO; + soap->omode |= SOAP_IO_STORE; + } + return soap_connect_command(soap, SOAP_POST_FILE, endpoint, action); +} +#endif + +/******************************************************************************/ + +#ifndef WITH_NOHTTP +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_PATCH(struct soap *soap, const char *endpoint, const char *action, const char *type) +{ + if (!soap->http_content) + soap->http_content = type; + if ((soap->omode & SOAP_IO) != SOAP_IO_CHUNK) + { + soap->omode &= ~SOAP_IO; + soap->omode |= SOAP_IO_STORE; + } + return soap_connect_command(soap, SOAP_PATCH, endpoint, action); +} +#endif + +/******************************************************************************/ + +#ifndef WITH_NOHTTP +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_DELETE(struct soap *soap, const char *endpoint) +{ + if (soap_connect_command(soap, SOAP_DEL, endpoint, NULL) + || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +#endif + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_connect(struct soap *soap, const char *endpoint, const char *action) +{ + return soap_connect_command(soap, SOAP_POST, endpoint, action); +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_connect_command(struct soap *soap, int http_command, const char *endpoints, const char *action) +{ + if (endpoints) + { + int retry = soap->connect_retry; + unsigned int backoff = 1; + for (;;) + { + struct timeval tv; + const char *s; + s = strchr(endpoints, ' '); + if (s) + { + size_t l = strlen(endpoints); + char *endpoint = NULL; + if (SOAP_MAXALLOCSIZE == 0 || l <= SOAP_MAXALLOCSIZE) + endpoint = (char*)SOAP_MALLOC(soap, l + 1); + if (!endpoint) + return soap->error = SOAP_EOM; + for (;;) + { + (void)soap_strncpy(endpoint, l + 1, endpoints, s - endpoints); + endpoint[s - endpoints] = '\0'; + if (soap_try_connect_command(soap, http_command, endpoint, action) != SOAP_TCP_ERROR) + break; + while (*s == ' ') + s++; + if (!*s) + break; + soap->error = SOAP_OK; + endpoints = s; + s = strchr(endpoints, ' '); + if (!s) + s = endpoints + strlen(endpoints); + } + SOAP_FREE(soap, endpoint); + } + else + { + soap_try_connect_command(soap, http_command, endpoints, action); + } + if (soap->error != SOAP_TCP_ERROR || retry <= 0) + break; + soap->error = SOAP_OK; + tv.tv_sec = backoff; + tv.tv_usec = 0; + select(0, NULL, NULL, NULL, &tv); + if (backoff < 32) + backoff *= 2; + --retry; + } + } + return soap->error; +} + +/******************************************************************************/ + +static int +soap_try_connect_command(struct soap *soap, int http_command, const char *endpoint, const char *action) +{ + char host[sizeof(soap->host)]; + int port; + ULONG64 count; + soap->error = SOAP_OK; + soap_reset_errno; + soap->errnum = 0; + (void)soap_memcpy(host, sizeof(host), soap->host, sizeof(soap->host)); /* save previous host name: if != then reconnect */ + port = soap->port; /* save previous port to compare */ + soap->status = http_command; + soap_set_endpoint(soap, endpoint); + soap->action = soap_strdup(soap, action); +#ifndef WITH_LEANER + if (soap->fconnect) + { + soap->error = soap->fconnect(soap, endpoint, soap->host, soap->port); + if (soap->error) + return soap->error; + } + else +#endif + if (soap->fopen && *soap->host) + { + if (!soap->keep_alive || !soap_valid_socket(soap->socket) || strcmp(soap->host, host) || soap->port != port || !soap->fpoll || soap->fpoll(soap)) + { + soap->error = SOAP_OK; +#ifndef WITH_LEAN + if (!strncmp(endpoint, "soap.udp:", 9) || !strncmp(endpoint, "udp:", 4)) + { + soap->omode |= SOAP_IO_UDP; + } + else +#endif + { + soap->keep_alive = 0; /* to force close */ + soap->omode &= ~SOAP_IO_UDP; /* to force close */ + } + (void)soap_closesock(soap); + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Connect/reconnect to '%s' host='%s' path='%s' port=%d\n", endpoint?endpoint:"(null)", soap->host, soap->path, soap->port)); + if (!soap->keep_alive || !soap_valid_socket(soap->socket)) + { + soap->socket = soap->fopen(soap, endpoint, soap->host, soap->port); + if (!soap_valid_socket(soap->socket) || soap->error) + { + if (soap->error) + return soap->error; + return soap->error = SOAP_TCP_ERROR; + } + soap->keep_alive = -((soap->omode & SOAP_IO_KEEPALIVE) != 0); + } + } + } +#ifdef WITH_NTLM + if (soap_ntlm_handshake(soap, SOAP_GET, endpoint, soap->host, soap->port)) + return soap->error; +#endif + count = soap_count_attachments(soap); + if (soap_init_send(soap)) + return soap->error; +#ifndef WITH_NOHTTP + if (http_command == SOAP_GET || http_command == SOAP_DEL || http_command == SOAP_HEAD || http_command == SOAP_OPTIONS) + { + soap->mode &= ~(SOAP_IO | SOAP_ENC_ZLIB); + soap->mode |= SOAP_IO_BUFFER; + } + if ((soap->mode & SOAP_IO) != SOAP_IO_STORE && !(soap->mode & SOAP_ENC_PLAIN) && endpoint) + { + soap_mode k = soap->mode; + soap->mode &= ~(SOAP_IO | SOAP_ENC_ZLIB); + if ((k & SOAP_IO) != SOAP_IO_FLUSH) + soap->mode |= SOAP_IO_BUFFER; + soap->error = soap->fpost(soap, endpoint, soap->host, soap->port, soap->path, action, count); + if (soap->error) + return soap->error; + if ((k & SOAP_IO) == SOAP_IO_CHUNK) + { + if (soap_flush(soap)) + return soap->error; + } + soap->mode = k; + } + if (http_command == SOAP_GET || http_command == SOAP_DEL || http_command == SOAP_HEAD || http_command == SOAP_OPTIONS) + return soap_end_send_flush(soap); +#endif +#ifndef WITH_LEANER + if (soap_begin_attachments(soap)) + return soap->error; +#endif + return SOAP_OK; +} + +/******************************************************************************/ + +#ifdef WITH_NTLM +static int +soap_ntlm_handshake(struct soap *soap, int command, const char *endpoint, const char *host, int port) +{ + /* requires libntlm from http://www.nongnu.org/libntlm/ */ + const char *userid = (soap->proxy_userid ? soap->proxy_userid : soap->userid); + const char *passwd = (soap->proxy_passwd ? soap->proxy_passwd : soap->passwd); + struct SOAP_ENV__Header *oldheader; + if (soap->ntlm_challenge && userid && passwd && soap->authrealm) + { + tSmbNtlmAuthRequest req; + tSmbNtlmAuthResponse res; + tSmbNtlmAuthChallenge ch; + int keep_alive = soap->keep_alive; + ULONG64 length = soap->length; + ULONG64 count = soap->count; + soap_mode m = soap->mode; + soap_mode om = soap->omode; + int status = soap->status; + char *action = soap->action; + short version = soap->version; + const char *http_content = soap->http_content; + const char *http_extra_header = soap->http_extra_header; + const char *bearer = soap->bearer; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "NTLM '%s'\n", soap->ntlm_challenge)); + if (!*soap->ntlm_challenge) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "NTLM S->C Type 1: received NTLM authentication challenge from server\n")); + /* S -> C 401 Unauthorized + WWW-Authenticate: NTLM + */ + buildSmbNtlmAuthRequest(&req, userid, soap->authrealm); + soap->ntlm_challenge = soap_s2base64(soap, (unsigned char*)(void*)&req, NULL, SmbLength(&req)); + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "NTLM C->S Type 2: sending NTLM authorization to server\nAuthorization: NTLM %s\n", soap->ntlm_challenge)); + /* C -> S GET ... + Authorization: NTLM TlRMTVNTUAABAAAAA7IAAAoACgApAAAACQAJACAAAABMSUdIVENJVFlVUlNBLU1JTk9S + */ + soap->omode = SOAP_IO_BUFFER; + if (soap_init_send(soap)) + return soap->error; + if (!soap->keep_alive) + soap->keep_alive = -1; /* client keep alive */ + soap->status = command; /* GET or CONNECT for proxy */ + if (soap->fpost(soap, endpoint, host, port, soap->path, soap->action, 0) + || soap_end_send_flush(soap)) + return soap->error; + soap->mode = m; + soap->keep_alive = keep_alive; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "NTLM S->C Type 2: waiting on server NTLM response\n")); + oldheader = soap->header; + if (soap_begin_recv(soap)) + if (soap->error == SOAP_EOF) + return soap->error; + (void)soap_end_recv(soap); + soap->header = oldheader; + soap->length = length; + if (soap->status != 401 && soap->status != 407) + return soap->error = SOAP_NTLM_ERROR; + soap->error = SOAP_OK; + } + /* S -> C 401 Unauthorized + WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAAAAACgAAAABggAAU3J2Tm9uY2UAAAAAAAAAAA== + */ + soap_base642s(soap, soap->ntlm_challenge, (char*)&ch, sizeof(tSmbNtlmAuthChallenge), NULL); + buildSmbNtlmAuthResponse(&ch, &res, userid, passwd); + soap->ntlm_challenge = soap_s2base64(soap, (unsigned char*)(void*)&res, NULL, SmbLength(&res)); + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "NTLM C->S Type 3: sending NTLM authorization to server\nAuthorization: NTLM %s\n", soap->ntlm_challenge)); + /* C -> S GET ... + Authorization: NTLM TlRMTVNTUAADAAAAGAAYAHIAAAAYABgAigAAABQAFABAAAAADAAMAFQAAAASABIAYAAAAAAAAACiAAAAAYIAAFUAUgBTAEEALQBNAEkATgBPAFIAWgBhAHAAaABvAGQATABJAEcASABUAEMASQBUAFkArYfKbe/jRoW5xDxHeoxC1gBmfWiS5+iX4OAN4xBKG/IFPwfH3agtPEia6YnhsADT + */ + soap->userid = NULL; + soap->passwd = NULL; + soap->proxy_userid = NULL; + soap->proxy_passwd = NULL; + soap->keep_alive = keep_alive; + soap->length = length; + soap->count = count; + soap->mode = m; + soap->omode = om; + soap->status = status; + soap->action = action; + soap->version = version; + soap->http_content = http_content; + soap->http_extra_header = http_extra_header; + soap->bearer = bearer; + } + return SOAP_OK; +} +#endif + +/******************************************************************************/ + +SOAP_FMAC1 +char* +SOAP_FMAC2 +soap_s2base64(struct soap *soap, const unsigned char *s, char *t, int n) +{ + int i; + unsigned long m; + char *p; + if (!t) + t = (char*)soap_malloc(soap, (n + 2) / 3 * 4 + 1); + if (!t) + return NULL; + p = t; + t[0] = '\0'; + if (!s) + return p; + for (; n > 2; n -= 3, s += 3) + { + m = s[0]; + m = (m << 8) | s[1]; + m = (m << 8) | s[2]; + for (i = 4; i > 0; m >>= 6) + t[--i] = soap_base64o[m & 0x3F]; + t += 4; + } + t[0] = '\0'; + if (n > 0) /* 0 < n <= 2 implies that t[0..4] is allocated (base64 scaling formula) */ + { + m = 0; + for (i = 0; i < n; i++) + m = (m << 8) | *s++; + for (; i < 3; i++) + m <<= 8; + for (i = 4; i > 0; m >>= 6) + t[--i] = soap_base64o[m & 0x3F]; + for (i = 3; i > n; i--) + t[i] = '='; + t[4] = '\0'; + } + return p; +} + +/******************************************************************************/ + +SOAP_FMAC1 +const char* +SOAP_FMAC2 +soap_base642s(struct soap *soap, const char *s, char *t, size_t l, int *n) +{ + size_t i, j; + soap_wchar c; + unsigned long m; + const char *p; + if (n) + *n = 0; + if (!s || !*s) + { + if (soap->error) + return NULL; + return SOAP_NON_NULL; + } + if (!t) + { + l = (strlen(s) + 3) / 4 * 3 + 1; /* space for raw binary and \0 */ + t = (char*)soap_malloc(soap, l); + } + if (!t) + return NULL; + p = t; + for (i = 0; ; i += 3, l -= 3) + { + m = 0; + j = 0; + while (j < 4) + { + c = *s++; + if (c == '=' || !c) + { + if (l >= j - 1) + { + switch (j) + { + case 2: + *t++ = (char)((m >> 4) & 0xFF); + i++; + l--; + break; + case 3: + *t++ = (char)((m >> 10) & 0xFF); + *t++ = (char)((m >> 2) & 0xFF); + i += 2; + l -= 2; + } + } + if (n) + *n = (int)i; + if (l) + *t = '\0'; + return p; + } + c -= '+'; + if (c >= 0 && c <= 79) + { + int b = soap_base64i[c]; + if (b >= 64) + { + soap->error = SOAP_TYPE; + return NULL; + } + m = (m << 6) + b; + j++; + } + else if (!soap_coblank(c + '+')) + { + soap->error = SOAP_TYPE; + return NULL; + } + } + if (l < 3) + { + if (n) + *n = (int)i; + if (l) + *t = '\0'; + return p; + } + *t++ = (char)((m >> 16) & 0xFF); + *t++ = (char)((m >> 8) & 0xFF); + *t++ = (char)(m & 0xFF); + } +} + +/******************************************************************************/ + +SOAP_FMAC1 +char* +SOAP_FMAC2 +soap_s2hex(struct soap *soap, const unsigned char *s, char *t, int n) +{ + char *p; + if (!t) + t = (char*)soap_malloc(soap, 2 * n + 1); + if (!t) + return NULL; + p = t; + t[0] = '\0'; + if (s) + { + for (; n > 0; n--) + { + int m = *s++; + *t++ = (char)((m >> 4) + (m > 159 ? 'a' - 10 : '0')); + m &= 0x0F; + *t++ = (char)(m + (m > 9 ? 'a' - 10 : '0')); + } + } + *t++ = '\0'; + return p; +} + +/******************************************************************************/ + +SOAP_FMAC1 +const char* +SOAP_FMAC2 +soap_hex2s(struct soap *soap, const char *s, char *t, size_t l, int *n) +{ + const char *p; + if (n) + *n = 0; + if (!s || !*s) + { + if (soap->error) + return NULL; + return SOAP_NON_NULL; + } + if (!t) + { + l = strlen(s) / 2 + 1; /* make sure enough space for \0 */ + t = (char*)soap_malloc(soap, l); + } + if (!t) + return NULL; + p = t; + while (l) + { + int d1, d2; + d1 = *s++; + if (!d1) + break; + d2 = *s++; + if (!d2) + break; + *t++ = (char)(((d1 >= 'A' ? (d1 & 0x7) + 9 : d1 - '0') << 4) + (d2 >= 'A' ? (d2 & 0x7) + 9 : d2 - '0')); + l--; + } + if (n) + *n = (int)(t - p); + if (l) + *t = '\0'; + return p; +} + +/******************************************************************************/ + +#ifndef WITH_NOHTTP +SOAP_FMAC1 +const char * +SOAP_FMAC2 +soap_http_content_type(struct soap *soap, int status) +{ + if (soap->status != SOAP_GET && soap->status != SOAP_DEL && soap->status != SOAP_CONNECT) + { + const char *s = "text/xml; charset=utf-8"; +#ifndef WITH_LEANER + const char *r = NULL; + size_t n; +#endif + if (((status >= SOAP_FILE && status < SOAP_FILE + 600) || soap->status == SOAP_PUT || soap->status == SOAP_POST_FILE || soap->status == SOAP_PATCH) && soap->http_content && *soap->http_content && !strchr(soap->http_content, 10) && !strchr(soap->http_content, 13)) + s = soap->http_content; + else if (status == SOAP_HTML) + s = "text/html; charset=utf-8"; + else if (soap->version == 2) + s = "application/soap+xml; charset=utf-8"; + soap->http_content = NULL; /* use http_content once (assign new value before each call) */ +#ifndef WITH_LEANER + if (soap->mode & (SOAP_ENC_DIME | SOAP_ENC_MTOM)) + { + if ((soap->mode & SOAP_ENC_MTOM)) + { + if (soap->version == 2) + r = "application/soap+xml"; + else + r = "text/xml"; + s = "application/xop+xml"; + } + else + { + s = "application/dime"; + } + } + if ((soap->mode & SOAP_ENC_MIME) && soap->mime.boundary) + { + const char *t; + size_t l; + (SOAP_SNPRINTF(soap->tmpbuf, sizeof(soap->tmpbuf), strlen(soap->mime.boundary) + 53), "multipart/related; charset=utf-8; boundary=\"%s\"; type=\"", soap->mime.boundary); + t = strchr(s, ';'); + if (t) + n = t - s; + else + n = strlen(s); + l = strlen(soap->tmpbuf); + if (sizeof(soap->tmpbuf) > l + n) + (void)soap_strncpy(soap->tmpbuf + l, sizeof(soap->tmpbuf) - l, s, n); + if (soap->mime.start) + { + l = strlen(soap->tmpbuf); + (SOAP_SNPRINTF(soap->tmpbuf + l, sizeof(soap->tmpbuf) - l, strlen(soap->mime.start) + 10), "\"; start=\"%s", soap->mime.start); + } + if (r) + { + l = strlen(soap->tmpbuf); + (SOAP_SNPRINTF(soap->tmpbuf + l, sizeof(soap->tmpbuf) - l, strlen(r) + 15), "\"; start-info=\"%s", r); + } + l = strlen(soap->tmpbuf); + if (sizeof(soap->tmpbuf) > l) + soap_strcpy(soap->tmpbuf + l, sizeof(soap->tmpbuf) - l, "\""); + } + else + { + soap_strcpy(soap->tmpbuf, sizeof(soap->tmpbuf), s); + } + if (status == SOAP_OK && soap->version == 2 && soap->action) + { + size_t l = strlen(soap->tmpbuf); + n = strlen(soap->action); + (SOAP_SNPRINTF(soap->tmpbuf + l, sizeof(soap->tmpbuf) - l, n + 11), "; action=\"%s\"", soap->action); + } +#else + soap_strcpy(soap->tmpbuf, sizeof(soap->tmpbuf), s); +#endif + return soap->tmpbuf; + } + return NULL; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_NOHTTP +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_puthttphdr(struct soap *soap, int status, ULONG64 count) +{ + int err = SOAP_OK; + if (soap_http_content_type(soap, status)) + { + err = soap->fposthdr(soap, "Content-Type", soap->tmpbuf); + if (err) + return err; +#ifdef WITH_ZLIB + if ((soap->omode & SOAP_ENC_ZLIB)) + { +#ifdef WITH_GZIP + err = soap->fposthdr(soap, "Content-Encoding", soap->zlib_out == SOAP_ZLIB_DEFLATE ? "deflate" : "gzip"); +#else + err = soap->fposthdr(soap, "Content-Encoding", "deflate"); +#endif + if (err) + return err; + } +#endif +#ifndef WITH_LEANER + if ((soap->omode & SOAP_IO) == SOAP_IO_CHUNK) + { + err = soap->fposthdr(soap, "Transfer-Encoding", "chunked"); + } + else +#endif + { + (SOAP_SNPRINTF(soap->tmpbuf, sizeof(soap->tmpbuf), 20), SOAP_ULONG_FORMAT, count); + err = soap->fposthdr(soap, "Content-Length", soap->tmpbuf); + } + if (err) + return err; + } + if (soap->http_extra_header) + { + const char *header = soap->http_extra_header; + soap->http_extra_header = NULL; /* use http_extra_header once (assign new value before each call) */ + if (*header) + { + err = soap_send(soap, header); + if (err) + return err; + err = soap_send_raw(soap, "\r\n", 2); + if (err) + return err; + } + } + if (soap->keep_alive) + { + if (soap->keep_alive > 0 && soap->recv_timeout) + { + int t = soap->recv_timeout; + if (t < 0) + t = 1; + (SOAP_SNPRINTF(soap->tmpbuf, sizeof(soap->tmpbuf), 20), "timeout=%d, max=%d", soap->recv_timeout, soap->keep_alive); + err = soap->fposthdr(soap, "Keep-Alive", soap->tmpbuf); + if (err) + return err; + } + return soap->fposthdr(soap, "Connection", "keep-alive"); + } + return soap->fposthdr(soap, "Connection", "close"); +} +#endif + +/******************************************************************************/ + +#ifndef WITH_LEAN +static const char* +soap_set_validation_fault(struct soap *soap, const char *s, const char *t) +{ + if (!t) + t = SOAP_STR_EOS; + if (*soap->tag) + (SOAP_SNPRINTF(soap->msgbuf, sizeof(soap->msgbuf), strlen(s) + strlen(t) + strlen(soap->tag) + 47), "Validation constraint violation: %s%s in element '%s'", s, t, soap->tag); + else + (SOAP_SNPRINTF(soap->msgbuf, sizeof(soap->msgbuf), strlen(s) + strlen(t) + 33), "Validation constraint violation: %s%s", s, t); + return soap->msgbuf; +} +#endif + +/******************************************************************************/ + +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_set_fault(struct soap *soap) +{ + const char **c; + const char **s; + if (soap->version == 0) + soap_version(soap); + c = soap_faultcode(soap); + s = soap_faultstring(soap); + if (soap->fseterror) + soap->fseterror(soap, c, s); + if (!*c) + { + if (soap->version == 2) + *c = "SOAP-ENV:Sender"; + else if (soap->version == 1) + *c = "SOAP-ENV:Client"; + else + *c = ""; + } + if (*s) + return; + if (soap->error >= SOAP_POST) + soap->error = SOAP_HTTP_METHOD; + switch (soap->error) + { +#ifndef WITH_LEAN + case SOAP_CLI_FAULT: + *s = "Client fault"; + break; + case SOAP_SVR_FAULT: + *s = "Server fault"; + break; + case SOAP_TAG_MISMATCH: + *s = soap_set_validation_fault(soap, "tag name or namespace mismatch", NULL); + break; + case SOAP_TYPE: + if (*soap->type) + *s = soap_set_validation_fault(soap, "type mismatch ", soap->type); + else if (*soap->arrayType) + *s = soap_set_validation_fault(soap, "array type mismatch", NULL); + else + *s = soap_set_validation_fault(soap, "invalid value", NULL); + break; + case SOAP_SYNTAX_ERROR: + *s = soap_set_validation_fault(soap, "syntax error", NULL); + break; + case SOAP_NO_TAG: + if (soap->version == 0 && soap->level == 0) + *s = soap_set_validation_fault(soap, "root element expected", NULL); + else if (soap->level == 0) + *s = soap_set_validation_fault(soap, "SOAP message expected", NULL); + else + *s = soap_set_validation_fault(soap, "element tag expected", NULL); + break; + case SOAP_END_TAG: + *s = soap_set_validation_fault(soap, "closing tag expected", NULL); + break; + case SOAP_MUSTUNDERSTAND: + *c = "SOAP-ENV:MustUnderstand"; + (SOAP_SNPRINTF(soap->msgbuf, sizeof(soap->msgbuf), strlen(soap->tag) + 65), "The data in element '%s' must be understood but cannot be processed", soap->tag); + *s = soap->msgbuf; + break; + case SOAP_VERSIONMISMATCH: + *c = "SOAP-ENV:VersionMismatch"; + *s = "Invalid SOAP message or SOAP version mismatch"; + break; + case SOAP_DATAENCODINGUNKNOWN: + *c = "SOAP-ENV:DataEncodingUnknown"; + *s = "Unsupported SOAP data encoding"; + break; + case SOAP_NAMESPACE: + *s = soap_set_validation_fault(soap, "namespace error", NULL); + break; + case SOAP_USER_ERROR: + *s = "User data access error"; + break; + case SOAP_NO_METHOD: + (SOAP_SNPRINTF(soap->msgbuf, sizeof(soap->msgbuf), strlen(soap->tag) + 66), "Method '%s' not implemented: method name or namespace not recognized", soap->tag); + *s = soap->msgbuf; + break; + case SOAP_NO_DATA: + *s = "Data required for operation"; + break; + case SOAP_GET_METHOD: + *s = "HTTP GET method not implemented"; + break; + case SOAP_PUT_METHOD: + *s = "HTTP PUT method not implemented"; + break; + case SOAP_PATCH_METHOD: + *s = "HTTP PATCH method not implemented"; + break; + case SOAP_DEL_METHOD: + *s = "HTTP DELETE method not implemented"; + break; + case SOAP_HTTP_METHOD: + *s = "HTTP method error"; + break; + case SOAP_EOM: + *s = "Out of memory"; + break; + case SOAP_MOE: + *s = "Memory overflow or memory corruption error"; + break; + case SOAP_HDR: + *s = "Header line too long"; + break; + case SOAP_IOB: + *s = "Array index out of bounds"; + break; + case SOAP_NULL: + *s = soap_set_validation_fault(soap, "nil not allowed", NULL); + break; + case SOAP_DUPLICATE_ID: + *s = soap_set_validation_fault(soap, "multiple elements (use the SOAP_XML_TREE flag) with duplicate id ", soap->id); + if (soap->version == 2) + *soap_faultsubcode(soap) = "SOAP-ENC:DuplicateID"; + break; + case SOAP_MISSING_ID: + *s = soap_set_validation_fault(soap, "missing id for ref ", soap->id); + if (soap->version == 2) + *soap_faultsubcode(soap) = "SOAP-ENC:MissingID"; + break; + case SOAP_HREF: + *s = soap_set_validation_fault(soap, "incompatible object type id-ref ", soap->id); + break; + case SOAP_FAULT: + break; +#ifndef WITH_NOIO + case SOAP_UDP_ERROR: + *s = "Message too large for UDP packet"; + break; + case SOAP_TCP_ERROR: + *s = tcp_error(soap); + break; +#endif + case SOAP_HTTP_ERROR: + *s = "An HTTP processing error occurred"; + break; + case SOAP_NTLM_ERROR: + *s = "An HTTP NTLM authentication error occurred"; + break; + case SOAP_SSL_ERROR: +#if defined(WITH_OPENSSL) || defined(WITH_GNUTLS) || defined(WITH_WOLFSSL) || defined(WITH_SYSTEMSSL) + *s = "SSL/TLS error"; +#else + *s = "OpenSSL not installed: recompile with -DWITH_OPENSSL"; +#endif + break; + case SOAP_PLUGIN_ERROR: + *s = "Plugin registry error"; + break; + case SOAP_DIME_ERROR: + *s = "DIME format error or max DIME size exceeds SOAP_MAXDIMESIZE currently set to " SOAP_XSTRINGIFY(SOAP_MAXDIMESIZE); + break; + case SOAP_DIME_HREF: + *s = "DIME href to missing attachment"; + break; + case SOAP_DIME_MISMATCH: + *s = "DIME version/transmission error"; + break; + case SOAP_DIME_END: + *s = "End of DIME error"; + break; + case SOAP_MIME_ERROR: + *s = "MIME format error"; + break; + case SOAP_MIME_HREF: + *s = "MIME href to missing attachment"; + break; + case SOAP_MIME_END: + *s = "End of MIME error"; + break; + case SOAP_ZLIB_ERROR: +#ifdef WITH_ZLIB + (SOAP_SNPRINTF(soap->msgbuf, sizeof(soap->msgbuf), (soap->d_stream && soap->d_stream->msg ? strlen(soap->d_stream->msg) : 0) + 19), "Zlib/gzip error: '%s'", soap->d_stream && soap->d_stream->msg ? soap->d_stream->msg : SOAP_STR_EOS); + *s = soap->msgbuf; +#else + *s = "Zlib/gzip not installed for (de)compression: recompile with -DWITH_GZIP"; +#endif + break; + case SOAP_REQUIRED: + *s = soap_set_validation_fault(soap, "missing required attribute", NULL); + break; + case SOAP_PROHIBITED: + *s = soap_set_validation_fault(soap, "prohibited attribute present", NULL); + break; + case SOAP_LEVEL: + *s = "Maximum XML nesting depth level exceeded: increase maxlevel"; + break; + case SOAP_LENGTH: + *s = soap_set_validation_fault(soap, "value range or content length violation", NULL); + break; + case SOAP_OCCURS: + *s = soap_set_validation_fault(soap, "occurrence constraint violation", NULL); + break; + case SOAP_FIXED: + *s = soap_set_validation_fault(soap, "value does not match the fixed value required", NULL); + break; + case SOAP_EMPTY: + *s = soap_set_validation_fault(soap, "empty value provided where a value is required", NULL); + break; + case SOAP_FD_EXCEEDED: + *s = "Maximum number of open connections was reached: increase FD_SETSIZE or define HAVE_POLL"; + break; + case SOAP_UTF_ERROR: + *s = "UTF content encoding error"; + break; + case SOAP_STOP: + *s = "Stopped: service request already handled by plugin (informative)"; + break; +#endif + case SOAP_EOF: +#ifndef WITH_NOIO + *s = soap_strerror(soap); /* *s = soap->msgbuf */ +#ifndef WITH_LEAN + if (strlen(soap->msgbuf) + 25 < sizeof(soap->msgbuf)) + { + (void)soap_memmove((void*)(soap->msgbuf + 25), sizeof(soap->tmpbuf) - 25, (const void*)soap->msgbuf, strlen(soap->msgbuf) + 1); + if (soap->is) +#if defined(__cplusplus) && !defined(WITH_COMPAT) + (void)soap_memcpy((void*)soap->msgbuf, sizeof(soap->msgbuf), (const void*)"End or bad std::istream: ", 25); +#else + (void)soap_memcpy((void*)soap->msgbuf, sizeof(soap->msgbuf), (const void*)"End at NUL buffer input: ", 25); +#endif + else + (void)soap_memcpy((void*)soap->msgbuf, sizeof(soap->msgbuf), (const void*)"End of file or no input: ", 25); + } +#endif + break; +#else + *s = "End of file or no input"; + break; +#endif + case SOAP_ERR: + *s = "An unspecified error occurred"; + break; + default: +#ifndef WITH_NOHTTP +#ifndef WITH_LEAN + if (soap->error >= 200 && soap->error < 600) + { + const char *t = http_error(soap, soap->error); + (SOAP_SNPRINTF(soap->msgbuf, sizeof(soap->msgbuf), strlen(t) + 54), "Error %d: HTTP %d %s", soap->error, soap->error, t); + *s = soap->msgbuf; + } + else +#endif +#endif + { + (SOAP_SNPRINTF(soap->msgbuf, sizeof(soap->msgbuf), 26), "Error %d", soap->error); + *s = soap->msgbuf; + } + } +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_send_fault(struct soap *soap) +{ + int status = soap->error; + if (status == SOAP_OK || status == SOAP_STOP) + return soap_closesock(soap); +#ifndef WITH_NOHTTP + if (status >= 200 && status <= 299) + return soap_send_empty_response(soap, status); +#endif + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Sending back fault struct for error code %d\n", soap->error)); + soap->keep_alive = 0; /* error: close connection later by disabling keep-alive here */ + soap_set_fault(soap); + if (soap->error < 200 && soap->error != SOAP_FAULT) + soap->header = NULL; + if (status != SOAP_EOF || (!soap->recv_timeout && !soap->send_timeout)) + { + int r = 1; +#ifndef WITH_NOIO + if (soap->fpoll && soap->fpoll(soap)) + { + r = 0; + } +#ifndef WITH_LEAN + else if (soap_valid_socket(soap->socket)) + { + r = tcp_select(soap, soap->socket, SOAP_TCP_SELECT_RCV | SOAP_TCP_SELECT_SND, 0); + if (r > 0) + { + int t; + if (!(r & SOAP_TCP_SELECT_SND) + || ((r & SOAP_TCP_SELECT_RCV) + && recv(soap->socket, (char*)&t, 1, MSG_PEEK) < 0)) + r = 0; + } + } +#endif +#endif + if (r > 0) + { + soap->error = SOAP_OK; + if (soap->version > 0) + { + soap->encodingStyle = NULL; /* no encodingStyle in Faults */ + soap_serializeheader(soap); + soap_serializefault(soap); + (void)soap_begin_count(soap); + if ((soap->mode & SOAP_IO_LENGTH)) + { + if (soap_envelope_begin_out(soap) + || soap_putheader(soap) + || soap_body_begin_out(soap) + || soap_putfault(soap) + || soap_body_end_out(soap) + || soap_envelope_end_out(soap)) + return soap_closesock(soap); + } + (void)soap_end_count(soap); + if (soap_response(soap, status) + || soap_envelope_begin_out(soap) + || soap_putheader(soap) + || soap_body_begin_out(soap) + || soap_putfault(soap) + || soap_body_end_out(soap) + || soap_envelope_end_out(soap) + || soap_end_send(soap)) + return soap_closesock(soap); + } + else + { + const char *s = *soap_faultstring(soap); + const char **d = soap_faultdetail(soap); + (void)soap_begin_count(soap); + if ((soap->mode & SOAP_IO_LENGTH)) + if (soap_element_begin_out(soap, "fault", 0, NULL) + || soap_outstring(soap, "reason", 0, (char*const*)&s, NULL, 0) + || (d && *d && soap_outliteral(soap, "detail", (char*const*)d, NULL)) + || soap_element_end_out(soap, "fault")) + return soap_closesock(soap); + (void)soap_end_count(soap); + if (soap_response(soap, status) + || soap_element_begin_out(soap, "fault", 0, NULL) + || soap_outstring(soap, "reason", 0, (char*const*)&s, NULL, 0) + || (d && *d && soap_outliteral(soap, "detail", (char*const*)d, NULL)) + || soap_element_end_out(soap, "fault") + || soap_end_send(soap)) + return soap_closesock(soap); + } + } + } + soap->error = status; + return soap_closesock(soap); +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_recv_fault(struct soap *soap, int check) +{ + int status = soap->status; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Check (%d) if receiving SOAP Fault (status = %d)\n", check, status)); + if (!check) + { + /* try getfault when no tag or tag mismatched at level 2, otherwise close and return SOAP_TAG_MISMATCH or HTTP error code */ + if (soap->error != SOAP_NO_TAG && (soap->error != SOAP_TAG_MISMATCH || soap->level != 2)) + { + if (soap->error == SOAP_TAG_MISMATCH && soap->level == 0) + { + soap->error = SOAP_OK; + if (!soap_element_begin_in(soap, "fault", 0, NULL)) + { + char *s = NULL, *d = NULL; + (void)soap_instring(soap, "reason", &s, NULL, 0, 1, 0, -1, NULL); + (void)soap_inliteral(soap, "detail", &d); + if (!soap_element_end_in(soap, "fault") && !soap_end_recv(soap)) + { + *soap_faultstring(soap) = s; + if (d && *d) + *soap_faultdetail(soap) = d; + if (status) + soap->error = status; + else + soap->error = SOAP_FAULT; + soap_set_fault(soap); + return soap_closesock(soap); + } + } + soap->error = SOAP_TAG_MISMATCH; + } + if (status && (status < 200 || status > 299)) + soap->error = status; + return soap_closesock(soap); + } + } + soap->error = SOAP_OK; + if (soap_getfault(soap)) + { + /* if check>0 and no SOAP Fault is present and no HTTP error then just return to parse request */ + if (check + && (status == 0 || (status >= 200 && status <= 299)) + && ((soap->error == SOAP_TAG_MISMATCH && soap->level <= 2) || soap->error == SOAP_NO_TAG)) + return soap->error = SOAP_OK; + /* if check=0 and empty SOAP Body and encodingStyle is NULL and no HTTP error then just return */ + if (!check + && (status == 0 || (status >= 200 && status <= 299)) + && !soap->encodingStyle + && (soap->error == SOAP_NO_TAG && soap->level <= 2)) + return soap->error = SOAP_OK; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Error: soap_get_soapfault() failed with error %d at level %u tag '%s'\n", soap->error, soap->level, soap->tag)); + *soap_faultcode(soap) = (soap->version == 2 ? "SOAP-ENV:Sender" : "SOAP-ENV:Client"); + if (status) + soap->error = status; + else + soap->error = status = SOAP_NO_DATA; + soap_set_fault(soap); + } + else + { + const char *s = *soap_faultcode(soap); + if (!soap_match_tag(soap, s, "SOAP-ENV:Server") + || !soap_match_tag(soap, s, "SOAP-ENV:Receiver")) + { + status = SOAP_SVR_FAULT; + } + else if (!soap_match_tag(soap, s, "SOAP-ENV:Client") + || !soap_match_tag(soap, s, "SOAP-ENV:Sender")) + { + status = SOAP_CLI_FAULT; + } + else if (!soap_match_tag(soap, s, "SOAP-ENV:MustUnderstand")) + { + status = SOAP_MUSTUNDERSTAND; + } + else if (!soap_match_tag(soap, s, "SOAP-ENV:VersionMismatch")) + { + status = SOAP_VERSIONMISMATCH; + } + else + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Received SOAP Fault code %s\n", s)); + status = SOAP_FAULT; + } + if (!soap_body_end_in(soap)) + soap_envelope_end_in(soap); + } + (void)soap_end_recv(soap); + soap->error = status; + return soap_closesock(soap); +} + +/******************************************************************************/ + +#ifndef WITH_NOHTTP +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_send_empty_response(struct soap *soap, int httpstatuscode) +{ + soap_mode m = soap->omode; + if (!(m & SOAP_IO_UDP)) + { + soap->count = 0; + if ((m & SOAP_IO) == SOAP_IO_CHUNK) + soap->omode = (m & ~SOAP_IO) | SOAP_IO_BUFFER; + (void)soap_response(soap, httpstatuscode); + (void)soap_end_send(soap); /* force end of sends */ + soap->error = SOAP_STOP; /* stops the server from returning another response */ + soap->omode = m; + } + return soap_closesock(soap); +} +#endif + +/******************************************************************************/ + +#ifndef WITH_NOHTTP +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_recv_empty_response(struct soap *soap) +{ + soap->error = SOAP_OK; + if (!(soap->omode & SOAP_IO_UDP) && !(soap->omode & SOAP_ENC_PLAIN)) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Receiving empty response\n")); + if (soap_begin_recv(soap) == SOAP_OK) + { + if (soap_http_skip_body(soap) || soap_end_recv(soap)) + return soap_closesock(soap); + if (soap->status < SOAP_STOP) + soap->error = soap->status; + } + if (soap->error == 200 || soap->error == 201 || soap->error == 202 || soap->error == 204) + { + soap->error = SOAP_OK; + } + } +#ifndef WITH_LEANER + else if ((soap->fprepareinitrecv && (soap->error = soap->fprepareinitrecv(soap))) + || (soap->fpreparefinalrecv && (soap->error = soap->fpreparefinalrecv(soap)))) + { + return soap->error; + } +#endif + return soap_closesock(soap); +} +#endif + +/******************************************************************************/ + +#ifndef WITH_NOIO +static const char* +soap_strerror(struct soap *soap) +{ + int err = soap->errnum; + *soap->msgbuf = '\0'; + if (err) + { +#ifndef WIN32 +# ifdef HAVE_STRERROR_R +# if !defined(_GNU_SOURCE) || (!(~_GNU_SOURCE+1) && ((!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)) || (_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600))) + err = strerror_r(err, soap->msgbuf, sizeof(soap->msgbuf)); /* XSI-compliant */ + if (err != 0) + soap_strcpy(soap->msgbuf, sizeof(soap->msgbuf), "unknown error"); +# else + return strerror_r(err, soap->msgbuf, sizeof(soap->msgbuf)); /* GNU-specific */ +# endif +# else + return strerror(err); +# endif +#else +#ifndef UNDER_CE + DWORD len; + *soap->msgbuf = '\0'; + len = FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, err, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPSTR)soap->msgbuf, (DWORD)sizeof(soap->msgbuf), NULL); +#else + DWORD i, len; + *soap->msgbuf = '\0'; + len = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, err, 0, (LPTSTR)soap->msgbuf, (DWORD)(sizeof(soap->msgbuf)/sizeof(TCHAR)), NULL); + for (i = 0; i <= len; i++) + { + if (((TCHAR*)soap->msgbuf)[i] < 0x80) + soap->msgbuf[i] = (char)((TCHAR*)soap->msgbuf)[i]; + else + soap->msgbuf[i] = '?'; + } +#endif +#endif + } + else + { + if (soap->recv_maxlength && soap->count > soap->recv_maxlength) + { + soap_strcpy(soap->msgbuf, sizeof(soap->msgbuf), "max message length exceeded"); + } + else + { + int tt = soap->transfer_timeout, rt = soap->recv_timeout, st = soap->send_timeout; +#ifndef WITH_LEAN + int tu = ' ', ru = ' ', su = ' '; +#endif + soap_strcpy(soap->msgbuf, sizeof(soap->msgbuf), "message transfer interrupted"); + if (tt | rt || st) + soap_strcpy(soap->msgbuf + 28, sizeof(soap->msgbuf) - 28, " or timed out"); +#ifndef WITH_LEAN + if (tt < 0) + { + tt = -tt; + tu = 'u'; + } + if (rt < 0) + { + rt = -rt; + ru = 'u'; + } + if (st < 0) + { + st = -st; + su = 'u'; + } + if (tt) + { + size_t l = strlen(soap->msgbuf); + (SOAP_SNPRINTF(soap->msgbuf + l, sizeof(soap->msgbuf) - l, 43), " (%d%csec max transfer time)", tt, tu); + } + if (rt) + { + size_t l = strlen(soap->msgbuf); + (SOAP_SNPRINTF(soap->msgbuf + l, sizeof(soap->msgbuf) - l, 40), " (%d%csec max recv delay)", rt, ru); + } + if (st) + { + size_t l = strlen(soap->msgbuf); + (SOAP_SNPRINTF(soap->msgbuf + l, sizeof(soap->msgbuf) - l, 40), " (%d%csec max send delay)", st, su); + } +#endif + } + } + return soap->msgbuf; +} +#endif + +/******************************************************************************/ + +static int +soap_set_error(struct soap *soap, const char *faultcode, const char *faultsubcodeQName, const char *faultstring, const char *faultdetailXML, int soaperror) +{ + *soap_faultcode(soap) = faultcode; + if (faultsubcodeQName) + *soap_faultsubcode(soap) = faultsubcodeQName; + *soap_faultstring(soap) = faultstring; + if (faultdetailXML && *faultdetailXML) + { + const char **s = soap_faultdetail(soap); + if (s) + *s = faultdetailXML; + } + return soap->error = soaperror; +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_set_sender_error(struct soap *soap, const char *faultstring, const char *faultdetailXML, int soaperror) +{ + return soap_set_error(soap, soap->version == 2 ? "SOAP-ENV:Sender" : soap->version == 1 ? "SOAP-ENV:Client" : "at sender", NULL, faultstring, faultdetailXML, soaperror); +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_set_receiver_error(struct soap *soap, const char *faultstring, const char *faultdetailXML, int soaperror) +{ + return soap_set_error(soap, soap->version == 2 ? "SOAP-ENV:Receiver" : soap->version == 1 ? "SOAP-ENV:Server" : "detected", NULL, faultstring, faultdetailXML, soaperror); +} + +/******************************************************************************/ + +static int +soap_copy_fault(struct soap *soap, const char *faultcode, const char *faultsubcodeQName, const char *faultstring, const char *faultdetailXML) +{ + char *r = NULL, *s = NULL, *t = NULL; + DBGFUN2("soap_copy_fault", "code=%s", faultcode ? faultcode : "(null)", "string=%s", faultstring ? faultstring : "(null)") + if (faultsubcodeQName) + r = soap_strdup(soap, faultsubcodeQName); + if (faultstring) + s = soap_strdup(soap, faultstring); + if (faultdetailXML) + t = soap_strdup(soap, faultdetailXML); + return soap_set_error(soap, faultcode, r, s, t, SOAP_FAULT); +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_sender_fault(struct soap *soap, const char *faultstring, const char *faultdetailXML) +{ + return soap_sender_fault_subcode(soap, NULL, faultstring, faultdetailXML); +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_sender_fault_subcode(struct soap *soap, const char *faultsubcodeQName, const char *faultstring, const char *faultdetailXML) +{ + return soap_copy_fault(soap, soap->version == 2 ? "SOAP-ENV:Sender" : soap->version == 1 ? "SOAP-ENV:Client" : "at source", faultsubcodeQName, faultstring, faultdetailXML); +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_receiver_fault(struct soap *soap, const char *faultstring, const char *faultdetailXML) +{ + return soap_receiver_fault_subcode(soap, NULL, faultstring, faultdetailXML); +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_receiver_fault_subcode(struct soap *soap, const char *faultsubcodeQName, const char *faultstring, const char *faultdetailXML) +{ + return soap_copy_fault(soap, soap->version == 2 ? "SOAP-ENV:Receiver" : soap->version == 1 ? "SOAP-ENV:Server" : "is internal", faultsubcodeQName, faultstring, faultdetailXML); +} + +/******************************************************************************/ + +#ifndef WITH_NOSTDLIB +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_print_fault(struct soap *soap, FILE *fd) +{ + if (soap_check_state(soap)) + { + fprintf(fd, "Error: soap struct state not initialized\n"); + } + else if (soap->error) + { + const char **c, *v = NULL, *s, *d; + c = soap_faultcode(soap); + if (!*c) + { + soap_set_fault(soap); + c = soap_faultcode(soap); + } + if (soap->version == 2) + v = soap_fault_subcode(soap); + s = soap_fault_string(soap); + d = soap_fault_detail(soap); + fprintf(fd, "%s%d fault %s [%s]\n\"%s\"\nDetail: %s\n", soap->version ? "SOAP 1." : "Error ", soap->version ? (int)soap->version : soap->error, *c, v ? v : "no subcode", s ? s : "[no reason]", d ? d : "[no detail]"); + } +} +#endif + +/******************************************************************************/ + +#ifdef __cplusplus +#ifndef WITH_LEAN +#ifndef WITH_NOSTDLIB +#ifndef WITH_COMPAT +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_stream_fault(struct soap *soap, std::ostream& os) +{ + if (soap_check_state(soap)) + { + os << "Error: soap struct state not initialized\n"; + } + else if (soap->error) + { + const char **c, *v = NULL, *s, *d; + c = soap_faultcode(soap); + if (!*c) + { + soap_set_fault(soap); + c = soap_faultcode(soap); + } + if (soap->version == 2) + v = soap_fault_subcode(soap); + s = soap_fault_string(soap); + d = soap_fault_detail(soap); + os << (soap->version ? "SOAP 1." : "Error ") + << (soap->version ? (int)soap->version : soap->error) + << " fault " << *c + << "[" << (v ? v : "no subcode") << "]" + << std::endl + << "\"" << (s ? s : "[no reason]") << "\"" + << std::endl + << "Detail: " << (d ? d : "[no detail]") + << std::endl; + } +} +#endif +#endif +#endif +#endif + +/******************************************************************************/ + +#ifndef WITH_LEAN +#ifndef WITH_NOSTDLIB +SOAP_FMAC1 +char* +SOAP_FMAC2 +soap_sprint_fault(struct soap *soap, char *buf, size_t len) +{ + if (soap_check_state(soap)) + { + soap_strcpy(buf, len, "Error: soap struct not initialized"); + } + else if (soap->error) + { + const char **c, *v = NULL, *s, *d; + c = soap_faultcode(soap); + if (!*c) + { + soap_set_fault(soap); + c = soap_faultcode(soap); + } + if (soap->version == 2) + v = soap_fault_subcode(soap); + if (!v) + v = "no subcode"; + s = soap_fault_string(soap); + if (!s) + s = "[no reason]"; + d = soap_fault_detail(soap); + if (!d) + d = "[no detail]"; + (SOAP_SNPRINTF(buf, len, strlen(*c) + strlen(v) + strlen(s) + strlen(d) + 72), "%s%d fault %s [%s]\n\"%s\"\nDetail: %s\n", soap->version ? "SOAP 1." : "Error ", soap->version ? (int)soap->version : soap->error, *c, v, s, d); + } + else if (len > 0) + { + *buf = '\0'; + } + return buf; +} +#endif +#endif + +/******************************************************************************/ + +#ifndef WITH_NOSTDLIB +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_print_fault_location(struct soap *soap, FILE *fd) +{ +#ifndef WITH_LEAN + int i, j, c1, c2; + if (soap_check_state(soap) == SOAP_OK && soap->error && soap->error != SOAP_STOP && soap->bufidx <= soap->buflen && soap->buflen > 0 && soap->buflen <= sizeof(soap->buf)) + { + i = (int)soap->bufidx - 1; + if (i <= 0) + i = 0; + c1 = soap->buf[i]; + soap->buf[i] = '\0'; + if ((int)soap->buflen >= i + 1024) + j = i + 1023; + else + j = (int)soap->buflen - 1; + c2 = soap->buf[j]; + soap->buf[j] = '\0'; + fprintf(fd, "%s%c\n\n", soap->buf, c1); + if (soap->bufidx < soap->buflen) + fprintf(fd, "%s\n", soap->buf + soap->bufidx); + soap->buf[i] = (char)c1; + soap->buf[j] = (char)c2; + } +#else + (void)soap; + (void)fd; +#endif +} +#endif + +/******************************************************************************/ + +#ifdef __cplusplus +#ifndef WITH_LEAN +#ifndef WITH_NOSTDLIB +#ifndef WITH_COMPAT +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_stream_fault_location(struct soap *soap, std::ostream& os) +{ + int i, j, c1, c2; + if (soap_check_state(soap) == SOAP_OK && soap->error && soap->error != SOAP_STOP && soap->bufidx <= soap->buflen && soap->buflen > 0 && soap->buflen <= sizeof(soap->buf)) + { + i = (int)soap->bufidx - 1; + if (i <= 0) + i = 0; + c1 = soap->buf[i]; + soap->buf[i] = '\0'; + if ((int)soap->buflen >= i + 1024) + j = i + 1023; + else + j = (int)soap->buflen - 1; + c2 = soap->buf[j]; + soap->buf[j] = '\0'; + os << soap->buf << (char)c1 << std::endl << "" << std::endl; + if (soap->bufidx < soap->buflen) + os << soap->buf + soap->bufidx << std::endl; + soap->buf[i] = (char)c1; + soap->buf[j] = (char)c2; + } +} +#endif +#endif +#endif +#endif + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_register_plugin_arg(struct soap *soap, int (*fcreate)(struct soap*, struct soap_plugin*, void*), void *arg) +{ + struct soap_plugin *p; + int err; + p = (struct soap_plugin*)SOAP_MALLOC(soap, sizeof(struct soap_plugin)); + if (!p) + return soap->error = SOAP_EOM; + p->id = NULL; + p->data = NULL; + p->fcopy = NULL; + p->fdelete = NULL; + err = fcreate(soap, p, arg); + if (!err && p->fdelete && p->id) + { + if (!soap_lookup_plugin(soap, p->id)) + { + p->next = soap->plugins; + soap->plugins = p; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Registered '%s' plugin\n", p->id)); + return SOAP_OK; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Could not register plugin '%s': plugin with the same ID already registered\n", p->id)); + p->fdelete(soap, p); + SOAP_FREE(soap, p); + return SOAP_OK; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Could not register plugin '%s': plugin returned error %d or plugin ID not set or fdelete callback not set\n", p->id ? p->id : "plugin ID not set", err)); + SOAP_FREE(soap, p); + soap->error = err ? err : SOAP_PLUGIN_ERROR; + return soap->error; +} + +/******************************************************************************/ + +static void * +fplugin(struct soap *soap, const char *id) +{ + struct soap_plugin *p; + for (p = soap->plugins; p; p = p->next) + if (p->id == id || !strcmp(p->id, id)) + return p->data; + return NULL; +} + +/******************************************************************************/ + +SOAP_FMAC1 +void * +SOAP_FMAC2 +soap_lookup_plugin(struct soap *soap, const char *id) +{ + return soap->fplugin(soap, id); +} + +/******************************************************************************/ + +#ifdef __cplusplus +} +#endif + +/******************************************************************************\ + * + * C++ soap struct methods + * +\******************************************************************************/ + +#ifdef __cplusplus +soap::soap() +{ + soap_init(this); + /* no logs to prevent DEBUG mode leaks when the user calls a soap_init() on this context */ + soap_set_test_logfile(this, NULL); + soap_set_sent_logfile(this, NULL); + soap_set_recv_logfile(this, NULL); +} +#endif + +/******************************************************************************/ + +#ifdef __cplusplus +soap::soap(soap_mode m) +{ + soap_init1(this, m); +} +#endif + +/******************************************************************************/ + +#ifdef __cplusplus +soap::soap(soap_mode im, soap_mode om) +{ + soap_init2(this, im, om); +} +#endif + +/******************************************************************************/ + +#ifdef __cplusplus +soap::soap(const struct soap& soap) +{ + soap_copy_context(this, &soap); +} +#endif + +/******************************************************************************/ + +#ifdef __cplusplus +struct soap& soap::operator=(const struct soap& soap) +{ + soap_done(this); + soap_copy_context(this, &soap); + return *this; +} +#endif + +/******************************************************************************/ + +#ifdef __cplusplus +void soap::destroy() +{ + soap_destroy(this); + soap_end(this); +} +#endif + +/******************************************************************************/ + +#ifdef __cplusplus +soap::~soap() +{ + soap_done(this); +} +#endif + +/******************************************************************************/ diff --git a/DFL_BOM_WL_TOERP/stdsoap2.h b/DFL_BOM_WL_TOERP/stdsoap2.h new file mode 100644 index 0000000..e613721 --- /dev/null +++ b/DFL_BOM_WL_TOERP/stdsoap2.h @@ -0,0 +1,3727 @@ +/* + stdsoap2.h 2.8.131 + + gSOAP runtime engine + +gSOAP XML Web services tools +Copyright (C) 2000-2023, Robert van Engelen, Genivia Inc., All Rights Reserved. +This part of the software is released under ONE of the following licenses: +GPL or the gSOAP public license. +-------------------------------------------------------------------------------- +Contributors: + +Wind River Systems, Inc., for the following addition licensed under the gSOAP +public license: + - vxWorks compatible, enabled with compiler option -DVXWORKS +-------------------------------------------------------------------------------- +gSOAP public license. + +The contents of this file are subject to the gSOAP Public License Version 1.3 +(the "License"); you may not use this file except in compliance with the +License. You may obtain a copy of the License at +http://www.cs.fsu.edu/~engelen/soaplicense.html +Software distributed under the License is distributed on an "AS IS" basis, +WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +for the specific language governing rights and limitations under the License. + +The Initial Developer of the Original Code is Robert A. van Engelen. +Copyright (C) 2000-2023, Robert van Engelen, Genivia Inc., All Rights Reserved. +-------------------------------------------------------------------------------- +GPL license. + +This program is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free Software +Foundation; either version 2 of the License, or (at your option) any later +version. + +This program is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A +PARTICULAR PURPOSE. See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along with +this program; if not, write to the Free Software Foundation, Inc., 59 Temple +Place, Suite 330, Boston, MA 02111-1307 USA + +Author contact information: +engelen@genivia.com / engelen@acm.org + +This program is released under the GPL with the additional exemption that +compiling, linking, and/or using OpenSSL is allowed. +-------------------------------------------------------------------------------- +A commercial use license is available from Genivia, Inc., contact@genivia.com +-------------------------------------------------------------------------------- +*/ + +#define GSOAP_VERSION 208131 + +#ifdef WITH_SOAPDEFS_H +# include "soapdefs.h" /* include user-defined stuff in soapdefs.h */ +#endif + +#ifndef _THREAD_SAFE +# define _THREAD_SAFE +#endif + +#ifndef OPENSERVER +# ifndef _REENTRANT +# define _REENTRANT +# endif +#endif + +#ifdef _WIN32 +# ifndef WIN32 +# define WIN32 +# endif +#endif + +/* for legacy purposes we use WIN32 macro, even when WIN64 is supported */ +#ifdef _WIN64 +# ifndef WIN32 +# define WIN32 +# endif +#endif + +#ifdef WIN32 +# ifdef SOAP_STD_EXPORTS /* dllexport the API functions and classes */ +# ifndef SOAP_STD_API +# define SOAP_STD_API __declspec(dllexport) +# endif +# ifndef SOAP_CMAC +# define SOAP_CMAC SOAP_STD_API /* export soap struct and generated classes */ +# endif +# ifndef SOAP_FMAC1 +# define SOAP_FMAC1 SOAP_STD_API /* export stdsoap2.cpp API */ +# endif +# ifndef SOAP_FMAC3 +# define SOAP_FMAC3 SOAP_STD_API /* export soapC.cpp serializers API */ +# endif +# ifndef SOAP_FMAC5 +# define SOAP_FMAC5 SOAP_STD_API /* export soapClient.cpp and soapServer.cpp API */ +# endif +# endif +#endif + +#ifndef SOAP_FMAC1 /* stdsoap2.h declaration macro */ +# define SOAP_FMAC1 +#endif + +#ifndef SOAP_FMAC2 /* stdsoap2.h declaration macro */ +# define SOAP_FMAC2 +#endif + +#ifndef SOAP_FMAC3 /* (de)serializer declaration macro */ +# define SOAP_FMAC3 +#endif + +#ifndef SOAP_FMAC3S /* string converter for (de)serializer declaration macro */ +# define SOAP_FMAC3S SOAP_FMAC3 +#endif + +#ifndef SOAP_FMAC4 /* (de)serializer declaration macro */ +# define SOAP_FMAC4 +#endif + +#ifndef SOAP_FMAC4S /* string converter for (de)serializer declaration macro */ +# define SOAP_FMAC4S SOAP_FMAC4 +#endif + +#ifndef SOAP_FMAC5 /* stub/skeleton declaration macro */ +# define SOAP_FMAC5 +#endif + +#ifndef SOAP_FMAC6 /* stub/skeleton declaration macro */ +# define SOAP_FMAC6 +#endif + +#ifndef SOAP_CMAC /* class declaration macro */ +# define SOAP_CMAC +#endif + +#ifndef SOAP_NMAC /* namespace table declaration macro */ +# define SOAP_NMAC +#endif + +#ifndef SOAP_SOURCE_STAMP +# define SOAP_SOURCE_STAMP(str) +#endif + +#ifndef STDSOAP_H +#define STDSOAP_H + +#define SOAP_XSTRINGIFY(s) SOAP_STRINGIFY(s) +#define SOAP_STRINGIFY(s) #s + +#if defined(SOAPDEFS_H) && !defined(WITH_SOAPDEFS_H) +# include SOAP_XSTRINGIFY(SOAPDEFS_H) /* include user-defined "SOAPDEFS_H" */ +#endif + +#if defined(__vxworks) || defined(__VXWORKS__) +# ifndef VXWORKS +# define VXWORKS +# endif +#endif + +#ifdef _WIN32_WCE +# ifndef UNDER_CE +# define UNDER_CE _WIN32_WCE +# endif +#endif + +#ifdef UNDER_CE +# ifndef WIN32 +# define WIN32 +# endif +#endif + +#ifdef __BORLANDC__ +# ifdef __clang__ +# ifdef _WIN32 +# ifndef WIN32 +# define WIN32 +# endif +# endif +# else +# ifdef __WIN32__ +# ifndef WIN32 +# define WIN32 +# endif +# endif +# endif +#endif + +#if defined(__CYGWIN__) || defined(__CYGWIN32__) +# ifndef CYGWIN +# define CYGWIN +# endif +#endif + +#ifdef __SYMBIAN32__ +# define SYMBIAN +# undef WIN32 +#endif + +#if defined(__hpux) +# ifndef HP_UX +# define HP_UX +# endif +#endif + +#if defined(__digital__) && defined(__unix__) +# ifndef TRU64 +# define TRU64 +# endif +#endif + +#ifdef __MVS__ +# ifndef OS390 +# define OS390 +# endif +#endif + +#if defined(__sun) && defined(__SVR4) +# ifndef SUN_OS +# define SUN_OS +# endif +#endif + +#ifdef HAVE_CONFIG_H +# include "config.h" +#else +# if defined(UNDER_CE) +# define SOAP_BUFLEN (2048) +# define SOAP_PTRHASH (32) +# define SOAP_IDHASH (19) +# define SOAP_BLKLEN (32) +# define SOAP_TAGLEN (256) +# define SOAP_HDRLEN (1024) +# define SOAP_MAXDIMS (4) +# define HAVE_SSCANF +# elif defined(CYGWIN) +# define HAVE_POLL +# define HAVE_SNPRINTF +# define HAVE_STRRCHR +# define HAVE_STRTOD +# define HAVE_SSCANF +# define HAVE_STRTOL +# define HAVE_STRTOUL +# define HAVE_SYS_TIMEB_H +# define HAVE_FTIME +# define HAVE_RAND_R +# define HAVE_GMTIME_R +# define HAVE_ASCTIME_R +# define HAVE_LOCALTIME_R +# define HAVE_STRERROR_R +# define HAVE_INTTYPES_H +# define HAVE_LOCALE_H +# define HAVE_SOCKLEN_T +# elif defined(WIN32) +# ifdef __BORLANDC__ +# ifdef __clang__ +# define HAVE_STRRCHR +# define HAVE_STRTOD +# define HAVE_SSCANF +# define HAVE_STRTOD_L +# define HAVE_STRTOL +# define HAVE_SYS_TIMEB_H +# define HAVE_FTIME +# define HAVE_GMTIME +# define SOAP_LONG_FORMAT "%lld" +# define SOAP_ULONG_FORMAT "%llu" +# else +# define HAVE_STRRCHR +# define HAVE_STRTOD +# define HAVE_SSCANF +# define HAVE_STRTOD_L +# define HAVE_STRTOL +# define HAVE_SYS_TIMEB_H +# define HAVE_FTIME +# define HAVE_GMTIME +# define SOAP_LONG_FORMAT "%I64d" +# define SOAP_ULONG_FORMAT "%I64u" +# endif +# else +# if _MSC_VER >= 1400 +# define HAVE_SNPRINTF +# endif +# define HAVE_STRRCHR +# define HAVE_STRTOD +# define HAVE_SSCANF +# define HAVE_STRTOD_L +# define HAVE_STRTOL +# define HAVE_STRTOUL +# if _MSC_VER >= 1300 +# define HAVE_STRTOLL /* use _strtoi64 */ +# define HAVE_STRTOULL /* use _strtoui64 */ +# endif +# define HAVE_SYS_TIMEB_H +# define HAVE_FTIME +# define HAVE_GMTIME +# define SOAP_LONG_FORMAT "%I64d" +# define SOAP_ULONG_FORMAT "%I64u" +# define HAVE_LOCALE_H +# endif +# elif defined(__APPLE__) +# define HAVE_POLL +# define HAVE_SNPRINTF +# define HAVE_STRLCPY +# define HAVE_STRRCHR +# define HAVE_STRTOD +# define HAVE_SSCANF +# define HAVE_STRTOD_L +# define HAVE_SSCANF_L +# define HAVE_STRTOL +# define HAVE_STRTOUL +# define HAVE_STRTOLL +# define HAVE_STRTOULL +# define HAVE_RAND_R +# define HAVE_GMTIME_R +# define HAVE_ASCTIME_R +# define HAVE_TM_GMTOFF +# define HAVE_GETTIMEOFDAY +# define HAVE_LOCALTIME_R +# define HAVE_STRERROR_R +# define HAVE_TIMEGM +# define HAVE_INTTYPES_H +# define HAVE_LOCALE_H +# define HAVE_XLOCALE_H +# define HAVE_RANDOM +# define HAVE_SOCKLEN_T +# elif defined(_AIX41) +# define HAVE_SNPRINTF +# define HAVE_STRRCHR +# define HAVE_STRTOD +# define HAVE_SSCANF +# define HAVE_STRTOL +# define HAVE_STRTOUL +# define HAVE_LOCALE_H +# elif defined(_AIX) +# define HAVE_SNPRINTF +# define HAVE_STRRCHR +# define HAVE_STRTOD +# define HAVE_SSCANF +# define HAVE_STRTOL +# define HAVE_STRTOUL +# define HAVE_SYS_TIMEB_H +# define HAVE_FTIME +# define HAVE_RAND_R +# define HAVE_GETHOSTBYNAME_R +# define HAVE_GMTIME_R +# define HAVE_ASCTIME_R +# define HAVE_LOCALTIME_R +# define HAVE_LOCALE_H +# define HAVE_SOCKLEN_T +# elif defined(HP_UX) +# include +# if 0 /* enable if __strtoll and __strtoull are available */ +extern intmax_t __strtoll(const char*, char**, int); +extern intmax_t __strtoull(const char*, char**, int); +# define strtoll __strtoll +# define strtoull __strtoull +# endif +# define HAVE_SNPRINTF +# define HAVE_STRRCHR +# define HAVE_STRTOD +# define HAVE_SSCANF +# define HAVE_STRTOL +# define HAVE_STRTOUL +# define HAVE_STRTOLL +# define HAVE_STRTOULL +# define HAVE_SYS_TIMEB_H +# define HAVE_FTIME +# define HAVE_RAND_R +# define HAVE_GMTIME_R +# define HAVE_ASCTIME_R +# define HAVE_LOCALTIME_R +# define HAVE_ISNAN +# define HAVE_LOCALE_H +# elif defined(FREEBSD) || defined(__FreeBSD__) || defined(OPENBSD) +# define HAVE_POLL +# define HAVE_SNPRINTF +# define HAVE_STRLCPY +# define HAVE_STRRCHR +# define HAVE_STRTOD +# define HAVE_SSCANF +# define HAVE_STRTOD_L +# define HAVE_SSCANF_L +# define HAVE_STRTOL +# define HAVE_STRTOUL +# define HAVE_STRTOLL +# define HAVE_STRTOULL +# define HAVE_GETTIMEOFDAY +# define HAVE_RAND_R +# define HAVE_GMTIME_R +# define HAVE_ASCTIME_R +# define HAVE_LOCALTIME_R +# define HAVE_STRERROR_R +# define SOAP_LONG_FORMAT "%qd" +# define SOAP_ULONG_FORMAT "%qu" +# define HAVE_ISNAN +# define HAVE_ISINF +# define HAVE_INTTYPES_H +# define HAVE_LOCALE_H +# define HAVE_XLOCALE_H +# define HAVE_RANDOM +# define HAVE_SOCKLEN_T +# elif defined(__VMS) +# include +# define HAVE_SNPRINTF +# define HAVE_STRRCHR +# define HAVE_STRTOD +# define HAVE_SSCANF +# define HAVE_STRTOL +# define HAVE_STRTOUL +# define HAVE_SYS_TIMEB_H +# define HAVE_FTIME +# define HAVE_RAND_R +# define HAVE_GMTIME_R +# define HAVE_ASCTIME_R +# define HAVE_LOCALTIME_R +# elif defined(TRU64) +# define HAVE_SNPRINTF +# define HAVE_STRRCHR +# define HAVE_STRTOD +# define HAVE_SSCANF +# define HAVE_STRTOL +# define HAVE_STRTOUL +# define HAVE_GETTIMEOFDAY +# define HAVE_RAND_R +# define HAVE_GMTIME_R +# define HAVE_ASCTIME_R +# define HAVE_LOCALTIME_R +# define __USE_STD_IOSTREAM +# define SOAP_LONG_FORMAT "%ld" +# define SOAP_ULONG_FORMAT "%lu" +# define HAVE_LOCALE_H +# elif defined(MAC_CARBON) +# define WITH_NOIO +# define HAVE_SNPRINTF +# define HAVE_STRRCHR +# define HAVE_STRTOD +# define HAVE_SSCANF +# define HAVE_STRTOL +# define HAVE_STRTOUL +# define HAVE_SYS_TIMEB_H +# define HAVE_FTIME +# define HAVE_RAND_R +# define HAVE_GETHOSTBYNAME_R +# define HAVE_GMTIME_R +# define HAVE_ASCTIME_R +# define HAVE_LOCALTIME_R +# define HAVE_STRERROR_R +# elif defined(SYMBIAN) +# define WITH_LEAN +# define WITH_NONAMESPACES +# define HAVE_STRTOD /* use STRTOD since sscanf doesn't seem to work */ +# include +# include +# elif defined(VXWORKS) +# ifdef _WRS_KERNEL +# define _POSIX_THREADS 1 +# endif +# define HAVE_STRRCHR +# define HAVE_STRTOD +# define HAVE_SSCANF +# define HAVE_STRTOL +# define HAVE_STRTOUL +# define HAVE_GMTIME +# define HAVE_LOCALTIME +# define HAVE_MKTIME +# elif defined(OS390) +# define HAVE_SNPRINTF +# define HAVE_STRRCHR +# define HAVE_STRTOD +# define HAVE_SSCANF +# define HAVE_STRTOL +# define HAVE_STRTOUL +# define HAVE_SYS_TIMEB_H +# define HAVE_FTIME +# define HAVE_RAND_R +# define HAVE_GMTIME_R +# define HAVE_ASCTIME_R +# define HAVE_LOCALTIME_R +# define HAVE_SOCKLEN_T +# elif defined(AS400) +# define HAVE_SNPRINTF +# define HAVE_STRRCHR +# define HAVE_STRTOD +# define HAVE_SSCANF +# define HAVE_STRTOL +# define HAVE_STRTOUL +# define HAVE_SYS_TIMEB_H +# define HAVE_FTIME +# define HAVE_RAND_R +# define HAVE_GMTIME_R +# define HAVE_ASCTIME_R +# define HAVE_LOCALTIME_R +# elif defined(__QNX__) || defined(QNX) +/* QNX does not have a working version of strtof */ +# undef HAVE_STRTOF +# define HAVE_POLL +# define HAVE_SNPRINTF +# define HAVE_STRLCPY +# define HAVE_STRRCHR +# define HAVE_STRTOD +# define HAVE_SSCANF +# define HAVE_STRTOL +# define HAVE_STRTOUL +# define HAVE_STRTOLL +# define HAVE_STRTOULL +# define HAVE_GETTIMEOFDAY +# define HAVE_RAND_R +# define HAVE_GETHOSTBYNAME_R +# define HAVE_GMTIME_R +# define HAVE_ASCTIME_R +# define HAVE_LOCALTIME_R +# define HAVE_STRERROR_R +# define HAVE_SOCKLEN_T +# elif defined(SUN_OS) +# define HAVE_SNPRINTF +# define HAVE_STRRCHR +# define HAVE_STRTOD +# define HAVE_SSCANF +# define HAVE_STRTOL +# define HAVE_STRTOUL +# define HAVE_SYS_TIMEB_H +# define HAVE_FTIME +# define HAVE_RAND_R +# define HAVE_GETHOSTBYNAME_R +# define HAVE_GMTIME_R +# define HAVE_ASCTIME_R +# define HAVE_LOCALTIME_R +# elif defined(__GLIBC__) || defined(__GNU__) || defined(__GNUC__) +# define HAVE_POLL +# define HAVE_SNPRINTF +# define HAVE_STRRCHR +# define HAVE_STRTOD +# define HAVE_SSCANF +# define HAVE_STRTOL +# define HAVE_STRTOUL +# define HAVE_STRTOLL +# define HAVE_STRTOULL +# define HAVE_GETTIMEOFDAY +# define HAVE_RAND_R +# define HAVE_GETHOSTBYNAME_R +# define HAVE_GMTIME_R +# define HAVE_ASCTIME_R +# define HAVE_LOCALTIME_R +# define HAVE_STRERROR_R +# define HAVE_TIMEGM +# define HAVE_ISNAN +# define HAVE_ISINF +# if !defined(__GNUC__) || __GNUC__ >= 4 /* gcc 3 and earlier often refuse to compile _l functions */ +# define HAVE_STRTOD_L +# define HAVE_SSCANF_L +# define HAVE_LOCALE_H +# endif +# define HAVE_SOCKLEN_T +# else /* Default assumptions for supported library functions when not including config.h */ +# ifndef WITH_C_LOCALE +# ifndef WITH_NO_C_LOCALE +# define WITH_NO_C_LOCALE /* turn locale support off by default */ +# endif +# endif +# define HAVE_SNPRINTF +# define HAVE_STRRCHR +# define HAVE_STRTOD +# define HAVE_SSCANF +# define HAVE_STRTOL +# define HAVE_STRTOUL +# define HAVE_STRTOLL +# define HAVE_STRTOULL +# define HAVE_GETTIMEOFDAY +# define HAVE_RAND_R +# define HAVE_GETHOSTBYNAME_R +# define HAVE_GMTIME_R +# define HAVE_ASCTIME_R +# define HAVE_LOCALTIME_R +# define HAVE_STRERROR_R +# define HAVE_INTTYPES_H +# define HAVE_LOCALE_H +# endif +#endif + +#ifdef WITH_LEANER +# ifndef WITH_LEAN +# define WITH_LEAN +# endif +#endif + +/* gSOAP 2.7.15 and higher: always use FAST and retain CDATA in literal XML, unless WITH_LEAN or WITH_NOCDATA */ +#ifndef WITH_LEAN +# ifndef WITH_FAST +# define WITH_FAST +# endif +# ifndef WITH_NOCDATA +# ifndef WITH_CDATA +# define WITH_CDATA +# endif +# endif +#endif + +#if !defined(__cplusplus) +/* allowing empty struct/union in C is a GNU extension */ +# if !defined(__GNU__) && !defined(__GNUC__) +# define WITH_NOEMPTYSTRUCT +# endif +#endif + +/* silence clang's C99 variadic macro warnings */ +#ifdef __clang__ +# pragma clang diagnostic ignored "-Wvariadic-macros" +#endif + +#if defined(WITH_PURE_VIRTUAL) +# define SOAP_PURE_VIRTUAL = 0 +# define SOAP_PURE_VIRTUAL_COPY = 0 +#elif defined(WITH_DEFAULT_VIRTUAL) +# define SOAP_PURE_VIRTUAL { return SOAP_NO_METHOD; } +# define SOAP_PURE_VIRTUAL_COPY +#else +# define SOAP_PURE_VIRTUAL +# define SOAP_PURE_VIRTUAL_COPY +#endif + +/* older OpenVMS TCP/IP stacks cannot handle 65536 bytes */ +#ifdef __VMS +# ifndef SOAP_BUFLEN +# define SOAP_BUFLEN (65535) +# endif +#endif + +/* small buffer, to accelerate base64 and hex binary output */ +#ifndef SOAP_BINARY_BUFLEN +# define SOAP_BINARY_BUFLEN (128) +#endif + +/* if we have locale.h then we should use it WITH_C_LOCALE enabled to avoid decimal point conversion issues */ +#ifdef HAVE_LOCALE_H +# ifndef WITH_NO_C_LOCALE +# ifndef WITH_C_LOCALE +# define WITH_C_LOCALE +# endif +# endif +#endif + +/* MinGW does not support uselocale() and xlocale.h and gettimeofday() */ +#if defined(__MINGW32__) || defined(__MINGW64__) +# if !defined(WITH_NO_C_LOCALE) +# define WITH_NO_C_LOCALE +# endif +# undef HAVE_GETTIMEOFDAY +#endif + +/* user can set WITH_NO_C_LOCALE to force removal of locale (e.g. in case of compiler errors) */ +#ifdef WITH_NO_C_LOCALE +# undef WITH_C_LOCALE +#endif + +#ifndef WITH_NOSTDLIB +# include +# include +# include +# include +# if !defined(HAVE_CONFIG_H) || defined(HAVE_CTYPE_H) +# include +# endif +# if !defined(HAVE_CONFIG_H) || defined(HAVE_LIMITS_H) +# include /* for MB_LEN_MAX strtol strtoll strtoul strtoull */ +# endif +# if !defined(HAVE_CONFIG_H) || defined(HAVE_FLOAT_H) +# include /* for INFINITY */ +# endif +# if !defined(HAVE_CONFIG_H) || defined(HAVE_MATH_H) +# include /* for isnan() and isinf() */ +# endif +#endif + +/* force inclusion of xlocale.h when WITH_INCLUDE_XLOCALE_H is defined by the user for systems that require xlocale.h */ +#ifdef WITH_INCLUDE_XLOCALE_H +# ifndef HAVE_XLOCALE_H +# define HAVE_XLOCALE_H +# endif +#endif + +#ifdef WITH_C_LOCALE +# include +# if defined(WIN32) && !defined(CYGWIN) +# define SOAP_LOCALE_T _locale_t +# define SOAP_LOCALE(soap) ((soap)->c_locale ? (soap)->c_locale : ((soap)->c_locale = _create_locale(LC_ALL, "C"))) +# define SOAP_FREELOCALE(soap) (void)((soap)->c_locale && (_free_locale((soap)->c_locale), ((soap)->c_locale = NULL))) +# else +# if defined(HAVE_XLOCALE_H) +# include +# endif +# define SOAP_LOCALE_T locale_t +# define SOAP_LOCALE(soap) ((soap)->c_locale ? (soap)->c_locale : ((soap)->c_locale = newlocale(LC_ALL_MASK, "C", NULL))) +# define SOAP_FREELOCALE(soap) (void)((soap)->c_locale && (freelocale((soap)->c_locale), ((soap)->c_locale = NULL))) +# if defined(CYGWIN) +# undef HAVE_STRTOF_L /* Cygwin does not support strtof_l strtod_l */ +# undef HAVE_STRTOD_L +# endif +# endif +#else +# undef HAVE_STRTOF_L +# undef HAVE_STRTOD_L +# undef HAVE_SSCANF_L +#endif + +#ifdef TANDEM_NONSTOP /* Support for Guardian */ +# define SOAP_BUFLEN (32767) +/*# define WITH_NOSTDLIB */ /* uncommment to remove stdlib dependences */ +# define WITH_NOIO /* no IO dependences, e.g. remove TCP/IP */ +# define int32_t int +# define int64_t long long +# define LONG64 long long +# define ULONG64 unsigned long long +# define DBL_PINFTY (1.1579208923716189e77) +# undef HAVE_GMTIME_R +# undef HAVE_ASCTIME_R +# undef HAVE_LOCALTIME_R +# undef HAVE_SNPRINTF +# define SOAP_BUFLEN (32767) +# define SOAP_SOCKET short +#pragma nolist +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# define INET_ERROR 4294967295 +#pragma list +#elif defined(__TANDEM) /* Support for OSS */ +# define int32_t int +# define SOAP_BUFLEN (32767) +#endif + +#ifdef WITH_NTLM +# include +#endif + +#ifdef HAVE_POLL +# include +#endif + +#ifdef __cplusplus +# include +# include +# include +# ifndef WITH_COMPAT +# include +# include +# endif +#endif + +#ifdef WITH_NOHTTP +# ifndef WITH_NOIO +# define WITH_NOIO +# undef WITH_COOKIES +# endif +#endif + +/* Suggestion when SOAP_FD_EXCEEDED error occurs: + Some systems allow increasing FD_SETSIZE before including sys/types.h: +#define FD_SETSIZE (2048) +*/ + +#ifndef UNDER_CE +# ifndef WITH_NOIO +# include +# include +# endif +# ifndef WITH_LEAN +# ifdef HAVE_SYS_TIMEB_H +# ifdef HAVE_FTIME +# include /* for ftime() */ +# endif +# endif +# include +# endif +#endif + +#ifdef OPENSERVER +# include +# include +# include + extern int h_errno; +#endif + +#ifdef HAVE_GETTIMEOFDAY +# ifndef WIN32 +# ifdef VXWORKS +# ifdef _WRS_KERNEL +# include +# endif +# else +# include /* for timeval and gettimeofday() */ +# endif +# endif +#endif + +#ifndef WITH_NOIO +# ifndef WIN32 +# include +# ifdef VXWORKS +# include +# include +# ifndef _WRS_KERNEL +# include +# endif +# else +# ifndef SYMBIAN +# include +# endif +# endif +# ifdef SUN_OS +# include /* SUN */ +# include /* only needed with SUN < 2.8 ? */ +# endif +# ifdef VXWORKS +# ifdef _WRS_KERNEL +# include +# endif +# endif +# include +# ifdef OS390 +# include +# else +# include /* TCP_NODELAY, TCP_FASTOPEN */ +# endif +# include +# endif +#endif + +#ifdef WIN32 +# define SOAP_WINSOCKINT int +#else +# define SOAP_WINSOCKINT size_t +#endif + +#ifdef WIN32 +# undef WITH_SELF_PIPE +#endif + +#if defined(WITH_IPV6_V6ONLY) +# ifndef WITH_IPV6 +# define WITH_IPV6 +# endif +#endif + +#ifdef WIN32 +# ifndef UNDER_CE +# include +# include +# endif +// When you get macro redefinition errors when compiling the code below, then: +// a) try arrange your includes so is included after "stdsoap2.h" +// b) or define _WINSOCKAPI_ first: +// #define _WINSOCKAPI_ // stops windows.h including winsock.h +// #include +// #include "stdsoap2.h" +// c) or compile with the -DWIN32_LEAN_AND_MEAN switch +# include // Visual Studio 2005 users: install Platform SDK (R2) +# include +// # define _WSPIAPI_COUNTOF // DEV NOTE: enble to fix problems with VC6 +// # include +# include // DEV NOTE: replaces older wspiapi.h above +# ifdef WITH_IPV6 +# define SOAP_GAI_STRERROR gai_strerrorA +# endif +#else +# ifdef VXWORKS +# include +# include +# include +# endif +# ifndef WITH_NOIO +# include +# include +# include +# include +# ifdef _AIX41 +# include +# endif +# endif +#endif + +#ifdef WITH_FASTCGI +# include +#endif + +#ifdef WITH_OPENSSL +# ifdef __VMS +# pragma names save +# pragma names uppercase +# endif +# undef WITH_GNUTLS +# define OPENSSL_NO_KRB5 +# include +# include +# include +# include +# include +# include +# include +# include +# ifndef ALLOW_OLD_VERSIONS +# if (OPENSSL_VERSION_NUMBER < 0x00905100L) +# error "Must use OpenSSL 0.9.6 or later" +# endif +# endif +# ifdef __VMS +# pragma names restore +# endif +#endif + +#ifdef WITH_GNUTLS +# include +# include +# if GNUTLS_VERSION_NUMBER < 0x020b00 +/* deprecated since GNUTLS 2.11.0 */ +# include +# endif +# ifndef HAVE_PTHREAD_H +# ifdef _POSIX_THREADS +# define HAVE_PTHREAD_H /* make GNUTLS thread safe */ +# endif +# endif +#endif + +#ifdef WITH_WOLFSSL +# include +#endif + +#ifdef WITH_SYSTEMSSL +# include +#endif + +#ifdef WITH_GZIP +# ifndef WITH_ZLIB +# define WITH_ZLIB +# endif +#endif + +#ifdef WITH_CASEINSENSITIVETAGS +# define SOAP_STRCMP soap_tag_cmp /* case insensitive XML element/attribute names */ +#else +# define SOAP_STRCMP strcmp /* case sensitive XML element/attribute names */ +#endif + +#ifdef WITH_ZLIB +# include +#endif + +/* #define DEBUG */ /* Uncomment to debug sending (in file SENT.log) receiving (in file RECV.log) and internal operations (in file TEST.log) */ + +/* #define DEBUG_STAMP */ /* Uncomment to debug sending (in file SENT.log) receiving (in file RECV.log) and time-stamped operations (in file TEST.log) */ + +#ifdef __cplusplus +extern "C" { +#endif + +/* Portability (X/Open, BSD sockets etc): define SOAP_SOCKLEN_T as socklen_t or int or ... */ +#if defined(HAVE_SOCKLEN_T) +# define SOAP_SOCKLEN_T socklen_t +#elif defined(_AIX) || defined(AIX) || defined(HP_UX) +# if defined(_AIX43) +# define SOAP_SOCKLEN_T socklen_t +# else +# define SOAP_SOCKLEN_T int +# endif +#elif defined(SOCKLEN_T) +# define SOAP_SOCKLEN_T SOCKLEN_T +#elif defined(__socklen_t_defined) || defined(_SOCKLEN_T) || defined(__ANDROID__) || !defined(_GNU_SOURCE) || (!(~_GNU_SOURCE+1) && !defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)) || _POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600 +# define SOAP_SOCKLEN_T socklen_t +#elif defined(IRIX) || defined(WIN32) || defined(SUN_OS) || defined(OPENSERVER) || defined(TRU64) || defined(VXWORKS) +# define SOAP_SOCKLEN_T int +#elif !defined(SOAP_SOCKLEN_T) +# define SOAP_SOCKLEN_T socklen_t +#endif + +/* AIX DCE threads portability: define SOAP_FUNC_R_ERR gmtime_r and localtime_r err ret val as -1 */ +#ifdef _AIX32_THREADS +# define SOAP_FUNC_R_ERR (-1) +#elif !defined(SOAP_FUNC_R_ERR) +# define SOAP_FUNC_R_ERR (NULL) +#endif + +#ifndef SOAP_SOCKET +# ifdef WIN32 +# define SOAP_SOCKET SOCKET +# define soap_closesocket(n) closesocket(n) +# else +# define SOAP_SOCKET int +# define soap_closesocket(n) close(n) +# endif +#endif + +#define SOAP_INVALID_SOCKET ((SOAP_SOCKET)-1) +#define soap_valid_socket(sk) ((sk) != SOAP_INVALID_SOCKET) + +#define SOAP_SHUT_WR (1) +#define SOAP_SHUT_RDWR (2) + +#ifndef SOAP_GAI_STRERROR +# define SOAP_GAI_STRERROR gai_strerror +#endif + +#ifndef FD_SETSIZE +# define FD_SETSIZE (1024) +#endif + +#ifdef WITH_LEAN +# define SOAP_CHK_EOF SOAP_EOF +#else +# define SOAP_CHK_EOF (soap->error ? soap->error : SOAP_EOF) +#endif + +#ifdef __cplusplus +# ifndef __STDC_FORMAT_MACROS +# define __STDC_FORMAT_MACROS +# endif +#endif + +#if defined(SYMBIAN) +# warning "Symbian build: removing 64 bit integer support" +# define LONG64 long +# define ULONG64 unsigned LONG64 +# ifndef SOAP_LONG_FORMAT +# define SOAP_LONG_FORMAT "%ld" +# endif +# ifndef SOAP_ULONG_FORMAT +# define SOAP_ULONG_FORMAT "%lu" +# endif +#elif !defined(WIN32) || defined(CYGWIN) || defined(__GLIBC__) || defined(__GNU__) || defined(__GNUC__) +# ifndef LONG64 +# if defined(HAVE_INTTYPES_H) +# include +# define LONG64 int64_t +# define ULONG64 uint64_t +# if defined(PRId64) && defined(PRIu64) +# ifndef SOAP_LONG_FORMAT +# define SOAP_LONG_FORMAT "%" PRId64 +# endif +# ifndef SOAP_ULONG_FORMAT +# define SOAP_ULONG_FORMAT "%" PRIu64 +# endif +# endif +# elif defined(HAVE_SYS_INTTYPES_H) +# include +# define LONG64 int64_t +# define ULONG64 uint64_t +# if defined(PRId64) && defined(PRIu64) +# ifndef SOAP_LONG_FORMAT +# define SOAP_LONG_FORMAT "%" PRId64 +# endif +# ifndef SOAP_ULONG_FORMAT +# define SOAP_ULONG_FORMAT "%" PRIu64 +# endif +# endif +# elif defined(HAVE_STDINT_H) +# include +# define LONG64 int64_t +# define ULONG64 uint64_t +# if defined(PRId64) && defined(PRIu64) +# ifndef SOAP_LONG_FORMAT +# define SOAP_LONG_FORMAT "%" PRId64 +# endif +# ifndef SOAP_ULONG_FORMAT +# define SOAP_ULONG_FORMAT "%" PRIu64 +# endif +# endif +# elif defined(CYGWIN) || defined(__GLIBC__) +# include +# if (__WORDSIZE == 64) +# define LONG64 int64_t +# define ULONG64 uint64_t +# ifndef SOAP_LONG_FORMAT +# define SOAP_LONG_FORMAT "%ld" +# endif +# ifndef SOAP_ULONG_FORMAT +# define SOAP_ULONG_FORMAT "%lu" +# endif +# else +# define LONG64 long long +# define ULONG64 unsigned LONG64 +# endif +# else +# define LONG64 long long +# define ULONG64 unsigned LONG64 +# endif +# endif +#elif defined(UNDER_CE) +# define LONG64 __int64 +# define ULONG64 unsigned LONG64 +#elif defined(__BORLANDC__) +# define LONG64 __int64 +# define ULONG64 unsigned LONG64 +#endif + +#ifndef SOAP_LONG_FORMAT +# define SOAP_LONG_FORMAT "%lld" /* printf format for 64 bit long long ints */ +#endif + +#ifndef SOAP_ULONG_FORMAT +# define SOAP_ULONG_FORMAT "%llu" /* printf format for unsigned 64 bit long long ints */ +#endif + +#if defined(WIN32) && !defined(CYGWIN) +# define soap_int32 __int32 +#elif defined(SYMBIAN) +# define soap_int32 long +#elif defined(_AIX) || defined(AIX) +# if defined(_AIX43) +# define soap_int32 int32_t +# else +# define soap_int32 signed int +# endif +#else +# define soap_int32 int32_t +#endif + +#ifdef WIN32 +# define SOAP_ERANGE ERANGE +# define SOAP_EINTR WSAEINTR +# define SOAP_EAGAIN WSAEWOULDBLOCK +# define SOAP_EWOULDBLOCK WSAEWOULDBLOCK +# define SOAP_EINPROGRESS WSAEINPROGRESS +# define SOAP_EADDRINUSE WSAEADDRINUSE +# define SOAP_ECONNREFUSED WSAECONNREFUSED +#else +# ifdef ERANGE +# define SOAP_ERANGE ERANGE +# else +# define SOAP_ERANGE (34) +# endif +# define SOAP_EINTR EINTR +# define SOAP_EAGAIN EAGAIN +# define SOAP_EADDRINUSE EADDRINUSE +# define SOAP_ECONNREFUSED ECONNREFUSED +# ifdef SYMBIAN +# define SOAP_EWOULDBLOCK 9898 +# define SOAP_EINPROGRESS 9899 +# else +# define SOAP_EWOULDBLOCK EWOULDBLOCK +# define SOAP_EINPROGRESS EINPROGRESS +# endif +#endif + +#ifdef WIN32 +# ifdef UNDER_CE +# define soap_errno GetLastError() +# define soap_socket_errno GetLastError() +# define soap_reset_errno SetLastError(0) +# else +# define soap_errno errno +# define soap_socket_errno WSAGetLastError() +# define soap_reset_errno _set_errno(0) +# endif +#else +# ifndef WITH_NOIO +# define soap_errno errno +# define soap_socket_errno errno +# define soap_reset_errno (errno = ENOENT) +# else +# define soap_errno 0 +# define soap_socket_errno 0 +# define soap_reset_errno +# endif +#endif + +#ifndef SOAP_BUFLEN +# if !defined(WITH_LEAN) +# define SOAP_BUFLEN (165536) /* buffer length for socket packets, so don't make this too small */ +# else +# define SOAP_BUFLEN (2048) /* lean size */ +# endif +#endif +#ifndef SOAP_LABLEN +# define SOAP_LABLEN (256) /* initial look-aside buffer length */ +#endif +#ifndef SOAP_PTRBLK +# define SOAP_PTRBLK (32) /* block allocation for pointer hash table chains */ +#endif +#ifndef SOAP_PTRHASH +# ifndef WITH_LEAN +# define SOAP_PTRHASH (4096) /* size of pointer analysis hash table (must be power of 2) */ +# else +# define SOAP_PTRHASH (32) +# endif +#endif +#ifndef SOAP_IDHASH +# ifndef WITH_LEAN +# define SOAP_IDHASH (1999) /* 1999, 8191: prime size of hash table for parsed id/ref */ +# else +# define SOAP_IDHASH (19) /* 19, 199: small prime */ +# endif +#endif +#ifndef SOAP_BLKLEN +# ifndef WITH_LEAN +# define SOAP_BLKLEN (256) /* to collect long strings and XML attributes */ +# else +# define SOAP_BLKLEN (32) +# endif +#endif +#ifndef SOAP_TAGLEN +# ifndef WITH_LEAN +# define SOAP_TAGLEN (1024) /* maximum length of XML element tag/attribute name or host/path name + 1 */ +# else +# define SOAP_TAGLEN (256) +# endif +#endif +#ifndef SOAP_HDRLEN +# ifndef WITH_LEAN +# define SOAP_HDRLEN (8192) /* maximum length of HTTP header line (must be >=4096 to read cookies) */ +# else +# define SOAP_HDRLEN (1024) +# endif +#endif +#ifndef SOAP_TMPLEN +# ifndef WITH_LEAN +# define SOAP_TMPLEN (2048) /* maximum length of msgbuf and tmpbuf short message buffers, must be >=1024 */ +# else +# define SOAP_TMPLEN (1024) +# endif +#endif +#ifndef SOAP_MAXDIMS +# ifndef WITH_LEAN +# define SOAP_MAXDIMS (16) /* maximum array dimensions (array nestings) must be less than 64 to protect soap->tmpbuf */ +# else +# define SOAP_MAXDIMS (4) +# endif +#endif +#ifndef SOAP_MAXPTRS +# ifndef WITH_LEAN +# define SOAP_MAXPTRS (4) /* maximum depth + 1 of id-ref deserialized pointer types (int* has depth 0, int*** has depth 2) */ +# else +# define SOAP_MAXPTRS (2) +# endif +#endif + +#ifndef SOAP_MAXALLOCSIZE +# define SOAP_MAXALLOCSIZE (0) /* max size that malloc() can handle, zero for no limit */ +#endif + +#ifndef SOAP_MAXLOGS +# define SOAP_MAXLOGS (3) /* max number of debug logs per struct soap environment */ +# define SOAP_INDEX_RECV (0) +# define SOAP_INDEX_SENT (1) +# define SOAP_INDEX_TEST (2) +#endif + +/* max HTTP chunk size is 2GB by default, can be larger but not to exceed size_t range max */ +#ifndef SOAP_MAXHTTPCHUNK +# define SOAP_MAXHTTPCHUNK (2147483647) +#endif + +/* Tag name of multiref elements in SOAP 1.1 encoding */ +#ifndef SOAP_MULTIREFTAG +# define SOAP_MULTIREFTAG "id" +#endif + +/* href-id value base name in multiref SOAP encoding */ +#ifndef SOAP_BASEREFNAME +# define SOAP_BASEREFNAME "_" +#endif + +/* Max number of EINTR interrupts to ignore while poll/select for pending activity on a socket */ +/* Each EINTR ignored may increase the I/O blocking time by at most one second */ +#ifndef SOAP_MAXEINTR +# define SOAP_MAXEINTR (10) +#endif + +/* SOAP_MAXKEEPALIVE: Max iterations in soap_serve() to keep server connection alive */ +#ifndef SOAP_MAXKEEPALIVE +# define SOAP_MAXKEEPALIVE (100) +#endif + +/* SOAP_MAXARRAYSIZE: Trusted total max size of an inbound SOAP Array. + Arrays of larger size are not pre-allocated, but deserialized + on an element-by-element basis until XML validation contrains kick in. + This macro only affects the efficiency of parsing SOAP arrays. +*/ +#ifndef SOAP_MAXARRAYSIZE +# define SOAP_MAXARRAYSIZE (100000) +#endif + +/* SOAP_MAXDIMESIZE: Trusted max size of inbound DIME data. + Increase if necessary to allow larger attachments, or decrease when server + resources are limited. This is to deny senders to allocate more than 8 MB + at the receiver without actually sending the whole message. +*/ +#ifndef SOAP_MAXDIMESIZE +# define SOAP_MAXDIMESIZE (8*1048576) /* 8 MB */ +#endif + +/* SOAP_MAXINFLATESIZE: Trusted inflated content size. + Larger content is subject to the SOAP_MINDEFLATERATIO constraint. + If SOAP_MINDEFLATERATIO is 1.0, SOAP_MAXINFLATESIZE is always the max + size of uncompressed content. +*/ +#ifndef SOAP_MAXINFLATESIZE +# define SOAP_MAXINFLATESIZE (1*1048576) /* 1 MB */ +#endif + +/* SOAP_MINDEFLATERATIO: Trusted deflation ratio after SOAP_MAXINFLATESIZE is reached. + Trust when compressed / deflated > SOAP_MINDEFLATERATIO + Sets a ratio > 0.00096899224806 (1032:1) + According to the zlib site: the limit (1032:1) comes from the fact that one + length/distance pair can represent at most 258 output bytes. A length + requires at least one bit and a distance requires at least one bit, so two + bits in can give 258 bytes out, or eight bits in give 1032 bytes out. A + dynamic block has no length restriction, so you could get arbitrarily close + to the limit of 1032:1. +*/ +#ifndef SOAP_MINDEFLATERATIO +# define SOAP_MINDEFLATERATIO (1.0/1032.0) /* ratio of deflated/inflated */ +#endif + +/* maximum XML nesting depth level allowed for inbound XML parsing, must be greater than zero (0) */ +#ifndef SOAP_MAXLEVEL +# define SOAP_MAXLEVEL (10000) +#endif + +/* maximum string content length if not already constrained by XML schema validation maxLength constraints, zero or negative means unlimited string lengths are allowed unless restricted by XML schema maxLength */ +#ifndef SOAP_MAXLENGTH +# define SOAP_MAXLENGTH (0) +#endif + +/* maximum number of array or container elements, must be greater than zero (0) */ +#ifndef SOAP_MAXOCCURS +# define SOAP_MAXOCCURS (100000) +#endif + +#ifdef VXWORKS +# ifdef WMW_RPM_IO +# include "httpLib.h" +# endif +# ifdef __INCmathh +# include +# ifndef HAVE_ISNAN +# define HAVE_ISNAN +# endif +# ifndef soap_isnan +# define soap_isnan(num) isNan(num) +# endif +# endif +# ifdef WM_SECURE_KEY_STORAGE +# include +# endif +#endif + +#ifdef WIN32 +# ifndef HAVE_ISNAN +# define HAVE_ISNAN +# endif +# define soap_isnan(n) _isnan(n) +# ifndef HAVE_ISINF +# define HAVE_ISINF +# endif +# define soap_isinf(n) (!_finite(n)) +#endif + +#ifdef SUN_OS +# ifndef HAVE_ISNAN +# define HAVE_ISNAN +# endif +#endif + +#ifdef __APPLE__ +# ifndef HAVE_ISNAN +# define HAVE_ISNAN +# endif +# ifndef HAVE_ISINF +# define HAVE_ISINF +# endif +#endif + +#if !defined(HAVE_ISNAN) && (defined(_MATH_H) || defined(_MATH_INCLUDED)) +# define HAVE_ISNAN +#endif + +union soap_double_nan {struct {unsigned int n1, n2;} iv; double dv; float fv;}; +extern const union soap_double_nan soap_double_nan; +extern const char soap_base64o[], soap_base64i[]; + +#ifdef VXWORKS +# ifndef FLT_MAX +# define FLT_MAX _ARCH_FLT_MAX +# endif +# ifndef DBL_MAX +# define DBL_MAX _ARCH_DBL_MAX +# endif +#endif + +#ifndef FLT_NAN +# define FLT_NAN (soap_double_nan.fv) +#endif + +#ifndef FLT_PINFTY +# if defined(INFINITY) +# define FLT_PINFTY INFINITY +# elif defined(FLT_MAX) +# define FLT_PINFTY FLT_MAX +# elif defined(HUGE_VALF) +# define FLT_PINFTY (float)HUGE_VALF +# elif defined(HUGE_VAL) +# define FLT_PINFTY (float)HUGE_VAL +# elif defined(FLOAT_MAX) +# define FLT_PINFTY FLOAT_MAX +# else +# define FLT_PINFTY (3.40282347e+38F) +# endif +#endif + +#ifndef FLT_NINFTY +# define FLT_NINFTY (-FLT_PINFTY) +#endif + +#ifndef DBL_NAN +# define DBL_NAN (soap_double_nan.dv) +#endif + +#ifndef DBL_PINFTY +# if defined(INFINITY) +# define DBL_PINFTY INFINITY +# elif defined(DBL_MAX) +# define DBL_PINFTY DBL_MAX +# elif defined(HUGE_VALF) +# define DBL_PINFTY (double)HUGE_VALF +# elif defined(HUGE_VAL) +# define DBL_PINFTY (double)HUGE_VAL +# elif defined(DOUBLE_MAX) +# define DBL_PINFTY DOUBLE_MAX +# else +# define DBL_PINFTY (1.7976931348623157e+308) +# endif +#endif + +#ifndef DBL_NINFTY +# define DBL_NINFTY (-DBL_PINFTY) +#endif + +#ifndef soap_isnan +# ifdef HAVE_ISNAN +# define soap_isnan(n) isnan(n) +# else +# define soap_isnan(n) ((n) != (n)) +# endif +#endif + +#ifndef soap_isinf +# ifdef HAVE_ISINF +# define soap_isinf(n) isinf(n) +# else +# define soap_isinf(n) (!soap_isnan(n) && soap_isnan((n) - (n))) +# endif +#endif + +#define soap_ispinfd(n) ((n) > 0 && soap_isinf(n)) +#define soap_ispinff(n) ((n) > 0 && soap_isinf(n)) +#define soap_isninfd(n) ((n) < 0 && soap_isinf(n)) +#define soap_isninff(n) ((n) < 0 && soap_isinf(n)) + +/* Safer str & mem functions */ + +/* The gSOAP code uses guards to ensure that these functions are well behaved + and do not raise errors. Therefore, the WIN _s functions should never + execute the "invalid parameter handler". +*/ + +/* use safer snprintf if possible or guard sprintf against overrun (assumes no variadic macros) */ +# ifdef HAVE_SNPRINTF +# if _MSC_VER >= 1400 +# define SOAP_SNPRINTF(buf, len, num) void)_snprintf_s((buf), (len), _TRUNCATE +# define SOAP_SNPRINTF_SAFE(buf, len) void)_snprintf_s((buf), (len), _TRUNCATE +# else +# define SOAP_SNPRINTF(buf, len, num) void)snprintf((buf), (len) +# define SOAP_SNPRINTF_SAFE(buf, len) void)snprintf((buf), (len) +# endif +# else +# define SOAP_SNPRINTF(buf, len, num) (len) <= (num)) ? (void)((buf)[0] = '\0') : (void)sprintf((buf) +# define SOAP_SNPRINTF_SAFE(buf, len) void)sprintf((buf) +# endif + +/* copy string (truncating the result, strings must not be NULL) */ +#if _MSC_VER >= 1400 +# define soap_strcpy(buf, len, src) (void)strncpy_s((buf), (len), (src), _TRUNCATE) +#elif defined(HAVE_STRLCPY) +# define soap_strcpy(buf, len, src) (void)strlcpy((buf), (src), (len)) +#else +# define soap_strcpy(buf, len, src) (void)(strncpy((buf), (src), (len)), (buf)[(len) - 1] = '\0') +#endif + +/* concat string (truncating the result, strings must not be NULL) */ +#if _MSC_VER >= 1400 +# define soap_strcat(buf, len, src) (void)strncat_s((buf), (len), (src), _TRUNCATE) +#elif defined(HAVE_STRLCAT) +# define soap_strcat(buf, len, src) (void)strlcat((buf), (src), (len)) +#else +SOAP_FMAC1 void SOAP_FMAC2 soap_strcat(char *buf, size_t len, const char *src); +#endif + +/* copy string up to num chars (sets string to empty on overrun and returns nonzero, zero if OK) */ +#if _MSC_VER >= 1400 +# define soap_strncpy(buf, len, src, num) ((buf) == NULL || ((size_t)(len) > (size_t)(num) ? strncpy_s((buf), (len), (src), (num)) : ((buf)[0] = '\0', 1))) +#else +# define soap_strncpy(buf, len, src, num) ((buf) == NULL || ((size_t)(len) > (size_t)(num) ? (strncpy((buf), (src), (num)), (buf)[(size_t)(num)] = '\0') : ((buf)[0] = '\0', 1))) +#endif + +/* concat string up to n chars (leaves destination intact on overrun and returns nonzero, zero if OK) */ +#if _MSC_VER >= 1400 +# define soap_strncat(buf, len, src, num) ((buf) == NULL || ((size_t)(len) > strlen((buf)) + (size_t)(num) ? strncat_s((buf), (len), (src), (num)) : 1)) +#else +SOAP_FMAC1 int SOAP_FMAC2 soap_strncat(char *buf, size_t len, const char *src, size_t num); +#endif + +/* copy memory (returns SOAP_ERANGE on overrun, zero if OK, pointers must not be NULL) */ +#if _MSC_VER >= 1400 +# define soap_memcpy(buf, len, src, num) ((size_t)(len) >= (size_t)(num) ? memcpy_s((buf), (len), (src), (num)) : SOAP_ERANGE) +#else +# define soap_memcpy(buf, len, src, num) ((size_t)(len) >= (size_t)(num) ? !memcpy((buf), (src), (num)) : SOAP_ERANGE) +#endif + +/* move memory (returns SOAP_ERANGE on overrun, zero if OK, pointers must not be NULL) */ +#if _MSC_VER >= 1400 +# define soap_memmove(buf, len, src, num) ((size_t)(len) >= (size_t)(num) ? memmove_s((buf), (len), (src), (num)) : SOAP_ERANGE) +#else +# define soap_memmove(buf, len, src, num) ((size_t)(len) >= (size_t)(num) ? !memmove((buf), (src), (num)) : SOAP_ERANGE) +#endif + +/* gSOAP status and error codes */ + +typedef soap_int32 soap_status; + +#define SOAP_EOF EOF +#define SOAP_OK 0 +#define SOAP_CLI_FAULT 1 +#define SOAP_SVR_FAULT 2 +#define SOAP_TAG_MISMATCH 3 +#define SOAP_TYPE 4 +#define SOAP_SYNTAX_ERROR 5 +#define SOAP_NO_TAG 6 +#define SOAP_IOB 7 +#define SOAP_MUSTUNDERSTAND 8 +#define SOAP_NAMESPACE 9 +#define SOAP_USER_ERROR 10 +#define SOAP_FATAL_ERROR 11 /* deprecated */ +#define SOAP_FAULT 12 +#define SOAP_NO_METHOD 13 +#define SOAP_NO_DATA 14 +#define SOAP_GET_METHOD 15 +#define SOAP_PUT_METHOD 16 +#define SOAP_PATCH_METHOD 17 +#define SOAP_DEL_METHOD 18 +#define SOAP_HTTP_METHOD 19 +#define SOAP_EOM 20 +#define SOAP_MOE 21 +#define SOAP_HDR 22 +#define SOAP_NULL 23 +#define SOAP_DUPLICATE_ID 24 +#define SOAP_MISSING_ID 25 +#define SOAP_HREF 26 +#define SOAP_UDP_ERROR 27 +#define SOAP_TCP_ERROR 28 +#define SOAP_HTTP_ERROR 29 +#define SOAP_SSL_ERROR 30 +#define SOAP_ZLIB_ERROR 31 +#define SOAP_DIME_ERROR 32 +#define SOAP_DIME_HREF 33 +#define SOAP_DIME_MISMATCH 34 +#define SOAP_DIME_END 35 +#define SOAP_MIME_ERROR 36 +#define SOAP_MIME_HREF 37 +#define SOAP_MIME_END 38 +#define SOAP_VERSIONMISMATCH 39 +#define SOAP_PLUGIN_ERROR 40 +#define SOAP_DATAENCODINGUNKNOWN 41 /* unused */ +#define SOAP_REQUIRED 42 +#define SOAP_PROHIBITED 43 +#define SOAP_OCCURS 44 +#define SOAP_LENGTH 45 +#define SOAP_PATTERN 46 +#define SOAP_FD_EXCEEDED 47 +#define SOAP_UTF_ERROR 48 +#define SOAP_NTLM_ERROR 49 +#define SOAP_LEVEL 50 +#define SOAP_FIXED 51 +#define SOAP_EMPTY 52 +#define SOAP_END_TAG 53 +#define SOAP_ERR 99 + +#define soap_xml_error_check(e) \ + ((e) == SOAP_TAG_MISMATCH || \ + (e) == SOAP_NO_TAG || \ + (e) == SOAP_IOB || \ + (e) == SOAP_SYNTAX_ERROR || \ + (e) == SOAP_NAMESPACE || \ + (e) == SOAP_TYPE || \ + (e) == SOAP_DUPLICATE_ID || \ + (e) == SOAP_MISSING_ID || \ + (e) == SOAP_REQUIRED || \ + (e) == SOAP_PROHIBITED || \ + (e) == SOAP_OCCURS || \ + (e) == SOAP_LENGTH || \ + (e) == SOAP_LEVEL || \ + (e) == SOAP_PATTERN || \ + (e) == SOAP_NULL || \ + (e) == SOAP_HREF || \ + (e) == SOAP_FIXED || \ + (e) == SOAP_EMPTY || \ + (e) == SOAP_END_TAG || \ + (e) == SOAP_UTF_ERROR) + +#define soap_soap_error_check(e) \ + ((e) == SOAP_CLI_FAULT || \ + (e) == SOAP_SVR_FAULT || \ + (e) == SOAP_VERSIONMISMATCH || \ + (e) == SOAP_MUSTUNDERSTAND || \ + (e) == SOAP_FAULT || \ + (e) == SOAP_NO_METHOD || \ + (e) == SOAP_DATAENCODINGUNKNOWN) + +#define soap_http_error_check(e) \ + ((e) == SOAP_HTTP_ERROR || \ + (e) == SOAP_NO_DATA || \ + ((e) >= SOAP_GET_METHOD && (e) <= SOAP_HTTP_METHOD) || \ + ((e) >= 100 && (e) < 600)) + +#define soap_dime_error_check(e) \ + ((e) == SOAP_DIME_ERROR || \ + (e) == SOAP_DIME_HREF || \ + (e) == SOAP_DIME_MISMATCH || \ + (e) == SOAP_DIME_END) + +#define soap_mime_error_check(e) \ + ((e) == SOAP_MIME_ERROR || \ + (e) == SOAP_MIME_HREF || \ + (e) == SOAP_MIME_END) + +#define soap_tcp_error_check(e) \ + ((e) == SOAP_EOF || \ + (e) == SOAP_TCP_ERROR) + +#define soap_udp_error_check(e) \ + ((e) == SOAP_EOF || \ + (e) == SOAP_UDP_ERROR) + +#define soap_ssl_error_check(e) ((e) == SOAP_SSL_ERROR) + +#define soap_zlib_error_check(e) ((e) == SOAP_ZLIB_ERROR) + +/* gSOAP HTTP response status codes 100 to 599 are reserved */ + +/* Codes 600 to 999 are user definable */ + +/* Exceptional gSOAP HTTP server response status codes >= 1000 */ + +#define SOAP_STOP 1000 /* No HTTP response should follow after SOAP_STOP is issued */ +#define SOAP_FORM 1001 /* Request (form) data is present, no HTTP response should follow */ +#define SOAP_HTML 1002 /* Custom HTML response */ +#define SOAP_FILE 1200 /* Custom file-based response with soap::http_content and optional http status */ + +/* gSOAP HTTP method codes (client) */ + +typedef int soap_http_command; + +#define SOAP_POST 2000 /* POST request */ +#define SOAP_POST_FILE 2001 /* Custom file-based POST request */ +#define SOAP_GET 2002 /* GET request */ +#define SOAP_PUT 2003 /* PUT request */ +#define SOAP_PATCH 2004 /* PATCH request */ +#define SOAP_DEL 2005 /* DELETE request */ +#define SOAP_HEAD 2006 /* HEAD request */ +#define SOAP_OPTIONS 2007 /* OPTIONS request */ +#define SOAP_CONNECT 2008 /* CONNECT request */ + +/* gSOAP DIME */ + +#define SOAP_DIME_CF 0x01 +#define SOAP_DIME_ME 0x02 +#define SOAP_DIME_MB 0x04 +#define SOAP_DIME_VERSION 0x08 /* DIME version 1 */ +#define SOAP_DIME_MEDIA 0x10 +#define SOAP_DIME_ABSURI 0x20 + +/* gSOAP ZLIB */ + +#define SOAP_ZLIB_NONE 0x00 +#define SOAP_ZLIB_DEFLATE 0x01 +#define SOAP_ZLIB_INFLATE 0x02 +#define SOAP_ZLIB_GZIP 0x02 + +/* gSOAP transport, connection, and content encoding modes */ + +typedef soap_int32 soap_mode; + +#define SOAP_IO 0x00000003 /* IO mask */ +#define SOAP_IO_FLUSH 0x00000000 /* out: flush output immediately, no buffering */ +#define SOAP_IO_BUFFER 0x00000001 /* out: buffer output in packets of size SOAP_BUFLEN */ +#define SOAP_IO_STORE 0x00000002 /* out: store entire output to determine length for transport */ +#define SOAP_IO_CHUNK 0x00000003 /* out: use HTTP chunked transfer AND buffer packets */ + +#define SOAP_IO_UDP 0x00000004 /* in/out: enable UDP instead of TCP */ +#define SOAP_IO_LENGTH 0x00000008 /* out: calc message length (internal) */ +#define SOAP_IO_KEEPALIVE 0x00000010 /* out: keep connection alive */ + +#define SOAP_ENC 0x00000FFF /* IO and ENC mask */ +#define SOAP_ENC_LATIN 0x00000020 /* in: accept iso-8859-1 */ +#define SOAP_ENC_PLAIN 0x00000040 /* out: plain (XML or other) body, no HTTP header, in: skip HTTP header (use soap::length) */ +#define SOAP_ENC_XML 0x00000040 /* deprecated, alias for SOAP_ENC_PLAIN */ +#define SOAP_ENC_DIME 0x00000080 +#define SOAP_ENC_MIME 0x00000100 +#define SOAP_ENC_MTOM 0x00000200 +#define SOAP_ENC_ZLIB 0x00000400 +#define SOAP_ENC_SSL 0x00000800 + +#define SOAP_XML_STRICT 0x00001000 /* in: strict validation */ +#define SOAP_XML_INDENT 0x00002000 /* out: emit indented XML */ +#define SOAP_XML_IGNORENS 0x00004000 /* in: ignore namespaces */ +#define SOAP_XML_DEFAULTNS 0x00008000 /* out: emit xmlns="..." */ +#define SOAP_XML_CANONICAL 0x00010000 /* out: exc-C14N exclusive canonical XML */ +#define SOAP_XML_TREE 0x00020000 /* in/out: XML tree (no id/ref) */ +#define SOAP_XML_NIL 0x00040000 /* out: all NULLs as xsi:nil */ +#define SOAP_XML_NOTYPE 0x00080000 /* out: do not add xsi:type */ + +#define SOAP_DOM_TREE 0x00100000 /* see DOM manual */ +#define SOAP_DOM_NODE 0x00200000 +#define SOAP_DOM_ASIS 0x00400000 + +#define SOAP_XML_CANONICAL_NA 0x00800000 /* out: (exc) C14N not QName aware */ + +#define SOAP_C_NOIOB 0x01000000 /* don't fault on array index out of bounds (just ignore) */ +#define SOAP_C_UTFSTRING 0x02000000 /* (de)serialize strings with UTF8 content */ +#define SOAP_C_MBSTRING 0x04000000 /* (de)serialize strings with multi-byte content */ +#define SOAP_C_NILSTRING 0x08000000 /* serialize empty strings as nil (omitted) */ + +#define SOAP_XML_DOM 0x10000000 /* enable internal DOM */ +#define SOAP_XML_GRAPH 0x20000000 /* force id-ref XML graph */ + +#define SOAP_MIME_POSTCHECK 0x40000000 /* MIME flag (internal) */ + +#define SOAP_SEC_WSUID 0x80000000 /* Add Body wsu:Id flag (internal) */ + +/* WITH_XMLNS backward compatibility: always use XML default namespaces */ +#ifdef WITH_XMLNS +# define SOAP_IO_DEFAULT (SOAP_IO_FLUSH | SOAP_XML_DEFAULTNS) +#else +# define SOAP_IO_DEFAULT SOAP_IO_FLUSH +#endif + +/* SSL client/server authentication settings */ + +#define SOAP_SSL_NO_AUTHENTICATION (0x0000) /* no authentication */ +#define SOAP_SSL_REQUIRE_SERVER_AUTHENTICATION (0x0001) /* client requires server to authenticate */ +#define SOAP_SSL_REQUIRE_CLIENT_AUTHENTICATION (0x0002) /* server requires client to authenticate */ +#define SOAP_SSL_SKIP_HOST_CHECK (0x0004) /* client skips common name check against host name */ +#define SOAP_SSL_ALLOW_EXPIRED_CERTIFICATE (0x0008) /* allow self-signed and expired certificates and those w/o CRL */ +#define SOAP_SSL_NO_DEFAULT_CA_PATH (0x0010) /* don't use SSL_CTX_set_default_verify_paths */ +#define SOAP_SSL_RSA (0x0020) /* use RSA */ +#define SOAP_SSL_SNI_HOST_CHECK (0x0040) /* client SNI only with a valid hostname, reject IP */ +#define SOAP_SSLv3 (0x0080) /* enable SSL v3 */ +#define SOAP_TLSv1_0 (0x0100) /* enable TLS v1.0 */ +#define SOAP_TLSv1_1 (0x0200) /* enable TLS v1.1 */ +#define SOAP_TLSv1_2 (0x0400) /* enable TLS v1.2 */ +#define SOAP_TLSv1_3 (0x0800) /* enable TLS v1.3 */ +#define SOAP_TLSv1 (SOAP_TLSv1_0 | SOAP_TLSv1_1 | SOAP_TLSv1_2 | SOAP_TLSv1_3) +#define SOAP_SSLv3_TLSv1 (SOAP_SSLv3 | SOAP_TLSv1) + +#define SOAP_SSL_CLIENT (0x8000) /* client context flag for internal use */ + +#define SOAP_SSL_DEFAULT SOAP_SSL_REQUIRE_SERVER_AUTHENTICATION + +typedef unsigned short soap_ssl_flags; + +/* state */ + +#define SOAP_NONE 0 +#define SOAP_INIT 1 +#define SOAP_COPY 2 + +#define soap_check_state(soap) (!(soap) || ((soap)->state != SOAP_INIT && (soap)->state != SOAP_COPY)) + +/* parts */ + +#define SOAP_END 0 +#define SOAP_BEGIN_SEND 1 +#define SOAP_BEGIN_RECV 2 +#define SOAP_IN_ENVELOPE 3 +#define SOAP_IN_HEADER 4 +#define SOAP_END_HEADER 5 +#define SOAP_NO_BODY 6 +#define SOAP_IN_BODY 7 +#define SOAP_END_BODY 8 +#define SOAP_END_ENVELOPE 9 + +/* events */ + +#define SOAP_SEC_BEGIN 1 +#define SOAP_SEC_SIGN 2 +#define SOAP_SEC_DECRYPT 3 + +/* DEBUG macros */ + +#ifdef DEBUG_STAMP +# ifndef DEBUG +# define DEBUG +# endif +#endif + +#ifdef DEBUG +# ifndef SOAP_DEBUG +# define SOAP_DEBUG +# endif +# ifndef SOAP_MEM_DEBUG +# define SOAP_MEM_DEBUG +# endif +#endif + +#ifdef SOAP_MEM_DEBUG +# ifndef SOAP_MALLOC +# define SOAP_MALLOC(soap, size) soap_track_malloc((soap), __FILE__, __LINE__, (size)) +# endif +# ifndef SOAP_FREE +# define SOAP_FREE(soap, ptr) soap_track_free((soap), __FILE__, __LINE__, (void*)(ptr)) +# endif +#endif + +#ifndef SOAP_MALLOC /* use libc malloc */ +# define SOAP_MALLOC(soap, size) malloc((size)) +#endif + +#ifndef SOAP_FREE /* use libc free */ +# define SOAP_FREE(soap, ptr) free((void*)(ptr)) +#endif + +#ifndef SOAP_MALLOC_UNMANAGED /* use libc malloc to alloc soap context with soap_new() */ +# define SOAP_MALLOC_UNMANAGED(size) malloc((size)) +#endif + +#ifndef SOAP_FREE_UNMANAGED /* use libc free to free soap context with soap_free() */ +# define SOAP_FREE_UNMANAGED(ptr) free((void*)(ptr)) +#endif + +#ifndef SOAP_NOTHROW +# if defined(__GNUC__) && (__GNUC__ <= 2) +# define SOAP_NOTHROW +# elif defined(WITH_LEAN) || defined(WITH_COMPAT) +# define SOAP_NOTHROW +# else +# define SOAP_NOTHROW (std::nothrow) +# endif +#endif + +#if defined(__BORLANDC__) && !defined(__clang__) +/* Embarcadero Classic compiler special case */ +# ifndef SOAP_NEW +# define SOAP_NEW(soap, type) new SOAP_NOTHROW (type) +# endif +# ifndef SOAP_NEW_ARRAY +# define SOAP_NEW_ARRAY(soap, type, n) new SOAP_NOTHROW (type[n]) +# endif +# ifndef SOAP_PLACEMENT_NEW +# define SOAP_PLACEMENT_NEW(soap, buf, type) new (buf) (type) +# endif +#elif (defined(__GNUC__) && (__GNUC__ <= 2)) || defined(__clang__) || defined(_AIX) || defined(AIX) +/* old form w/o parenthesis, soap context may be NULL */ +# ifndef SOAP_NEW +# define SOAP_NEW(soap, type) new SOAP_NOTHROW type +# endif +# ifndef SOAP_NEW_ARRAY +# define SOAP_NEW_ARRAY(soap, type, n) new SOAP_NOTHROW type[n] +# endif +# ifndef SOAP_PLACEMENT_NEW +# define SOAP_PLACEMENT_NEW(soap, buf, type) new (buf) type +# endif +#else +/* new form with parenthesis for (type) but not type[n], soap context may be NULL */ +# ifndef SOAP_NEW +# define SOAP_NEW(soap, type) new SOAP_NOTHROW (type) +# endif +# ifndef SOAP_NEW_ARRAY +# define SOAP_NEW_ARRAY(soap, type, n) new SOAP_NOTHROW type[n] +# endif +# ifndef SOAP_PLACEMENT_NEW +# define SOAP_PLACEMENT_NEW(soap, buf, type) new (buf) (type) +# endif +#endif + +#ifndef SOAP_DELETE /* use C++ delete operator, soap context may be NULL */ +# define SOAP_DELETE(soap, obj, type) delete obj +#endif + +#ifndef SOAP_DELETE_ARRAY /* use C++ delete[] operator, soap context may be NULL */ +# define SOAP_DELETE_ARRAY(soap, obj, type) delete[] obj +#endif + +#ifndef SOAP_NEW_UNMANAGED /* use C++ unmanaged new operator for soap_new() and soap::copy() */ +# define SOAP_NEW_UNMANAGED(soap) new SOAP_NOTHROW soap +#endif + +#ifndef SOAP_DELETE_UNMANAGED /* use C++ unmanaged delete operator for soap_free() */ +# define SOAP_DELETE_UNMANAGED(soap) delete soap +#endif + +#ifdef SOAP_DEBUG +# ifndef SOAP_MESSAGE +# define SOAP_MESSAGE fprintf +# endif +# ifndef DBGLOG +# ifdef DEBUG_STAMP +# ifdef WIN32 +# define DBGLOG(DBGFILE, CMD) \ +{ if (soap)\ + { if (!soap->fdebug[SOAP_INDEX_##DBGFILE])\ + soap_open_logfile((struct soap*)soap, SOAP_INDEX_##DBGFILE);\ + if (soap->fdebug[SOAP_INDEX_##DBGFILE])\ + { FILE *fdebug = soap->fdebug[SOAP_INDEX_##DBGFILE];\ + SYSTEMTIME _localTime;\ + ::GetLocalTime(&_localTime); \ + fprintf(fdebug, "%02d%02d%02d %02d:%02d:%02d.%03d|", (int)_localTime.wYear%100, (int)_localTime.wMonth, (int)_localTime.wDay, (int)_localTime.wHour, (int)_localTime.wMinute, (int)_localTime.wSecond, (int)_localTime.wMilliseconds);\ + CMD;\ + fflush(fdebug);\ + }\ + }\ +} +# else +# define DBGLOG(DBGFILE, CMD) \ +{ if (soap)\ + { if (!soap->fdebug[SOAP_INDEX_##DBGFILE])\ + soap_open_logfile((struct soap*)soap, SOAP_INDEX_##DBGFILE);\ + if (soap->fdebug[SOAP_INDEX_##DBGFILE])\ + { FILE *fdebug = soap->fdebug[SOAP_INDEX_##DBGFILE];\ + struct timeval _tv;\ + struct tm _tm;\ + gettimeofday(&_tv, NULL);\ + localtime_r(&_tv.tv_sec, &_tm);\ + fprintf(fdebug, "%02d%02d%02d %02d:%02d:%02d.%06ld|", (int)_tm.tm_year%100, (int)_tm.tm_mon+1, (int)_tm.tm_mday, (int)_tm.tm_hour, (int)_tm.tm_min, (int)_tm.tm_sec, (long)_tv.tv_usec);\ + CMD;\ + fflush(fdebug);\ + }\ + }\ +} +# endif +# else +# define DBGLOG(DBGFILE, CMD) \ +{ if (soap)\ + { if (!soap->fdebug[SOAP_INDEX_##DBGFILE])\ + soap_open_logfile((struct soap*)soap, SOAP_INDEX_##DBGFILE);\ + if (soap->fdebug[SOAP_INDEX_##DBGFILE])\ + { FILE *fdebug = soap->fdebug[SOAP_INDEX_##DBGFILE];\ + CMD;\ + fflush(fdebug);\ + }\ + }\ +} +# endif +# endif +# ifndef DBGMSG +# define DBGMSG(DBGFILE, MSG, LEN) \ +{ if (soap)\ + { if (!soap->fdebug[SOAP_INDEX_##DBGFILE])\ + soap_open_logfile((struct soap*)soap, SOAP_INDEX_##DBGFILE);\ + if (soap->fdebug[SOAP_INDEX_##DBGFILE])\ + { fwrite((void*)(MSG), 1, (size_t)(LEN), soap->fdebug[SOAP_INDEX_##DBGFILE]);\ + fflush(soap->fdebug[SOAP_INDEX_##DBGFILE]);\ + }\ + }\ +} +# endif +# ifndef DBGFUN +# define DBGFUN(FNAME) DBGLOG(TEST, SOAP_MESSAGE(fdebug, "%s(%d): %s()\n", __FILE__, __LINE__, FNAME)) +# define DBGFUN1(FNAME, FMT, ARG) DBGLOG(TEST, SOAP_MESSAGE(fdebug, "%s(%d): %s(" FMT ")\n", __FILE__, __LINE__, FNAME, (ARG))) +# define DBGFUN2(FNAME, FMT1, ARG1, FMT2, ARG2) DBGLOG(TEST, SOAP_MESSAGE(fdebug, "%s(%d): %s(" FMT1 ", " FMT2 ")\n", __FILE__, __LINE__, FNAME, (ARG1), (ARG2))) +# define DBGFUN3(FNAME, FMT1, ARG1, FMT2, ARG2, FMT3, ARG3) DBGLOG(TEST, SOAP_MESSAGE(fdebug, "%s(%d): %s(" FMT1 ", " FMT2 ", " FMT3 ")\n", __FILE__, __LINE__, FNAME, (ARG1), (ARG2), (ARG3))) +# define DBGFUN4(FNAME, FMT1, ARG1, FMT2, ARG2, FMT3, ARG3, FMT4, ARG4) DBGLOG(TEST, SOAP_MESSAGE(fdebug, "%s(%d): %s(" FMT1 ", " FMT2 ", " FMT3 ", " FMT4 ")\n", __FILE__, __LINE__, FNAME, (ARG1), (ARG2), (ARG3), (ARG4))) +# endif +# ifndef DBGHEX +# define DBGHEX(DBGFILE, MSG, LEN) \ +{ if (soap)\ + { if (!soap->fdebug[SOAP_INDEX_##DBGFILE])\ + soap_open_logfile(soap, SOAP_INDEX_##DBGFILE);\ + if (soap->fdebug[SOAP_INDEX_##DBGFILE])\ + { int i; char *s;\ + for (s = (char*)(MSG), i = (LEN); i; i--)\ + fprintf(soap->fdebug[SOAP_INDEX_##DBGFILE], "%2.2X ", (int)*s++&0xFF);\ + fflush(soap->fdebug[SOAP_INDEX_##DBGFILE]);\ + }\ + }\ +} +# endif +#else +# define DBGLOG(DBGFILE, CMD) +# define DBGMSG(DBGFILE, MSG, LEN) +# define DBGFUN(FNAME) +# define DBGFUN1(FNAME, FMT, ARG) +# define DBGFUN2(FNAME, FMT1, ARG1, FMT2, ARG2) +# define DBGFUN3(FNAME, FMT1, ARG1, FMT2, ARG2, FMT3, ARG3) +# define DBGFUN4(FNAME, FMT1, ARG1, FMT2, ARG2, FMT3, ARG3, FMT4, ARG4) +# define DBGHEX(DBGFILE, MSG, LEN) +#endif + +/* UCS-4 requires 32 bits (0-7FFFFFFF, the sign bit is used by gSOAP to distinguish XML entities) */ +typedef soap_int32 soap_wchar; + +/* forward declaration */ +struct SOAP_CMAC soap; + +/* namespace table row */ +struct SOAP_CMAC Namespace +{ + const char *id; + const char *ns; + const char *in; + char *out; +}; + +/* namespace stack */ +struct soap_nlist +{ + struct soap_nlist *next; + unsigned int level; /* nesting depth level */ + short index; /* corresponding entry in ns mapping table */ + const char *ns; /* only set when parsed ns URI is not in the ns mapping table */ + char id[1]; /* the actual string value flows into the allocated region id[0...] below this struct */ +}; + +/* block header, the data flows into the allocated region below this struct */ +struct soap_bhead +{ + struct soap_bhead *next; + size_t size; +}; + +/* block stack for nested block allocations */ +struct soap_blist +{ + struct soap_blist *next; + struct soap_bhead *head; + size_t size; + size_t item; +}; + +/* pointer serialization management */ +struct soap_plist +{ + struct soap_plist *next; + const void *ptr; + void *dup; + const void *array; /* array pointer */ + int size; /* array size */ + int type; + int id; + char mark1; /* 0=single-ref, 1=embedded-multi-ref (SOAP1.1), 2=multi-ref, 3=attachment */ + char mark2; +}; + +/* block allocation for pointer serialization management */ +struct soap_pblk +{ + struct soap_pblk *next; + struct soap_plist plist[SOAP_PTRBLK]; +}; + +#ifdef SOAP_MEM_DEBUG +/* malloc/free tracking for debugging */ +struct soap_mlist +{ + struct soap_mlist *next; + const void *ptr; + const char *file; + int line; + short live; +}; +#endif + +/* class allocation list */ +struct soap_clist +{ + struct soap_clist *next; + void *ptr; + int type; + int size; /* array size */ + int (*fdelete)(struct soap*, struct soap_clist*); +}; + +/* attributes */ +struct soap_attribute +{ + struct soap_attribute *next; + short flag; /* soap_set_attr: 1 = normal, 2 = utf content */ + char *value; + size_t size; + const char *ns; + short visible; + char name[1]; /* the actual name string flows into the allocated region below this struct */ +}; + +#if !defined(WITH_LEAN) || defined(WITH_COOKIES) +struct soap_cookie +{ + struct soap_cookie *next; + char *name; + char *value; + char *domain; + char *path; + ULONG64 expire; /* client-side: local time to expire (value cast to time_t) */ + long maxage; /* server-side: seconds to expire */ + unsigned int version; + short secure; + short session; /* server-side */ + short env; /* server-side: got cookie from client and should not be (re)send */ + short modified; /* server-side: client cookie was modified and should be send */ +}; +#endif + +SOAP_FMAC1 struct soap_multipart* SOAP_FMAC2 soap_next_multipart(struct soap_multipart*); + +#ifdef __cplusplus +class soap_multipart_iterator +{ + public: + typedef ptrdiff_t difference_type; + typedef soap_multipart value_type; + typedef soap_multipart& reference; + typedef soap_multipart* pointer; + typedef std::forward_iterator_tag iterator_category; + struct soap_multipart *content; + soap_multipart_iterator() : content(NULL) { } + soap_multipart_iterator(struct soap_multipart *p) : content(p) { } + bool operator==(const soap_multipart_iterator& iter) const { return (bool)(content == iter.content); } + bool operator!=(const soap_multipart_iterator& iter) const { return (bool)(content != iter.content); } + struct soap_multipart& operator*() const { return *content; } + struct soap_multipart *operator->() const { return content; } + soap_multipart_iterator& operator++() { content = soap_next_multipart(content); return *this; } + soap_multipart_iterator operator++(int) { soap_multipart_iterator iter(*this); content = soap_next_multipart(content); return iter; } +}; +#endif + +#ifndef WITH_LEANER +struct soap_dime +{ + size_t count; + size_t size; + size_t chunksize; + size_t buflen; + char flags; + char *ptr; + const char *id; + const char *type; + const char *options; + struct soap_multipart *list; /* list of DIME attachments received */ + struct soap_multipart *first, *last; /* temporary in/out queue */ +#ifdef __cplusplus + typedef soap_multipart_iterator iterator; + typedef soap_multipart_iterator const_iterator; + const_iterator cbegin() const { soap_multipart_iterator iter(list); return iter; } + const_iterator cend() const { soap_multipart_iterator iter(NULL); return iter; } + iterator begin() { soap_multipart_iterator iter(list); return iter; } + iterator end() { soap_multipart_iterator iter(NULL); return iter; } +#endif +}; +#endif + +#ifndef WITH_LEANER +struct soap_mime +{ + char *boundary; /* MIME boundary */ + const char *start; /* MIME start ID */ + struct soap_multipart *list; /* list of MIME attachments received */ + struct soap_multipart *first, *last; /* temporary in/out queue */ +#ifdef __cplusplus + typedef soap_multipart_iterator iterator; + typedef soap_multipart_iterator const_iterator; + const_iterator cbegin() const { soap_multipart_iterator iter(list); return iter; } + const_iterator cend() const { soap_multipart_iterator iter(NULL); return iter; } + iterator begin() { soap_multipart_iterator iter(list); return iter; } + iterator end() { soap_multipart_iterator iter(NULL); return iter; } +#endif +}; +#endif + +#ifndef WITH_LEANER +/* RFC2045 MIME content transfer encodings */ +enum soap_mime_encoding +{ + SOAP_MIME_NONE, + SOAP_MIME_7BIT, + SOAP_MIME_8BIT, + SOAP_MIME_BINARY, + SOAP_MIME_QUOTED_PRINTABLE, + SOAP_MIME_BASE64, + SOAP_MIME_IETF_TOKEN, + SOAP_MIME_X_TOKEN +}; +#endif + +#ifndef WITH_LEANER +/* DIME/MIME multipart list */ +struct soap_multipart +{ + struct soap_multipart *next; + const char *ptr; /* points to raw data content */ + size_t size; /* size of data content */ + const char *id; /* DIME/MIME content ID or form data name */ + const char *type; /* DIME/MIME type (MIME type format) */ + const char *options; /* DIME options */ + enum soap_mime_encoding encoding; /* MIME Content-Transfer-Encoding */ + const char *location; /* MIME Content-Location (optional) */ + const char *description; /* MIME Content-Description (optional) */ +#ifdef __cplusplus + typedef soap_multipart_iterator iterator; + typedef soap_multipart_iterator const_iterator; +#endif +}; +#endif + +#ifndef WITH_LEANER +/* attachment DIME and MTOM XOP forwarding */ +struct soap_xlist +{ + struct soap_xlist *next; + unsigned char **ptr; + int *size; + char *id; + char **type; + char **options; +}; +#endif + +/******************************************************************************/ + +#ifndef WITH_LEANER + +/* dom.c[pp] functions (optional, compile and link dom.c[pp] */ +struct SOAP_CMAC soap_dom_element; +struct SOAP_CMAC soap_dom_attribute; + +/* soap_dom_element construction */ + +SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_elt_new(struct soap *soap, const char *ns, const char *tag); +SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_elt_new_w(struct soap *soap, const char *ns, const wchar_t *tag); +SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_elt_set(struct soap_dom_element *elt, const char *ns, const char *tag); +SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_elt_set_w(struct soap_dom_element *elt, const char *ns, const wchar_t *tag); + +SOAP_FMAC1 struct soap_dom_attribute * SOAP_FMAC2 soap_att(struct soap_dom_element *elt, const char *ns, const char *tag); +SOAP_FMAC1 struct soap_dom_attribute * SOAP_FMAC2 soap_att_w(struct soap_dom_element *elt, const char *ns, const wchar_t *tag); +SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_elt(struct soap_dom_element *elt, const char *ns, const char *tag); +SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_elt_w(struct soap_dom_element *elt, const char *ns, const wchar_t *tag); +SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_nth_elt(struct soap_dom_element *elt, const char *ns, const char *tag, size_t n); +SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_nth_elt_w(struct soap_dom_element *elt, const char *ns, const wchar_t *tag, size_t n); +SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_nth(struct soap_dom_element *elt, size_t n); +SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_add_att(struct soap_dom_element *elt, const struct soap_dom_attribute *node); +SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_add_elt(struct soap_dom_element *elt, const struct soap_dom_element *node); +SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_add_atts(struct soap_dom_element *elt, const struct soap_dom_attribute *atts); +SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_add_elts(struct soap_dom_element *elt, const struct soap_dom_element *elts); + +/* soap_dom_element assignment */ + +SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_elt_bool(struct soap_dom_element *elt, LONG64 b); +SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_elt_int(struct soap_dom_element *elt, LONG64 n); +SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_elt_double(struct soap_dom_element *elt, double x); +SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_elt_text(struct soap_dom_element *elt, const char *text); +SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_elt_text_w(struct soap_dom_element *elt, const wchar_t *text); +SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_elt_node(struct soap_dom_element *elt, const void *node, int type); +SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_elt_copy(struct soap_dom_element *elt, const struct soap_dom_element *node); + +/* soap_dom_element properties */ + +SOAP_FMAC1 int SOAP_FMAC2 soap_elt_match(const struct soap_dom_element *elt, const char *ns, const char *patt); +SOAP_FMAC1 int SOAP_FMAC2 soap_elt_match_w(const struct soap_dom_element *elt, const char *ns, const wchar_t *patt); +SOAP_FMAC1 const char * SOAP_FMAC2 soap_elt_get_ns(const struct soap_dom_element *elt); +SOAP_FMAC1 const char * SOAP_FMAC2 soap_elt_get_tag(const struct soap_dom_element *elt); +SOAP_FMAC1 int SOAP_FMAC2 soap_elt_is_true(const struct soap_dom_element *elt); +SOAP_FMAC1 int SOAP_FMAC2 soap_elt_is_false(const struct soap_dom_element *elt); +SOAP_FMAC1 int SOAP_FMAC2 soap_elt_get_int(const struct soap_dom_element *elt); +SOAP_FMAC1 long SOAP_FMAC2 soap_elt_get_long(const struct soap_dom_element *elt); +SOAP_FMAC1 LONG64 SOAP_FMAC2 soap_elt_get_LONG64(const struct soap_dom_element *elt); +SOAP_FMAC1 double SOAP_FMAC2 soap_elt_get_double(const struct soap_dom_element *elt); +SOAP_FMAC1 const char * SOAP_FMAC2 soap_elt_get_text(const struct soap_dom_element *elt); +SOAP_FMAC1 const void * SOAP_FMAC2 soap_elt_get_node(const struct soap_dom_element *elt, int type); +SOAP_FMAC1 int SOAP_FMAC2 soap_elt_get_type(const struct soap_dom_element *elt, const void **node); +SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_elt_parent(const struct soap_dom_element *elt); +SOAP_FMAC1 size_t SOAP_FMAC2 soap_elt_depth(const struct soap_dom_element *elt); +SOAP_FMAC1 size_t SOAP_FMAC2 soap_elt_index(const struct soap_dom_element *elt); +SOAP_FMAC1 size_t SOAP_FMAC2 soap_elt_len(const struct soap_dom_element *elt); +SOAP_FMAC1 size_t SOAP_FMAC2 soap_elt_nth(const struct soap_dom_element *elt); + +/* soap_dom_attribute construction */ + +SOAP_FMAC1 struct soap_dom_attribute * SOAP_FMAC2 soap_att_new(struct soap *soap, const char *ns, const char *tag); +SOAP_FMAC1 struct soap_dom_attribute * SOAP_FMAC2 soap_att_new_w(struct soap *soap, const char *ns, const wchar_t *tag); +SOAP_FMAC1 struct soap_dom_attribute * SOAP_FMAC2 soap_att_set(struct soap_dom_attribute *att, const char *ns, const char *tag); +SOAP_FMAC1 struct soap_dom_attribute * SOAP_FMAC2 soap_att_set_w(struct soap_dom_attribute *att, const char *ns, const wchar_t *tag); +SOAP_FMAC1 struct soap_dom_attribute * SOAP_FMAC2 soap_att_add(struct soap_dom_attribute *att, const char *ns, const char *tag); +SOAP_FMAC1 struct soap_dom_attribute * SOAP_FMAC2 soap_att_add_w(struct soap_dom_attribute *att, const char *ns, const wchar_t *tag); + +/* soap_dom_attribute assignment */ + +SOAP_FMAC1 struct soap_dom_attribute * SOAP_FMAC2 soap_att_bool(struct soap_dom_attribute *att, LONG64 b); +SOAP_FMAC1 struct soap_dom_attribute * SOAP_FMAC2 soap_att_int(struct soap_dom_attribute *att, LONG64 n); +SOAP_FMAC1 struct soap_dom_attribute * SOAP_FMAC2 soap_att_double(struct soap_dom_attribute *att, double x); +SOAP_FMAC1 struct soap_dom_attribute * SOAP_FMAC2 soap_att_text(struct soap_dom_attribute *att, const char *text); +SOAP_FMAC1 struct soap_dom_attribute * SOAP_FMAC2 soap_att_text_w(struct soap_dom_attribute *att, const wchar_t *text); +SOAP_FMAC1 struct soap_dom_attribute * SOAP_FMAC2 soap_att_copy(struct soap_dom_attribute *att, const struct soap_dom_attribute *node); + +/* soap_dom_attribute properties */ + +SOAP_FMAC1 int SOAP_FMAC2 soap_att_match(const struct soap_dom_attribute *att, const char *ns, const char *patt); +SOAP_FMAC1 int SOAP_FMAC2 soap_att_match_w(const struct soap_dom_attribute *att, const char *ns, const wchar_t *patt); +SOAP_FMAC1 const char * SOAP_FMAC2 soap_att_get_ns(const struct soap_dom_attribute *att); +SOAP_FMAC1 const char * SOAP_FMAC2 soap_att_get_tag(const struct soap_dom_attribute *att); +SOAP_FMAC1 int SOAP_FMAC2 soap_att_is_true(const struct soap_dom_attribute *att); +SOAP_FMAC1 int SOAP_FMAC2 soap_att_is_false(const struct soap_dom_attribute *att); +SOAP_FMAC1 int SOAP_FMAC2 soap_att_get_int(const struct soap_dom_attribute *att); +SOAP_FMAC1 long SOAP_FMAC2 soap_att_get_long(const struct soap_dom_attribute *att); +SOAP_FMAC1 LONG64 SOAP_FMAC2 soap_att_get_LONG64(const struct soap_dom_attribute *att); +SOAP_FMAC1 double SOAP_FMAC2 soap_att_get_double(const struct soap_dom_attribute *att); +SOAP_FMAC1 const char * SOAP_FMAC2 soap_att_get_text(const struct soap_dom_attribute *att); + +/* DOM local traversal */ + +SOAP_FMAC1 struct soap_dom_attribute * SOAP_FMAC2 soap_att_first(struct soap_dom_element *elt); +SOAP_FMAC1 struct soap_dom_attribute * SOAP_FMAC2 soap_att_next(const struct soap_dom_attribute *att); +SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_elt_first(struct soap_dom_element *elt); +SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_elt_next(const struct soap_dom_element *elt); + +/* DOM local retrieval */ + +SOAP_FMAC1 struct soap_dom_attribute * SOAP_FMAC2 soap_att_get(const struct soap_dom_element *elt, const char *ns, const char *tag); +SOAP_FMAC1 struct soap_dom_attribute * SOAP_FMAC2 soap_att_get_w(const struct soap_dom_element *elt, const char *ns, const wchar_t *tag); +SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_elt_get(const struct soap_dom_element *elt, const char *ns, const char *tag); +SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_elt_get_w(const struct soap_dom_element *elt, const char *ns, const wchar_t *tag); +SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_elt_get_next(const struct soap_dom_element *elt); +SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_elt_get_nth(struct soap_dom_element *elt, size_t n); + +/* DOM local search */ + +SOAP_FMAC1 struct soap_dom_attribute * SOAP_FMAC2 soap_att_find(struct soap_dom_element *elt, const char *ns, const char *patt); +SOAP_FMAC1 struct soap_dom_attribute * SOAP_FMAC2 soap_att_find_next(const struct soap_dom_attribute *att, const char *ns, const char *patt); +SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_elt_find(struct soap_dom_element *elt, const char *ns, const char *patt); +SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_elt_find_next(const struct soap_dom_element *elt, const char *ns, const char *patt); +SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_elt_find_type(struct soap_dom_element *elt, const char *ns, const char *patt, int type); +SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_elt_find_next_type(const struct soap_dom_element *elt, const char *ns, const char *patt, int type); + +/* DOM size of local search results */ + +SOAP_FMAC1 size_t SOAP_FMAC2 soap_att_size(struct soap_dom_element *elt, const char *ns, const char *patt); +SOAP_FMAC1 size_t SOAP_FMAC2 soap_elt_size(struct soap_dom_element *elt, const char *ns, const char *patt); +SOAP_FMAC1 size_t SOAP_FMAC2 soap_elt_size_type(struct soap_dom_element *elt, const char *ns, const char *patt, int type); + +/* DOM deep traversal */ + +SOAP_FMAC1 struct soap_dom_attribute * SOAP_FMAC2 soap_dom_next_attribute(const struct soap_dom_attribute *att); +SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_dom_next_element(const struct soap_dom_element *elt, const struct soap_dom_element *end); + +/* DOM deep search */ + +SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_dom_find(struct soap_dom_element *begin, const struct soap_dom_element *end, const char *ns, const char *patt, int type); +SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_dom_find_next(const struct soap_dom_element *elt, const struct soap_dom_element *end, const char *ns, const char *patt, int type); + +#endif + +#if defined(__cplusplus) +} /* extern "C" */ +#endif + +#ifndef WITH_LEANER +#ifdef __cplusplus +class SOAP_CMAC soap_dom_attribute_iterator +{ + public: + typedef ptrdiff_t difference_type; + typedef soap_dom_attribute value_type; + typedef soap_dom_attribute& reference; + typedef soap_dom_attribute* pointer; + typedef std::forward_iterator_tag iterator_category; + struct soap_dom_attribute *iter; + const char *nstr; + const char *name; + bool operator==(const soap_dom_attribute_iterator&) const; + bool operator!=(const soap_dom_attribute_iterator&) const; + struct soap_dom_attribute& operator*() const; + struct soap_dom_attribute *operator->() const; + soap_dom_attribute_iterator& operator++(); + soap_dom_attribute_iterator operator++(int); + soap_dom_attribute_iterator(); + soap_dom_attribute_iterator(struct soap_dom_attribute*); + ~soap_dom_attribute_iterator(); +}; +#endif +#endif + +#ifndef WITH_LEANER +struct SOAP_CMAC soap_dom_attribute +{ + struct soap_dom_attribute *next; + const char *nstr; + const char *name; + const char *text; + struct soap *soap; +#ifdef __cplusplus + typedef soap_dom_attribute_iterator iterator; + typedef soap_dom_attribute_iterator const_iterator; + soap_dom_attribute(struct soap *soap = NULL); + soap_dom_attribute(const soap_dom_attribute& att); + soap_dom_attribute(struct soap *soap, const char *tag); + soap_dom_attribute(struct soap *soap, const wchar_t *tag); + soap_dom_attribute(struct soap *soap, const char *ns, const char *tag, const char *str); + soap_dom_attribute(struct soap *soap, const char *ns, const char *tag, const wchar_t *str); + soap_dom_attribute(struct soap *soap, const char *ns, const wchar_t *tag, const char *str); + soap_dom_attribute(struct soap *soap, const char *ns, const wchar_t *tag, const wchar_t *str); + soap_dom_attribute(struct soap *soap, const char *ns, const char *tag, const std::string& str); + soap_dom_attribute(struct soap *soap, const char *ns, const char *tag, const std::wstring& str); + soap_dom_attribute(struct soap *soap, const char *ns, const wchar_t *tag, const std::string& str); + soap_dom_attribute(struct soap *soap, const char *ns, const wchar_t *tag, const std::wstring& str); + ~soap_dom_attribute(); + soap_dom_attribute& set(const char *ns, const char *tag) { return *soap_att_set(this, ns, tag); } + soap_dom_attribute& set(const char *ns, const wchar_t *tag) { return *soap_att_set_w(this, ns, tag); } + soap_dom_attribute& set(bool b) { return *soap_att_bool(this, b); } + soap_dom_attribute& set(int n) { return *soap_att_int(this, n); } + soap_dom_attribute& set(LONG64 n) { return *soap_att_int(this, n); } + soap_dom_attribute& set(float x) { return *soap_att_double(this, x); } + soap_dom_attribute& set(double x) { return *soap_att_double(this, x); } + soap_dom_attribute& set(const char *str) { return *soap_att_text(this, str); } + soap_dom_attribute& set(const wchar_t *str) { return *soap_att_text_w(this, str); } +#ifndef WITH_COMPAT + soap_dom_attribute& set(const std::string& str) { return *soap_att_text(this, str.c_str()); } + soap_dom_attribute& set(const std::wstring& str) { return *soap_att_text_w(this, str.c_str()); } +#endif + soap_dom_attribute& operator=(bool b) { return *soap_att_bool(this, b); } + soap_dom_attribute& operator=(int n) { return *soap_att_int(this, n); } + soap_dom_attribute& operator=(LONG64 n) { return *soap_att_int(this, n); } + soap_dom_attribute& operator=(float x) { return *soap_att_double(this, x); } + soap_dom_attribute& operator=(double x) { return *soap_att_double(this, x); } + soap_dom_attribute& operator=(const char *str) { return *soap_att_text(this, str); } + soap_dom_attribute& operator=(const wchar_t *str) { return *soap_att_text_w(this, str); } +#ifndef WITH_COMPAT + soap_dom_attribute& operator=(const std::string& str) { return *soap_att_text(this, str.c_str()); } + soap_dom_attribute& operator=(const std::wstring& str) { return *soap_att_text_w(this, str.c_str()); } +#endif + soap_dom_attribute& operator=(const soap_dom_attribute& att) { return *soap_att_copy(this, &att); } + soap_dom_attribute& att(const char *tag) { return *soap_att_add(this, NULL, tag); } + soap_dom_attribute& att(const wchar_t *tag) { return *soap_att_add_w(this, NULL, tag); } + soap_dom_attribute& att(const char *ns, const char *tag) { return *soap_att_add(this, ns, tag); } + soap_dom_attribute& att(const char *ns, const wchar_t *tag) { return *soap_att_add_w(this, ns, tag); } + bool match(const char *patt) const { return soap_att_match(this, NULL, patt) != 0; } + bool match(const wchar_t *patt) const { return soap_att_match_w(this, NULL, patt) != 0; } + bool match(const char *ns, const char *patt) const { return soap_att_match(this, ns, patt) != 0; } + bool match(const char *ns, const wchar_t *patt) const { return soap_att_match_w(this, ns, patt) != 0; } + const char *ns() const { return this->nstr; } + const char *tag() const { return this->name; } + bool is_true() const { return soap_att_is_true(this) != 0; } + bool is_false() const { return soap_att_is_false(this) != 0; } + LONG64 get_int() const { return soap_att_get_LONG64(this); } + double get_double() const { return soap_att_get_double(this); } + const char *get_text() const { return this->text; } + operator bool() const { return soap_att_is_true(this) != 0; } + operator int() const { return soap_att_get_int(this); } + operator LONG64() const { return soap_att_get_LONG64(this); } + operator double() const { return soap_att_get_double(this); } + operator const char*() const { return this->text; } + const_iterator cbegin() { return this->att_begin(); } + const_iterator cend() { return this->att_end(); } + iterator begin() { return this->att_begin(); } + iterator end() { return this->att_end(); } + iterator att_begin() { return soap_dom_attribute_iterator(this); } + iterator att_end() { return soap_dom_attribute_iterator(NULL); } + iterator att_find(const char *patt) { return att_find(NULL, patt); } + iterator att_find(const wchar_t *patt) { return att_find(NULL, patt); } + iterator att_find(const char *ns, const char *patt); + iterator att_find(const char *ns, const wchar_t *patt); + void unlink(); +#endif +}; +#endif + +#ifndef WITH_LEANER +#ifdef __cplusplus +class SOAP_CMAC soap_dom_element_iterator +{ + public: + typedef ptrdiff_t difference_type; + typedef soap_dom_element value_type; + typedef soap_dom_element& reference; + typedef soap_dom_element* pointer; + typedef std::forward_iterator_tag iterator_category; + struct soap_dom_element *iter; + struct soap_dom_element *stop; + const char *nstr; + const char *name; + int type; + bool deep; + bool operator==(const soap_dom_element_iterator&) const; + bool operator!=(const soap_dom_element_iterator&) const; + struct soap_dom_element& operator*() const; + struct soap_dom_element *operator->() const; + soap_dom_element_iterator& operator++(); + soap_dom_element_iterator operator++(int); + soap_dom_element_iterator(); + soap_dom_element_iterator(struct soap_dom_element*); + ~soap_dom_element_iterator(); +}; +#endif +#endif + +#ifndef WITH_LEANER +struct SOAP_CMAC soap_dom_element +{ + struct soap_dom_element *next; + struct soap_dom_element *prnt; + struct soap_dom_element *elts; + struct soap_dom_attribute *atts; + const char *nstr; + const char *name; + const char *lead; + const char *text; + const char *code; + const char *tail; + const void *node; + int type; + struct soap *soap; +#ifdef __cplusplus + typedef soap_dom_element_iterator iterator; + typedef soap_dom_element_iterator const_iterator; + soap_dom_element(struct soap *soap = NULL); + soap_dom_element(const soap_dom_element& elt); + soap_dom_element(struct soap *soap, const char *tag); + soap_dom_element(struct soap *soap, const wchar_t *tag); + soap_dom_element(struct soap *soap, const char *ns, const char *tag); + soap_dom_element(struct soap *soap, const char *ns, const wchar_t *tag); + soap_dom_element(struct soap *soap, const char *ns, const char *tag, const char *str); + soap_dom_element(struct soap *soap, const char *ns, const char *tag, const wchar_t *str); + soap_dom_element(struct soap *soap, const char *ns, const wchar_t *tag, const char *str); + soap_dom_element(struct soap *soap, const char *ns, const wchar_t *tag, const wchar_t *str); +#ifndef WITH_COMPAT + soap_dom_element(struct soap *soap, const char *ns, const char *tag, const std::string& str); + soap_dom_element(struct soap *soap, const char *ns, const char *tag, const std::wstring& str); + soap_dom_element(struct soap *soap, const char *ns, const wchar_t *tag, const std::string& str); + soap_dom_element(struct soap *soap, const char *ns, const wchar_t *tag, const std::wstring& str); +#endif + soap_dom_element(struct soap *soap, const char *ns, const char *tag, const void *nod, int typ); + soap_dom_element(struct soap *soap, const char *ns, const wchar_t *tag, const void *nod, int typ); + ~soap_dom_element(); + soap_dom_element& set(const char *ns, const char *tag) { return *soap_elt_set(this, ns, tag); } + soap_dom_element& set(const char *ns, const wchar_t *tag) { return *soap_elt_set_w(this, ns, tag); } + soap_dom_element& set(bool b) { return *soap_elt_bool(this, b); } + soap_dom_element& set(int n) { return *soap_elt_int(this, n); } + soap_dom_element& set(LONG64 n) { return *soap_elt_int(this, n); } + soap_dom_element& set(float x) { return *soap_elt_double(this, x); } + soap_dom_element& set(double x) { return *soap_elt_double(this, x); } + soap_dom_element& set(const char *str) { return *soap_elt_text(this, str); } + soap_dom_element& set(const wchar_t *str) { return *soap_elt_text_w(this, str); } +#ifndef WITH_COMPAT + soap_dom_element& set(const std::string& str) { return *soap_elt_text(this, str.c_str()); } + soap_dom_element& set(const std::wstring& str) { return *soap_elt_text_w(this, str.c_str()); } +#endif + soap_dom_element& set(const void *nod, int typ) { return *soap_elt_node(this, nod, typ); } + soap_dom_element& add(soap_dom_element& elt) { return *soap_add_elt(this, &elt); } + soap_dom_element& add(soap_dom_element *elt) { return *soap_add_elt(this, elt); } + soap_dom_element& add(soap_dom_attribute& att) { return *soap_add_att(this, &att); } + soap_dom_element& add(soap_dom_attribute *att) { return *soap_add_att(this, att); } + soap_dom_element& adds(soap_dom_element& elt) { return *soap_add_elts(this, &elt); } + soap_dom_element& adds(soap_dom_element *elt) { return *soap_add_elts(this, elt); } + soap_dom_element& adds(soap_dom_attribute& att) { return *soap_add_atts(this, &att); } + soap_dom_element& adds(soap_dom_attribute *att) { return *soap_add_atts(this, att); } + soap_dom_element& operator=(bool b) { return *soap_elt_bool(this, b); } + soap_dom_element& operator=(int n) { return *soap_elt_int(this, n); } + soap_dom_element& operator=(LONG64 n) { return *soap_elt_int(this, n); } + soap_dom_element& operator=(float x) { return *soap_elt_double(this, x); } + soap_dom_element& operator=(double x) { return *soap_elt_double(this, x); } + soap_dom_element& operator=(const char *str) { return *soap_elt_text(this, str); } + soap_dom_element& operator=(const wchar_t *str) { return *soap_elt_text_w(this, str); } +#ifndef WITH_COMPAT + soap_dom_element& operator=(const std::string& str) { return *soap_elt_text(this, str.c_str()); } + soap_dom_element& operator=(const std::wstring& str) { return *soap_elt_text_w(this, str.c_str()); } +#endif + soap_dom_element& operator=(const soap_dom_element& elt) { return *soap_elt_copy(this, &elt); } + template soap_dom_element& operator=(const T& nod) { return this->set(&nod, nod.soap_type()); } + template soap_dom_element& operator=(const T *nod) { return this->set(nod, nod->soap_type()); } + template soap_dom_element& operator=(T *nod) { return this->set(nod, nod->soap_type()); } + soap_dom_attribute& att(const char *tag) { return *soap_att(this, NULL, tag); } + soap_dom_attribute& att(const wchar_t *tag) { return *soap_att_w(this, NULL, tag); } + soap_dom_attribute& att(const char *ns, const char *tag) { return *soap_att(this, ns, tag); } + soap_dom_attribute& att(const char *ns, const wchar_t *tag) { return *soap_att_w(this, ns, tag); } + soap_dom_element& elt() { return *soap_elt(this, NULL, NULL); } + soap_dom_element& elt(const char *tag) { return *soap_elt(this, NULL, tag); } + soap_dom_element& elt(const wchar_t *tag) { return *soap_elt_w(this, NULL, tag); } + soap_dom_element& elt(const char *ns, const char *tag) { return *soap_elt(this, ns, tag); } + soap_dom_element& elt(const char *ns, const wchar_t *tag) { return *soap_elt_w(this, ns, tag); } + soap_dom_element& operator[](const char *tag) { return *soap_elt(this, NULL, tag); } + soap_dom_element& operator[](const wchar_t *tag) { return *soap_elt_w(this, NULL, tag); } + soap_dom_element& operator[](size_t n) { return *soap_nth(this, n); } + soap_dom_attribute *att_get(const char *tag) const { return soap_att_get(this, NULL, tag); } + soap_dom_attribute *att_get(const wchar_t *tag) const { return soap_att_get_w(this, NULL, tag); } + soap_dom_attribute *att_get(const char *ns, const char *tag) const { return soap_att_get(this, ns, tag); } + soap_dom_attribute *att_get(const char *ns, const wchar_t *tag) const { return soap_att_get_w(this, ns, tag); } + soap_dom_element *elt_get() const { return soap_elt_get(this, NULL, NULL); } + soap_dom_element *elt_get(const char *tag) const { return soap_elt_get(this, NULL, tag); } + soap_dom_element *elt_get(const wchar_t *tag) const { return soap_elt_get_w(this, NULL, tag); } + soap_dom_element *elt_get(const char *ns, const char *tag) const { return soap_elt_get(this, ns, tag); } + soap_dom_element *elt_get(const char *ns, const wchar_t *tag) const { return soap_elt_get_w(this, ns, tag); } + soap_dom_element *get_next() const { return soap_elt_get_next(this); } + soap_dom_element *get_nth(size_t n) { return soap_elt_get_nth(this, n); } + bool match(const char *pat) const { return soap_elt_match(this, NULL, pat) != 0; } + bool match(const wchar_t *pat) const { return soap_elt_match_w(this, NULL, pat) != 0; } + bool match(const char *ns, const char *pat) const { return soap_elt_match(this, ns, pat) != 0; } + bool match(const char *ns, const wchar_t *pat) const { return soap_elt_match_w(this, ns, pat) != 0; } + const char *ns() const { return this->nstr; } + const char *tag() const { return this->name; } + soap_dom_element *parent() { return this->prnt; } + size_t depth() const { return soap_elt_depth(this); } + size_t index() const { return soap_elt_index(this); } + size_t len() const { return soap_elt_len(this); } + size_t nth() const { return soap_elt_nth(this); } + size_t elt_size() { return soap_elt_size(this, NULL, NULL); } + size_t elt_size(const char *pat, int typ = 0) { return elt_size(NULL, pat, typ); } + size_t elt_size(const char *ns, const char *pat, int typ = 0) { return soap_elt_size_type(this, ns, pat, typ); } + size_t att_size() { return soap_att_size(this, NULL, NULL); } + size_t att_size(const char *pat) { return att_size(NULL, pat); } +#ifndef WITH_COMPAT + size_t att_size(const std::string& pat) { return att_size(NULL, pat); } +#endif + size_t att_size(const char *ns, const char *pat) { return soap_att_size(this, ns, pat); } +#ifndef WITH_COMPAT + size_t att_size(const char *ns, const std::string& pat) { return soap_att_size(this, ns, pat.c_str()); } +#endif + bool is_true() const { return soap_elt_is_true(this) != 0; } + bool is_false() const { return soap_elt_is_false(this) != 0; } + LONG64 get_int() const { return soap_elt_get_LONG64(this); } + double get_double() const { return soap_elt_get_double(this); } + const char *get_text() const { return this->text; } + const void *get_node(int typ) const { return soap_elt_get_node(this, typ); } + int get_type(const void **nod) const { return soap_elt_get_type(this, nod); } + operator bool() const { return soap_elt_is_true(this) != 0; } + operator int() const { return soap_elt_get_int(this); } + operator LONG64() const { return soap_elt_get_LONG64(this); } + operator double() const { return soap_elt_get_double(this); } + operator const char*() const { return this->text; } + const_iterator cbegin() { return this->begin(); } + const_iterator cend() { return this->end(); } + iterator begin(); + iterator end() { return soap_dom_element_iterator(NULL); } + iterator elt_begin() { return soap_dom_element_iterator(this->elts); } + iterator elt_end() { return soap_dom_element_iterator(NULL); } + soap_dom_attribute::iterator att_begin() { return soap_dom_attribute_iterator(this->atts); } + soap_dom_attribute::iterator att_end() { return soap_dom_attribute_iterator(NULL); } + iterator find(const char *pat, int typ = 0) { return find(NULL, pat, typ); } + iterator find(const wchar_t *pat, int typ = 0) { return find(NULL, pat, typ); } + iterator find(const char *ns, const char *pat, int typ = 0); + iterator find(const char *ns, const wchar_t *pat, int typ = 0); + iterator find(int typ); + iterator elt_find(const char *pat, int typ = 0) { return elt_find(NULL, pat, typ); } + iterator elt_find(const wchar_t *pat, int typ = 0) { return elt_find(NULL, pat, typ); } + iterator elt_find(const char *ns, const char *pat, int typ = 0); + iterator elt_find(const char *ns, const wchar_t *pat, int typ = 0); + iterator elt_find(int typ); + soap_dom_attribute::iterator att_find(const char *pat) { return att_find(NULL, pat); } + soap_dom_attribute::iterator att_find(const wchar_t *pat) { return att_find(NULL, pat); } + soap_dom_attribute::iterator att_find(const char *ns, const char *pat); + soap_dom_attribute::iterator att_find(const char *ns, const wchar_t *pat); + void unlink(); +#endif +}; +#endif + +#ifndef WITH_LEANER +SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_dup_xsd__anyType(struct soap *soap, struct soap_dom_element *d, const struct soap_dom_element *a); +SOAP_FMAC1 void SOAP_FMAC2 soap_del_xsd__anyType(const struct soap_dom_element *a); +SOAP_FMAC1 struct soap_dom_attribute * SOAP_FMAC2 soap_dup_xsd__anyAttribute(struct soap *soap, struct soap_dom_attribute *d, const struct soap_dom_attribute *a); +SOAP_FMAC1 void SOAP_FMAC2 soap_del_xsd__anyAttribute(const struct soap_dom_attribute *a); +SOAP_FMAC1 int SOAP_FMAC2 soap_dom_call(struct soap *soap, const char *endpoint, const char *action, const struct soap_dom_element *in, struct soap_dom_element *out); +#endif + +#ifndef WITH_LEANER +#if defined(__cplusplus) && !defined(WITH_COMPAT) +extern std::ostream &operator<<(std::ostream&, const struct soap_dom_element&); +extern std::istream &operator>>(std::istream&, struct soap_dom_element&); + +SOAP_FMAC1 int SOAP_FMAC2 soap_dom_call(struct soap *soap, const char *endpoint, const char *action, const struct soap_dom_element& in, struct soap_dom_element& out); +SOAP_FMAC1 int SOAP_FMAC2 soap_dom_call(struct soap *soap, const char *endpoint, const char *action, const struct soap_dom_element *in, struct soap_dom_element& out); +SOAP_FMAC1 int SOAP_FMAC2 soap_dom_call(struct soap *soap, const char *endpoint, const char *action, const struct soap_dom_element& in, struct soap_dom_element *out); +#endif +#endif + +#if defined(__cplusplus) +extern "C" { +#endif + +/******************************************************************************/ + +struct SOAP_CMAC soap +{ + short state; /* 0 = uninitialized, 1 = initialized, 2 = copy of another soap struct */ + short version; /* 1 = SOAP1.1 and 2 = SOAP1.2 (set automatically from namespace URI in nsmap table), 0 indicates non-SOAP content */ + soap_mode mode; /* internal mode flag, combines imode/omode */ + soap_mode imode; /* input mode flag set with soap_init1(), soap_new1(), or soap_set_imode() */ + soap_mode omode; /* ouput mode flag set with soap_init1(), soap_new1(), or soap_set_omode() */ + const char *float_format; /* user-definable format string for floats (<1024 chars) */ + const char *double_format; /* user-definable format string for doubles (<1024 chars) */ + const char *long_double_format;/* user-definable format string for long doubles (<1024 chars) */ + const char *dime_id_format; /* user-definable format string for integer DIME id ( 0, sets max message size that can be received */ + int recv_timeout; /* user-definable, when > 0, sets socket recv stall timeout in seconds, < 0 in usec */ + int send_timeout; /* user-definable, when > 0, sets socket send stall timeout in seconds, < 0 in usec */ + int transfer_timeout; /* user-definable, when > 0, sets socket total transfer timeout in seconds, < 0 in usec */ + int connect_timeout; /* user-definable, when > 0, sets socket connect() timeout in seconds, < 0 in usec */ + int accept_timeout; /* user-definable, when > 0, sets socket accept() timeout in seconds, < 0 in usec */ + int socket_flags; /* user-definable socket recv() and send() flags, e.g. set to MSG_NOSIGNAL to disable sigpipe */ + int connect_flags; /* user-definable connect() SOL_SOCKET sockopt flags, e.g. set to SO_DEBUG to debug socket */ + int connect_retry; /* number of times to retry connecting (exponential backoff), zero by default */ + int bind_flags; /* user-definable bind() SOL_SOCKET sockopt flags, e.g. set to SO_REUSEADDR to enable reuse */ + short bind_inet6; /* user-definable, when > 0 use AF_INET6 instead of PF_UNSPEC (only with -DWITH_IPV6) */ + short bind_v6only; /* user-definable, when > 0 use IPPROTO_IPV6 sockopt IPV6_V6ONLY (only with -DWITH_IPV6) */ + int accept_flags; /* user-definable accept() SOL_SOCKET sockopt flags */ +#ifdef WITH_SELF_PIPE + int pipe_fd[2]; /* self pipe trick file descriptors used to close the select call from another thread */ +#endif + int sndbuf; /* user-definable SO_SNDBUF setsockopt value */ + int rcvbuf; /* user-definable SO_RCVBUF setsockopt value */ + unsigned short linger_time; /* user-definable linger time for SO_LINGER option */ + unsigned int maxlevel; /* user-definable max XML nesting depth levels, initialized to SOAP_MAXLEVEL */ + long maxlength; /* user-definable max string length, initialized to SOAP_MAXLENGTH, maxlength<=0 is unbounded */ + size_t maxoccurs; /* user-definable max array/container size, initialized to SOAP_MAXOCCURS */ + const char *http_version; /* HTTP version used "1.0" or "1.1" */ + const char *http_content; /* optional custom HTTP content type (with SOAP_PUT, SOAP_POST_FILE, SOAP_FILE) */ + const char *http_extra_header;/* optional custom HTTP header of the form 'key: val' (multiple headers should be separated in the string by \r\n - crlf) */ + const char *encodingStyle; /* default = "" which means that SOAP encoding is used */ + const char *actor; /* SOAP-ENV:actor or role attribute value */ + const char *lang; /* user-definable xml:lang attribute value of SOAP-ENV:Text */ + const struct Namespace *namespaces; /* Pointer to global namespace mapping table */ + struct Namespace *local_namespaces; /* Local namespace mapping table */ + struct soap_nlist *nlist; /* namespace stack */ + struct soap_blist *blist; /* block allocation stack */ + struct soap_clist *clist; /* class instance allocation list */ + void *alist; /* memory allocation (malloc) list */ +#if !defined(WITH_LEANER) || !defined(WITH_NOIDREF) + struct soap_ilist *iht[SOAP_IDHASH]; +#endif + struct soap_plist *pht[SOAP_PTRHASH]; + struct soap_pblk *pblk; /* plist block allocation */ + short pidx; /* plist block allocation */ + short shaky; /* objects in reallocatable containers are on shaky grounds */ + struct SOAP_ENV__Header *header; + struct SOAP_ENV__Fault *fault; + int idnum; + void *user; /* for user to pass user-defined data to callbacks */ + void *data[4]; /* extension data = {smdevp, mecevp, ...} */ + struct soap_plugin *plugins; /* linked list of plug-in data */ + const char *bearer; /* HTTP authorization bearer token value */ + const char *userid; /* HTTP Basic authorization userid */ + const char *passwd; /* HTTP Basic authorization passwd */ + const char *authrealm; /* HTTP authentication realm (and NTLM domain) */ +#if !defined(WITH_LEAN) || defined(WITH_NTLM) + const char *ntlm_challenge; /* HTTP NTLM challenge key string */ + short ntlm_auth; /* HTTP NTLM authentication type */ +#endif + int (*fpost)(struct soap*, const char*, const char*, int, const char*, const char*, ULONG64); + int (*fget)(struct soap*); /* HTTP GET hook (not set by default) */ + int (*fput)(struct soap*); /* HTTP PUT hook (handled as POST by default) */ + int (*fpatch)(struct soap*); /* HTTP PATCH hook (handled as POST by default) */ + int (*fdel)(struct soap*); /* HTTP DELETE hook (not set by default) */ + int (*fopt)(struct soap*); /* HTTP OPTIONS hook (not set by default) */ + int (*fhead)(struct soap*); /* HTTP HEAD hook (not set by default) */ + int (*fform)(struct soap*); /* HTTP/HTML form handler for plugins */ + int (*fposthdr)(struct soap*, const char*, const char*); + int (*fresponse)(struct soap*, int, ULONG64); + int (*fparse)(struct soap*); + int (*fparsehdr)(struct soap*, const char*, const char*); + int (*fheader)(struct soap*); + int (*fresolve)(struct soap*, const char*, struct in_addr* inaddr); + int (*fconnect)(struct soap*, const char*, const char*, int); + int (*fdisconnect)(struct soap*); + int (*fclosesocket)(struct soap*, SOAP_SOCKET); + int (*fshutdownsocket)(struct soap*, SOAP_SOCKET, int); + SOAP_SOCKET (*fopen)(struct soap*, const char*, const char*, int); + SOAP_SOCKET (*faccept)(struct soap*, SOAP_SOCKET, struct sockaddr*, int *n); + int (*fclose)(struct soap*); + int (*fsend)(struct soap*, const char*, size_t); + size_t (*frecv)(struct soap*, char*, size_t); + int (*fpoll)(struct soap*); + void (*fseterror)(struct soap*, const char **c, const char **s); + int (*fencoding)(struct soap*, const char*); + int (*fignore)(struct soap*, const char*); + int (*fserveloop)(struct soap*); + void *(*fplugin)(struct soap*, const char*); +#ifndef WITH_LEANER + int (*fsvalidate)(struct soap*, const char*, const char*); + int (*fwvalidate)(struct soap*, const char*, const wchar_t*); + int (*feltbegin)(struct soap*, const char*); + int (*feltendin)(struct soap*, const char*, const char*); + int (*feltbegout)(struct soap*, const char*, int, const char*); + int (*feltendout)(struct soap*, const char*); + int (*fprepareinitsend)(struct soap*); + int (*fprepareinitrecv)(struct soap*); + int (*fpreparesend)(struct soap*, const char*, size_t); + int (*fpreparerecv)(struct soap*, const char*, size_t); + int (*fpreparefinalsend)(struct soap*); + int (*fpreparefinalrecv)(struct soap*); + int recverror; /* last soap_recv_raw error code for filterrecv */ + int (*ffiltersend)(struct soap*, const char**, size_t*); + int (*ffilterrecv)(struct soap*, char*, size_t*, size_t); + void *(*fdimereadopen)(struct soap*, void*, const char*, const char*, const char*); + void *(*fdimewriteopen)(struct soap*, const char*, const char*, const char*); + void (*fdimereadclose)(struct soap*, void*); + void (*fdimewriteclose)(struct soap*, void*); + size_t (*fdimeread)(struct soap*, void*, char*, size_t); + int (*fdimewrite)(struct soap*, void*, const char*, size_t); + void *(*fmimereadopen)(struct soap*, void*, const char*, const char*, const char*); + void *(*fmimewriteopen)(struct soap*, void*, const char*, const char*, const char*, enum soap_mime_encoding); + void (*fmimereadclose)(struct soap*, void*); + void (*fmimewriteclose)(struct soap*, void*); + size_t (*fmimeread)(struct soap*, void*, char*, size_t); + int (*fmimewrite)(struct soap*, void*, const char*, size_t); +#endif + SOAP_SOCKET master; /* socket bound to TCP/IP port */ + SOAP_SOCKET socket; /* socket to send and receive */ + SOAP_SOCKET sendsk; /* socket to send (overrides ::socket) */ + SOAP_SOCKET recvsk; /* socket to receive (overrides ::socket) */ +#if defined(__cplusplus) && !defined(WITH_COMPAT) + std::ostream *os; /* C++ only: ostream to send */ + std::istream *is; /* C++ only: istream to receive */ +#else + const char **os; /* C only: pointer to a const char*, will be set to point to the string output */ + const char *is; /* C only: a const char* to read from (soap->is will advance) */ +#endif +#ifndef UNDER_CE + int sendfd; /* int file descriptor for sending */ + int recvfd; /* int file descriptor for receiving */ +#else + FILE *sendfd; /* WinCE FILE* to send */ + FILE *recvfd; /* WinCE FILE* to receive */ +#endif +#if defined(WITH_OPENSSL) /* OpenSSL */ + int (*fsslauth)(struct soap*); + int (*fsslverify)(int, X509_STORE_CTX*); + BIO *bio; + SSL *ssl; + SSL_CTX *ctx; + SSL_SESSION *session; + const char *dhfile; + const char *randfile; +#elif defined(WITH_GNUTLS) /* GNUTLS */ + int (*fsslauth)(struct soap*); + void *fsslverify; + gnutls_certificate_credentials_t xcred; /* cert pointer */ + gnutls_anon_client_credentials_t acred; /* anon pointer */ + gnutls_priority_t cache; /* priority cache pointer */ + gnutls_session_t session; /* session pointer */ + gnutls_dh_params_t dh_params; + gnutls_rsa_params_t rsa_params; +#elif defined(WITH_WOLFSSL) /* WolfSSL */ + int (*fsslauth)(struct soap*); + VerifyCallback fsslverify; /* callback to verify certificates */ + void *bio; /* N/A */ + WOLFSSL *ssl; /* ssl socket */ + WOLFSSL_CTX *ctx; /* environment */ + void *session; /* N/A */ + const char *dhfile; /* N/A */ + const char *randfile; /* N/A */ +#elif defined(WITH_SYSTEMSSL) /* SYSTEM SSL */ + int (*fsslauth)(struct soap*); + void *fsslverify; /* N/A */ + void *bio; /* N/A */ + gsk_handle ssl; /* ssl socket */ + gsk_handle ctx; /* environment */ + void *session; /* N/A */ + const char *dhfile; /* N/A */ + const char *randfile; /* N/A */ +#else /* No SSL/TLS */ + void *fsslauth; /* dummy members, to preserve struct size */ + void *fsslverify; + void *bio; + void *ssl; + void *ctx; + void *session; + void *dh_params; + void *rsa_params; +#endif + unsigned short ssl_flags; + const char *keyfile; + const char *keyid; + const char *password; + const char *cafile; + const char *capath; + const char *crlfile; + char session_host[SOAP_TAGLEN]; + int session_port; + size_t bufidx; /* index in soap.buf[] */ + size_t buflen; /* length of soap.buf[] content */ + soap_wchar ahead; /* parser lookahead */ + short cdata; /* CDATA parser state */ + short body; /* HTTP or XML element has a body (1) or not (0) */ + unsigned int level; /* XML nesting level */ +#ifndef WITH_LEAN + ULONG64 start; /* start time of send/recv (value cast to time_t) */ +#endif + ULONG64 count; /* message length counter */ + ULONG64 length; /* message length as was set by HTTP header received */ + char *labbuf; /* look-aside buffer */ + size_t lablen; /* look-aside buffer allocated length */ + size_t labidx; /* look-aside buffer index to available part */ + char buf[SOAP_BUFLEN];/* send and receive buffer */ + char msgbuf[SOAP_TMPLEN]; /* in/out buffer for HTTP/MIME headers and short messages, must be >=1024 bytes */ + char tmpbuf[SOAP_TMPLEN]; /* in/out buffer for HTTP/MIME headers, simpleType values, element and attribute tag names, and DIME must be >=1024 bytes */ + char tag[SOAP_TAGLEN]; + char id[SOAP_TAGLEN]; + char href[SOAP_TAGLEN]; + char type[SOAP_TAGLEN]; + char arrayType[SOAP_TAGLEN]; + char arraySize[SOAP_TAGLEN]; + char arrayOffset[SOAP_TAGLEN]; + int position; + int positions[SOAP_MAXDIMS]; + struct soap_attribute *attributes; /* attribute list */ + short other; + short root; + short encoding; /* when set, output encodingStyle */ + short mustUnderstand; /* a mustUnderstand element was parsed or is output */ + short null; /* parsed XML is xsi:nil */ + short ns; /* zero to output all xmlns */ + short part; /* SOAP part state (header or body) */ + short event; /* engine events and states for use by plugins */ + short peeked; + unsigned int evlev; /* event level */ + int alloced; + size_t chunksize; + size_t chunkbuflen; + char endpoint[SOAP_TAGLEN]; + char path[SOAP_TAGLEN]; + char host[SOAP_TAGLEN]; + char *action; /* SOAPAction string */ + const char *prolog; /* XML declaration prolog */ + unsigned int ip; /* IP number retrieved from request */ + unsigned int ip6[4]; /* same for IPv6: upper in ip6[0] to lower in ip6[3] requires WITH_IPV6 */ + int port; /* port number */ + const char *override_host; /* to override the client-side host name/IP when connecting */ + int override_port; /* to override client-side port number when connecting */ + int keep_alive; /* connection should be kept open (-1, 0, or counts down) */ + int tcp_keep_alive; /* enable SO_KEEPALIVE */ + unsigned int tcp_keep_idle; /* set TCP_KEEPIDLE */ + unsigned int tcp_keep_intvl; /* set TCP_KEEPINTVL */ + unsigned int tcp_keep_cnt; /* set TCP_KEEPCNT */ + int max_keep_alive; /* maximum keep-alive session (default=100) 0 to always keep open */ + const char *proxy_http_version;/* HTTP version of proxy "1.0" or "1.1" */ + const char *proxy_host; /* Proxy Server host name */ + int proxy_port; /* Proxy Server port (default = 8080) */ + const char *proxy_userid; /* Proxy Authorization user name */ + const char *proxy_passwd; /* Proxy Authorization password */ + const char *proxy_from; /* X-Forwarding-For header returned by proxy */ + const char *origin; /* Origin header received */ + const char *cors_origin; /* CORS Allow-Origin header returned by server */ + const char *cors_allow; /* CORS Allow-Origin header default value of "*" */ + const char *cors_method; /* CORS Request-Method header received */ + const char *cors_header; /* CORS Request-Headers header received */ + const char *cors_methods; /* CORS Allow-Methods header returned by server */ + const char *cors_headers; /* CORS Allow-Headers header returned by server */ + const char *x_frame_options; /* "DENY", "SAMEORIGIN" (default), or "ALLOW-FROM uri" */ + int status; /* HTTP status code, HTTP method, or other error code */ + int error; + int errmode; + int errnum; +#ifndef WITH_LEANER + struct soap_dom_element *dom; + struct soap_dime dime; + struct soap_mime mime; + struct soap_xlist *xlist; +#endif + const char *logfile[SOAP_MAXLOGS]; + FILE *fdebug[SOAP_MAXLOGS]; + struct soap_mlist *mht[SOAP_PTRHASH]; +#ifndef WITH_LEAN + const char *wsuid; /* space-separated string of element tags */ + const char *c14nexclude; /* space-separated string of prefixes for c14n exclusion */ + const char *c14ninclude; /* space-separated string of prefixes for c14n inclusion */ +#endif + struct soap_cookie *cookies; + const char *cookie_domain; + const char *cookie_path; + int cookie_max; +#ifndef WITH_NOIO + unsigned int ipv6_multicast_if; /* in_addr_t in6addr->sin6_scope_id IPv6 value */ + char* ipv4_multicast_if; /* IP_MULTICAST_IF IPv4 setsockopt interface_addr */ + unsigned char ipv4_multicast_ttl; /* IP_MULTICAST_TTL value 0..255 */ + const char *client_addr; /* when non-NULL, client binds to this address before connect */ + const char *client_addr_ipv6; /* WITH_IPV6: when non-NULL and client_addr is non-NULL and when connecting to a IPv6 server, client binds to this IPv6 address instead of client_addr */ + int client_port; /* when nonnegative, client binds to this port before connect */ + const char *client_interface; /* when non-NULL, override client-side interface address using this address */ + union { + struct sockaddr addr; + struct sockaddr_in in; + struct sockaddr_storage storage; + } peer; /* set by soap_connect/soap_accept and by UDP recv */ + size_t peerlen; +#endif +#ifdef SOAP_LOCALE_T + SOAP_LOCALE_T c_locale; /* if this does not compile, use ./configure --enable-xlocale or compile with -DWITH_INCLUDE_XLOCALE_H, or use -DWITH_NO_C_LOCALE to disable locale support */ +#else + void *c_locale; +#endif +#ifdef WITH_ZLIB + z_stream *d_stream; /* decompression stream */ + uLong z_crc; /* internal gzip crc */ +#else + void *d_stream; /* dummy members, to preserve struct size */ + soap_int32 z_crc; +#endif + const char *z_dict; /* support for zlib static dictionaries */ + unsigned int z_dict_len; + short zlib_state; /* SOAP_ZLIB_NONE, SOAP_ZLIB_DEFLATE, or SOAP_ZLIB_INFLATE */ + short zlib_in; /* SOAP_ZLIB_NONE, SOAP_ZLIB_DEFLATE, or SOAP_ZLIB_GZIP */ + short zlib_out; /* SOAP_ZLIB_NONE, SOAP_ZLIB_DEFLATE, or SOAP_ZLIB_GZIP */ + char *z_buf; /* buffer */ + size_t z_buflen; + unsigned short z_level; /* compression level to be used (0=none, 1=fast to 9=best) */ + float z_ratio_in; /* detected compression ratio compressed_length/length of inbound message */ + float z_ratio_out; /* detected compression ratio compressed_length/length of outbound message */ +#ifdef WMW_RPM_IO /* vxWorks compatibility */ + void *rpmreqid; +#endif +#ifdef __cplusplus + soap(); + soap(soap_mode); + soap(soap_mode, soap_mode); + soap(const struct soap&); + struct soap& operator=(const struct soap&); + void destroy(); + ~soap(); /* no virtual methods, so sizeof(soap) should be the same in C and C++ */ +#endif +}; + +struct soap_code_map +{ + LONG64 code; + const char *string; +}; + +/* forwarding list */ +struct soap_flist +{ + struct soap_flist *next; + int type; + void *ptr; + unsigned int level; + size_t index; + void (*finsert)(struct soap*, int, int, void*, size_t, const void*, void**); +}; + +/* id-ref forwarding list */ +struct soap_ilist +{ + struct soap_ilist *next; + int type; + size_t size; + void *ptr; + void **spine; + void *link; + void *copy; + struct soap_flist *flist; + void *smart; + short shaky; + char id[1]; /* the actual id string value flows into the allocated region below this struct */ +}; + +struct soap_plugin +{ + struct soap_plugin *next; + const char *id; + void *data; + int (*fcopy)(struct soap *soap, struct soap_plugin *dst, struct soap_plugin *src); + void (*fdelete)(struct soap *soap, struct soap_plugin *p); /* should delete fields of plugin only and not free(p) */ +}; + +extern SOAP_NMAC struct Namespace namespaces[]; + +#ifndef WITH_LEAN +# define soap_get0(soap) (((soap)->bufidx>=(soap)->buflen && soap_recv((soap))) ? EOF : (unsigned char)(soap)->buf[(soap)->bufidx]) +# define soap_get1(soap) (((soap)->bufidx>=(soap)->buflen && soap_recv((soap))) ? EOF : (unsigned char)(soap)->buf[(soap)->bufidx++]) +# define soap_getchar(soap) ((soap)->ahead ? soap_getahead((soap)) : soap_get1((soap))) +SOAP_FMAC1 soap_wchar SOAP_FMAC2 soap_getahead(struct soap*); +#else +SOAP_FMAC1 soap_wchar SOAP_FMAC2 soap_get0(struct soap*); +SOAP_FMAC1 soap_wchar SOAP_FMAC2 soap_get1(struct soap*); +SOAP_FMAC1 soap_wchar SOAP_FMAC2 soap_getchar(struct soap*); +#endif + +#define soap_versioning_paste(name, ext) name##_REQUIRE_lib_v##ext +#define soap_versioning_ext(name, ext) soap_versioning_paste(name, ext) +#define soap_versioning(name) soap_versioning_ext(name, GSOAP_VERSION) + +#define soap_init(soap) soap_init1(soap, SOAP_IO_DEFAULT) +#define soap_init1(soap, mode) soap_init2(soap, mode, mode) +#define soap_init2(soap, imode, omode) soap_versioning(soap_init)(soap, imode, omode) + +#define soap_new() soap_new1(SOAP_IO_DEFAULT) +#define soap_new1(mode) soap_new2(mode, mode) +#define soap_new2(imode, omode) soap_versioning(soap_new)(imode, omode) + +#define soap_revget1(soap) ((soap)->bufidx--) +#define soap_unget(soap, c) ((soap)->ahead = c) +#define soap_peek(soap) ((soap)->ahead = soap_get(soap)) +#define soap_register_plugin(soap, plugin) soap_register_plugin_arg(soap, plugin, NULL) +#define soap_mode(soap, n) ((soap)->mode = (soap)->imode = (soap)->omode = (n)) +#define soap_imode(soap, n) ((soap)->imode = (n)) +#define soap_omode(soap, n) ((soap)->omode = (n)) +#define soap_set_imode(soap, n) ((soap)->imode |= (n)) +#define soap_clr_imode(soap, n) ((soap)->imode &= ~(n)) +#define soap_set_omode(soap, n) ((soap)->omode |= (n)) +#define soap_clr_omode(soap, n) ((soap)->omode &= ~(n)) +#define soap_set_mode(soap, n) ((soap)->mode |= (n), (soap)->imode |= (n), (soap)->omode |= (n)) +#define soap_clr_mode(soap, n) ((soap)->mode &= ~(n), (soap)->imode &= ~(n), (soap)->omode &= ~(n)) +#define soap_destroy(soap) soap_delete((soap), NULL) + +#define SOAP_NO_LINK_TO_DELETE (-2) /* pass to soap_link() as size n: do not manage, smart pointers are self-managing */ + +#ifdef HAVE_STRRCHR +# define soap_strrchr(s, t) strrchr(s, t) +#else + SOAP_FMAC1 char* SOAP_FMAC2 soap_strrchr(const char *s, int t); +#endif + +#ifdef HAVE_STRTOL +# define soap_strtol(s, t, b) strtol(s, t, b) +#else + SOAP_FMAC1 long SOAP_FMAC2 soap_strtol(const char*, char**, int); +#endif + +#ifdef HAVE_STRTOUL +# define soap_strtoul(s, t, b) strtoul(s, t, b) +#else + SOAP_FMAC1 unsigned long SOAP_FMAC2 soap_strtoul(const char*, char**, int); +#endif + +#if defined(WIN32) && !defined(__MINGW32__) && !defined(__MINGW64__) && !defined(__BORLANDC__) +# define soap_strtoll _strtoi64 +#elif defined(HAVE_STRTOLL) && !defined(soap_strtoll) +# define soap_strtoll strtoll +#elif !defined(soap_strtoll) + SOAP_FMAC1 LONG64 SOAP_FMAC2 soap_strtoll(const char*, char**, int); +#endif + +#if defined(WIN32) && !defined(__MINGW32__) && !defined(__MINGW64__) && !defined(__BORLANDC__) +# define soap_strtoull _strtoui64 +#elif defined(HAVE_STRTOULL) && !defined(soap_strtoull) +# define soap_strtoull strtoull +#elif !defined(soap_strtoull) + SOAP_FMAC1 ULONG64 SOAP_FMAC2 soap_strtoull(const char*, char**, int); +#endif + +#if defined(WITH_OPENSSL) +# define soap_random soap_rand() + SOAP_FMAC1 int SOAP_FMAC2 soap_rand(void); +#elif defined(UNDER_CE) +# define soap_random (int)Random() +#elif defined(HAVE_RANDOM) +# define soap_random (int)random() +#else +# define soap_random rand() +#endif + +#ifdef WITH_NOIDREF +# define soap_embedded(s, p, t) ((void)(s), 0) +# define soap_id_lookup(s, i, p, t, n, k, fb) ((void)(s), (p)) +# define soap_id_forward(s, h, p, i, t, tt, n, k, fi, fb) ((void)(s), (p)) +# define soap_id_nullify(s, i) ((void)(s), (i)) +# define soap_reference(s, a, t) ((void)(s), 1) +# define soap_array_reference(s, p, a, n, t) ((void)(s), 1) +# define soap_attachment_reference(s, p, a, n, t, i, y) ((void)(s), 1) +# define soap_embed(s, p, a, n, t) ((void)(s), 0) +# define soap_embedded_id(s, i, p, t) ((void)(s), (void)(t), i) +# define soap_is_embedded(s, p) ((void)(s), 0) +# define soap_is_single(s, p) ((void)(s), 1) +# define soap_lookup_type(s, i) ((void)(s), 0) +# define soap_getindependent(s) ((void)(s), 0) +# define soap_putindependent(s) ((void)(s), 0) +# define soap_markelement(s, p, t) ((void)(s), 0) +# define soap_begin_shaky(s) ((void)(s), 0) +# define soap_end_shaky(s, f) ((void)(s), (void)(f), 0) +#endif + +/* soap_traverse() traversal/walker routines take walker function arguments */ +typedef void soap_walker(struct soap*, void*, int, const char*, const char*); + +SOAP_FMAC5 int SOAP_FMAC6 soap_serve(struct soap *soap); +SOAP_FMAC5 int SOAP_FMAC6 soap_serve_request(struct soap *soap); + +SOAP_FMAC1 void SOAP_FMAC2 soap_ssl_init(void); +SOAP_FMAC1 void SOAP_FMAC2 soap_ssl_noinit(void); +SOAP_FMAC1 int SOAP_FMAC2 soap_GET(struct soap*, const char*, const char*); +SOAP_FMAC1 int SOAP_FMAC2 soap_PUT(struct soap*, const char*, const char*, const char*); +SOAP_FMAC1 int SOAP_FMAC2 soap_PATCH(struct soap*, const char*, const char*, const char*); +SOAP_FMAC1 int SOAP_FMAC2 soap_POST(struct soap*, const char*, const char*, const char*); +SOAP_FMAC1 int SOAP_FMAC2 soap_DELETE(struct soap*, const char*); +SOAP_FMAC1 int SOAP_FMAC2 soap_connect_command(struct soap*, int, const char*, const char*); +SOAP_FMAC1 int SOAP_FMAC2 soap_connect(struct soap*, const char*, const char*); +SOAP_FMAC1 SOAP_SOCKET SOAP_FMAC2 soap_bind(struct soap*, const char*, int, int); +SOAP_FMAC1 SOAP_SOCKET SOAP_FMAC2 soap_accept(struct soap*); +SOAP_FMAC1 int SOAP_FMAC2 soap_ssl_accept(struct soap*); +SOAP_FMAC1 const char * SOAP_FMAC2 soap_ssl_error(struct soap*, int ret, int err); +SOAP_FMAC1 int SOAP_FMAC2 soap_ssl_crl(struct soap*, const char*); +SOAP_FMAC1 int SOAP_FMAC2 soap_poll(struct soap*); +SOAP_FMAC1 int SOAP_FMAC2 soap_ready(struct soap*); + +#if defined(VXWORKS) && defined(WM_SECURE_KEY_STORAGE) +SOAP_FMAC1 int SOAP_FMAC2 soap_ssl_server_context(struct soap *soap, unsigned short flags, const char *keyfile, const char *keyid, const char *password, const char *cafile, const char *capath, const char *dhfile, const char *randfile, const char *sid); +#else +SOAP_FMAC1 int SOAP_FMAC2 soap_ssl_server_context(struct soap *soap, unsigned short flags, const char *keyfile, const char *password, const char *cafile, const char *capath, const char *dhfile, const char *randfile, const char *sid); +#endif +#if defined(VXWORKS) && defined(WM_SECURE_KEY_STORAGE) +SOAP_FMAC1 int SOAP_FMAC2 soap_ssl_client_context(struct soap *soap, unsigned short flags, const char *keyfile, const char *keyid, const char *password, const char *cafile, const char *capath, const char *randfile); +#else +SOAP_FMAC1 int SOAP_FMAC2 soap_ssl_client_context(struct soap *soap, unsigned short flags, const char *keyfile, const char *password, const char *cafile, const char *capath, const char *randfile); +#endif + +SOAP_FMAC1 const char * SOAP_FMAC2 soap_http_content_type(struct soap *soap, int status); +SOAP_FMAC1 int SOAP_FMAC2 soap_puthttphdr(struct soap*, int status, ULONG64 count); + +SOAP_FMAC1 const char* SOAP_FMAC2 soap_http_header_attribute(struct soap*, const char*, const char*); +SOAP_FMAC1 const char* SOAP_FMAC2 soap_decode_key(char*, size_t, const char*); +SOAP_FMAC1 const char* SOAP_FMAC2 soap_decode_val(char*, size_t, const char*); + +SOAP_FMAC1 size_t SOAP_FMAC2 soap_hash(const char*); +SOAP_FMAC1 void SOAP_FMAC2 soap_set_endpoint(struct soap*, const char*); +SOAP_FMAC1 int SOAP_FMAC2 soap_flush_raw(struct soap*, const char*, size_t); +SOAP_FMAC1 int SOAP_FMAC2 soap_flush(struct soap*); +SOAP_FMAC1 soap_wchar SOAP_FMAC2 soap_get(struct soap*); +SOAP_FMAC1 int SOAP_FMAC2 soap_tag_cmp(const char*, const char*); +SOAP_FMAC1 void SOAP_FMAC2 soap_set_fault(struct soap*); +SOAP_FMAC1 int SOAP_FMAC2 soap_sender_fault(struct soap*, const char*, const char*); +SOAP_FMAC1 int SOAP_FMAC2 soap_sender_fault_subcode(struct soap*, const char*, const char*, const char*); +SOAP_FMAC1 int SOAP_FMAC2 soap_receiver_fault(struct soap*, const char*, const char*); +SOAP_FMAC1 int SOAP_FMAC2 soap_receiver_fault_subcode(struct soap*, const char*, const char*, const char*); +SOAP_FMAC1 int SOAP_FMAC2 soap_set_sender_error(struct soap*, const char*, const char*, int); +SOAP_FMAC1 int SOAP_FMAC2 soap_set_receiver_error(struct soap*, const char*, const char*, int); + +SOAP_FMAC1 int SOAP_FMAC2 soap_send_raw(struct soap*, const char*, size_t); +SOAP_FMAC1 int SOAP_FMAC2 soap_recv_raw(struct soap*); +SOAP_FMAC1 int SOAP_FMAC2 soap_recv(struct soap*); +SOAP_FMAC1 int SOAP_FMAC2 soap_send(struct soap*, const char*); + +#ifndef WITH_LEANER +SOAP_FMAC1 int SOAP_FMAC2 soap_send2(struct soap*, const char*, const char*); +SOAP_FMAC1 int SOAP_FMAC2 soap_send3(struct soap*, const char*, const char*, const char*); +SOAP_FMAC1 int SOAP_FMAC2 soap_query_send_key(struct soap*, const char*); +SOAP_FMAC1 int SOAP_FMAC2 soap_query_send_val(struct soap*, const char*); +SOAP_FMAC1 char * SOAP_FMAC2 soap_query(struct soap*); +SOAP_FMAC1 char * SOAP_FMAC2 soap_query_key(struct soap*, char**); +SOAP_FMAC1 char * SOAP_FMAC2 soap_query_val(struct soap*, char**); +SOAP_FMAC1 const char * SOAP_FMAC2 soap_query_decode(char*, size_t, const char*); +#endif + +SOAP_FMAC1 int SOAP_FMAC2 soap_pututf8(struct soap*, unsigned long); +SOAP_FMAC1 soap_wchar SOAP_FMAC2 soap_getutf8(struct soap*); +SOAP_FMAC1 size_t SOAP_FMAC2 soap_utf8len(const char*); + +SOAP_FMAC1 int SOAP_FMAC2 soap_putbase64(struct soap*, const unsigned char*, int); +SOAP_FMAC1 unsigned char* SOAP_FMAC2 soap_getbase64(struct soap*, int*, int); +SOAP_FMAC1 int SOAP_FMAC2 soap_puthex(struct soap*, const unsigned char*, int); +SOAP_FMAC1 unsigned char* SOAP_FMAC2 soap_gethex(struct soap*, int*); + +#ifndef WITH_LEANER +SOAP_FMAC1 int SOAP_FMAC2 soap_xop_forward(struct soap*, unsigned char**, int*, char**, char**, char**); +SOAP_FMAC1 int SOAP_FMAC2 soap_attachment_forward(struct soap*, unsigned char**, int*, char**, char**, char**); +#endif + +SOAP_FMAC1 int SOAP_FMAC2 soap_pointer_lookup(struct soap*, const void *p, int t, struct soap_plist**); +SOAP_FMAC1 int SOAP_FMAC2 soap_pointer_enter(struct soap*, const void *p, const void *a, int n, int t, struct soap_plist**); +SOAP_FMAC1 int SOAP_FMAC2 soap_array_pointer_lookup(struct soap*, const void *p, const void *a, int n, int t, struct soap_plist**); +#ifndef WITH_NOIDREF +SOAP_FMAC1 int SOAP_FMAC2 soap_pointer_lookup_id(struct soap*, void *p, int t, struct soap_plist**); +SOAP_FMAC1 int SOAP_FMAC2 soap_embed(struct soap *soap, const void *p, const void *a, int n, int t); +SOAP_FMAC1 struct soap_ilist* SOAP_FMAC2 soap_lookup(struct soap*, const char*); +SOAP_FMAC1 struct soap_ilist* SOAP_FMAC2 soap_enter(struct soap*, const char*, int t, size_t n); +SOAP_FMAC1 int SOAP_FMAC2 soap_resolve(struct soap*); +SOAP_FMAC1 void SOAP_FMAC2 soap_embedded(struct soap*, const void *p, int t); +SOAP_FMAC1 int SOAP_FMAC2 soap_reference(struct soap*, const void *p, int t); +SOAP_FMAC1 int SOAP_FMAC2 soap_array_reference(struct soap*, const void *p, const void *a, int n, int t); +SOAP_FMAC1 int SOAP_FMAC2 soap_attachment_reference(struct soap *soap, const void *p, const void *a, int n, int t, const char *id, const char *type); +SOAP_FMAC1 int SOAP_FMAC2 soap_embedded_id(struct soap*, int id, const void *p, int t); +SOAP_FMAC1 int SOAP_FMAC2 soap_is_embedded(struct soap*, struct soap_plist*); +SOAP_FMAC1 int SOAP_FMAC2 soap_is_single(struct soap*, struct soap_plist*); +SOAP_FMAC1 void SOAP_FMAC2 soap_set_embedded(struct soap*, struct soap_plist*); +#endif +SOAP_FMAC1 int SOAP_FMAC2 soap_check_and_mark(struct soap *soap, const void *p, int t, char **mark); +SOAP_FMAC1 void * SOAP_FMAC2 soap_mark_lookup(struct soap *soap, const void *p, int t, struct soap_plist **pp, char **mark); +SOAP_FMAC1 int SOAP_FMAC2 soap_mark_cycle(struct soap *soap, struct soap_plist *pp); +SOAP_FMAC1 void SOAP_FMAC2 soap_mark_dup(struct soap *soap, void *a, struct soap_plist *pp); +SOAP_FMAC1 void SOAP_FMAC2 soap_unmark(struct soap *soap, char *mark); + +SOAP_FMAC1 int SOAP_FMAC2 soap_begin_count(struct soap*); +SOAP_FMAC1 int SOAP_FMAC2 soap_end_count(struct soap*); +SOAP_FMAC1 int SOAP_FMAC2 soap_begin_send(struct soap*); +SOAP_FMAC1 int SOAP_FMAC2 soap_end_send(struct soap*); +SOAP_FMAC1 int SOAP_FMAC2 soap_end_send_flush(struct soap*); + +SOAP_FMAC1 const struct soap_code_map* SOAP_FMAC2 soap_code(const struct soap_code_map*, const char*); +SOAP_FMAC1 LONG64 SOAP_FMAC2 soap_code_int(const struct soap_code_map*, const char*, LONG64); +SOAP_FMAC1 const char* SOAP_FMAC2 soap_code_str(const struct soap_code_map*, long); +SOAP_FMAC1 LONG64 SOAP_FMAC2 soap_code_bits(const struct soap_code_map*, const char*); +SOAP_FMAC1 const char* SOAP_FMAC2 soap_code_list(struct soap*, const struct soap_code_map*, long); + +SOAP_FMAC1 int SOAP_FMAC2 soap_binary_search_string(const char**, int, const char*); + +SOAP_FMAC1 int SOAP_FMAC2 soap_getline(struct soap*, char*, int); +SOAP_FMAC1 int SOAP_FMAC2 soap_begin_serve(struct soap*); +SOAP_FMAC1 int SOAP_FMAC2 soap_begin_recv(struct soap*); +SOAP_FMAC1 int SOAP_FMAC2 soap_end_recv(struct soap*); + +SOAP_FMAC1 void* SOAP_FMAC2 soap_malloc(struct soap*, size_t); +SOAP_FMAC1 void SOAP_FMAC2 soap_dealloc(struct soap*, void*); +SOAP_FMAC1 struct soap_clist * SOAP_FMAC2 soap_link(struct soap*, int, int, int (*fdelete)(struct soap*, struct soap_clist*)); +SOAP_FMAC1 int SOAP_FMAC2 soap_unlink(struct soap*, const void*); +SOAP_FMAC1 void SOAP_FMAC2 soap_free_temp(struct soap*); +SOAP_FMAC1 void SOAP_FMAC2 soap_del(struct soap*); + +SOAP_FMAC1 void* SOAP_FMAC2 soap_track_malloc(struct soap*, const char*, int, size_t); +SOAP_FMAC1 void SOAP_FMAC2 soap_track_free(struct soap*, const char*, int, void*); + +#ifndef WITH_NOIDREF +SOAP_FMAC1 int SOAP_FMAC2 soap_lookup_type(struct soap*, const char *id); +SOAP_FMAC1 short SOAP_FMAC2 soap_begin_shaky(struct soap*); +SOAP_FMAC1 void SOAP_FMAC2 soap_end_shaky(struct soap*, short); +SOAP_FMAC1 void* SOAP_FMAC2 soap_id_lookup(struct soap*, const char *id, void **p, int t, size_t n, unsigned int k, int (*fbase)(int, int)); +SOAP_FMAC1 void* SOAP_FMAC2 soap_id_forward(struct soap*, const char *id, void *p, size_t i, int t, int tt, size_t n, unsigned int k, void(*finsert)(struct soap*, int, int, void*, size_t, const void*, void**), int (*fbase)(int, int)); +SOAP_FMAC1 int SOAP_FMAC2 soap_id_nullify(struct soap*, const char*); +#endif +SOAP_FMAC1 void* SOAP_FMAC2 soap_id_enter(struct soap*, const char *id, void *p, int t, size_t n, const char *type, const char *arrayType, void *(*finstantiate)(struct soap*, int, const char*, const char*, size_t*), int (*fbase)(int, int)); +SOAP_FMAC1 void** SOAP_FMAC2 soap_id_smart(struct soap *soap, const char*, int t, size_t n); + +SOAP_FMAC1 size_t SOAP_FMAC2 soap_size(const int *, int); +SOAP_FMAC1 size_t SOAP_FMAC2 soap_getsizes(const char *, int *, int); +SOAP_FMAC1 int SOAP_FMAC2 soap_getoffsets(const char *, const int *, int *, int); + +SOAP_FMAC1 int SOAP_FMAC2 soap_getposition(const char *, int *); + +SOAP_FMAC1 char* SOAP_FMAC2 soap_putsizesoffsets(struct soap*, const char *, const int *, const int *, int); +SOAP_FMAC1 char* SOAP_FMAC2 soap_putoffsets(struct soap*, const int *, int); + +SOAP_FMAC1 int SOAP_FMAC2 soap_closesock(struct soap*); +SOAP_FMAC1 int SOAP_FMAC2 soap_force_closesock(struct soap*); + +SOAP_FMAC1 struct soap *SOAP_FMAC2 soap_versioning(soap_new)(soap_mode, soap_mode); +SOAP_FMAC1 void SOAP_FMAC2 soap_free(struct soap*); +SOAP_FMAC1 struct soap *SOAP_FMAC2 soap_copy(const struct soap*); +SOAP_FMAC1 struct soap *SOAP_FMAC2 soap_copy_context(struct soap*, const struct soap*); +SOAP_FMAC1 void SOAP_FMAC2 soap_copy_stream(struct soap*, struct soap*); +SOAP_FMAC1 void SOAP_FMAC2 soap_free_stream(struct soap*); +SOAP_FMAC1 void SOAP_FMAC2 soap_versioning(soap_init)(struct soap*, soap_mode, soap_mode); +SOAP_FMAC1 void SOAP_FMAC2 soap_initialize(struct soap*); +SOAP_FMAC1 void SOAP_FMAC2 soap_done(struct soap*); +SOAP_FMAC1 void SOAP_FMAC2 soap_cleanup(struct soap*); +SOAP_FMAC1 void SOAP_FMAC2 soap_begin(struct soap*); +SOAP_FMAC1 void SOAP_FMAC2 soap_end(struct soap*); +SOAP_FMAC1 void SOAP_FMAC2 soap_delete(struct soap*, void*); +SOAP_FMAC1 void SOAP_FMAC2 soap_delegate_deletion(struct soap*, struct soap*); +#ifdef WITH_SELF_PIPE +SOAP_FMAC1 void SOAP_FMAC2 soap_close_connection(struct soap*); +#endif + +/* API functions available with DEBUG or SOAP_DEBUG defined: */ +SOAP_FMAC1 void SOAP_FMAC2 soap_set_recv_logfile(struct soap*, const char*); +SOAP_FMAC1 void SOAP_FMAC2 soap_set_sent_logfile(struct soap*, const char*); +SOAP_FMAC1 void SOAP_FMAC2 soap_set_test_logfile(struct soap*, const char*); +SOAP_FMAC1 void SOAP_FMAC2 soap_close_logfiles(struct soap*); +SOAP_FMAC1 void SOAP_FMAC2 soap_open_logfile(struct soap*, int); +/* */ + +SOAP_FMAC1 const char* SOAP_FMAC2 soap_value(struct soap*); + +SOAP_FMAC1 int SOAP_FMAC2 soap_match_tag(struct soap*, const char*, const char *); +SOAP_FMAC1 int SOAP_FMAC2 soap_match_att(struct soap*, const char*, const char *); +SOAP_FMAC1 int SOAP_FMAC2 soap_match_array(struct soap*, const char*); + +SOAP_FMAC1 int SOAP_FMAC2 soap_element(struct soap*, const char*, int, const char*); +SOAP_FMAC1 int SOAP_FMAC2 soap_element_start_end_out(struct soap*, const char *tag); +SOAP_FMAC1 int SOAP_FMAC2 soap_element_begin_out(struct soap*, const char *tag, int id, const char *type); +SOAP_FMAC1 int SOAP_FMAC2 soap_array_begin_out(struct soap*, const char *tag, int id, const char *type, const char *offset); +SOAP_FMAC1 int SOAP_FMAC2 soap_element_ref(struct soap*, const char *tag, int id, int href); +SOAP_FMAC1 int SOAP_FMAC2 soap_element_href(struct soap*, const char *tag, int id, const char *ref, const char *val); +SOAP_FMAC1 int SOAP_FMAC2 soap_element_null(struct soap*, const char *tag, int id, const char *type); +SOAP_FMAC1 int SOAP_FMAC2 soap_element_empty(struct soap*, const char *tag, int id, const char *type); +SOAP_FMAC1 int SOAP_FMAC2 soap_element_nil(struct soap*, const char *tag); +SOAP_FMAC1 int SOAP_FMAC2 soap_element_id(struct soap*, const char *tag, int id, const void *p, const void *a, int n, const char *type, int t, char **mark); +SOAP_FMAC1 int SOAP_FMAC2 soap_element_result(struct soap*, const char *tag); +SOAP_FMAC1 void SOAP_FMAC2 soap_check_result(struct soap*, const char *tag); +SOAP_FMAC1 int SOAP_FMAC2 soap_element_end_out(struct soap*, const char *tag); +SOAP_FMAC1 int SOAP_FMAC2 soap_element_end(struct soap*, const char *tag); + +SOAP_FMAC1 int SOAP_FMAC2 soap_attribute(struct soap*, const char*, const char*); + +SOAP_FMAC1 int SOAP_FMAC2 soap_element_begin_in(struct soap*, const char *tag, int nillable, const char *type); + +SOAP_FMAC1 int SOAP_FMAC2 soap_element_end_in(struct soap*, const char *tag); + +SOAP_FMAC1 int SOAP_FMAC2 soap_peek_element(struct soap*); + +SOAP_FMAC1 void SOAP_FMAC2 soap_retry(struct soap*); +SOAP_FMAC1 void SOAP_FMAC2 soap_revert(struct soap*); +SOAP_FMAC1 int SOAP_FMAC2 soap_ignore(struct soap*); + +SOAP_FMAC1 void* SOAP_FMAC2 soap_memdup(struct soap*, const void*, size_t); +SOAP_FMAC1 char* SOAP_FMAC2 soap_strdup(struct soap*, const char*); +SOAP_FMAC1 wchar_t* SOAP_FMAC2 soap_wstrdup(struct soap*, const wchar_t*); +SOAP_FMAC1 char* SOAP_FMAC2 soap_strtrim(struct soap*, char*); +SOAP_FMAC1 wchar_t* SOAP_FMAC2 soap_wstrtrim(struct soap*, wchar_t*); +SOAP_FMAC1 const char * SOAP_FMAC2 soap_tagsearch(const char *big, const char *little); + +SOAP_FMAC1 int SOAP_FMAC2 soap_string_out(struct soap*, const char *s, int flag); +SOAP_FMAC1 char* SOAP_FMAC2 soap_string_in(struct soap*, int, long, long, const char*); + +#ifndef WITH_LEANER +SOAP_FMAC1 int SOAP_FMAC2 soap_wstring_out(struct soap*, const wchar_t *s, int flag); +SOAP_FMAC1 wchar_t* SOAP_FMAC2 soap_wstring_in(struct soap*, int, long, long, const char*); +#endif + +SOAP_FMAC1 int SOAP_FMAC2 soap_match_namespace(struct soap*, const char *, const char*, size_t n1, size_t n2); + +SOAP_FMAC1 void SOAP_FMAC2 soap_set_version(struct soap*, short); +SOAP_FMAC1 int SOAP_FMAC2 soap_set_namespaces(struct soap*, const struct Namespace*); +SOAP_FMAC1 void SOAP_FMAC2 soap_set_local_namespaces(struct soap*); + +SOAP_FMAC1 void SOAP_FMAC2 soap_pop_namespace(struct soap*); +SOAP_FMAC1 struct soap_nlist* SOAP_FMAC2 soap_push_namespace(struct soap*, const char *,const char *); +SOAP_FMAC1 const char* SOAP_FMAC2 soap_current_namespace_tag(struct soap *soap, const char *tag); +SOAP_FMAC1 const char* SOAP_FMAC2 soap_current_namespace_att(struct soap *soap, const char *tag); + +SOAP_FMAC1 struct soap_nlist* SOAP_FMAC2 soap_lookup_ns(struct soap *soap, const char *tag, size_t n); + +SOAP_FMAC1 int SOAP_FMAC2 soap_store_lab(struct soap*, const char*, size_t); +SOAP_FMAC1 int SOAP_FMAC2 soap_append_lab(struct soap*, const char*, size_t); + +SOAP_FMAC1 struct soap_blist* SOAP_FMAC2 soap_alloc_block(struct soap*); +SOAP_FMAC1 void* SOAP_FMAC2 soap_push_block(struct soap*, struct soap_blist*, size_t); +SOAP_FMAC1 void* SOAP_FMAC2 soap_push_block_max(struct soap*, struct soap_blist*, size_t); +SOAP_FMAC1 void SOAP_FMAC2 soap_pop_block(struct soap*, struct soap_blist*); +SOAP_FMAC1 size_t SOAP_FMAC2 soap_size_block(struct soap*, struct soap_blist*, size_t); +SOAP_FMAC1 char* SOAP_FMAC2 soap_first_block(struct soap*, struct soap_blist*); +SOAP_FMAC1 char* SOAP_FMAC2 soap_next_block(struct soap*, struct soap_blist*); +SOAP_FMAC1 size_t SOAP_FMAC2 soap_block_size(struct soap*, struct soap_blist*); +SOAP_FMAC1 void* SOAP_FMAC2 soap_save_block(struct soap*, struct soap_blist*, char*, int); +SOAP_FMAC1 void SOAP_FMAC2 soap_end_block(struct soap*, struct soap_blist*); +SOAP_FMAC1 void SOAP_FMAC2 soap_update_pointers(struct soap *soap, const char *dst, const char *src, size_t len); + +SOAP_FMAC1 int SOAP_FMAC2 soap_envelope_begin_out(struct soap*); +SOAP_FMAC1 int SOAP_FMAC2 soap_envelope_end_out(struct soap*); + +SOAP_FMAC1 int SOAP_FMAC2 soap_http_has_body(struct soap*); +SOAP_FMAC1 int SOAP_FMAC2 soap_http_skip_body(struct soap*); +SOAP_FMAC1 char * SOAP_FMAC2 soap_http_get_body(struct soap*, size_t *len); +SOAP_FMAC1 char * SOAP_FMAC2 soap_http_get_form(struct soap*); +SOAP_FMAC1 char * SOAP_FMAC2 soap_http_get_body_prefix(struct soap*, size_t *len, const char *prefix); + +SOAP_FMAC1 int SOAP_FMAC2 soap_envelope_begin_in(struct soap*); +SOAP_FMAC1 int SOAP_FMAC2 soap_envelope_end_in(struct soap*); + +SOAP_FMAC1 int SOAP_FMAC2 soap_body_begin_out(struct soap*); +SOAP_FMAC1 int SOAP_FMAC2 soap_body_end_out(struct soap*); + +SOAP_FMAC1 int SOAP_FMAC2 soap_body_begin_in(struct soap*); +SOAP_FMAC1 int SOAP_FMAC2 soap_body_end_in(struct soap*); + +SOAP_FMAC1 int SOAP_FMAC2 soap_recv_header(struct soap*); + +SOAP_FMAC1 int SOAP_FMAC2 soap_response(struct soap*, int); + +SOAP_FMAC1 int SOAP_FMAC2 soap_send_empty_response(struct soap*, int status); +SOAP_FMAC1 int SOAP_FMAC2 soap_recv_empty_response(struct soap*); + +SOAP_FMAC1 int SOAP_FMAC2 soap_send_fault(struct soap*); +SOAP_FMAC1 int SOAP_FMAC2 soap_recv_fault(struct soap*, int check); + +#ifndef WITH_NOSTDLIB +SOAP_FMAC1 void SOAP_FMAC2 soap_print_fault(struct soap*, FILE*); +SOAP_FMAC1 void SOAP_FMAC2 soap_print_fault_location(struct soap*, FILE*); +# ifndef WITH_LEAN +# ifndef WITH_COMPAT +# ifdef __cplusplus +SOAP_FMAC1 void SOAP_FMAC2 soap_stream_fault(struct soap*, std::ostream&); +SOAP_FMAC1 void SOAP_FMAC2 soap_stream_fault_location(struct soap*, std::ostream&); +# endif +# endif +SOAP_FMAC1 char* SOAP_FMAC2 soap_sprint_fault(struct soap*, char*, size_t); +# endif +#endif + +SOAP_FMAC1 int SOAP_FMAC2 soap_s2byte(struct soap*, const char*, char*); +SOAP_FMAC1 int SOAP_FMAC2 soap_s2short(struct soap*, const char*, short*); +SOAP_FMAC1 int SOAP_FMAC2 soap_s2int(struct soap*, const char*, int*); +SOAP_FMAC1 int SOAP_FMAC2 soap_s2long(struct soap*, const char*, long*); +SOAP_FMAC1 int SOAP_FMAC2 soap_s2LONG64(struct soap*, const char*, LONG64*); +SOAP_FMAC1 int SOAP_FMAC2 soap_s2float(struct soap*, const char*, float*); +SOAP_FMAC1 int SOAP_FMAC2 soap_s2double(struct soap*, const char*, double*); +SOAP_FMAC1 int SOAP_FMAC2 soap_s2unsignedByte(struct soap*, const char*, unsigned char*); +SOAP_FMAC1 int SOAP_FMAC2 soap_s2unsignedShort(struct soap*, const char*, unsigned short*); +SOAP_FMAC1 int SOAP_FMAC2 soap_s2unsignedInt(struct soap*, const char*, unsigned int*); +SOAP_FMAC1 int SOAP_FMAC2 soap_s2unsignedLong(struct soap*, const char*, unsigned long*); +SOAP_FMAC1 int SOAP_FMAC2 soap_s2ULONG64(struct soap*, const char*, ULONG64*); +SOAP_FMAC1 int SOAP_FMAC2 soap_s2char(struct soap*, const char*, char**, int, long minlen, long maxlen, const char *pattern); +SOAP_FMAC1 int SOAP_FMAC2 soap_s2QName(struct soap*, const char*, char**, long minlen, long maxlen, const char *pattern); + +#ifndef WITH_COMPAT +#ifdef __cplusplus +SOAP_FMAC1 int SOAP_FMAC2 soap_s2stdQName(struct soap*, const char*, std::string*, long minlen, long maxlen, const char *pattern); +SOAP_FMAC1 int SOAP_FMAC2 soap_s2stdchar(struct soap*, const char*, std::string*, int, long minlen, long maxlen, const char *pattern); +SOAP_FMAC1 int SOAP_FMAC2 soap_s2stdwchar(struct soap*, const char*, std::wstring*, int, long minlen, long maxlen, const char *pattern); +#endif +#endif + +#ifndef WITH_LEAN +SOAP_FMAC1 int SOAP_FMAC2 soap_s2wchar(struct soap*, const char*, wchar_t**, int, long minlen, long maxlen, const char *pattern); +SOAP_FMAC1 int SOAP_FMAC2 soap_s2dateTime(struct soap*, const char*, time_t*); +#endif + +SOAP_FMAC1 char* SOAP_FMAC2 soap_s2base64(struct soap*, const unsigned char*, char*, int); +SOAP_FMAC1 char* SOAP_FMAC2 soap_s2hex(struct soap*, const unsigned char*, char*, int); + +SOAP_FMAC1 const char* SOAP_FMAC2 soap_byte2s(struct soap*, char); +SOAP_FMAC1 const char* SOAP_FMAC2 soap_short2s(struct soap*, short); +SOAP_FMAC1 const char* SOAP_FMAC2 soap_int2s(struct soap*, int); +SOAP_FMAC1 const char* SOAP_FMAC2 soap_long2s(struct soap*, long); +SOAP_FMAC1 const char* SOAP_FMAC2 soap_LONG642s(struct soap*, LONG64); +SOAP_FMAC1 const char* SOAP_FMAC2 soap_float2s(struct soap*, float); +SOAP_FMAC1 const char* SOAP_FMAC2 soap_double2s(struct soap*, double); +SOAP_FMAC1 const char* SOAP_FMAC2 soap_unsignedByte2s(struct soap*, unsigned char); +SOAP_FMAC1 const char* SOAP_FMAC2 soap_unsignedShort2s(struct soap*, unsigned short); +SOAP_FMAC1 const char* SOAP_FMAC2 soap_unsignedInt2s(struct soap*, unsigned int); +SOAP_FMAC1 const char* SOAP_FMAC2 soap_unsignedLong2s(struct soap*, unsigned long); +SOAP_FMAC1 const char* SOAP_FMAC2 soap_ULONG642s(struct soap*, ULONG64); +SOAP_FMAC1 const char* SOAP_FMAC2 soap_QName2s(struct soap*, const char*); + +#ifndef WITH_LEAN +SOAP_FMAC1 const char* SOAP_FMAC2 soap_wchar2s(struct soap*, const wchar_t*); +SOAP_FMAC1 const char* SOAP_FMAC2 soap_dateTime2s(struct soap*, time_t); +#endif + +SOAP_FMAC1 const char* SOAP_FMAC2 soap_base642s(struct soap*, const char*, char*, size_t, int*); +SOAP_FMAC1 const char* SOAP_FMAC2 soap_hex2s(struct soap*, const char*, char*, size_t, int*); + +SOAP_FMAC1 int* SOAP_FMAC2 soap_inint(struct soap*, const char *tag, int *p, const char *, int); +SOAP_FMAC1 char* SOAP_FMAC2 soap_inbyte(struct soap*, const char *tag, char *p, const char *, int); +SOAP_FMAC1 long* SOAP_FMAC2 soap_inlong(struct soap*, const char *tag, long *p, const char *, int); +SOAP_FMAC1 LONG64* SOAP_FMAC2 soap_inLONG64(struct soap*, const char *tag, LONG64 *p, const char *, int); +SOAP_FMAC1 short* SOAP_FMAC2 soap_inshort(struct soap*, const char *tag, short *p, const char *, int); +SOAP_FMAC1 float* SOAP_FMAC2 soap_infloat(struct soap*, const char *tag, float *p, const char *, int); +SOAP_FMAC1 double* SOAP_FMAC2 soap_indouble(struct soap*, const char *tag, double *p, const char *, int); +SOAP_FMAC1 unsigned char* SOAP_FMAC2 soap_inunsignedByte(struct soap*, const char *tag, unsigned char *p, const char *, int); +SOAP_FMAC1 unsigned short* SOAP_FMAC2 soap_inunsignedShort(struct soap*, const char *tag, unsigned short *p, const char *, int); +SOAP_FMAC1 unsigned int* SOAP_FMAC2 soap_inunsignedInt(struct soap*, const char *tag, unsigned int *p, const char *, int); +SOAP_FMAC1 unsigned long* SOAP_FMAC2 soap_inunsignedLong(struct soap*, const char *tag, unsigned long *p, const char *, int); +SOAP_FMAC1 ULONG64* SOAP_FMAC2 soap_inULONG64(struct soap*, const char *tag, ULONG64 *p, const char *, int); +SOAP_FMAC1 char** SOAP_FMAC2 soap_instring(struct soap*, const char *tag, char **p, const char *, int, int, long, long, const char*); +SOAP_FMAC1 char** SOAP_FMAC2 soap_inliteral(struct soap*, const char *tag, char **p); + +#ifndef WITH_LEAN +SOAP_FMAC1 time_t* SOAP_FMAC2 soap_indateTime(struct soap*, const char *tag, time_t *p, const char *, int); +#endif + +#if !defined(WITH_LEAN) || defined(WITH_COOKIES) +SOAP_FMAC1 time_t SOAP_FMAC2 soap_timegm(struct tm*); +#endif + +#ifndef WITH_LEANER +SOAP_FMAC1 wchar_t** SOAP_FMAC2 soap_inwstring(struct soap*, const char *tag, wchar_t **p, const char *, int, int, long, long, const char*); +SOAP_FMAC1 wchar_t** SOAP_FMAC2 soap_inwliteral(struct soap*, const char *tag, wchar_t **p); +#endif + +SOAP_FMAC1 int SOAP_FMAC2 soap_outbyte(struct soap*, const char *tag, int id, const char *p, const char *, int); +SOAP_FMAC1 int SOAP_FMAC2 soap_outshort(struct soap*, const char *tag, int id, const short *p, const char *, int); +SOAP_FMAC1 int SOAP_FMAC2 soap_outint(struct soap*, const char *tag, int id, const int *p, const char *, int); +SOAP_FMAC1 int SOAP_FMAC2 soap_outlong(struct soap*, const char *tag, int id, const long *p, const char *, int); +SOAP_FMAC1 int SOAP_FMAC2 soap_outLONG64(struct soap*, const char *tag, int id, const LONG64 *p, const char *, int); +SOAP_FMAC1 int SOAP_FMAC2 soap_outfloat(struct soap*, const char *tag, int id, const float *p, const char *, int); +SOAP_FMAC1 int SOAP_FMAC2 soap_outdouble(struct soap*, const char *tag, int id, const double *p, const char *, int); +SOAP_FMAC1 int SOAP_FMAC2 soap_outunsignedByte(struct soap*, const char *tag, int id, const unsigned char *p, const char *, int); +SOAP_FMAC1 int SOAP_FMAC2 soap_outunsignedShort(struct soap*, const char *tag, int id, const unsigned short *p, const char *, int); +SOAP_FMAC1 int SOAP_FMAC2 soap_outunsignedInt(struct soap*, const char *tag, int id, const unsigned int *p, const char *, int); +SOAP_FMAC1 int SOAP_FMAC2 soap_outunsignedLong(struct soap*, const char *tag, int id, const unsigned long *p, const char *, int); +SOAP_FMAC1 int SOAP_FMAC2 soap_outULONG64(struct soap*, const char *tag, int id, const ULONG64 *p, const char *, int); +SOAP_FMAC1 int SOAP_FMAC2 soap_outstring(struct soap*, const char *tag, int id, char *const*p, const char *, int); +SOAP_FMAC1 int SOAP_FMAC2 soap_outliteral(struct soap*, const char *tag, char *const*p, const char *type); + +#ifndef WITH_LEAN +SOAP_FMAC1 int SOAP_FMAC2 soap_outdateTime(struct soap*, const char *tag, int id, const time_t *p, const char *, int); +#endif + +#ifndef WITH_LEANER +SOAP_FMAC1 int SOAP_FMAC2 soap_outwstring(struct soap*, const char *tag, int id, wchar_t *const*p, const char *, int); +SOAP_FMAC1 int SOAP_FMAC2 soap_outwliteral(struct soap*, const char *tag, wchar_t *const*p, const char *type); +#endif + +#ifndef WITH_LEANER +SOAP_FMAC1 int SOAP_FMAC2 soap_attachment(struct soap *, const char*, int, const void*, const void*, int, const char*, const char*, const char*, const char*, int); +SOAP_FMAC1 int SOAP_FMAC2 soap_move(struct soap*, ULONG64); +SOAP_FMAC1 ULONG64 SOAP_FMAC2 soap_tell(struct soap*); +SOAP_FMAC1 char* SOAP_FMAC2 soap_dime_option(struct soap*, unsigned short, const char*); +SOAP_FMAC1 int SOAP_FMAC2 soap_getdimehdr(struct soap*); +SOAP_FMAC1 int SOAP_FMAC2 soap_getdime(struct soap*); +SOAP_FMAC1 int SOAP_FMAC2 soap_putdimehdr(struct soap*); +SOAP_FMAC1 int SOAP_FMAC2 soap_putdime(struct soap*); +SOAP_FMAC1 int SOAP_FMAC2 soap_getmimehdr(struct soap*); +SOAP_FMAC1 int SOAP_FMAC2 soap_getmime(struct soap*); +SOAP_FMAC1 int SOAP_FMAC2 soap_putmimehdr(struct soap*, struct soap_multipart*); +SOAP_FMAC1 int SOAP_FMAC2 soap_putmime(struct soap*); +SOAP_FMAC1 void SOAP_FMAC2 soap_set_dime(struct soap*); +SOAP_FMAC1 void SOAP_FMAC2 soap_set_mime(struct soap*, const char *boundary, const char *start); +SOAP_FMAC1 void SOAP_FMAC2 soap_clr_dime(struct soap*); +SOAP_FMAC1 void SOAP_FMAC2 soap_clr_mime(struct soap*); +SOAP_FMAC1 int SOAP_FMAC2 soap_set_dime_attachment(struct soap*, const char *ptr, size_t size, const char *type, const char *id, unsigned short optype, const char *option); +SOAP_FMAC1 int SOAP_FMAC2 soap_set_mime_attachment(struct soap*, const char *ptr, size_t size, enum soap_mime_encoding encoding, const char *type, const char *id, const char *location, const char *description); +SOAP_FMAC1 void SOAP_FMAC2 soap_post_check_mime_attachments(struct soap *soap); +SOAP_FMAC1 int SOAP_FMAC2 soap_check_mime_attachments(struct soap *soap); +SOAP_FMAC1 struct soap_multipart* SOAP_FMAC2 soap_recv_mime_attachment(struct soap *soap, void *handle); +SOAP_FMAC1 int SOAP_FMAC2 soap_match_cid(struct soap*, const char*, const char*); +SOAP_FMAC1 const char* SOAP_FMAC2 soap_rand_uuid(struct soap*, const char*); +#endif + +SOAP_FMAC1 int SOAP_FMAC2 soap_register_plugin_arg(struct soap*, int (*fcreate)(struct soap*, struct soap_plugin*, void*), void*); +SOAP_FMAC1 void* SOAP_FMAC2 soap_lookup_plugin(struct soap*, const char*); + +SOAP_FMAC1 const char* SOAP_FMAC2 soap_attr_value(struct soap *soap, const char *name, int flag, int occurs); +SOAP_FMAC1 int SOAP_FMAC2 soap_set_attr(struct soap *soap, const char *name, const char *value, int flag); +SOAP_FMAC1 void SOAP_FMAC2 soap_clr_attr(struct soap *soap); + +SOAP_FMAC1 const char* SOAP_FMAC2 soap_extend_url(struct soap *soap, const char*, const char*); +SOAP_FMAC1 const char* SOAP_FMAC2 soap_extend_url_query(struct soap *soap, const char*, const char*); +SOAP_FMAC1 void SOAP_FMAC2 soap_url_query(struct soap *soap, const char*, const char*); +SOAP_FMAC1 int SOAP_FMAC2 soap_encode_url(const char*, char*, int); +SOAP_FMAC1 const char* SOAP_FMAC2 soap_encode_url_string(struct soap*, const char*); +#ifdef WITH_COOKIES +SOAP_FMAC1 void SOAP_FMAC2 soap_getcookies(struct soap *soap, const char *val); +SOAP_FMAC1 struct soap_cookie* SOAP_FMAC2 soap_set_cookie(struct soap*, const char*, const char*, const char*, const char*); +SOAP_FMAC1 struct soap_cookie* SOAP_FMAC2 soap_cookie(struct soap*, const char*, const char*, const char*); +SOAP_FMAC1 struct soap_cookie* SOAP_FMAC2 soap_cookie_env(struct soap*, const char*, const char*, const char*, short); +SOAP_FMAC1 const char* SOAP_FMAC2 soap_cookie_value(struct soap*, const char*, const char*, const char*); +SOAP_FMAC1 const char* SOAP_FMAC2 soap_env_cookie_value(struct soap*, const char*, const char*, const char*); +SOAP_FMAC1 time_t SOAP_FMAC2 soap_cookie_expire(struct soap*, const char*, const char*, const char*); +SOAP_FMAC1 int SOAP_FMAC2 soap_set_cookie_expire(struct soap*, const char*, long, const char*, const char*); +SOAP_FMAC1 int SOAP_FMAC2 soap_set_cookie_secure(struct soap*, const char*, const char*, const char*); +SOAP_FMAC1 int SOAP_FMAC2 soap_set_cookie_session(struct soap*, const char*, const char*, const char*); +SOAP_FMAC1 int SOAP_FMAC2 soap_clr_cookie_session(struct soap*, const char*, const char*, const char*); +SOAP_FMAC1 void SOAP_FMAC2 soap_clr_cookie(struct soap*, const char*, const char*, const char*); +SOAP_FMAC1 int SOAP_FMAC2 soap_getenv_cookies(struct soap*); +SOAP_FMAC1 void SOAP_FMAC2 soap_free_cookies(struct soap*); +SOAP_FMAC1 struct soap_cookie* SOAP_FMAC2 soap_copy_cookies(struct soap*, const struct soap*); +SOAP_FMAC1 int SOAP_FMAC2 soap_putsetcookies(struct soap *soap); +SOAP_FMAC1 int SOAP_FMAC2 soap_putcookies(struct soap *soap, const char *domain, const char *path, int secure); +#endif + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +/* declare global SOAP header and fault processing functions, unless WITH_STATIC is defined (generated in soapXYXLib code) */ +#ifndef WITH_STATIC +SOAP_FMAC3 void SOAP_FMAC4 soap_header(struct soap*); +SOAP_FMAC3 void SOAP_FMAC4 soap_fault(struct soap*); +SOAP_FMAC3 const char ** SOAP_FMAC4 soap_faultcode(struct soap*); +SOAP_FMAC3 const char ** SOAP_FMAC4 soap_faultsubcode(struct soap*); +SOAP_FMAC3 const char ** SOAP_FMAC4 soap_faultstring(struct soap*); +SOAP_FMAC3 const char ** SOAP_FMAC4 soap_faultdetail(struct soap*); +SOAP_FMAC3 const char * SOAP_FMAC4 soap_fault_subcode(struct soap*); +SOAP_FMAC3 const char * SOAP_FMAC4 soap_fault_string(struct soap*); +SOAP_FMAC3 const char * SOAP_FMAC4 soap_fault_detail(struct soap*); +SOAP_FMAC3 void SOAP_FMAC4 soap_serializefault(struct soap*); +SOAP_FMAC3 void SOAP_FMAC4 soap_serializeheader(struct soap*); +SOAP_FMAC3 int SOAP_FMAC4 soap_getheader(struct soap*); +SOAP_FMAC3 int SOAP_FMAC4 soap_putheader(struct soap*); +SOAP_FMAC3 int SOAP_FMAC4 soap_getfault(struct soap*); +SOAP_FMAC3 int SOAP_FMAC4 soap_putfault(struct soap*); +#endif + +#ifdef __cplusplus + +/* C++ templates (for generated C++ only, not needed nor used in generated C code) */ + +template +struct soap_block +{ + static T *push(struct soap *soap, struct soap_blist *b) + { + if (!b) + b = soap->blist; + if (!b) + return NULL; + T *p = (T*)soap_push_block_max(soap, b, sizeof(T)); + if (p) + SOAP_PLACEMENT_NEW(soap, p, T); + return p; + } + static void pop(struct soap *soap, struct soap_blist *b) + { + if (!b) + b = soap->blist; + if (!b || !b->head) + return; + ((T*)(b->head + 1))->~T(); + soap_pop_block(soap, b); + } + static void save(struct soap *soap, struct soap_blist *b, T *p) + { + if (!b) + b = soap->blist; + for (T *q = (T*)soap_first_block(soap, b); q; q = (T*)soap_next_block(soap, b)) + { + soap_update_pointers(soap, (const char*)p, (const char*)q, sizeof(T)); + *p++ = *q; + q->~T(); + } + soap_end_block(soap, b); + } + static void end(struct soap *soap, struct soap_blist *b) + { + if (!b) + b = soap->blist; + for (T *p = (T*)soap_first_block(soap, b); p; p = (T*)soap_next_block(soap, b)) + p->~T(); + soap_end_block(soap, b); + } +}; + +#endif + +#endif /* STDSOAP_H */ diff --git a/DFL_BOM_WL_TOERP/util.cpp b/DFL_BOM_WL_TOERP/util.cpp new file mode 100644 index 0000000..911c1a6 --- /dev/null +++ b/DFL_BOM_WL_TOERP/util.cpp @@ -0,0 +1,315 @@ +#include "util.h" + +void split(std::string s, const char* delim, std::vector* ret) +{ + size_t last = 0; + size_t index = s.find(delim, last); + int size=strlen(delim); + while (index != std::string::npos) { + ret->push_back(s.substr(last, index - last)); + last = index + size; + index = s.find(delim, last); + } + if (index - last > 0) { + ret->push_back(s.substr(last, index - last)); + } +} + +bool isTypeOf(tag_t objtag, const char * type_name) { + tag_t type = NULLTAG; + TCTYPE_ask_object_type(objtag, &type); + tag_t item_type = NULLTAG; + TCTYPE_find_type(type_name, "", &item_type); + bool is_type = false; + if (item_type != NULLTAG) { + logical isok = FALSE; + TCTYPE_is_type_of(type, item_type, &isok); + if (isok) { + is_type = true; + } + } + return is_type; +} + + + + + + + + +void vecToArray(vector &vec,char ***arr) +{ + (*arr)=(char **)MEM_alloc(vec.size()*sizeof(char *)); + for(auto i=0;itm_year + 1900 << '-'; + if (local->tm_mon < 9) + ss << "0"; + ss << local->tm_mon + 1 << '-'; + if (local->tm_mday < 9) + ss << "0"; + ss << local->tm_mday << ' '; + if (local->tm_hour < 10) + ss << "0"; + if (local->tm_min < 10) + ss << "0"; + ss << local->tm_min; + if(local->tm_sec<10) + ss<<"0"; + ss<tm_sec; + return ss.str(); +} + +string getTime() +{ + stringstream ss; + time_t t = time(0); + tm* local = localtime(&t); + ss << local->tm_year + 1900 << '-'; + if (local->tm_mon < 9) + ss << "0"; + ss << local->tm_mon + 1 << '-'; + if (local->tm_mday < 9) + ss << "0"; + ss << local->tm_mday << ' '; + if (local->tm_hour < 10) + ss << "0"; + ss << local->tm_hour << ':'; + if (local->tm_min < 10) + ss << "0"; + ss << local->tm_min<<':'; + if(local->tm_sec<10) + ss<<"0"; + ss<tm_sec; + return ss.str(); +} +char* G2U(const char* gb2312) +{ + int len = MultiByteToWideChar(CP_ACP, 0, gb2312, -1, NULL, 0); + wchar_t* wstr = new wchar_t[len + 1]; + memset(wstr, 0, len + 1); + MultiByteToWideChar(CP_ACP, 0, gb2312, -1, wstr, len); + len = WideCharToMultiByte(CP_UTF8, 0, wstr, -1, NULL, 0, NULL, NULL); + char* str = new char[len + 1]; + memset(str, 0, len + 1); + WideCharToMultiByte(CP_UTF8, 0, wstr, -1, str, len, NULL, NULL); + if (wstr) delete[] wstr; + return str; +} +char* U2G(const char* utf8) +{ + int len = MultiByteToWideChar(CP_UTF8, 0, utf8, -1, NULL, 0); + wchar_t* wstr = new wchar_t[len + 1]; + memset(wstr, 0, len + 1); + MultiByteToWideChar(CP_UTF8, 0, utf8, -1, wstr, len); + len = WideCharToMultiByte(CP_ACP, 0, wstr, -1, NULL, 0, NULL, NULL); + char* str = new char[len + 1]; + memset(str, 0, len + 1); + WideCharToMultiByte(CP_ACP, 0, wstr, -1, str, len, NULL, NULL); + if (wstr) delete[] wstr; + return str; +} +string WStringToString(const wstring& ws) +{ + string curLocale = setlocale(LC_ALL, NULL); // curLocale = "C"; + setlocale(LC_ALL, "chs"); + const wchar_t* _Source = ws.c_str(); + size_t _Dsize = 2 * ws.size() + 1; + char *_Dest = new char[_Dsize]; + memset(_Dest,0,_Dsize); + wcstombs(_Dest,_Source,_Dsize); + string result = _Dest; + delete []_Dest; + setlocale(LC_ALL, curLocale.c_str()); + result = G2U(result.c_str()); + return result; +} +wstring StringToWString(const string s) +{ + setlocale(LC_ALL, "chs"); + const char* _Source = s.c_str(); + size_t _Dsize = s.size() + 1; + wchar_t *_Dest = new wchar_t[_Dsize]; + wmemset(_Dest, 0, _Dsize); + mbstowcs(_Dest,_Source,_Dsize); + wstring result = _Dest; + delete []_Dest; + setlocale(LC_ALL, "C"); + return result; +} + + + + + + + + +std::string string_To_UTF8(const std::string str) +{ + int nwLen = ::MultiByteToWideChar(CP_ACP, 0, str.c_str(), -1, NULL, 0); + + wchar_t * pwBuf = new wchar_t[nwLen + 1];//һҪ1Ȼβ + ZeroMemory(pwBuf, nwLen * 2 + 2); + + ::MultiByteToWideChar(CP_ACP, 0, str.c_str(), str.length(), pwBuf, nwLen); + + int nLen = ::WideCharToMultiByte(CP_UTF8, 0, pwBuf, -1, NULL, NULL, NULL, NULL); + + char * pBuf = new char[nLen + 1]; + ZeroMemory(pBuf, nLen + 1); + + ::WideCharToMultiByte(CP_UTF8, 0, pwBuf, nwLen, pBuf, nLen, NULL, NULL); + + std::string retStr(pBuf); + + delete []pwBuf; + delete []pBuf; + + pwBuf = NULL; + pBuf = NULL; + + return retStr; +} + + +double stringToNum( string str) +{ + istringstream iss(str); + double num; + iss >> num; + return num; +} + + +void trim(std::string &s) +{ + if (s.empty()) + { + return; + } + s.erase(0,s.find_first_not_of(" ")); + s.erase(s.find_last_not_of(" ") + 1); +} + + +void getLatest(tag_t item,tag_t *rev) +{ + int cnt,rel_cnt; + tag_t *tags,*rels; + ITEM_list_all_revs(item,&cnt,&tags); + for(auto i=cnt-1;i>=0;i--) + { + AOM_ask_value_tags(tags[i],"release_status_list",&rel_cnt,&rels); + if(rel_cnt) + { + *rev=tags[i]; + return; + } + } + *rev=NULLTAG; +} + + + + +string get_excel_data(libxl::Book *book, libxl::Sheet *sheet, int row, int col) +{ + string result; + double temp; + + try + { + libxl::CellType cell_type = sheet->cellType(row, col); + switch (cell_type) + { + case libxl::CELLTYPE_STRING: + result = WStringToString(sheet->readStr(row, col)); + break; + case libxl::CELLTYPE_BLANK: + result = ""; + break; + case libxl::CELLTYPE_EMPTY: + result = ""; + break; + case libxl::CELLTYPE_NUMBER: + temp = sheet->readNum(row, col); + if (sheet->isDate(row, col)) + { + int year = 0, month = 0, day = 0, hour = 0, min = 0, second = 0; + book->dateUnpack(temp, &year, &month, &day, &hour, &min, &second); + date_t d; + d.year = year; d.month = month-1; d.day = day; d.hour = hour; d.minute = min; d.second = second; + char *date_str, *date_format; + DATE_default_date_format(&date_format); + DATE_date_to_string(d, date_format, &date_str); + result = date_str; + } + else + { + result = temp == (int)temp ? to_string((int)temp) : to_string(temp); + } + break; + case libxl::CELLTYPE_BOOLEAN: + result = to_string(sheet->readBool(row, col)); + break; + case libxl::CELLTYPE_ERROR: + result = ""; + break; + } + + } + catch (exception e) + { + // LERROR<<"col num"< +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "ae/dataset.h" +#include +#include +#include +#include +#include +#include +#include +#include "schmgt/schmgt_bridge_itk.h" +#include +#include "cfm/cfm.h" +#include "schmgt/schmgt_bridge_itk.h" +#include +#include "metaframework/BusinessObjectRef.hxx" +#include "tccore/ItemRevision.hxx" +#include "ps/ps.h" +#include "sstream" +#include +#include +#include +#include +#include "epm/EPMTask.hxx" +#include "bom/bom.h" +#include +#include "spdlog/spdlog.h" +#include "spdlog/sinks/basic_file_sink.h" +#include "tccore/Item.hxx" +// #include "excelreader.h" +#include "libxl.h" +using namespace std; +using namespace libxl; +using namespace spdlog; +// using namespace excelreader; +extern "C" int POM_AM__set_application_bypass(logical bypass); +const char* newGUID(); + +bool isTypeOf(tag_t objtag, const char * type_name); +void split(std::string s, const char* delim, std::vector* ret); +void vecToArray(vector &vec, char ***arr); +string WStringToString(const wstring& ws); +wstring StringToWString(const string s); +string getTime(); +char* U2G(const char* utf8); +char* G2U(const char* gb2312); +std::string string_To_UTF8(const std::string str); +string getTime2(); +double stringToNum(string str); +void getLatest(tag_t item, tag_t *rev); +string get_excel_data(libxl::Book *book, libxl::Sheet *sheet, int row, int col); + +void trim(string &s); +void log(const char* format, ...); + +#define SAFECALL( argument ) \ +{ \ + int retcode = argument; \ + if ( retcode != ITK_ok ) { \ + const char* *err; \ + const int *e1,*e2; \ + int e; \ + EMH_ask_errors(&e,&e1,&e2,&err); \ + stringstream err_ss;\ + for(auto e_i=0;e_i + + + + D:\正泰\正泰整理\BOM数据读取优化\项目BOM传递优化\GetBOMProp\x64\Release\BOMToSapOpt.exe + + + + + + \ No newline at end of file diff --git a/DFL_BOM_WL_TOERP/x64/Release/BOMToSapOpt.tlog/BOMToSapOpt.lastbuildstate b/DFL_BOM_WL_TOERP/x64/Release/BOMToSapOpt.tlog/BOMToSapOpt.lastbuildstate new file mode 100644 index 0000000..aebee1e --- /dev/null +++ b/DFL_BOM_WL_TOERP/x64/Release/BOMToSapOpt.tlog/BOMToSapOpt.lastbuildstate @@ -0,0 +1,2 @@ +#TargetFrameworkVersion=v4.0:PlatformToolSet=v140:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit +Release|x64|Z:\TC_install\ZhengTai\c\GetBOMProp\| diff --git a/DFL_BOM_WL_TOERP/x64/Release/BOMToSapOpt.tlog/CL.command.1.tlog b/DFL_BOM_WL_TOERP/x64/Release/BOMToSapOpt.tlog/CL.command.1.tlog new file mode 100644 index 0000000..959bd97 Binary files /dev/null and b/DFL_BOM_WL_TOERP/x64/Release/BOMToSapOpt.tlog/CL.command.1.tlog differ diff --git a/DFL_BOM_WL_TOERP/x64/Release/BOMToSapOpt.tlog/CL.read.1.tlog b/DFL_BOM_WL_TOERP/x64/Release/BOMToSapOpt.tlog/CL.read.1.tlog new file mode 100644 index 0000000..e083ac9 Binary files /dev/null and b/DFL_BOM_WL_TOERP/x64/Release/BOMToSapOpt.tlog/CL.read.1.tlog differ diff --git a/DFL_BOM_WL_TOERP/x64/Release/BOMToSapOpt.tlog/CL.write.1.tlog b/DFL_BOM_WL_TOERP/x64/Release/BOMToSapOpt.tlog/CL.write.1.tlog new file mode 100644 index 0000000..140a37c Binary files /dev/null and b/DFL_BOM_WL_TOERP/x64/Release/BOMToSapOpt.tlog/CL.write.1.tlog differ diff --git a/DFL_BOM_WL_TOERP/x64/Release/BOMToSapOpt.tlog/link.command.1.tlog b/DFL_BOM_WL_TOERP/x64/Release/BOMToSapOpt.tlog/link.command.1.tlog new file mode 100644 index 0000000..cff477d Binary files /dev/null and b/DFL_BOM_WL_TOERP/x64/Release/BOMToSapOpt.tlog/link.command.1.tlog differ diff --git a/DFL_BOM_WL_TOERP/x64/Release/BOMToSapOpt.tlog/link.read.1.tlog b/DFL_BOM_WL_TOERP/x64/Release/BOMToSapOpt.tlog/link.read.1.tlog new file mode 100644 index 0000000..9dbf101 Binary files /dev/null and b/DFL_BOM_WL_TOERP/x64/Release/BOMToSapOpt.tlog/link.read.1.tlog differ diff --git a/DFL_BOM_WL_TOERP/x64/Release/BOMToSapOpt.tlog/link.write.1.tlog b/DFL_BOM_WL_TOERP/x64/Release/BOMToSapOpt.tlog/link.write.1.tlog new file mode 100644 index 0000000..9451e25 Binary files /dev/null and b/DFL_BOM_WL_TOERP/x64/Release/BOMToSapOpt.tlog/link.write.1.tlog differ diff --git a/DFL_BOM_WL_TOERP/x64/Release/CRUL_server_call_httpserver.obj b/DFL_BOM_WL_TOERP/x64/Release/CRUL_server_call_httpserver.obj new file mode 100644 index 0000000..f1b251c Binary files /dev/null and b/DFL_BOM_WL_TOERP/x64/Release/CRUL_server_call_httpserver.obj differ diff --git a/DFL_BOM_WL_TOERP/x64/Release/DFL_BOM_.C1C26324.tlog/CL.command.1.tlog b/DFL_BOM_WL_TOERP/x64/Release/DFL_BOM_.C1C26324.tlog/CL.command.1.tlog new file mode 100644 index 0000000..0bd01e8 Binary files /dev/null and b/DFL_BOM_WL_TOERP/x64/Release/DFL_BOM_.C1C26324.tlog/CL.command.1.tlog differ diff --git a/DFL_BOM_WL_TOERP/x64/Release/DFL_BOM_.C1C26324.tlog/CL.read.1.tlog b/DFL_BOM_WL_TOERP/x64/Release/DFL_BOM_.C1C26324.tlog/CL.read.1.tlog new file mode 100644 index 0000000..e45e06d Binary files /dev/null and b/DFL_BOM_WL_TOERP/x64/Release/DFL_BOM_.C1C26324.tlog/CL.read.1.tlog differ diff --git a/DFL_BOM_WL_TOERP/x64/Release/DFL_BOM_.C1C26324.tlog/CL.write.1.tlog b/DFL_BOM_WL_TOERP/x64/Release/DFL_BOM_.C1C26324.tlog/CL.write.1.tlog new file mode 100644 index 0000000..af01da4 Binary files /dev/null and b/DFL_BOM_WL_TOERP/x64/Release/DFL_BOM_.C1C26324.tlog/CL.write.1.tlog differ diff --git a/DFL_BOM_WL_TOERP/x64/Release/DFL_BOM_.C1C26324.tlog/DFL_BOM_WL_TOERP1.lastbuildstate b/DFL_BOM_WL_TOERP/x64/Release/DFL_BOM_.C1C26324.tlog/DFL_BOM_WL_TOERP1.lastbuildstate new file mode 100644 index 0000000..07cb371 --- /dev/null +++ b/DFL_BOM_WL_TOERP/x64/Release/DFL_BOM_.C1C26324.tlog/DFL_BOM_WL_TOERP1.lastbuildstate @@ -0,0 +1,2 @@ +#TargetFrameworkVersion=v4.0:PlatformToolSet=v141:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit:WindowsTargetPlatformVersion=10.0.17763.0 +Release|x64|D:\code\DFL_BOM_WL_TOERP\| diff --git a/DFL_BOM_WL_TOERP/x64/Release/DFL_BOM_.C1C26324.tlog/DFL_BOM_WL_TOERP1.write.1u.tlog b/DFL_BOM_WL_TOERP/x64/Release/DFL_BOM_.C1C26324.tlog/DFL_BOM_WL_TOERP1.write.1u.tlog new file mode 100644 index 0000000..a31e710 Binary files /dev/null and b/DFL_BOM_WL_TOERP/x64/Release/DFL_BOM_.C1C26324.tlog/DFL_BOM_WL_TOERP1.write.1u.tlog differ diff --git a/DFL_BOM_WL_TOERP/x64/Release/DFL_BOM_.C1C26324.tlog/link.command.1.tlog b/DFL_BOM_WL_TOERP/x64/Release/DFL_BOM_.C1C26324.tlog/link.command.1.tlog new file mode 100644 index 0000000..09799c6 Binary files /dev/null and b/DFL_BOM_WL_TOERP/x64/Release/DFL_BOM_.C1C26324.tlog/link.command.1.tlog differ diff --git a/DFL_BOM_WL_TOERP/x64/Release/DFL_BOM_.C1C26324.tlog/link.read.1.tlog b/DFL_BOM_WL_TOERP/x64/Release/DFL_BOM_.C1C26324.tlog/link.read.1.tlog new file mode 100644 index 0000000..8d48b2f Binary files /dev/null and b/DFL_BOM_WL_TOERP/x64/Release/DFL_BOM_.C1C26324.tlog/link.read.1.tlog differ diff --git a/DFL_BOM_WL_TOERP/x64/Release/DFL_BOM_.C1C26324.tlog/link.write.1.tlog b/DFL_BOM_WL_TOERP/x64/Release/DFL_BOM_.C1C26324.tlog/link.write.1.tlog new file mode 100644 index 0000000..b4ca28e Binary files /dev/null and b/DFL_BOM_WL_TOERP/x64/Release/DFL_BOM_.C1C26324.tlog/link.write.1.tlog differ diff --git a/DFL_BOM_WL_TOERP/x64/Release/DFL_BOM_WL_TOERP.Build.CppClean.log b/DFL_BOM_WL_TOERP/x64/Release/DFL_BOM_WL_TOERP.Build.CppClean.log new file mode 100644 index 0000000..4aeb3e8 --- /dev/null +++ b/DFL_BOM_WL_TOERP/x64/Release/DFL_BOM_WL_TOERP.Build.CppClean.log @@ -0,0 +1,15 @@ +d:\美菱\out\plm开发\itk\bom数据读取优化\dfl_bom_wl_toerp\dfl_bom_wl_toerp\x64\release\vc142.pdb +d:\美菱\out\plm开发\itk\bom数据读取优化\dfl_bom_wl_toerp\dfl_bom_wl_toerp\x64\release\dfl_bom_wl_toerp.obj +d:\美菱\out\plm开发\itk\bom数据读取优化\dfl_bom_wl_toerp\dfl_bom_wl_toerp\x64\release\ado.obj +d:\美菱\out\plm开发\itk\bom数据读取优化\dfl_bom_wl_toerp\x64\release\dfl_bom_wl_toerp.exe +d:\美菱\out\plm开发\itk\bom数据读取优化\dfl_bom_wl_toerp\dfl_bom_wl_toerp\x64\release\dfl_bom_wl_toerp.ipdb +d:\美菱\out\plm开发\itk\bom数据读取优化\dfl_bom_wl_toerp\dfl_bom_wl_toerp\x64\release\dfl_bom_wl_toerp.iobj +d:\美菱\out\plm开发\itk\bom数据读取优化\dfl_bom_wl_toerp\x64\release\dfl_bom_wl_toerp.pdb +d:\美菱\out\plm开发\itk\bom数据读取优化\dfl_bom_wl_toerp\dfl_bom_wl_toerp\x64\release\msado15.tli +d:\美菱\out\plm开发\itk\bom数据读取优化\dfl_bom_wl_toerp\dfl_bom_wl_toerp\x64\release\msado15.tlh +d:\美菱\out\plm开发\itk\bom数据读取优化\dfl_bom_wl_toerp\dfl_bom_wl_toerp\x64\release\dfl_bom_wl_toerp.tlog\cl.command.1.tlog +d:\美菱\out\plm开发\itk\bom数据读取优化\dfl_bom_wl_toerp\dfl_bom_wl_toerp\x64\release\dfl_bom_wl_toerp.tlog\cl.read.1.tlog +d:\美菱\out\plm开发\itk\bom数据读取优化\dfl_bom_wl_toerp\dfl_bom_wl_toerp\x64\release\dfl_bom_wl_toerp.tlog\cl.write.1.tlog +d:\美菱\out\plm开发\itk\bom数据读取优化\dfl_bom_wl_toerp\dfl_bom_wl_toerp\x64\release\dfl_bom_wl_toerp.tlog\link.command.1.tlog +d:\美菱\out\plm开发\itk\bom数据读取优化\dfl_bom_wl_toerp\dfl_bom_wl_toerp\x64\release\dfl_bom_wl_toerp.tlog\link.read.1.tlog +d:\美菱\out\plm开发\itk\bom数据读取优化\dfl_bom_wl_toerp\dfl_bom_wl_toerp\x64\release\dfl_bom_wl_toerp.tlog\link.write.1.tlog diff --git a/DFL_BOM_WL_TOERP/x64/Release/DFL_BOM_WL_TOERP.exe.recipe b/DFL_BOM_WL_TOERP/x64/Release/DFL_BOM_WL_TOERP.exe.recipe new file mode 100644 index 0000000..d255d9d --- /dev/null +++ b/DFL_BOM_WL_TOERP/x64/Release/DFL_BOM_WL_TOERP.exe.recipe @@ -0,0 +1,11 @@ + + + + + D:\美菱\out\PLM开发\ITK\BOM数据读取优化\DFL_BOM_WL_TOERP\x64\Release\DFL_BOM_WL_TOERP.exe + + + + + + \ No newline at end of file diff --git a/DFL_BOM_WL_TOERP/x64/Release/DFL_BOM_WL_TOERP.log b/DFL_BOM_WL_TOERP/x64/Release/DFL_BOM_WL_TOERP.log new file mode 100644 index 0000000..295f9a2 --- /dev/null +++ b/DFL_BOM_WL_TOERP/x64/Release/DFL_BOM_WL_TOERP.log @@ -0,0 +1,120 @@ +生成启动时间为 2024/3/8 16:55:29。 + 1>项目“Z:\TC_install\ZhengTai\c\GetBOMProp\DFL_BOM_WL_TOERP\DFL_BOM_WL_TOERP.vcxproj”在节点 2 上(Build 个目标)。 + 1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppBuild.targets(392,5): warning MSB8028: The intermediate directory (x64\Release\) contains files shared from another project (DFL_BOM_WL_TOERP1.vcxproj, DFL_BOM_WL_TOERP.vcxproj, GetBomMessage.vcxproj, GetBOMProp.vcxproj, GetBOMProp2.vcxproj). This can lead to incorrect clean and rebuild behavior. + 1>ClCompile: + D:\VS2015\VC\bin\x86_amd64\CL.exe /c /IZ:\TC_install\ZhengTai\c\GetBOMProp\packages\sqdlog.1.0.0\build\..\lib\native\include\ /IZ:\TC_install\ZhengTai\c\sdplog\include /I"Z:\TC_install\ZhengTai\c\libcurl-vc15-x64-release-dll-ipv6-sspi-schannel\include" /IZ:\TC_install\YSR\c\clib\OCI\include /IZ:\TC_install\jingdiao\c\tclib\include /IZ:\TC_install\jingdiao\c\tclib\include_cpp /IZ:\TC_install\ZhengTai\c\libxl\include /Zi /nologo /W3 /WX- /sdl /O2 /Oi /GL /D WIN32 /D NDEBUG /D _CONSOLE /D IPLIB=none /D _UNICODE /D UNICODE /Gm- /MD /GS /Gy /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /Fo"x64\Release\\" /Fd"x64\Release\vc140.pdb" /Gd /TP /errorReport:prompt /D _CRT_SECURE_NO_WARNINGS BOMSendSap.cpp + BOMSendSap.cpp + 1>D:\VS2015\VC\include\xlocale(341): warning C4530: 使用了 C++ 异常处理程序,但未启用展开语义。请指定 /EHsc + 1>Z:\TC_install\jingdiao\c\tclib\include\pom/pom/pom.h(806): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 + 1>Z:\TC_install\jingdiao\c\tclib\include\pom/pom/pom.h(5417): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 + 1>BOMSendSap.cpp(16): warning C4067: 预处理器指令后有意外标记 - 应输入换行符 + 1>Z:\TC_install\jingdiao\c\tclib\include_cpp\metaframework/RootObject.hxx(90): warning C4251: “Teamcenter::RootObject::m_typeName”: class“std::basic_string,std::allocator>”需要有 dll 接口由 class“Teamcenter::RootObject”的客户端使用 + 1>Z:\TC_install\jingdiao\c\tclib\include_cpp\metaframework/RootObject.hxx(95): warning C4251: “Teamcenter::RootObject::name”: class“std::basic_string,std::allocator>”需要有 dll 接口由 class“Teamcenter::RootObject”的客户端使用 + 1>Z:\TC_install\jingdiao\c\tclib\include_cpp\metaframework/OperationInput.hxx(414): warning C4251: “Teamcenter::OperationInput::name”: class“std::basic_string,std::allocator>”需要有 dll 接口由 class“Teamcenter::OperationInput”的客户端使用 + 1>Z:\TC_install\jingdiao\c\tclib\include_cpp\metaframework/BulkInput.hxx(120): warning C4251: “Teamcenter::BulkInput::name”: class“std::basic_string,std::allocator>”需要有 dll 接口由 class“Teamcenter::BulkInput”的客户端使用 + 1>Z:\TC_install\jingdiao\c\tclib\include_cpp\metaframework/BulkData.hxx(123): warning C4251: “Teamcenter::BulkData::name”: class“std::basic_string,std::allocator>”需要有 dll 接口由 class“Teamcenter::BulkData”的客户端使用 + 1>Z:\TC_install\jingdiao\c\tclib\include_cpp\metaframework/DeepCopyData.hxx(93): warning C4251: “Teamcenter::DeepCopyData::name”: class“std::basic_string,std::allocator>”需要有 dll 接口由 class“Teamcenter::DeepCopyData”的客户端使用 + 1>Z:\TC_install\jingdiao\c\tclib\include_cpp\metaframework/CreateInput.hxx(140): warning C4251: “Teamcenter::CreateInput::name”: class“std::basic_string,std::allocator>”需要有 dll 接口由 class“Teamcenter::CreateInput”的客户端使用 + 1>Z:\TC_install\jingdiao\c\tclib\include_cpp\metaframework/SaveAsInput.hxx(93): warning C4251: “Teamcenter::SaveAsInput::name”: class“std::basic_string,std::allocator>”需要有 dll 接口由 class“Teamcenter::SaveAsInput”的客户端使用 + 1>Z:\TC_install\jingdiao\c\tclib\include_cpp\metaframework/BusinessObject.hxx(666): warning C4251: “Teamcenter::BusinessObject::name”: class“std::basic_string,std::allocator>”需要有 dll 接口由 class“Teamcenter::BusinessObject”的客户端使用 + 1>Z:\TC_install\jingdiao\c\tclib\include_cpp\extensionframework/OperationDispatcher.hxx(439): warning C4251: “Teamcenter::OperationDispatcher::m_boName”: class“std::basic_string,std::allocator>”需要有 dll 接口由 class“Teamcenter::OperationDispatcher”的客户端使用 + 1>Z:\TC_install\jingdiao\c\tclib\include_cpp\tccore/POM_object.hxx(253): warning C4251: “Teamcenter::POM_object::name”: class“std::basic_string,std::allocator>”需要有 dll 接口由 class“Teamcenter::POM_object”的客户端使用 + 1>Z:\TC_install\jingdiao\c\tclib\include_cpp\tccore\imantype.hxx(225): warning C4251: “Teamcenter::ImanType::name”: class“std::basic_string,std::allocator>”需要有 dll 接口由 class“Teamcenter::ImanType”的客户端使用 + 1>Z:\TC_install\jingdiao\c\tclib\include_cpp\base_utils/IFail.hxx(114): warning C4251: “IFail::m_message”: class“std::basic_string,std::allocator>”需要有 dll 接口由 class“IFail”的客户端使用 + 1>Z:\TC_install\jingdiao\c\tclib\include_cpp\tccore/FeatureKeyCheck.hxx(55): warning C4251: “Teamcenter::FeatureKeyCheck::featureKey”: class“std::basic_string,std::allocator>”需要有 dll 接口由 class“Teamcenter::FeatureKeyCheck”的客户端使用 + 1>Z:\TC_install\jingdiao\c\tclib\include_cpp\tccore/FeatureKeyCheck.hxx(74): warning C4251: “Teamcenter::FeatureKeyCheckAND::featureKeyChecks”: class“std::vector>”需要有 dll 接口由 class“Teamcenter::FeatureKeyCheckAND”的客户端使用 + with + [ + _Ty=Teamcenter::FeatureKeyCheck * + ] + 1>Z:\TC_install\jingdiao\c\tclib\include_cpp\tccore/FeatureKeyCheck.hxx(95): warning C4251: “Teamcenter::FeatureKeyCheckOR::featureKeyChecks”: class“std::vector>”需要有 dll 接口由 class“Teamcenter::FeatureKeyCheckOR”的客户端使用 + with + [ + _Ty=Teamcenter::FeatureKeyCheck * + ] + 1>Z:\TC_install\jingdiao\c\tclib\include_cpp\metaframework/ReviseInput.hxx(93): warning C4251: “Teamcenter::ReviseInput::name”: class“std::basic_string,std::allocator>”需要有 dll 接口由 class“Teamcenter::ReviseInput”的客户端使用 + 1>Z:\TC_install\jingdiao\c\tclib\include_cpp\metaframework/RuntimeBusinessObject.hxx(93): warning C4251: “Teamcenter::RuntimeBusinessObject::name”: class“std::basic_string,std::allocator>”需要有 dll 接口由 class“Teamcenter::RuntimeBusinessObject”的客户端使用 + 1>Z:\TC_install\jingdiao\c\tclib\include_cpp\tc/Fnd0BaseProvider.hxx(103): warning C4251: “Teamcenter::Fnd0BaseProvider::name”: class“std::basic_string,std::allocator>”需要有 dll 接口由 class“Teamcenter::Fnd0BaseProvider”的客户端使用 + 1>Z:\TC_install\jingdiao\c\tclib\include_cpp\tccore/POM_application_object.hxx(149): warning C4251: “Teamcenter::POM_application_object::name”: class“std::basic_string,std::allocator>”需要有 dll 接口由 class“Teamcenter::POM_application_object”的客户端使用 + 1>Z:\TC_install\jingdiao\c\tclib\include_cpp\tccore/WorkspaceObject.hxx(567): warning C4251: “Teamcenter::WorkspaceObject::name”: class“std::basic_string,std::allocator>”需要有 dll 接口由 class“Teamcenter::WorkspaceObject”的客户端使用 + 1>Z:\TC_install\jingdiao\c\tclib\include_cpp\tccore/ItemRevision.hxx(518): warning C4251: “Teamcenter::ItemRevision::name”: class“std::basic_string,std::allocator>”需要有 dll 接口由 class“Teamcenter::ItemRevision”的客户端使用 + 1>Z:\TC_install\jingdiao\c\tclib\include_cpp\epm/EPMTask.hxx(1086): warning C4251: “Teamcenter::EPMTask::name”: class“std::basic_string,std::allocator>”需要有 dll 接口由 class“Teamcenter::EPMTask”的客户端使用 + 1>Z:\TC_install\ZhengTai\c\GetBOMProp\packages\sqdlog.1.0.0\lib\native\include\spdlog/fmt/bundled/core.h(327): warning C4566: 由通用字符名称“\u00B5”表示的字符不能在当前代码页(936)中表示出来 + 1>Z:\TC_install\jingdiao\c\tclib\include_cpp\tccore/Item.hxx(347): warning C4251: “Teamcenter::Item::name”: class“std::basic_string,std::allocator>”需要有 dll 接口由 class“Teamcenter::Item”的客户端使用 + 1>BOMSendSap.cpp(149): warning C4267: “=”: 从“size_t”转换到“int”,可能丢失数据 + 1>BOMSendSap.cpp(190): warning C4267: “初始化”: 从“size_t”转换到“int”,可能丢失数据 + 1>BOMSendSap.cpp(201): warning C4244: “初始化”: 从“__int64”转换到“int”,可能丢失数据 + 1>BOMSendSap.cpp(233): warning C4267: “初始化”: 从“size_t”转换到“int”,可能丢失数据 + 1>BOMSendSap.cpp(282): warning C4267: “=”: 从“size_t”转换到“int”,可能丢失数据 + 1>BOMSendSap.cpp(316): warning C4267: “=”: 从“size_t”转换到“int”,可能丢失数据 + 1>BOMSendSap.cpp(331): warning C4996: 'AOM_UIF_ask_value': "AOM_UIF_ask_value" deprecated in Teamcenter "11.1"; Use "AOM_ask_displayable_values" instead. + Z:\TC_install\jingdiao\c\tclib\include\tccore/aom_prop.h(833): note: 参见“AOM_UIF_ask_value”的声明 + 1>BOMSendSap.cpp(332): warning C4996: 'AOM_UIF_ask_value': "AOM_UIF_ask_value" deprecated in Teamcenter "11.1"; Use "AOM_ask_displayable_values" instead. + Z:\TC_install\jingdiao\c\tclib\include\tccore/aom_prop.h(833): note: 参见“AOM_UIF_ask_value”的声明 + 1>BOMSendSap.cpp(333): warning C4996: 'AOM_UIF_ask_value': "AOM_UIF_ask_value" deprecated in Teamcenter "11.1"; Use "AOM_ask_displayable_values" instead. + Z:\TC_install\jingdiao\c\tclib\include\tccore/aom_prop.h(833): note: 参见“AOM_UIF_ask_value”的声明 + 1>BOMSendSap.cpp(384): warning C4996: 'WSOM_where_referenced': "WSOM_where_referenced" deprecated in Teamcenter "11.3"; Use "WSOM_where_referenced2" instead. + Z:\TC_install\jingdiao\c\tclib\include\tccore/workspaceobject.h(887): note: 参见“WSOM_where_referenced”的声明 + 1>BOMSendSap.cpp(463): warning C4267: “初始化”: 从“size_t”转换到“int”,可能丢失数据 + 1>BOMSendSap.cpp(552): warning C4267: “初始化”: 从“size_t”转换到“int”,可能丢失数据 + 1>BOMSendSap.cpp(606): warning C4267: “=”: 从“size_t”转换到“int”,可能丢失数据 + 1>BOMSendSap.cpp(580): warning C4996: 'AOM_UIF_ask_value': "AOM_UIF_ask_value" deprecated in Teamcenter "11.1"; Use "AOM_ask_displayable_values" instead. + Z:\TC_install\jingdiao\c\tclib\include\tccore/aom_prop.h(833): note: 参见“AOM_UIF_ask_value”的声明 + 1>BOMSendSap.cpp(581): warning C4996: 'AOM_UIF_ask_value': "AOM_UIF_ask_value" deprecated in Teamcenter "11.1"; Use "AOM_ask_displayable_values" instead. + Z:\TC_install\jingdiao\c\tclib\include\tccore/aom_prop.h(833): note: 参见“AOM_UIF_ask_value”的声明 + 1>BOMSendSap.cpp(582): warning C4996: 'AOM_UIF_ask_value': "AOM_UIF_ask_value" deprecated in Teamcenter "11.1"; Use "AOM_ask_displayable_values" instead. + Z:\TC_install\jingdiao\c\tclib\include\tccore/aom_prop.h(833): note: 参见“AOM_UIF_ask_value”的声明 + 1>BOMSendSap.cpp(583): warning C4996: 'AOM_UIF_ask_value': "AOM_UIF_ask_value" deprecated in Teamcenter "11.1"; Use "AOM_ask_displayable_values" instead. + Z:\TC_install\jingdiao\c\tclib\include\tccore/aom_prop.h(833): note: 参见“AOM_UIF_ask_value”的声明 + 1>BOMSendSap.cpp(584): warning C4996: 'AOM_UIF_ask_value': "AOM_UIF_ask_value" deprecated in Teamcenter "11.1"; Use "AOM_ask_displayable_values" instead. + Z:\TC_install\jingdiao\c\tclib\include\tccore/aom_prop.h(833): note: 参见“AOM_UIF_ask_value”的声明 + 1>BOMSendSap.cpp(585): warning C4996: 'AOM_UIF_ask_value': "AOM_UIF_ask_value" deprecated in Teamcenter "11.1"; Use "AOM_ask_displayable_values" instead. + Z:\TC_install\jingdiao\c\tclib\include\tccore/aom_prop.h(833): note: 参见“AOM_UIF_ask_value”的声明 + 1>BOMSendSap.cpp(708): warning C4267: “=”: 从“size_t”转换到“int”,可能丢失数据 + 1>BOMSendSap.cpp(660): warning C4101: “itemID”: 未引用的局部变量 + 1>BOMSendSap.cpp(963): warning C4267: “初始化”: 从“size_t”转换到“int”,可能丢失数据 + 1>BOMSendSap.cpp(910): warning C4996: 'AOM_UIF_ask_value': "AOM_UIF_ask_value" deprecated in Teamcenter "11.1"; Use "AOM_ask_displayable_values" instead. + Z:\TC_install\jingdiao\c\tclib\include\tccore/aom_prop.h(833): note: 参见“AOM_UIF_ask_value”的声明 + 1>BOMSendSap.cpp(922): warning C4996: 'WSOM_where_referenced': "WSOM_where_referenced" deprecated in Teamcenter "11.3"; Use "WSOM_where_referenced2" instead. + Z:\TC_install\jingdiao\c\tclib\include\tccore/workspaceobject.h(887): note: 参见“WSOM_where_referenced”的声明 + 1>BOMSendSap.cpp(1146): warning C4267: “初始化”: 从“size_t”转换到“int”,可能丢失数据 + 1>BOMSendSap.cpp(1160): warning C4267: “=”: 从“size_t”转换到“int”,可能丢失数据 + 1>BOMSendSap.cpp(1059): warning C4996: 'AOM_UIF_ask_value': "AOM_UIF_ask_value" deprecated in Teamcenter "11.1"; Use "AOM_ask_displayable_values" instead. + Z:\TC_install\jingdiao\c\tclib\include\tccore/aom_prop.h(833): note: 参见“AOM_UIF_ask_value”的声明 + 1>BOMSendSap.cpp(1602): warning C4996: 'WSOM_where_referenced': "WSOM_where_referenced" deprecated in Teamcenter "11.3"; Use "WSOM_where_referenced2" instead. + Z:\TC_install\jingdiao\c\tclib\include\tccore/workspaceobject.h(887): note: 参见“WSOM_where_referenced”的声明 + 1>BOMSendSap.cpp(1623): warning C4996: 'AOM_UIF_ask_value': "AOM_UIF_ask_value" deprecated in Teamcenter "11.1"; Use "AOM_ask_displayable_values" instead. + Z:\TC_install\jingdiao\c\tclib\include\tccore/aom_prop.h(833): note: 参见“AOM_UIF_ask_value”的声明 + 1>BOMSendSap.cpp(1624): warning C4996: 'AOM_UIF_ask_value': "AOM_UIF_ask_value" deprecated in Teamcenter "11.1"; Use "AOM_ask_displayable_values" instead. + Z:\TC_install\jingdiao\c\tclib\include\tccore/aom_prop.h(833): note: 参见“AOM_UIF_ask_value”的声明 + 1>BOMSendSap.cpp(1787): warning C4101: “revUid”: 未引用的局部变量 + 1>BOMSendSap.cpp(1800): warning C4101: “ccp”: 未引用的局部变量 + 1>D:\VS2015\VC\include\exception(361): warning C4577: 'noexcept' used with no exception handling mode specified; termination on exception is not guaranteed. Specify /EHsc + Link: + D:\VS2015\VC\bin\x86_amd64\link.exe /ERRORREPORT:PROMPT /OUT:"Z:\TC_install\ZhengTai\c\GetBOMProp\x64\Release\BOMToSapOpt.exe" /INCREMENTAL:NO /NOLOGO /LIBPATH:Z:\TC_install\ZhengTai\c\sdplog\lib /LIBPATH:Z:\TC_install\jingdiao\c\tclib\lib /LIBPATH:Z:\TC_install\ZhengTai\c\libxl\lib "Z:\TC_install\ZhengTai\c\GetBOMProp\packages\sqdlog.1.0.0\build\..\lib\native\lib\*.lib" "Z:\TC_install\ZhengTai\c\sdplog\lib\*.lib" "Z:\TC_install\jingdiao\c\tclib\lib\*.lib" Z:\TC_install\jingdiao\c\tclib\lib\itk_main.obj "Z:\TC_install\ZhengTai\c\libxl\lib\*.lib" kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /NODEFAULTLIB:libuser_exits.ar.lib /MANIFEST /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /manifest:embed /Debug /PDB:"Z:\TC_install\ZhengTai\c\GetBOMProp\x64\Release\BOMToSapOpt.pdb" /SUBSYSTEM:CONSOLE /HEAP:"30000000","9000000" /STACK:"30000000","9000000" /OPT:REF /OPT:ICF /LTCG:incremental /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:"Z:\TC_install\ZhengTai\c\GetBOMProp\x64\Release\BOMToSapOpt.lib" /MACHINE:X64 x64\Release\ado.obj + x64\Release\AutoFeeding.obj + x64\Release\BOMSendSap.obj + x64\Release\createProcessTmp.obj + x64\Release\CRUL_server_call_httpserver.obj + x64\Release\EBomToPBom.obj + x64\Release\GetBOMProp.obj + x64\Release\ocilib.obj + x64\Release\readBomMsg.obj + x64\Release\soapC.obj + x64\Release\soapSIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy.obj + x64\Release\soapSI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy.obj + x64\Release\soapSI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy.obj + x64\Release\stdsoap2.obj + x64\Release\util.obj + 正在生成代码 + 4 of 7986 functions ( 0.1%) were compiled, the rest were copied from previous compilation. + 0 functions were new in current compilation + 2 functions had inline decision re-evaluated but remain unchanged + 已完成代码的生成 + 1>itk_main.obj : warning LNK4099: 未找到 PDB“vc160.pdb”(使用“itk_main.obj”或在“Z:\TC_install\ZhengTai\c\GetBOMProp\x64\Release\vc160.pdb”中寻找);正在链接对象,如同没有调试信息一样 + DFL_BOM_WL_TOERP.vcxproj -> Z:\TC_install\ZhengTai\c\GetBOMProp\x64\Release\BOMToSapOpt.exe + 1>已完成生成项目“Z:\TC_install\ZhengTai\c\GetBOMProp\DFL_BOM_WL_TOERP\DFL_BOM_WL_TOERP.vcxproj”(Build 个目标)的操作。 + +已成功生成。 + +已用时间 00:00:12.84 diff --git a/DFL_BOM_WL_TOERP/x64/Release/DFL_BOM_WL_TOERP.tlog/CL.command.1.tlog b/DFL_BOM_WL_TOERP/x64/Release/DFL_BOM_WL_TOERP.tlog/CL.command.1.tlog new file mode 100644 index 0000000..7f4df9a Binary files /dev/null and b/DFL_BOM_WL_TOERP/x64/Release/DFL_BOM_WL_TOERP.tlog/CL.command.1.tlog differ diff --git a/DFL_BOM_WL_TOERP/x64/Release/DFL_BOM_WL_TOERP.tlog/CL.read.1.tlog b/DFL_BOM_WL_TOERP/x64/Release/DFL_BOM_WL_TOERP.tlog/CL.read.1.tlog new file mode 100644 index 0000000..0ac1c21 Binary files /dev/null and b/DFL_BOM_WL_TOERP/x64/Release/DFL_BOM_WL_TOERP.tlog/CL.read.1.tlog differ diff --git a/DFL_BOM_WL_TOERP/x64/Release/DFL_BOM_WL_TOERP.tlog/CL.write.1.tlog b/DFL_BOM_WL_TOERP/x64/Release/DFL_BOM_WL_TOERP.tlog/CL.write.1.tlog new file mode 100644 index 0000000..9a724ea Binary files /dev/null and b/DFL_BOM_WL_TOERP/x64/Release/DFL_BOM_WL_TOERP.tlog/CL.write.1.tlog differ diff --git a/DFL_BOM_WL_TOERP/x64/Release/DFL_BOM_WL_TOERP.tlog/DFL_BOM_WL_TOERP.lastbuildstate b/DFL_BOM_WL_TOERP/x64/Release/DFL_BOM_WL_TOERP.tlog/DFL_BOM_WL_TOERP.lastbuildstate new file mode 100644 index 0000000..dc716e5 --- /dev/null +++ b/DFL_BOM_WL_TOERP/x64/Release/DFL_BOM_WL_TOERP.tlog/DFL_BOM_WL_TOERP.lastbuildstate @@ -0,0 +1,2 @@ +PlatformToolSet=v142:VCToolArchitecture=Native32Bit:VCToolsVersion=14.29.30133:TargetPlatformVersion=10.0.19041.0: +Release|x64|D:\美菱\out\PLM开发\ITK\BOM数据读取优化\DFL_BOM_WL_TOERP\| diff --git a/DFL_BOM_WL_TOERP/x64/Release/DFL_BOM_WL_TOERP.tlog/link.command.1.tlog b/DFL_BOM_WL_TOERP/x64/Release/DFL_BOM_WL_TOERP.tlog/link.command.1.tlog new file mode 100644 index 0000000..8362b1f Binary files /dev/null and b/DFL_BOM_WL_TOERP/x64/Release/DFL_BOM_WL_TOERP.tlog/link.command.1.tlog differ diff --git a/DFL_BOM_WL_TOERP/x64/Release/DFL_BOM_WL_TOERP.tlog/link.read.1.tlog b/DFL_BOM_WL_TOERP/x64/Release/DFL_BOM_WL_TOERP.tlog/link.read.1.tlog new file mode 100644 index 0000000..9917392 Binary files /dev/null and b/DFL_BOM_WL_TOERP/x64/Release/DFL_BOM_WL_TOERP.tlog/link.read.1.tlog differ diff --git a/DFL_BOM_WL_TOERP/x64/Release/DFL_BOM_WL_TOERP.tlog/link.write.1.tlog b/DFL_BOM_WL_TOERP/x64/Release/DFL_BOM_WL_TOERP.tlog/link.write.1.tlog new file mode 100644 index 0000000..70fddb1 Binary files /dev/null and b/DFL_BOM_WL_TOERP/x64/Release/DFL_BOM_WL_TOERP.tlog/link.write.1.tlog differ diff --git a/DFL_BOM_WL_TOERP/x64/Release/DFL_BOM_WL_TOERP1.Build.CppClean.log b/DFL_BOM_WL_TOERP/x64/Release/DFL_BOM_WL_TOERP1.Build.CppClean.log new file mode 100644 index 0000000..da54399 --- /dev/null +++ b/DFL_BOM_WL_TOERP/x64/Release/DFL_BOM_WL_TOERP1.Build.CppClean.log @@ -0,0 +1,14 @@ +d:\code\dfl_bom_wl_toerp\dfl_bom_wl_toerp\x64\release\vc141.pdb +d:\code\dfl_bom_wl_toerp\dfl_bom_wl_toerp\x64\release\ocilib.obj +d:\code\dfl_bom_wl_toerp\dfl_bom_wl_toerp\x64\release\dfl_bom_wl_toerp.obj +d:\code\dfl_bom_wl_toerp\x64\release\dfl_bom_wl_toerp1.ipdb +d:\code\dfl_bom_wl_toerp\x64\release\dfl_bom_wl_toerp1.iobj +d:\code\dfl_bom_wl_toerp\x64\release\dfl_bom_wl_toerp1.exe +d:\code\dfl_bom_wl_toerp\x64\release\dfl_bom_wl_toerp1.pdb +d:\code\dfl_bom_wl_toerp\dfl_bom_wl_toerp\x64\release\dfl_bom_.c1c26324.tlog\cl.command.1.tlog +d:\code\dfl_bom_wl_toerp\dfl_bom_wl_toerp\x64\release\dfl_bom_.c1c26324.tlog\cl.read.1.tlog +d:\code\dfl_bom_wl_toerp\dfl_bom_wl_toerp\x64\release\dfl_bom_.c1c26324.tlog\cl.write.1.tlog +d:\code\dfl_bom_wl_toerp\dfl_bom_wl_toerp\x64\release\dfl_bom_.c1c26324.tlog\dfl_bom_wl_toerp1.write.1u.tlog +d:\code\dfl_bom_wl_toerp\dfl_bom_wl_toerp\x64\release\dfl_bom_.c1c26324.tlog\link.command.1.tlog +d:\code\dfl_bom_wl_toerp\dfl_bom_wl_toerp\x64\release\dfl_bom_.c1c26324.tlog\link.read.1.tlog +d:\code\dfl_bom_wl_toerp\dfl_bom_wl_toerp\x64\release\dfl_bom_.c1c26324.tlog\link.write.1.tlog diff --git a/DFL_BOM_WL_TOERP/x64/Release/EBomToPBom.obj b/DFL_BOM_WL_TOERP/x64/Release/EBomToPBom.obj new file mode 100644 index 0000000..1ec5bc5 Binary files /dev/null and b/DFL_BOM_WL_TOERP/x64/Release/EBomToPBom.obj differ diff --git a/DFL_BOM_WL_TOERP/x64/Release/GetBOMProp.Build.CppClean.log b/DFL_BOM_WL_TOERP/x64/Release/GetBOMProp.Build.CppClean.log new file mode 100644 index 0000000..2eea380 --- /dev/null +++ b/DFL_BOM_WL_TOERP/x64/Release/GetBOMProp.Build.CppClean.log @@ -0,0 +1,15 @@ +d:\正泰\正泰整理\bom数据读取优化\bom数据读取优化\getbomprop\dfl_bom_wl_toerp\x64\release\vc142.pdb +d:\正泰\正泰整理\bom数据读取优化\bom数据读取优化\getbomprop\dfl_bom_wl_toerp\x64\release\getbomprop.obj +d:\正泰\正泰整理\bom数据读取优化\bom数据读取优化\getbomprop\dfl_bom_wl_toerp\x64\release\ado.obj +d:\正泰\正泰整理\bom数据读取优化\bom数据读取优化\getbomprop\x64\release\getbomprop.exe +d:\正泰\正泰整理\bom数据读取优化\bom数据读取优化\getbomprop\dfl_bom_wl_toerp\x64\release\getbomprop.ipdb +d:\正泰\正泰整理\bom数据读取优化\bom数据读取优化\getbomprop\dfl_bom_wl_toerp\x64\release\getbomprop.iobj +d:\正泰\正泰整理\bom数据读取优化\bom数据读取优化\getbomprop\x64\release\getbomprop.pdb +d:\正泰\正泰整理\bom数据读取优化\bom数据读取优化\getbomprop\dfl_bom_wl_toerp\x64\release\msado15.tli +d:\正泰\正泰整理\bom数据读取优化\bom数据读取优化\getbomprop\dfl_bom_wl_toerp\x64\release\msado15.tlh +d:\正泰\正泰整理\bom数据读取优化\bom数据读取优化\getbomprop\dfl_bom_wl_toerp\x64\release\getbomprop.tlog\cl.command.1.tlog +d:\正泰\正泰整理\bom数据读取优化\bom数据读取优化\getbomprop\dfl_bom_wl_toerp\x64\release\getbomprop.tlog\cl.read.1.tlog +d:\正泰\正泰整理\bom数据读取优化\bom数据读取优化\getbomprop\dfl_bom_wl_toerp\x64\release\getbomprop.tlog\cl.write.1.tlog +d:\正泰\正泰整理\bom数据读取优化\bom数据读取优化\getbomprop\dfl_bom_wl_toerp\x64\release\getbomprop.tlog\link.command.1.tlog +d:\正泰\正泰整理\bom数据读取优化\bom数据读取优化\getbomprop\dfl_bom_wl_toerp\x64\release\getbomprop.tlog\link.read.1.tlog +d:\正泰\正泰整理\bom数据读取优化\bom数据读取优化\getbomprop\dfl_bom_wl_toerp\x64\release\getbomprop.tlog\link.write.1.tlog diff --git a/DFL_BOM_WL_TOERP/x64/Release/GetBOMProp.exe.recipe b/DFL_BOM_WL_TOERP/x64/Release/GetBOMProp.exe.recipe new file mode 100644 index 0000000..4b2ec86 --- /dev/null +++ b/DFL_BOM_WL_TOERP/x64/Release/GetBOMProp.exe.recipe @@ -0,0 +1,11 @@ + + + + + D:\正泰\正泰整理\BOM数据读取优化\BOM数据读取优化\GetBOMProp\x64\Release\GetBOMProp.exe + + + + + + \ No newline at end of file diff --git a/DFL_BOM_WL_TOERP/x64/Release/GetBOMProp.obj b/DFL_BOM_WL_TOERP/x64/Release/GetBOMProp.obj new file mode 100644 index 0000000..a0431a0 Binary files /dev/null and b/DFL_BOM_WL_TOERP/x64/Release/GetBOMProp.obj differ diff --git a/DFL_BOM_WL_TOERP/x64/Release/GetBOMProp.tlog/CL.command.1.tlog b/DFL_BOM_WL_TOERP/x64/Release/GetBOMProp.tlog/CL.command.1.tlog new file mode 100644 index 0000000..cd69205 Binary files /dev/null and b/DFL_BOM_WL_TOERP/x64/Release/GetBOMProp.tlog/CL.command.1.tlog differ diff --git a/DFL_BOM_WL_TOERP/x64/Release/GetBOMProp.tlog/CL.read.1.tlog b/DFL_BOM_WL_TOERP/x64/Release/GetBOMProp.tlog/CL.read.1.tlog new file mode 100644 index 0000000..b9e8397 Binary files /dev/null and b/DFL_BOM_WL_TOERP/x64/Release/GetBOMProp.tlog/CL.read.1.tlog differ diff --git a/DFL_BOM_WL_TOERP/x64/Release/GetBOMProp.tlog/CL.write.1.tlog b/DFL_BOM_WL_TOERP/x64/Release/GetBOMProp.tlog/CL.write.1.tlog new file mode 100644 index 0000000..3b5d495 Binary files /dev/null and b/DFL_BOM_WL_TOERP/x64/Release/GetBOMProp.tlog/CL.write.1.tlog differ diff --git a/DFL_BOM_WL_TOERP/x64/Release/GetBOMProp.tlog/GetBOMProp.lastbuildstate b/DFL_BOM_WL_TOERP/x64/Release/GetBOMProp.tlog/GetBOMProp.lastbuildstate new file mode 100644 index 0000000..18ac249 --- /dev/null +++ b/DFL_BOM_WL_TOERP/x64/Release/GetBOMProp.tlog/GetBOMProp.lastbuildstate @@ -0,0 +1,2 @@ +PlatformToolSet=v142:VCToolArchitecture=Native32Bit:VCToolsVersion=14.29.30133:VCServicingVersionMFC=14.29.30136:TargetPlatformVersion=10.0.19041.0: +Release|x64|D:\正泰\正泰整理\BOM数据读取优化\BOM数据读取优化\GetBOMProp\| diff --git a/DFL_BOM_WL_TOERP/x64/Release/GetBOMProp.tlog/link.command.1.tlog b/DFL_BOM_WL_TOERP/x64/Release/GetBOMProp.tlog/link.command.1.tlog new file mode 100644 index 0000000..f0a2a55 Binary files /dev/null and b/DFL_BOM_WL_TOERP/x64/Release/GetBOMProp.tlog/link.command.1.tlog differ diff --git a/DFL_BOM_WL_TOERP/x64/Release/GetBOMProp.tlog/link.read.1.tlog b/DFL_BOM_WL_TOERP/x64/Release/GetBOMProp.tlog/link.read.1.tlog new file mode 100644 index 0000000..25e86de Binary files /dev/null and b/DFL_BOM_WL_TOERP/x64/Release/GetBOMProp.tlog/link.read.1.tlog differ diff --git a/DFL_BOM_WL_TOERP/x64/Release/GetBOMProp.tlog/link.write.1.tlog b/DFL_BOM_WL_TOERP/x64/Release/GetBOMProp.tlog/link.write.1.tlog new file mode 100644 index 0000000..d6a75f4 Binary files /dev/null and b/DFL_BOM_WL_TOERP/x64/Release/GetBOMProp.tlog/link.write.1.tlog differ diff --git a/DFL_BOM_WL_TOERP/x64/Release/GetBOMProp2.Build.CppClean.log b/DFL_BOM_WL_TOERP/x64/Release/GetBOMProp2.Build.CppClean.log new file mode 100644 index 0000000..dd74a75 --- /dev/null +++ b/DFL_BOM_WL_TOERP/x64/Release/GetBOMProp2.Build.CppClean.log @@ -0,0 +1,27 @@ +d:\正泰\正泰整理\bom数据读取优化\bom数据读取优化\getbomprop\dfl_bom_wl_toerp\x64\release\vc142.pdb +d:\正泰\正泰整理\bom数据读取优化\bom数据读取优化\getbomprop\dfl_bom_wl_toerp\x64\release\stdsoap2.obj +d:\正泰\正泰整理\bom数据读取优化\bom数据读取优化\getbomprop\dfl_bom_wl_toerp\x64\release\soapsi_uscoreprocessroute_uscoreplm_uscoreout_uscoresynbindingproxy.obj +d:\正泰\正泰整理\bom数据读取优化\bom数据读取优化\getbomprop\dfl_bom_wl_toerp\x64\release\soapsi_uscorefactory_uscorenumber_uscoreplm_uscoreout_uscoresynbindingproxy.obj +d:\正泰\正泰整理\bom数据读取优化\bom数据读取优化\getbomprop\dfl_bom_wl_toerp\x64\release\soapsi_uscorebom_uscoreplm_uscoreout_uscoresynbindingproxy.obj +d:\正泰\正泰整理\bom数据读取优化\bom数据读取优化\getbomprop\dfl_bom_wl_toerp\x64\release\soapc.obj +d:\正泰\正泰整理\bom数据读取优化\bom数据读取优化\getbomprop\dfl_bom_wl_toerp\x64\release\readbommsg.obj +d:\正泰\正泰整理\bom数据读取优化\bom数据读取优化\getbomprop\dfl_bom_wl_toerp\x64\release\ocilib.obj +d:\正泰\正泰整理\bom数据读取优化\bom数据读取优化\getbomprop\dfl_bom_wl_toerp\x64\release\mysql.obj +d:\正泰\正泰整理\bom数据读取优化\bom数据读取优化\getbomprop\dfl_bom_wl_toerp\x64\release\getbomprop.obj +d:\正泰\正泰整理\bom数据读取优化\bom数据读取优化\getbomprop\dfl_bom_wl_toerp\x64\release\ebomtopbom.obj +d:\正泰\正泰整理\bom数据读取优化\bom数据读取优化\getbomprop\dfl_bom_wl_toerp\x64\release\crul_server_call_httpserver.obj +d:\正泰\正泰整理\bom数据读取优化\bom数据读取优化\getbomprop\dfl_bom_wl_toerp\x64\release\createprocesstmp.obj +d:\正泰\正泰整理\bom数据读取优化\bom数据读取优化\getbomprop\dfl_bom_wl_toerp\x64\release\autofeeding.obj +d:\正泰\正泰整理\bom数据读取优化\bom数据读取优化\getbomprop\dfl_bom_wl_toerp\x64\release\ado.obj +d:\正泰\正泰整理\bom数据读取优化\bom数据读取优化\getbomprop\x64\release\getbomprop2.exe +d:\正泰\正泰整理\bom数据读取优化\bom数据读取优化\getbomprop\dfl_bom_wl_toerp\x64\release\getbomprop2.ipdb +d:\正泰\正泰整理\bom数据读取优化\bom数据读取优化\getbomprop\dfl_bom_wl_toerp\x64\release\getbomprop2.iobj +d:\正泰\正泰整理\bom数据读取优化\bom数据读取优化\getbomprop\x64\release\getbomprop2.pdb +d:\正泰\正泰整理\bom数据读取优化\bom数据读取优化\getbomprop\dfl_bom_wl_toerp\x64\release\msado15.tli +d:\正泰\正泰整理\bom数据读取优化\bom数据读取优化\getbomprop\dfl_bom_wl_toerp\x64\release\msado15.tlh +d:\正泰\正泰整理\bom数据读取优化\bom数据读取优化\getbomprop\dfl_bom_wl_toerp\x64\release\getbomprop2.tlog\cl.command.1.tlog +d:\正泰\正泰整理\bom数据读取优化\bom数据读取优化\getbomprop\dfl_bom_wl_toerp\x64\release\getbomprop2.tlog\cl.read.1.tlog +d:\正泰\正泰整理\bom数据读取优化\bom数据读取优化\getbomprop\dfl_bom_wl_toerp\x64\release\getbomprop2.tlog\cl.write.1.tlog +d:\正泰\正泰整理\bom数据读取优化\bom数据读取优化\getbomprop\dfl_bom_wl_toerp\x64\release\getbomprop2.tlog\link.command.1.tlog +d:\正泰\正泰整理\bom数据读取优化\bom数据读取优化\getbomprop\dfl_bom_wl_toerp\x64\release\getbomprop2.tlog\link.read.1.tlog +d:\正泰\正泰整理\bom数据读取优化\bom数据读取优化\getbomprop\dfl_bom_wl_toerp\x64\release\getbomprop2.tlog\link.write.1.tlog diff --git a/DFL_BOM_WL_TOERP/x64/Release/GetBOMProp2.exe.recipe b/DFL_BOM_WL_TOERP/x64/Release/GetBOMProp2.exe.recipe new file mode 100644 index 0000000..44ec9c3 --- /dev/null +++ b/DFL_BOM_WL_TOERP/x64/Release/GetBOMProp2.exe.recipe @@ -0,0 +1,11 @@ + + + + + D:\正泰\正泰整理\BOM数据读取优化\BOM数据读取优化\GetBOMProp\x64\Release\GetBOMProp2.exe + + + + + + \ No newline at end of file diff --git a/DFL_BOM_WL_TOERP/x64/Release/GetBOMProp2.tlog/CL.command.1.tlog b/DFL_BOM_WL_TOERP/x64/Release/GetBOMProp2.tlog/CL.command.1.tlog new file mode 100644 index 0000000..a2f949b Binary files /dev/null and b/DFL_BOM_WL_TOERP/x64/Release/GetBOMProp2.tlog/CL.command.1.tlog differ diff --git a/DFL_BOM_WL_TOERP/x64/Release/GetBOMProp2.tlog/CL.read.1.tlog b/DFL_BOM_WL_TOERP/x64/Release/GetBOMProp2.tlog/CL.read.1.tlog new file mode 100644 index 0000000..d015ed9 Binary files /dev/null and b/DFL_BOM_WL_TOERP/x64/Release/GetBOMProp2.tlog/CL.read.1.tlog differ diff --git a/DFL_BOM_WL_TOERP/x64/Release/GetBOMProp2.tlog/CL.write.1.tlog b/DFL_BOM_WL_TOERP/x64/Release/GetBOMProp2.tlog/CL.write.1.tlog new file mode 100644 index 0000000..1b93216 Binary files /dev/null and b/DFL_BOM_WL_TOERP/x64/Release/GetBOMProp2.tlog/CL.write.1.tlog differ diff --git a/DFL_BOM_WL_TOERP/x64/Release/GetBOMProp2.tlog/GetBOMProp2.lastbuildstate b/DFL_BOM_WL_TOERP/x64/Release/GetBOMProp2.tlog/GetBOMProp2.lastbuildstate new file mode 100644 index 0000000..18ac249 --- /dev/null +++ b/DFL_BOM_WL_TOERP/x64/Release/GetBOMProp2.tlog/GetBOMProp2.lastbuildstate @@ -0,0 +1,2 @@ +PlatformToolSet=v142:VCToolArchitecture=Native32Bit:VCToolsVersion=14.29.30133:VCServicingVersionMFC=14.29.30136:TargetPlatformVersion=10.0.19041.0: +Release|x64|D:\正泰\正泰整理\BOM数据读取优化\BOM数据读取优化\GetBOMProp\| diff --git a/DFL_BOM_WL_TOERP/x64/Release/GetBOMProp2.tlog/link.command.1.tlog b/DFL_BOM_WL_TOERP/x64/Release/GetBOMProp2.tlog/link.command.1.tlog new file mode 100644 index 0000000..8acd21f Binary files /dev/null and b/DFL_BOM_WL_TOERP/x64/Release/GetBOMProp2.tlog/link.command.1.tlog differ diff --git a/DFL_BOM_WL_TOERP/x64/Release/GetBOMProp2.tlog/link.read.1.tlog b/DFL_BOM_WL_TOERP/x64/Release/GetBOMProp2.tlog/link.read.1.tlog new file mode 100644 index 0000000..2086ea6 Binary files /dev/null and b/DFL_BOM_WL_TOERP/x64/Release/GetBOMProp2.tlog/link.read.1.tlog differ diff --git a/DFL_BOM_WL_TOERP/x64/Release/GetBOMProp2.tlog/link.write.1.tlog b/DFL_BOM_WL_TOERP/x64/Release/GetBOMProp2.tlog/link.write.1.tlog new file mode 100644 index 0000000..7a3b91c Binary files /dev/null and b/DFL_BOM_WL_TOERP/x64/Release/GetBOMProp2.tlog/link.write.1.tlog differ diff --git a/DFL_BOM_WL_TOERP/x64/Release/GetBomMessage.Build.CppClean.log b/DFL_BOM_WL_TOERP/x64/Release/GetBomMessage.Build.CppClean.log new file mode 100644 index 0000000..f710d9b --- /dev/null +++ b/DFL_BOM_WL_TOERP/x64/Release/GetBomMessage.Build.CppClean.log @@ -0,0 +1,7 @@ +d:\美菱\out\plm开发\java\itk\bom数据读取优化\getbommessage\dfl_bom_wl_toerp\x64\release\ado.obj +d:\美菱\out\plm开发\java\itk\bom数据读取优化\getbommessage\dfl_bom_wl_toerp\x64\release\dfl_bom_wl_toerp.obj +d:\美菱\out\plm开发\java\itk\bom数据读取优化\getbommessage\dfl_bom_wl_toerp\x64\release\dfl_bom_wl_toerp.ipdb +d:\美菱\out\plm开发\java\itk\bom数据读取优化\getbommessage\dfl_bom_wl_toerp\x64\release\dfl_bom_wl_toerp.iobj +d:\美菱\out\plm开发\java\itk\bom数据读取优化\getbommessage\dfl_bom_wl_toerp\x64\release\msado15.tli +d:\美菱\out\plm开发\java\itk\bom数据读取优化\getbommessage\dfl_bom_wl_toerp\x64\release\msado15.tlh +d:\美菱\out\plm开发\java\itk\bom数据读取优化\getbommessage\dfl_bom_wl_toerp\x64\release\vc142.pdb diff --git a/DFL_BOM_WL_TOERP/x64/Release/GetBomMessage.exe.recipe b/DFL_BOM_WL_TOERP/x64/Release/GetBomMessage.exe.recipe new file mode 100644 index 0000000..e986ac5 --- /dev/null +++ b/DFL_BOM_WL_TOERP/x64/Release/GetBomMessage.exe.recipe @@ -0,0 +1,11 @@ + + + + + D:\美菱\out\PLM开发\JAVA\ITK\BOM数据读取优化\GetBomMessage\x64\Release\GetBomMessage.exe + + + + + + \ No newline at end of file diff --git a/DFL_BOM_WL_TOERP/x64/Release/GetBomMessage.tlog/CL.command.1.tlog b/DFL_BOM_WL_TOERP/x64/Release/GetBomMessage.tlog/CL.command.1.tlog new file mode 100644 index 0000000..cf6b2a8 Binary files /dev/null and b/DFL_BOM_WL_TOERP/x64/Release/GetBomMessage.tlog/CL.command.1.tlog differ diff --git a/DFL_BOM_WL_TOERP/x64/Release/GetBomMessage.tlog/CL.read.1.tlog b/DFL_BOM_WL_TOERP/x64/Release/GetBomMessage.tlog/CL.read.1.tlog new file mode 100644 index 0000000..f17a680 Binary files /dev/null and b/DFL_BOM_WL_TOERP/x64/Release/GetBomMessage.tlog/CL.read.1.tlog differ diff --git a/DFL_BOM_WL_TOERP/x64/Release/GetBomMessage.tlog/CL.write.1.tlog b/DFL_BOM_WL_TOERP/x64/Release/GetBomMessage.tlog/CL.write.1.tlog new file mode 100644 index 0000000..3f38533 Binary files /dev/null and b/DFL_BOM_WL_TOERP/x64/Release/GetBomMessage.tlog/CL.write.1.tlog differ diff --git a/DFL_BOM_WL_TOERP/x64/Release/GetBomMessage.tlog/GetBomMessage.lastbuildstate b/DFL_BOM_WL_TOERP/x64/Release/GetBomMessage.tlog/GetBomMessage.lastbuildstate new file mode 100644 index 0000000..4ec3189 --- /dev/null +++ b/DFL_BOM_WL_TOERP/x64/Release/GetBomMessage.tlog/GetBomMessage.lastbuildstate @@ -0,0 +1,2 @@ +PlatformToolSet=v142:VCToolArchitecture=Native32Bit:VCToolsVersion=14.29.30133:VCServicingVersionMFC=14.29.30136:TargetPlatformVersion=10.0.19041.0: +Release|x64|D:\美菱\out\PLM开发\JAVA\ITK\BOM数据读取优化\GetBomMessage\| diff --git a/DFL_BOM_WL_TOERP/x64/Release/GetBomMessage.tlog/link.command.1.tlog b/DFL_BOM_WL_TOERP/x64/Release/GetBomMessage.tlog/link.command.1.tlog new file mode 100644 index 0000000..8d35ca8 Binary files /dev/null and b/DFL_BOM_WL_TOERP/x64/Release/GetBomMessage.tlog/link.command.1.tlog differ diff --git a/DFL_BOM_WL_TOERP/x64/Release/GetBomMessage.tlog/link.read.1.tlog b/DFL_BOM_WL_TOERP/x64/Release/GetBomMessage.tlog/link.read.1.tlog new file mode 100644 index 0000000..4a00172 Binary files /dev/null and b/DFL_BOM_WL_TOERP/x64/Release/GetBomMessage.tlog/link.read.1.tlog differ diff --git a/DFL_BOM_WL_TOERP/x64/Release/GetBomMessage.tlog/link.write.1.tlog b/DFL_BOM_WL_TOERP/x64/Release/GetBomMessage.tlog/link.write.1.tlog new file mode 100644 index 0000000..e66d0ff Binary files /dev/null and b/DFL_BOM_WL_TOERP/x64/Release/GetBomMessage.tlog/link.write.1.tlog differ diff --git a/DFL_BOM_WL_TOERP/x64/Release/ado.obj b/DFL_BOM_WL_TOERP/x64/Release/ado.obj new file mode 100644 index 0000000..c765dab Binary files /dev/null and b/DFL_BOM_WL_TOERP/x64/Release/ado.obj differ diff --git a/DFL_BOM_WL_TOERP/x64/Release/createProcessTmp.obj b/DFL_BOM_WL_TOERP/x64/Release/createProcessTmp.obj new file mode 100644 index 0000000..88b87d8 Binary files /dev/null and b/DFL_BOM_WL_TOERP/x64/Release/createProcessTmp.obj differ diff --git a/DFL_BOM_WL_TOERP/x64/Release/msado15.tlh b/DFL_BOM_WL_TOERP/x64/Release/msado15.tlh new file mode 100644 index 0000000..0f61174 --- /dev/null +++ b/DFL_BOM_WL_TOERP/x64/Release/msado15.tlh @@ -0,0 +1,5027 @@ +// Created by Microsoft (R) C/C++ Compiler Version 14.00.23026.0 (12cf8bfa). +// +// z:\tc_install\zhengtai\c\getbomprop\dfl_bom_wl_toerp\x64\release\msado15.tlh +// +// C++ source equivalent of type library c:\program files\common files\system\ado\msado15.dll +// compiler-generated file created 03/08/24 at 10:11:29 - DO NOT EDIT! + +#pragma once +#pragma pack(push, 8) + +#include + +// +// Forward references and typedefs +// + +struct __declspec(uuid("b691e011-1797-432e-907a-4d8c69339129")) +/* LIBID */ __ADODB; +enum CursorTypeEnum; +enum CursorOptionEnum; +enum LockTypeEnum; +enum ExecuteOptionEnum; +enum ConnectOptionEnum; +enum ObjectStateEnum; +enum CursorLocationEnum; +enum DataTypeEnum; +enum FieldAttributeEnum; +enum EditModeEnum; +enum RecordStatusEnum; +enum GetRowsOptionEnum; +enum PositionEnum; +enum BookmarkEnum; +enum MarshalOptionsEnum; +enum AffectEnum; +enum ResyncEnum; +enum CompareEnum; +enum FilterGroupEnum; +enum SearchDirectionEnum; +enum PersistFormatEnum; +enum StringFormatEnum; +enum ConnectPromptEnum; +enum ConnectModeEnum; +enum RecordCreateOptionsEnum; +enum RecordOpenOptionsEnum; +enum IsolationLevelEnum; +enum XactAttributeEnum; +enum PropertyAttributesEnum; +enum ErrorValueEnum; +enum ParameterAttributesEnum; +enum ParameterDirectionEnum; +enum CommandTypeEnum; +enum EventStatusEnum; +enum EventReasonEnum; +enum SchemaEnum; +enum FieldStatusEnum; +enum SeekEnum; +enum ADCPROP_UPDATECRITERIA_ENUM; +enum ADCPROP_ASYNCTHREADPRIORITY_ENUM; +enum ADCPROP_AUTORECALC_ENUM; +enum ADCPROP_UPDATERESYNC_ENUM; +enum MoveRecordOptionsEnum; +enum CopyRecordOptionsEnum; +enum StreamTypeEnum; +enum LineSeparatorEnum; +enum StreamOpenOptionsEnum; +enum StreamWriteEnum; +enum SaveOptionsEnum; +enum FieldEnum; +enum StreamReadEnum; +enum RecordTypeEnum; +struct __declspec(uuid("00000512-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ _Collection; +struct __declspec(uuid("00000513-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ _DynaCollection; +struct __declspec(uuid("00000534-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ _ADO; +struct __declspec(uuid("00000504-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ Properties; +struct __declspec(uuid("00000503-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ Property; +struct __declspec(uuid("00000500-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ Error; +struct __declspec(uuid("00000501-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ Errors; +struct __declspec(uuid("00001508-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ Command15; +struct __declspec(uuid("00001550-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ _Connection; +struct __declspec(uuid("00001515-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ Connection15; +struct __declspec(uuid("00001556-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ _Recordset; +struct __declspec(uuid("00001555-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ Recordset21; +struct __declspec(uuid("0000154f-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ Recordset20; +struct __declspec(uuid("0000150e-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ Recordset15; +struct __declspec(uuid("00001564-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ Fields; +struct __declspec(uuid("0000154d-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ Fields20; +struct __declspec(uuid("00001506-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ Fields15; +struct __declspec(uuid("00001569-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ Field; +struct __declspec(uuid("0000154c-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ Field20; +struct __declspec(uuid("0000150c-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ _Parameter; +struct __declspec(uuid("0000150d-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ Parameters; +struct __declspec(uuid("0000154e-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ Command25; +struct __declspec(uuid("986761e8-7269-4890-aa65-ad7c03697a6d")) +/* dual interface */ _Command; +struct __declspec(uuid("00001402-0000-0010-8000-00aa006d2ea4")) +/* interface */ ConnectionEventsVt; +struct __declspec(uuid("00001403-0000-0010-8000-00aa006d2ea4")) +/* interface */ RecordsetEventsVt; +struct __declspec(uuid("00001400-0000-0010-8000-00aa006d2ea4")) +/* dispinterface */ ConnectionEvents; +struct __declspec(uuid("00001266-0000-0010-8000-00aa006d2ea4")) +/* dispinterface */ RecordsetEvents; +struct __declspec(uuid("00000516-0000-0010-8000-00aa006d2ea4")) +/* interface */ ADOConnectionConstruction15; +struct __declspec(uuid("00000551-0000-0010-8000-00aa006d2ea4")) +/* interface */ ADOConnectionConstruction; +struct /* coclass */ Connection; +struct __declspec(uuid("00001562-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ _Record; +struct /* coclass */ Record; +struct __declspec(uuid("00001565-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ _Stream; +struct /* coclass */ Stream; +struct __declspec(uuid("00000567-0000-0010-8000-00aa006d2ea4")) +/* interface */ ADORecordConstruction; +struct __declspec(uuid("00000568-0000-0010-8000-00aa006d2ea4")) +/* interface */ ADOStreamConstruction; +struct __declspec(uuid("00000517-0000-0010-8000-00aa006d2ea4")) +/* interface */ ADOCommandConstruction; +struct /* coclass */ Command; +struct /* coclass */ Recordset; +struct __declspec(uuid("00000283-0000-0010-8000-00aa006d2ea4")) +/* interface */ ADORecordsetConstruction; +struct __declspec(uuid("00001505-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ Field15; +struct /* coclass */ Parameter; +struct __declspec(uuid("00000402-0000-0010-8000-00aa006d2ea4")) +/* interface */ ConnectionEventsVt_Deprecated; +struct __declspec(uuid("00000550-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ _Connection_Deprecated; +struct __declspec(uuid("00000515-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ Connection15_Deprecated; +struct __declspec(uuid("00000556-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ _Recordset_Deprecated; +struct __declspec(uuid("00000555-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ Recordset21_Deprecated; +struct __declspec(uuid("0000054f-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ Recordset20_Deprecated; +struct __declspec(uuid("0000050e-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ Recordset15_Deprecated; +struct __declspec(uuid("00000564-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ Fields_Deprecated; +struct __declspec(uuid("0000054d-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ Fields20_Deprecated; +struct __declspec(uuid("00000506-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ Fields15_Deprecated; +struct __declspec(uuid("00000569-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ Field_Deprecated; +struct __declspec(uuid("0000054c-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ Field20_Deprecated; +struct __declspec(uuid("b08400bd-f9d1-4d02-b856-71d5dba123e9")) +/* dual interface */ _Command_Deprecated; +struct __declspec(uuid("0000054e-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ Command25_Deprecated; +struct __declspec(uuid("00000508-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ Command15_Deprecated; +struct __declspec(uuid("0000050c-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ _Parameter_Deprecated; +struct __declspec(uuid("0000050d-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ Parameters_Deprecated; +struct __declspec(uuid("00000403-0000-0010-8000-00aa006d2ea4")) +/* interface */ RecordsetEventsVt_Deprecated; +struct __declspec(uuid("00000400-0000-0010-8000-00aa006d2ea4")) +/* dispinterface */ ConnectionEvents_Deprecated; +struct __declspec(uuid("00000266-0000-0010-8000-00aa006d2ea4")) +/* dispinterface */ RecordsetEvents_Deprecated; +struct __declspec(uuid("00000562-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ _Record_Deprecated; +struct __declspec(uuid("00000565-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ _Stream_Deprecated; +struct __declspec(uuid("00000505-0000-0010-8000-00aa006d2ea4")) +/* dual interface */ Field15_Deprecated; +typedef __int64 PositionEnum_Param; +typedef enum SearchDirectionEnum SearchDirection; +typedef __int64 ADO_LONGPTR; + +// +// Smart pointer typedef declarations +// + +_COM_SMARTPTR_TYPEDEF(_Collection, __uuidof(_Collection)); +_COM_SMARTPTR_TYPEDEF(_DynaCollection, __uuidof(_DynaCollection)); +_COM_SMARTPTR_TYPEDEF(Property, __uuidof(Property)); +_COM_SMARTPTR_TYPEDEF(Properties, __uuidof(Properties)); +_COM_SMARTPTR_TYPEDEF(_ADO, __uuidof(_ADO)); +_COM_SMARTPTR_TYPEDEF(Error, __uuidof(Error)); +_COM_SMARTPTR_TYPEDEF(Errors, __uuidof(Errors)); +_COM_SMARTPTR_TYPEDEF(Field20, __uuidof(Field20)); +_COM_SMARTPTR_TYPEDEF(Field, __uuidof(Field)); +_COM_SMARTPTR_TYPEDEF(Fields15, __uuidof(Fields15)); +_COM_SMARTPTR_TYPEDEF(Fields20, __uuidof(Fields20)); +_COM_SMARTPTR_TYPEDEF(Fields, __uuidof(Fields)); +_COM_SMARTPTR_TYPEDEF(_Parameter, __uuidof(_Parameter)); +_COM_SMARTPTR_TYPEDEF(Parameters, __uuidof(Parameters)); +_COM_SMARTPTR_TYPEDEF(ConnectionEvents, __uuidof(ConnectionEvents)); +_COM_SMARTPTR_TYPEDEF(RecordsetEvents, __uuidof(RecordsetEvents)); +_COM_SMARTPTR_TYPEDEF(ADOConnectionConstruction15, __uuidof(ADOConnectionConstruction15)); +_COM_SMARTPTR_TYPEDEF(ADOConnectionConstruction, __uuidof(ADOConnectionConstruction)); +_COM_SMARTPTR_TYPEDEF(_Stream, __uuidof(_Stream)); +_COM_SMARTPTR_TYPEDEF(ADORecordConstruction, __uuidof(ADORecordConstruction)); +_COM_SMARTPTR_TYPEDEF(ADOStreamConstruction, __uuidof(ADOStreamConstruction)); +_COM_SMARTPTR_TYPEDEF(ADOCommandConstruction, __uuidof(ADOCommandConstruction)); +_COM_SMARTPTR_TYPEDEF(ADORecordsetConstruction, __uuidof(ADORecordsetConstruction)); +_COM_SMARTPTR_TYPEDEF(Field15, __uuidof(Field15)); +_COM_SMARTPTR_TYPEDEF(Field20_Deprecated, __uuidof(Field20_Deprecated)); +_COM_SMARTPTR_TYPEDEF(Field_Deprecated, __uuidof(Field_Deprecated)); +_COM_SMARTPTR_TYPEDEF(Fields15_Deprecated, __uuidof(Fields15_Deprecated)); +_COM_SMARTPTR_TYPEDEF(Fields20_Deprecated, __uuidof(Fields20_Deprecated)); +_COM_SMARTPTR_TYPEDEF(Fields_Deprecated, __uuidof(Fields_Deprecated)); +_COM_SMARTPTR_TYPEDEF(_Parameter_Deprecated, __uuidof(_Parameter_Deprecated)); +_COM_SMARTPTR_TYPEDEF(Parameters_Deprecated, __uuidof(Parameters_Deprecated)); +_COM_SMARTPTR_TYPEDEF(ConnectionEvents_Deprecated, __uuidof(ConnectionEvents_Deprecated)); +_COM_SMARTPTR_TYPEDEF(RecordsetEvents_Deprecated, __uuidof(RecordsetEvents_Deprecated)); +_COM_SMARTPTR_TYPEDEF(_Stream_Deprecated, __uuidof(_Stream_Deprecated)); +_COM_SMARTPTR_TYPEDEF(Field15_Deprecated, __uuidof(Field15_Deprecated)); +_COM_SMARTPTR_TYPEDEF(Command15, __uuidof(Command15)); +_COM_SMARTPTR_TYPEDEF(Command25, __uuidof(Command25)); +_COM_SMARTPTR_TYPEDEF(_Command, __uuidof(_Command)); +_COM_SMARTPTR_TYPEDEF(Connection15, __uuidof(Connection15)); +_COM_SMARTPTR_TYPEDEF(_Connection, __uuidof(_Connection)); +_COM_SMARTPTR_TYPEDEF(Recordset15, __uuidof(Recordset15)); +_COM_SMARTPTR_TYPEDEF(Recordset20, __uuidof(Recordset20)); +_COM_SMARTPTR_TYPEDEF(Recordset21, __uuidof(Recordset21)); +_COM_SMARTPTR_TYPEDEF(_Recordset, __uuidof(_Recordset)); +_COM_SMARTPTR_TYPEDEF(ConnectionEventsVt, __uuidof(ConnectionEventsVt)); +_COM_SMARTPTR_TYPEDEF(RecordsetEventsVt, __uuidof(RecordsetEventsVt)); +_COM_SMARTPTR_TYPEDEF(_Record, __uuidof(_Record)); +_COM_SMARTPTR_TYPEDEF(ConnectionEventsVt_Deprecated, __uuidof(ConnectionEventsVt_Deprecated)); +_COM_SMARTPTR_TYPEDEF(Connection15_Deprecated, __uuidof(Connection15_Deprecated)); +_COM_SMARTPTR_TYPEDEF(_Connection_Deprecated, __uuidof(_Connection_Deprecated)); +_COM_SMARTPTR_TYPEDEF(Recordset15_Deprecated, __uuidof(Recordset15_Deprecated)); +_COM_SMARTPTR_TYPEDEF(Recordset20_Deprecated, __uuidof(Recordset20_Deprecated)); +_COM_SMARTPTR_TYPEDEF(Recordset21_Deprecated, __uuidof(Recordset21_Deprecated)); +_COM_SMARTPTR_TYPEDEF(_Recordset_Deprecated, __uuidof(_Recordset_Deprecated)); +_COM_SMARTPTR_TYPEDEF(Command15_Deprecated, __uuidof(Command15_Deprecated)); +_COM_SMARTPTR_TYPEDEF(Command25_Deprecated, __uuidof(Command25_Deprecated)); +_COM_SMARTPTR_TYPEDEF(_Command_Deprecated, __uuidof(_Command_Deprecated)); +_COM_SMARTPTR_TYPEDEF(RecordsetEventsVt_Deprecated, __uuidof(RecordsetEventsVt_Deprecated)); +_COM_SMARTPTR_TYPEDEF(_Record_Deprecated, __uuidof(_Record_Deprecated)); + +// +// Type library items +// + +enum __declspec(uuid("0000051b-0000-0010-8000-00aa006d2ea4")) +CursorTypeEnum +{ + adOpenUnspecified = -1, + adOpenForwardOnly = 0, + adOpenKeyset = 1, + adOpenDynamic = 2, + adOpenStatic = 3 +}; + +enum __declspec(uuid("0000051c-0000-0010-8000-00aa006d2ea4")) +CursorOptionEnum +{ + adHoldRecords = 256, + adMovePrevious = 512, + adAddNew = 16778240, + adDelete = 16779264, + adUpdate = 16809984, + adBookmark = 8192, + adApproxPosition = 16384, + adUpdateBatch = 65536, + adResync = 131072, + adNotify = 262144, + adFind = 524288, + adSeek = 4194304, + adIndex = 8388608 +}; + +enum __declspec(uuid("0000051d-0000-0010-8000-00aa006d2ea4")) +LockTypeEnum +{ + adLockUnspecified = -1, + adLockReadOnly = 1, + adLockPessimistic = 2, + adLockOptimistic = 3, + adLockBatchOptimistic = 4 +}; + +enum __declspec(uuid("0000051e-0000-0010-8000-00aa006d2ea4")) +ExecuteOptionEnum +{ + adOptionUnspecified = -1, + adAsyncExecute = 16, + adAsyncFetch = 32, + adAsyncFetchNonBlocking = 64, + adExecuteNoRecords = 128, + adExecuteStream = 1024, + adExecuteRecord = 2048 +}; + +enum __declspec(uuid("00000541-0000-0010-8000-00aa006d2ea4")) +ConnectOptionEnum +{ + adConnectUnspecified = -1, + adAsyncConnect = 16 +}; + +enum __declspec(uuid("00000532-0000-0010-8000-00aa006d2ea4")) +ObjectStateEnum +{ + adStateClosed = 0, + adStateOpen = 1, + adStateConnecting = 2, + adStateExecuting = 4, + adStateFetching = 8 +}; + +enum __declspec(uuid("0000052f-0000-0010-8000-00aa006d2ea4")) +CursorLocationEnum +{ + adUseNone = 1, + adUseServer = 2, + adUseClient = 3, + adUseClientBatch = 3 +}; + +enum __declspec(uuid("0000051f-0000-0010-8000-00aa006d2ea4")) +DataTypeEnum +{ + adEmpty = 0, + adTinyInt = 16, + adSmallInt = 2, + adInteger = 3, + adBigInt = 20, + adUnsignedTinyInt = 17, + adUnsignedSmallInt = 18, + adUnsignedInt = 19, + adUnsignedBigInt = 21, + adSingle = 4, + adDouble = 5, + adCurrency = 6, + adDecimal = 14, + adNumeric = 131, + adBoolean = 11, + adError = 10, + adUserDefined = 132, + adVariant = 12, + adIDispatch = 9, + adIUnknown = 13, + adGUID = 72, + adDate = 7, + adDBDate = 133, + adDBTime = 134, + adDBTimeStamp = 135, + adBSTR = 8, + adChar = 129, + adVarChar = 200, + adLongVarChar = 201, + adWChar = 130, + adVarWChar = 202, + adLongVarWChar = 203, + adBinary = 128, + adVarBinary = 204, + adLongVarBinary = 205, + adChapter = 136, + adFileTime = 64, + adPropVariant = 138, + adVarNumeric = 139, + adArray = 8192 +}; + +enum __declspec(uuid("00000525-0000-0010-8000-00aa006d2ea4")) +FieldAttributeEnum +{ + adFldUnspecified = -1, + adFldMayDefer = 2, + adFldUpdatable = 4, + adFldUnknownUpdatable = 8, + adFldFixed = 16, + adFldIsNullable = 32, + adFldMayBeNull = 64, + adFldLong = 128, + adFldRowID = 256, + adFldRowVersion = 512, + adFldCacheDeferred = 4096, + adFldIsChapter = 8192, + adFldNegativeScale = 16384, + adFldKeyColumn = 32768, + adFldIsRowURL = 65536, + adFldIsDefaultStream = 131072, + adFldIsCollection = 262144 +}; + +enum __declspec(uuid("00000526-0000-0010-8000-00aa006d2ea4")) +EditModeEnum +{ + adEditNone = 0, + adEditInProgress = 1, + adEditAdd = 2, + adEditDelete = 4 +}; + +enum __declspec(uuid("00000527-0000-0010-8000-00aa006d2ea4")) +RecordStatusEnum +{ + adRecOK = 0, + adRecNew = 1, + adRecModified = 2, + adRecDeleted = 4, + adRecUnmodified = 8, + adRecInvalid = 16, + adRecMultipleChanges = 64, + adRecPendingChanges = 128, + adRecCanceled = 256, + adRecCantRelease = 1024, + adRecConcurrencyViolation = 2048, + adRecIntegrityViolation = 4096, + adRecMaxChangesExceeded = 8192, + adRecObjectOpen = 16384, + adRecOutOfMemory = 32768, + adRecPermissionDenied = 65536, + adRecSchemaViolation = 131072, + adRecDBDeleted = 262144 +}; + +enum __declspec(uuid("00000542-0000-0010-8000-00aa006d2ea4")) +GetRowsOptionEnum +{ + adGetRowsRest = -1 +}; + +enum __declspec(uuid("00000528-0000-0010-8000-00aa006d2ea4")) +PositionEnum +{ + adPosUnknown = -1, + adPosBOF = -2, + adPosEOF = -3 +}; + +enum BookmarkEnum +{ + adBookmarkCurrent = 0, + adBookmarkFirst = 1, + adBookmarkLast = 2 +}; + +enum __declspec(uuid("00000540-0000-0010-8000-00aa006d2ea4")) +MarshalOptionsEnum +{ + adMarshalAll = 0, + adMarshalModifiedOnly = 1 +}; + +enum __declspec(uuid("00000543-0000-0010-8000-00aa006d2ea4")) +AffectEnum +{ + adAffectCurrent = 1, + adAffectGroup = 2, + adAffectAll = 3, + adAffectAllChapters = 4 +}; + +enum __declspec(uuid("00000544-0000-0010-8000-00aa006d2ea4")) +ResyncEnum +{ + adResyncUnderlyingValues = 1, + adResyncAllValues = 2 +}; + +enum __declspec(uuid("00000545-0000-0010-8000-00aa006d2ea4")) +CompareEnum +{ + adCompareLessThan = 0, + adCompareEqual = 1, + adCompareGreaterThan = 2, + adCompareNotEqual = 3, + adCompareNotComparable = 4 +}; + +enum __declspec(uuid("00000546-0000-0010-8000-00aa006d2ea4")) +FilterGroupEnum +{ + adFilterNone = 0, + adFilterPendingRecords = 1, + adFilterAffectedRecords = 2, + adFilterFetchedRecords = 3, + adFilterPredicate = 4, + adFilterConflictingRecords = 5 +}; + +enum __declspec(uuid("00000547-0000-0010-8000-00aa006d2ea4")) +SearchDirectionEnum +{ + adSearchForward = 1, + adSearchBackward = -1 +}; + +enum __declspec(uuid("00000548-0000-0010-8000-00aa006d2ea4")) +PersistFormatEnum +{ + adPersistADTG = 0, + adPersistXML = 1 +}; + +enum __declspec(uuid("00000549-0000-0010-8000-00aa006d2ea4")) +StringFormatEnum +{ + adClipString = 2 +}; + +enum __declspec(uuid("00000520-0000-0010-8000-00aa006d2ea4")) +ConnectPromptEnum +{ + adPromptAlways = 1, + adPromptComplete = 2, + adPromptCompleteRequired = 3, + adPromptNever = 4 +}; + +enum __declspec(uuid("00000521-0000-0010-8000-00aa006d2ea4")) +ConnectModeEnum +{ + adModeUnknown = 0, + adModeRead = 1, + adModeWrite = 2, + adModeReadWrite = 3, + adModeShareDenyRead = 4, + adModeShareDenyWrite = 8, + adModeShareExclusive = 12, + adModeShareDenyNone = 16, + adModeRecursive = 4194304 +}; + +enum __declspec(uuid("00000570-0000-0010-8000-00aa006d2ea4")) +RecordCreateOptionsEnum +{ + adCreateCollection = 8192, + adCreateStructDoc = 0x80000000, + adCreateNonCollection = 0, + adOpenIfExists = 33554432, + adCreateOverwrite = 67108864, + adFailIfNotExists = -1 +}; + +enum __declspec(uuid("00000571-0000-0010-8000-00aa006d2ea4")) +RecordOpenOptionsEnum +{ + adOpenRecordUnspecified = -1, + adOpenSource = 8388608, + adOpenOutput = 8388608, + adOpenAsync = 4096, + adDelayFetchStream = 16384, + adDelayFetchFields = 32768, + adOpenExecuteCommand = 65536 +}; + +enum __declspec(uuid("00000523-0000-0010-8000-00aa006d2ea4")) +IsolationLevelEnum +{ + adXactUnspecified = -1, + adXactChaos = 16, + adXactReadUncommitted = 256, + adXactBrowse = 256, + adXactCursorStability = 4096, + adXactReadCommitted = 4096, + adXactRepeatableRead = 65536, + adXactSerializable = 1048576, + adXactIsolated = 1048576 +}; + +enum __declspec(uuid("00000524-0000-0010-8000-00aa006d2ea4")) +XactAttributeEnum +{ + adXactCommitRetaining = 131072, + adXactAbortRetaining = 262144, + adXactAsyncPhaseOne = 524288, + adXactSyncPhaseOne = 1048576 +}; + +enum __declspec(uuid("00000529-0000-0010-8000-00aa006d2ea4")) +PropertyAttributesEnum +{ + adPropNotSupported = 0, + adPropRequired = 1, + adPropOptional = 2, + adPropRead = 512, + adPropWrite = 1024 +}; + +enum __declspec(uuid("0000052a-0000-0010-8000-00aa006d2ea4")) +ErrorValueEnum +{ + adErrProviderFailed = 3000, + adErrInvalidArgument = 3001, + adErrOpeningFile = 3002, + adErrReadFile = 3003, + adErrWriteFile = 3004, + adErrNoCurrentRecord = 3021, + adErrIllegalOperation = 3219, + adErrCantChangeProvider = 3220, + adErrInTransaction = 3246, + adErrFeatureNotAvailable = 3251, + adErrItemNotFound = 3265, + adErrObjectInCollection = 3367, + adErrObjectNotSet = 3420, + adErrDataConversion = 3421, + adErrObjectClosed = 3704, + adErrObjectOpen = 3705, + adErrProviderNotFound = 3706, + adErrBoundToCommand = 3707, + adErrInvalidParamInfo = 3708, + adErrInvalidConnection = 3709, + adErrNotReentrant = 3710, + adErrStillExecuting = 3711, + adErrOperationCancelled = 3712, + adErrStillConnecting = 3713, + adErrInvalidTransaction = 3714, + adErrNotExecuting = 3715, + adErrUnsafeOperation = 3716, + adwrnSecurityDialog = 3717, + adwrnSecurityDialogHeader = 3718, + adErrIntegrityViolation = 3719, + adErrPermissionDenied = 3720, + adErrDataOverflow = 3721, + adErrSchemaViolation = 3722, + adErrSignMismatch = 3723, + adErrCantConvertvalue = 3724, + adErrCantCreate = 3725, + adErrColumnNotOnThisRow = 3726, + adErrURLDoesNotExist = 3727, + adErrTreePermissionDenied = 3728, + adErrInvalidURL = 3729, + adErrResourceLocked = 3730, + adErrResourceExists = 3731, + adErrCannotComplete = 3732, + adErrVolumeNotFound = 3733, + adErrOutOfSpace = 3734, + adErrResourceOutOfScope = 3735, + adErrUnavailable = 3736, + adErrURLNamedRowDoesNotExist = 3737, + adErrDelResOutOfScope = 3738, + adErrPropInvalidColumn = 3739, + adErrPropInvalidOption = 3740, + adErrPropInvalidValue = 3741, + adErrPropConflicting = 3742, + adErrPropNotAllSettable = 3743, + adErrPropNotSet = 3744, + adErrPropNotSettable = 3745, + adErrPropNotSupported = 3746, + adErrCatalogNotSet = 3747, + adErrCantChangeConnection = 3748, + adErrFieldsUpdateFailed = 3749, + adErrDenyNotSupported = 3750, + adErrDenyTypeNotSupported = 3751, + adErrProviderNotSpecified = 3753, + adErrConnectionStringTooLong = 3754 +}; + +enum __declspec(uuid("0000052b-0000-0010-8000-00aa006d2ea4")) +ParameterAttributesEnum +{ + adParamSigned = 16, + adParamNullable = 64, + adParamLong = 128 +}; + +enum __declspec(uuid("0000052c-0000-0010-8000-00aa006d2ea4")) +ParameterDirectionEnum +{ + adParamUnknown = 0, + adParamInput = 1, + adParamOutput = 2, + adParamInputOutput = 3, + adParamReturnValue = 4 +}; + +enum __declspec(uuid("0000052e-0000-0010-8000-00aa006d2ea4")) +CommandTypeEnum +{ + adCmdUnspecified = -1, + adCmdUnknown = 8, + adCmdText = 1, + adCmdTable = 2, + adCmdStoredProc = 4, + adCmdFile = 256, + adCmdTableDirect = 512 +}; + +enum __declspec(uuid("00000530-0000-0010-8000-00aa006d2ea4")) +EventStatusEnum +{ + adStatusOK = 1, + adStatusErrorsOccurred = 2, + adStatusCantDeny = 3, + adStatusCancel = 4, + adStatusUnwantedEvent = 5 +}; + +enum __declspec(uuid("00000531-0000-0010-8000-00aa006d2ea4")) +EventReasonEnum +{ + adRsnAddNew = 1, + adRsnDelete = 2, + adRsnUpdate = 3, + adRsnUndoUpdate = 4, + adRsnUndoAddNew = 5, + adRsnUndoDelete = 6, + adRsnRequery = 7, + adRsnResynch = 8, + adRsnClose = 9, + adRsnMove = 10, + adRsnFirstChange = 11, + adRsnMoveFirst = 12, + adRsnMoveNext = 13, + adRsnMovePrevious = 14, + adRsnMoveLast = 15 +}; + +enum __declspec(uuid("00000533-0000-0010-8000-00aa006d2ea4")) +SchemaEnum +{ + adSchemaProviderSpecific = -1, + adSchemaAsserts = 0, + adSchemaCatalogs = 1, + adSchemaCharacterSets = 2, + adSchemaCollations = 3, + adSchemaColumns = 4, + adSchemaCheckConstraints = 5, + adSchemaConstraintColumnUsage = 6, + adSchemaConstraintTableUsage = 7, + adSchemaKeyColumnUsage = 8, + adSchemaReferentialContraints = 9, + adSchemaReferentialConstraints = 9, + adSchemaTableConstraints = 10, + adSchemaColumnsDomainUsage = 11, + adSchemaIndexes = 12, + adSchemaColumnPrivileges = 13, + adSchemaTablePrivileges = 14, + adSchemaUsagePrivileges = 15, + adSchemaProcedures = 16, + adSchemaSchemata = 17, + adSchemaSQLLanguages = 18, + adSchemaStatistics = 19, + adSchemaTables = 20, + adSchemaTranslations = 21, + adSchemaProviderTypes = 22, + adSchemaViews = 23, + adSchemaViewColumnUsage = 24, + adSchemaViewTableUsage = 25, + adSchemaProcedureParameters = 26, + adSchemaForeignKeys = 27, + adSchemaPrimaryKeys = 28, + adSchemaProcedureColumns = 29, + adSchemaDBInfoKeywords = 30, + adSchemaDBInfoLiterals = 31, + adSchemaCubes = 32, + adSchemaDimensions = 33, + adSchemaHierarchies = 34, + adSchemaLevels = 35, + adSchemaMeasures = 36, + adSchemaProperties = 37, + adSchemaMembers = 38, + adSchemaTrustees = 39, + adSchemaFunctions = 40, + adSchemaActions = 41, + adSchemaCommands = 42, + adSchemaSets = 43 +}; + +enum __declspec(uuid("0000057e-0000-0010-8000-00aa006d2ea4")) +FieldStatusEnum +{ + adFieldOK = 0, + adFieldCantConvertValue = 2, + adFieldIsNull = 3, + adFieldTruncated = 4, + adFieldSignMismatch = 5, + adFieldDataOverflow = 6, + adFieldCantCreate = 7, + adFieldUnavailable = 8, + adFieldPermissionDenied = 9, + adFieldIntegrityViolation = 10, + adFieldSchemaViolation = 11, + adFieldBadStatus = 12, + adFieldDefault = 13, + adFieldIgnore = 15, + adFieldDoesNotExist = 16, + adFieldInvalidURL = 17, + adFieldResourceLocked = 18, + adFieldResourceExists = 19, + adFieldCannotComplete = 20, + adFieldVolumeNotFound = 21, + adFieldOutOfSpace = 22, + adFieldCannotDeleteSource = 23, + adFieldReadOnly = 24, + adFieldResourceOutOfScope = 25, + adFieldAlreadyExists = 26, + adFieldPendingInsert = 65536, + adFieldPendingDelete = 131072, + adFieldPendingChange = 262144, + adFieldPendingUnknown = 524288, + adFieldPendingUnknownDelete = 1048576 +}; + +enum __declspec(uuid("00000552-0000-0010-8000-00aa006d2ea4")) +SeekEnum +{ + adSeekFirstEQ = 1, + adSeekLastEQ = 2, + adSeekAfterEQ = 4, + adSeekAfter = 8, + adSeekBeforeEQ = 16, + adSeekBefore = 32 +}; + +enum __declspec(uuid("0000054a-0000-0010-8000-00aa006d2ea4")) +ADCPROP_UPDATECRITERIA_ENUM +{ + adCriteriaKey = 0, + adCriteriaAllCols = 1, + adCriteriaUpdCols = 2, + adCriteriaTimeStamp = 3 +}; + +enum __declspec(uuid("0000054b-0000-0010-8000-00aa006d2ea4")) +ADCPROP_ASYNCTHREADPRIORITY_ENUM +{ + adPriorityLowest = 1, + adPriorityBelowNormal = 2, + adPriorityNormal = 3, + adPriorityAboveNormal = 4, + adPriorityHighest = 5 +}; + +enum __declspec(uuid("00000554-0000-0010-8000-00aa006d2ea4")) +ADCPROP_AUTORECALC_ENUM +{ + adRecalcUpFront = 0, + adRecalcAlways = 1 +}; + +enum __declspec(uuid("00000553-0000-0010-8000-00aa006d2ea4")) +ADCPROP_UPDATERESYNC_ENUM +{ + adResyncNone = 0, + adResyncAutoIncrement = 1, + adResyncConflicts = 2, + adResyncUpdates = 4, + adResyncInserts = 8, + adResyncAll = 15 +}; + +enum __declspec(uuid("00000573-0000-0010-8000-00aa006d2ea4")) +MoveRecordOptionsEnum +{ + adMoveUnspecified = -1, + adMoveOverWrite = 1, + adMoveDontUpdateLinks = 2, + adMoveAllowEmulation = 4 +}; + +enum __declspec(uuid("00000574-0000-0010-8000-00aa006d2ea4")) +CopyRecordOptionsEnum +{ + adCopyUnspecified = -1, + adCopyOverWrite = 1, + adCopyAllowEmulation = 4, + adCopyNonRecursive = 2 +}; + +enum __declspec(uuid("00000576-0000-0010-8000-00aa006d2ea4")) +StreamTypeEnum +{ + adTypeBinary = 1, + adTypeText = 2 +}; + +enum __declspec(uuid("00000577-0000-0010-8000-00aa006d2ea4")) +LineSeparatorEnum +{ + adLF = 10, + adCR = 13, + adCRLF = -1 +}; + +enum __declspec(uuid("0000057a-0000-0010-8000-00aa006d2ea4")) +StreamOpenOptionsEnum +{ + adOpenStreamUnspecified = -1, + adOpenStreamAsync = 1, + adOpenStreamFromRecord = 4 +}; + +enum __declspec(uuid("0000057b-0000-0010-8000-00aa006d2ea4")) +StreamWriteEnum +{ + adWriteChar = 0, + adWriteLine = 1, + stWriteChar = 0, + stWriteLine = 1 +}; + +enum __declspec(uuid("0000057c-0000-0010-8000-00aa006d2ea4")) +SaveOptionsEnum +{ + adSaveCreateNotExist = 1, + adSaveCreateOverWrite = 2 +}; + +enum FieldEnum +{ + adDefaultStream = -1, + adRecordURL = -2 +}; + +enum StreamReadEnum +{ + adReadAll = -1, + adReadLine = -2 +}; + +enum __declspec(uuid("0000057d-0000-0010-8000-00aa006d2ea4")) +RecordTypeEnum +{ + adSimpleRecord = 0, + adCollectionRecord = 1, + adStructDoc = 2 +}; + +struct __declspec(uuid("00000512-0000-0010-8000-00aa006d2ea4")) +_Collection : IDispatch +{ + // + // Property data + // + + __declspec(property(get=GetCount)) + long Count; + + // + // Wrapper methods for error-handling + // + + long GetCount ( ); + IUnknownPtr _NewEnum ( ); + HRESULT Refresh ( ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_Count ( + /*[out,retval]*/ long * c ) = 0; + virtual HRESULT __stdcall raw__NewEnum ( + /*[out,retval]*/ IUnknown * * ppvObject ) = 0; + virtual HRESULT __stdcall raw_Refresh ( ) = 0; +}; + +struct __declspec(uuid("00000513-0000-0010-8000-00aa006d2ea4")) +_DynaCollection : _Collection +{ + // + // Wrapper methods for error-handling + // + + HRESULT Append ( + IDispatch * Object ); + HRESULT Delete ( + const _variant_t & Index ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall raw_Append ( + /*[in]*/ IDispatch * Object ) = 0; + virtual HRESULT __stdcall raw_Delete ( + /*[in]*/ VARIANT Index ) = 0; +}; + +struct __declspec(uuid("00000503-0000-0010-8000-00aa006d2ea4")) +Property : IDispatch +{ + // + // Property data + // + + __declspec(property(get=GetValue,put=PutValue)) + _variant_t Value; + __declspec(property(get=GetName)) + _bstr_t Name; + __declspec(property(get=GetType)) + enum DataTypeEnum Type; + __declspec(property(get=GetAttributes,put=PutAttributes)) + long Attributes; + + // + // Wrapper methods for error-handling + // + + _variant_t GetValue ( ); + void PutValue ( + const _variant_t & pval ); + _bstr_t GetName ( ); + enum DataTypeEnum GetType ( ); + long GetAttributes ( ); + void PutAttributes ( + long plAttributes ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_Value ( + /*[out,retval]*/ VARIANT * pval ) = 0; + virtual HRESULT __stdcall put_Value ( + /*[in]*/ VARIANT pval ) = 0; + virtual HRESULT __stdcall get_Name ( + /*[out,retval]*/ BSTR * pbstr ) = 0; + virtual HRESULT __stdcall get_Type ( + /*[out,retval]*/ enum DataTypeEnum * ptype ) = 0; + virtual HRESULT __stdcall get_Attributes ( + /*[out,retval]*/ long * plAttributes ) = 0; + virtual HRESULT __stdcall put_Attributes ( + /*[in]*/ long plAttributes ) = 0; +}; + +struct __declspec(uuid("00000504-0000-0010-8000-00aa006d2ea4")) +Properties : _Collection +{ + // + // Property data + // + + __declspec(property(get=GetItem)) + PropertyPtr Item[]; + + // + // Wrapper methods for error-handling + // + + PropertyPtr GetItem ( + const _variant_t & Index ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_Item ( + /*[in]*/ VARIANT Index, + /*[out,retval]*/ struct Property * * ppvObject ) = 0; +}; + +struct __declspec(uuid("00000534-0000-0010-8000-00aa006d2ea4")) +_ADO : IDispatch +{ + // + // Property data + // + + __declspec(property(get=GetProperties)) + PropertiesPtr Properties; + + // + // Wrapper methods for error-handling + // + + PropertiesPtr GetProperties ( ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_Properties ( + /*[out,retval]*/ struct Properties * * ppvObject ) = 0; +}; + +struct __declspec(uuid("00000500-0000-0010-8000-00aa006d2ea4")) +Error : IDispatch +{ + // + // Property data + // + + __declspec(property(get=GetDescription)) + _bstr_t Description; + __declspec(property(get=GetNumber)) + long Number; + __declspec(property(get=GetSource)) + _bstr_t Source; + __declspec(property(get=GetHelpFile)) + _bstr_t HelpFile; + __declspec(property(get=GetHelpContext)) + long HelpContext; + __declspec(property(get=GetSQLState)) + _bstr_t SQLState; + __declspec(property(get=GetNativeError)) + long NativeError; + + // + // Wrapper methods for error-handling + // + + long GetNumber ( ); + _bstr_t GetSource ( ); + _bstr_t GetDescription ( ); + _bstr_t GetHelpFile ( ); + long GetHelpContext ( ); + _bstr_t GetSQLState ( ); + long GetNativeError ( ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_Number ( + /*[out,retval]*/ long * pl ) = 0; + virtual HRESULT __stdcall get_Source ( + /*[out,retval]*/ BSTR * pbstr ) = 0; + virtual HRESULT __stdcall get_Description ( + /*[out,retval]*/ BSTR * pbstr ) = 0; + virtual HRESULT __stdcall get_HelpFile ( + /*[out,retval]*/ BSTR * pbstr ) = 0; + virtual HRESULT __stdcall get_HelpContext ( + /*[out,retval]*/ long * pl ) = 0; + virtual HRESULT __stdcall get_SQLState ( + /*[out,retval]*/ BSTR * pbstr ) = 0; + virtual HRESULT __stdcall get_NativeError ( + /*[out,retval]*/ long * pl ) = 0; +}; + +struct __declspec(uuid("00000501-0000-0010-8000-00aa006d2ea4")) +Errors : _Collection +{ + // + // Property data + // + + __declspec(property(get=GetItem)) + ErrorPtr Item[]; + + // + // Wrapper methods for error-handling + // + + ErrorPtr GetItem ( + const _variant_t & Index ); + HRESULT Clear ( ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_Item ( + /*[in]*/ VARIANT Index, + /*[out,retval]*/ struct Error * * ppvObject ) = 0; + virtual HRESULT __stdcall raw_Clear ( ) = 0; +}; + +struct __declspec(uuid("0000154c-0000-0010-8000-00aa006d2ea4")) +Field20 : _ADO +{ + // + // Property data + // + + __declspec(property(get=GetValue,put=PutValue)) + _variant_t Value; + __declspec(property(get=GetName)) + _bstr_t Name; + __declspec(property(get=GetType,put=PutType)) + enum DataTypeEnum Type; + __declspec(property(get=GetDefinedSize,put=PutDefinedSize)) + long DefinedSize; + __declspec(property(get=GetOriginalValue)) + _variant_t OriginalValue; + __declspec(property(get=GetUnderlyingValue)) + _variant_t UnderlyingValue; + __declspec(property(get=GetActualSize)) + long ActualSize; + __declspec(property(get=GetPrecision,put=PutPrecision)) + unsigned char Precision; + __declspec(property(get=GetNumericScale,put=PutNumericScale)) + unsigned char NumericScale; + __declspec(property(get=GetAttributes,put=PutAttributes)) + long Attributes; + __declspec(property(get=GetDataFormat,put=PutRefDataFormat)) + IUnknownPtr DataFormat; + + // + // Wrapper methods for error-handling + // + + long GetActualSize ( ); + long GetAttributes ( ); + long GetDefinedSize ( ); + _bstr_t GetName ( ); + enum DataTypeEnum GetType ( ); + _variant_t GetValue ( ); + void PutValue ( + const _variant_t & pvar ); + unsigned char GetPrecision ( ); + unsigned char GetNumericScale ( ); + HRESULT AppendChunk ( + const _variant_t & Data ); + _variant_t GetChunk ( + long Length ); + _variant_t GetOriginalValue ( ); + _variant_t GetUnderlyingValue ( ); + IUnknownPtr GetDataFormat ( ); + void PutRefDataFormat ( + IUnknown * ppiDF ); + void PutPrecision ( + unsigned char pbPrecision ); + void PutNumericScale ( + unsigned char pbNumericScale ); + void PutType ( + enum DataTypeEnum pDataType ); + void PutDefinedSize ( + long pl ); + void PutAttributes ( + long pl ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_ActualSize ( + /*[out,retval]*/ long * pl ) = 0; + virtual HRESULT __stdcall get_Attributes ( + /*[out,retval]*/ long * pl ) = 0; + virtual HRESULT __stdcall get_DefinedSize ( + /*[out,retval]*/ long * pl ) = 0; + virtual HRESULT __stdcall get_Name ( + /*[out,retval]*/ BSTR * pbstr ) = 0; + virtual HRESULT __stdcall get_Type ( + /*[out,retval]*/ enum DataTypeEnum * pDataType ) = 0; + virtual HRESULT __stdcall get_Value ( + /*[out,retval]*/ VARIANT * pvar ) = 0; + virtual HRESULT __stdcall put_Value ( + /*[in]*/ VARIANT pvar ) = 0; + virtual HRESULT __stdcall get_Precision ( + /*[out,retval]*/ unsigned char * pbPrecision ) = 0; + virtual HRESULT __stdcall get_NumericScale ( + /*[out,retval]*/ unsigned char * pbNumericScale ) = 0; + virtual HRESULT __stdcall raw_AppendChunk ( + /*[in]*/ VARIANT Data ) = 0; + virtual HRESULT __stdcall raw_GetChunk ( + /*[in]*/ long Length, + /*[out,retval]*/ VARIANT * pvar ) = 0; + virtual HRESULT __stdcall get_OriginalValue ( + /*[out,retval]*/ VARIANT * pvar ) = 0; + virtual HRESULT __stdcall get_UnderlyingValue ( + /*[out,retval]*/ VARIANT * pvar ) = 0; + virtual HRESULT __stdcall get_DataFormat ( + /*[out,retval]*/ IUnknown * * ppiDF ) = 0; + virtual HRESULT __stdcall putref_DataFormat ( + /*[in]*/ IUnknown * ppiDF ) = 0; + virtual HRESULT __stdcall put_Precision ( + /*[in]*/ unsigned char pbPrecision ) = 0; + virtual HRESULT __stdcall put_NumericScale ( + /*[in]*/ unsigned char pbNumericScale ) = 0; + virtual HRESULT __stdcall put_Type ( + /*[in]*/ enum DataTypeEnum pDataType ) = 0; + virtual HRESULT __stdcall put_DefinedSize ( + /*[in]*/ long pl ) = 0; + virtual HRESULT __stdcall put_Attributes ( + /*[in]*/ long pl ) = 0; +}; + +struct __declspec(uuid("00001569-0000-0010-8000-00aa006d2ea4")) +Field : Field20 +{ + // + // Property data + // + + __declspec(property(get=GetStatus)) + long Status; + + // + // Wrapper methods for error-handling + // + + long GetStatus ( ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_Status ( + /*[out,retval]*/ long * pFStatus ) = 0; +}; + +struct __declspec(uuid("00001506-0000-0010-8000-00aa006d2ea4")) +Fields15 : _Collection +{ + // + // Property data + // + + __declspec(property(get=GetItem)) + FieldPtr Item[]; + + // + // Wrapper methods for error-handling + // + + FieldPtr GetItem ( + const _variant_t & Index ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_Item ( + /*[in]*/ VARIANT Index, + /*[out,retval]*/ struct Field * * ppvObject ) = 0; +}; + +struct __declspec(uuid("0000154d-0000-0010-8000-00aa006d2ea4")) +Fields20 : Fields15 +{ + // + // Wrapper methods for error-handling + // + + HRESULT _Append ( + _bstr_t Name, + enum DataTypeEnum Type, + long DefinedSize, + enum FieldAttributeEnum Attrib ); + HRESULT Delete ( + const _variant_t & Index ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall raw__Append ( + /*[in]*/ BSTR Name, + /*[in]*/ enum DataTypeEnum Type, + /*[in]*/ long DefinedSize, + /*[in]*/ enum FieldAttributeEnum Attrib ) = 0; + virtual HRESULT __stdcall raw_Delete ( + /*[in]*/ VARIANT Index ) = 0; +}; + +struct __declspec(uuid("00001564-0000-0010-8000-00aa006d2ea4")) +Fields : Fields20 +{ + // + // Wrapper methods for error-handling + // + + HRESULT Append ( + _bstr_t Name, + enum DataTypeEnum Type, + long DefinedSize, + enum FieldAttributeEnum Attrib, + const _variant_t & FieldValue = vtMissing ); + HRESULT Update ( ); + HRESULT Resync ( + enum ResyncEnum ResyncValues ); + HRESULT CancelUpdate ( ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall raw_Append ( + /*[in]*/ BSTR Name, + /*[in]*/ enum DataTypeEnum Type, + /*[in]*/ long DefinedSize, + /*[in]*/ enum FieldAttributeEnum Attrib, + /*[in]*/ VARIANT FieldValue = vtMissing ) = 0; + virtual HRESULT __stdcall raw_Update ( ) = 0; + virtual HRESULT __stdcall raw_Resync ( + /*[in]*/ enum ResyncEnum ResyncValues ) = 0; + virtual HRESULT __stdcall raw_CancelUpdate ( ) = 0; +}; + +struct __declspec(uuid("0000150c-0000-0010-8000-00aa006d2ea4")) +_Parameter : _ADO +{ + // + // Property data + // + + __declspec(property(get=GetValue,put=PutValue)) + _variant_t Value; + __declspec(property(get=GetName,put=PutName)) + _bstr_t Name; + __declspec(property(get=GetType,put=PutType)) + enum DataTypeEnum Type; + __declspec(property(get=GetDirection,put=PutDirection)) + enum ParameterDirectionEnum Direction; + __declspec(property(get=GetPrecision,put=PutPrecision)) + unsigned char Precision; + __declspec(property(get=GetNumericScale,put=PutNumericScale)) + unsigned char NumericScale; + __declspec(property(get=GetSize,put=PutSize)) + long Size; + __declspec(property(get=GetAttributes,put=PutAttributes)) + long Attributes; + + // + // Wrapper methods for error-handling + // + + _bstr_t GetName ( ); + void PutName ( + _bstr_t pbstr ); + _variant_t GetValue ( ); + void PutValue ( + const _variant_t & pvar ); + enum DataTypeEnum GetType ( ); + void PutType ( + enum DataTypeEnum psDataType ); + void PutDirection ( + enum ParameterDirectionEnum plParmDirection ); + enum ParameterDirectionEnum GetDirection ( ); + void PutPrecision ( + unsigned char pbPrecision ); + unsigned char GetPrecision ( ); + void PutNumericScale ( + unsigned char pbScale ); + unsigned char GetNumericScale ( ); + void PutSize ( + long pl ); + long GetSize ( ); + HRESULT AppendChunk ( + const _variant_t & Val ); + long GetAttributes ( ); + void PutAttributes ( + long plParmAttribs ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_Name ( + /*[out,retval]*/ BSTR * pbstr ) = 0; + virtual HRESULT __stdcall put_Name ( + /*[in]*/ BSTR pbstr ) = 0; + virtual HRESULT __stdcall get_Value ( + /*[out,retval]*/ VARIANT * pvar ) = 0; + virtual HRESULT __stdcall put_Value ( + /*[in]*/ VARIANT pvar ) = 0; + virtual HRESULT __stdcall get_Type ( + /*[out,retval]*/ enum DataTypeEnum * psDataType ) = 0; + virtual HRESULT __stdcall put_Type ( + /*[in]*/ enum DataTypeEnum psDataType ) = 0; + virtual HRESULT __stdcall put_Direction ( + /*[in]*/ enum ParameterDirectionEnum plParmDirection ) = 0; + virtual HRESULT __stdcall get_Direction ( + /*[out,retval]*/ enum ParameterDirectionEnum * plParmDirection ) = 0; + virtual HRESULT __stdcall put_Precision ( + /*[in]*/ unsigned char pbPrecision ) = 0; + virtual HRESULT __stdcall get_Precision ( + /*[out,retval]*/ unsigned char * pbPrecision ) = 0; + virtual HRESULT __stdcall put_NumericScale ( + /*[in]*/ unsigned char pbScale ) = 0; + virtual HRESULT __stdcall get_NumericScale ( + /*[out,retval]*/ unsigned char * pbScale ) = 0; + virtual HRESULT __stdcall put_Size ( + /*[in]*/ long pl ) = 0; + virtual HRESULT __stdcall get_Size ( + /*[out,retval]*/ long * pl ) = 0; + virtual HRESULT __stdcall raw_AppendChunk ( + /*[in]*/ VARIANT Val ) = 0; + virtual HRESULT __stdcall get_Attributes ( + /*[out,retval]*/ long * plParmAttribs ) = 0; + virtual HRESULT __stdcall put_Attributes ( + /*[in]*/ long plParmAttribs ) = 0; +}; + +struct __declspec(uuid("0000150d-0000-0010-8000-00aa006d2ea4")) +Parameters : _DynaCollection +{ + // + // Property data + // + + __declspec(property(get=GetItem)) + _ParameterPtr Item[]; + + // + // Wrapper methods for error-handling + // + + _ParameterPtr GetItem ( + const _variant_t & Index ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_Item ( + /*[in]*/ VARIANT Index, + /*[out,retval]*/ struct _Parameter * * ppvObject ) = 0; +}; + +struct __declspec(uuid("00001400-0000-0010-8000-00aa006d2ea4")) +ConnectionEvents : IDispatch +{ + // + // Wrapper methods for error-handling + // + + // Methods: + HRESULT InfoMessage ( + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Connection * pConnection ); + HRESULT BeginTransComplete ( + long TransactionLevel, + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Connection * pConnection ); + HRESULT CommitTransComplete ( + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Connection * pConnection ); + HRESULT RollbackTransComplete ( + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Connection * pConnection ); + HRESULT WillExecute ( + BSTR * Source, + enum CursorTypeEnum * CursorType, + enum LockTypeEnum * LockType, + long * Options, + enum EventStatusEnum * adStatus, + struct _Command * pCommand, + struct _Recordset * pRecordset, + struct _Connection * pConnection ); + HRESULT ExecuteComplete ( + long RecordsAffected, + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Command * pCommand, + struct _Recordset * pRecordset, + struct _Connection * pConnection ); + HRESULT WillConnect ( + BSTR * ConnectionString, + BSTR * UserID, + BSTR * Password, + long * Options, + enum EventStatusEnum * adStatus, + struct _Connection * pConnection ); + HRESULT ConnectComplete ( + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Connection * pConnection ); + HRESULT Disconnect ( + enum EventStatusEnum * adStatus, + struct _Connection * pConnection ); +}; + +struct __declspec(uuid("00001266-0000-0010-8000-00aa006d2ea4")) +RecordsetEvents : IDispatch +{ + // + // Wrapper methods for error-handling + // + + // Methods: + HRESULT WillChangeField ( + long cFields, + const _variant_t & Fields, + enum EventStatusEnum * adStatus, + struct _Recordset * pRecordset ); + HRESULT FieldChangeComplete ( + long cFields, + const _variant_t & Fields, + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Recordset * pRecordset ); + HRESULT WillChangeRecord ( + enum EventReasonEnum adReason, + long cRecords, + enum EventStatusEnum * adStatus, + struct _Recordset * pRecordset ); + HRESULT RecordChangeComplete ( + enum EventReasonEnum adReason, + long cRecords, + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Recordset * pRecordset ); + HRESULT WillChangeRecordset ( + enum EventReasonEnum adReason, + enum EventStatusEnum * adStatus, + struct _Recordset * pRecordset ); + HRESULT RecordsetChangeComplete ( + enum EventReasonEnum adReason, + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Recordset * pRecordset ); + HRESULT WillMove ( + enum EventReasonEnum adReason, + enum EventStatusEnum * adStatus, + struct _Recordset * pRecordset ); + HRESULT MoveComplete ( + enum EventReasonEnum adReason, + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Recordset * pRecordset ); + HRESULT EndOfRecordset ( + VARIANT_BOOL * fMoreData, + enum EventStatusEnum * adStatus, + struct _Recordset * pRecordset ); + HRESULT FetchProgress ( + long Progress, + long MaxProgress, + enum EventStatusEnum * adStatus, + struct _Recordset * pRecordset ); + HRESULT FetchComplete ( + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Recordset * pRecordset ); +}; + +struct __declspec(uuid("00000516-0000-0010-8000-00aa006d2ea4")) +ADOConnectionConstruction15 : IUnknown +{ + // + // Property data + // + + __declspec(property(get=GetDSO)) + IUnknownPtr DSO; + __declspec(property(get=GetSession)) + IUnknownPtr Session; + + // + // Wrapper methods for error-handling + // + + IUnknownPtr GetDSO ( ); + IUnknownPtr GetSession ( ); + HRESULT WrapDSOandSession ( + IUnknown * pDSO, + IUnknown * pSession ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_DSO ( + /*[out,retval]*/ IUnknown * * ppDSO ) = 0; + virtual HRESULT __stdcall get_Session ( + /*[out,retval]*/ IUnknown * * ppSession ) = 0; + virtual HRESULT __stdcall raw_WrapDSOandSession ( + /*[in]*/ IUnknown * pDSO, + /*[in]*/ IUnknown * pSession ) = 0; +}; + +struct __declspec(uuid("00000551-0000-0010-8000-00aa006d2ea4")) +ADOConnectionConstruction : ADOConnectionConstruction15 +{}; + +struct __declspec(uuid("00000514-0000-0010-8000-00aa006d2ea4")) +Connection; + // [ default ] interface _Connection + // [ default, source ] dispinterface ConnectionEvents + +struct __declspec(uuid("00000560-0000-0010-8000-00aa006d2ea4")) +Record; + // [ default ] interface _Record + +struct __declspec(uuid("00001565-0000-0010-8000-00aa006d2ea4")) +_Stream : IDispatch +{ + // + // Property data + // + + __declspec(property(get=GetSize)) + long Size; + __declspec(property(get=GetEOS)) + VARIANT_BOOL EOS; + __declspec(property(get=GetPosition,put=PutPosition)) + long Position; + __declspec(property(get=GetType,put=PutType)) + enum StreamTypeEnum Type; + __declspec(property(get=GetLineSeparator,put=PutLineSeparator)) + enum LineSeparatorEnum LineSeparator; + __declspec(property(get=GetState)) + enum ObjectStateEnum State; + __declspec(property(get=GetMode,put=PutMode)) + enum ConnectModeEnum Mode; + __declspec(property(get=GetCharset,put=PutCharset)) + _bstr_t Charset; + + // + // Wrapper methods for error-handling + // + + long GetSize ( ); + VARIANT_BOOL GetEOS ( ); + long GetPosition ( ); + void PutPosition ( + long pPos ); + enum StreamTypeEnum GetType ( ); + void PutType ( + enum StreamTypeEnum ptype ); + enum LineSeparatorEnum GetLineSeparator ( ); + void PutLineSeparator ( + enum LineSeparatorEnum pLS ); + enum ObjectStateEnum GetState ( ); + enum ConnectModeEnum GetMode ( ); + void PutMode ( + enum ConnectModeEnum pMode ); + _bstr_t GetCharset ( ); + void PutCharset ( + _bstr_t pbstrCharset ); + _variant_t Read ( + long NumBytes ); + HRESULT Open ( + const _variant_t & Source, + enum ConnectModeEnum Mode, + enum StreamOpenOptionsEnum Options, + _bstr_t UserName, + _bstr_t Password ); + HRESULT Close ( ); + HRESULT SkipLine ( ); + HRESULT Write ( + const _variant_t & Buffer ); + HRESULT SetEOS ( ); + HRESULT CopyTo ( + struct _Stream * DestStream, + long CharNumber ); + HRESULT Flush ( ); + HRESULT SaveToFile ( + _bstr_t FileName, + enum SaveOptionsEnum Options ); + HRESULT LoadFromFile ( + _bstr_t FileName ); + _bstr_t ReadText ( + long NumChars ); + HRESULT WriteText ( + _bstr_t Data, + enum StreamWriteEnum Options ); + HRESULT Cancel ( ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_Size ( + /*[out,retval]*/ long * pSize ) = 0; + virtual HRESULT __stdcall get_EOS ( + /*[out,retval]*/ VARIANT_BOOL * pEOS ) = 0; + virtual HRESULT __stdcall get_Position ( + /*[out,retval]*/ long * pPos ) = 0; + virtual HRESULT __stdcall put_Position ( + /*[in]*/ long pPos ) = 0; + virtual HRESULT __stdcall get_Type ( + /*[out,retval]*/ enum StreamTypeEnum * ptype ) = 0; + virtual HRESULT __stdcall put_Type ( + /*[in]*/ enum StreamTypeEnum ptype ) = 0; + virtual HRESULT __stdcall get_LineSeparator ( + /*[out,retval]*/ enum LineSeparatorEnum * pLS ) = 0; + virtual HRESULT __stdcall put_LineSeparator ( + /*[in]*/ enum LineSeparatorEnum pLS ) = 0; + virtual HRESULT __stdcall get_State ( + /*[out,retval]*/ enum ObjectStateEnum * pState ) = 0; + virtual HRESULT __stdcall get_Mode ( + /*[out,retval]*/ enum ConnectModeEnum * pMode ) = 0; + virtual HRESULT __stdcall put_Mode ( + /*[in]*/ enum ConnectModeEnum pMode ) = 0; + virtual HRESULT __stdcall get_Charset ( + /*[out,retval]*/ BSTR * pbstrCharset ) = 0; + virtual HRESULT __stdcall put_Charset ( + /*[in]*/ BSTR pbstrCharset ) = 0; + virtual HRESULT __stdcall raw_Read ( + /*[in]*/ long NumBytes, + /*[out,retval]*/ VARIANT * pval ) = 0; + virtual HRESULT __stdcall raw_Open ( + /*[in]*/ VARIANT Source, + /*[in]*/ enum ConnectModeEnum Mode, + /*[in]*/ enum StreamOpenOptionsEnum Options, + /*[in]*/ BSTR UserName, + /*[in]*/ BSTR Password ) = 0; + virtual HRESULT __stdcall raw_Close ( ) = 0; + virtual HRESULT __stdcall raw_SkipLine ( ) = 0; + virtual HRESULT __stdcall raw_Write ( + /*[in]*/ VARIANT Buffer ) = 0; + virtual HRESULT __stdcall raw_SetEOS ( ) = 0; + virtual HRESULT __stdcall raw_CopyTo ( + /*[in]*/ struct _Stream * DestStream, + /*[in]*/ long CharNumber ) = 0; + virtual HRESULT __stdcall raw_Flush ( ) = 0; + virtual HRESULT __stdcall raw_SaveToFile ( + /*[in]*/ BSTR FileName, + /*[in]*/ enum SaveOptionsEnum Options ) = 0; + virtual HRESULT __stdcall raw_LoadFromFile ( + /*[in]*/ BSTR FileName ) = 0; + virtual HRESULT __stdcall raw_ReadText ( + /*[in]*/ long NumChars, + /*[out,retval]*/ BSTR * pbstr ) = 0; + virtual HRESULT __stdcall raw_WriteText ( + /*[in]*/ BSTR Data, + /*[in]*/ enum StreamWriteEnum Options ) = 0; + virtual HRESULT __stdcall raw_Cancel ( ) = 0; +}; + +struct __declspec(uuid("00000566-0000-0010-8000-00aa006d2ea4")) +Stream; + // [ default ] interface _Stream + +struct __declspec(uuid("00000567-0000-0010-8000-00aa006d2ea4")) +ADORecordConstruction : IDispatch +{ + // + // Property data + // + + __declspec(property(get=GetRow,put=PutRow)) + IUnknownPtr Row; + __declspec(property(put=PutParentRow)) + IUnknownPtr ParentRow; + + // + // Wrapper methods for error-handling + // + + IUnknownPtr GetRow ( ); + void PutRow ( + IUnknown * ppRow ); + void PutParentRow ( + IUnknown * _arg1 ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_Row ( + /*[out,retval]*/ IUnknown * * ppRow ) = 0; + virtual HRESULT __stdcall put_Row ( + /*[in]*/ IUnknown * ppRow ) = 0; + virtual HRESULT __stdcall put_ParentRow ( + /*[in]*/ IUnknown * _arg1 ) = 0; +}; + +struct __declspec(uuid("00000568-0000-0010-8000-00aa006d2ea4")) +ADOStreamConstruction : IDispatch +{ + // + // Property data + // + + __declspec(property(get=GetStream,put=PutStream)) + IUnknownPtr Stream; + + // + // Wrapper methods for error-handling + // + + IUnknownPtr GetStream ( ); + void PutStream ( + IUnknown * ppStm ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_Stream ( + /*[out,retval]*/ IUnknown * * ppStm ) = 0; + virtual HRESULT __stdcall put_Stream ( + /*[in]*/ IUnknown * ppStm ) = 0; +}; + +struct __declspec(uuid("00000517-0000-0010-8000-00aa006d2ea4")) +ADOCommandConstruction : IUnknown +{ + // + // Property data + // + + __declspec(property(get=GetOLEDBCommand,put=PutOLEDBCommand)) + IUnknownPtr OLEDBCommand; + + // + // Wrapper methods for error-handling + // + + IUnknownPtr GetOLEDBCommand ( ); + void PutOLEDBCommand ( + IUnknown * ppOLEDBCommand ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_OLEDBCommand ( + /*[out,retval]*/ IUnknown * * ppOLEDBCommand ) = 0; + virtual HRESULT __stdcall put_OLEDBCommand ( + /*[in]*/ IUnknown * ppOLEDBCommand ) = 0; +}; + +struct __declspec(uuid("00000507-0000-0010-8000-00aa006d2ea4")) +Command; + // [ default ] interface _Command + +struct __declspec(uuid("00000535-0000-0010-8000-00aa006d2ea4")) +Recordset; + // [ default ] interface _Recordset + // [ default, source ] dispinterface RecordsetEvents + +struct __declspec(uuid("00000283-0000-0010-8000-00aa006d2ea4")) +ADORecordsetConstruction : IDispatch +{ + // + // Property data + // + + __declspec(property(get=GetRowset,put=PutRowset)) + IUnknownPtr Rowset; + __declspec(property(get=GetChapter,put=PutChapter)) + ADO_LONGPTR Chapter; + __declspec(property(get=GetRowPosition,put=PutRowPosition)) + IUnknownPtr RowPosition; + + // + // Wrapper methods for error-handling + // + + IUnknownPtr GetRowset ( ); + void PutRowset ( + IUnknown * ppRowset ); + ADO_LONGPTR GetChapter ( ); + void PutChapter ( + ADO_LONGPTR plChapter ); + IUnknownPtr GetRowPosition ( ); + void PutRowPosition ( + IUnknown * ppRowPos ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_Rowset ( + /*[out,retval]*/ IUnknown * * ppRowset ) = 0; + virtual HRESULT __stdcall put_Rowset ( + /*[in]*/ IUnknown * ppRowset ) = 0; + virtual HRESULT __stdcall get_Chapter ( + /*[out,retval]*/ ADO_LONGPTR * plChapter ) = 0; + virtual HRESULT __stdcall put_Chapter ( + /*[in]*/ ADO_LONGPTR plChapter ) = 0; + virtual HRESULT __stdcall get_RowPosition ( + /*[out,retval]*/ IUnknown * * ppRowPos ) = 0; + virtual HRESULT __stdcall put_RowPosition ( + /*[in]*/ IUnknown * ppRowPos ) = 0; +}; + +struct __declspec(uuid("00001505-0000-0010-8000-00aa006d2ea4")) +Field15 : _ADO +{ + // + // Property data + // + + __declspec(property(get=GetValue,put=PutValue)) + _variant_t Value; + __declspec(property(get=GetName)) + _bstr_t Name; + __declspec(property(get=GetType)) + enum DataTypeEnum Type; + __declspec(property(get=GetDefinedSize)) + long DefinedSize; + __declspec(property(get=GetOriginalValue)) + _variant_t OriginalValue; + __declspec(property(get=GetUnderlyingValue)) + _variant_t UnderlyingValue; + __declspec(property(get=GetActualSize)) + long ActualSize; + __declspec(property(get=GetPrecision)) + unsigned char Precision; + __declspec(property(get=GetNumericScale)) + unsigned char NumericScale; + __declspec(property(get=GetAttributes)) + long Attributes; + + // + // Wrapper methods for error-handling + // + + long GetActualSize ( ); + long GetAttributes ( ); + long GetDefinedSize ( ); + _bstr_t GetName ( ); + enum DataTypeEnum GetType ( ); + _variant_t GetValue ( ); + void PutValue ( + const _variant_t & pvar ); + unsigned char GetPrecision ( ); + unsigned char GetNumericScale ( ); + HRESULT AppendChunk ( + const _variant_t & Data ); + _variant_t GetChunk ( + long Length ); + _variant_t GetOriginalValue ( ); + _variant_t GetUnderlyingValue ( ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_ActualSize ( + /*[out,retval]*/ long * pl ) = 0; + virtual HRESULT __stdcall get_Attributes ( + /*[out,retval]*/ long * pl ) = 0; + virtual HRESULT __stdcall get_DefinedSize ( + /*[out,retval]*/ long * pl ) = 0; + virtual HRESULT __stdcall get_Name ( + /*[out,retval]*/ BSTR * pbstr ) = 0; + virtual HRESULT __stdcall get_Type ( + /*[out,retval]*/ enum DataTypeEnum * pDataType ) = 0; + virtual HRESULT __stdcall get_Value ( + /*[out,retval]*/ VARIANT * pvar ) = 0; + virtual HRESULT __stdcall put_Value ( + /*[in]*/ VARIANT pvar ) = 0; + virtual HRESULT __stdcall get_Precision ( + /*[out,retval]*/ unsigned char * pbPrecision ) = 0; + virtual HRESULT __stdcall get_NumericScale ( + /*[out,retval]*/ unsigned char * pbNumericScale ) = 0; + virtual HRESULT __stdcall raw_AppendChunk ( + /*[in]*/ VARIANT Data ) = 0; + virtual HRESULT __stdcall raw_GetChunk ( + /*[in]*/ long Length, + /*[out,retval]*/ VARIANT * pvar ) = 0; + virtual HRESULT __stdcall get_OriginalValue ( + /*[out,retval]*/ VARIANT * pvar ) = 0; + virtual HRESULT __stdcall get_UnderlyingValue ( + /*[out,retval]*/ VARIANT * pvar ) = 0; +}; + +struct __declspec(uuid("0000050b-0000-0010-8000-00aa006d2ea4")) +Parameter; + // [ default ] interface _Parameter + +struct __declspec(uuid("0000054c-0000-0010-8000-00aa006d2ea4")) +Field20_Deprecated : _ADO +{ + // + // Property data + // + + __declspec(property(get=GetValue,put=PutValue)) + _variant_t Value; + __declspec(property(get=GetName)) + _bstr_t Name; + __declspec(property(get=GetType,put=PutType)) + enum DataTypeEnum Type; + __declspec(property(get=GetDefinedSize,put=PutDefinedSize)) + ADO_LONGPTR DefinedSize; + __declspec(property(get=GetOriginalValue)) + _variant_t OriginalValue; + __declspec(property(get=GetUnderlyingValue)) + _variant_t UnderlyingValue; + __declspec(property(get=GetActualSize)) + ADO_LONGPTR ActualSize; + __declspec(property(get=GetPrecision,put=PutPrecision)) + unsigned char Precision; + __declspec(property(get=GetNumericScale,put=PutNumericScale)) + unsigned char NumericScale; + __declspec(property(get=GetAttributes,put=PutAttributes)) + long Attributes; + __declspec(property(get=GetDataFormat,put=PutRefDataFormat)) + IUnknownPtr DataFormat; + + // + // Wrapper methods for error-handling + // + + ADO_LONGPTR GetActualSize ( ); + long GetAttributes ( ); + ADO_LONGPTR GetDefinedSize ( ); + _bstr_t GetName ( ); + enum DataTypeEnum GetType ( ); + _variant_t GetValue ( ); + void PutValue ( + const _variant_t & pvar ); + unsigned char GetPrecision ( ); + unsigned char GetNumericScale ( ); + HRESULT AppendChunk ( + const _variant_t & Data ); + _variant_t GetChunk ( + long Length ); + _variant_t GetOriginalValue ( ); + _variant_t GetUnderlyingValue ( ); + IUnknownPtr GetDataFormat ( ); + void PutRefDataFormat ( + IUnknown * ppiDF ); + void PutPrecision ( + unsigned char pbPrecision ); + void PutNumericScale ( + unsigned char pbNumericScale ); + void PutType ( + enum DataTypeEnum pDataType ); + void PutDefinedSize ( + ADO_LONGPTR pl ); + void PutAttributes ( + long pl ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_ActualSize ( + /*[out,retval]*/ ADO_LONGPTR * pl ) = 0; + virtual HRESULT __stdcall get_Attributes ( + /*[out,retval]*/ long * pl ) = 0; + virtual HRESULT __stdcall get_DefinedSize ( + /*[out,retval]*/ ADO_LONGPTR * pl ) = 0; + virtual HRESULT __stdcall get_Name ( + /*[out,retval]*/ BSTR * pbstr ) = 0; + virtual HRESULT __stdcall get_Type ( + /*[out,retval]*/ enum DataTypeEnum * pDataType ) = 0; + virtual HRESULT __stdcall get_Value ( + /*[out,retval]*/ VARIANT * pvar ) = 0; + virtual HRESULT __stdcall put_Value ( + /*[in]*/ VARIANT pvar ) = 0; + virtual HRESULT __stdcall get_Precision ( + /*[out,retval]*/ unsigned char * pbPrecision ) = 0; + virtual HRESULT __stdcall get_NumericScale ( + /*[out,retval]*/ unsigned char * pbNumericScale ) = 0; + virtual HRESULT __stdcall raw_AppendChunk ( + /*[in]*/ VARIANT Data ) = 0; + virtual HRESULT __stdcall raw_GetChunk ( + /*[in]*/ long Length, + /*[out,retval]*/ VARIANT * pvar ) = 0; + virtual HRESULT __stdcall get_OriginalValue ( + /*[out,retval]*/ VARIANT * pvar ) = 0; + virtual HRESULT __stdcall get_UnderlyingValue ( + /*[out,retval]*/ VARIANT * pvar ) = 0; + virtual HRESULT __stdcall get_DataFormat ( + /*[out,retval]*/ IUnknown * * ppiDF ) = 0; + virtual HRESULT __stdcall putref_DataFormat ( + /*[in]*/ IUnknown * ppiDF ) = 0; + virtual HRESULT __stdcall put_Precision ( + /*[in]*/ unsigned char pbPrecision ) = 0; + virtual HRESULT __stdcall put_NumericScale ( + /*[in]*/ unsigned char pbNumericScale ) = 0; + virtual HRESULT __stdcall put_Type ( + /*[in]*/ enum DataTypeEnum pDataType ) = 0; + virtual HRESULT __stdcall put_DefinedSize ( + /*[in]*/ ADO_LONGPTR pl ) = 0; + virtual HRESULT __stdcall put_Attributes ( + /*[in]*/ long pl ) = 0; +}; + +struct __declspec(uuid("00000569-0000-0010-8000-00aa006d2ea4")) +Field_Deprecated : Field20_Deprecated +{ + // + // Property data + // + + __declspec(property(get=GetStatus)) + long Status; + + // + // Wrapper methods for error-handling + // + + long GetStatus ( ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_Status ( + /*[out,retval]*/ long * pFStatus ) = 0; +}; + +struct __declspec(uuid("00000506-0000-0010-8000-00aa006d2ea4")) +Fields15_Deprecated : _Collection +{ + // + // Property data + // + + __declspec(property(get=GetItem)) + Field_DeprecatedPtr Item[]; + + // + // Wrapper methods for error-handling + // + + Field_DeprecatedPtr GetItem ( + const _variant_t & Index ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_Item ( + /*[in]*/ VARIANT Index, + /*[out,retval]*/ struct Field_Deprecated * * ppvObject ) = 0; +}; + +struct __declspec(uuid("0000054d-0000-0010-8000-00aa006d2ea4")) +Fields20_Deprecated : Fields15_Deprecated +{ + // + // Wrapper methods for error-handling + // + + HRESULT _Append ( + _bstr_t Name, + enum DataTypeEnum Type, + ADO_LONGPTR DefinedSize, + enum FieldAttributeEnum Attrib ); + HRESULT Delete ( + const _variant_t & Index ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall raw__Append ( + /*[in]*/ BSTR Name, + /*[in]*/ enum DataTypeEnum Type, + /*[in]*/ ADO_LONGPTR DefinedSize, + /*[in]*/ enum FieldAttributeEnum Attrib ) = 0; + virtual HRESULT __stdcall raw_Delete ( + /*[in]*/ VARIANT Index ) = 0; +}; + +struct __declspec(uuid("00000564-0000-0010-8000-00aa006d2ea4")) +Fields_Deprecated : Fields20_Deprecated +{ + // + // Wrapper methods for error-handling + // + + HRESULT Append ( + _bstr_t Name, + enum DataTypeEnum Type, + ADO_LONGPTR DefinedSize, + enum FieldAttributeEnum Attrib, + const _variant_t & FieldValue = vtMissing ); + HRESULT Update ( ); + HRESULT Resync ( + enum ResyncEnum ResyncValues ); + HRESULT CancelUpdate ( ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall raw_Append ( + /*[in]*/ BSTR Name, + /*[in]*/ enum DataTypeEnum Type, + /*[in]*/ ADO_LONGPTR DefinedSize, + /*[in]*/ enum FieldAttributeEnum Attrib, + /*[in]*/ VARIANT FieldValue = vtMissing ) = 0; + virtual HRESULT __stdcall raw_Update ( ) = 0; + virtual HRESULT __stdcall raw_Resync ( + /*[in]*/ enum ResyncEnum ResyncValues ) = 0; + virtual HRESULT __stdcall raw_CancelUpdate ( ) = 0; +}; + +struct __declspec(uuid("0000050c-0000-0010-8000-00aa006d2ea4")) +_Parameter_Deprecated : _ADO +{ + // + // Property data + // + + __declspec(property(get=GetValue,put=PutValue)) + _variant_t Value; + __declspec(property(get=GetName,put=PutName)) + _bstr_t Name; + __declspec(property(get=GetType,put=PutType)) + enum DataTypeEnum Type; + __declspec(property(get=GetDirection,put=PutDirection)) + enum ParameterDirectionEnum Direction; + __declspec(property(get=GetPrecision,put=PutPrecision)) + unsigned char Precision; + __declspec(property(get=GetNumericScale,put=PutNumericScale)) + unsigned char NumericScale; + __declspec(property(get=GetSize,put=PutSize)) + ADO_LONGPTR Size; + __declspec(property(get=GetAttributes,put=PutAttributes)) + long Attributes; + + // + // Wrapper methods for error-handling + // + + _bstr_t GetName ( ); + void PutName ( + _bstr_t pbstr ); + _variant_t GetValue ( ); + void PutValue ( + const _variant_t & pvar ); + enum DataTypeEnum GetType ( ); + void PutType ( + enum DataTypeEnum psDataType ); + void PutDirection ( + enum ParameterDirectionEnum plParmDirection ); + enum ParameterDirectionEnum GetDirection ( ); + void PutPrecision ( + unsigned char pbPrecision ); + unsigned char GetPrecision ( ); + void PutNumericScale ( + unsigned char pbScale ); + unsigned char GetNumericScale ( ); + void PutSize ( + ADO_LONGPTR pl ); + ADO_LONGPTR GetSize ( ); + HRESULT AppendChunk ( + const _variant_t & Val ); + long GetAttributes ( ); + void PutAttributes ( + long plParmAttribs ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_Name ( + /*[out,retval]*/ BSTR * pbstr ) = 0; + virtual HRESULT __stdcall put_Name ( + /*[in]*/ BSTR pbstr ) = 0; + virtual HRESULT __stdcall get_Value ( + /*[out,retval]*/ VARIANT * pvar ) = 0; + virtual HRESULT __stdcall put_Value ( + /*[in]*/ VARIANT pvar ) = 0; + virtual HRESULT __stdcall get_Type ( + /*[out,retval]*/ enum DataTypeEnum * psDataType ) = 0; + virtual HRESULT __stdcall put_Type ( + /*[in]*/ enum DataTypeEnum psDataType ) = 0; + virtual HRESULT __stdcall put_Direction ( + /*[in]*/ enum ParameterDirectionEnum plParmDirection ) = 0; + virtual HRESULT __stdcall get_Direction ( + /*[out,retval]*/ enum ParameterDirectionEnum * plParmDirection ) = 0; + virtual HRESULT __stdcall put_Precision ( + /*[in]*/ unsigned char pbPrecision ) = 0; + virtual HRESULT __stdcall get_Precision ( + /*[out,retval]*/ unsigned char * pbPrecision ) = 0; + virtual HRESULT __stdcall put_NumericScale ( + /*[in]*/ unsigned char pbScale ) = 0; + virtual HRESULT __stdcall get_NumericScale ( + /*[out,retval]*/ unsigned char * pbScale ) = 0; + virtual HRESULT __stdcall put_Size ( + /*[in]*/ ADO_LONGPTR pl ) = 0; + virtual HRESULT __stdcall get_Size ( + /*[out,retval]*/ ADO_LONGPTR * pl ) = 0; + virtual HRESULT __stdcall raw_AppendChunk ( + /*[in]*/ VARIANT Val ) = 0; + virtual HRESULT __stdcall get_Attributes ( + /*[out,retval]*/ long * plParmAttribs ) = 0; + virtual HRESULT __stdcall put_Attributes ( + /*[in]*/ long plParmAttribs ) = 0; +}; + +struct __declspec(uuid("0000050d-0000-0010-8000-00aa006d2ea4")) +Parameters_Deprecated : _DynaCollection +{ + // + // Property data + // + + __declspec(property(get=GetItem)) + _Parameter_DeprecatedPtr Item[]; + + // + // Wrapper methods for error-handling + // + + _Parameter_DeprecatedPtr GetItem ( + const _variant_t & Index ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_Item ( + /*[in]*/ VARIANT Index, + /*[out,retval]*/ struct _Parameter_Deprecated * * ppvObject ) = 0; +}; + +struct __declspec(uuid("00000400-0000-0010-8000-00aa006d2ea4")) +ConnectionEvents_Deprecated : IDispatch +{ + // + // Wrapper methods for error-handling + // + + // Methods: + HRESULT InfoMessage ( + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Connection_Deprecated * pConnection ); + HRESULT BeginTransComplete ( + long TransactionLevel, + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Connection_Deprecated * pConnection ); + HRESULT CommitTransComplete ( + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Connection_Deprecated * pConnection ); + HRESULT RollbackTransComplete ( + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Connection_Deprecated * pConnection ); + HRESULT WillExecute ( + BSTR * Source, + enum CursorTypeEnum * CursorType, + enum LockTypeEnum * LockType, + long * Options, + enum EventStatusEnum * adStatus, + struct _Command_Deprecated * pCommand, + struct _Recordset_Deprecated * pRecordset, + struct _Connection_Deprecated * pConnection ); + HRESULT ExecuteComplete ( + long RecordsAffected, + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Command_Deprecated * pCommand, + struct _Recordset_Deprecated * pRecordset, + struct _Connection_Deprecated * pConnection ); + HRESULT WillConnect ( + BSTR * ConnectionString, + BSTR * UserID, + BSTR * Password, + long * Options, + enum EventStatusEnum * adStatus, + struct _Connection_Deprecated * pConnection ); + HRESULT ConnectComplete ( + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Connection_Deprecated * pConnection ); + HRESULT Disconnect ( + enum EventStatusEnum * adStatus, + struct _Connection_Deprecated * pConnection ); +}; + +struct __declspec(uuid("00000266-0000-0010-8000-00aa006d2ea4")) +RecordsetEvents_Deprecated : IDispatch +{ + // + // Wrapper methods for error-handling + // + + // Methods: + HRESULT WillChangeField ( + long cFields, + const _variant_t & Fields, + enum EventStatusEnum * adStatus, + struct _Recordset_Deprecated * pRecordset ); + HRESULT FieldChangeComplete ( + long cFields, + const _variant_t & Fields, + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Recordset_Deprecated * pRecordset ); + HRESULT WillChangeRecord ( + enum EventReasonEnum adReason, + long cRecords, + enum EventStatusEnum * adStatus, + struct _Recordset_Deprecated * pRecordset ); + HRESULT RecordChangeComplete ( + enum EventReasonEnum adReason, + long cRecords, + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Recordset_Deprecated * pRecordset ); + HRESULT WillChangeRecordset ( + enum EventReasonEnum adReason, + enum EventStatusEnum * adStatus, + struct _Recordset_Deprecated * pRecordset ); + HRESULT RecordsetChangeComplete ( + enum EventReasonEnum adReason, + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Recordset_Deprecated * pRecordset ); + HRESULT WillMove ( + enum EventReasonEnum adReason, + enum EventStatusEnum * adStatus, + struct _Recordset_Deprecated * pRecordset ); + HRESULT MoveComplete ( + enum EventReasonEnum adReason, + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Recordset_Deprecated * pRecordset ); + HRESULT EndOfRecordset ( + VARIANT_BOOL * fMoreData, + enum EventStatusEnum * adStatus, + struct _Recordset_Deprecated * pRecordset ); + HRESULT FetchProgress ( + long Progress, + long MaxProgress, + enum EventStatusEnum * adStatus, + struct _Recordset_Deprecated * pRecordset ); + HRESULT FetchComplete ( + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Recordset_Deprecated * pRecordset ); +}; + +struct __declspec(uuid("00000565-0000-0010-8000-00aa006d2ea4")) +_Stream_Deprecated : IDispatch +{ + // + // Property data + // + + __declspec(property(get=GetSize)) + ADO_LONGPTR Size; + __declspec(property(get=GetEOS)) + VARIANT_BOOL EOS; + __declspec(property(get=GetPosition,put=PutPosition)) + ADO_LONGPTR Position; + __declspec(property(get=GetType,put=PutType)) + enum StreamTypeEnum Type; + __declspec(property(get=GetLineSeparator,put=PutLineSeparator)) + enum LineSeparatorEnum LineSeparator; + __declspec(property(get=GetState)) + enum ObjectStateEnum State; + __declspec(property(get=GetMode,put=PutMode)) + enum ConnectModeEnum Mode; + __declspec(property(get=GetCharset,put=PutCharset)) + _bstr_t Charset; + + // + // Wrapper methods for error-handling + // + + ADO_LONGPTR GetSize ( ); + VARIANT_BOOL GetEOS ( ); + ADO_LONGPTR GetPosition ( ); + void PutPosition ( + ADO_LONGPTR pPos ); + enum StreamTypeEnum GetType ( ); + void PutType ( + enum StreamTypeEnum ptype ); + enum LineSeparatorEnum GetLineSeparator ( ); + void PutLineSeparator ( + enum LineSeparatorEnum pLS ); + enum ObjectStateEnum GetState ( ); + enum ConnectModeEnum GetMode ( ); + void PutMode ( + enum ConnectModeEnum pMode ); + _bstr_t GetCharset ( ); + void PutCharset ( + _bstr_t pbstrCharset ); + _variant_t Read ( + long NumBytes ); + HRESULT Open ( + const _variant_t & Source, + enum ConnectModeEnum Mode, + enum StreamOpenOptionsEnum Options, + _bstr_t UserName, + _bstr_t Password ); + HRESULT Close ( ); + HRESULT SkipLine ( ); + HRESULT Write ( + const _variant_t & Buffer ); + HRESULT SetEOS ( ); + HRESULT CopyTo ( + struct _Stream_Deprecated * DestStream, + ADO_LONGPTR CharNumber ); + HRESULT Flush ( ); + HRESULT SaveToFile ( + _bstr_t FileName, + enum SaveOptionsEnum Options ); + HRESULT LoadFromFile ( + _bstr_t FileName ); + _bstr_t ReadText ( + long NumChars ); + HRESULT WriteText ( + _bstr_t Data, + enum StreamWriteEnum Options ); + HRESULT Cancel ( ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_Size ( + /*[out,retval]*/ ADO_LONGPTR * pSize ) = 0; + virtual HRESULT __stdcall get_EOS ( + /*[out,retval]*/ VARIANT_BOOL * pEOS ) = 0; + virtual HRESULT __stdcall get_Position ( + /*[out,retval]*/ ADO_LONGPTR * pPos ) = 0; + virtual HRESULT __stdcall put_Position ( + /*[in]*/ ADO_LONGPTR pPos ) = 0; + virtual HRESULT __stdcall get_Type ( + /*[out,retval]*/ enum StreamTypeEnum * ptype ) = 0; + virtual HRESULT __stdcall put_Type ( + /*[in]*/ enum StreamTypeEnum ptype ) = 0; + virtual HRESULT __stdcall get_LineSeparator ( + /*[out,retval]*/ enum LineSeparatorEnum * pLS ) = 0; + virtual HRESULT __stdcall put_LineSeparator ( + /*[in]*/ enum LineSeparatorEnum pLS ) = 0; + virtual HRESULT __stdcall get_State ( + /*[out,retval]*/ enum ObjectStateEnum * pState ) = 0; + virtual HRESULT __stdcall get_Mode ( + /*[out,retval]*/ enum ConnectModeEnum * pMode ) = 0; + virtual HRESULT __stdcall put_Mode ( + /*[in]*/ enum ConnectModeEnum pMode ) = 0; + virtual HRESULT __stdcall get_Charset ( + /*[out,retval]*/ BSTR * pbstrCharset ) = 0; + virtual HRESULT __stdcall put_Charset ( + /*[in]*/ BSTR pbstrCharset ) = 0; + virtual HRESULT __stdcall raw_Read ( + /*[in]*/ long NumBytes, + /*[out,retval]*/ VARIANT * pval ) = 0; + virtual HRESULT __stdcall raw_Open ( + /*[in]*/ VARIANT Source, + /*[in]*/ enum ConnectModeEnum Mode, + /*[in]*/ enum StreamOpenOptionsEnum Options, + /*[in]*/ BSTR UserName, + /*[in]*/ BSTR Password ) = 0; + virtual HRESULT __stdcall raw_Close ( ) = 0; + virtual HRESULT __stdcall raw_SkipLine ( ) = 0; + virtual HRESULT __stdcall raw_Write ( + /*[in]*/ VARIANT Buffer ) = 0; + virtual HRESULT __stdcall raw_SetEOS ( ) = 0; + virtual HRESULT __stdcall raw_CopyTo ( + /*[in]*/ struct _Stream_Deprecated * DestStream, + /*[in]*/ ADO_LONGPTR CharNumber ) = 0; + virtual HRESULT __stdcall raw_Flush ( ) = 0; + virtual HRESULT __stdcall raw_SaveToFile ( + /*[in]*/ BSTR FileName, + /*[in]*/ enum SaveOptionsEnum Options ) = 0; + virtual HRESULT __stdcall raw_LoadFromFile ( + /*[in]*/ BSTR FileName ) = 0; + virtual HRESULT __stdcall raw_ReadText ( + /*[in]*/ long NumChars, + /*[out,retval]*/ BSTR * pbstr ) = 0; + virtual HRESULT __stdcall raw_WriteText ( + /*[in]*/ BSTR Data, + /*[in]*/ enum StreamWriteEnum Options ) = 0; + virtual HRESULT __stdcall raw_Cancel ( ) = 0; +}; + +struct __declspec(uuid("00000505-0000-0010-8000-00aa006d2ea4")) +Field15_Deprecated : _ADO +{ + // + // Property data + // + + __declspec(property(get=GetValue,put=PutValue)) + _variant_t Value; + __declspec(property(get=GetName)) + _bstr_t Name; + __declspec(property(get=GetType)) + enum DataTypeEnum Type; + __declspec(property(get=GetDefinedSize)) + ADO_LONGPTR DefinedSize; + __declspec(property(get=GetOriginalValue)) + _variant_t OriginalValue; + __declspec(property(get=GetUnderlyingValue)) + _variant_t UnderlyingValue; + __declspec(property(get=GetActualSize)) + ADO_LONGPTR ActualSize; + __declspec(property(get=GetPrecision)) + unsigned char Precision; + __declspec(property(get=GetNumericScale)) + unsigned char NumericScale; + __declspec(property(get=GetAttributes)) + long Attributes; + + // + // Wrapper methods for error-handling + // + + ADO_LONGPTR GetActualSize ( ); + long GetAttributes ( ); + ADO_LONGPTR GetDefinedSize ( ); + _bstr_t GetName ( ); + enum DataTypeEnum GetType ( ); + _variant_t GetValue ( ); + void PutValue ( + const _variant_t & pvar ); + unsigned char GetPrecision ( ); + unsigned char GetNumericScale ( ); + HRESULT AppendChunk ( + const _variant_t & Data ); + _variant_t GetChunk ( + long Length ); + _variant_t GetOriginalValue ( ); + _variant_t GetUnderlyingValue ( ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_ActualSize ( + /*[out,retval]*/ ADO_LONGPTR * pl ) = 0; + virtual HRESULT __stdcall get_Attributes ( + /*[out,retval]*/ long * pl ) = 0; + virtual HRESULT __stdcall get_DefinedSize ( + /*[out,retval]*/ ADO_LONGPTR * pl ) = 0; + virtual HRESULT __stdcall get_Name ( + /*[out,retval]*/ BSTR * pbstr ) = 0; + virtual HRESULT __stdcall get_Type ( + /*[out,retval]*/ enum DataTypeEnum * pDataType ) = 0; + virtual HRESULT __stdcall get_Value ( + /*[out,retval]*/ VARIANT * pvar ) = 0; + virtual HRESULT __stdcall put_Value ( + /*[in]*/ VARIANT pvar ) = 0; + virtual HRESULT __stdcall get_Precision ( + /*[out,retval]*/ unsigned char * pbPrecision ) = 0; + virtual HRESULT __stdcall get_NumericScale ( + /*[out,retval]*/ unsigned char * pbNumericScale ) = 0; + virtual HRESULT __stdcall raw_AppendChunk ( + /*[in]*/ VARIANT Data ) = 0; + virtual HRESULT __stdcall raw_GetChunk ( + /*[in]*/ long Length, + /*[out,retval]*/ VARIANT * pvar ) = 0; + virtual HRESULT __stdcall get_OriginalValue ( + /*[out,retval]*/ VARIANT * pvar ) = 0; + virtual HRESULT __stdcall get_UnderlyingValue ( + /*[out,retval]*/ VARIANT * pvar ) = 0; +}; + +struct __declspec(uuid("00001508-0000-0010-8000-00aa006d2ea4")) +Command15 : _ADO +{ + // + // Property data + // + + __declspec(property(get=GetParameters)) + ParametersPtr Parameters; + __declspec(property(get=GetActiveConnection,put=PutRefActiveConnection)) + _ConnectionPtr ActiveConnection; + __declspec(property(get=GetCommandText,put=PutCommandText)) + _bstr_t CommandText; + __declspec(property(get=GetCommandTimeout,put=PutCommandTimeout)) + long CommandTimeout; + __declspec(property(get=GetPrepared,put=PutPrepared)) + VARIANT_BOOL Prepared; + __declspec(property(get=GetCommandType,put=PutCommandType)) + enum CommandTypeEnum CommandType; + __declspec(property(get=GetName,put=PutName)) + _bstr_t Name; + + // + // Wrapper methods for error-handling + // + + _ConnectionPtr GetActiveConnection ( ); + void PutRefActiveConnection ( + struct _Connection * ppvObject ); + void PutActiveConnection ( + const _variant_t & ppvObject ); + _bstr_t GetCommandText ( ); + void PutCommandText ( + _bstr_t pbstr ); + long GetCommandTimeout ( ); + void PutCommandTimeout ( + long pl ); + VARIANT_BOOL GetPrepared ( ); + void PutPrepared ( + VARIANT_BOOL pfPrepared ); + _RecordsetPtr Execute ( + VARIANT * RecordsAffected, + VARIANT * Parameters, + long Options ); + _ParameterPtr CreateParameter ( + _bstr_t Name, + enum DataTypeEnum Type, + enum ParameterDirectionEnum Direction, + long Size, + const _variant_t & Value = vtMissing ); + ParametersPtr GetParameters ( ); + void PutCommandType ( + enum CommandTypeEnum plCmdType ); + enum CommandTypeEnum GetCommandType ( ); + _bstr_t GetName ( ); + void PutName ( + _bstr_t pbstrName ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_ActiveConnection ( + /*[out,retval]*/ struct _Connection * * ppvObject ) = 0; + virtual HRESULT __stdcall putref_ActiveConnection ( + /*[in]*/ struct _Connection * ppvObject ) = 0; + virtual HRESULT __stdcall put_ActiveConnection ( + /*[in]*/ VARIANT ppvObject ) = 0; + virtual HRESULT __stdcall get_CommandText ( + /*[out,retval]*/ BSTR * pbstr ) = 0; + virtual HRESULT __stdcall put_CommandText ( + /*[in]*/ BSTR pbstr ) = 0; + virtual HRESULT __stdcall get_CommandTimeout ( + /*[out,retval]*/ long * pl ) = 0; + virtual HRESULT __stdcall put_CommandTimeout ( + /*[in]*/ long pl ) = 0; + virtual HRESULT __stdcall get_Prepared ( + /*[out,retval]*/ VARIANT_BOOL * pfPrepared ) = 0; + virtual HRESULT __stdcall put_Prepared ( + /*[in]*/ VARIANT_BOOL pfPrepared ) = 0; + virtual HRESULT __stdcall raw_Execute ( + /*[out]*/ VARIANT * RecordsAffected, + /*[in]*/ VARIANT * Parameters, + /*[in]*/ long Options, + /*[out,retval]*/ struct _Recordset * * ppiRs ) = 0; + virtual HRESULT __stdcall raw_CreateParameter ( + /*[in]*/ BSTR Name, + /*[in]*/ enum DataTypeEnum Type, + /*[in]*/ enum ParameterDirectionEnum Direction, + /*[in]*/ long Size, + /*[in]*/ VARIANT Value, + /*[out,retval]*/ struct _Parameter * * ppiprm ) = 0; + virtual HRESULT __stdcall get_Parameters ( + /*[out,retval]*/ struct Parameters * * ppvObject ) = 0; + virtual HRESULT __stdcall put_CommandType ( + /*[in]*/ enum CommandTypeEnum plCmdType ) = 0; + virtual HRESULT __stdcall get_CommandType ( + /*[out,retval]*/ enum CommandTypeEnum * plCmdType ) = 0; + virtual HRESULT __stdcall get_Name ( + /*[out,retval]*/ BSTR * pbstrName ) = 0; + virtual HRESULT __stdcall put_Name ( + /*[in]*/ BSTR pbstrName ) = 0; +}; + +struct __declspec(uuid("0000154e-0000-0010-8000-00aa006d2ea4")) +Command25 : Command15 +{ + // + // Property data + // + + __declspec(property(get=GetState)) + long State; + + // + // Wrapper methods for error-handling + // + + long GetState ( ); + HRESULT Cancel ( ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_State ( + /*[out,retval]*/ long * plObjState ) = 0; + virtual HRESULT __stdcall raw_Cancel ( ) = 0; +}; + +struct __declspec(uuid("986761e8-7269-4890-aa65-ad7c03697a6d")) +_Command : Command25 +{ + // + // Property data + // + + __declspec(property(get=GetDialect,put=PutDialect)) + _bstr_t Dialect; + __declspec(property(get=GetNamedParameters,put=PutNamedParameters)) + VARIANT_BOOL NamedParameters; + + // + // Wrapper methods for error-handling + // + + void PutRefCommandStream ( + IUnknown * pvStream ); + _variant_t GetCommandStream ( ); + void PutDialect ( + _bstr_t pbstrDialect ); + _bstr_t GetDialect ( ); + void PutNamedParameters ( + VARIANT_BOOL pfNamedParameters ); + VARIANT_BOOL GetNamedParameters ( ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall putref_CommandStream ( + /*[in]*/ IUnknown * pvStream ) = 0; + virtual HRESULT __stdcall get_CommandStream ( + /*[out,retval]*/ VARIANT * pvStream ) = 0; + virtual HRESULT __stdcall put_Dialect ( + /*[in]*/ BSTR pbstrDialect ) = 0; + virtual HRESULT __stdcall get_Dialect ( + /*[out,retval]*/ BSTR * pbstrDialect ) = 0; + virtual HRESULT __stdcall put_NamedParameters ( + /*[in]*/ VARIANT_BOOL pfNamedParameters ) = 0; + virtual HRESULT __stdcall get_NamedParameters ( + /*[out,retval]*/ VARIANT_BOOL * pfNamedParameters ) = 0; +}; + +struct __declspec(uuid("00001515-0000-0010-8000-00aa006d2ea4")) +Connection15 : _ADO +{ + // + // Property data + // + + __declspec(property(get=GetConnectionString,put=PutConnectionString)) + _bstr_t ConnectionString; + __declspec(property(get=GetCommandTimeout,put=PutCommandTimeout)) + long CommandTimeout; + __declspec(property(get=GetConnectionTimeout,put=PutConnectionTimeout)) + long ConnectionTimeout; + __declspec(property(get=GetVersion)) + _bstr_t Version; + __declspec(property(get=GetErrors)) + ErrorsPtr Errors; + __declspec(property(get=GetDefaultDatabase,put=PutDefaultDatabase)) + _bstr_t DefaultDatabase; + __declspec(property(get=GetIsolationLevel,put=PutIsolationLevel)) + enum IsolationLevelEnum IsolationLevel; + __declspec(property(get=GetAttributes,put=PutAttributes)) + long Attributes; + __declspec(property(get=GetCursorLocation,put=PutCursorLocation)) + enum CursorLocationEnum CursorLocation; + __declspec(property(get=GetMode,put=PutMode)) + enum ConnectModeEnum Mode; + __declspec(property(get=GetProvider,put=PutProvider)) + _bstr_t Provider; + __declspec(property(get=GetState)) + long State; + + // + // Wrapper methods for error-handling + // + + _bstr_t GetConnectionString ( ); + void PutConnectionString ( + _bstr_t pbstr ); + long GetCommandTimeout ( ); + void PutCommandTimeout ( + long plTimeout ); + long GetConnectionTimeout ( ); + void PutConnectionTimeout ( + long plTimeout ); + _bstr_t GetVersion ( ); + HRESULT Close ( ); + _RecordsetPtr Execute ( + _bstr_t CommandText, + VARIANT * RecordsAffected, + long Options ); + long BeginTrans ( ); + HRESULT CommitTrans ( ); + HRESULT RollbackTrans ( ); + HRESULT Open ( + _bstr_t ConnectionString, + _bstr_t UserID, + _bstr_t Password, + long Options ); + ErrorsPtr GetErrors ( ); + _bstr_t GetDefaultDatabase ( ); + void PutDefaultDatabase ( + _bstr_t pbstr ); + enum IsolationLevelEnum GetIsolationLevel ( ); + void PutIsolationLevel ( + enum IsolationLevelEnum Level ); + long GetAttributes ( ); + void PutAttributes ( + long plAttr ); + enum CursorLocationEnum GetCursorLocation ( ); + void PutCursorLocation ( + enum CursorLocationEnum plCursorLoc ); + enum ConnectModeEnum GetMode ( ); + void PutMode ( + enum ConnectModeEnum plMode ); + _bstr_t GetProvider ( ); + void PutProvider ( + _bstr_t pbstr ); + long GetState ( ); + _RecordsetPtr OpenSchema ( + enum SchemaEnum Schema, + const _variant_t & Restrictions = vtMissing, + const _variant_t & SchemaID = vtMissing ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_ConnectionString ( + /*[out,retval]*/ BSTR * pbstr ) = 0; + virtual HRESULT __stdcall put_ConnectionString ( + /*[in]*/ BSTR pbstr ) = 0; + virtual HRESULT __stdcall get_CommandTimeout ( + /*[out,retval]*/ long * plTimeout ) = 0; + virtual HRESULT __stdcall put_CommandTimeout ( + /*[in]*/ long plTimeout ) = 0; + virtual HRESULT __stdcall get_ConnectionTimeout ( + /*[out,retval]*/ long * plTimeout ) = 0; + virtual HRESULT __stdcall put_ConnectionTimeout ( + /*[in]*/ long plTimeout ) = 0; + virtual HRESULT __stdcall get_Version ( + /*[out,retval]*/ BSTR * pbstr ) = 0; + virtual HRESULT __stdcall raw_Close ( ) = 0; + virtual HRESULT __stdcall raw_Execute ( + /*[in]*/ BSTR CommandText, + /*[out]*/ VARIANT * RecordsAffected, + /*[in]*/ long Options, + /*[out,retval]*/ struct _Recordset * * ppiRset ) = 0; + virtual HRESULT __stdcall raw_BeginTrans ( + /*[out,retval]*/ long * TransactionLevel ) = 0; + virtual HRESULT __stdcall raw_CommitTrans ( ) = 0; + virtual HRESULT __stdcall raw_RollbackTrans ( ) = 0; + virtual HRESULT __stdcall raw_Open ( + /*[in]*/ BSTR ConnectionString, + /*[in]*/ BSTR UserID, + /*[in]*/ BSTR Password, + /*[in]*/ long Options ) = 0; + virtual HRESULT __stdcall get_Errors ( + /*[out,retval]*/ struct Errors * * ppvObject ) = 0; + virtual HRESULT __stdcall get_DefaultDatabase ( + /*[out,retval]*/ BSTR * pbstr ) = 0; + virtual HRESULT __stdcall put_DefaultDatabase ( + /*[in]*/ BSTR pbstr ) = 0; + virtual HRESULT __stdcall get_IsolationLevel ( + /*[out,retval]*/ enum IsolationLevelEnum * Level ) = 0; + virtual HRESULT __stdcall put_IsolationLevel ( + /*[in]*/ enum IsolationLevelEnum Level ) = 0; + virtual HRESULT __stdcall get_Attributes ( + /*[out,retval]*/ long * plAttr ) = 0; + virtual HRESULT __stdcall put_Attributes ( + /*[in]*/ long plAttr ) = 0; + virtual HRESULT __stdcall get_CursorLocation ( + /*[out,retval]*/ enum CursorLocationEnum * plCursorLoc ) = 0; + virtual HRESULT __stdcall put_CursorLocation ( + /*[in]*/ enum CursorLocationEnum plCursorLoc ) = 0; + virtual HRESULT __stdcall get_Mode ( + /*[out,retval]*/ enum ConnectModeEnum * plMode ) = 0; + virtual HRESULT __stdcall put_Mode ( + /*[in]*/ enum ConnectModeEnum plMode ) = 0; + virtual HRESULT __stdcall get_Provider ( + /*[out,retval]*/ BSTR * pbstr ) = 0; + virtual HRESULT __stdcall put_Provider ( + /*[in]*/ BSTR pbstr ) = 0; + virtual HRESULT __stdcall get_State ( + /*[out,retval]*/ long * plObjState ) = 0; + virtual HRESULT __stdcall raw_OpenSchema ( + /*[in]*/ enum SchemaEnum Schema, + /*[in]*/ VARIANT Restrictions, + /*[in]*/ VARIANT SchemaID, + /*[out,retval]*/ struct _Recordset * * pprset ) = 0; +}; + +struct __declspec(uuid("00001550-0000-0010-8000-00aa006d2ea4")) +_Connection : Connection15 +{ + // + // Wrapper methods for error-handling + // + + HRESULT Cancel ( ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall raw_Cancel ( ) = 0; +}; + +struct __declspec(uuid("0000150e-0000-0010-8000-00aa006d2ea4")) +Recordset15 : _ADO +{ + // + // Property data + // + + __declspec(property(get=GetFields)) + FieldsPtr Fields; + __declspec(property(get=GetPageSize,put=PutPageSize)) + long PageSize; + __declspec(property(get=GetPageCount)) + long PageCount; + __declspec(property(get=GetCursorLocation,put=PutCursorLocation)) + enum CursorLocationEnum CursorLocation; + __declspec(property(get=GetState)) + long State; + __declspec(property(get=GetMarshalOptions,put=PutMarshalOptions)) + enum MarshalOptionsEnum MarshalOptions; + __declspec(property(get=GetCollect,put=PutCollect)) + _variant_t Collect[]; + __declspec(property(get=GetEditMode)) + enum EditModeEnum EditMode; + __declspec(property(get=GetStatus)) + long Status; + __declspec(property(get=GetFilter,put=PutFilter)) + _variant_t Filter; + __declspec(property(get=GetSort,put=PutSort)) + _bstr_t Sort; + __declspec(property(get=GetAbsolutePosition,put=PutAbsolutePosition)) + enum PositionEnum AbsolutePosition; + __declspec(property(get=GetBOF)) + VARIANT_BOOL BOF; + __declspec(property(get=GetBookmark,put=PutBookmark)) + _variant_t Bookmark; + __declspec(property(get=GetCacheSize,put=PutCacheSize)) + long CacheSize; + __declspec(property(get=GetCursorType,put=PutCursorType)) + enum CursorTypeEnum CursorType; + __declspec(property(get=GetadoEOF)) + VARIANT_BOOL adoEOF; + __declspec(property(get=GetAbsolutePage,put=PutAbsolutePage)) + enum PositionEnum AbsolutePage; + __declspec(property(get=GetLockType,put=PutLockType)) + enum LockTypeEnum LockType; + __declspec(property(get=GetMaxRecords,put=PutMaxRecords)) + long MaxRecords; + __declspec(property(get=GetRecordCount)) + long RecordCount; + + // + // Wrapper methods for error-handling + // + + enum PositionEnum GetAbsolutePosition ( ); + void PutAbsolutePosition ( + enum PositionEnum pl ); + void PutRefActiveConnection ( + IDispatch * pvar ); + void PutActiveConnection ( + const _variant_t & pvar ); + _variant_t GetActiveConnection ( ); + VARIANT_BOOL GetBOF ( ); + _variant_t GetBookmark ( ); + void PutBookmark ( + const _variant_t & pvBookmark ); + long GetCacheSize ( ); + void PutCacheSize ( + long pl ); + enum CursorTypeEnum GetCursorType ( ); + void PutCursorType ( + enum CursorTypeEnum plCursorType ); + VARIANT_BOOL GetadoEOF ( ); + FieldsPtr GetFields ( ); + enum LockTypeEnum GetLockType ( ); + void PutLockType ( + enum LockTypeEnum plLockType ); + long GetMaxRecords ( ); + void PutMaxRecords ( + long plMaxRecords ); + long GetRecordCount ( ); + void PutRefSource ( + IDispatch * pvSource ); + void PutSource ( + _bstr_t pvSource ); + _variant_t GetSource ( ); + HRESULT AddNew ( + const _variant_t & FieldList = vtMissing, + const _variant_t & Values = vtMissing ); + HRESULT CancelUpdate ( ); + HRESULT Close ( ); + HRESULT Delete ( + enum AffectEnum AffectRecords ); + _variant_t GetRows ( + long Rows, + const _variant_t & Start = vtMissing, + const _variant_t & Fields = vtMissing ); + HRESULT Move ( + long NumRecords, + const _variant_t & Start = vtMissing ); + HRESULT MoveNext ( ); + HRESULT MovePrevious ( ); + HRESULT MoveFirst ( ); + HRESULT MoveLast ( ); + HRESULT Open ( + const _variant_t & Source, + const _variant_t & ActiveConnection, + enum CursorTypeEnum CursorType, + enum LockTypeEnum LockType, + long Options ); + HRESULT Requery ( + long Options ); + HRESULT _xResync ( + enum AffectEnum AffectRecords ); + HRESULT Update ( + const _variant_t & Fields = vtMissing, + const _variant_t & Values = vtMissing ); + enum PositionEnum GetAbsolutePage ( ); + void PutAbsolutePage ( + enum PositionEnum pl ); + enum EditModeEnum GetEditMode ( ); + _variant_t GetFilter ( ); + void PutFilter ( + const _variant_t & Criteria ); + long GetPageCount ( ); + long GetPageSize ( ); + void PutPageSize ( + long pl ); + _bstr_t GetSort ( ); + void PutSort ( + _bstr_t Criteria ); + long GetStatus ( ); + long GetState ( ); + _RecordsetPtr _xClone ( ); + HRESULT UpdateBatch ( + enum AffectEnum AffectRecords ); + HRESULT CancelBatch ( + enum AffectEnum AffectRecords ); + enum CursorLocationEnum GetCursorLocation ( ); + void PutCursorLocation ( + enum CursorLocationEnum plCursorLoc ); + _RecordsetPtr NextRecordset ( + VARIANT * RecordsAffected ); + VARIANT_BOOL Supports ( + enum CursorOptionEnum CursorOptions ); + _variant_t GetCollect ( + const _variant_t & Index ); + void PutCollect ( + const _variant_t & Index, + const _variant_t & pvar ); + enum MarshalOptionsEnum GetMarshalOptions ( ); + void PutMarshalOptions ( + enum MarshalOptionsEnum peMarshal ); + HRESULT Find ( + _bstr_t Criteria, + long SkipRecords, + enum SearchDirectionEnum SearchDirection, + const _variant_t & Start = vtMissing ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_AbsolutePosition ( + /*[out,retval]*/ enum PositionEnum * pl ) = 0; + virtual HRESULT __stdcall put_AbsolutePosition ( + /*[in]*/ enum PositionEnum pl ) = 0; + virtual HRESULT __stdcall putref_ActiveConnection ( + /*[in]*/ IDispatch * pvar ) = 0; + virtual HRESULT __stdcall put_ActiveConnection ( + /*[in]*/ VARIANT pvar ) = 0; + virtual HRESULT __stdcall get_ActiveConnection ( + /*[out,retval]*/ VARIANT * pvar ) = 0; + virtual HRESULT __stdcall get_BOF ( + /*[out,retval]*/ VARIANT_BOOL * pb ) = 0; + virtual HRESULT __stdcall get_Bookmark ( + /*[out,retval]*/ VARIANT * pvBookmark ) = 0; + virtual HRESULT __stdcall put_Bookmark ( + /*[in]*/ VARIANT pvBookmark ) = 0; + virtual HRESULT __stdcall get_CacheSize ( + /*[out,retval]*/ long * pl ) = 0; + virtual HRESULT __stdcall put_CacheSize ( + /*[in]*/ long pl ) = 0; + virtual HRESULT __stdcall get_CursorType ( + /*[out,retval]*/ enum CursorTypeEnum * plCursorType ) = 0; + virtual HRESULT __stdcall put_CursorType ( + /*[in]*/ enum CursorTypeEnum plCursorType ) = 0; + virtual HRESULT __stdcall get_adoEOF ( + /*[out,retval]*/ VARIANT_BOOL * pb ) = 0; + virtual HRESULT __stdcall get_Fields ( + /*[out,retval]*/ struct Fields * * ppvObject ) = 0; + virtual HRESULT __stdcall get_LockType ( + /*[out,retval]*/ enum LockTypeEnum * plLockType ) = 0; + virtual HRESULT __stdcall put_LockType ( + /*[in]*/ enum LockTypeEnum plLockType ) = 0; + virtual HRESULT __stdcall get_MaxRecords ( + /*[out,retval]*/ long * plMaxRecords ) = 0; + virtual HRESULT __stdcall put_MaxRecords ( + /*[in]*/ long plMaxRecords ) = 0; + virtual HRESULT __stdcall get_RecordCount ( + /*[out,retval]*/ long * pl ) = 0; + virtual HRESULT __stdcall putref_Source ( + /*[in]*/ IDispatch * pvSource ) = 0; + virtual HRESULT __stdcall put_Source ( + /*[in]*/ BSTR pvSource ) = 0; + virtual HRESULT __stdcall get_Source ( + /*[out,retval]*/ VARIANT * pvSource ) = 0; + virtual HRESULT __stdcall raw_AddNew ( + /*[in]*/ VARIANT FieldList = vtMissing, + /*[in]*/ VARIANT Values = vtMissing ) = 0; + virtual HRESULT __stdcall raw_CancelUpdate ( ) = 0; + virtual HRESULT __stdcall raw_Close ( ) = 0; + virtual HRESULT __stdcall raw_Delete ( + /*[in]*/ enum AffectEnum AffectRecords ) = 0; + virtual HRESULT __stdcall raw_GetRows ( + /*[in]*/ long Rows, + /*[in]*/ VARIANT Start, + /*[in]*/ VARIANT Fields, + /*[out,retval]*/ VARIANT * pvar ) = 0; + virtual HRESULT __stdcall raw_Move ( + /*[in]*/ long NumRecords, + /*[in]*/ VARIANT Start = vtMissing ) = 0; + virtual HRESULT __stdcall raw_MoveNext ( ) = 0; + virtual HRESULT __stdcall raw_MovePrevious ( ) = 0; + virtual HRESULT __stdcall raw_MoveFirst ( ) = 0; + virtual HRESULT __stdcall raw_MoveLast ( ) = 0; + virtual HRESULT __stdcall raw_Open ( + /*[in]*/ VARIANT Source, + /*[in]*/ VARIANT ActiveConnection, + /*[in]*/ enum CursorTypeEnum CursorType, + /*[in]*/ enum LockTypeEnum LockType, + /*[in]*/ long Options ) = 0; + virtual HRESULT __stdcall raw_Requery ( + /*[in]*/ long Options ) = 0; + virtual HRESULT __stdcall raw__xResync ( + /*[in]*/ enum AffectEnum AffectRecords ) = 0; + virtual HRESULT __stdcall raw_Update ( + /*[in]*/ VARIANT Fields = vtMissing, + /*[in]*/ VARIANT Values = vtMissing ) = 0; + virtual HRESULT __stdcall get_AbsolutePage ( + /*[out,retval]*/ enum PositionEnum * pl ) = 0; + virtual HRESULT __stdcall put_AbsolutePage ( + /*[in]*/ enum PositionEnum pl ) = 0; + virtual HRESULT __stdcall get_EditMode ( + /*[out,retval]*/ enum EditModeEnum * pl ) = 0; + virtual HRESULT __stdcall get_Filter ( + /*[out,retval]*/ VARIANT * Criteria ) = 0; + virtual HRESULT __stdcall put_Filter ( + /*[in]*/ VARIANT Criteria ) = 0; + virtual HRESULT __stdcall get_PageCount ( + /*[out,retval]*/ long * pl ) = 0; + virtual HRESULT __stdcall get_PageSize ( + /*[out,retval]*/ long * pl ) = 0; + virtual HRESULT __stdcall put_PageSize ( + /*[in]*/ long pl ) = 0; + virtual HRESULT __stdcall get_Sort ( + /*[out,retval]*/ BSTR * Criteria ) = 0; + virtual HRESULT __stdcall put_Sort ( + /*[in]*/ BSTR Criteria ) = 0; + virtual HRESULT __stdcall get_Status ( + /*[out,retval]*/ long * pl ) = 0; + virtual HRESULT __stdcall get_State ( + /*[out,retval]*/ long * plObjState ) = 0; + virtual HRESULT __stdcall raw__xClone ( + /*[out,retval]*/ struct _Recordset * * ppvObject ) = 0; + virtual HRESULT __stdcall raw_UpdateBatch ( + /*[in]*/ enum AffectEnum AffectRecords ) = 0; + virtual HRESULT __stdcall raw_CancelBatch ( + /*[in]*/ enum AffectEnum AffectRecords ) = 0; + virtual HRESULT __stdcall get_CursorLocation ( + /*[out,retval]*/ enum CursorLocationEnum * plCursorLoc ) = 0; + virtual HRESULT __stdcall put_CursorLocation ( + /*[in]*/ enum CursorLocationEnum plCursorLoc ) = 0; + virtual HRESULT __stdcall raw_NextRecordset ( + /*[out]*/ VARIANT * RecordsAffected, + /*[out,retval]*/ struct _Recordset * * ppiRs ) = 0; + virtual HRESULT __stdcall raw_Supports ( + /*[in]*/ enum CursorOptionEnum CursorOptions, + /*[out,retval]*/ VARIANT_BOOL * pb ) = 0; + virtual HRESULT __stdcall get_Collect ( + /*[in]*/ VARIANT Index, + /*[out,retval]*/ VARIANT * pvar ) = 0; + virtual HRESULT __stdcall put_Collect ( + /*[in]*/ VARIANT Index, + /*[in]*/ VARIANT pvar ) = 0; + virtual HRESULT __stdcall get_MarshalOptions ( + /*[out,retval]*/ enum MarshalOptionsEnum * peMarshal ) = 0; + virtual HRESULT __stdcall put_MarshalOptions ( + /*[in]*/ enum MarshalOptionsEnum peMarshal ) = 0; + virtual HRESULT __stdcall raw_Find ( + /*[in]*/ BSTR Criteria, + /*[in]*/ long SkipRecords, + /*[in]*/ enum SearchDirectionEnum SearchDirection, + /*[in]*/ VARIANT Start = vtMissing ) = 0; +}; + +struct __declspec(uuid("0000154f-0000-0010-8000-00aa006d2ea4")) +Recordset20 : Recordset15 +{ + // + // Property data + // + + __declspec(property(get=GetDataSource,put=PutRefDataSource)) + IUnknownPtr DataSource; + __declspec(property(get=GetActiveCommand)) + IDispatchPtr ActiveCommand; + __declspec(property(get=GetStayInSync,put=PutStayInSync)) + VARIANT_BOOL StayInSync; + __declspec(property(get=GetDataMember,put=PutDataMember)) + _bstr_t DataMember; + + // + // Wrapper methods for error-handling + // + + HRESULT Cancel ( ); + IUnknownPtr GetDataSource ( ); + void PutRefDataSource ( + IUnknown * ppunkDataSource ); + HRESULT _xSave ( + _bstr_t FileName, + enum PersistFormatEnum PersistFormat ); + IDispatchPtr GetActiveCommand ( ); + void PutStayInSync ( + VARIANT_BOOL pbStayInSync ); + VARIANT_BOOL GetStayInSync ( ); + _bstr_t GetString ( + enum StringFormatEnum StringFormat, + long NumRows, + _bstr_t ColumnDelimeter, + _bstr_t RowDelimeter, + _bstr_t NullExpr ); + _bstr_t GetDataMember ( ); + void PutDataMember ( + _bstr_t pbstrDataMember ); + enum CompareEnum CompareBookmarks ( + const _variant_t & Bookmark1, + const _variant_t & Bookmark2 ); + _RecordsetPtr Clone ( + enum LockTypeEnum LockType ); + HRESULT Resync ( + enum AffectEnum AffectRecords, + enum ResyncEnum ResyncValues ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall raw_Cancel ( ) = 0; + virtual HRESULT __stdcall get_DataSource ( + /*[out,retval]*/ IUnknown * * ppunkDataSource ) = 0; + virtual HRESULT __stdcall putref_DataSource ( + /*[in]*/ IUnknown * ppunkDataSource ) = 0; + virtual HRESULT __stdcall raw__xSave ( + /*[in]*/ BSTR FileName, + /*[in]*/ enum PersistFormatEnum PersistFormat ) = 0; + virtual HRESULT __stdcall get_ActiveCommand ( + /*[out,retval]*/ IDispatch * * ppCmd ) = 0; + virtual HRESULT __stdcall put_StayInSync ( + /*[in]*/ VARIANT_BOOL pbStayInSync ) = 0; + virtual HRESULT __stdcall get_StayInSync ( + /*[out,retval]*/ VARIANT_BOOL * pbStayInSync ) = 0; + virtual HRESULT __stdcall raw_GetString ( + /*[in]*/ enum StringFormatEnum StringFormat, + /*[in]*/ long NumRows, + /*[in]*/ BSTR ColumnDelimeter, + /*[in]*/ BSTR RowDelimeter, + /*[in]*/ BSTR NullExpr, + /*[out,retval]*/ BSTR * pRetString ) = 0; + virtual HRESULT __stdcall get_DataMember ( + /*[out,retval]*/ BSTR * pbstrDataMember ) = 0; + virtual HRESULT __stdcall put_DataMember ( + /*[in]*/ BSTR pbstrDataMember ) = 0; + virtual HRESULT __stdcall raw_CompareBookmarks ( + /*[in]*/ VARIANT Bookmark1, + /*[in]*/ VARIANT Bookmark2, + /*[out,retval]*/ enum CompareEnum * pCompare ) = 0; + virtual HRESULT __stdcall raw_Clone ( + /*[in]*/ enum LockTypeEnum LockType, + /*[out,retval]*/ struct _Recordset * * ppvObject ) = 0; + virtual HRESULT __stdcall raw_Resync ( + /*[in]*/ enum AffectEnum AffectRecords, + /*[in]*/ enum ResyncEnum ResyncValues ) = 0; +}; + +struct __declspec(uuid("00001555-0000-0010-8000-00aa006d2ea4")) +Recordset21 : Recordset20 +{ + // + // Property data + // + + __declspec(property(get=GetIndex,put=PutIndex)) + _bstr_t Index; + + // + // Wrapper methods for error-handling + // + + HRESULT Seek ( + const _variant_t & KeyValues, + enum SeekEnum SeekOption ); + void PutIndex ( + _bstr_t pbstrIndex ); + _bstr_t GetIndex ( ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall raw_Seek ( + /*[in]*/ VARIANT KeyValues, + /*[in]*/ enum SeekEnum SeekOption ) = 0; + virtual HRESULT __stdcall put_Index ( + /*[in]*/ BSTR pbstrIndex ) = 0; + virtual HRESULT __stdcall get_Index ( + /*[out,retval]*/ BSTR * pbstrIndex ) = 0; +}; + +struct __declspec(uuid("00001556-0000-0010-8000-00aa006d2ea4")) +_Recordset : Recordset21 +{ + // + // Wrapper methods for error-handling + // + + HRESULT Save ( + const _variant_t & Destination, + enum PersistFormatEnum PersistFormat ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall raw_Save ( + /*[in]*/ VARIANT Destination, + /*[in]*/ enum PersistFormatEnum PersistFormat ) = 0; +}; + +struct __declspec(uuid("00001402-0000-0010-8000-00aa006d2ea4")) +ConnectionEventsVt : IUnknown +{ + // + // Wrapper methods for error-handling + // + + HRESULT InfoMessage ( + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Connection * pConnection ); + HRESULT BeginTransComplete ( + long TransactionLevel, + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Connection * pConnection ); + HRESULT CommitTransComplete ( + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Connection * pConnection ); + HRESULT RollbackTransComplete ( + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Connection * pConnection ); + HRESULT WillExecute ( + BSTR * Source, + enum CursorTypeEnum * CursorType, + enum LockTypeEnum * LockType, + long * Options, + enum EventStatusEnum * adStatus, + struct _Command * pCommand, + struct _Recordset * pRecordset, + struct _Connection * pConnection ); + HRESULT ExecuteComplete ( + long RecordsAffected, + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Command * pCommand, + struct _Recordset * pRecordset, + struct _Connection * pConnection ); + HRESULT WillConnect ( + BSTR * ConnectionString, + BSTR * UserID, + BSTR * Password, + long * Options, + enum EventStatusEnum * adStatus, + struct _Connection * pConnection ); + HRESULT ConnectComplete ( + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Connection * pConnection ); + HRESULT Disconnect ( + enum EventStatusEnum * adStatus, + struct _Connection * pConnection ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall raw_InfoMessage ( + /*[in]*/ struct Error * pError, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Connection * pConnection ) = 0; + virtual HRESULT __stdcall raw_BeginTransComplete ( + /*[in]*/ long TransactionLevel, + /*[in]*/ struct Error * pError, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Connection * pConnection ) = 0; + virtual HRESULT __stdcall raw_CommitTransComplete ( + /*[in]*/ struct Error * pError, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Connection * pConnection ) = 0; + virtual HRESULT __stdcall raw_RollbackTransComplete ( + /*[in]*/ struct Error * pError, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Connection * pConnection ) = 0; + virtual HRESULT __stdcall raw_WillExecute ( + /*[in,out]*/ BSTR * Source, + /*[in,out]*/ enum CursorTypeEnum * CursorType, + /*[in,out]*/ enum LockTypeEnum * LockType, + /*[in,out]*/ long * Options, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Command * pCommand, + /*[in]*/ struct _Recordset * pRecordset, + /*[in]*/ struct _Connection * pConnection ) = 0; + virtual HRESULT __stdcall raw_ExecuteComplete ( + /*[in]*/ long RecordsAffected, + /*[in]*/ struct Error * pError, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Command * pCommand, + /*[in]*/ struct _Recordset * pRecordset, + /*[in]*/ struct _Connection * pConnection ) = 0; + virtual HRESULT __stdcall raw_WillConnect ( + /*[in,out]*/ BSTR * ConnectionString, + /*[in,out]*/ BSTR * UserID, + /*[in,out]*/ BSTR * Password, + /*[in,out]*/ long * Options, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Connection * pConnection ) = 0; + virtual HRESULT __stdcall raw_ConnectComplete ( + /*[in]*/ struct Error * pError, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Connection * pConnection ) = 0; + virtual HRESULT __stdcall raw_Disconnect ( + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Connection * pConnection ) = 0; +}; + +struct __declspec(uuid("00001403-0000-0010-8000-00aa006d2ea4")) +RecordsetEventsVt : IUnknown +{ + // + // Wrapper methods for error-handling + // + + HRESULT WillChangeField ( + long cFields, + const _variant_t & Fields, + enum EventStatusEnum * adStatus, + struct _Recordset * pRecordset ); + HRESULT FieldChangeComplete ( + long cFields, + const _variant_t & Fields, + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Recordset * pRecordset ); + HRESULT WillChangeRecord ( + enum EventReasonEnum adReason, + long cRecords, + enum EventStatusEnum * adStatus, + struct _Recordset * pRecordset ); + HRESULT RecordChangeComplete ( + enum EventReasonEnum adReason, + long cRecords, + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Recordset * pRecordset ); + HRESULT WillChangeRecordset ( + enum EventReasonEnum adReason, + enum EventStatusEnum * adStatus, + struct _Recordset * pRecordset ); + HRESULT RecordsetChangeComplete ( + enum EventReasonEnum adReason, + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Recordset * pRecordset ); + HRESULT WillMove ( + enum EventReasonEnum adReason, + enum EventStatusEnum * adStatus, + struct _Recordset * pRecordset ); + HRESULT MoveComplete ( + enum EventReasonEnum adReason, + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Recordset * pRecordset ); + HRESULT EndOfRecordset ( + VARIANT_BOOL * fMoreData, + enum EventStatusEnum * adStatus, + struct _Recordset * pRecordset ); + HRESULT FetchProgress ( + long Progress, + long MaxProgress, + enum EventStatusEnum * adStatus, + struct _Recordset * pRecordset ); + HRESULT FetchComplete ( + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Recordset * pRecordset ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall raw_WillChangeField ( + /*[in]*/ long cFields, + /*[in]*/ VARIANT Fields, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Recordset * pRecordset ) = 0; + virtual HRESULT __stdcall raw_FieldChangeComplete ( + /*[in]*/ long cFields, + /*[in]*/ VARIANT Fields, + /*[in]*/ struct Error * pError, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Recordset * pRecordset ) = 0; + virtual HRESULT __stdcall raw_WillChangeRecord ( + /*[in]*/ enum EventReasonEnum adReason, + /*[in]*/ long cRecords, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Recordset * pRecordset ) = 0; + virtual HRESULT __stdcall raw_RecordChangeComplete ( + /*[in]*/ enum EventReasonEnum adReason, + /*[in]*/ long cRecords, + /*[in]*/ struct Error * pError, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Recordset * pRecordset ) = 0; + virtual HRESULT __stdcall raw_WillChangeRecordset ( + /*[in]*/ enum EventReasonEnum adReason, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Recordset * pRecordset ) = 0; + virtual HRESULT __stdcall raw_RecordsetChangeComplete ( + /*[in]*/ enum EventReasonEnum adReason, + /*[in]*/ struct Error * pError, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Recordset * pRecordset ) = 0; + virtual HRESULT __stdcall raw_WillMove ( + /*[in]*/ enum EventReasonEnum adReason, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Recordset * pRecordset ) = 0; + virtual HRESULT __stdcall raw_MoveComplete ( + /*[in]*/ enum EventReasonEnum adReason, + /*[in]*/ struct Error * pError, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Recordset * pRecordset ) = 0; + virtual HRESULT __stdcall raw_EndOfRecordset ( + /*[in,out]*/ VARIANT_BOOL * fMoreData, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Recordset * pRecordset ) = 0; + virtual HRESULT __stdcall raw_FetchProgress ( + /*[in]*/ long Progress, + /*[in]*/ long MaxProgress, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Recordset * pRecordset ) = 0; + virtual HRESULT __stdcall raw_FetchComplete ( + /*[in]*/ struct Error * pError, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Recordset * pRecordset ) = 0; +}; + +struct __declspec(uuid("00001562-0000-0010-8000-00aa006d2ea4")) +_Record : _ADO +{ + // + // Property data + // + + __declspec(property(get=GetFields)) + FieldsPtr Fields; + __declspec(property(get=GetState)) + enum ObjectStateEnum State; + __declspec(property(get=GetMode,put=PutMode)) + enum ConnectModeEnum Mode; + __declspec(property(get=GetParentURL)) + _bstr_t ParentURL; + __declspec(property(get=GetRecordType)) + enum RecordTypeEnum RecordType; + + // + // Wrapper methods for error-handling + // + + _variant_t GetActiveConnection ( ); + void PutActiveConnection ( + _bstr_t pvar ); + void PutRefActiveConnection ( + struct _Connection * pvar ); + enum ObjectStateEnum GetState ( ); + _variant_t GetSource ( ); + void PutSource ( + _bstr_t pvar ); + void PutRefSource ( + IDispatch * pvar ); + enum ConnectModeEnum GetMode ( ); + void PutMode ( + enum ConnectModeEnum pMode ); + _bstr_t GetParentURL ( ); + _bstr_t MoveRecord ( + _bstr_t Source, + _bstr_t Destination, + _bstr_t UserName, + _bstr_t Password, + enum MoveRecordOptionsEnum Options, + VARIANT_BOOL Async ); + _bstr_t CopyRecord ( + _bstr_t Source, + _bstr_t Destination, + _bstr_t UserName, + _bstr_t Password, + enum CopyRecordOptionsEnum Options, + VARIANT_BOOL Async ); + HRESULT DeleteRecord ( + _bstr_t Source, + VARIANT_BOOL Async ); + HRESULT Open ( + const _variant_t & Source, + const _variant_t & ActiveConnection, + enum ConnectModeEnum Mode, + enum RecordCreateOptionsEnum CreateOptions, + enum RecordOpenOptionsEnum Options, + _bstr_t UserName, + _bstr_t Password ); + HRESULT Close ( ); + FieldsPtr GetFields ( ); + enum RecordTypeEnum GetRecordType ( ); + _RecordsetPtr GetChildren ( ); + HRESULT Cancel ( ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_ActiveConnection ( + /*[out,retval]*/ VARIANT * pvar ) = 0; + virtual HRESULT __stdcall put_ActiveConnection ( + /*[in]*/ BSTR pvar ) = 0; + virtual HRESULT __stdcall putref_ActiveConnection ( + /*[in]*/ struct _Connection * pvar ) = 0; + virtual HRESULT __stdcall get_State ( + /*[out,retval]*/ enum ObjectStateEnum * pState ) = 0; + virtual HRESULT __stdcall get_Source ( + /*[out,retval]*/ VARIANT * pvar ) = 0; + virtual HRESULT __stdcall put_Source ( + /*[in]*/ BSTR pvar ) = 0; + virtual HRESULT __stdcall putref_Source ( + /*[in]*/ IDispatch * pvar ) = 0; + virtual HRESULT __stdcall get_Mode ( + /*[out,retval]*/ enum ConnectModeEnum * pMode ) = 0; + virtual HRESULT __stdcall put_Mode ( + /*[in]*/ enum ConnectModeEnum pMode ) = 0; + virtual HRESULT __stdcall get_ParentURL ( + /*[out,retval]*/ BSTR * pbstrParentURL ) = 0; + virtual HRESULT __stdcall raw_MoveRecord ( + /*[in]*/ BSTR Source, + /*[in]*/ BSTR Destination, + /*[in]*/ BSTR UserName, + /*[in]*/ BSTR Password, + /*[in]*/ enum MoveRecordOptionsEnum Options, + /*[in]*/ VARIANT_BOOL Async, + /*[out,retval]*/ BSTR * pbstrNewURL ) = 0; + virtual HRESULT __stdcall raw_CopyRecord ( + /*[in]*/ BSTR Source, + /*[in]*/ BSTR Destination, + /*[in]*/ BSTR UserName, + /*[in]*/ BSTR Password, + /*[in]*/ enum CopyRecordOptionsEnum Options, + /*[in]*/ VARIANT_BOOL Async, + /*[out,retval]*/ BSTR * pbstrNewURL ) = 0; + virtual HRESULT __stdcall raw_DeleteRecord ( + /*[in]*/ BSTR Source, + /*[in]*/ VARIANT_BOOL Async ) = 0; + virtual HRESULT __stdcall raw_Open ( + /*[in]*/ VARIANT Source, + /*[in]*/ VARIANT ActiveConnection, + /*[in]*/ enum ConnectModeEnum Mode, + /*[in]*/ enum RecordCreateOptionsEnum CreateOptions, + /*[in]*/ enum RecordOpenOptionsEnum Options, + /*[in]*/ BSTR UserName, + /*[in]*/ BSTR Password ) = 0; + virtual HRESULT __stdcall raw_Close ( ) = 0; + virtual HRESULT __stdcall get_Fields ( + /*[out,retval]*/ struct Fields * * ppFlds ) = 0; + virtual HRESULT __stdcall get_RecordType ( + /*[out,retval]*/ enum RecordTypeEnum * ptype ) = 0; + virtual HRESULT __stdcall raw_GetChildren ( + /*[out,retval]*/ struct _Recordset * * pprset ) = 0; + virtual HRESULT __stdcall raw_Cancel ( ) = 0; +}; + +struct __declspec(uuid("00000402-0000-0010-8000-00aa006d2ea4")) +ConnectionEventsVt_Deprecated : IUnknown +{ + // + // Wrapper methods for error-handling + // + + HRESULT InfoMessage ( + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Connection_Deprecated * pConnection ); + HRESULT BeginTransComplete ( + long TransactionLevel, + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Connection_Deprecated * pConnection ); + HRESULT CommitTransComplete ( + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Connection_Deprecated * pConnection ); + HRESULT RollbackTransComplete ( + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Connection_Deprecated * pConnection ); + HRESULT WillExecute ( + BSTR * Source, + enum CursorTypeEnum * CursorType, + enum LockTypeEnum * LockType, + long * Options, + enum EventStatusEnum * adStatus, + struct _Command_Deprecated * pCommand, + struct _Recordset_Deprecated * pRecordset, + struct _Connection_Deprecated * pConnection ); + HRESULT ExecuteComplete ( + long RecordsAffected, + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Command_Deprecated * pCommand, + struct _Recordset_Deprecated * pRecordset, + struct _Connection_Deprecated * pConnection ); + HRESULT WillConnect ( + BSTR * ConnectionString, + BSTR * UserID, + BSTR * Password, + long * Options, + enum EventStatusEnum * adStatus, + struct _Connection_Deprecated * pConnection ); + HRESULT ConnectComplete ( + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Connection_Deprecated * pConnection ); + HRESULT Disconnect ( + enum EventStatusEnum * adStatus, + struct _Connection_Deprecated * pConnection ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall raw_InfoMessage ( + /*[in]*/ struct Error * pError, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Connection_Deprecated * pConnection ) = 0; + virtual HRESULT __stdcall raw_BeginTransComplete ( + /*[in]*/ long TransactionLevel, + /*[in]*/ struct Error * pError, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Connection_Deprecated * pConnection ) = 0; + virtual HRESULT __stdcall raw_CommitTransComplete ( + /*[in]*/ struct Error * pError, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Connection_Deprecated * pConnection ) = 0; + virtual HRESULT __stdcall raw_RollbackTransComplete ( + /*[in]*/ struct Error * pError, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Connection_Deprecated * pConnection ) = 0; + virtual HRESULT __stdcall raw_WillExecute ( + /*[in,out]*/ BSTR * Source, + /*[in,out]*/ enum CursorTypeEnum * CursorType, + /*[in,out]*/ enum LockTypeEnum * LockType, + /*[in,out]*/ long * Options, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Command_Deprecated * pCommand, + /*[in]*/ struct _Recordset_Deprecated * pRecordset, + /*[in]*/ struct _Connection_Deprecated * pConnection ) = 0; + virtual HRESULT __stdcall raw_ExecuteComplete ( + /*[in]*/ long RecordsAffected, + /*[in]*/ struct Error * pError, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Command_Deprecated * pCommand, + /*[in]*/ struct _Recordset_Deprecated * pRecordset, + /*[in]*/ struct _Connection_Deprecated * pConnection ) = 0; + virtual HRESULT __stdcall raw_WillConnect ( + /*[in,out]*/ BSTR * ConnectionString, + /*[in,out]*/ BSTR * UserID, + /*[in,out]*/ BSTR * Password, + /*[in,out]*/ long * Options, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Connection_Deprecated * pConnection ) = 0; + virtual HRESULT __stdcall raw_ConnectComplete ( + /*[in]*/ struct Error * pError, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Connection_Deprecated * pConnection ) = 0; + virtual HRESULT __stdcall raw_Disconnect ( + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Connection_Deprecated * pConnection ) = 0; +}; + +struct __declspec(uuid("00000515-0000-0010-8000-00aa006d2ea4")) +Connection15_Deprecated : _ADO +{ + // + // Property data + // + + __declspec(property(get=GetConnectionString,put=PutConnectionString)) + _bstr_t ConnectionString; + __declspec(property(get=GetCommandTimeout,put=PutCommandTimeout)) + long CommandTimeout; + __declspec(property(get=GetConnectionTimeout,put=PutConnectionTimeout)) + long ConnectionTimeout; + __declspec(property(get=GetVersion)) + _bstr_t Version; + __declspec(property(get=GetErrors)) + ErrorsPtr Errors; + __declspec(property(get=GetDefaultDatabase,put=PutDefaultDatabase)) + _bstr_t DefaultDatabase; + __declspec(property(get=GetIsolationLevel,put=PutIsolationLevel)) + enum IsolationLevelEnum IsolationLevel; + __declspec(property(get=GetAttributes,put=PutAttributes)) + long Attributes; + __declspec(property(get=GetCursorLocation,put=PutCursorLocation)) + enum CursorLocationEnum CursorLocation; + __declspec(property(get=GetMode,put=PutMode)) + enum ConnectModeEnum Mode; + __declspec(property(get=GetProvider,put=PutProvider)) + _bstr_t Provider; + __declspec(property(get=GetState)) + long State; + + // + // Wrapper methods for error-handling + // + + _bstr_t GetConnectionString ( ); + void PutConnectionString ( + _bstr_t pbstr ); + long GetCommandTimeout ( ); + void PutCommandTimeout ( + long plTimeout ); + long GetConnectionTimeout ( ); + void PutConnectionTimeout ( + long plTimeout ); + _bstr_t GetVersion ( ); + HRESULT Close ( ); + _Recordset_DeprecatedPtr Execute ( + _bstr_t CommandText, + VARIANT * RecordsAffected, + long Options ); + long BeginTrans ( ); + HRESULT CommitTrans ( ); + HRESULT RollbackTrans ( ); + HRESULT Open ( + _bstr_t ConnectionString, + _bstr_t UserID, + _bstr_t Password, + long Options ); + ErrorsPtr GetErrors ( ); + _bstr_t GetDefaultDatabase ( ); + void PutDefaultDatabase ( + _bstr_t pbstr ); + enum IsolationLevelEnum GetIsolationLevel ( ); + void PutIsolationLevel ( + enum IsolationLevelEnum Level ); + long GetAttributes ( ); + void PutAttributes ( + long plAttr ); + enum CursorLocationEnum GetCursorLocation ( ); + void PutCursorLocation ( + enum CursorLocationEnum plCursorLoc ); + enum ConnectModeEnum GetMode ( ); + void PutMode ( + enum ConnectModeEnum plMode ); + _bstr_t GetProvider ( ); + void PutProvider ( + _bstr_t pbstr ); + long GetState ( ); + _Recordset_DeprecatedPtr OpenSchema ( + enum SchemaEnum Schema, + const _variant_t & Restrictions = vtMissing, + const _variant_t & SchemaID = vtMissing ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_ConnectionString ( + /*[out,retval]*/ BSTR * pbstr ) = 0; + virtual HRESULT __stdcall put_ConnectionString ( + /*[in]*/ BSTR pbstr ) = 0; + virtual HRESULT __stdcall get_CommandTimeout ( + /*[out,retval]*/ long * plTimeout ) = 0; + virtual HRESULT __stdcall put_CommandTimeout ( + /*[in]*/ long plTimeout ) = 0; + virtual HRESULT __stdcall get_ConnectionTimeout ( + /*[out,retval]*/ long * plTimeout ) = 0; + virtual HRESULT __stdcall put_ConnectionTimeout ( + /*[in]*/ long plTimeout ) = 0; + virtual HRESULT __stdcall get_Version ( + /*[out,retval]*/ BSTR * pbstr ) = 0; + virtual HRESULT __stdcall raw_Close ( ) = 0; + virtual HRESULT __stdcall raw_Execute ( + /*[in]*/ BSTR CommandText, + /*[out]*/ VARIANT * RecordsAffected, + /*[in]*/ long Options, + /*[out,retval]*/ struct _Recordset_Deprecated * * ppiRset ) = 0; + virtual HRESULT __stdcall raw_BeginTrans ( + /*[out,retval]*/ long * TransactionLevel ) = 0; + virtual HRESULT __stdcall raw_CommitTrans ( ) = 0; + virtual HRESULT __stdcall raw_RollbackTrans ( ) = 0; + virtual HRESULT __stdcall raw_Open ( + /*[in]*/ BSTR ConnectionString, + /*[in]*/ BSTR UserID, + /*[in]*/ BSTR Password, + /*[in]*/ long Options ) = 0; + virtual HRESULT __stdcall get_Errors ( + /*[out,retval]*/ struct Errors * * ppvObject ) = 0; + virtual HRESULT __stdcall get_DefaultDatabase ( + /*[out,retval]*/ BSTR * pbstr ) = 0; + virtual HRESULT __stdcall put_DefaultDatabase ( + /*[in]*/ BSTR pbstr ) = 0; + virtual HRESULT __stdcall get_IsolationLevel ( + /*[out,retval]*/ enum IsolationLevelEnum * Level ) = 0; + virtual HRESULT __stdcall put_IsolationLevel ( + /*[in]*/ enum IsolationLevelEnum Level ) = 0; + virtual HRESULT __stdcall get_Attributes ( + /*[out,retval]*/ long * plAttr ) = 0; + virtual HRESULT __stdcall put_Attributes ( + /*[in]*/ long plAttr ) = 0; + virtual HRESULT __stdcall get_CursorLocation ( + /*[out,retval]*/ enum CursorLocationEnum * plCursorLoc ) = 0; + virtual HRESULT __stdcall put_CursorLocation ( + /*[in]*/ enum CursorLocationEnum plCursorLoc ) = 0; + virtual HRESULT __stdcall get_Mode ( + /*[out,retval]*/ enum ConnectModeEnum * plMode ) = 0; + virtual HRESULT __stdcall put_Mode ( + /*[in]*/ enum ConnectModeEnum plMode ) = 0; + virtual HRESULT __stdcall get_Provider ( + /*[out,retval]*/ BSTR * pbstr ) = 0; + virtual HRESULT __stdcall put_Provider ( + /*[in]*/ BSTR pbstr ) = 0; + virtual HRESULT __stdcall get_State ( + /*[out,retval]*/ long * plObjState ) = 0; + virtual HRESULT __stdcall raw_OpenSchema ( + /*[in]*/ enum SchemaEnum Schema, + /*[in]*/ VARIANT Restrictions, + /*[in]*/ VARIANT SchemaID, + /*[out,retval]*/ struct _Recordset_Deprecated * * pprset ) = 0; +}; + +struct __declspec(uuid("00000550-0000-0010-8000-00aa006d2ea4")) +_Connection_Deprecated : Connection15_Deprecated +{ + // + // Wrapper methods for error-handling + // + + HRESULT Cancel ( ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall raw_Cancel ( ) = 0; +}; + +struct __declspec(uuid("0000050e-0000-0010-8000-00aa006d2ea4")) +Recordset15_Deprecated : _ADO +{ + // + // Property data + // + + __declspec(property(get=GetFields)) + Fields_DeprecatedPtr Fields; + __declspec(property(get=GetPageSize,put=PutPageSize)) + long PageSize; + __declspec(property(get=GetPageCount)) + ADO_LONGPTR PageCount; + __declspec(property(get=GetCursorLocation,put=PutCursorLocation)) + enum CursorLocationEnum CursorLocation; + __declspec(property(get=GetState)) + long State; + __declspec(property(get=GetMarshalOptions,put=PutMarshalOptions)) + enum MarshalOptionsEnum MarshalOptions; + __declspec(property(get=GetCollect,put=PutCollect)) + _variant_t Collect[]; + __declspec(property(get=GetEditMode)) + enum EditModeEnum EditMode; + __declspec(property(get=GetStatus)) + long Status; + __declspec(property(get=GetFilter,put=PutFilter)) + _variant_t Filter; + __declspec(property(get=GetSort,put=PutSort)) + _bstr_t Sort; + __declspec(property(get=GetAbsolutePosition,put=PutAbsolutePosition)) + PositionEnum_Param AbsolutePosition; + __declspec(property(get=GetBOF)) + VARIANT_BOOL BOF; + __declspec(property(get=GetBookmark,put=PutBookmark)) + _variant_t Bookmark; + __declspec(property(get=GetCacheSize,put=PutCacheSize)) + long CacheSize; + __declspec(property(get=GetCursorType,put=PutCursorType)) + enum CursorTypeEnum CursorType; + __declspec(property(get=GetadoEOF)) + VARIANT_BOOL adoEOF; + __declspec(property(get=GetAbsolutePage,put=PutAbsolutePage)) + PositionEnum_Param AbsolutePage; + __declspec(property(get=GetLockType,put=PutLockType)) + enum LockTypeEnum LockType; + __declspec(property(get=GetMaxRecords,put=PutMaxRecords)) + ADO_LONGPTR MaxRecords; + __declspec(property(get=GetRecordCount)) + ADO_LONGPTR RecordCount; + + // + // Wrapper methods for error-handling + // + + PositionEnum_Param GetAbsolutePosition ( ); + void PutAbsolutePosition ( + PositionEnum_Param pl ); + void PutRefActiveConnection ( + IDispatch * pvar ); + void PutActiveConnection ( + const _variant_t & pvar ); + _variant_t GetActiveConnection ( ); + VARIANT_BOOL GetBOF ( ); + _variant_t GetBookmark ( ); + void PutBookmark ( + const _variant_t & pvBookmark ); + long GetCacheSize ( ); + void PutCacheSize ( + long pl ); + enum CursorTypeEnum GetCursorType ( ); + void PutCursorType ( + enum CursorTypeEnum plCursorType ); + VARIANT_BOOL GetadoEOF ( ); + Fields_DeprecatedPtr GetFields ( ); + enum LockTypeEnum GetLockType ( ); + void PutLockType ( + enum LockTypeEnum plLockType ); + ADO_LONGPTR GetMaxRecords ( ); + void PutMaxRecords ( + ADO_LONGPTR plMaxRecords ); + ADO_LONGPTR GetRecordCount ( ); + void PutRefSource ( + IDispatch * pvSource ); + void PutSource ( + _bstr_t pvSource ); + _variant_t GetSource ( ); + HRESULT AddNew ( + const _variant_t & FieldList = vtMissing, + const _variant_t & Values = vtMissing ); + HRESULT CancelUpdate ( ); + HRESULT Close ( ); + HRESULT Delete ( + enum AffectEnum AffectRecords ); + _variant_t GetRows ( + long Rows, + const _variant_t & Start = vtMissing, + const _variant_t & Fields = vtMissing ); + HRESULT Move ( + ADO_LONGPTR NumRecords, + const _variant_t & Start = vtMissing ); + HRESULT MoveNext ( ); + HRESULT MovePrevious ( ); + HRESULT MoveFirst ( ); + HRESULT MoveLast ( ); + HRESULT Open ( + const _variant_t & Source, + const _variant_t & ActiveConnection, + enum CursorTypeEnum CursorType, + enum LockTypeEnum LockType, + long Options ); + HRESULT Requery ( + long Options ); + HRESULT _xResync ( + enum AffectEnum AffectRecords ); + HRESULT Update ( + const _variant_t & Fields = vtMissing, + const _variant_t & Values = vtMissing ); + PositionEnum_Param GetAbsolutePage ( ); + void PutAbsolutePage ( + PositionEnum_Param pl ); + enum EditModeEnum GetEditMode ( ); + _variant_t GetFilter ( ); + void PutFilter ( + const _variant_t & Criteria ); + ADO_LONGPTR GetPageCount ( ); + long GetPageSize ( ); + void PutPageSize ( + long pl ); + _bstr_t GetSort ( ); + void PutSort ( + _bstr_t Criteria ); + long GetStatus ( ); + long GetState ( ); + _Recordset_DeprecatedPtr _xClone ( ); + HRESULT UpdateBatch ( + enum AffectEnum AffectRecords ); + HRESULT CancelBatch ( + enum AffectEnum AffectRecords ); + enum CursorLocationEnum GetCursorLocation ( ); + void PutCursorLocation ( + enum CursorLocationEnum plCursorLoc ); + _Recordset_DeprecatedPtr NextRecordset ( + VARIANT * RecordsAffected ); + VARIANT_BOOL Supports ( + enum CursorOptionEnum CursorOptions ); + _variant_t GetCollect ( + const _variant_t & Index ); + void PutCollect ( + const _variant_t & Index, + const _variant_t & pvar ); + enum MarshalOptionsEnum GetMarshalOptions ( ); + void PutMarshalOptions ( + enum MarshalOptionsEnum peMarshal ); + HRESULT Find ( + _bstr_t Criteria, + ADO_LONGPTR SkipRecords, + enum SearchDirectionEnum SearchDirection, + const _variant_t & Start = vtMissing ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_AbsolutePosition ( + /*[out,retval]*/ PositionEnum_Param * pl ) = 0; + virtual HRESULT __stdcall put_AbsolutePosition ( + /*[in]*/ PositionEnum_Param pl ) = 0; + virtual HRESULT __stdcall putref_ActiveConnection ( + /*[in]*/ IDispatch * pvar ) = 0; + virtual HRESULT __stdcall put_ActiveConnection ( + /*[in]*/ VARIANT pvar ) = 0; + virtual HRESULT __stdcall get_ActiveConnection ( + /*[out,retval]*/ VARIANT * pvar ) = 0; + virtual HRESULT __stdcall get_BOF ( + /*[out,retval]*/ VARIANT_BOOL * pb ) = 0; + virtual HRESULT __stdcall get_Bookmark ( + /*[out,retval]*/ VARIANT * pvBookmark ) = 0; + virtual HRESULT __stdcall put_Bookmark ( + /*[in]*/ VARIANT pvBookmark ) = 0; + virtual HRESULT __stdcall get_CacheSize ( + /*[out,retval]*/ long * pl ) = 0; + virtual HRESULT __stdcall put_CacheSize ( + /*[in]*/ long pl ) = 0; + virtual HRESULT __stdcall get_CursorType ( + /*[out,retval]*/ enum CursorTypeEnum * plCursorType ) = 0; + virtual HRESULT __stdcall put_CursorType ( + /*[in]*/ enum CursorTypeEnum plCursorType ) = 0; + virtual HRESULT __stdcall get_adoEOF ( + /*[out,retval]*/ VARIANT_BOOL * pb ) = 0; + virtual HRESULT __stdcall get_Fields ( + /*[out,retval]*/ struct Fields_Deprecated * * ppvObject ) = 0; + virtual HRESULT __stdcall get_LockType ( + /*[out,retval]*/ enum LockTypeEnum * plLockType ) = 0; + virtual HRESULT __stdcall put_LockType ( + /*[in]*/ enum LockTypeEnum plLockType ) = 0; + virtual HRESULT __stdcall get_MaxRecords ( + /*[out,retval]*/ ADO_LONGPTR * plMaxRecords ) = 0; + virtual HRESULT __stdcall put_MaxRecords ( + /*[in]*/ ADO_LONGPTR plMaxRecords ) = 0; + virtual HRESULT __stdcall get_RecordCount ( + /*[out,retval]*/ ADO_LONGPTR * pl ) = 0; + virtual HRESULT __stdcall putref_Source ( + /*[in]*/ IDispatch * pvSource ) = 0; + virtual HRESULT __stdcall put_Source ( + /*[in]*/ BSTR pvSource ) = 0; + virtual HRESULT __stdcall get_Source ( + /*[out,retval]*/ VARIANT * pvSource ) = 0; + virtual HRESULT __stdcall raw_AddNew ( + /*[in]*/ VARIANT FieldList = vtMissing, + /*[in]*/ VARIANT Values = vtMissing ) = 0; + virtual HRESULT __stdcall raw_CancelUpdate ( ) = 0; + virtual HRESULT __stdcall raw_Close ( ) = 0; + virtual HRESULT __stdcall raw_Delete ( + /*[in]*/ enum AffectEnum AffectRecords ) = 0; + virtual HRESULT __stdcall raw_GetRows ( + /*[in]*/ long Rows, + /*[in]*/ VARIANT Start, + /*[in]*/ VARIANT Fields, + /*[out,retval]*/ VARIANT * pvar ) = 0; + virtual HRESULT __stdcall raw_Move ( + /*[in]*/ ADO_LONGPTR NumRecords, + /*[in]*/ VARIANT Start = vtMissing ) = 0; + virtual HRESULT __stdcall raw_MoveNext ( ) = 0; + virtual HRESULT __stdcall raw_MovePrevious ( ) = 0; + virtual HRESULT __stdcall raw_MoveFirst ( ) = 0; + virtual HRESULT __stdcall raw_MoveLast ( ) = 0; + virtual HRESULT __stdcall raw_Open ( + /*[in]*/ VARIANT Source, + /*[in]*/ VARIANT ActiveConnection, + /*[in]*/ enum CursorTypeEnum CursorType, + /*[in]*/ enum LockTypeEnum LockType, + /*[in]*/ long Options ) = 0; + virtual HRESULT __stdcall raw_Requery ( + /*[in]*/ long Options ) = 0; + virtual HRESULT __stdcall raw__xResync ( + /*[in]*/ enum AffectEnum AffectRecords ) = 0; + virtual HRESULT __stdcall raw_Update ( + /*[in]*/ VARIANT Fields = vtMissing, + /*[in]*/ VARIANT Values = vtMissing ) = 0; + virtual HRESULT __stdcall get_AbsolutePage ( + /*[out,retval]*/ PositionEnum_Param * pl ) = 0; + virtual HRESULT __stdcall put_AbsolutePage ( + /*[in]*/ PositionEnum_Param pl ) = 0; + virtual HRESULT __stdcall get_EditMode ( + /*[out,retval]*/ enum EditModeEnum * pl ) = 0; + virtual HRESULT __stdcall get_Filter ( + /*[out,retval]*/ VARIANT * Criteria ) = 0; + virtual HRESULT __stdcall put_Filter ( + /*[in]*/ VARIANT Criteria ) = 0; + virtual HRESULT __stdcall get_PageCount ( + /*[out,retval]*/ ADO_LONGPTR * pl ) = 0; + virtual HRESULT __stdcall get_PageSize ( + /*[out,retval]*/ long * pl ) = 0; + virtual HRESULT __stdcall put_PageSize ( + /*[in]*/ long pl ) = 0; + virtual HRESULT __stdcall get_Sort ( + /*[out,retval]*/ BSTR * Criteria ) = 0; + virtual HRESULT __stdcall put_Sort ( + /*[in]*/ BSTR Criteria ) = 0; + virtual HRESULT __stdcall get_Status ( + /*[out,retval]*/ long * pl ) = 0; + virtual HRESULT __stdcall get_State ( + /*[out,retval]*/ long * plObjState ) = 0; + virtual HRESULT __stdcall raw__xClone ( + /*[out,retval]*/ struct _Recordset_Deprecated * * ppvObject ) = 0; + virtual HRESULT __stdcall raw_UpdateBatch ( + /*[in]*/ enum AffectEnum AffectRecords ) = 0; + virtual HRESULT __stdcall raw_CancelBatch ( + /*[in]*/ enum AffectEnum AffectRecords ) = 0; + virtual HRESULT __stdcall get_CursorLocation ( + /*[out,retval]*/ enum CursorLocationEnum * plCursorLoc ) = 0; + virtual HRESULT __stdcall put_CursorLocation ( + /*[in]*/ enum CursorLocationEnum plCursorLoc ) = 0; + virtual HRESULT __stdcall raw_NextRecordset ( + /*[out]*/ VARIANT * RecordsAffected, + /*[out,retval]*/ struct _Recordset_Deprecated * * ppiRs ) = 0; + virtual HRESULT __stdcall raw_Supports ( + /*[in]*/ enum CursorOptionEnum CursorOptions, + /*[out,retval]*/ VARIANT_BOOL * pb ) = 0; + virtual HRESULT __stdcall get_Collect ( + /*[in]*/ VARIANT Index, + /*[out,retval]*/ VARIANT * pvar ) = 0; + virtual HRESULT __stdcall put_Collect ( + /*[in]*/ VARIANT Index, + /*[in]*/ VARIANT pvar ) = 0; + virtual HRESULT __stdcall get_MarshalOptions ( + /*[out,retval]*/ enum MarshalOptionsEnum * peMarshal ) = 0; + virtual HRESULT __stdcall put_MarshalOptions ( + /*[in]*/ enum MarshalOptionsEnum peMarshal ) = 0; + virtual HRESULT __stdcall raw_Find ( + /*[in]*/ BSTR Criteria, + /*[in]*/ ADO_LONGPTR SkipRecords, + /*[in]*/ enum SearchDirectionEnum SearchDirection, + /*[in]*/ VARIANT Start = vtMissing ) = 0; +}; + +struct __declspec(uuid("0000054f-0000-0010-8000-00aa006d2ea4")) +Recordset20_Deprecated : Recordset15_Deprecated +{ + // + // Property data + // + + __declspec(property(get=GetDataSource,put=PutRefDataSource)) + IUnknownPtr DataSource; + __declspec(property(get=GetActiveCommand)) + IDispatchPtr ActiveCommand; + __declspec(property(get=GetStayInSync,put=PutStayInSync)) + VARIANT_BOOL StayInSync; + __declspec(property(get=GetDataMember,put=PutDataMember)) + _bstr_t DataMember; + + // + // Wrapper methods for error-handling + // + + HRESULT Cancel ( ); + IUnknownPtr GetDataSource ( ); + void PutRefDataSource ( + IUnknown * ppunkDataSource ); + HRESULT _xSave ( + _bstr_t FileName, + enum PersistFormatEnum PersistFormat ); + IDispatchPtr GetActiveCommand ( ); + void PutStayInSync ( + VARIANT_BOOL pbStayInSync ); + VARIANT_BOOL GetStayInSync ( ); + _bstr_t GetString ( + enum StringFormatEnum StringFormat, + long NumRows, + _bstr_t ColumnDelimeter, + _bstr_t RowDelimeter, + _bstr_t NullExpr ); + _bstr_t GetDataMember ( ); + void PutDataMember ( + _bstr_t pbstrDataMember ); + enum CompareEnum CompareBookmarks ( + const _variant_t & Bookmark1, + const _variant_t & Bookmark2 ); + _Recordset_DeprecatedPtr Clone ( + enum LockTypeEnum LockType ); + HRESULT Resync ( + enum AffectEnum AffectRecords, + enum ResyncEnum ResyncValues ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall raw_Cancel ( ) = 0; + virtual HRESULT __stdcall get_DataSource ( + /*[out,retval]*/ IUnknown * * ppunkDataSource ) = 0; + virtual HRESULT __stdcall putref_DataSource ( + /*[in]*/ IUnknown * ppunkDataSource ) = 0; + virtual HRESULT __stdcall raw__xSave ( + /*[in]*/ BSTR FileName, + /*[in]*/ enum PersistFormatEnum PersistFormat ) = 0; + virtual HRESULT __stdcall get_ActiveCommand ( + /*[out,retval]*/ IDispatch * * ppCmd ) = 0; + virtual HRESULT __stdcall put_StayInSync ( + /*[in]*/ VARIANT_BOOL pbStayInSync ) = 0; + virtual HRESULT __stdcall get_StayInSync ( + /*[out,retval]*/ VARIANT_BOOL * pbStayInSync ) = 0; + virtual HRESULT __stdcall raw_GetString ( + /*[in]*/ enum StringFormatEnum StringFormat, + /*[in]*/ long NumRows, + /*[in]*/ BSTR ColumnDelimeter, + /*[in]*/ BSTR RowDelimeter, + /*[in]*/ BSTR NullExpr, + /*[out,retval]*/ BSTR * pRetString ) = 0; + virtual HRESULT __stdcall get_DataMember ( + /*[out,retval]*/ BSTR * pbstrDataMember ) = 0; + virtual HRESULT __stdcall put_DataMember ( + /*[in]*/ BSTR pbstrDataMember ) = 0; + virtual HRESULT __stdcall raw_CompareBookmarks ( + /*[in]*/ VARIANT Bookmark1, + /*[in]*/ VARIANT Bookmark2, + /*[out,retval]*/ enum CompareEnum * pCompare ) = 0; + virtual HRESULT __stdcall raw_Clone ( + /*[in]*/ enum LockTypeEnum LockType, + /*[out,retval]*/ struct _Recordset_Deprecated * * ppvObject ) = 0; + virtual HRESULT __stdcall raw_Resync ( + /*[in]*/ enum AffectEnum AffectRecords, + /*[in]*/ enum ResyncEnum ResyncValues ) = 0; +}; + +struct __declspec(uuid("00000555-0000-0010-8000-00aa006d2ea4")) +Recordset21_Deprecated : Recordset20_Deprecated +{ + // + // Property data + // + + __declspec(property(get=GetIndex,put=PutIndex)) + _bstr_t Index; + + // + // Wrapper methods for error-handling + // + + HRESULT Seek ( + const _variant_t & KeyValues, + enum SeekEnum SeekOption ); + void PutIndex ( + _bstr_t pbstrIndex ); + _bstr_t GetIndex ( ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall raw_Seek ( + /*[in]*/ VARIANT KeyValues, + /*[in]*/ enum SeekEnum SeekOption ) = 0; + virtual HRESULT __stdcall put_Index ( + /*[in]*/ BSTR pbstrIndex ) = 0; + virtual HRESULT __stdcall get_Index ( + /*[out,retval]*/ BSTR * pbstrIndex ) = 0; +}; + +struct __declspec(uuid("00000556-0000-0010-8000-00aa006d2ea4")) +_Recordset_Deprecated : Recordset21_Deprecated +{ + // + // Wrapper methods for error-handling + // + + HRESULT Save ( + const _variant_t & Destination, + enum PersistFormatEnum PersistFormat ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall raw_Save ( + /*[in]*/ VARIANT Destination, + /*[in]*/ enum PersistFormatEnum PersistFormat ) = 0; +}; + +struct __declspec(uuid("00000508-0000-0010-8000-00aa006d2ea4")) +Command15_Deprecated : _ADO +{ + // + // Property data + // + + __declspec(property(get=GetParameters)) + Parameters_DeprecatedPtr Parameters; + __declspec(property(get=GetActiveConnection,put=PutRefActiveConnection)) + _Connection_DeprecatedPtr ActiveConnection; + __declspec(property(get=GetCommandText,put=PutCommandText)) + _bstr_t CommandText; + __declspec(property(get=GetCommandTimeout,put=PutCommandTimeout)) + long CommandTimeout; + __declspec(property(get=GetPrepared,put=PutPrepared)) + VARIANT_BOOL Prepared; + __declspec(property(get=GetCommandType,put=PutCommandType)) + enum CommandTypeEnum CommandType; + __declspec(property(get=GetName,put=PutName)) + _bstr_t Name; + + // + // Wrapper methods for error-handling + // + + _Connection_DeprecatedPtr GetActiveConnection ( ); + void PutRefActiveConnection ( + struct _Connection_Deprecated * ppvObject ); + void PutActiveConnection ( + const _variant_t & ppvObject ); + _bstr_t GetCommandText ( ); + void PutCommandText ( + _bstr_t pbstr ); + long GetCommandTimeout ( ); + void PutCommandTimeout ( + long pl ); + VARIANT_BOOL GetPrepared ( ); + void PutPrepared ( + VARIANT_BOOL pfPrepared ); + _Recordset_DeprecatedPtr Execute ( + VARIANT * RecordsAffected, + VARIANT * Parameters, + long Options ); + _Parameter_DeprecatedPtr CreateParameter ( + _bstr_t Name, + enum DataTypeEnum Type, + enum ParameterDirectionEnum Direction, + ADO_LONGPTR Size, + const _variant_t & Value = vtMissing ); + Parameters_DeprecatedPtr GetParameters ( ); + void PutCommandType ( + enum CommandTypeEnum plCmdType ); + enum CommandTypeEnum GetCommandType ( ); + _bstr_t GetName ( ); + void PutName ( + _bstr_t pbstrName ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_ActiveConnection ( + /*[out,retval]*/ struct _Connection_Deprecated * * ppvObject ) = 0; + virtual HRESULT __stdcall putref_ActiveConnection ( + /*[in]*/ struct _Connection_Deprecated * ppvObject ) = 0; + virtual HRESULT __stdcall put_ActiveConnection ( + /*[in]*/ VARIANT ppvObject ) = 0; + virtual HRESULT __stdcall get_CommandText ( + /*[out,retval]*/ BSTR * pbstr ) = 0; + virtual HRESULT __stdcall put_CommandText ( + /*[in]*/ BSTR pbstr ) = 0; + virtual HRESULT __stdcall get_CommandTimeout ( + /*[out,retval]*/ long * pl ) = 0; + virtual HRESULT __stdcall put_CommandTimeout ( + /*[in]*/ long pl ) = 0; + virtual HRESULT __stdcall get_Prepared ( + /*[out,retval]*/ VARIANT_BOOL * pfPrepared ) = 0; + virtual HRESULT __stdcall put_Prepared ( + /*[in]*/ VARIANT_BOOL pfPrepared ) = 0; + virtual HRESULT __stdcall raw_Execute ( + /*[out]*/ VARIANT * RecordsAffected, + /*[in]*/ VARIANT * Parameters, + /*[in]*/ long Options, + /*[out,retval]*/ struct _Recordset_Deprecated * * ppiRs ) = 0; + virtual HRESULT __stdcall raw_CreateParameter ( + /*[in]*/ BSTR Name, + /*[in]*/ enum DataTypeEnum Type, + /*[in]*/ enum ParameterDirectionEnum Direction, + /*[in]*/ ADO_LONGPTR Size, + /*[in]*/ VARIANT Value, + /*[out,retval]*/ struct _Parameter_Deprecated * * ppiprm ) = 0; + virtual HRESULT __stdcall get_Parameters ( + /*[out,retval]*/ struct Parameters_Deprecated * * ppvObject ) = 0; + virtual HRESULT __stdcall put_CommandType ( + /*[in]*/ enum CommandTypeEnum plCmdType ) = 0; + virtual HRESULT __stdcall get_CommandType ( + /*[out,retval]*/ enum CommandTypeEnum * plCmdType ) = 0; + virtual HRESULT __stdcall get_Name ( + /*[out,retval]*/ BSTR * pbstrName ) = 0; + virtual HRESULT __stdcall put_Name ( + /*[in]*/ BSTR pbstrName ) = 0; +}; + +struct __declspec(uuid("0000054e-0000-0010-8000-00aa006d2ea4")) +Command25_Deprecated : Command15_Deprecated +{ + // + // Property data + // + + __declspec(property(get=GetState)) + long State; + + // + // Wrapper methods for error-handling + // + + long GetState ( ); + HRESULT Cancel ( ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_State ( + /*[out,retval]*/ long * plObjState ) = 0; + virtual HRESULT __stdcall raw_Cancel ( ) = 0; +}; + +struct __declspec(uuid("b08400bd-f9d1-4d02-b856-71d5dba123e9")) +_Command_Deprecated : Command25_Deprecated +{ + // + // Property data + // + + __declspec(property(get=GetDialect,put=PutDialect)) + _bstr_t Dialect; + __declspec(property(get=GetNamedParameters,put=PutNamedParameters)) + VARIANT_BOOL NamedParameters; + + // + // Wrapper methods for error-handling + // + + void PutRefCommandStream ( + IUnknown * pvStream ); + _variant_t GetCommandStream ( ); + void PutDialect ( + _bstr_t pbstrDialect ); + _bstr_t GetDialect ( ); + void PutNamedParameters ( + VARIANT_BOOL pfNamedParameters ); + VARIANT_BOOL GetNamedParameters ( ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall putref_CommandStream ( + /*[in]*/ IUnknown * pvStream ) = 0; + virtual HRESULT __stdcall get_CommandStream ( + /*[out,retval]*/ VARIANT * pvStream ) = 0; + virtual HRESULT __stdcall put_Dialect ( + /*[in]*/ BSTR pbstrDialect ) = 0; + virtual HRESULT __stdcall get_Dialect ( + /*[out,retval]*/ BSTR * pbstrDialect ) = 0; + virtual HRESULT __stdcall put_NamedParameters ( + /*[in]*/ VARIANT_BOOL pfNamedParameters ) = 0; + virtual HRESULT __stdcall get_NamedParameters ( + /*[out,retval]*/ VARIANT_BOOL * pfNamedParameters ) = 0; +}; + +struct __declspec(uuid("00000403-0000-0010-8000-00aa006d2ea4")) +RecordsetEventsVt_Deprecated : IUnknown +{ + // + // Wrapper methods for error-handling + // + + HRESULT WillChangeField ( + long cFields, + const _variant_t & Fields, + enum EventStatusEnum * adStatus, + struct _Recordset_Deprecated * pRecordset ); + HRESULT FieldChangeComplete ( + long cFields, + const _variant_t & Fields, + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Recordset_Deprecated * pRecordset ); + HRESULT WillChangeRecord ( + enum EventReasonEnum adReason, + long cRecords, + enum EventStatusEnum * adStatus, + struct _Recordset_Deprecated * pRecordset ); + HRESULT RecordChangeComplete ( + enum EventReasonEnum adReason, + long cRecords, + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Recordset_Deprecated * pRecordset ); + HRESULT WillChangeRecordset ( + enum EventReasonEnum adReason, + enum EventStatusEnum * adStatus, + struct _Recordset_Deprecated * pRecordset ); + HRESULT RecordsetChangeComplete ( + enum EventReasonEnum adReason, + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Recordset_Deprecated * pRecordset ); + HRESULT WillMove ( + enum EventReasonEnum adReason, + enum EventStatusEnum * adStatus, + struct _Recordset_Deprecated * pRecordset ); + HRESULT MoveComplete ( + enum EventReasonEnum adReason, + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Recordset_Deprecated * pRecordset ); + HRESULT EndOfRecordset ( + VARIANT_BOOL * fMoreData, + enum EventStatusEnum * adStatus, + struct _Recordset_Deprecated * pRecordset ); + HRESULT FetchProgress ( + long Progress, + long MaxProgress, + enum EventStatusEnum * adStatus, + struct _Recordset_Deprecated * pRecordset ); + HRESULT FetchComplete ( + struct Error * pError, + enum EventStatusEnum * adStatus, + struct _Recordset_Deprecated * pRecordset ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall raw_WillChangeField ( + /*[in]*/ long cFields, + /*[in]*/ VARIANT Fields, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Recordset_Deprecated * pRecordset ) = 0; + virtual HRESULT __stdcall raw_FieldChangeComplete ( + /*[in]*/ long cFields, + /*[in]*/ VARIANT Fields, + /*[in]*/ struct Error * pError, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Recordset_Deprecated * pRecordset ) = 0; + virtual HRESULT __stdcall raw_WillChangeRecord ( + /*[in]*/ enum EventReasonEnum adReason, + /*[in]*/ long cRecords, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Recordset_Deprecated * pRecordset ) = 0; + virtual HRESULT __stdcall raw_RecordChangeComplete ( + /*[in]*/ enum EventReasonEnum adReason, + /*[in]*/ long cRecords, + /*[in]*/ struct Error * pError, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Recordset_Deprecated * pRecordset ) = 0; + virtual HRESULT __stdcall raw_WillChangeRecordset ( + /*[in]*/ enum EventReasonEnum adReason, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Recordset_Deprecated * pRecordset ) = 0; + virtual HRESULT __stdcall raw_RecordsetChangeComplete ( + /*[in]*/ enum EventReasonEnum adReason, + /*[in]*/ struct Error * pError, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Recordset_Deprecated * pRecordset ) = 0; + virtual HRESULT __stdcall raw_WillMove ( + /*[in]*/ enum EventReasonEnum adReason, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Recordset_Deprecated * pRecordset ) = 0; + virtual HRESULT __stdcall raw_MoveComplete ( + /*[in]*/ enum EventReasonEnum adReason, + /*[in]*/ struct Error * pError, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Recordset_Deprecated * pRecordset ) = 0; + virtual HRESULT __stdcall raw_EndOfRecordset ( + /*[in,out]*/ VARIANT_BOOL * fMoreData, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Recordset_Deprecated * pRecordset ) = 0; + virtual HRESULT __stdcall raw_FetchProgress ( + /*[in]*/ long Progress, + /*[in]*/ long MaxProgress, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Recordset_Deprecated * pRecordset ) = 0; + virtual HRESULT __stdcall raw_FetchComplete ( + /*[in]*/ struct Error * pError, + /*[in,out]*/ enum EventStatusEnum * adStatus, + /*[in]*/ struct _Recordset_Deprecated * pRecordset ) = 0; +}; + +struct __declspec(uuid("00000562-0000-0010-8000-00aa006d2ea4")) +_Record_Deprecated : _ADO +{ + // + // Property data + // + + __declspec(property(get=GetFields)) + Fields_DeprecatedPtr Fields; + __declspec(property(get=GetState)) + enum ObjectStateEnum State; + __declspec(property(get=GetMode,put=PutMode)) + enum ConnectModeEnum Mode; + __declspec(property(get=GetParentURL)) + _bstr_t ParentURL; + __declspec(property(get=GetRecordType)) + enum RecordTypeEnum RecordType; + + // + // Wrapper methods for error-handling + // + + _variant_t GetActiveConnection ( ); + void PutActiveConnection ( + _bstr_t pvar ); + void PutRefActiveConnection ( + struct _Connection_Deprecated * pvar ); + enum ObjectStateEnum GetState ( ); + _variant_t GetSource ( ); + void PutSource ( + _bstr_t pvar ); + void PutRefSource ( + IDispatch * pvar ); + enum ConnectModeEnum GetMode ( ); + void PutMode ( + enum ConnectModeEnum pMode ); + _bstr_t GetParentURL ( ); + _bstr_t MoveRecord ( + _bstr_t Source, + _bstr_t Destination, + _bstr_t UserName, + _bstr_t Password, + enum MoveRecordOptionsEnum Options, + VARIANT_BOOL Async ); + _bstr_t CopyRecord ( + _bstr_t Source, + _bstr_t Destination, + _bstr_t UserName, + _bstr_t Password, + enum CopyRecordOptionsEnum Options, + VARIANT_BOOL Async ); + HRESULT DeleteRecord ( + _bstr_t Source, + VARIANT_BOOL Async ); + HRESULT Open ( + const _variant_t & Source, + const _variant_t & ActiveConnection, + enum ConnectModeEnum Mode, + enum RecordCreateOptionsEnum CreateOptions, + enum RecordOpenOptionsEnum Options, + _bstr_t UserName, + _bstr_t Password ); + HRESULT Close ( ); + Fields_DeprecatedPtr GetFields ( ); + enum RecordTypeEnum GetRecordType ( ); + _Recordset_DeprecatedPtr GetChildren ( ); + HRESULT Cancel ( ); + + // + // Raw methods provided by interface + // + + virtual HRESULT __stdcall get_ActiveConnection ( + /*[out,retval]*/ VARIANT * pvar ) = 0; + virtual HRESULT __stdcall put_ActiveConnection ( + /*[in]*/ BSTR pvar ) = 0; + virtual HRESULT __stdcall putref_ActiveConnection ( + /*[in]*/ struct _Connection_Deprecated * pvar ) = 0; + virtual HRESULT __stdcall get_State ( + /*[out,retval]*/ enum ObjectStateEnum * pState ) = 0; + virtual HRESULT __stdcall get_Source ( + /*[out,retval]*/ VARIANT * pvar ) = 0; + virtual HRESULT __stdcall put_Source ( + /*[in]*/ BSTR pvar ) = 0; + virtual HRESULT __stdcall putref_Source ( + /*[in]*/ IDispatch * pvar ) = 0; + virtual HRESULT __stdcall get_Mode ( + /*[out,retval]*/ enum ConnectModeEnum * pMode ) = 0; + virtual HRESULT __stdcall put_Mode ( + /*[in]*/ enum ConnectModeEnum pMode ) = 0; + virtual HRESULT __stdcall get_ParentURL ( + /*[out,retval]*/ BSTR * pbstrParentURL ) = 0; + virtual HRESULT __stdcall raw_MoveRecord ( + /*[in]*/ BSTR Source, + /*[in]*/ BSTR Destination, + /*[in]*/ BSTR UserName, + /*[in]*/ BSTR Password, + /*[in]*/ enum MoveRecordOptionsEnum Options, + /*[in]*/ VARIANT_BOOL Async, + /*[out,retval]*/ BSTR * pbstrNewURL ) = 0; + virtual HRESULT __stdcall raw_CopyRecord ( + /*[in]*/ BSTR Source, + /*[in]*/ BSTR Destination, + /*[in]*/ BSTR UserName, + /*[in]*/ BSTR Password, + /*[in]*/ enum CopyRecordOptionsEnum Options, + /*[in]*/ VARIANT_BOOL Async, + /*[out,retval]*/ BSTR * pbstrNewURL ) = 0; + virtual HRESULT __stdcall raw_DeleteRecord ( + /*[in]*/ BSTR Source, + /*[in]*/ VARIANT_BOOL Async ) = 0; + virtual HRESULT __stdcall raw_Open ( + /*[in]*/ VARIANT Source, + /*[in]*/ VARIANT ActiveConnection, + /*[in]*/ enum ConnectModeEnum Mode, + /*[in]*/ enum RecordCreateOptionsEnum CreateOptions, + /*[in]*/ enum RecordOpenOptionsEnum Options, + /*[in]*/ BSTR UserName, + /*[in]*/ BSTR Password ) = 0; + virtual HRESULT __stdcall raw_Close ( ) = 0; + virtual HRESULT __stdcall get_Fields ( + /*[out,retval]*/ struct Fields_Deprecated * * ppFlds ) = 0; + virtual HRESULT __stdcall get_RecordType ( + /*[out,retval]*/ enum RecordTypeEnum * ptype ) = 0; + virtual HRESULT __stdcall raw_GetChildren ( + /*[out,retval]*/ struct _Recordset_Deprecated * * pprset ) = 0; + virtual HRESULT __stdcall raw_Cancel ( ) = 0; +}; + +// +// Wrapper method implementations +// + +#include "z:\tc_install\zhengtai\c\getbomprop\dfl_bom_wl_toerp\x64\release\msado15.tli" + +#pragma pack(pop) diff --git a/DFL_BOM_WL_TOERP/x64/Release/msado15.tli b/DFL_BOM_WL_TOERP/x64/Release/msado15.tli new file mode 100644 index 0000000..d2dc602 --- /dev/null +++ b/DFL_BOM_WL_TOERP/x64/Release/msado15.tli @@ -0,0 +1,3952 @@ +// Created by Microsoft (R) C/C++ Compiler Version 14.00.23026.0 (12cf8bfa). +// +// z:\tc_install\zhengtai\c\getbomprop\dfl_bom_wl_toerp\x64\release\msado15.tli +// +// Wrapper implementations for type library c:\program files\common files\system\ado\msado15.dll +// compiler-generated file created 03/08/24 at 10:11:29 - DO NOT EDIT! + +#pragma once + +// +// interface _Collection wrapper method implementations +// + +inline long _Collection::GetCount ( ) { + long _result = 0; + HRESULT _hr = get_Count(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline IUnknownPtr _Collection::_NewEnum ( ) { + IUnknown * _result = 0; + HRESULT _hr = raw__NewEnum(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return IUnknownPtr(_result, false); +} + +inline HRESULT _Collection::Refresh ( ) { + HRESULT _hr = raw_Refresh(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +// +// interface _DynaCollection wrapper method implementations +// + +inline HRESULT _DynaCollection::Append ( IDispatch * Object ) { + HRESULT _hr = raw_Append(Object); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT _DynaCollection::Delete ( const _variant_t & Index ) { + HRESULT _hr = raw_Delete(Index); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +// +// interface Property wrapper method implementations +// + +inline _variant_t Property::GetValue ( ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = get_Value(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline void Property::PutValue ( const _variant_t & pval ) { + HRESULT _hr = put_Value(pval); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline _bstr_t Property::GetName ( ) { + BSTR _result = 0; + HRESULT _hr = get_Name(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline enum DataTypeEnum Property::GetType ( ) { + enum DataTypeEnum _result; + HRESULT _hr = get_Type(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline long Property::GetAttributes ( ) { + long _result = 0; + HRESULT _hr = get_Attributes(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Property::PutAttributes ( long plAttributes ) { + HRESULT _hr = put_Attributes(plAttributes); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +// +// interface Properties wrapper method implementations +// + +inline PropertyPtr Properties::GetItem ( const _variant_t & Index ) { + struct Property * _result = 0; + HRESULT _hr = get_Item(Index, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return PropertyPtr(_result, false); +} + +// +// interface _ADO wrapper method implementations +// + +inline PropertiesPtr _ADO::GetProperties ( ) { + struct Properties * _result = 0; + HRESULT _hr = get_Properties(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return PropertiesPtr(_result, false); +} + +// +// interface Error wrapper method implementations +// + +inline long Error::GetNumber ( ) { + long _result = 0; + HRESULT _hr = get_Number(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline _bstr_t Error::GetSource ( ) { + BSTR _result = 0; + HRESULT _hr = get_Source(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline _bstr_t Error::GetDescription ( ) { + BSTR _result = 0; + HRESULT _hr = get_Description(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline _bstr_t Error::GetHelpFile ( ) { + BSTR _result = 0; + HRESULT _hr = get_HelpFile(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline long Error::GetHelpContext ( ) { + long _result = 0; + HRESULT _hr = get_HelpContext(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline _bstr_t Error::GetSQLState ( ) { + BSTR _result = 0; + HRESULT _hr = get_SQLState(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline long Error::GetNativeError ( ) { + long _result = 0; + HRESULT _hr = get_NativeError(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +// +// interface Errors wrapper method implementations +// + +inline ErrorPtr Errors::GetItem ( const _variant_t & Index ) { + struct Error * _result = 0; + HRESULT _hr = get_Item(Index, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return ErrorPtr(_result, false); +} + +inline HRESULT Errors::Clear ( ) { + HRESULT _hr = raw_Clear(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +// +// interface Field20 wrapper method implementations +// + +inline long Field20::GetActualSize ( ) { + long _result = 0; + HRESULT _hr = get_ActualSize(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline long Field20::GetAttributes ( ) { + long _result = 0; + HRESULT _hr = get_Attributes(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline long Field20::GetDefinedSize ( ) { + long _result = 0; + HRESULT _hr = get_DefinedSize(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline _bstr_t Field20::GetName ( ) { + BSTR _result = 0; + HRESULT _hr = get_Name(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline enum DataTypeEnum Field20::GetType ( ) { + enum DataTypeEnum _result; + HRESULT _hr = get_Type(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline _variant_t Field20::GetValue ( ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = get_Value(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline void Field20::PutValue ( const _variant_t & pvar ) { + HRESULT _hr = put_Value(pvar); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline unsigned char Field20::GetPrecision ( ) { + unsigned char _result = 0; + HRESULT _hr = get_Precision(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline unsigned char Field20::GetNumericScale ( ) { + unsigned char _result = 0; + HRESULT _hr = get_NumericScale(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline HRESULT Field20::AppendChunk ( const _variant_t & Data ) { + HRESULT _hr = raw_AppendChunk(Data); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline _variant_t Field20::GetChunk ( long Length ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = raw_GetChunk(Length, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline _variant_t Field20::GetOriginalValue ( ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = get_OriginalValue(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline _variant_t Field20::GetUnderlyingValue ( ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = get_UnderlyingValue(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline IUnknownPtr Field20::GetDataFormat ( ) { + IUnknown * _result = 0; + HRESULT _hr = get_DataFormat(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return IUnknownPtr(_result, false); +} + +inline void Field20::PutRefDataFormat ( IUnknown * ppiDF ) { + HRESULT _hr = putref_DataFormat(ppiDF); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline void Field20::PutPrecision ( unsigned char pbPrecision ) { + HRESULT _hr = put_Precision(pbPrecision); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline void Field20::PutNumericScale ( unsigned char pbNumericScale ) { + HRESULT _hr = put_NumericScale(pbNumericScale); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline void Field20::PutType ( enum DataTypeEnum pDataType ) { + HRESULT _hr = put_Type(pDataType); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline void Field20::PutDefinedSize ( long pl ) { + HRESULT _hr = put_DefinedSize(pl); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline void Field20::PutAttributes ( long pl ) { + HRESULT _hr = put_Attributes(pl); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +// +// interface Field wrapper method implementations +// + +inline long Field::GetStatus ( ) { + long _result = 0; + HRESULT _hr = get_Status(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +// +// interface Fields15 wrapper method implementations +// + +inline FieldPtr Fields15::GetItem ( const _variant_t & Index ) { + struct Field * _result = 0; + HRESULT _hr = get_Item(Index, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return FieldPtr(_result, false); +} + +// +// interface Fields20 wrapper method implementations +// + +inline HRESULT Fields20::_Append ( _bstr_t Name, enum DataTypeEnum Type, long DefinedSize, enum FieldAttributeEnum Attrib ) { + HRESULT _hr = raw__Append(Name, Type, DefinedSize, Attrib); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Fields20::Delete ( const _variant_t & Index ) { + HRESULT _hr = raw_Delete(Index); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +// +// interface Fields wrapper method implementations +// + +inline HRESULT Fields::Append ( _bstr_t Name, enum DataTypeEnum Type, long DefinedSize, enum FieldAttributeEnum Attrib, const _variant_t & FieldValue ) { + HRESULT _hr = raw_Append(Name, Type, DefinedSize, Attrib, FieldValue); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Fields::Update ( ) { + HRESULT _hr = raw_Update(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Fields::Resync ( enum ResyncEnum ResyncValues ) { + HRESULT _hr = raw_Resync(ResyncValues); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Fields::CancelUpdate ( ) { + HRESULT _hr = raw_CancelUpdate(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +// +// interface _Parameter wrapper method implementations +// + +inline _bstr_t _Parameter::GetName ( ) { + BSTR _result = 0; + HRESULT _hr = get_Name(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline void _Parameter::PutName ( _bstr_t pbstr ) { + HRESULT _hr = put_Name(pbstr); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline _variant_t _Parameter::GetValue ( ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = get_Value(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline void _Parameter::PutValue ( const _variant_t & pvar ) { + HRESULT _hr = put_Value(pvar); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline enum DataTypeEnum _Parameter::GetType ( ) { + enum DataTypeEnum _result; + HRESULT _hr = get_Type(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void _Parameter::PutType ( enum DataTypeEnum psDataType ) { + HRESULT _hr = put_Type(psDataType); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline void _Parameter::PutDirection ( enum ParameterDirectionEnum plParmDirection ) { + HRESULT _hr = put_Direction(plParmDirection); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline enum ParameterDirectionEnum _Parameter::GetDirection ( ) { + enum ParameterDirectionEnum _result; + HRESULT _hr = get_Direction(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void _Parameter::PutPrecision ( unsigned char pbPrecision ) { + HRESULT _hr = put_Precision(pbPrecision); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline unsigned char _Parameter::GetPrecision ( ) { + unsigned char _result = 0; + HRESULT _hr = get_Precision(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void _Parameter::PutNumericScale ( unsigned char pbScale ) { + HRESULT _hr = put_NumericScale(pbScale); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline unsigned char _Parameter::GetNumericScale ( ) { + unsigned char _result = 0; + HRESULT _hr = get_NumericScale(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void _Parameter::PutSize ( long pl ) { + HRESULT _hr = put_Size(pl); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline long _Parameter::GetSize ( ) { + long _result = 0; + HRESULT _hr = get_Size(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline HRESULT _Parameter::AppendChunk ( const _variant_t & Val ) { + HRESULT _hr = raw_AppendChunk(Val); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline long _Parameter::GetAttributes ( ) { + long _result = 0; + HRESULT _hr = get_Attributes(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void _Parameter::PutAttributes ( long plParmAttribs ) { + HRESULT _hr = put_Attributes(plParmAttribs); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +// +// interface Parameters wrapper method implementations +// + +inline _ParameterPtr Parameters::GetItem ( const _variant_t & Index ) { + struct _Parameter * _result = 0; + HRESULT _hr = get_Item(Index, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _ParameterPtr(_result, false); +} + +// +// dispinterface ConnectionEvents wrapper method implementations +// + +inline HRESULT ConnectionEvents::InfoMessage ( struct Error * pError, enum EventStatusEnum * adStatus, struct _Connection * pConnection ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0x0, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x0009\x4003\x0009", pError, adStatus, pConnection); + return _result; +} + +inline HRESULT ConnectionEvents::BeginTransComplete ( long TransactionLevel, struct Error * pError, enum EventStatusEnum * adStatus, struct _Connection * pConnection ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0x1, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x0003\x0009\x4003\x0009", TransactionLevel, pError, adStatus, pConnection); + return _result; +} + +inline HRESULT ConnectionEvents::CommitTransComplete ( struct Error * pError, enum EventStatusEnum * adStatus, struct _Connection * pConnection ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0x3, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x0009\x4003\x0009", pError, adStatus, pConnection); + return _result; +} + +inline HRESULT ConnectionEvents::RollbackTransComplete ( struct Error * pError, enum EventStatusEnum * adStatus, struct _Connection * pConnection ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0x2, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x0009\x4003\x0009", pError, adStatus, pConnection); + return _result; +} + +inline HRESULT ConnectionEvents::WillExecute ( BSTR * Source, enum CursorTypeEnum * CursorType, enum LockTypeEnum * LockType, long * Options, enum EventStatusEnum * adStatus, struct _Command * pCommand, struct _Recordset * pRecordset, struct _Connection * pConnection ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0x4, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x4008\x4003\x4003\x4003\x4003\x0009\x0009\x0009", Source, CursorType, LockType, Options, adStatus, pCommand, pRecordset, pConnection); + return _result; +} + +inline HRESULT ConnectionEvents::ExecuteComplete ( long RecordsAffected, struct Error * pError, enum EventStatusEnum * adStatus, struct _Command * pCommand, struct _Recordset * pRecordset, struct _Connection * pConnection ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0x5, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x0003\x0009\x4003\x0009\x0009\x0009", RecordsAffected, pError, adStatus, pCommand, pRecordset, pConnection); + return _result; +} + +inline HRESULT ConnectionEvents::WillConnect ( BSTR * ConnectionString, BSTR * UserID, BSTR * Password, long * Options, enum EventStatusEnum * adStatus, struct _Connection * pConnection ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0x6, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x4008\x4008\x4008\x4003\x4003\x0009", ConnectionString, UserID, Password, Options, adStatus, pConnection); + return _result; +} + +inline HRESULT ConnectionEvents::ConnectComplete ( struct Error * pError, enum EventStatusEnum * adStatus, struct _Connection * pConnection ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0x7, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x0009\x4003\x0009", pError, adStatus, pConnection); + return _result; +} + +inline HRESULT ConnectionEvents::Disconnect ( enum EventStatusEnum * adStatus, struct _Connection * pConnection ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0x8, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x4003\x0009", adStatus, pConnection); + return _result; +} + +// +// dispinterface RecordsetEvents wrapper method implementations +// + +inline HRESULT RecordsetEvents::WillChangeField ( long cFields, const _variant_t & Fields, enum EventStatusEnum * adStatus, struct _Recordset * pRecordset ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0x9, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x0003\x000c\x4003\x0009", cFields, &Fields, adStatus, pRecordset); + return _result; +} + +inline HRESULT RecordsetEvents::FieldChangeComplete ( long cFields, const _variant_t & Fields, struct Error * pError, enum EventStatusEnum * adStatus, struct _Recordset * pRecordset ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0xa, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x0003\x000c\x0009\x4003\x0009", cFields, &Fields, pError, adStatus, pRecordset); + return _result; +} + +inline HRESULT RecordsetEvents::WillChangeRecord ( enum EventReasonEnum adReason, long cRecords, enum EventStatusEnum * adStatus, struct _Recordset * pRecordset ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0xb, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x0003\x0003\x4003\x0009", adReason, cRecords, adStatus, pRecordset); + return _result; +} + +inline HRESULT RecordsetEvents::RecordChangeComplete ( enum EventReasonEnum adReason, long cRecords, struct Error * pError, enum EventStatusEnum * adStatus, struct _Recordset * pRecordset ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0xc, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x0003\x0003\x0009\x4003\x0009", adReason, cRecords, pError, adStatus, pRecordset); + return _result; +} + +inline HRESULT RecordsetEvents::WillChangeRecordset ( enum EventReasonEnum adReason, enum EventStatusEnum * adStatus, struct _Recordset * pRecordset ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0xd, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x0003\x4003\x0009", adReason, adStatus, pRecordset); + return _result; +} + +inline HRESULT RecordsetEvents::RecordsetChangeComplete ( enum EventReasonEnum adReason, struct Error * pError, enum EventStatusEnum * adStatus, struct _Recordset * pRecordset ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0xe, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x0003\x0009\x4003\x0009", adReason, pError, adStatus, pRecordset); + return _result; +} + +inline HRESULT RecordsetEvents::WillMove ( enum EventReasonEnum adReason, enum EventStatusEnum * adStatus, struct _Recordset * pRecordset ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0xf, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x0003\x4003\x0009", adReason, adStatus, pRecordset); + return _result; +} + +inline HRESULT RecordsetEvents::MoveComplete ( enum EventReasonEnum adReason, struct Error * pError, enum EventStatusEnum * adStatus, struct _Recordset * pRecordset ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0x10, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x0003\x0009\x4003\x0009", adReason, pError, adStatus, pRecordset); + return _result; +} + +inline HRESULT RecordsetEvents::EndOfRecordset ( VARIANT_BOOL * fMoreData, enum EventStatusEnum * adStatus, struct _Recordset * pRecordset ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0x11, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x400b\x4003\x0009", fMoreData, adStatus, pRecordset); + return _result; +} + +inline HRESULT RecordsetEvents::FetchProgress ( long Progress, long MaxProgress, enum EventStatusEnum * adStatus, struct _Recordset * pRecordset ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0x12, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x0003\x0003\x4003\x0009", Progress, MaxProgress, adStatus, pRecordset); + return _result; +} + +inline HRESULT RecordsetEvents::FetchComplete ( struct Error * pError, enum EventStatusEnum * adStatus, struct _Recordset * pRecordset ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0x13, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x0009\x4003\x0009", pError, adStatus, pRecordset); + return _result; +} + +// +// interface ADOConnectionConstruction15 wrapper method implementations +// + +inline IUnknownPtr ADOConnectionConstruction15::GetDSO ( ) { + IUnknown * _result = 0; + HRESULT _hr = get_DSO(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return IUnknownPtr(_result, false); +} + +inline IUnknownPtr ADOConnectionConstruction15::GetSession ( ) { + IUnknown * _result = 0; + HRESULT _hr = get_Session(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return IUnknownPtr(_result, false); +} + +inline HRESULT ADOConnectionConstruction15::WrapDSOandSession ( IUnknown * pDSO, IUnknown * pSession ) { + HRESULT _hr = raw_WrapDSOandSession(pDSO, pSession); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +// +// interface _Stream wrapper method implementations +// + +inline long _Stream::GetSize ( ) { + long _result = 0; + HRESULT _hr = get_Size(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline VARIANT_BOOL _Stream::GetEOS ( ) { + VARIANT_BOOL _result = 0; + HRESULT _hr = get_EOS(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline long _Stream::GetPosition ( ) { + long _result = 0; + HRESULT _hr = get_Position(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void _Stream::PutPosition ( long pPos ) { + HRESULT _hr = put_Position(pPos); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline enum StreamTypeEnum _Stream::GetType ( ) { + enum StreamTypeEnum _result; + HRESULT _hr = get_Type(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void _Stream::PutType ( enum StreamTypeEnum ptype ) { + HRESULT _hr = put_Type(ptype); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline enum LineSeparatorEnum _Stream::GetLineSeparator ( ) { + enum LineSeparatorEnum _result; + HRESULT _hr = get_LineSeparator(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void _Stream::PutLineSeparator ( enum LineSeparatorEnum pLS ) { + HRESULT _hr = put_LineSeparator(pLS); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline enum ObjectStateEnum _Stream::GetState ( ) { + enum ObjectStateEnum _result; + HRESULT _hr = get_State(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline enum ConnectModeEnum _Stream::GetMode ( ) { + enum ConnectModeEnum _result; + HRESULT _hr = get_Mode(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void _Stream::PutMode ( enum ConnectModeEnum pMode ) { + HRESULT _hr = put_Mode(pMode); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline _bstr_t _Stream::GetCharset ( ) { + BSTR _result = 0; + HRESULT _hr = get_Charset(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline void _Stream::PutCharset ( _bstr_t pbstrCharset ) { + HRESULT _hr = put_Charset(pbstrCharset); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline _variant_t _Stream::Read ( long NumBytes ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = raw_Read(NumBytes, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline HRESULT _Stream::Open ( const _variant_t & Source, enum ConnectModeEnum Mode, enum StreamOpenOptionsEnum Options, _bstr_t UserName, _bstr_t Password ) { + HRESULT _hr = raw_Open(Source, Mode, Options, UserName, Password); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT _Stream::Close ( ) { + HRESULT _hr = raw_Close(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT _Stream::SkipLine ( ) { + HRESULT _hr = raw_SkipLine(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT _Stream::Write ( const _variant_t & Buffer ) { + HRESULT _hr = raw_Write(Buffer); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT _Stream::SetEOS ( ) { + HRESULT _hr = raw_SetEOS(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT _Stream::CopyTo ( struct _Stream * DestStream, long CharNumber ) { + HRESULT _hr = raw_CopyTo(DestStream, CharNumber); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT _Stream::Flush ( ) { + HRESULT _hr = raw_Flush(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT _Stream::SaveToFile ( _bstr_t FileName, enum SaveOptionsEnum Options ) { + HRESULT _hr = raw_SaveToFile(FileName, Options); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT _Stream::LoadFromFile ( _bstr_t FileName ) { + HRESULT _hr = raw_LoadFromFile(FileName); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline _bstr_t _Stream::ReadText ( long NumChars ) { + BSTR _result = 0; + HRESULT _hr = raw_ReadText(NumChars, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline HRESULT _Stream::WriteText ( _bstr_t Data, enum StreamWriteEnum Options ) { + HRESULT _hr = raw_WriteText(Data, Options); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT _Stream::Cancel ( ) { + HRESULT _hr = raw_Cancel(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +// +// interface ADORecordConstruction wrapper method implementations +// + +inline IUnknownPtr ADORecordConstruction::GetRow ( ) { + IUnknown * _result = 0; + HRESULT _hr = get_Row(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return IUnknownPtr(_result, false); +} + +inline void ADORecordConstruction::PutRow ( IUnknown * ppRow ) { + HRESULT _hr = put_Row(ppRow); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline void ADORecordConstruction::PutParentRow ( IUnknown * _arg1 ) { + HRESULT _hr = put_ParentRow(_arg1); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +// +// interface ADOStreamConstruction wrapper method implementations +// + +inline IUnknownPtr ADOStreamConstruction::GetStream ( ) { + IUnknown * _result = 0; + HRESULT _hr = get_Stream(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return IUnknownPtr(_result, false); +} + +inline void ADOStreamConstruction::PutStream ( IUnknown * ppStm ) { + HRESULT _hr = put_Stream(ppStm); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +// +// interface ADOCommandConstruction wrapper method implementations +// + +inline IUnknownPtr ADOCommandConstruction::GetOLEDBCommand ( ) { + IUnknown * _result = 0; + HRESULT _hr = get_OLEDBCommand(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return IUnknownPtr(_result, false); +} + +inline void ADOCommandConstruction::PutOLEDBCommand ( IUnknown * ppOLEDBCommand ) { + HRESULT _hr = put_OLEDBCommand(ppOLEDBCommand); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +// +// interface ADORecordsetConstruction wrapper method implementations +// + +inline IUnknownPtr ADORecordsetConstruction::GetRowset ( ) { + IUnknown * _result = 0; + HRESULT _hr = get_Rowset(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return IUnknownPtr(_result, false); +} + +inline void ADORecordsetConstruction::PutRowset ( IUnknown * ppRowset ) { + HRESULT _hr = put_Rowset(ppRowset); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline ADO_LONGPTR ADORecordsetConstruction::GetChapter ( ) { + ADO_LONGPTR _result; + HRESULT _hr = get_Chapter(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void ADORecordsetConstruction::PutChapter ( ADO_LONGPTR plChapter ) { + HRESULT _hr = put_Chapter(plChapter); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline IUnknownPtr ADORecordsetConstruction::GetRowPosition ( ) { + IUnknown * _result = 0; + HRESULT _hr = get_RowPosition(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return IUnknownPtr(_result, false); +} + +inline void ADORecordsetConstruction::PutRowPosition ( IUnknown * ppRowPos ) { + HRESULT _hr = put_RowPosition(ppRowPos); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +// +// interface Field15 wrapper method implementations +// + +inline long Field15::GetActualSize ( ) { + long _result = 0; + HRESULT _hr = get_ActualSize(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline long Field15::GetAttributes ( ) { + long _result = 0; + HRESULT _hr = get_Attributes(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline long Field15::GetDefinedSize ( ) { + long _result = 0; + HRESULT _hr = get_DefinedSize(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline _bstr_t Field15::GetName ( ) { + BSTR _result = 0; + HRESULT _hr = get_Name(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline enum DataTypeEnum Field15::GetType ( ) { + enum DataTypeEnum _result; + HRESULT _hr = get_Type(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline _variant_t Field15::GetValue ( ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = get_Value(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline void Field15::PutValue ( const _variant_t & pvar ) { + HRESULT _hr = put_Value(pvar); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline unsigned char Field15::GetPrecision ( ) { + unsigned char _result = 0; + HRESULT _hr = get_Precision(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline unsigned char Field15::GetNumericScale ( ) { + unsigned char _result = 0; + HRESULT _hr = get_NumericScale(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline HRESULT Field15::AppendChunk ( const _variant_t & Data ) { + HRESULT _hr = raw_AppendChunk(Data); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline _variant_t Field15::GetChunk ( long Length ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = raw_GetChunk(Length, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline _variant_t Field15::GetOriginalValue ( ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = get_OriginalValue(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline _variant_t Field15::GetUnderlyingValue ( ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = get_UnderlyingValue(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +// +// interface Field20_Deprecated wrapper method implementations +// + +inline ADO_LONGPTR Field20_Deprecated::GetActualSize ( ) { + ADO_LONGPTR _result; + HRESULT _hr = get_ActualSize(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline long Field20_Deprecated::GetAttributes ( ) { + long _result = 0; + HRESULT _hr = get_Attributes(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline ADO_LONGPTR Field20_Deprecated::GetDefinedSize ( ) { + ADO_LONGPTR _result; + HRESULT _hr = get_DefinedSize(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline _bstr_t Field20_Deprecated::GetName ( ) { + BSTR _result = 0; + HRESULT _hr = get_Name(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline enum DataTypeEnum Field20_Deprecated::GetType ( ) { + enum DataTypeEnum _result; + HRESULT _hr = get_Type(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline _variant_t Field20_Deprecated::GetValue ( ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = get_Value(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline void Field20_Deprecated::PutValue ( const _variant_t & pvar ) { + HRESULT _hr = put_Value(pvar); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline unsigned char Field20_Deprecated::GetPrecision ( ) { + unsigned char _result = 0; + HRESULT _hr = get_Precision(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline unsigned char Field20_Deprecated::GetNumericScale ( ) { + unsigned char _result = 0; + HRESULT _hr = get_NumericScale(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline HRESULT Field20_Deprecated::AppendChunk ( const _variant_t & Data ) { + HRESULT _hr = raw_AppendChunk(Data); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline _variant_t Field20_Deprecated::GetChunk ( long Length ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = raw_GetChunk(Length, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline _variant_t Field20_Deprecated::GetOriginalValue ( ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = get_OriginalValue(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline _variant_t Field20_Deprecated::GetUnderlyingValue ( ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = get_UnderlyingValue(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline IUnknownPtr Field20_Deprecated::GetDataFormat ( ) { + IUnknown * _result = 0; + HRESULT _hr = get_DataFormat(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return IUnknownPtr(_result, false); +} + +inline void Field20_Deprecated::PutRefDataFormat ( IUnknown * ppiDF ) { + HRESULT _hr = putref_DataFormat(ppiDF); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline void Field20_Deprecated::PutPrecision ( unsigned char pbPrecision ) { + HRESULT _hr = put_Precision(pbPrecision); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline void Field20_Deprecated::PutNumericScale ( unsigned char pbNumericScale ) { + HRESULT _hr = put_NumericScale(pbNumericScale); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline void Field20_Deprecated::PutType ( enum DataTypeEnum pDataType ) { + HRESULT _hr = put_Type(pDataType); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline void Field20_Deprecated::PutDefinedSize ( ADO_LONGPTR pl ) { + HRESULT _hr = put_DefinedSize(pl); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline void Field20_Deprecated::PutAttributes ( long pl ) { + HRESULT _hr = put_Attributes(pl); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +// +// interface Field_Deprecated wrapper method implementations +// + +inline long Field_Deprecated::GetStatus ( ) { + long _result = 0; + HRESULT _hr = get_Status(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +// +// interface Fields15_Deprecated wrapper method implementations +// + +inline Field_DeprecatedPtr Fields15_Deprecated::GetItem ( const _variant_t & Index ) { + struct Field_Deprecated * _result = 0; + HRESULT _hr = get_Item(Index, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return Field_DeprecatedPtr(_result, false); +} + +// +// interface Fields20_Deprecated wrapper method implementations +// + +inline HRESULT Fields20_Deprecated::_Append ( _bstr_t Name, enum DataTypeEnum Type, ADO_LONGPTR DefinedSize, enum FieldAttributeEnum Attrib ) { + HRESULT _hr = raw__Append(Name, Type, DefinedSize, Attrib); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Fields20_Deprecated::Delete ( const _variant_t & Index ) { + HRESULT _hr = raw_Delete(Index); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +// +// interface Fields_Deprecated wrapper method implementations +// + +inline HRESULT Fields_Deprecated::Append ( _bstr_t Name, enum DataTypeEnum Type, ADO_LONGPTR DefinedSize, enum FieldAttributeEnum Attrib, const _variant_t & FieldValue ) { + HRESULT _hr = raw_Append(Name, Type, DefinedSize, Attrib, FieldValue); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Fields_Deprecated::Update ( ) { + HRESULT _hr = raw_Update(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Fields_Deprecated::Resync ( enum ResyncEnum ResyncValues ) { + HRESULT _hr = raw_Resync(ResyncValues); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Fields_Deprecated::CancelUpdate ( ) { + HRESULT _hr = raw_CancelUpdate(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +// +// interface _Parameter_Deprecated wrapper method implementations +// + +inline _bstr_t _Parameter_Deprecated::GetName ( ) { + BSTR _result = 0; + HRESULT _hr = get_Name(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline void _Parameter_Deprecated::PutName ( _bstr_t pbstr ) { + HRESULT _hr = put_Name(pbstr); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline _variant_t _Parameter_Deprecated::GetValue ( ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = get_Value(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline void _Parameter_Deprecated::PutValue ( const _variant_t & pvar ) { + HRESULT _hr = put_Value(pvar); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline enum DataTypeEnum _Parameter_Deprecated::GetType ( ) { + enum DataTypeEnum _result; + HRESULT _hr = get_Type(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void _Parameter_Deprecated::PutType ( enum DataTypeEnum psDataType ) { + HRESULT _hr = put_Type(psDataType); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline void _Parameter_Deprecated::PutDirection ( enum ParameterDirectionEnum plParmDirection ) { + HRESULT _hr = put_Direction(plParmDirection); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline enum ParameterDirectionEnum _Parameter_Deprecated::GetDirection ( ) { + enum ParameterDirectionEnum _result; + HRESULT _hr = get_Direction(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void _Parameter_Deprecated::PutPrecision ( unsigned char pbPrecision ) { + HRESULT _hr = put_Precision(pbPrecision); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline unsigned char _Parameter_Deprecated::GetPrecision ( ) { + unsigned char _result = 0; + HRESULT _hr = get_Precision(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void _Parameter_Deprecated::PutNumericScale ( unsigned char pbScale ) { + HRESULT _hr = put_NumericScale(pbScale); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline unsigned char _Parameter_Deprecated::GetNumericScale ( ) { + unsigned char _result = 0; + HRESULT _hr = get_NumericScale(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void _Parameter_Deprecated::PutSize ( ADO_LONGPTR pl ) { + HRESULT _hr = put_Size(pl); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline ADO_LONGPTR _Parameter_Deprecated::GetSize ( ) { + ADO_LONGPTR _result; + HRESULT _hr = get_Size(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline HRESULT _Parameter_Deprecated::AppendChunk ( const _variant_t & Val ) { + HRESULT _hr = raw_AppendChunk(Val); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline long _Parameter_Deprecated::GetAttributes ( ) { + long _result = 0; + HRESULT _hr = get_Attributes(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void _Parameter_Deprecated::PutAttributes ( long plParmAttribs ) { + HRESULT _hr = put_Attributes(plParmAttribs); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +// +// interface Parameters_Deprecated wrapper method implementations +// + +inline _Parameter_DeprecatedPtr Parameters_Deprecated::GetItem ( const _variant_t & Index ) { + struct _Parameter_Deprecated * _result = 0; + HRESULT _hr = get_Item(Index, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _Parameter_DeprecatedPtr(_result, false); +} + +// +// dispinterface ConnectionEvents_Deprecated wrapper method implementations +// + +inline HRESULT ConnectionEvents_Deprecated::InfoMessage ( struct Error * pError, enum EventStatusEnum * adStatus, struct _Connection_Deprecated * pConnection ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0x0, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x0009\x4003\x0009", pError, adStatus, pConnection); + return _result; +} + +inline HRESULT ConnectionEvents_Deprecated::BeginTransComplete ( long TransactionLevel, struct Error * pError, enum EventStatusEnum * adStatus, struct _Connection_Deprecated * pConnection ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0x1, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x0003\x0009\x4003\x0009", TransactionLevel, pError, adStatus, pConnection); + return _result; +} + +inline HRESULT ConnectionEvents_Deprecated::CommitTransComplete ( struct Error * pError, enum EventStatusEnum * adStatus, struct _Connection_Deprecated * pConnection ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0x3, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x0009\x4003\x0009", pError, adStatus, pConnection); + return _result; +} + +inline HRESULT ConnectionEvents_Deprecated::RollbackTransComplete ( struct Error * pError, enum EventStatusEnum * adStatus, struct _Connection_Deprecated * pConnection ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0x2, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x0009\x4003\x0009", pError, adStatus, pConnection); + return _result; +} + +inline HRESULT ConnectionEvents_Deprecated::WillExecute ( BSTR * Source, enum CursorTypeEnum * CursorType, enum LockTypeEnum * LockType, long * Options, enum EventStatusEnum * adStatus, struct _Command_Deprecated * pCommand, struct _Recordset_Deprecated * pRecordset, struct _Connection_Deprecated * pConnection ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0x4, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x4008\x4003\x4003\x4003\x4003\x0009\x0009\x0009", Source, CursorType, LockType, Options, adStatus, pCommand, pRecordset, pConnection); + return _result; +} + +inline HRESULT ConnectionEvents_Deprecated::ExecuteComplete ( long RecordsAffected, struct Error * pError, enum EventStatusEnum * adStatus, struct _Command_Deprecated * pCommand, struct _Recordset_Deprecated * pRecordset, struct _Connection_Deprecated * pConnection ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0x5, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x0003\x0009\x4003\x0009\x0009\x0009", RecordsAffected, pError, adStatus, pCommand, pRecordset, pConnection); + return _result; +} + +inline HRESULT ConnectionEvents_Deprecated::WillConnect ( BSTR * ConnectionString, BSTR * UserID, BSTR * Password, long * Options, enum EventStatusEnum * adStatus, struct _Connection_Deprecated * pConnection ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0x6, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x4008\x4008\x4008\x4003\x4003\x0009", ConnectionString, UserID, Password, Options, adStatus, pConnection); + return _result; +} + +inline HRESULT ConnectionEvents_Deprecated::ConnectComplete ( struct Error * pError, enum EventStatusEnum * adStatus, struct _Connection_Deprecated * pConnection ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0x7, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x0009\x4003\x0009", pError, adStatus, pConnection); + return _result; +} + +inline HRESULT ConnectionEvents_Deprecated::Disconnect ( enum EventStatusEnum * adStatus, struct _Connection_Deprecated * pConnection ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0x8, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x4003\x0009", adStatus, pConnection); + return _result; +} + +// +// dispinterface RecordsetEvents_Deprecated wrapper method implementations +// + +inline HRESULT RecordsetEvents_Deprecated::WillChangeField ( long cFields, const _variant_t & Fields, enum EventStatusEnum * adStatus, struct _Recordset_Deprecated * pRecordset ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0x9, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x0003\x000c\x4003\x0009", cFields, &Fields, adStatus, pRecordset); + return _result; +} + +inline HRESULT RecordsetEvents_Deprecated::FieldChangeComplete ( long cFields, const _variant_t & Fields, struct Error * pError, enum EventStatusEnum * adStatus, struct _Recordset_Deprecated * pRecordset ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0xa, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x0003\x000c\x0009\x4003\x0009", cFields, &Fields, pError, adStatus, pRecordset); + return _result; +} + +inline HRESULT RecordsetEvents_Deprecated::WillChangeRecord ( enum EventReasonEnum adReason, long cRecords, enum EventStatusEnum * adStatus, struct _Recordset_Deprecated * pRecordset ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0xb, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x0003\x0003\x4003\x0009", adReason, cRecords, adStatus, pRecordset); + return _result; +} + +inline HRESULT RecordsetEvents_Deprecated::RecordChangeComplete ( enum EventReasonEnum adReason, long cRecords, struct Error * pError, enum EventStatusEnum * adStatus, struct _Recordset_Deprecated * pRecordset ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0xc, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x0003\x0003\x0009\x4003\x0009", adReason, cRecords, pError, adStatus, pRecordset); + return _result; +} + +inline HRESULT RecordsetEvents_Deprecated::WillChangeRecordset ( enum EventReasonEnum adReason, enum EventStatusEnum * adStatus, struct _Recordset_Deprecated * pRecordset ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0xd, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x0003\x4003\x0009", adReason, adStatus, pRecordset); + return _result; +} + +inline HRESULT RecordsetEvents_Deprecated::RecordsetChangeComplete ( enum EventReasonEnum adReason, struct Error * pError, enum EventStatusEnum * adStatus, struct _Recordset_Deprecated * pRecordset ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0xe, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x0003\x0009\x4003\x0009", adReason, pError, adStatus, pRecordset); + return _result; +} + +inline HRESULT RecordsetEvents_Deprecated::WillMove ( enum EventReasonEnum adReason, enum EventStatusEnum * adStatus, struct _Recordset_Deprecated * pRecordset ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0xf, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x0003\x4003\x0009", adReason, adStatus, pRecordset); + return _result; +} + +inline HRESULT RecordsetEvents_Deprecated::MoveComplete ( enum EventReasonEnum adReason, struct Error * pError, enum EventStatusEnum * adStatus, struct _Recordset_Deprecated * pRecordset ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0x10, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x0003\x0009\x4003\x0009", adReason, pError, adStatus, pRecordset); + return _result; +} + +inline HRESULT RecordsetEvents_Deprecated::EndOfRecordset ( VARIANT_BOOL * fMoreData, enum EventStatusEnum * adStatus, struct _Recordset_Deprecated * pRecordset ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0x11, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x400b\x4003\x0009", fMoreData, adStatus, pRecordset); + return _result; +} + +inline HRESULT RecordsetEvents_Deprecated::FetchProgress ( long Progress, long MaxProgress, enum EventStatusEnum * adStatus, struct _Recordset_Deprecated * pRecordset ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0x12, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x0003\x0003\x4003\x0009", Progress, MaxProgress, adStatus, pRecordset); + return _result; +} + +inline HRESULT RecordsetEvents_Deprecated::FetchComplete ( struct Error * pError, enum EventStatusEnum * adStatus, struct _Recordset_Deprecated * pRecordset ) { + HRESULT _result = 0; + _com_dispatch_method(this, 0x13, DISPATCH_METHOD, VT_ERROR, (void*)&_result, + L"\x0009\x4003\x0009", pError, adStatus, pRecordset); + return _result; +} + +// +// interface _Stream_Deprecated wrapper method implementations +// + +inline ADO_LONGPTR _Stream_Deprecated::GetSize ( ) { + ADO_LONGPTR _result; + HRESULT _hr = get_Size(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline VARIANT_BOOL _Stream_Deprecated::GetEOS ( ) { + VARIANT_BOOL _result = 0; + HRESULT _hr = get_EOS(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline ADO_LONGPTR _Stream_Deprecated::GetPosition ( ) { + ADO_LONGPTR _result; + HRESULT _hr = get_Position(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void _Stream_Deprecated::PutPosition ( ADO_LONGPTR pPos ) { + HRESULT _hr = put_Position(pPos); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline enum StreamTypeEnum _Stream_Deprecated::GetType ( ) { + enum StreamTypeEnum _result; + HRESULT _hr = get_Type(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void _Stream_Deprecated::PutType ( enum StreamTypeEnum ptype ) { + HRESULT _hr = put_Type(ptype); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline enum LineSeparatorEnum _Stream_Deprecated::GetLineSeparator ( ) { + enum LineSeparatorEnum _result; + HRESULT _hr = get_LineSeparator(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void _Stream_Deprecated::PutLineSeparator ( enum LineSeparatorEnum pLS ) { + HRESULT _hr = put_LineSeparator(pLS); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline enum ObjectStateEnum _Stream_Deprecated::GetState ( ) { + enum ObjectStateEnum _result; + HRESULT _hr = get_State(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline enum ConnectModeEnum _Stream_Deprecated::GetMode ( ) { + enum ConnectModeEnum _result; + HRESULT _hr = get_Mode(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void _Stream_Deprecated::PutMode ( enum ConnectModeEnum pMode ) { + HRESULT _hr = put_Mode(pMode); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline _bstr_t _Stream_Deprecated::GetCharset ( ) { + BSTR _result = 0; + HRESULT _hr = get_Charset(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline void _Stream_Deprecated::PutCharset ( _bstr_t pbstrCharset ) { + HRESULT _hr = put_Charset(pbstrCharset); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline _variant_t _Stream_Deprecated::Read ( long NumBytes ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = raw_Read(NumBytes, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline HRESULT _Stream_Deprecated::Open ( const _variant_t & Source, enum ConnectModeEnum Mode, enum StreamOpenOptionsEnum Options, _bstr_t UserName, _bstr_t Password ) { + HRESULT _hr = raw_Open(Source, Mode, Options, UserName, Password); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT _Stream_Deprecated::Close ( ) { + HRESULT _hr = raw_Close(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT _Stream_Deprecated::SkipLine ( ) { + HRESULT _hr = raw_SkipLine(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT _Stream_Deprecated::Write ( const _variant_t & Buffer ) { + HRESULT _hr = raw_Write(Buffer); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT _Stream_Deprecated::SetEOS ( ) { + HRESULT _hr = raw_SetEOS(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT _Stream_Deprecated::CopyTo ( struct _Stream_Deprecated * DestStream, ADO_LONGPTR CharNumber ) { + HRESULT _hr = raw_CopyTo(DestStream, CharNumber); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT _Stream_Deprecated::Flush ( ) { + HRESULT _hr = raw_Flush(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT _Stream_Deprecated::SaveToFile ( _bstr_t FileName, enum SaveOptionsEnum Options ) { + HRESULT _hr = raw_SaveToFile(FileName, Options); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT _Stream_Deprecated::LoadFromFile ( _bstr_t FileName ) { + HRESULT _hr = raw_LoadFromFile(FileName); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline _bstr_t _Stream_Deprecated::ReadText ( long NumChars ) { + BSTR _result = 0; + HRESULT _hr = raw_ReadText(NumChars, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline HRESULT _Stream_Deprecated::WriteText ( _bstr_t Data, enum StreamWriteEnum Options ) { + HRESULT _hr = raw_WriteText(Data, Options); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT _Stream_Deprecated::Cancel ( ) { + HRESULT _hr = raw_Cancel(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +// +// interface Field15_Deprecated wrapper method implementations +// + +inline ADO_LONGPTR Field15_Deprecated::GetActualSize ( ) { + ADO_LONGPTR _result; + HRESULT _hr = get_ActualSize(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline long Field15_Deprecated::GetAttributes ( ) { + long _result = 0; + HRESULT _hr = get_Attributes(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline ADO_LONGPTR Field15_Deprecated::GetDefinedSize ( ) { + ADO_LONGPTR _result; + HRESULT _hr = get_DefinedSize(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline _bstr_t Field15_Deprecated::GetName ( ) { + BSTR _result = 0; + HRESULT _hr = get_Name(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline enum DataTypeEnum Field15_Deprecated::GetType ( ) { + enum DataTypeEnum _result; + HRESULT _hr = get_Type(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline _variant_t Field15_Deprecated::GetValue ( ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = get_Value(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline void Field15_Deprecated::PutValue ( const _variant_t & pvar ) { + HRESULT _hr = put_Value(pvar); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline unsigned char Field15_Deprecated::GetPrecision ( ) { + unsigned char _result = 0; + HRESULT _hr = get_Precision(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline unsigned char Field15_Deprecated::GetNumericScale ( ) { + unsigned char _result = 0; + HRESULT _hr = get_NumericScale(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline HRESULT Field15_Deprecated::AppendChunk ( const _variant_t & Data ) { + HRESULT _hr = raw_AppendChunk(Data); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline _variant_t Field15_Deprecated::GetChunk ( long Length ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = raw_GetChunk(Length, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline _variant_t Field15_Deprecated::GetOriginalValue ( ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = get_OriginalValue(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline _variant_t Field15_Deprecated::GetUnderlyingValue ( ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = get_UnderlyingValue(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +// +// interface Command15 wrapper method implementations +// + +inline _ConnectionPtr Command15::GetActiveConnection ( ) { + struct _Connection * _result = 0; + HRESULT _hr = get_ActiveConnection(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _ConnectionPtr(_result, false); +} + +inline void Command15::PutRefActiveConnection ( struct _Connection * ppvObject ) { + HRESULT _hr = putref_ActiveConnection(ppvObject); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline void Command15::PutActiveConnection ( const _variant_t & ppvObject ) { + HRESULT _hr = put_ActiveConnection(ppvObject); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline _bstr_t Command15::GetCommandText ( ) { + BSTR _result = 0; + HRESULT _hr = get_CommandText(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline void Command15::PutCommandText ( _bstr_t pbstr ) { + HRESULT _hr = put_CommandText(pbstr); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline long Command15::GetCommandTimeout ( ) { + long _result = 0; + HRESULT _hr = get_CommandTimeout(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Command15::PutCommandTimeout ( long pl ) { + HRESULT _hr = put_CommandTimeout(pl); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline VARIANT_BOOL Command15::GetPrepared ( ) { + VARIANT_BOOL _result = 0; + HRESULT _hr = get_Prepared(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Command15::PutPrepared ( VARIANT_BOOL pfPrepared ) { + HRESULT _hr = put_Prepared(pfPrepared); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline _RecordsetPtr Command15::Execute ( VARIANT * RecordsAffected, VARIANT * Parameters, long Options ) { + struct _Recordset * _result = 0; + HRESULT _hr = raw_Execute(RecordsAffected, Parameters, Options, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _RecordsetPtr(_result, false); +} + +inline _ParameterPtr Command15::CreateParameter ( _bstr_t Name, enum DataTypeEnum Type, enum ParameterDirectionEnum Direction, long Size, const _variant_t & Value ) { + struct _Parameter * _result = 0; + HRESULT _hr = raw_CreateParameter(Name, Type, Direction, Size, Value, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _ParameterPtr(_result, false); +} + +inline ParametersPtr Command15::GetParameters ( ) { + struct Parameters * _result = 0; + HRESULT _hr = get_Parameters(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return ParametersPtr(_result, false); +} + +inline void Command15::PutCommandType ( enum CommandTypeEnum plCmdType ) { + HRESULT _hr = put_CommandType(plCmdType); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline enum CommandTypeEnum Command15::GetCommandType ( ) { + enum CommandTypeEnum _result; + HRESULT _hr = get_CommandType(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline _bstr_t Command15::GetName ( ) { + BSTR _result = 0; + HRESULT _hr = get_Name(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline void Command15::PutName ( _bstr_t pbstrName ) { + HRESULT _hr = put_Name(pbstrName); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +// +// interface Command25 wrapper method implementations +// + +inline long Command25::GetState ( ) { + long _result = 0; + HRESULT _hr = get_State(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline HRESULT Command25::Cancel ( ) { + HRESULT _hr = raw_Cancel(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +// +// interface _Command wrapper method implementations +// + +inline void _Command::PutRefCommandStream ( IUnknown * pvStream ) { + HRESULT _hr = putref_CommandStream(pvStream); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline _variant_t _Command::GetCommandStream ( ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = get_CommandStream(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline void _Command::PutDialect ( _bstr_t pbstrDialect ) { + HRESULT _hr = put_Dialect(pbstrDialect); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline _bstr_t _Command::GetDialect ( ) { + BSTR _result = 0; + HRESULT _hr = get_Dialect(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline void _Command::PutNamedParameters ( VARIANT_BOOL pfNamedParameters ) { + HRESULT _hr = put_NamedParameters(pfNamedParameters); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline VARIANT_BOOL _Command::GetNamedParameters ( ) { + VARIANT_BOOL _result = 0; + HRESULT _hr = get_NamedParameters(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +// +// interface Connection15 wrapper method implementations +// + +inline _bstr_t Connection15::GetConnectionString ( ) { + BSTR _result = 0; + HRESULT _hr = get_ConnectionString(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline void Connection15::PutConnectionString ( _bstr_t pbstr ) { + HRESULT _hr = put_ConnectionString(pbstr); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline long Connection15::GetCommandTimeout ( ) { + long _result = 0; + HRESULT _hr = get_CommandTimeout(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Connection15::PutCommandTimeout ( long plTimeout ) { + HRESULT _hr = put_CommandTimeout(plTimeout); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline long Connection15::GetConnectionTimeout ( ) { + long _result = 0; + HRESULT _hr = get_ConnectionTimeout(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Connection15::PutConnectionTimeout ( long plTimeout ) { + HRESULT _hr = put_ConnectionTimeout(plTimeout); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline _bstr_t Connection15::GetVersion ( ) { + BSTR _result = 0; + HRESULT _hr = get_Version(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline HRESULT Connection15::Close ( ) { + HRESULT _hr = raw_Close(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline _RecordsetPtr Connection15::Execute ( _bstr_t CommandText, VARIANT * RecordsAffected, long Options ) { + struct _Recordset * _result = 0; + HRESULT _hr = raw_Execute(CommandText, RecordsAffected, Options, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _RecordsetPtr(_result, false); +} + +inline long Connection15::BeginTrans ( ) { + long _result = 0; + HRESULT _hr = raw_BeginTrans(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline HRESULT Connection15::CommitTrans ( ) { + HRESULT _hr = raw_CommitTrans(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Connection15::RollbackTrans ( ) { + HRESULT _hr = raw_RollbackTrans(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Connection15::Open ( _bstr_t ConnectionString, _bstr_t UserID, _bstr_t Password, long Options ) { + HRESULT _hr = raw_Open(ConnectionString, UserID, Password, Options); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline ErrorsPtr Connection15::GetErrors ( ) { + struct Errors * _result = 0; + HRESULT _hr = get_Errors(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return ErrorsPtr(_result, false); +} + +inline _bstr_t Connection15::GetDefaultDatabase ( ) { + BSTR _result = 0; + HRESULT _hr = get_DefaultDatabase(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline void Connection15::PutDefaultDatabase ( _bstr_t pbstr ) { + HRESULT _hr = put_DefaultDatabase(pbstr); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline enum IsolationLevelEnum Connection15::GetIsolationLevel ( ) { + enum IsolationLevelEnum _result; + HRESULT _hr = get_IsolationLevel(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Connection15::PutIsolationLevel ( enum IsolationLevelEnum Level ) { + HRESULT _hr = put_IsolationLevel(Level); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline long Connection15::GetAttributes ( ) { + long _result = 0; + HRESULT _hr = get_Attributes(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Connection15::PutAttributes ( long plAttr ) { + HRESULT _hr = put_Attributes(plAttr); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline enum CursorLocationEnum Connection15::GetCursorLocation ( ) { + enum CursorLocationEnum _result; + HRESULT _hr = get_CursorLocation(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Connection15::PutCursorLocation ( enum CursorLocationEnum plCursorLoc ) { + HRESULT _hr = put_CursorLocation(plCursorLoc); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline enum ConnectModeEnum Connection15::GetMode ( ) { + enum ConnectModeEnum _result; + HRESULT _hr = get_Mode(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Connection15::PutMode ( enum ConnectModeEnum plMode ) { + HRESULT _hr = put_Mode(plMode); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline _bstr_t Connection15::GetProvider ( ) { + BSTR _result = 0; + HRESULT _hr = get_Provider(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline void Connection15::PutProvider ( _bstr_t pbstr ) { + HRESULT _hr = put_Provider(pbstr); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline long Connection15::GetState ( ) { + long _result = 0; + HRESULT _hr = get_State(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline _RecordsetPtr Connection15::OpenSchema ( enum SchemaEnum Schema, const _variant_t & Restrictions, const _variant_t & SchemaID ) { + struct _Recordset * _result = 0; + HRESULT _hr = raw_OpenSchema(Schema, Restrictions, SchemaID, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _RecordsetPtr(_result, false); +} + +// +// interface _Connection wrapper method implementations +// + +inline HRESULT _Connection::Cancel ( ) { + HRESULT _hr = raw_Cancel(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +// +// interface Recordset15 wrapper method implementations +// + +inline enum PositionEnum Recordset15::GetAbsolutePosition ( ) { + enum PositionEnum _result; + HRESULT _hr = get_AbsolutePosition(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Recordset15::PutAbsolutePosition ( enum PositionEnum pl ) { + HRESULT _hr = put_AbsolutePosition(pl); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline void Recordset15::PutRefActiveConnection ( IDispatch * pvar ) { + HRESULT _hr = putref_ActiveConnection(pvar); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline void Recordset15::PutActiveConnection ( const _variant_t & pvar ) { + HRESULT _hr = put_ActiveConnection(pvar); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline _variant_t Recordset15::GetActiveConnection ( ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = get_ActiveConnection(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline VARIANT_BOOL Recordset15::GetBOF ( ) { + VARIANT_BOOL _result = 0; + HRESULT _hr = get_BOF(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline _variant_t Recordset15::GetBookmark ( ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = get_Bookmark(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline void Recordset15::PutBookmark ( const _variant_t & pvBookmark ) { + HRESULT _hr = put_Bookmark(pvBookmark); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline long Recordset15::GetCacheSize ( ) { + long _result = 0; + HRESULT _hr = get_CacheSize(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Recordset15::PutCacheSize ( long pl ) { + HRESULT _hr = put_CacheSize(pl); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline enum CursorTypeEnum Recordset15::GetCursorType ( ) { + enum CursorTypeEnum _result; + HRESULT _hr = get_CursorType(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Recordset15::PutCursorType ( enum CursorTypeEnum plCursorType ) { + HRESULT _hr = put_CursorType(plCursorType); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline VARIANT_BOOL Recordset15::GetadoEOF ( ) { + VARIANT_BOOL _result = 0; + HRESULT _hr = get_adoEOF(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline FieldsPtr Recordset15::GetFields ( ) { + struct Fields * _result = 0; + HRESULT _hr = get_Fields(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return FieldsPtr(_result, false); +} + +inline enum LockTypeEnum Recordset15::GetLockType ( ) { + enum LockTypeEnum _result; + HRESULT _hr = get_LockType(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Recordset15::PutLockType ( enum LockTypeEnum plLockType ) { + HRESULT _hr = put_LockType(plLockType); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline long Recordset15::GetMaxRecords ( ) { + long _result = 0; + HRESULT _hr = get_MaxRecords(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Recordset15::PutMaxRecords ( long plMaxRecords ) { + HRESULT _hr = put_MaxRecords(plMaxRecords); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline long Recordset15::GetRecordCount ( ) { + long _result = 0; + HRESULT _hr = get_RecordCount(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Recordset15::PutRefSource ( IDispatch * pvSource ) { + HRESULT _hr = putref_Source(pvSource); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline void Recordset15::PutSource ( _bstr_t pvSource ) { + HRESULT _hr = put_Source(pvSource); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline _variant_t Recordset15::GetSource ( ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = get_Source(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline HRESULT Recordset15::AddNew ( const _variant_t & FieldList, const _variant_t & Values ) { + HRESULT _hr = raw_AddNew(FieldList, Values); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Recordset15::CancelUpdate ( ) { + HRESULT _hr = raw_CancelUpdate(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Recordset15::Close ( ) { + HRESULT _hr = raw_Close(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Recordset15::Delete ( enum AffectEnum AffectRecords ) { + HRESULT _hr = raw_Delete(AffectRecords); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline _variant_t Recordset15::GetRows ( long Rows, const _variant_t & Start, const _variant_t & Fields ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = raw_GetRows(Rows, Start, Fields, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline HRESULT Recordset15::Move ( long NumRecords, const _variant_t & Start ) { + HRESULT _hr = raw_Move(NumRecords, Start); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Recordset15::MoveNext ( ) { + HRESULT _hr = raw_MoveNext(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Recordset15::MovePrevious ( ) { + HRESULT _hr = raw_MovePrevious(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Recordset15::MoveFirst ( ) { + HRESULT _hr = raw_MoveFirst(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Recordset15::MoveLast ( ) { + HRESULT _hr = raw_MoveLast(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Recordset15::Open ( const _variant_t & Source, const _variant_t & ActiveConnection, enum CursorTypeEnum CursorType, enum LockTypeEnum LockType, long Options ) { + HRESULT _hr = raw_Open(Source, ActiveConnection, CursorType, LockType, Options); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Recordset15::Requery ( long Options ) { + HRESULT _hr = raw_Requery(Options); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Recordset15::_xResync ( enum AffectEnum AffectRecords ) { + HRESULT _hr = raw__xResync(AffectRecords); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Recordset15::Update ( const _variant_t & Fields, const _variant_t & Values ) { + HRESULT _hr = raw_Update(Fields, Values); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline enum PositionEnum Recordset15::GetAbsolutePage ( ) { + enum PositionEnum _result; + HRESULT _hr = get_AbsolutePage(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Recordset15::PutAbsolutePage ( enum PositionEnum pl ) { + HRESULT _hr = put_AbsolutePage(pl); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline enum EditModeEnum Recordset15::GetEditMode ( ) { + enum EditModeEnum _result; + HRESULT _hr = get_EditMode(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline _variant_t Recordset15::GetFilter ( ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = get_Filter(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline void Recordset15::PutFilter ( const _variant_t & Criteria ) { + HRESULT _hr = put_Filter(Criteria); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline long Recordset15::GetPageCount ( ) { + long _result = 0; + HRESULT _hr = get_PageCount(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline long Recordset15::GetPageSize ( ) { + long _result = 0; + HRESULT _hr = get_PageSize(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Recordset15::PutPageSize ( long pl ) { + HRESULT _hr = put_PageSize(pl); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline _bstr_t Recordset15::GetSort ( ) { + BSTR _result = 0; + HRESULT _hr = get_Sort(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline void Recordset15::PutSort ( _bstr_t Criteria ) { + HRESULT _hr = put_Sort(Criteria); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline long Recordset15::GetStatus ( ) { + long _result = 0; + HRESULT _hr = get_Status(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline long Recordset15::GetState ( ) { + long _result = 0; + HRESULT _hr = get_State(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline _RecordsetPtr Recordset15::_xClone ( ) { + struct _Recordset * _result = 0; + HRESULT _hr = raw__xClone(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _RecordsetPtr(_result, false); +} + +inline HRESULT Recordset15::UpdateBatch ( enum AffectEnum AffectRecords ) { + HRESULT _hr = raw_UpdateBatch(AffectRecords); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Recordset15::CancelBatch ( enum AffectEnum AffectRecords ) { + HRESULT _hr = raw_CancelBatch(AffectRecords); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline enum CursorLocationEnum Recordset15::GetCursorLocation ( ) { + enum CursorLocationEnum _result; + HRESULT _hr = get_CursorLocation(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Recordset15::PutCursorLocation ( enum CursorLocationEnum plCursorLoc ) { + HRESULT _hr = put_CursorLocation(plCursorLoc); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline _RecordsetPtr Recordset15::NextRecordset ( VARIANT * RecordsAffected ) { + struct _Recordset * _result = 0; + HRESULT _hr = raw_NextRecordset(RecordsAffected, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _RecordsetPtr(_result, false); +} + +inline VARIANT_BOOL Recordset15::Supports ( enum CursorOptionEnum CursorOptions ) { + VARIANT_BOOL _result = 0; + HRESULT _hr = raw_Supports(CursorOptions, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline _variant_t Recordset15::GetCollect ( const _variant_t & Index ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = get_Collect(Index, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline void Recordset15::PutCollect ( const _variant_t & Index, const _variant_t & pvar ) { + HRESULT _hr = put_Collect(Index, pvar); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline enum MarshalOptionsEnum Recordset15::GetMarshalOptions ( ) { + enum MarshalOptionsEnum _result; + HRESULT _hr = get_MarshalOptions(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Recordset15::PutMarshalOptions ( enum MarshalOptionsEnum peMarshal ) { + HRESULT _hr = put_MarshalOptions(peMarshal); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline HRESULT Recordset15::Find ( _bstr_t Criteria, long SkipRecords, enum SearchDirectionEnum SearchDirection, const _variant_t & Start ) { + HRESULT _hr = raw_Find(Criteria, SkipRecords, SearchDirection, Start); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +// +// interface Recordset20 wrapper method implementations +// + +inline HRESULT Recordset20::Cancel ( ) { + HRESULT _hr = raw_Cancel(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline IUnknownPtr Recordset20::GetDataSource ( ) { + IUnknown * _result = 0; + HRESULT _hr = get_DataSource(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return IUnknownPtr(_result, false); +} + +inline void Recordset20::PutRefDataSource ( IUnknown * ppunkDataSource ) { + HRESULT _hr = putref_DataSource(ppunkDataSource); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline HRESULT Recordset20::_xSave ( _bstr_t FileName, enum PersistFormatEnum PersistFormat ) { + HRESULT _hr = raw__xSave(FileName, PersistFormat); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline IDispatchPtr Recordset20::GetActiveCommand ( ) { + IDispatch * _result = 0; + HRESULT _hr = get_ActiveCommand(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return IDispatchPtr(_result, false); +} + +inline void Recordset20::PutStayInSync ( VARIANT_BOOL pbStayInSync ) { + HRESULT _hr = put_StayInSync(pbStayInSync); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline VARIANT_BOOL Recordset20::GetStayInSync ( ) { + VARIANT_BOOL _result = 0; + HRESULT _hr = get_StayInSync(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline _bstr_t Recordset20::GetString ( enum StringFormatEnum StringFormat, long NumRows, _bstr_t ColumnDelimeter, _bstr_t RowDelimeter, _bstr_t NullExpr ) { + BSTR _result = 0; + HRESULT _hr = raw_GetString(StringFormat, NumRows, ColumnDelimeter, RowDelimeter, NullExpr, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline _bstr_t Recordset20::GetDataMember ( ) { + BSTR _result = 0; + HRESULT _hr = get_DataMember(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline void Recordset20::PutDataMember ( _bstr_t pbstrDataMember ) { + HRESULT _hr = put_DataMember(pbstrDataMember); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline enum CompareEnum Recordset20::CompareBookmarks ( const _variant_t & Bookmark1, const _variant_t & Bookmark2 ) { + enum CompareEnum _result; + HRESULT _hr = raw_CompareBookmarks(Bookmark1, Bookmark2, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline _RecordsetPtr Recordset20::Clone ( enum LockTypeEnum LockType ) { + struct _Recordset * _result = 0; + HRESULT _hr = raw_Clone(LockType, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _RecordsetPtr(_result, false); +} + +inline HRESULT Recordset20::Resync ( enum AffectEnum AffectRecords, enum ResyncEnum ResyncValues ) { + HRESULT _hr = raw_Resync(AffectRecords, ResyncValues); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +// +// interface Recordset21 wrapper method implementations +// + +inline HRESULT Recordset21::Seek ( const _variant_t & KeyValues, enum SeekEnum SeekOption ) { + HRESULT _hr = raw_Seek(KeyValues, SeekOption); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline void Recordset21::PutIndex ( _bstr_t pbstrIndex ) { + HRESULT _hr = put_Index(pbstrIndex); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline _bstr_t Recordset21::GetIndex ( ) { + BSTR _result = 0; + HRESULT _hr = get_Index(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +// +// interface _Recordset wrapper method implementations +// + +inline HRESULT _Recordset::Save ( const _variant_t & Destination, enum PersistFormatEnum PersistFormat ) { + HRESULT _hr = raw_Save(Destination, PersistFormat); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +// +// interface ConnectionEventsVt wrapper method implementations +// + +inline HRESULT ConnectionEventsVt::InfoMessage ( struct Error * pError, enum EventStatusEnum * adStatus, struct _Connection * pConnection ) { + HRESULT _hr = raw_InfoMessage(pError, adStatus, pConnection); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT ConnectionEventsVt::BeginTransComplete ( long TransactionLevel, struct Error * pError, enum EventStatusEnum * adStatus, struct _Connection * pConnection ) { + HRESULT _hr = raw_BeginTransComplete(TransactionLevel, pError, adStatus, pConnection); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT ConnectionEventsVt::CommitTransComplete ( struct Error * pError, enum EventStatusEnum * adStatus, struct _Connection * pConnection ) { + HRESULT _hr = raw_CommitTransComplete(pError, adStatus, pConnection); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT ConnectionEventsVt::RollbackTransComplete ( struct Error * pError, enum EventStatusEnum * adStatus, struct _Connection * pConnection ) { + HRESULT _hr = raw_RollbackTransComplete(pError, adStatus, pConnection); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT ConnectionEventsVt::WillExecute ( BSTR * Source, enum CursorTypeEnum * CursorType, enum LockTypeEnum * LockType, long * Options, enum EventStatusEnum * adStatus, struct _Command * pCommand, struct _Recordset * pRecordset, struct _Connection * pConnection ) { + HRESULT _hr = raw_WillExecute(Source, CursorType, LockType, Options, adStatus, pCommand, pRecordset, pConnection); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT ConnectionEventsVt::ExecuteComplete ( long RecordsAffected, struct Error * pError, enum EventStatusEnum * adStatus, struct _Command * pCommand, struct _Recordset * pRecordset, struct _Connection * pConnection ) { + HRESULT _hr = raw_ExecuteComplete(RecordsAffected, pError, adStatus, pCommand, pRecordset, pConnection); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT ConnectionEventsVt::WillConnect ( BSTR * ConnectionString, BSTR * UserID, BSTR * Password, long * Options, enum EventStatusEnum * adStatus, struct _Connection * pConnection ) { + HRESULT _hr = raw_WillConnect(ConnectionString, UserID, Password, Options, adStatus, pConnection); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT ConnectionEventsVt::ConnectComplete ( struct Error * pError, enum EventStatusEnum * adStatus, struct _Connection * pConnection ) { + HRESULT _hr = raw_ConnectComplete(pError, adStatus, pConnection); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT ConnectionEventsVt::Disconnect ( enum EventStatusEnum * adStatus, struct _Connection * pConnection ) { + HRESULT _hr = raw_Disconnect(adStatus, pConnection); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +// +// interface RecordsetEventsVt wrapper method implementations +// + +inline HRESULT RecordsetEventsVt::WillChangeField ( long cFields, const _variant_t & Fields, enum EventStatusEnum * adStatus, struct _Recordset * pRecordset ) { + HRESULT _hr = raw_WillChangeField(cFields, Fields, adStatus, pRecordset); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT RecordsetEventsVt::FieldChangeComplete ( long cFields, const _variant_t & Fields, struct Error * pError, enum EventStatusEnum * adStatus, struct _Recordset * pRecordset ) { + HRESULT _hr = raw_FieldChangeComplete(cFields, Fields, pError, adStatus, pRecordset); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT RecordsetEventsVt::WillChangeRecord ( enum EventReasonEnum adReason, long cRecords, enum EventStatusEnum * adStatus, struct _Recordset * pRecordset ) { + HRESULT _hr = raw_WillChangeRecord(adReason, cRecords, adStatus, pRecordset); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT RecordsetEventsVt::RecordChangeComplete ( enum EventReasonEnum adReason, long cRecords, struct Error * pError, enum EventStatusEnum * adStatus, struct _Recordset * pRecordset ) { + HRESULT _hr = raw_RecordChangeComplete(adReason, cRecords, pError, adStatus, pRecordset); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT RecordsetEventsVt::WillChangeRecordset ( enum EventReasonEnum adReason, enum EventStatusEnum * adStatus, struct _Recordset * pRecordset ) { + HRESULT _hr = raw_WillChangeRecordset(adReason, adStatus, pRecordset); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT RecordsetEventsVt::RecordsetChangeComplete ( enum EventReasonEnum adReason, struct Error * pError, enum EventStatusEnum * adStatus, struct _Recordset * pRecordset ) { + HRESULT _hr = raw_RecordsetChangeComplete(adReason, pError, adStatus, pRecordset); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT RecordsetEventsVt::WillMove ( enum EventReasonEnum adReason, enum EventStatusEnum * adStatus, struct _Recordset * pRecordset ) { + HRESULT _hr = raw_WillMove(adReason, adStatus, pRecordset); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT RecordsetEventsVt::MoveComplete ( enum EventReasonEnum adReason, struct Error * pError, enum EventStatusEnum * adStatus, struct _Recordset * pRecordset ) { + HRESULT _hr = raw_MoveComplete(adReason, pError, adStatus, pRecordset); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT RecordsetEventsVt::EndOfRecordset ( VARIANT_BOOL * fMoreData, enum EventStatusEnum * adStatus, struct _Recordset * pRecordset ) { + HRESULT _hr = raw_EndOfRecordset(fMoreData, adStatus, pRecordset); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT RecordsetEventsVt::FetchProgress ( long Progress, long MaxProgress, enum EventStatusEnum * adStatus, struct _Recordset * pRecordset ) { + HRESULT _hr = raw_FetchProgress(Progress, MaxProgress, adStatus, pRecordset); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT RecordsetEventsVt::FetchComplete ( struct Error * pError, enum EventStatusEnum * adStatus, struct _Recordset * pRecordset ) { + HRESULT _hr = raw_FetchComplete(pError, adStatus, pRecordset); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +// +// interface _Record wrapper method implementations +// + +inline _variant_t _Record::GetActiveConnection ( ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = get_ActiveConnection(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline void _Record::PutActiveConnection ( _bstr_t pvar ) { + HRESULT _hr = put_ActiveConnection(pvar); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline void _Record::PutRefActiveConnection ( struct _Connection * pvar ) { + HRESULT _hr = putref_ActiveConnection(pvar); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline enum ObjectStateEnum _Record::GetState ( ) { + enum ObjectStateEnum _result; + HRESULT _hr = get_State(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline _variant_t _Record::GetSource ( ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = get_Source(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline void _Record::PutSource ( _bstr_t pvar ) { + HRESULT _hr = put_Source(pvar); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline void _Record::PutRefSource ( IDispatch * pvar ) { + HRESULT _hr = putref_Source(pvar); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline enum ConnectModeEnum _Record::GetMode ( ) { + enum ConnectModeEnum _result; + HRESULT _hr = get_Mode(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void _Record::PutMode ( enum ConnectModeEnum pMode ) { + HRESULT _hr = put_Mode(pMode); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline _bstr_t _Record::GetParentURL ( ) { + BSTR _result = 0; + HRESULT _hr = get_ParentURL(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline _bstr_t _Record::MoveRecord ( _bstr_t Source, _bstr_t Destination, _bstr_t UserName, _bstr_t Password, enum MoveRecordOptionsEnum Options, VARIANT_BOOL Async ) { + BSTR _result = 0; + HRESULT _hr = raw_MoveRecord(Source, Destination, UserName, Password, Options, Async, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline _bstr_t _Record::CopyRecord ( _bstr_t Source, _bstr_t Destination, _bstr_t UserName, _bstr_t Password, enum CopyRecordOptionsEnum Options, VARIANT_BOOL Async ) { + BSTR _result = 0; + HRESULT _hr = raw_CopyRecord(Source, Destination, UserName, Password, Options, Async, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline HRESULT _Record::DeleteRecord ( _bstr_t Source, VARIANT_BOOL Async ) { + HRESULT _hr = raw_DeleteRecord(Source, Async); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT _Record::Open ( const _variant_t & Source, const _variant_t & ActiveConnection, enum ConnectModeEnum Mode, enum RecordCreateOptionsEnum CreateOptions, enum RecordOpenOptionsEnum Options, _bstr_t UserName, _bstr_t Password ) { + HRESULT _hr = raw_Open(Source, ActiveConnection, Mode, CreateOptions, Options, UserName, Password); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT _Record::Close ( ) { + HRESULT _hr = raw_Close(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline FieldsPtr _Record::GetFields ( ) { + struct Fields * _result = 0; + HRESULT _hr = get_Fields(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return FieldsPtr(_result, false); +} + +inline enum RecordTypeEnum _Record::GetRecordType ( ) { + enum RecordTypeEnum _result; + HRESULT _hr = get_RecordType(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline _RecordsetPtr _Record::GetChildren ( ) { + struct _Recordset * _result = 0; + HRESULT _hr = raw_GetChildren(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _RecordsetPtr(_result, false); +} + +inline HRESULT _Record::Cancel ( ) { + HRESULT _hr = raw_Cancel(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +// +// interface ConnectionEventsVt_Deprecated wrapper method implementations +// + +inline HRESULT ConnectionEventsVt_Deprecated::InfoMessage ( struct Error * pError, enum EventStatusEnum * adStatus, struct _Connection_Deprecated * pConnection ) { + HRESULT _hr = raw_InfoMessage(pError, adStatus, pConnection); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT ConnectionEventsVt_Deprecated::BeginTransComplete ( long TransactionLevel, struct Error * pError, enum EventStatusEnum * adStatus, struct _Connection_Deprecated * pConnection ) { + HRESULT _hr = raw_BeginTransComplete(TransactionLevel, pError, adStatus, pConnection); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT ConnectionEventsVt_Deprecated::CommitTransComplete ( struct Error * pError, enum EventStatusEnum * adStatus, struct _Connection_Deprecated * pConnection ) { + HRESULT _hr = raw_CommitTransComplete(pError, adStatus, pConnection); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT ConnectionEventsVt_Deprecated::RollbackTransComplete ( struct Error * pError, enum EventStatusEnum * adStatus, struct _Connection_Deprecated * pConnection ) { + HRESULT _hr = raw_RollbackTransComplete(pError, adStatus, pConnection); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT ConnectionEventsVt_Deprecated::WillExecute ( BSTR * Source, enum CursorTypeEnum * CursorType, enum LockTypeEnum * LockType, long * Options, enum EventStatusEnum * adStatus, struct _Command_Deprecated * pCommand, struct _Recordset_Deprecated * pRecordset, struct _Connection_Deprecated * pConnection ) { + HRESULT _hr = raw_WillExecute(Source, CursorType, LockType, Options, adStatus, pCommand, pRecordset, pConnection); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT ConnectionEventsVt_Deprecated::ExecuteComplete ( long RecordsAffected, struct Error * pError, enum EventStatusEnum * adStatus, struct _Command_Deprecated * pCommand, struct _Recordset_Deprecated * pRecordset, struct _Connection_Deprecated * pConnection ) { + HRESULT _hr = raw_ExecuteComplete(RecordsAffected, pError, adStatus, pCommand, pRecordset, pConnection); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT ConnectionEventsVt_Deprecated::WillConnect ( BSTR * ConnectionString, BSTR * UserID, BSTR * Password, long * Options, enum EventStatusEnum * adStatus, struct _Connection_Deprecated * pConnection ) { + HRESULT _hr = raw_WillConnect(ConnectionString, UserID, Password, Options, adStatus, pConnection); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT ConnectionEventsVt_Deprecated::ConnectComplete ( struct Error * pError, enum EventStatusEnum * adStatus, struct _Connection_Deprecated * pConnection ) { + HRESULT _hr = raw_ConnectComplete(pError, adStatus, pConnection); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT ConnectionEventsVt_Deprecated::Disconnect ( enum EventStatusEnum * adStatus, struct _Connection_Deprecated * pConnection ) { + HRESULT _hr = raw_Disconnect(adStatus, pConnection); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +// +// interface Connection15_Deprecated wrapper method implementations +// + +inline _bstr_t Connection15_Deprecated::GetConnectionString ( ) { + BSTR _result = 0; + HRESULT _hr = get_ConnectionString(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline void Connection15_Deprecated::PutConnectionString ( _bstr_t pbstr ) { + HRESULT _hr = put_ConnectionString(pbstr); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline long Connection15_Deprecated::GetCommandTimeout ( ) { + long _result = 0; + HRESULT _hr = get_CommandTimeout(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Connection15_Deprecated::PutCommandTimeout ( long plTimeout ) { + HRESULT _hr = put_CommandTimeout(plTimeout); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline long Connection15_Deprecated::GetConnectionTimeout ( ) { + long _result = 0; + HRESULT _hr = get_ConnectionTimeout(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Connection15_Deprecated::PutConnectionTimeout ( long plTimeout ) { + HRESULT _hr = put_ConnectionTimeout(plTimeout); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline _bstr_t Connection15_Deprecated::GetVersion ( ) { + BSTR _result = 0; + HRESULT _hr = get_Version(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline HRESULT Connection15_Deprecated::Close ( ) { + HRESULT _hr = raw_Close(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline _Recordset_DeprecatedPtr Connection15_Deprecated::Execute ( _bstr_t CommandText, VARIANT * RecordsAffected, long Options ) { + struct _Recordset_Deprecated * _result = 0; + HRESULT _hr = raw_Execute(CommandText, RecordsAffected, Options, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _Recordset_DeprecatedPtr(_result, false); +} + +inline long Connection15_Deprecated::BeginTrans ( ) { + long _result = 0; + HRESULT _hr = raw_BeginTrans(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline HRESULT Connection15_Deprecated::CommitTrans ( ) { + HRESULT _hr = raw_CommitTrans(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Connection15_Deprecated::RollbackTrans ( ) { + HRESULT _hr = raw_RollbackTrans(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Connection15_Deprecated::Open ( _bstr_t ConnectionString, _bstr_t UserID, _bstr_t Password, long Options ) { + HRESULT _hr = raw_Open(ConnectionString, UserID, Password, Options); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline ErrorsPtr Connection15_Deprecated::GetErrors ( ) { + struct Errors * _result = 0; + HRESULT _hr = get_Errors(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return ErrorsPtr(_result, false); +} + +inline _bstr_t Connection15_Deprecated::GetDefaultDatabase ( ) { + BSTR _result = 0; + HRESULT _hr = get_DefaultDatabase(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline void Connection15_Deprecated::PutDefaultDatabase ( _bstr_t pbstr ) { + HRESULT _hr = put_DefaultDatabase(pbstr); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline enum IsolationLevelEnum Connection15_Deprecated::GetIsolationLevel ( ) { + enum IsolationLevelEnum _result; + HRESULT _hr = get_IsolationLevel(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Connection15_Deprecated::PutIsolationLevel ( enum IsolationLevelEnum Level ) { + HRESULT _hr = put_IsolationLevel(Level); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline long Connection15_Deprecated::GetAttributes ( ) { + long _result = 0; + HRESULT _hr = get_Attributes(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Connection15_Deprecated::PutAttributes ( long plAttr ) { + HRESULT _hr = put_Attributes(plAttr); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline enum CursorLocationEnum Connection15_Deprecated::GetCursorLocation ( ) { + enum CursorLocationEnum _result; + HRESULT _hr = get_CursorLocation(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Connection15_Deprecated::PutCursorLocation ( enum CursorLocationEnum plCursorLoc ) { + HRESULT _hr = put_CursorLocation(plCursorLoc); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline enum ConnectModeEnum Connection15_Deprecated::GetMode ( ) { + enum ConnectModeEnum _result; + HRESULT _hr = get_Mode(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Connection15_Deprecated::PutMode ( enum ConnectModeEnum plMode ) { + HRESULT _hr = put_Mode(plMode); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline _bstr_t Connection15_Deprecated::GetProvider ( ) { + BSTR _result = 0; + HRESULT _hr = get_Provider(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline void Connection15_Deprecated::PutProvider ( _bstr_t pbstr ) { + HRESULT _hr = put_Provider(pbstr); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline long Connection15_Deprecated::GetState ( ) { + long _result = 0; + HRESULT _hr = get_State(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline _Recordset_DeprecatedPtr Connection15_Deprecated::OpenSchema ( enum SchemaEnum Schema, const _variant_t & Restrictions, const _variant_t & SchemaID ) { + struct _Recordset_Deprecated * _result = 0; + HRESULT _hr = raw_OpenSchema(Schema, Restrictions, SchemaID, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _Recordset_DeprecatedPtr(_result, false); +} + +// +// interface _Connection_Deprecated wrapper method implementations +// + +inline HRESULT _Connection_Deprecated::Cancel ( ) { + HRESULT _hr = raw_Cancel(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +// +// interface Recordset15_Deprecated wrapper method implementations +// + +inline PositionEnum_Param Recordset15_Deprecated::GetAbsolutePosition ( ) { + PositionEnum_Param _result; + HRESULT _hr = get_AbsolutePosition(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Recordset15_Deprecated::PutAbsolutePosition ( PositionEnum_Param pl ) { + HRESULT _hr = put_AbsolutePosition(pl); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline void Recordset15_Deprecated::PutRefActiveConnection ( IDispatch * pvar ) { + HRESULT _hr = putref_ActiveConnection(pvar); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline void Recordset15_Deprecated::PutActiveConnection ( const _variant_t & pvar ) { + HRESULT _hr = put_ActiveConnection(pvar); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline _variant_t Recordset15_Deprecated::GetActiveConnection ( ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = get_ActiveConnection(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline VARIANT_BOOL Recordset15_Deprecated::GetBOF ( ) { + VARIANT_BOOL _result = 0; + HRESULT _hr = get_BOF(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline _variant_t Recordset15_Deprecated::GetBookmark ( ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = get_Bookmark(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline void Recordset15_Deprecated::PutBookmark ( const _variant_t & pvBookmark ) { + HRESULT _hr = put_Bookmark(pvBookmark); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline long Recordset15_Deprecated::GetCacheSize ( ) { + long _result = 0; + HRESULT _hr = get_CacheSize(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Recordset15_Deprecated::PutCacheSize ( long pl ) { + HRESULT _hr = put_CacheSize(pl); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline enum CursorTypeEnum Recordset15_Deprecated::GetCursorType ( ) { + enum CursorTypeEnum _result; + HRESULT _hr = get_CursorType(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Recordset15_Deprecated::PutCursorType ( enum CursorTypeEnum plCursorType ) { + HRESULT _hr = put_CursorType(plCursorType); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline VARIANT_BOOL Recordset15_Deprecated::GetadoEOF ( ) { + VARIANT_BOOL _result = 0; + HRESULT _hr = get_adoEOF(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline Fields_DeprecatedPtr Recordset15_Deprecated::GetFields ( ) { + struct Fields_Deprecated * _result = 0; + HRESULT _hr = get_Fields(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return Fields_DeprecatedPtr(_result, false); +} + +inline enum LockTypeEnum Recordset15_Deprecated::GetLockType ( ) { + enum LockTypeEnum _result; + HRESULT _hr = get_LockType(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Recordset15_Deprecated::PutLockType ( enum LockTypeEnum plLockType ) { + HRESULT _hr = put_LockType(plLockType); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline ADO_LONGPTR Recordset15_Deprecated::GetMaxRecords ( ) { + ADO_LONGPTR _result; + HRESULT _hr = get_MaxRecords(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Recordset15_Deprecated::PutMaxRecords ( ADO_LONGPTR plMaxRecords ) { + HRESULT _hr = put_MaxRecords(plMaxRecords); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline ADO_LONGPTR Recordset15_Deprecated::GetRecordCount ( ) { + ADO_LONGPTR _result; + HRESULT _hr = get_RecordCount(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Recordset15_Deprecated::PutRefSource ( IDispatch * pvSource ) { + HRESULT _hr = putref_Source(pvSource); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline void Recordset15_Deprecated::PutSource ( _bstr_t pvSource ) { + HRESULT _hr = put_Source(pvSource); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline _variant_t Recordset15_Deprecated::GetSource ( ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = get_Source(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline HRESULT Recordset15_Deprecated::AddNew ( const _variant_t & FieldList, const _variant_t & Values ) { + HRESULT _hr = raw_AddNew(FieldList, Values); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Recordset15_Deprecated::CancelUpdate ( ) { + HRESULT _hr = raw_CancelUpdate(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Recordset15_Deprecated::Close ( ) { + HRESULT _hr = raw_Close(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Recordset15_Deprecated::Delete ( enum AffectEnum AffectRecords ) { + HRESULT _hr = raw_Delete(AffectRecords); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline _variant_t Recordset15_Deprecated::GetRows ( long Rows, const _variant_t & Start, const _variant_t & Fields ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = raw_GetRows(Rows, Start, Fields, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline HRESULT Recordset15_Deprecated::Move ( ADO_LONGPTR NumRecords, const _variant_t & Start ) { + HRESULT _hr = raw_Move(NumRecords, Start); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Recordset15_Deprecated::MoveNext ( ) { + HRESULT _hr = raw_MoveNext(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Recordset15_Deprecated::MovePrevious ( ) { + HRESULT _hr = raw_MovePrevious(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Recordset15_Deprecated::MoveFirst ( ) { + HRESULT _hr = raw_MoveFirst(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Recordset15_Deprecated::MoveLast ( ) { + HRESULT _hr = raw_MoveLast(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Recordset15_Deprecated::Open ( const _variant_t & Source, const _variant_t & ActiveConnection, enum CursorTypeEnum CursorType, enum LockTypeEnum LockType, long Options ) { + HRESULT _hr = raw_Open(Source, ActiveConnection, CursorType, LockType, Options); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Recordset15_Deprecated::Requery ( long Options ) { + HRESULT _hr = raw_Requery(Options); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Recordset15_Deprecated::_xResync ( enum AffectEnum AffectRecords ) { + HRESULT _hr = raw__xResync(AffectRecords); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Recordset15_Deprecated::Update ( const _variant_t & Fields, const _variant_t & Values ) { + HRESULT _hr = raw_Update(Fields, Values); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline PositionEnum_Param Recordset15_Deprecated::GetAbsolutePage ( ) { + PositionEnum_Param _result; + HRESULT _hr = get_AbsolutePage(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Recordset15_Deprecated::PutAbsolutePage ( PositionEnum_Param pl ) { + HRESULT _hr = put_AbsolutePage(pl); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline enum EditModeEnum Recordset15_Deprecated::GetEditMode ( ) { + enum EditModeEnum _result; + HRESULT _hr = get_EditMode(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline _variant_t Recordset15_Deprecated::GetFilter ( ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = get_Filter(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline void Recordset15_Deprecated::PutFilter ( const _variant_t & Criteria ) { + HRESULT _hr = put_Filter(Criteria); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline ADO_LONGPTR Recordset15_Deprecated::GetPageCount ( ) { + ADO_LONGPTR _result; + HRESULT _hr = get_PageCount(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline long Recordset15_Deprecated::GetPageSize ( ) { + long _result = 0; + HRESULT _hr = get_PageSize(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Recordset15_Deprecated::PutPageSize ( long pl ) { + HRESULT _hr = put_PageSize(pl); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline _bstr_t Recordset15_Deprecated::GetSort ( ) { + BSTR _result = 0; + HRESULT _hr = get_Sort(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline void Recordset15_Deprecated::PutSort ( _bstr_t Criteria ) { + HRESULT _hr = put_Sort(Criteria); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline long Recordset15_Deprecated::GetStatus ( ) { + long _result = 0; + HRESULT _hr = get_Status(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline long Recordset15_Deprecated::GetState ( ) { + long _result = 0; + HRESULT _hr = get_State(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline _Recordset_DeprecatedPtr Recordset15_Deprecated::_xClone ( ) { + struct _Recordset_Deprecated * _result = 0; + HRESULT _hr = raw__xClone(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _Recordset_DeprecatedPtr(_result, false); +} + +inline HRESULT Recordset15_Deprecated::UpdateBatch ( enum AffectEnum AffectRecords ) { + HRESULT _hr = raw_UpdateBatch(AffectRecords); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT Recordset15_Deprecated::CancelBatch ( enum AffectEnum AffectRecords ) { + HRESULT _hr = raw_CancelBatch(AffectRecords); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline enum CursorLocationEnum Recordset15_Deprecated::GetCursorLocation ( ) { + enum CursorLocationEnum _result; + HRESULT _hr = get_CursorLocation(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Recordset15_Deprecated::PutCursorLocation ( enum CursorLocationEnum plCursorLoc ) { + HRESULT _hr = put_CursorLocation(plCursorLoc); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline _Recordset_DeprecatedPtr Recordset15_Deprecated::NextRecordset ( VARIANT * RecordsAffected ) { + struct _Recordset_Deprecated * _result = 0; + HRESULT _hr = raw_NextRecordset(RecordsAffected, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _Recordset_DeprecatedPtr(_result, false); +} + +inline VARIANT_BOOL Recordset15_Deprecated::Supports ( enum CursorOptionEnum CursorOptions ) { + VARIANT_BOOL _result = 0; + HRESULT _hr = raw_Supports(CursorOptions, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline _variant_t Recordset15_Deprecated::GetCollect ( const _variant_t & Index ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = get_Collect(Index, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline void Recordset15_Deprecated::PutCollect ( const _variant_t & Index, const _variant_t & pvar ) { + HRESULT _hr = put_Collect(Index, pvar); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline enum MarshalOptionsEnum Recordset15_Deprecated::GetMarshalOptions ( ) { + enum MarshalOptionsEnum _result; + HRESULT _hr = get_MarshalOptions(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Recordset15_Deprecated::PutMarshalOptions ( enum MarshalOptionsEnum peMarshal ) { + HRESULT _hr = put_MarshalOptions(peMarshal); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline HRESULT Recordset15_Deprecated::Find ( _bstr_t Criteria, ADO_LONGPTR SkipRecords, enum SearchDirectionEnum SearchDirection, const _variant_t & Start ) { + HRESULT _hr = raw_Find(Criteria, SkipRecords, SearchDirection, Start); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +// +// interface Recordset20_Deprecated wrapper method implementations +// + +inline HRESULT Recordset20_Deprecated::Cancel ( ) { + HRESULT _hr = raw_Cancel(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline IUnknownPtr Recordset20_Deprecated::GetDataSource ( ) { + IUnknown * _result = 0; + HRESULT _hr = get_DataSource(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return IUnknownPtr(_result, false); +} + +inline void Recordset20_Deprecated::PutRefDataSource ( IUnknown * ppunkDataSource ) { + HRESULT _hr = putref_DataSource(ppunkDataSource); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline HRESULT Recordset20_Deprecated::_xSave ( _bstr_t FileName, enum PersistFormatEnum PersistFormat ) { + HRESULT _hr = raw__xSave(FileName, PersistFormat); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline IDispatchPtr Recordset20_Deprecated::GetActiveCommand ( ) { + IDispatch * _result = 0; + HRESULT _hr = get_ActiveCommand(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return IDispatchPtr(_result, false); +} + +inline void Recordset20_Deprecated::PutStayInSync ( VARIANT_BOOL pbStayInSync ) { + HRESULT _hr = put_StayInSync(pbStayInSync); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline VARIANT_BOOL Recordset20_Deprecated::GetStayInSync ( ) { + VARIANT_BOOL _result = 0; + HRESULT _hr = get_StayInSync(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline _bstr_t Recordset20_Deprecated::GetString ( enum StringFormatEnum StringFormat, long NumRows, _bstr_t ColumnDelimeter, _bstr_t RowDelimeter, _bstr_t NullExpr ) { + BSTR _result = 0; + HRESULT _hr = raw_GetString(StringFormat, NumRows, ColumnDelimeter, RowDelimeter, NullExpr, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline _bstr_t Recordset20_Deprecated::GetDataMember ( ) { + BSTR _result = 0; + HRESULT _hr = get_DataMember(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline void Recordset20_Deprecated::PutDataMember ( _bstr_t pbstrDataMember ) { + HRESULT _hr = put_DataMember(pbstrDataMember); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline enum CompareEnum Recordset20_Deprecated::CompareBookmarks ( const _variant_t & Bookmark1, const _variant_t & Bookmark2 ) { + enum CompareEnum _result; + HRESULT _hr = raw_CompareBookmarks(Bookmark1, Bookmark2, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline _Recordset_DeprecatedPtr Recordset20_Deprecated::Clone ( enum LockTypeEnum LockType ) { + struct _Recordset_Deprecated * _result = 0; + HRESULT _hr = raw_Clone(LockType, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _Recordset_DeprecatedPtr(_result, false); +} + +inline HRESULT Recordset20_Deprecated::Resync ( enum AffectEnum AffectRecords, enum ResyncEnum ResyncValues ) { + HRESULT _hr = raw_Resync(AffectRecords, ResyncValues); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +// +// interface Recordset21_Deprecated wrapper method implementations +// + +inline HRESULT Recordset21_Deprecated::Seek ( const _variant_t & KeyValues, enum SeekEnum SeekOption ) { + HRESULT _hr = raw_Seek(KeyValues, SeekOption); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline void Recordset21_Deprecated::PutIndex ( _bstr_t pbstrIndex ) { + HRESULT _hr = put_Index(pbstrIndex); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline _bstr_t Recordset21_Deprecated::GetIndex ( ) { + BSTR _result = 0; + HRESULT _hr = get_Index(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +// +// interface _Recordset_Deprecated wrapper method implementations +// + +inline HRESULT _Recordset_Deprecated::Save ( const _variant_t & Destination, enum PersistFormatEnum PersistFormat ) { + HRESULT _hr = raw_Save(Destination, PersistFormat); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +// +// interface Command15_Deprecated wrapper method implementations +// + +inline _Connection_DeprecatedPtr Command15_Deprecated::GetActiveConnection ( ) { + struct _Connection_Deprecated * _result = 0; + HRESULT _hr = get_ActiveConnection(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _Connection_DeprecatedPtr(_result, false); +} + +inline void Command15_Deprecated::PutRefActiveConnection ( struct _Connection_Deprecated * ppvObject ) { + HRESULT _hr = putref_ActiveConnection(ppvObject); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline void Command15_Deprecated::PutActiveConnection ( const _variant_t & ppvObject ) { + HRESULT _hr = put_ActiveConnection(ppvObject); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline _bstr_t Command15_Deprecated::GetCommandText ( ) { + BSTR _result = 0; + HRESULT _hr = get_CommandText(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline void Command15_Deprecated::PutCommandText ( _bstr_t pbstr ) { + HRESULT _hr = put_CommandText(pbstr); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline long Command15_Deprecated::GetCommandTimeout ( ) { + long _result = 0; + HRESULT _hr = get_CommandTimeout(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Command15_Deprecated::PutCommandTimeout ( long pl ) { + HRESULT _hr = put_CommandTimeout(pl); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline VARIANT_BOOL Command15_Deprecated::GetPrepared ( ) { + VARIANT_BOOL _result = 0; + HRESULT _hr = get_Prepared(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void Command15_Deprecated::PutPrepared ( VARIANT_BOOL pfPrepared ) { + HRESULT _hr = put_Prepared(pfPrepared); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline _Recordset_DeprecatedPtr Command15_Deprecated::Execute ( VARIANT * RecordsAffected, VARIANT * Parameters, long Options ) { + struct _Recordset_Deprecated * _result = 0; + HRESULT _hr = raw_Execute(RecordsAffected, Parameters, Options, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _Recordset_DeprecatedPtr(_result, false); +} + +inline _Parameter_DeprecatedPtr Command15_Deprecated::CreateParameter ( _bstr_t Name, enum DataTypeEnum Type, enum ParameterDirectionEnum Direction, ADO_LONGPTR Size, const _variant_t & Value ) { + struct _Parameter_Deprecated * _result = 0; + HRESULT _hr = raw_CreateParameter(Name, Type, Direction, Size, Value, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _Parameter_DeprecatedPtr(_result, false); +} + +inline Parameters_DeprecatedPtr Command15_Deprecated::GetParameters ( ) { + struct Parameters_Deprecated * _result = 0; + HRESULT _hr = get_Parameters(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return Parameters_DeprecatedPtr(_result, false); +} + +inline void Command15_Deprecated::PutCommandType ( enum CommandTypeEnum plCmdType ) { + HRESULT _hr = put_CommandType(plCmdType); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline enum CommandTypeEnum Command15_Deprecated::GetCommandType ( ) { + enum CommandTypeEnum _result; + HRESULT _hr = get_CommandType(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline _bstr_t Command15_Deprecated::GetName ( ) { + BSTR _result = 0; + HRESULT _hr = get_Name(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline void Command15_Deprecated::PutName ( _bstr_t pbstrName ) { + HRESULT _hr = put_Name(pbstrName); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +// +// interface Command25_Deprecated wrapper method implementations +// + +inline long Command25_Deprecated::GetState ( ) { + long _result = 0; + HRESULT _hr = get_State(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline HRESULT Command25_Deprecated::Cancel ( ) { + HRESULT _hr = raw_Cancel(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +// +// interface _Command_Deprecated wrapper method implementations +// + +inline void _Command_Deprecated::PutRefCommandStream ( IUnknown * pvStream ) { + HRESULT _hr = putref_CommandStream(pvStream); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline _variant_t _Command_Deprecated::GetCommandStream ( ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = get_CommandStream(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline void _Command_Deprecated::PutDialect ( _bstr_t pbstrDialect ) { + HRESULT _hr = put_Dialect(pbstrDialect); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline _bstr_t _Command_Deprecated::GetDialect ( ) { + BSTR _result = 0; + HRESULT _hr = get_Dialect(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline void _Command_Deprecated::PutNamedParameters ( VARIANT_BOOL pfNamedParameters ) { + HRESULT _hr = put_NamedParameters(pfNamedParameters); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline VARIANT_BOOL _Command_Deprecated::GetNamedParameters ( ) { + VARIANT_BOOL _result = 0; + HRESULT _hr = get_NamedParameters(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +// +// interface RecordsetEventsVt_Deprecated wrapper method implementations +// + +inline HRESULT RecordsetEventsVt_Deprecated::WillChangeField ( long cFields, const _variant_t & Fields, enum EventStatusEnum * adStatus, struct _Recordset_Deprecated * pRecordset ) { + HRESULT _hr = raw_WillChangeField(cFields, Fields, adStatus, pRecordset); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT RecordsetEventsVt_Deprecated::FieldChangeComplete ( long cFields, const _variant_t & Fields, struct Error * pError, enum EventStatusEnum * adStatus, struct _Recordset_Deprecated * pRecordset ) { + HRESULT _hr = raw_FieldChangeComplete(cFields, Fields, pError, adStatus, pRecordset); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT RecordsetEventsVt_Deprecated::WillChangeRecord ( enum EventReasonEnum adReason, long cRecords, enum EventStatusEnum * adStatus, struct _Recordset_Deprecated * pRecordset ) { + HRESULT _hr = raw_WillChangeRecord(adReason, cRecords, adStatus, pRecordset); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT RecordsetEventsVt_Deprecated::RecordChangeComplete ( enum EventReasonEnum adReason, long cRecords, struct Error * pError, enum EventStatusEnum * adStatus, struct _Recordset_Deprecated * pRecordset ) { + HRESULT _hr = raw_RecordChangeComplete(adReason, cRecords, pError, adStatus, pRecordset); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT RecordsetEventsVt_Deprecated::WillChangeRecordset ( enum EventReasonEnum adReason, enum EventStatusEnum * adStatus, struct _Recordset_Deprecated * pRecordset ) { + HRESULT _hr = raw_WillChangeRecordset(adReason, adStatus, pRecordset); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT RecordsetEventsVt_Deprecated::RecordsetChangeComplete ( enum EventReasonEnum adReason, struct Error * pError, enum EventStatusEnum * adStatus, struct _Recordset_Deprecated * pRecordset ) { + HRESULT _hr = raw_RecordsetChangeComplete(adReason, pError, adStatus, pRecordset); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT RecordsetEventsVt_Deprecated::WillMove ( enum EventReasonEnum adReason, enum EventStatusEnum * adStatus, struct _Recordset_Deprecated * pRecordset ) { + HRESULT _hr = raw_WillMove(adReason, adStatus, pRecordset); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT RecordsetEventsVt_Deprecated::MoveComplete ( enum EventReasonEnum adReason, struct Error * pError, enum EventStatusEnum * adStatus, struct _Recordset_Deprecated * pRecordset ) { + HRESULT _hr = raw_MoveComplete(adReason, pError, adStatus, pRecordset); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT RecordsetEventsVt_Deprecated::EndOfRecordset ( VARIANT_BOOL * fMoreData, enum EventStatusEnum * adStatus, struct _Recordset_Deprecated * pRecordset ) { + HRESULT _hr = raw_EndOfRecordset(fMoreData, adStatus, pRecordset); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT RecordsetEventsVt_Deprecated::FetchProgress ( long Progress, long MaxProgress, enum EventStatusEnum * adStatus, struct _Recordset_Deprecated * pRecordset ) { + HRESULT _hr = raw_FetchProgress(Progress, MaxProgress, adStatus, pRecordset); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT RecordsetEventsVt_Deprecated::FetchComplete ( struct Error * pError, enum EventStatusEnum * adStatus, struct _Recordset_Deprecated * pRecordset ) { + HRESULT _hr = raw_FetchComplete(pError, adStatus, pRecordset); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +// +// interface _Record_Deprecated wrapper method implementations +// + +inline _variant_t _Record_Deprecated::GetActiveConnection ( ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = get_ActiveConnection(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline void _Record_Deprecated::PutActiveConnection ( _bstr_t pvar ) { + HRESULT _hr = put_ActiveConnection(pvar); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline void _Record_Deprecated::PutRefActiveConnection ( struct _Connection_Deprecated * pvar ) { + HRESULT _hr = putref_ActiveConnection(pvar); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline enum ObjectStateEnum _Record_Deprecated::GetState ( ) { + enum ObjectStateEnum _result; + HRESULT _hr = get_State(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline _variant_t _Record_Deprecated::GetSource ( ) { + VARIANT _result; + VariantInit(&_result); + HRESULT _hr = get_Source(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _variant_t(_result, false); +} + +inline void _Record_Deprecated::PutSource ( _bstr_t pvar ) { + HRESULT _hr = put_Source(pvar); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline void _Record_Deprecated::PutRefSource ( IDispatch * pvar ) { + HRESULT _hr = putref_Source(pvar); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline enum ConnectModeEnum _Record_Deprecated::GetMode ( ) { + enum ConnectModeEnum _result; + HRESULT _hr = get_Mode(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline void _Record_Deprecated::PutMode ( enum ConnectModeEnum pMode ) { + HRESULT _hr = put_Mode(pMode); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); +} + +inline _bstr_t _Record_Deprecated::GetParentURL ( ) { + BSTR _result = 0; + HRESULT _hr = get_ParentURL(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline _bstr_t _Record_Deprecated::MoveRecord ( _bstr_t Source, _bstr_t Destination, _bstr_t UserName, _bstr_t Password, enum MoveRecordOptionsEnum Options, VARIANT_BOOL Async ) { + BSTR _result = 0; + HRESULT _hr = raw_MoveRecord(Source, Destination, UserName, Password, Options, Async, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline _bstr_t _Record_Deprecated::CopyRecord ( _bstr_t Source, _bstr_t Destination, _bstr_t UserName, _bstr_t Password, enum CopyRecordOptionsEnum Options, VARIANT_BOOL Async ) { + BSTR _result = 0; + HRESULT _hr = raw_CopyRecord(Source, Destination, UserName, Password, Options, Async, &_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _bstr_t(_result, false); +} + +inline HRESULT _Record_Deprecated::DeleteRecord ( _bstr_t Source, VARIANT_BOOL Async ) { + HRESULT _hr = raw_DeleteRecord(Source, Async); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT _Record_Deprecated::Open ( const _variant_t & Source, const _variant_t & ActiveConnection, enum ConnectModeEnum Mode, enum RecordCreateOptionsEnum CreateOptions, enum RecordOpenOptionsEnum Options, _bstr_t UserName, _bstr_t Password ) { + HRESULT _hr = raw_Open(Source, ActiveConnection, Mode, CreateOptions, Options, UserName, Password); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline HRESULT _Record_Deprecated::Close ( ) { + HRESULT _hr = raw_Close(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} + +inline Fields_DeprecatedPtr _Record_Deprecated::GetFields ( ) { + struct Fields_Deprecated * _result = 0; + HRESULT _hr = get_Fields(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return Fields_DeprecatedPtr(_result, false); +} + +inline enum RecordTypeEnum _Record_Deprecated::GetRecordType ( ) { + enum RecordTypeEnum _result; + HRESULT _hr = get_RecordType(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _result; +} + +inline _Recordset_DeprecatedPtr _Record_Deprecated::GetChildren ( ) { + struct _Recordset_Deprecated * _result = 0; + HRESULT _hr = raw_GetChildren(&_result); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _Recordset_DeprecatedPtr(_result, false); +} + +inline HRESULT _Record_Deprecated::Cancel ( ) { + HRESULT _hr = raw_Cancel(); + if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); + return _hr; +} diff --git a/DFL_BOM_WL_TOERP/x64/Release/ocilib.obj b/DFL_BOM_WL_TOERP/x64/Release/ocilib.obj new file mode 100644 index 0000000..3931fb0 Binary files /dev/null and b/DFL_BOM_WL_TOERP/x64/Release/ocilib.obj differ diff --git a/DFL_BOM_WL_TOERP/x64/Release/readBomMsg.obj b/DFL_BOM_WL_TOERP/x64/Release/readBomMsg.obj new file mode 100644 index 0000000..f37455c Binary files /dev/null and b/DFL_BOM_WL_TOERP/x64/Release/readBomMsg.obj differ diff --git a/DFL_BOM_WL_TOERP/x64/Release/soapC.obj b/DFL_BOM_WL_TOERP/x64/Release/soapC.obj new file mode 100644 index 0000000..873ade9 Binary files /dev/null and b/DFL_BOM_WL_TOERP/x64/Release/soapC.obj differ diff --git a/DFL_BOM_WL_TOERP/x64/Release/soapSIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy.obj b/DFL_BOM_WL_TOERP/x64/Release/soapSIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy.obj new file mode 100644 index 0000000..c4df243 Binary files /dev/null and b/DFL_BOM_WL_TOERP/x64/Release/soapSIO_USCOREBOM_USCOREPLM_USCOREASYNBindingProxy.obj differ diff --git a/DFL_BOM_WL_TOERP/x64/Release/soapSI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy.obj b/DFL_BOM_WL_TOERP/x64/Release/soapSI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy.obj new file mode 100644 index 0000000..7f4e677 Binary files /dev/null and b/DFL_BOM_WL_TOERP/x64/Release/soapSI_USCOREFACTORY_USCORENUMBER_USCOREPLM_USCOREOUT_USCORESYNBindingProxy.obj differ diff --git a/DFL_BOM_WL_TOERP/x64/Release/soapSI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy.obj b/DFL_BOM_WL_TOERP/x64/Release/soapSI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy.obj new file mode 100644 index 0000000..3da97a0 Binary files /dev/null and b/DFL_BOM_WL_TOERP/x64/Release/soapSI_USCOREPROCESSROUTE_USCOREPLM_USCOREOUT_USCORESYNBindingProxy.obj differ diff --git a/DFL_BOM_WL_TOERP/x64/Release/stdsoap2.obj b/DFL_BOM_WL_TOERP/x64/Release/stdsoap2.obj new file mode 100644 index 0000000..fcda3b8 Binary files /dev/null and b/DFL_BOM_WL_TOERP/x64/Release/stdsoap2.obj differ diff --git a/DFL_BOM_WL_TOERP/x64/Release/util.obj b/DFL_BOM_WL_TOERP/x64/Release/util.obj new file mode 100644 index 0000000..f76238e Binary files /dev/null and b/DFL_BOM_WL_TOERP/x64/Release/util.obj differ diff --git a/DFL_BOM_WL_TOERP/x64/Release/vc140.pdb b/DFL_BOM_WL_TOERP/x64/Release/vc140.pdb new file mode 100644 index 0000000..ffec52a Binary files /dev/null and b/DFL_BOM_WL_TOERP/x64/Release/vc140.pdb differ diff --git a/packages/sqdlog.1.0.0/[Content_Types].xml b/packages/sqdlog.1.0.0/[Content_Types].xml new file mode 100644 index 0000000..5c97181 --- /dev/null +++ b/packages/sqdlog.1.0.0/[Content_Types].xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/packages/sqdlog.1.0.0/build/sqdlog.targets b/packages/sqdlog.1.0.0/build/sqdlog.targets new file mode 100644 index 0000000..5e862a0 --- /dev/null +++ b/packages/sqdlog.1.0.0/build/sqdlog.targets @@ -0,0 +1,13 @@ + + + + + $(MSBuildThisFileDirectory)..\lib\native\include\;%(AdditionalIncludeDirectories) + + + $(MSBuildThisFileDirectory)..\lib\native\lib\*.lib;%(AdditionalDependencies) + + + + + \ No newline at end of file diff --git a/packages/sqdlog.1.0.0/lib/native/include/spdlog/async.h b/packages/sqdlog.1.0.0/lib/native/include/spdlog/async.h new file mode 100644 index 0000000..afaf263 --- /dev/null +++ b/packages/sqdlog.1.0.0/lib/native/include/spdlog/async.h @@ -0,0 +1,93 @@ +// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. +// Distributed under the MIT License (http://opensource.org/licenses/MIT) + +#pragma once + +// +// Async logging using global thread pool +// All loggers created here share same global thread pool. +// Each log message is pushed to a queue along with a shared pointer to the +// logger. +// If a logger deleted while having pending messages in the queue, it's actual +// destruction will defer +// until all its messages are processed by the thread pool. +// This is because each message in the queue holds a shared_ptr to the +// originating logger. + +#include +#include +#include + +#include +#include +#include + +namespace spdlog { + +namespace details { +static const size_t default_async_q_size = 8192; +} + +// async logger factory - creates async loggers backed with thread pool. +// if a global thread pool doesn't already exist, create it with default queue +// size of 8192 items and single thread. +template +struct async_factory_impl +{ + template + static std::shared_ptr create(std::string logger_name, SinkArgs &&... args) + { + auto ®istry_inst = details::registry::instance(); + + // create global thread pool if not already exists.. + + auto &mutex = registry_inst.tp_mutex(); + std::lock_guard tp_lock(mutex); + auto tp = registry_inst.get_tp(); + if (tp == nullptr) + { + tp = std::make_shared(details::default_async_q_size, 1); + registry_inst.set_tp(tp); + } + + auto sink = std::make_shared(std::forward(args)...); + auto new_logger = std::make_shared(std::move(logger_name), std::move(sink), std::move(tp), OverflowPolicy); + registry_inst.initialize_logger(new_logger); + return new_logger; + } +}; + +using async_factory = async_factory_impl; +using async_factory_nonblock = async_factory_impl; + +template +inline std::shared_ptr create_async(std::string logger_name, SinkArgs &&... sink_args) +{ + return async_factory::create(std::move(logger_name), std::forward(sink_args)...); +} + +template +inline std::shared_ptr create_async_nb(std::string logger_name, SinkArgs &&... sink_args) +{ + return async_factory_nonblock::create(std::move(logger_name), std::forward(sink_args)...); +} + +// set global thread pool. +inline void init_thread_pool(size_t q_size, size_t thread_count, std::function on_thread_start) +{ + auto tp = std::make_shared(q_size, thread_count, on_thread_start); + details::registry::instance().set_tp(std::move(tp)); +} + +// set global thread pool. +inline void init_thread_pool(size_t q_size, size_t thread_count) +{ + init_thread_pool(q_size, thread_count, [] {}); +} + +// get the global thread pool. +inline std::shared_ptr thread_pool() +{ + return details::registry::instance().get_tp(); +} +} // namespace spdlog diff --git a/packages/sqdlog.1.0.0/lib/native/include/spdlog/async_logger-inl.h b/packages/sqdlog.1.0.0/lib/native/include/spdlog/async_logger-inl.h new file mode 100644 index 0000000..f8c9694 --- /dev/null +++ b/packages/sqdlog.1.0.0/lib/native/include/spdlog/async_logger-inl.h @@ -0,0 +1,92 @@ +// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. +// Distributed under the MIT License (http://opensource.org/licenses/MIT) + +#pragma once + +#ifndef SPDLOG_HEADER_ONLY +#include +#endif + +#include +#include + +#include +#include + +SPDLOG_INLINE spdlog::async_logger::async_logger( + std::string logger_name, sinks_init_list sinks_list, std::weak_ptr tp, async_overflow_policy overflow_policy) + : async_logger(std::move(logger_name), sinks_list.begin(), sinks_list.end(), std::move(tp), overflow_policy) +{} + +SPDLOG_INLINE spdlog::async_logger::async_logger( + std::string logger_name, sink_ptr single_sink, std::weak_ptr tp, async_overflow_policy overflow_policy) + : async_logger(std::move(logger_name), {std::move(single_sink)}, std::move(tp), overflow_policy) +{} + +// send the log message to the thread pool +SPDLOG_INLINE void spdlog::async_logger::sink_it_(const details::log_msg &msg) +{ + if (auto pool_ptr = thread_pool_.lock()) + { + pool_ptr->post_log(shared_from_this(), msg, overflow_policy_); + } + else + { + throw_spdlog_ex("async log: thread pool doesn't exist anymore"); + } +} + +// send flush request to the thread pool +SPDLOG_INLINE void spdlog::async_logger::flush_() +{ + if (auto pool_ptr = thread_pool_.lock()) + { + pool_ptr->post_flush(shared_from_this(), overflow_policy_); + } + else + { + throw_spdlog_ex("async flush: thread pool doesn't exist anymore"); + } +} + +// +// backend functions - called from the thread pool to do the actual job +// +SPDLOG_INLINE void spdlog::async_logger::backend_sink_it_(const details::log_msg &msg) +{ + for (auto &sink : sinks_) + { + if (sink->should_log(msg.level)) + { + SPDLOG_TRY + { + sink->log(msg); + } + SPDLOG_LOGGER_CATCH() + } + } + + if (should_flush_(msg)) + { + backend_flush_(); + } +} + +SPDLOG_INLINE void spdlog::async_logger::backend_flush_() +{ + for (auto &sink : sinks_) + { + SPDLOG_TRY + { + sink->flush(); + } + SPDLOG_LOGGER_CATCH() + } +} + +SPDLOG_INLINE std::shared_ptr spdlog::async_logger::clone(std::string new_name) +{ + auto cloned = std::make_shared(*this); + cloned->name_ = std::move(new_name); + return cloned; +} diff --git a/packages/sqdlog.1.0.0/lib/native/include/spdlog/async_logger.h b/packages/sqdlog.1.0.0/lib/native/include/spdlog/async_logger.h new file mode 100644 index 0000000..6f29967 --- /dev/null +++ b/packages/sqdlog.1.0.0/lib/native/include/spdlog/async_logger.h @@ -0,0 +1,68 @@ +// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. +// Distributed under the MIT License (http://opensource.org/licenses/MIT) + +#pragma once + +// Fast asynchronous logger. +// Uses pre allocated queue. +// Creates a single back thread to pop messages from the queue and log them. +// +// Upon each log write the logger: +// 1. Checks if its log level is enough to log the message +// 2. Push a new copy of the message to a queue (or block the caller until +// space is available in the queue) +// Upon destruction, logs all remaining messages in the queue before +// destructing.. + +#include + +namespace spdlog { + +// Async overflow policy - block by default. +enum class async_overflow_policy +{ + block, // Block until message can be enqueued + overrun_oldest // Discard oldest message in the queue if full when trying to + // add new item. +}; + +namespace details { +class thread_pool; +} + +class SPDLOG_API async_logger final : public std::enable_shared_from_this, public logger +{ + friend class details::thread_pool; + +public: + template + async_logger(std::string logger_name, It begin, It end, std::weak_ptr tp, + async_overflow_policy overflow_policy = async_overflow_policy::block) + : logger(std::move(logger_name), begin, end) + , thread_pool_(std::move(tp)) + , overflow_policy_(overflow_policy) + {} + + async_logger(std::string logger_name, sinks_init_list sinks_list, std::weak_ptr tp, + async_overflow_policy overflow_policy = async_overflow_policy::block); + + async_logger(std::string logger_name, sink_ptr single_sink, std::weak_ptr tp, + async_overflow_policy overflow_policy = async_overflow_policy::block); + + std::shared_ptr clone(std::string new_name) override; + +protected: + void sink_it_(const details::log_msg &msg) override; + void flush_() override; + void backend_sink_it_(const details::log_msg &incoming_log_msg); + void backend_flush_(); + +private: + std::weak_ptr thread_pool_; + async_overflow_policy overflow_policy_; +}; +} // namespace spdlog + +#ifdef SPDLOG_HEADER_ONLY +#include "async_logger-inl.h" +#endif diff --git a/packages/sqdlog.1.0.0/lib/native/include/spdlog/cfg/argv.h b/packages/sqdlog.1.0.0/lib/native/include/spdlog/cfg/argv.h new file mode 100644 index 0000000..82bc183 --- /dev/null +++ b/packages/sqdlog.1.0.0/lib/native/include/spdlog/cfg/argv.h @@ -0,0 +1,45 @@ +// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. +// Distributed under the MIT License (http://opensource.org/licenses/MIT) + +#pragma once +#include +#include + +// +// Init log levels using each argv entry that starts with "SPDLOG_LEVEL=" +// +// set all loggers to debug level: +// example.exe "SPDLOG_LEVEL=debug" + +// set logger1 to trace level +// example.exe "SPDLOG_LEVEL=logger1=trace" + +// turn off all logging except for logger1 and logger2: +// example.exe "SPDLOG_LEVEL=off,logger1=debug,logger2=info" + +namespace spdlog { +namespace cfg { + +// search for SPDLOG_LEVEL= in the args and use it to init the levels +void load_argv_levels(int argc, const char **argv) +{ + const std::string spdlog_level_prefix = "SPDLOG_LEVEL="; + for (int i = 1; i < argc; i++) + { + std::string arg = argv[i]; + if (arg.find(spdlog_level_prefix) == 0) + { + auto levels_string = arg.substr(spdlog_level_prefix.size()); + auto levels = helpers::extract_levels(levels_string); + details::registry::instance().update_levels(std::move(levels)); + } + } +} + +void load_argv_levels(int argc, char **argv) +{ + load_argv_levels(argc, const_cast(argv)); +} + +} // namespace cfg +} // namespace spdlog diff --git a/packages/sqdlog.1.0.0/lib/native/include/spdlog/cfg/env.h b/packages/sqdlog.1.0.0/lib/native/include/spdlog/cfg/env.h new file mode 100644 index 0000000..115b676 --- /dev/null +++ b/packages/sqdlog.1.0.0/lib/native/include/spdlog/cfg/env.h @@ -0,0 +1,36 @@ +// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. +// Distributed under the MIT License (http://opensource.org/licenses/MIT) + +#pragma once +#include +#include +#include + +// +// Init levels and patterns from env variables SPDLOG_LEVEL +// Inspired from Rust's "env_logger" crate (https://crates.io/crates/env_logger). +// Note - fallback to "info" level on unrecognized levels +// +// Examples: +// +// set global level to debug: +// export SPDLOG_LEVEL=debug +// +// turn off all logging except for logger1: +// export SPDLOG_LEVEL="off,logger1=debug" +// + +// turn off all logging except for logger1 and logger2: +// export SPDLOG_LEVEL="off,logger1=debug,logger2=info" + +namespace spdlog { +namespace cfg { +void load_env_levels() +{ + auto env_val = details::os::getenv("SPDLOG_LEVEL"); + auto levels = helpers::extract_levels(env_val); + details::registry::instance().update_levels(std::move(levels)); +} + +} // namespace cfg +} // namespace spdlog diff --git a/packages/sqdlog.1.0.0/lib/native/include/spdlog/cfg/helpers-inl.h b/packages/sqdlog.1.0.0/lib/native/include/spdlog/cfg/helpers-inl.h new file mode 100644 index 0000000..b091507 --- /dev/null +++ b/packages/sqdlog.1.0.0/lib/native/include/spdlog/cfg/helpers-inl.h @@ -0,0 +1,103 @@ +// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. +// Distributed under the MIT License (http://opensource.org/licenses/MIT) + +#pragma once + +#ifndef SPDLOG_HEADER_ONLY +#include +#endif + +#include +#include +#include + +#include +#include +#include + +namespace spdlog { +namespace cfg { +namespace helpers { + +// inplace convert to lowercase +inline std::string &to_lower_(std::string &str) +{ + std::transform( + str.begin(), str.end(), str.begin(), [](char ch) { return static_cast((ch >= 'A' && ch <= 'Z') ? ch + ('a' - 'A') : ch); }); + return str; +} + +// inplace trim spaces +inline std::string &trim_(std::string &str) +{ + const char *spaces = " \n\r\t"; + str.erase(str.find_last_not_of(spaces) + 1); + str.erase(0, str.find_first_not_of(spaces)); + return str; +} + +// return (name,value) trimmed pair from given "name=value" string. +// return empty string on missing parts +// "key=val" => ("key", "val") +// " key = val " => ("key", "val") +// "key=" => ("key", "") +// "val" => ("", "val") + +inline std::pair extract_kv_(char sep, const std::string &str) +{ + auto n = str.find(sep); + std::string k, v; + if (n == std::string::npos) + { + v = str; + } + else + { + k = str.substr(0, n); + v = str.substr(n + 1); + } + return std::make_pair(trim_(k), trim_(v)); +} + +// return vector of key/value pairs from sequence of "K1=V1,K2=V2,.." +// "a=AAA,b=BBB,c=CCC,.." => {("a","AAA"),("b","BBB"),("c", "CCC"),...} +inline std::unordered_map extract_key_vals_(const std::string &str) +{ + std::string token; + std::istringstream token_stream(str); + std::unordered_map rv{}; + while (std::getline(token_stream, token, ',')) + { + if (token.empty()) + { + continue; + } + auto kv = extract_kv_('=', token); + rv[kv.first] = kv.second; + } + return rv; +} + +SPDLOG_INLINE log_levels extract_levels(const std::string &input) +{ + auto key_vals = extract_key_vals_(input); + log_levels rv; + + for (auto &name_level : key_vals) + { + auto &logger_name = name_level.first; + auto level_name = to_lower_(name_level.second); + auto level = level::from_str(level_name); + // fallback to "info" if unrecognized level name + if (level == level::off && level_name != "off") + { + level = level::info; + } + rv.set(logger_name, level); + } + return rv; +} + +} // namespace helpers +} // namespace cfg +} // namespace spdlog diff --git a/packages/sqdlog.1.0.0/lib/native/include/spdlog/cfg/helpers.h b/packages/sqdlog.1.0.0/lib/native/include/spdlog/cfg/helpers.h new file mode 100644 index 0000000..8d75082 --- /dev/null +++ b/packages/sqdlog.1.0.0/lib/native/include/spdlog/cfg/helpers.h @@ -0,0 +1,28 @@ +// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. +// Distributed under the MIT License (http://opensource.org/licenses/MIT) + +#pragma once + +#include + +namespace spdlog { +namespace cfg { +namespace helpers { +// +// Init levels from given string +// +// Examples: +// +// set global level to debug: "debug" +// turn off all logging except for logger1: "off,logger1=debug" +// turn off all logging except for logger1 and logger2: "off,logger1=debug,logger2=info" +// +SPDLOG_API log_levels extract_levels(const std::string &txt); +} // namespace helpers + +} // namespace cfg +} // namespace spdlog + +#ifdef SPDLOG_HEADER_ONLY +#include "helpers-inl.h" +#endif // SPDLOG_HEADER_ONLY diff --git a/packages/sqdlog.1.0.0/lib/native/include/spdlog/cfg/log_levels.h b/packages/sqdlog.1.0.0/lib/native/include/spdlog/cfg/log_levels.h new file mode 100644 index 0000000..ba3b2f7 --- /dev/null +++ b/packages/sqdlog.1.0.0/lib/native/include/spdlog/cfg/log_levels.h @@ -0,0 +1,47 @@ +// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. +// Distributed under the MIT License (http://opensource.org/licenses/MIT) + +#pragma once + +#include +#include +#include + +namespace spdlog { +namespace cfg { +class log_levels +{ + std::unordered_map levels_; + spdlog::level::level_enum default_level_ = level::info; + +public: + void set(const std::string &logger_name, level::level_enum lvl) + { + if (logger_name.empty()) + { + default_level_ = lvl; + } + else + { + levels_[logger_name] = lvl; + } + } + + void set_default(level::level_enum lvl) + { + default_level_ = lvl; + } + + level::level_enum get(const std::string &logger_name) + { + auto it = levels_.find(logger_name); + return it != levels_.end() ? it->second : default_level_; + } + + level::level_enum default_level() + { + return default_level_; + } +}; +} // namespace cfg +} // namespace spdlog diff --git a/packages/sqdlog.1.0.0/lib/native/include/spdlog/common-inl.h b/packages/sqdlog.1.0.0/lib/native/include/spdlog/common-inl.h new file mode 100644 index 0000000..be0d8f8 --- /dev/null +++ b/packages/sqdlog.1.0.0/lib/native/include/spdlog/common-inl.h @@ -0,0 +1,76 @@ +// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. +// Distributed under the MIT License (http://opensource.org/licenses/MIT) + +#pragma once + +#ifndef SPDLOG_HEADER_ONLY +#include +#endif + +namespace spdlog { +namespace level { +static string_view_t level_string_views[] SPDLOG_LEVEL_NAMES; + +static const char *short_level_names[] SPDLOG_SHORT_LEVEL_NAMES; + +SPDLOG_INLINE string_view_t &to_string_view(spdlog::level::level_enum l) SPDLOG_NOEXCEPT +{ + return level_string_views[l]; +} + +SPDLOG_INLINE const char *to_short_c_str(spdlog::level::level_enum l) SPDLOG_NOEXCEPT +{ + return short_level_names[l]; +} + +SPDLOG_INLINE spdlog::level::level_enum from_str(const std::string &name) SPDLOG_NOEXCEPT +{ + int level = 0; + for (const auto &level_str : level_string_views) + { + if (level_str == name) + { + return static_cast(level); + } + level++; + } + // check also for "warn" and "err" before giving up.. + if (name == "warn") + { + return level::warn; + } + if (name == "err") + { + return level::err; + } + return level::off; +} +} // namespace level + +SPDLOG_INLINE spdlog_ex::spdlog_ex(std::string msg) + : msg_(std::move(msg)) +{} + +SPDLOG_INLINE spdlog_ex::spdlog_ex(const std::string &msg, int last_errno) +{ + memory_buf_t outbuf; + fmt::format_system_error(outbuf, last_errno, msg); + msg_ = fmt::to_string(outbuf); +} + +SPDLOG_INLINE const char *spdlog_ex::what() const SPDLOG_NOEXCEPT +{ + return msg_.c_str(); +} + +SPDLOG_INLINE void throw_spdlog_ex(const std::string &msg, int last_errno) +{ + SPDLOG_THROW(spdlog_ex(msg, last_errno)); +} + +SPDLOG_INLINE void throw_spdlog_ex(std::string msg) +{ + SPDLOG_THROW(spdlog_ex(std::move(msg))); +} + +} // namespace spdlog diff --git a/packages/sqdlog.1.0.0/lib/native/include/spdlog/common.h b/packages/sqdlog.1.0.0/lib/native/include/spdlog/common.h new file mode 100644 index 0000000..923e906 --- /dev/null +++ b/packages/sqdlog.1.0.0/lib/native/include/spdlog/common.h @@ -0,0 +1,246 @@ +// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. +// Distributed under the MIT License (http://opensource.org/licenses/MIT) + +#pragma once + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef SPDLOG_COMPILED_LIB +#undef SPDLOG_HEADER_ONLY +#if defined(_WIN32) && defined(SPDLOG_SHARED_LIB) +#ifdef spdlog_EXPORTS +#define SPDLOG_API __declspec(dllexport) +#else +#define SPDLOG_API __declspec(dllimport) +#endif +#else // !defined(_WIN32) || !defined(SPDLOG_SHARED_LIB) +#define SPDLOG_API +#endif +#define SPDLOG_INLINE +#else // !defined(SPDLOG_COMPILED_LIB) +#define SPDLOG_API +#define SPDLOG_HEADER_ONLY +#define SPDLOG_INLINE inline +#endif // #ifdef SPDLOG_COMPILED_LIB + +#include + +// visual studio upto 2013 does not support noexcept nor constexpr +#if defined(_MSC_VER) && (_MSC_VER < 1900) +#define SPDLOG_NOEXCEPT _NOEXCEPT +#define SPDLOG_CONSTEXPR +#else +#define SPDLOG_NOEXCEPT noexcept +#define SPDLOG_CONSTEXPR constexpr +#endif + +#if defined(__GNUC__) || defined(__clang__) +#define SPDLOG_DEPRECATED __attribute__((deprecated)) +#elif defined(_MSC_VER) +#define SPDLOG_DEPRECATED __declspec(deprecated) +#else +#define SPDLOG_DEPRECATED +#endif + +// disable thread local on msvc 2013 +#ifndef SPDLOG_NO_TLS +#if (defined(_MSC_VER) && (_MSC_VER < 1900)) || defined(__cplusplus_winrt) +#define SPDLOG_NO_TLS 1 +#endif +#endif + +#ifndef SPDLOG_FUNCTION +#define SPDLOG_FUNCTION static_cast(__FUNCTION__) +#endif + +#ifdef SPDLOG_NO_EXCEPTIONS +#define SPDLOG_TRY +#define SPDLOG_THROW(ex) \ + do \ + { \ + printf("spdlog fatal error: %s\n", ex.what()); \ + std::abort(); \ + } while (0) +#define SPDLOG_CATCH_ALL() +#else +#define SPDLOG_TRY try +#define SPDLOG_THROW(ex) throw(ex) +#define SPDLOG_CATCH_ALL() catch (...) +#endif + +namespace spdlog { + +class formatter; + +namespace sinks { +class sink; +} + +#if defined(_WIN32) && defined(SPDLOG_WCHAR_FILENAMES) +using filename_t = std::wstring; +#define SPDLOG_FILENAME_T(s) L##s +#else +using filename_t = std::string; +#define SPDLOG_FILENAME_T(s) s +#endif + +using log_clock = std::chrono::system_clock; +using sink_ptr = std::shared_ptr; +using sinks_init_list = std::initializer_list; +using err_handler = std::function; +using string_view_t = fmt::basic_string_view; +using wstring_view_t = fmt::basic_string_view; +using memory_buf_t = fmt::basic_memory_buffer; + +#ifdef SPDLOG_WCHAR_TO_UTF8_SUPPORT +#ifndef _WIN32 +#error SPDLOG_WCHAR_TO_UTF8_SUPPORT only supported on windows +#else +template +struct is_convertible_to_wstring_view : std::is_convertible +{}; +#endif // _WIN32 +#else +template +struct is_convertible_to_wstring_view : std::false_type +{}; +#endif // SPDLOG_WCHAR_TO_UTF8_SUPPORT + +#if defined(SPDLOG_NO_ATOMIC_LEVELS) +using level_t = details::null_atomic_int; +#else +using level_t = std::atomic; +#endif + +#define SPDLOG_LEVEL_TRACE 0 +#define SPDLOG_LEVEL_DEBUG 1 +#define SPDLOG_LEVEL_INFO 2 +#define SPDLOG_LEVEL_WARN 3 +#define SPDLOG_LEVEL_ERROR 4 +#define SPDLOG_LEVEL_CRITICAL 5 +#define SPDLOG_LEVEL_OFF 6 + +#if !defined(SPDLOG_ACTIVE_LEVEL) +#define SPDLOG_ACTIVE_LEVEL SPDLOG_LEVEL_INFO +#endif + +// Log level enum +namespace level { +enum level_enum +{ + trace = SPDLOG_LEVEL_TRACE, + debug = SPDLOG_LEVEL_DEBUG, + info = SPDLOG_LEVEL_INFO, + warn = SPDLOG_LEVEL_WARN, + err = SPDLOG_LEVEL_ERROR, + critical = SPDLOG_LEVEL_CRITICAL, + off = SPDLOG_LEVEL_OFF, + n_levels +}; + +#if !defined(SPDLOG_LEVEL_NAMES) +#define SPDLOG_LEVEL_NAMES \ + { \ + "trace", "debug", "info", "warning", "error", "critical", "off" \ + } +#endif + +#if !defined(SPDLOG_SHORT_LEVEL_NAMES) + +#define SPDLOG_SHORT_LEVEL_NAMES \ + { \ + "T", "D", "I", "W", "E", "C", "O" \ + } +#endif + +SPDLOG_API string_view_t &to_string_view(spdlog::level::level_enum l) SPDLOG_NOEXCEPT; +SPDLOG_API const char *to_short_c_str(spdlog::level::level_enum l) SPDLOG_NOEXCEPT; +SPDLOG_API spdlog::level::level_enum from_str(const std::string &name) SPDLOG_NOEXCEPT; + +using level_hasher = std::hash; +} // namespace level + +// +// Color mode used by sinks with color support. +// +enum class color_mode +{ + always, + automatic, + never +}; + +// +// Pattern time - specific time getting to use for pattern_formatter. +// local time by default +// +enum class pattern_time_type +{ + local, // log localtime + utc // log utc +}; + +// +// Log exception +// +class SPDLOG_API spdlog_ex : public std::exception +{ +public: + explicit spdlog_ex(std::string msg); + spdlog_ex(const std::string &msg, int last_errno); + const char *what() const SPDLOG_NOEXCEPT override; + +private: + std::string msg_; +}; + +SPDLOG_API void throw_spdlog_ex(const std::string &msg, int last_errno); +SPDLOG_API void throw_spdlog_ex(std::string msg); + +struct source_loc +{ + SPDLOG_CONSTEXPR source_loc() = default; + SPDLOG_CONSTEXPR source_loc(const char *filename_in, int line_in, const char *funcname_in) + : filename{filename_in} + , line{line_in} + , funcname{funcname_in} + {} + + SPDLOG_CONSTEXPR bool empty() const SPDLOG_NOEXCEPT + { + return line == 0; + } + const char *filename{nullptr}; + int line{0}; + const char *funcname{nullptr}; +}; + +namespace details { +// make_unique support for pre c++14 + +#if __cplusplus >= 201402L // C++14 and beyond +using std::make_unique; +#else +template +std::unique_ptr make_unique(Args &&... args) +{ + static_assert(!std::is_array::value, "arrays not supported"); + return std::unique_ptr(new T(std::forward(args)...)); +} +#endif +} // namespace details +} // namespace spdlog + +#ifdef SPDLOG_HEADER_ONLY +#include "common-inl.h" +#endif diff --git a/packages/sqdlog.1.0.0/lib/native/include/spdlog/details/backtracer-inl.h b/packages/sqdlog.1.0.0/lib/native/include/spdlog/details/backtracer-inl.h new file mode 100644 index 0000000..21553c2 --- /dev/null +++ b/packages/sqdlog.1.0.0/lib/native/include/spdlog/details/backtracer-inl.h @@ -0,0 +1,69 @@ +// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. +// Distributed under the MIT License (http://opensource.org/licenses/MIT) + +#pragma once + +#ifndef SPDLOG_HEADER_ONLY +#include +#endif +namespace spdlog { +namespace details { +SPDLOG_INLINE backtracer::backtracer(const backtracer &other) +{ + std::lock_guard lock(other.mutex_); + enabled_ = other.enabled(); + messages_ = other.messages_; +} + +SPDLOG_INLINE backtracer::backtracer(backtracer &&other) SPDLOG_NOEXCEPT +{ + std::lock_guard lock(other.mutex_); + enabled_ = other.enabled(); + messages_ = std::move(other.messages_); +} + +SPDLOG_INLINE backtracer &backtracer::operator=(backtracer other) +{ + std::lock_guard lock(mutex_); + enabled_ = other.enabled(); + messages_ = std::move(other.messages_); + return *this; +} + +SPDLOG_INLINE void backtracer::enable(size_t size) +{ + std::lock_guard lock{mutex_}; + enabled_.store(true, std::memory_order_relaxed); + messages_ = circular_q{size}; +} + +SPDLOG_INLINE void backtracer::disable() +{ + std::lock_guard lock{mutex_}; + enabled_.store(false, std::memory_order_relaxed); +} + +SPDLOG_INLINE bool backtracer::enabled() const +{ + return enabled_.load(std::memory_order_relaxed); +} + +SPDLOG_INLINE void backtracer::push_back(const log_msg &msg) +{ + std::lock_guard lock{mutex_}; + messages_.push_back(log_msg_buffer{msg}); +} + +// pop all items in the q and apply the given fun on each of them. +SPDLOG_INLINE void backtracer::foreach_pop(std::function fun) +{ + std::lock_guard lock{mutex_}; + while (!messages_.empty()) + { + auto &front_msg = messages_.front(); + fun(front_msg); + messages_.pop_front(); + } +} +} // namespace details +} // namespace spdlog diff --git a/packages/sqdlog.1.0.0/lib/native/include/spdlog/details/backtracer.h b/packages/sqdlog.1.0.0/lib/native/include/spdlog/details/backtracer.h new file mode 100644 index 0000000..b7476bc --- /dev/null +++ b/packages/sqdlog.1.0.0/lib/native/include/spdlog/details/backtracer.h @@ -0,0 +1,45 @@ +// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. +// Distributed under the MIT License (http://opensource.org/licenses/MIT) + +#pragma once + +#include +#include + +#include +#include +#include + +// Store log messages in circular buffer. +// Useful for storing debug data in case of error/warning happens. + +namespace spdlog { +namespace details { +class SPDLOG_API backtracer +{ + mutable std::mutex mutex_; + std::atomic enabled_{false}; + circular_q messages_; + +public: + backtracer() = default; + backtracer(const backtracer &other); + + backtracer(backtracer &&other) SPDLOG_NOEXCEPT; + backtracer &operator=(backtracer other); + + void enable(size_t size); + void disable(); + bool enabled() const; + void push_back(const log_msg &msg); + + // pop all items in the q and apply the given fun on each of them. + void foreach_pop(std::function fun); +}; + +} // namespace details +} // namespace spdlog + +#ifdef SPDLOG_HEADER_ONLY +#include "backtracer-inl.h" +#endif \ No newline at end of file diff --git a/packages/sqdlog.1.0.0/lib/native/include/spdlog/details/circular_q.h b/packages/sqdlog.1.0.0/lib/native/include/spdlog/details/circular_q.h new file mode 100644 index 0000000..1f2712e --- /dev/null +++ b/packages/sqdlog.1.0.0/lib/native/include/spdlog/details/circular_q.h @@ -0,0 +1,141 @@ +// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. +// Distributed under the MIT License (http://opensource.org/licenses/MIT) + +// circular q view of std::vector. +#pragma once + +#include +#include + +namespace spdlog { +namespace details { +template +class circular_q +{ + size_t max_items_ = 0; + typename std::vector::size_type head_ = 0; + typename std::vector::size_type tail_ = 0; + size_t overrun_counter_ = 0; + std::vector v_; + +public: + using value_type = T; + + // empty ctor - create a disabled queue with no elements allocated at all + circular_q() = default; + + explicit circular_q(size_t max_items) + : max_items_(max_items + 1) // one item is reserved as marker for full q + , v_(max_items_) + {} + + circular_q(const circular_q &) = default; + circular_q &operator=(const circular_q &) = default; + + // move cannot be default, + // since we need to reset head_, tail_, etc to zero in the moved object + circular_q(circular_q &&other) SPDLOG_NOEXCEPT + { + copy_moveable(std::move(other)); + } + + circular_q &operator=(circular_q &&other) SPDLOG_NOEXCEPT + { + copy_moveable(std::move(other)); + return *this; + } + + // push back, overrun (oldest) item if no room left + void push_back(T &&item) + { + if (max_items_ > 0) + { + v_[tail_] = std::move(item); + tail_ = (tail_ + 1) % max_items_; + + if (tail_ == head_) // overrun last item if full + { + head_ = (head_ + 1) % max_items_; + ++overrun_counter_; + } + } + } + + // Return reference to the front item. + // If there are no elements in the container, the behavior is undefined. + const T &front() const + { + return v_[head_]; + } + + T &front() + { + return v_[head_]; + } + + // Return number of elements actually stored + size_t size() const + { + if (tail_ >= head_) + { + return tail_ - head_; + } + else + { + return max_items_ - (head_ - tail_); + } + } + + // Return const reference to item by index. + // If index is out of range 0…size()-1, the behavior is undefined. + const T &at(size_t i) const + { + assert(i < size()); + return v_[(head_ + i) % max_items_]; + } + + // Pop item from front. + // If there are no elements in the container, the behavior is undefined. + void pop_front() + { + head_ = (head_ + 1) % max_items_; + } + + bool empty() const + { + return tail_ == head_; + } + + bool full() const + { + // head is ahead of the tail by 1 + if (max_items_ > 0) + { + return ((tail_ + 1) % max_items_) == head_; + } + return false; + } + + size_t overrun_counter() const + { + return overrun_counter_; + } + +private: + // copy from other&& and reset it to disabled state + void copy_moveable(circular_q &&other) SPDLOG_NOEXCEPT + { + max_items_ = other.max_items_; + head_ = other.head_; + tail_ = other.tail_; + overrun_counter_ = other.overrun_counter_; + v_ = std::move(other.v_); + + // put &&other in disabled, but valid state + other.max_items_ = 0; + other.head_ = other.tail_ = 0; + other.overrun_counter_ = 0; + } +}; +} // namespace details +} // namespace spdlog diff --git a/packages/sqdlog.1.0.0/lib/native/include/spdlog/details/console_globals.h b/packages/sqdlog.1.0.0/lib/native/include/spdlog/details/console_globals.h new file mode 100644 index 0000000..665201d --- /dev/null +++ b/packages/sqdlog.1.0.0/lib/native/include/spdlog/details/console_globals.h @@ -0,0 +1,32 @@ +// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. +// Distributed under the MIT License (http://opensource.org/licenses/MIT) + +#pragma once + +#include +#include + +namespace spdlog { +namespace details { + +struct console_mutex +{ + using mutex_t = std::mutex; + static mutex_t &mutex() + { + static mutex_t s_mutex; + return s_mutex; + } +}; + +struct console_nullmutex +{ + using mutex_t = null_mutex; + static mutex_t &mutex() + { + static mutex_t s_mutex; + return s_mutex; + } +}; +} // namespace details +} // namespace spdlog diff --git a/packages/sqdlog.1.0.0/lib/native/include/spdlog/details/file_helper-inl.h b/packages/sqdlog.1.0.0/lib/native/include/spdlog/details/file_helper-inl.h new file mode 100644 index 0000000..7cb00f2 --- /dev/null +++ b/packages/sqdlog.1.0.0/lib/native/include/spdlog/details/file_helper-inl.h @@ -0,0 +1,132 @@ +// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. +// Distributed under the MIT License (http://opensource.org/licenses/MIT) + +#pragma once + +#ifndef SPDLOG_HEADER_ONLY +#include +#endif + +#include +#include + +#include +#include +#include +#include +#include +#include + +namespace spdlog { +namespace details { + +SPDLOG_INLINE file_helper::~file_helper() +{ + close(); +} + +SPDLOG_INLINE void file_helper::open(const filename_t &fname, bool truncate) +{ + close(); + filename_ = fname; + auto *mode = truncate ? SPDLOG_FILENAME_T("wb") : SPDLOG_FILENAME_T("ab"); + + for (int tries = 0; tries < open_tries_; ++tries) + { + // create containing folder if not exists already. + os::create_dir(os::dir_name(fname)); + if (!os::fopen_s(&fd_, fname, mode)) + { + return; + } + + details::os::sleep_for_millis(open_interval_); + } + + throw_spdlog_ex("Failed opening file " + os::filename_to_str(filename_) + " for writing", errno); +} + +SPDLOG_INLINE void file_helper::reopen(bool truncate) +{ + if (filename_.empty()) + { + throw_spdlog_ex("Failed re opening file - was not opened before"); + } + this->open(filename_, truncate); +} + +SPDLOG_INLINE void file_helper::flush() +{ + std::fflush(fd_); +} + +SPDLOG_INLINE void file_helper::close() +{ + if (fd_ != nullptr) + { + std::fclose(fd_); + fd_ = nullptr; + } +} + +SPDLOG_INLINE void file_helper::write(const memory_buf_t &buf) +{ + size_t msg_size = buf.size(); + auto data = buf.data(); + if (std::fwrite(data, 1, msg_size, fd_) != msg_size) + { + throw_spdlog_ex("Failed writing to file " + os::filename_to_str(filename_), errno); + } +} + +SPDLOG_INLINE size_t file_helper::size() const +{ + if (fd_ == nullptr) + { + throw_spdlog_ex("Cannot use size() on closed file " + os::filename_to_str(filename_)); + } + return os::filesize(fd_); +} + +SPDLOG_INLINE const filename_t &file_helper::filename() const +{ + return filename_; +} + +// +// return file path and its extension: +// +// "mylog.txt" => ("mylog", ".txt") +// "mylog" => ("mylog", "") +// "mylog." => ("mylog.", "") +// "/dir1/dir2/mylog.txt" => ("/dir1/dir2/mylog", ".txt") +// +// the starting dot in filenames is ignored (hidden files): +// +// ".mylog" => (".mylog". "") +// "my_folder/.mylog" => ("my_folder/.mylog", "") +// "my_folder/.mylog.txt" => ("my_folder/.mylog", ".txt") +SPDLOG_INLINE std::tuple file_helper::split_by_extension(const filename_t &fname) +{ + auto ext_index = fname.rfind('.'); + + // no valid extension found - return whole path and empty string as + // extension + if (ext_index == filename_t::npos || ext_index == 0 || ext_index == fname.size() - 1) + { + return std::make_tuple(fname, filename_t()); + } + + // treat cases like "/etc/rc.d/somelogfile or "/abc/.hiddenfile" + auto folder_index = fname.rfind(details::os::folder_sep); + if (folder_index != filename_t::npos && folder_index >= ext_index - 1) + { + return std::make_tuple(fname, filename_t()); + } + + // finally - return a valid base and extension tuple + return std::make_tuple(fname.substr(0, ext_index), fname.substr(ext_index)); +} + +} // namespace details +} // namespace spdlog diff --git a/packages/sqdlog.1.0.0/lib/native/include/spdlog/details/file_helper.h b/packages/sqdlog.1.0.0/lib/native/include/spdlog/details/file_helper.h new file mode 100644 index 0000000..5395d9c --- /dev/null +++ b/packages/sqdlog.1.0.0/lib/native/include/spdlog/details/file_helper.h @@ -0,0 +1,59 @@ +// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. +// Distributed under the MIT License (http://opensource.org/licenses/MIT) + +#pragma once + +#include +#include + +namespace spdlog { +namespace details { + +// Helper class for file sinks. +// When failing to open a file, retry several times(5) with a delay interval(10 ms). +// Throw spdlog_ex exception on errors. + +class SPDLOG_API file_helper +{ +public: + explicit file_helper() = default; + + file_helper(const file_helper &) = delete; + file_helper &operator=(const file_helper &) = delete; + ~file_helper(); + + void open(const filename_t &fname, bool truncate = false); + void reopen(bool truncate); + void flush(); + void close(); + void write(const memory_buf_t &buf); + size_t size() const; + const filename_t &filename() const; + + // + // return file path and its extension: + // + // "mylog.txt" => ("mylog", ".txt") + // "mylog" => ("mylog", "") + // "mylog." => ("mylog.", "") + // "/dir1/dir2/mylog.txt" => ("/dir1/dir2/mylog", ".txt") + // + // the starting dot in filenames is ignored (hidden files): + // + // ".mylog" => (".mylog". "") + // "my_folder/.mylog" => ("my_folder/.mylog", "") + // "my_folder/.mylog.txt" => ("my_folder/.mylog", ".txt") + static std::tuple split_by_extension(const filename_t &fname); + +private: + const int open_tries_ = 5; + const int open_interval_ = 10; + std::FILE *fd_{nullptr}; + filename_t filename_; +}; +} // namespace details +} // namespace spdlog + +#ifdef SPDLOG_HEADER_ONLY +#include "file_helper-inl.h" +#endif diff --git a/packages/sqdlog.1.0.0/lib/native/include/spdlog/details/fmt_helper.h b/packages/sqdlog.1.0.0/lib/native/include/spdlog/details/fmt_helper.h new file mode 100644 index 0000000..cbc0bdf --- /dev/null +++ b/packages/sqdlog.1.0.0/lib/native/include/spdlog/details/fmt_helper.h @@ -0,0 +1,108 @@ +// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. +// Distributed under the MIT License (http://opensource.org/licenses/MIT) +#pragma once + +#include +#include +#include +#include + +// Some fmt helpers to efficiently format and pad ints and strings +namespace spdlog { +namespace details { +namespace fmt_helper { + +inline spdlog::string_view_t to_string_view(const memory_buf_t &buf) SPDLOG_NOEXCEPT +{ + return spdlog::string_view_t{buf.data(), buf.size()}; +} + +inline void append_string_view(spdlog::string_view_t view, memory_buf_t &dest) +{ + auto *buf_ptr = view.data(); + dest.append(buf_ptr, buf_ptr + view.size()); +} + +template +inline void append_int(T n, memory_buf_t &dest) +{ + fmt::format_int i(n); + dest.append(i.data(), i.data() + i.size()); +} + +template +inline unsigned int count_digits(T n) +{ + using count_type = typename std::conditional<(sizeof(T) > sizeof(uint32_t)), uint64_t, uint32_t>::type; + return static_cast(fmt::internal::count_digits(static_cast(n))); +} + +inline void pad2(int n, memory_buf_t &dest) +{ + if (n >= 0 && n < 100) // 0-99 + { + dest.push_back(static_cast('0' + n / 10)); + dest.push_back(static_cast('0' + n % 10)); + } + else // unlikely, but just in case, let fmt deal with it + { + fmt::format_to(dest, "{:02}", n); + } +} + +template +inline void pad_uint(T n, unsigned int width, memory_buf_t &dest) +{ + static_assert(std::is_unsigned::value, "pad_uint must get unsigned T"); + for (auto digits = count_digits(n); digits < width; digits++) + { + dest.push_back('0'); + } + append_int(n, dest); +} + +template +inline void pad3(T n, memory_buf_t &dest) +{ + static_assert(std::is_unsigned::value, "pad3 must get unsigned T"); + if (n < 1000) + { + dest.push_back(static_cast(n / 100 + '0')); + n = n % 100; + dest.push_back(static_cast((n / 10) + '0')); + dest.push_back(static_cast((n % 10) + '0')); + } + else + { + append_int(n, dest); + } +} + +template +inline void pad6(T n, memory_buf_t &dest) +{ + pad_uint(n, 6, dest); +} + +template +inline void pad9(T n, memory_buf_t &dest) +{ + pad_uint(n, 9, dest); +} + +// return fraction of a second of the given time_point. +// e.g. +// fraction(tp) -> will return the millis part of the second +template +inline ToDuration time_fraction(log_clock::time_point tp) +{ + using std::chrono::duration_cast; + using std::chrono::seconds; + auto duration = tp.time_since_epoch(); + auto secs = duration_cast(duration); + return duration_cast(duration) - duration_cast(secs); +} + +} // namespace fmt_helper +} // namespace details +} // namespace spdlog diff --git a/packages/sqdlog.1.0.0/lib/native/include/spdlog/details/log_msg-inl.h b/packages/sqdlog.1.0.0/lib/native/include/spdlog/details/log_msg-inl.h new file mode 100644 index 0000000..af11e0d --- /dev/null +++ b/packages/sqdlog.1.0.0/lib/native/include/spdlog/details/log_msg-inl.h @@ -0,0 +1,37 @@ +// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. +// Distributed under the MIT License (http://opensource.org/licenses/MIT) + +#pragma once + +#ifndef SPDLOG_HEADER_ONLY +#include +#endif + +#include + +namespace spdlog { +namespace details { + +SPDLOG_INLINE log_msg::log_msg(spdlog::log_clock::time_point log_time, spdlog::source_loc loc, string_view_t a_logger_name, + spdlog::level::level_enum lvl, spdlog::string_view_t msg) + : logger_name(a_logger_name) + , level(lvl) + , time(log_time) +#ifndef SPDLOG_NO_THREAD_ID + , thread_id(os::thread_id()) +#endif + , source(loc) + , payload(msg) +{} + +SPDLOG_INLINE log_msg::log_msg( + spdlog::source_loc loc, string_view_t a_logger_name, spdlog::level::level_enum lvl, spdlog::string_view_t msg) + : log_msg(os::now(), loc, a_logger_name, lvl, msg) +{} + +SPDLOG_INLINE log_msg::log_msg(string_view_t a_logger_name, spdlog::level::level_enum lvl, spdlog::string_view_t msg) + : log_msg(os::now(), source_loc{}, a_logger_name, lvl, msg) +{} + +} // namespace details +} // namespace spdlog diff --git a/packages/sqdlog.1.0.0/lib/native/include/spdlog/details/log_msg.h b/packages/sqdlog.1.0.0/lib/native/include/spdlog/details/log_msg.h new file mode 100644 index 0000000..834ca4d --- /dev/null +++ b/packages/sqdlog.1.0.0/lib/native/include/spdlog/details/log_msg.h @@ -0,0 +1,36 @@ +// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. +// Distributed under the MIT License (http://opensource.org/licenses/MIT) + +#pragma once + +#include +#include + +namespace spdlog { +namespace details { +struct SPDLOG_API log_msg +{ + log_msg() = default; + log_msg(log_clock::time_point log_time, source_loc loc, string_view_t logger_name, level::level_enum lvl, string_view_t msg); + log_msg(source_loc loc, string_view_t logger_name, level::level_enum lvl, string_view_t msg); + log_msg(string_view_t logger_name, level::level_enum lvl, string_view_t msg); + log_msg(const log_msg &other) = default; + + string_view_t logger_name; + level::level_enum level{level::off}; + log_clock::time_point time; + size_t thread_id{0}; + + // wrapping the formatted text with color (updated by pattern_formatter). + mutable size_t color_range_start{0}; + mutable size_t color_range_end{0}; + + source_loc source; + string_view_t payload; +}; +} // namespace details +} // namespace spdlog + +#ifdef SPDLOG_HEADER_ONLY +#include "log_msg-inl.h" +#endif diff --git a/packages/sqdlog.1.0.0/lib/native/include/spdlog/details/log_msg_buffer-inl.h b/packages/sqdlog.1.0.0/lib/native/include/spdlog/details/log_msg_buffer-inl.h new file mode 100644 index 0000000..51f4d5b --- /dev/null +++ b/packages/sqdlog.1.0.0/lib/native/include/spdlog/details/log_msg_buffer-inl.h @@ -0,0 +1,58 @@ +// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. +// Distributed under the MIT License (http://opensource.org/licenses/MIT) + +#pragma once + +#ifndef SPDLOG_HEADER_ONLY +#include +#endif + +namespace spdlog { +namespace details { + +SPDLOG_INLINE log_msg_buffer::log_msg_buffer(const log_msg &orig_msg) + : log_msg{orig_msg} +{ + buffer.append(logger_name.begin(), logger_name.end()); + buffer.append(payload.begin(), payload.end()); + update_string_views(); +} + +SPDLOG_INLINE log_msg_buffer::log_msg_buffer(const log_msg_buffer &other) + : log_msg{other} +{ + buffer.append(logger_name.begin(), logger_name.end()); + buffer.append(payload.begin(), payload.end()); + update_string_views(); +} + +SPDLOG_INLINE log_msg_buffer::log_msg_buffer(log_msg_buffer &&other) SPDLOG_NOEXCEPT : log_msg{other}, buffer{std::move(other.buffer)} +{ + update_string_views(); +} + +SPDLOG_INLINE log_msg_buffer &log_msg_buffer::operator=(const log_msg_buffer &other) +{ + log_msg::operator=(other); + buffer.clear(); + buffer.append(other.buffer.data(), other.buffer.data() + other.buffer.size()); + update_string_views(); + return *this; +} + +SPDLOG_INLINE log_msg_buffer &log_msg_buffer::operator=(log_msg_buffer &&other) SPDLOG_NOEXCEPT +{ + log_msg::operator=(other); + buffer = std::move(other.buffer); + update_string_views(); + return *this; +} + +SPDLOG_INLINE void log_msg_buffer::update_string_views() +{ + logger_name = string_view_t{buffer.data(), logger_name.size()}; + payload = string_view_t{buffer.data() + logger_name.size(), payload.size()}; +} + +} // namespace details +} // namespace spdlog diff --git a/packages/sqdlog.1.0.0/lib/native/include/spdlog/details/log_msg_buffer.h b/packages/sqdlog.1.0.0/lib/native/include/spdlog/details/log_msg_buffer.h new file mode 100644 index 0000000..4410110 --- /dev/null +++ b/packages/sqdlog.1.0.0/lib/native/include/spdlog/details/log_msg_buffer.h @@ -0,0 +1,33 @@ +// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. +// Distributed under the MIT License (http://opensource.org/licenses/MIT) + +#pragma once + +#include + +namespace spdlog { +namespace details { + +// Extend log_msg with internal buffer to store its payload. +// This is needed since log_msg holds string_views that points to stack data. + +class SPDLOG_API log_msg_buffer : public log_msg +{ + memory_buf_t buffer; + void update_string_views(); + +public: + log_msg_buffer() = default; + explicit log_msg_buffer(const log_msg &orig_msg); + log_msg_buffer(const log_msg_buffer &other); + log_msg_buffer(log_msg_buffer &&other) SPDLOG_NOEXCEPT; + log_msg_buffer &operator=(const log_msg_buffer &other); + log_msg_buffer &operator=(log_msg_buffer &&other) SPDLOG_NOEXCEPT; +}; + +} // namespace details +} // namespace spdlog + +#ifdef SPDLOG_HEADER_ONLY +#include "log_msg_buffer-inl.h" +#endif diff --git a/packages/sqdlog.1.0.0/lib/native/include/spdlog/details/mpmc_blocking_q.h b/packages/sqdlog.1.0.0/lib/native/include/spdlog/details/mpmc_blocking_q.h new file mode 100644 index 0000000..7f8a253 --- /dev/null +++ b/packages/sqdlog.1.0.0/lib/native/include/spdlog/details/mpmc_blocking_q.h @@ -0,0 +1,120 @@ +// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. +// Distributed under the MIT License (http://opensource.org/licenses/MIT) + +#pragma once + +// multi producer-multi consumer blocking queue. +// enqueue(..) - will block until room found to put the new message. +// enqueue_nowait(..) - will return immediately with false if no room left in +// the queue. +// dequeue_for(..) - will block until the queue is not empty or timeout have +// passed. + +#include + +#include +#include + +namespace spdlog { +namespace details { + +template +class mpmc_blocking_queue +{ +public: + using item_type = T; + explicit mpmc_blocking_queue(size_t max_items) + : q_(max_items) + {} + +#ifndef __MINGW32__ + // try to enqueue and block if no room left + void enqueue(T &&item) + { + { + std::unique_lock lock(queue_mutex_); + pop_cv_.wait(lock, [this] { return !this->q_.full(); }); + q_.push_back(std::move(item)); + } + push_cv_.notify_one(); + } + + // enqueue immediately. overrun oldest message in the queue if no room left. + void enqueue_nowait(T &&item) + { + { + std::unique_lock lock(queue_mutex_); + q_.push_back(std::move(item)); + } + push_cv_.notify_one(); + } + + // try to dequeue item. if no item found. wait upto timeout and try again + // Return true, if succeeded dequeue item, false otherwise + bool dequeue_for(T &popped_item, std::chrono::milliseconds wait_duration) + { + { + std::unique_lock lock(queue_mutex_); + if (!push_cv_.wait_for(lock, wait_duration, [this] { return !this->q_.empty(); })) + { + return false; + } + popped_item = std::move(q_.front()); + q_.pop_front(); + } + pop_cv_.notify_one(); + return true; + } + +#else + // apparently mingw deadlocks if the mutex is released before cv.notify_one(), + // so release the mutex at the very end each function. + + // try to enqueue and block if no room left + void enqueue(T &&item) + { + std::unique_lock lock(queue_mutex_); + pop_cv_.wait(lock, [this] { return !this->q_.full(); }); + q_.push_back(std::move(item)); + push_cv_.notify_one(); + } + + // enqueue immediately. overrun oldest message in the queue if no room left. + void enqueue_nowait(T &&item) + { + std::unique_lock lock(queue_mutex_); + q_.push_back(std::move(item)); + push_cv_.notify_one(); + } + + // try to dequeue item. if no item found. wait upto timeout and try again + // Return true, if succeeded dequeue item, false otherwise + bool dequeue_for(T &popped_item, std::chrono::milliseconds wait_duration) + { + std::unique_lock lock(queue_mutex_); + if (!push_cv_.wait_for(lock, wait_duration, [this] { return !this->q_.empty(); })) + { + return false; + } + popped_item = std::move(q_.front()); + q_.pop_front(); + pop_cv_.notify_one(); + return true; + } + +#endif + + size_t overrun_counter() + { + std::unique_lock lock(queue_mutex_); + return q_.overrun_counter(); + } + +private: + std::mutex queue_mutex_; + std::condition_variable push_cv_; + std::condition_variable pop_cv_; + spdlog::details::circular_q q_; +}; +} // namespace details +} // namespace spdlog diff --git a/packages/sqdlog.1.0.0/lib/native/include/spdlog/details/null_mutex.h b/packages/sqdlog.1.0.0/lib/native/include/spdlog/details/null_mutex.h new file mode 100644 index 0000000..83533d4 --- /dev/null +++ b/packages/sqdlog.1.0.0/lib/native/include/spdlog/details/null_mutex.h @@ -0,0 +1,49 @@ +// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. +// Distributed under the MIT License (http://opensource.org/licenses/MIT) + +#pragma once + +#include +#include +// null, no cost dummy "mutex" and dummy "atomic" int + +namespace spdlog { +namespace details { +struct null_mutex +{ + void lock() const {} + void unlock() const {} + bool try_lock() const + { + return true; + } +}; + +struct null_atomic_int +{ + int value; + null_atomic_int() = default; + + explicit null_atomic_int(int new_value) + : value(new_value) + {} + + int load(std::memory_order = std::memory_order_relaxed) const + { + return value; + } + + void store(int new_value, std::memory_order = std::memory_order_relaxed) + { + value = new_value; + } + + int exchange(int new_value, std::memory_order = std::memory_order_relaxed) + { + std::swap(new_value, value); + return new_value; // return value before the call + } +}; + +} // namespace details +} // namespace spdlog diff --git a/packages/sqdlog.1.0.0/lib/native/include/spdlog/details/os-inl.h b/packages/sqdlog.1.0.0/lib/native/include/spdlog/details/os-inl.h new file mode 100644 index 0000000..87c8c5a --- /dev/null +++ b/packages/sqdlog.1.0.0/lib/native/include/spdlog/details/os-inl.h @@ -0,0 +1,554 @@ +// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. +// Distributed under the MIT License (http://opensource.org/licenses/MIT) + +#pragma once + +#ifndef SPDLOG_HEADER_ONLY +#include +#endif + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef _WIN32 + +#include // _get_osfhandle and _isatty support +#include // _get_pid support +#include + +#ifdef __MINGW32__ +#include +#endif + +#if defined(SPDLOG_WCHAR_TO_UTF8_SUPPORT) || defined(SPDLOG_WCHAR_FILENAMES) +#include +#endif + +#include // for _mkdir/_wmkdir + +#else // unix + +#include +#include + +#ifdef __linux__ +#include //Use gettid() syscall under linux to get thread id + +#elif defined(_AIX) +#include // for pthread_getthreadid_np + +#elif defined(__DragonFly__) || defined(__FreeBSD__) +#include // for pthread_getthreadid_np + +#elif defined(__NetBSD__) +#include // for _lwp_self + +#elif defined(__sun) +#include // for thr_self +#endif + +#endif // unix + +#ifndef __has_feature // Clang - feature checking macros. +#define __has_feature(x) 0 // Compatibility with non-clang compilers. +#endif + +namespace spdlog { +namespace details { +namespace os { + +SPDLOG_INLINE spdlog::log_clock::time_point now() SPDLOG_NOEXCEPT +{ + +#if defined __linux__ && defined SPDLOG_CLOCK_COARSE + timespec ts; + ::clock_gettime(CLOCK_REALTIME_COARSE, &ts); + return std::chrono::time_point( + std::chrono::duration_cast(std::chrono::seconds(ts.tv_sec) + std::chrono::nanoseconds(ts.tv_nsec))); + +#else + return log_clock::now(); +#endif +} +SPDLOG_INLINE std::tm localtime(const std::time_t &time_tt) SPDLOG_NOEXCEPT +{ + +#ifdef _WIN32 + std::tm tm; + ::localtime_s(&tm, &time_tt); +#else + std::tm tm; + ::localtime_r(&time_tt, &tm); +#endif + return tm; +} + +SPDLOG_INLINE std::tm localtime() SPDLOG_NOEXCEPT +{ + std::time_t now_t = ::time(nullptr); + return localtime(now_t); +} + +SPDLOG_INLINE std::tm gmtime(const std::time_t &time_tt) SPDLOG_NOEXCEPT +{ + +#ifdef _WIN32 + std::tm tm; + ::gmtime_s(&tm, &time_tt); +#else + std::tm tm; + ::gmtime_r(&time_tt, &tm); +#endif + return tm; +} + +SPDLOG_INLINE std::tm gmtime() SPDLOG_NOEXCEPT +{ + std::time_t now_t = ::time(nullptr); + return gmtime(now_t); +} + +// fopen_s on non windows for writing +SPDLOG_INLINE bool fopen_s(FILE **fp, const filename_t &filename, const filename_t &mode) +{ +#ifdef _WIN32 +#ifdef SPDLOG_WCHAR_FILENAMES + *fp = ::_wfsopen((filename.c_str()), mode.c_str(), _SH_DENYNO); +#else + *fp = ::_fsopen((filename.c_str()), mode.c_str(), _SH_DENYNO); +#endif +#if defined(SPDLOG_PREVENT_CHILD_FD) + if (*fp != nullptr) + { + auto file_handle = reinterpret_cast(_get_osfhandle(::_fileno(*fp))); + if (!::SetHandleInformation(file_handle, HANDLE_FLAG_INHERIT, 0)) + { + ::fclose(*fp); + *fp = nullptr; + } + } +#endif +#else // unix +#if defined(SPDLOG_PREVENT_CHILD_FD) + const int mode_flag = mode == SPDLOG_FILENAME_T("ab") ? O_APPEND : O_TRUNC; + const int fd = ::open((filename.c_str()), O_CREAT | O_WRONLY | O_CLOEXEC | mode_flag, mode_t(0644)); + if (fd == -1) + { + return false; + } + *fp = ::fdopen(fd, mode.c_str()); + if (*fp == nullptr) + { + ::close(fd); + } +#else + *fp = ::fopen((filename.c_str()), mode.c_str()); +#endif +#endif + + return *fp == nullptr; +} + +SPDLOG_INLINE int remove(const filename_t &filename) SPDLOG_NOEXCEPT +{ +#if defined(_WIN32) && defined(SPDLOG_WCHAR_FILENAMES) + return ::_wremove(filename.c_str()); +#else + return std::remove(filename.c_str()); +#endif +} + +SPDLOG_INLINE int remove_if_exists(const filename_t &filename) SPDLOG_NOEXCEPT +{ + return path_exists(filename) ? remove(filename) : 0; +} + +SPDLOG_INLINE int rename(const filename_t &filename1, const filename_t &filename2) SPDLOG_NOEXCEPT +{ +#if defined(_WIN32) && defined(SPDLOG_WCHAR_FILENAMES) + return ::_wrename(filename1.c_str(), filename2.c_str()); +#else + return std::rename(filename1.c_str(), filename2.c_str()); +#endif +} + +// Return true if path exists (file or directory) +SPDLOG_INLINE bool path_exists(const filename_t &filename) SPDLOG_NOEXCEPT +{ +#ifdef _WIN32 +#ifdef SPDLOG_WCHAR_FILENAMES + auto attribs = ::GetFileAttributesW(filename.c_str()); +#else + auto attribs = ::GetFileAttributesA(filename.c_str()); +#endif + return attribs != INVALID_FILE_ATTRIBUTES; +#else // common linux/unix all have the stat system call + struct stat buffer; + return (::stat(filename.c_str(), &buffer) == 0); +#endif +} + +// Return file size according to open FILE* object +SPDLOG_INLINE size_t filesize(FILE *f) +{ + if (f == nullptr) + { + throw_spdlog_ex("Failed getting file size. fd is null"); + } +#if defined(_WIN32) && !defined(__CYGWIN__) + int fd = ::_fileno(f); +#if _WIN64 // 64 bits + __int64 ret = ::_filelengthi64(fd); + if (ret >= 0) + { + return static_cast(ret); + } + +#else // windows 32 bits + long ret = ::_filelength(fd); + if (ret >= 0) + { + return static_cast(ret); + } +#endif + +#else // unix +// OpenBSD doesn't compile with :: before the fileno(..) +#if defined(__OpenBSD__) + int fd = fileno(f); +#else + int fd = ::fileno(f); +#endif +// 64 bits(but not in osx or cygwin, where fstat64 is deprecated) +#if (defined(__linux__) || defined(__sun) || defined(_AIX)) && (defined(__LP64__) || defined(_LP64)) + struct stat64 st; + if (::fstat64(fd, &st) == 0) + { + return static_cast(st.st_size); + } +#else // other unix or linux 32 bits or cygwin + struct stat st; + if (::fstat(fd, &st) == 0) + { + return static_cast(st.st_size); + } +#endif +#endif + throw_spdlog_ex("Failed getting file size from fd", errno); + return 0; // will not be reached. +} + +// Return utc offset in minutes or throw spdlog_ex on failure +SPDLOG_INLINE int utc_minutes_offset(const std::tm &tm) +{ + +#ifdef _WIN32 +#if _WIN32_WINNT < _WIN32_WINNT_WS08 + TIME_ZONE_INFORMATION tzinfo; + auto rv = ::GetTimeZoneInformation(&tzinfo); +#else + DYNAMIC_TIME_ZONE_INFORMATION tzinfo; + auto rv = ::GetDynamicTimeZoneInformation(&tzinfo); +#endif + if (rv == TIME_ZONE_ID_INVALID) + throw_spdlog_ex("Failed getting timezone info. ", errno); + + int offset = -tzinfo.Bias; + if (tm.tm_isdst) + { + offset -= tzinfo.DaylightBias; + } + else + { + offset -= tzinfo.StandardBias; + } + return offset; +#else + +#if defined(sun) || defined(__sun) || defined(_AIX) || (!defined(_BSD_SOURCE) && !defined(_GNU_SOURCE)) + // 'tm_gmtoff' field is BSD extension and it's missing on SunOS/Solaris + struct helper + { + static long int calculate_gmt_offset(const std::tm &localtm = details::os::localtime(), const std::tm &gmtm = details::os::gmtime()) + { + int local_year = localtm.tm_year + (1900 - 1); + int gmt_year = gmtm.tm_year + (1900 - 1); + + long int days = ( + // difference in day of year + localtm.tm_yday - + gmtm.tm_yday + + // + intervening leap days + + ((local_year >> 2) - (gmt_year >> 2)) - (local_year / 100 - gmt_year / 100) + + ((local_year / 100 >> 2) - (gmt_year / 100 >> 2)) + + // + difference in years * 365 */ + + (long int)(local_year - gmt_year) * 365); + + long int hours = (24 * days) + (localtm.tm_hour - gmtm.tm_hour); + long int mins = (60 * hours) + (localtm.tm_min - gmtm.tm_min); + long int secs = (60 * mins) + (localtm.tm_sec - gmtm.tm_sec); + + return secs; + } + }; + + auto offset_seconds = helper::calculate_gmt_offset(tm); +#else + auto offset_seconds = tm.tm_gmtoff; +#endif + + return static_cast(offset_seconds / 60); +#endif +} + +// Return current thread id as size_t +// It exists because the std::this_thread::get_id() is much slower(especially +// under VS 2013) +SPDLOG_INLINE size_t _thread_id() SPDLOG_NOEXCEPT +{ +#ifdef _WIN32 + return static_cast(::GetCurrentThreadId()); +#elif defined(__linux__) +#if defined(__ANDROID__) && defined(__ANDROID_API__) && (__ANDROID_API__ < 21) +#define SYS_gettid __NR_gettid +#endif + return static_cast(::syscall(SYS_gettid)); +#elif defined(_AIX) || defined(__DragonFly__) || defined(__FreeBSD__) + return static_cast(::pthread_getthreadid_np()); +#elif defined(__NetBSD__) + return static_cast(::_lwp_self()); +#elif defined(__OpenBSD__) + return static_cast(::getthrid()); +#elif defined(__sun) + return static_cast(::thr_self()); +#elif __APPLE__ + uint64_t tid; + pthread_threadid_np(nullptr, &tid); + return static_cast(tid); +#else // Default to standard C++11 (other Unix) + return static_cast(std::hash()(std::this_thread::get_id())); +#endif +} + +// Return current thread id as size_t (from thread local storage) +SPDLOG_INLINE size_t thread_id() SPDLOG_NOEXCEPT +{ +#if defined(SPDLOG_NO_TLS) + return _thread_id(); +#else // cache thread id in tls + static thread_local const size_t tid = _thread_id(); + return tid; +#endif +} + +// This is avoid msvc issue in sleep_for that happens if the clock changes. +// See https://github.com/gabime/spdlog/issues/609 +SPDLOG_INLINE void sleep_for_millis(int milliseconds) SPDLOG_NOEXCEPT +{ +#if defined(_WIN32) + ::Sleep(milliseconds); +#else + std::this_thread::sleep_for(std::chrono::milliseconds(milliseconds)); +#endif +} + +// wchar support for windows file names (SPDLOG_WCHAR_FILENAMES must be defined) +#if defined(_WIN32) && defined(SPDLOG_WCHAR_FILENAMES) +SPDLOG_INLINE std::string filename_to_str(const filename_t &filename) +{ + memory_buf_t buf; + wstr_to_utf8buf(filename, buf); + return fmt::to_string(buf); +} +#else +SPDLOG_INLINE std::string filename_to_str(const filename_t &filename) +{ + return filename; +} +#endif + +SPDLOG_INLINE int pid() SPDLOG_NOEXCEPT +{ + +#ifdef _WIN32 + return static_cast(::GetCurrentProcessId()); +#else + return static_cast(::getpid()); +#endif +} + +// Determine if the terminal supports colors +// Based on: https://github.com/agauniyal/rang/ +SPDLOG_INLINE bool is_color_terminal() SPDLOG_NOEXCEPT +{ +#ifdef _WIN32 + return true; +#else + static constexpr std::array terms = { + {"ansi", "color", "console", "cygwin", "gnome", "konsole", "kterm", "linux", "msys", "putty", "rxvt", "screen", "vt100", "xterm"}}; + + const char *env_p = std::getenv("TERM"); + if (env_p == nullptr) + { + return false; + } + + static const bool result = + std::any_of(terms.begin(), terms.end(), [&](const char *term) { return std::strstr(env_p, term) != nullptr; }); + return result; +#endif +} + +// Determine if the terminal attached +// Source: https://github.com/agauniyal/rang/ +SPDLOG_INLINE bool in_terminal(FILE *file) SPDLOG_NOEXCEPT +{ + +#ifdef _WIN32 + return ::_isatty(_fileno(file)) != 0; +#else + return ::isatty(fileno(file)) != 0; +#endif +} + +#if (defined(SPDLOG_WCHAR_TO_UTF8_SUPPORT) || defined(SPDLOG_WCHAR_FILENAMES)) && defined(_WIN32) +SPDLOG_INLINE void wstr_to_utf8buf(wstring_view_t wstr, memory_buf_t &target) +{ + if (wstr.size() > static_cast((std::numeric_limits::max)())) + { + throw_spdlog_ex("UTF-16 string is too big to be converted to UTF-8"); + } + + int wstr_size = static_cast(wstr.size()); + if (wstr_size == 0) + { + target.resize(0); + return; + } + + int result_size = static_cast(target.capacity()); + if ((wstr_size + 1) * 2 > result_size) + { + result_size = ::WideCharToMultiByte(CP_UTF8, 0, wstr.data(), wstr_size, NULL, 0, NULL, NULL); + } + + if (result_size > 0) + { + target.resize(result_size); + result_size = ::WideCharToMultiByte(CP_UTF8, 0, wstr.data(), wstr_size, target.data(), result_size, NULL, NULL); + + if (result_size > 0) + { + target.resize(result_size); + return; + } + } + + throw_spdlog_ex(fmt::format("WideCharToMultiByte failed. Last error: {}", ::GetLastError())); +} +#endif // (defined(SPDLOG_WCHAR_TO_UTF8_SUPPORT) || defined(SPDLOG_WCHAR_FILENAMES)) && defined(_WIN32) + +// return true on success +static SPDLOG_INLINE bool mkdir_(const filename_t &path) +{ +#ifdef _WIN32 +#ifdef SPDLOG_WCHAR_FILENAMES + return ::_wmkdir(path.c_str()) == 0; +#else + return ::_mkdir(path.c_str()) == 0; +#endif +#else + return ::mkdir(path.c_str(), mode_t(0755)) == 0; +#endif +} + +// create the given directory - and all directories leading to it +// return true on success or if the directory already exists +SPDLOG_INLINE bool create_dir(filename_t path) +{ + if (path_exists(path)) + { + return true; + } + + if (path.empty()) + { + return false; + } + +#ifdef _WIN32 + // support forward slash in windows + std::replace(path.begin(), path.end(), '/', folder_sep); +#endif + + size_t search_offset = 0; + do + { + auto token_pos = path.find(folder_sep, search_offset); + // treat the entire path as a folder if no folder separator not found + if (token_pos == filename_t::npos) + { + token_pos = path.size(); + } + + auto subdir = path.substr(0, token_pos); + + if (!subdir.empty() && !path_exists(subdir) && !mkdir_(subdir)) + { + return false; // return error if failed creating dir + } + search_offset = token_pos + 1; + } while (search_offset < path.size()); + + return true; +} + +// Return directory name from given path or empty string +// "abc/file" => "abc" +// "abc/" => "abc" +// "abc" => "" +// "abc///" => "abc//" +SPDLOG_INLINE filename_t dir_name(filename_t path) +{ +#ifdef _WIN32 + // support forward slash in windows + std::replace(path.begin(), path.end(), '/', folder_sep); +#endif + auto pos = path.find_last_of(folder_sep); + return pos != filename_t::npos ? path.substr(0, pos) : filename_t{}; +} + +std::string SPDLOG_INLINE getenv(const char *field) +{ + +#if defined(_MSC_VER) +#if defined(__cplusplus_winrt) + return std::string{}; // not supported under uwp +#else + size_t len = 0; + char buf[128]; + bool ok = ::getenv_s(&len, buf, sizeof(buf), field) == 0; + return ok ? buf : std::string{}; +#endif +#else // revert to getenv + char *buf = ::getenv(field); + return buf ? buf : std::string{}; +#endif +} + +} // namespace os +} // namespace details +} // namespace spdlog diff --git a/packages/sqdlog.1.0.0/lib/native/include/spdlog/details/os.h b/packages/sqdlog.1.0.0/lib/native/include/spdlog/details/os.h new file mode 100644 index 0000000..cd586e1 --- /dev/null +++ b/packages/sqdlog.1.0.0/lib/native/include/spdlog/details/os.h @@ -0,0 +1,111 @@ +// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. +// Distributed under the MIT License (http://opensource.org/licenses/MIT) + +#pragma once + +#include +#include // std::time_t + +namespace spdlog { +namespace details { +namespace os { + +SPDLOG_API spdlog::log_clock::time_point now() SPDLOG_NOEXCEPT; + +SPDLOG_API std::tm localtime(const std::time_t &time_tt) SPDLOG_NOEXCEPT; + +SPDLOG_API std::tm localtime() SPDLOG_NOEXCEPT; + +SPDLOG_API std::tm gmtime(const std::time_t &time_tt) SPDLOG_NOEXCEPT; + +SPDLOG_API std::tm gmtime() SPDLOG_NOEXCEPT; + +// eol definition +#if !defined(SPDLOG_EOL) +#ifdef _WIN32 +#define SPDLOG_EOL "\r\n" +#else +#define SPDLOG_EOL "\n" +#endif +#endif + +SPDLOG_CONSTEXPR static const char *default_eol = SPDLOG_EOL; + +// folder separator +#ifdef _WIN32 +static const char folder_sep = '\\'; +#else +SPDLOG_CONSTEXPR static const char folder_sep = '/'; +#endif + +// fopen_s on non windows for writing +SPDLOG_API bool fopen_s(FILE **fp, const filename_t &filename, const filename_t &mode); + +// Remove filename. return 0 on success +SPDLOG_API int remove(const filename_t &filename) SPDLOG_NOEXCEPT; + +// Remove file if exists. return 0 on success +// Note: Non atomic (might return failure to delete if concurrently deleted by other process/thread) +SPDLOG_API int remove_if_exists(const filename_t &filename) SPDLOG_NOEXCEPT; + +SPDLOG_API int rename(const filename_t &filename1, const filename_t &filename2) SPDLOG_NOEXCEPT; + +// Return if file exists. +SPDLOG_API bool path_exists(const filename_t &filename) SPDLOG_NOEXCEPT; + +// Return file size according to open FILE* object +SPDLOG_API size_t filesize(FILE *f); + +// Return utc offset in minutes or throw spdlog_ex on failure +SPDLOG_API int utc_minutes_offset(const std::tm &tm = details::os::localtime()); + +// Return current thread id as size_t +// It exists because the std::this_thread::get_id() is much slower(especially +// under VS 2013) +SPDLOG_API size_t _thread_id() SPDLOG_NOEXCEPT; + +// Return current thread id as size_t (from thread local storage) +SPDLOG_API size_t thread_id() SPDLOG_NOEXCEPT; + +// This is avoid msvc issue in sleep_for that happens if the clock changes. +// See https://github.com/gabime/spdlog/issues/609 +SPDLOG_API void sleep_for_millis(int milliseconds) SPDLOG_NOEXCEPT; + +SPDLOG_API std::string filename_to_str(const filename_t &filename); + +SPDLOG_API int pid() SPDLOG_NOEXCEPT; + +// Determine if the terminal supports colors +// Source: https://github.com/agauniyal/rang/ +SPDLOG_API bool is_color_terminal() SPDLOG_NOEXCEPT; + +// Determine if the terminal attached +// Source: https://github.com/agauniyal/rang/ +SPDLOG_API bool in_terminal(FILE *file) SPDLOG_NOEXCEPT; + +#if (defined(SPDLOG_WCHAR_TO_UTF8_SUPPORT) || defined(SPDLOG_WCHAR_FILENAMES)) && defined(_WIN32) +void wstr_to_utf8buf(wstring_view_t wstr, memory_buf_t &target); +#endif + +// Return directory name from given path or empty string +// "abc/file" => "abc" +// "abc/" => "abc" +// "abc" => "" +// "abc///" => "abc//" +SPDLOG_API filename_t dir_name(filename_t path); + +// Create a dir from the given path. +// Return true if succeeded or if this dir already exists. +SPDLOG_API bool create_dir(filename_t path); + +// non thread safe, cross platform getenv/getenv_s +// return empty string if field not found +SPDLOG_API std::string getenv(const char *field); + +} // namespace os +} // namespace details +} // namespace spdlog + +#ifdef SPDLOG_HEADER_ONLY +#include "os-inl.h" +#endif diff --git a/packages/sqdlog.1.0.0/lib/native/include/spdlog/details/periodic_worker-inl.h b/packages/sqdlog.1.0.0/lib/native/include/spdlog/details/periodic_worker-inl.h new file mode 100644 index 0000000..1d79499 --- /dev/null +++ b/packages/sqdlog.1.0.0/lib/native/include/spdlog/details/periodic_worker-inl.h @@ -0,0 +1,49 @@ +// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. +// Distributed under the MIT License (http://opensource.org/licenses/MIT) + +#pragma once + +#ifndef SPDLOG_HEADER_ONLY +#include +#endif + +namespace spdlog { +namespace details { + +SPDLOG_INLINE periodic_worker::periodic_worker(const std::function &callback_fun, std::chrono::seconds interval) +{ + active_ = (interval > std::chrono::seconds::zero()); + if (!active_) + { + return; + } + + worker_thread_ = std::thread([this, callback_fun, interval]() { + for (;;) + { + std::unique_lock lock(this->mutex_); + if (this->cv_.wait_for(lock, interval, [this] { return !this->active_; })) + { + return; // active_ == false, so exit this thread + } + callback_fun(); + } + }); +} + +// stop the worker thread and join it +SPDLOG_INLINE periodic_worker::~periodic_worker() +{ + if (worker_thread_.joinable()) + { + { + std::lock_guard lock(mutex_); + active_ = false; + } + cv_.notify_one(); + worker_thread_.join(); + } +} + +} // namespace details +} // namespace spdlog diff --git a/packages/sqdlog.1.0.0/lib/native/include/spdlog/details/periodic_worker.h b/packages/sqdlog.1.0.0/lib/native/include/spdlog/details/periodic_worker.h new file mode 100644 index 0000000..4237366 --- /dev/null +++ b/packages/sqdlog.1.0.0/lib/native/include/spdlog/details/periodic_worker.h @@ -0,0 +1,40 @@ +// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. +// Distributed under the MIT License (http://opensource.org/licenses/MIT) + +#pragma once + +// periodic worker thread - periodically executes the given callback function. +// +// RAII over the owned thread: +// creates the thread on construction. +// stops and joins the thread on destruction (if the thread is executing a callback, wait for it to finish first). + +#include +#include +#include +#include +#include +namespace spdlog { +namespace details { + +class SPDLOG_API periodic_worker +{ +public: + periodic_worker(const std::function &callback_fun, std::chrono::seconds interval); + periodic_worker(const periodic_worker &) = delete; + periodic_worker &operator=(const periodic_worker &) = delete; + // stop the worker thread and join it + ~periodic_worker(); + +private: + bool active_; + std::thread worker_thread_; + std::mutex mutex_; + std::condition_variable cv_; +}; +} // namespace details +} // namespace spdlog + +#ifdef SPDLOG_HEADER_ONLY +#include "periodic_worker-inl.h" +#endif diff --git a/packages/sqdlog.1.0.0/lib/native/include/spdlog/details/registry-inl.h b/packages/sqdlog.1.0.0/lib/native/include/spdlog/details/registry-inl.h new file mode 100644 index 0000000..33835d8 --- /dev/null +++ b/packages/sqdlog.1.0.0/lib/native/include/spdlog/details/registry-inl.h @@ -0,0 +1,299 @@ +// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. +// Distributed under the MIT License (http://opensource.org/licenses/MIT) + +#pragma once + +#ifndef SPDLOG_HEADER_ONLY +#include +#endif + +#include +#include +#include +#include + +#ifndef SPDLOG_DISABLE_DEFAULT_LOGGER +// support for the default stdout color logger +#ifdef _WIN32 +#include +#else +#include +#endif +#endif // SPDLOG_DISABLE_DEFAULT_LOGGER + +#include +#include +#include +#include +#include + +namespace spdlog { +namespace details { + +SPDLOG_INLINE registry::registry() + : formatter_(new pattern_formatter()) +{ + +#ifndef SPDLOG_DISABLE_DEFAULT_LOGGER + // create default logger (ansicolor_stdout_sink_mt or wincolor_stdout_sink_mt in windows). +#ifdef _WIN32 + auto color_sink = std::make_shared(); +#else + auto color_sink = std::make_shared(); +#endif + + const char *default_logger_name = ""; + default_logger_ = std::make_shared(default_logger_name, std::move(color_sink)); + loggers_[default_logger_name] = default_logger_; + +#endif // SPDLOG_DISABLE_DEFAULT_LOGGER +} + +SPDLOG_INLINE registry::~registry() = default; + +SPDLOG_INLINE void registry::register_logger(std::shared_ptr new_logger) +{ + std::lock_guard lock(logger_map_mutex_); + register_logger_(std::move(new_logger)); +} + +SPDLOG_INLINE void registry::initialize_logger(std::shared_ptr new_logger) +{ + std::lock_guard lock(logger_map_mutex_); + new_logger->set_formatter(formatter_->clone()); + + if (err_handler_) + { + new_logger->set_error_handler(err_handler_); + } + + new_logger->set_level(levels_.get(new_logger->name())); + new_logger->flush_on(flush_level_); + + if (backtrace_n_messages_ > 0) + { + new_logger->enable_backtrace(backtrace_n_messages_); + } + + if (automatic_registration_) + { + register_logger_(std::move(new_logger)); + } +} + +SPDLOG_INLINE std::shared_ptr registry::get(const std::string &logger_name) +{ + std::lock_guard lock(logger_map_mutex_); + auto found = loggers_.find(logger_name); + return found == loggers_.end() ? nullptr : found->second; +} + +SPDLOG_INLINE std::shared_ptr registry::default_logger() +{ + std::lock_guard lock(logger_map_mutex_); + return default_logger_; +} + +// Return raw ptr to the default logger. +// To be used directly by the spdlog default api (e.g. spdlog::info) +// This make the default API faster, but cannot be used concurrently with set_default_logger(). +// e.g do not call set_default_logger() from one thread while calling spdlog::info() from another. +SPDLOG_INLINE logger *registry::get_default_raw() +{ + return default_logger_.get(); +} + +// set default logger. +// default logger is stored in default_logger_ (for faster retrieval) and in the loggers_ map. +SPDLOG_INLINE void registry::set_default_logger(std::shared_ptr new_default_logger) +{ + std::lock_guard lock(logger_map_mutex_); + // remove previous default logger from the map + if (default_logger_ != nullptr) + { + loggers_.erase(default_logger_->name()); + } + if (new_default_logger != nullptr) + { + loggers_[new_default_logger->name()] = new_default_logger; + } + default_logger_ = std::move(new_default_logger); +} + +SPDLOG_INLINE void registry::set_tp(std::shared_ptr tp) +{ + std::lock_guard lock(tp_mutex_); + tp_ = std::move(tp); +} + +SPDLOG_INLINE std::shared_ptr registry::get_tp() +{ + std::lock_guard lock(tp_mutex_); + return tp_; +} + +// Set global formatter. Each sink in each logger will get a clone of this object +SPDLOG_INLINE void registry::set_formatter(std::unique_ptr formatter) +{ + std::lock_guard lock(logger_map_mutex_); + formatter_ = std::move(formatter); + for (auto &l : loggers_) + { + l.second->set_formatter(formatter_->clone()); + } +} + +SPDLOG_INLINE void registry::enable_backtrace(size_t n_messages) +{ + std::lock_guard lock(logger_map_mutex_); + backtrace_n_messages_ = n_messages; + + for (auto &l : loggers_) + { + l.second->enable_backtrace(n_messages); + } +} + +SPDLOG_INLINE void registry::disable_backtrace() +{ + std::lock_guard lock(logger_map_mutex_); + backtrace_n_messages_ = 0; + for (auto &l : loggers_) + { + l.second->disable_backtrace(); + } +} + +SPDLOG_INLINE void registry::set_level(level::level_enum log_level) +{ + std::lock_guard lock(logger_map_mutex_); + for (auto &l : loggers_) + { + l.second->set_level(log_level); + } + levels_.set_default(log_level); +} + +SPDLOG_INLINE void registry::flush_on(level::level_enum log_level) +{ + std::lock_guard lock(logger_map_mutex_); + for (auto &l : loggers_) + { + l.second->flush_on(log_level); + } + flush_level_ = log_level; +} + +SPDLOG_INLINE void registry::flush_every(std::chrono::seconds interval) +{ + std::lock_guard lock(flusher_mutex_); + auto clbk = [this]() { this->flush_all(); }; + periodic_flusher_ = details::make_unique(clbk, interval); +} + +SPDLOG_INLINE void registry::set_error_handler(void (*handler)(const std::string &msg)) +{ + std::lock_guard lock(logger_map_mutex_); + for (auto &l : loggers_) + { + l.second->set_error_handler(handler); + } + err_handler_ = handler; +} + +SPDLOG_INLINE void registry::apply_all(const std::function)> &fun) +{ + std::lock_guard lock(logger_map_mutex_); + for (auto &l : loggers_) + { + fun(l.second); + } +} + +SPDLOG_INLINE void registry::flush_all() +{ + std::lock_guard lock(logger_map_mutex_); + for (auto &l : loggers_) + { + l.second->flush(); + } +} + +SPDLOG_INLINE void registry::drop(const std::string &logger_name) +{ + std::lock_guard lock(logger_map_mutex_); + loggers_.erase(logger_name); + if (default_logger_ && default_logger_->name() == logger_name) + { + default_logger_.reset(); + } +} + +SPDLOG_INLINE void registry::drop_all() +{ + std::lock_guard lock(logger_map_mutex_); + loggers_.clear(); + default_logger_.reset(); +} + +// clean all resources and threads started by the registry +SPDLOG_INLINE void registry::shutdown() +{ + { + std::lock_guard lock(flusher_mutex_); + periodic_flusher_.reset(); + } + + drop_all(); + + { + std::lock_guard lock(tp_mutex_); + tp_.reset(); + } +} + +SPDLOG_INLINE std::recursive_mutex ®istry::tp_mutex() +{ + return tp_mutex_; +} + +SPDLOG_INLINE void registry::set_automatic_registration(bool automatic_registration) +{ + std::lock_guard lock(logger_map_mutex_); + automatic_registration_ = automatic_registration; +} + +SPDLOG_INLINE void registry::update_levels(cfg::log_levels levels) +{ + std::lock_guard lock(logger_map_mutex_); + levels_ = std::move(levels); + for (auto &l : loggers_) + { + auto &logger = l.second; + logger->set_level(levels_.get(logger->name())); + } +} + +SPDLOG_INLINE registry ®istry::instance() +{ + static registry s_instance; + return s_instance; +} + +SPDLOG_INLINE void registry::throw_if_exists_(const std::string &logger_name) +{ + if (loggers_.find(logger_name) != loggers_.end()) + { + throw_spdlog_ex("logger with name '" + logger_name + "' already exists"); + } +} + +SPDLOG_INLINE void registry::register_logger_(std::shared_ptr new_logger) +{ + auto logger_name = new_logger->name(); + throw_if_exists_(logger_name); + loggers_[logger_name] = std::move(new_logger); +} + +} // namespace details +} // namespace spdlog diff --git a/packages/sqdlog.1.0.0/lib/native/include/spdlog/details/registry.h b/packages/sqdlog.1.0.0/lib/native/include/spdlog/details/registry.h new file mode 100644 index 0000000..8be109e --- /dev/null +++ b/packages/sqdlog.1.0.0/lib/native/include/spdlog/details/registry.h @@ -0,0 +1,112 @@ +// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. +// Distributed under the MIT License (http://opensource.org/licenses/MIT) + +#pragma once + +// Loggers registry of unique name->logger pointer +// An attempt to create a logger with an already existing name will result with spdlog_ex exception. +// If user requests a non existing logger, nullptr will be returned +// This class is thread safe + +#include +#include + +#include +#include +#include +#include +#include +#include + +namespace spdlog { +class logger; + +namespace details { +class thread_pool; +class periodic_worker; + +class SPDLOG_API registry +{ +public: + registry(const registry &) = delete; + registry &operator=(const registry &) = delete; + + void register_logger(std::shared_ptr new_logger); + void initialize_logger(std::shared_ptr new_logger); + std::shared_ptr get(const std::string &logger_name); + std::shared_ptr default_logger(); + + // Return raw ptr to the default logger. + // To be used directly by the spdlog default api (e.g. spdlog::info) + // This make the default API faster, but cannot be used concurrently with set_default_logger(). + // e.g do not call set_default_logger() from one thread while calling spdlog::info() from another. + logger *get_default_raw(); + + // set default logger. + // default logger is stored in default_logger_ (for faster retrieval) and in the loggers_ map. + void set_default_logger(std::shared_ptr new_default_logger); + + void set_tp(std::shared_ptr tp); + + std::shared_ptr get_tp(); + + // Set global formatter. Each sink in each logger will get a clone of this object + void set_formatter(std::unique_ptr formatter); + + void enable_backtrace(size_t n_messages); + + void disable_backtrace(); + + void set_level(level::level_enum log_level); + + void flush_on(level::level_enum log_level); + + void flush_every(std::chrono::seconds interval); + + void set_error_handler(void (*handler)(const std::string &msg)); + + void apply_all(const std::function)> &fun); + + void flush_all(); + + void drop(const std::string &logger_name); + + void drop_all(); + + // clean all resources and threads started by the registry + void shutdown(); + + std::recursive_mutex &tp_mutex(); + + void set_automatic_registration(bool automatic_registration); + + void update_levels(cfg::log_levels levels); + + static registry &instance(); + +private: + registry(); + ~registry(); + + void throw_if_exists_(const std::string &logger_name); + void register_logger_(std::shared_ptr new_logger); + std::mutex logger_map_mutex_, flusher_mutex_; + std::recursive_mutex tp_mutex_; + std::unordered_map> loggers_; + cfg::log_levels levels_; + std::unique_ptr formatter_; + level::level_enum flush_level_ = level::off; + void (*err_handler_)(const std::string &msg); + std::shared_ptr tp_; + std::unique_ptr periodic_flusher_; + std::shared_ptr default_logger_; + bool automatic_registration_ = true; + size_t backtrace_n_messages_ = 0; +}; + +} // namespace details +} // namespace spdlog + +#ifdef SPDLOG_HEADER_ONLY +#include "registry-inl.h" +#endif diff --git a/packages/sqdlog.1.0.0/lib/native/include/spdlog/details/synchronous_factory.h b/packages/sqdlog.1.0.0/lib/native/include/spdlog/details/synchronous_factory.h new file mode 100644 index 0000000..68f5c21 --- /dev/null +++ b/packages/sqdlog.1.0.0/lib/native/include/spdlog/details/synchronous_factory.h @@ -0,0 +1,24 @@ +// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. +// Distributed under the MIT License (http://opensource.org/licenses/MIT) + +#pragma once + +#include "registry.h" + +namespace spdlog { + +// Default logger factory- creates synchronous loggers +class logger; + +struct synchronous_factory +{ + template + static std::shared_ptr create(std::string logger_name, SinkArgs &&... args) + { + auto sink = std::make_shared(std::forward(args)...); + auto new_logger = std::make_shared(std::move(logger_name), std::move(sink)); + details::registry::instance().initialize_logger(new_logger); + return new_logger; + } +}; +} // namespace spdlog \ No newline at end of file diff --git a/packages/sqdlog.1.0.0/lib/native/include/spdlog/details/tcp_client-windows.h b/packages/sqdlog.1.0.0/lib/native/include/spdlog/details/tcp_client-windows.h new file mode 100644 index 0000000..8f2e2fe --- /dev/null +++ b/packages/sqdlog.1.0.0/lib/native/include/spdlog/details/tcp_client-windows.h @@ -0,0 +1,175 @@ +// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. +// Distributed under the MIT License (http://opensource.org/licenses/MIT) + +#pragma once + +#define WIN32_LEAN_AND_MEAN +// tcp client helper +#include +#include + +#include +#include +#include +#include +#include +#include + +#pragma comment(lib, "Ws2_32.lib") +#pragma comment(lib, "Mswsock.lib") +#pragma comment(lib, "AdvApi32.lib") + +namespace spdlog { +namespace details { +class tcp_client +{ + SOCKET socket_ = INVALID_SOCKET; + + static bool winsock_initialized_() + { + SOCKET s = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); + if (s == INVALID_SOCKET) + { + return false; + } + else + { + closesocket(s); + return true; + } + } + + static void init_winsock_() + { + WSADATA wsaData; + auto rv = WSAStartup(MAKEWORD(2, 2), &wsaData); + if (rv != 0) + { + throw_winsock_error_("WSAStartup failed", ::WSAGetLastError()); + } + } + + static void throw_winsock_error_(const std::string &msg, int last_error) + { + char buf[512]; + ::FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, last_error, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), buf, (sizeof(buf) / sizeof(char)), NULL); + + throw_spdlog_ex(fmt::format("tcp_sink - {}: {}", msg, buf)); + } + +public: + bool is_connected() const + { + return socket_ != INVALID_SOCKET; + } + + void close() + { + ::closesocket(socket_); + socket_ = INVALID_SOCKET; + WSACleanup(); + } + + SOCKET fd() const + { + return socket_; + } + + ~tcp_client() + { + close(); + } + + // try to connect or throw on failure + void connect(const std::string &host, int port) + { + // initialize winsock if needed + if (!winsock_initialized_()) + { + init_winsock_(); + } + + if (is_connected()) + { + close(); + } + struct addrinfo hints + {}; + ZeroMemory(&hints, sizeof(hints)); + + hints.ai_family = AF_INET; // IPv4 + hints.ai_socktype = SOCK_STREAM; // TCP + hints.ai_flags = AI_NUMERICSERV; // port passed as as numeric value + hints.ai_protocol = 0; + + auto port_str = std::to_string(port); + struct addrinfo *addrinfo_result; + auto rv = ::getaddrinfo(host.c_str(), port_str.c_str(), &hints, &addrinfo_result); + int last_error = 0; + if (rv != 0) + { + last_error = ::WSAGetLastError(); + WSACleanup(); + throw_winsock_error_("getaddrinfo failed", last_error); + } + + // Try each address until we successfully connect(2). + + for (auto *rp = addrinfo_result; rp != nullptr; rp = rp->ai_next) + { + socket_ = socket(rp->ai_family, rp->ai_socktype, rp->ai_protocol); + if (socket_ == INVALID_SOCKET) + { + last_error = ::WSAGetLastError(); + WSACleanup(); + continue; + } + if (::connect(socket_, rp->ai_addr, (int)rp->ai_addrlen) == 0) + { + break; + } + else + { + last_error = ::WSAGetLastError(); + close(); + } + } + ::freeaddrinfo(addrinfo_result); + if (socket_ == INVALID_SOCKET) + { + WSACleanup(); + throw_winsock_error_("connect failed", last_error); + } + + // set TCP_NODELAY + int enable_flag = 1; + ::setsockopt(socket_, IPPROTO_TCP, TCP_NODELAY, (char *)&enable_flag, sizeof(enable_flag)); + } + + // Send exactly n_bytes of the given data. + // On error close the connection and throw. + void send(const char *data, size_t n_bytes) + { + size_t bytes_sent = 0; + while (bytes_sent < n_bytes) + { + const int send_flags = 0; + auto write_result = ::send(socket_, data + bytes_sent, (int)(n_bytes - bytes_sent), send_flags); + if (write_result == SOCKET_ERROR) + { + int last_error = ::WSAGetLastError(); + close(); + throw_winsock_error_("send failed", last_error); + } + + if (write_result == 0) // (probably should not happen but in any case..) + { + break; + } + bytes_sent += static_cast(write_result); + } + } +}; +} // namespace details +} // namespace spdlog diff --git a/packages/sqdlog.1.0.0/lib/native/include/spdlog/details/tcp_client.h b/packages/sqdlog.1.0.0/lib/native/include/spdlog/details/tcp_client.h new file mode 100644 index 0000000..8d331b0 --- /dev/null +++ b/packages/sqdlog.1.0.0/lib/native/include/spdlog/details/tcp_client.h @@ -0,0 +1,145 @@ +// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. +// Distributed under the MIT License (http://opensource.org/licenses/MIT) + +#pragma once + +#ifdef _WIN32 +#error include tcp_client-windows.h instead +#endif + +// tcp client helper +#include +#include + +#include +#include +#include +#include +#include + +#include + +namespace spdlog { +namespace details { +class tcp_client +{ + int socket_ = -1; + +public: + bool is_connected() const + { + return socket_ != -1; + } + + void close() + { + if (is_connected()) + { + ::close(socket_); + socket_ = -1; + } + } + + int fd() const + { + return socket_; + } + + ~tcp_client() + { + close(); + } + + // try to connect or throw on failure + void connect(const std::string &host, int port) + { + close(); + struct addrinfo hints + {}; + memset(&hints, 0, sizeof(struct addrinfo)); + hints.ai_family = AF_INET; // IPv4 + hints.ai_socktype = SOCK_STREAM; // TCP + hints.ai_flags = AI_NUMERICSERV; // port passed as as numeric value + hints.ai_protocol = 0; + + auto port_str = std::to_string(port); + struct addrinfo *addrinfo_result; + auto rv = ::getaddrinfo(host.c_str(), port_str.c_str(), &hints, &addrinfo_result); + if (rv != 0) + { + auto msg = fmt::format("::getaddrinfo failed: {}", gai_strerror(rv)); + throw_spdlog_ex(msg); + } + + // Try each address until we successfully connect(2). + int last_errno = 0; + for (auto *rp = addrinfo_result; rp != nullptr; rp = rp->ai_next) + { + int const flags = SOCK_CLOEXEC; + socket_ = ::socket(rp->ai_family, rp->ai_socktype | flags, rp->ai_protocol); + if (socket_ == -1) + { + last_errno = errno; + continue; + } + rv = ::connect(socket_, rp->ai_addr, rp->ai_addrlen); + if (rv == 0) + { + break; + } + else + { + last_errno = errno; + ::close(socket_); + socket_ = -1; + } + } + ::freeaddrinfo(addrinfo_result); + if (socket_ == -1) + { + throw_spdlog_ex("::connect failed", last_errno); + } + + // set TCP_NODELAY + int enable_flag = 1; + ::setsockopt(socket_, IPPROTO_TCP, TCP_NODELAY, (char *)&enable_flag, sizeof(enable_flag)); + + // prevent sigpipe on systems where MSG_NOSIGNAL is not available +#if defined(SO_NOSIGPIPE) && !defined(MSG_NOSIGNAL) + ::setsockopt(socket_, SOL_SOCKET, SO_NOSIGPIPE, (char *)&enable_flag, sizeof(enable_flag)); +#endif + +#if !defined(SO_NOSIGPIPE) && !defined(MSG_NOSIGNAL) +#error "tcp_sink would raise SIGPIPE since niether SO_NOSIGPIPE nor MSG_NOSIGNAL are available" +#endif + } + + // Send exactly n_bytes of the given data. + // On error close the connection and throw. + void send(const char *data, size_t n_bytes) + { + size_t bytes_sent = 0; + while (bytes_sent < n_bytes) + { +#if defined(MSG_NOSIGNAL) + const int send_flags = MSG_NOSIGNAL; +#else + const int send_flags = 0; +#endif + auto write_result = ::send(socket_, data + bytes_sent, n_bytes - bytes_sent, send_flags); + if (write_result < 0) + { + close(); + throw_spdlog_ex("write(2) failed", errno); + } + + if (write_result == 0) // (probably should not happen but in any case..) + { + break; + } + bytes_sent += static_cast(write_result); + } + } +}; +} // namespace details +} // namespace spdlog diff --git a/packages/sqdlog.1.0.0/lib/native/include/spdlog/details/thread_pool-inl.h b/packages/sqdlog.1.0.0/lib/native/include/spdlog/details/thread_pool-inl.h new file mode 100644 index 0000000..df65b02 --- /dev/null +++ b/packages/sqdlog.1.0.0/lib/native/include/spdlog/details/thread_pool-inl.h @@ -0,0 +1,124 @@ +// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. +// Distributed under the MIT License (http://opensource.org/licenses/MIT) + +#pragma once + +#ifndef SPDLOG_HEADER_ONLY +#include +#endif + +#include +#include + +namespace spdlog { +namespace details { + +SPDLOG_INLINE thread_pool::thread_pool(size_t q_max_items, size_t threads_n, std::function on_thread_start) + : q_(q_max_items) +{ + if (threads_n == 0 || threads_n > 1000) + { + throw_spdlog_ex("spdlog::thread_pool(): invalid threads_n param (valid " + "range is 1-1000)"); + } + for (size_t i = 0; i < threads_n; i++) + { + threads_.emplace_back([this, on_thread_start] { + on_thread_start(); + this->thread_pool::worker_loop_(); + }); + } +} + +SPDLOG_INLINE thread_pool::thread_pool(size_t q_max_items, size_t threads_n) + : thread_pool(q_max_items, threads_n, [] {}) +{} + +// message all threads to terminate gracefully join them +SPDLOG_INLINE thread_pool::~thread_pool() +{ + SPDLOG_TRY + { + for (size_t i = 0; i < threads_.size(); i++) + { + post_async_msg_(async_msg(async_msg_type::terminate), async_overflow_policy::block); + } + + for (auto &t : threads_) + { + t.join(); + } + } + SPDLOG_CATCH_ALL() {} +} + +void SPDLOG_INLINE thread_pool::post_log(async_logger_ptr &&worker_ptr, const details::log_msg &msg, async_overflow_policy overflow_policy) +{ + async_msg async_m(std::move(worker_ptr), async_msg_type::log, msg); + post_async_msg_(std::move(async_m), overflow_policy); +} + +void SPDLOG_INLINE thread_pool::post_flush(async_logger_ptr &&worker_ptr, async_overflow_policy overflow_policy) +{ + post_async_msg_(async_msg(std::move(worker_ptr), async_msg_type::flush), overflow_policy); +} + +size_t SPDLOG_INLINE thread_pool::overrun_counter() +{ + return q_.overrun_counter(); +} + +void SPDLOG_INLINE thread_pool::post_async_msg_(async_msg &&new_msg, async_overflow_policy overflow_policy) +{ + if (overflow_policy == async_overflow_policy::block) + { + q_.enqueue(std::move(new_msg)); + } + else + { + q_.enqueue_nowait(std::move(new_msg)); + } +} + +void SPDLOG_INLINE thread_pool::worker_loop_() +{ + while (process_next_msg_()) {} +} + +// process next message in the queue +// return true if this thread should still be active (while no terminate msg +// was received) +bool SPDLOG_INLINE thread_pool::process_next_msg_() +{ + async_msg incoming_async_msg; + bool dequeued = q_.dequeue_for(incoming_async_msg, std::chrono::seconds(10)); + if (!dequeued) + { + return true; + } + + switch (incoming_async_msg.msg_type) + { + case async_msg_type::log: { + incoming_async_msg.worker_ptr->backend_sink_it_(incoming_async_msg); + return true; + } + case async_msg_type::flush: { + incoming_async_msg.worker_ptr->backend_flush_(); + return true; + } + + case async_msg_type::terminate: { + return false; + } + + default: { + assert(false); + } + } + + return true; +} + +} // namespace details +} // namespace spdlog diff --git a/packages/sqdlog.1.0.0/lib/native/include/spdlog/details/thread_pool.h b/packages/sqdlog.1.0.0/lib/native/include/spdlog/details/thread_pool.h new file mode 100644 index 0000000..733949b --- /dev/null +++ b/packages/sqdlog.1.0.0/lib/native/include/spdlog/details/thread_pool.h @@ -0,0 +1,120 @@ +// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. +// Distributed under the MIT License (http://opensource.org/licenses/MIT) + +#pragma once + +#include +#include +#include + +#include +#include +#include +#include +#include + +namespace spdlog { +class async_logger; + +namespace details { + +using async_logger_ptr = std::shared_ptr; + +enum class async_msg_type +{ + log, + flush, + terminate +}; + +#include +// Async msg to move to/from the queue +// Movable only. should never be copied +struct async_msg : log_msg_buffer +{ + async_msg_type msg_type{async_msg_type::log}; + async_logger_ptr worker_ptr; + + async_msg() = default; + ~async_msg() = default; + + // should only be moved in or out of the queue.. + async_msg(const async_msg &) = delete; + +// support for vs2013 move +#if defined(_MSC_VER) && _MSC_VER <= 1800 + async_msg(async_msg &&other) + : log_msg_buffer(std::move(other)) + , msg_type(other.msg_type) + , worker_ptr(std::move(other.worker_ptr)) + {} + + async_msg &operator=(async_msg &&other) + { + *static_cast(this) = std::move(other); + msg_type = other.msg_type; + worker_ptr = std::move(other.worker_ptr); + return *this; + } +#else // (_MSC_VER) && _MSC_VER <= 1800 + async_msg(async_msg &&) = default; + async_msg &operator=(async_msg &&) = default; +#endif + + // construct from log_msg with given type + async_msg(async_logger_ptr &&worker, async_msg_type the_type, const details::log_msg &m) + : log_msg_buffer{m} + , msg_type{the_type} + , worker_ptr{std::move(worker)} + {} + + async_msg(async_logger_ptr &&worker, async_msg_type the_type) + : log_msg_buffer{} + , msg_type{the_type} + , worker_ptr{std::move(worker)} + {} + + explicit async_msg(async_msg_type the_type) + : async_msg{nullptr, the_type} + {} +}; + +class SPDLOG_API thread_pool +{ +public: + using item_type = async_msg; + using q_type = details::mpmc_blocking_queue; + + thread_pool(size_t q_max_items, size_t threads_n, std::function on_thread_start); + thread_pool(size_t q_max_items, size_t threads_n); + + // message all threads to terminate gracefully join them + ~thread_pool(); + + thread_pool(const thread_pool &) = delete; + thread_pool &operator=(thread_pool &&) = delete; + + void post_log(async_logger_ptr &&worker_ptr, const details::log_msg &msg, async_overflow_policy overflow_policy); + void post_flush(async_logger_ptr &&worker_ptr, async_overflow_policy overflow_policy); + size_t overrun_counter(); + +private: + q_type q_; + + std::vector threads_; + + void post_async_msg_(async_msg &&new_msg, async_overflow_policy overflow_policy); + void worker_loop_(); + + // process next message in the queue + // return true if this thread should still be active (while no terminate msg + // was received) + bool process_next_msg_(); +}; + +} // namespace details +} // namespace spdlog + +#ifdef SPDLOG_HEADER_ONLY +#include "thread_pool-inl.h" +#endif diff --git a/packages/sqdlog.1.0.0/lib/native/include/spdlog/details/windows_include.h b/packages/sqdlog.1.0.0/lib/native/include/spdlog/details/windows_include.h new file mode 100644 index 0000000..6a2f14f --- /dev/null +++ b/packages/sqdlog.1.0.0/lib/native/include/spdlog/details/windows_include.h @@ -0,0 +1,11 @@ +#pragma once + +#ifndef NOMINMAX +#define NOMINMAX // prevent windows redefining min/max +#endif + +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN +#endif + +#include diff --git a/packages/sqdlog.1.0.0/lib/native/include/spdlog/fmt/bin_to_hex.h b/packages/sqdlog.1.0.0/lib/native/include/spdlog/fmt/bin_to_hex.h new file mode 100644 index 0000000..e974cf5 --- /dev/null +++ b/packages/sqdlog.1.0.0/lib/native/include/spdlog/fmt/bin_to_hex.h @@ -0,0 +1,216 @@ +// +// Copyright(c) 2015 Gabi Melman. +// Distributed under the MIT License (http://opensource.org/licenses/MIT) +// + +#pragma once + +#include + +// +// Support for logging binary data as hex +// format flags: +// {:X} - print in uppercase. +// {:s} - don't separate each byte with space. +// {:p} - don't print the position on each line start. +// {:n} - don't split the output to lines. +// {:a} - show ASCII if :n is not set + +// +// Examples: +// +// std::vector v(200, 0x0b); +// logger->info("Some buffer {}", spdlog::to_hex(v)); +// char buf[128]; +// logger->info("Some buffer {:X}", spdlog::to_hex(std::begin(buf), std::end(buf))); +// logger->info("Some buffer {:X}", spdlog::to_hex(std::begin(buf), std::end(buf), 16)); + +namespace spdlog { +namespace details { + +template +class dump_info +{ +public: + dump_info(It range_begin, It range_end, size_t size_per_line) + : begin_(range_begin) + , end_(range_end) + , size_per_line_(size_per_line) + {} + + It begin() const + { + return begin_; + } + It end() const + { + return end_; + } + size_t size_per_line() const + { + return size_per_line_; + } + +private: + It begin_, end_; + size_t size_per_line_; +}; +} // namespace details + +// create a dump_info that wraps the given container +template +inline details::dump_info to_hex(const Container &container, size_t size_per_line = 32) +{ + static_assert(sizeof(typename Container::value_type) == 1, "sizeof(Container::value_type) != 1"); + using Iter = typename Container::const_iterator; + return details::dump_info(std::begin(container), std::end(container), size_per_line); +} + +// create dump_info from ranges +template +inline details::dump_info to_hex(const It range_begin, const It range_end, size_t size_per_line = 32) +{ + return details::dump_info(range_begin, range_end, size_per_line); +} + +} // namespace spdlog + +namespace fmt { + +template +struct formatter> +{ + const char delimiter = ' '; + bool put_newlines = true; + bool put_delimiters = true; + bool use_uppercase = false; + bool put_positions = true; // position on start of each line + bool show_ascii = false; + + // parse the format string flags + template + auto parse(ParseContext &ctx) -> decltype(ctx.begin()) + { + auto it = ctx.begin(); + while (*it && *it != '}') + { + switch (*it) + { + case 'X': + use_uppercase = true; + break; + case 's': + put_delimiters = false; + break; + case 'p': + put_positions = false; + break; + case 'n': + put_newlines = false; + show_ascii = false; + break; + case 'a': + if (put_newlines) + { + show_ascii = true; + } + break; + } + + ++it; + } + return it; + } + + // format the given bytes range as hex + template + auto format(const spdlog::details::dump_info &the_range, FormatContext &ctx) -> decltype(ctx.out()) + { + SPDLOG_CONSTEXPR const char *hex_upper = "0123456789ABCDEF"; + SPDLOG_CONSTEXPR const char *hex_lower = "0123456789abcdef"; + const char *hex_chars = use_uppercase ? hex_upper : hex_lower; + +#if FMT_VERSION < 60000 + auto inserter = ctx.begin(); +#else + auto inserter = ctx.out(); +#endif + + int size_per_line = static_cast(the_range.size_per_line()); + auto start_of_line = the_range.begin(); + for (auto i = the_range.begin(); i != the_range.end(); i++) + { + auto ch = static_cast(*i); + + if (put_newlines && (i == the_range.begin() || i - start_of_line >= size_per_line)) + { + if (show_ascii && i != the_range.begin()) + { + *inserter++ = delimiter; + *inserter++ = delimiter; + for (auto j = start_of_line; j < i; j++) + { + auto pc = static_cast(*j); + *inserter++ = std::isprint(pc) ? static_cast(*j) : '.'; + } + } + + put_newline(inserter, static_cast(i - the_range.begin())); + + // put first byte without delimiter in front of it + *inserter++ = hex_chars[(ch >> 4) & 0x0f]; + *inserter++ = hex_chars[ch & 0x0f]; + start_of_line = i; + continue; + } + + if (put_delimiters) + { + *inserter++ = delimiter; + } + + *inserter++ = hex_chars[(ch >> 4) & 0x0f]; + *inserter++ = hex_chars[ch & 0x0f]; + } + if (show_ascii) // add ascii to last line + { + if (the_range.end() - the_range.begin() > size_per_line) + { + auto blank_num = size_per_line - (the_range.end() - start_of_line); + while (blank_num-- > 0) + { + *inserter++ = delimiter; + *inserter++ = delimiter; + if (put_delimiters) + { + *inserter++ = delimiter; + } + } + } + *inserter++ = delimiter; + *inserter++ = delimiter; + for (auto j = start_of_line; j != the_range.end(); j++) + { + auto pc = static_cast(*j); + *inserter++ = std::isprint(pc) ? static_cast(*j) : '.'; + } + } + return inserter; + } + + // put newline(and position header) + template + void put_newline(It inserter, std::size_t pos) + { +#ifdef _WIN32 + *inserter++ = '\r'; +#endif + *inserter++ = '\n'; + + if (put_positions) + { + fmt::format_to(inserter, "{:<04X}: ", pos); + } + } +}; +} // namespace fmt diff --git a/packages/sqdlog.1.0.0/lib/native/include/spdlog/fmt/bundled/LICENSE.rst b/packages/sqdlog.1.0.0/lib/native/include/spdlog/fmt/bundled/LICENSE.rst new file mode 100644 index 0000000..f0ec3db --- /dev/null +++ b/packages/sqdlog.1.0.0/lib/native/include/spdlog/fmt/bundled/LICENSE.rst @@ -0,0 +1,27 @@ +Copyright (c) 2012 - present, Victor Zverovich + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--- Optional exception to the license --- + +As an exception, if, as a result of your compiling your source code, portions +of this Software are embedded into a machine-executable object form of such +source code, you may redistribute such embedded portions in such object form +without including the above copyright and permission notices. diff --git a/packages/sqdlog.1.0.0/lib/native/include/spdlog/fmt/bundled/chrono.h b/packages/sqdlog.1.0.0/lib/native/include/spdlog/fmt/bundled/chrono.h new file mode 100644 index 0000000..421d464 --- /dev/null +++ b/packages/sqdlog.1.0.0/lib/native/include/spdlog/fmt/bundled/chrono.h @@ -0,0 +1,1119 @@ +// Formatting library for C++ - chrono support +// +// Copyright (c) 2012 - present, Victor Zverovich +// All rights reserved. +// +// For the license information refer to format.h. + +#ifndef FMT_CHRONO_H_ +#define FMT_CHRONO_H_ + +#include +#include +#include +#include + +#include "format.h" +#include "locale.h" + +FMT_BEGIN_NAMESPACE + +// Enable safe chrono durations, unless explicitly disabled. +#ifndef FMT_SAFE_DURATION_CAST +# define FMT_SAFE_DURATION_CAST 1 +#endif +#if FMT_SAFE_DURATION_CAST + +// For conversion between std::chrono::durations without undefined +// behaviour or erroneous results. +// This is a stripped down version of duration_cast, for inclusion in fmt. +// See https://github.com/pauldreik/safe_duration_cast +// +// Copyright Paul Dreik 2019 +namespace safe_duration_cast { + +template ::value && + std::numeric_limits::is_signed == + std::numeric_limits::is_signed)> +FMT_CONSTEXPR To lossless_integral_conversion(const From from, int& ec) { + ec = 0; + using F = std::numeric_limits; + using T = std::numeric_limits; + static_assert(F::is_integer, "From must be integral"); + static_assert(T::is_integer, "To must be integral"); + + // A and B are both signed, or both unsigned. + if (F::digits <= T::digits) { + // From fits in To without any problem. + } else { + // From does not always fit in To, resort to a dynamic check. + if (from < T::min() || from > T::max()) { + // outside range. + ec = 1; + return {}; + } + } + return static_cast(from); +} + +/** + * converts From to To, without loss. If the dynamic value of from + * can't be converted to To without loss, ec is set. + */ +template ::value && + std::numeric_limits::is_signed != + std::numeric_limits::is_signed)> +FMT_CONSTEXPR To lossless_integral_conversion(const From from, int& ec) { + ec = 0; + using F = std::numeric_limits; + using T = std::numeric_limits; + static_assert(F::is_integer, "From must be integral"); + static_assert(T::is_integer, "To must be integral"); + + if (F::is_signed && !T::is_signed) { + // From may be negative, not allowed! + if (fmt::internal::is_negative(from)) { + ec = 1; + return {}; + } + + // From is positive. Can it always fit in To? + if (F::digits <= T::digits) { + // yes, From always fits in To. + } else { + // from may not fit in To, we have to do a dynamic check + if (from > static_cast(T::max())) { + ec = 1; + return {}; + } + } + } + + if (!F::is_signed && T::is_signed) { + // can from be held in To? + if (F::digits < T::digits) { + // yes, From always fits in To. + } else { + // from may not fit in To, we have to do a dynamic check + if (from > static_cast(T::max())) { + // outside range. + ec = 1; + return {}; + } + } + } + + // reaching here means all is ok for lossless conversion. + return static_cast(from); + +} // function + +template ::value)> +FMT_CONSTEXPR To lossless_integral_conversion(const From from, int& ec) { + ec = 0; + return from; +} // function + +// clang-format off +/** + * converts From to To if possible, otherwise ec is set. + * + * input | output + * ---------------------------------|--------------- + * NaN | NaN + * Inf | Inf + * normal, fits in output | converted (possibly lossy) + * normal, does not fit in output | ec is set + * subnormal | best effort + * -Inf | -Inf + */ +// clang-format on +template ::value)> +FMT_CONSTEXPR To safe_float_conversion(const From from, int& ec) { + ec = 0; + using T = std::numeric_limits; + static_assert(std::is_floating_point::value, "From must be floating"); + static_assert(std::is_floating_point::value, "To must be floating"); + + // catch the only happy case + if (std::isfinite(from)) { + if (from >= T::lowest() && from <= T::max()) { + return static_cast(from); + } + // not within range. + ec = 1; + return {}; + } + + // nan and inf will be preserved + return static_cast(from); +} // function + +template ::value)> +FMT_CONSTEXPR To safe_float_conversion(const From from, int& ec) { + ec = 0; + static_assert(std::is_floating_point::value, "From must be floating"); + return from; +} + +/** + * safe duration cast between integral durations + */ +template ::value), + FMT_ENABLE_IF(std::is_integral::value)> +To safe_duration_cast(std::chrono::duration from, + int& ec) { + using From = std::chrono::duration; + ec = 0; + // the basic idea is that we need to convert from count() in the from type + // to count() in the To type, by multiplying it with this: + struct Factor + : std::ratio_divide {}; + + static_assert(Factor::num > 0, "num must be positive"); + static_assert(Factor::den > 0, "den must be positive"); + + // the conversion is like this: multiply from.count() with Factor::num + // /Factor::den and convert it to To::rep, all this without + // overflow/underflow. let's start by finding a suitable type that can hold + // both To, From and Factor::num + using IntermediateRep = + typename std::common_type::type; + + // safe conversion to IntermediateRep + IntermediateRep count = + lossless_integral_conversion(from.count(), ec); + if (ec) { + return {}; + } + // multiply with Factor::num without overflow or underflow + if (Factor::num != 1) { + const auto max1 = internal::max_value() / Factor::num; + if (count > max1) { + ec = 1; + return {}; + } + const auto min1 = std::numeric_limits::min() / Factor::num; + if (count < min1) { + ec = 1; + return {}; + } + count *= Factor::num; + } + + // this can't go wrong, right? den>0 is checked earlier. + if (Factor::den != 1) { + count /= Factor::den; + } + // convert to the to type, safely + using ToRep = typename To::rep; + const ToRep tocount = lossless_integral_conversion(count, ec); + if (ec) { + return {}; + } + return To{tocount}; +} + +/** + * safe duration_cast between floating point durations + */ +template ::value), + FMT_ENABLE_IF(std::is_floating_point::value)> +To safe_duration_cast(std::chrono::duration from, + int& ec) { + using From = std::chrono::duration; + ec = 0; + if (std::isnan(from.count())) { + // nan in, gives nan out. easy. + return To{std::numeric_limits::quiet_NaN()}; + } + // maybe we should also check if from is denormal, and decide what to do about + // it. + + // +-inf should be preserved. + if (std::isinf(from.count())) { + return To{from.count()}; + } + + // the basic idea is that we need to convert from count() in the from type + // to count() in the To type, by multiplying it with this: + struct Factor + : std::ratio_divide {}; + + static_assert(Factor::num > 0, "num must be positive"); + static_assert(Factor::den > 0, "den must be positive"); + + // the conversion is like this: multiply from.count() with Factor::num + // /Factor::den and convert it to To::rep, all this without + // overflow/underflow. let's start by finding a suitable type that can hold + // both To, From and Factor::num + using IntermediateRep = + typename std::common_type::type; + + // force conversion of From::rep -> IntermediateRep to be safe, + // even if it will never happen be narrowing in this context. + IntermediateRep count = + safe_float_conversion(from.count(), ec); + if (ec) { + return {}; + } + + // multiply with Factor::num without overflow or underflow + if (Factor::num != 1) { + constexpr auto max1 = internal::max_value() / + static_cast(Factor::num); + if (count > max1) { + ec = 1; + return {}; + } + constexpr auto min1 = std::numeric_limits::lowest() / + static_cast(Factor::num); + if (count < min1) { + ec = 1; + return {}; + } + count *= static_cast(Factor::num); + } + + // this can't go wrong, right? den>0 is checked earlier. + if (Factor::den != 1) { + using common_t = typename std::common_type::type; + count /= static_cast(Factor::den); + } + + // convert to the to type, safely + using ToRep = typename To::rep; + + const ToRep tocount = safe_float_conversion(count, ec); + if (ec) { + return {}; + } + return To{tocount}; +} +} // namespace safe_duration_cast +#endif + +// Prevents expansion of a preceding token as a function-style macro. +// Usage: f FMT_NOMACRO() +#define FMT_NOMACRO + +namespace internal { +inline null<> localtime_r FMT_NOMACRO(...) { return null<>(); } +inline null<> localtime_s(...) { return null<>(); } +inline null<> gmtime_r(...) { return null<>(); } +inline null<> gmtime_s(...) { return null<>(); } +} // namespace internal + +// Thread-safe replacement for std::localtime +inline std::tm localtime(std::time_t time) { + struct dispatcher { + std::time_t time_; + std::tm tm_; + + dispatcher(std::time_t t) : time_(t) {} + + bool run() { + using namespace fmt::internal; + return handle(localtime_r(&time_, &tm_)); + } + + bool handle(std::tm* tm) { return tm != nullptr; } + + bool handle(internal::null<>) { + using namespace fmt::internal; + return fallback(localtime_s(&tm_, &time_)); + } + + bool fallback(int res) { return res == 0; } + +#if !FMT_MSC_VER + bool fallback(internal::null<>) { + using namespace fmt::internal; + std::tm* tm = std::localtime(&time_); + if (tm) tm_ = *tm; + return tm != nullptr; + } +#endif + }; + dispatcher lt(time); + // Too big time values may be unsupported. + if (!lt.run()) FMT_THROW(format_error("time_t value out of range")); + return lt.tm_; +} + +// Thread-safe replacement for std::gmtime +inline std::tm gmtime(std::time_t time) { + struct dispatcher { + std::time_t time_; + std::tm tm_; + + dispatcher(std::time_t t) : time_(t) {} + + bool run() { + using namespace fmt::internal; + return handle(gmtime_r(&time_, &tm_)); + } + + bool handle(std::tm* tm) { return tm != nullptr; } + + bool handle(internal::null<>) { + using namespace fmt::internal; + return fallback(gmtime_s(&tm_, &time_)); + } + + bool fallback(int res) { return res == 0; } + +#if !FMT_MSC_VER + bool fallback(internal::null<>) { + std::tm* tm = std::gmtime(&time_); + if (tm) tm_ = *tm; + return tm != nullptr; + } +#endif + }; + dispatcher gt(time); + // Too big time values may be unsupported. + if (!gt.run()) FMT_THROW(format_error("time_t value out of range")); + return gt.tm_; +} + +namespace internal { +inline std::size_t strftime(char* str, std::size_t count, const char* format, + const std::tm* time) { + return std::strftime(str, count, format, time); +} + +inline std::size_t strftime(wchar_t* str, std::size_t count, + const wchar_t* format, const std::tm* time) { + return std::wcsftime(str, count, format, time); +} +} // namespace internal + +template struct formatter { + template + auto parse(ParseContext& ctx) -> decltype(ctx.begin()) { + auto it = ctx.begin(); + if (it != ctx.end() && *it == ':') ++it; + auto end = it; + while (end != ctx.end() && *end != '}') ++end; + tm_format.reserve(internal::to_unsigned(end - it + 1)); + tm_format.append(it, end); + tm_format.push_back('\0'); + return end; + } + + template + auto format(const std::tm& tm, FormatContext& ctx) -> decltype(ctx.out()) { + basic_memory_buffer buf; + std::size_t start = buf.size(); + for (;;) { + std::size_t size = buf.capacity() - start; + std::size_t count = + internal::strftime(&buf[start], size, &tm_format[0], &tm); + if (count != 0) { + buf.resize(start + count); + break; + } + if (size >= tm_format.size() * 256) { + // If the buffer is 256 times larger than the format string, assume + // that `strftime` gives an empty result. There doesn't seem to be a + // better way to distinguish the two cases: + // https://github.com/fmtlib/fmt/issues/367 + break; + } + const std::size_t MIN_GROWTH = 10; + buf.reserve(buf.capacity() + (size > MIN_GROWTH ? size : MIN_GROWTH)); + } + return std::copy(buf.begin(), buf.end(), ctx.out()); + } + + basic_memory_buffer tm_format; +}; + +namespace internal { +template FMT_CONSTEXPR const char* get_units() { + return nullptr; +} +template <> FMT_CONSTEXPR const char* get_units() { return "as"; } +template <> FMT_CONSTEXPR const char* get_units() { return "fs"; } +template <> FMT_CONSTEXPR const char* get_units() { return "ps"; } +template <> FMT_CONSTEXPR const char* get_units() { return "ns"; } +template <> FMT_CONSTEXPR const char* get_units() { return "µs"; } +template <> FMT_CONSTEXPR const char* get_units() { return "ms"; } +template <> FMT_CONSTEXPR const char* get_units() { return "cs"; } +template <> FMT_CONSTEXPR const char* get_units() { return "ds"; } +template <> FMT_CONSTEXPR const char* get_units>() { return "s"; } +template <> FMT_CONSTEXPR const char* get_units() { return "das"; } +template <> FMT_CONSTEXPR const char* get_units() { return "hs"; } +template <> FMT_CONSTEXPR const char* get_units() { return "ks"; } +template <> FMT_CONSTEXPR const char* get_units() { return "Ms"; } +template <> FMT_CONSTEXPR const char* get_units() { return "Gs"; } +template <> FMT_CONSTEXPR const char* get_units() { return "Ts"; } +template <> FMT_CONSTEXPR const char* get_units() { return "Ps"; } +template <> FMT_CONSTEXPR const char* get_units() { return "Es"; } +template <> FMT_CONSTEXPR const char* get_units>() { + return "m"; +} +template <> FMT_CONSTEXPR const char* get_units>() { + return "h"; +} + +enum class numeric_system { + standard, + // Alternative numeric system, e.g. 十二 instead of 12 in ja_JP locale. + alternative +}; + +// Parses a put_time-like format string and invokes handler actions. +template +FMT_CONSTEXPR const Char* parse_chrono_format(const Char* begin, + const Char* end, + Handler&& handler) { + auto ptr = begin; + while (ptr != end) { + auto c = *ptr; + if (c == '}') break; + if (c != '%') { + ++ptr; + continue; + } + if (begin != ptr) handler.on_text(begin, ptr); + ++ptr; // consume '%' + if (ptr == end) FMT_THROW(format_error("invalid format")); + c = *ptr++; + switch (c) { + case '%': + handler.on_text(ptr - 1, ptr); + break; + case 'n': { + const Char newline[] = {'\n'}; + handler.on_text(newline, newline + 1); + break; + } + case 't': { + const Char tab[] = {'\t'}; + handler.on_text(tab, tab + 1); + break; + } + // Day of the week: + case 'a': + handler.on_abbr_weekday(); + break; + case 'A': + handler.on_full_weekday(); + break; + case 'w': + handler.on_dec0_weekday(numeric_system::standard); + break; + case 'u': + handler.on_dec1_weekday(numeric_system::standard); + break; + // Month: + case 'b': + handler.on_abbr_month(); + break; + case 'B': + handler.on_full_month(); + break; + // Hour, minute, second: + case 'H': + handler.on_24_hour(numeric_system::standard); + break; + case 'I': + handler.on_12_hour(numeric_system::standard); + break; + case 'M': + handler.on_minute(numeric_system::standard); + break; + case 'S': + handler.on_second(numeric_system::standard); + break; + // Other: + case 'c': + handler.on_datetime(numeric_system::standard); + break; + case 'x': + handler.on_loc_date(numeric_system::standard); + break; + case 'X': + handler.on_loc_time(numeric_system::standard); + break; + case 'D': + handler.on_us_date(); + break; + case 'F': + handler.on_iso_date(); + break; + case 'r': + handler.on_12_hour_time(); + break; + case 'R': + handler.on_24_hour_time(); + break; + case 'T': + handler.on_iso_time(); + break; + case 'p': + handler.on_am_pm(); + break; + case 'Q': + handler.on_duration_value(); + break; + case 'q': + handler.on_duration_unit(); + break; + case 'z': + handler.on_utc_offset(); + break; + case 'Z': + handler.on_tz_name(); + break; + // Alternative representation: + case 'E': { + if (ptr == end) FMT_THROW(format_error("invalid format")); + c = *ptr++; + switch (c) { + case 'c': + handler.on_datetime(numeric_system::alternative); + break; + case 'x': + handler.on_loc_date(numeric_system::alternative); + break; + case 'X': + handler.on_loc_time(numeric_system::alternative); + break; + default: + FMT_THROW(format_error("invalid format")); + } + break; + } + case 'O': + if (ptr == end) FMT_THROW(format_error("invalid format")); + c = *ptr++; + switch (c) { + case 'w': + handler.on_dec0_weekday(numeric_system::alternative); + break; + case 'u': + handler.on_dec1_weekday(numeric_system::alternative); + break; + case 'H': + handler.on_24_hour(numeric_system::alternative); + break; + case 'I': + handler.on_12_hour(numeric_system::alternative); + break; + case 'M': + handler.on_minute(numeric_system::alternative); + break; + case 'S': + handler.on_second(numeric_system::alternative); + break; + default: + FMT_THROW(format_error("invalid format")); + } + break; + default: + FMT_THROW(format_error("invalid format")); + } + begin = ptr; + } + if (begin != ptr) handler.on_text(begin, ptr); + return ptr; +} + +struct chrono_format_checker { + FMT_NORETURN void report_no_date() { FMT_THROW(format_error("no date")); } + + template void on_text(const Char*, const Char*) {} + FMT_NORETURN void on_abbr_weekday() { report_no_date(); } + FMT_NORETURN void on_full_weekday() { report_no_date(); } + FMT_NORETURN void on_dec0_weekday(numeric_system) { report_no_date(); } + FMT_NORETURN void on_dec1_weekday(numeric_system) { report_no_date(); } + FMT_NORETURN void on_abbr_month() { report_no_date(); } + FMT_NORETURN void on_full_month() { report_no_date(); } + void on_24_hour(numeric_system) {} + void on_12_hour(numeric_system) {} + void on_minute(numeric_system) {} + void on_second(numeric_system) {} + FMT_NORETURN void on_datetime(numeric_system) { report_no_date(); } + FMT_NORETURN void on_loc_date(numeric_system) { report_no_date(); } + FMT_NORETURN void on_loc_time(numeric_system) { report_no_date(); } + FMT_NORETURN void on_us_date() { report_no_date(); } + FMT_NORETURN void on_iso_date() { report_no_date(); } + void on_12_hour_time() {} + void on_24_hour_time() {} + void on_iso_time() {} + void on_am_pm() {} + void on_duration_value() {} + void on_duration_unit() {} + FMT_NORETURN void on_utc_offset() { report_no_date(); } + FMT_NORETURN void on_tz_name() { report_no_date(); } +}; + +template ::value)> +inline bool isnan(T) { + return false; +} +template ::value)> +inline bool isnan(T value) { + return std::isnan(value); +} + +template ::value)> +inline bool isfinite(T) { + return true; +} +template ::value)> +inline bool isfinite(T value) { + return std::isfinite(value); +} + +// Converts value to int and checks that it's in the range [0, upper). +template ::value)> +inline int to_nonnegative_int(T value, int upper) { + FMT_ASSERT(value >= 0 && value <= upper, "invalid value"); + (void)upper; + return static_cast(value); +} +template ::value)> +inline int to_nonnegative_int(T value, int upper) { + FMT_ASSERT( + std::isnan(value) || (value >= 0 && value <= static_cast(upper)), + "invalid value"); + (void)upper; + return static_cast(value); +} + +template ::value)> +inline T mod(T x, int y) { + return x % static_cast(y); +} +template ::value)> +inline T mod(T x, int y) { + return std::fmod(x, static_cast(y)); +} + +// If T is an integral type, maps T to its unsigned counterpart, otherwise +// leaves it unchanged (unlike std::make_unsigned). +template ::value> +struct make_unsigned_or_unchanged { + using type = T; +}; + +template struct make_unsigned_or_unchanged { + using type = typename std::make_unsigned::type; +}; + +#if FMT_SAFE_DURATION_CAST +// throwing version of safe_duration_cast +template +To fmt_safe_duration_cast(std::chrono::duration from) { + int ec; + To to = safe_duration_cast::safe_duration_cast(from, ec); + if (ec) FMT_THROW(format_error("cannot format duration")); + return to; +} +#endif + +template ::value)> +inline std::chrono::duration get_milliseconds( + std::chrono::duration d) { + // this may overflow and/or the result may not fit in the + // target type. +#if FMT_SAFE_DURATION_CAST + using CommonSecondsType = + typename std::common_type::type; + const auto d_as_common = fmt_safe_duration_cast(d); + const auto d_as_whole_seconds = + fmt_safe_duration_cast(d_as_common); + // this conversion should be nonproblematic + const auto diff = d_as_common - d_as_whole_seconds; + const auto ms = + fmt_safe_duration_cast>(diff); + return ms; +#else + auto s = std::chrono::duration_cast(d); + return std::chrono::duration_cast(d - s); +#endif +} + +template ::value)> +inline std::chrono::duration get_milliseconds( + std::chrono::duration d) { + using common_type = typename std::common_type::type; + auto ms = mod(d.count() * static_cast(Period::num) / + static_cast(Period::den) * 1000, + 1000); + return std::chrono::duration(static_cast(ms)); +} + +template +OutputIt format_duration_value(OutputIt out, Rep val, int precision) { + const Char pr_f[] = {'{', ':', '.', '{', '}', 'f', '}', 0}; + if (precision >= 0) return format_to(out, pr_f, val, precision); + const Char fp_f[] = {'{', ':', 'g', '}', 0}; + const Char format[] = {'{', '}', 0}; + return format_to(out, std::is_floating_point::value ? fp_f : format, + val); +} + +template +OutputIt format_duration_unit(OutputIt out) { + if (const char* unit = get_units()) { + string_view s(unit); + if (const_check(std::is_same())) { + utf8_to_utf16 u(s); + return std::copy(u.c_str(), u.c_str() + u.size(), out); + } + return std::copy(s.begin(), s.end(), out); + } + const Char num_f[] = {'[', '{', '}', ']', 's', 0}; + if (Period::den == 1) return format_to(out, num_f, Period::num); + const Char num_def_f[] = {'[', '{', '}', '/', '{', '}', ']', 's', 0}; + return format_to(out, num_def_f, Period::num, Period::den); +} + +template +struct chrono_formatter { + FormatContext& context; + OutputIt out; + int precision; + // rep is unsigned to avoid overflow. + using rep = + conditional_t::value && sizeof(Rep) < sizeof(int), + unsigned, typename make_unsigned_or_unchanged::type>; + rep val; + using seconds = std::chrono::duration; + seconds s; + using milliseconds = std::chrono::duration; + bool negative; + + using char_type = typename FormatContext::char_type; + + explicit chrono_formatter(FormatContext& ctx, OutputIt o, + std::chrono::duration d) + : context(ctx), + out(o), + val(static_cast(d.count())), + negative(false) { + if (d.count() < 0) { + val = 0 - val; + negative = true; + } + + // this may overflow and/or the result may not fit in the + // target type. +#if FMT_SAFE_DURATION_CAST + // might need checked conversion (rep!=Rep) + auto tmpval = std::chrono::duration(val); + s = fmt_safe_duration_cast(tmpval); +#else + s = std::chrono::duration_cast( + std::chrono::duration(val)); +#endif + } + + // returns true if nan or inf, writes to out. + bool handle_nan_inf() { + if (isfinite(val)) { + return false; + } + if (isnan(val)) { + write_nan(); + return true; + } + // must be +-inf + if (val > 0) { + write_pinf(); + } else { + write_ninf(); + } + return true; + } + + Rep hour() const { return static_cast(mod((s.count() / 3600), 24)); } + + Rep hour12() const { + Rep hour = static_cast(mod((s.count() / 3600), 12)); + return hour <= 0 ? 12 : hour; + } + + Rep minute() const { return static_cast(mod((s.count() / 60), 60)); } + Rep second() const { return static_cast(mod(s.count(), 60)); } + + std::tm time() const { + auto time = std::tm(); + time.tm_hour = to_nonnegative_int(hour(), 24); + time.tm_min = to_nonnegative_int(minute(), 60); + time.tm_sec = to_nonnegative_int(second(), 60); + return time; + } + + void write_sign() { + if (negative) { + *out++ = '-'; + negative = false; + } + } + + void write(Rep value, int width) { + write_sign(); + if (isnan(value)) return write_nan(); + uint32_or_64_or_128_t n = + to_unsigned(to_nonnegative_int(value, max_value())); + int num_digits = internal::count_digits(n); + if (width > num_digits) out = std::fill_n(out, width - num_digits, '0'); + out = format_decimal(out, n, num_digits); + } + + void write_nan() { std::copy_n("nan", 3, out); } + void write_pinf() { std::copy_n("inf", 3, out); } + void write_ninf() { std::copy_n("-inf", 4, out); } + + void format_localized(const tm& time, char format, char modifier = 0) { + if (isnan(val)) return write_nan(); + auto locale = context.locale().template get(); + auto& facet = std::use_facet>(locale); + std::basic_ostringstream os; + os.imbue(locale); + facet.put(os, os, ' ', &time, format, modifier); + auto str = os.str(); + std::copy(str.begin(), str.end(), out); + } + + void on_text(const char_type* begin, const char_type* end) { + std::copy(begin, end, out); + } + + // These are not implemented because durations don't have date information. + void on_abbr_weekday() {} + void on_full_weekday() {} + void on_dec0_weekday(numeric_system) {} + void on_dec1_weekday(numeric_system) {} + void on_abbr_month() {} + void on_full_month() {} + void on_datetime(numeric_system) {} + void on_loc_date(numeric_system) {} + void on_loc_time(numeric_system) {} + void on_us_date() {} + void on_iso_date() {} + void on_utc_offset() {} + void on_tz_name() {} + + void on_24_hour(numeric_system ns) { + if (handle_nan_inf()) return; + + if (ns == numeric_system::standard) return write(hour(), 2); + auto time = tm(); + time.tm_hour = to_nonnegative_int(hour(), 24); + format_localized(time, 'H', 'O'); + } + + void on_12_hour(numeric_system ns) { + if (handle_nan_inf()) return; + + if (ns == numeric_system::standard) return write(hour12(), 2); + auto time = tm(); + time.tm_hour = to_nonnegative_int(hour12(), 12); + format_localized(time, 'I', 'O'); + } + + void on_minute(numeric_system ns) { + if (handle_nan_inf()) return; + + if (ns == numeric_system::standard) return write(minute(), 2); + auto time = tm(); + time.tm_min = to_nonnegative_int(minute(), 60); + format_localized(time, 'M', 'O'); + } + + void on_second(numeric_system ns) { + if (handle_nan_inf()) return; + + if (ns == numeric_system::standard) { + write(second(), 2); +#if FMT_SAFE_DURATION_CAST + // convert rep->Rep + using duration_rep = std::chrono::duration; + using duration_Rep = std::chrono::duration; + auto tmpval = fmt_safe_duration_cast(duration_rep{val}); +#else + auto tmpval = std::chrono::duration(val); +#endif + auto ms = get_milliseconds(tmpval); + if (ms != std::chrono::milliseconds(0)) { + *out++ = '.'; + write(ms.count(), 3); + } + return; + } + auto time = tm(); + time.tm_sec = to_nonnegative_int(second(), 60); + format_localized(time, 'S', 'O'); + } + + void on_12_hour_time() { + if (handle_nan_inf()) return; + format_localized(time(), 'r'); + } + + void on_24_hour_time() { + if (handle_nan_inf()) { + *out++ = ':'; + handle_nan_inf(); + return; + } + + write(hour(), 2); + *out++ = ':'; + write(minute(), 2); + } + + void on_iso_time() { + on_24_hour_time(); + *out++ = ':'; + if (handle_nan_inf()) return; + write(second(), 2); + } + + void on_am_pm() { + if (handle_nan_inf()) return; + format_localized(time(), 'p'); + } + + void on_duration_value() { + if (handle_nan_inf()) return; + write_sign(); + out = format_duration_value(out, val, precision); + } + + void on_duration_unit() { + out = format_duration_unit(out); + } +}; +} // namespace internal + +template +struct formatter, Char> { + private: + basic_format_specs specs; + int precision; + using arg_ref_type = internal::arg_ref; + arg_ref_type width_ref; + arg_ref_type precision_ref; + mutable basic_string_view format_str; + using duration = std::chrono::duration; + + struct spec_handler { + formatter& f; + basic_format_parse_context& context; + basic_string_view format_str; + + template FMT_CONSTEXPR arg_ref_type make_arg_ref(Id arg_id) { + context.check_arg_id(arg_id); + return arg_ref_type(arg_id); + } + + FMT_CONSTEXPR arg_ref_type make_arg_ref(basic_string_view arg_id) { + context.check_arg_id(arg_id); + return arg_ref_type(arg_id); + } + + FMT_CONSTEXPR arg_ref_type make_arg_ref(internal::auto_id) { + return arg_ref_type(context.next_arg_id()); + } + + void on_error(const char* msg) { FMT_THROW(format_error(msg)); } + void on_fill(basic_string_view fill) { f.specs.fill = fill; } + void on_align(align_t align) { f.specs.align = align; } + void on_width(int width) { f.specs.width = width; } + void on_precision(int _precision) { f.precision = _precision; } + void end_precision() {} + + template void on_dynamic_width(Id arg_id) { + f.width_ref = make_arg_ref(arg_id); + } + + template void on_dynamic_precision(Id arg_id) { + f.precision_ref = make_arg_ref(arg_id); + } + }; + + using iterator = typename basic_format_parse_context::iterator; + struct parse_range { + iterator begin; + iterator end; + }; + + FMT_CONSTEXPR parse_range do_parse(basic_format_parse_context& ctx) { + auto begin = ctx.begin(), end = ctx.end(); + if (begin == end || *begin == '}') return {begin, begin}; + spec_handler handler{*this, ctx, format_str}; + begin = internal::parse_align(begin, end, handler); + if (begin == end) return {begin, begin}; + begin = internal::parse_width(begin, end, handler); + if (begin == end) return {begin, begin}; + if (*begin == '.') { + if (std::is_floating_point::value) + begin = internal::parse_precision(begin, end, handler); + else + handler.on_error("precision not allowed for this argument type"); + } + end = parse_chrono_format(begin, end, internal::chrono_format_checker()); + return {begin, end}; + } + + public: + formatter() : precision(-1) {} + + FMT_CONSTEXPR auto parse(basic_format_parse_context& ctx) + -> decltype(ctx.begin()) { + auto range = do_parse(ctx); + format_str = basic_string_view( + &*range.begin, internal::to_unsigned(range.end - range.begin)); + return range.end; + } + + template + auto format(const duration& d, FormatContext& ctx) -> decltype(ctx.out()) { + auto begin = format_str.begin(), end = format_str.end(); + // As a possible future optimization, we could avoid extra copying if width + // is not specified. + basic_memory_buffer buf; + auto out = std::back_inserter(buf); + using range = internal::output_range; + internal::basic_writer w(range(ctx.out())); + internal::handle_dynamic_spec(specs.width, + width_ref, ctx); + internal::handle_dynamic_spec( + precision, precision_ref, ctx); + if (begin == end || *begin == '}') { + out = internal::format_duration_value(out, d.count(), precision); + internal::format_duration_unit(out); + } else { + internal::chrono_formatter f( + ctx, out, d); + f.precision = precision; + parse_chrono_format(begin, end, f); + } + w.write(buf.data(), buf.size(), specs); + return w.out(); + } +}; + +FMT_END_NAMESPACE + +#endif // FMT_CHRONO_H_ diff --git a/packages/sqdlog.1.0.0/lib/native/include/spdlog/fmt/bundled/color.h b/packages/sqdlog.1.0.0/lib/native/include/spdlog/fmt/bundled/color.h new file mode 100644 index 0000000..96d9ab6 --- /dev/null +++ b/packages/sqdlog.1.0.0/lib/native/include/spdlog/fmt/bundled/color.h @@ -0,0 +1,568 @@ +// Formatting library for C++ - color support +// +// Copyright (c) 2018 - present, Victor Zverovich and fmt contributors +// All rights reserved. +// +// For the license information refer to format.h. + +#ifndef FMT_COLOR_H_ +#define FMT_COLOR_H_ + +#include "format.h" + +FMT_BEGIN_NAMESPACE + +enum class color : uint32_t { + alice_blue = 0xF0F8FF, // rgb(240,248,255) + antique_white = 0xFAEBD7, // rgb(250,235,215) + aqua = 0x00FFFF, // rgb(0,255,255) + aquamarine = 0x7FFFD4, // rgb(127,255,212) + azure = 0xF0FFFF, // rgb(240,255,255) + beige = 0xF5F5DC, // rgb(245,245,220) + bisque = 0xFFE4C4, // rgb(255,228,196) + black = 0x000000, // rgb(0,0,0) + blanched_almond = 0xFFEBCD, // rgb(255,235,205) + blue = 0x0000FF, // rgb(0,0,255) + blue_violet = 0x8A2BE2, // rgb(138,43,226) + brown = 0xA52A2A, // rgb(165,42,42) + burly_wood = 0xDEB887, // rgb(222,184,135) + cadet_blue = 0x5F9EA0, // rgb(95,158,160) + chartreuse = 0x7FFF00, // rgb(127,255,0) + chocolate = 0xD2691E, // rgb(210,105,30) + coral = 0xFF7F50, // rgb(255,127,80) + cornflower_blue = 0x6495ED, // rgb(100,149,237) + cornsilk = 0xFFF8DC, // rgb(255,248,220) + crimson = 0xDC143C, // rgb(220,20,60) + cyan = 0x00FFFF, // rgb(0,255,255) + dark_blue = 0x00008B, // rgb(0,0,139) + dark_cyan = 0x008B8B, // rgb(0,139,139) + dark_golden_rod = 0xB8860B, // rgb(184,134,11) + dark_gray = 0xA9A9A9, // rgb(169,169,169) + dark_green = 0x006400, // rgb(0,100,0) + dark_khaki = 0xBDB76B, // rgb(189,183,107) + dark_magenta = 0x8B008B, // rgb(139,0,139) + dark_olive_green = 0x556B2F, // rgb(85,107,47) + dark_orange = 0xFF8C00, // rgb(255,140,0) + dark_orchid = 0x9932CC, // rgb(153,50,204) + dark_red = 0x8B0000, // rgb(139,0,0) + dark_salmon = 0xE9967A, // rgb(233,150,122) + dark_sea_green = 0x8FBC8F, // rgb(143,188,143) + dark_slate_blue = 0x483D8B, // rgb(72,61,139) + dark_slate_gray = 0x2F4F4F, // rgb(47,79,79) + dark_turquoise = 0x00CED1, // rgb(0,206,209) + dark_violet = 0x9400D3, // rgb(148,0,211) + deep_pink = 0xFF1493, // rgb(255,20,147) + deep_sky_blue = 0x00BFFF, // rgb(0,191,255) + dim_gray = 0x696969, // rgb(105,105,105) + dodger_blue = 0x1E90FF, // rgb(30,144,255) + fire_brick = 0xB22222, // rgb(178,34,34) + floral_white = 0xFFFAF0, // rgb(255,250,240) + forest_green = 0x228B22, // rgb(34,139,34) + fuchsia = 0xFF00FF, // rgb(255,0,255) + gainsboro = 0xDCDCDC, // rgb(220,220,220) + ghost_white = 0xF8F8FF, // rgb(248,248,255) + gold = 0xFFD700, // rgb(255,215,0) + golden_rod = 0xDAA520, // rgb(218,165,32) + gray = 0x808080, // rgb(128,128,128) + green = 0x008000, // rgb(0,128,0) + green_yellow = 0xADFF2F, // rgb(173,255,47) + honey_dew = 0xF0FFF0, // rgb(240,255,240) + hot_pink = 0xFF69B4, // rgb(255,105,180) + indian_red = 0xCD5C5C, // rgb(205,92,92) + indigo = 0x4B0082, // rgb(75,0,130) + ivory = 0xFFFFF0, // rgb(255,255,240) + khaki = 0xF0E68C, // rgb(240,230,140) + lavender = 0xE6E6FA, // rgb(230,230,250) + lavender_blush = 0xFFF0F5, // rgb(255,240,245) + lawn_green = 0x7CFC00, // rgb(124,252,0) + lemon_chiffon = 0xFFFACD, // rgb(255,250,205) + light_blue = 0xADD8E6, // rgb(173,216,230) + light_coral = 0xF08080, // rgb(240,128,128) + light_cyan = 0xE0FFFF, // rgb(224,255,255) + light_golden_rod_yellow = 0xFAFAD2, // rgb(250,250,210) + light_gray = 0xD3D3D3, // rgb(211,211,211) + light_green = 0x90EE90, // rgb(144,238,144) + light_pink = 0xFFB6C1, // rgb(255,182,193) + light_salmon = 0xFFA07A, // rgb(255,160,122) + light_sea_green = 0x20B2AA, // rgb(32,178,170) + light_sky_blue = 0x87CEFA, // rgb(135,206,250) + light_slate_gray = 0x778899, // rgb(119,136,153) + light_steel_blue = 0xB0C4DE, // rgb(176,196,222) + light_yellow = 0xFFFFE0, // rgb(255,255,224) + lime = 0x00FF00, // rgb(0,255,0) + lime_green = 0x32CD32, // rgb(50,205,50) + linen = 0xFAF0E6, // rgb(250,240,230) + magenta = 0xFF00FF, // rgb(255,0,255) + maroon = 0x800000, // rgb(128,0,0) + medium_aquamarine = 0x66CDAA, // rgb(102,205,170) + medium_blue = 0x0000CD, // rgb(0,0,205) + medium_orchid = 0xBA55D3, // rgb(186,85,211) + medium_purple = 0x9370DB, // rgb(147,112,219) + medium_sea_green = 0x3CB371, // rgb(60,179,113) + medium_slate_blue = 0x7B68EE, // rgb(123,104,238) + medium_spring_green = 0x00FA9A, // rgb(0,250,154) + medium_turquoise = 0x48D1CC, // rgb(72,209,204) + medium_violet_red = 0xC71585, // rgb(199,21,133) + midnight_blue = 0x191970, // rgb(25,25,112) + mint_cream = 0xF5FFFA, // rgb(245,255,250) + misty_rose = 0xFFE4E1, // rgb(255,228,225) + moccasin = 0xFFE4B5, // rgb(255,228,181) + navajo_white = 0xFFDEAD, // rgb(255,222,173) + navy = 0x000080, // rgb(0,0,128) + old_lace = 0xFDF5E6, // rgb(253,245,230) + olive = 0x808000, // rgb(128,128,0) + olive_drab = 0x6B8E23, // rgb(107,142,35) + orange = 0xFFA500, // rgb(255,165,0) + orange_red = 0xFF4500, // rgb(255,69,0) + orchid = 0xDA70D6, // rgb(218,112,214) + pale_golden_rod = 0xEEE8AA, // rgb(238,232,170) + pale_green = 0x98FB98, // rgb(152,251,152) + pale_turquoise = 0xAFEEEE, // rgb(175,238,238) + pale_violet_red = 0xDB7093, // rgb(219,112,147) + papaya_whip = 0xFFEFD5, // rgb(255,239,213) + peach_puff = 0xFFDAB9, // rgb(255,218,185) + peru = 0xCD853F, // rgb(205,133,63) + pink = 0xFFC0CB, // rgb(255,192,203) + plum = 0xDDA0DD, // rgb(221,160,221) + powder_blue = 0xB0E0E6, // rgb(176,224,230) + purple = 0x800080, // rgb(128,0,128) + rebecca_purple = 0x663399, // rgb(102,51,153) + red = 0xFF0000, // rgb(255,0,0) + rosy_brown = 0xBC8F8F, // rgb(188,143,143) + royal_blue = 0x4169E1, // rgb(65,105,225) + saddle_brown = 0x8B4513, // rgb(139,69,19) + salmon = 0xFA8072, // rgb(250,128,114) + sandy_brown = 0xF4A460, // rgb(244,164,96) + sea_green = 0x2E8B57, // rgb(46,139,87) + sea_shell = 0xFFF5EE, // rgb(255,245,238) + sienna = 0xA0522D, // rgb(160,82,45) + silver = 0xC0C0C0, // rgb(192,192,192) + sky_blue = 0x87CEEB, // rgb(135,206,235) + slate_blue = 0x6A5ACD, // rgb(106,90,205) + slate_gray = 0x708090, // rgb(112,128,144) + snow = 0xFFFAFA, // rgb(255,250,250) + spring_green = 0x00FF7F, // rgb(0,255,127) + steel_blue = 0x4682B4, // rgb(70,130,180) + tan = 0xD2B48C, // rgb(210,180,140) + teal = 0x008080, // rgb(0,128,128) + thistle = 0xD8BFD8, // rgb(216,191,216) + tomato = 0xFF6347, // rgb(255,99,71) + turquoise = 0x40E0D0, // rgb(64,224,208) + violet = 0xEE82EE, // rgb(238,130,238) + wheat = 0xF5DEB3, // rgb(245,222,179) + white = 0xFFFFFF, // rgb(255,255,255) + white_smoke = 0xF5F5F5, // rgb(245,245,245) + yellow = 0xFFFF00, // rgb(255,255,0) + yellow_green = 0x9ACD32 // rgb(154,205,50) +}; // enum class color + +enum class terminal_color : uint8_t { + black = 30, + red, + green, + yellow, + blue, + magenta, + cyan, + white, + bright_black = 90, + bright_red, + bright_green, + bright_yellow, + bright_blue, + bright_magenta, + bright_cyan, + bright_white +}; + +enum class emphasis : uint8_t { + bold = 1, + italic = 1 << 1, + underline = 1 << 2, + strikethrough = 1 << 3 +}; + +// rgb is a struct for red, green and blue colors. +// Using the name "rgb" makes some editors show the color in a tooltip. +struct rgb { + FMT_CONSTEXPR rgb() : r(0), g(0), b(0) {} + FMT_CONSTEXPR rgb(uint8_t r_, uint8_t g_, uint8_t b_) : r(r_), g(g_), b(b_) {} + FMT_CONSTEXPR rgb(uint32_t hex) + : r((hex >> 16) & 0xFF), g((hex >> 8) & 0xFF), b(hex & 0xFF) {} + FMT_CONSTEXPR rgb(color hex) + : r((uint32_t(hex) >> 16) & 0xFF), + g((uint32_t(hex) >> 8) & 0xFF), + b(uint32_t(hex) & 0xFF) {} + uint8_t r; + uint8_t g; + uint8_t b; +}; + +namespace internal { + +// color is a struct of either a rgb color or a terminal color. +struct color_type { + FMT_CONSTEXPR color_type() FMT_NOEXCEPT : is_rgb(), value{} {} + FMT_CONSTEXPR color_type(color rgb_color) FMT_NOEXCEPT : is_rgb(true), + value{} { + value.rgb_color = static_cast(rgb_color); + } + FMT_CONSTEXPR color_type(rgb rgb_color) FMT_NOEXCEPT : is_rgb(true), value{} { + value.rgb_color = (static_cast(rgb_color.r) << 16) | + (static_cast(rgb_color.g) << 8) | rgb_color.b; + } + FMT_CONSTEXPR color_type(terminal_color term_color) FMT_NOEXCEPT : is_rgb(), + value{} { + value.term_color = static_cast(term_color); + } + bool is_rgb; + union color_union { + uint8_t term_color; + uint32_t rgb_color; + } value; +}; +} // namespace internal + +// Experimental text formatting support. +class text_style { + public: + FMT_CONSTEXPR text_style(emphasis em = emphasis()) FMT_NOEXCEPT + : set_foreground_color(), + set_background_color(), + ems(em) {} + + FMT_CONSTEXPR text_style& operator|=(const text_style& rhs) { + if (!set_foreground_color) { + set_foreground_color = rhs.set_foreground_color; + foreground_color = rhs.foreground_color; + } else if (rhs.set_foreground_color) { + if (!foreground_color.is_rgb || !rhs.foreground_color.is_rgb) + FMT_THROW(format_error("can't OR a terminal color")); + foreground_color.value.rgb_color |= rhs.foreground_color.value.rgb_color; + } + + if (!set_background_color) { + set_background_color = rhs.set_background_color; + background_color = rhs.background_color; + } else if (rhs.set_background_color) { + if (!background_color.is_rgb || !rhs.background_color.is_rgb) + FMT_THROW(format_error("can't OR a terminal color")); + background_color.value.rgb_color |= rhs.background_color.value.rgb_color; + } + + ems = static_cast(static_cast(ems) | + static_cast(rhs.ems)); + return *this; + } + + friend FMT_CONSTEXPR text_style operator|(text_style lhs, + const text_style& rhs) { + return lhs |= rhs; + } + + FMT_CONSTEXPR text_style& operator&=(const text_style& rhs) { + if (!set_foreground_color) { + set_foreground_color = rhs.set_foreground_color; + foreground_color = rhs.foreground_color; + } else if (rhs.set_foreground_color) { + if (!foreground_color.is_rgb || !rhs.foreground_color.is_rgb) + FMT_THROW(format_error("can't AND a terminal color")); + foreground_color.value.rgb_color &= rhs.foreground_color.value.rgb_color; + } + + if (!set_background_color) { + set_background_color = rhs.set_background_color; + background_color = rhs.background_color; + } else if (rhs.set_background_color) { + if (!background_color.is_rgb || !rhs.background_color.is_rgb) + FMT_THROW(format_error("can't AND a terminal color")); + background_color.value.rgb_color &= rhs.background_color.value.rgb_color; + } + + ems = static_cast(static_cast(ems) & + static_cast(rhs.ems)); + return *this; + } + + friend FMT_CONSTEXPR text_style operator&(text_style lhs, + const text_style& rhs) { + return lhs &= rhs; + } + + FMT_CONSTEXPR bool has_foreground() const FMT_NOEXCEPT { + return set_foreground_color; + } + FMT_CONSTEXPR bool has_background() const FMT_NOEXCEPT { + return set_background_color; + } + FMT_CONSTEXPR bool has_emphasis() const FMT_NOEXCEPT { + return static_cast(ems) != 0; + } + FMT_CONSTEXPR internal::color_type get_foreground() const FMT_NOEXCEPT { + FMT_ASSERT(has_foreground(), "no foreground specified for this style"); + return foreground_color; + } + FMT_CONSTEXPR internal::color_type get_background() const FMT_NOEXCEPT { + FMT_ASSERT(has_background(), "no background specified for this style"); + return background_color; + } + FMT_CONSTEXPR emphasis get_emphasis() const FMT_NOEXCEPT { + FMT_ASSERT(has_emphasis(), "no emphasis specified for this style"); + return ems; + } + + private: + FMT_CONSTEXPR text_style(bool is_foreground, + internal::color_type text_color) FMT_NOEXCEPT + : set_foreground_color(), + set_background_color(), + ems() { + if (is_foreground) { + foreground_color = text_color; + set_foreground_color = true; + } else { + background_color = text_color; + set_background_color = true; + } + } + + friend FMT_CONSTEXPR_DECL text_style fg(internal::color_type foreground) + FMT_NOEXCEPT; + friend FMT_CONSTEXPR_DECL text_style bg(internal::color_type background) + FMT_NOEXCEPT; + + internal::color_type foreground_color; + internal::color_type background_color; + bool set_foreground_color; + bool set_background_color; + emphasis ems; +}; + +FMT_CONSTEXPR text_style fg(internal::color_type foreground) FMT_NOEXCEPT { + return text_style(/*is_foreground=*/true, foreground); +} + +FMT_CONSTEXPR text_style bg(internal::color_type background) FMT_NOEXCEPT { + return text_style(/*is_foreground=*/false, background); +} + +FMT_CONSTEXPR text_style operator|(emphasis lhs, emphasis rhs) FMT_NOEXCEPT { + return text_style(lhs) | rhs; +} + +namespace internal { + +template struct ansi_color_escape { + FMT_CONSTEXPR ansi_color_escape(internal::color_type text_color, + const char* esc) FMT_NOEXCEPT { + // If we have a terminal color, we need to output another escape code + // sequence. + if (!text_color.is_rgb) { + bool is_background = esc == internal::data::background_color; + uint32_t value = text_color.value.term_color; + // Background ASCII codes are the same as the foreground ones but with + // 10 more. + if (is_background) value += 10u; + + std::size_t index = 0; + buffer[index++] = static_cast('\x1b'); + buffer[index++] = static_cast('['); + + if (value >= 100u) { + buffer[index++] = static_cast('1'); + value %= 100u; + } + buffer[index++] = static_cast('0' + value / 10u); + buffer[index++] = static_cast('0' + value % 10u); + + buffer[index++] = static_cast('m'); + buffer[index++] = static_cast('\0'); + return; + } + + for (int i = 0; i < 7; i++) { + buffer[i] = static_cast(esc[i]); + } + rgb color(text_color.value.rgb_color); + to_esc(color.r, buffer + 7, ';'); + to_esc(color.g, buffer + 11, ';'); + to_esc(color.b, buffer + 15, 'm'); + buffer[19] = static_cast(0); + } + FMT_CONSTEXPR ansi_color_escape(emphasis em) FMT_NOEXCEPT { + uint8_t em_codes[4] = {}; + uint8_t em_bits = static_cast(em); + if (em_bits & static_cast(emphasis::bold)) em_codes[0] = 1; + if (em_bits & static_cast(emphasis::italic)) em_codes[1] = 3; + if (em_bits & static_cast(emphasis::underline)) em_codes[2] = 4; + if (em_bits & static_cast(emphasis::strikethrough)) + em_codes[3] = 9; + + std::size_t index = 0; + for (int i = 0; i < 4; ++i) { + if (!em_codes[i]) continue; + buffer[index++] = static_cast('\x1b'); + buffer[index++] = static_cast('['); + buffer[index++] = static_cast('0' + em_codes[i]); + buffer[index++] = static_cast('m'); + } + buffer[index++] = static_cast(0); + } + FMT_CONSTEXPR operator const Char*() const FMT_NOEXCEPT { return buffer; } + + FMT_CONSTEXPR const Char* begin() const FMT_NOEXCEPT { return buffer; } + FMT_CONSTEXPR const Char* end() const FMT_NOEXCEPT { + return buffer + std::char_traits::length(buffer); + } + + private: + Char buffer[7u + 3u * 4u + 1u]; + + static FMT_CONSTEXPR void to_esc(uint8_t c, Char* out, + char delimiter) FMT_NOEXCEPT { + out[0] = static_cast('0' + c / 100); + out[1] = static_cast('0' + c / 10 % 10); + out[2] = static_cast('0' + c % 10); + out[3] = static_cast(delimiter); + } +}; + +template +FMT_CONSTEXPR ansi_color_escape make_foreground_color( + internal::color_type foreground) FMT_NOEXCEPT { + return ansi_color_escape(foreground, internal::data::foreground_color); +} + +template +FMT_CONSTEXPR ansi_color_escape make_background_color( + internal::color_type background) FMT_NOEXCEPT { + return ansi_color_escape(background, internal::data::background_color); +} + +template +FMT_CONSTEXPR ansi_color_escape make_emphasis(emphasis em) FMT_NOEXCEPT { + return ansi_color_escape(em); +} + +template +inline void fputs(const Char* chars, FILE* stream) FMT_NOEXCEPT { + std::fputs(chars, stream); +} + +template <> +inline void fputs(const wchar_t* chars, FILE* stream) FMT_NOEXCEPT { + std::fputws(chars, stream); +} + +template inline void reset_color(FILE* stream) FMT_NOEXCEPT { + fputs(internal::data::reset_color, stream); +} + +template <> inline void reset_color(FILE* stream) FMT_NOEXCEPT { + fputs(internal::data::wreset_color, stream); +} + +template +inline void reset_color(basic_memory_buffer& buffer) FMT_NOEXCEPT { + const char* begin = data::reset_color; + const char* end = begin + sizeof(data::reset_color) - 1; + buffer.append(begin, end); +} + +template +void vformat_to(basic_memory_buffer& buf, const text_style& ts, + basic_string_view format_str, + basic_format_args> args) { + bool has_style = false; + if (ts.has_emphasis()) { + has_style = true; + auto emphasis = internal::make_emphasis(ts.get_emphasis()); + buf.append(emphasis.begin(), emphasis.end()); + } + if (ts.has_foreground()) { + has_style = true; + auto foreground = + internal::make_foreground_color(ts.get_foreground()); + buf.append(foreground.begin(), foreground.end()); + } + if (ts.has_background()) { + has_style = true; + auto background = + internal::make_background_color(ts.get_background()); + buf.append(background.begin(), background.end()); + } + internal::vformat_to(buf, format_str, args); + if (has_style) internal::reset_color(buf); +} +} // namespace internal + +template > +void vprint(std::FILE* f, const text_style& ts, const S& format, + basic_format_args> args) { + basic_memory_buffer buf; + internal::vformat_to(buf, ts, to_string_view(format), args); + buf.push_back(Char(0)); + internal::fputs(buf.data(), f); +} + +/** + Formats a string and prints it to the specified file stream using ANSI + escape sequences to specify text formatting. + Example: + fmt::print(fmt::emphasis::bold | fg(fmt::color::red), + "Elapsed time: {0:.2f} seconds", 1.23); + */ +template ::value)> +void print(std::FILE* f, const text_style& ts, const S& format_str, + const Args&... args) { + internal::check_format_string(format_str); + using context = buffer_context>; + format_arg_store as{args...}; + vprint(f, ts, format_str, basic_format_args(as)); +} + +/** + Formats a string and prints it to stdout using ANSI escape sequences to + specify text formatting. + Example: + fmt::print(fmt::emphasis::bold | fg(fmt::color::red), + "Elapsed time: {0:.2f} seconds", 1.23); + */ +template ::value)> +void print(const text_style& ts, const S& format_str, const Args&... args) { + return print(stdout, ts, format_str, args...); +} + +template > +inline std::basic_string vformat( + const text_style& ts, const S& format_str, + basic_format_args>> args) { + basic_memory_buffer buf; + internal::vformat_to(buf, ts, to_string_view(format_str), args); + return fmt::to_string(buf); +} + +/** + \rst + Formats arguments and returns the result as a string using ANSI + escape sequences to specify text formatting. + + **Example**:: + + #include + std::string message = fmt::format(fmt::emphasis::bold | fg(fmt::color::red), + "The answer is {}", 42); + \endrst +*/ +template > +inline std::basic_string format(const text_style& ts, const S& format_str, + const Args&... args) { + return vformat(ts, to_string_view(format_str), + internal::make_args_checked(format_str, args...)); +} + +FMT_END_NAMESPACE + +#endif // FMT_COLOR_H_ diff --git a/packages/sqdlog.1.0.0/lib/native/include/spdlog/fmt/bundled/compile.h b/packages/sqdlog.1.0.0/lib/native/include/spdlog/fmt/bundled/compile.h new file mode 100644 index 0000000..e4b12f3 --- /dev/null +++ b/packages/sqdlog.1.0.0/lib/native/include/spdlog/fmt/bundled/compile.h @@ -0,0 +1,595 @@ +// Formatting library for C++ - experimental format string compilation +// +// Copyright (c) 2012 - present, Victor Zverovich and fmt contributors +// All rights reserved. +// +// For the license information refer to format.h. + +#ifndef FMT_COMPILE_H_ +#define FMT_COMPILE_H_ + +#include + +#include "format.h" + +FMT_BEGIN_NAMESPACE +namespace internal { + +// Part of a compiled format string. It can be either literal text or a +// replacement field. +template struct format_part { + enum class kind { arg_index, arg_name, text, replacement }; + + struct replacement { + arg_ref arg_id; + dynamic_format_specs specs; + }; + + kind part_kind; + union value { + int arg_index; + basic_string_view str; + replacement repl; + + FMT_CONSTEXPR value(int index = 0) : arg_index(index) {} + FMT_CONSTEXPR value(basic_string_view s) : str(s) {} + FMT_CONSTEXPR value(replacement r) : repl(r) {} + } val; + // Position past the end of the argument id. + const Char* arg_id_end = nullptr; + + FMT_CONSTEXPR format_part(kind k = kind::arg_index, value v = {}) + : part_kind(k), val(v) {} + + static FMT_CONSTEXPR format_part make_arg_index(int index) { + return format_part(kind::arg_index, index); + } + static FMT_CONSTEXPR format_part make_arg_name(basic_string_view name) { + return format_part(kind::arg_name, name); + } + static FMT_CONSTEXPR format_part make_text(basic_string_view text) { + return format_part(kind::text, text); + } + static FMT_CONSTEXPR format_part make_replacement(replacement repl) { + return format_part(kind::replacement, repl); + } +}; + +template struct part_counter { + unsigned num_parts = 0; + + FMT_CONSTEXPR void on_text(const Char* begin, const Char* end) { + if (begin != end) ++num_parts; + } + + FMT_CONSTEXPR void on_arg_id() { ++num_parts; } + FMT_CONSTEXPR void on_arg_id(int) { ++num_parts; } + FMT_CONSTEXPR void on_arg_id(basic_string_view) { ++num_parts; } + + FMT_CONSTEXPR void on_replacement_field(const Char*) {} + + FMT_CONSTEXPR const Char* on_format_specs(const Char* begin, + const Char* end) { + // Find the matching brace. + unsigned brace_counter = 0; + for (; begin != end; ++begin) { + if (*begin == '{') { + ++brace_counter; + } else if (*begin == '}') { + if (brace_counter == 0u) break; + --brace_counter; + } + } + return begin; + } + + FMT_CONSTEXPR void on_error(const char*) {} +}; + +// Counts the number of parts in a format string. +template +FMT_CONSTEXPR unsigned count_parts(basic_string_view format_str) { + part_counter counter; + parse_format_string(format_str, counter); + return counter.num_parts; +} + +template +class format_string_compiler : public error_handler { + private: + using part = format_part; + + PartHandler handler_; + part part_; + basic_string_view format_str_; + basic_format_parse_context parse_context_; + + public: + FMT_CONSTEXPR format_string_compiler(basic_string_view format_str, + PartHandler handler) + : handler_(handler), + format_str_(format_str), + parse_context_(format_str) {} + + FMT_CONSTEXPR void on_text(const Char* begin, const Char* end) { + if (begin != end) + handler_(part::make_text({begin, to_unsigned(end - begin)})); + } + + FMT_CONSTEXPR void on_arg_id() { + part_ = part::make_arg_index(parse_context_.next_arg_id()); + } + + FMT_CONSTEXPR void on_arg_id(int id) { + parse_context_.check_arg_id(id); + part_ = part::make_arg_index(id); + } + + FMT_CONSTEXPR void on_arg_id(basic_string_view id) { + part_ = part::make_arg_name(id); + } + + FMT_CONSTEXPR void on_replacement_field(const Char* ptr) { + part_.arg_id_end = ptr; + handler_(part_); + } + + FMT_CONSTEXPR const Char* on_format_specs(const Char* begin, + const Char* end) { + auto repl = typename part::replacement(); + dynamic_specs_handler> handler( + repl.specs, parse_context_); + auto it = parse_format_specs(begin, end, handler); + if (*it != '}') on_error("missing '}' in format string"); + repl.arg_id = part_.part_kind == part::kind::arg_index + ? arg_ref(part_.val.arg_index) + : arg_ref(part_.val.str); + auto part = part::make_replacement(repl); + part.arg_id_end = begin; + handler_(part); + return it; + } +}; + +// Compiles a format string and invokes handler(part) for each parsed part. +template +FMT_CONSTEXPR void compile_format_string(basic_string_view format_str, + PartHandler handler) { + parse_format_string( + format_str, + format_string_compiler(format_str, handler)); +} + +template +void format_arg( + basic_format_parse_context& parse_ctx, + Context& ctx, Id arg_id) { + ctx.advance_to( + visit_format_arg(arg_formatter(ctx, &parse_ctx), ctx.arg(arg_id))); +} + +// vformat_to is defined in a subnamespace to prevent ADL. +namespace cf { +template +auto vformat_to(Range out, CompiledFormat& cf, basic_format_args args) + -> typename Context::iterator { + using char_type = typename Context::char_type; + basic_format_parse_context parse_ctx( + to_string_view(cf.format_str_)); + Context ctx(out.begin(), args); + + const auto& parts = cf.parts(); + for (auto part_it = std::begin(parts); part_it != std::end(parts); + ++part_it) { + const auto& part = *part_it; + const auto& value = part.val; + + using format_part_t = format_part; + switch (part.part_kind) { + case format_part_t::kind::text: { + const auto text = value.str; + auto output = ctx.out(); + auto&& it = reserve(output, text.size()); + it = std::copy_n(text.begin(), text.size(), it); + ctx.advance_to(output); + break; + } + + case format_part_t::kind::arg_index: + advance_to(parse_ctx, part.arg_id_end); + internal::format_arg(parse_ctx, ctx, value.arg_index); + break; + + case format_part_t::kind::arg_name: + advance_to(parse_ctx, part.arg_id_end); + internal::format_arg(parse_ctx, ctx, value.str); + break; + + case format_part_t::kind::replacement: { + const auto& arg_id_value = value.repl.arg_id.val; + const auto arg = value.repl.arg_id.kind == arg_id_kind::index + ? ctx.arg(arg_id_value.index) + : ctx.arg(arg_id_value.name); + + auto specs = value.repl.specs; + + handle_dynamic_spec(specs.width, specs.width_ref, ctx); + handle_dynamic_spec(specs.precision, + specs.precision_ref, ctx); + + error_handler h; + numeric_specs_checker checker(h, arg.type()); + if (specs.align == align::numeric) checker.require_numeric_argument(); + if (specs.sign != sign::none) checker.check_sign(); + if (specs.alt) checker.require_numeric_argument(); + if (specs.precision >= 0) checker.check_precision(); + + advance_to(parse_ctx, part.arg_id_end); + ctx.advance_to( + visit_format_arg(arg_formatter(ctx, nullptr, &specs), arg)); + break; + } + } + } + return ctx.out(); +} +} // namespace cf + +struct basic_compiled_format {}; + +template +struct compiled_format_base : basic_compiled_format { + using char_type = char_t; + using parts_container = std::vector>; + + parts_container compiled_parts; + + explicit compiled_format_base(basic_string_view format_str) { + compile_format_string(format_str, + [this](const format_part& part) { + compiled_parts.push_back(part); + }); + } + + const parts_container& parts() const { return compiled_parts; } +}; + +template struct format_part_array { + format_part data[N] = {}; + FMT_CONSTEXPR format_part_array() = default; +}; + +template +FMT_CONSTEXPR format_part_array compile_to_parts( + basic_string_view format_str) { + format_part_array parts; + unsigned counter = 0; + // This is not a lambda for compatibility with older compilers. + struct { + format_part* parts; + unsigned* counter; + FMT_CONSTEXPR void operator()(const format_part& part) { + parts[(*counter)++] = part; + } + } collector{parts.data, &counter}; + compile_format_string(format_str, collector); + if (counter < N) { + parts.data[counter] = + format_part::make_text(basic_string_view()); + } + return parts; +} + +template constexpr const T& constexpr_max(const T& a, const T& b) { + return (a < b) ? b : a; +} + +template +struct compiled_format_base::value>> + : basic_compiled_format { + using char_type = char_t; + + FMT_CONSTEXPR explicit compiled_format_base(basic_string_view) {} + +// Workaround for old compilers. Format string compilation will not be +// performed there anyway. +#if FMT_USE_CONSTEXPR + static FMT_CONSTEXPR_DECL const unsigned num_format_parts = + constexpr_max(count_parts(to_string_view(S())), 1u); +#else + static const unsigned num_format_parts = 1; +#endif + + using parts_container = format_part[num_format_parts]; + + const parts_container& parts() const { + static FMT_CONSTEXPR_DECL const auto compiled_parts = + compile_to_parts( + internal::to_string_view(S())); + return compiled_parts.data; + } +}; + +template +class compiled_format : private compiled_format_base { + public: + using typename compiled_format_base::char_type; + + private: + basic_string_view format_str_; + + template + friend auto cf::vformat_to(Range out, CompiledFormat& cf, + basic_format_args args) -> + typename Context::iterator; + + public: + compiled_format() = delete; + explicit constexpr compiled_format(basic_string_view format_str) + : compiled_format_base(format_str), format_str_(format_str) {} +}; + +#ifdef __cpp_if_constexpr +template struct type_list {}; + +// Returns a reference to the argument at index N from [first, rest...]. +template +constexpr const auto& get(const T& first, const Args&... rest) { + static_assert(N < 1 + sizeof...(Args), "index is out of bounds"); + if constexpr (N == 0) + return first; + else + return get(rest...); +} + +template struct get_type_impl; + +template struct get_type_impl> { + using type = remove_cvref_t(std::declval()...))>; +}; + +template +using get_type = typename get_type_impl::type; + +template struct is_compiled_format : std::false_type {}; + +template struct text { + basic_string_view data; + using char_type = Char; + + template + OutputIt format(OutputIt out, const Args&...) const { + // TODO: reserve + return copy_str(data.begin(), data.end(), out); + } +}; + +template +struct is_compiled_format> : std::true_type {}; + +template +constexpr text make_text(basic_string_view s, size_t pos, + size_t size) { + return {{&s[pos], size}}; +} + +template , int> = 0> +OutputIt format_default(OutputIt out, T value) { + // TODO: reserve + format_int fi(value); + return std::copy(fi.data(), fi.data() + fi.size(), out); +} + +template +OutputIt format_default(OutputIt out, double value) { + writer w(out); + w.write(value); + return w.out(); +} + +template +OutputIt format_default(OutputIt out, Char value) { + *out++ = value; + return out; +} + +template +OutputIt format_default(OutputIt out, const Char* value) { + auto length = std::char_traits::length(value); + return copy_str(value, value + length, out); +} + +// A replacement field that refers to argument N. +template struct field { + using char_type = Char; + + template + OutputIt format(OutputIt out, const Args&... args) const { + // This ensures that the argument type is convertile to `const T&`. + const T& arg = get(args...); + return format_default(out, arg); + } +}; + +template +struct is_compiled_format> : std::true_type {}; + +template struct concat { + L lhs; + R rhs; + using char_type = typename L::char_type; + + template + OutputIt format(OutputIt out, const Args&... args) const { + out = lhs.format(out, args...); + return rhs.format(out, args...); + } +}; + +template +struct is_compiled_format> : std::true_type {}; + +template +constexpr concat make_concat(L lhs, R rhs) { + return {lhs, rhs}; +} + +struct unknown_format {}; + +template +constexpr size_t parse_text(basic_string_view str, size_t pos) { + for (size_t size = str.size(); pos != size; ++pos) { + if (str[pos] == '{' || str[pos] == '}') break; + } + return pos; +} + +template +constexpr auto compile_format_string(S format_str); + +template +constexpr auto parse_tail(T head, S format_str) { + if constexpr (POS != to_string_view(format_str).size()) { + constexpr auto tail = compile_format_string(format_str); + if constexpr (std::is_same, + unknown_format>()) + return tail; + else + return make_concat(head, tail); + } else { + return head; + } +} + +// Compiles a non-empty format string and returns the compiled representation +// or unknown_format() on unrecognized input. +template +constexpr auto compile_format_string(S format_str) { + using char_type = typename S::char_type; + constexpr basic_string_view str = format_str; + if constexpr (str[POS] == '{') { + if (POS + 1 == str.size()) + throw format_error("unmatched '{' in format string"); + if constexpr (str[POS + 1] == '{') { + return parse_tail(make_text(str, POS, 1), format_str); + } else if constexpr (str[POS + 1] == '}') { + using type = get_type; + if constexpr (std::is_same::value) { + return parse_tail(field(), + format_str); + } else { + return unknown_format(); + } + } else { + return unknown_format(); + } + } else if constexpr (str[POS] == '}') { + if (POS + 1 == str.size()) + throw format_error("unmatched '}' in format string"); + return parse_tail(make_text(str, POS, 1), format_str); + } else { + constexpr auto end = parse_text(str, POS + 1); + return parse_tail(make_text(str, POS, end - POS), + format_str); + } +} +#endif // __cpp_if_constexpr +} // namespace internal + +#if FMT_USE_CONSTEXPR +# ifdef __cpp_if_constexpr +template ::value)> +constexpr auto compile(S format_str) { + constexpr basic_string_view str = format_str; + if constexpr (str.size() == 0) { + return internal::make_text(str, 0, 0); + } else { + constexpr auto result = + internal::compile_format_string, 0, 0>( + format_str); + if constexpr (std::is_same, + internal::unknown_format>()) { + return internal::compiled_format(to_string_view(format_str)); + } else { + return result; + } + } +} + +template ::value)> +std::basic_string format(const CompiledFormat& cf, const Args&... args) { + basic_memory_buffer buffer; + cf.format(std::back_inserter(buffer), args...); + return to_string(buffer); +} + +template ::value)> +OutputIt format_to(OutputIt out, const CompiledFormat& cf, + const Args&... args) { + return cf.format(out, args...); +} +# else +template ::value)> +constexpr auto compile(S format_str) -> internal::compiled_format { + return internal::compiled_format(to_string_view(format_str)); +} +# endif // __cpp_if_constexpr +#endif // FMT_USE_CONSTEXPR + +// Compiles the format string which must be a string literal. +template +auto compile(const Char (&format_str)[N]) + -> internal::compiled_format { + return internal::compiled_format( + basic_string_view(format_str, N - 1)); +} + +template ::value)> +std::basic_string format(const CompiledFormat& cf, const Args&... args) { + basic_memory_buffer buffer; + using range = buffer_range; + using context = buffer_context; + internal::cf::vformat_to(range(buffer), cf, + make_format_args(args...)); + return to_string(buffer); +} + +template ::value)> +OutputIt format_to(OutputIt out, const CompiledFormat& cf, + const Args&... args) { + using char_type = typename CompiledFormat::char_type; + using range = internal::output_range; + using context = format_context_t; + return internal::cf::vformat_to(range(out), cf, + make_format_args(args...)); +} + +template ::value)> +format_to_n_result format_to_n(OutputIt out, size_t n, + const CompiledFormat& cf, + const Args&... args) { + auto it = + format_to(internal::truncating_iterator(out, n), cf, args...); + return {it.base(), it.count()}; +} + +template +std::size_t formatted_size(const CompiledFormat& cf, const Args&... args) { + return format_to(internal::counting_iterator(), cf, args...).count(); +} + +FMT_END_NAMESPACE + +#endif // FMT_COMPILE_H_ diff --git a/packages/sqdlog.1.0.0/lib/native/include/spdlog/fmt/bundled/core.h b/packages/sqdlog.1.0.0/lib/native/include/spdlog/fmt/bundled/core.h new file mode 100644 index 0000000..6df2875 --- /dev/null +++ b/packages/sqdlog.1.0.0/lib/native/include/spdlog/fmt/bundled/core.h @@ -0,0 +1,1789 @@ +// Formatting library for C++ - the core API +// +// Copyright (c) 2012 - present, Victor Zverovich +// All rights reserved. +// +// For the license information refer to format.h. + +#ifndef FMT_CORE_H_ +#define FMT_CORE_H_ + +#include // std::FILE +#include +#include +#include +#include +#include +#include +#include + +// The fmt library version in the form major * 10000 + minor * 100 + patch. +#define FMT_VERSION 60200 + +#ifdef __has_feature +# define FMT_HAS_FEATURE(x) __has_feature(x) +#else +# define FMT_HAS_FEATURE(x) 0 +#endif + +#if defined(__has_include) && !defined(__INTELLISENSE__) && \ + !(defined(__INTEL_COMPILER) && __INTEL_COMPILER < 1600) +# define FMT_HAS_INCLUDE(x) __has_include(x) +#else +# define FMT_HAS_INCLUDE(x) 0 +#endif + +#ifdef __has_cpp_attribute +# define FMT_HAS_CPP_ATTRIBUTE(x) __has_cpp_attribute(x) +#else +# define FMT_HAS_CPP_ATTRIBUTE(x) 0 +#endif + +#define FMT_HAS_CPP14_ATTRIBUTE(attribute) \ + (__cplusplus >= 201402L && FMT_HAS_CPP_ATTRIBUTE(attribute)) + +#define FMT_HAS_CPP17_ATTRIBUTE(attribute) \ + (__cplusplus >= 201703L && FMT_HAS_CPP_ATTRIBUTE(attribute)) + +#ifdef __clang__ +# define FMT_CLANG_VERSION (__clang_major__ * 100 + __clang_minor__) +#else +# define FMT_CLANG_VERSION 0 +#endif + +#if defined(__GNUC__) && !defined(__clang__) +# define FMT_GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__) +#else +# define FMT_GCC_VERSION 0 +#endif + +#if __cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X__) +# define FMT_HAS_GXX_CXX11 FMT_GCC_VERSION +#else +# define FMT_HAS_GXX_CXX11 0 +#endif + +#ifdef __NVCC__ +# define FMT_NVCC __NVCC__ +#else +# define FMT_NVCC 0 +#endif + +#ifdef _MSC_VER +# define FMT_MSC_VER _MSC_VER +#else +# define FMT_MSC_VER 0 +#endif + +// Check if relaxed C++14 constexpr is supported. +// GCC doesn't allow throw in constexpr until version 6 (bug 67371). +#ifndef FMT_USE_CONSTEXPR +# define FMT_USE_CONSTEXPR \ + (FMT_HAS_FEATURE(cxx_relaxed_constexpr) || FMT_MSC_VER >= 1910 || \ + (FMT_GCC_VERSION >= 600 && __cplusplus >= 201402L)) && \ + !FMT_NVCC +#endif +#if FMT_USE_CONSTEXPR +# define FMT_CONSTEXPR constexpr +# define FMT_CONSTEXPR_DECL constexpr +#else +# define FMT_CONSTEXPR inline +# define FMT_CONSTEXPR_DECL +#endif + +#ifndef FMT_OVERRIDE +# if FMT_HAS_FEATURE(cxx_override) || \ + (FMT_GCC_VERSION >= 408 && FMT_HAS_GXX_CXX11) || FMT_MSC_VER >= 1900 +# define FMT_OVERRIDE override +# else +# define FMT_OVERRIDE +# endif +#endif + +// Check if exceptions are disabled. +#ifndef FMT_EXCEPTIONS +# if (defined(__GNUC__) && !defined(__EXCEPTIONS)) || \ + FMT_MSC_VER && !_HAS_EXCEPTIONS +# define FMT_EXCEPTIONS 0 +# else +# define FMT_EXCEPTIONS 1 +# endif +#endif + +// Define FMT_USE_NOEXCEPT to make fmt use noexcept (C++11 feature). +#ifndef FMT_USE_NOEXCEPT +# define FMT_USE_NOEXCEPT 0 +#endif + +#if FMT_USE_NOEXCEPT || FMT_HAS_FEATURE(cxx_noexcept) || \ + (FMT_GCC_VERSION >= 408 && FMT_HAS_GXX_CXX11) || FMT_MSC_VER >= 1900 +# define FMT_DETECTED_NOEXCEPT noexcept +# define FMT_HAS_CXX11_NOEXCEPT 1 +#else +# define FMT_DETECTED_NOEXCEPT throw() +# define FMT_HAS_CXX11_NOEXCEPT 0 +#endif + +#ifndef FMT_NOEXCEPT +# if FMT_EXCEPTIONS || FMT_HAS_CXX11_NOEXCEPT +# define FMT_NOEXCEPT FMT_DETECTED_NOEXCEPT +# else +# define FMT_NOEXCEPT +# endif +#endif + +// [[noreturn]] is disabled on MSVC and NVCC because of bogus unreachable code +// warnings. +#if FMT_EXCEPTIONS && FMT_HAS_CPP_ATTRIBUTE(noreturn) && !FMT_MSC_VER && \ + !FMT_NVCC +# define FMT_NORETURN [[noreturn]] +#else +# define FMT_NORETURN +#endif + +#ifndef FMT_MAYBE_UNUSED +# if FMT_HAS_CPP17_ATTRIBUTE(maybe_unused) +# define FMT_MAYBE_UNUSED [[maybe_unused]] +# else +# define FMT_MAYBE_UNUSED +# endif +#endif + +#ifndef FMT_DEPRECATED +# if FMT_HAS_CPP14_ATTRIBUTE(deprecated) || FMT_MSC_VER >= 1900 +# define FMT_DEPRECATED [[deprecated]] +# else +# if defined(__GNUC__) || defined(__clang__) +# define FMT_DEPRECATED __attribute__((deprecated)) +# elif FMT_MSC_VER +# define FMT_DEPRECATED __declspec(deprecated) +# else +# define FMT_DEPRECATED /* deprecated */ +# endif +# endif +#endif + +// Workaround broken [[deprecated]] in the Intel, PGI and NVCC compilers. +#if defined(__INTEL_COMPILER) || defined(__PGI) || FMT_NVCC +# define FMT_DEPRECATED_ALIAS +#else +# define FMT_DEPRECATED_ALIAS FMT_DEPRECATED +#endif + +#ifndef FMT_BEGIN_NAMESPACE +# if FMT_HAS_FEATURE(cxx_inline_namespaces) || FMT_GCC_VERSION >= 404 || \ + FMT_MSC_VER >= 1900 +# define FMT_INLINE_NAMESPACE inline namespace +# define FMT_END_NAMESPACE \ + } \ + } +# else +# define FMT_INLINE_NAMESPACE namespace +# define FMT_END_NAMESPACE \ + } \ + using namespace v6; \ + } +# endif +# define FMT_BEGIN_NAMESPACE \ + namespace fmt { \ + FMT_INLINE_NAMESPACE v6 { +#endif + +#if !defined(FMT_HEADER_ONLY) && defined(_WIN32) +# if FMT_MSC_VER +# define FMT_NO_W4275 __pragma(warning(suppress : 4275)) +# else +# define FMT_NO_W4275 +# endif +# define FMT_CLASS_API FMT_NO_W4275 +# ifdef FMT_EXPORT +# define FMT_API __declspec(dllexport) +# elif defined(FMT_SHARED) +# define FMT_API __declspec(dllimport) +# define FMT_EXTERN_TEMPLATE_API FMT_API +# endif +#endif +#ifndef FMT_CLASS_API +# define FMT_CLASS_API +#endif +#ifndef FMT_API +# if FMT_GCC_VERSION || FMT_CLANG_VERSION +# define FMT_API __attribute__((visibility("default"))) +# define FMT_EXTERN_TEMPLATE_API FMT_API +# define FMT_INSTANTIATION_DEF_API +# else +# define FMT_API +# endif +#endif +#ifndef FMT_EXTERN_TEMPLATE_API +# define FMT_EXTERN_TEMPLATE_API +#endif +#ifndef FMT_INSTANTIATION_DEF_API +# define FMT_INSTANTIATION_DEF_API FMT_API +#endif + +#ifndef FMT_HEADER_ONLY +# define FMT_EXTERN extern +#else +# define FMT_EXTERN +#endif + +// libc++ supports string_view in pre-c++17. +#if (FMT_HAS_INCLUDE() && \ + (__cplusplus > 201402L || defined(_LIBCPP_VERSION))) || \ + (defined(_MSVC_LANG) && _MSVC_LANG > 201402L && _MSC_VER >= 1910) +# include +# define FMT_USE_STRING_VIEW +#elif FMT_HAS_INCLUDE("experimental/string_view") && __cplusplus >= 201402L +# include +# define FMT_USE_EXPERIMENTAL_STRING_VIEW +#endif + +#ifndef FMT_UNICODE +# define FMT_UNICODE !FMT_MSC_VER +#endif +#if FMT_UNICODE && FMT_MSC_VER +# pragma execution_character_set("utf-8") +#endif + +FMT_BEGIN_NAMESPACE + +// Implementations of enable_if_t and other metafunctions for older systems. +template +using enable_if_t = typename std::enable_if::type; +template +using conditional_t = typename std::conditional::type; +template using bool_constant = std::integral_constant; +template +using remove_reference_t = typename std::remove_reference::type; +template +using remove_const_t = typename std::remove_const::type; +template +using remove_cvref_t = typename std::remove_cv>::type; +template struct type_identity { using type = T; }; +template using type_identity_t = typename type_identity::type; + +struct monostate {}; + +// An enable_if helper to be used in template parameters which results in much +// shorter symbols: https://godbolt.org/z/sWw4vP. Extra parentheses are needed +// to workaround a bug in MSVC 2019 (see #1140 and #1186). +#define FMT_ENABLE_IF(...) enable_if_t<(__VA_ARGS__), int> = 0 + +namespace internal { + +// A helper function to suppress bogus "conditional expression is constant" +// warnings. +template FMT_CONSTEXPR T const_check(T value) { return value; } + +// A workaround for gcc 4.8 to make void_t work in a SFINAE context. +template struct void_t_impl { using type = void; }; + +FMT_NORETURN FMT_API void assert_fail(const char* file, int line, + const char* message); + +#ifndef FMT_ASSERT +# ifdef NDEBUG +// FMT_ASSERT is not empty to avoid -Werror=empty-body. +# define FMT_ASSERT(condition, message) ((void)0) +# else +# define FMT_ASSERT(condition, message) \ + ((condition) /* void() fails with -Winvalid-constexpr on clang 4.0.1 */ \ + ? (void)0 \ + : ::fmt::internal::assert_fail(__FILE__, __LINE__, (message))) +# endif +#endif + +#if defined(FMT_USE_STRING_VIEW) +template using std_string_view = std::basic_string_view; +#elif defined(FMT_USE_EXPERIMENTAL_STRING_VIEW) +template +using std_string_view = std::experimental::basic_string_view; +#else +template struct std_string_view {}; +#endif + +#ifdef FMT_USE_INT128 +// Do nothing. +#elif defined(__SIZEOF_INT128__) && !FMT_NVCC +# define FMT_USE_INT128 1 +using int128_t = __int128_t; +using uint128_t = __uint128_t; +#else +# define FMT_USE_INT128 0 +#endif +#if !FMT_USE_INT128 +struct int128_t {}; +struct uint128_t {}; +#endif + +// Casts a nonnegative integer to unsigned. +template +FMT_CONSTEXPR typename std::make_unsigned::type to_unsigned(Int value) { + FMT_ASSERT(value >= 0, "negative value"); + return static_cast::type>(value); +} + +constexpr unsigned char micro[] = "\u00B5"; + +template constexpr bool is_unicode() { + return FMT_UNICODE || sizeof(Char) != 1 || + (sizeof(micro) == 3 && micro[0] == 0xC2 && micro[1] == 0xB5); +} + +#ifdef __cpp_char8_t +using char8_type = char8_t; +#else +enum char8_type : unsigned char {}; +#endif +} // namespace internal + +template +using void_t = typename internal::void_t_impl::type; + +/** + An implementation of ``std::basic_string_view`` for pre-C++17. It provides a + subset of the API. ``fmt::basic_string_view`` is used for format strings even + if ``std::string_view`` is available to prevent issues when a library is + compiled with a different ``-std`` option than the client code (which is not + recommended). + */ +template class basic_string_view { + private: + const Char* data_; + size_t size_; + + public: + using char_type FMT_DEPRECATED_ALIAS = Char; + using value_type = Char; + using iterator = const Char*; + + FMT_CONSTEXPR basic_string_view() FMT_NOEXCEPT : data_(nullptr), size_(0) {} + + /** Constructs a string reference object from a C string and a size. */ + FMT_CONSTEXPR basic_string_view(const Char* s, size_t count) FMT_NOEXCEPT + : data_(s), + size_(count) {} + + /** + \rst + Constructs a string reference object from a C string computing + the size with ``std::char_traits::length``. + \endrst + */ +#if __cplusplus >= 201703L // C++17's char_traits::length() is constexpr. + FMT_CONSTEXPR +#endif + basic_string_view(const Char* s) + : data_(s), size_(std::char_traits::length(s)) {} + + /** Constructs a string reference from a ``std::basic_string`` object. */ + template + FMT_CONSTEXPR basic_string_view( + const std::basic_string& s) FMT_NOEXCEPT + : data_(s.data()), + size_(s.size()) {} + + template < + typename S, + FMT_ENABLE_IF(std::is_same>::value)> + FMT_CONSTEXPR basic_string_view(S s) FMT_NOEXCEPT : data_(s.data()), + size_(s.size()) {} + + /** Returns a pointer to the string data. */ + FMT_CONSTEXPR const Char* data() const { return data_; } + + /** Returns the string size. */ + FMT_CONSTEXPR size_t size() const { return size_; } + + FMT_CONSTEXPR iterator begin() const { return data_; } + FMT_CONSTEXPR iterator end() const { return data_ + size_; } + + FMT_CONSTEXPR const Char& operator[](size_t pos) const { return data_[pos]; } + + FMT_CONSTEXPR void remove_prefix(size_t n) { + data_ += n; + size_ -= n; + } + + // Lexicographically compare this string reference to other. + int compare(basic_string_view other) const { + size_t str_size = size_ < other.size_ ? size_ : other.size_; + int result = std::char_traits::compare(data_, other.data_, str_size); + if (result == 0) + result = size_ == other.size_ ? 0 : (size_ < other.size_ ? -1 : 1); + return result; + } + + friend bool operator==(basic_string_view lhs, basic_string_view rhs) { + return lhs.compare(rhs) == 0; + } + friend bool operator!=(basic_string_view lhs, basic_string_view rhs) { + return lhs.compare(rhs) != 0; + } + friend bool operator<(basic_string_view lhs, basic_string_view rhs) { + return lhs.compare(rhs) < 0; + } + friend bool operator<=(basic_string_view lhs, basic_string_view rhs) { + return lhs.compare(rhs) <= 0; + } + friend bool operator>(basic_string_view lhs, basic_string_view rhs) { + return lhs.compare(rhs) > 0; + } + friend bool operator>=(basic_string_view lhs, basic_string_view rhs) { + return lhs.compare(rhs) >= 0; + } +}; + +using string_view = basic_string_view; +using wstring_view = basic_string_view; + +#ifndef __cpp_char8_t +// char8_t is deprecated; use char instead. +using char8_t FMT_DEPRECATED_ALIAS = internal::char8_type; +#endif + +/** Specifies if ``T`` is a character type. Can be specialized by users. */ +template struct is_char : std::false_type {}; +template <> struct is_char : std::true_type {}; +template <> struct is_char : std::true_type {}; +template <> struct is_char : std::true_type {}; +template <> struct is_char : std::true_type {}; +template <> struct is_char : std::true_type {}; + +/** + \rst + Returns a string view of `s`. In order to add custom string type support to + {fmt} provide an overload of `to_string_view` for it in the same namespace as + the type for the argument-dependent lookup to work. + + **Example**:: + + namespace my_ns { + inline string_view to_string_view(const my_string& s) { + return {s.data(), s.length()}; + } + } + std::string message = fmt::format(my_string("The answer is {}"), 42); + \endrst + */ +template ::value)> +inline basic_string_view to_string_view(const Char* s) { + return s; +} + +template +inline basic_string_view to_string_view( + const std::basic_string& s) { + return s; +} + +template +inline basic_string_view to_string_view(basic_string_view s) { + return s; +} + +template >::value)> +inline basic_string_view to_string_view( + internal::std_string_view s) { + return s; +} + +// A base class for compile-time strings. It is defined in the fmt namespace to +// make formatting functions visible via ADL, e.g. format(fmt("{}"), 42). +struct compile_string {}; + +template +struct is_compile_string : std::is_base_of {}; + +template ::value)> +constexpr basic_string_view to_string_view(const S& s) { + return s; +} + +namespace internal { +void to_string_view(...); +using fmt::v6::to_string_view; + +// Specifies whether S is a string type convertible to fmt::basic_string_view. +// It should be a constexpr function but MSVC 2017 fails to compile it in +// enable_if and MSVC 2015 fails to compile it as an alias template. +template +struct is_string : std::is_class()))> { +}; + +template struct char_t_impl {}; +template struct char_t_impl::value>> { + using result = decltype(to_string_view(std::declval())); + using type = typename result::value_type; +}; + +struct error_handler { + FMT_CONSTEXPR error_handler() = default; + FMT_CONSTEXPR error_handler(const error_handler&) = default; + + // This function is intentionally not constexpr to give a compile-time error. + FMT_NORETURN FMT_API void on_error(const char* message); +}; +} // namespace internal + +/** String's character type. */ +template using char_t = typename internal::char_t_impl::type; + +/** + \rst + Parsing context consisting of a format string range being parsed and an + argument counter for automatic indexing. + + You can use one of the following type aliases for common character types: + + +-----------------------+-------------------------------------+ + | Type | Definition | + +=======================+=====================================+ + | format_parse_context | basic_format_parse_context | + +-----------------------+-------------------------------------+ + | wformat_parse_context | basic_format_parse_context | + +-----------------------+-------------------------------------+ + \endrst + */ +template +class basic_format_parse_context : private ErrorHandler { + private: + basic_string_view format_str_; + int next_arg_id_; + + public: + using char_type = Char; + using iterator = typename basic_string_view::iterator; + + explicit FMT_CONSTEXPR basic_format_parse_context( + basic_string_view format_str, ErrorHandler eh = ErrorHandler()) + : ErrorHandler(eh), format_str_(format_str), next_arg_id_(0) {} + + /** + Returns an iterator to the beginning of the format string range being + parsed. + */ + FMT_CONSTEXPR iterator begin() const FMT_NOEXCEPT { + return format_str_.begin(); + } + + /** + Returns an iterator past the end of the format string range being parsed. + */ + FMT_CONSTEXPR iterator end() const FMT_NOEXCEPT { return format_str_.end(); } + + /** Advances the begin iterator to ``it``. */ + FMT_CONSTEXPR void advance_to(iterator it) { + format_str_.remove_prefix(internal::to_unsigned(it - begin())); + } + + /** + Reports an error if using the manual argument indexing; otherwise returns + the next argument index and switches to the automatic indexing. + */ + FMT_CONSTEXPR int next_arg_id() { + if (next_arg_id_ >= 0) return next_arg_id_++; + on_error("cannot switch from manual to automatic argument indexing"); + return 0; + } + + /** + Reports an error if using the automatic argument indexing; otherwise + switches to the manual indexing. + */ + FMT_CONSTEXPR void check_arg_id(int) { + if (next_arg_id_ > 0) + on_error("cannot switch from automatic to manual argument indexing"); + else + next_arg_id_ = -1; + } + + FMT_CONSTEXPR void check_arg_id(basic_string_view) {} + + FMT_CONSTEXPR void on_error(const char* message) { + ErrorHandler::on_error(message); + } + + FMT_CONSTEXPR ErrorHandler error_handler() const { return *this; } +}; + +using format_parse_context = basic_format_parse_context; +using wformat_parse_context = basic_format_parse_context; + +template +using basic_parse_context FMT_DEPRECATED_ALIAS = + basic_format_parse_context; +using parse_context FMT_DEPRECATED_ALIAS = basic_format_parse_context; +using wparse_context FMT_DEPRECATED_ALIAS = basic_format_parse_context; + +template class basic_format_arg; +template class basic_format_args; + +// A formatter for objects of type T. +template +struct formatter { + // A deleted default constructor indicates a disabled formatter. + formatter() = delete; +}; + +template +struct FMT_DEPRECATED convert_to_int + : bool_constant::value && + std::is_convertible::value> {}; + +// Specifies if T has an enabled formatter specialization. A type can be +// formattable even if it doesn't have a formatter e.g. via a conversion. +template +using has_formatter = + std::is_constructible>; + +namespace internal { + +/** A contiguous memory buffer with an optional growing ability. */ +template class buffer { + private: + T* ptr_; + std::size_t size_; + std::size_t capacity_; + + protected: + // Don't initialize ptr_ since it is not accessed to save a few cycles. + buffer(std::size_t sz) FMT_NOEXCEPT : size_(sz), capacity_(sz) {} + + buffer(T* p = nullptr, std::size_t sz = 0, std::size_t cap = 0) FMT_NOEXCEPT + : ptr_(p), + size_(sz), + capacity_(cap) {} + + /** Sets the buffer data and capacity. */ + void set(T* buf_data, std::size_t buf_capacity) FMT_NOEXCEPT { + ptr_ = buf_data; + capacity_ = buf_capacity; + } + + /** Increases the buffer capacity to hold at least *capacity* elements. */ + virtual void grow(std::size_t capacity) = 0; + + public: + using value_type = T; + using const_reference = const T&; + + buffer(const buffer&) = delete; + void operator=(const buffer&) = delete; + virtual ~buffer() = default; + + T* begin() FMT_NOEXCEPT { return ptr_; } + T* end() FMT_NOEXCEPT { return ptr_ + size_; } + + const T* begin() const FMT_NOEXCEPT { return ptr_; } + const T* end() const FMT_NOEXCEPT { return ptr_ + size_; } + + /** Returns the size of this buffer. */ + std::size_t size() const FMT_NOEXCEPT { return size_; } + + /** Returns the capacity of this buffer. */ + std::size_t capacity() const FMT_NOEXCEPT { return capacity_; } + + /** Returns a pointer to the buffer data. */ + T* data() FMT_NOEXCEPT { return ptr_; } + + /** Returns a pointer to the buffer data. */ + const T* data() const FMT_NOEXCEPT { return ptr_; } + + /** + Resizes the buffer. If T is a POD type new elements may not be initialized. + */ + void resize(std::size_t new_size) { + reserve(new_size); + size_ = new_size; + } + + /** Clears this buffer. */ + void clear() { size_ = 0; } + + /** Reserves space to store at least *capacity* elements. */ + void reserve(std::size_t new_capacity) { + if (new_capacity > capacity_) grow(new_capacity); + } + + void push_back(const T& value) { + reserve(size_ + 1); + ptr_[size_++] = value; + } + + /** Appends data to the end of the buffer. */ + template void append(const U* begin, const U* end); + + template T& operator[](I index) { return ptr_[index]; } + template const T& operator[](I index) const { + return ptr_[index]; + } +}; + +// A container-backed buffer. +template +class container_buffer : public buffer { + private: + Container& container_; + + protected: + void grow(std::size_t capacity) FMT_OVERRIDE { + container_.resize(capacity); + this->set(&container_[0], capacity); + } + + public: + explicit container_buffer(Container& c) + : buffer(c.size()), container_(c) {} +}; + +// Extracts a reference to the container from back_insert_iterator. +template +inline Container& get_container(std::back_insert_iterator it) { + using bi_iterator = std::back_insert_iterator; + struct accessor : bi_iterator { + accessor(bi_iterator iter) : bi_iterator(iter) {} + using bi_iterator::container; + }; + return *accessor(it).container; +} + +template +struct fallback_formatter { + fallback_formatter() = delete; +}; + +// Specifies if T has an enabled fallback_formatter specialization. +template +using has_fallback_formatter = + std::is_constructible>; + +template struct named_arg_base; +template struct named_arg; + +enum class type { + none_type, + named_arg_type, + // Integer types should go first, + int_type, + uint_type, + long_long_type, + ulong_long_type, + int128_type, + uint128_type, + bool_type, + char_type, + last_integer_type = char_type, + // followed by floating-point types. + float_type, + double_type, + long_double_type, + last_numeric_type = long_double_type, + cstring_type, + string_type, + pointer_type, + custom_type +}; + +// Maps core type T to the corresponding type enum constant. +template +struct type_constant : std::integral_constant {}; + +#define FMT_TYPE_CONSTANT(Type, constant) \ + template \ + struct type_constant \ + : std::integral_constant {} + +FMT_TYPE_CONSTANT(const named_arg_base&, named_arg_type); +FMT_TYPE_CONSTANT(int, int_type); +FMT_TYPE_CONSTANT(unsigned, uint_type); +FMT_TYPE_CONSTANT(long long, long_long_type); +FMT_TYPE_CONSTANT(unsigned long long, ulong_long_type); +FMT_TYPE_CONSTANT(int128_t, int128_type); +FMT_TYPE_CONSTANT(uint128_t, uint128_type); +FMT_TYPE_CONSTANT(bool, bool_type); +FMT_TYPE_CONSTANT(Char, char_type); +FMT_TYPE_CONSTANT(float, float_type); +FMT_TYPE_CONSTANT(double, double_type); +FMT_TYPE_CONSTANT(long double, long_double_type); +FMT_TYPE_CONSTANT(const Char*, cstring_type); +FMT_TYPE_CONSTANT(basic_string_view, string_type); +FMT_TYPE_CONSTANT(const void*, pointer_type); + +FMT_CONSTEXPR bool is_integral_type(type t) { + FMT_ASSERT(t != type::named_arg_type, "invalid argument type"); + return t > type::none_type && t <= type::last_integer_type; +} + +FMT_CONSTEXPR bool is_arithmetic_type(type t) { + FMT_ASSERT(t != type::named_arg_type, "invalid argument type"); + return t > type::none_type && t <= type::last_numeric_type; +} + +template struct string_value { + const Char* data; + std::size_t size; +}; + +template struct custom_value { + using parse_context = basic_format_parse_context; + const void* value; + void (*format)(const void* arg, parse_context& parse_ctx, Context& ctx); +}; + +// A formatting argument value. +template class value { + public: + using char_type = typename Context::char_type; + + union { + int int_value; + unsigned uint_value; + long long long_long_value; + unsigned long long ulong_long_value; + int128_t int128_value; + uint128_t uint128_value; + bool bool_value; + char_type char_value; + float float_value; + double double_value; + long double long_double_value; + const void* pointer; + string_value string; + custom_value custom; + const named_arg_base* named_arg; + }; + + FMT_CONSTEXPR value(int val = 0) : int_value(val) {} + FMT_CONSTEXPR value(unsigned val) : uint_value(val) {} + value(long long val) : long_long_value(val) {} + value(unsigned long long val) : ulong_long_value(val) {} + value(int128_t val) : int128_value(val) {} + value(uint128_t val) : uint128_value(val) {} + value(float val) : float_value(val) {} + value(double val) : double_value(val) {} + value(long double val) : long_double_value(val) {} + value(bool val) : bool_value(val) {} + value(char_type val) : char_value(val) {} + value(const char_type* val) { string.data = val; } + value(basic_string_view val) { + string.data = val.data(); + string.size = val.size(); + } + value(const void* val) : pointer(val) {} + + template value(const T& val) { + custom.value = &val; + // Get the formatter type through the context to allow different contexts + // have different extension points, e.g. `formatter` for `format` and + // `printf_formatter` for `printf`. + custom.format = format_custom_arg< + T, conditional_t::value, + typename Context::template formatter_type, + fallback_formatter>>; + } + + value(const named_arg_base& val) { named_arg = &val; } + + private: + // Formats an argument of a custom type, such as a user-defined class. + template + static void format_custom_arg( + const void* arg, basic_format_parse_context& parse_ctx, + Context& ctx) { + Formatter f; + parse_ctx.advance_to(f.parse(parse_ctx)); + ctx.advance_to(f.format(*static_cast(arg), ctx)); + } +}; + +template +FMT_CONSTEXPR basic_format_arg make_arg(const T& value); + +// To minimize the number of types we need to deal with, long is translated +// either to int or to long long depending on its size. +enum { long_short = sizeof(long) == sizeof(int) }; +using long_type = conditional_t; +using ulong_type = conditional_t; + +// Maps formatting arguments to core types. +template struct arg_mapper { + using char_type = typename Context::char_type; + + FMT_CONSTEXPR int map(signed char val) { return val; } + FMT_CONSTEXPR unsigned map(unsigned char val) { return val; } + FMT_CONSTEXPR int map(short val) { return val; } + FMT_CONSTEXPR unsigned map(unsigned short val) { return val; } + FMT_CONSTEXPR int map(int val) { return val; } + FMT_CONSTEXPR unsigned map(unsigned val) { return val; } + FMT_CONSTEXPR long_type map(long val) { return val; } + FMT_CONSTEXPR ulong_type map(unsigned long val) { return val; } + FMT_CONSTEXPR long long map(long long val) { return val; } + FMT_CONSTEXPR unsigned long long map(unsigned long long val) { return val; } + FMT_CONSTEXPR int128_t map(int128_t val) { return val; } + FMT_CONSTEXPR uint128_t map(uint128_t val) { return val; } + FMT_CONSTEXPR bool map(bool val) { return val; } + + template ::value)> + FMT_CONSTEXPR char_type map(T val) { + static_assert( + std::is_same::value || std::is_same::value, + "mixing character types is disallowed"); + return val; + } + + FMT_CONSTEXPR float map(float val) { return val; } + FMT_CONSTEXPR double map(double val) { return val; } + FMT_CONSTEXPR long double map(long double val) { return val; } + + FMT_CONSTEXPR const char_type* map(char_type* val) { return val; } + FMT_CONSTEXPR const char_type* map(const char_type* val) { return val; } + template ::value)> + FMT_CONSTEXPR basic_string_view map(const T& val) { + static_assert(std::is_same>::value, + "mixing character types is disallowed"); + return to_string_view(val); + } + template , T>::value && + !is_string::value && !has_formatter::value && + !has_fallback_formatter::value)> + FMT_CONSTEXPR basic_string_view map(const T& val) { + return basic_string_view(val); + } + template < + typename T, + FMT_ENABLE_IF( + std::is_constructible, T>::value && + !std::is_constructible, T>::value && + !is_string::value && !has_formatter::value && + !has_fallback_formatter::value)> + FMT_CONSTEXPR basic_string_view map(const T& val) { + return std_string_view(val); + } + FMT_CONSTEXPR const char* map(const signed char* val) { + static_assert(std::is_same::value, "invalid string type"); + return reinterpret_cast(val); + } + FMT_CONSTEXPR const char* map(const unsigned char* val) { + static_assert(std::is_same::value, "invalid string type"); + return reinterpret_cast(val); + } + + FMT_CONSTEXPR const void* map(void* val) { return val; } + FMT_CONSTEXPR const void* map(const void* val) { return val; } + FMT_CONSTEXPR const void* map(std::nullptr_t val) { return val; } + template FMT_CONSTEXPR int map(const T*) { + // Formatting of arbitrary pointers is disallowed. If you want to output + // a pointer cast it to "void *" or "const void *". In particular, this + // forbids formatting of "[const] volatile char *" which is printed as bool + // by iostreams. + static_assert(!sizeof(T), "formatting of non-void pointers is disallowed"); + return 0; + } + + template ::value && + !has_formatter::value && + !has_fallback_formatter::value)> + FMT_CONSTEXPR auto map(const T& val) + -> decltype(std::declval().map( + static_cast::type>(val))) { + return map(static_cast::type>(val)); + } + template ::value && !is_char::value && + (has_formatter::value || + has_fallback_formatter::value))> + FMT_CONSTEXPR const T& map(const T& val) { + return val; + } + + template + FMT_CONSTEXPR const named_arg_base& map( + const named_arg& val) { + auto arg = make_arg(val.value); + std::memcpy(val.data, &arg, sizeof(arg)); + return val; + } + + int map(...) { + constexpr bool formattable = sizeof(Context) == 0; + static_assert( + formattable, + "Cannot format argument. To make type T formattable provide a " + "formatter specialization: " + "https://fmt.dev/latest/api.html#formatting-user-defined-types"); + return 0; + } +}; + +// A type constant after applying arg_mapper. +template +using mapped_type_constant = + type_constant().map(std::declval())), + typename Context::char_type>; + +enum { packed_arg_bits = 5 }; +// Maximum number of arguments with packed types. +enum { max_packed_args = 63 / packed_arg_bits }; +enum : unsigned long long { is_unpacked_bit = 1ULL << 63 }; + +template class arg_map; +} // namespace internal + +// A formatting argument. It is a trivially copyable/constructible type to +// allow storage in basic_memory_buffer. +template class basic_format_arg { + private: + internal::value value_; + internal::type type_; + + template + friend FMT_CONSTEXPR basic_format_arg internal::make_arg( + const T& value); + + template + friend FMT_CONSTEXPR auto visit_format_arg(Visitor&& vis, + const basic_format_arg& arg) + -> decltype(vis(0)); + + friend class basic_format_args; + friend class internal::arg_map; + + using char_type = typename Context::char_type; + + public: + class handle { + public: + explicit handle(internal::custom_value custom) : custom_(custom) {} + + void format(basic_format_parse_context& parse_ctx, + Context& ctx) const { + custom_.format(custom_.value, parse_ctx, ctx); + } + + private: + internal::custom_value custom_; + }; + + FMT_CONSTEXPR basic_format_arg() : type_(internal::type::none_type) {} + + FMT_CONSTEXPR explicit operator bool() const FMT_NOEXCEPT { + return type_ != internal::type::none_type; + } + + internal::type type() const { return type_; } + + bool is_integral() const { return internal::is_integral_type(type_); } + bool is_arithmetic() const { return internal::is_arithmetic_type(type_); } +}; + +/** + \rst + Visits an argument dispatching to the appropriate visit method based on + the argument type. For example, if the argument type is ``double`` then + ``vis(value)`` will be called with the value of type ``double``. + \endrst + */ +template +FMT_CONSTEXPR auto visit_format_arg(Visitor&& vis, + const basic_format_arg& arg) + -> decltype(vis(0)) { + using char_type = typename Context::char_type; + switch (arg.type_) { + case internal::type::none_type: + break; + case internal::type::named_arg_type: + FMT_ASSERT(false, "invalid argument type"); + break; + case internal::type::int_type: + return vis(arg.value_.int_value); + case internal::type::uint_type: + return vis(arg.value_.uint_value); + case internal::type::long_long_type: + return vis(arg.value_.long_long_value); + case internal::type::ulong_long_type: + return vis(arg.value_.ulong_long_value); +#if FMT_USE_INT128 + case internal::type::int128_type: + return vis(arg.value_.int128_value); + case internal::type::uint128_type: + return vis(arg.value_.uint128_value); +#else + case internal::type::int128_type: + case internal::type::uint128_type: + break; +#endif + case internal::type::bool_type: + return vis(arg.value_.bool_value); + case internal::type::char_type: + return vis(arg.value_.char_value); + case internal::type::float_type: + return vis(arg.value_.float_value); + case internal::type::double_type: + return vis(arg.value_.double_value); + case internal::type::long_double_type: + return vis(arg.value_.long_double_value); + case internal::type::cstring_type: + return vis(arg.value_.string.data); + case internal::type::string_type: + return vis(basic_string_view(arg.value_.string.data, + arg.value_.string.size)); + case internal::type::pointer_type: + return vis(arg.value_.pointer); + case internal::type::custom_type: + return vis(typename basic_format_arg::handle(arg.value_.custom)); + } + return vis(monostate()); +} + +namespace internal { +// A map from argument names to their values for named arguments. +template class arg_map { + private: + using char_type = typename Context::char_type; + + struct entry { + basic_string_view name; + basic_format_arg arg; + }; + + entry* map_; + unsigned size_; + + void push_back(value val) { + const auto& named = *val.named_arg; + map_[size_] = {named.name, named.template deserialize()}; + ++size_; + } + + public: + arg_map(const arg_map&) = delete; + void operator=(const arg_map&) = delete; + arg_map() : map_(nullptr), size_(0) {} + void init(const basic_format_args& args); + ~arg_map() { delete[] map_; } + + basic_format_arg find(basic_string_view name) const { + // The list is unsorted, so just return the first matching name. + for (entry *it = map_, *end = map_ + size_; it != end; ++it) { + if (it->name == name) return it->arg; + } + return {}; + } +}; + +// A type-erased reference to an std::locale to avoid heavy include. +class locale_ref { + private: + const void* locale_; // A type-erased pointer to std::locale. + + public: + locale_ref() : locale_(nullptr) {} + template explicit locale_ref(const Locale& loc); + + explicit operator bool() const FMT_NOEXCEPT { return locale_ != nullptr; } + + template Locale get() const; +}; + +template constexpr unsigned long long encode_types() { return 0; } + +template +constexpr unsigned long long encode_types() { + return static_cast(mapped_type_constant::value) | + (encode_types() << packed_arg_bits); +} + +template +FMT_CONSTEXPR basic_format_arg make_arg(const T& value) { + basic_format_arg arg; + arg.type_ = mapped_type_constant::value; + arg.value_ = arg_mapper().map(value); + return arg; +} + +template +inline value make_arg(const T& val) { + return arg_mapper().map(val); +} + +template +inline basic_format_arg make_arg(const T& value) { + return make_arg(value); +} + +template struct is_reference_wrapper : std::false_type {}; + +template +struct is_reference_wrapper> : std::true_type {}; + +class dynamic_arg_list { + // Workaround for clang's -Wweak-vtables. Unlike for regular classes, for + // templates it doesn't complain about inability to deduce single translation + // unit for placing vtable. So storage_node_base is made a fake template. + template struct node { + virtual ~node() = default; + std::unique_ptr> next; + }; + + template struct typed_node : node<> { + T value; + + template + FMT_CONSTEXPR typed_node(const Arg& arg) : value(arg) {} + + template + FMT_CONSTEXPR typed_node(const basic_string_view& arg) + : value(arg.data(), arg.size()) {} + }; + + std::unique_ptr> head_; + + public: + template const T& push(const Arg& arg) { + auto node = std::unique_ptr>(new typed_node(arg)); + auto& value = node->value; + node->next = std::move(head_); + head_ = std::move(node); + return value; + } +}; +} // namespace internal + +// Formatting context. +template class basic_format_context { + public: + /** The character type for the output. */ + using char_type = Char; + + private: + OutputIt out_; + basic_format_args args_; + internal::arg_map map_; + internal::locale_ref loc_; + + public: + using iterator = OutputIt; + using format_arg = basic_format_arg; + template using formatter_type = formatter; + + basic_format_context(const basic_format_context&) = delete; + void operator=(const basic_format_context&) = delete; + /** + Constructs a ``basic_format_context`` object. References to the arguments are + stored in the object so make sure they have appropriate lifetimes. + */ + basic_format_context(OutputIt out, + basic_format_args ctx_args, + internal::locale_ref loc = internal::locale_ref()) + : out_(out), args_(ctx_args), loc_(loc) {} + + format_arg arg(int id) const { return args_.get(id); } + + // Checks if manual indexing is used and returns the argument with the + // specified name. + format_arg arg(basic_string_view name); + + internal::error_handler error_handler() { return {}; } + void on_error(const char* message) { error_handler().on_error(message); } + + // Returns an iterator to the beginning of the output range. + iterator out() { return out_; } + + // Advances the begin iterator to ``it``. + void advance_to(iterator it) { out_ = it; } + + internal::locale_ref locale() { return loc_; } +}; + +template +using buffer_context = + basic_format_context>, + Char>; +using format_context = buffer_context; +using wformat_context = buffer_context; + +/** + \rst + An array of references to arguments. It can be implicitly converted into + `~fmt::basic_format_args` for passing into type-erased formatting functions + such as `~fmt::vformat`. + \endrst + */ +template +class format_arg_store +#if FMT_GCC_VERSION && FMT_GCC_VERSION < 409 + // Workaround a GCC template argument substitution bug. + : public basic_format_args +#endif +{ + private: + static const size_t num_args = sizeof...(Args); + static const bool is_packed = num_args < internal::max_packed_args; + + using value_type = conditional_t, + basic_format_arg>; + + // If the arguments are not packed, add one more element to mark the end. + value_type data_[num_args + (num_args == 0 ? 1 : 0)]; + + friend class basic_format_args; + + public: + static constexpr unsigned long long types = + is_packed ? internal::encode_types() + : internal::is_unpacked_bit | num_args; + + format_arg_store(const Args&... args) + : +#if FMT_GCC_VERSION && FMT_GCC_VERSION < 409 + basic_format_args(*this), +#endif + data_{internal::make_arg(args)...} { + } +}; + +/** + \rst + Constructs an `~fmt::format_arg_store` object that contains references to + arguments and can be implicitly converted to `~fmt::format_args`. `Context` + can be omitted in which case it defaults to `~fmt::context`. + See `~fmt::arg` for lifetime considerations. + \endrst + */ +template +inline format_arg_store make_format_args( + const Args&... args) { + return {args...}; +} + +/** + \rst + A dynamic version of `fmt::format_arg_store<>`. + It's equipped with a storage to potentially temporary objects which lifetime + could be shorter than the format arguments object. + + It can be implicitly converted into `~fmt::basic_format_args` for passing + into type-erased formatting functions such as `~fmt::vformat`. + \endrst + */ +template +class dynamic_format_arg_store +#if FMT_GCC_VERSION && FMT_GCC_VERSION < 409 + // Workaround a GCC template argument substitution bug. + : public basic_format_args +#endif +{ + private: + using char_type = typename Context::char_type; + + template struct need_copy { + static constexpr internal::type mapped_type = + internal::mapped_type_constant::value; + + enum { + value = !(internal::is_reference_wrapper::value || + std::is_same>::value || + std::is_same>::value || + (mapped_type != internal::type::cstring_type && + mapped_type != internal::type::string_type && + mapped_type != internal::type::custom_type && + mapped_type != internal::type::named_arg_type)) + }; + }; + + template + using stored_type = conditional_t::value, + std::basic_string, T>; + + // Storage of basic_format_arg must be contiguous. + std::vector> data_; + + // Storage of arguments not fitting into basic_format_arg must grow + // without relocation because items in data_ refer to it. + internal::dynamic_arg_list dynamic_args_; + + friend class basic_format_args; + + unsigned long long get_types() const { + return internal::is_unpacked_bit | data_.size(); + } + + template void emplace_arg(const T& arg) { + data_.emplace_back(internal::make_arg(arg)); + } + + public: + /** + \rst + Adds an argument into the dynamic store for later passing to a formating + function. + + Note that custom types and string types (but not string views!) are copied + into the store with dynamic memory (in addition to resizing vector). + + **Example**:: + + fmt::dynamic_format_arg_store store; + store.push_back(42); + store.push_back("abc"); + store.push_back(1.5f); + std::string result = fmt::vformat("{} and {} and {}", store); + \endrst + */ + template void push_back(const T& arg) { + static_assert( + !std::is_base_of, T>::value, + "named arguments are not supported yet"); + if (internal::const_check(need_copy::value)) + emplace_arg(dynamic_args_.push>(arg)); + else + emplace_arg(arg); + } + + /** + Adds a reference to the argument into the dynamic store for later passing to + a formating function. + */ + template void push_back(std::reference_wrapper arg) { + static_assert( + need_copy::value, + "objects of built-in types and string views are always copied"); + emplace_arg(arg.get()); + } +}; + +/** + \rst + A view of a collection of formatting arguments. To avoid lifetime issues it + should only be used as a parameter type in type-erased functions such as + ``vformat``:: + + void vlog(string_view format_str, format_args args); // OK + format_args args = make_format_args(42); // Error: dangling reference + \endrst + */ +template class basic_format_args { + public: + using size_type = int; + using format_arg = basic_format_arg; + + private: + // To reduce compiled code size per formatting function call, types of first + // max_packed_args arguments are passed in the types_ field. + unsigned long long types_; + union { + // If the number of arguments is less than max_packed_args, the argument + // values are stored in values_, otherwise they are stored in args_. + // This is done to reduce compiled code size as storing larger objects + // may require more code (at least on x86-64) even if the same amount of + // data is actually copied to stack. It saves ~10% on the bloat test. + const internal::value* values_; + const format_arg* args_; + }; + + bool is_packed() const { return (types_ & internal::is_unpacked_bit) == 0; } + + internal::type type(int index) const { + int shift = index * internal::packed_arg_bits; + unsigned int mask = (1 << internal::packed_arg_bits) - 1; + return static_cast((types_ >> shift) & mask); + } + + friend class internal::arg_map; + + void set_data(const internal::value* values) { values_ = values; } + void set_data(const format_arg* args) { args_ = args; } + + format_arg do_get(int index) const { + format_arg arg; + if (!is_packed()) { + auto num_args = max_size(); + if (index < num_args) arg = args_[index]; + return arg; + } + if (index > internal::max_packed_args) return arg; + arg.type_ = type(index); + if (arg.type_ == internal::type::none_type) return arg; + internal::value& val = arg.value_; + val = values_[index]; + return arg; + } + + public: + basic_format_args() : types_(0) {} + + /** + \rst + Constructs a `basic_format_args` object from `~fmt::format_arg_store`. + \endrst + */ + template + basic_format_args(const format_arg_store& store) + : types_(store.types) { + set_data(store.data_); + } + + /** + \rst + Constructs a `basic_format_args` object from + `~fmt::dynamic_format_arg_store`. + \endrst + */ + basic_format_args(const dynamic_format_arg_store& store) + : types_(store.get_types()) { + set_data(store.data_.data()); + } + + /** + \rst + Constructs a `basic_format_args` object from a dynamic set of arguments. + \endrst + */ + basic_format_args(const format_arg* args, int count) + : types_(internal::is_unpacked_bit | internal::to_unsigned(count)) { + set_data(args); + } + + /** Returns the argument at specified index. */ + format_arg get(int index) const { + format_arg arg = do_get(index); + if (arg.type_ == internal::type::named_arg_type) + arg = arg.value_.named_arg->template deserialize(); + return arg; + } + + int max_size() const { + unsigned long long max_packed = internal::max_packed_args; + return static_cast(is_packed() ? max_packed + : types_ & ~internal::is_unpacked_bit); + } +}; + +/** An alias to ``basic_format_args``. */ +// It is a separate type rather than an alias to make symbols readable. +struct format_args : basic_format_args { + template + format_args(Args&&... args) + : basic_format_args(static_cast(args)...) {} +}; +struct wformat_args : basic_format_args { + template + wformat_args(Args&&... args) + : basic_format_args(static_cast(args)...) {} +}; + +template struct is_contiguous : std::false_type {}; + +template +struct is_contiguous> : std::true_type {}; + +template +struct is_contiguous> : std::true_type {}; + +namespace internal { + +template +struct is_contiguous_back_insert_iterator : std::false_type {}; +template +struct is_contiguous_back_insert_iterator> + : is_contiguous {}; + +template struct named_arg_base { + basic_string_view name; + + // Serialized value. + mutable char data[sizeof(basic_format_arg>)]; + + named_arg_base(basic_string_view nm) : name(nm) {} + + template basic_format_arg deserialize() const { + basic_format_arg arg; + std::memcpy(&arg, data, sizeof(basic_format_arg)); + return arg; + } +}; + +struct view {}; + +template +struct named_arg : view, named_arg_base { + const T& value; + + named_arg(basic_string_view name, const T& val) + : named_arg_base(name), value(val) {} +}; + +template ::value)> +inline void check_format_string(const S&) { +#if defined(FMT_ENFORCE_COMPILE_STRING) + static_assert(is_compile_string::value, + "FMT_ENFORCE_COMPILE_STRING requires all format strings to " + "utilize FMT_STRING() or fmt()."); +#endif +} +template ::value)> +void check_format_string(S); + +template struct bool_pack; +template +using all_true = + std::is_same, bool_pack>; + +template > +inline format_arg_store, remove_reference_t...> +make_args_checked(const S& format_str, + const remove_reference_t&... args) { + static_assert( + all_true<(!std::is_base_of>::value || + !std::is_reference::value)...>::value, + "passing views as lvalues is disallowed"); + check_format_string(format_str); + return {args...}; +} + +template +std::basic_string vformat( + basic_string_view format_str, + basic_format_args>> args); + +template +typename buffer_context::iterator vformat_to( + buffer& buf, basic_string_view format_str, + basic_format_args>> args); + +template ::value)> +inline void vprint_mojibake(std::FILE*, basic_string_view, const Args&) {} + +FMT_API void vprint_mojibake(std::FILE*, string_view, format_args); +#ifndef _WIN32 +inline void vprint_mojibake(std::FILE*, string_view, format_args) {} +#endif +} // namespace internal + +/** + \rst + Returns a named argument to be used in a formatting function. It should only + be used in a call to a formatting function. + + **Example**:: + + fmt::print("Elapsed time: {s:.2f} seconds", fmt::arg("s", 1.23)); + \endrst + */ +template > +inline internal::named_arg arg(const S& name, const T& arg) { + static_assert(internal::is_string::value, ""); + return {name, arg}; +} + +// Disable nested named arguments, e.g. ``arg("a", arg("b", 42))``. +template +void arg(S, internal::named_arg) = delete; + +/** Formats a string and writes the output to ``out``. */ +// GCC 8 and earlier cannot handle std::back_insert_iterator with +// vformat_to(...) overload, so SFINAE on iterator type instead. +template , + FMT_ENABLE_IF( + internal::is_contiguous_back_insert_iterator::value)> +OutputIt vformat_to( + OutputIt out, const S& format_str, + basic_format_args>> args) { + using container = remove_reference_t; + internal::container_buffer buf((internal::get_container(out))); + internal::vformat_to(buf, to_string_view(format_str), args); + return out; +} + +template ::value&& internal::is_string::value)> +inline std::back_insert_iterator format_to( + std::back_insert_iterator out, const S& format_str, + Args&&... args) { + return vformat_to(out, to_string_view(format_str), + internal::make_args_checked(format_str, args...)); +} + +template > +inline std::basic_string vformat( + const S& format_str, + basic_format_args>> args) { + return internal::vformat(to_string_view(format_str), args); +} + +/** + \rst + Formats arguments and returns the result as a string. + + **Example**:: + + #include + std::string message = fmt::format("The answer is {}", 42); + \endrst +*/ +// Pass char_t as a default template parameter instead of using +// std::basic_string> to reduce the symbol size. +template > +inline std::basic_string format(const S& format_str, Args&&... args) { + return internal::vformat( + to_string_view(format_str), + internal::make_args_checked(format_str, args...)); +} + +FMT_API void vprint(string_view, format_args); +FMT_API void vprint(std::FILE*, string_view, format_args); + +/** + \rst + Formats ``args`` according to specifications in ``format_str`` and writes the + output to the file ``f``. Strings are assumed to be Unicode-encoded unless the + ``FMT_UNICODE`` macro is set to 0. + + **Example**:: + + fmt::print(stderr, "Don't {}!", "panic"); + \endrst + */ +template > +inline void print(std::FILE* f, const S& format_str, Args&&... args) { + return internal::is_unicode() + ? vprint(f, to_string_view(format_str), + internal::make_args_checked(format_str, args...)) + : internal::vprint_mojibake( + f, to_string_view(format_str), + internal::make_args_checked(format_str, args...)); +} + +/** + \rst + Formats ``args`` according to specifications in ``format_str`` and writes + the output to ``stdout``. Strings are assumed to be Unicode-encoded unless + the ``FMT_UNICODE`` macro is set to 0. + + **Example**:: + + fmt::print("Elapsed time: {0:.2f} seconds", 1.23); + \endrst + */ +template > +inline void print(const S& format_str, Args&&... args) { + return internal::is_unicode() + ? vprint(to_string_view(format_str), + internal::make_args_checked(format_str, args...)) + : internal::vprint_mojibake( + stdout, to_string_view(format_str), + internal::make_args_checked(format_str, args...)); +} +FMT_END_NAMESPACE + +#endif // FMT_CORE_H_ diff --git a/packages/sqdlog.1.0.0/lib/native/include/spdlog/fmt/bundled/format-inl.h b/packages/sqdlog.1.0.0/lib/native/include/spdlog/fmt/bundled/format-inl.h new file mode 100644 index 0000000..f632714 --- /dev/null +++ b/packages/sqdlog.1.0.0/lib/native/include/spdlog/fmt/bundled/format-inl.h @@ -0,0 +1,1403 @@ +// Formatting library for C++ - implementation +// +// Copyright (c) 2012 - 2016, Victor Zverovich +// All rights reserved. +// +// For the license information refer to format.h. + +#ifndef FMT_FORMAT_INL_H_ +#define FMT_FORMAT_INL_H_ + +#include +#include +#include +#include +#include +#include // for std::memmove +#include + +#include "format.h" +#if !defined(FMT_STATIC_THOUSANDS_SEPARATOR) +# include +#endif + +#ifdef _WIN32 +# include +# include +#endif + +#ifdef _MSC_VER +# pragma warning(push) +# pragma warning(disable : 4702) // unreachable code +#endif + +// Dummy implementations of strerror_r and strerror_s called if corresponding +// system functions are not available. +inline fmt::internal::null<> strerror_r(int, char*, ...) { return {}; } +inline fmt::internal::null<> strerror_s(char*, std::size_t, ...) { return {}; } + +FMT_BEGIN_NAMESPACE +namespace internal { + +FMT_FUNC void assert_fail(const char* file, int line, const char* message) { + print(stderr, "{}:{}: assertion failed: {}", file, line, message); + std::abort(); +} + +#ifndef _MSC_VER +# define FMT_SNPRINTF snprintf +#else // _MSC_VER +inline int fmt_snprintf(char* buffer, size_t size, const char* format, ...) { + va_list args; + va_start(args, format); + int result = vsnprintf_s(buffer, size, _TRUNCATE, format, args); + va_end(args); + return result; +} +# define FMT_SNPRINTF fmt_snprintf +#endif // _MSC_VER + +// A portable thread-safe version of strerror. +// Sets buffer to point to a string describing the error code. +// This can be either a pointer to a string stored in buffer, +// or a pointer to some static immutable string. +// Returns one of the following values: +// 0 - success +// ERANGE - buffer is not large enough to store the error message +// other - failure +// Buffer should be at least of size 1. +FMT_FUNC int safe_strerror(int error_code, char*& buffer, + std::size_t buffer_size) FMT_NOEXCEPT { + FMT_ASSERT(buffer != nullptr && buffer_size != 0, "invalid buffer"); + + class dispatcher { + private: + int error_code_; + char*& buffer_; + std::size_t buffer_size_; + + // A noop assignment operator to avoid bogus warnings. + void operator=(const dispatcher&) {} + + // Handle the result of XSI-compliant version of strerror_r. + int handle(int result) { + // glibc versions before 2.13 return result in errno. + return result == -1 ? errno : result; + } + + // Handle the result of GNU-specific version of strerror_r. + FMT_MAYBE_UNUSED + int handle(char* message) { + // If the buffer is full then the message is probably truncated. + if (message == buffer_ && strlen(buffer_) == buffer_size_ - 1) + return ERANGE; + buffer_ = message; + return 0; + } + + // Handle the case when strerror_r is not available. + FMT_MAYBE_UNUSED + int handle(internal::null<>) { + return fallback(strerror_s(buffer_, buffer_size_, error_code_)); + } + + // Fallback to strerror_s when strerror_r is not available. + FMT_MAYBE_UNUSED + int fallback(int result) { + // If the buffer is full then the message is probably truncated. + return result == 0 && strlen(buffer_) == buffer_size_ - 1 ? ERANGE + : result; + } + +#if !FMT_MSC_VER + // Fallback to strerror if strerror_r and strerror_s are not available. + int fallback(internal::null<>) { + errno = 0; + buffer_ = strerror(error_code_); + return errno; + } +#endif + + public: + dispatcher(int err_code, char*& buf, std::size_t buf_size) + : error_code_(err_code), buffer_(buf), buffer_size_(buf_size) {} + + int run() { return handle(strerror_r(error_code_, buffer_, buffer_size_)); } + }; + return dispatcher(error_code, buffer, buffer_size).run(); +} + +FMT_FUNC void format_error_code(internal::buffer& out, int error_code, + string_view message) FMT_NOEXCEPT { + // Report error code making sure that the output fits into + // inline_buffer_size to avoid dynamic memory allocation and potential + // bad_alloc. + out.resize(0); + static const char SEP[] = ": "; + static const char ERROR_STR[] = "error "; + // Subtract 2 to account for terminating null characters in SEP and ERROR_STR. + std::size_t error_code_size = sizeof(SEP) + sizeof(ERROR_STR) - 2; + auto abs_value = static_cast>(error_code); + if (internal::is_negative(error_code)) { + abs_value = 0 - abs_value; + ++error_code_size; + } + error_code_size += internal::to_unsigned(internal::count_digits(abs_value)); + internal::writer w(out); + if (message.size() <= inline_buffer_size - error_code_size) { + w.write(message); + w.write(SEP); + } + w.write(ERROR_STR); + w.write(error_code); + assert(out.size() <= inline_buffer_size); +} + +FMT_FUNC void report_error(format_func func, int error_code, + string_view message) FMT_NOEXCEPT { + memory_buffer full_message; + func(full_message, error_code, message); + // Don't use fwrite_fully because the latter may throw. + (void)std::fwrite(full_message.data(), full_message.size(), 1, stderr); + std::fputc('\n', stderr); +} + +// A wrapper around fwrite that throws on error. +FMT_FUNC void fwrite_fully(const void* ptr, size_t size, size_t count, + FILE* stream) { + size_t written = std::fwrite(ptr, size, count, stream); + if (written < count) FMT_THROW(system_error(errno, "cannot write to file")); +} +} // namespace internal + +#if !defined(FMT_STATIC_THOUSANDS_SEPARATOR) +namespace internal { + +template +locale_ref::locale_ref(const Locale& loc) : locale_(&loc) { + static_assert(std::is_same::value, ""); +} + +template Locale locale_ref::get() const { + static_assert(std::is_same::value, ""); + return locale_ ? *static_cast(locale_) : std::locale(); +} + +template FMT_FUNC std::string grouping_impl(locale_ref loc) { + return std::use_facet>(loc.get()).grouping(); +} +template FMT_FUNC Char thousands_sep_impl(locale_ref loc) { + return std::use_facet>(loc.get()) + .thousands_sep(); +} +template FMT_FUNC Char decimal_point_impl(locale_ref loc) { + return std::use_facet>(loc.get()) + .decimal_point(); +} +} // namespace internal +#else +template +FMT_FUNC std::string internal::grouping_impl(locale_ref) { + return "\03"; +} +template +FMT_FUNC Char internal::thousands_sep_impl(locale_ref) { + return FMT_STATIC_THOUSANDS_SEPARATOR; +} +template +FMT_FUNC Char internal::decimal_point_impl(locale_ref) { + return '.'; +} +#endif + +FMT_API FMT_FUNC format_error::~format_error() FMT_NOEXCEPT = default; +FMT_API FMT_FUNC system_error::~system_error() FMT_NOEXCEPT = default; + +FMT_FUNC void system_error::init(int err_code, string_view format_str, + format_args args) { + error_code_ = err_code; + memory_buffer buffer; + format_system_error(buffer, err_code, vformat(format_str, args)); + std::runtime_error& base = *this; + base = std::runtime_error(to_string(buffer)); +} + +namespace internal { + +template <> FMT_FUNC int count_digits<4>(internal::fallback_uintptr n) { + // fallback_uintptr is always stored in little endian. + int i = static_cast(sizeof(void*)) - 1; + while (i > 0 && n.value[i] == 0) --i; + auto char_digits = std::numeric_limits::digits / 4; + return i >= 0 ? i * char_digits + count_digits<4, unsigned>(n.value[i]) : 1; +} + +template +const char basic_data::digits[] = + "0001020304050607080910111213141516171819" + "2021222324252627282930313233343536373839" + "4041424344454647484950515253545556575859" + "6061626364656667686970717273747576777879" + "8081828384858687888990919293949596979899"; + +template +const char basic_data::hex_digits[] = "0123456789abcdef"; + +#define FMT_POWERS_OF_10(factor) \ + factor * 10, (factor)*100, (factor)*1000, (factor)*10000, (factor)*100000, \ + (factor)*1000000, (factor)*10000000, (factor)*100000000, \ + (factor)*1000000000 + +template +const uint64_t basic_data::powers_of_10_64[] = { + 1, FMT_POWERS_OF_10(1), FMT_POWERS_OF_10(1000000000ULL), + 10000000000000000000ULL}; + +template +const uint32_t basic_data::zero_or_powers_of_10_32[] = {0, + FMT_POWERS_OF_10(1)}; + +template +const uint64_t basic_data::zero_or_powers_of_10_64[] = { + 0, FMT_POWERS_OF_10(1), FMT_POWERS_OF_10(1000000000ULL), + 10000000000000000000ULL}; + +// Normalized 64-bit significands of pow(10, k), for k = -348, -340, ..., 340. +// These are generated by support/compute-powers.py. +template +const uint64_t basic_data::pow10_significands[] = { + 0xfa8fd5a0081c0288, 0xbaaee17fa23ebf76, 0x8b16fb203055ac76, + 0xcf42894a5dce35ea, 0x9a6bb0aa55653b2d, 0xe61acf033d1a45df, + 0xab70fe17c79ac6ca, 0xff77b1fcbebcdc4f, 0xbe5691ef416bd60c, + 0x8dd01fad907ffc3c, 0xd3515c2831559a83, 0x9d71ac8fada6c9b5, + 0xea9c227723ee8bcb, 0xaecc49914078536d, 0x823c12795db6ce57, + 0xc21094364dfb5637, 0x9096ea6f3848984f, 0xd77485cb25823ac7, + 0xa086cfcd97bf97f4, 0xef340a98172aace5, 0xb23867fb2a35b28e, + 0x84c8d4dfd2c63f3b, 0xc5dd44271ad3cdba, 0x936b9fcebb25c996, + 0xdbac6c247d62a584, 0xa3ab66580d5fdaf6, 0xf3e2f893dec3f126, + 0xb5b5ada8aaff80b8, 0x87625f056c7c4a8b, 0xc9bcff6034c13053, + 0x964e858c91ba2655, 0xdff9772470297ebd, 0xa6dfbd9fb8e5b88f, + 0xf8a95fcf88747d94, 0xb94470938fa89bcf, 0x8a08f0f8bf0f156b, + 0xcdb02555653131b6, 0x993fe2c6d07b7fac, 0xe45c10c42a2b3b06, + 0xaa242499697392d3, 0xfd87b5f28300ca0e, 0xbce5086492111aeb, + 0x8cbccc096f5088cc, 0xd1b71758e219652c, 0x9c40000000000000, + 0xe8d4a51000000000, 0xad78ebc5ac620000, 0x813f3978f8940984, + 0xc097ce7bc90715b3, 0x8f7e32ce7bea5c70, 0xd5d238a4abe98068, + 0x9f4f2726179a2245, 0xed63a231d4c4fb27, 0xb0de65388cc8ada8, + 0x83c7088e1aab65db, 0xc45d1df942711d9a, 0x924d692ca61be758, + 0xda01ee641a708dea, 0xa26da3999aef774a, 0xf209787bb47d6b85, + 0xb454e4a179dd1877, 0x865b86925b9bc5c2, 0xc83553c5c8965d3d, + 0x952ab45cfa97a0b3, 0xde469fbd99a05fe3, 0xa59bc234db398c25, + 0xf6c69a72a3989f5c, 0xb7dcbf5354e9bece, 0x88fcf317f22241e2, + 0xcc20ce9bd35c78a5, 0x98165af37b2153df, 0xe2a0b5dc971f303a, + 0xa8d9d1535ce3b396, 0xfb9b7cd9a4a7443c, 0xbb764c4ca7a44410, + 0x8bab8eefb6409c1a, 0xd01fef10a657842c, 0x9b10a4e5e9913129, + 0xe7109bfba19c0c9d, 0xac2820d9623bf429, 0x80444b5e7aa7cf85, + 0xbf21e44003acdd2d, 0x8e679c2f5e44ff8f, 0xd433179d9c8cb841, + 0x9e19db92b4e31ba9, 0xeb96bf6ebadf77d9, 0xaf87023b9bf0ee6b, +}; + +// Binary exponents of pow(10, k), for k = -348, -340, ..., 340, corresponding +// to significands above. +template +const int16_t basic_data::pow10_exponents[] = { + -1220, -1193, -1166, -1140, -1113, -1087, -1060, -1034, -1007, -980, -954, + -927, -901, -874, -847, -821, -794, -768, -741, -715, -688, -661, + -635, -608, -582, -555, -529, -502, -475, -449, -422, -396, -369, + -343, -316, -289, -263, -236, -210, -183, -157, -130, -103, -77, + -50, -24, 3, 30, 56, 83, 109, 136, 162, 189, 216, + 242, 269, 295, 322, 348, 375, 402, 428, 455, 481, 508, + 534, 561, 588, 614, 641, 667, 694, 720, 747, 774, 800, + 827, 853, 880, 907, 933, 960, 986, 1013, 1039, 1066}; + +template +const char basic_data::foreground_color[] = "\x1b[38;2;"; +template +const char basic_data::background_color[] = "\x1b[48;2;"; +template const char basic_data::reset_color[] = "\x1b[0m"; +template const wchar_t basic_data::wreset_color[] = L"\x1b[0m"; +template const char basic_data::signs[] = {0, '-', '+', ' '}; + +template struct bits { + static FMT_CONSTEXPR_DECL const int value = + static_cast(sizeof(T) * std::numeric_limits::digits); +}; + +class fp; +template fp normalize(fp value); + +// Lower (upper) boundary is a value half way between a floating-point value +// and its predecessor (successor). Boundaries have the same exponent as the +// value so only significands are stored. +struct boundaries { + uint64_t lower; + uint64_t upper; +}; + +// A handmade floating-point number f * pow(2, e). +class fp { + private: + using significand_type = uint64_t; + + public: + significand_type f; + int e; + + // All sizes are in bits. + // Subtract 1 to account for an implicit most significant bit in the + // normalized form. + static FMT_CONSTEXPR_DECL const int double_significand_size = + std::numeric_limits::digits - 1; + static FMT_CONSTEXPR_DECL const uint64_t implicit_bit = + 1ULL << double_significand_size; + static FMT_CONSTEXPR_DECL const int significand_size = + bits::value; + + fp() : f(0), e(0) {} + fp(uint64_t f_val, int e_val) : f(f_val), e(e_val) {} + + // Constructs fp from an IEEE754 double. It is a template to prevent compile + // errors on platforms where double is not IEEE754. + template explicit fp(Double d) { assign(d); } + + // Assigns d to this and return true iff predecessor is closer than successor. + template + bool assign(Double d) { + // Assume double is in the format [sign][exponent][significand]. + using limits = std::numeric_limits; + const int exponent_size = + bits::value - double_significand_size - 1; // -1 for sign + const uint64_t significand_mask = implicit_bit - 1; + const uint64_t exponent_mask = (~0ULL >> 1) & ~significand_mask; + const int exponent_bias = (1 << exponent_size) - limits::max_exponent - 1; + auto u = bit_cast(d); + f = u & significand_mask; + int biased_e = + static_cast((u & exponent_mask) >> double_significand_size); + // Predecessor is closer if d is a normalized power of 2 (f == 0) other than + // the smallest normalized number (biased_e > 1). + bool is_predecessor_closer = f == 0 && biased_e > 1; + if (biased_e != 0) + f += implicit_bit; + else + biased_e = 1; // Subnormals use biased exponent 1 (min exponent). + e = biased_e - exponent_bias - double_significand_size; + return is_predecessor_closer; + } + + template + bool assign(Double) { + *this = fp(); + return false; + } + + // Assigns d to this together with computing lower and upper boundaries, + // where a boundary is a value half way between the number and its predecessor + // (lower) or successor (upper). The upper boundary is normalized and lower + // has the same exponent but may be not normalized. + template boundaries assign_with_boundaries(Double d) { + bool is_lower_closer = assign(d); + fp lower = + is_lower_closer ? fp((f << 2) - 1, e - 2) : fp((f << 1) - 1, e - 1); + // 1 in normalize accounts for the exponent shift above. + fp upper = normalize<1>(fp((f << 1) + 1, e - 1)); + lower.f <<= lower.e - upper.e; + return boundaries{lower.f, upper.f}; + } + + template boundaries assign_float_with_boundaries(Double d) { + assign(d); + constexpr int min_normal_e = std::numeric_limits::min_exponent - + std::numeric_limits::digits; + significand_type half_ulp = 1 << (std::numeric_limits::digits - + std::numeric_limits::digits - 1); + if (min_normal_e > e) half_ulp <<= min_normal_e - e; + fp upper = normalize<0>(fp(f + half_ulp, e)); + fp lower = fp( + f - (half_ulp >> ((f == implicit_bit && e > min_normal_e) ? 1 : 0)), e); + lower.f <<= lower.e - upper.e; + return boundaries{lower.f, upper.f}; + } +}; + +// Normalizes the value converted from double and multiplied by (1 << SHIFT). +template fp normalize(fp value) { + // Handle subnormals. + const auto shifted_implicit_bit = fp::implicit_bit << SHIFT; + while ((value.f & shifted_implicit_bit) == 0) { + value.f <<= 1; + --value.e; + } + // Subtract 1 to account for hidden bit. + const auto offset = + fp::significand_size - fp::double_significand_size - SHIFT - 1; + value.f <<= offset; + value.e -= offset; + return value; +} + +inline bool operator==(fp x, fp y) { return x.f == y.f && x.e == y.e; } + +// Computes lhs * rhs / pow(2, 64) rounded to nearest with half-up tie breaking. +inline uint64_t multiply(uint64_t lhs, uint64_t rhs) { +#if FMT_USE_INT128 + auto product = static_cast<__uint128_t>(lhs) * rhs; + auto f = static_cast(product >> 64); + return (static_cast(product) & (1ULL << 63)) != 0 ? f + 1 : f; +#else + // Multiply 32-bit parts of significands. + uint64_t mask = (1ULL << 32) - 1; + uint64_t a = lhs >> 32, b = lhs & mask; + uint64_t c = rhs >> 32, d = rhs & mask; + uint64_t ac = a * c, bc = b * c, ad = a * d, bd = b * d; + // Compute mid 64-bit of result and round. + uint64_t mid = (bd >> 32) + (ad & mask) + (bc & mask) + (1U << 31); + return ac + (ad >> 32) + (bc >> 32) + (mid >> 32); +#endif +} + +inline fp operator*(fp x, fp y) { return {multiply(x.f, y.f), x.e + y.e + 64}; } + +// Returns a cached power of 10 `c_k = c_k.f * pow(2, c_k.e)` such that its +// (binary) exponent satisfies `min_exponent <= c_k.e <= min_exponent + 28`. +inline fp get_cached_power(int min_exponent, int& pow10_exponent) { + const int64_t one_over_log2_10 = 0x4d104d42; // round(pow(2, 32) / log2(10)) + int index = static_cast( + ((min_exponent + fp::significand_size - 1) * one_over_log2_10 + + ((int64_t(1) << 32) - 1)) // ceil + >> 32 // arithmetic shift + ); + // Decimal exponent of the first (smallest) cached power of 10. + const int first_dec_exp = -348; + // Difference between 2 consecutive decimal exponents in cached powers of 10. + const int dec_exp_step = 8; + index = (index - first_dec_exp - 1) / dec_exp_step + 1; + pow10_exponent = first_dec_exp + index * dec_exp_step; + return {data::pow10_significands[index], data::pow10_exponents[index]}; +} + +// A simple accumulator to hold the sums of terms in bigint::square if uint128_t +// is not available. +struct accumulator { + uint64_t lower; + uint64_t upper; + + accumulator() : lower(0), upper(0) {} + explicit operator uint32_t() const { return static_cast(lower); } + + void operator+=(uint64_t n) { + lower += n; + if (lower < n) ++upper; + } + void operator>>=(int shift) { + assert(shift == 32); + (void)shift; + lower = (upper << 32) | (lower >> 32); + upper >>= 32; + } +}; + +class bigint { + private: + // A bigint is stored as an array of bigits (big digits), with bigit at index + // 0 being the least significant one. + using bigit = uint32_t; + using double_bigit = uint64_t; + enum { bigits_capacity = 32 }; + basic_memory_buffer bigits_; + int exp_; + + bigit operator[](int index) const { return bigits_[to_unsigned(index)]; } + bigit& operator[](int index) { return bigits_[to_unsigned(index)]; } + + static FMT_CONSTEXPR_DECL const int bigit_bits = bits::value; + + friend struct formatter; + + void subtract_bigits(int index, bigit other, bigit& borrow) { + auto result = static_cast((*this)[index]) - other - borrow; + (*this)[index] = static_cast(result); + borrow = static_cast(result >> (bigit_bits * 2 - 1)); + } + + void remove_leading_zeros() { + int num_bigits = static_cast(bigits_.size()) - 1; + while (num_bigits > 0 && (*this)[num_bigits] == 0) --num_bigits; + bigits_.resize(to_unsigned(num_bigits + 1)); + } + + // Computes *this -= other assuming aligned bigints and *this >= other. + void subtract_aligned(const bigint& other) { + FMT_ASSERT(other.exp_ >= exp_, "unaligned bigints"); + FMT_ASSERT(compare(*this, other) >= 0, ""); + bigit borrow = 0; + int i = other.exp_ - exp_; + for (size_t j = 0, n = other.bigits_.size(); j != n; ++i, ++j) { + subtract_bigits(i, other.bigits_[j], borrow); + } + while (borrow > 0) subtract_bigits(i, 0, borrow); + remove_leading_zeros(); + } + + void multiply(uint32_t value) { + const double_bigit wide_value = value; + bigit carry = 0; + for (size_t i = 0, n = bigits_.size(); i < n; ++i) { + double_bigit result = bigits_[i] * wide_value + carry; + bigits_[i] = static_cast(result); + carry = static_cast(result >> bigit_bits); + } + if (carry != 0) bigits_.push_back(carry); + } + + void multiply(uint64_t value) { + const bigit mask = ~bigit(0); + const double_bigit lower = value & mask; + const double_bigit upper = value >> bigit_bits; + double_bigit carry = 0; + for (size_t i = 0, n = bigits_.size(); i < n; ++i) { + double_bigit result = bigits_[i] * lower + (carry & mask); + carry = + bigits_[i] * upper + (result >> bigit_bits) + (carry >> bigit_bits); + bigits_[i] = static_cast(result); + } + while (carry != 0) { + bigits_.push_back(carry & mask); + carry >>= bigit_bits; + } + } + + public: + bigint() : exp_(0) {} + explicit bigint(uint64_t n) { assign(n); } + ~bigint() { assert(bigits_.capacity() <= bigits_capacity); } + + bigint(const bigint&) = delete; + void operator=(const bigint&) = delete; + + void assign(const bigint& other) { + bigits_.resize(other.bigits_.size()); + auto data = other.bigits_.data(); + std::copy(data, data + other.bigits_.size(), bigits_.data()); + exp_ = other.exp_; + } + + void assign(uint64_t n) { + size_t num_bigits = 0; + do { + bigits_[num_bigits++] = n & ~bigit(0); + n >>= bigit_bits; + } while (n != 0); + bigits_.resize(num_bigits); + exp_ = 0; + } + + int num_bigits() const { return static_cast(bigits_.size()) + exp_; } + + bigint& operator<<=(int shift) { + assert(shift >= 0); + exp_ += shift / bigit_bits; + shift %= bigit_bits; + if (shift == 0) return *this; + bigit carry = 0; + for (size_t i = 0, n = bigits_.size(); i < n; ++i) { + bigit c = bigits_[i] >> (bigit_bits - shift); + bigits_[i] = (bigits_[i] << shift) + carry; + carry = c; + } + if (carry != 0) bigits_.push_back(carry); + return *this; + } + + template bigint& operator*=(Int value) { + FMT_ASSERT(value > 0, ""); + multiply(uint32_or_64_or_128_t(value)); + return *this; + } + + friend int compare(const bigint& lhs, const bigint& rhs) { + int num_lhs_bigits = lhs.num_bigits(), num_rhs_bigits = rhs.num_bigits(); + if (num_lhs_bigits != num_rhs_bigits) + return num_lhs_bigits > num_rhs_bigits ? 1 : -1; + int i = static_cast(lhs.bigits_.size()) - 1; + int j = static_cast(rhs.bigits_.size()) - 1; + int end = i - j; + if (end < 0) end = 0; + for (; i >= end; --i, --j) { + bigit lhs_bigit = lhs[i], rhs_bigit = rhs[j]; + if (lhs_bigit != rhs_bigit) return lhs_bigit > rhs_bigit ? 1 : -1; + } + if (i != j) return i > j ? 1 : -1; + return 0; + } + + // Returns compare(lhs1 + lhs2, rhs). + friend int add_compare(const bigint& lhs1, const bigint& lhs2, + const bigint& rhs) { + int max_lhs_bigits = (std::max)(lhs1.num_bigits(), lhs2.num_bigits()); + int num_rhs_bigits = rhs.num_bigits(); + if (max_lhs_bigits + 1 < num_rhs_bigits) return -1; + if (max_lhs_bigits > num_rhs_bigits) return 1; + auto get_bigit = [](const bigint& n, int i) -> bigit { + return i >= n.exp_ && i < n.num_bigits() ? n[i - n.exp_] : 0; + }; + double_bigit borrow = 0; + int min_exp = (std::min)((std::min)(lhs1.exp_, lhs2.exp_), rhs.exp_); + for (int i = num_rhs_bigits - 1; i >= min_exp; --i) { + double_bigit sum = + static_cast(get_bigit(lhs1, i)) + get_bigit(lhs2, i); + bigit rhs_bigit = get_bigit(rhs, i); + if (sum > rhs_bigit + borrow) return 1; + borrow = rhs_bigit + borrow - sum; + if (borrow > 1) return -1; + borrow <<= bigit_bits; + } + return borrow != 0 ? -1 : 0; + } + + // Assigns pow(10, exp) to this bigint. + void assign_pow10(int exp) { + assert(exp >= 0); + if (exp == 0) return assign(1); + // Find the top bit. + int bitmask = 1; + while (exp >= bitmask) bitmask <<= 1; + bitmask >>= 1; + // pow(10, exp) = pow(5, exp) * pow(2, exp). First compute pow(5, exp) by + // repeated squaring and multiplication. + assign(5); + bitmask >>= 1; + while (bitmask != 0) { + square(); + if ((exp & bitmask) != 0) *this *= 5; + bitmask >>= 1; + } + *this <<= exp; // Multiply by pow(2, exp) by shifting. + } + + void square() { + basic_memory_buffer n(std::move(bigits_)); + int num_bigits = static_cast(bigits_.size()); + int num_result_bigits = 2 * num_bigits; + bigits_.resize(to_unsigned(num_result_bigits)); + using accumulator_t = conditional_t; + auto sum = accumulator_t(); + for (int bigit_index = 0; bigit_index < num_bigits; ++bigit_index) { + // Compute bigit at position bigit_index of the result by adding + // cross-product terms n[i] * n[j] such that i + j == bigit_index. + for (int i = 0, j = bigit_index; j >= 0; ++i, --j) { + // Most terms are multiplied twice which can be optimized in the future. + sum += static_cast(n[i]) * n[j]; + } + (*this)[bigit_index] = static_cast(sum); + sum >>= bits::value; // Compute the carry. + } + // Do the same for the top half. + for (int bigit_index = num_bigits; bigit_index < num_result_bigits; + ++bigit_index) { + for (int j = num_bigits - 1, i = bigit_index - j; i < num_bigits;) + sum += static_cast(n[i++]) * n[j--]; + (*this)[bigit_index] = static_cast(sum); + sum >>= bits::value; + } + --num_result_bigits; + remove_leading_zeros(); + exp_ *= 2; + } + + // Divides this bignum by divisor, assigning the remainder to this and + // returning the quotient. + int divmod_assign(const bigint& divisor) { + FMT_ASSERT(this != &divisor, ""); + if (compare(*this, divisor) < 0) return 0; + int num_bigits = static_cast(bigits_.size()); + FMT_ASSERT(divisor.bigits_[divisor.bigits_.size() - 1u] != 0, ""); + int exp_difference = exp_ - divisor.exp_; + if (exp_difference > 0) { + // Align bigints by adding trailing zeros to simplify subtraction. + bigits_.resize(to_unsigned(num_bigits + exp_difference)); + for (int i = num_bigits - 1, j = i + exp_difference; i >= 0; --i, --j) + bigits_[j] = bigits_[i]; + std::uninitialized_fill_n(bigits_.data(), exp_difference, 0); + exp_ -= exp_difference; + } + int quotient = 0; + do { + subtract_aligned(divisor); + ++quotient; + } while (compare(*this, divisor) >= 0); + return quotient; + } +}; + +enum class round_direction { unknown, up, down }; + +// Given the divisor (normally a power of 10), the remainder = v % divisor for +// some number v and the error, returns whether v should be rounded up, down, or +// whether the rounding direction can't be determined due to error. +// error should be less than divisor / 2. +inline round_direction get_round_direction(uint64_t divisor, uint64_t remainder, + uint64_t error) { + FMT_ASSERT(remainder < divisor, ""); // divisor - remainder won't overflow. + FMT_ASSERT(error < divisor, ""); // divisor - error won't overflow. + FMT_ASSERT(error < divisor - error, ""); // error * 2 won't overflow. + // Round down if (remainder + error) * 2 <= divisor. + if (remainder <= divisor - remainder && error * 2 <= divisor - remainder * 2) + return round_direction::down; + // Round up if (remainder - error) * 2 >= divisor. + if (remainder >= error && + remainder - error >= divisor - (remainder - error)) { + return round_direction::up; + } + return round_direction::unknown; +} + +namespace digits { +enum result { + more, // Generate more digits. + done, // Done generating digits. + error // Digit generation cancelled due to an error. +}; +} + +// A version of count_digits optimized for grisu_gen_digits. +inline int grisu_count_digits(uint32_t n) { + if (n < 10) return 1; + if (n < 100) return 2; + if (n < 1000) return 3; + if (n < 10000) return 4; + if (n < 100000) return 5; + if (n < 1000000) return 6; + if (n < 10000000) return 7; + if (n < 100000000) return 8; + if (n < 1000000000) return 9; + return 10; +} + +// Generates output using the Grisu digit-gen algorithm. +// error: the size of the region (lower, upper) outside of which numbers +// definitely do not round to value (Delta in Grisu3). +template +FMT_ALWAYS_INLINE digits::result grisu_gen_digits(fp value, uint64_t error, + int& exp, Handler& handler) { + const fp one(1ULL << -value.e, value.e); + // The integral part of scaled value (p1 in Grisu) = value / one. It cannot be + // zero because it contains a product of two 64-bit numbers with MSB set (due + // to normalization) - 1, shifted right by at most 60 bits. + auto integral = static_cast(value.f >> -one.e); + FMT_ASSERT(integral != 0, ""); + FMT_ASSERT(integral == value.f >> -one.e, ""); + // The fractional part of scaled value (p2 in Grisu) c = value % one. + uint64_t fractional = value.f & (one.f - 1); + exp = grisu_count_digits(integral); // kappa in Grisu. + // Divide by 10 to prevent overflow. + auto result = handler.on_start(data::powers_of_10_64[exp - 1] << -one.e, + value.f / 10, error * 10, exp); + if (result != digits::more) return result; + // Generate digits for the integral part. This can produce up to 10 digits. + do { + uint32_t digit = 0; + auto divmod_integral = [&](uint32_t divisor) { + digit = integral / divisor; + integral %= divisor; + }; + // This optimization by Milo Yip reduces the number of integer divisions by + // one per iteration. + switch (exp) { + case 10: + divmod_integral(1000000000); + break; + case 9: + divmod_integral(100000000); + break; + case 8: + divmod_integral(10000000); + break; + case 7: + divmod_integral(1000000); + break; + case 6: + divmod_integral(100000); + break; + case 5: + divmod_integral(10000); + break; + case 4: + divmod_integral(1000); + break; + case 3: + divmod_integral(100); + break; + case 2: + divmod_integral(10); + break; + case 1: + digit = integral; + integral = 0; + break; + default: + FMT_ASSERT(false, "invalid number of digits"); + } + --exp; + uint64_t remainder = + (static_cast(integral) << -one.e) + fractional; + result = handler.on_digit(static_cast('0' + digit), + data::powers_of_10_64[exp] << -one.e, remainder, + error, exp, true); + if (result != digits::more) return result; + } while (exp > 0); + // Generate digits for the fractional part. + for (;;) { + fractional *= 10; + error *= 10; + char digit = + static_cast('0' + static_cast(fractional >> -one.e)); + fractional &= one.f - 1; + --exp; + result = handler.on_digit(digit, one.f, fractional, error, exp, false); + if (result != digits::more) return result; + } +} + +// The fixed precision digit handler. +struct fixed_handler { + char* buf; + int size; + int precision; + int exp10; + bool fixed; + + digits::result on_start(uint64_t divisor, uint64_t remainder, uint64_t error, + int& exp) { + // Non-fixed formats require at least one digit and no precision adjustment. + if (!fixed) return digits::more; + // Adjust fixed precision by exponent because it is relative to decimal + // point. + precision += exp + exp10; + // Check if precision is satisfied just by leading zeros, e.g. + // format("{:.2f}", 0.001) gives "0.00" without generating any digits. + if (precision > 0) return digits::more; + if (precision < 0) return digits::done; + auto dir = get_round_direction(divisor, remainder, error); + if (dir == round_direction::unknown) return digits::error; + buf[size++] = dir == round_direction::up ? '1' : '0'; + return digits::done; + } + + digits::result on_digit(char digit, uint64_t divisor, uint64_t remainder, + uint64_t error, int, bool integral) { + FMT_ASSERT(remainder < divisor, ""); + buf[size++] = digit; + if (size < precision) return digits::more; + if (!integral) { + // Check if error * 2 < divisor with overflow prevention. + // The check is not needed for the integral part because error = 1 + // and divisor > (1 << 32) there. + if (error >= divisor || error >= divisor - error) return digits::error; + } else { + FMT_ASSERT(error == 1 && divisor > 2, ""); + } + auto dir = get_round_direction(divisor, remainder, error); + if (dir != round_direction::up) + return dir == round_direction::down ? digits::done : digits::error; + ++buf[size - 1]; + for (int i = size - 1; i > 0 && buf[i] > '9'; --i) { + buf[i] = '0'; + ++buf[i - 1]; + } + if (buf[0] > '9') { + buf[0] = '1'; + buf[size++] = '0'; + } + return digits::done; + } +}; + +// The shortest representation digit handler. +struct grisu_shortest_handler { + char* buf; + int size; + // Distance between scaled value and upper bound (wp_W in Grisu3). + uint64_t diff; + + digits::result on_start(uint64_t, uint64_t, uint64_t, int&) { + return digits::more; + } + + // Decrement the generated number approaching value from above. + void round(uint64_t d, uint64_t divisor, uint64_t& remainder, + uint64_t error) { + while ( + remainder < d && error - remainder >= divisor && + (remainder + divisor < d || d - remainder >= remainder + divisor - d)) { + --buf[size - 1]; + remainder += divisor; + } + } + + // Implements Grisu's round_weed. + digits::result on_digit(char digit, uint64_t divisor, uint64_t remainder, + uint64_t error, int exp, bool integral) { + buf[size++] = digit; + if (remainder >= error) return digits::more; + uint64_t unit = integral ? 1 : data::powers_of_10_64[-exp]; + uint64_t up = (diff - 1) * unit; // wp_Wup + round(up, divisor, remainder, error); + uint64_t down = (diff + 1) * unit; // wp_Wdown + if (remainder < down && error - remainder >= divisor && + (remainder + divisor < down || + down - remainder > remainder + divisor - down)) { + return digits::error; + } + return 2 * unit <= remainder && remainder <= error - 4 * unit + ? digits::done + : digits::error; + } +}; + +// Formats value using a variation of the Fixed-Precision Positive +// Floating-Point Printout ((FPP)^2) algorithm by Steele & White: +// https://fmt.dev/p372-steele.pdf. +template +void fallback_format(Double d, buffer& buf, int& exp10) { + bigint numerator; // 2 * R in (FPP)^2. + bigint denominator; // 2 * S in (FPP)^2. + // lower and upper are differences between value and corresponding boundaries. + bigint lower; // (M^- in (FPP)^2). + bigint upper_store; // upper's value if different from lower. + bigint* upper = nullptr; // (M^+ in (FPP)^2). + fp value; + // Shift numerator and denominator by an extra bit or two (if lower boundary + // is closer) to make lower and upper integers. This eliminates multiplication + // by 2 during later computations. + // TODO: handle float + int shift = value.assign(d) ? 2 : 1; + uint64_t significand = value.f << shift; + if (value.e >= 0) { + numerator.assign(significand); + numerator <<= value.e; + lower.assign(1); + lower <<= value.e; + if (shift != 1) { + upper_store.assign(1); + upper_store <<= value.e + 1; + upper = &upper_store; + } + denominator.assign_pow10(exp10); + denominator <<= 1; + } else if (exp10 < 0) { + numerator.assign_pow10(-exp10); + lower.assign(numerator); + if (shift != 1) { + upper_store.assign(numerator); + upper_store <<= 1; + upper = &upper_store; + } + numerator *= significand; + denominator.assign(1); + denominator <<= shift - value.e; + } else { + numerator.assign(significand); + denominator.assign_pow10(exp10); + denominator <<= shift - value.e; + lower.assign(1); + if (shift != 1) { + upper_store.assign(1ULL << 1); + upper = &upper_store; + } + } + if (!upper) upper = &lower; + // Invariant: value == (numerator / denominator) * pow(10, exp10). + bool even = (value.f & 1) == 0; + int num_digits = 0; + char* data = buf.data(); + for (;;) { + int digit = numerator.divmod_assign(denominator); + bool low = compare(numerator, lower) - even < 0; // numerator <[=] lower. + // numerator + upper >[=] pow10: + bool high = add_compare(numerator, *upper, denominator) + even > 0; + data[num_digits++] = static_cast('0' + digit); + if (low || high) { + if (!low) { + ++data[num_digits - 1]; + } else if (high) { + int result = add_compare(numerator, numerator, denominator); + // Round half to even. + if (result > 0 || (result == 0 && (digit % 2) != 0)) + ++data[num_digits - 1]; + } + buf.resize(to_unsigned(num_digits)); + exp10 -= num_digits - 1; + return; + } + numerator *= 10; + lower *= 10; + if (upper != &lower) *upper *= 10; + } +} + +// Formats value using the Grisu algorithm +// (https://www.cs.tufts.edu/~nr/cs257/archive/florian-loitsch/printf.pdf) +// if T is a IEEE754 binary32 or binary64 and snprintf otherwise. +template +int format_float(T value, int precision, float_specs specs, buffer& buf) { + static_assert(!std::is_same::value, ""); + FMT_ASSERT(value >= 0, "value is negative"); + + const bool fixed = specs.format == float_format::fixed; + if (value <= 0) { // <= instead of == to silence a warning. + if (precision <= 0 || !fixed) { + buf.push_back('0'); + return 0; + } + buf.resize(to_unsigned(precision)); + std::uninitialized_fill_n(buf.data(), precision, '0'); + return -precision; + } + + if (!specs.use_grisu) return snprintf_float(value, precision, specs, buf); + + int exp = 0; + const int min_exp = -60; // alpha in Grisu. + int cached_exp10 = 0; // K in Grisu. + if (precision < 0) { + fp fp_value; + auto boundaries = specs.binary32 + ? fp_value.assign_float_with_boundaries(value) + : fp_value.assign_with_boundaries(value); + fp_value = normalize(fp_value); + // Find a cached power of 10 such that multiplying value by it will bring + // the exponent in the range [min_exp, -32]. + const fp cached_pow = get_cached_power( + min_exp - (fp_value.e + fp::significand_size), cached_exp10); + // Multiply value and boundaries by the cached power of 10. + fp_value = fp_value * cached_pow; + boundaries.lower = multiply(boundaries.lower, cached_pow.f); + boundaries.upper = multiply(boundaries.upper, cached_pow.f); + assert(min_exp <= fp_value.e && fp_value.e <= -32); + --boundaries.lower; // \tilde{M}^- - 1 ulp -> M^-_{\downarrow}. + ++boundaries.upper; // \tilde{M}^+ + 1 ulp -> M^+_{\uparrow}. + // Numbers outside of (lower, upper) definitely do not round to value. + grisu_shortest_handler handler{buf.data(), 0, + boundaries.upper - fp_value.f}; + auto result = + grisu_gen_digits(fp(boundaries.upper, fp_value.e), + boundaries.upper - boundaries.lower, exp, handler); + if (result == digits::error) { + exp += handler.size - cached_exp10 - 1; + fallback_format(value, buf, exp); + return exp; + } + buf.resize(to_unsigned(handler.size)); + } else { + if (precision > 17) return snprintf_float(value, precision, specs, buf); + fp normalized = normalize(fp(value)); + const auto cached_pow = get_cached_power( + min_exp - (normalized.e + fp::significand_size), cached_exp10); + normalized = normalized * cached_pow; + fixed_handler handler{buf.data(), 0, precision, -cached_exp10, fixed}; + if (grisu_gen_digits(normalized, 1, exp, handler) == digits::error) + return snprintf_float(value, precision, specs, buf); + int num_digits = handler.size; + if (!fixed) { + // Remove trailing zeros. + while (num_digits > 0 && buf[num_digits - 1] == '0') { + --num_digits; + ++exp; + } + } + buf.resize(to_unsigned(num_digits)); + } + return exp - cached_exp10; +} + +template +int snprintf_float(T value, int precision, float_specs specs, + buffer& buf) { + // Buffer capacity must be non-zero, otherwise MSVC's vsnprintf_s will fail. + FMT_ASSERT(buf.capacity() > buf.size(), "empty buffer"); + static_assert(!std::is_same::value, ""); + + // Subtract 1 to account for the difference in precision since we use %e for + // both general and exponent format. + if (specs.format == float_format::general || + specs.format == float_format::exp) + precision = (precision >= 0 ? precision : 6) - 1; + + // Build the format string. + enum { max_format_size = 7 }; // Ths longest format is "%#.*Le". + char format[max_format_size]; + char* format_ptr = format; + *format_ptr++ = '%'; + if (specs.showpoint && specs.format == float_format::hex) *format_ptr++ = '#'; + if (precision >= 0) { + *format_ptr++ = '.'; + *format_ptr++ = '*'; + } + if (std::is_same()) *format_ptr++ = 'L'; + *format_ptr++ = specs.format != float_format::hex + ? (specs.format == float_format::fixed ? 'f' : 'e') + : (specs.upper ? 'A' : 'a'); + *format_ptr = '\0'; + + // Format using snprintf. + auto offset = buf.size(); + for (;;) { + auto begin = buf.data() + offset; + auto capacity = buf.capacity() - offset; +#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION + if (precision > 100000) + throw std::runtime_error( + "fuzz mode - avoid large allocation inside snprintf"); +#endif + // Suppress the warning about a nonliteral format string. + // Cannot use auto becase of a bug in MinGW (#1532). + int (*snprintf_ptr)(char*, size_t, const char*, ...) = FMT_SNPRINTF; + int result = precision >= 0 + ? snprintf_ptr(begin, capacity, format, precision, value) + : snprintf_ptr(begin, capacity, format, value); + if (result < 0) { + buf.reserve(buf.capacity() + 1); // The buffer will grow exponentially. + continue; + } + auto size = to_unsigned(result); + // Size equal to capacity means that the last character was truncated. + if (size >= capacity) { + buf.reserve(size + offset + 1); // Add 1 for the terminating '\0'. + continue; + } + auto is_digit = [](char c) { return c >= '0' && c <= '9'; }; + if (specs.format == float_format::fixed) { + if (precision == 0) { + buf.resize(size); + return 0; + } + // Find and remove the decimal point. + auto end = begin + size, p = end; + do { + --p; + } while (is_digit(*p)); + int fraction_size = static_cast(end - p - 1); + std::memmove(p, p + 1, to_unsigned(fraction_size)); + buf.resize(size - 1); + return -fraction_size; + } + if (specs.format == float_format::hex) { + buf.resize(size + offset); + return 0; + } + // Find and parse the exponent. + auto end = begin + size, exp_pos = end; + do { + --exp_pos; + } while (*exp_pos != 'e'); + char sign = exp_pos[1]; + assert(sign == '+' || sign == '-'); + int exp = 0; + auto p = exp_pos + 2; // Skip 'e' and sign. + do { + assert(is_digit(*p)); + exp = exp * 10 + (*p++ - '0'); + } while (p != end); + if (sign == '-') exp = -exp; + int fraction_size = 0; + if (exp_pos != begin + 1) { + // Remove trailing zeros. + auto fraction_end = exp_pos - 1; + while (*fraction_end == '0') --fraction_end; + // Move the fractional part left to get rid of the decimal point. + fraction_size = static_cast(fraction_end - begin - 1); + std::memmove(begin + 1, begin + 2, to_unsigned(fraction_size)); + } + buf.resize(to_unsigned(fraction_size) + offset + 1); + return exp - fraction_size; + } +} + +// A public domain branchless UTF-8 decoder by Christopher Wellons: +// https://github.com/skeeto/branchless-utf8 +/* Decode the next character, c, from buf, reporting errors in e. + * + * Since this is a branchless decoder, four bytes will be read from the + * buffer regardless of the actual length of the next character. This + * means the buffer _must_ have at least three bytes of zero padding + * following the end of the data stream. + * + * Errors are reported in e, which will be non-zero if the parsed + * character was somehow invalid: invalid byte sequence, non-canonical + * encoding, or a surrogate half. + * + * The function returns a pointer to the next character. When an error + * occurs, this pointer will be a guess that depends on the particular + * error, but it will always advance at least one byte. + */ +FMT_FUNC const char* utf8_decode(const char* buf, uint32_t* c, int* e) { + static const char lengths[] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, + 0, 0, 2, 2, 2, 2, 3, 3, 4, 0}; + static const int masks[] = {0x00, 0x7f, 0x1f, 0x0f, 0x07}; + static const uint32_t mins[] = {4194304, 0, 128, 2048, 65536}; + static const int shiftc[] = {0, 18, 12, 6, 0}; + static const int shifte[] = {0, 6, 4, 2, 0}; + + auto s = reinterpret_cast(buf); + int len = lengths[s[0] >> 3]; + + // Compute the pointer to the next character early so that the next + // iteration can start working on the next character. Neither Clang + // nor GCC figure out this reordering on their own. + const char* next = buf + len + !len; + + // Assume a four-byte character and load four bytes. Unused bits are + // shifted out. + *c = uint32_t(s[0] & masks[len]) << 18; + *c |= uint32_t(s[1] & 0x3f) << 12; + *c |= uint32_t(s[2] & 0x3f) << 6; + *c |= uint32_t(s[3] & 0x3f) << 0; + *c >>= shiftc[len]; + + // Accumulate the various error conditions. + *e = (*c < mins[len]) << 6; // non-canonical encoding + *e |= ((*c >> 11) == 0x1b) << 7; // surrogate half? + *e |= (*c > 0x10FFFF) << 8; // out of range? + *e |= (s[1] & 0xc0) >> 2; + *e |= (s[2] & 0xc0) >> 4; + *e |= (s[3]) >> 6; + *e ^= 0x2a; // top two bits of each tail byte correct? + *e >>= shifte[len]; + + return next; +} +} // namespace internal + +template <> struct formatter { + format_parse_context::iterator parse(format_parse_context& ctx) { + return ctx.begin(); + } + + format_context::iterator format(const internal::bigint& n, + format_context& ctx) { + auto out = ctx.out(); + bool first = true; + for (auto i = n.bigits_.size(); i > 0; --i) { + auto value = n.bigits_[i - 1u]; + if (first) { + out = format_to(out, "{:x}", value); + first = false; + continue; + } + out = format_to(out, "{:08x}", value); + } + if (n.exp_ > 0) + out = format_to(out, "p{}", n.exp_ * internal::bigint::bigit_bits); + return out; + } +}; + +FMT_FUNC internal::utf8_to_utf16::utf8_to_utf16(string_view s) { + auto transcode = [this](const char* p) { + auto cp = uint32_t(); + auto error = 0; + p = utf8_decode(p, &cp, &error); + if (error != 0) FMT_THROW(std::runtime_error("invalid utf8")); + if (cp <= 0xFFFF) { + buffer_.push_back(static_cast(cp)); + } else { + cp -= 0x10000; + buffer_.push_back(static_cast(0xD800 + (cp >> 10))); + buffer_.push_back(static_cast(0xDC00 + (cp & 0x3FF))); + } + return p; + }; + auto p = s.data(); + const size_t block_size = 4; // utf8_decode always reads blocks of 4 chars. + if (s.size() >= block_size) { + for (auto end = p + s.size() - block_size + 1; p < end;) p = transcode(p); + } + if (auto num_chars_left = s.data() + s.size() - p) { + char buf[2 * block_size - 1] = {}; + memcpy(buf, p, to_unsigned(num_chars_left)); + p = buf; + do { + p = transcode(p); + } while (p - buf < num_chars_left); + } + buffer_.push_back(0); +} + +FMT_FUNC void format_system_error(internal::buffer& out, int error_code, + string_view message) FMT_NOEXCEPT { + FMT_TRY { + memory_buffer buf; + buf.resize(inline_buffer_size); + for (;;) { + char* system_message = &buf[0]; + int result = + internal::safe_strerror(error_code, system_message, buf.size()); + if (result == 0) { + internal::writer w(out); + w.write(message); + w.write(": "); + w.write(system_message); + return; + } + if (result != ERANGE) + break; // Can't get error message, report error code instead. + buf.resize(buf.size() * 2); + } + } + FMT_CATCH(...) {} + format_error_code(out, error_code, message); +} + +FMT_FUNC void internal::error_handler::on_error(const char* message) { + FMT_THROW(format_error(message)); +} + +FMT_FUNC void report_system_error(int error_code, + fmt::string_view message) FMT_NOEXCEPT { + report_error(format_system_error, error_code, message); +} + +FMT_FUNC void vprint(std::FILE* f, string_view format_str, format_args args) { + memory_buffer buffer; + internal::vformat_to(buffer, format_str, + basic_format_args>(args)); +#ifdef _WIN32 + auto fd = _fileno(f); + if (_isatty(fd)) { + internal::utf8_to_utf16 u16(string_view(buffer.data(), buffer.size())); + auto written = DWORD(); + if (!WriteConsoleW(reinterpret_cast(_get_osfhandle(fd)), + u16.c_str(), static_cast(u16.size()), &written, + nullptr)) { + FMT_THROW(format_error("failed to write to console")); + } + return; + } +#endif + internal::fwrite_fully(buffer.data(), 1, buffer.size(), f); +} + +#ifdef _WIN32 +// Print assuming legacy (non-Unicode) encoding. +FMT_FUNC void internal::vprint_mojibake(std::FILE* f, string_view format_str, + format_args args) { + memory_buffer buffer; + internal::vformat_to(buffer, format_str, + basic_format_args>(args)); + fwrite_fully(buffer.data(), 1, buffer.size(), f); +} +#endif + +FMT_FUNC void vprint(string_view format_str, format_args args) { + vprint(stdout, format_str, args); +} + +FMT_END_NAMESPACE + +#ifdef _MSC_VER +# pragma warning(pop) +#endif + +#endif // FMT_FORMAT_INL_H_ diff --git a/packages/sqdlog.1.0.0/lib/native/include/spdlog/fmt/bundled/format.h b/packages/sqdlog.1.0.0/lib/native/include/spdlog/fmt/bundled/format.h new file mode 100644 index 0000000..4e96539 --- /dev/null +++ b/packages/sqdlog.1.0.0/lib/native/include/spdlog/fmt/bundled/format.h @@ -0,0 +1,3648 @@ +/* + Formatting library for C++ + + Copyright (c) 2012 - present, Victor Zverovich + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + --- Optional exception to the license --- + + As an exception, if, as a result of your compiling your source code, portions + of this Software are embedded into a machine-executable object form of such + source code, you may redistribute such embedded portions in such object form + without including the above copyright and permission notices. + */ + +#ifndef FMT_FORMAT_H_ +#define FMT_FORMAT_H_ + +#include +#include +#include +#include +#include +#include +#include + +#include "core.h" + +#ifdef FMT_DEPRECATED_INCLUDE_OS +# include "os.h" +#endif + +#ifdef __INTEL_COMPILER +# define FMT_ICC_VERSION __INTEL_COMPILER +#elif defined(__ICL) +# define FMT_ICC_VERSION __ICL +#else +# define FMT_ICC_VERSION 0 +#endif + +#ifdef __NVCC__ +# define FMT_CUDA_VERSION (__CUDACC_VER_MAJOR__ * 100 + __CUDACC_VER_MINOR__) +#else +# define FMT_CUDA_VERSION 0 +#endif + +#ifdef __has_builtin +# define FMT_HAS_BUILTIN(x) __has_builtin(x) +#else +# define FMT_HAS_BUILTIN(x) 0 +#endif + +#if FMT_GCC_VERSION || FMT_CLANG_VERSION +# define FMT_NOINLINE __attribute__((noinline)) +#else +# define FMT_NOINLINE +#endif + +#if __cplusplus == 201103L || __cplusplus == 201402L +# if defined(__clang__) +# define FMT_FALLTHROUGH [[clang::fallthrough]] +# elif FMT_GCC_VERSION >= 700 && !defined(__PGI) +# define FMT_FALLTHROUGH [[gnu::fallthrough]] +# else +# define FMT_FALLTHROUGH +# endif +#elif FMT_HAS_CPP17_ATTRIBUTE(fallthrough) || \ + (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) +# define FMT_FALLTHROUGH [[fallthrough]] +#else +# define FMT_FALLTHROUGH +#endif + +#ifndef FMT_THROW +# if FMT_EXCEPTIONS +# if FMT_MSC_VER || FMT_NVCC +FMT_BEGIN_NAMESPACE +namespace internal { +template inline void do_throw(const Exception& x) { + // Silence unreachable code warnings in MSVC and NVCC because these + // are nearly impossible to fix in a generic code. + volatile bool b = true; + if (b) throw x; +} +} // namespace internal +FMT_END_NAMESPACE +# define FMT_THROW(x) internal::do_throw(x) +# else +# define FMT_THROW(x) throw x +# endif +# else +# define FMT_THROW(x) \ + do { \ + static_cast(sizeof(x)); \ + FMT_ASSERT(false, ""); \ + } while (false) +# endif +#endif + +#if FMT_EXCEPTIONS +# define FMT_TRY try +# define FMT_CATCH(x) catch (x) +#else +# define FMT_TRY if (true) +# define FMT_CATCH(x) if (false) +#endif + +#ifndef FMT_USE_USER_DEFINED_LITERALS +// For Intel and NVIDIA compilers both they and the system gcc/msc support UDLs. +# if (FMT_HAS_FEATURE(cxx_user_literals) || FMT_GCC_VERSION >= 407 || \ + FMT_MSC_VER >= 1900) && \ + (!(FMT_ICC_VERSION || FMT_CUDA_VERSION) || FMT_ICC_VERSION >= 1500 || \ + FMT_CUDA_VERSION >= 700) +# define FMT_USE_USER_DEFINED_LITERALS 1 +# else +# define FMT_USE_USER_DEFINED_LITERALS 0 +# endif +#endif + +#ifndef FMT_USE_UDL_TEMPLATE +// EDG front end based compilers (icc, nvcc) and GCC < 6.4 do not propertly +// support UDL templates and GCC >= 9 warns about them. +# if FMT_USE_USER_DEFINED_LITERALS && FMT_ICC_VERSION == 0 && \ + FMT_CUDA_VERSION == 0 && \ + ((FMT_GCC_VERSION >= 604 && FMT_GCC_VERSION <= 900 && \ + __cplusplus >= 201402L) || \ + FMT_CLANG_VERSION >= 304) +# define FMT_USE_UDL_TEMPLATE 1 +# else +# define FMT_USE_UDL_TEMPLATE 0 +# endif +#endif + +#ifndef FMT_USE_FLOAT +# define FMT_USE_FLOAT 1 +#endif + +#ifndef FMT_USE_DOUBLE +# define FMT_USE_DOUBLE 1 +#endif + +#ifndef FMT_USE_LONG_DOUBLE +# define FMT_USE_LONG_DOUBLE 1 +#endif + +// __builtin_clz is broken in clang with Microsoft CodeGen: +// https://github.com/fmtlib/fmt/issues/519 +#if (FMT_GCC_VERSION || FMT_HAS_BUILTIN(__builtin_clz)) && !FMT_MSC_VER +# define FMT_BUILTIN_CLZ(n) __builtin_clz(n) +#endif +#if (FMT_GCC_VERSION || FMT_HAS_BUILTIN(__builtin_clzll)) && !FMT_MSC_VER +# define FMT_BUILTIN_CLZLL(n) __builtin_clzll(n) +#endif + +// Some compilers masquerade as both MSVC and GCC-likes or otherwise support +// __builtin_clz and __builtin_clzll, so only define FMT_BUILTIN_CLZ using the +// MSVC intrinsics if the clz and clzll builtins are not available. +#if FMT_MSC_VER && !defined(FMT_BUILTIN_CLZLL) && !defined(_MANAGED) +# include // _BitScanReverse, _BitScanReverse64 + +FMT_BEGIN_NAMESPACE +namespace internal { +// Avoid Clang with Microsoft CodeGen's -Wunknown-pragmas warning. +# ifndef __clang__ +# pragma intrinsic(_BitScanReverse) +# endif +inline uint32_t clz(uint32_t x) { + unsigned long r = 0; + _BitScanReverse(&r, x); + + FMT_ASSERT(x != 0, ""); + // Static analysis complains about using uninitialized data + // "r", but the only way that can happen is if "x" is 0, + // which the callers guarantee to not happen. +# pragma warning(suppress : 6102) + return 31 - r; +} +# define FMT_BUILTIN_CLZ(n) internal::clz(n) + +# if defined(_WIN64) && !defined(__clang__) +# pragma intrinsic(_BitScanReverse64) +# endif + +inline uint32_t clzll(uint64_t x) { + unsigned long r = 0; +# ifdef _WIN64 + _BitScanReverse64(&r, x); +# else + // Scan the high 32 bits. + if (_BitScanReverse(&r, static_cast(x >> 32))) return 63 - (r + 32); + + // Scan the low 32 bits. + _BitScanReverse(&r, static_cast(x)); +# endif + + FMT_ASSERT(x != 0, ""); + // Static analysis complains about using uninitialized data + // "r", but the only way that can happen is if "x" is 0, + // which the callers guarantee to not happen. +# pragma warning(suppress : 6102) + return 63 - r; +} +# define FMT_BUILTIN_CLZLL(n) internal::clzll(n) +} // namespace internal +FMT_END_NAMESPACE +#endif + +// Enable the deprecated numeric alignment. +#ifndef FMT_NUMERIC_ALIGN +# define FMT_NUMERIC_ALIGN 1 +#endif + +// Enable the deprecated percent specifier. +#ifndef FMT_DEPRECATED_PERCENT +# define FMT_DEPRECATED_PERCENT 0 +#endif + +FMT_BEGIN_NAMESPACE +namespace internal { + +// An equivalent of `*reinterpret_cast(&source)` that doesn't have +// undefined behavior (e.g. due to type aliasing). +// Example: uint64_t d = bit_cast(2.718); +template +inline Dest bit_cast(const Source& source) { + static_assert(sizeof(Dest) == sizeof(Source), "size mismatch"); + Dest dest; + std::memcpy(&dest, &source, sizeof(dest)); + return dest; +} + +inline bool is_big_endian() { + const auto u = 1u; + struct bytes { + char data[sizeof(u)]; + }; + return bit_cast(u).data[0] == 0; +} + +// A fallback implementation of uintptr_t for systems that lack it. +struct fallback_uintptr { + unsigned char value[sizeof(void*)]; + + fallback_uintptr() = default; + explicit fallback_uintptr(const void* p) { + *this = bit_cast(p); + if (is_big_endian()) { + for (size_t i = 0, j = sizeof(void*) - 1; i < j; ++i, --j) + std::swap(value[i], value[j]); + } + } +}; +#ifdef UINTPTR_MAX +using uintptr_t = ::uintptr_t; +inline uintptr_t to_uintptr(const void* p) { return bit_cast(p); } +#else +using uintptr_t = fallback_uintptr; +inline fallback_uintptr to_uintptr(const void* p) { + return fallback_uintptr(p); +} +#endif + +// Returns the largest possible value for type T. Same as +// std::numeric_limits::max() but shorter and not affected by the max macro. +template constexpr T max_value() { + return (std::numeric_limits::max)(); +} +template constexpr int num_bits() { + return std::numeric_limits::digits; +} +template <> constexpr int num_bits() { + return static_cast(sizeof(void*) * + std::numeric_limits::digits); +} + +// An approximation of iterator_t for pre-C++20 systems. +template +using iterator_t = decltype(std::begin(std::declval())); + +// Detect the iterator category of *any* given type in a SFINAE-friendly way. +// Unfortunately, older implementations of std::iterator_traits are not safe +// for use in a SFINAE-context. +template +struct iterator_category : std::false_type {}; + +template struct iterator_category { + using type = std::random_access_iterator_tag; +}; + +template +struct iterator_category> { + using type = typename It::iterator_category; +}; + +// Detect if *any* given type models the OutputIterator concept. +template class is_output_iterator { + // Check for mutability because all iterator categories derived from + // std::input_iterator_tag *may* also meet the requirements of an + // OutputIterator, thereby falling into the category of 'mutable iterators' + // [iterator.requirements.general] clause 4. The compiler reveals this + // property only at the point of *actually dereferencing* the iterator! + template + static decltype(*(std::declval())) test(std::input_iterator_tag); + template static char& test(std::output_iterator_tag); + template static const char& test(...); + + using type = decltype(test(typename iterator_category::type{})); + + public: + enum { value = !std::is_const>::value }; +}; + +// A workaround for std::string not having mutable data() until C++17. +template inline Char* get_data(std::basic_string& s) { + return &s[0]; +} +template +inline typename Container::value_type* get_data(Container& c) { + return c.data(); +} + +#if defined(_SECURE_SCL) && _SECURE_SCL +// Make a checked iterator to avoid MSVC warnings. +template using checked_ptr = stdext::checked_array_iterator; +template checked_ptr make_checked(T* p, std::size_t size) { + return {p, size}; +} +#else +template using checked_ptr = T*; +template inline T* make_checked(T* p, std::size_t) { return p; } +#endif + +template ::value)> +inline checked_ptr reserve( + std::back_insert_iterator& it, std::size_t n) { + Container& c = get_container(it); + std::size_t size = c.size(); + c.resize(size + n); + return make_checked(get_data(c) + size, n); +} + +template +inline Iterator& reserve(Iterator& it, std::size_t) { + return it; +} + +// An output iterator that counts the number of objects written to it and +// discards them. +class counting_iterator { + private: + std::size_t count_; + + public: + using iterator_category = std::output_iterator_tag; + using difference_type = std::ptrdiff_t; + using pointer = void; + using reference = void; + using _Unchecked_type = counting_iterator; // Mark iterator as checked. + + struct value_type { + template void operator=(const T&) {} + }; + + counting_iterator() : count_(0) {} + + std::size_t count() const { return count_; } + + counting_iterator& operator++() { + ++count_; + return *this; + } + + counting_iterator operator++(int) { + auto it = *this; + ++*this; + return it; + } + + value_type operator*() const { return {}; } +}; + +template class truncating_iterator_base { + protected: + OutputIt out_; + std::size_t limit_; + std::size_t count_; + + truncating_iterator_base(OutputIt out, std::size_t limit) + : out_(out), limit_(limit), count_(0) {} + + public: + using iterator_category = std::output_iterator_tag; + using value_type = typename std::iterator_traits::value_type; + using difference_type = void; + using pointer = void; + using reference = void; + using _Unchecked_type = + truncating_iterator_base; // Mark iterator as checked. + + OutputIt base() const { return out_; } + std::size_t count() const { return count_; } +}; + +// An output iterator that truncates the output and counts the number of objects +// written to it. +template ::value_type>::type> +class truncating_iterator; + +template +class truncating_iterator + : public truncating_iterator_base { + mutable typename truncating_iterator_base::value_type blackhole_; + + public: + using value_type = typename truncating_iterator_base::value_type; + + truncating_iterator(OutputIt out, std::size_t limit) + : truncating_iterator_base(out, limit) {} + + truncating_iterator& operator++() { + if (this->count_++ < this->limit_) ++this->out_; + return *this; + } + + truncating_iterator operator++(int) { + auto it = *this; + ++*this; + return it; + } + + value_type& operator*() const { + return this->count_ < this->limit_ ? *this->out_ : blackhole_; + } +}; + +template +class truncating_iterator + : public truncating_iterator_base { + public: + truncating_iterator(OutputIt out, std::size_t limit) + : truncating_iterator_base(out, limit) {} + + template truncating_iterator& operator=(T val) { + if (this->count_++ < this->limit_) *this->out_++ = val; + return *this; + } + + truncating_iterator& operator++() { return *this; } + truncating_iterator& operator++(int) { return *this; } + truncating_iterator& operator*() { return *this; } +}; + +// A range with the specified output iterator and value type. +template +class output_range { + private: + OutputIt it_; + + public: + using value_type = T; + using iterator = OutputIt; + struct sentinel {}; + + explicit output_range(OutputIt it) : it_(it) {} + OutputIt begin() const { return it_; } + sentinel end() const { return {}; } // Sentinel is not used yet. +}; + +template +inline size_t count_code_points(basic_string_view s) { + return s.size(); +} + +// Counts the number of code points in a UTF-8 string. +inline size_t count_code_points(basic_string_view s) { + const char* data = s.data(); + size_t num_code_points = 0; + for (size_t i = 0, size = s.size(); i != size; ++i) { + if ((data[i] & 0xc0) != 0x80) ++num_code_points; + } + return num_code_points; +} + +inline size_t count_code_points(basic_string_view s) { + return count_code_points(basic_string_view( + reinterpret_cast(s.data()), s.size())); +} + +template +inline size_t code_point_index(basic_string_view s, size_t n) { + size_t size = s.size(); + return n < size ? n : size; +} + +// Calculates the index of the nth code point in a UTF-8 string. +inline size_t code_point_index(basic_string_view s, size_t n) { + const char8_type* data = s.data(); + size_t num_code_points = 0; + for (size_t i = 0, size = s.size(); i != size; ++i) { + if ((data[i] & 0xc0) != 0x80 && ++num_code_points > n) { + return i; + } + } + return s.size(); +} + +inline char8_type to_char8_t(char c) { return static_cast(c); } + +template +using needs_conversion = bool_constant< + std::is_same::value_type, + char>::value && + std::is_same::value>; + +template ::value)> +OutputIt copy_str(InputIt begin, InputIt end, OutputIt it) { + return std::copy(begin, end, it); +} + +template ::value)> +OutputIt copy_str(InputIt begin, InputIt end, OutputIt it) { + return std::transform(begin, end, it, to_char8_t); +} + +#ifndef FMT_USE_GRISU +# define FMT_USE_GRISU 1 +#endif + +template constexpr bool use_grisu() { + return FMT_USE_GRISU && std::numeric_limits::is_iec559 && + sizeof(T) <= sizeof(double); +} + +template +template +void buffer::append(const U* begin, const U* end) { + std::size_t new_size = size_ + to_unsigned(end - begin); + reserve(new_size); + std::uninitialized_copy(begin, end, make_checked(ptr_, capacity_) + size_); + size_ = new_size; +} +} // namespace internal + +// A range with an iterator appending to a buffer. +template +class buffer_range : public internal::output_range< + std::back_insert_iterator>, T> { + public: + using iterator = std::back_insert_iterator>; + using internal::output_range::output_range; + buffer_range(internal::buffer& buf) + : internal::output_range(std::back_inserter(buf)) {} +}; + +class FMT_DEPRECATED u8string_view + : public basic_string_view { + public: + u8string_view(const char* s) + : basic_string_view( + reinterpret_cast(s)) {} + u8string_view(const char* s, size_t count) FMT_NOEXCEPT + : basic_string_view( + reinterpret_cast(s), count) {} +}; + +#if FMT_USE_USER_DEFINED_LITERALS +inline namespace literals { +FMT_DEPRECATED inline basic_string_view operator"" _u( + const char* s, std::size_t n) { + return {reinterpret_cast(s), n}; +} +} // namespace literals +#endif + +// The number of characters to store in the basic_memory_buffer object itself +// to avoid dynamic memory allocation. +enum { inline_buffer_size = 500 }; + +/** + \rst + A dynamically growing memory buffer for trivially copyable/constructible types + with the first ``SIZE`` elements stored in the object itself. + + You can use one of the following type aliases for common character types: + + +----------------+------------------------------+ + | Type | Definition | + +================+==============================+ + | memory_buffer | basic_memory_buffer | + +----------------+------------------------------+ + | wmemory_buffer | basic_memory_buffer | + +----------------+------------------------------+ + + **Example**:: + + fmt::memory_buffer out; + format_to(out, "The answer is {}.", 42); + + This will append the following output to the ``out`` object: + + .. code-block:: none + + The answer is 42. + + The output can be converted to an ``std::string`` with ``to_string(out)``. + \endrst + */ +template > +class basic_memory_buffer : private Allocator, public internal::buffer { + private: + T store_[SIZE]; + + // Deallocate memory allocated by the buffer. + void deallocate() { + T* data = this->data(); + if (data != store_) Allocator::deallocate(data, this->capacity()); + } + + protected: + void grow(std::size_t size) FMT_OVERRIDE; + + public: + using value_type = T; + using const_reference = const T&; + + explicit basic_memory_buffer(const Allocator& alloc = Allocator()) + : Allocator(alloc) { + this->set(store_, SIZE); + } + ~basic_memory_buffer() FMT_OVERRIDE { deallocate(); } + + private: + // Move data from other to this buffer. + void move(basic_memory_buffer& other) { + Allocator &this_alloc = *this, &other_alloc = other; + this_alloc = std::move(other_alloc); + T* data = other.data(); + std::size_t size = other.size(), capacity = other.capacity(); + if (data == other.store_) { + this->set(store_, capacity); + std::uninitialized_copy(other.store_, other.store_ + size, + internal::make_checked(store_, capacity)); + } else { + this->set(data, capacity); + // Set pointer to the inline array so that delete is not called + // when deallocating. + other.set(other.store_, 0); + } + this->resize(size); + } + + public: + /** + \rst + Constructs a :class:`fmt::basic_memory_buffer` object moving the content + of the other object to it. + \endrst + */ + basic_memory_buffer(basic_memory_buffer&& other) FMT_NOEXCEPT { move(other); } + + /** + \rst + Moves the content of the other ``basic_memory_buffer`` object to this one. + \endrst + */ + basic_memory_buffer& operator=(basic_memory_buffer&& other) FMT_NOEXCEPT { + FMT_ASSERT(this != &other, ""); + deallocate(); + move(other); + return *this; + } + + // Returns a copy of the allocator associated with this buffer. + Allocator get_allocator() const { return *this; } +}; + +template +void basic_memory_buffer::grow(std::size_t size) { +#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION + if (size > 1000) throw std::runtime_error("fuzz mode - won't grow that much"); +#endif + std::size_t old_capacity = this->capacity(); + std::size_t new_capacity = old_capacity + old_capacity / 2; + if (size > new_capacity) new_capacity = size; + T* old_data = this->data(); + T* new_data = std::allocator_traits::allocate(*this, new_capacity); + // The following code doesn't throw, so the raw pointer above doesn't leak. + std::uninitialized_copy(old_data, old_data + this->size(), + internal::make_checked(new_data, new_capacity)); + this->set(new_data, new_capacity); + // deallocate must not throw according to the standard, but even if it does, + // the buffer already uses the new storage and will deallocate it in + // destructor. + if (old_data != store_) Allocator::deallocate(old_data, old_capacity); +} + +using memory_buffer = basic_memory_buffer; +using wmemory_buffer = basic_memory_buffer; + +/** A formatting error such as invalid format string. */ +FMT_CLASS_API +class FMT_API format_error : public std::runtime_error { + public: + explicit format_error(const char* message) : std::runtime_error(message) {} + explicit format_error(const std::string& message) + : std::runtime_error(message) {} + format_error(const format_error&) = default; + format_error& operator=(const format_error&) = default; + format_error(format_error&&) = default; + format_error& operator=(format_error&&) = default; + ~format_error() FMT_NOEXCEPT FMT_OVERRIDE; +}; + +namespace internal { + +// Returns true if value is negative, false otherwise. +// Same as `value < 0` but doesn't produce warnings if T is an unsigned type. +template ::is_signed)> +FMT_CONSTEXPR bool is_negative(T value) { + return value < 0; +} +template ::is_signed)> +FMT_CONSTEXPR bool is_negative(T) { + return false; +} + +template ::value)> +FMT_CONSTEXPR bool is_supported_floating_point(T) { + return (std::is_same::value && FMT_USE_FLOAT) || + (std::is_same::value && FMT_USE_DOUBLE) || + (std::is_same::value && FMT_USE_LONG_DOUBLE); +} + +// Smallest of uint32_t, uint64_t, uint128_t that is large enough to +// represent all values of T. +template +using uint32_or_64_or_128_t = conditional_t< + std::numeric_limits::digits <= 32, uint32_t, + conditional_t::digits <= 64, uint64_t, uint128_t>>; + +// Static data is placed in this class template for the header-only config. +template struct FMT_EXTERN_TEMPLATE_API basic_data { + static const uint64_t powers_of_10_64[]; + static const uint32_t zero_or_powers_of_10_32[]; + static const uint64_t zero_or_powers_of_10_64[]; + static const uint64_t pow10_significands[]; + static const int16_t pow10_exponents[]; + static const char digits[]; + static const char hex_digits[]; + static const char foreground_color[]; + static const char background_color[]; + static const char reset_color[5]; + static const wchar_t wreset_color[5]; + static const char signs[]; +}; + +FMT_EXTERN template struct basic_data; + +// This is a struct rather than an alias to avoid shadowing warnings in gcc. +struct data : basic_data<> {}; + +#ifdef FMT_BUILTIN_CLZLL +// Returns the number of decimal digits in n. Leading zeros are not counted +// except for n == 0 in which case count_digits returns 1. +inline int count_digits(uint64_t n) { + // Based on http://graphics.stanford.edu/~seander/bithacks.html#IntegerLog10 + // and the benchmark https://github.com/localvoid/cxx-benchmark-count-digits. + int t = (64 - FMT_BUILTIN_CLZLL(n | 1)) * 1233 >> 12; + return t - (n < data::zero_or_powers_of_10_64[t]) + 1; +} +#else +// Fallback version of count_digits used when __builtin_clz is not available. +inline int count_digits(uint64_t n) { + int count = 1; + for (;;) { + // Integer division is slow so do it for a group of four digits instead + // of for every digit. The idea comes from the talk by Alexandrescu + // "Three Optimization Tips for C++". See speed-test for a comparison. + if (n < 10) return count; + if (n < 100) return count + 1; + if (n < 1000) return count + 2; + if (n < 10000) return count + 3; + n /= 10000u; + count += 4; + } +} +#endif + +#if FMT_USE_INT128 +inline int count_digits(uint128_t n) { + int count = 1; + for (;;) { + // Integer division is slow so do it for a group of four digits instead + // of for every digit. The idea comes from the talk by Alexandrescu + // "Three Optimization Tips for C++". See speed-test for a comparison. + if (n < 10) return count; + if (n < 100) return count + 1; + if (n < 1000) return count + 2; + if (n < 10000) return count + 3; + n /= 10000U; + count += 4; + } +} +#endif + +// Counts the number of digits in n. BITS = log2(radix). +template inline int count_digits(UInt n) { + int num_digits = 0; + do { + ++num_digits; + } while ((n >>= BITS) != 0); + return num_digits; +} + +template <> int count_digits<4>(internal::fallback_uintptr n); + +#if FMT_GCC_VERSION || FMT_CLANG_VERSION +# define FMT_ALWAYS_INLINE inline __attribute__((always_inline)) +#else +# define FMT_ALWAYS_INLINE +#endif + +#ifdef FMT_BUILTIN_CLZ +// Optional version of count_digits for better performance on 32-bit platforms. +inline int count_digits(uint32_t n) { + int t = (32 - FMT_BUILTIN_CLZ(n | 1)) * 1233 >> 12; + return t - (n < data::zero_or_powers_of_10_32[t]) + 1; +} +#endif + +template FMT_API std::string grouping_impl(locale_ref loc); +template inline std::string grouping(locale_ref loc) { + return grouping_impl(loc); +} +template <> inline std::string grouping(locale_ref loc) { + return grouping_impl(loc); +} + +template FMT_API Char thousands_sep_impl(locale_ref loc); +template inline Char thousands_sep(locale_ref loc) { + return Char(thousands_sep_impl(loc)); +} +template <> inline wchar_t thousands_sep(locale_ref loc) { + return thousands_sep_impl(loc); +} + +template FMT_API Char decimal_point_impl(locale_ref loc); +template inline Char decimal_point(locale_ref loc) { + return Char(decimal_point_impl(loc)); +} +template <> inline wchar_t decimal_point(locale_ref loc) { + return decimal_point_impl(loc); +} + +// Formats a decimal unsigned integer value writing into buffer. +// add_thousands_sep is called after writing each char to add a thousands +// separator if necessary. +template +inline Char* format_decimal(Char* buffer, UInt value, int num_digits, + F add_thousands_sep) { + FMT_ASSERT(num_digits >= 0, "invalid digit count"); + buffer += num_digits; + Char* end = buffer; + while (value >= 100) { + // Integer division is slow so do it for a group of two digits instead + // of for every digit. The idea comes from the talk by Alexandrescu + // "Three Optimization Tips for C++". See speed-test for a comparison. + auto index = static_cast((value % 100) * 2); + value /= 100; + *--buffer = static_cast(data::digits[index + 1]); + add_thousands_sep(buffer); + *--buffer = static_cast(data::digits[index]); + add_thousands_sep(buffer); + } + if (value < 10) { + *--buffer = static_cast('0' + value); + return end; + } + auto index = static_cast(value * 2); + *--buffer = static_cast(data::digits[index + 1]); + add_thousands_sep(buffer); + *--buffer = static_cast(data::digits[index]); + return end; +} + +template constexpr int digits10() FMT_NOEXCEPT { + return std::numeric_limits::digits10; +} +template <> constexpr int digits10() FMT_NOEXCEPT { return 38; } +template <> constexpr int digits10() FMT_NOEXCEPT { return 38; } + +template +inline Iterator format_decimal(Iterator out, UInt value, int num_digits, + F add_thousands_sep) { + FMT_ASSERT(num_digits >= 0, "invalid digit count"); + // Buffer should be large enough to hold all digits (<= digits10 + 1). + enum { max_size = digits10() + 1 }; + Char buffer[2 * max_size]; + auto end = format_decimal(buffer, value, num_digits, add_thousands_sep); + return internal::copy_str(buffer, end, out); +} + +template +inline It format_decimal(It out, UInt value, int num_digits) { + return format_decimal(out, value, num_digits, [](Char*) {}); +} + +template +inline Char* format_uint(Char* buffer, UInt value, int num_digits, + bool upper = false) { + buffer += num_digits; + Char* end = buffer; + do { + const char* digits = upper ? "0123456789ABCDEF" : data::hex_digits; + unsigned digit = (value & ((1 << BASE_BITS) - 1)); + *--buffer = static_cast(BASE_BITS < 4 ? static_cast('0' + digit) + : digits[digit]); + } while ((value >>= BASE_BITS) != 0); + return end; +} + +template +Char* format_uint(Char* buffer, internal::fallback_uintptr n, int num_digits, + bool = false) { + auto char_digits = std::numeric_limits::digits / 4; + int start = (num_digits + char_digits - 1) / char_digits - 1; + if (int start_digits = num_digits % char_digits) { + unsigned value = n.value[start--]; + buffer = format_uint(buffer, value, start_digits); + } + for (; start >= 0; --start) { + unsigned value = n.value[start]; + buffer += char_digits; + auto p = buffer; + for (int i = 0; i < char_digits; ++i) { + unsigned digit = (value & ((1 << BASE_BITS) - 1)); + *--p = static_cast(data::hex_digits[digit]); + value >>= BASE_BITS; + } + } + return buffer; +} + +template +inline It format_uint(It out, UInt value, int num_digits, bool upper = false) { + // Buffer should be large enough to hold all digits (digits / BASE_BITS + 1). + char buffer[num_bits() / BASE_BITS + 1]; + format_uint(buffer, value, num_digits, upper); + return internal::copy_str(buffer, buffer + num_digits, out); +} + +// A converter from UTF-8 to UTF-16. +class utf8_to_utf16 { + private: + wmemory_buffer buffer_; + + public: + FMT_API explicit utf8_to_utf16(string_view s); + operator wstring_view() const { return {&buffer_[0], size()}; } + size_t size() const { return buffer_.size() - 1; } + const wchar_t* c_str() const { return &buffer_[0]; } + std::wstring str() const { return {&buffer_[0], size()}; } +}; + +template struct null {}; + +// Workaround an array initialization issue in gcc 4.8. +template struct fill_t { + private: + enum { max_size = 4 }; + Char data_[max_size]; + unsigned char size_; + + public: + FMT_CONSTEXPR void operator=(basic_string_view s) { + auto size = s.size(); + if (size > max_size) { + FMT_THROW(format_error("invalid fill")); + return; + } + for (size_t i = 0; i < size; ++i) data_[i] = s[i]; + size_ = static_cast(size); + } + + size_t size() const { return size_; } + const Char* data() const { return data_; } + + FMT_CONSTEXPR Char& operator[](size_t index) { return data_[index]; } + FMT_CONSTEXPR const Char& operator[](size_t index) const { + return data_[index]; + } + + static FMT_CONSTEXPR fill_t make() { + auto fill = fill_t(); + fill[0] = Char(' '); + fill.size_ = 1; + return fill; + } +}; +} // namespace internal + +// We cannot use enum classes as bit fields because of a gcc bug +// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61414. +namespace align { +enum type { none, left, right, center, numeric }; +} +using align_t = align::type; + +namespace sign { +enum type { none, minus, plus, space }; +} +using sign_t = sign::type; + +// Format specifiers for built-in and string types. +template struct basic_format_specs { + int width; + int precision; + char type; + align_t align : 4; + sign_t sign : 3; + bool alt : 1; // Alternate form ('#'). + internal::fill_t fill; + + constexpr basic_format_specs() + : width(0), + precision(-1), + type(0), + align(align::none), + sign(sign::none), + alt(false), + fill(internal::fill_t::make()) {} +}; + +using format_specs = basic_format_specs; + +namespace internal { + +// A floating-point presentation format. +enum class float_format : unsigned char { + general, // General: exponent notation or fixed point based on magnitude. + exp, // Exponent notation with the default precision of 6, e.g. 1.2e-3. + fixed, // Fixed point with the default precision of 6, e.g. 0.0012. + hex +}; + +struct float_specs { + int precision; + float_format format : 8; + sign_t sign : 8; + bool upper : 1; + bool locale : 1; + bool percent : 1; + bool binary32 : 1; + bool use_grisu : 1; + bool showpoint : 1; +}; + +// Writes the exponent exp in the form "[+-]d{2,3}" to buffer. +template It write_exponent(int exp, It it) { + FMT_ASSERT(-10000 < exp && exp < 10000, "exponent out of range"); + if (exp < 0) { + *it++ = static_cast('-'); + exp = -exp; + } else { + *it++ = static_cast('+'); + } + if (exp >= 100) { + const char* top = data::digits + (exp / 100) * 2; + if (exp >= 1000) *it++ = static_cast(top[0]); + *it++ = static_cast(top[1]); + exp %= 100; + } + const char* d = data::digits + exp * 2; + *it++ = static_cast(d[0]); + *it++ = static_cast(d[1]); + return it; +} + +template class float_writer { + private: + // The number is given as v = digits_ * pow(10, exp_). + const char* digits_; + int num_digits_; + int exp_; + size_t size_; + float_specs specs_; + Char decimal_point_; + + template It prettify(It it) const { + // pow(10, full_exp - 1) <= v <= pow(10, full_exp). + int full_exp = num_digits_ + exp_; + if (specs_.format == float_format::exp) { + // Insert a decimal point after the first digit and add an exponent. + *it++ = static_cast(*digits_); + int num_zeros = specs_.precision - num_digits_; + if (num_digits_ > 1 || specs_.showpoint) *it++ = decimal_point_; + it = copy_str(digits_ + 1, digits_ + num_digits_, it); + if (num_zeros > 0 && specs_.showpoint) + it = std::fill_n(it, num_zeros, static_cast('0')); + *it++ = static_cast(specs_.upper ? 'E' : 'e'); + return write_exponent(full_exp - 1, it); + } + if (num_digits_ <= full_exp) { + // 1234e7 -> 12340000000[.0+] + it = copy_str(digits_, digits_ + num_digits_, it); + it = std::fill_n(it, full_exp - num_digits_, static_cast('0')); + if (specs_.showpoint || specs_.precision < 0) { + *it++ = decimal_point_; + int num_zeros = specs_.precision - full_exp; + if (num_zeros <= 0) { + if (specs_.format != float_format::fixed) + *it++ = static_cast('0'); + return it; + } +#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION + if (num_zeros > 1000) + throw std::runtime_error("fuzz mode - avoiding excessive cpu use"); +#endif + it = std::fill_n(it, num_zeros, static_cast('0')); + } + } else if (full_exp > 0) { + // 1234e-2 -> 12.34[0+] + it = copy_str(digits_, digits_ + full_exp, it); + if (!specs_.showpoint) { + // Remove trailing zeros. + int num_digits = num_digits_; + while (num_digits > full_exp && digits_[num_digits - 1] == '0') + --num_digits; + if (num_digits != full_exp) *it++ = decimal_point_; + return copy_str(digits_ + full_exp, digits_ + num_digits, it); + } + *it++ = decimal_point_; + it = copy_str(digits_ + full_exp, digits_ + num_digits_, it); + if (specs_.precision > num_digits_) { + // Add trailing zeros. + int num_zeros = specs_.precision - num_digits_; + it = std::fill_n(it, num_zeros, static_cast('0')); + } + } else { + // 1234e-6 -> 0.001234 + *it++ = static_cast('0'); + int num_zeros = -full_exp; + int num_digits = num_digits_; + if (num_digits == 0 && specs_.precision >= 0 && + specs_.precision < num_zeros) { + num_zeros = specs_.precision; + } + // Remove trailing zeros. + if (!specs_.showpoint) + while (num_digits > 0 && digits_[num_digits - 1] == '0') --num_digits; + if (num_zeros != 0 || num_digits != 0 || specs_.showpoint) { + *it++ = decimal_point_; + it = std::fill_n(it, num_zeros, static_cast('0')); + it = copy_str(digits_, digits_ + num_digits, it); + } + } + return it; + } + + public: + float_writer(const char* digits, int num_digits, int exp, float_specs specs, + Char decimal_point) + : digits_(digits), + num_digits_(num_digits), + exp_(exp), + specs_(specs), + decimal_point_(decimal_point) { + int full_exp = num_digits + exp - 1; + int precision = specs.precision > 0 ? specs.precision : 16; + if (specs_.format == float_format::general && + !(full_exp >= -4 && full_exp < precision)) { + specs_.format = float_format::exp; + } + size_ = prettify(counting_iterator()).count(); + size_ += specs.sign ? 1 : 0; + } + + size_t size() const { return size_; } + size_t width() const { return size(); } + + template void operator()(It&& it) { + if (specs_.sign) *it++ = static_cast(data::signs[specs_.sign]); + it = prettify(it); + } +}; + +template +int format_float(T value, int precision, float_specs specs, buffer& buf); + +// Formats a floating-point number with snprintf. +template +int snprintf_float(T value, int precision, float_specs specs, + buffer& buf); + +template T promote_float(T value) { return value; } +inline double promote_float(float value) { return static_cast(value); } + +template +FMT_CONSTEXPR void handle_int_type_spec(char spec, Handler&& handler) { + switch (spec) { + case 0: + case 'd': + handler.on_dec(); + break; + case 'x': + case 'X': + handler.on_hex(); + break; + case 'b': + case 'B': + handler.on_bin(); + break; + case 'o': + handler.on_oct(); + break; + case 'n': + case 'L': + handler.on_num(); + break; + default: + handler.on_error(); + } +} + +template +FMT_CONSTEXPR float_specs parse_float_type_spec( + const basic_format_specs& specs, ErrorHandler&& eh = {}) { + auto result = float_specs(); + result.showpoint = specs.alt; + switch (specs.type) { + case 0: + result.format = float_format::general; + result.showpoint |= specs.precision > 0; + break; + case 'G': + result.upper = true; + FMT_FALLTHROUGH; + case 'g': + result.format = float_format::general; + break; + case 'E': + result.upper = true; + FMT_FALLTHROUGH; + case 'e': + result.format = float_format::exp; + result.showpoint |= specs.precision != 0; + break; + case 'F': + result.upper = true; + FMT_FALLTHROUGH; + case 'f': + result.format = float_format::fixed; + result.showpoint |= specs.precision != 0; + break; +#if FMT_DEPRECATED_PERCENT + case '%': + result.format = float_format::fixed; + result.percent = true; + break; +#endif + case 'A': + result.upper = true; + FMT_FALLTHROUGH; + case 'a': + result.format = float_format::hex; + break; + case 'n': + result.locale = true; + break; + default: + eh.on_error("invalid type specifier"); + break; + } + return result; +} + +template +FMT_CONSTEXPR void handle_char_specs(const basic_format_specs* specs, + Handler&& handler) { + if (!specs) return handler.on_char(); + if (specs->type && specs->type != 'c') return handler.on_int(); + if (specs->align == align::numeric || specs->sign != sign::none || specs->alt) + handler.on_error("invalid format specifier for char"); + handler.on_char(); +} + +template +FMT_CONSTEXPR void handle_cstring_type_spec(Char spec, Handler&& handler) { + if (spec == 0 || spec == 's') + handler.on_string(); + else if (spec == 'p') + handler.on_pointer(); + else + handler.on_error("invalid type specifier"); +} + +template +FMT_CONSTEXPR void check_string_type_spec(Char spec, ErrorHandler&& eh) { + if (spec != 0 && spec != 's') eh.on_error("invalid type specifier"); +} + +template +FMT_CONSTEXPR void check_pointer_type_spec(Char spec, ErrorHandler&& eh) { + if (spec != 0 && spec != 'p') eh.on_error("invalid type specifier"); +} + +template class int_type_checker : private ErrorHandler { + public: + FMT_CONSTEXPR explicit int_type_checker(ErrorHandler eh) : ErrorHandler(eh) {} + + FMT_CONSTEXPR void on_dec() {} + FMT_CONSTEXPR void on_hex() {} + FMT_CONSTEXPR void on_bin() {} + FMT_CONSTEXPR void on_oct() {} + FMT_CONSTEXPR void on_num() {} + + FMT_CONSTEXPR void on_error() { + ErrorHandler::on_error("invalid type specifier"); + } +}; + +template +class char_specs_checker : public ErrorHandler { + private: + char type_; + + public: + FMT_CONSTEXPR char_specs_checker(char type, ErrorHandler eh) + : ErrorHandler(eh), type_(type) {} + + FMT_CONSTEXPR void on_int() { + handle_int_type_spec(type_, int_type_checker(*this)); + } + FMT_CONSTEXPR void on_char() {} +}; + +template +class cstring_type_checker : public ErrorHandler { + public: + FMT_CONSTEXPR explicit cstring_type_checker(ErrorHandler eh) + : ErrorHandler(eh) {} + + FMT_CONSTEXPR void on_string() {} + FMT_CONSTEXPR void on_pointer() {} +}; + +template +void arg_map::init(const basic_format_args& args) { + if (map_) return; + map_ = new entry[internal::to_unsigned(args.max_size())]; + if (args.is_packed()) { + for (int i = 0;; ++i) { + internal::type arg_type = args.type(i); + if (arg_type == internal::type::none_type) return; + if (arg_type == internal::type::named_arg_type) + push_back(args.values_[i]); + } + } + for (int i = 0, n = args.max_size(); i < n; ++i) { + auto type = args.args_[i].type_; + if (type == internal::type::named_arg_type) push_back(args.args_[i].value_); + } +} + +template struct nonfinite_writer { + sign_t sign; + const char* str; + static constexpr size_t str_size = 3; + + size_t size() const { return str_size + (sign ? 1 : 0); } + size_t width() const { return size(); } + + template void operator()(It&& it) const { + if (sign) *it++ = static_cast(data::signs[sign]); + it = copy_str(str, str + str_size, it); + } +}; + +template +FMT_NOINLINE OutputIt fill(OutputIt it, size_t n, const fill_t& fill) { + auto fill_size = fill.size(); + if (fill_size == 1) return std::fill_n(it, n, fill[0]); + for (size_t i = 0; i < n; ++i) it = std::copy_n(fill.data(), fill_size, it); + return it; +} + +// This template provides operations for formatting and writing data into a +// character range. +template class basic_writer { + public: + using char_type = typename Range::value_type; + using iterator = typename Range::iterator; + using format_specs = basic_format_specs; + + private: + iterator out_; // Output iterator. + locale_ref locale_; + + // Attempts to reserve space for n extra characters in the output range. + // Returns a pointer to the reserved range or a reference to out_. + auto reserve(std::size_t n) -> decltype(internal::reserve(out_, n)) { + return internal::reserve(out_, n); + } + + template struct padded_int_writer { + size_t size_; + string_view prefix; + char_type fill; + std::size_t padding; + F f; + + size_t size() const { return size_; } + size_t width() const { return size_; } + + template void operator()(It&& it) const { + if (prefix.size() != 0) + it = copy_str(prefix.begin(), prefix.end(), it); + it = std::fill_n(it, padding, fill); + f(it); + } + }; + + // Writes an integer in the format + // + // where are written by f(it). + template + void write_int(int num_digits, string_view prefix, format_specs specs, F f) { + std::size_t size = prefix.size() + to_unsigned(num_digits); + char_type fill = specs.fill[0]; + std::size_t padding = 0; + if (specs.align == align::numeric) { + auto unsiged_width = to_unsigned(specs.width); + if (unsiged_width > size) { + padding = unsiged_width - size; + size = unsiged_width; + } + } else if (specs.precision > num_digits) { + size = prefix.size() + to_unsigned(specs.precision); + padding = to_unsigned(specs.precision - num_digits); + fill = static_cast('0'); + } + if (specs.align == align::none) specs.align = align::right; + write_padded(specs, padded_int_writer{size, prefix, fill, padding, f}); + } + + // Writes a decimal integer. + template void write_decimal(Int value) { + auto abs_value = static_cast>(value); + bool negative = is_negative(value); + // Don't do -abs_value since it trips unsigned-integer-overflow sanitizer. + if (negative) abs_value = ~abs_value + 1; + int num_digits = count_digits(abs_value); + auto&& it = reserve((negative ? 1 : 0) + static_cast(num_digits)); + if (negative) *it++ = static_cast('-'); + it = format_decimal(it, abs_value, num_digits); + } + + // The handle_int_type_spec handler that writes an integer. + template struct int_writer { + using unsigned_type = uint32_or_64_or_128_t; + + basic_writer& writer; + const Specs& specs; + unsigned_type abs_value; + char prefix[4]; + unsigned prefix_size; + + string_view get_prefix() const { return string_view(prefix, prefix_size); } + + int_writer(basic_writer& w, Int value, const Specs& s) + : writer(w), + specs(s), + abs_value(static_cast(value)), + prefix_size(0) { + if (is_negative(value)) { + prefix[0] = '-'; + ++prefix_size; + abs_value = 0 - abs_value; + } else if (specs.sign != sign::none && specs.sign != sign::minus) { + prefix[0] = specs.sign == sign::plus ? '+' : ' '; + ++prefix_size; + } + } + + struct dec_writer { + unsigned_type abs_value; + int num_digits; + + template void operator()(It&& it) const { + it = internal::format_decimal(it, abs_value, num_digits); + } + }; + + void on_dec() { + int num_digits = count_digits(abs_value); + writer.write_int(num_digits, get_prefix(), specs, + dec_writer{abs_value, num_digits}); + } + + struct hex_writer { + int_writer& self; + int num_digits; + + template void operator()(It&& it) const { + it = format_uint<4, char_type>(it, self.abs_value, num_digits, + self.specs.type != 'x'); + } + }; + + void on_hex() { + if (specs.alt) { + prefix[prefix_size++] = '0'; + prefix[prefix_size++] = specs.type; + } + int num_digits = count_digits<4>(abs_value); + writer.write_int(num_digits, get_prefix(), specs, + hex_writer{*this, num_digits}); + } + + template struct bin_writer { + unsigned_type abs_value; + int num_digits; + + template void operator()(It&& it) const { + it = format_uint(it, abs_value, num_digits); + } + }; + + void on_bin() { + if (specs.alt) { + prefix[prefix_size++] = '0'; + prefix[prefix_size++] = static_cast(specs.type); + } + int num_digits = count_digits<1>(abs_value); + writer.write_int(num_digits, get_prefix(), specs, + bin_writer<1>{abs_value, num_digits}); + } + + void on_oct() { + int num_digits = count_digits<3>(abs_value); + if (specs.alt && specs.precision <= num_digits && abs_value != 0) { + // Octal prefix '0' is counted as a digit, so only add it if precision + // is not greater than the number of digits. + prefix[prefix_size++] = '0'; + } + writer.write_int(num_digits, get_prefix(), specs, + bin_writer<3>{abs_value, num_digits}); + } + + enum { sep_size = 1 }; + + struct num_writer { + unsigned_type abs_value; + int size; + const std::string& groups; + char_type sep; + + template void operator()(It&& it) const { + basic_string_view s(&sep, sep_size); + // Index of a decimal digit with the least significant digit having + // index 0. + int digit_index = 0; + std::string::const_iterator group = groups.cbegin(); + it = format_decimal( + it, abs_value, size, + [this, s, &group, &digit_index](char_type*& buffer) { + if (*group <= 0 || ++digit_index % *group != 0 || + *group == max_value()) + return; + if (group + 1 != groups.cend()) { + digit_index = 0; + ++group; + } + buffer -= s.size(); + std::uninitialized_copy(s.data(), s.data() + s.size(), + make_checked(buffer, s.size())); + }); + } + }; + + void on_num() { + std::string groups = grouping(writer.locale_); + if (groups.empty()) return on_dec(); + auto sep = thousands_sep(writer.locale_); + if (!sep) return on_dec(); + int num_digits = count_digits(abs_value); + int size = num_digits; + std::string::const_iterator group = groups.cbegin(); + while (group != groups.cend() && num_digits > *group && *group > 0 && + *group != max_value()) { + size += sep_size; + num_digits -= *group; + ++group; + } + if (group == groups.cend()) + size += sep_size * ((num_digits - 1) / groups.back()); + writer.write_int(size, get_prefix(), specs, + num_writer{abs_value, size, groups, sep}); + } + + FMT_NORETURN void on_error() { + FMT_THROW(format_error("invalid type specifier")); + } + }; + + template struct str_writer { + const Char* s; + size_t size_; + + size_t size() const { return size_; } + size_t width() const { + return count_code_points(basic_string_view(s, size_)); + } + + template void operator()(It&& it) const { + it = copy_str(s, s + size_, it); + } + }; + + struct bytes_writer { + string_view bytes; + + size_t size() const { return bytes.size(); } + size_t width() const { return bytes.size(); } + + template void operator()(It&& it) const { + const char* data = bytes.data(); + it = copy_str(data, data + size(), it); + } + }; + + template struct pointer_writer { + UIntPtr value; + int num_digits; + + size_t size() const { return to_unsigned(num_digits) + 2; } + size_t width() const { return size(); } + + template void operator()(It&& it) const { + *it++ = static_cast('0'); + *it++ = static_cast('x'); + it = format_uint<4, char_type>(it, value, num_digits); + } + }; + + public: + explicit basic_writer(Range out, locale_ref loc = locale_ref()) + : out_(out.begin()), locale_(loc) {} + + iterator out() const { return out_; } + + // Writes a value in the format + // + // where is written by f(it). + template void write_padded(const format_specs& specs, F&& f) { + // User-perceived width (in code points). + unsigned width = to_unsigned(specs.width); + size_t size = f.size(); // The number of code units. + size_t num_code_points = width != 0 ? f.width() : size; + if (width <= num_code_points) return f(reserve(size)); + size_t padding = width - num_code_points; + size_t fill_size = specs.fill.size(); + auto&& it = reserve(size + padding * fill_size); + if (specs.align == align::right) { + it = fill(it, padding, specs.fill); + f(it); + } else if (specs.align == align::center) { + std::size_t left_padding = padding / 2; + it = fill(it, left_padding, specs.fill); + f(it); + it = fill(it, padding - left_padding, specs.fill); + } else { + f(it); + it = fill(it, padding, specs.fill); + } + } + + void write(int value) { write_decimal(value); } + void write(long value) { write_decimal(value); } + void write(long long value) { write_decimal(value); } + + void write(unsigned value) { write_decimal(value); } + void write(unsigned long value) { write_decimal(value); } + void write(unsigned long long value) { write_decimal(value); } + +#if FMT_USE_INT128 + void write(int128_t value) { write_decimal(value); } + void write(uint128_t value) { write_decimal(value); } +#endif + + template + void write_int(T value, const Spec& spec) { + handle_int_type_spec(spec.type, int_writer(*this, value, spec)); + } + + template ::value)> + void write(T value, format_specs specs = {}) { + if (const_check(!is_supported_floating_point(value))) { + return; + } + float_specs fspecs = parse_float_type_spec(specs); + fspecs.sign = specs.sign; + if (std::signbit(value)) { // value < 0 is false for NaN so use signbit. + fspecs.sign = sign::minus; + value = -value; + } else if (fspecs.sign == sign::minus) { + fspecs.sign = sign::none; + } + + if (!std::isfinite(value)) { + auto str = std::isinf(value) ? (fspecs.upper ? "INF" : "inf") + : (fspecs.upper ? "NAN" : "nan"); + return write_padded(specs, nonfinite_writer{fspecs.sign, str}); + } + + if (specs.align == align::none) { + specs.align = align::right; + } else if (specs.align == align::numeric) { + if (fspecs.sign) { + auto&& it = reserve(1); + *it++ = static_cast(data::signs[fspecs.sign]); + fspecs.sign = sign::none; + if (specs.width != 0) --specs.width; + } + specs.align = align::right; + } + + memory_buffer buffer; + if (fspecs.format == float_format::hex) { + if (fspecs.sign) buffer.push_back(data::signs[fspecs.sign]); + snprintf_float(promote_float(value), specs.precision, fspecs, buffer); + write_padded(specs, str_writer{buffer.data(), buffer.size()}); + return; + } + int precision = specs.precision >= 0 || !specs.type ? specs.precision : 6; + if (fspecs.format == float_format::exp) { + if (precision == max_value()) + FMT_THROW(format_error("number is too big")); + else + ++precision; + } + if (const_check(std::is_same())) fspecs.binary32 = true; + fspecs.use_grisu = use_grisu(); + if (const_check(FMT_DEPRECATED_PERCENT) && fspecs.percent) value *= 100; + int exp = format_float(promote_float(value), precision, fspecs, buffer); + if (const_check(FMT_DEPRECATED_PERCENT) && fspecs.percent) { + buffer.push_back('%'); + --exp; // Adjust decimal place position. + } + fspecs.precision = precision; + char_type point = fspecs.locale ? decimal_point(locale_) + : static_cast('.'); + write_padded(specs, float_writer(buffer.data(), + static_cast(buffer.size()), + exp, fspecs, point)); + } + + void write(char value) { + auto&& it = reserve(1); + *it++ = value; + } + + template ::value)> + void write(Char value) { + auto&& it = reserve(1); + *it++ = value; + } + + void write(string_view value) { + auto&& it = reserve(value.size()); + it = copy_str(value.begin(), value.end(), it); + } + void write(wstring_view value) { + static_assert(std::is_same::value, ""); + auto&& it = reserve(value.size()); + it = std::copy(value.begin(), value.end(), it); + } + + template + void write(const Char* s, std::size_t size, const format_specs& specs) { + write_padded(specs, str_writer{s, size}); + } + + template + void write(basic_string_view s, const format_specs& specs = {}) { + const Char* data = s.data(); + std::size_t size = s.size(); + if (specs.precision >= 0 && to_unsigned(specs.precision) < size) + size = code_point_index(s, to_unsigned(specs.precision)); + write(data, size, specs); + } + + void write_bytes(string_view bytes, const format_specs& specs) { + write_padded(specs, bytes_writer{bytes}); + } + + template + void write_pointer(UIntPtr value, const format_specs* specs) { + int num_digits = count_digits<4>(value); + auto pw = pointer_writer{value, num_digits}; + if (!specs) return pw(reserve(to_unsigned(num_digits) + 2)); + format_specs specs_copy = *specs; + if (specs_copy.align == align::none) specs_copy.align = align::right; + write_padded(specs_copy, pw); + } +}; + +using writer = basic_writer>; + +template struct is_integral : std::is_integral {}; +template <> struct is_integral : std::true_type {}; +template <> struct is_integral : std::true_type {}; + +template +class arg_formatter_base { + public: + using char_type = typename Range::value_type; + using iterator = typename Range::iterator; + using format_specs = basic_format_specs; + + private: + using writer_type = basic_writer; + writer_type writer_; + format_specs* specs_; + + struct char_writer { + char_type value; + + size_t size() const { return 1; } + size_t width() const { return 1; } + + template void operator()(It&& it) const { *it++ = value; } + }; + + void write_char(char_type value) { + if (specs_) + writer_.write_padded(*specs_, char_writer{value}); + else + writer_.write(value); + } + + void write_pointer(const void* p) { + writer_.write_pointer(internal::to_uintptr(p), specs_); + } + + protected: + writer_type& writer() { return writer_; } + FMT_DEPRECATED format_specs* spec() { return specs_; } + format_specs* specs() { return specs_; } + iterator out() { return writer_.out(); } + + void write(bool value) { + string_view sv(value ? "true" : "false"); + specs_ ? writer_.write(sv, *specs_) : writer_.write(sv); + } + + void write(const char_type* value) { + if (!value) { + FMT_THROW(format_error("string pointer is null")); + } else { + auto length = std::char_traits::length(value); + basic_string_view sv(value, length); + specs_ ? writer_.write(sv, *specs_) : writer_.write(sv); + } + } + + public: + arg_formatter_base(Range r, format_specs* s, locale_ref loc) + : writer_(r, loc), specs_(s) {} + + iterator operator()(monostate) { + FMT_ASSERT(false, "invalid argument type"); + return out(); + } + + template ::value)> + iterator operator()(T value) { + if (specs_) + writer_.write_int(value, *specs_); + else + writer_.write(value); + return out(); + } + + iterator operator()(char_type value) { + internal::handle_char_specs( + specs_, char_spec_handler(*this, static_cast(value))); + return out(); + } + + iterator operator()(bool value) { + if (specs_ && specs_->type) return (*this)(value ? 1 : 0); + write(value != 0); + return out(); + } + + template ::value)> + iterator operator()(T value) { + if (const_check(is_supported_floating_point(value))) + writer_.write(value, specs_ ? *specs_ : format_specs()); + else + FMT_ASSERT(false, "unsupported float argument type"); + return out(); + } + + struct char_spec_handler : ErrorHandler { + arg_formatter_base& formatter; + char_type value; + + char_spec_handler(arg_formatter_base& f, char_type val) + : formatter(f), value(val) {} + + void on_int() { + if (formatter.specs_) + formatter.writer_.write_int(value, *formatter.specs_); + else + formatter.writer_.write(value); + } + void on_char() { formatter.write_char(value); } + }; + + struct cstring_spec_handler : internal::error_handler { + arg_formatter_base& formatter; + const char_type* value; + + cstring_spec_handler(arg_formatter_base& f, const char_type* val) + : formatter(f), value(val) {} + + void on_string() { formatter.write(value); } + void on_pointer() { formatter.write_pointer(value); } + }; + + iterator operator()(const char_type* value) { + if (!specs_) return write(value), out(); + internal::handle_cstring_type_spec(specs_->type, + cstring_spec_handler(*this, value)); + return out(); + } + + iterator operator()(basic_string_view value) { + if (specs_) { + internal::check_string_type_spec(specs_->type, internal::error_handler()); + writer_.write(value, *specs_); + } else { + writer_.write(value); + } + return out(); + } + + iterator operator()(const void* value) { + if (specs_) + check_pointer_type_spec(specs_->type, internal::error_handler()); + write_pointer(value); + return out(); + } +}; + +template FMT_CONSTEXPR bool is_name_start(Char c) { + return ('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z') || '_' == c; +} + +// Parses the range [begin, end) as an unsigned integer. This function assumes +// that the range is non-empty and the first character is a digit. +template +FMT_CONSTEXPR int parse_nonnegative_int(const Char*& begin, const Char* end, + ErrorHandler&& eh) { + FMT_ASSERT(begin != end && '0' <= *begin && *begin <= '9', ""); + unsigned value = 0; + // Convert to unsigned to prevent a warning. + constexpr unsigned max_int = max_value(); + unsigned big = max_int / 10; + do { + // Check for overflow. + if (value > big) { + value = max_int + 1; + break; + } + value = value * 10 + unsigned(*begin - '0'); + ++begin; + } while (begin != end && '0' <= *begin && *begin <= '9'); + if (value > max_int) eh.on_error("number is too big"); + return static_cast(value); +} + +template class custom_formatter { + private: + using char_type = typename Context::char_type; + + basic_format_parse_context& parse_ctx_; + Context& ctx_; + + public: + explicit custom_formatter(basic_format_parse_context& parse_ctx, + Context& ctx) + : parse_ctx_(parse_ctx), ctx_(ctx) {} + + bool operator()(typename basic_format_arg::handle h) const { + h.format(parse_ctx_, ctx_); + return true; + } + + template bool operator()(T) const { return false; } +}; + +template +using is_integer = + bool_constant::value && !std::is_same::value && + !std::is_same::value && + !std::is_same::value>; + +template class width_checker { + public: + explicit FMT_CONSTEXPR width_checker(ErrorHandler& eh) : handler_(eh) {} + + template ::value)> + FMT_CONSTEXPR unsigned long long operator()(T value) { + if (is_negative(value)) handler_.on_error("negative width"); + return static_cast(value); + } + + template ::value)> + FMT_CONSTEXPR unsigned long long operator()(T) { + handler_.on_error("width is not integer"); + return 0; + } + + private: + ErrorHandler& handler_; +}; + +template class precision_checker { + public: + explicit FMT_CONSTEXPR precision_checker(ErrorHandler& eh) : handler_(eh) {} + + template ::value)> + FMT_CONSTEXPR unsigned long long operator()(T value) { + if (is_negative(value)) handler_.on_error("negative precision"); + return static_cast(value); + } + + template ::value)> + FMT_CONSTEXPR unsigned long long operator()(T) { + handler_.on_error("precision is not integer"); + return 0; + } + + private: + ErrorHandler& handler_; +}; + +// A format specifier handler that sets fields in basic_format_specs. +template class specs_setter { + public: + explicit FMT_CONSTEXPR specs_setter(basic_format_specs& specs) + : specs_(specs) {} + + FMT_CONSTEXPR specs_setter(const specs_setter& other) + : specs_(other.specs_) {} + + FMT_CONSTEXPR void on_align(align_t align) { specs_.align = align; } + FMT_CONSTEXPR void on_fill(basic_string_view fill) { + specs_.fill = fill; + } + FMT_CONSTEXPR void on_plus() { specs_.sign = sign::plus; } + FMT_CONSTEXPR void on_minus() { specs_.sign = sign::minus; } + FMT_CONSTEXPR void on_space() { specs_.sign = sign::space; } + FMT_CONSTEXPR void on_hash() { specs_.alt = true; } + + FMT_CONSTEXPR void on_zero() { + specs_.align = align::numeric; + specs_.fill[0] = Char('0'); + } + + FMT_CONSTEXPR void on_width(int width) { specs_.width = width; } + FMT_CONSTEXPR void on_precision(int precision) { + specs_.precision = precision; + } + FMT_CONSTEXPR void end_precision() {} + + FMT_CONSTEXPR void on_type(Char type) { + specs_.type = static_cast(type); + } + + protected: + basic_format_specs& specs_; +}; + +template class numeric_specs_checker { + public: + FMT_CONSTEXPR numeric_specs_checker(ErrorHandler& eh, internal::type arg_type) + : error_handler_(eh), arg_type_(arg_type) {} + + FMT_CONSTEXPR void require_numeric_argument() { + if (!is_arithmetic_type(arg_type_)) + error_handler_.on_error("format specifier requires numeric argument"); + } + + FMT_CONSTEXPR void check_sign() { + require_numeric_argument(); + if (is_integral_type(arg_type_) && arg_type_ != type::int_type && + arg_type_ != type::long_long_type && arg_type_ != type::char_type) { + error_handler_.on_error("format specifier requires signed argument"); + } + } + + FMT_CONSTEXPR void check_precision() { + if (is_integral_type(arg_type_) || arg_type_ == type::pointer_type) + error_handler_.on_error("precision not allowed for this argument type"); + } + + private: + ErrorHandler& error_handler_; + internal::type arg_type_; +}; + +// A format specifier handler that checks if specifiers are consistent with the +// argument type. +template class specs_checker : public Handler { + public: + FMT_CONSTEXPR specs_checker(const Handler& handler, internal::type arg_type) + : Handler(handler), checker_(*this, arg_type) {} + + FMT_CONSTEXPR specs_checker(const specs_checker& other) + : Handler(other), checker_(*this, other.arg_type_) {} + + FMT_CONSTEXPR void on_align(align_t align) { + if (align == align::numeric) checker_.require_numeric_argument(); + Handler::on_align(align); + } + + FMT_CONSTEXPR void on_plus() { + checker_.check_sign(); + Handler::on_plus(); + } + + FMT_CONSTEXPR void on_minus() { + checker_.check_sign(); + Handler::on_minus(); + } + + FMT_CONSTEXPR void on_space() { + checker_.check_sign(); + Handler::on_space(); + } + + FMT_CONSTEXPR void on_hash() { + checker_.require_numeric_argument(); + Handler::on_hash(); + } + + FMT_CONSTEXPR void on_zero() { + checker_.require_numeric_argument(); + Handler::on_zero(); + } + + FMT_CONSTEXPR void end_precision() { checker_.check_precision(); } + + private: + numeric_specs_checker checker_; +}; + +template