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

Function vm_get_int

tinyemu/machine.c:56–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

54}
55
56int vm_get_int(JSONValue obj, const char *name, int *pval)
57{
58 JSONValue val;
59 val = json_object_get(obj, name);
60 if (json_is_undefined(val)) {
61 vm_error("expecting '%s' property\n", name);
62 return -1;
63 }
64 if (val.type != JSON_INT) {
65 vm_error("%s: integer expected\n", name);
66 return -1;
67 }
68 *pval = val.u.int32;
69 return 0;
70}
71
72int vm_get_int_opt(JSONValue obj, const char *name, int *pval, int def_val)
73{

Callers 2

bf_init_onloadFunction · 0.85

Calls 3

json_object_getFunction · 0.85
json_is_undefinedFunction · 0.85
vm_errorFunction · 0.85

Tested by

no test coverage detected