/***************************************
- $Header: /home/amb/routino/src/RCS/segmentsx.c,v 1.68 2010/10/09 14:14:42 amb Exp $
+ $Header: /home/amb/routino/src/RCS/segmentsx.c,v 1.69 2010/11/13 14:22:28 amb Exp $
Extended Segment data type functions.
#include "types.h"
#include "files.h"
+#include "logging.h"
#include "functions.h"
/* Print the start message */
- printf("Sorting Segments");
- fflush(stdout);
+ printf_first("Sorting Segments");
/* Close the files and re-open them (finished appending) */
/* Print the final message */
- printf("\rSorted Segments: Segments=%d\n",segmentsx->xnumber);
- fflush(stdout);
+ printf_last("Sorted Segments: Segments=%d",segmentsx->xnumber);
}
/* Print the start message */
- printf("Checking: Segments=0 Duplicate=0 Loop=0 Missing-Node=0");
- fflush(stdout);
+ printf_first("Checking: Segments=0 Duplicate=0 Loop=0 Missing-Node=0");
/* Allocate the array of indexes */
total++;
if(!(total%10000))
- {
- printf("\rChecking: Segments=%d Duplicate=%d Loop=%d Missing-Node=%d",total,duplicate,loop,missing);
- fflush(stdout);
- }
+ printf_middle("Checking: Segments=%d Duplicate=%d Loop=%d Missing-Node=%d",total,duplicate,loop,missing);
}
/* Close the files and re-open them */
/* Print the final message */
- printf("\rChecked: Segments=%d Duplicate=%d Loop=%d Missing-Node=%d \n",total,duplicate,loop,missing);
- fflush(stdout);
+ printf_last("Checked: Segments=%d Duplicate=%d Loop=%d Missing-Node=%d",total,duplicate,loop,missing);
}
/* Print the start message */
- printf("Measuring Segments: Segments=0");
- fflush(stdout);
+ printf_first("Measuring Segments: Segments=0");
/* Map into memory */
index++;
if(!(index%10000))
- {
- printf("\rMeasuring Segments: Segments=%d",index);
- fflush(stdout);
- }
+ printf_middle("Measuring Segments: Segments=%d",index);
}
/* Close the files and re-open them */
/* Print the final message */
- printf("\rMeasured Segments: Segments=%d \n",segmentsx->number);
- fflush(stdout);
+ printf_last("Measured Segments: Segments=%d",segmentsx->number);
}
/* Print the start message */
- printf("Rotating Segments: Segments=0 Rotated=0");
- fflush(stdout);
+ printf_first("Rotating Segments: Segments=0 Rotated=0");
/* Close the files and re-open them (finished appending) */
index++;
if(!(index%10000))
- {
- printf("\rRotating Segments: Segments=%d Rotated=%d",index,rotated);
- fflush(stdout);
- }
+ printf_middle("Rotating Segments: Segments=%d Rotated=%d",index,rotated);
}
/* Close the files and re-open them */
/* Print the final message */
- printf("\rRotated Segments: Segments=%d Rotated=%d \n",index,rotated);
- fflush(stdout);
+ printf_last("Rotated Segments: Segments=%d Rotated=%d",index,rotated);
}
/* Print the start message */
- printf("Deduplicating Segments: Segments=0 Duplicate=0");
- fflush(stdout);
+ printf_first("Deduplicating Segments: Segments=0 Duplicate=0");
/* Map into memory */
index++;
if(!(index%10000))
- {
- printf("\rDeduplicating Segments: Segments=%d Duplicate=%d",index,duplicate);
- fflush(stdout);
- }
+ printf_middle("Deduplicating Segments: Segments=%d Duplicate=%d",index,duplicate);
}
/* Close the files and re-open them */
/* Print the final message */
- printf("\rDeduplicated Segments: Segments=%d Duplicate=%d Unique=%d\n",index,duplicate,index-duplicate);
- fflush(stdout);
+ printf_last("Deduplicated Segments: Segments=%d Duplicate=%d Unique=%d",index,duplicate,index-duplicate);
}
/* Print the start message */
- printf("Creating Real Segments: Segments=0");
- fflush(stdout);
+ printf_first("Creating Real Segments: Segments=0");
/* Map into memory */
#endif
if(!((i+1)%10000))
- {
- printf("\rCreating Real Segments: Segments=%d",i+1);
- fflush(stdout);
- }
+ printf_middle("Creating Real Segments: Segments=%d",i+1);
}
/* Unmap from memory */
/* Print the final message */
- printf("\rCreating Real Segments: Segments=%d \n",segmentsx->number);
- fflush(stdout);
+ printf_last("Creating Real Segments: Segments=%d",segmentsx->number);
}
/* Print the start message */
- printf("Indexing Nodes: Nodes=0");
- fflush(stdout);
+ printf_first("Indexing Nodes: Nodes=0");
/* Map into memory */
while(1);
if(!((i+1)%10000))
- {
- printf("\rIndexing Nodes: Nodes=%d",i+1);
- fflush(stdout);
- }
+ printf_middle("Indexing Nodes: Nodes=%d",i+1);
}
/* Unmap from memory */
/* Print the final message */
- printf("\rIndexed Nodes: Nodes=%d \n",nodesx->number);
- fflush(stdout);
+ printf_last("Indexed Nodes: Nodes=%d",nodesx->number);
}
/* Print the start message */
- printf("Writing Segments: Segments=0");
- fflush(stdout);
+ printf_first("Writing Segments: Segments=0");
/* Write out the segments data */
WriteFile(fd,segment,sizeof(Segment));
if(!((i+1)%10000))
- {
- printf("\rWriting Segments: Segments=%d",i+1);
- fflush(stdout);
- }
+ printf_middle("Writing Segments: Segments=%d",i+1);
}
/* Write out the header structure */
/* Print the final message */
- printf("\rWrote Segments: Segments=%d \n",segmentsx->number);
- fflush(stdout);
+ printf_last("Wrote Segments: Segments=%d",segmentsx->number);
}