Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/ExeBy/exe_root.../opt/saltstac.../salt/include
File: verto.h
/*
[0] Fix | Delete
* Copyright 2011 Red Hat, Inc.
[1] Fix | Delete
*
[2] Fix | Delete
* Permission is hereby granted, free of charge, to any person
[3] Fix | Delete
* obtaining a copy of this software and associated documentation files
[4] Fix | Delete
* (the "Software"), to deal in the Software without restriction,
[5] Fix | Delete
* including without limitation the rights to use, copy, modify, merge,
[6] Fix | Delete
* publish, distribute, sublicense, and/or sell copies of the Software,
[7] Fix | Delete
* and to permit persons to whom the Software is furnished to do so,
[8] Fix | Delete
* subject to the following conditions:
[9] Fix | Delete
*
[10] Fix | Delete
* The above copyright notice and this permission notice shall be
[11] Fix | Delete
* included in all copies or substantial portions of the Software.
[12] Fix | Delete
*
[13] Fix | Delete
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
[14] Fix | Delete
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
[15] Fix | Delete
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
[16] Fix | Delete
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
[17] Fix | Delete
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
[18] Fix | Delete
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
[19] Fix | Delete
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
[20] Fix | Delete
* SOFTWARE.
[21] Fix | Delete
*/
[22] Fix | Delete
[23] Fix | Delete
#ifndef VERTO_H_
[24] Fix | Delete
#define VERTO_H_
[25] Fix | Delete
[26] Fix | Delete
#include <time.h> /* For time_t */
[27] Fix | Delete
#include <unistd.h> /* For pid_t */
[28] Fix | Delete
[29] Fix | Delete
#ifdef WIN32
[30] Fix | Delete
#include <windows.h>
[31] Fix | Delete
typedef HANDLE verto_proc;
[32] Fix | Delete
typedef DWORD verto_proc_status;
[33] Fix | Delete
#else
[34] Fix | Delete
#include <sys/types.h>
[35] Fix | Delete
typedef pid_t verto_proc;
[36] Fix | Delete
typedef int verto_proc_status;
[37] Fix | Delete
#endif
[38] Fix | Delete
[39] Fix | Delete
#define VERTO_SIG_IGN ((verto_callback *) 1)
[40] Fix | Delete
[41] Fix | Delete
#ifdef __cplusplus
[42] Fix | Delete
extern "C"
[43] Fix | Delete
{
[44] Fix | Delete
#endif /* __cplusplus */
[45] Fix | Delete
[46] Fix | Delete
typedef struct verto_ctx verto_ctx;
[47] Fix | Delete
typedef struct verto_ev verto_ev;
[48] Fix | Delete
[49] Fix | Delete
typedef enum {
[50] Fix | Delete
VERTO_EV_TYPE_NONE = 0,
[51] Fix | Delete
VERTO_EV_TYPE_IO = 1,
[52] Fix | Delete
VERTO_EV_TYPE_TIMEOUT = 1 << 1,
[53] Fix | Delete
VERTO_EV_TYPE_IDLE = 1 << 2,
[54] Fix | Delete
VERTO_EV_TYPE_SIGNAL = 1 << 3,
[55] Fix | Delete
VERTO_EV_TYPE_CHILD = 1 << 4
[56] Fix | Delete
} verto_ev_type;
[57] Fix | Delete
[58] Fix | Delete
typedef enum {
[59] Fix | Delete
VERTO_EV_FLAG_NONE = 0,
[60] Fix | Delete
VERTO_EV_FLAG_PERSIST = 1,
[61] Fix | Delete
VERTO_EV_FLAG_PRIORITY_LOW = 1 << 1,
[62] Fix | Delete
VERTO_EV_FLAG_PRIORITY_MEDIUM = 1 << 2,
[63] Fix | Delete
VERTO_EV_FLAG_PRIORITY_HIGH = 1 << 3,
[64] Fix | Delete
VERTO_EV_FLAG_IO_READ = 1 << 4,
[65] Fix | Delete
VERTO_EV_FLAG_IO_WRITE = 1 << 5,
[66] Fix | Delete
VERTO_EV_FLAG_IO_ERROR = 1 << 7,
[67] Fix | Delete
VERTO_EV_FLAG_IO_CLOSE_FD = 1 << 8,
[68] Fix | Delete
VERTO_EV_FLAG_REINITIABLE = 1 << 6,
[69] Fix | Delete
_VERTO_EV_FLAG_MUTABLE_MASK = VERTO_EV_FLAG_PRIORITY_LOW
[70] Fix | Delete
| VERTO_EV_FLAG_PRIORITY_MEDIUM
[71] Fix | Delete
| VERTO_EV_FLAG_PRIORITY_HIGH
[72] Fix | Delete
| VERTO_EV_FLAG_IO_READ
[73] Fix | Delete
| VERTO_EV_FLAG_IO_WRITE,
[74] Fix | Delete
_VERTO_EV_FLAG_MAX = VERTO_EV_FLAG_IO_CLOSE_FD
[75] Fix | Delete
} verto_ev_flag;
[76] Fix | Delete
[77] Fix | Delete
typedef void (verto_callback)(verto_ctx *ctx, verto_ev *ev);
[78] Fix | Delete
[79] Fix | Delete
/**
[80] Fix | Delete
* Creates a new event context using an optionally specified implementation
[81] Fix | Delete
* and/or optionally specified required features.
[82] Fix | Delete
*
[83] Fix | Delete
* If you are an application that has already decided on using a particular
[84] Fix | Delete
* event loop implementation, you should not call this function, but instead
[85] Fix | Delete
* import the verto-NAME.h header and link against the verto-NAME.so, where
[86] Fix | Delete
* NAME is the implementation you wish to use.
[87] Fix | Delete
*
[88] Fix | Delete
* If you are a library, you should generally avoid creating event contexts
[89] Fix | Delete
* on your own but allow applications to pass in a verto_ctx you can use.
[90] Fix | Delete
*
[91] Fix | Delete
* There are two cases where you should use this function. The first is
[92] Fix | Delete
* where you have a need to choose an implementation at run time, usually
[93] Fix | Delete
* for testing purposes. The second and more common is when you simply
[94] Fix | Delete
* wish to remain implementation agnostic. In this later case, you should
[95] Fix | Delete
* always call like this: verto_new(NULL, ...). This lets verto choose the best
[96] Fix | Delete
* implementation to use.
[97] Fix | Delete
*
[98] Fix | Delete
* If impl is not NULL, a new context is returned which is backed by the
[99] Fix | Delete
* implementation specified. If the implementation specified is not
[100] Fix | Delete
* available or if the required types (reqtypes) are not provided by the
[101] Fix | Delete
* named implementation, NULL is returned. The parameter 'impl' can specify:
[102] Fix | Delete
* * The full path to an implementation library
[103] Fix | Delete
* * The name of the implementation library (i.e. - "glib" or "libev")
[104] Fix | Delete
*
[105] Fix | Delete
* If impl is NULL, verto will attempt to automatically determine the
[106] Fix | Delete
* best implementation to use.
[107] Fix | Delete
*
[108] Fix | Delete
* First, verto will attempt to use an existing, previously loaded
[109] Fix | Delete
* implementation. This is handled automatically by internal caching of either
[110] Fix | Delete
* the first implementation loaded or the one specified by verto_set_default().
[111] Fix | Delete
*
[112] Fix | Delete
* Second, verto will attempt to discern if you are already linked to any
[113] Fix | Delete
* of the supported implementations (to avoid wasting memory by loading
[114] Fix | Delete
* extra unnecessary libraries). If you are linked to one supported
[115] Fix | Delete
* implementation, that implementation will be chosen. If you are linked
[116] Fix | Delete
* to more than one supported implementation one of the ones linked to
[117] Fix | Delete
* will be chosen, but the order of the particular choice is undefined.
[118] Fix | Delete
*
[119] Fix | Delete
* Third, verto will attempt to load the compile-time default, if defined at
[120] Fix | Delete
* build time and available at runtime.
[121] Fix | Delete
*
[122] Fix | Delete
* Last, verto will attempt to load any implementation installed. The specific
[123] Fix | Delete
* order of this step is undefined.
[124] Fix | Delete
*
[125] Fix | Delete
* In all cases above, if the implementation does not support all the specified
[126] Fix | Delete
* features (reqtypes), it will be skipped and processing will continue from
[127] Fix | Delete
* where it left off. This means that if verto_new() returns non-NULL it is
[128] Fix | Delete
* guaranteed to support the features you specified.
[129] Fix | Delete
*
[130] Fix | Delete
* @see verto_set_default()
[131] Fix | Delete
* @param impl The implementation to use, or NULL.
[132] Fix | Delete
* @param reqtypes A bitwise or'd list of required event type features.
[133] Fix | Delete
* @return A new verto_ctx, or NULL on error. Call verto_free() when done.
[134] Fix | Delete
*/
[135] Fix | Delete
verto_ctx *
[136] Fix | Delete
verto_new(const char *impl, verto_ev_type reqtypes);
[137] Fix | Delete
[138] Fix | Delete
/**
[139] Fix | Delete
* Gets the default event context using an optionally specified implementation.
[140] Fix | Delete
*
[141] Fix | Delete
* This function is essentially a singleton version of verto_new(). However,
[142] Fix | Delete
* since this function must return the same loop as the *_default() call of
[143] Fix | Delete
* the underlying implementation (if such a function exists), it is NOT a
[144] Fix | Delete
* global singleton, but a per-implementation singleton. For this reason, you
[145] Fix | Delete
* must call verto_free() when you are done with this loop. Even after calling
[146] Fix | Delete
* verto_free() on the default verto_ctx, you can safely call verto_default()
[147] Fix | Delete
* again and receive a new reference to the same (internally default) loop.
[148] Fix | Delete
*
[149] Fix | Delete
* In all other respects, verto_default() acts exactly like verto_new().
[150] Fix | Delete
*
[151] Fix | Delete
* @see verto_new()
[152] Fix | Delete
* @see verto_free()
[153] Fix | Delete
* @param impl The implementation to use, or NULL.
[154] Fix | Delete
* @param reqtypes A bitwise or'd list of required event type features.
[155] Fix | Delete
* @return The default verto_ctx, or NULL on error. Call verto_free() when done.
[156] Fix | Delete
*/
[157] Fix | Delete
verto_ctx *
[158] Fix | Delete
verto_default(const char *impl, verto_ev_type reqtypes);
[159] Fix | Delete
[160] Fix | Delete
/**
[161] Fix | Delete
* Sets the default implementation to use by its name.
[162] Fix | Delete
*
[163] Fix | Delete
* This function returns 1 on success and 0 on failure. It can fail for the
[164] Fix | Delete
* following reasons:
[165] Fix | Delete
* 1. The default implementation was already set via verto_set_default().
[166] Fix | Delete
* 2. The implementation specified could not be found.
[167] Fix | Delete
* 3. The implementation specified didn't support the features specified.
[168] Fix | Delete
* 4. The impl argument was NULL.
[169] Fix | Delete
* 5. verto_new() was already called.
[170] Fix | Delete
* 6. verto_default() was already called.
[171] Fix | Delete
* 7. verto_new_NAME() was already called.
[172] Fix | Delete
* 8. verto_default_NAME() was already called.
[173] Fix | Delete
* 9. verto_convert_NAME() was already called.
[174] Fix | Delete
*
[175] Fix | Delete
* @see verto_new()
[176] Fix | Delete
* @see verto_default()
[177] Fix | Delete
* @param impl The implementation to use.
[178] Fix | Delete
* @param reqtypes A bitwise or'd list of required event type features.
[179] Fix | Delete
* @return The default verto_ctx, or NULL on error. Call verto_free() when done.
[180] Fix | Delete
*/
[181] Fix | Delete
int
[182] Fix | Delete
verto_set_default(const char *impl, verto_ev_type reqtypes);
[183] Fix | Delete
[184] Fix | Delete
/**
[185] Fix | Delete
* Sets the allocator to use for verto_ctx and verto_ev objects.
[186] Fix | Delete
*
[187] Fix | Delete
* If you plan to set the allocator, you MUST call this function before any
[188] Fix | Delete
* other verto_*() calls.
[189] Fix | Delete
*
[190] Fix | Delete
* @see verto_new()
[191] Fix | Delete
* @see verto_default()
[192] Fix | Delete
* @see verto_add_io()
[193] Fix | Delete
* @see verto_add_timeout()
[194] Fix | Delete
* @see verto_add_idle()
[195] Fix | Delete
* @see verto_add_signal()
[196] Fix | Delete
* @see verto_add_child()
[197] Fix | Delete
* @param resize The allocator to use (behaves like realloc();
[198] Fix | Delete
* resize(ptr, 0) must free memory at ptr.)
[199] Fix | Delete
* @param hierarchical Zero if the allocator is not hierarchical
[200] Fix | Delete
*/
[201] Fix | Delete
int
[202] Fix | Delete
verto_set_allocator(void *(*resize)(void *mem, size_t size), int hierarchical);
[203] Fix | Delete
[204] Fix | Delete
/**
[205] Fix | Delete
* Frees a verto_ctx.
[206] Fix | Delete
*
[207] Fix | Delete
* When called on a default verto_ctx, the reference will be freed but the
[208] Fix | Delete
* internal default loop will still be available via another call to
[209] Fix | Delete
* verto_default().
[210] Fix | Delete
*
[211] Fix | Delete
* @see verto_new()
[212] Fix | Delete
* @see verto_default()
[213] Fix | Delete
* @param ctx The verto_ctx to free.
[214] Fix | Delete
*/
[215] Fix | Delete
void
[216] Fix | Delete
verto_free(verto_ctx *ctx);
[217] Fix | Delete
[218] Fix | Delete
/**
[219] Fix | Delete
* Frees global state.
[220] Fix | Delete
*
[221] Fix | Delete
* Remove and free all allocated global state. Call only when no further
[222] Fix | Delete
* contexts exist and all threads have exited.
[223] Fix | Delete
*
[224] Fix | Delete
* @see verto_new()
[225] Fix | Delete
* @see verto_free()
[226] Fix | Delete
* @see verto_default()
[227] Fix | Delete
*/
[228] Fix | Delete
void
[229] Fix | Delete
verto_cleanup(void);
[230] Fix | Delete
[231] Fix | Delete
/**
[232] Fix | Delete
* Run the verto_ctx forever, or at least until verto_break() is called.
[233] Fix | Delete
*
[234] Fix | Delete
* @see verto_break()
[235] Fix | Delete
* @param ctx The verto_ctx to run.
[236] Fix | Delete
*/
[237] Fix | Delete
void
[238] Fix | Delete
verto_run(verto_ctx *ctx);
[239] Fix | Delete
[240] Fix | Delete
/**
[241] Fix | Delete
* Run the verto_ctx once. May block.
[242] Fix | Delete
*
[243] Fix | Delete
* @param ctx The verto_ctx to run once.
[244] Fix | Delete
*/
[245] Fix | Delete
void
[246] Fix | Delete
verto_run_once(verto_ctx *ctx);
[247] Fix | Delete
[248] Fix | Delete
/**
[249] Fix | Delete
* Exits the currently running verto_ctx.
[250] Fix | Delete
*
[251] Fix | Delete
* @see verto_run()
[252] Fix | Delete
* @param ctx The verto_ctx to exit.
[253] Fix | Delete
*/
[254] Fix | Delete
void
[255] Fix | Delete
verto_break(verto_ctx *ctx);
[256] Fix | Delete
[257] Fix | Delete
/**
[258] Fix | Delete
* Re-initializes the verto_ctx.
[259] Fix | Delete
*
[260] Fix | Delete
* This function deletes all events, except those which have set the
[261] Fix | Delete
* VERTO_EV_FLAG_REINITIABLE flag. If you fork(), you MUST call this in the
[262] Fix | Delete
* child process after the fork!
[263] Fix | Delete
*
[264] Fix | Delete
* If this function fails it indicates that at least one
[265] Fix | Delete
* VERTO_EV_FLAG_REINITIABLE event was not rearmed or that ctx was NULL.
[266] Fix | Delete
*
[267] Fix | Delete
* @see verto_new()
[268] Fix | Delete
* @see verto_default()
[269] Fix | Delete
* @param ctx The verto_ctx to re-initialize.
[270] Fix | Delete
* @return Non-zero on success, 0 on error.
[271] Fix | Delete
*/
[272] Fix | Delete
int
[273] Fix | Delete
verto_reinitialize(verto_ctx *ctx);
[274] Fix | Delete
[275] Fix | Delete
/**
[276] Fix | Delete
* Adds a callback executed when a file descriptor is ready to be read/written.
[277] Fix | Delete
*
[278] Fix | Delete
* All verto_ev events are automatically freed when their parent verto_ctx is
[279] Fix | Delete
* freed. You do not need to free them manually. If VERTO_EV_FLAG_PERSIST is
[280] Fix | Delete
* provided, the event will repeat until verto_del() is called. If
[281] Fix | Delete
* VERTO_EV_FLAG_PERSIST is not provided, the event will be freed automatically
[282] Fix | Delete
* after its execution. In either case, you may call verto_del() at any time
[283] Fix | Delete
* to prevent the event from executing.
[284] Fix | Delete
* If VERTO_EV_FLAG_IO_CLOSE_FD is provided the passed in fd is automatically
[285] Fix | Delete
* closed when the event is freed with verto_del()
[286] Fix | Delete
*
[287] Fix | Delete
* NOTE: On Windows, the underlying select() only works with sockets. As such,
[288] Fix | Delete
* any attempt to add a non-socket io event on Windows will produce undefined
[289] Fix | Delete
* results and may even crash.
[290] Fix | Delete
*
[291] Fix | Delete
* @see verto_del()
[292] Fix | Delete
* @param ctx The verto_ctx which will fire the callback.
[293] Fix | Delete
* @param flags The flags to set (at least one VERTO_EV_FLAG_IO* required).
[294] Fix | Delete
* @param callback The callback to fire.
[295] Fix | Delete
* @param fd The file descriptor to watch for reads.
[296] Fix | Delete
* @return The verto_ev registered with the event context or NULL on error.
[297] Fix | Delete
*/
[298] Fix | Delete
verto_ev *
[299] Fix | Delete
verto_add_io(verto_ctx *ctx, verto_ev_flag flags,
[300] Fix | Delete
verto_callback *callback, int fd);
[301] Fix | Delete
[302] Fix | Delete
/**
[303] Fix | Delete
* Adds a callback executed after a period of time.
[304] Fix | Delete
*
[305] Fix | Delete
* All verto_ev events are automatically freed when their parent verto_ctx is
[306] Fix | Delete
* freed. You do not need to free them manually. If VERTO_EV_FLAG_PERSIST is
[307] Fix | Delete
* provided, the event will repeat until verto_del() is called. If
[308] Fix | Delete
* VERTO_EV_FLAG_PERSIST is not provided, the event will be freed automatically
[309] Fix | Delete
* after its execution. In either case, you may call verto_del() at any time
[310] Fix | Delete
* to prevent the event from executing.
[311] Fix | Delete
*
[312] Fix | Delete
* @see verto_del()
[313] Fix | Delete
* @param ctx The verto_ctx which will fire the callback.
[314] Fix | Delete
* @param flags The flags to set.
[315] Fix | Delete
* @param callback The callback to fire.
[316] Fix | Delete
* @param interval Time period to wait before firing (in milliseconds).
[317] Fix | Delete
* @return The verto_ev registered with the event context.
[318] Fix | Delete
*/
[319] Fix | Delete
verto_ev *
[320] Fix | Delete
verto_add_timeout(verto_ctx *ctx, verto_ev_flag flags,
[321] Fix | Delete
verto_callback *callback, time_t interval);
[322] Fix | Delete
[323] Fix | Delete
/**
[324] Fix | Delete
* Adds a callback executed when there is nothing else to do.
[325] Fix | Delete
*
[326] Fix | Delete
* All verto_ev events are automatically freed when their parent verto_ctx is
[327] Fix | Delete
* freed. You do not need to free them manually. If VERTO_EV_FLAG_PERSIST is
[328] Fix | Delete
* provided, the event will repeat until verto_del() is called. If
[329] Fix | Delete
* VERTO_EV_FLAG_PERSIST is not provided, the event will be freed automatically
[330] Fix | Delete
* after its execution. In either case, you may call verto_del() at any time
[331] Fix | Delete
* to prevent the event from executing.
[332] Fix | Delete
*
[333] Fix | Delete
* @see verto_del()
[334] Fix | Delete
* @param ctx The verto_ctx which will fire the callback.
[335] Fix | Delete
* @param flags The flags to set.
[336] Fix | Delete
* @param callback The callback to fire.
[337] Fix | Delete
* @return The verto_ev registered with the event context.
[338] Fix | Delete
*/
[339] Fix | Delete
verto_ev *
[340] Fix | Delete
verto_add_idle(verto_ctx *ctx, verto_ev_flag flags,
[341] Fix | Delete
verto_callback *callback);
[342] Fix | Delete
[343] Fix | Delete
/**
[344] Fix | Delete
* Adds a callback executed when a signal is received.
[345] Fix | Delete
*
[346] Fix | Delete
* All verto_ev events are automatically freed when their parent verto_ctx is
[347] Fix | Delete
* freed. You do not need to free them manually. If VERTO_EV_FLAG_PERSIST is
[348] Fix | Delete
* provided, the event will repeat until verto_del() is called. If
[349] Fix | Delete
* VERTO_EV_FLAG_PERSIST is not provided, the event will be freed automatically
[350] Fix | Delete
* after its execution. In either case, you may call verto_del() at any time
[351] Fix | Delete
* to prevent the event from executing.
[352] Fix | Delete
*
[353] Fix | Delete
* NOTE: If you attempt to ignore a signal without the VERTO_EV_FLAG_PERSIST
[354] Fix | Delete
* flag, this function fails.
[355] Fix | Delete
*
[356] Fix | Delete
* NOTE: SIGCHLD is expressly not supported. If you want this notification,
[357] Fix | Delete
* please use verto_add_child().
[358] Fix | Delete
*
[359] Fix | Delete
* WARNNIG: Signal events can only be reliably received in the default verto_ctx
[360] Fix | Delete
* in some implementations. Attempting to receive signal events in non-default
[361] Fix | Delete
* loops may result in assert() failures.
[362] Fix | Delete
*
[363] Fix | Delete
* WARNING: While verto does its best to protect you from crashes, there is
[364] Fix | Delete
* essentially no way to do signal events if you mix multiple implementations in
[365] Fix | Delete
* a single process. Attempting to do so will result in undefined behavior,
[366] Fix | Delete
* and potentially even a crash. You have been warned.
[367] Fix | Delete
*
[368] Fix | Delete
* @see verto_add_child()
[369] Fix | Delete
* @see verto_repeat()
[370] Fix | Delete
* @see verto_del()
[371] Fix | Delete
* @param ctx The verto_ctx which will fire the callback.
[372] Fix | Delete
* @param flags The flags to set.
[373] Fix | Delete
* @param callback The callback to fire.
[374] Fix | Delete
* @param signal The signal to watch for.
[375] Fix | Delete
* @return The verto_ev registered with the event context.
[376] Fix | Delete
*/
[377] Fix | Delete
verto_ev *
[378] Fix | Delete
verto_add_signal(verto_ctx *ctx, verto_ev_flag flags,
[379] Fix | Delete
verto_callback *callback, int signal);
[380] Fix | Delete
[381] Fix | Delete
/**
[382] Fix | Delete
* Adds a callback executed when a child process exits.
[383] Fix | Delete
*
[384] Fix | Delete
* This event will be freed automatically after its execution. Due to the
[385] Fix | Delete
* nature of a process' life-cycle, child events cannot persist (processes only
[386] Fix | Delete
* exit once). This function returns NULL if you attempt to use
[387] Fix | Delete
* VERTO_EV_FLAG_PERSIST. You may, of course, call verto_del() at any time to
[388] Fix | Delete
* prevent the callback from firing.
[389] Fix | Delete
*
[390] Fix | Delete
* @see verto_del()
[391] Fix | Delete
* @param ctx The verto_ctx which will fire the callback.
[392] Fix | Delete
* @param flags The flags to set.
[393] Fix | Delete
* @param callback The callback to fire.
[394] Fix | Delete
* @param child The pid (POSIX) or handle (Win32) of the child to watch for.
[395] Fix | Delete
* @return The verto_ev registered with the event context.
[396] Fix | Delete
*/
[397] Fix | Delete
verto_ev *
[398] Fix | Delete
verto_add_child(verto_ctx *ctx, verto_ev_flag flags,
[399] Fix | Delete
verto_callback *callback, verto_proc proc);
[400] Fix | Delete
[401] Fix | Delete
/**
[402] Fix | Delete
* Sets the private pointer of the verto_ev.
[403] Fix | Delete
*
[404] Fix | Delete
* The free callback will be called in two cases:
[405] Fix | Delete
* 1. When the event is deleted (manually or automatically)
[406] Fix | Delete
* 2. When verto_set_private() is called again, unless
[407] Fix | Delete
* free is NULL.
[408] Fix | Delete
*
[409] Fix | Delete
* @see verto_get_private()
[410] Fix | Delete
* @param ev The verto_ev
[411] Fix | Delete
* @param priv The private value to store
[412] Fix | Delete
* @param free The callback used to free the data or NULL
[413] Fix | Delete
*/
[414] Fix | Delete
void
[415] Fix | Delete
verto_set_private(verto_ev *ev, void *priv, verto_callback *free);
[416] Fix | Delete
[417] Fix | Delete
/**
[418] Fix | Delete
* Gets the private pointer of the verto_ev.
[419] Fix | Delete
*
[420] Fix | Delete
* @see verto_set_private()
[421] Fix | Delete
* @param ev The verto_ev
[422] Fix | Delete
* @return The verto_ev private pointer
[423] Fix | Delete
*/
[424] Fix | Delete
void *
[425] Fix | Delete
verto_get_private(const verto_ev *ev);
[426] Fix | Delete
[427] Fix | Delete
/**
[428] Fix | Delete
* Gets the type of the verto_ev.
[429] Fix | Delete
*
[430] Fix | Delete
* @see verto_add_io()
[431] Fix | Delete
* @see verto_add_timeout()
[432] Fix | Delete
* @see verto_add_idle()
[433] Fix | Delete
* @see verto_add_signal()
[434] Fix | Delete
* @see verto_add_child()
[435] Fix | Delete
* @param ev The verto_ev
[436] Fix | Delete
* @return The verto_ev type
[437] Fix | Delete
*/
[438] Fix | Delete
verto_ev_type
[439] Fix | Delete
verto_get_type(const verto_ev *ev);
[440] Fix | Delete
[441] Fix | Delete
/**
[442] Fix | Delete
* Gets the flags associated with the given verto_ev.
[443] Fix | Delete
*
[444] Fix | Delete
* @see verto_add_io()
[445] Fix | Delete
* @see verto_add_timeout()
[446] Fix | Delete
* @see verto_add_idle()
[447] Fix | Delete
* @see verto_add_signal()
[448] Fix | Delete
* @see verto_add_child()
[449] Fix | Delete
* @see verto_set_flags()
[450] Fix | Delete
* @param ev The verto_ev
[451] Fix | Delete
* @return The verto_ev type
[452] Fix | Delete
*/
[453] Fix | Delete
verto_ev_flag
[454] Fix | Delete
verto_get_flags(const verto_ev *ev);
[455] Fix | Delete
[456] Fix | Delete
/**
[457] Fix | Delete
* Sets the flags associated with the given verto_ev.
[458] Fix | Delete
*
[459] Fix | Delete
* See _VERTO_EV_FLAG_MUTABLE_MASK for the flags that can be changed
[460] Fix | Delete
* with this function. All others will be ignored. If the flags specified
[461] Fix | Delete
* are the same as the flags the event already has, this function is a no-op.
[462] Fix | Delete
*
[463] Fix | Delete
* @see verto_add_io()
[464] Fix | Delete
* @see verto_add_timeout()
[465] Fix | Delete
* @see verto_add_idle()
[466] Fix | Delete
* @see verto_add_signal()
[467] Fix | Delete
* @see verto_add_child()
[468] Fix | Delete
* @see verto_get_flags()
[469] Fix | Delete
* @param ev The verto_ev
[470] Fix | Delete
* @param flags The flags for the event
[471] Fix | Delete
*/
[472] Fix | Delete
void
[473] Fix | Delete
verto_set_flags(verto_ev *ev, verto_ev_flag flags);
[474] Fix | Delete
[475] Fix | Delete
/**
[476] Fix | Delete
* Gets the file descriptor associated with a read/write verto_ev.
[477] Fix | Delete
*
[478] Fix | Delete
* @see verto_add_io()
[479] Fix | Delete
* @param ev The verto_ev to retrieve the file descriptor from.
[480] Fix | Delete
* @return The file descriptor, or -1 if not a read/write event.
[481] Fix | Delete
*/
[482] Fix | Delete
int
[483] Fix | Delete
verto_get_fd(const verto_ev *ev);
[484] Fix | Delete
[485] Fix | Delete
/**
[486] Fix | Delete
* Gets the file descriptor state from when the event fires.
[487] Fix | Delete
*
[488] Fix | Delete
* @see verto_add_io()
[489] Fix | Delete
* @param ev The verto_ev to retrieve the fd state from.
[490] Fix | Delete
* @return The fd state.
[491] Fix | Delete
*/
[492] Fix | Delete
verto_ev_flag
[493] Fix | Delete
verto_get_fd_state(const verto_ev *ev);
[494] Fix | Delete
[495] Fix | Delete
/**
[496] Fix | Delete
* Gets the interval associated with a timeout verto_ev.
[497] Fix | Delete
*
[498] Fix | Delete
* @see verto_add_timeout()
[499] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function