File: recur.h

package info (click to toggle)
magicrescue 1.1.9-4
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 812 kB
  • ctags: 530
  • sloc: ansic: 1,939; perl: 1,649; sh: 316; makefile: 65
file content (32 lines) | stat: -rw-r--r-- 700 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#if defined(__GNU__) && !defined(PATH_MAX)
#define PATH_MAX 1024
#endif

#ifndef _RECUR_H

#include <sys/stat.h>
#include <dirent.h>

#define RECUR_MAXDEPTH 100

struct dirstack {
    DIR *dirs[RECUR_MAXDEPTH];
    DIR **pos;
    char prefix[PATH_MAX];
};

struct recur {
    char **list;
    struct dirstack *stack;
};

void rm_rf(const char *dir);
struct dirstack *dirstack_open(const char *path);
void dirstack_close(struct dirstack *stack);
int dirstack_next(struct dirstack *stack, char *fullname, struct stat *st_arg);
struct recur *recur_open(char **paths);
void recur_close(struct recur *recur);
int recur_next(struct recur *recur, char *name, struct stat *st_arg);

# define _RECUR_H
#endif