upipe/upump.h header reference

Upipe event loop handling More

Header inclusion [link] 

Members [link] 

Types [link] 

Functions [link] 

Macros [link] 

Description [link] 

Upipe event loop handling

Members detail [link] 

#define _UPIPE_UPUMP_H_ [link] 

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

[link] 

This struct is declared in upipe-pthread/upipe_pthread_transfer.h source file, line 46.

FieldDescription
struct urefcount * refcount;pointer to refcount management structure
int (*umutex_lock)(struct umutex *) ;lock mutex
int (*umutex_unlock)(struct umutex *) ;unlock mutex

[link] 

This struct is declared in upipe/upump.h source file, line 109.

FieldDescription
struct uchain uchain;structure for double-linked lists - for use by the allocating pipe
struct upump_mgr * mgr;pointer to the event loop manager
upump_cb cb;function to call back when triggered
void * opaque;opaque pointer for the callback
struct urefcount * refcount;pointer to urefcount structure to increment during callback

struct upump * upump_alloc_fd_read(struct upump_mgr *mgr, upump_cb cb, void *opaque, struct urefcount *refcount, int fd) [link] 

This function is declared in upipe/upump.h source file, line 246.

This function allocates and initializes a pump for a readable file descriptor.

Parameter list:

  • mgr: management structure for this event loop
  • cb: function to call when the pump triggers
  • opaque: pointer to the module's internal structure
  • refcount: pointer to urefcount structure to increment during callback, or NULL
  • fd: file descriptor to watch

The return value is pointer to allocated pump, or NULL in case of failure

struct upump * upump_alloc_fd_write(struct upump_mgr *mgr, upump_cb cb, void *opaque, struct urefcount *refcount, int fd) [link] 

This function is declared in upipe/upump.h source file, line 264.

This function allocates and initializes a pump for a writable file descriptor.

Parameter list:

  • mgr: management structure for this event loop
  • cb: function to call when the pump triggers
  • opaque: pointer to the module's internal structure
  • refcount: pointer to urefcount structure to increment during callback, or NULL
  • fd: file descriptor to watch

The return value is pointer to allocated pump, or NULL in case of failure

struct upump * upump_alloc_idler(struct upump_mgr *mgr, upump_cb cb, void *opaque, struct urefcount *refcount) [link] 

This function is declared in upipe/upump.h source file, line 206.

This function allocates and initializes an idler pump.

Parameter list:

  • mgr: management structure for this event loop
  • cb: function to call when the pump triggers
  • opaque: pointer to the module's internal structure
  • refcount: pointer to urefcount structure to increment during callback, or NULL

The return value is pointer to allocated pump, or NULL in case of failure

struct upump * upump_alloc_signal(struct upump_mgr *mgr, upump_cb cb, void *opaque, struct urefcount *refcount, int signal) [link] 

This function is declared in upipe/upump.h source file, line 282.

This function allocates and initializes a pump for a signal.

Parameter list:

  • mgr: management structure for this event loop
  • cb: function to call when the pump triggers
  • opaque: pointer to the module's internal structure
  • refcount: pointer to urefcount structure to increment during callback, or NULL
  • signal: signal to watch

The return value is pointer to allocated pump, or NULL in case of failure

struct upump * upump_alloc_timer(struct upump_mgr *mgr, upump_cb cb, void *opaque, struct urefcount *refcount, uint64_t after, uint64_t repeat) [link] 

This function is declared in upipe/upump.h source file, line 227.

This function allocates and initializes a pump for a timer.

Parameter list:

  • mgr: management structure for this event loop
  • cb: function to call when the pump triggers
  • opaque: pointer to the module's internal structure
  • refcount: pointer to urefcount structure to increment during callback, or NULL
  • after: time after which it triggers, in ticks of a 27 MHz monotonic clock
  • repeat: pump will trigger again each repeat occurrence, in ticks of a 27 MHz monotonic clock (0 to disable)

The return value is pointer to allocated pump, or NULL in case of failure

struct upump_blocker [link] 

This struct is declared in upipe/upump_common.h source file, line 46.

FieldDescription
struct uchain uchain;structure for double-linked lists
struct upump * upump;blocked pump
upump_blocker_cb cb;function to call back when the pump is released
void * opaque;opaque pointer for the callback

typedef void (*upump_cb)(struct upump *) [link] 

This typedef is declared in upipe/upump.h source file, line 102.

function called when a pump is triggered

enum upump_command [link] 

This enum is declared in upipe/upump.h source file, line 78.

This enum defines standard commands which upump handlers may implement.

IdentifierValueDescription
UPUMP_START0starts the pump (void)
UPUMP_STOP1stops the pump (void)
UPUMP_FREE2frees the pump (void)
UPUMP_GET_STATUS3gets the pump blocking status (int *)
UPUMP_SET_STATUS4sets the pump blocking status (int)
UPUMP_ALLOC_BLOCKER5allocates a blocker (struct upump_blocker **)
UPUMP_FREE_BLOCKER6frees a blocker (struct upump_blocker *)
UPUMP_RESTART7restarts the pump (void)
UPUMP_CONTROL_LOCAL0x8000non-standard commands implemented by a upump handler can start from there (first arg = signature)

void upump_free(struct upump *upump) [link] 

This function is declared in upipe/upump.h source file, line 362.

This function frees a upump structure. Please note that the pump must be stopped before.

Parameter list:

  • upump: description structure of the pump

#define upump_get_opaque(upump, type) [link] 

This macro is declared in upipe/upump.h source file, line 399.

This macro gets the opaque structure with a cast.

Parameter list:

  • upump: description structure of the pump
  • type: type to cast to return opaque

void upump_get_status(struct upump *upump, bool *status_p) [link] 

This function is declared in upipe/upump.h source file, line 376.

This function gets the blocking status of a pump (whether the event loop will quit if the pump is the only active pump).

Parameter list:

  • upump: description structure of the pump
  • status_p: reference to boolean representing the blocking status of a pump

[link] 

This struct is declared in upipe/uprobe_upump_mgr.h source file, line 43.

FieldDescription
struct urefcount * refcount;pointer to refcount management structure
unsigned int signature;signature of the upump handler
struct uchain uchain;structure for double-linked lists - for use by the application only
void * opaque;opaque - for use by the application only
struct upump *(*upump_alloc)(struct upump_mgr *, int va_list ) ;function to create a pump
int (*upump_control)(struct upump *, int va_list ) ;control function for standard or local commands - all parameters belong to the caller
int (*upump_mgr_control)(struct upump_mgr *, int va_list ) ;control function for standard or local manager commands - all parameters belong to the caller

typedef struct upump_mgr *(*upump_mgr_alloc)(uint16_t , uint16_t ) [link] 

This typedef is declared in upipe/upump.h source file, line 162.

This typedef allocates a new event loop and a upump manager.

enum upump_mgr_command [link] 

This enum is declared in upipe/upump.h source file, line 126.

This enum defines standard commands which upump managers may implement.

IdentifierValueDescription
UPUMP_MGR_RUN0run the event loop (struct umutex *)
UPUMP_MGR_VACUUM1release all buffers kept in pools (void)
UPUMP_MGR_CONTROL_LOCAL0x8000non-standard manager commands implemented by a upump handler can start from there (first arg = signature)

#define upump_mgr_get_opaque(upump_mgr, type) [link] 

This macro is declared in upipe/upump.h source file, line 442.

This macro gets the opaque member of a upump manager.

Parameter list:

  • upump_mgr: pointer to upump_mgr
  • type: type to cast to

The return value is opaque

void upump_mgr_release(struct upump_mgr *mgr) [link] 

This function is declared in upipe/upump.h source file, line 432.

This function decrements the reference count of a upump manager of frees it.

Parameter list:

  • mgr: pointer to upump manager

int upump_mgr_run(struct upump_mgr *mgr, struct umutex *mutex) [link] 

This function is declared in upipe/upump.h source file, line 501.

This function runs an event loop until no pump is active.

Parameter list:

  • mgr: pointer to upump manager
  • mutex: mutual exclusion primitives to access the event loop

The return value is an error code, including UBASE_ERR_BUSY, if a pump is still active

void upump_mgr_set_opaque(struct upump_mgr *upump_mgr, void *opaque) [link] 

This function is declared in upipe/upump.h source file, line 452.

This function sets the opaque member of a upump manager

Parameter list:

  • upump_mgr: pointer to upump_mgr
  • opaque: opaque

struct upump_mgr * upump_mgr_use(struct upump_mgr *mgr) [link] 

This function is declared in upipe/upump.h source file, line 420.

This function increments the reference count of a upump manager.

Parameter list:

  • mgr: pointer to upump manager

The return value is same pointer to upump manager

int upump_mgr_vacuum(struct upump_mgr *mgr) [link] 

This function is declared in upipe/upump.h source file, line 512.

This function instructs an existing upump manager to release all structures currently kept in pools. It is intended as a debug tool only.

Parameter list:

  • mgr: pointer to upump manager

The return value is an error code

void upump_restart(struct upump *upump) [link] 

This function is declared in upipe/upump.h source file, line 352.

This function asks the event loop to restart a timer pump. The timer will be restart to its initial value, as if it was stop, set to its initial value and start. This could be useful to implement IO timeout without freeing and allocating a pump each time data is received.

Parameter list:

  • pump: description structure of the pump

void upump_set_cb(struct upump *upump, upump_cb cb, void *opaque) [link] 

This function is declared in upipe/upump.h source file, line 409.

This function sets the callback parameters of an existing pump.

Parameter list:

  • upump: description structure of the pump
  • cb: function to call when the pump triggers
  • opaque: pointer to the module's internal structure

void upump_set_status(struct upump *upump, bool status) [link] 

This function is declared in upipe/upump.h source file, line 389.

This function sets the blocking status of a pump (whether the event loop will quit if the pump is the only active pump).

Parameter list:

  • upump: description structure of the pump
  • status: boolean setting the blocking status of a pump

void upump_start(struct upump *upump) [link] 

This function is declared in upipe/upump.h source file, line 331.

This function asks the event loop to start monitoring a pump.

Parameter list:

  • pump: description structure of the pump

void upump_stop(struct upump *upump) [link] 

This function is declared in upipe/upump.h source file, line 340.

This function asks the event loop to stop monitoring a pump.

Parameter list:

  • pump: description structure of the pump

enum upump_type [link] 

This enum is declared in upipe/upump.h source file, line 56.

This enum defines the standard types of pumps.

IdentifierValueDescription
UPUMP_TYPE_IDLER0event continuously triggers (no argument)
UPUMP_TYPE_TIMER1event triggers once after a given timeout (arguments = uint64_t, uint64_t)
UPUMP_TYPE_FD_READ2event triggers on available data from file descriptor (argument = int)
UPUMP_TYPE_FD_WRITE3event triggers on available writing space to file descriptor (argument = int)
UPUMP_TYPE_SIGNAL4event triggers on a UNIX signal (argument = int)
UPUMP_TYPE_LOCAL0x8000non-standard types implemented by a upump handler can start from there (first arg = signature)

struct upump * upump_alloc(struct upump_mgr *mgr, upump_cb cb, void *opaque, struct urefcount *refcount, int event, ...) [link] 

This function is for internal use only.

This function is declared in upipe/upump.h source file, line 178.

This function allocates and initializes a pump.

Parameter list:

  • mgr: management structure for this event loop
  • cb: function to call when the pump triggers
  • opaque: pointer to the module's internal structure
  • refcount: pointer to urefcount structure to increment during callback, or NULL
  • event: type of event to watch for, followed by optional parameters

The return value is pointer to allocated pump, or NULL in case of failure

int upump_control(struct upump *upump, int command, ...) [link] 

This function is for internal use only.

This function is declared in upipe/upump.h source file, line 317.

This function sends a control command to the pump. Note that all control commands must be executed from the same thread - no reentrancy or locking is required from the pump. Also note that all arguments are owned by the caller.

Parameter list:

  • upump: description structure of the pump
  • command: control command to send, followed by optional read or write parameters

The return value is an error code

int upump_control_va(struct upump *upump, int command, va_list args) [link] 

This function is for internal use only.

This function is declared in upipe/upump.h source file, line 298.

This function sends a control command to the pump. Note that all control commands must be executed from the same thread - no reentrancy or locking is required from the pump. Also note that all arguments are owned by the caller.

Parameter list:

  • upump: description structure of the pump
  • command: control command to send
  • args: optional read or write parameters

The return value is an error code

struct upump * upump_from_uchain(struct uchain *sub) [link] 

This function is for internal use only.

This function is declared in UBASE_FROM_TO function like macro expansion, line 19 in upipe/upump.h source file, line 123.

This function returns a pointer to uchain.

Parameter list:

  • sub: pointer to struct uchain

The return value is pointer to struct upump

int upump_mgr_control(struct upump_mgr *mgr, int command, ...) [link] 

This function is for internal use only.

This function is declared in upipe/upump.h source file, line 484.

This function sends a control command to the pipe manager. Note that thread semantics depend on the pipe manager. Also note that all arguments are owned by the caller.

Parameter list:

  • mgr: pointer to upump manager
  • command: control manager command to send, followed by optional read or write parameters

The return value is an error code

int upump_mgr_control_va(struct upump_mgr *mgr, int command, va_list args) [link] 

This function is for internal use only.

This function is declared in upipe/upump.h source file, line 466.

This function sends a control command to the upump manager. Note that all arguments are owned by the caller.

Parameter list:

  • mgr: pointer to upump manager
  • command: manager control command to send
  • args: optional read or write parameters

The return value is an error code

struct upump_mgr * upump_mgr_from_uchain(struct uchain *sub) [link] 

This function is for internal use only.

This function is declared in UBASE_FROM_TO function like macro expansion, line 19 in upipe/upump.h source file, line 159.

This function returns a pointer to uchain.

Parameter list:

  • sub: pointer to struct uchain

The return value is pointer to struct upump_mgr

struct uchain * upump_mgr_to_uchain(struct upump_mgr *s) [link] 

This function is for internal use only.

This function is declared in UBASE_FROM_TO function like macro expansion, line 9 in upipe/upump.h source file, line 159.

This function returns a pointer to uchain.

Parameter list:

  • upump_mgr: pointer to struct upump_mgr

The return value is pointer to struct uchain

struct uchain * upump_to_uchain(struct upump *s) [link] 

This function is for internal use only.

This function is declared in UBASE_FROM_TO function like macro expansion, line 9 in upipe/upump.h source file, line 123.

This function returns a pointer to uchain.

Parameter list:

  • upump: pointer to struct upump

The return value is pointer to struct uchain

Valid XHTML 1.0 StrictGenerated by cmassiot on Sun Dec 14 18:31:17 2025 using MkDoc