1 /* $NetBSD: serial_test.c,v 1.6 2014/12/10 04:37:53 christos Exp $ */
4 * Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC")
5 * Copyright (C) 1999-2001, 2003 Internet Software Consortium.
7 * Permission to use, copy, modify, and/or distribute this software for any
8 * purpose with or without fee is hereby granted, provided that the above
9 * copyright notice and this permission notice appear in all copies.
11 * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
12 * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
13 * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
14 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
15 * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
16 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17 * PERFORMANCE OF THIS SOFTWARE.
20 /* Id: serial_test.c,v 1.15 2007/06/19 23:46:59 tbox Exp */
26 #include <isc/serial.h>
27 #include <isc/stdlib.h>
35 while (fgets(buf
, sizeof(buf
), stdin
) != NULL
) {
36 buf
[sizeof(buf
) - 1] = '\0';
38 a
= strtoul(s
, &e
, 0);
42 b
= strtoul(s
, &e
, 0);
45 fprintf(stdout
, "%u %u gt:%d lt:%d ge:%d le:%d eq:%d ne:%d\n",
47 isc_serial_gt(a
,b
), isc_serial_lt(a
,b
),
48 isc_serial_ge(a
,b
), isc_serial_le(a
,b
),
49 isc_serial_eq(a
,b
), isc_serial_ne(a
,b
));