blob: 4a0f19e19d03477233fdfd137c38c432d8f0e1f8 [file] [log] [blame]
Lev Walkinf15320b2004-06-03 03:38:44 +00001/*
2 * CLASS-related stuff.
3 */
4#ifndef ASN1_PARSER_CLASS_H
5#define ASN1_PARSER_CLASS_H
6
7#include <asn1p_ref.h>
8
9/*
10 * WITH SYNTAX free-form chunks.
11 */
12typedef 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
26typedef 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 */
36asn1p_wsyntx_chunk_t *asn1p_wsyntx_chunk_new(void);
37void asn1p_wsyntx_chunk_free(asn1p_wsyntx_chunk_t *);
38asn1p_wsyntx_chunk_t *asn1p_wsyntx_chunk_clone(asn1p_wsyntx_chunk_t *);
39
40asn1p_wsyntx_t *asn1p_wsyntx_new(void);
41void asn1p_wsyntx_free(asn1p_wsyntx_t *);
42asn1p_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 */
49asn1p_wsyntx_chunk_t *asn1p_wsyntx_chunk_fromref(asn1p_ref_t *ref, int do_copy);
50asn1p_wsyntx_chunk_t *asn1p_wsyntx_chunk_frombuf(char *buf, int len, int do_copy);
51
52
53#endif /* ASN1_PARSER_CLASS_H */