summaryrefslogtreecommitdiff
path: root/support/dktools/test-eradisk.c
blob: 3abc64fdd2f21cc12ec6fdb8759fbbc0b3692b96 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/*
	WARNING: This file was generated by dkct.
	Changes you make here will be lost if dkct is run again!
	You should modify the original source and run dkct on it.
	Original source: test-eradisk.ctr
*/

/**	@file test-eradisk.c The test-eradisk module.
*/


#line 1 "test-eradisk.ctr"


#include <stdio.h>
#include <stdlib.h>

#include "dk4mai8dsz.h"

int main(int argc, char *argv[])
{
  size_t	 ts = 512;
  size_t	 as = 512;
  size_t	 is = 0;
  int		 cc = 1;
  int		 ic;
  const char	*ep = NULL;
  if (1 < argc) {
    if (0 != dk4ma_input_c8_dec_size_t(&as, argv[1], &ep, 1, NULL)) {
      ts = as;
      printf("ts = %u\n", (unsigned)ts);
    }
  }
  while (1 == cc) {
    ic = fgetc(stdin);
    if (EOF == ic) {
      cc = 0;
    } else {
      if (++is >= ts) {
        cc = 0;
      } else {
        printf("%u / %u\n", (unsigned)is, (unsigned)ts);
      }
    }
  }
  exit(0); return 0;
}