Initial revision
[yaz-moved-to-github.git] / odr / odr_use.c
1 /*
2  * Copyright (C) 1994, Index Data I/S 
3  * All rights reserved.
4  * Sebastian Hammer, Adam Dickmeiss
5  *
6  * $Log: odr_use.c,v $
7  * Revision 1.1  1995-02-03 17:04:39  quinn
8  * Initial revision
9  *
10  */
11
12 #include <odr.h>
13 #include <odr_use.h>
14
15 int odr_external(ODR o, Odr_external **p, int opt)
16 {
17     Odr_external *pp;
18     
19     odr_implicit_settag(o, ODR_UNIVERSAL, ODR_EXTERNAL);
20     if (!odr_sequence_begin(o, p, sizeof(Odr_external)))
21         return opt;
22     pp = *p;
23     return
24         odr_oid(o, &pp->direct_reference, 1) &&
25         odr_integer(o, &pp->indirect_reference, 1) &&
26         odr_graphicstring(o, &pp->descriptor, 1) &&
27         odr_implicit(o, odr_octetstring, &pp->octet_aligned, ODR_CONTEXT,
28             1, 0) &&
29         odr_sequence_end(o);
30 }
31
32 int odr_visiblestring(ODR o, char **p, int opt)
33 {
34     return odr_implicit(o, odr_cstring, p, ODR_UNIVERSAL, ODR_VISIBLESTRING,
35         opt);
36 }    
37
38 int odr_graphicstring(ODR o, char **p, int opt)
39 {
40     return odr_implicit(o, odr_cstring, p, ODR_UNIVERSAL, ODR_GRAPHICSTRING,
41         opt);
42 }