Return-Path: Delivered-To: apmail-httpd-modules-dev-archive@locus.apache.org Received: (qmail 86791 invoked from network); 12 Oct 2006 13:55:09 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 12 Oct 2006 13:55:09 -0000 Received: (qmail 28222 invoked by uid 500); 12 Oct 2006 13:55:09 -0000 Delivered-To: apmail-httpd-modules-dev-archive@httpd.apache.org Received: (qmail 28204 invoked by uid 500); 12 Oct 2006 13:55:09 -0000 Mailing-List: contact modules-dev-help@httpd.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: modules-dev@httpd.apache.org Delivered-To: mailing list modules-dev@httpd.apache.org Received: (qmail 28193 invoked by uid 99); 12 Oct 2006 13:55:09 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 Oct 2006 06:55:09 -0700 X-ASF-Spam-Status: No, hits=0.6 required=10.0 tests=NO_REAL_NAME X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: local policy) Received: from [193.70.193.55] (HELO mail2a.webresidence.it) (193.70.193.55) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 Oct 2006 06:55:08 -0700 Received: from pisa.iol.it (193.70.193.60) by mail2a.webresidence.it (7.2.059.5) id 45003BD7000274AA for modules-dev@httpd.apache.org; Thu, 12 Oct 2006 15:54:46 +0200 Date: Thu, 12 Oct 2006 15:54:46 +0200 Message-Id: Subject: Re: Share data between modules MIME-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable From: "m.spinetti@pisa.iol.it" To: modules-dev@httpd.apache.org X-XaM3-API-Version: 1.1.9.1.25 X-SenderIP: 151.5.148.94 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Maybe I have to use it.... In module A I declare apr_hash_t; in the post config I creates and populates it. Then I write a funcion called my_function and in the register_hooks I write: APR_REGISTER_OPTIONAL_FN(my_function); Then in my file.h I write: APR_DECLARE_OPTIONAL_FN(..., my_function, ...); After that, my modules B and C can call my_function nad retrieve a value of a given key. Is it ok? Marco > Hi Nick, > > > On Thursday 12 October 2006 13:41, m.spinetti@pisa.iol.it wrote: > > > > > So my idea was that one of the three modules parses the file, creates > > > the hash_table_t and populates it. Then each child of these modules > > > should be able to read (only read e not write) the hash table. > > > Is it possible in your opinion? > > > > Of course. The module just needs to export an accessor function, > > to access either the hash itself or the value of a given key. > > Use APR_OPTIONAL if you want to keep them fully independent > > at link time. > > I'm a bit confused... I have to declare my apr_hash_t* in the module > which creates and populates it and then export an accessor function. > But how can I export an accessor function? > Where should I use APR_OPTIONAL? > > Regards > > Marco > > > > > > I suppose that I have to use apr_shm_t (and apr_rmm_init??). > > > > Erm, why? > > > > -- > > Nick Kew > > > > Application Development with Apache - the Apache Modules Book > > http://www.prenhallprofessional.com/title/0132409674 > > > >