C Collections

cthreadcomm · Section 3

ceventloop_declare

ceventloop_declare - declare an uninitialised ceventloop variable

C Collections (libccollections, -lccollections)

#include <ccollections/cthreadcomm.h>
 
ceventloop_declare(name);

Expands to `ceventloop name` and leaves the variable
uninitialised, so you must assign it with ceventloop_construct()
or a ceventloop_create*() call before you use it.
 
It is there so that the names match the other c_collections modules,
in the same way as cthrpool_declare().

name  Variable name to declare.

ceventloop_declare(loop);
char *err = NULL;
loop = ceventloop_create(32, 1, 1, &err);
if (!loop) { fprintf(stderr, "%s\n", err); exit(1); }
/* ... register selectables ... */
ceventloop_destroy(loop);

ceventloop_declare_scoped(3), ceventloop_construct(3), ceventloop_create(3)