vlm | c4436cf | 2004-10-21 11:20:50 +0000 | [diff] [blame] | 1 | /*- |
| 2 | * Copyright (c) 2004 Lev Walkin <vlm@lionet.info>. All rights reserved. |
| 3 | * Redistribution and modifications are permitted subject to BSD license. |
| 4 | */ |
| 5 | #ifndef ASN_CODECS_PRIM_H |
| 6 | #define ASN_CODECS_PRIM_H |
| 7 | |
| 8 | #include <asn_application.h> |
| 9 | |
| 10 | typedef struct ASN__PRIMITIVE_TYPE_s { |
| 11 | uint8_t *buf; /* Buffer with consecutive primitive encoding bytes */ |
| 12 | int size; /* Size of the buffer */ |
| 13 | } ASN__PRIMITIVE_TYPE_t; /* Do not use this type directly! */ |
| 14 | |
| 15 | asn_struct_free_f ASN__PRIMITIVE_TYPE_free; |
| 16 | ber_type_decoder_f ber_decode_primitive; |
| 17 | der_type_encoder_f der_encode_primitive; |
| 18 | |
| 19 | /* |
vlm | b848b2a | 2004-10-21 14:02:19 +0000 | [diff] [blame] | 20 | * Specific function to decode simple primitive types. |
vlm | c4436cf | 2004-10-21 11:20:50 +0000 | [diff] [blame] | 21 | * Also see xer_decode_general() in xer_decoder.h |
| 22 | */ |
| 23 | asn_dec_rval_t xer_decode_primitive(asn_codec_ctx_t *opt_codec_ctx, |
| 24 | asn_TYPE_descriptor_t *type_descriptor, |
vlm | b848b2a | 2004-10-21 14:02:19 +0000 | [diff] [blame] | 25 | void **struct_ptr, size_t struct_size, |
vlm | c4436cf | 2004-10-21 11:20:50 +0000 | [diff] [blame] | 26 | const char *opt_mname, |
| 27 | void *buf_ptr, size_t size, |
vlm | 80a4859 | 2005-02-25 12:10:27 +0000 | [diff] [blame^] | 28 | ssize_t (*prim_body_decode)(asn_TYPE_descriptor_t *td, |
| 29 | void *struct_ptr, void *chunk_buf, size_t chunk_size) |
vlm | c4436cf | 2004-10-21 11:20:50 +0000 | [diff] [blame] | 30 | ); |
| 31 | |
| 32 | #endif /* ASN_CODECS_PRIM_H */ |