44 lines
960 B
C
44 lines
960 B
C
#ifndef UTILITIES_H
|
|
#define UTILITIES_H
|
|
|
|
#include <errno.h>
|
|
#include <dirent.h>
|
|
#include <unistd.h>
|
|
#include <fcntl.h>
|
|
|
|
#include "myers.h"
|
|
#include "action_list.h"
|
|
|
|
#define RESET "\033[0m"
|
|
#define RED_BG "\033[41m"
|
|
#define GREEN_BG "\033[42m"
|
|
#define BLACK_FG "\033[30m"
|
|
|
|
typedef enum {
|
|
PT_NOEXIST,
|
|
PT_FILE,
|
|
PT_DIR,
|
|
PT_OTHER,
|
|
PT_ERROR
|
|
} PathType;
|
|
|
|
typedef List StringBuffer;
|
|
|
|
|
|
StringBuffer* string_buffer_new();
|
|
int string_buffer_push(StringBuffer*, char*);
|
|
void string_buffer_sort(StringBuffer*);
|
|
char* string_buffer_search(StringBuffer*, char*);
|
|
char* find_root(char*);
|
|
void walk(char*, char*, char*, FileInfoBuffer*, int, char*);
|
|
char* get_repo_path(char*, char*);
|
|
int is_in_repo(char*, char*);
|
|
int cut_path(char*, char*);
|
|
void combine_path(char*, char*);
|
|
PathType get_path_type(const char*);
|
|
char* get_file_content(char*);
|
|
char* get_file_content_with_size(char*, size_t*);
|
|
int create_default_config_file(char*);
|
|
|
|
|
|
#endif // UTILITIES_H
|