Revision: 33086
          http://brlcad.svn.sourceforge.net/brlcad/?rev=33086&view=rev
Author:   bob1961
Date:     2008-10-28 15:17:06 +0000 (Tue, 28 Oct 2008)

Log Message:
-----------
Added the echo function to libged.

Modified Paths:
--------------
    brlcad/trunk/include/ged.h
    brlcad/trunk/misc/win32-msvc8/libged/libged.vcproj
    brlcad/trunk/src/libged/Makefile.am
    brlcad/trunk/src/libtclcad/ged_obj.c

Added Paths:
-----------
    brlcad/trunk/src/libged/echo.c

Modified: brlcad/trunk/include/ged.h
===================================================================
--- brlcad/trunk/include/ged.h  2008-10-28 13:49:07 UTC (rev 33085)
+++ brlcad/trunk/include/ged.h  2008-10-28 15:17:06 UTC (rev 33086)
@@ -1398,6 +1398,14 @@
 GED_EXPORT BU_EXTERN(int ged_eac, (struct ged *gedp, int argc, const char 
*argv[]));
 
 /**
+ * Echo the specified arguments.
+ *
+ * Usage:
+ *     echo args
+ */
+GED_EXPORT BU_EXTERN(int ged_echo, (struct ged *gedp, int argc, const char 
*argv[]));
+
+/**
  * Text edit the color table
  *
  * Usage:

Modified: brlcad/trunk/misc/win32-msvc8/libged/libged.vcproj
===================================================================
--- brlcad/trunk/misc/win32-msvc8/libged/libged.vcproj  2008-10-28 13:49:07 UTC 
(rev 33085)
+++ brlcad/trunk/misc/win32-msvc8/libged/libged.vcproj  2008-10-28 15:17:06 UTC 
(rev 33086)
@@ -410,6 +410,10 @@
                                >
                        </File>
                        <File
+                               RelativePath="..\..\..\src\libged\echo.c"
+                               >
+                       </File>
+                       <File
                                RelativePath="..\..\..\src\libged\edcodes.c"
                                >
                        </File>

Modified: brlcad/trunk/src/libged/Makefile.am
===================================================================
--- brlcad/trunk/src/libged/Makefile.am 2008-10-28 13:49:07 UTC (rev 33085)
+++ brlcad/trunk/src/libged/Makefile.am 2008-10-28 15:17:06 UTC (rev 33086)
@@ -49,6 +49,7 @@
        dump.c \
        dup.c \
        eac.c \
+       echo.c \
        edcodes.c \
        edcomb.c \
        editit.c \

Added: brlcad/trunk/src/libged/echo.c
===================================================================
--- brlcad/trunk/src/libged/echo.c                              (rev 0)
+++ brlcad/trunk/src/libged/echo.c      2008-10-28 15:17:06 UTC (rev 33086)
@@ -0,0 +1,71 @@
+/*                         E C H O . C
+ * BRL-CAD
+ *
+ * Copyright (c) 2008 United States Government as represented by
+ * the U.S. Army Research Laboratory.
+ *
+ * This library 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 library 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 echo.c
+ *
+ * The echo command.
+ *
+ */
+
+#include "common.h"
+#include "bio.h"
+
+#include <stdlib.h>
+#include <ctype.h>
+#include <string.h>
+
+#include "ged_private.h"
+
+int
+ged_echo(struct ged *gedp, int argc, const char *argv[])
+{
+    register int i;
+
+    static const char *usage = "args";
+
+    GED_CHECK_DATABASE_OPEN(gedp, BRLCAD_ERROR);
+    GED_CHECK_ARGC_GT_0(gedp, argc, BRLCAD_ERROR);
+
+    /* initialize result */
+    bu_vls_trunc(&gedp->ged_result_str, 0);
+
+    /* must be wanting help */
+    if (argc == 1) {
+       bu_vls_printf(&gedp->ged_result_str, "Usage: %s %s", argv[0], usage);
+       return BRLCAD_HELP;
+    }
+
+    for (i=1; i < argc; i++)  {
+       bu_vls_printf(&gedp->ged_result_str, "%s%s", i==1 ? "" : " ", argv[i]);
+    }
+
+    bu_vls_printf(&gedp->ged_result_str, "\n");
+
+    return BRLCAD_OK;
+}
+
+/*
+ * Local Variables:
+ * tab-width: 8
+ * mode: C
+ * indent-tabs-mode: t
+ * c-file-style: "stroustrup"
+ * End:
+ * ex: shiftwidth=4 tabstop=8
+ */


Property changes on: brlcad/trunk/src/libged/echo.c
___________________________________________________________________
Added: svn:executable
   + *
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native

Modified: brlcad/trunk/src/libtclcad/ged_obj.c
===================================================================
--- brlcad/trunk/src/libtclcad/ged_obj.c        2008-10-28 13:49:07 UTC (rev 
33085)
+++ brlcad/trunk/src/libtclcad/ged_obj.c        2008-10-28 15:17:06 UTC (rev 
33086)
@@ -400,6 +400,7 @@
     {"E",      (char *)0, MAXARGS, go_autoview_func, ged_E},
     {"e",      (char *)0, MAXARGS, go_autoview_func, ged_draw},
     {"eac",    (char *)0, MAXARGS, go_autoview_func, ged_eac},
+    {"echo",   (char *)0, MAXARGS, go_pass_through_func, ged_echo},
     {"edcodes",        (char *)0, MAXARGS, go_pass_through_func, ged_edcodes},
     {"edcomb", (char *)0, MAXARGS, go_pass_through_func, ged_edcomb},
     {"edmater",        (char *)0, MAXARGS, go_pass_through_func, ged_edmater},


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
BRL-CAD Source Commits mailing list
brlcad-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to