2 * Copyright (c) 2017 Lev Walkin <vlm@lionet.info>.
4 * Redistribution and modifications are permitted subject to BSD license.
6 #include <asn_internal.h>
7 #include <constr_SET_OF.h>
10 SET_OF_print(const asn_TYPE_descriptor_t *td, const void *sptr, int ilevel,
11 asn_app_consume_bytes_f *cb, void *app_key) {
12 asn_TYPE_member_t *elm = td->elements;
13 const asn_anonymous_set_ *list = _A_CSET_FROM_VOID(sptr);
17 if(!sptr) return (cb("<absent>", 8, app_key) < 0) ? -1 : 0;
20 if(cb(td->name, strlen(td->name), app_key) < 0
21 || cb(" ::= {", 6, app_key) < 0)
24 for(i = 0; i < list->count; i++) {
25 const void *memb_ptr = list->array[i];
26 if(!memb_ptr) continue;
30 ret = elm->type->op->print_struct(elm->type, memb_ptr,
31 ilevel + 1, cb, app_key);
38 return (cb("}", 1, app_key) < 0) ? -1 : 0;