xi_dir_t *xi_dir_open(const xchar *pathname) { WIN32_FIND_DATA ddat; xi_dir_t *dfd; xchar buf[XCFG_PATHNAME_MAX]; if (pathname == NULL) { return NULL; } dfd = xi_mem_alloc(sizeof(xi_dir_t)); if (dfd == NULL) { return NULL; } xi_strcpy(buf, pathname); xi_strcat(buf, "/*"); dfd->dfd = FindFirstFile(buf, &ddat); if (dfd->dfd == NULL) { xi_mem_free(dfd); return NULL; } xi_strcpy(dfd->pathname, pathname); return dfd; }
xi_fdset_t *xi_sel_fdcreate() { return xi_mem_alloc(sizeof(struct _xi_fdset)); }