30#ifdef HAVE_SYS_IOCTL_H
43static struct state *st = &state;
45static int cmp_names(
const void *
aa,
const void *
bb)
47 char *
const *a = (
char *
const *)
aa;
48 char *
const *
b = (
char *
const *)
bb;
69 st->ls_closure = closure;
74 st->ls_ex_filter = func;
75 st->ls_ex_closure = closure;
105 if (
dp->d_name[0] ==
'.')
107 if (st->ls_filter && !(*st->ls_filter)(
dp->d_name, st->ls_closure))
109 if (st->ls_ex_filter &&
110 (*st->ls_ex_filter)(
dp->d_name, st->ls_ex_closure))
144 for (i = 0; i < n; i++)
void G_free(void *)
Free allocated memory.
void void void void G_fatal_error(const char *,...) __attribute__((format(printf
char * G_store(const char *)
Copy string to allocated memory.
void G_ls(const char *dir, FILE *stream)
Prints a directory listing to a stream, in prettified column format.
void G_ls_format(char **list, int num_items, int perline, FILE *stream)
Prints a listing of items to a stream, in prettified column format.
void G_set_ls_filter(ls_filter_func *func, void *closure)
Sets a function and its complementary data for G_ls2 filtering.
char ** G_ls2(const char *dir, int *num_files)
Stores a sorted directory listing in an array.
int ls_filter_func(const char *, void *)
void G_set_ls_exclude_filter(ls_filter_func *func, void *closure)
DIR * opendir(const char *name)
struct dirent * readdir(DIR *dir)