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 mx...@apache.org on 2011/11/20 19:50:36 UTC

svn commit: r1204207 [1/2] - in /tcl/rivet/branches/rivet-namespace: ./ src/ src/apache-2/ tests/ tests/apachetest/ tests/docroot1/ tests/docroot2/

Author: mxmanghi
Date: Sun Nov 20 18:50:34 2011
New Revision: 1204207

URL: http://svn.apache.org/viewvc?rev=1204207&view=rev
Log:
2011-11-20 Massimo Manghi <mx...@apache.org>
    * src/rivet.h: Macro definition for Rivet command objects has rolled back to 
    its previous form and doesn't call Tcl_Export anymore. In case commands are
    exported by calling Tcl_Export in rivetCore.c and rivetPkgInit.c
    * tests/*: test suite reviewed for new tests

2011-11-16 Massimo Manghi <mx...@apache.org>
    * src/apache-2/rivetCore.c: code rationalization. namespace reference will not be
    passed to the RIVET_OBJ_COMMAND macro and commands are exported by calling Tcl_Export
    on the whole command set in ::rivet. The whole process is controlled by the macro
    symbol RIVET_NAMESPACE_EXPORT 
    * src/rivet.h: only one RIVET_OBJ_COMMAND macro exists now. Call to Rivet_WWWInit,
    Rivet_CryptInit and Rivet_ListInit haved changed. Rivet namespace pointer in not
    passed around anymore and it's handled only in rivetPkgInit.c
    * src/rivetPkgInit.c: 

2011-11-14 Massimo Manghi <mx...@apache.org>
    * configure.ac:  new switch --enable-rivet-commands-export to enable/disable 
    commands in ::rivet namespace


Added:
    tcl/rivet/branches/rivet-namespace/tests/docroot1/basic1.rvt
    tcl/rivet/branches/rivet-namespace/tests/docroot2/basic2.rvt
Modified:
    tcl/rivet/branches/rivet-namespace/ChangeLog
    tcl/rivet/branches/rivet-namespace/src/apache-2/mod_rivet.c
    tcl/rivet/branches/rivet-namespace/src/apache-2/rivetCore.c
    tcl/rivet/branches/rivet-namespace/src/rivet.h
    tcl/rivet/branches/rivet-namespace/src/rivetCrypt.c
    tcl/rivet/branches/rivet-namespace/src/rivetList.c
    tcl/rivet/branches/rivet-namespace/src/rivetPkgInit.c
    tcl/rivet/branches/rivet-namespace/src/rivetWWW.c
    tcl/rivet/branches/rivet-namespace/tests/apachetest/apachetest.tcl
    tcl/rivet/branches/rivet-namespace/tests/binary.rvt
    tcl/rivet/branches/rivet-namespace/tests/binary.test
    tcl/rivet/branches/rivet-namespace/tests/broken.rvt
    tcl/rivet/branches/rivet-namespace/tests/broken.test
    tcl/rivet/branches/rivet-namespace/tests/channel.rvt
    tcl/rivet/branches/rivet-namespace/tests/config.rvt
    tcl/rivet/branches/rivet-namespace/tests/config.test
    tcl/rivet/branches/rivet-namespace/tests/cookies.rvt
    tcl/rivet/branches/rivet-namespace/tests/docroot1/afterscript.tcl
    tcl/rivet/branches/rivet-namespace/tests/docroot1/beforescript.tcl
    tcl/rivet/branches/rivet-namespace/tests/docroot1/childinit.tcl
    tcl/rivet/branches/rivet-namespace/tests/docroot1/vhost1.rvt
    tcl/rivet/branches/rivet-namespace/tests/docroot2/afterscript.tcl
    tcl/rivet/branches/rivet-namespace/tests/docroot2/beforescript.tcl
    tcl/rivet/branches/rivet-namespace/tests/docroot2/vhost2.rvt
    tcl/rivet/branches/rivet-namespace/tests/env.rvt
    tcl/rivet/branches/rivet-namespace/tests/get.rvt
    tcl/rivet/branches/rivet-namespace/tests/get.test
    tcl/rivet/branches/rivet-namespace/tests/headers.rvt
    tcl/rivet/branches/rivet-namespace/tests/headers.test
    tcl/rivet/branches/rivet-namespace/tests/include.html
    tcl/rivet/branches/rivet-namespace/tests/include.rvt
    tcl/rivet/branches/rivet-namespace/tests/include.test
    tcl/rivet/branches/rivet-namespace/tests/lang.test
    tcl/rivet/branches/rivet-namespace/tests/makeurl.rvt
    tcl/rivet/branches/rivet-namespace/tests/makeurl.test
    tcl/rivet/branches/rivet-namespace/tests/parse.rvt
    tcl/rivet/branches/rivet-namespace/tests/post.rvt
    tcl/rivet/branches/rivet-namespace/tests/post.test
    tcl/rivet/branches/rivet-namespace/tests/rivet.test
    tcl/rivet/branches/rivet-namespace/tests/runtests.tcl
    tcl/rivet/branches/rivet-namespace/tests/upload.rvt
    tcl/rivet/branches/rivet-namespace/tests/uploadsave.rvt
    tcl/rivet/branches/rivet-namespace/tests/virtualhost.test

Modified: tcl/rivet/branches/rivet-namespace/ChangeLog
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/rivet-namespace/ChangeLog?rev=1204207&r1=1204206&r2=1204207&view=diff
==============================================================================
--- tcl/rivet/branches/rivet-namespace/ChangeLog (original)
+++ tcl/rivet/branches/rivet-namespace/ChangeLog Sun Nov 20 18:50:34 2011
@@ -1,3 +1,23 @@
+2011-11-20 Massimo Manghi <mx...@apache.org>
+    * src/rivet.h: Macro definition for Rivet command objects has rolled back to 
+    its previous form and doesn't call Tcl_Export anymore. In case commands are
+    exported by calling Tcl_Export in rivetCore.c and rivetPkgInit.c
+    * tests/*: test suite reviewed for new tests
+
+2011-11-16 Massimo Manghi <mx...@apache.org>
+    * src/apache-2/rivetCore.c: code rationalization. namespace reference will not be
+    passed to the RIVET_OBJ_COMMAND macro and commands are exported by calling Tcl_Export
+    on the whole command set in ::rivet. The whole process is controlled by the macro
+    symbol RIVET_NAMESPACE_EXPORT 
+    * src/rivet.h: only one RIVET_OBJ_COMMAND object exists now. Call to Rivet_WWWInit,
+    Rivet_CryptInit and Rivet_ListInit haved changed. Rivet namespace pointer in not
+    passed around anymore and it's handled only in rivetPkgInit.c
+    * src/rivetPkgInit.c: 
+
+2011-11-14 Massimo Manghi <mx...@apache.org>
+    * configure.ac:  new switch --enable-rivet-commands-export to enable/disable 
+    commands in ::rivet namespace
+
 2011-11-12 Massimo Manghi <mx...@apache.org>
     * src/apache-2/rivetCore.c: reindented to improve readability.
     * doc/xml/commands.xml: typo corrected

Modified: tcl/rivet/branches/rivet-namespace/src/apache-2/mod_rivet.c
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/rivet-namespace/src/apache-2/mod_rivet.c?rev=1204207&r1=1204206&r2=1204207&view=diff
==============================================================================
--- tcl/rivet/branches/rivet-namespace/src/apache-2/mod_rivet.c (original)
+++ tcl/rivet/branches/rivet-namespace/src/apache-2/mod_rivet.c Sun Nov 20 18:50:34 2011
@@ -381,9 +381,7 @@ Rivet_ExecuteAndCheck(Tcl_Interp *interp
             }
         }
 
-        Tcl_SetVar( interp, "errorOutbuf",
-                Tcl_GetStringFromObj( outbuf, NULL ),
-                TCL_GLOBAL_ONLY );
+        Tcl_SetVar( interp, "errorOutbuf",Tcl_GetStringFromObj( outbuf, NULL ),TCL_GLOBAL_ONLY );
 
         /* If we don't have an error script, use the default error handler. */
         if (conf->rivet_error_script ) {
@@ -515,7 +513,6 @@ Rivet_ParseExecFile(TclWebRequest *req, 
         if (toplevel) {
             if (rsc->rivet_before_script) {
                 Tcl_AppendObjToObj(outbuf,rsc->rivet_before_script);
-//              Tcl_NewStringObj(rsc->rivet_before_script, -1));
             }
         }
 
@@ -542,7 +539,6 @@ Rivet_ParseExecFile(TclWebRequest *req, 
         }
         if (toplevel) {
             if (rsc->rivet_after_script) {
-//              Tcl_AppendObjToObj(outbuf,Tcl_NewStringObj(rsc->rivet_after_script, -1));
                 Tcl_AppendObjToObj(outbuf,rsc->rivet_after_script);
             }
         }
@@ -599,8 +595,6 @@ Rivet_ParseExecFile(TclWebRequest *req, 
 static void
 Rivet_CleanupRequest( request_rec *r )
 {
-
-
 #if 0
     apr_table_t *t;
     apr_array_header_t *arr;
@@ -1701,6 +1695,7 @@ Rivet_InitTclStuff(server_rec *s, apr_po
  *-----------------------------------------------------------------------------
  */
 
+
 static void
 Rivet_ChildInit(apr_pool_t *pChild, server_rec *s)
 {
@@ -1713,6 +1708,11 @@ Rivet_ChildInit(apr_pool_t *pChild, serv
     apr_pool_cleanup_register (pChild, s, Rivet_ChildExit, Rivet_ChildExit);
 }
 
+
+//TODO: clarify whether rsc or rdc
+
+#define USE_APACHE_RSC
+
 /* Set things up to execute a file, then execute */
 static int
 Rivet_SendContent(request_rec *r)
@@ -1726,8 +1726,11 @@ Rivet_SendContent(request_rec *r)
     static Tcl_Obj  *request_cleanup = NULL;
 
     rivet_interp_globals *globals = NULL;
+#ifdef USE_APACHE_RSC
     rivet_server_conf    *rsc = NULL;
+#else
     rivet_server_conf    *rdc;
+#endif
 
     ctype = Rivet_CheckType(r);  
     if (ctype == CTYPE_NOT_HANDLED) {
@@ -1750,10 +1753,12 @@ Rivet_SendContent(request_rec *r)
 
     globals->req->charset = NULL;
 
+#ifndef USE_APACHE_RSC
     if (r->per_dir_config != NULL)
         rdc = RIVET_SERVER_CONF( r->per_dir_config );
     else
         rdc = rsc;
+#endif
 
     r->allowed |= (1 << M_GET);
     r->allowed |= (1 << M_POST);
@@ -1796,9 +1801,11 @@ Rivet_SendContent(request_rec *r)
         goto sendcleanup;
     }
 
-    //TODO: clarify whether rsc or rdc
-    //Rivet_PropagatePerDirConfArrays( interp, rdc );
+#ifdef USE_APACHE_RSC
     Rivet_PropagatePerDirConfArrays( interp, rsc );
+#else
+    Rivet_PropagatePerDirConfArrays( interp, rdc );
+#endif
 
     /* Initialize this the first time through and keep it around. */
     if (request_init == NULL) {

Modified: tcl/rivet/branches/rivet-namespace/src/apache-2/rivetCore.c
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/rivet-namespace/src/apache-2/rivetCore.c?rev=1204207&r1=1204206&r2=1204207&view=diff
==============================================================================
--- tcl/rivet/branches/rivet-namespace/src/apache-2/rivetCore.c (original)
+++ tcl/rivet/branches/rivet-namespace/src/apache-2/rivetCore.c Sun Nov 20 18:50:34 2011
@@ -54,10 +54,6 @@
 extern module rivet_module;
 extern char* TclWeb_GetRawPost (TclWebRequest *req);
 
-/* declarations for commands in rivetWWW.c */
-
-EXTERN int Rivet_InitWWW( Tcl_Interp *interp, Tcl_Namespace* ns);
-
 #define POOL (globals->r->pool)
 
 /*
@@ -1399,33 +1395,39 @@ TestpanicCmd(dummy, interp, argc, argv)
 int
 Rivet_InitCore( Tcl_Interp *interp )
 {
+#if RIVET_NAMESPACE_EXPORT == 1
     rivet_interp_globals *globals = NULL;
     Tcl_Namespace *rivet_ns;
 
     globals = Tcl_GetAssocData(interp, "rivet", NULL);
     rivet_ns = globals->rivet_ns;
+#endif
 
-    RIVET_OBJ_CMD ("makeurl",Rivet_MakeURL,rivet_ns);
-    RIVET_OBJ_CMD ("headers",Rivet_Headers,rivet_ns);
-    RIVET_OBJ_CMD ("load_env",Rivet_LoadEnv,rivet_ns);
-    RIVET_OBJ_CMD ("load_headers",Rivet_LoadHeaders,rivet_ns);
-    RIVET_OBJ_CMD ("var",Rivet_Var,rivet_ns);
-    RIVET_OBJ_CMD ("abort_page",Rivet_AbortPageCmd,rivet_ns);
-    RIVET_OBJ_CMD ("abort_code", Rivet_AbortCodeCmd,rivet_ns);
-    RIVET_OBJ_CMD ("virtual_filename",Rivet_VirtualFilenameCmd,rivet_ns);
-    RIVET_OBJ_CMD ("apache_table",Rivet_ApacheTable,rivet_ns);
-    RIVET_OBJ_CMD ("var_qs",Rivet_Var,rivet_ns);
-    RIVET_OBJ_CMD ("var_post",Rivet_Var,rivet_ns);
-    RIVET_OBJ_CMD ("raw_post",Rivet_RawPost,rivet_ns);
-    RIVET_OBJ_CMD ("upload",Rivet_Upload,rivet_ns);
-    RIVET_OBJ_CMD ("include",Rivet_Include,rivet_ns);
-    RIVET_OBJ_CMD ("parse",Rivet_Parse,rivet_ns);
-    RIVET_OBJ_CMD ("no_body",Rivet_NoBody,rivet_ns);
-    RIVET_OBJ_CMD ("env",Rivet_EnvCmd,rivet_ns);
-    RIVET_OBJ_CMD ("apache_log_error",Rivet_LogErrorCmd,rivet_ns);
+    RIVET_OBJ_CMD ("makeurl",Rivet_MakeURL);
+    RIVET_OBJ_CMD ("headers",Rivet_Headers);
+    RIVET_OBJ_CMD ("load_env",Rivet_LoadEnv);
+    RIVET_OBJ_CMD ("load_headers",Rivet_LoadHeaders);
+    RIVET_OBJ_CMD ("var",Rivet_Var);
+    RIVET_OBJ_CMD ("abort_page",Rivet_AbortPageCmd);
+    RIVET_OBJ_CMD ("abort_code", Rivet_AbortCodeCmd);
+    RIVET_OBJ_CMD ("virtual_filename",Rivet_VirtualFilenameCmd);
+    RIVET_OBJ_CMD ("apache_table",Rivet_ApacheTable);
+    RIVET_OBJ_CMD ("var_qs",Rivet_Var);
+    RIVET_OBJ_CMD ("var_post",Rivet_Var);
+    RIVET_OBJ_CMD ("raw_post",Rivet_RawPost);
+    RIVET_OBJ_CMD ("upload",Rivet_Upload);
+    RIVET_OBJ_CMD ("include",Rivet_Include);
+    RIVET_OBJ_CMD ("parse",Rivet_Parse);
+    RIVET_OBJ_CMD ("no_body",Rivet_NoBody);
+    RIVET_OBJ_CMD ("env",Rivet_EnvCmd);
+    RIVET_OBJ_CMD ("apache_log_error",Rivet_LogErrorCmd);
 
 #ifdef TESTPANIC
-    RIVET_OBJ_CMD ("testpanic",TestpanicCmd,rivet_ns);
+    RIVET_OBJ_CMD ("testpanic",TestpanicCmd);
+#endif
+
+#if RIVET_NAMESPACE_EXPORT == 1
+    Tcl_Export(interp,rivet_ns,"*",0);
 #endif
 
 //  return Tcl_PkgProvide( interp,RIVET_TCL_PACKAGE,"1.2");

Modified: tcl/rivet/branches/rivet-namespace/src/rivet.h
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/rivet-namespace/src/rivet.h?rev=1204207&r1=1204206&r2=1204207&view=diff
==============================================================================
--- tcl/rivet/branches/rivet-namespace/src/rivet.h (original)
+++ tcl/rivet/branches/rivet-namespace/src/rivet.h Sun Nov 20 18:50:34 2011
@@ -47,29 +47,15 @@ Tcl_CreateObjCommand( interp, /* Tcl int
  * created somewhere before the macro is called. 
  */
 
-#if RIVET_NAMESPACE_EXPORT == 1
-
-#define RIVET_OBJ_CMD(name,func,ns) \
-Tcl_CreateObjCommand( interp, /* Tcl interpreter */\
-		      RIVET_NS "::" name,   /* Function name in Tcl */\
-		      func,   /* C function name */\
-		      NULL,   /* Client Data */\
-		      (Tcl_CmdDeleteProc *)NULL /* Tcl Delete Prov */); \
-Tcl_Export(interp,ns,name,0);
-
-#else
-
-#define RIVET_OBJ_CMD(name,func,ns) \
+#define RIVET_OBJ_CMD(name,func) \
 Tcl_CreateObjCommand( interp, /* Tcl interpreter */\
 		      RIVET_NS "::" name,   /* Function name in Tcl */\
 		      func,   /* C function name */\
 		      NULL,   /* Client Data */\
 		      (Tcl_CmdDeleteProc *)NULL /* Tcl Delete Prov */); 
 
-#endif
-
-EXTERN int Rivet_Init( Tcl_Interp *interp );
-EXTERN int Rivet_InitList( Tcl_Interp *interp, Tcl_Namespace* ns);
-EXTERN int Rivet_InitCrypt( Tcl_Interp *interp, Tcl_Namespace* ns);
-EXTERN int Rivet_InitWWW( Tcl_Interp *interp, Tcl_Namespace* ns);
-EXTERN int Rivet_InitCore( Tcl_Interp *interp); 
+EXTERN int Rivet_Init(Tcl_Interp *interp);
+EXTERN int Rivet_InitList(Tcl_Interp *interp);
+EXTERN int Rivet_InitCrypt(Tcl_Interp *interp);
+EXTERN int Rivet_InitWWW(Tcl_Interp *interp);
+EXTERN int Rivet_InitCore(Tcl_Interp *interp); 

Modified: tcl/rivet/branches/rivet-namespace/src/rivetCrypt.c
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/rivet-namespace/src/rivetCrypt.c?rev=1204207&r1=1204206&r2=1204207&view=diff
==============================================================================
--- tcl/rivet/branches/rivet-namespace/src/rivetCrypt.c (original)
+++ tcl/rivet/branches/rivet-namespace/src/rivetCrypt.c Sun Nov 20 18:50:34 2011
@@ -8,7 +8,7 @@
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at
 
-   	http://www.apache.org/licenses/LICENSE-2.0
+    http://www.apache.org/licenses/LICENSE-2.0
 
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
@@ -45,19 +45,19 @@ Rivet_Crypt(char *string, const char *ke
 
     while (*string != '\0')
     {
-	if (*string >= 32 && *string <= 126)
-	{
-	    if (mode)
-		*string = (((*string - 32) + (*kp - 32)) % 94) + 32;
-	    else
-		*string = (((*string - 32) - (*kp - 32) + 94) % 94) + 32;
-	}
-
-	string++;
-	kp++;
-	if (*kp == '\0') {
-	    kp = key;
-	}
+        if (*string >= 32 && *string <= 126)
+        {
+            if (mode)
+                *string = (((*string - 32) + (*kp - 32)) % 94) + 32;
+            else
+                *string = (((*string - 32) - (*kp - 32) + 94) % 94) + 32;
+        }
+
+        string++;
+        kp++;
+        if (*kp == '\0') {
+            kp = key;
+        }
     }
 }
 
@@ -69,7 +69,7 @@ TCL_CMD_HEADER( Rivet_EncryptCmd )
     int keyIndex;
 
     if( objc < 3 ) {
-	Tcl_WrongNumArgs( interp, 1, objv, "data key" );
+        Tcl_WrongNumArgs( interp, 1, objv, "data key" );
         return TCL_ERROR;
     }
 
@@ -80,7 +80,7 @@ TCL_CMD_HEADER( Rivet_EncryptCmd )
 
     for( keyIndex = 2; keyIndex < objc; keyIndex++ )
     {
-	key = Tcl_GetStringFromObj( objv[keyIndex], NULL );
+        key = Tcl_GetStringFromObj( objv[keyIndex], NULL );
         Rivet_Crypt( resultBuffer, key, 0L, MODE_ENCRYPT );
     }
 
@@ -97,7 +97,7 @@ TCL_CMD_HEADER( Rivet_DecryptCmd )
     int keyIndex;
 
     if( objc < 3 ) {
-	Tcl_WrongNumArgs( interp, 1, objv, "data key" );
+    Tcl_WrongNumArgs( interp, 1, objv, "data key" );
         return TCL_ERROR;
     }
 
@@ -108,7 +108,7 @@ TCL_CMD_HEADER( Rivet_DecryptCmd )
 
     for( keyIndex = 2; keyIndex < objc; keyIndex++ )
     {
-	key = Tcl_GetStringFromObj( objv[keyIndex], NULL );
+        key = Tcl_GetStringFromObj( objv[keyIndex], NULL );
         Rivet_Crypt( resultBuffer, key, 0L, MODE_DECRYPT );
     }
 
@@ -124,7 +124,7 @@ TCL_CMD_HEADER( Rivet_CryptCmd )
     const char *resultBuffer;
 
     if( objc != 3 ) {
-	Tcl_WrongNumArgs( interp, 1, objv, "key salt" );
+        Tcl_WrongNumArgs( interp, 1, objv, "key salt" );
         return TCL_ERROR;
     }
 
@@ -134,17 +134,16 @@ TCL_CMD_HEADER( Rivet_CryptCmd )
     resultBuffer = crypt((const char *)key, (const char *)salt);
 
     if( resultBuffer == NULL ) {
-	Tcl_AppendResult (interp,
-		"crypt function failed: ",
-		Tcl_GetStringFromObj(objv[1], NULL),
-		(char *)NULL );
-	return TCL_ERROR;
+        Tcl_AppendResult (interp,
+                            "crypt function failed: ",
+                            Tcl_GetStringFromObj(objv[1], NULL),
+                            (char *)NULL );
+        return TCL_ERROR;
     }
     Tcl_SetObjResult( interp, Tcl_NewStringObj( resultBuffer, -1 ) );
     return TCL_OK;
 #else /* ! crypt */
-    Tcl_SetObjResult(interp, 
-                     Tcl_NewStringObj("error: command not available", -1));
+    Tcl_SetObjResult(interp,Tcl_NewStringObj("error: command not available", -1));
     return TCL_ERROR;
 #endif /* ! crypt */
 }
@@ -162,10 +161,10 @@ TCL_CMD_HEADER( Rivet_CryptCmd )
  *-----------------------------------------------------------------------------
  */
 int
-Rivet_InitCrypt( Tcl_Interp *interp, Tcl_Namespace* rivet_ns )
+Rivet_InitCrypt( Tcl_Interp *interp)
 {
-    RIVET_OBJ_CMD( "encrypt", Rivet_EncryptCmd, rivet_ns);
-    RIVET_OBJ_CMD( "decrypt", Rivet_DecryptCmd, rivet_ns);
-    RIVET_OBJ_CMD( "crypt", Rivet_CryptCmd, rivet_ns);
+    RIVET_OBJ_CMD("encrypt", Rivet_EncryptCmd);
+    RIVET_OBJ_CMD("decrypt", Rivet_DecryptCmd);
+    RIVET_OBJ_CMD("crypt", Rivet_CryptCmd);
     return TCL_OK;
 }

Modified: tcl/rivet/branches/rivet-namespace/src/rivetList.c
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/rivet-namespace/src/rivetList.c?rev=1204207&r1=1204206&r2=1204207&view=diff
==============================================================================
--- tcl/rivet/branches/rivet-namespace/src/rivetList.c (original)
+++ tcl/rivet/branches/rivet-namespace/src/rivetList.c Sun Nov 20 18:50:34 2011
@@ -8,7 +8,7 @@
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at
 
-   	http://www.apache.org/licenses/LICENSE-2.0
+    http://www.apache.org/licenses/LICENSE-2.0
 
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
@@ -55,9 +55,9 @@ Rivet_LremoveObjCmd( clientData, interp,
     Tcl_Obj **listObjv, *matchedListPtr = NULL;
 
     if( objc < 3 ) {
-	Tcl_WrongNumArgs( interp, 1, objv,
-	    "?mode? ?-all? list ?pattern?.. ?pattern?..");
-	return TCL_ERROR;
+        Tcl_WrongNumArgs( interp, 1, objv,
+            "?mode? ?-all? list ?pattern?.. ?pattern?..");
+        return TCL_ERROR;
     }
 
     list = 1;
@@ -69,35 +69,35 @@ Rivet_LremoveObjCmd( clientData, interp,
      */
     for( i = 1; i < objc; ++i )
     {
-	modeStr = Tcl_GetStringFromObj(objv[i], NULL);
-	if( modeStr[0] != '-' ) break;
+        modeStr = Tcl_GetStringFromObj(objv[i], NULL);
+        if( modeStr[0] != '-' ) break;
 
-	if( STREQU(modeStr, "-exact") ) {
-	    mode = EXACT;
-	    list++;
-	} else if( STREQU(modeStr, "-glob") ) {
-	    mode = GLOB;
-	    list++;
-	} else if( STREQU(modeStr, "-regexp") ) {
-	    mode = REGEXP;
-	    list++;
-	} else if( STREQU(modeStr, "-all") ) {
-	    all = 1;
-	    list++;
-	} else if( STREQU(modeStr, "--") ) {
-	    list++;
-	    break;
-	} else {
-	    Tcl_AppendResult( interp, "bad switch \"", modeStr,
-				"\": must be -exact, -glob, -regexp or -all",
-				(char *)NULL);
-	    return TCL_ERROR;
-	}
+        if( STREQU(modeStr, "-exact") ) {
+            mode = EXACT;
+            list++;
+        } else if( STREQU(modeStr, "-glob") ) {
+            mode = GLOB;
+            list++;
+        } else if( STREQU(modeStr, "-regexp") ) {
+            mode = REGEXP;
+            list++;
+        } else if( STREQU(modeStr, "-all") ) {
+            all = 1;
+            list++;
+        } else if( STREQU(modeStr, "--") ) {
+            list++;
+            break;
+        } else {
+            Tcl_AppendResult( interp, "bad switch \"", modeStr,
+                    "\": must be -exact, -glob, -regexp or -all",
+                    (char *)NULL);
+            return TCL_ERROR;
+        }
     }
 
     if( list >= objc - 1 )  {
-	Tcl_WrongNumArgs(interp, 1, objv, "?mod? ?-all? list pattern");
-	return TCL_ERROR;
+        Tcl_WrongNumArgs(interp, 1, objv, "?mod? ?-all? list pattern");
+        return TCL_ERROR;
     }
 
     if( Tcl_ListObjGetElements(interp, objv[list],
@@ -108,80 +108,80 @@ Rivet_LremoveObjCmd( clientData, interp,
     for(i = 0; i < listObjc; i++)
     {
         match = 0;
-	value = Tcl_GetStringFromObj(listObjv[i], &valueLen);
+        value = Tcl_GetStringFromObj(listObjv[i], &valueLen);
+
+    /* We're done.  Append the rest of the elements and return */
+        if( done ) {
+            if (matchedListPtr == NULL) {
+                matchedListPtr = Tcl_NewListObj(0, NULL);
+            }
+            if (Tcl_ListObjAppendElement(interp, matchedListPtr,
+                         listObjv[i]) != TCL_OK) {
+                goto errorExit;
+            }
+            continue;
+        }
+
+        append = list + 1;
+        for( j = list + 1; j < objc; ++j )
+        {
+            pattern = Tcl_GetStringFromObj(objv[j], &patternLen);
+            if( (mode != EXACT) && (strlen(pattern) != (size_t)patternLen) ) {
+                goto binData;
+            }
+
+            switch(mode) {
+              case EXACT:
+                match = (valueLen == patternLen) &&
+                        (memcmp(value, pattern, (unsigned)valueLen) == 0);
+                break;
+
+              case GLOB:
+                if( strlen(value) != (size_t)valueLen ) {
+                    goto binData;
+                }
+                match = Tcl_StringMatch(value, pattern);
+                break;
+
+              case REGEXP:
+                if( strlen(value) != (size_t)valueLen ) {
+                    goto binData;
+                }
+                match = Tcl_RegExpMatch(interp, value, pattern);
+                if( match < 0 ) {
+                    goto errorExit;
+                }
+                break;
+            }
+            /* It's not in the pattern we're looking for.
+             * Check the next pattern.
+             */
+            if( !match ) {
+                append++;
+                continue;
+            }
+
+            /* We found a match, and we're not looking for anymore */
+            if( !all ) {
+                done = 1;
+                break;
+            }
+        }
+
+    /* We're done.  Append the rest of the elements and return */
+        if( done ) continue;
 
-	/* We're done.  Append the rest of the elements and return */
-	if( done ) {
-	    if (matchedListPtr == NULL) {
-		matchedListPtr = Tcl_NewListObj(0, NULL);
-	    }
-	    if (Tcl_ListObjAppendElement(interp, matchedListPtr,
-					 listObjv[i]) != TCL_OK) {
-		goto errorExit;
-	    }
-	    continue;
-	}
-
-	append = list + 1;
-	for( j = list + 1; j < objc; ++j )
-	{
-	    pattern = Tcl_GetStringFromObj(objv[j], &patternLen);
-	    if( (mode != EXACT) && (strlen(pattern) != (size_t)patternLen) ) {
-		goto binData;
-	    }
-
-	    switch(mode) {
-	      case EXACT:
-		match = (valueLen == patternLen) &&
-		    (memcmp(value, pattern, (unsigned)valueLen) == 0);
-		break;
-
-	      case GLOB:
-		if( strlen(value) != (size_t)valueLen ) {
-		    goto binData;
-		}
-		match = Tcl_StringMatch(value, pattern);
-		break;
-
-	      case REGEXP:
-		if( strlen(value) != (size_t)valueLen ) {
-		    goto binData;
-		}
-		match = Tcl_RegExpMatch(interp, value, pattern);
-		if( match < 0 ) {
-		    goto errorExit;
-		}
-		break;
-	    }
-	    /* It's not in the pattern we're looking for.
-	     * Check the next pattern.
-	     */
-	    if( !match ) {
-		append++;
-		continue;
-	    }
-
-	    /* We found a match, and we're not looking for anymore */
-	    if( !all ) {
-		done = 1;
-		break;
-	    }
-	}
-
-	/* We're done.  Append the rest of the elements and return */
-	if( done ) continue;
-
-	/* If append is equal to j, the value made it through all the patterns
-	 * without matching, so we append it to our return list.
-	 */
-	if( append == j ) {
-	    if (matchedListPtr == NULL) {
-		matchedListPtr = Tcl_NewListObj(0, NULL);
-	    }
-	    if (Tcl_ListObjAppendElement(interp, matchedListPtr,
-					 listObjv[i]) != TCL_OK)
-		goto errorExit;
-	}
+    /* If append is equal to j, the value made it through all the patterns
+     * without matching, so we append it to our return list.
+     */
+        if( append == j ) {
+            if (matchedListPtr == NULL) {
+                matchedListPtr = Tcl_NewListObj(0, NULL);
+            }
+            if (Tcl_ListObjAppendElement(interp, matchedListPtr,
+                         listObjv[i]) != TCL_OK)
+            goto errorExit;
+        }
     }
 
     if( matchedListPtr != NULL ) {
@@ -196,7 +196,7 @@ Rivet_LremoveObjCmd( clientData, interp,
 
   binData:
     Tcl_AppendResult(interp, "Binary data is not supported in this mode.",
-				(char *) NULL);
+                (char *) NULL);
     return TCL_ERROR;
 }
 
@@ -251,8 +251,8 @@ Rivet_CommaSplitObjCmd (notUsed, interp,
     int          quotePairsWithinStrings = 1;
 
     if( objc != 2 ) {
-	Tcl_WrongNumArgs( interp, 1, objv, "string" );
-	return TCL_ERROR;
+    Tcl_WrongNumArgs( interp, 1, objv, "string" );
+    return TCL_ERROR;
     }
 
     /* get access to a textual representation of the object */
@@ -267,113 +267,111 @@ Rivet_CommaSplitObjCmd (notUsed, interp,
     /* this loop walks through the comma-separated string we've been passed */
     while (1) {
 
-	/* grab the next character in the buffer */
+    /* grab the next character in the buffer */
         c = *next;
 
-	/* if we've got a quote at this point, it is at the start
-	 * of a field, scan to the closing quote, make that a field, 
-	 * and update */
-
-	if (c == '"') {
-	    next = ++first;
-	    while (1) {
-	        c = *next;
-		/*
-		 * if we're at the end, we've got an unterminated quoted string
-		 */
-	        if (c == '\0') goto format_error;
-
-                /*
-		 * If we get a double quote, first see if it's a pair of double 
-		 * quotes, i.e. a quoted quote, and handle that.
-		 */
-	        if (c == '"') {
-		    /* if consecutive pairs of quotes as quotes of quotes
-		     * is enabled and the following char is a double quote,
-		     * turn the pair into a single by zooming on down */
-		    if (quotequoteQuotesQuote && (*(next + 1) == '"')) {
-			next += 2;
-			continue;
-		    }
-
-		    /* If double quotes within strings is enabled and the
-		     * char following this quote is not a comma, scan forward
-		     * for a quote */
-		    if (quotePairsWithinStrings && (*(next + 1) != ',')) {
-			next++;
-			continue;
-		    }
-		    /* It's a solo double-quote, not a pair of double-quotes, 
-		     * so terminate the element
-		     * at the current quote (the closing quote).
-		     */
-		    Rivet_ListObjAppendString (interp,
-			      resultList, first, next - first);
-
-		    /* skip the closing quote that we overwrote, and the
-		     * following comma if there is one.
-		     */
-
-		    ++next;
-		    c = *next;
-
-		    /* 
-		     *if we get end-of-line here, it's fine... and we're done
-		     */
-
-		    if (c == '\0')
-			return TCL_OK;
+    /* if we've got a quote at this point, it is at the start
+     * of a field, scan to the closing quote, make that a field, 
+     * and update */
+
+        if (c == '"') {
+            next = ++first;
+            while (1) {
+                c = *next;
+            /*
+             * if we're at the end, we've got an unterminated quoted string
+             */
+                if (c == '\0') goto format_error;
 
                     /*
-		     * It's not end-of-line.  If the next character is
-		     * not a comma, it's an error.
-		     */
-		    if (c != ',') {
-		      format_error:
-			Tcl_ResetResult (interp);
-			Tcl_AppendResult (interp,
-					  "format error in string: \"", 
-					   first, "\"", (char *) NULL);
-			return TCL_ERROR;
-		    }
-
-		    /* We're done with that field.  The next one starts one
-		     * character past the current one, which is (was) a
-		     * comma */
-		    first = ++next;
-		    break;
-		}
-		/* It wasn't a quote, look at the next character. */
-		next++;
-	    }
-	    continue;
-	}
-
-	/* If we get here, we're at the start of a field that didn't
-	 * start with a quote */
-	next = first;
-	while (1) {
-	    c = *next;
-
-            /* If we reach end of the string, append the last element
-	     * and return to our caller. */
-	    if (c == '\0') {
-		Rivet_ListObjAppendString (interp, resultList, first, -1);
-		return TCL_OK;
-	    }
-
-            /* If we get a comma, that's the end of this piece,
-	     * stick it into the list.
-	     */
-	    if (c == ',') {
-		Rivet_ListObjAppendString (interp,
-			  resultList,
-			  first, next - first);
-		first = ++next;
-		break;
-	    }
-	    next++;
-	}
+             * If we get a double quote, first see if it's a pair of double 
+             * quotes, i.e. a quoted quote, and handle that.
+             */
+                if (c == '"') {
+                /* if consecutive pairs of quotes as quotes of quotes
+                 * is enabled and the following char is a double quote,
+                 * turn the pair into a single by zooming on down */
+                    if (quotequoteQuotesQuote && (*(next + 1) == '"')) {
+                        next += 2;
+                        continue;
+                    }
+
+                /* If double quotes within strings is enabled and the
+                 * char following this quote is not a comma, scan forward
+                 * for a quote */
+                    if (quotePairsWithinStrings && (*(next + 1) != ',')) {
+                        next++;
+                        continue;
+                    }
+                /* It's a solo double-quote, not a pair of double-quotes, 
+                 * so terminate the element
+                 * at the current quote (the closing quote).
+                 */
+                    Rivet_ListObjAppendString (interp,resultList, first, next - first);
+
+                /* skip the closing quote that we overwrote, and the
+                 * following comma if there is one.
+                 */
+
+                    ++next;
+                    c = *next;
+
+                /* 
+                 *if we get end-of-line here, it's fine... and we're done
+                 */
+
+                    if (c == '\0') return TCL_OK;
+
+                        /*
+                 * It's not end-of-line.  If the next character is
+                 * not a comma, it's an error.
+                 */
+                    if (c != ',') {
+                      format_error:
+                        Tcl_ResetResult (interp);
+                        Tcl_AppendResult (interp,
+                                  "format error in string: \"", 
+                                   first, "\"", (char *) NULL);
+                        return TCL_ERROR;
+                    }
+
+                /* We're done with that field.  The next one starts one
+                 * character past the current one, which is (was) a
+                 * comma */
+                    first = ++next;
+                    break;
+                }
+            /* It wasn't a quote, look at the next character. */
+                next++;
+            }
+            continue;
+        }
+
+    /* If we get here, we're at the start of a field that didn't
+     * start with a quote */
+        next = first;
+        while (1) {
+            c = *next;
+
+                /* If we reach end of the string, append the last element
+             * and return to our caller. */
+            if (c == '\0') {
+                Rivet_ListObjAppendString (interp, resultList, first, -1);
+                return TCL_OK;
+            }
+
+                /* If we get a comma, that's the end of this piece,
+             * stick it into the list.
+             */
+            if (c == ',') {
+                Rivet_ListObjAppendString (interp,
+                      resultList,
+                      first, next - first);
+                first = ++next;
+                break;
+            }
+            next++;
+        }
     }
     Rivet_ListObjAppendString (interp, resultList, first, -1);
     return TCL_OK;
@@ -412,54 +410,54 @@ Rivet_CommaJoinObjCmd (notUsed, interp, 
     int         stringLength;
 
     if( objc != 2 ) {
-	Tcl_WrongNumArgs( interp, 1, objv,
-			"list arrayName elementName ?elementName..?" );
+    Tcl_WrongNumArgs( interp, 1, objv,
+            "list arrayName elementName ?elementName..?" );
         return TCL_ERROR;
     }
 
     resultPtr = Tcl_GetObjResult (interp);
 
     if (Tcl_ListObjGetElements  (interp, 
-				 objv[1], 
-				 &listObjc, 
-				 &listObjv) != TCL_OK) {
-	return TCL_ERROR;
+                 objv[1], 
+                 &listObjc, 
+                 &listObjv) != TCL_OK) {
+        return TCL_ERROR;
     }
 
     didField = 0;
     for (listIdx = 0; listIdx < listObjc; listIdx++) {
-	/* If it's the first thing we've output, start it out
-	 * with a double quote.  If not, terminate the last
-	 * element with a double quote, then put out a comma,
-	 * then open the next element with a double quote
-	 */
-	if (didField) {
-	    Tcl_AppendToObj (resultPtr, "\",\"", 3);
-	} else {
-	    Tcl_AppendToObj (resultPtr, "\"", 1);
-	    didField = 1;
-	}
-	walkPtr = strPtr  = Tcl_GetStringFromObj (listObjv[listIdx], &stringLength);
-	/* Walk the string of the list element that we're about to
-	 * append to the result object.
-	 *
-	 * For each character, if it isn't a double quote, move on to
-	 * the next character until the string is exhausted.
-	 */
-	for (;stringLength; stringLength--) {
-	    if (*walkPtr++ != '"') continue;
-
-	    /* OK, we saw a double quote.  Emit everything up to and
-	     * including the double quote, then reset the string to
-	     * start at the same double quote (to issue it twice and
-	     * pick up where we left off.  Be sure to get the length
-	     * calculations right!
-	     */
-
-	     Tcl_AppendToObj (resultPtr, strPtr, walkPtr - strPtr);
-	     strPtr = walkPtr - 1;
-	}
-	Tcl_AppendToObj (resultPtr, strPtr, walkPtr - strPtr);
+        /* If it's the first thing we've output, start it out
+         * with a double quote.  If not, terminate the last
+         * element with a double quote, then put out a comma,
+         * then open the next element with a double quote
+         */
+        if (didField) {
+            Tcl_AppendToObj (resultPtr, "\",\"", 3);
+        } else {
+            Tcl_AppendToObj (resultPtr, "\"", 1);
+            didField = 1;
+        }
+        walkPtr = strPtr  = Tcl_GetStringFromObj (listObjv[listIdx], &stringLength);
+        /* Walk the string of the list element that we're about to
+         * append to the result object.
+         *
+         * For each character, if it isn't a double quote, move on to
+         * the next character until the string is exhausted.
+         */
+        for (;stringLength; stringLength--) {
+            if (*walkPtr++ != '"') continue;
+
+            /* OK, we saw a double quote.  Emit everything up to and
+             * including the double quote, then reset the string to
+             * start at the same double quote (to issue it twice and
+             * pick up where we left off.  Be sure to get the length
+             * calculations right!
+             */
+
+             Tcl_AppendToObj (resultPtr, strPtr, walkPtr - strPtr);
+             strPtr = walkPtr - 1;
+        }
+        Tcl_AppendToObj (resultPtr, strPtr, walkPtr - strPtr);
     }
     Tcl_AppendToObj (resultPtr, "\"", 1);
     return TCL_OK;
@@ -480,13 +478,13 @@ Rivet_CommaJoinObjCmd (notUsed, interp, 
  */
 TCL_CMD_HEADER( Rivet_LassignArrayObjCmd )
 {
-    int	    listObjc, listIdx, idx;
+    int     listObjc, listIdx, idx;
     Tcl_Obj **listObjv;
     Tcl_Obj *varValue;
 
     if( objc < 4 ) {
-	Tcl_WrongNumArgs( interp, 1, objv,
-			"list arrayName elementName ?elementName..?");
+    Tcl_WrongNumArgs( interp, 1, objv,
+            "list arrayName elementName ?elementName..?");
         return TCL_ERROR;
     }
 
@@ -495,27 +493,27 @@ TCL_CMD_HEADER( Rivet_LassignArrayObjCmd
         return TCL_ERROR;
 
     for (idx = 3, listIdx = 0; idx < objc; idx++, listIdx++) {
-	varValue = (listIdx < listObjc) ?
-		listObjv[listIdx] : Tcl_NewStringObj("", -1);
+    varValue = (listIdx < listObjc) ?
+        listObjv[listIdx] : Tcl_NewStringObj("", -1);
 
-	if( Tcl_ObjSetVar2( interp, objv[2], objv[idx],
-				varValue, TCL_LEAVE_ERR_MSG ) == NULL ) {
-	    return TCL_ERROR;
+    if( Tcl_ObjSetVar2( interp, objv[2], objv[idx],
+                varValue, TCL_LEAVE_ERR_MSG ) == NULL ) {
+        return TCL_ERROR;
         }
     }
 
     /* We have some left over items.  Return them in a list. */
     if( listIdx < listObjc ) {
-	Tcl_Obj *list = Tcl_NewListObj( 0, NULL );
-	int i;
+    Tcl_Obj *list = Tcl_NewListObj( 0, NULL );
+    int i;
 
-	for( i = listIdx; i < listObjc; ++i )
-	{
-	    if (Tcl_ListObjAppendElement(interp, list, listObjv[i]) != TCL_OK) {
-		return TCL_ERROR;
-	    }
-	}
-	Tcl_SetObjResult( interp, list );
+    for( i = listIdx; i < listObjc; ++i )
+    {
+        if (Tcl_ListObjAppendElement(interp, list, listObjv[i]) != TCL_OK) {
+        return TCL_ERROR;
+        }
+    }
+    Tcl_SetObjResult( interp, list );
     }
     return TCL_OK;
 }
@@ -536,12 +534,12 @@ TCL_CMD_HEADER( Rivet_LassignArrayObjCmd
  */
 
 int 
-Rivet_InitList( Tcl_Interp *interp, Tcl_Namespace* rivet_ns)
+Rivet_InitList( Tcl_Interp *interp)
 {
-    RIVET_OBJ_CMD( "lremove", Rivet_LremoveObjCmd ,rivet_ns);
-    RIVET_OBJ_CMD( "comma_split", Rivet_CommaSplitObjCmd ,rivet_ns);
-    RIVET_OBJ_CMD( "comma_join", Rivet_CommaJoinObjCmd ,rivet_ns);
-    RIVET_OBJ_CMD( "lassign_array", Rivet_LassignArrayObjCmd ,rivet_ns);
+    RIVET_OBJ_CMD("lremove",Rivet_LremoveObjCmd);
+    RIVET_OBJ_CMD("comma_split",Rivet_CommaSplitObjCmd);
+    RIVET_OBJ_CMD("comma_join",Rivet_CommaJoinObjCmd);
+    RIVET_OBJ_CMD("lassign_array",Rivet_LassignArrayObjCmd);
 
     return TCL_OK;
 }

Modified: tcl/rivet/branches/rivet-namespace/src/rivetPkgInit.c
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/rivet-namespace/src/rivetPkgInit.c?rev=1204207&r1=1204206&r2=1204207&view=diff
==============================================================================
--- tcl/rivet/branches/rivet-namespace/src/rivetPkgInit.c (original)
+++ tcl/rivet/branches/rivet-namespace/src/rivetPkgInit.c Sun Nov 20 18:50:34 2011
@@ -26,7 +26,6 @@
 #include "rivet.h"
 #include "mod_rivet.h"
 
-
 /*-----------------------------------------------------------------------------
  * Rivet_GetNamespace --
  *
@@ -48,6 +47,8 @@
  *-----------------------------------------------------------------------------
  */
 
+#if RIVET_NAMESPACE_EXPORT == 1
+
 static Tcl_Namespace* 
 Rivet_GetNamespace( Tcl_Interp* interp)
 {
@@ -67,8 +68,8 @@ Rivet_GetNamespace( Tcl_Interp* interp)
 
     return rivet_ns;
 }
+#endif
 
-
 /*-----------------------------------------------------------------------------
  * Rivetlib_Init --
  *
@@ -83,7 +84,9 @@ Rivet_GetNamespace( Tcl_Interp* interp)
 int
 Rivetlib_Init( Tcl_Interp *interp )
 {
-    Tcl_Namespace *rivet_ns = NULL; 
+#if RIVET_NAMESPACE_EXPORT == 1
+    Tcl_Namespace *rivet_ns = Rivet_GetNamespace(interp);; 
+#endif
 
 #ifdef USE_TCL_STUBS
     if (Tcl_InitStubs(interp, "8.5", 0) == NULL) { 
@@ -93,11 +96,13 @@ Rivetlib_Init( Tcl_Interp *interp )
 	    return TCL_ERROR;
     }
 
-    rivet_ns = Rivet_GetNamespace(interp);
-
-    Rivet_InitList ( interp, rivet_ns );
-    Rivet_InitCrypt( interp, rivet_ns );
-    Rivet_InitWWW  ( interp, rivet_ns );
+    Rivet_InitList (interp);
+    Rivet_InitCrypt(interp);
+    Rivet_InitWWW  (interp);
+
+#if RIVET_NAMESPACE_EXPORT == 1
+    Tcl_Export(interp,rivet_ns,"*",0);
+#endif
     return Tcl_PkgProvide( interp, RIVETLIB_TCL_PACKAGE, "1.2" );
 }
 
@@ -117,7 +122,9 @@ Rivetlib_Init( Tcl_Interp *interp )
 int
 Rivetlib_SafeInit( Tcl_Interp *interp )
 {
-    Tcl_Namespace *rivet_ns = NULL; 
+#if RIVET_NAMESPACE_EXPORT == 1
+    Tcl_Namespace *rivet_ns = Rivet_GetNamespace(interp);
+#endif
 
 #ifdef USE_TCL_STUBS
     if (Tcl_InitStubs(interp, "8.5", 0) == NULL) { 
@@ -127,11 +134,13 @@ Rivetlib_SafeInit( Tcl_Interp *interp )
 	    return TCL_ERROR;
     }
 
-    rivet_ns = Rivet_GetNamespace(interp);
-
-    Rivet_InitList( interp, rivet_ns );
-    Rivet_InitCrypt( interp, rivet_ns );
-    Rivet_InitWWW( interp, rivet_ns );
+    Rivet_InitList(interp);
+    Rivet_InitCrypt(interp);
+    Rivet_InitWWW(interp);
+
+#if RIVET_NAMESPACE_EXPORT == 1
+    Tcl_Export(interp,rivet_ns,"*",0);
+#endif
     return Tcl_PkgProvide( interp, RIVETLIB_TCL_PACKAGE, "1.2" );
 }
 

Modified: tcl/rivet/branches/rivet-namespace/src/rivetWWW.c
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/rivet-namespace/src/rivetWWW.c?rev=1204207&r1=1204206&r2=1204207&view=diff
==============================================================================
--- tcl/rivet/branches/rivet-namespace/src/rivetWWW.c (original)
+++ tcl/rivet/branches/rivet-namespace/src/rivetWWW.c Sun Nov 20 18:50:34 2011
@@ -352,11 +352,11 @@ TCL_CMD_HEADER( Rivet_EscapeShellCommand
  */
 
 int 
-Rivet_InitWWW( Tcl_Interp *interp, Tcl_Namespace* rivet_ns)
+Rivet_InitWWW( Tcl_Interp *interp)
 {
-    RIVET_OBJ_CMD ("unescape_string",Rivet_UnescapeStringCmd,rivet_ns);
-    RIVET_OBJ_CMD ("escape_string",Rivet_EscapeStringCmd,rivet_ns);
-    RIVET_OBJ_CMD ("escape_sgml_chars",Rivet_EscapeSgmlCharsCmd,rivet_ns);
-    RIVET_OBJ_CMD ("escape_shell_command",Rivet_EscapeShellCommandCmd,rivet_ns);
+    RIVET_OBJ_CMD ("unescape_string",Rivet_UnescapeStringCmd);
+    RIVET_OBJ_CMD ("escape_string",Rivet_EscapeStringCmd);
+    RIVET_OBJ_CMD ("escape_sgml_chars",Rivet_EscapeSgmlCharsCmd);
+    RIVET_OBJ_CMD ("escape_shell_command",Rivet_EscapeShellCommandCmd);
     return TCL_OK;
 }

Modified: tcl/rivet/branches/rivet-namespace/tests/apachetest/apachetest.tcl
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/rivet-namespace/tests/apachetest/apachetest.tcl?rev=1204207&r1=1204206&r2=1204207&view=diff
==============================================================================
--- tcl/rivet/branches/rivet-namespace/tests/apachetest/apachetest.tcl (original)
+++ tcl/rivet/branches/rivet-namespace/tests/apachetest/apachetest.tcl Sun Nov 20 18:50:34 2011
@@ -30,7 +30,7 @@ source [file join [file dirname [info sc
 
 namespace eval apachetest {
 
-    set debug 0
+    set debug 1
 
     # name of the apache binary, such as /usr/sbin/httpd
     variable binname ""
@@ -80,13 +80,13 @@ proc apachetest::connect { } {
     set diff 0
     # We try for 10 seconds.
     while { $diff < 10 } {
-	if { ! [catch {
-	    set sk [socket localhost 8081]
-	} err]} {
-	    close $sk
-	    return
-	}
-	set diff [expr {[clock seconds] - $starttime}]
+        if { ! [catch {
+            set sk [socket localhost 8081]
+        } err]} {
+            close $sk
+            return
+        }
+        set diff [expr {[clock seconds] - $starttime}]
     }
 }
 
@@ -133,10 +133,9 @@ proc apachetest::start { options conftex
     if { $debug > 0 } {
 	    puts "Apache started as PID $serverpid"
     }
-    if { [catch {
-	uplevel $code
-    } err] } {
-    }
+
+    if { [catch { uplevel $code } err] } { }
+
     # Kill and wait are the only reasons we need TclX.
     # apache2 binary started with -X reacts to SIGQUIT and ignores TERM
     kill QUIT $serverpid 
@@ -153,14 +152,14 @@ proc apachetest::start { options conftex
 proc apachetest::startserver { args } {
     variable binname
     variable debug
+
     if { [catch {
-	if { $debug } {
-	    puts "$binname -X -f [file join [pwd] server.conf] [concat $args]"
-	}
-	set serverpid [eval exec $binname -X -f \
-			   "[file join [pwd] server.conf]" [concat $args]]
+        if { $debug } {
+            puts "$binname -X -f [file join [pwd] server.conf] [concat $args]"
+        }
+        set serverpid [eval exec $binname -X -f "[file join [pwd] server.conf]" [concat $args]]
     } err] } {
-	puts "$err"
+        puts "$err"
     }
 }
 
@@ -169,9 +168,10 @@ proc apachetest::startserver { args } {
 
 proc apachetest::getbinname { argv } {
     variable binname
+
     set binname [lindex $argv 0]
     if { $binname == "" || ! [file executable $binname] } {
-	error "Please supply the full name and path of the Apache executable on the command line."
+	    error "Please supply the full name and path of the Apache executable on the command line."
     }
     return $binname
 }
@@ -182,6 +182,7 @@ proc apachetest::getbinname { argv } {
 
 proc apachetest::getcompiledin { binname } {
     variable module_assoc
+
     set bin [open [list | "$binname" -l] r]
     set compiledin [read $bin]
     close $bin
@@ -189,17 +190,17 @@ proc apachetest::getcompiledin { binname
     set compiledin [list]
     set mod_so_present 0
     foreach entry $modlist {
-	if { [regexp {(.*)\.c$} $entry match modname] } {
-	    if { $modname == "mod_so" } {
-		set mod_so_present 1
-	    }
-	    if { [info exists module_assoc($modname)] } {
-		lappend compiledin $module_assoc($modname)
-	    }
-	}
+        if { [regexp {(.*)\.c$} $entry match modname] } {
+            if { $modname == "mod_so" } {
+                set mod_so_present 1
+            }
+            if { [info exists module_assoc($modname)] } {
+                lappend compiledin $module_assoc($modname)
+            }
+        }
     }
     if { $mod_so_present == 0 } {
-	error "We need mod_so in Apache to run these tests"
+        error "We need mod_so in Apache to run these tests"
     }
     return $compiledin
 }
@@ -211,15 +212,19 @@ proc apachetest::gethttpdconf { binname 
     set options [read $bin]
     close $bin
     regexp {SERVER_CONFIG_FILE="(.*?)"} "$options" match filename
+
     if { ! [file exists $filename] } {
-	# see if we can find something by combining HTTP_ROOT + SERVER_CONFIG_FILE
-	regexp {HTTPD_ROOT="(.*?)"} "$options" match httpdroot
-	set completename [file join $httpdroot $filename]
-	if { ! [file exists $completename] } {
-	    error "neither '$filename' or '$completename' exists"
-	}
-	return $completename
+
+# see if we can find something by combining HTTP_ROOT + SERVER_CONFIG_FILE
+
+        regexp {HTTPD_ROOT="(.*?)"} "$options" match httpdroot
+        set completename [file join $httpdroot $filename]
+        if { ! [file exists $completename] } {
+            error "neither '$filename' or '$completename' exists"
+        }
+        return $completename
     }
+
     return $filename
 }
 
@@ -238,7 +243,7 @@ proc apachetest::gethttpdconf { binname 
 #	Text of configuration files.
 
 proc apachetest::getallincludes { conffile } {
-    if [file  exists $conffile] {
+    if [file exists $conffile] {
 	    set fl [open $conffile r]
 	    set data [read $fl]
 	    close $fl
@@ -246,41 +251,41 @@ proc apachetest::getallincludes { conffi
 	    set newdata {}
 	    foreach line [split $data \n] {
 		# Look for Include lines.
-		if { [regexp -line {^[^\#]*Include +(.*)} $line match file] } {
-		    puts "including files from $file"
-		    set file [string trim $file]
-
-		    # Include directives accept as argument a file, a directory
-		    # or a glob-style file matching pattern. Patterns usually match
-		    # many files, but are not directories, so we have to handle 
-		    # all these 3 cases
-
-		    # we use the glob command to tell whether we are dealing with
-		    # a pure file expression or a matching pattern
-
-		    set matched_files [glob -nocomplain $file]
-		    set matched_files_n [llength $matched_files]
-		    if {$matched_files_n > 1} {
-			foreach fl $matched_files {
-			    puts "including $fl"
-			    if [file  exists $fl] {
-				    append newdata [getallincludes $fl]
-			    }
-			}
-		    } elseif {$matched_files_n == 1} {
-			set file $matched_files
-			if { [file isdirectory $file] } {
-			    foreach fl [glob -nocomplain [file join $file *]] {
-				puts "including $fl"
-				if [file  exists $fl] {
-					append newdata [getallincludes $fl]
-				}
-			    }
-			} else {
-			    append newdata [getallincludes $file]
-			}
-		    }
-		}
+            if { [regexp -line {^[^\#]*Include +(.*)} $line match file] } {
+                puts "including files from $file"
+                set file [string trim $file]
+
+                # Include directives accept as argument a file, a directory
+                # or a glob-style file matching pattern. Patterns usually match
+                # many files, but are not directories, so we have to handle 
+                # all these 3 cases
+
+                # we use the glob command to tell whether we are dealing with
+                # a pure file expression or a matching pattern
+
+                set matched_files [glob -nocomplain $file]
+                set matched_files_n [llength $matched_files]
+                if {$matched_files_n > 1} {
+                    foreach fl $matched_files {
+                        puts "including $fl"
+                        if [file  exists $fl] {
+                            append newdata [getallincludes $fl]
+                        }
+                    }
+                } elseif {$matched_files_n == 1} {
+                    set file $matched_files
+                    if { [file isdirectory $file] } {
+                        foreach fl [glob -nocomplain [file join $file *]] {
+                            puts "including $fl"
+                            if [file  exists $fl] {
+                                append newdata [getallincludes $fl]
+                            }
+                        }
+                    } else {
+                        append newdata [getallincludes $file]
+                    }
+                }
+            }
 	    }
 	    append data $newdata
 	    return $data
@@ -311,18 +316,19 @@ proc apachetest::getloadmodules { conffi
     regexp -line {^[^#]*(ServerRoot[\s]?[\"]?)([^\"]+)()([\"]?)} $confdata \
     match sub1 server_root_path sub2 
     foreach mod $needtoget {
+
     	# Look for LoadModule lines.
-	puts -nonewline "check conf line for $mod module..."
-	flush stdout
+        puts -nonewline "check conf line for $mod module..."
+        flush stdout
         if { ! [regexp -line "^\[^\#\]*(LoadModule\\s+$mod\\s+.+)\$"\
-                $confdata match line] } {
+                        $confdata match line] } {
             error "No LoadModule line for $mod\!"
         } else {
-	    puts ok
+            puts ok
 
-	    set raw_path [join [lrange [split $line { }] 2 end]]
-	    #trimming leading whitespaces
-	    set path [string trimleft $raw_path]
+            set raw_path [join [lrange [split $line { }] 2 end]]
+            #trimming leading whitespaces
+            set path [string trimleft $raw_path]
             if ![string equal [file pathtype $line] "absolute"] {
                 set absolute_path [file join $server_root_path $path]
                 lappend loadline "[join [lrange [split $line " "]  0 1]] $absolute_path"
@@ -342,20 +348,20 @@ proc apachetest::determinemodules { binn
     set conffile [gethttpdconf $binname]
 
     foreach {n k} [array get module_assoc] {
-	lappend needed $k
+        lappend needed $k
     }
     set needed [lsort $needed]
 
     set needtoget [list]
     foreach mod $needed {
-	if { [lsearch $compiledin $mod] == -1 } {
-	    lappend needtoget $mod
-	}
+        if { [lsearch $compiledin $mod] == -1 } {
+            lappend needtoget $mod
+        }
     }
     if { $needtoget == "" } {
-	return ""
+        return ""
     } else {
-	return [getloadmodules $conffile $needtoget]
+        return [getloadmodules $conffile $needtoget]
     }
 }
 

Modified: tcl/rivet/branches/rivet-namespace/tests/binary.rvt
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/rivet-namespace/tests/binary.rvt?rev=1204207&r1=1204206&r2=1204207&view=diff
==============================================================================
--- tcl/rivet/branches/rivet-namespace/tests/binary.rvt (original)
+++ tcl/rivet/branches/rivet-namespace/tests/binary.rvt Sun Nov 20 18:50:34 2011
@@ -1,6 +1,6 @@
 <?
-headers type "image/jpeg"
-if { [var exists test1] } {
+::rivet::headers type "image/jpeg"
+if { [::rivet::var exists test1] } {
     set fl [ open AngeloFish.jpg r ]
     fconfigure $fl -encoding binary
     fconfigure $fl -translation binary
@@ -11,6 +11,6 @@ if { [var exists test1] } {
     puts -nonewline [read $fl]
     close $fl
 } else {
-    include AngeloFish.jpg
+    ::rivet::include AngeloFish.jpg
 }
-?>
\ No newline at end of file
+?>

Modified: tcl/rivet/branches/rivet-namespace/tests/binary.test
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/rivet-namespace/tests/binary.test?rev=1204207&r1=1204206&r2=1204207&view=diff
==============================================================================
--- tcl/rivet/branches/rivet-namespace/tests/binary.test (original)
+++ tcl/rivet/branches/rivet-namespace/tests/binary.test Sun Nov 20 18:50:34 2011
@@ -8,7 +8,7 @@ set binaryfile AngeloFish.jpg
     set fl [open $binaryfile r]
     fconfigure $fl -translation binary
     fconfigure $fl -encoding binary
-    set ret [string equal -length 42746 [::http::data $page] [read $fl]]
+    set ret [string equal -length 42747 [::http::data $page] [read $fl]]
     close $fl
     set ret
 } 1
@@ -18,7 +18,7 @@ set binaryfile AngeloFish.jpg
     set fl [open $binaryfile r]
     fconfigure $fl -translation binary
     fconfigure $fl -encoding binary
-    set ret [string equal -length 42746 [::http::data $page] [read $fl]]
+    set ret [string equal -length 42747 [::http::data $page] [read $fl]]
     close $fl
     set ret
 } 1

Modified: tcl/rivet/branches/rivet-namespace/tests/broken.rvt
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/rivet-namespace/tests/broken.rvt?rev=1204207&r1=1204206&r2=1204207&view=diff
==============================================================================
--- tcl/rivet/branches/rivet-namespace/tests/broken.rvt (original)
+++ tcl/rivet/branches/rivet-namespace/tests/broken.rvt Sun Nov 20 18:50:34 2011
@@ -1,4 +1,4 @@
 <?
-# non-existant command
+# non-existent command
 broken
 ?>

Modified: tcl/rivet/branches/rivet-namespace/tests/broken.test
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/rivet-namespace/tests/broken.test?rev=1204207&r1=1204206&r2=1204207&view=diff
==============================================================================
--- tcl/rivet/branches/rivet-namespace/tests/broken.test (original)
+++ tcl/rivet/branches/rivet-namespace/tests/broken.test Sun Nov 20 18:50:34 2011
@@ -4,10 +4,10 @@ set testfilename1 broken.rvt
 
 ::tcltest::test broken-1.1 {error page test} {
     apachetest::start {} {} {
-	catch {
-	    set page [::http::geturl "${urlbase}$testfilename1"]
-	    set match [string trim [::http::data $page]]
-	}
+        catch {
+            set page [::http::geturl "${urlbase}$testfilename1"]
+            set match [string trim [::http::data $page]]
+        }
     }
     set match
 } {<PRE>
@@ -19,7 +19,7 @@ set testfilename1 broken.rvt
 "namespace eval request {
 puts -nonewline ""
 
-# non-existant command
+# non-existent command
 broken
 
 puts -nonewline "
@@ -30,7 +30,7 @@ puts -nonewline "
 namespace eval request {
 puts -nonewline ""
 
-# non-existant command
+# non-existent command
 broken
 
 puts -nonewline "

Modified: tcl/rivet/branches/rivet-namespace/tests/channel.rvt
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/rivet-namespace/tests/channel.rvt?rev=1204207&r1=1204206&r2=1204207&view=diff
==============================================================================
--- tcl/rivet/branches/rivet-namespace/tests/channel.rvt (original)
+++ tcl/rivet/branches/rivet-namespace/tests/channel.rvt Sun Nov 20 18:50:34 2011
@@ -1,6 +1,6 @@
 HTML
 <?
-no_body
+::rivet::no_body
 puts "foo"
 ?>
 MORE HTML
@@ -15,4 +15,4 @@ flush stdout
 after 2000
 puts stdout baz
 ?>
-LAST HTML
\ No newline at end of file
+LAST HTML

Modified: tcl/rivet/branches/rivet-namespace/tests/config.rvt
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/rivet-namespace/tests/config.rvt?rev=1204207&r1=1204206&r2=1204207&view=diff
==============================================================================
--- tcl/rivet/branches/rivet-namespace/tests/config.rvt (original)
+++ tcl/rivet/branches/rivet-namespace/tests/config.rvt Sun Nov 20 18:50:34 2011
@@ -1,8 +1,8 @@
 <?
-if { [var exists brokenpage] } {
+if { [::rivet::var exists brokenpage] } {
     # config-1.1
     broken
-} elseif { [var exists goodpage] } {
+} elseif { [::rivet::var exists goodpage] } {
     puts "Page Body"
 }
 ?>
\ No newline at end of file

Modified: tcl/rivet/branches/rivet-namespace/tests/config.test
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/rivet-namespace/tests/config.test?rev=1204207&r1=1204206&r2=1204207&view=diff
==============================================================================
--- tcl/rivet/branches/rivet-namespace/tests/config.test (original)
+++ tcl/rivet/branches/rivet-namespace/tests/config.test Sun Nov 20 18:50:34 2011
@@ -4,13 +4,13 @@ set testfilename1 config.rvt
 
 ::tcltest::test config-1.1 {ErrorScript config test} {
     apachetest::start {
-	-c "RivetUserConf ErrorScript 'puts \"Page broken\"'"
+	    -c "RivetUserConf ErrorScript 'puts \"Page broken\"'"
     } {} {
-	catch {
-	    set page [::http::geturl "${urlbase}$testfilename1?brokenpage"]
-	    set match [string trim [::http::data $page]]
-	    ::http::cleanup $page
-	}
+        catch {
+            set page [::http::geturl "${urlbase}$testfilename1?brokenpage"]
+            set match [string trim [::http::data $page]]
+            ::http::cleanup $page
+        }
     }
     set match
 } {Page broken}
@@ -19,11 +19,11 @@ set testfilename1 config.rvt
     apachetest::start {
 	-c "RivetUserConf ErrorScript 'puts \"Page broken\"'" -c "AccessFileName test-htaccess"
     } {} {
-	catch {
-	    set page [::http::geturl "${urlbase}$testfilename1?brokenpage"]
-	    set match [string trim [::http::data $page]]
-	    ::http::cleanup $page
-	}
+        catch {
+            set page [::http::geturl "${urlbase}$testfilename1?brokenpage"]
+            set match [string trim [::http::data $page]]
+            ::http::cleanup $page
+        }
     }
     set match
 } {Local Page Header
@@ -34,19 +34,19 @@ this page is BROKEN}
     puts $fl {RivetUserConf BeforeScript 'puts "Local Page Header"'}
     close $fl
     apachetest::start { -c "AccessFileName htaccess2" } {} {
-	catch {
-	    set page [::http::geturl "${urlbase}$testfilename1?goodpage"]
-	    set match [string trim [::http::data $page]]
-	    ::http::cleanup $page
-	    # Now change what's in the ".htaccess" file, and see if it
-	    # picks it up.
-	    set fl [open htaccess2 w]
-	    puts $fl {RivetUserConf BeforeScript 'puts "New Local Page Header"'}
-	    close $fl
-	    set page [::http::geturl "${urlbase}$testfilename1?goodpage"]
-	    append match [string trim [::http::data $page]]
-	    ::http::cleanup $page
-	}
+        catch {
+            set page [::http::geturl "${urlbase}$testfilename1?goodpage"]
+            set match [string trim [::http::data $page]]
+            ::http::cleanup $page
+            # Now change what's in the ".htaccess" file, and see if it
+            # picks it up.
+            set fl [open htaccess2 w]
+            puts $fl {RivetUserConf BeforeScript 'puts "New Local Page Header"'}
+            close $fl
+            set page [::http::geturl "${urlbase}$testfilename1?goodpage"]
+            append match [string trim [::http::data $page]]
+            ::http::cleanup $page
+        }
     }
     set match
 } {Local Page Header
@@ -115,12 +115,12 @@ set i 0
 foreach Config $ConfigList {
     incr i
     ::tcltest::test config-auto-${i}.1 {config test} {
-	apachetest::start $Config {} {
-	    catch {
-		set page [::http::geturl "${urlbase}$testfilename1?goodpage"]
-		set match [string trim [::http::data $page]]
-	    }
-	}
-	set match
+        apachetest::start $Config {} {
+            catch {
+                set page [::http::geturl "${urlbase}$testfilename1?goodpage"]
+                set match [string trim [::http::data $page]]
+            }
+        }
+        set match
     } [lindex $ResultList [expr $i - 1]]
 }

Modified: tcl/rivet/branches/rivet-namespace/tests/cookies.rvt
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/rivet-namespace/tests/cookies.rvt?rev=1204207&r1=1204206&r2=1204207&view=diff
==============================================================================
--- tcl/rivet/branches/rivet-namespace/tests/cookies.rvt (original)
+++ tcl/rivet/branches/rivet-namespace/tests/cookies.rvt Sun Nov 20 18:50:34 2011
@@ -1,8 +1,8 @@
 <?
 
-load_cookies
+::rivet::load_cookies
 
-cookie set mod rivet -expires 01-01-2003
+::rivet::cookie set mod rivet -expires 01-01-2003
 
 if { [ array exists cookies ] } {
     foreach { ck } [ array names cookies ]  {
@@ -10,4 +10,4 @@ if { [ array exists cookies ] } {
     }
 }
 
-?>
\ No newline at end of file
+?>

Modified: tcl/rivet/branches/rivet-namespace/tests/docroot1/afterscript.tcl
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/rivet-namespace/tests/docroot1/afterscript.tcl?rev=1204207&r1=1204206&r2=1204207&view=diff
==============================================================================
--- tcl/rivet/branches/rivet-namespace/tests/docroot1/afterscript.tcl (original)
+++ tcl/rivet/branches/rivet-namespace/tests/docroot1/afterscript.tcl Sun Nov 20 18:50:34 2011
@@ -2,4 +2,4 @@
 
 # $Id$
 
-puts "afterscript1<br>"
+puts -nonewline "afterscript1"

Added: tcl/rivet/branches/rivet-namespace/tests/docroot1/basic1.rvt
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/rivet-namespace/tests/docroot1/basic1.rvt?rev=1204207&view=auto
==============================================================================
--- tcl/rivet/branches/rivet-namespace/tests/docroot1/basic1.rvt (added)
+++ tcl/rivet/branches/rivet-namespace/tests/docroot1/basic1.rvt Sun Nov 20 18:50:34 2011
@@ -0,0 +1 @@
+Virtual Host1 Test

Modified: tcl/rivet/branches/rivet-namespace/tests/docroot1/beforescript.tcl
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/rivet-namespace/tests/docroot1/beforescript.tcl?rev=1204207&r1=1204206&r2=1204207&view=diff
==============================================================================
--- tcl/rivet/branches/rivet-namespace/tests/docroot1/beforescript.tcl (original)
+++ tcl/rivet/branches/rivet-namespace/tests/docroot1/beforescript.tcl Sun Nov 20 18:50:34 2011
@@ -2,4 +2,5 @@
 
 # $Id$
 
-puts "beforescript1"
\ No newline at end of file
+set  ::beforescript1 1
+puts "beforescript1"

Modified: tcl/rivet/branches/rivet-namespace/tests/docroot1/childinit.tcl
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/rivet-namespace/tests/docroot1/childinit.tcl?rev=1204207&r1=1204206&r2=1204207&view=diff
==============================================================================
--- tcl/rivet/branches/rivet-namespace/tests/docroot1/childinit.tcl (original)
+++ tcl/rivet/branches/rivet-namespace/tests/docroot1/childinit.tcl Sun Nov 20 18:50:34 2011
@@ -2,4 +2,4 @@
 
 # $Id$
 
-set ::childinit1 1
\ No newline at end of file
+set ::childinit1 1

Modified: tcl/rivet/branches/rivet-namespace/tests/docroot1/vhost1.rvt
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/rivet-namespace/tests/docroot1/vhost1.rvt?rev=1204207&r1=1204206&r2=1204207&view=diff
==============================================================================
--- tcl/rivet/branches/rivet-namespace/tests/docroot1/vhost1.rvt (original)
+++ tcl/rivet/branches/rivet-namespace/tests/docroot1/vhost1.rvt Sun Nov 20 18:50:34 2011
@@ -1,15 +1,13 @@
-Virtual Host1 Test
-
 <?
-set ::vhost1 1
-puts "vhost1 hello world<br>"
+if {[info exists ::childinit1]} {
+    puts "vhost1 hello world<br>"
+	puts "::childinit1 exists<br>"
 
-foreach var {
-    childinit1 childinit2 vhost1 vhost2
-} {
-    if { [info exists ::$var] } {
-	puts "$var exists<br>"
-    }
-}
+} elseif {[info exists ::beforescript1]} {
+    ?>Virtual Host1 Test<?
+} 
+if {[info exists ::childinit2]} {
+	puts "::childinit2 exists<br>"
 
+}
 ?>

Modified: tcl/rivet/branches/rivet-namespace/tests/docroot2/afterscript.tcl
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/rivet-namespace/tests/docroot2/afterscript.tcl?rev=1204207&r1=1204206&r2=1204207&view=diff
==============================================================================
--- tcl/rivet/branches/rivet-namespace/tests/docroot2/afterscript.tcl (original)
+++ tcl/rivet/branches/rivet-namespace/tests/docroot2/afterscript.tcl Sun Nov 20 18:50:34 2011
@@ -2,4 +2,4 @@
 
 # $Id$
 
-puts "afterscript2<br>"
+puts -nonewline "afterscript2"

Added: tcl/rivet/branches/rivet-namespace/tests/docroot2/basic2.rvt
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/rivet-namespace/tests/docroot2/basic2.rvt?rev=1204207&view=auto
==============================================================================
--- tcl/rivet/branches/rivet-namespace/tests/docroot2/basic2.rvt (added)
+++ tcl/rivet/branches/rivet-namespace/tests/docroot2/basic2.rvt Sun Nov 20 18:50:34 2011
@@ -0,0 +1,2 @@
+Virtual Host2 Test
+

Modified: tcl/rivet/branches/rivet-namespace/tests/docroot2/beforescript.tcl
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/rivet-namespace/tests/docroot2/beforescript.tcl?rev=1204207&r1=1204206&r2=1204207&view=diff
==============================================================================
--- tcl/rivet/branches/rivet-namespace/tests/docroot2/beforescript.tcl (original)
+++ tcl/rivet/branches/rivet-namespace/tests/docroot2/beforescript.tcl Sun Nov 20 18:50:34 2011
@@ -2,4 +2,5 @@
 
 # $Id$
 
+set  ::beforescript2 1
 puts "beforescript2"

Modified: tcl/rivet/branches/rivet-namespace/tests/docroot2/vhost2.rvt
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/rivet-namespace/tests/docroot2/vhost2.rvt?rev=1204207&r1=1204206&r2=1204207&view=diff
==============================================================================
--- tcl/rivet/branches/rivet-namespace/tests/docroot2/vhost2.rvt (original)
+++ tcl/rivet/branches/rivet-namespace/tests/docroot2/vhost2.rvt Sun Nov 20 18:50:34 2011
@@ -1,15 +1,13 @@
-Virtual Host2 Test
-
 <?
-set ::vhost2 2
-puts "vhost2 hello world"
+if {[info exists ::childinit2]} {
+    puts "vhost2 hello world<br>"
+	puts "::childinit2 exists<br>"
 
-foreach var {
-    childinit1 childinit2 vhost1 vhost2
-} {
-    if { [info exists ::$var] } {
-	puts "$var exists<br>"
-    }
+} elseif {[info exists ::beforescript2]} {
+    ?>Virtual Host2 Test<?
 }
+if {[info exists ::childinit1]} {
+	puts "::childinit1 exists<br>"
 
+}
 ?>

Modified: tcl/rivet/branches/rivet-namespace/tests/env.rvt
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/rivet-namespace/tests/env.rvt?rev=1204207&r1=1204206&r2=1204207&view=diff
==============================================================================
--- tcl/rivet/branches/rivet-namespace/tests/env.rvt (original)
+++ tcl/rivet/branches/rivet-namespace/tests/env.rvt Sun Nov 20 18:50:34 2011
@@ -1,7 +1,7 @@
 <?
 
-load_env
+::rivet::load_env
 
 puts "env(DOCUMENT_NAME) = $env(DOCUMENT_NAME)\n"
 
-?>
\ No newline at end of file
+?>

Modified: tcl/rivet/branches/rivet-namespace/tests/get.rvt
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/rivet-namespace/tests/get.rvt?rev=1204207&r1=1204206&r2=1204207&view=diff
==============================================================================
--- tcl/rivet/branches/rivet-namespace/tests/get.rvt (original)
+++ tcl/rivet/branches/rivet-namespace/tests/get.rvt Sun Nov 20 18:50:34 2011
@@ -1,26 +1,26 @@
 <?
 
-if { [var number] > 0 } {
-    if { [var exists foobar] } {
-	puts "\[var get foobar\] = [var get foobar]\n"
-	puts "\[var_qs get foobar\] = [var_qs get foobar]\n"
+if { [::rivet::var number] > 0 } {
+    if { [::rivet::var exists foobar] } {
+        puts "\[::rivet::var get foobar\] = [::rivet::var get foobar]\n"
+        puts "\[::rivet::var_qs get foobar\] = [::rivet::var_qs get foobar]\n"
     }
-    if { [var exists xst] } {
-	puts "\[var exists xst\]\[var exists noxst\] = [var exists xst] [var exists noxst]\n"
-	puts "\[var_qs exists xst\]\[var_qs exists noxst\] = [var_qs exists xst] [var_qs exists noxst]\n"
+    if { [::rivet::var exists xst] } {
+        puts "\[::rivet::var exists xst\]\[::rivet::var exists noxst\] = [::rivet::var exists xst] [::rivet::var exists noxst]\n"
+        puts "\[::rivet::var_qs exists xst\]\[::rivet::var_qs exists noxst\] = [::rivet::var_qs exists xst] [::rivet::var_qs exists noxst]\n"
     }
-    if { [var exists Más] } {
-	puts "\[var get Más\] = [var get Más]\n"
+    if { [::rivet::var exists Más] } {
+        puts "\[::rivet::var get Más\] = [::rivet::var get Más]\n"
     }
-    if { [var exists lstvar1] } {
-	puts "\[var get lstvar1\] = [var get lstvar1]\n"
+    if { [::rivet::var exists lstvar1] } {
+        puts "\[::rivet::var get lstvar1\] = [::rivet::var get lstvar1]\n"
     }
-    if { [var exists lstvar2] } {
-	puts "\[var list lstvar2\] = [var list lstvar2]\n"
+    if { [::rivet::var exists lstvar2] } {
+        puts "\[::rivet::var list lstvar2\] = [::rivet::var list lstvar2]\n"
     }
-    puts "\[var get xst foo\] = [var get xst foo]"
+    puts "\[::rivet::var get xst foo\] = [::rivet::var get xst foo]"
 } else {
-    puts "\[var get xst\] = [var get xst]"
+    puts "\[::rivet::var get xst\] = [::rivet::var get xst]"
 }
 
-?>
\ No newline at end of file
+?>

Modified: tcl/rivet/branches/rivet-namespace/tests/get.test
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/rivet-namespace/tests/get.test?rev=1204207&r1=1204206&r2=1204207&view=diff
==============================================================================
--- tcl/rivet/branches/rivet-namespace/tests/get.test (original)
+++ tcl/rivet/branches/rivet-namespace/tests/get.test Sun Nov 20 18:50:34 2011
@@ -2,60 +2,60 @@
 
 ::tcltest::test getvariables-1.1 {GET variables} {
     set page [ ::http::geturl "${urlbase}get.rvt?foobar=goober" ]
-    regexp -line {\[var get foobar\] = goober$} [ ::http::data $page ] match
+    regexp -line {\[::rivet::var get foobar\] = goober$} [ ::http::data $page ] match
     set match
-} {[var get foobar] = goober}
+} {[::rivet::var get foobar] = goober}
 
 ::tcltest::test getvariables-1.2 {GET variables - exists} {
     set page [ ::http::geturl "${urlbase}get.rvt?xst=1" ]
-    regexp -line {\[var exists xst\]\[var exists noxst\] = 1 0$} [ ::http::data $page ] match
+    regexp -line {\[::rivet::var exists xst\]\[::rivet::var exists noxst\] = 1 0$} [ ::http::data $page ] match
     set match
-} {[var exists xst][var exists noxst] = 1 0}
+} {[::rivet::var exists xst][::rivet::var exists noxst] = 1 0}
 
 ::tcltest::test getvariables-1.3 {GET variables - doesn't exist} {
     set page [ ::http::geturl "${urlbase}get.rvt" ]
-    regexp -line {\[var get xst\] = } [ ::http::data $page ] match
+    regexp -line {\[::rivet::var get xst\] = } [ ::http::data $page ] match
     set match
-} {[var get xst] = }
+} {[::rivet::var get xst] = }
 
 ::tcltest::test getvariables-1.4 {GET variables - default value} {
     set page [ ::http::geturl "${urlbase}get.rvt?defaulttest=1" ]
-    regexp {^\[var get xst foo\] = foo} [ ::http::data $page ] match
+    regexp {^\[::rivet::var get xst foo\] = foo} [ ::http::data $page ] match
     set match
-} {[var get xst foo] = foo}
+} {[::rivet::var get xst foo] = foo}
 
 ::tcltest::test getvariables-1.5 {GET variables - var_qs exists} {
     set page [ ::http::geturl "${urlbase}get.rvt?xst=1" ]
-    regexp -line {\[var_qs exists xst\]\[var_qs exists noxst\] = 1 0$} [ ::http::data $page ] match
+    regexp -line {\[::rivet::var_qs exists xst\]\[::rivet::var_qs exists noxst\] = 1 0$} [ ::http::data $page ] match
     set match
-} {[var_qs exists xst][var_qs exists noxst] = 1 0}
+} {[::rivet::var_qs exists xst][::rivet::var_qs exists noxst] = 1 0}
 
 ::tcltest::test getvariables-2.1 {GET variables + I18N} {
     set page [ ::http::geturl "${urlbase}get.rvt?Más=Tú" ]
-    regexp -line {^\[var get Más\] = Tú$} [ ::http::data $page ] match
+    regexp -line {^\[::rivet::var get Más\] = Tú$} [ ::http::data $page ] match
     set match
-} {[var get Más] = Tú}
+} {[::rivet::var get Más] = Tú}
 
 ::tcltest::test getvariables-2.2 {GET variables + I18N + encoding} {
     set page [ ::http::geturl [ format "${urlbase}get.rvt?%s" [ ::http::formatQuery Más Tú ] ] ]
-    regexp -line {^\[var get Más\] = Tú$} [ ::http::data $page ] match
+    regexp -line {^\[::rivet::var get Más\] = Tú$} [ ::http::data $page ] match
     set match
-} {[var get Más] = Tú}
+} {[::rivet::var get Más] = Tú}
 
 ::tcltest::test getvariables-3.1 {GET multi-value variable} {
     set page [ ::http::geturl "${urlbase}get.rvt?lstvar1=a&lstvar1=b&lstvar1=c+d" ]
-    regexp -line {\[var get lstvar1\] = a b c d$} [ ::http::data $page ] match
+    regexp -line {\[::rivet::var get lstvar1\] = a b c d$} [ ::http::data $page ] match
     set match
-} {[var get lstvar1] = a b c d}
+} {[::rivet::var get lstvar1] = a b c d}
 
 ::tcltest::test getvariables-3.2 {GET multi-value variable as list} {
     set page [ ::http::geturl "${urlbase}get.rvt?lstvar2=a&lstvar2=b&lstvar2=c+d" ]
-    regexp -line {\[var list lstvar2\] = a b {c d}$} [ ::http::data $page ] match
+    regexp -line {\[::rivet::var list lstvar2\] = a b {c d}$} [ ::http::data $page ] match
     set match
-} {[var list lstvar2] = a b {c d}}
+} {[::rivet::var list lstvar2] = a b {c d}}
 
 ::tcltest::test getvariables-4.1 {var_qs} {
     set page [ ::http::geturl "${urlbase}get.rvt?foobar=goober" ]
-    regexp -line {\[var_qs get foobar\] = goober$} [ ::http::data $page ] match
+    regexp -line {\[::rivet::var_qs get foobar\] = goober$} [::http::data $page] match
     set match
-} {[var_qs get foobar] = goober}
+} {[::rivet::var_qs get foobar] = goober}

Modified: tcl/rivet/branches/rivet-namespace/tests/headers.rvt
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/rivet-namespace/tests/headers.rvt?rev=1204207&r1=1204206&r2=1204207&view=diff
==============================================================================
--- tcl/rivet/branches/rivet-namespace/tests/headers.rvt (original)
+++ tcl/rivet/branches/rivet-namespace/tests/headers.rvt Sun Nov 20 18:50:34 2011
@@ -9,7 +9,7 @@
 
 <?
 
-load_headers hdrs
+::rivet::load_headers hdrs
 parray hdrs
 
 ?>

Modified: tcl/rivet/branches/rivet-namespace/tests/headers.test
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/rivet-namespace/tests/headers.test?rev=1204207&r1=1204206&r2=1204207&view=diff
==============================================================================
--- tcl/rivet/branches/rivet-namespace/tests/headers.test (original)
+++ tcl/rivet/branches/rivet-namespace/tests/headers.test Sun Nov 20 18:50:34 2011
@@ -14,4 +14,4 @@ hdrs(User-Agent) = Tcl http client packa
     set match [string trim $match]
     ::http::cleanup $page
     set match
-} $result
\ No newline at end of file
+} $result

Modified: tcl/rivet/branches/rivet-namespace/tests/include.html
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/rivet-namespace/tests/include.html?rev=1204207&r1=1204206&r2=1204207&view=diff
==============================================================================
--- tcl/rivet/branches/rivet-namespace/tests/include.html (original)
+++ tcl/rivet/branches/rivet-namespace/tests/include.html Sun Nov 20 18:50:34 2011
@@ -1,11 +1,11 @@
     <table>
       <tbody>
-	<tr>
-	  <td>row 1</td>
-	</tr>
-	<tr>
-	  <td>row 2</td>
-	</tr>
+    <tr>
+      <td>row 1</td>
+    </tr>
+    <tr>
+      <td>row 2</td>
+    </tr>
       </tbody>
     </table>
 <p>ÆüËܸì(EUC-JP Japanese text)</p>
\ No newline at end of file

Modified: tcl/rivet/branches/rivet-namespace/tests/include.rvt
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/rivet-namespace/tests/include.rvt?rev=1204207&r1=1204206&r2=1204207&view=diff
==============================================================================
--- tcl/rivet/branches/rivet-namespace/tests/include.rvt (original)
+++ tcl/rivet/branches/rivet-namespace/tests/include.rvt Sun Nov 20 18:50:34 2011
@@ -1,11 +1,9 @@
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
 <html>
-  <head>
-    <title>Include Test</title>
-  </head>
+  <head><title>Include Test</title></head>
 
   <body>
     <h1>Include Test</h1>
-    <? include include.html ?>
+    <? ::rivet::include include.html ?>
   </body>
 </html>
\ No newline at end of file

Modified: tcl/rivet/branches/rivet-namespace/tests/include.test
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/rivet-namespace/tests/include.test?rev=1204207&r1=1204206&r2=1204207&view=diff
==============================================================================
--- tcl/rivet/branches/rivet-namespace/tests/include.test (original)
+++ tcl/rivet/branches/rivet-namespace/tests/include.test Sun Nov 20 18:50:34 2011
@@ -7,20 +7,18 @@ set testfilename1 include.rvt
     ::http::data $page
 } {<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
 <html>
-  <head>
-    <title>Include Test</title>
-  </head>
+  <head><title>Include Test</title></head>
 
   <body>
     <h1>Include Test</h1>
         <table>
       <tbody>
-	<tr>
-	  <td>row 1</td>
-	</tr>
-	<tr>
-	  <td>row 2</td>
-	</tr>
+    <tr>
+      <td>row 1</td>
+    </tr>
+    <tr>
+      <td>row 2</td>
+    </tr>
       </tbody>
     </table>
 <p>ÆüËܸì(EUC-JP Japanese text)</p>

Modified: tcl/rivet/branches/rivet-namespace/tests/lang.test
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/rivet-namespace/tests/lang.test?rev=1204207&r1=1204206&r2=1204207&view=diff
==============================================================================
--- tcl/rivet/branches/rivet-namespace/tests/lang.test (original)
+++ tcl/rivet/branches/rivet-namespace/tests/lang.test Sun Nov 20 18:50:34 2011
@@ -7,24 +7,22 @@ apachetest::start {} {} {
     set testfilename1 include.rvt
 
     ::tcltest::test lang-1.1 {"include" with LANG} {
-	set page [ ::http::geturl "${urlbase}$testfilename1" ]
-	::http::data $page
+    set page [ ::http::geturl "${urlbase}$testfilename1" ]
+    ::http::data $page
     } {<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
 <html>
-  <head>
-    <title>Include Test</title>
-  </head>
+  <head><title>Include Test</title></head>
 
   <body>
     <h1>Include Test</h1>
         <table>
       <tbody>
-	<tr>
-	  <td>row 1</td>
-	</tr>
-	<tr>
-	  <td>row 2</td>
-	</tr>
+    <tr>
+      <td>row 1</td>
+    </tr>
+    <tr>
+      <td>row 2</td>
+    </tr>
       </tbody>
     </table>
 <p>ÆüËܸì(EUC-JP Japanese text)</p>
@@ -34,8 +32,8 @@ apachetest::start {} {} {
     set testfilename1 parse.rvt
 
     ::tcltest::test parse-1.1 {Parse command} {
-	set page [ ::http::geturl "${urlbase}$testfilename1" ]
-	::http::data $page
+    set page [ ::http::geturl "${urlbase}$testfilename1" ]
+    ::http::data $page
     } {<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
 <html>
   <head>

Modified: tcl/rivet/branches/rivet-namespace/tests/makeurl.rvt
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/rivet-namespace/tests/makeurl.rvt?rev=1204207&r1=1204206&r2=1204207&view=diff
==============================================================================
--- tcl/rivet/branches/rivet-namespace/tests/makeurl.rvt (original)
+++ tcl/rivet/branches/rivet-namespace/tests/makeurl.rvt Sun Nov 20 18:50:34 2011
@@ -1,6 +1,25 @@
 <?
 
+    if {[::rivet::var exists urltype]} {
+
+        switch [::rivet::var get urltype] {
+
+            absolute {
 # makeurl-1.1
-puts [makeurl /foo]
+                puts [::rivet::makeurl /foo]
+            }
+
+            relative {
+# makeurl-1.2
+                puts [::rivet::makeurl foo/]
+
+            }
+            
+        }
+    } else {
+
+# makeurl-1.3
+        puts [::rivet::makeurl]
 
-?>
\ No newline at end of file
+    }
+?>

Modified: tcl/rivet/branches/rivet-namespace/tests/makeurl.test
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/rivet-namespace/tests/makeurl.test?rev=1204207&r1=1204206&r2=1204207&view=diff
==============================================================================
--- tcl/rivet/branches/rivet-namespace/tests/makeurl.test (original)
+++ tcl/rivet/branches/rivet-namespace/tests/makeurl.test Sun Nov 20 18:50:34 2011
@@ -3,8 +3,20 @@
 set testfilename1 makeurl.rvt
 
 ::tcltest::test makeurl-1.1 {makeurl} {
-    set page [ ::http::geturl "${urlbase}$testfilename1" ]
+    set page [ ::http::geturl "${urlbase}${testfilename1}?urltype=absolute" ]
     set match [string trim [ ::http::data $page ]]
     set match
 } {http://localhost:8081/foo}
 
+::tcltest::test makeurl-1.2 {makeurl} {
+    set page [ ::http::geturl "${urlbase}${testfilename1}?urltype=relative" ]
+    set match [string trim [ ::http::data $page ]]
+    set match
+} {http://localhost:8081/makeurl.rvt/foo/}
+
+::tcltest::test makeurl-1.3 {makeurl} {
+    set page [ ::http::geturl "${urlbase}${testfilename1}" ]
+    set match [string trim [ ::http::data $page ]]
+    set match
+} {http://localhost:8081/makeurl.rvt}
+

Modified: tcl/rivet/branches/rivet-namespace/tests/parse.rvt
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/rivet-namespace/tests/parse.rvt?rev=1204207&r1=1204206&r2=1204207&view=diff
==============================================================================
--- tcl/rivet/branches/rivet-namespace/tests/parse.rvt (original)
+++ tcl/rivet/branches/rivet-namespace/tests/parse.rvt Sun Nov 20 18:50:34 2011
@@ -6,6 +6,6 @@
 
   <body>
     <h1>Parse Test</h1>
-    <? parse hello.rvt ?>
+    <? ::rivet::parse hello.rvt ?>
   </body>
 </html>
\ No newline at end of file

Modified: tcl/rivet/branches/rivet-namespace/tests/post.rvt
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/rivet-namespace/tests/post.rvt?rev=1204207&r1=1204206&r2=1204207&view=diff
==============================================================================
--- tcl/rivet/branches/rivet-namespace/tests/post.rvt (original)
+++ tcl/rivet/branches/rivet-namespace/tests/post.rvt Sun Nov 20 18:50:34 2011
@@ -1,21 +1,21 @@
 <?
 
-if { [ var number ] > 0 } {
+if { [ ::rivet::var number ] > 0 } {
     # get/post variables 1.1
-    if { [ var exists foobar ] } {
-	puts "\[var get foobar\] = [var get foobar]\n"
-	puts "\[var_post get foobar\] = [var_post get foobar]\n"
+    if { [ ::rivet::var exists foobar ] } {
+        puts "\[::rivet::var get foobar\] = [::rivet::var get foobar]\n"
+        puts "\[::rivet::var_post get foobar\] = [::rivet::var_post get foobar]\n"
     }
     # get/post variables 1.{2,3}
-    if { [ var exists Más ] } {
-	puts "\[var get Más\] = [var get Más]\n"
+    if { [ ::rivet::var exists Más ] } {
+        puts "\[::rivet::var get Más\] = [::rivet::var get Más]\n"
     }
-    if { [var exists lstvar1] } {
-	puts "\[var get lstvar1\] = [var get lstvar1]\n"
+    if { [::rivet::var exists lstvar1] } {
+        puts "\[::rivet::var get lstvar1\] = [::rivet::var get lstvar1]\n"
     }
-    if { [var exists lstvar2] } {
-	puts "\[var list lstvar2\] = [var list lstvar2]\n"
+    if { [::rivet::var exists lstvar2] } {
+        puts "\[::rivet::var list lstvar2\] = [::rivet::var list lstvar2]\n"
     }
 }
 
-?>
\ No newline at end of file
+?>

Modified: tcl/rivet/branches/rivet-namespace/tests/post.test
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/rivet-namespace/tests/post.test?rev=1204207&r1=1204206&r2=1204207&view=diff
==============================================================================
--- tcl/rivet/branches/rivet-namespace/tests/post.test (original)
+++ tcl/rivet/branches/rivet-namespace/tests/post.test Sun Nov 20 18:50:34 2011
@@ -4,36 +4,36 @@ set testfilename1 post.rvt
 
 ::tcltest::test postvariables-1.1 {POST variables} {
     set page [ ::http::geturl "${urlbase}$testfilename1" -query foobar=goober ]
-    regexp -line {^\[var get foobar\] = goober$} [ ::http::data $page ] match
+    regexp -line {^\[::rivet::var get foobar\] = goober$} [ ::http::data $page ] match
     set match
-} {[var get foobar] = goober}
+} {[::rivet::var get foobar] = goober}
 
 ::tcltest::test postvariables-2.1 {POST variables + I18N} {
     set page [ ::http::geturl "${urlbase}$testfilename1" -query Más=Tú ]
-    regexp -line {^\[var get Más\] = Tú$} [ ::http::data $page ] match
+    regexp -line {^\[::rivet::var get Más\] = Tú$} [ ::http::data $page ] match
     set match
-} {[var get Más] = Tú}
+} {[::rivet::var get Más] = Tú}
 
 ::tcltest::test postvariables-2.2 {POST variables + I18N + encoding} {
     set page [ ::http::geturl "${urlbase}$testfilename1" -query [ ::http::formatQuery Más Tú ] ]
-    regexp -line {^\[var get Más\] = Tú$} [ ::http::data $page ] match
+    regexp -line {^\[::rivet::var get Más\] = Tú$} [ ::http::data $page ] match
     set match
-} {[var get Más] = Tú}
+} {[::rivet::var get Más] = Tú}
 
 ::tcltest::test postvariables-3.1 {POST multi-value variable} {
     set page [ ::http::geturl "${urlbase}get.rvt" -query [::http::formatQuery lstvar1 a lstvar1 b lstvar1 {c d}]]
-    regexp -line {\[var get lstvar1\] = a b c d$} [ ::http::data $page ] match
+    regexp -line {\[::rivet::var get lstvar1\] = a b c d$} [ ::http::data $page ] match
     set match
-} {[var get lstvar1] = a b c d}
+} {[::rivet::var get lstvar1] = a b c d}
 
 ::tcltest::test postvariables-3.2 {POST multi-value variable as list} {
     set page [ ::http::geturl "${urlbase}get.rvt" -query [::http::formatQuery lstvar2 a lstvar2 b lstvar2 {c d}]]
-    regexp -line {\[var list lstvar2\] = a b {c d}$} [ ::http::data $page ] match
+    regexp -line {\[::rivet::var list lstvar2\] = a b {c d}$} [ ::http::data $page ] match
     set match
-} {[var list lstvar2] = a b {c d}}
+} {[::rivet::var list lstvar2] = a b {c d}}
 
 ::tcltest::test postvariables-4.1 {var_post} {
     set page [ ::http::geturl "${urlbase}$testfilename1" -query foobar=goober ]
-    regexp -line {^\[var_post get foobar\] = goober$} [ ::http::data $page ] match
+    regexp -line {^\[::rivet::var_post get foobar\] = goober$} [ ::http::data $page ] match
     set match
-} {[var_post get foobar] = goober}
+} {[::rivet::var_post get foobar] = goober}

Modified: tcl/rivet/branches/rivet-namespace/tests/rivet.test
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/rivet-namespace/tests/rivet.test?rev=1204207&r1=1204206&r2=1204207&view=diff
==============================================================================
--- tcl/rivet/branches/rivet-namespace/tests/rivet.test (original)
+++ tcl/rivet/branches/rivet-namespace/tests/rivet.test Sun Nov 20 18:50:34 2011
@@ -32,11 +32,11 @@ if { $testgroup1 } {
     puts -nonewline "Running all tests against one server process."
     flush stdout
     apachetest::start {} {} {
-	foreach Test $TestList {
-	    puts -nonewline "."
-	    flush stdout
-	    source $Test
-	}
+        foreach Test $TestList {
+            puts -nonewline "."
+            flush stdout
+            source $Test
+        }
     }
     puts " done"
 }
@@ -45,10 +45,10 @@ if { $testgroup1 } {
 
 if { $testgroup2 } {
     foreach Test $TestList {
-	apachetest::start {} {} {
-	    puts "Running $Test"
-	    source $Test
-	}
+        apachetest::start {} {} {
+            puts "Running $Test"
+            source $Test
+        }
     }
 }
 
@@ -58,15 +58,16 @@ if { $testgroup2 } {
 
 if { $testgroup3 } {
     foreach Test {
-	broken.test
-	config.test
-	lang.test
-	parsepackage.test
-	virtualhost.test
+        broken.test
+        config.test
+        lang.test
+        parsepackage.test
+        virtualhost.test
     } {
-	puts "Running $Test"
-	source $Test
+        puts "Running $Test"
+        source $Test
     }
 }
 
 ::tcltest::cleanupTests
+



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