Code Cleanup
This commit is contained in:
@@ -28,7 +28,8 @@ void CRCTable_Init() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
unsigned long CRC_BufferInternal(unsigned char *buffer, int len,
|
unsigned long CRC_BufferInternal(unsigned char *buffer, int len,
|
||||||
unsigned long crc) {
|
unsigned long crc)
|
||||||
|
{
|
||||||
unsigned char *p;
|
unsigned char *p;
|
||||||
|
|
||||||
// Calculate CRC from buffer
|
// Calculate CRC from buffer
|
||||||
|
|||||||
114
src/filenode.c
114
src/filenode.c
@@ -7,30 +7,30 @@
|
|||||||
#include "fileutil.h"
|
#include "fileutil.h"
|
||||||
#include "filenode.h"
|
#include "filenode.h"
|
||||||
|
|
||||||
FileNode *_free_filenode = NULL;
|
FileNode *_freeFileNode = NULL;
|
||||||
int _n_filenode = 0;
|
int _n_filenode = 0;
|
||||||
#define FileNode_Block 1024
|
#define FileNode_Block 1024
|
||||||
FileNode *FileNode_Create() {
|
FileNode *FileNode_Create() {
|
||||||
FileNode *fileNode;
|
FileNode *fileNode;
|
||||||
|
|
||||||
if (_free_filenode == NULL) {
|
if (_freeFileNode == NULL) {
|
||||||
FileNode *nodos;
|
FileNode *nodes;
|
||||||
int i;
|
int i;
|
||||||
// Allocate a block
|
// Allocate a block
|
||||||
nodos = malloc(sizeof(FileNode) * FileNode_Block);
|
nodes = malloc(sizeof(FileNode) * FileNode_Block);
|
||||||
if (nodos == NULL) {
|
if (nodes == NULL) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
for (i = 0; i < FileNode_Block - 1; i++) {
|
for (i = 0; i < FileNode_Block - 1; i++) {
|
||||||
nodos[i].next = &nodos[i + 1];
|
nodes[i].next = &nodes[i + 1];
|
||||||
}
|
}
|
||||||
nodos[FileNode_Block - 1].next = NULL;
|
nodes[FileNode_Block - 1].next = NULL;
|
||||||
_free_filenode = &nodos[0];
|
_freeFileNode = &nodes[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get first free
|
// Get first free
|
||||||
fileNode = _free_filenode;
|
fileNode = _freeFileNode;
|
||||||
_free_filenode = fileNode->next;
|
_freeFileNode = fileNode->next;
|
||||||
fileNode->next = NULL;
|
fileNode->next = NULL;
|
||||||
_n_filenode++;
|
_n_filenode++;
|
||||||
|
|
||||||
@@ -50,7 +50,7 @@ FileNode *FileNode_Create() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void FileNode_Delete(FileNode *fn) {
|
void FileNode_Delete(FileNode *fn) {
|
||||||
|
// Delete childs
|
||||||
FileNode *fileNodeChildAux = fn->child;
|
FileNode *fileNodeChildAux = fn->child;
|
||||||
FileNode *fileNodeChild = fn->child;
|
FileNode *fileNodeChild = fn->child;
|
||||||
while (fileNodeChild) {
|
while (fileNodeChild) {
|
||||||
@@ -64,98 +64,99 @@ void FileNode_Delete(FileNode *fn) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn->next = _free_filenode;
|
// Queue freed node
|
||||||
_free_filenode = fn;
|
fn->next = _freeFileNode;
|
||||||
|
_freeFileNode = fn;
|
||||||
_n_filenode--;
|
_n_filenode--;
|
||||||
}
|
}
|
||||||
|
|
||||||
void FileNode_AddChild(FileNode *fileNode, FileNode *file2) {
|
void FileNode_AddChild(FileNode *fileNode, FileNode *fileNodeChild) {
|
||||||
if (!file2 || !fileNode)
|
if (!fileNodeChild || !fileNode)
|
||||||
return;
|
return;
|
||||||
file2->next = fileNode->child;
|
fileNodeChild->next = fileNode->child;
|
||||||
fileNode->child = file2;
|
fileNode->child = fileNodeChild;
|
||||||
fileNode->childCount++;
|
fileNode->childCount++;
|
||||||
file2->parent = fileNode;
|
fileNodeChild->parent = fileNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
void FileNode_SetStatusRec(FileNode *fileNode, FileStatus status) {
|
void FileNode_SetStatusRec(FileNode *fileNode, FileStatus status) {
|
||||||
FileNode *fn_child;
|
FileNode *fileNodeChild;
|
||||||
fileNode->status = status;
|
fileNode->status = status;
|
||||||
fn_child = fileNode->child;
|
fileNodeChild = fileNode->child;
|
||||||
while (fn_child != NULL) {
|
while (fileNodeChild != NULL) {
|
||||||
FileNode_SetStatusRec(fn_child, status);
|
FileNode_SetStatusRec(fileNodeChild, status);
|
||||||
fn_child = fn_child->next;
|
fileNodeChild = fileNodeChild->next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void FileNode_GetPath_Rec(FileNode *fileNode, char **pathnode) {
|
void FileNode_GetPath_Rec(FileNode *fileNode, char **pathNode) {
|
||||||
if (fileNode->parent) {
|
if (fileNode->parent) {
|
||||||
pathnode[0] = fileNode->parent->name;
|
pathNode[0] = fileNode->parent->name;
|
||||||
FileNode_GetPath_Rec(fileNode->parent, pathnode + 1);
|
FileNode_GetPath_Rec(fileNode->parent, pathNode + 1);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
pathnode[0] = NULL;
|
pathNode[0] = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
char temppath[MaxPath];
|
char tempPath[MaxPath];
|
||||||
char *FileNode_GetPath(FileNode *fileNode, char *path) {
|
char *FileNode_GetPath(FileNode *fileNode, char *path) {
|
||||||
char *pathnodes[MaxPath];
|
char *pathNodes[MaxPathNodes];
|
||||||
int levels, i;
|
int levels, i;
|
||||||
char *pathptr = temppath;
|
char *pathPtr = tempPath;
|
||||||
if (path) { pathptr = path; }
|
if (path) { pathPtr = path; }
|
||||||
|
|
||||||
FileNode_GetPath_Rec(fileNode, pathnodes);
|
FileNode_GetPath_Rec(fileNode, pathNodes);
|
||||||
levels = 0;
|
levels = 0;
|
||||||
while (pathnodes[levels]) {
|
while (pathNodes[levels]) {
|
||||||
levels++;
|
levels++;
|
||||||
}
|
}
|
||||||
strcpy(pathptr, "");
|
strcpy(pathPtr, "");
|
||||||
for (i = levels - 1; i >= 0; i--) {
|
for (i = levels - 1; i >= 0; i--) {
|
||||||
strcat(pathptr, pathnodes[i]);
|
strcat(pathPtr, pathNodes[i]);
|
||||||
strcat(pathptr, "/");
|
strcat(pathPtr, "/");
|
||||||
}
|
}
|
||||||
strcat(pathptr, fileNode->name);
|
strcat(pathPtr, fileNode->name);
|
||||||
return temppath;
|
return tempPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
char *FileNode_GetFullPath(FileNode *fileNode, char *basePath, char *path) {
|
char *FileNode_GetFullPath(FileNode *fileNode, char *basePath, char *path) {
|
||||||
char *pathnodes[MaxPath];
|
char *pathNodes[MaxPath];
|
||||||
int levels, i;
|
int levels, i;
|
||||||
char *pathptr = temppath;
|
char *pathPtr = tempPath;
|
||||||
if (path)
|
if (path)
|
||||||
pathptr = path;
|
pathPtr = path;
|
||||||
|
|
||||||
FileNode_GetPath_Rec(fileNode, pathnodes);
|
FileNode_GetPath_Rec(fileNode, pathNodes);
|
||||||
levels = 0;
|
levels = 0;
|
||||||
while (pathnodes[levels]) {
|
while (pathNodes[levels]) {
|
||||||
levels++;
|
levels++;
|
||||||
}
|
}
|
||||||
strcpy(pathptr, basePath);
|
strcpy(pathPtr, basePath);
|
||||||
strcat(pathptr, "/");
|
strcat(pathPtr, "/");
|
||||||
for (i = levels - 2; i >= 0; i--) {
|
for (i = levels - 2; i >= 0; i--) {
|
||||||
strcat(pathptr, pathnodes[i]);
|
strcat(pathPtr, pathNodes[i]);
|
||||||
strcat(pathptr, "/");
|
strcat(pathPtr, "/");
|
||||||
}
|
}
|
||||||
strcat(pathptr, fileNode->name);
|
strcat(pathPtr, fileNode->name);
|
||||||
return temppath;
|
return tempPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
void FileNode_GetSize(FileNode *fileNode, char *file) {
|
void FileNode_LoadSize(FileNode *fileNode, char *file) {
|
||||||
fileNode->flags |= FileFlag_HasSize;
|
fileNode->flags |= FileFlag_HasSize;
|
||||||
fileNode->size = File_GetSize(file);
|
fileNode->size = File_GetSize(file);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FileNode_GetTime(FileNode *fileNode, char *file) {
|
void FileNode_LoadTime(FileNode *fileNode, char *file) {
|
||||||
fileNode->flags |= FileFlag_HasTime;
|
fileNode->flags |= FileFlag_HasTime;
|
||||||
fileNode->fileTime = FileTime_Get(file);
|
fileNode->fileTime = FileTime_Get(file);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FileNode_GetSizeAndTime(FileNode *fileNode, char *file) {
|
void FileNode_LoadSizeAndTime(FileNode *fileNode, char *file) {
|
||||||
fileNode->flags |= FileFlag_HasSize | FileFlag_HasTime;
|
fileNode->flags |= FileFlag_HasSize | FileFlag_HasTime;
|
||||||
File_GetSizeAndTime(file, &fileNode->size, &fileNode->fileTime);
|
File_GetSizeAndTime(file, &fileNode->size, &fileNode->fileTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FileNode_GetCRC(FileNode *fileNode, char *filePath) {
|
void FileNode_LoadCRC(FileNode *fileNode, char *filePath) {
|
||||||
FILE *file;
|
FILE *file;
|
||||||
file = fopen(filePath, "rb");
|
file = fopen(filePath, "rb");
|
||||||
if (!file) {
|
if (!file) {
|
||||||
@@ -174,7 +175,8 @@ void FileNode_SaveNode(FileNode *fileNode, FILE *file) {
|
|||||||
fwrite((void *)&nameLen, sizeof(nameLen), 1, file);
|
fwrite((void *)&nameLen, sizeof(nameLen), 1, file);
|
||||||
if (nameLen > 0 && nameLen < MaxFilename) {
|
if (nameLen > 0 && nameLen < MaxFilename) {
|
||||||
fputs(fileNode->name, file);
|
fputs(fileNode->name, file);
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -408,13 +410,13 @@ FileNode *FileNode_Build(char *path) {
|
|||||||
if (File_IsDirectory(path)) {
|
if (File_IsDirectory(path)) {
|
||||||
// Get information data from directories, and child files
|
// Get information data from directories, and child files
|
||||||
fileNode->flags |= FileFlag_Directory;
|
fileNode->flags |= FileFlag_Directory;
|
||||||
FileNode_GetTime(fileNode, path);
|
FileNode_LoadTime(fileNode, path);
|
||||||
File_IterateDir(path, FileNode_Build_Iterate, fileNode);
|
File_IterateDir(path, FileNode_Build_Iterate, fileNode);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// Get information data from files
|
// Get information data from files
|
||||||
fileNode->flags |= FileFlag_Normal;
|
fileNode->flags |= FileFlag_Normal;
|
||||||
FileNode_GetSizeAndTime(fileNode, path);
|
FileNode_LoadSizeAndTime(fileNode, path);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (fileNode);
|
return (fileNode);
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
#define FileFlag_HasSize 8
|
#define FileFlag_HasSize 8
|
||||||
#define FileFlag_HasTime 16
|
#define FileFlag_HasTime 16
|
||||||
#define FileFlag_HasCRC 32
|
#define FileFlag_HasCRC 32
|
||||||
|
#define FileFlag_PlaceHolder 512
|
||||||
#define FileFlag_MarkerForReview 1024
|
#define FileFlag_MarkerForReview 1024
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
@@ -42,10 +43,10 @@ void FileNode_AddChild(FileNode *file, FileNode *file2);
|
|||||||
|
|
||||||
char *FileNode_GetFullPath(FileNode *fileNode, char *basePath, char *path);
|
char *FileNode_GetFullPath(FileNode *fileNode, char *basePath, char *path);
|
||||||
|
|
||||||
void FileNode_GetSize(FileNode *fileNode, char *file);
|
void FileNode_LoadSize(FileNode *fileNode, char *file);
|
||||||
void FileNode_GetTime(FileNode *fileNode, char *file);
|
void FileNode_LoadTime(FileNode *fileNode, char *file);
|
||||||
void FileNode_GetSizeAndTime(FileNode *fileNode, char *file);
|
void FileNode_LoadSizeAndTime(FileNode *fileNode, char *file);
|
||||||
void FileNode_GetCRC(FileNode *fileNode, char *file);
|
void FileNode_LoadCRC(FileNode *fileNode, char *file);
|
||||||
|
|
||||||
void FileNode_Save(FileNode *fileNode, char *fichero);
|
void FileNode_Save(FileNode *fileNode, char *fichero);
|
||||||
FileNode *FileNode_Load(char *fichero);
|
FileNode *FileNode_Load(char *fichero);
|
||||||
|
|||||||
@@ -52,7 +52,8 @@ void AccionFileNode_Destroy(ActionFileNode *actionFileNode) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ActionFileNode *ActionFileNode_CreateNormal(FileNode *fileNodeLeft,
|
ActionFileNode *ActionFileNode_CreateNormal(FileNode *fileNodeLeft,
|
||||||
FileNode *fileNodeRight) {
|
FileNode *fileNodeRight)
|
||||||
|
{
|
||||||
ActionFileNode *actionFileNode;
|
ActionFileNode *actionFileNode;
|
||||||
actionFileNode = ActionFileNode_Create();
|
actionFileNode = ActionFileNode_Create();
|
||||||
actionFileNode->action = ActionFileCmp_Nothing;
|
actionFileNode->action = ActionFileCmp_Nothing;
|
||||||
@@ -65,7 +66,8 @@ ActionFileNode *ActionFileNode_CreateNormal(FileNode *fileNodeLeft,
|
|||||||
void AccionFileNode_CompareChilds(ActionFileNode *actionFileNodeRoot,
|
void AccionFileNode_CompareChilds(ActionFileNode *actionFileNodeRoot,
|
||||||
ActionFileNode **actionFileNodeQueue,
|
ActionFileNode **actionFileNodeQueue,
|
||||||
void(*CheckPair)(FileNode *fileNodeLeft, FileNode *fileNodeRight,
|
void(*CheckPair)(FileNode *fileNodeLeft, FileNode *fileNodeRight,
|
||||||
ActionFileNode **actionFileNodeQueue)) {
|
ActionFileNode **actionFileNodeQueue))
|
||||||
|
{
|
||||||
FileNode *fileNodeLeft;
|
FileNode *fileNodeLeft;
|
||||||
FileNode *fileNodeRight;
|
FileNode *fileNodeRight;
|
||||||
FileNode *fileNodeRightQueue;
|
FileNode *fileNodeRightQueue;
|
||||||
@@ -151,7 +153,8 @@ void AccionFileNode_CompareChilds(ActionFileNode *actionFileNodeRoot,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void AccionFileNode_DeletePair(FileNode *fileNodeLeft, FileNode *fileNodeRight,
|
void AccionFileNode_DeletePair(FileNode *fileNodeLeft, FileNode *fileNodeRight,
|
||||||
ActionFileNode **actionFileNodeQueue) {
|
ActionFileNode **actionFileNodeQueue)
|
||||||
|
{
|
||||||
ActionFileNode *actionFileNodeNew = ActionFileNode_CreateNormal(
|
ActionFileNode *actionFileNodeNew = ActionFileNode_CreateNormal(
|
||||||
fileNodeLeft, fileNodeRight);
|
fileNodeLeft, fileNodeRight);
|
||||||
|
|
||||||
@@ -224,7 +227,8 @@ void AccionFileNode_DeletePair(FileNode *fileNodeLeft, FileNode *fileNodeRight,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void AccionFileNode_CheckPair(FileNode *fileNodeLeft, FileNode *fileNodeRight,
|
void AccionFileNode_CheckPair(FileNode *fileNodeLeft, FileNode *fileNodeRight,
|
||||||
ActionFileNode **actionFileNodeQueue) {
|
ActionFileNode **actionFileNodeQueue)
|
||||||
|
{
|
||||||
ActionFileNode *actionFileNodeNew = ActionFileNode_CreateNormal(
|
ActionFileNode *actionFileNodeNew = ActionFileNode_CreateNormal(
|
||||||
fileNodeLeft, fileNodeRight);
|
fileNodeLeft, fileNodeRight);
|
||||||
|
|
||||||
@@ -300,11 +304,12 @@ void AccionFileNode_CheckPair(FileNode *fileNodeLeft, FileNode *fileNodeRight,
|
|||||||
}
|
}
|
||||||
if (fileNodeLeft && fileNodeRight) {
|
if (fileNodeLeft && fileNodeRight) {
|
||||||
if ((fileNodeLeft->flags & FileFlag_Directory)
|
if ((fileNodeLeft->flags & FileFlag_Directory)
|
||||||
&& (fileNodeRight->flags & FileFlag_Directory)) {
|
&& (fileNodeRight->flags & FileFlag_Directory))
|
||||||
|
{
|
||||||
// Directory
|
// Directory
|
||||||
|
|
||||||
// Prepare action for directory pair
|
// Prepare action for directory pair
|
||||||
if (abs((int)(fileNodeLeft->fileTime - fileNodeRight->fileTime)) <= maxDeltaTime) { // appoximadamente iguales
|
if (abs((int)(fileNodeLeft->fileTime - fileNodeRight->fileTime)) <= maxDeltaTime) { // aprox. equal
|
||||||
if (fileNodeRight->status == FileStatus_Deleted
|
if (fileNodeRight->status == FileStatus_Deleted
|
||||||
&& fileNodeLeft->status == FileStatus_Deleted) {
|
&& fileNodeLeft->status == FileStatus_Deleted) {
|
||||||
actionFileNodeNew->action = ActionFileCmp_Nothing;
|
actionFileNodeNew->action = ActionFileCmp_Nothing;
|
||||||
@@ -360,7 +365,8 @@ void AccionFileNode_CheckPair(FileNode *fileNodeLeft, FileNode *fileNodeRight,
|
|||||||
QueueNode(*actionFileNodeQueue, actionFileNodeNew);
|
QueueNode(*actionFileNodeQueue, actionFileNodeNew);
|
||||||
}
|
}
|
||||||
else if ((fileNodeLeft->flags & FileFlag_Normal)
|
else if ((fileNodeLeft->flags & FileFlag_Normal)
|
||||||
&& (fileNodeRight->flags & FileFlag_Normal)) {
|
&& (fileNodeRight->flags & FileFlag_Normal))
|
||||||
|
{
|
||||||
// Files
|
// Files
|
||||||
|
|
||||||
// Prepare action for file pair
|
// Prepare action for file pair
|
||||||
@@ -425,7 +431,8 @@ ActionFileNode *ActionFileNode_BuildSync(FileNode *izquierda, FileNode *derecha)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void AccionFileNode_Copy(FileNode *fileNodeLeft, FileNode *fileNodeRight,
|
void AccionFileNode_Copy(FileNode *fileNodeLeft, FileNode *fileNodeRight,
|
||||||
ActionFileNode **actionFileNodeQueue) {
|
ActionFileNode **actionFileNodeQueue)
|
||||||
|
{
|
||||||
ActionFileNode *actionFileNodeNew = ActionFileNode_CreateNormal(
|
ActionFileNode *actionFileNodeNew = ActionFileNode_CreateNormal(
|
||||||
fileNodeLeft, fileNodeRight);
|
fileNodeLeft, fileNodeRight);
|
||||||
|
|
||||||
@@ -470,7 +477,8 @@ void AccionFileNode_Copy(FileNode *fileNodeLeft, FileNode *fileNodeRight,
|
|||||||
}
|
}
|
||||||
if (fileNodeLeft && fileNodeRight) {
|
if (fileNodeLeft && fileNodeRight) {
|
||||||
if ((fileNodeLeft->flags & FileFlag_Directory)
|
if ((fileNodeLeft->flags & FileFlag_Directory)
|
||||||
|| (fileNodeRight->flags & FileFlag_Directory)) {
|
|| (fileNodeRight->flags & FileFlag_Directory))
|
||||||
|
{
|
||||||
if (fileNodeLeft->status != FileStatus_Deleted) {
|
if (fileNodeLeft->status != FileStatus_Deleted) {
|
||||||
AccionFileNode_CompareChilds(actionFileNodeNew,
|
AccionFileNode_CompareChilds(actionFileNodeNew,
|
||||||
actionFileNodeQueue, AccionFileNode_Copy);
|
actionFileNodeQueue, AccionFileNode_Copy);
|
||||||
@@ -493,7 +501,8 @@ void AccionFileNode_Copy(FileNode *fileNodeLeft, FileNode *fileNodeRight,
|
|||||||
else {
|
else {
|
||||||
if (fileNodeLeft->status != FileStatus_Deleted) {
|
if (fileNodeLeft->status != FileStatus_Deleted) {
|
||||||
if (abs((int)(fileNodeLeft->fileTime - fileNodeRight->fileTime))
|
if (abs((int)(fileNodeLeft->fileTime - fileNodeRight->fileTime))
|
||||||
<= maxDeltaTime) { // appox. equal
|
<= maxDeltaTime)
|
||||||
|
{
|
||||||
actionFileNodeNew->action = ActionFileCmp_Nothing;
|
actionFileNodeNew->action = ActionFileCmp_Nothing;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -521,7 +530,8 @@ ActionFileNode *ActionFileNode_BuildCopy(FileNode *fileNodeLeft,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ActionFileNode_Statistics(ActionFileNode *actionFileNode,
|
void ActionFileNode_Statistics(ActionFileNode *actionFileNode,
|
||||||
ActionQueueStatistics *statistics) {
|
ActionQueueStatistics *statistics)
|
||||||
|
{
|
||||||
statistics->readLeft = 0;
|
statistics->readLeft = 0;
|
||||||
statistics->writeLeft = 0;
|
statistics->writeLeft = 0;
|
||||||
statistics->readRight = 0;
|
statistics->readRight = 0;
|
||||||
@@ -645,7 +655,8 @@ void AccionFileNodeAux_MakeDir(char *pathOrig, char *pathDest) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ActionFileNode_RunList(ActionFileNode *actionFileNode, char *pathLeft,
|
void ActionFileNode_RunList(ActionFileNode *actionFileNode, char *pathLeft,
|
||||||
char *pathRight) {
|
char *pathRight)
|
||||||
|
{
|
||||||
char fullPathLeft[MaxPath], fullPathRight[MaxPath], showPath[MaxPath];
|
char fullPathLeft[MaxPath], fullPathRight[MaxPath], showPath[MaxPath];
|
||||||
while (actionFileNode != NULL) {
|
while (actionFileNode != NULL) {
|
||||||
if (actionFileNode->left) {
|
if (actionFileNode->left) {
|
||||||
|
|||||||
@@ -12,8 +12,9 @@ void FileTime_Print(FileTime t);
|
|||||||
|
|
||||||
///////////////////////////////////////////////
|
///////////////////////////////////////////////
|
||||||
// File
|
// File
|
||||||
#define MaxPath 4096
|
|
||||||
#define MaxFilename 2048
|
#define MaxFilename 2048
|
||||||
|
#define MaxPath 4096
|
||||||
|
#define MaxPathNodes 512
|
||||||
|
|
||||||
void File_GetName(char *path, char *name);
|
void File_GetName(char *path, char *name);
|
||||||
|
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ int main(int argc, char *argv[]) {
|
|||||||
for (i = 2; i < argc; i++) {
|
for (i = 2; i < argc; i++) {
|
||||||
if (File_ExistsPath(argv[i])) {
|
if (File_ExistsPath(argv[i])) {
|
||||||
FileNode *fileNode = FileNode_Build(argv[i]);
|
FileNode *fileNode = FileNode_Build(argv[i]);
|
||||||
FileNode_GetCRC(fileNode, argv[i]);
|
FileNode_LoadCRC(fileNode, argv[i]);
|
||||||
FileNode_PrintNode(fileNode);
|
FileNode_PrintNode(fileNode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,7 +47,8 @@ void Time_Pause(int pausa){
|
|||||||
diff = tend - t;
|
diff = tend - t;
|
||||||
if (diff > 1000) {
|
if (diff > 1000) {
|
||||||
Sleep((int)diff / 1000);
|
Sleep((int)diff / 1000);
|
||||||
}else{
|
}
|
||||||
|
else {
|
||||||
Sleep(0);
|
Sleep(0);
|
||||||
}
|
}
|
||||||
t = Time_GetTime();
|
t = Time_GetTime();
|
||||||
|
|||||||
Reference in New Issue
Block a user