libexplain  1.4.D001
Functions | Variables
libexplain/buffer/socket_type.c File Reference
#include <libexplain/ac/sys/socket.h>
#include <libexplain/parse_bits.h>
#include <libexplain/buffer/socket_type.h>
#include <libexplain/sizeof.h>
#include <libexplain/string_buffer.h>

Go to the source code of this file.

Functions

void explain_buffer_socket_type (explain_string_buffer_t *sb, int type)
int explain_parse_socket_type_or_die (const char *text, const char *caption)
void explain_buffer_socket_type_from_fildes (explain_string_buffer_t *sb, int fildes)

Variables

static const
explain_parse_bits_table_t 
table []

Function Documentation

void explain_buffer_socket_type ( struct explain_string_buffer_t sb,
int  type 
)

The explain_buffer_socket_type function may be used to print a symbolic representation of a socket type.

Parameters:
sbThe string buffer to print into.
typeThe socket type to decipher.

Definition at line 52 of file socket_type.c.

void explain_buffer_socket_type_from_fildes ( struct explain_string_buffer_t sb,
int  fildes 
)

The explain_buffer_socket_type_from_fildes function may be used to supplement an error explanation with the type of a socet, taken from the file descriptor. Nothing is printed if thr socket type cannot be determined.

Parameters:
sbThe string buffer to print into.
fildesthe file descriptor to extract the socket type from and then print it

Definition at line 72 of file socket_type.c.

int explain_parse_socket_type_or_die ( const char *  text,
const char *  caption 
)

The explain_parse_socket_type_or_die function may be used to parse a string into a socket type value. On error, prints a diagnostic and exits EXIT_FAILURE.

Parameters:
textThe string to parse.
captionaddition text to add to start of error message
Returns:
the socket type

Definition at line 65 of file socket_type.c.


Variable Documentation

Initial value:
{


















}

Definition at line 28 of file socket_type.c.