SIM-115: update simulator to use latest E2SM KPM version 3
[sim/e2-interface.git] / e2sim / asn1c / OBJECT_IDENTIFIER_print.c
1 /*
2  * Copyright (c) 2017 Lev Walkin <vlm@lionet.info>.
3  * All rights reserved.
4  * Redistribution and modifications are permitted subject to BSD license.
5  */
6 #include <asn_internal.h>
7 #include <OBJECT_IDENTIFIER.h>
8
9 int
10 OBJECT_IDENTIFIER_print(const asn_TYPE_descriptor_t *td, const void *sptr,
11                         int ilevel, asn_app_consume_bytes_f *cb,
12                         void *app_key) {
13     const OBJECT_IDENTIFIER_t *st = (const OBJECT_IDENTIFIER_t *)sptr;
14
15     (void)td;  /* Unused argument */
16     (void)ilevel;  /* Unused argument */
17
18     if(!st || !st->buf)
19         return (cb("<absent>", 8, app_key) < 0) ? -1 : 0;
20
21     /* Dump preamble */
22     if(cb("{ ", 2, app_key) < 0)
23         return -1;
24
25     if(OBJECT_IDENTIFIER__dump_body(st, cb, app_key) < 0) {
26         return -1;
27     }
28
29     return (cb(" }", 2, app_key) < 0) ? -1 : 0;
30 }