YAZ
5.34.0
src
ber_null.c
Go to the documentation of this file.
1
/* This file is part of the YAZ toolkit.
2
* Copyright (C) Index Data
3
* See the file LICENSE for details.
4
*/
5
13
#if HAVE_CONFIG_H
14
#include <
config.h
>
15
#endif
16
17
#include "
odr-priv.h
"
18
22
int
ber_null
(
ODR
o)
23
{
24
switch
(o->
direction
)
25
{
26
case
ODR_ENCODE
:
27
if
(
odr_putc
(o, 0X00) < 0)
28
return
0;
29
return
1;
30
case
ODR_DECODE
:
31
if
(
odr_max
(o) < 1)
32
{
33
odr_seterror
(o,
OPROTO
, 39);
34
return
0;
35
}
36
if
(*(o->
op
->
bp
++) != 0X00)
37
{
38
odr_seterror
(o,
OPROTO
, 12);
39
return
0;
40
}
41
return
1;
42
case
ODR_PRINT
:
43
return
1;
44
default
:
45
odr_seterror
(o,
OOTHER
, 13);
46
return
0;
47
}
48
}
49
/*
50
* Local variables:
51
* c-basic-offset: 4
52
* c-file-style: "Stroustrup"
53
* indent-tabs-mode: nil
54
* End:
55
* vim: shiftwidth=4 tabstop=8 expandtab
56
*/
57
ber_null
int ber_null(ODR o)
Definition:
ber_null.c:22
config.h
odr-priv.h
Internal ODR definitions.
odr_putc
#define odr_putc(o, c)
Definition:
odr-priv.h:129
odr_max
#define odr_max(o)
Definition:
odr-priv.h:47
odr_seterror
void odr_seterror(ODR o, int error, int id)
Definition:
odr.c:118
ODR_DECODE
#define ODR_DECODE
Definition:
odr.h:95
ODR_PRINT
#define ODR_PRINT
Definition:
odr.h:97
OOTHER
#define OOTHER
Definition:
odr.h:156
ODR_ENCODE
#define ODR_ENCODE
Definition:
odr.h:96
OPROTO
#define OPROTO
Definition:
odr.h:157
Odr_private::bp
const char * bp
Definition:
odr-priv.h:85
odr
Definition:
odr.h:125
odr::op
struct Odr_private * op
Definition:
odr.h:132
odr::direction
int direction
Definition:
odr.h:126
Generated by
1.9.1