]>
Commit | Line | Data |
---|---|---|
d62a17ae | 1 | /* |
46f4a4d2 PJ |
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 | * | |
896014f4 DL |
16 | * You should have received a copy of the GNU General Public License along |
17 | * with this program; see the file COPYING; if not, write to the Free Software | |
18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | |
46f4a4d2 PJ |
19 | */ |
20 | ||
4dcadf7e | 21 | #include <zebra.h> |
dff4f527 | 22 | #include <memory.h> |
fc7948fa | 23 | #include <memory_vty.h> |
4dcadf7e | 24 | #include <buffer.h> |
25 | ||
26 | struct thread_master *master; | |
27 | ||
d62a17ae | 28 | int main(int argc, char **argv) |
4dcadf7e | 29 | { |
d62a17ae | 30 | struct buffer *b1, *b2; |
31 | int n; | |
32 | char junk[3]; | |
33 | char c = 'a'; | |
4dcadf7e | 34 | |
d62a17ae | 35 | memory_init(); |
4dcadf7e | 36 | |
d62a17ae | 37 | if ((argc != 2) || (sscanf(argv[1], "%d%1s", &n, junk) != 1)) { |
38 | fprintf(stderr, "Usage: %s <number of chars to simulate>\n", | |
39 | *argv); | |
40 | return 1; | |
41 | } | |
42 | ||
43 | b1 = buffer_new(0); | |
44 | b2 = buffer_new(1024); | |
45 | ||
46 | while (n-- > 0) { | |
47 | buffer_put(b1, &c, 1); | |
48 | buffer_put(b2, &c, 1); | |
49 | if (c++ == 'z') | |
50 | c = 'a'; | |
51 | buffer_reset(b1); | |
52 | buffer_reset(b2); | |
53 | } | |
54 | buffer_free(b1); | |
55 | buffer_free(b2); | |
56 | return 0; | |
4dcadf7e | 57 | } |