From 53894e5aa1e733a0321a69bd1b12bd794586b4ab Mon Sep 17 00:00:00 2001 From: Tzafrir Cohen Date: Tue, 17 Jun 2008 17:49:05 +0000 Subject: Move the xpp utilities to the tools side. git-svn-id: http://svn.asterisk.org/svn/dahdi/tools/trunk@4374 a0bf4364-ded3-4de4-8d8a-66a801d63aff --- xpp/test_parse.c | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 xpp/test_parse.c (limited to 'xpp/test_parse.c') diff --git a/xpp/test_parse.c b/xpp/test_parse.c new file mode 100644 index 0000000..8ac2023 --- /dev/null +++ b/xpp/test_parse.c @@ -0,0 +1,35 @@ +#include +#include +#include "hexfile.h" + +static void default_report_func(int level, const char *msg, ...) +{ + va_list ap; + + va_start(ap, msg); + vfprintf(stderr, msg, ap); + va_end(ap); +} + +int main(int argc, char *argv[]) +{ + struct hexdata *hd; + int i; + + if(argc < 2) { + fprintf(stderr, "Usage: program hexfile...\n"); + return 1; + } + parse_hexfile_set_reporting(default_report_func); + for(i = 1; i < argc; i++) { + hd = parse_hexfile(argv[i], 2000); + if(!hd) { + fprintf(stderr, "Parsing failed\n"); + return 1; + } + fprintf(stderr, "=== %s === (version: %s)\n", argv[i], hd->version_info); + dump_hexfile2(hd, "-", 60 ); + free_hexdata(hd); + } + return 0; +} -- cgit v1.2.3