chiark / gitweb /
Version bump.
authormdw <mdw>
Fri, 7 Mar 2003 20:04:21 +0000 (20:04 +0000)
committermdw <mdw>
Fri, 7 Mar 2003 20:04:21 +0000 (20:04 +0000)
Makefile
vec.h [new file with mode: 0644]

index 3a56067cbbccf82d04b9d3c0c017801f702568e5..bdcb3e1bb518253d8c90a6052100a36666c13979 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
 # Makefile for RIGHT ON COMMAND-LINE
 #
 # Makefile for RIGHT ON COMMAND-LINE
 #
-# $Id: Makefile,v 1.8 2003/03/07 20:03:01 mdw Exp $
+# $Id: Makefile,v 1.9 2003/03/07 20:04:21 mdw Exp $
 
 #----- Configuration stuff --------------------------------------------------
 
 
 #----- Configuration stuff --------------------------------------------------
 
@@ -30,7 +30,7 @@ RM = rm
 # Shouldn't need to fiddle with thiis stuff.
 
 PACKAGE = rocl
 # Shouldn't need to fiddle with thiis stuff.
 
 PACKAGE = rocl
-VERSION = 1.1.0
+VERSION = 1.1.1
 
 TCLSCRIPTS = \
        elite-editor elite-pairs elite-path elite-find elite-map \
 
 TCLSCRIPTS = \
        elite-editor elite-pairs elite-path elite-find elite-map \
diff --git a/vec.h b/vec.h
new file mode 100644 (file)
index 0000000..6221ab1
--- /dev/null
+++ b/vec.h
@@ -0,0 +1,121 @@
+/* -*-c-*-
+ *
+ * $Id: vec.h,v 1.1 2003/03/07 20:04:21 mdw Exp $
+ *
+ * Vectors and arrays in Tcl
+ *
+ * (c) 2003 Mark Wooding
+ */
+
+/*----- Licensing notice --------------------------------------------------* 
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ * 
+ * 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 General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+/*----- Revision history --------------------------------------------------* 
+ *
+ * $Log: vec.h,v $
+ * Revision 1.1  2003/03/07 20:04:21  mdw
+ * Version bump.
+ *
+ */
+
+#ifndef VEC_H
+#define VEC_H
+
+#ifdef __cplusplus
+  extern "C" {
+#endif
+
+/*----- Header files ------------------------------------------------------*/
+
+#include <stddef.h>
+
+#include <tcl.h>
+
+/*----- Data structures ---------------------------------------------------*/
+
+typedef struct vec_bound { long lo, hi; } vec_bound;
+typedef struct vec {
+  Tcl_Command c;
+  size_t ndim;
+  vec_bound *dim;
+  size_t n;
+  Tcl_Obj **v;
+} vec;
+
+/*----- Functions provided ------------------------------------------------*/
+
+/* --- @vec_find@ --- *
+ *
+ * Arguments:  @Tcl_Interp *ti@ = interpreter vector exists in
+ *             @Tcl_Obj *o@ = object containing the command name
+ *
+ * Returns:    A pointer to the vector, or null.
+ *
+ * Use:                Finds the vector with a given name.
+ */
+
+extern vec *vec_find(Tcl_Interp */*ti*/, Tcl_Obj */*o*/);
+
+/* --- @vec_index@ --- *
+ *
+ * Arguments:  @Tcl_Interp *ti@ = interpreter to put errors in
+ *             @vec *v@ = the vector
+ *             @int objc@ = number of indices provided
+ *             @Tcl_Obj *const *objv@ = vector of objects
+ *
+ * Returns:    Address of the object pointer, or null.
+ *
+ * Use:                Looks up an index in a vector.
+ */
+
+extern Tcl_Obj **vec_index(Tcl_Interp */*ti*/, vec */*v*/,
+                          int /*objc*/, Tcl_Obj *const */*objv*/);
+
+/* --- @vec_destroy@ --- *
+ *
+ * Arguments:  @Tcl_Interp *ti@ = owning interpreter
+ *             @vec *v@ = vector pointer
+ *
+ * Returns:    ---
+ *
+ * Use:                Destroys a vector.
+ */
+
+extern void vec_destroy(Tcl_Interp */*ti*/, vec */*v*/);
+
+/* --- @vec_create@ --- *
+ *
+ * Arguments:  @Tcl_Interp *ti@ = interpreter to create vector in
+ *             @size_t ndim@ = number of dimensions
+ *             @const vec_bound *dim@ = the actual dimensions
+ *             @Tcl_Obj *init@ = initial value
+ *
+ * Returns:    A pointer to the vector, or null if it failed.
+ *
+ * Use:                Creates a new vector object.
+ */
+
+extern vec *vec_create(Tcl_Interp */*ti*/, size_t /*ndim*/,
+                      const vec_bound */*dim*/, Tcl_Obj */*init*/);
+
+/*----- That's all, folks -------------------------------------------------*/
+
+#ifdef __cplusplus
+  }
+#endif
+
+#endif