-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathutils.h
More file actions
76 lines (45 loc) · 2.52 KB
/
Copy pathutils.h
File metadata and controls
76 lines (45 loc) · 2.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#ifndef UTILS
#define UTILS
#pragma warning (disable : 4996)
#include <stdio.h>
#include <windows.h>
#include "types.h"
#include "traverse.h"
#define DEBUG_LOG(msg) printf("DEBUG_LOG: %s\n", msg);
#define iDEBUG_LOG(msg, n) printf("DEBUG_LOG: %s%d\n", msg, n);
#define i64DEBUG_LOG(msg, n) printf("DEBUG_LOG: %s%I64d\n", msg, n);
#define ptrDEBUG_LOG(msg, ptr) printf("DEBUG_LOG: %s ptr: %p\n", msg, ptr);
#define BUFSIZE 520
/*********** utils_comparing ***********/
void compare(Traverser * traverser_new, Traverser * traverser_old, const unsigned char showDifferent, const char * const writeDifferentPath);
void startComparing(const char * const readPath, Traverser * traverser_new, Traverser * traverser_old, const unsigned char showDifferent,
const unsigned char compareOnly, const char * const readPathNew, const char * const writeDifferentPath);
/***************************************/
/************ utils_file_io ************/
void readFromDisk(const char * const readPath, Traverser * traverser);
DWORD WINAPI writeToDiskT(LPVOID lpParameter);
void writeToDisk(const char * const writePath, Traverser * traverser, const unsigned char freePath);
void calculateFileAndDirCountFromDisk(const char * const readPath, unsigned int * fileCount, unsigned int * dirCount);
/***************************************/
/********** utils_stat_output **********/
void printHTable(HTable * hTable);
void printDIArray(DirectoryItem * const dirItems[], const unsigned int dirCount);
void printFIArray(FileItem * const fileItems[], const unsigned int fileCount);
void outputStats(Traverser * const traverser);
/***************************************/
/*********** utils_fileitem ************/
unsigned long long constructByteSize(const unsigned int fileSizeLow, const unsigned int fileSizeHigh);
unsigned long constructWriteTime(const FILETIME fileTime);
/***************************************/
/*********** utils_traversing **********/
unsigned char startTraverse(const char * const root, const char * const savePath, Traverser * traverser, const unsigned char write,
const unsigned char thread, HANDLE * hThread);
unsigned char validateDirectory(const char * const directory);
/***************************************/
/************* utils_res ***************/
void initTraverser(Traverser * const traverser);
void initTraverserWithRoot(Traverser * const traverser, const char * const root);
Traverser * allocTraverser();
void releaseRes(Traverser * const traverser, const unsigned char releaseRoot);
/***************************************/
#endif