Go to the source code of this file.
|
void | checkerr (int Result, const char *ErrorOut) |
| Checks if Result is < 0 then printout the ErrorOut and exits with code 0.
|
|
uint32_t | snf_bytes_to_uint32 (const char *bytes, int nBytes) |
| Turns a sequence of bytes into a uint32 (Following big-endian)
|
|
char * | snf_strlen_to_bytes (const char *Str, int nBytes) |
| Turns a string's length into a sequence of bytes (Following big-endian)
|
|
char * | snf_uint32_to_bytes (uint32_t i, int nBytes) |
| Turns a uint32 into a sequence of bytes (Following big-endian)
|
|
int | snf_setnonblocking (int _sock) |
| Sets a socket as non blocking.
|
|
void | snf_print_err (const char *StrErr) |
|
◆ checkerr()
void checkerr |
( |
int | Result, |
|
|
const char * | ErrorOut ) |
|
extern |
Checks if Result is < 0 then printout the ErrorOut and exits with code 0.
- Parameters
-
Result | Input to be checked if < 0 |
ErrorOut | Error Message content |
◆ snf_bytes_to_uint32()
uint32_t snf_bytes_to_uint32 |
( |
const char * | bytes, |
|
|
int | nBytes ) |
|
extern |
Turns a sequence of bytes into a uint32 (Following big-endian)
- Parameters
-
bytes | Bytes sequence |
nBytes | Bytes sequence's length |
- Returns
- bytes's value in uint32_t On Sucess || 0
◆ snf_strlen_to_bytes()
char * snf_strlen_to_bytes |
( |
const char * | Str, |
|
|
int | nBytes ) |
|
extern |
Turns a string's length into a sequence of bytes (Following big-endian)
- Parameters
-
Str | String whose length would be formatted into Bytes sequence |
nBytes | Bytes sequence's length |
- Returns
- Byte sequence On Success | NULL On fail { Shall fail if Str is NULL || nBytes is a negative number || Str doesn't finish with a null character || an Error occured during allocation }
◆ snf_uint32_to_bytes()
char * snf_uint32_to_bytes |
( |
uint32_t | i, |
|
|
int | nBytes ) |
|
extern |
Turns a uint32 into a sequence of bytes (Following big-endian)
- Parameters
-
i | uint32_t that would be formatted into Bytes sequence |
nBytes | Bytes sequence's length |
- Returns
- Byte sequence On Success | NULL On fail { Shall fail if nBytes is a negative number || Str doesn't finish with a null character || an Error occured during allocation }
◆ snf_setnonblocking()
int snf_setnonblocking |
( |
int | _sock | ) |
|
|
extern |
Sets a socket as non blocking.
- Parameters
-
_sock | Socket to be operated on |
- Returns
- See fcntl(..)
◆ snf_print_err()
void snf_print_err |
( |
const char * | StrErr | ) |
|
|
extern |
◆ SNF_ERR_OUT
void(* SNF_ERR_OUT) (const char *) |
( |
const char * | | ) |
|
|
extern |