X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=doc%2Fodr.xml;h=2a5fd7de4775fdd181167cc83d9e104f7b6dcf08;hb=5b9a39fc00ab0969ff020f05c51c5d336e00d762;hp=4f6ea57ddebd8012a7d71179325dd0ca0e6d2e6f;hpb=f34de3e6a08dfb7e5440264730b75ba713e55789;p=yaz-moved-to-github.git diff --git a/doc/odr.xml b/doc/odr.xml index 4f6ea57..2a5fd7d 100644 --- a/doc/odr.xml +++ b/doc/odr.xml @@ -1,4 +1,4 @@ - + The ODR Module Introduction @@ -369,16 +369,42 @@ void do_nothing_useful(int value) another file), by using the more generic mechanism: void odr_set_stream(ODR o, void *handle, - void (*stream_puts)(void *handle, const char *strz), + void (*stream_write)(ODR o, void *handle, int type, + const char *buf, int len), void (*stream_close)(void *handle)); Here the user provides an opaque handle and two handlers, - stream_puts for printing, + stream_write for writing, and stream_close which is supposed to close/free resources associated with handle. The stream_close handler is optional and if NULL for the function is provided, it will not be invoked. + The stream_write takes the ODR handle + as parameter, the user defined handle, a type + ODR_OCTETSTRING, ODR_VISIBLESTRING + which indicates the type of contents is being written. + + Another utility useful for diagnostics (error handling) or as + part of the printing facilities is: + + const char **odr_get_element_path(ODR o); + + which returns a list of current elements that ODR deals with at the + moment. For the returned array, say ar, + ar[0] is the top level element, + ar[n] is the last. The last element has the + property that ar[n+1] == NULL. + + + Element Path for record + + For a database record part of a PresentResponse the + array returned by odr_get_element + is presentResponse, databaseOrSurDiagnostics, ?, record, ?, databaseRecord . The question mark appears due to + unnamed constructions. + + Diagnostics