summaryrefslogtreecommitdiff
path: root/src/joinfields.c
blob: 241584241e9417e9ed9156f9bea4bbde0969e7f1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#define BUFSIZE 0x100000

int main() {
  unsigned char rein[BUFSIZE];
  unsigned long bytes_read;

  while( (bytes_read = read( 0, rein, BUFSIZE)) != 0)
  {
    int i;
    const int maxentries = bytes_read / 16;
    for( i=1; i<maxentries; i++) {
      rein[i*5+0] = rein[i*16+0];
      rein[i*5+1] = rein[i*16+1];
      rein[i*5+2] = rein[i*16+2];
      rein[i*5+3] = rein[i*16+3];
      rein[i*5+4] = rein[i*16+4];
    }
    write( 1, rein, maxentries*5);
  }
  return 0;
}