YAZ  5.23.1
Macros | Typedefs | Enumerations | Functions
oid_util.h File Reference

Header for OID basic functions. More...

#include <yaz/yconfig.h>

Go to the source code of this file.

Macros

#define OID_SIZE   20
 
#define OID_STR_MAX   256
 

Typedefs

typedef short Odr_oid
 
typedef enum oid_proto oid_proto
 

Enumerations

enum  oid_proto { PROTO_NOP =0, PROTO_Z3950, PROTO_HTTP }
 

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

Header for OID basic functions.

Definition in file oid_util.h.

Macro Definition Documentation

#define OID_SIZE   20
#define OID_STR_MAX   256

Typedef Documentation

typedef short Odr_oid

Definition at line 42 of file oid_util.h.

typedef enum oid_proto oid_proto

Enumeration Type Documentation

enum oid_proto
Enumerator
PROTO_NOP 
PROTO_Z3950 
PROTO_HTTP 

Definition at line 44 of file oid_util.h.

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().