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 char **ofts_st_path;
00034 uint16_t ofts_st_path_count;
00035 uint16_t ofts_st_path_index;
00037 pcre *ofts_path_regex;
00038 pcre_extra *ofts_path_regex_extra;
00039 uint32_t ofts_path_op;
00040
00041 SEXP_t *ofts_spath;
00042 SEXP_t *ofts_sfilename;
00043 SEXP_t *ofts_sfilepath;
00044
00045 int max_depth;
00046 int direction;
00047 int recurse;
00048 int filesystem;
00049
00050 fsdev_t *localdevs;
00051 } OVAL_FTS;
00052
00053 #define OVAL_RECURSE_DIRECTION_NONE 0
00054 #define OVAL_RECURSE_DIRECTION_DOWN 1
00055 #define OVAL_RECURSE_DIRECTION_UP 2
00056
00057 #define OVAL_RECURSE_FILES 0x01
00058 #define OVAL_RECURSE_DIRS 0x02
00059 #define OVAL_RECURSE_SYMLINKS 0x04
00060
00061 #define OVAL_RECURSE_SYMLINKS_AND_DIRS (OVAL_RECURSE_SYMLINKS|OVAL_RECURSE_DIRS)
00062 #define OVAL_RECURSE_FILES_AND_DIRS (OVAL_RECURSE_FILES|OVAL_RECURSE_SYMLINKS)
00063
00064 #define OVAL_RECURSE_FS_LOCAL 0
00065 #define OVAL_RECURSE_FS_DEFINED 1
00066 #define OVAL_RECURSE_FS_ALL 2
00067
00068 typedef struct {
00069 char *file;
00070 size_t file_len;
00071 char *path;
00072 size_t path_len;
00073 } OVAL_FTSENT;
00074
00075
00076
00077
00078 OVAL_FTS *oval_fts_open(SEXP_t *path, SEXP_t *filename, SEXP_t *filepath, SEXP_t *behaviors);
00079 OVAL_FTSENT *oval_fts_read(OVAL_FTS *ofts);
00080 int oval_fts_close(OVAL_FTS *ofts);
00081
00082 void oval_ftsent_free(OVAL_FTSENT *ofts_ent);
00083
00084 #endif