File: gentest.c

package info (click to toggle)
cdparanoia 3a9-1
  • links: PTS
  • area: main
  • in suites: slink
  • size: 556 kB
  • ctags: 530
  • sloc: ansic: 6,535; sh: 1,238; makefile: 33
file content (23 lines) | stat: -rw-r--r-- 395 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include <unistd.h>
#include <fcntl.h>

int main(){
  long i,j,fd;
  char out[2];

  fd=open("test",O_RDWR|O_CREAT|O_TRUNC);
  for(i=1;i<100;i++){
    for(j=-32768;j<32768;j+=i){
      out[0]=j&0xff;
      out[1]=(j>>8)&0xff;
      write(fd,out,2);
    }
    for(j=32767;j>-32768;j-=i){
      out[0]=j&0xff;
      out[1]=(j>>8)&0xff;
      write(fd,out,2);
    }
  }
  close(fd);
  return(0);
}