int w_frame_image_uninit (w_frame_image_t *fimg) { char *name; s_image_t *img; while (!s_list_eol(fimg->images, 0)) { img = (s_image_t *) s_list_get(fimg->images, 0); s_list_remove(fimg->images, 0); s_image_uninit(img); } s_list_uninit(fimg->images); while (!s_list_eol(fimg->names, 0)) { name = (char *) s_list_get(fimg->names, 0); s_list_remove(fimg->names, 0); s_free(name); } s_list_uninit(fimg->names); s_free(fimg); return 0; }
int s_config_uninit (s_config_t *cfg) { while (!s_list_eol(cfg->category, 0)) { s_config_cat_t *cat = (s_config_cat_t *) s_list_get(cfg->category, 0); s_list_remove(cfg->category, 0); s_config_category_uninit(cat); } s_list_uninit(cfg->category); s_free(cfg); return 0; }
void w_clistbox_uninit (w_object_t *object) { w_clistbox_t *lb; w_clistbox_item_t *li; w_clistbox_item_image_t *ii; lb = object->data[OBJECT_CLISTBOX]; while (!s_list_eol(lb->items, 0)) { li = (w_clistbox_item_t *) s_list_get(lb->items, 0); s_list_remove(lb->items, 0); w_clistbox_item_uninit(li); } while (!s_list_eol(lb->item_images, 0)) { ii = (w_clistbox_item_image_t *) s_list_get(lb->item_images, 0); s_list_remove(lb->item_images, 0); w_clistbox_item_image_uninit(ii); } s_list_uninit(lb->item_images); s_list_uninit(lb->items); w_frame_uninit(object); s_free(lb); }
int s_config_category_uninit (s_config_cat_t *cat) { while (!s_list_eol(cat->variable, 0)) { s_config_var_t *var = (s_config_var_t *) s_list_get(cat->variable, 0); s_list_remove(cat->variable, 0); s_config_variable_uninit(var); } s_list_uninit(cat->variable); s_free(cat->name); s_free(cat); return 0; }
int s_handlers_init (s_window_t *window) { window->handlers = (s_handlers_t *) s_malloc(sizeof(s_handlers_t)); if (s_list_init(&(window->handlers->list))) { goto err0; } if (s_thread_mutex_init(&(window->handlers->mut))) { goto err1; } return 0; err1: s_list_uninit(window->handlers->list); err0: s_free(window->handlers); return 1; }
int s_pollfds_init (s_window_t *window) { window->pollfds = (s_pollfds_t *) s_calloc(1, sizeof(s_pollfds_t)); if (s_list_init(&(window->pollfds->list))) { goto err0; } if (s_thread_mutex_init(&(window->pollfds->mut))) { goto err1; } return 0; err1: s_list_uninit(window->pollfds->list); err0: s_free(window->pollfds); return -1; }
int s_image_layers_uninit (s_image_t *img) { s_image_t *img_; while (!s_list_eol(img->layers, 0)) { img_ = (s_image_t *) s_list_get(img->layers, 0); s_list_remove(img->layers, 0); s_image_layer_uninit(img_); } s_list_uninit(img->layers); img->layers = NULL; return 0; }
void w_frame_uninit (w_object_t *object) { w_frame_t *frame; w_frame_image_t *fimg; frame = (w_frame_t *) object->data[OBJECT_FRAME]; w_object_uninit(object); while (!s_list_eol(frame->images, 0)) { fimg = s_list_get(frame->images, 0); s_list_remove(frame->images, 0); w_frame_image_uninit(fimg); } s_list_uninit(frame->images); s_free(frame); }
int s_handlers_uninit (s_window_t *window) { s_handler_t *hndl; s_thread_mutex_lock(window->handlers->mut); while (!s_list_eol(window->handlers->list, 0)) { hndl = (s_handler_t *) s_list_get(window->handlers->list, 0); s_list_remove(window->handlers->list, 0); s_handler_uninit(hndl); } s_thread_mutex_unlock(window->handlers->mut); s_thread_mutex_destroy(window->handlers->mut); s_list_uninit(window->handlers->list); s_free(window->handlers); return 0; }
int s_pollfds_uninit (s_window_t *window) { s_pollfd_t *pfd; s_thread_mutex_lock(window->pollfds->mut); while (!s_list_eol(window->pollfds->list, 0)) { pfd = (s_pollfd_t *) s_list_get(window->pollfds->list, 0); s_list_remove(window->pollfds->list, 0); if (pfd->pf_close != NULL) { pfd->pf_close(window, pfd); } s_pollfd_uninit(pfd); } s_thread_mutex_unlock(window->pollfds->mut); s_thread_mutex_destroy(window->pollfds->mut); s_list_uninit(window->pollfds->list); s_free(window->pollfds); return 0; }
int s_event_uninit (s_event_t *event) { s_desktop_client_t *desktopc; while (!s_list_eol(event->desktop->clients, 0)) { desktopc = (s_desktop_client_t *) s_list_get(event->desktop->clients, 0); s_list_remove(event->desktop->clients, 0); s_free(desktopc->title); s_free(desktopc); } s_list_uninit(event->desktop->clients); s_free(event->desktop); s_free(event->expose->rect); s_free(event->expose); s_free(event->mouse); s_free(event->keybd); s_free(event); return 0; }