Back to index

glibc  2.9
Classes | Defines | Functions | Variables
scandir.c File Reference
#include <dirent.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <bits/libc-lock.h>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.


struct  scandir_cancel_struct


#define SCANDIR   scandir
#define READDIR   __readdir
#define DIRENT_TYPE   struct dirent


static void cancel_handler (void *arg)


int const char * dir
DIRENT_TYPE *** namelist
int(* select )(const DIRENT_TYPE *)
int(* cmp )(const void *, const void *)

Class Documentation

struct scandir_cancel_struct

Definition at line 33 of file scandir.c.

Class Members
size_t cnt
DIR * dp
void * v

Define Documentation

#define DIRENT_TYPE   struct dirent

Definition at line 28 of file scandir.c.

#define READDIR   __readdir

Definition at line 27 of file scandir.c.

#define SCANDIR   scandir

Definition at line 26 of file scandir.c.


Definition at line 32 of file scandir.c.

Function Documentation

static void cancel_handler ( void *  arg) [static]

Definition at line 41 of file scandir.c.

  struct scandir_cancel_struct *cp = arg;
  size_t i;
  void **v = cp->v;

  for (i = 0; i < cp->cnt; ++i)
    free (v[i]);
  free (v);
  (void) __closedir (cp->dp);

Variable Documentation

int(* cmp)(const void *, const void *)

Definition at line 60 of file scandir.c.

int const char* dir

Definition at line 57 of file scandir.c.

Definition at line 58 of file scandir.c.

Definition at line 59 of file scandir.c.