src/sock.c
changeset 4 a3ca0f97a075
parent 3 cc94ae754e2a
child 5 a09a0797f6f0
equal deleted inserted replaced
3:cc94ae754e2a 4:a3ca0f97a075
     2 #include "sock_internal.h"
     2 #include "sock_internal.h"
     3 #include "sock_gnutls.h"
     3 #include "sock_gnutls.h"
     4 
     4 
     5 #include <assert.h>
     5 #include <assert.h>
     6 
     6 
     7 err_t sock_init (void)
     7 err_t sock_init (struct error_info *err)
     8 {
     8 {
     9     err_t err;
     9     // XXX: just call these all directly for now
       
    10     if (sock_gnutls_init(err))
       
    11         return ERROR_CODE(err);
    10 
    12 
    11     // XXX: just call these all directly for now
    13     // done
    12 
    14     return SUCCESS;
    13     if ((err = sock_gnutls_init()))
       
    14         return err;
       
    15 }
    15 }
    16 
    16 
    17 void sock_stream_init (struct sock_stream *sock, struct sock_stream_type *type)
    17 void sock_stream_init (struct sock_stream *sock, struct sock_stream_type *type)
    18 {
    18 {
    19     // be strict
    19     // be strict
    36 }
    36 }
    37 
    37 
    38 void sock_stream_error (struct sock_stream *sock, struct error_info *err)
    38 void sock_stream_error (struct sock_stream *sock, struct error_info *err)
    39 {
    39 {
    40     // copy from SOCK_ER
    40     // copy from SOCK_ER
    41     *err = SOCK_ERR(sock);
    41     *err = *SOCK_ERR(sock);
    42 }
    42 }