upipe/ubase.h header reference
Upipe common definitions More
Header inclusion
Members
Types
Functions
- bool ubase_check(int err)
- uint64_t ubase_gcd(uint64_t a, uint64_t b)
- int ubase_ncmp(const char *string, const char *prefix)
- void uchain_init(struct uchain *uchain)
- void urational_simplify(struct urational *urational)
Macros
Description
Members detail
This macro is declared in upipe/ubase.h source file, line 229.
This macro runs the given function and throws an error in case of failure.
Parameters list:
- command: command whose return code is to be checked
This macro is declared in upipe/ubase.h source file, line 204.
This macro runs the given function and throws a fatal error in case of failure.
Parameters list:
- command: command whose return code is to be checked
This macro is declared in upipe/ubase.h source file, line 216.
This macro runs the given function, throws a fatal error and returns in case of failure.
Parameters list:
- command: command whose return code is to be checked
This macro is declared in upipe/ubase.h source file, line 144.
This macro allows to define a 32-bit unsigned integer with 4 letters.
This macro is declared in upipe/ubase.h source file, line 83.
This macro declares two functions dealing with substructures included into a larger structure.
Parameters 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 193.
This macro runs the given function and returns an error in case of failure.
Parameters list:
- command: command whose return code is to be checked
This macro is declared in upipe/ubase.h source file, line 255.
This macro checks that the first argument is equal to the given signature.
Parameters 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 31.
This macro is declared in upipe/ubase.h source file, line 69.
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 53.
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 240.
This macro asserts if the given command (returning an enum ubase_err) failed.
Parameters list:
- command: command whose return code is to be checked
This function is declared in upipe/ubase.h source file, line 186.
This function returns true if no error happened in an error code.
Parameters list:
- err: error code
The return value is true if no error happened
This enum is declared in upipe/ubase.h source file, line 157.
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_UPUMP | 3 | unable to allocate a upump |
UBASE_ERR_UNHANDLED | 4 | unhandled command or event |
UBASE_ERR_INVALID | 5 | invalid argument |
UBASE_ERR_EXTERNAL | 6 | error in external library |
UBASE_ERR_BUSY | 7 | failure to get an exclusive resource |
UBASE_ERR_LOCAL | 0 | non-standard error codes implemented by a module type can start from there |
This function is declared in upipe/ubase.h source file, line 269.
This function returns the greatest common denominator between two positive integers.
Parameters list:
- a: first integer (not null)
- b: second integer
The return value is GCD of the two integers
This macro is declared in upipe/ubase.h source file, line 247.
This macro asserts if the given command (returning an enum ubase_err) succeeded.
Parameters list:
- command: command whose return code is to be checked
This function is declared in upipe/ubase.h source file, line 308.
This function checks if a prefix matches a string.
Parameters list:
- string: large string
- prefix: prefix to check
The return value is 0 if the prefix matches
This struct is declared in upipe/ubase.h source file, line 127.
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 139.
This function initializes a uchain.
Parameters list:
- uchain: pointer to a uchain structure
This macro is declared in upipe/ubase.h source file, line 58.
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 279.
This struct defines the rational type.
void urational_simplify(struct urational *urational)
This function is declared in upipe/ubase.h source file, line 291.
This function simplifies a rational.
Parameters list:
- urational: pointer to rational
This macro is for internal use only.
This macro is declared in upipe/ubase.h source file, line 106.
This macro is a helper to simplify printf-style functions.