diff options
| author | Dirk Engling <erdgeist@erdgeist.org> | 2014-02-20 02:46:41 +0100 |
|---|---|---|
| committer | Dirk Engling <erdgeist@erdgeist.org> | 2014-02-20 02:46:41 +0100 |
| commit | 64c85dfc1d3b546dd4b5f84168e9256817f3a741 (patch) | |
| tree | e3de2e7a99362bfa1dfcde3d4bad3e76af179c61 /src/postprocess/joinfields.c | |
| parent | 632c350fcf2021620afd032994e6e32c34c6dbfb (diff) | |
clean up source directory
Diffstat (limited to 'src/postprocess/joinfields.c')
| -rw-r--r-- | src/postprocess/joinfields.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/postprocess/joinfields.c b/src/postprocess/joinfields.c new file mode 100644 index 0000000..2415842 --- /dev/null +++ b/src/postprocess/joinfields.c | |||
| @@ -0,0 +1,21 @@ | |||
| 1 | #define BUFSIZE 0x100000 | ||
| 2 | |||
| 3 | int main() { | ||
| 4 | unsigned char rein[BUFSIZE]; | ||
| 5 | unsigned long bytes_read; | ||
| 6 | |||
| 7 | while( (bytes_read = read( 0, rein, BUFSIZE)) != 0) | ||
| 8 | { | ||
| 9 | int i; | ||
| 10 | const int maxentries = bytes_read / 16; | ||
| 11 | for( i=1; i<maxentries; i++) { | ||
| 12 | rein[i*5+0] = rein[i*16+0]; | ||
| 13 | rein[i*5+1] = rein[i*16+1]; | ||
| 14 | rein[i*5+2] = rein[i*16+2]; | ||
| 15 | rein[i*5+3] = rein[i*16+3]; | ||
| 16 | rein[i*5+4] = rein[i*16+4]; | ||
| 17 | } | ||
| 18 | write( 1, rein, maxentries*5); | ||
| 19 | } | ||
| 20 | return 0; | ||
| 21 | } | ||
