Fix FileNode debug printing loop.
Mark delete actions.
This commit is contained in:
@@ -6,10 +6,8 @@ POR HACER
|
||||
* GUI
|
||||
|
||||
|
||||
|
||||
HECHO
|
||||
=====
|
||||
|
||||
* CRC de ficheros (CRC_File en crc.h)
|
||||
* Lectura y Escritura de fechas de ficheros (FileTime end fileutil.h)
|
||||
* Utilidades de ficheros (fileutil.h)
|
||||
@@ -17,3 +15,4 @@ HECHO
|
||||
de cada fichero; crc, fecha, estado (FileNode en filenode.h)
|
||||
* Scaneo, construccion y reconstruccion de arboles FileNode, detectando cambios.
|
||||
* Comparador de FileNodes que genere una lista de AccionFileCmp (filenodecmp.h)
|
||||
|
||||
|
||||
17
filenode.c
17
filenode.c
@@ -295,7 +295,7 @@ void FileNode_PrintNode(FileNode *fn){
|
||||
}
|
||||
printf("\n");
|
||||
|
||||
|
||||
/*
|
||||
// Tamanho
|
||||
if(fn->flags&FileFlag_TieneTamanho){
|
||||
printf("\\-Tamanho: %lld\n",fn->size);
|
||||
@@ -310,27 +310,32 @@ void FileNode_PrintNode(FileNode *fn){
|
||||
if(fn->flags&FileFlag_TieneCRC){
|
||||
printf("\\-CRC : [%08X]\n",fn->crc);
|
||||
}
|
||||
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
void FileNode_Print(FileNode *fn){
|
||||
FileNode *fnAux=fn;
|
||||
int end=0;
|
||||
|
||||
while(fnAux!=NULL){
|
||||
while(fnAux!=NULL && !end){
|
||||
|
||||
FileNode_PrintNode(fnAux);
|
||||
|
||||
if(fnAux->child){
|
||||
fnAux=fnAux->child;
|
||||
}else{
|
||||
if(fnAux->sig==NULL){
|
||||
while(fnAux->sig==NULL){
|
||||
fnAux=fnAux->padre;
|
||||
if(fnAux==fn){
|
||||
if(fnAux==fn || fnAux==NULL){
|
||||
printf("End\n");
|
||||
end=1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
fnAux=fnAux->sig;
|
||||
if(!end){
|
||||
fnAux=fnAux->sig;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,22 +68,32 @@ void AccionFileNode_CheckPair(
|
||||
}
|
||||
if(!fnIzq && fnDer){
|
||||
afnNew->accion=AccionFileCmp_DerechaAIzquierda;
|
||||
if(fnDer->child){
|
||||
if(fnDer->child && fnDer->estado!=EstadoFichero_Borrado){
|
||||
doChilds=1;
|
||||
}
|
||||
|
||||
// Anular en caso de se operacion nula
|
||||
if(fnDer->estado==EstadoFichero_Borrado){
|
||||
afnNew->accion=AccionFileCmp_Nada;
|
||||
}
|
||||
}
|
||||
if(fnIzq && !fnDer){
|
||||
afnNew->accion=AccionFileCmp_IzquierdaADerecha;
|
||||
if(fnIzq->child){
|
||||
if(fnIzq->child && fnIzq->estado!=EstadoFichero_Borrado){
|
||||
doChilds=1;
|
||||
}
|
||||
|
||||
// Anular en caso de se operacion nula
|
||||
if(fnIzq->estado==EstadoFichero_Borrado){
|
||||
afnNew->accion=AccionFileCmp_Nada;
|
||||
}
|
||||
}
|
||||
if(fnIzq && fnDer){
|
||||
// Realizar comparacion completa
|
||||
if(fnIzq->child){
|
||||
if(fnIzq->child && fnIzq->estado!=EstadoFichero_Borrado){
|
||||
doChilds=1;
|
||||
}
|
||||
if(fnIzq->child){
|
||||
if(fnIzq->child && fnDer->estado!=EstadoFichero_Borrado){
|
||||
doChilds=1;
|
||||
}
|
||||
|
||||
@@ -93,9 +103,22 @@ void AccionFileNode_CheckPair(
|
||||
}else
|
||||
if(fnIzq->ft<fnDer->ft){
|
||||
afnNew->accion=AccionFileCmp_DerechaAIzquierda;
|
||||
if(fnDer->estado==EstadoFichero_Borrado){
|
||||
afnNew->accion=AccionFileCmp_BorrarIzquierda;
|
||||
}
|
||||
}else
|
||||
if(fnIzq->ft>fnDer->ft){
|
||||
afnNew->accion=AccionFileCmp_IzquierdaADerecha;
|
||||
if(fnIzq->estado==EstadoFichero_Borrado){
|
||||
afnNew->accion=AccionFileCmp_BorrarDerecha;
|
||||
}
|
||||
}
|
||||
|
||||
// Anular en caso de se operacion nula
|
||||
if(fnDer->estado==EstadoFichero_Borrado &&
|
||||
fnIzq->estado==EstadoFichero_Borrado)
|
||||
{
|
||||
afnNew->accion=AccionFileCmp_Nada;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user