Edit

kc3-lang/kc3/socket/socket_buf.h

Branch :

  • Show log

    Commit

  • Author : Google Search Manual
    Date : 2025-08-29 15:45:17
    Hash : 5930eea0
    Message : feat: socket(_buf) initialization

  • socket/socket_buf.h
  • /* kc3
     * Copyright from 2022 to 2025 kmx.io <contact@kmx.io>
     *
     * Permission is hereby granted to use this software granted the above
     * copyright notice and this permission paragraph are included in all
     * copies and substantial portions of this software.
     *
     * THIS SOFTWARE IS PROVIDED "AS-IS" WITHOUT ANY GUARANTEE OF
     * PURPOSE AND PERFORMANCE. IN NO EVENT WHATSOEVER SHALL THE
     * AUTHOR BE CONSIDERED LIABLE FOR THE USE AND PERFORMANCE OF
     * THIS SOFTWARE.
     */
    #ifndef SOCKET_BUF_H
    #define SOCKET_BUF_H
    
    #include "types.h"
    
    /* Stack-allocation compatible functions, call socket_buf_clean after
       use. */
    void           socket_buf_clean (s_socket_buf *sb);
    void           socket_buf_close (s_socket_buf *sb);
    s_socket_buf * socket_buf_init (s_socket_buf *sb, t_socket sockfd,
                                    struct sockaddr *addr, u32 addr_len);
    s_socket_buf * socket_buf_init_accept (s_socket_buf *sb,
                                           p_socket listening);
    s_socket_buf * socket_buf_init_connect (s_socket_buf *sb,
                                            const s_str *host,
                                            const s_str *service);
    
    #endif /* SOCKET_BUF_H */