You are viewing a plain text version of this content. The canonical link for it is here.
Posted to rivet-dev@tcl.apache.org by Massimo Manghi <ma...@unipr.it> on 2008/12/21 19:40:05 UTC

upload tempname handling added to rivetCore.c

I made the simple changes that were needed to have the
subcommand 'upload tempname' handled by the interpreter.
I think I'm going to commit soon

Index: src/apache-2/rivetCore.c
===================================================================
--- src/apache-2/rivetCore.c    (revision 728469)
+++ src/apache-2/rivetCore.c    (working copy)
@@ -584,6 +584,7 @@
        "type",
        "filename",
        "names",
+       "tempname",
        NULL
     };

@@ -595,25 +596,27 @@
        SIZE,
        TYPE,
        FILENAME,
-       NAMES
+       NAMES,
+       TEMPNAME
     };

     rivet_interp_globals *globals = Tcl_GetAssocData(interp, "rivet", 
NULL);
     command = Tcl_GetString(objv[1]);
     Tcl_GetIndexFromObj(interp, objv[1], SubCommand,
-                       "channel|save|data|exists|size|type|filename|names",
+                       "channel|save|data|exists|size|type|filename|names|
tempname",
                        0, &subcommandindex);

     /* If it's any of these, we need to find a specific name. */

     /* Excluded cases are EXISTS and NAMES. */
-    if ((enum subcommand)subcommandindex == CHANNEL ||
-       (enum subcommand)subcommandindex == SAVE ||
-       (enum subcommand)subcommandindex == DATA ||
-       (enum subcommand)subcommandindex == EXISTS ||
-       (enum subcommand)subcommandindex == SIZE ||
-       (enum subcommand)subcommandindex == TYPE ||
-       (enum subcommand)subcommandindex == FILENAME)
+    if ((enum subcommand)subcommandindex == CHANNEL    ||
+       (enum subcommand)subcommandindex == SAVE        ||
+       (enum subcommand)subcommandindex == DATA        ||
+       (enum subcommand)subcommandindex == EXISTS      ||
+       (enum subcommand)subcommandindex == SIZE        ||
+       (enum subcommand)subcommandindex == TYPE        ||
+       (enum subcommand)subcommandindex == FILENAME    ||
+       (enum subcommand)subcommandindex == TEMPNAME)
     {
        varname = Tcl_GetString(objv[2]);
        if ((enum subcommand)subcommandindex != EXISTS)
@@ -683,6 +686,9 @@
     case FILENAME:
        TclWeb_UploadFilename(result, globals->req);
        break;
+    case TEMPNAME:
+       TclWeb_UploadTempname(result,globals->req);
+       break;
     case NAMES:
        if (objc != 2)
        {
@@ -693,7 +699,7 @@
        break;
     default:
        Tcl_WrongNumArgs(interp, 1, objv,
-                        "channel|save ?name?|data|exists|size|type|
filename|names");
+                        "channel|save ?name?|data|exists|size|type|
filename|names|tempname");
     }
     Tcl_SetObjResult(interp, result);
     return TCL_OK;


-- Massimo


---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-dev-help@tcl.apache.org