YAZ  5.34.0
Typedefs | Functions
spipe.h File Reference

socket-pipe header More...

#include <stddef.h>
#include <time.h>
#include <yaz/yconfig.h>
#include <yaz/wrbuf.h>

Go to the source code of this file.

Typedefs

typedef struct yaz_spipeyaz_spipe_t
 YAZ socket pipe opaque pointer. More...
 

Functions

yaz_spipe_t yaz_spipe_create (int port_to_use, WRBUF *err_msg)
 create socket pipe More...
 
void yaz_spipe_destroy (yaz_spipe_t p)
 destroys socket pipe More...
 
int yaz_spipe_get_read_fd (yaz_spipe_t p)
 returns reading socket More...
 
int yaz_spipe_get_write_fd (yaz_spipe_t p)
 returns writing socket More...
 

Detailed Description

socket-pipe header

Definition in file spipe.h.

Typedef Documentation

◆ yaz_spipe_t

typedef struct yaz_spipe* yaz_spipe_t

YAZ socket pipe opaque pointer.

Definition at line 43 of file spipe.h.

Function Documentation

◆ yaz_spipe_create()

yaz_spipe_t yaz_spipe_create ( int  port_to_use,
WRBUF err_msg 
)

create socket pipe

Parameters
port_to_useport that we temporarily bind to
err_msgerror message reference (0 if not to be set)
Returns
0 on failure; != 0 on success

Definition at line 101 of file spipe.c.

References yaz_spipe::m_fd, yaz_spipe::m_socket, nonblock(), wrbuf_printf(), xfree, xmalloc, YAZ_INVALID_SOCKET, YAZ_SOCKLEN_T, yaz_spipe_close(), and yaz_spipe_destroy().

◆ yaz_spipe_destroy()

void yaz_spipe_destroy ( yaz_spipe_t  p)

destroys socket pipe

Parameters
psocket pipe pointer

Definition at line 255 of file spipe.c.

References yaz_spipe::m_fd, yaz_spipe::m_socket, xfree, and yaz_spipe_close().

Referenced by yaz_spipe_create().

◆ yaz_spipe_get_read_fd()

int yaz_spipe_get_read_fd ( yaz_spipe_t  p)

returns reading socket

Parameters
psocket pipe pointer

Definition at line 266 of file spipe.c.

References yaz_spipe::m_fd.

◆ yaz_spipe_get_write_fd()

int yaz_spipe_get_write_fd ( yaz_spipe_t  p)

returns writing socket

Parameters
psocket pipe pointer

Definition at line 271 of file spipe.c.

References yaz_spipe::m_fd.