vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1 | /* |
| 2 | * CLASS-related stuff. |
| 3 | */ |
| 4 | #ifndef ASN1_PARSER_CLASS_H |
| 5 | #define ASN1_PARSER_CLASS_H |
| 6 | |
vlm | ea4246f | 2005-02-25 13:32:12 +0000 | [diff] [blame] | 7 | #include "asn1p_ref.h" |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 8 | |
| 9 | /* |
| 10 | * WITH SYNTAX free-form chunks. |
| 11 | */ |
| 12 | typedef struct asn1p_wsyntx_chunk_s { |
| 13 | /* |
| 14 | * It could be the union, but the story is: |
| 15 | * if ref is here, the ref is used. |
| 16 | * Otherwise, buf/len is used. |
| 17 | */ |
| 18 | asn1p_ref_t *ref; |
| 19 | |
| 20 | char *buf; |
| 21 | int len; |
| 22 | |
| 23 | TQ_ENTRY(struct asn1p_wsyntx_chunk_s) next; |
| 24 | } asn1p_wsyntx_chunk_t; |
| 25 | |
| 26 | typedef struct asn1p_wsyntx_s { |
| 27 | |
| 28 | TQ_HEAD(struct asn1p_wsyntx_chunk_s) chunks; |
| 29 | |
| 30 | } asn1p_wsyntx_t; |
| 31 | |
| 32 | |
| 33 | /* |
| 34 | * Constructor, destructor and cloning function. |
| 35 | */ |
| 36 | asn1p_wsyntx_chunk_t *asn1p_wsyntx_chunk_new(void); |
| 37 | void asn1p_wsyntx_chunk_free(asn1p_wsyntx_chunk_t *); |
| 38 | asn1p_wsyntx_chunk_t *asn1p_wsyntx_chunk_clone(asn1p_wsyntx_chunk_t *); |
| 39 | |
| 40 | asn1p_wsyntx_t *asn1p_wsyntx_new(void); |
| 41 | void asn1p_wsyntx_free(asn1p_wsyntx_t *); |
| 42 | asn1p_wsyntx_t *asn1p_wsyntx_clone(asn1p_wsyntx_t *); |
| 43 | |
| 44 | /* |
| 45 | * RETURN VALUES: |
| 46 | * 0: Component has been added |
| 47 | * -1: Failure to add component (refer to errno) |
| 48 | */ |
| 49 | asn1p_wsyntx_chunk_t *asn1p_wsyntx_chunk_fromref(asn1p_ref_t *ref, int do_copy); |
| 50 | asn1p_wsyntx_chunk_t *asn1p_wsyntx_chunk_frombuf(char *buf, int len, int do_copy); |
| 51 | |
| 52 | |
| 53 | #endif /* ASN1_PARSER_CLASS_H */ |