X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=doc%2Fbook.xml;fp=doc%2Fbook.xml;h=bb99baa4b0e9290cd5e17108654fae8f35f02a4e;hp=f61011cc1145ab1a004fb281e1341aa1a79a9f53;hb=323805b6779bcf1befdc7cdd7f10c23b06885e0d;hpb=0ec12c344e05f3637af9f48e6aa28a54d99f8343 diff --git a/doc/book.xml b/doc/book.xml index f61011c..bb99baa 100644 --- a/doc/book.xml +++ b/doc/book.xml @@ -7883,7 +7883,7 @@ int cql_transform_rpn2cql_wrbuf(cql_transform_t ct, Introduction - &odr; is the BER-encoding/decoding subsystem of &yaz;. Care as been taken + &odr; is the BER-encoding/decoding subsystem of &yaz;. Care has been taken to isolate &odr; from the rest of the package - specifically from the transport interface. &odr; may be used in any context where basic ASN.1/BER representations are used. @@ -8207,7 +8207,7 @@ void do_nothing_useful(Odr_int value) odr_setprint(ODR o, FILE *file); before encoders or decoders are being invoked. - It is also possible to direct the output to a buffer (of indeed + It is also possible to direct the output to a buffer (or indeed another file), by using the more generic mechanism: void odr_set_stream(ODR o, void *handle, @@ -8224,7 +8224,7 @@ void do_nothing_useful(Odr_int value) 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. + which indicates the type of contents being written. Another utility useful for diagnostics (error handling) or as @@ -8234,7 +8234,7 @@ void do_nothing_useful(Odr_int value) 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, + then ar[0] is the top level element, ar[n] is the last. The last element has the property that ar[n+1] == NULL. @@ -8484,7 +8484,7 @@ int odr_octetstring(ODR o, Odr_oct **p, int optional, The buf field should point to the character array that holds the octetstring. The len field holds the actual length. - The character array need not be null terminated. + The character array need not be null-terminated. To make things a little easier, an alternative is given for string @@ -8495,8 +8495,8 @@ int odr_octetstring(ODR o, Odr_oct **p, int optional, int odr_cstring(ODR o, char **p, int optional, const char *name); - Which encoded or decodes between OCTETSTRING representations and - null-terminates C strings. + which encodes or decodes between OCTETSTRING representations and + null-terminated C strings. Functions are provided for the derived string types, e.g.: @@ -8626,7 +8626,7 @@ int odr_sequence_end(ODR o); parameter is ignored. On decoding, it returns 1 if the type is found in the data stream. size bytes of memory are allocated, and *p is set to point to this space. - odr_sequence_end() is called at the end of the + The odr_sequence_end() is called at the end of the complex function. Assume that a type is defined like this: @@ -8752,7 +8752,7 @@ int odr_constructed_end(ODR o); Assume that the IMPLICIT in the type definition above were replaced - with EXPLICIT (or that the IMPLICIT keyword were simply deleted, which + with EXPLICIT (or that the IMPLICIT keyword was simply deleted, which would be equivalent). The structure definition would look the same, but the function would look like this: @@ -8779,7 +8779,7 @@ int mySequence(ODR o, MySequence **p, int optional, const char *name) Notice that the interface here gets kind of nasty. The reason is simple: Explicitly tagged, constructed types are fairly rare in the protocols that we care about, so the - esthetic annoyance (not to mention the dangers of a cluttered + aesthetic annoyance (not to mention the dangers of a cluttered interface) is less than the time that would be required to develop a better interface. Nevertheless, it is far from satisfying, and it's a point that will be worked on in the future. One option for you would @@ -8976,7 +8976,7 @@ int myChoice(ODR o, MyChoice **p, int optional, const char *name) declaring sequence elements (including CHOICEs) optional. - The ASN.1 specifications naturally requires that each member of a + The ASN.1 specifications naturally require that each member of a CHOICE have a distinct tag, so they can be told apart on decoding. Sometimes it can be useful to define a CHOICE that has multiple types that share the same tag. You'll need some other mechanism, perhaps @@ -8993,7 +8993,7 @@ void odr_choice_bias(ODR o, int what); provides this functionality. When called, it leaves a notice for the next call to odr_choice() to be called on the decoding - stream o that only the arm entry with + stream o, that only the arm entry with a which field equal to what should be tried. @@ -9163,8 +9163,8 @@ void odr_choice_bias(ODR o, int what); The cs_create function returns a null-pointer if a system error occurs. - The blocking parameter should be one if - you wish the association to operate in blocking mode, zero otherwise. + The blocking parameter should be '1' if + you wish the association to operate in blocking mode, and '0' otherwise. The protocol field should be PROTO_Z3950 or PROTO_HTTP. Protocol PROTO_SR is no longer supported. @@ -9201,7 +9201,7 @@ void odr_choice_bias(ODR o, int what); should call it repeatedly with the same values of buf and len, until the buffer has been transmitted. When a full buffer has been sent, the function will return 0 for - success. -1 indicates an error condition (see below). + success. The return value -1 indicates an error condition (see below). int cs_get(COMSTACK handle, char **buf, int *size); @@ -9217,12 +9217,12 @@ void odr_choice_bias(ODR o, int what); around internally by the subsystem when partial packages are read. Before calling cs_get - for the fist time, the buffer can be initialized to the null pointer, - and the length should also be set to 0 - cs_get will perform a + for the first time, the buffer can be initialized to the null pointer, + and the length should also be set to 0 (cs_get will perform a malloc(2) - on the buffer for you. When a full buffer has been read, the size of - the package is returned (which will always be greater than 1). -1 - indicates an error condition. + on the buffer for you). When a full buffer has been read, the size of + the package is returned (which will always be greater than 1). + The return value -1 indicates an error condition. See also the cs_more() function below. @@ -9325,7 +9325,7 @@ void odr_choice_bias(ODR o, int what); int cs_fileno(COMSTACK h); - Returns the file descriptor of the association. Use this when + returns the file descriptor of the association. Use this when file-level operations on the endpoint are required (select(2) operations, specifically). @@ -9411,7 +9411,7 @@ void odr_choice_bias(ODR o, int what); You may need to use this function with some care if your - name server service is slow or unreliable + name server service is slow or unreliable. @@ -9471,8 +9471,8 @@ void odr_choice_bias(ODR o, int what); cs_straddr. The str is similar to that described for cs_straddr but with a prefix denoting the &comstack; type. Prefixes supported - are tcp:, unix: and - ssl: for TCP/IP, UNIX and SSL respectively. + are tcp: and unix: and + ssl: for TCP/IP and UNIX and SSL respectively. If no prefix is given, then TCP/IP is used. The blocking is passed to function cs_create. The third parameter @@ -9489,7 +9489,7 @@ void odr_choice_bias(ODR o, int what); void *cs_get_ssl(COMSTACK cs); Returns the SSL handle, SSL * for comstack. If comstack - is not of type SSL, NULL is returned. + is not of type SSL, then NULL is returned. @@ -9539,15 +9539,15 @@ void odr_choice_bias(ODR o, int what); You can the textual representation of the error code - by using cs_errmsg - which - works like strerror(3) + by using cs_errmsg, which + works like strerror(3). const char *cs_errmsg(int n); - It is also possible to get straight to the textual represenataion - without the error code by using + It is also possible to get straight to the textual representation + without the error code, by using cs_strerror.