upipe/ubase.h header reference
Upipe common definitions More
Header inclusion
Members
Types
Functions
- bool ubase_check(int err)
- void ubase_clean_data(uint8_t **data_p)
- void ubase_clean_fd(int *fd_p)
- void ubase_clean_ptr(void **ptr_p)
- void ubase_clean_str(char **str_p)
- int ubase_clip(int i, int min, int max)
- const char * ubase_err_str(int err)
- uint64_t ubase_gcd(uint64_t a, uint64_t b)
- uint32_t ubase_get_signature(va_list args)
- int ubase_ncmp(const char *string, const char *prefix)
- int64_t ubase_sign(int64_t x)
- void uchain_init(struct uchain *uchain)
- struct urational urational_add(const struct urational *urational1, const struct urational *urational2)
- int64_t urational_cmp(const struct urational *urational1, const struct urational *urational2)
- struct urational urational_divide(const struct urational *dividend, const struct urational *diviser)
- struct urational urational_multiply(const struct urational *urational1, const struct urational *urational2)
- void urational_simplify(struct urational *urational)
Macros
Description
Upipe common definitions
Members detail
This macro is declared in upipe/ubase.h source file, line 316.
This macro returns #UBASE_ERR_ALLOC if the variable is NULL.
Parameter list:
- var: variable to check
This macro is declared in upipe/ubase.h source file, line 88.
This macro is used to retrieve the number of items of an array.
This macro is declared in upipe/ubase.h source file, line 194.
This macro is declared in upipe/ubase.h source file, line 68.
This macro marks a function or variable as deprecated (forces compiler warnings).
This macro is declared in upipe/ubase.h source file, line 280.
This macro runs the given function and throws an error in case of failure.
Parameter list:
- command: command whose return code is to be checked
This macro is declared in upipe/ubase.h source file, line 255.
This macro runs the given function and throws a fatal error in case of failure.
Parameter list:
- command: command whose return code is to be checked
This macro is declared in upipe/ubase.h source file, line 267.
This macro runs the given function, throws a fatal error and returns in case of failure.
Parameter list:
- command: command whose return code is to be checked
This macro is declared in upipe/ubase.h source file, line 70.
This macro marks a function as taking printf style arguments
This macro is declared in upipe/ubase.h source file, line 157.
This macro allows to define a 32-bit unsigned integer with 4 letters.
This macro is declared in upipe/ubase.h source file, line 99.
This macro declares two functions dealing with substructures included into a larger structure.
Parameter list:
- STRUCTURE: name of the larger structure
- SUBSTRUCT: name of the smaller substructure
- SUBNAME: name to use for the functions (STRUCTURE##_{to,from}_##SUBNAME)
- SUB: name of the struct SUBSTRUCT field of struct STRUCTURE
This macro is declared in upipe/ubase.h source file, line 244.
This macro runs the given function and returns if the error code is not UBASE_ERR_UNHANDLER.
Parameter list:
- command: command whose return code is to be checked
This macro is declared in upipe/ubase.h source file, line 232.
This macro runs the given function and returns an error in case of failure.
Parameter list:
- command: command whose return code is to be checked
This macro is declared in upipe/ubase.h source file, line 306.
This macro checks that the first argument is equal to the given signature.
Parameter list:
- args: va_list of arguments
- signature: unsigned int representing the signature of a module
This macro is declared in upipe/ubase.h source file, line 65.
This macro marks a function or variable as possibly unused (suppresses compiler warnings).
This macro is declared in upipe/ubase.h source file, line 31.
This macro is declared in upipe/ubase.h source file, line 82.
Preprocessor condition: not defined( container_of )
This macro is used to retrieve the private portion of a structure.
This macro is declared in upipe/ubase.h source file, line 55.
Preprocessor condition: not defined( likely )
This macro should be used in a if conditional when it will be true most of the time.
This macro is declared in upipe/ubase.h source file, line 291.
This macro asserts if the given command (returning an enum ubase_err) failed.
Parameter list:
- command: command whose return code is to be checked
This function is declared in upipe/ubase.h source file, line 225.
This function returns true if no error happened in an error code.
Parameter list:
- err: error code
The return value is true if no error happened
This function is declared in upipe/ubase.h source file, line 481.
This function frees data pointer and sets it to NULL.
Parameter list:
- ptr: a pointer to data pointer
This function is declared in upipe/ubase.h source file, line 490.
This function closes a fd and sets it to -1.
Parameter list:
- fd_p: a pointer to a fd
This function is declared in upipe/ubase.h source file, line 460.
This function frees a pointer and sets it to NULL.
Parameter list:
- ptr: a pointer to malloced data or NULL
This function is declared in upipe/ubase.h source file, line 472.
This function frees a string and sets it to NULL.
Parameter list:
- ptr: a pointer to a string
This function is declared in upipe/ubase.h source file, line 518.
This function clips an integer into the given range
Parameter list:
- args: the va list to copy from
The return value is a signature
This enum is declared in upipe/ubase.h source file, line 170.
This enum defines the standard error codes.
Identifier | Value | Description |
---|---|---|
UBASE_ERR_NONE | 0 | no error |
UBASE_ERR_UNKNOWN | 1 | unknown error |
UBASE_ERR_ALLOC | 2 | allocation error |
UBASE_ERR_NOSPC | 3 | not enough space |
UBASE_ERR_UPUMP | 4 | unable to allocate a upump |
UBASE_ERR_UNHANDLED | 5 | unhandled command or event |
UBASE_ERR_INVALID | 6 | invalid argument |
UBASE_ERR_EXTERNAL | 7 | error in external library |
UBASE_ERR_BUSY | 8 | failure to get an exclusive resource |
UBASE_ERR_LOCAL | 0x8000 | non-standard error codes implemented by a module type can start from there |
This function is declared in upipe/ubase.h source file, line 203.
This function return the corresponding error string.
Parameter list:
- err: the error value
The return value is the error string
This function is declared in upipe/ubase.h source file, line 338.
This function returns the greatest common denominator between two positive integers.
Parameter list:
- a: first integer (not null)
- b: second integer
The return value is GCD of the two integers
This function is declared in upipe/ubase.h source file, line 504.
This function copies the signature from a va list.
Parameter list:
- args: the va list to copy from
The return value is a signature
This macro is declared in upipe/ubase.h source file, line 298.
This macro asserts if the given command (returning an enum ubase_err) succeeded.
Parameter list:
- command: command whose return code is to be checked
This function is declared in upipe/ubase.h source file, line 451.
This function checks if a prefix matches a string.
Parameter list:
- string: large string
- prefix: prefix to check
The return value is 0 if the prefix matches
This function is declared in upipe/ubase.h source file, line 327.
This function returns the sign of an integer.
Parameter list:
- x: integer
The return value is sign of the integer
This struct is declared in upipe/ubase.h source file, line 140.
This struct is designed to chain uref and ubuf in a list.
void uchain_init(struct uchain *uchain)
This function is declared in upipe/ubase.h source file, line 152.
This function initializes a uchain.
Parameter list:
- uchain: pointer to a uchain structure
This macro is declared in upipe/ubase.h source file, line 60.
Preprocessor condition: not defined( unlikely )
This macro should be used in a if conditional when it will be false most of the time.
This struct is declared in upipe/ubase.h source file, line 348.
This struct defines the rational type.
struct urational urational_add(const struct urational *urational1, const struct urational *urational2)
This function is declared in upipe/ubase.h source file, line 397.
This function adds two rationals.
Parameter list:
- urational1: pointer to rational 1
- urational2: pointer to rational 2
The return value is a rational
This function is declared in upipe/ubase.h source file, line 380.
This function compares two rationals.
Parameter list:
- urational1: pointer to rational 1
- urational2: pointer to rational 2
The return value is 0 if both rationals are equal
struct urational urational_divide(const struct urational *dividend, const struct urational *diviser)
This function is declared in upipe/ubase.h source file, line 430.
This function divides two rationals.
Parameter list:
- urational1: pointer to rational 1
- urational2: pointer to rational 2
The return value is a rational
struct urational urational_multiply(const struct urational *urational1, const struct urational *urational2)
This function is declared in upipe/ubase.h source file, line 414.
This function multiplies two rationals.
Parameter list:
- urational1: pointer to rational 1
- urational2: pointer to rational 2
The return value is a rational
void urational_simplify(struct urational *urational)
This function is declared in upipe/ubase.h source file, line 360.
This function simplifies a rational.
Parameter list:
- urational: pointer to rational
This macro is for internal use only.
This macro is declared in upipe/ubase.h source file, line 122.
This macro is a helper to simplify printf-style functions.