Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/http/src/receive-buffer.c

    rb7fd2a0 rcde999a  
    4343#include <http/receive-buffer.h>
    4444
    45 errno_t recv_buffer_init(receive_buffer_t *rb, size_t buffer_size,
     45int recv_buffer_init(receive_buffer_t *rb, size_t buffer_size,
    4646    receive_func_t receive, void *client_data)
    4747{
     
    6161}
    6262
    63 static errno_t dummy_receive(void *unused, void *buf, size_t buf_size,
     63static int dummy_receive(void *unused, void *buf, size_t buf_size,
    6464    size_t *nrecv)
    6565{
     
    6868}
    6969
    70 errno_t recv_buffer_init_const(receive_buffer_t *rb, void *buf, size_t size)
    71 {
    72         errno_t rc = recv_buffer_init(rb, size, dummy_receive, NULL);
     70int recv_buffer_init_const(receive_buffer_t *rb, void *buf, size_t size)
     71{
     72        int rc = recv_buffer_init(rb, size, dummy_receive, NULL);
    7373        if (rc != EOK)
    7474                return rc;
     
    107107}
    108108
    109 errno_t recv_cut(receive_buffer_t *rb, receive_buffer_mark_t *a, receive_buffer_mark_t *b, void **out_buf, size_t *out_size)
     109int recv_cut(receive_buffer_t *rb, receive_buffer_mark_t *a, receive_buffer_mark_t *b, void **out_buf, size_t *out_size)
    110110{
    111111        if (a->offset > b->offset)
     
    123123}
    124124
    125 errno_t recv_cut_str(receive_buffer_t *rb, receive_buffer_mark_t *a, receive_buffer_mark_t *b, char **out_buf)
     125int recv_cut_str(receive_buffer_t *rb, receive_buffer_mark_t *a, receive_buffer_mark_t *b, char **out_buf)
    126126{
    127127        if (a->offset > b->offset)
     
    147147
    148148/** Receive one character (with buffering) */
    149 errno_t recv_char(receive_buffer_t *rb, char *c, bool consume)
     149int recv_char(receive_buffer_t *rb, char *c, bool consume)
    150150{
    151151        if (rb->out == rb->in) {
     
    170170               
    171171                size_t nrecv;
    172                 errno_t rc = rb->receive(rb->client_data, rb->buffer + rb->in, free, &nrecv);
     172                int rc = rb->receive(rb->client_data, rb->buffer + rb->in, free, &nrecv);
    173173                if (rc != EOK)
    174174                        return rc;
     
    183183}
    184184
    185 errno_t recv_buffer(receive_buffer_t *rb, char *buf, size_t buf_size,
     185int recv_buffer(receive_buffer_t *rb, char *buf, size_t buf_size,
    186186    size_t *nrecv)
    187187{
     
    202202 * @return EOK or an error code
    203203 */
    204 errno_t recv_discard(receive_buffer_t *rb, char discard, size_t *ndisc)
     204int recv_discard(receive_buffer_t *rb, char discard, size_t *ndisc)
    205205{
    206206        char c = 0;
    207         errno_t rc = recv_char(rb, &c, false);
     207        int rc = recv_char(rb, &c, false);
    208208        if (rc != EOK)
    209209                return rc;
     
    223223 * @return EOK or an error code
    224224 */
    225 errno_t recv_discard_str(receive_buffer_t *rb, const char *discard, size_t *ndisc)
     225int recv_discard_str(receive_buffer_t *rb, const char *discard, size_t *ndisc)
    226226{
    227227        size_t discarded = 0;
    228228        while (*discard) {
    229229                size_t nd;
    230                 errno_t rc = recv_discard(rb, *discard, &nd);
     230                int rc = recv_discard(rb, *discard, &nd);
    231231                if (rc != EOK)
    232232                        return rc;
     
    241241}
    242242
    243 errno_t recv_while(receive_buffer_t *rb, char_class_func_t class)
     243int recv_while(receive_buffer_t *rb, char_class_func_t class)
    244244{
    245245        while (true) {
    246246                char c = 0;
    247                 errno_t rc = recv_char(rb, &c, false);
     247                int rc = recv_char(rb, &c, false);
    248248                if (rc != EOK)
    249249                        return rc;
     
    266266 * @return EOK on success or an error code
    267267 */
    268 errno_t recv_eol(receive_buffer_t *rb, size_t *nrecv)
     268int recv_eol(receive_buffer_t *rb, size_t *nrecv)
    269269{
    270270        char c = 0;
    271         errno_t rc = recv_char(rb, &c, false);
     271        int rc = recv_char(rb, &c, false);
    272272        if (rc != EOK)
    273273                return rc;
     
    292292
    293293/* Receive a single line */
    294 errno_t recv_line(receive_buffer_t *rb, char *line, size_t size, size_t *nrecv)
     294int recv_line(receive_buffer_t *rb, char *line, size_t size, size_t *nrecv)
    295295{
    296296        size_t written = 0;
     
    299299        while (written < size) {
    300300                char c = 0;
    301                 errno_t rc = recv_char(rb, &c, true);
     301                int rc = recv_char(rb, &c, true);
    302302                if (rc != EOK)
    303303                        return rc;
Note: See TracChangeset for help on using the changeset viewer.