HIPC  0.5
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
Functions
posix_usoc.c File Reference
#include <stddef.h>
#include <hipc.h>
#include <hipc/posix/ioutils.h>
#include <hipc/posix/usoc.h>
Include dependency graph for posix_usoc.c:

Go to the source code of this file.

Functions

void hipcPosixUsocInit (struct HIPC_usoc *so_p, const int fdr, const int fdw)
 Initializes a universal socket. More...
 
enum HIPC_errno hipcUsocRead (struct HIPC_usoc *so_p, void *buf, const size_t size)
 Reads exactly size bytes from so_p. More...
 
enum HIPC_errno hipcUsocWrite (struct HIPC_usoc *so_p, const void *buf, const size_t size)
 Writes exactly size bytes to so_p. More...
 

Function Documentation

void hipcPosixUsocInit ( struct HIPC_usoc so_p,
const int  fdr,
const int  fdw 
)

Initializes a universal socket.

Parameters
so_pPointer to a universal socket
fdra file descriptor for reading
fdwa file descriptor for writing

Definition at line 14 of file posix_usoc.c.

References HIPC_usoc::fdr, and HIPC_usoc::fdw.

Referenced by main().

Here is the caller graph for this function:

enum HIPC_errno hipcUsocRead ( struct HIPC_usoc so_p,
void *  buf,
const size_t  size 
)

Reads exactly size bytes from so_p.

Parameters
so_pPointer to a universal socket
bufBuffer into which bytes are read
sizeNumber of bytes to be read
Returns
HIPC_SUCCESS on success, or an error on failure.

Definition at line 24 of file posix_usoc.c.

References HIPC_usoc::fdr, HIPC_ERR_S_IO_READ, HIPC_SUCCESS, and hipcPosixReadExactly().

Here is the call graph for this function:

enum HIPC_errno hipcUsocWrite ( struct HIPC_usoc so_p,
const void *  buf,
const size_t  size 
)

Writes exactly size bytes to so_p.

Parameters
so_pPointer to a universal socket
bufBuffer from which bytes are written
sizeNumber of bytes to be written
Returns
HIPC_SUCCESS on success, or an error on failure.

Definition at line 36 of file posix_usoc.c.

References HIPC_usoc::fdw, HIPC_ERR_S_IO_WRITE, HIPC_SUCCESS, and hipcPosixWriteExactly().

Here is the call graph for this function: