From: Adam Dickmeiss Date: Wed, 11 Sep 2013 07:21:34 +0000 (+0200) Subject: Rename odr_write2 to odr_write X-Git-Tag: v5.0.0~47 X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=commitdiff_plain;h=c82db01c9fc0b51254ec6ead5fe3b503ca098ca0 Rename odr_write2 to odr_write --- diff --git a/include/yaz/odr.h b/include/yaz/odr.h index 3f3c9f0..0d3cff1 100644 --- a/include/yaz/odr.h +++ b/include/yaz/odr.h @@ -287,7 +287,7 @@ YAZ_EXPORT void odr_end(ODR o); YAZ_EXPORT Odr_oid *odr_oiddup(ODR odr, const Odr_oid *o); YAZ_EXPORT Odr_oid *odr_oiddup_nmem(NMEM nmem, const Odr_oid *o); YAZ_EXPORT int odr_grow_block(ODR b, int min_bytes); -YAZ_EXPORT int odr_write2(ODR o, const char *buf, int bytes); +YAZ_EXPORT int odr_write(ODR o, const char *buf, int bytes); YAZ_EXPORT int odr_seek(ODR o, int whence, int offset); YAZ_EXPORT int odr_dumpBER(FILE *f, const char *buf, int len); YAZ_EXPORT void odr_choice_bias(ODR o, int what); diff --git a/src/ber_any.c b/src/ber_any.c index e4bcef3..e167d42 100644 --- a/src/ber_any.c +++ b/src/ber_any.c @@ -39,7 +39,7 @@ int ber_any(ODR o, Odr_any **p) o->bp += res; return 1; case ODR_ENCODE: - if (odr_write2(o, (*p)->buf, (*p)->len) < 0) + if (odr_write(o, (*p)->buf, (*p)->len) < 0) return 0; return 1; default: odr_seterror(o, OOTHER, 3); return 0; diff --git a/src/ber_bit.c b/src/ber_bit.c index b2242c4..ac3631a 100644 --- a/src/ber_bit.c +++ b/src/ber_bit.c @@ -70,7 +70,7 @@ int ber_bitstring(ODR o, Odr_bitmask *p, int cons) return 0; if (p->top < 0) return 1; - if (odr_write2(o, p->bits, p->top + 1) < 0) + if (odr_write(o, p->bits, p->top + 1) < 0) return 0; return 1; case ODR_PRINT: diff --git a/src/ber_int.c b/src/ber_int.c index 7717c07..cc02d3b 100644 --- a/src/ber_int.c +++ b/src/ber_int.c @@ -77,7 +77,7 @@ int ber_encinteger(ODR o, Odr_int val) len = sizeof(uval) - i; if (ber_enclen(o, len, 1, 1) != 1) return -1; - if (odr_write2(o, (const char *) tmp + i, len) < 0) + if (odr_write(o, (const char *) tmp + i, len) < 0) return -1; return 0; } diff --git a/src/ber_oct.c b/src/ber_oct.c index 1f547bf..25829c1 100644 --- a/src/ber_oct.c +++ b/src/ber_oct.c @@ -89,7 +89,7 @@ int ber_octetstring(ODR o, Odr_oct *p, int cons) return 0; if (p->len == 0) return 1; - if (odr_write2(o, p->buf, p->len) < 0) + if (odr_write(o, p->buf, p->len) < 0) return 0; return 1; case ODR_PRINT: diff --git a/src/http.c b/src/http.c index e4c3001..683336a 100644 --- a/src/http.c +++ b/src/http.c @@ -595,24 +595,24 @@ int yaz_encode_http_response(ODR o, Z_HTTP_Response *hr) sprintf(sbuf, "HTTP/%s %d %s\r\n", hr->version, hr->code, z_HTTP_errmsg(hr->code)); - odr_write2(o, sbuf, strlen(sbuf)); + odr_write(o, sbuf, strlen(sbuf)); /* use content_len for Content-Length */ sprintf(sbuf, "Content-Length: %d\r\n", hr->content_len); - odr_write2(o, sbuf, strlen(sbuf)); + odr_write(o, sbuf, strlen(sbuf)); for (h = hr->headers; h; h = h->next) { if (yaz_strcasecmp(h->name, "Content-Length") && yaz_strcasecmp(h->name, "Transfer-Encoding")) { /* skip Content-Length if given. content_len rules */ - odr_write2(o, h->name, strlen(h->name)); - odr_write2(o, ": ", 2); - odr_write2(o, h->value, strlen(h->value)); - odr_write2(o, "\r\n", 2); + odr_write(o, h->name, strlen(h->name)); + odr_write(o, ": ", 2); + odr_write(o, h->value, strlen(h->value)); + odr_write(o, "\r\n", 2); } } - odr_write2(o, "\r\n", 2); + odr_write(o, "\r\n", 2); if (hr->content_buf) - odr_write2(o, hr->content_buf, hr->content_len); + odr_write(o, hr->content_buf, hr->content_len); if (o->direction == ODR_PRINT) { odr_printf(o, "-- HTTP response:\n"); @@ -627,12 +627,12 @@ int yaz_encode_http_request(ODR o, Z_HTTP_Request *hr) Z_HTTP_Header *h; int top0 = o->top; - odr_write2(o, hr->method, strlen(hr->method)); - odr_write2(o, " ", 1); - odr_write2(o, hr->path, strlen(hr->path)); - odr_write2(o, " HTTP/", 6); - odr_write2(o, hr->version, strlen(hr->version)); - odr_write2(o, "\r\n", 2); + odr_write(o, hr->method, strlen(hr->method)); + odr_write(o, " ", 1); + odr_write(o, hr->path, strlen(hr->path)); + odr_write(o, " HTTP/", 6); + odr_write(o, hr->version, strlen(hr->version)); + odr_write(o, "\r\n", 2); if (hr->content_len && !z_HTTP_header_lookup(hr->headers, "Content-Length")) @@ -640,18 +640,18 @@ int yaz_encode_http_request(ODR o, Z_HTTP_Request *hr) char lstr[60]; sprintf(lstr, "Content-Length: %d\r\n", hr->content_len); - odr_write2(o, lstr, strlen(lstr)); + odr_write(o, lstr, strlen(lstr)); } for (h = hr->headers; h; h = h->next) { - odr_write2(o, h->name, strlen(h->name)); - odr_write2(o, ": ", 2); - odr_write2(o, h->value, strlen(h->value)); - odr_write2(o, "\r\n", 2); + odr_write(o, h->name, strlen(h->name)); + odr_write(o, ": ", 2); + odr_write(o, h->value, strlen(h->value)); + odr_write(o, "\r\n", 2); } - odr_write2(o, "\r\n", 2); + odr_write(o, "\r\n", 2); if (hr->content_buf) - odr_write2(o, hr->content_buf, hr->content_len); + odr_write(o, hr->content_buf, hr->content_len); if (o->direction == ODR_PRINT) { odr_printf(o, "-- HTTP request:\n"); diff --git a/src/odr_cons.c b/src/odr_cons.c index 76de621..4a18372 100644 --- a/src/odr_cons.c +++ b/src/odr_cons.c @@ -92,7 +92,7 @@ int odr_constructed_begin(ODR o, void *xxp, int zclass, int tag, o->op->stack_top->lenlen = lenlen; - if (odr_write2(o, dummy, lenlen) < 0) /* dummy */ + if (odr_write(o, dummy, lenlen) < 0) /* dummy */ { ODR_STACK_POP(o); return 0; diff --git a/src/odr_mem.c b/src/odr_mem.c index 2cc6b4a..c102b16 100644 --- a/src/odr_mem.c +++ b/src/odr_mem.c @@ -97,7 +97,7 @@ int odr_grow_block(ODR b, int min_bytes) return 0; } -int odr_write2(ODR o, const char *buf, int bytes) +int odr_write(ODR o, const char *buf, int bytes) { if (o->pos + bytes >= o->size && odr_grow_block(o, bytes)) {