Revision: 41045
http://brlcad.svn.sourceforge.net/brlcad/?rev=41045&view=rev
Author: brlcad
Date: 2010-10-18 17:11:58 +0000 (Mon, 18 Oct 2010)
Log Message:
-----------
remove the 'query' command prompt input tool. it's a specialized version of
'read' (with defaults) that, while useful for scripting, used SIGALRM and
alarm() in its implementation making it non-portable to Windows without
maintenance effort. since it's a burden, not in major use, and has drop-in
replacements available, remove it from the package.
Modified Paths:
--------------
brlcad/trunk/NEWS
brlcad/trunk/src/util/Makefile.am
Removed Paths:
-------------
brlcad/trunk/src/util/query.1
brlcad/trunk/src/util/query.c
Modified: brlcad/trunk/NEWS
===================================================================
--- brlcad/trunk/NEWS 2010-10-18 17:03:25 UTC (rev 41044)
+++ brlcad/trunk/NEWS 2010-10-18 17:11:58 UTC (rev 41045)
@@ -13,6 +13,7 @@
--- 2010-09-XX Release 7.18.0 ---
----------------------------------------------------------------------
+* removed 'query' command line prompting tool - Sean Morrison
* increased optimized package run-time performance - Sean Morrison
* fixed crash when raytracing multiple frames - Keith Bowman
* fixed mged zap crash while using preview - Keith Bowman, Bob Parker
Modified: brlcad/trunk/src/util/Makefile.am
===================================================================
--- brlcad/trunk/src/util/Makefile.am 2010-10-18 17:03:25 UTC (rev 41044)
+++ brlcad/trunk/src/util/Makefile.am 2010-10-18 17:11:58 UTC (rev 41045)
@@ -142,7 +142,6 @@
png-bw \
png-pix \
png_info \
- query \
rle-pix \
sun-pix \
terrain \
@@ -509,9 +508,6 @@
png_pix_CFLAGS = ${PNG_CPPFLAGS}
png_pix_LDADD = ${BN} ${BU}
-query_SOURCES = query.c
-query_LDADD = ${BU}
-
rle_pix_SOURCES = rle-pix.c
rle_pix_LDADD = ${RLE} ${BU} ${SYSV}
rle_pix_CFLAGS = ${RLE_CPPFLAGS}
@@ -636,7 +632,6 @@
png-bw.1 \
png-pix.1 \
png_info.1 \
- query.1 \
random.1 \
rle-pix.1 \
sun-pix.1 \
@@ -765,7 +760,6 @@
$(png_bw_OBJECTS) \
$(png_pix_OBJECTS) \
$(png_info_OBJECTS) \
- $(query_OBJECTS) \
$(random_OBJECTS) \
$(rle_pix_OBJECTS) \
$(sgi_pix_OBJECTS) \
Deleted: brlcad/trunk/src/util/query.1
===================================================================
--- brlcad/trunk/src/util/query.1 2010-10-18 17:03:25 UTC (rev 41044)
+++ brlcad/trunk/src/util/query.1 2010-10-18 17:11:58 UTC (rev 41045)
@@ -1,84 +0,0 @@
-.TH QUERY 1 BRL-CAD
-.\" Q U E R Y . 1
-.\" BRL-CAD
-.\"
-.\" Copyright (c) 2005-2010 United States Government as represented by
-.\" the U.S. Army Research Laboratory.
-.\"
-.\" Redistribution and use in source (Docbook format) and 'compiled'
-.\" forms (PDF, PostScript, HTML, RTF, etc), with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\"
-.\" 1. Redistributions of source code (Docbook format) must retain the
-.\" above copyright notice, this list of conditions and the following
-.\" disclaimer.
-.\"
-.\" 2. Redistributions in compiled form (transformed to other DTDs,
-.\" converted to PDF, PostScript, HTML, RTF, and other formats) must
-.\" reproduce the above copyright notice, this list of conditions and
-.\" the following disclaimer in the documentation and/or other
-.\" materials provided with the distribution.
-.\"
-.\" 3. The name of the author may not be used to endorse or promote
-.\" products derived from this documentation without specific prior
-.\" written permission.
-.\"
-.\" THIS DOCUMENTATION IS PROVIDED BY THE AUTHOR AS IS'' AND ANY
-.\" EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
-.\" ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
-.\" OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
-.\" BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-.\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
-.\" USE OF THIS DOCUMENTATION, EVEN IF ADVISED OF THE POSSIBILITY OF
-.\" SUCH DAMAGE.
-.\"
-.\".\".\"
-.SH NAME
-query \- query the user for input
-.SH SYNOPSIS
-.B query
-.RB [ \-t\ seconds]
-.RB [ \-r\ response]
-.RB [ \-v]
-.RB [ \-l]
-.SH DESCRIPTION
-By default,
-.I query
-reads a line from standard input and echoes it to standard output.
-options include:
-.TP
-.B \-t seconds
-Timeout after
-.I seconds
-seconds. If no input has been seen by this time,
-query will echo the default response value to standard output.
-.TP
-.B \-r response
-Change the default response to
-.I response.
-The default
-response is "y" if not set with this option. The \-r option is
-only useful in conjunction with \-t or \-l.
-.TP
-.B \-v
-Turn on verbosity. This will echo to stderr what the current response
-is and what the timeout is if timeout is set. There is no newline sent
-after the message.
-.TP
-.B \-l
-Loop rather than return response when a timeout occurs. If timeout is
-not set it defaults to 5 seconds for loops. This will also cause a
-message to appear on stderr stating what the default is and what the
-loop intervel is. At the end of each loop,
-.I query
-will output a newline and bell.
-.SH DIAGNOSTICS
-Exit status is 0 if everything is OK, 1 for usage error.
-.SH "BUG REPORTS"
-Reports of bugs or problems should be submitted via electronic
-mail to <[email protected]>.
Deleted: brlcad/trunk/src/util/query.c
===================================================================
--- brlcad/trunk/src/util/query.c 2010-10-18 17:03:25 UTC (rev 41044)
+++ brlcad/trunk/src/util/query.c 2010-10-18 17:11:58 UTC (rev 41045)
@@ -1,172 +0,0 @@
-/* Q U E R Y . C
- * BRL-CAD
- *
- * Copyright (c) 2004-2010 United States Government as represented by
- * the U.S. Army Research Laboratory.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this file; see the file named COPYING for more
- * information.
- */
-/** @file query.c
- *
- * By default, query reads a line from standard input and echoes it
- * to standard output.
- *
- * entry:
- * -t seconds to wait for user response.
- * -r default response
- * -v toggle verbose option (Default "r" in "t" seconds)
- * -l loop rather than respond.
- *
- * Exit:
- * <stdout> The line read
- * or y
- * or response
- *
- */
-
-#include "common.h"
-
-#include <stdlib.h>
-#include <string.h>
-#include <signal.h>
-#include <errno.h>
-#include "bio.h"
-
-#include "bu.h"
-
-
-char Yes_Response[] = "y";
-int Verbose=0;
-char *Response= Yes_Response;
-int Timeout=0;
-int Loop=0;
-int Done = 0;
-
-static const char usage[] = "\
-Usage: %s [-v] [-t seconds] [-r response ] [-l]\n";
-
-int
-get_args(int argc, char **argv)
-{
- int c;
-
- while ((c = bu_getopt(argc, argv, "t:r:vl")) != EOF) {
- switch (c) {
- case 't':
- Timeout = atoi(bu_optarg);
- break;
- case 'r':
- Response = bu_optarg;
- break;
- case 'v':
- Verbose = 1 - Verbose;
- break;
- case 'l':
- Loop = 1;
- break;
- default: /* '?' */
- return 0;
- }
- }
- if (Timeout < 0) Timeout = 0;
- if ((Loop & Timeout) <= 0) Timeout=5;
-
- if (Loop) Verbose = 0;
-
- return 1;
-}
-
-
-void handler(int);
-
-int
-main(int argc, char **argv)
-{
- char line[80];
- char *eol;
- char *flag;
-
- if (!get_args(argc, argv)) {
- bu_exit(1, usage, argv[0]);
- }
-
- (void) signal(SIGALRM, handler);
- Done = 0;
-
- for (;;) {
- (void) signal(SIGALRM, handler);
- if (Verbose) {
- if (Timeout) {
- (void) fprintf(stderr,
- "(Default: %s in %d sec)", Response,
- Timeout);
- } else {
- (void) fprintf(stderr,
- "(Default: %s)", Response);
- }
- }
-
- if (Loop) {
- (void) fprintf(stderr,
- "(Default: %s, loop in %d sec)", Response, Timeout);
- }
- if (Timeout) alarm(Timeout);
-
- flag = bu_fgets(line, 80, stdin);
- if (Done) {
- if (Loop) {
- (void) fputs("\n\007", stderr);
- Done = 0;
- } else {
- (void) fputs(Response, stdout);
- (void) putchar('\n');
- break;
- }
- } else if (flag == NULL) {
- (void) fputs(Response, stdout);
- break;
- } else {
- /* good response */
- eol = strlen(line) + line;
- if (*(eol-1) == '\n') {
- --eol;
- *eol = '\0';
- }
- if (eol == line) {
- (void) fputs(Response, stdout);
- } else {
- (void) fputs(line, stdout);
- }
- (void)putchar('\n');
- break;
- }
- }
- bu_exit (0, NULL);
-}
-void
-handler(int sig)
-{
- Done = 1;
-}
-
-
-/*
- * Local Variables:
- * mode: C
- * tab-width: 8
- * indent-tabs-mode: t
- * c-file-style: "stroustrup"
- * End:
- * ex: shiftwidth=4 tabstop=8
- */
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Download new Adobe(R) Flash(R) Builder(TM) 4
The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly
Flex(R) Builder(TM)) enable the development of rich applications that run
across multiple browsers and platforms. Download your free trials today!
http://p.sf.net/sfu/adobe-dev2dev
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits