Package Reference#
fipv/fipv.c#
-
static PyObject *ipv4(PyObject *self, PyObject *args)#
[source] Module function for validating IPv4 values.
- Parameters:
self (PyObject*) – the module itself
args (PyObject*) – function arguments as a python object
- Returns:
- Python boolean object,
True
if value is a valid IPv4 otherwise returns
False
- Python boolean object,
-
static PyObject *ipv4_cidr(PyObject *self, PyObject *args)#
[source] Module function for validating IPv4 CIDR values.
- Parameters:
self (PyObject*) – the module itself
args (PyObject*) – function arguments as a python object
- Returns:
- Python boolean object,
True
if value is a valid IPv4 CIDR otherwise returns
False
- Python boolean object,
-
static PyObject *ipv6(PyObject *self, PyObject *args)#
[source] Module function for validating IPv6 values.
- Parameters:
self (PyObject*) – the module itself
args (PyObject*) – function arguments as a python object
- Returns:
- Python boolean object,
True
if value is a valid IPv6 otherwise returns
False
- Python boolean object,
-
static PyObject *ipv6_cidr(PyObject *self, PyObject *args)#
[source] Module function for validating IPv6 CIDR values.
- Parameters:
self (PyObject*) – the module itself
args (PyObject*) – function arguments as a python object
- Returns:
- Python boolean object,
True
if value is a valid IPv6 CIDR otherwise returns
False
- Python boolean object,
include/split.h#
-
struct split_t split(char *target_str, char *delimiters)#
[source] Basically it splits dynamically given string.
- Parameters:
target_str (char*) – target string to be splitted
delimiters (char*) – list of delimiter characters as a char pointer
- Returns:
splitted results as a
struct split_t
type
-
void free_split(struct split_t *split_ptr)#
[source] Deallocate any type of
struct split_t
object.- Parameters:
split_ptr (struct split_t*) – target address of split_t object
-
bool free_split_r(struct split_t *ptr, bool ret)#
[source] - Reentrant function for free_split. The _r indicates
that. Basically it frees given split_t pointer address (uses
free_split
) and returns given return value.
- Parameters:
ptr (struct split_t*) – target address of split_t object
ret (bool) – return value as a bool
- Returns:
directly given ret value
include/types.h#
include/utils.h#
-
bool is_digit(char *target_str)#
[source] Checks if the given string is a digit.
- Parameters:
target_str (char*) – target string to be checked
- Returns:
true
if string is a digit otherwisefalse
-
bool is_xdigit(char *target_str)#
[source] Checks if the given string is a hexadecimal.
- Parameters:
target_str (char*) – target string to be checked
- Returns:
true
if string is a hexadecimal otherwisefalse
-
bool startswith(char *target_str, char chr)#
[source] Returns
true
if the given string startswith given character.- Parameters:
target_str (char*) – target string
chr (char) – comparing character
- Returns:
true
iftarget_str
startswithchr
-
bool endswith(char *target_str, char chr)#
[source] Returns
true
if the given string endswith given character.- Parameters:
target_str (char*) – target string
chr (char) – comparing character
- Returns:
true
iftarget_str
endswithchr
-
int blanks(char *target_str, char delimiter)#
[source] - Definition of blank is python empty string (
''
). If you split..
with
.
in python, you get 3 empty string (['', '', '']
) simply blanks function counts these empty strings.
- Parameters:
target_str (char*) – target string to count blanks
delimiter (char) – delimiter character
- Returns:
count of empty strings
- Definition of blank is python empty string (
include/xalloc.h#
-
void *xmem_err(void *p)#
[source] Throw exception and exit program if p is
NULL
pointer.- Parameters:
p (void*) – target pointer
- Returns:
p
ifp
is notNULL
-
void *xmalloc(size_t size)#
[source] Allocate memory from heap and initialize with zero values.
- Parameters:
size (size_t) – allocation byte size
- Returns:
head of allocated address