YAZ  5.23.1
Functions
oid_util.c File Reference

Implements OID base utilities. More...

#include <stdlib.h>
#include <string.h>
#include <yaz/yaz-iconv.h>
#include <yaz/snprintf.h>
#include <yaz/oid_util.h>

Go to the source code of this file.

Functions

void oid_oidcpy (Odr_oid *t, const Odr_oid *s)
 copies OID More...
 
void oid_oidcat (Odr_oid *t, const Odr_oid *s)
 appends to OID More...
 
int oid_oidcmp (const Odr_oid *o1, const Odr_oid *o2)
 compares OIDs More...
 
int oid_oidlen (const Odr_oid *o)
 returns length of OIDs More...
 
char * oid_oid_to_dotstring (const Odr_oid *oid, char *oidbuf)
 converts OID to string (dot notation) More...
 
int oid_dotstring_to_oid (const char *name, Odr_oid *oid)
 converts dot string to OID More...
 

Detailed Description

Implements OID base utilities.

Definition in file oid_util.c.

Function Documentation

int oid_dotstring_to_oid ( const char *  name,
Odr_oid oid 
)

converts dot string to OID

Parameters
namedot string OID, e.g. "1.2.840.10003.2.1"
oidresulting OID buffer which should be at least of size OID_SIZE
Return values
0OK
-1failure

Definition at line 75 of file oid_util.c.

References OID_SIZE, and yaz_isdigit.

Referenced by odr_getoidbystr_nmem().

char* oid_oid_to_dotstring ( const Odr_oid oid,
char *  oidbuf 
)

converts OID to string (dot notation)

Parameters
oidOID
oidbufresulting buffer which should be at least of size OID_STR_MAX
Returns
result (same as oidbuf)

Definition at line 59 of file oid_util.c.

References OID_SIZE, and yaz_snprintf().

Referenced by my_fetch(), oid_name_to_dotstring(), retrieve_fetch(), yaz_oid_to_string_buf(), yaz_retrieval_request(), and ztest_fetch().

void oid_oidcat ( Odr_oid t,
const Odr_oid s 
)

appends to OID

Parameters
tdestination OID
ssource OID

Definition at line 27 of file oid_util.c.

int oid_oidcmp ( const Odr_oid o1,
const Odr_oid o2 
)

compares OIDs

Parameters
o1first OID
o2second OID
Return values
0equal
>0o1 greater than o2
<0o1 less than o2

Definition at line 34 of file oid_util.c.

Referenced by cql_lookup_reverse(), my_fetch(), retrieve_fetch(), return_record_wrbuf(), yaz_del_charneg_record(), yaz_get_charneg_record(), yaz_oi_update(), yaz_oid_to_string(), yaz_retrieval_request(), z_ext_getentbyref(), z_ext_record_oid_nmem(), ztest_esrequest(), and ztest_fetch().

void oid_oidcpy ( Odr_oid t,
const Odr_oid s 
)

copies OID

Parameters
tdestination OID
ssource OID

Definition at line 22 of file oid_util.c.

Referenced by odr_getoidbystr_nmem(), odr_oiddup_nmem(), and yaz_oid_add().

int oid_oidlen ( const Odr_oid o)

returns length of OIDs

Parameters
oOID
Returns
length as number of Odr_oids

Definition at line 49 of file oid_util.c.

Referenced by odr_getoidbystr_nmem(), odr_oiddup_nmem(), set_form(), yaz_oid_add(), and yaz_oid_is_iso2709().