2 * Copyright (c) 1995-2003, Index Data.
4 * Permission to use, copy, modify, distribute, and sell this software and
5 * its documentation, in whole or in part, for any purpose, is hereby granted,
8 * 1. This copyright and permission notice appear in all copies of the
9 * software and its documentation. Notices of copyright or attribution
10 * which appear at the beginning of any file must remain unchanged.
12 * 2. The name of Index Data or the individual authors may not be used to
13 * endorse or promote products derived from this software without specific
14 * prior written permission.
16 * THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND,
17 * EXPRESS, IMPLIED, OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
18 * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
19 * IN NO EVENT SHALL INDEX DATA BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
20 * INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES
21 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR
22 * NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
23 * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
26 * $Id: odr-priv.h,v 1.3 2003-01-06 08:20:27 adam Exp $
34 #include <yaz/yaz-util.h>
36 struct Odr_ber_tag { /* used to be statics in ber_tag... */
44 /* stack for constructed types */
45 #define ODR_MAX_STACK 50
46 int stackp; /* top of stack (-1 == initial state) */
47 odr_constack stack[ODR_MAX_STACK];
49 struct Odr_ber_tag odr_ber_tag;
50 yaz_iconv_t iconv_handle;
54 * write a single character at the current position - grow buffer if
56 * (no, we're not usually this anal about our macros, but this baby is
57 * next to unreadable without some indentation :)
59 #define odr_putc(o, c) \
62 (o)->pos < (o)->size ? \
64 (o)->buf[(o)->pos++] = (c), \
68 odr_grow_block((o), 1) == 0 ? \
70 (o)->buf[(o)->pos++] = (c), \
74 (o)->error = OSPACE, \
80 (o)->pos > (o)->top ? \
82 (o)->top = (o)->pos, \