You are viewing a plain text version of this content. The canonical link for it is here.
Posted to site-cvs@tcl.apache.org by mx...@apache.org on 2016/12/21 13:14:51 UTC

svn commit: r1775412 - in /tcl/rivet/trunk: ./ src/mod_rivet_ng/

Author: mxmanghi
Date: Wed Dec 21 13:14:51 2016
New Revision: 1775412

URL: http://svn.apache.org/viewvc?rev=1775412&view=rev
Log:
    better wording of cache functions names. 


Modified:
    tcl/rivet/trunk/ChangeLog
    tcl/rivet/trunk/src/mod_rivet_ng/mod_rivet_cache.c   (contents, props changed)
    tcl/rivet/trunk/src/mod_rivet_ng/mod_rivet_cache.h
    tcl/rivet/trunk/src/mod_rivet_ng/mod_rivet_common.c
    tcl/rivet/trunk/src/mod_rivet_ng/mod_rivet_generator.c
    tcl/rivet/trunk/src/mod_rivet_ng/rivetCore.c
    tcl/rivet/trunk/src/mod_rivet_ng/worker_prefork_common.c

Modified: tcl/rivet/trunk/ChangeLog
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/ChangeLog?rev=1775412&r1=1775411&r2=1775412&view=diff
==============================================================================
--- tcl/rivet/trunk/ChangeLog (original)
+++ tcl/rivet/trunk/ChangeLog Wed Dec 21 13:14:51 2016
@@ -1,3 +1,7 @@
+2016-12-19 Massimo Manghi <mx...@apache.org>
+    * rivet/mod_rivet_ng/mod_rivet_cache.c: better wording of cache 
+    functions names. 
+
 2016-12-12 Massimo Manghi <mx...@apache.org>
     * rivet/init.tcl.in: [url_script] now evaluated
     explicitly in the ::request name space. We

Modified: tcl/rivet/trunk/src/mod_rivet_ng/mod_rivet_cache.c
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/src/mod_rivet_ng/mod_rivet_cache.c?rev=1775412&r1=1775411&r2=1775412&view=diff
==============================================================================
--- tcl/rivet/trunk/src/mod_rivet_ng/mod_rivet_cache.c (original)
+++ tcl/rivet/trunk/src/mod_rivet_ng/mod_rivet_cache.c Wed Dec 21 13:14:51 2016
@@ -17,6 +17,9 @@
     specific language governing permissions and limitations
     under the License.
 */
+
+/* $Id: */
+
 #include <apr_strings.h>
 
 #include "mod_rivet.h"
@@ -25,7 +28,7 @@
 extern mod_rivet_globals* module_globals;
 
 /*
- * -- Rivet_CreateCache 
+ * -- RivetCache_Create 
  *
  * Creates a per interpreter script cach
  *
@@ -41,7 +44,7 @@ extern mod_rivet_globals* module_globals
  *
  */
 
-void Rivet_CreateCache (apr_pool_t *p, rivet_thread_interp* interp_obj)
+void RivetCache_Create (apr_pool_t *p, rivet_thread_interp* interp_obj)
 {
     interp_obj->objCacheList = 
                 apr_pcalloc(p,(signed)((interp_obj->cache_size)*sizeof(char *)));
@@ -52,7 +55,7 @@ void Rivet_CreateCache (apr_pool_t *p, r
 }
 
 /*
- * -- Rivet_CacheCleanup
+ * -- RivetCache_Cleanup
  *
  * Cache clean-up. This function is called when a user configuration
  * is changed thus invalidating the whole cache. A better solution is
@@ -69,7 +72,7 @@ void Rivet_CreateCache (apr_pool_t *p, r
  *      the cache associated to the thread interpreter is emptied
  */
 
-void Rivet_CacheCleanup (rivet_thread_private* private,rivet_thread_interp* rivet_interp)
+void RivetCache_Cleanup (rivet_thread_private* private,rivet_thread_interp* rivet_interp)
 {
     int ct;
     Tcl_HashEntry *delEntry;
@@ -120,7 +123,7 @@ void Rivet_CacheCleanup (rivet_thread_pr
  *      int                 toplevel   - toplevel template
  */
 
-char* Rivet_MakeCacheKey (apr_pool_t*   pool,
+char* RivetCache_MakeKey (apr_pool_t*   pool,
                           char*         filename,
                           time_t        ctime, 
                           time_t        mtime,
@@ -132,7 +135,7 @@ char* Rivet_MakeCacheKey (apr_pool_t*
 }
 
 /*
- * -- Rivet_CacheEntryLookup
+ * -- RivetCache_EntryLookup
  *
  * Cache entry lookiup. A hash table lookup key is created and an entry
  * searched in the cache. If an entry is not found the function returns NULL
@@ -148,7 +151,7 @@ char* Rivet_MakeCacheKey (apr_pool_t*
  *
  */
 
-Tcl_HashEntry* Rivet_CacheEntryLookup (rivet_thread_interp* rivet_interp,char* hashKey,int* isNew)
+Tcl_HashEntry* RivetCache_EntryLookup (rivet_thread_interp* rivet_interp,char* hashKey,int* isNew)
 {
     Tcl_HashEntry*  entry = NULL;
 
@@ -158,7 +161,7 @@ Tcl_HashEntry* Rivet_CacheEntryLookup (r
 }
 
 /*
- * -- Rivet_CacheFetchScript
+ * -- RivetCache_FetchScript
  *
  * Cache entry lookiup. A hash table lookup key is created and an entry
  * searched in the cache. If an entry is not found the function returns NULL
@@ -172,16 +175,16 @@ Tcl_HashEntry* Rivet_CacheEntryLookup (r
  * Side Effects:
  *
  */
-Tcl_Obj* Rivet_CacheFetchScript (Tcl_HashEntry* entry)
+Tcl_Obj* RivetCache_FetchScript (Tcl_HashEntry* entry)
 {
     return (Tcl_Obj *)Tcl_GetHashValue(entry);
 }
 
-/* -- Rivet_CacheStoreScript 
+/* -- RivetCache_StoreScript 
  *
  */
 
-int Rivet_CacheStoreScript(rivet_thread_interp* rivet_interp, Tcl_HashEntry* entry, Tcl_Obj* script)
+int RivetCache_StoreScript(rivet_thread_interp* rivet_interp, Tcl_HashEntry* entry, Tcl_Obj* script)
 {
     if (rivet_interp->cache_size) {
 

Propchange: tcl/rivet/trunk/src/mod_rivet_ng/mod_rivet_cache.c
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: tcl/rivet/trunk/src/mod_rivet_ng/mod_rivet_cache.h
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/src/mod_rivet_ng/mod_rivet_cache.h?rev=1775412&r1=1775411&r2=1775412&view=diff
==============================================================================
--- tcl/rivet/trunk/src/mod_rivet_ng/mod_rivet_cache.h (original)
+++ tcl/rivet/trunk/src/mod_rivet_ng/mod_rivet_cache.h Wed Dec 21 13:14:51 2016
@@ -21,15 +21,15 @@
 #ifndef __mod_rivet_cache_h__
 #define __mod_rivet_cache_h__
 
-EXTERN void  Rivet_CreateCache (apr_pool_t *p, rivet_thread_interp* interp_obj);
-EXTERN void  Rivet_CacheCleanup (rivet_thread_private* private,rivet_thread_interp* rivet_interp);
-EXTERN char* Rivet_MakeCacheKey (apr_pool_t* pool, char*         filename,
-                                                      time_t        ctime, 
-                                                      time_t        mtime,
-                                                      unsigned int  user_conf,
-                                                      int           toplevel);
-EXTERN Tcl_HashEntry* Rivet_CacheEntryLookup (rivet_thread_interp* rivet_interp,char* hashKey,int* isNew);
-EXTERN Tcl_Obj* Rivet_CacheFetchScript (Tcl_HashEntry* entry);
-EXTERN int Rivet_CacheStoreScript(rivet_thread_interp* rivet_interp, Tcl_HashEntry* entry, Tcl_Obj* script);
+EXTERN void  RivetCache_Create  (apr_pool_t *p, rivet_thread_interp* interp_obj);
+EXTERN void  RivetCache_Cleanup (rivet_thread_private* private,rivet_thread_interp* rivet_interp);
+EXTERN char* RivetCache_MakeKey (apr_pool_t* pool, char*         filename,
+                                                   time_t        ctime, 
+                                                   time_t        mtime,
+                                                   unsigned int  user_conf,
+                                                   int           toplevel);
+EXTERN Tcl_HashEntry* RivetCache_EntryLookup (rivet_thread_interp* rivet_interp,char* hashKey,int* isNew);
+EXTERN Tcl_Obj* RivetCache_FetchScript (Tcl_HashEntry* entry);
+EXTERN int RivetCache_StoreScript(rivet_thread_interp* rivet_interp, Tcl_HashEntry* entry, Tcl_Obj* script);
 
 #endif /* __mod_rivet_cache_h__ */

Modified: tcl/rivet/trunk/src/mod_rivet_ng/mod_rivet_common.c
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/src/mod_rivet_ng/mod_rivet_common.c?rev=1775412&r1=1775411&r2=1775412&view=diff
==============================================================================
--- tcl/rivet/trunk/src/mod_rivet_ng/mod_rivet_common.c (original)
+++ tcl/rivet/trunk/src/mod_rivet_ng/mod_rivet_common.c Wed Dec 21 13:14:51 2016
@@ -28,6 +28,7 @@
 #include <unistd.h>
 
 #include "mod_rivet.h"
+#include "mod_rivet_cache.h"
 #include "rivetChannel.h"
 #include "mod_rivet_common.h"
 #include "TclWeb.h"
@@ -292,7 +293,7 @@ rivet_thread_interp* Rivet_NewVHostInter
     // Initialize cache structures
 
     if (interp_obj->cache_size) {
-        Rivet_CreateCache(pool,interp_obj); 
+        RivetCache_Create(pool,interp_obj); 
     }
 
     interp_obj->flags           = 0;

Modified: tcl/rivet/trunk/src/mod_rivet_ng/mod_rivet_generator.c
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/src/mod_rivet_ng/mod_rivet_generator.c?rev=1775412&r1=1775411&r2=1775412&view=diff
==============================================================================
--- tcl/rivet/trunk/src/mod_rivet_ng/mod_rivet_generator.c (original)
+++ tcl/rivet/trunk/src/mod_rivet_ng/mod_rivet_generator.c Wed Dec 21 13:14:51 2016
@@ -301,7 +301,7 @@ Rivet_SendContent(rivet_thread_private *
     if (USER_CONF_UPDATED(private->running_conf) && (interp_obj->cache_size != 0) && 
                                                     (interp_obj->cache_free < interp_obj->cache_size)) 
     {
-        Rivet_CacheCleanup(private,interp_obj);
+        RivetCache_Cleanup(private,interp_obj);
     }
 
     /* URL referenced script execution and exception handling */

Modified: tcl/rivet/trunk/src/mod_rivet_ng/rivetCore.c
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/src/mod_rivet_ng/rivetCore.c?rev=1775412&r1=1775411&r2=1775412&view=diff
==============================================================================
--- tcl/rivet/trunk/src/mod_rivet_ng/rivetCore.c (original)
+++ tcl/rivet/trunk/src/mod_rivet_ng/rivetCore.c Wed Dec 21 13:14:51 2016
@@ -281,13 +281,13 @@ TCL_CMD_HEADER( Rivet_Parse )
     /* */
 
     cache_key = 
-        Rivet_MakeCacheKey( private->pool,
+        RivetCache_MakeKey( private->pool,
                             private->r->filename,
                             finfo_b.ctime,finfo_b.mtime,
                             IS_USER_CONF(private->running_conf),0);
 
     rivet_interp = RIVET_PEEK_INTERP(private,private->running_conf);
-    entry = Rivet_CacheEntryLookup (rivet_interp,cache_key,&isNew);
+    entry = RivetCache_EntryLookup (rivet_interp,cache_key,&isNew);
 
     if (isNew)
     {
@@ -301,9 +301,9 @@ TCL_CMD_HEADER( Rivet_Parse )
             return result;
         }
         
-        Rivet_CacheStoreScript(rivet_interp,entry,script);
+        RivetCache_StoreScript(rivet_interp,entry,script);
     } else {
-        script = Rivet_CacheFetchScript(entry);
+        script = RivetCache_FetchScript(entry);
     }
 
     return Tcl_EvalObjEx(interp,script,0); 
@@ -1842,9 +1842,9 @@ TCL_CMD_HEADER( Rivet_UrlScript )
     rivet_interp = RIVET_PEEK_INTERP(private,private->running_conf);
     ctime = private->r->finfo.ctime;
     mtime = private->r->finfo.mtime;
-    cache_key = Rivet_MakeCacheKey(private->pool,private->r->filename,ctime,mtime,user_conf,1);
+    cache_key = RivetCache_MakeKey(private->pool,private->r->filename,ctime,mtime,user_conf,1);
 
-    entry = Rivet_CacheEntryLookup (rivet_interp,cache_key,&isNew);
+    entry = RivetCache_EntryLookup (rivet_interp,cache_key,&isNew);
     if (isNew)
     {
         Tcl_Interp*     interp;
@@ -1890,11 +1890,11 @@ TCL_CMD_HEADER( Rivet_UrlScript )
         }
     */
 
-        Rivet_CacheStoreScript(rivet_interp,entry,script);
+        RivetCache_StoreScript(rivet_interp,entry,script);
     }
     else
     {
-        script = Rivet_CacheFetchScript(entry);
+        script = RivetCache_FetchScript(entry);
     }
 
     Tcl_SetObjResult(rivet_interp->interp, script);

Modified: tcl/rivet/trunk/src/mod_rivet_ng/worker_prefork_common.c
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/src/mod_rivet_ng/worker_prefork_common.c?rev=1775412&r1=1775411&r2=1775412&view=diff
==============================================================================
--- tcl/rivet/trunk/src/mod_rivet_ng/worker_prefork_common.c (original)
+++ tcl/rivet/trunk/src/mod_rivet_ng/worker_prefork_common.c Wed Dec 21 13:14:51 2016
@@ -25,6 +25,7 @@
 #include <apr_strings.h>
 #include "mod_rivet.h"
 #include "mod_rivet_common.h"
+#include "mod_rivet_cache.h"
 #include "worker_prefork_common.h"
 
 extern mod_rivet_globals* module_globals;
@@ -51,7 +52,7 @@ Rivet_DuplicateVHostInterp(apr_pool_t* p
     /* TODO: decouple cache by creating a new cache object */
 
     if (interp_obj->cache_size) {
-        Rivet_CreateCache(pool,interp_obj); 
+        RivetCache_Create(pool,interp_obj); 
     }
 
     interp_obj->pool            = source_obj->pool;



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