21 #include "sol-common-buildopts.h" 
  432 #ifndef SOL_MAINLOOP_FD_ENABLED 
  434 #define SOL_MAINLOOP_FD_ENABLED 
  435 #undef SOL_MAINLOOP_FD_ENABLED 
  438 #ifdef SOL_MAINLOOP_FD_ENABLED 
  448     SOL_FD_FLAGS_NONE = 0,
 
  452     SOL_FD_FLAGS_IN   = (1 << 0),
 
  456     SOL_FD_FLAGS_OUT  = (1 << 1),
 
  460     SOL_FD_FLAGS_PRI  = (1 << 2),
 
  466     SOL_FD_FLAGS_ERR  = (1 << 3),
 
  472     SOL_FD_FLAGS_HUP  = (1 << 4),
 
  478     SOL_FD_FLAGS_NVAL = (1 << 5)
 
  486 typedef struct sol_fd sol_fd;
 
  503 struct sol_fd *sol_fd_add(
int fd, uint32_t flags, 
bool (*cb)(
void *data, 
int fd, uint32_t active_flags), 
const void *data);
 
  514 bool sol_fd_del(
struct sol_fd *handle);
 
  526 bool sol_fd_set_flags(
struct sol_fd *handle, uint32_t flags);
 
  538 bool sol_fd_remove_flags(
struct sol_fd *handle, uint32_t flags);
 
  550 bool sol_fd_add_flags(
struct sol_fd *handle, uint32_t flags);
 
  561 uint32_t sol_fd_get_flags(
const struct sol_fd *handle);
 
  572 #ifndef SOL_MAINLOOP_FORK_WATCH_ENABLED 
  574 #define SOL_MAINLOOP_FORK_WATCH_ENABLED 
  575 #undef SOL_MAINLOOP_FORK_WATCH_ENABLED 
  578 #ifdef SOL_MAINLOOP_FORK_WATCH_ENABLED 
  586 struct sol_child_watch;
 
  587 typedef struct sol_child_watch sol_child_watch;
 
  605 struct sol_child_watch *sol_child_watch_add(uint64_t pid, 
void (*cb)(
void *data, uint64_t pid, 
int status), 
const void *data);
 
  620 bool sol_child_watch_del(
struct sol_child_watch *handle);
 
  638 #ifndef SOL_NO_API_VERSION 
  640 #define SOL_NO_API_VERSION 
  641 #undef SOL_NO_API_VERSION 
  658 #ifndef SOL_SET_API_VERSION 
  660 #define SOL_SET_API_VERSION(expression) 
  661 #undef SOL_SET_API_VERSION 
  668 #ifndef SOL_NO_API_VERSION 
  669 #define SOL_MAINLOOP_SOURCE_TYPE_API_VERSION (1)   
  673     uint16_t api_version; 
  847 #ifndef SOL_NO_API_VERSION 
  848 #define SOL_MAINLOOP_IMPLEMENTATION_API_VERSION (1)   
  852     uint16_t api_version; 
  918     void *(*timeout_add)(uint32_t timeout_ms, bool (*cb)(
void *data), 
const void *data);
 
  962     void *(*idle_add)(bool (*cb)(
void *data), 
const void *data);
 
  979 #ifdef SOL_MAINLOOP_FD_ENABLED 
 1007     void *(*fd_add)(
int fd, uint32_t flags, bool (*cb)(
void *data, 
int fd, uint32_t active_flags), 
const void *data);
 
 1027     bool (*fd_del)(
void *handle);
 
 1044     bool (*fd_set_flags)(
void *handle, uint32_t flags);
 
 1061     uint32_t (*fd_get_flags)(
const void *handle);
 
 1064 #ifdef SOL_MAINLOOP_FORK_WATCH_ENABLED 
 1085     void *(*child_watch_add)(uint64_t pid, void (*cb)(
void *data, uint64_t pid, 
int status), 
const void *data);
 
 1104     bool (*child_watch_del)(
void *handle);
 
 1149     void *(*source_get_data)(
const void *handle);
 
 1247 #ifndef SOL_NO_API_VERSION 
 1248 #define SOL_MAIN_CALLBACKS_API_VERSION (1) 
void * sol_mainloop_source_get_data(const struct sol_mainloop_source *handle)
Retrieve the user data (context) given to the source at creation time. 
 
bool(* idle_del)(void *handle)
Function to be called to remove an idler to be dispatched. 
Definition: sol-mainloop.h:977
 
int sol_init(void)
Initializes the Soletta library. 
 
struct sol_main_callbacks sol_main_callbacks
Structure used to keep the application main callbacks. 
 
const struct sol_mainloop_implementation * sol_mainloop_get_implementation(void)
Returns the current mainloop implementation in use. 
 
int sol_run(void)
Runs the main loop. 
 
void(* shutdown)(void)
Function to be called to shutdown (cleanup) the mainloop implementation. 
Definition: sol-mainloop.h:871
 
void(* dispose)(void *data)
Function to be called when the source is deleted. 
Definition: sol-mainloop.h:754
 
void sol_set_args(int argc, char *argv[])
Sets a new list of arguments and its count. 
 
const struct sol_mainloop_implementation * SOL_MAINLOOP_IMPLEMENTATION_DEFAULT
Pointer to Soletta's internal mainloop implementation, that is the default to be used if no other is ...
 
struct sol_mainloop_source_type sol_mainloop_source_type
Structure representing the type of a source of mainloop events. 
 
void sol_mainloop_del_source(struct sol_mainloop_source *handle)
Destroy a source of main loop events. 
 
bool(* check)(void *data)
Function to be called to check if there are events to be dispatched. 
Definition: sol-mainloop.h:736
 
Structure representing the type of a source of mainloop events. 
Definition: sol-mainloop.h:667
 
bool sol_mainloop_set_implementation(const struct sol_mainloop_implementation *impl)
Changes the mainloop implementation. 
 
bool(* timeout_del)(void *handle)
Function to be called to remove a timeout to be dispatched. 
Definition: sol-mainloop.h:933
 
void sol_shutdown(void)
Shutdown Soletta library. 
 
int sol_argc(void)
Gets the argument count the application was launched with, if any. 
 
struct sol_idle * sol_idle_add(bool(*cb)(void *data), const void *data)
Adds a function to be called when the application goes idle. 
 
struct sol_idle sol_idle
Handle for idlers. 
Definition: sol-mainloop.h:392
 
uint16_t flags
Application flags. 
Definition: sol-mainloop.h:1251
 
void(* startup)(void)
Application startup function. 
Definition: sol-mainloop.h:1252
 
static FILE * fd
Definition: download.c:28
 
uint16_t api_version
API version. 
Definition: sol-mainloop.h:1249
 
static struct sol_timeout * timeout
Definition: browse.c:36
 
void sol_quit(void)
Terminates the main loop. 
 
struct sol_mainloop_source sol_mainloop_source
Structure of a Source of mainloop events. 
Definition: sol-mainloop.h:762
 
struct sol_timeout * sol_timeout_add(uint32_t timeout_ms, bool(*cb)(void *data), const void *data)
Adds a function to be called periodically by the main loop. 
 
void(* source_del)(void *handle)
Function to be called to remove mainloop event source. 
Definition: sol-mainloop.h:1137
 
bool(* prepare)(void *data)
Function to be called to prepare to check for events. 
Definition: sol-mainloop.h:697
 
struct sol_mainloop_implementation sol_mainloop_implementation
Structure representing a mainloop implementation (hooks). 
 
bool sol_timeout_del(struct sol_timeout *handle)
Deletes the given timeout. 
 
int(* init)(void)
Function to be called to initialize the mainloop implementation. 
Definition: sol-mainloop.h:862
 
void(* quit)(void)
Function to be called to quit the mainloop. 
Definition: sol-mainloop.h:894
 
struct sol_timeout sol_timeout
Handle for timers tracking the timeouts. 
Definition: sol-mainloop.h:351
 
Structure representing a mainloop implementation (hooks). 
Definition: sol-mainloop.h:846
 
Structure used to keep the application main callbacks. 
Definition: sol-mainloop.h:1246
 
bool(* get_next_timeout)(void *data, struct timespec *timeout)
Function to be called to query the next timeout for the next event in this source. 
Definition: sol-mainloop.h:721
 
void(* shutdown)(void)
Application shutdown function. 
Definition: sol-mainloop.h:1253
 
void sol_quit_with_code(int return_code)
Terminates the main loop, setting a specific return code. 
 
int sol_mainloop_default_main(const struct sol_main_callbacks *callbacks, int argc, char *argv[])
Helper function called by SOL_MAIN. 
 
char ** sol_argv(void)
Gets the list of arguments the application was launched with, if any. 
 
struct sol_mainloop_source * sol_mainloop_add_source(const struct sol_mainloop_source_type *type, const void *data)
Create a new source of events to the main loop. 
 
void(* dispatch)(void *data)
Function to be called during main loop iterations if prepare() or check() returns true...
Definition: sol-mainloop.h:744
 
bool sol_idle_del(struct sol_idle *handle)
Deletes the given idler. 
 
void(* run)(void)
Function to be called to run the mainloop. 
Definition: sol-mainloop.h:881