X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=odr%2Fodr_util.c;h=5da40887aca8897f6527612a27f14353a8afc41a;hb=0442642bb213139271943552e5c1bc731ee96872;hp=3f450ca736d571b072b7a1cf51cc12eee04665a3;hpb=4d531a1a9131d69c3b6c27fbac42837e22cff61c;p=yaz-moved-to-github.git diff --git a/odr/odr_util.c b/odr/odr_util.c index 3f450ca..5da4088 100644 --- a/odr/odr_util.c +++ b/odr/odr_util.c @@ -2,7 +2,7 @@ * Copyright (c) 1995-2003, Index Data * See the file LICENSE for details. * - * $Id: odr_util.c,v 1.22 2003-01-06 08:20:28 adam Exp $ + * $Id: odr_util.c,v 1.25 2003-05-24 19:20:14 adam Exp $ */ #if HAVE_CONFIG_H #include @@ -81,4 +81,14 @@ Odr_oid *odr_getoidbystr(ODR o, const char *str) return odr_getoidbystr_nmem (o->mem, str); } - +int odr_missing(ODR o, int opt, const char *name) +{ + if (o->error) + return 0; + if (!opt) + { + odr_seterror(o, OREQUIRED, 53); + odr_setelement(o, name); + } + return opt; +}