00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef OVAL_FTS_H
00023 #define OVAL_FTS_H
00024
00025 #include <sexp.h>
00026 #include <fts.h>
00027 #include <pcre.h>
00028 #include "fsdev.h"
00029
00030 typedef struct {
00031 FTS *ofts_fts;
00032
00033 SEXP_t *ofts_path;
00034 char **ofts_st_path;
00035 uint16_t ofts_st_path_count;
00036 uint16_t ofts_st_path_index;
00038 pcre *ofts_path_regex;
00039 pcre_extra *ofts_path_regex_extra;
00040 bool ofts_path_regex_Opartial;
00042 SEXP_t *ofts_filename;
00043 SEXP_t *ofts_behaviors;
00044
00045 bool ofts_nilfilename;
00046
00047 int max_depth;
00048 int direction;
00049 int recurse;
00050 int filesystem;
00051
00052 fsdev_t *localdevs;
00053 } OVAL_FTS;
00054
00055 #define OVAL_RECURSE_DIRECTION_NONE 0
00056 #define OVAL_RECURSE_DIRECTION_DOWN 1
00057 #define OVAL_RECURSE_DIRECTION_UP 2
00058
00059 #define OVAL_RECURSE_FILES 0x01
00060 #define OVAL_RECURSE_DIRS 0x02
00061 #define OVAL_RECURSE_SYMLINKS 0x04
00062
00063 #define OVAL_RECURSE_SYMLINKS_AND_DIRS (OVAL_RECURSE_SYMLINKS|OVAL_RECURSE_DIRS)
00064 #define OVAL_RECURSE_FILES_AND_DIRS (OVAL_RECURSE_FILES|OVAL_RECURSE_SYMLINKS)
00065
00066 #define OVAL_RECURSE_FS_LOCAL 0
00067 #define OVAL_RECURSE_FS_DEFINED 1
00068 #define OVAL_RECURSE_FS_ALL 2
00069
00070 typedef struct {
00071 char *filepath;
00072 size_t filepath_len;
00073
00074 char *file;
00075 size_t file_len;
00076
00077 char *path;
00078 size_t path_len;
00079
00080 bool nilfile;
00081 } OVAL_FTSENT;
00082
00083
00084
00085
00086 OVAL_FTS *oval_fts_open(SEXP_t *path, SEXP_t *filename, SEXP_t *filepath, SEXP_t *behaviors);
00087 OVAL_FTSENT *oval_fts_read(OVAL_FTS *ofts);
00088 int oval_fts_close(OVAL_FTS *ofts);
00089
00090 void oval_ftsent_free(OVAL_FTSENT *ofts_ent);
00091
00092 #endif