containers / libocispec

a C library for accessing OCI runtime and image spec files
Other
52 stars 30 forks source link

Cleanup references to yajl #147

Closed saschagrunert closed 2 days ago

saschagrunert commented 2 days ago

Refers to #138

saschagrunert commented 2 days ago

@xw19 there are still some references to yajl in the code:

src/ocispec/json_common.c
8:#define YAJL_GET_OBJECT_NO_CHECK(v) (&(v)->u.object)
9:#define YAJL_GET_STRING_NO_CHECK(v) ((v)->u.string)

src/ocispec/sources.py
137:        c_file.append(f'        yajl_val tmp = get_val (tree, "{obj.origname}", yajl_t_string);\n')
141:            c_file.append('                yajl_val *items = YAJL_GET_ARRAY_NO_CHECK(tmp)->values;\n')
142:            c_file.append(f'                ret->{obj.fixname} = calloc ( YAJL_GET_ARRAY_NO_CHECK(tmp)->len + 1, sizeof (*ret->{obj.fixname}));\n')
146:            c_file.append('                for (j = 0; j < YAJL_GET_ARRAY_NO_CHECK(tmp)->len; j++)\n')
148:            c_file.append('                    char *str = YAJL_GET_STRING (itmes[j]);\n')
154:            c_file.append('            char *str = YAJL_GET_STRING (tmp);\n')
686:                     f'for key \'{keyname}\': %s", YAJL_GET_NUMBER (val), strerror (-invalid)) < 0)\n')

Are they required or can I removed them as well?

Edit: Removed them.

saschagrunert commented 2 days ago

@xw19 PTAL

xw19 commented 2 days ago

LGTM

xw19 commented 2 days ago

I have one concern in all of our builds I am observing that test suites are not running or not reporting

https://github.com/containers/libocispec/actions/runs/12065395898/job/33644073262?pr=147#step:3:683