summaryrefslogtreecommitdiffstats
path: root/Resources/xlatefile.c
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2010-07-20 15:29:38 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2010-07-20 15:29:38 (GMT)
commitc00ba4b1229c79aacf041678a9c667dad2791784 (patch)
tree355cf0be823410eedde7bd65fa463fc92736c57e /Resources/xlatefile.c
parenta67794b1bc35421f1267133a6f7b447db2a71a3a (diff)
downloadhdf5-c00ba4b1229c79aacf041678a9c667dad2791784.zip
hdf5-c00ba4b1229c79aacf041678a9c667dad2791784.tar.gz
hdf5-c00ba4b1229c79aacf041678a9c667dad2791784.tar.bz2
[svn-r19107] Move Resources folder to config/cmake
Tested: Local Linux
Diffstat (limited to 'Resources/xlatefile.c')
-rw-r--r--Resources/xlatefile.c56
1 files changed, 0 insertions, 56 deletions
diff --git a/Resources/xlatefile.c b/Resources/xlatefile.c
deleted file mode 100644
index c16f573..0000000
--- a/Resources/xlatefile.c
+++ /dev/null
@@ -1,56 +0,0 @@
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-
-#define BUFFERSIZE 1024
-
-int main(int argc, char *argv[]) {
- FILE *infile = NULL;
- FILE *outfile = NULL;
- char *buffer = NULL;
- char argbuf[8];
- unsigned int bytes = 0;
- unsigned int idx = 0;
- unsigned int lineidx = 0;
- unsigned int stripXlines = 3;
-
- if(argc < 3)
- exit(1);
- if(NULL == (infile = fopen(argv[1], "rb")))
- exit(2);
- if(NULL == (outfile = fopen(argv[2], "wb+")))
- exit(3);
- if(argc > 3)
- if(argv[3][0] == '-')
- if(argv[3][1] == 'l') {
- strcpy(argbuf, &argv[3][2]);
- stripXlines = atoi(argbuf);
- }
- buffer = (char*)malloc(BUFFERSIZE);
- if(buffer) {
- while(!feof(infile)) {
- /* read the file into the buffer. */
- bytes = fread(buffer, 1, BUFFERSIZE, infile);
- if(lineidx < stripXlines) {
- for(idx = 0; idx < bytes; idx++) {
- if(buffer[idx] == '\n') {
- lineidx++;
- if(buffer[idx+1] == '\r')
- idx++;
- }
- if(lineidx >= stripXlines) {
- fwrite(&buffer[idx+1], 1, bytes-idx-1, outfile);
- idx = bytes;
- }
- }
- }
- else
- fwrite(buffer, 1, bytes, outfile);
- }
- free(buffer);
- }
- fclose(outfile);
- fclose(infile);
-
- return 0;
-}