MCPcopy Create free account
hub / github.com/3proxy/3proxy / printval

Function printval

src/webadmin.c:103–157  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

101}
102
103static void printval(void *value, int type, int level, struct printparam* pp){
104 struct node pn, cn;
105 struct property *p;
106 int i;
107
108 pn.iteration = NULL;
109 pn.parent = NULL;
110 pn.type = type;
111 pn.value = value;
112
113 printstr(pp, "<item>");
114 for(p = datatypes[type].properties; p; ) {
115 cn.iteration = NULL;
116 cn.parent = &pn;
117 cn.type = p->type;
118 cn.value = (*p->e_f)(&pn);
119 if(cn.value){
120 for(i = 0; i < level; i++) printstr(pp, "\t");
121 if(strcmp(p->name, "next")){
122 printstr(pp, "<parameter>");
123 printstr(pp, "<name>");
124 printstr(pp, p->name);
125 printstr(pp, "</name>");
126 printstr(pp, "<type>");
127 printstr(pp, datatypes[p->type].type);
128 printstr(pp, "</type>");
129 printstr(pp, "<description>");
130 printstr(pp, p->description);
131 printstr(pp, "</description>");
132 }
133 if(datatypes[p->type].p_f){
134 printstr(pp, "<value><![CDATA[");
135 (*datatypes[p->type].p_f)(&cn, stdcbf, pp);
136 printstr(pp, "]]></value>\n");
137 printstr(pp, "</parameter>");
138 }
139 else {
140 if(!strcmp(p->name, "next")){
141/* printstr(pp, "<!-- -------------------- -->\n"); */
142 printstr(pp, "</item>\n<item>");
143 p = datatypes[type].properties;
144 pn.value = value = cn.value;
145 continue;
146 }
147 else {
148 printstr(pp, "\n");
149 printval(cn.value, cn.type, level+1, pp);
150 printstr(pp, "</parameter>");
151 }
152 }
153 }
154 p=p->next;
155 }
156 printstr(pp, "</item>");
157}
158
159
160char * admin_stringtable[]={

Callers 1

adminchildFunction · 0.85

Calls 1

printstrFunction · 0.85

Tested by

no test coverage detected