chiark / gitweb /
Progressing.
[chiark-tcl.git] / base / chiark-tcl.h
index d4a5719eee94763cd73c77f3b8e6e021affa1168..83469d561452a45fea7d9621da212e38605cb3d5 100644 (file)
@@ -4,9 +4,9 @@
  *  hbytes raw2h BINARY                          => hex
  *  hbytes h2raw HEX                             => binary
  *
- *  hbytes prefix VAR [VALUE ...]         = set VAR [concat VALUE ... $VAR]
- *  hbytes append VAR [VALUE ...]         = set VAR [concat $VAR VALUE ...]
- *  hbytes concat VAR [VALUE ...]         = set VAR [concat VALUE ...]
+ *  hbytes prepend VAR [VALUE ...]         = set VAR [concat VALUE ... $VAR]
+ *  hbytes append VAR [VALUE ...]          = set VAR [concat $VAR VALUE ...]
+ *  hbytes concat VAR [VALUE ...]          = set VAR [concat VALUE ...]
  *  hbytes unprepend VAR PREFIXLENGTH            => prefix (removed from VAR)
  *  hbytes unappend VAR SUFFIXLENGTH             => suffix (removed from VAR)
  *  hbytes chopto VAR NEWVARLENGTH               => suffix (removed from VAR)
@@ -46,12 +46,22 @@ void objfreeir(Tcl_Obj *o);
 void hbytes_set(HBytes_Value *upd, const Byte *array, int l);
 Tcl_Obj *hbytes_set_obj(Tcl_Obj *overwrite, const Byte *array, int l);
 
+/* from parse.c */
+
+typedef struct {
+  HBytes_Value *hb;
+  Tcl_Obj *obj, *var;
+} HBytes_Var;
+
+void fini_hbv(Tcl_Interp *ip, int rc, HBytes_Var *agg);
+
 /* from enum.c */
 
 extern Tcl_ObjType enum_nearlytype;
+extern Tcl_ObjType enum1_nearlytype;
 
 const void *enum_lookup_cached_func(Tcl_Interp *ip, Tcl_Obj *o,
-                                   size_t entrysize, const void *firstentry,
+                                   const void *firstentry, size_t entrysize,
                                    const char *what);
 #define enum_lookup_cached(ip,o,table,what)                    \
     (enum_lookup_cached_func((ip),(o),                         \
@@ -64,6 +74,10 @@ const void *enum_lookup_cached_func(Tcl_Interp *ip, Tcl_Obj *o,
    * set to the error message.
    */
 
+int enum1_lookup_cached_func(Tcl_Interp *ip, Tcl_Obj *o,
+                            const char *opts, const char *what);
+  /* -1 => error */
+
 /* from crypto.c */
 
 typedef struct {