ftwin 0.8.10
ft_config.h
1#ifndef FT_CONFIG_H
2#define FT_CONFIG_H
3
4#include "ft_types.h"
5#include <stddef.h>
6
20static const size_t KIBIBYTE = 1024;
21
25static const double MICROSECONDS_PER_SECOND = 1000000.0;
26
30static const size_t MAX_PATH_BUFFER = 4096;
31
35static const size_t CHAR_MAX_VAL = 256;
36
40static const size_t DEFAULT_SMALL_BUFFER_SIZE = 16;
41
45static const size_t DEFAULT_IO_BUFFER_SIZE = 8192;
46
50static const int DECIMAL_BASE = 10;
51
55static const int BENCHMARK_ITERATIONS = 20;
56
60static const int STRESS_TEST_ITERATIONS = 100;
61
65static const int PARALLEL_TIMEOUT_SECONDS = 30;
66
70static const int TEST_FILE_SIZE_SMALL = 5120;
71
75static const int TEST_FILE_SIZE_LARGE = 50000;
76
80static const int TEST_CHUNK_SIZE = 10;
81
84/* Constants */
85static const int ERROR_BUFFER_SIZE = 128;
86static const int MAX_THREADS = 256;
87static const int BASE_TEN = 10;
88
93typedef struct ft_conf_t
94{
95 apr_off_t minsize;
96 apr_off_t maxsize;
97 apr_off_t excess_size;
98 double threshold;
99 apr_pool_t *pool;
100 napr_heap_t *heap;
101 napr_hash_t *sizes;
102 napr_hash_t *gids;
103 napr_hash_t *ig_files;
104 pcre *ig_regex;
105 pcre *wl_regex;
106 pcre *ar_regex;
107 char *p_path;
108 char *username;
109 apr_size_t p_path_len;
110 apr_uid_t userid;
111 apr_gid_t groupid;
112 unsigned int num_threads;
113 ft_ignore_context_t *global_ignores;
114 int respect_gitignore;
115 unsigned short int mask;
116 char sep;
118
119
125ft_conf_t *ft_config_create(apr_pool_t *pool);
126
135apr_status_t ft_config_parse_args(ft_conf_t *conf, int argc, const char **argv, int *first_arg_index);
136
137#endif /* FT_CONFIG_H */
static const int TEST_FILE_SIZE_LARGE
A larger sample file size for testing.
Definition ft_config.h:75
static const int STRESS_TEST_ITERATIONS
A larger loop count for stress tests.
Definition ft_config.h:60
static const double MICROSECONDS_PER_SECOND
The number of microseconds in one second.
Definition ft_config.h:25
static const int DECIMAL_BASE
The base for string-to-integer conversions.
Definition ft_config.h:50
static const size_t DEFAULT_IO_BUFFER_SIZE
The default buffer size for I/O operations.
Definition ft_config.h:45
static const size_t CHAR_MAX_VAL
The maximum value of a character, often used as a buffer size.
Definition ft_config.h:35
static const size_t MAX_PATH_BUFFER
The maximum length for a file path buffer.
Definition ft_config.h:30
static const size_t DEFAULT_SMALL_BUFFER_SIZE
The default buffer size for small operations.
Definition ft_config.h:40
static const int TEST_FILE_SIZE_SMALL
A sample file size for testing purposes.
Definition ft_config.h:70
static const size_t KIBIBYTE
The number of bytes in one kibibyte (1024).
Definition ft_config.h:20
static const int TEST_CHUNK_SIZE
A sample chunk size for file operations in tests.
Definition ft_config.h:80
static const int BENCHMARK_ITERATIONS
A common loop count for benchmark iterations.
Definition ft_config.h:55
static const int PARALLEL_TIMEOUT_SECONDS
A timeout value in seconds for parallel operations.
Definition ft_config.h:65
struct napr_hash_t napr_hash_t
Opaque hash table structure.
Definition napr_hash.h:31
struct napr_heap_t napr_heap_t
Opaque heap structure.
Definition napr_heap.h:28
Main configuration structure for the ftwin application.
Definition ft_config.h:94
Represents the ignore rules for a specific directory and its descendants.
Definition ft_ignore.h:51