Mon, 30 May 2011 08:45:08 +0200
encapsulated common operations
universe@3 | 1 | #ifndef _CLINE_H |
universe@3 | 2 | #define _CLINE_H |
universe@1 | 3 | |
universe@1 | 4 | #include <stdio.h> |
universe@1 | 5 | #include <string.h> |
universe@1 | 6 | #include <stdbool.h> |
universe@1 | 7 | #include <stdlib.h> |
universe@1 | 8 | #include <dirent.h> |
universe@1 | 9 | |
universe@6 | 10 | |
universe@6 | 11 | typedef struct _suffix_list { |
universe@6 | 12 | int count; |
universe@6 | 13 | char** items; |
universe@6 | 14 | } suffix_list_t; |
universe@6 | 15 | |
universe@3 | 16 | typedef struct _settings { |
universe@3 | 17 | char fileSeparator; |
universe@6 | 18 | suffix_list_t* suffixList; |
universe@3 | 19 | bool recursive; |
universe@3 | 20 | bool includeSuffixes; |
universe@3 | 21 | bool matchesOnly; |
universe@3 | 22 | } settings_t; |
universe@3 | 23 | |
universe@4 | 24 | #ifdef _cplusplus |
universe@4 | 25 | extern "C" { |
universe@4 | 26 | #endif |
universe@3 | 27 | settings_t* new_settings_t(); |
universe@4 | 28 | void destroy_settings_t(settings_t*); |
universe@6 | 29 | suffix_list_t* new_suffix_list_t(); |
universe@6 | 30 | void destroy_suffix_list_t(suffix_list_t*); |
universe@6 | 31 | void add_suffix(suffix_list_t*, char*); |
universe@3 | 32 | |
universe@4 | 33 | void printHelpText(const char*); |
universe@8 | 34 | int exit_with_help(char*, settings_t*, int); |
universe@4 | 35 | #ifdef _cplusplus |
universe@4 | 36 | } |
universe@4 | 37 | #endif |
universe@3 | 38 | |
universe@3 | 39 | #endif /* _CLINE_H */ |