MCPcopy Create free account
hub / github.com/ading2210/linuxpdf / vm_get_str2

Function vm_get_str2

tinyemu/machine.c:88–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

86}
87
88static int vm_get_str2(JSONValue obj, const char *name, const char **pstr,
89 BOOL is_opt)
90{
91 JSONValue val;
92 val = json_object_get(obj, name);
93 if (json_is_undefined(val)) {
94 if (is_opt) {
95 *pstr = NULL;
96 return 0;
97 } else {
98 vm_error("expecting '%s' property\n", name);
99 return -1;
100 }
101 }
102 if (val.type != JSON_STR) {
103 vm_error("%s: string expected\n", name);
104 return -1;
105 }
106 *pstr = val.u.str->data;
107 return 0;
108}
109
110static int vm_get_str(JSONValue obj, const char *name, const char **pstr)
111{

Callers 2

vm_get_strFunction · 0.85
vm_get_str_optFunction · 0.85

Calls 3

json_object_getFunction · 0.85
json_is_undefinedFunction · 0.85
vm_errorFunction · 0.85

Tested by

no test coverage detected