Header for OID database. More...
#include <yaz/yconfig.h>#include <yaz/oid_util.h>#include <yaz/odr.h>#include <yaz/oid_std.h>Go to the source code of this file.
Data Structures | |
| struct | yaz_oid_entry |
Defines | |
| #define | Z3950_PREFIX 1, 2, 840, 10003 |
Typedefs | |
| typedef struct yaz_oid_db * | yaz_oid_db_t |
| OID database. | |
| typedef enum oid_class | oid_class |
Enumerations | |
| enum | oid_class { CLASS_NOP = 0, CLASS_APPCTX, CLASS_ABSYN, CLASS_ATTSET, CLASS_TRANSYN, CLASS_DIAGSET, CLASS_RECSYN, CLASS_RESFORM, CLASS_ACCFORM, CLASS_EXTSERV, CLASS_USERINFO, CLASS_ELEMSPEC, CLASS_VARSET, CLASS_SCHEMA, CLASS_TAGSET, CLASS_GENERAL, CLASS_NEGOT } |
Functions | |
| yaz_oid_db_t | yaz_oid_std (void) |
| returns standard OID database | |
| const Odr_oid * | yaz_string_to_oid (yaz_oid_db_t oid_db, oid_class oclass, const char *name) |
| maps named OID string to raw OID by database lookup | |
| Odr_oid * | yaz_string_to_oid_nmem (yaz_oid_db_t oid_db, oid_class oclass, const char *name, NMEM nmem) |
| creates NMEM malloc'ed OID from string | |
| Odr_oid * | yaz_string_to_oid_odr (yaz_oid_db_t oid_db, oid_class oclass, const char *name, ODR odr) |
| creates ODR malloc'ed OID from string | |
| const char * | yaz_oid_to_string (yaz_oid_db_t oid_db, const Odr_oid *oid, oid_class *oclass) |
| maps raw OID to string | |
| const char * | yaz_oid_to_string_buf (const Odr_oid *oid, oid_class *oclass, char *buf) |
| maps any OID to string (named or dot-notation) | |
| char * | oid_name_to_dotstring (oid_class oclass, const char *name, char *oid_buf) |
| maps named from standard database to dot notation | |
| void | yaz_oid_trav (yaz_oid_db_t oid_db, void(*func)(const Odr_oid *oid, oid_class oclass, const char *name, void *client_data), void *client_data) |
| traverses OIDs in a database | |
| int | yaz_oid_is_iso2709 (const Odr_oid *oid) |
| checks if OID refers to MARC transfer syntax | |
| int | yaz_oid_add (yaz_oid_db_t oid_db, oid_class oclass, const char *name, const Odr_oid *new_oid) |
| adds new OID entry to database | |
| yaz_oid_db_t | yaz_oid_db_new (void) |
| creates empty OID database | |
| void | yaz_oid_db_destroy (yaz_oid_db_t oid_db) |
| destroys OID database | |
Header for OID database.
Definition in file oid_db.h.
| typedef struct yaz_oid_db* yaz_oid_db_t |
| enum oid_class |
| char* oid_name_to_dotstring | ( | oid_class | oclass, | |
| const char * | name, | |||
| char * | oid_buf | |||
| ) |
maps named from standard database to dot notation
| oclass | class of string (enum oid_class) | |
| name | named OID | |
| oid_buf | buffer for result (must be of size OID_STR_MAX) |
Definition at line 111 of file oid_db.c.
References yaz_oid_entry::oid, oid_oid_to_dotstring(), yaz_oid_std(), and yaz_string_to_oid().
| int yaz_oid_add | ( | yaz_oid_db_t | oid_db, | |
| oid_class | oclass, | |||
| const char * | name, | |||
| const Odr_oid * | new_oid | |||
| ) |
adds new OID entry to database
| oid_db | database | |
| oclass | OID class | |
| name | name of OID | |
| new_oid | OID value (raw OID) |
| 0 | OID added | |
| -1 | OID name+oclass already exists |
Definition at line 129 of file oid_db.c.
References CLASS_NOP, yaz_oid_db::entries, yaz_oid_entry::name, yaz_oid_db::next, yaz_oid_entry::oclass, yaz_oid_entry::oid, oid_oidcpy(), oid_oidlen(), xmalloc, yaz_oid_db::xmalloced, xstrdup, and yaz_string_to_oid().
| void yaz_oid_db_destroy | ( | yaz_oid_db_t | oid_db | ) |
destroys OID database
| oid_db | database |
Definition at line 171 of file oid_db.c.
References yaz_oid_db::entries, yaz_oid_entry::name, yaz_oid_db::next, xfree, and yaz_oid_db::xmalloced.
| yaz_oid_db_t yaz_oid_db_new | ( | void | ) |
creates empty OID database
Definition at line 162 of file oid_db.c.
References yaz_oid_db::entries, yaz_oid_db::next, xmalloc, and yaz_oid_db::xmalloced.
| int yaz_oid_is_iso2709 | ( | const Odr_oid * | oid | ) |
checks if OID refers to MARC transfer syntax
| oid | raw OID |
| 1 | OID is a MARC type | |
| 0 | OID is not a MARC type |
Definition at line 120 of file oid_db.c.
References oid_oidlen().
Referenced by return_record_wrbuf(), and ztest_fetch().
| yaz_oid_db_t yaz_oid_std | ( | void | ) |
returns standard OID database
| OID | database handle |
Definition at line 34 of file oid_db.c.
Referenced by conf_retrieval(), cql_transform_parse_tok_line(), create_update_package(), npr_format(), oid_name_to_dotstring(), otherInfo_attach(), query_oid_getvalbyname(), yaz_oid_to_string_buf(), yaz_xml2query_attribute_element(), yaz_xml2query_rpn(), ZOOM_record_error(), and zoom_yaz_str_to_z3950oid().
| const char* yaz_oid_to_string | ( | yaz_oid_db_t | oid_db, | |
| const Odr_oid * | oid, | |||
| oid_class * | oclass | |||
| ) |
maps raw OID to string
| oid_db | OID database | |
| oid | raw OID | |
| oclass | holds OID class if found (output parameter) |
Definition at line 79 of file oid_db.c.
References get_entries, yaz_oid_entry::name, yaz_oid_db::next, yaz_oid_entry::oclass, yaz_oid_entry::oid, and oid_oidcmp().
Referenced by npr_format(), yaz_oid_to_string_buf(), and ZOOM_record_error().
maps any OID to string (named or dot-notation)
| oid | raw OID | |
| oclass | holds OID class if found (output parameter) | |
| buf | string buffer for result (must be of size OID_STR_MAX) |
Definition at line 100 of file oid_db.c.
References CLASS_GENERAL, oid_oid_to_dotstring(), yaz_oid_std(), and yaz_oid_to_string().
Referenced by display_grs1(), response_default_diag(), yaz_attribute_element_to_wrbuf(), yaz_query2xml_attribute_element(), yaz_query2xml_rpn(), yaz_rpnquery_to_wrbuf(), z_ext_record_oid(), z_ext_record_oid_any(), zlog_attributes(), and ztest_esrequest().
| void yaz_oid_trav | ( | yaz_oid_db_t | oid_db, | |
| void(*)(const Odr_oid *oid, oid_class oclass, const char *name, void *client_data) | func, | |||
| void * | client_data | |||
| ) |
traverses OIDs in a database
| oid_db | OID database | |
| func | function to be called for each OID | |
| client_data | data to be passed to func (custom defined) |
Definition at line 189 of file oid_db.c.
References get_entries, yaz_oid_entry::name, yaz_oid_db::next, yaz_oid_entry::oclass, and yaz_oid_entry::oid.
| const Odr_oid* yaz_string_to_oid | ( | yaz_oid_db_t | oid_db, | |
| oid_class | oclass, | |||
| const char * | name | |||
| ) |
maps named OID string to raw OID by database lookup
| oid_db | OID database | |
| oclass | class of string (enum oid_class) | |
| name | OID name |
This function only maps known names in the database provided. Use yaz_string_to_oid_nmem or yaz_string_to_oid_odr to map any named OID in dot-notation (1.2.8).
Definition at line 41 of file oid_db.c.
References CLASS_GENERAL, get_entries, yaz_oid_entry::name, yaz_oid_db::next, yaz_oid_entry::oclass, yaz_oid_entry::oid, and yaz_matchstr().
Referenced by oid_name_to_dotstring(), yaz_oid_add(), and yaz_string_to_oid_nmem().
| Odr_oid* yaz_string_to_oid_nmem | ( | yaz_oid_db_t | oid_db, | |
| oid_class | oclass, | |||
| const char * | name, | |||
| NMEM | nmem | |||
| ) |
creates NMEM malloc'ed OID from string
| oid_db | OID database | |
| oclass | class of string (enum oid_class) | |
| name | OID name | |
| nmem | memory for returned OID |
Definition at line 64 of file oid_db.c.
References odr_getoidbystr_nmem(), odr_oiddup_nmem(), yaz_oid_entry::oid, and yaz_string_to_oid().
Referenced by cql_transform_parse_tok_line(), and yaz_string_to_oid_odr().
| Odr_oid* yaz_string_to_oid_odr | ( | yaz_oid_db_t | oid_db, | |
| oid_class | oclass, | |||
| const char * | name, | |||
| ODR | odr | |||
| ) |
creates ODR malloc'ed OID from string
| oid_db | OID database | |
| oclass | class of string (enum oid_class) | |
| name | OID name | |
| odr | memory for returned OID |
Definition at line 73 of file oid_db.c.
References odr_getmem, and yaz_string_to_oid_nmem().
Referenced by conf_retrieval(), create_update_package(), otherInfo_attach(), query_oid_getvalbyname(), yaz_xml2query_attribute_element(), yaz_xml2query_rpn(), and zoom_yaz_str_to_z3950oid().
1.6.3