blob: b310776f86cc1fb667a3a89e5ebbd54d7d8e49f9 [file] [log] [blame]
paul4dcadf72005-04-13 03:31:35 +00001#include <zebra.h>
pauldff4f522005-09-06 23:08:01 +00002#include <memory.h>
paul4dcadf72005-04-13 03:31:35 +00003#include <buffer.h>
4
5struct thread_master *master;
6
7int
8main(int argc, char **argv)
9{
10 struct buffer *b1, *b2;
11 int n;
12 char junk[3];
13 char c = 'a';
14
pauldff4f522005-09-06 23:08:01 +000015 memory_init();
16
paul4dcadf72005-04-13 03:31:35 +000017 if ((argc != 2) || (sscanf(argv[1], "%d%1s", &n, junk) != 1))
18 {
19 fprintf(stderr, "Usage: %s <number of chars to simulate>\n", *argv);
20 return 1;
21 }
22
23 b1 = buffer_new(0);
24 b2 = buffer_new(1024);
25
26 while (n-- > 0)
27 {
28 buffer_put(b1, &c, 1);
29 buffer_put(b2, &c, 1);
30 if (c++ == 'z')
31 c = 'a';
32 buffer_reset(b1);
33 buffer_reset(b2);
34 }
35 buffer_free(b1);
36 buffer_free(b2);
37 return 0;
38}