From 4cadb168b5477478ceea77aa53364c54e6b3cfba Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Thu, 24 Aug 2006 13:19:44 +0000 Subject: [PATCH] Allow this update test to read record data from standard input. --- zoom/zoomtst9.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/zoom/zoomtst9.c b/zoom/zoomtst9.c index d3f6e2f..8e9898b 100644 --- a/zoom/zoomtst9.c +++ b/zoom/zoomtst9.c @@ -1,4 +1,4 @@ -/* $Id: zoomtst9.c,v 1.2 2006-04-21 10:28:08 adam Exp $ */ +/* $Id: zoomtst9.c,v 1.3 2006-08-24 13:19:44 adam Exp $ */ /** \file zoomtst9.c \brief Extended Service Update @@ -6,6 +6,7 @@ #include #include +#include #include #include @@ -73,8 +74,21 @@ int main(int argc, char **argv) ZOOM_package_option_set(pkg, "recordIdOpaque", argv[i][0] ? argv[i] : 0); i++; - ZOOM_package_option_set(pkg, "record", - argv[i][0] ? argv[i] : 0); + if (!strcmp(argv[i], "-")) + { + /* For -, read record buffer from stdin */ + WRBUF w = wrbuf_alloc(); + int ch; + while ((ch = getchar()) != EOF) + wrbuf_putc(w, ch); + wrbuf_putc(w, '\0'); + ZOOM_package_option_set(pkg, "record", wrbuf_buf(w)); + } + else + { + ZOOM_package_option_set(pkg, "record", + argv[i][0] ? argv[i] : 0); + } i++; ZOOM_package_send(pkg, "update"); /* Update EXT service */ -- 1.7.10.4