apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bnicho...@apache.org
Subject cvs commit: apr/include/arch/netware apr_private.h
Date Fri, 22 Feb 2002 15:51:17 GMT
bnicholes    02/02/22 07:51:17

  Modified:    misc/netware start.c libprews.c
               include/arch/netware apr_private.h
  Log:
  Added APIs for storing the global memory pool and the stat cache
  
  Revision  Changes    Path
  1.4       +1 -0      apr/misc/netware/start.c
  
  Index: start.c
  ===================================================================
  RCS file: /home/cvs/apr/misc/netware/start.c,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- start.c	18 Feb 2002 05:38:32 -0000	1.3
  +++ start.c	22 Feb 2002 15:51:17 -0000	1.4
  @@ -109,6 +109,7 @@
       }
       
       apr_signal_init(pool);
  +    setGlobalPool((void*)pool);
   
       return APR_SUCCESS;
   }
  
  
  
  1.4       +51 -0     apr/misc/netware/libprews.c
  
  Index: libprews.c
  ===================================================================
  RCS file: /home/cvs/apr/misc/netware/libprews.c,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- libprews.c	31 Jan 2002 18:49:51 -0000	1.3
  +++ libprews.c	22 Feb 2002 15:51:17 -0000	1.4
  @@ -17,6 +17,8 @@
   
   typedef struct app_data {
       int     initialized;
  +    void*   gPool;
  +    void*   statCache;
   } APP_DATA;
   
   /* library-private data...*/
  @@ -147,3 +149,52 @@
       return 0;
   }
   
  +int setGlobalPool(void *data)
  +{
  +    APP_DATA *app_data = (APP_DATA*) get_app_data(gLibId);
  +
  +    NXLock(gLibLock);
  +
  +    if (app_data && !app_data->gPool) {
  +        app_data->gPool = data;
  +    }
  +
  +    NXUnlock(gLibLock);
  +    return 1;
  +}
  +
  +void* getGlobalPool()
  +{
  +    APP_DATA *app_data = (APP_DATA*) get_app_data(gLibId);
  +
  +    if (app_data) {
  +        return app_data->gPool;
  +    }
  +
  +    return NULL;
  +}
  +
  +int setStatCache(void *data)
  +{
  +    APP_DATA *app_data = (APP_DATA*) get_app_data(gLibId);
  +
  +    NXLock(gLibLock);
  +
  +    if (app_data && !app_data->statCache) {
  +        app_data->statCache = data;
  +    }
  +
  +    NXUnlock(gLibLock);
  +    return 1;
  +}
  +
  +void* getStatCache()
  +{
  +    APP_DATA *app_data = (APP_DATA*) get_app_data(gLibId);
  +
  +    if (app_data) {
  +        return app_data->statCache;
  +    }
  +
  +    return NULL;
  +}
  
  
  
  1.7       +6 -0      apr/include/arch/netware/apr_private.h
  
  Index: apr_private.h
  ===================================================================
  RCS file: /home/cvs/apr/include/arch/netware/apr_private.h,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- apr_private.h	8 Feb 2002 19:13:43 -0000	1.6
  +++ apr_private.h	22 Feb 2002 15:51:17 -0000	1.7
  @@ -168,6 +168,12 @@
   int register_NLM(void *NLMHandle);
   int unregister_NLM(void *NLMHandle);
   
  +/* Application global data management */
  +int setGlobalPool(void *data);
  +void* getGlobalPool();
  +int setStatCache(void *data);
  +void* getStatCache();
  +
   /* Redefine malloc to use the library malloc call so 
       that all of the memory resources will be owned
       and can be shared by the library. */
  
  
  

Mime
View raw message