~ubuntu-branches/ubuntu/intrepid/asn1c/intrepid

« back to all changes in this revision

Viewing changes to libasn1parser/asn1p_oid.h

  • Committer: Bazaar Package Importer
  • Author(s): W. Borgert
  • Date: 2005-05-28 12:36:42 UTC
  • Revision ID: james.westby@ubuntu.com-20050528123642-3h6kstws5u0xcovl
Tags: upstream-0.9.14
ImportĀ upstreamĀ versionĀ 0.9.14

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Object Identifier definition.
 
3
 */
 
4
#ifndef ASN1_PARSER_OID_H
 
5
#define ASN1_PARSER_OID_H
 
6
 
 
7
/********************************
 
8
 * Single Object Identifier Arc *
 
9
 ********************************/
 
10
 
 
11
/*
 
12
 * Object identifier arc (one number in the hierarchy).
 
13
 */
 
14
typedef struct asn1p_oid_arc_s {
 
15
        asn1c_integer_t number; /* -1 if not yet defined */
 
16
        char *name;     /* 0 if not defined */
 
17
} asn1p_oid_arc_t;
 
18
 
 
19
 
 
20
/*
 
21
 * Arc constructor.
 
22
 */
 
23
asn1p_oid_arc_t *asn1p_oid_arc_new(
 
24
        const char *optName, asn1c_integer_t optNumber /* = -1 */);
 
25
/*
 
26
 * Arc destructor.
 
27
 */
 
28
void asn1p_oid_arc_free(asn1p_oid_arc_t *);
 
29
 
 
30
 
 
31
/**************************************************
 
32
 * Object Identifier itself, a collection of arcs *
 
33
 **************************************************/
 
34
 
 
35
/*
 
36
 * Object Identifier as a collection of arcs.
 
37
 */
 
38
typedef struct asn1p_oid_s {
 
39
        asn1p_oid_arc_t *arcs;
 
40
        int arcs_count;
 
41
} asn1p_oid_t;
 
42
 
 
43
/*
 
44
 * OID constructor.
 
45
 */
 
46
asn1p_oid_t *asn1p_oid_new(void);
 
47
 
 
48
/*
 
49
 * Add another arc using given one as a template
 
50
 */
 
51
int asn1p_oid_add_arc(asn1p_oid_t *, asn1p_oid_arc_t *template);
 
52
 
 
53
/*
 
54
 * OID destructor.
 
55
 */
 
56
void asn1p_oid_free(asn1p_oid_t *);
 
57
 
 
58
/*
 
59
 * RETURN VALUES:
 
60
 *      0: The specified OIDs are equal.
 
61
 *      -1 or 1 otherwise.
 
62
 */
 
63
int asn1p_oid_compare(asn1p_oid_t *a, asn1p_oid_t *b);
 
64
 
 
65
 
 
66
#endif  /* ASN1_PARSER_OID_H */