Return-Path: Delivered-To: apmail-httpd-modules-dev-archive@locus.apache.org Received: (qmail 85006 invoked from network); 12 Oct 2006 13:49:25 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 12 Oct 2006 13:49:25 -0000 Received: (qmail 14456 invoked by uid 500); 12 Oct 2006 13:49:21 -0000 Delivered-To: apmail-httpd-modules-dev-archive@httpd.apache.org Received: (qmail 14430 invoked by uid 500); 12 Oct 2006 13:49:21 -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 14403 invoked by uid 99); 12 Oct 2006 13:49:21 -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:49:21 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: local policy) Received: from [80.229.52.226] (HELO asgard.webthing.com) (80.229.52.226) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 Oct 2006 06:49:20 -0700 Received: from asgard (asgard [192.168.1.2]) by asgard.webthing.com (Postfix) with ESMTP id 01C5F6455A for ; Thu, 12 Oct 2006 14:48:58 +0100 (BST) From: Nick Kew Organization: WebThing Ltd To: modules-dev@httpd.apache.org Subject: Re: Share data between modules Date: Thu, 12 Oct 2006 14:48:56 +0100 User-Agent: KMail/1.9.1 References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200610121448.58450.nick@webthing.com> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N On Thursday 12 October 2006 14:37, m.spinetti@pisa.iol.it wrote: > 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? apr_hash_t* get_hash(server_rec* s) { server_cfg* cfg = ap_get_module_config(s->module_config, &exporting_module); return cfg->hash; } Or variants thereupon. -- Nick Kew Application Development with Apache - the Apache Modules Book http://www.prenhallprofessional.com/title/0132409674