Example #1
0
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;
}
Example #2
0
xi_fdset_t *xi_sel_fdcreate() {
	return xi_mem_alloc(sizeof(struct _xi_fdset));
}