void data_setup() { events_setup(); player_setup(&(demo[0])); person_setup(&(demo[1])); demo_setup(); }
/* easy_events() * * Runs a transfer in a blocking manner using the events-based API */ static CURLcode easy_events(struct Curl_multi *multi) { struct events evs= {2, FALSE, 0, NULL, 0}; /* if running event-based, do some further multi inits */ events_setup(multi, &evs); return wait_or_timeout(multi, &evs); }
/* easy_events() * * Runs a transfer in a blocking manner using the events-based API */ static CURLcode easy_events(struct Curl_multi *multi) { /* this struct is made static to allow it to be used after this function returns and curl_multi_remove_handle() is called */ static struct events evs= {2, FALSE, 0, NULL, 0}; /* if running event-based, do some further multi inits */ events_setup(multi, &evs); return wait_or_timeout(multi, &evs); }
struct event * events_add(int fd, short events, void(*cb)(int, short, void *), void *arg) { struct event *ev; ev = events_setup(fd, events, cb, arg); if(ev == NULL) return NULL; event_add(ev, NULL); return ev; }