27#ifdef HAVE_SYS_IOCTL_H
40static struct state *st = &state;
42static int cmp_names(
const void *
aa,
const void *
bb)
44 char *
const *a = (
char *
const *)
aa;
45 char *
const *
b = (
char *
const *)
bb;
66 st->ls_closure = closure;
71 st->ls_ex_filter = func;
72 st->ls_ex_closure = closure;
102 if (
dp->d_name[0] ==
'.')
104 if (st->ls_filter && !(*st->ls_filter)(
dp->d_name, st->ls_closure))
106 if (st->ls_ex_filter &&
107 (*st->ls_ex_filter)(
dp->d_name, st->ls_ex_closure))
141 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)