upipe/ubase.h header reference

Upipe common definitions More

Header inclusion  

Members  

Types  

Functions  

Macros  

Description  

Upipe common definitions

Members detail  

#define UBASE_ERROR(upipe, command)  

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

#define UBASE_FATAL(upipe, command)  

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

#define UBASE_FATAL_RETURN(upipe, command)  

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

#define UBASE_FOURCC(a, b, c, d)  

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.

#define UBASE_FROM_TO(STRUCTURE, SUBSTRUCT, SUBNAME, SUB)  

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

#define UBASE_RETURN(command)  

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

#define UBASE_SIGNATURE_CHECK(args, signature)  

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

#define _UPIPE_UBASE_H_  

This macro is declared in upipe/ubase.h source file, line 31.

#define container_of(ptr, type, member)  

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.

#define likely(x)  

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.

#define ubase_assert(command)  

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

bool ubase_check(int err)  

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

enum ubase_err  

This enum is declared in upipe/ubase.h source file, line 157.

This enum defines the standard error codes.

IdentifierValueDescription
UBASE_ERR_NONE0no error
UBASE_ERR_UNKNOWN1unknown error
UBASE_ERR_ALLOC2allocation error
UBASE_ERR_UPUMP3unable to allocate a upump
UBASE_ERR_UNHANDLED4unhandled command or event
UBASE_ERR_INVALID5invalid argument
UBASE_ERR_EXTERNAL6error in external library
UBASE_ERR_BUSY7failure to get an exclusive resource
UBASE_ERR_LOCAL0non-standard error codes implemented by a module type can start from there

uint64_t ubase_gcd(uint64_t a, uint64_t b)  

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

#define ubase_nassert(command)  

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

int ubase_ncmp(const char *string, const char *prefix)  

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

struct uchain  

This struct is declared in upipe/ubase.h source file, line 127.

This struct is designed to chain uref and ubuf in a list.

FieldDescription
struct uchain *next;pointer to next element
struct uchain *prev;pointer to previous element

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

#define unlikely(x)  

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.

struct urational  

This struct is declared in upipe/ubase.h source file, line 279.

This struct defines the rational type.

FieldDescription
int64_t num;numerator
uint64_t den;denominator

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

#define UBASE_VARARG(command)  

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.

Valid XHTML 1.0 StrictGenerated by cmassiot on Thu Nov 6 12:15:31 2014 using MkDoc