blob: e95d6fb8291a41282b72141561ba2ddf239660a5 [file] [log] [blame]
Paul Jakma010ebbb2014-09-16 11:53:49 +01001/*
2 * Copyright (C) 2004 Paul Jakma
3 *
4 * This file is part of Quagga.
5 *
6 * Quagga is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2, or (at your option) any
9 * later version.
10 *
11 * Quagga is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with Quagga; see the file COPYING. If not, write to the Free
18 * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
19 * 02111-1307, USA.
20 */
21
paul4dcadf72005-04-13 03:31:35 +000022#include <zebra.h>
pauldff4f522005-09-06 23:08:01 +000023#include <memory.h>
paul4dcadf72005-04-13 03:31:35 +000024#include <buffer.h>
25
26struct thread_master *master;
27
28int
29main(int argc, char **argv)
30{
31 struct buffer *b1, *b2;
32 int n;
33 char junk[3];
34 char c = 'a';
35
pauldff4f522005-09-06 23:08:01 +000036 memory_init();
37
paul4dcadf72005-04-13 03:31:35 +000038 if ((argc != 2) || (sscanf(argv[1], "%d%1s", &n, junk) != 1))
39 {
40 fprintf(stderr, "Usage: %s <number of chars to simulate>\n", *argv);
41 return 1;
42 }
43
44 b1 = buffer_new(0);
45 b2 = buffer_new(1024);
46
47 while (n-- > 0)
48 {
49 buffer_put(b1, &c, 1);
50 buffer_put(b2, &c, 1);
51 if (c++ == 'z')
52 c = 'a';
53 buffer_reset(b1);
54 buffer_reset(b2);
55 }
56 buffer_free(b1);
57 buffer_free(b2);
58 return 0;
59}