libexplain  1.4.D001
Functions
libexplain/buffer/socket_protocol.h File Reference

Go to the source code of this file.

Functions

void explain_buffer_socket_protocol (struct explain_string_buffer_t *sb, int protocol)
int explain_parse_socket_protocol_or_die (const char *text, const char *cptn)

Function Documentation

void explain_buffer_socket_protocol ( struct explain_string_buffer_t sb,
int  protocol 
)

The explain_buffer_socket_protocol function may be used to print a symbolic value of a socket protocol value to the given string buffer.

Parameters:
sbThe string buffer to print into.
protocolThe socket protocol value to interpret.

Definition at line 111 of file socket_protocol.c.

int explain_parse_socket_protocol_or_die ( const char *  text,
const char *  cptn 
)

The explain_parse_socket_protocol function is used to parse a string into a socket protocol value. On error, prints a diagnostic and exits EXIT_FAILURE.

Parameters:
textThe string to be parsed.
cptnadditional text to add to start of error message
Returns:
the socket value, or -1 on error

Definition at line 135 of file socket_protocol.c.