Return-Path: Delivered-To: apmail-httpd-modules-dev-archive@minotaur.apache.org Received: (qmail 16990 invoked from network); 2 Apr 2009 19:00:16 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 2 Apr 2009 19:00:16 -0000 Received: (qmail 13823 invoked by uid 500); 2 Apr 2009 19:00:16 -0000 Delivered-To: apmail-httpd-modules-dev-archive@httpd.apache.org Received: (qmail 13767 invoked by uid 500); 2 Apr 2009 19:00:15 -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 13757 invoked by uid 99); 2 Apr 2009 19:00:15 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Apr 2009 19:00:15 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of sorinm@gmail.com designates 209.85.219.162 as permitted sender) Received: from [209.85.219.162] (HELO mail-ew0-f162.google.com) (209.85.219.162) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Apr 2009 19:00:09 +0000 Received: by ewy6 with SMTP id 6so661962ewy.24 for ; Thu, 02 Apr 2009 11:59:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=ukVzy7ltMj4VLVQ2Ev9YvNx+8e45bq7gGTmKDtqI5eg=; b=Z7MJs0bV3RfxpSKXehT92Q8jVMLENV9fn6eal2RyRSMcN1/Sf/N+5SgxbwuYqpANHc FJYOaO4/ojN2p+9p2jRlxeLN4jVx/TTpTA/YEWxavGUQJz4Kqs6qwOa9jxtZteoveZel OoM0b88UXereXTPf5dvmz3x9dxDfNI2eVlVYU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=YCigoEk65KkQM3EpI6TpRV0DARChxBX4u9oX6Rvwwez3SNGPT5497apeH/g6m+M1K1 WqlnnsqSvx42yb3oB/gk4j510bghLJo09R5icy5J8lq0zjyNNz8WRGubI1NRuRKo6c2Y a57qZUh+Qv0oSrTLqMehDtHArHtw7h8N7uXNE= MIME-Version: 1.0 Received: by 10.210.78.16 with SMTP id a16mr234359ebb.28.1238698787683; Thu, 02 Apr 2009 11:59:47 -0700 (PDT) In-Reply-To: <49D4F9D1.6040006@dmi.me.uk> References: <49D4F9D1.6040006@dmi.me.uk> Date: Thu, 2 Apr 2009 20:59:47 +0200 Message-ID: <20170a030904021159j7e614bfn38ea5a9ca2791b98@mail.gmail.com> Subject: Re: APR feature detection From: Sorin Manolache To: modules-dev@httpd.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org On Thu, Apr 2, 2009 at 19:45, Dave Ingram wrote: > Hi guys, > > Is there any way that my module can detect which APR features are > enabled in Apache? It relies on DBD, and if that's not available then my > module just segfaults, which isn't very friendly. I'd prefer to give an > error message to the user, telling them that DBD is required. > > Does anyone have any tips, or should I ask the APR list instead? dbd does this: APR_REGISTER_OPTIONAL_FN(ap_dbd_prepare); APR_REGISTER_OPTIONAL_FN(ap_dbd_open); APR_REGISTER_OPTIONAL_FN(ap_dbd_close); APR_REGISTER_OPTIONAL_FN(ap_dbd_acquire); APR_REGISTER_OPTIONAL_FN(ap_dbd_cacquire); APR_RETRIEVE_OPTIONAL_FN(one of the functions above) should give you NULL if DBD is absent. The two macros are declared in apr_optional.h. S -- A: Because it reverses the logical flow of conversation. Q: Why is top-posting frowned upon? A: Top-posting. Q: What is the most annoying thing in e-mail?