From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29765 invoked by alias); 8 Jun 2017 23:14:17 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 41257 Received: (qmail 29451 invoked from network); 8 Jun 2017 23:14:17 -0000 X-Qmail-Scanner-Diagnostics: from mail-ua0-f177.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(209.85.217.177):SA:0(-0.0/5.0):. Processed in 1.428872 secs); 08 Jun 2017 23:14:17 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_PASS,T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: schaefer@brasslantern.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.217.177 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version; bh=pUaaQT2WRF2F3CupDMmfYhhuNnvL4cWMiBaRKKJ1Tjo=; b=u6oGteMhzTTrOilxbT+jshmhnZIcv8B564L34rN2PGKepRKNOjBKZav0j/7BDFDcga 76ewKH46QUNo9Lkqg+Nhw5eS3mg+BU8rd+d40p7rvfnfxni16SMf4pZ6EyV9nPohk+OP adng3x2zHR1KS0d+RzWDO8Ga3IeFO2Lu+W7O9OKK+3svMthDHK8HIVHS9Q/nKzHWQCgK PeRQq5LwYG7RNznNWJjxeGOziV5emZtmxP/hoMMVryyfA92O9exR1uD1gpYOT/JFPA93 7ih904JJfdmDzWGfP2cqJ+83Fqk6isxoF0IifcdYiW93r9dJBVOIRX6xRTknu1MmJTKk cThQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:date:in-reply-to:comments :references:to:subject:mime-version; bh=pUaaQT2WRF2F3CupDMmfYhhuNnvL4cWMiBaRKKJ1Tjo=; b=TDDRNkBo6hYOLOGZa3uyUUaTjKiUqhcbeMoyCjrtYdMPV5lFAPkaf/GzJ9s/p6nj2q nRkPo325rAjRFIHlfkExT5DC+Z13Fa1fuVSnimg1+pNMbogv0TnjA5p3HyCzcmvzA9q+ 7oArmerJptyLSImuYyWDE3Cg9gGAZBr9UeHXWa4Jtid6ntDIVB2DrnLrHLkIe5m+Esbh dlMAcYC2kGvNewrvGzygKtXEroA2xe0iFMx3N1I1IgZpKFiM+Kw65KOgMR99vP8L4IyC ZHpDCGPoWSCNJo/mmGVepu8+d7MGzQ2XJAyjDdAfEGioyvjRxCTVAGw9ZEOIy6z82le6 X9uw== X-Gm-Message-State: AODbwcDgglQHch+hLBtzt8iLUsQ0AcXIRcECSEunikAHCxJIi+STIgwZ wqcYx17p/zGCbmaszDc= X-Received: by 10.176.7.5 with SMTP id h5mr18921340uah.147.1496963649088; Thu, 08 Jun 2017 16:14:09 -0700 (PDT) From: Bart Schaefer Message-Id: <170608161436.ZM21724@torch.brasslantern.com> Date: Thu, 8 Jun 2017 16:14:36 -0700 In-Reply-To: Comments: In reply to Sebastian Gniazdowski "Re: Return value from execstring(), or construct Options for a builtin?" (Jun 8, 12:04pm) References: <170607091113.ZM17152@torch.brasslantern.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-workers@zsh.org Subject: Re: Return value from execstring(), or construct Options for a builtin? MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Jun 8, 12:04pm, Sebastian Gniazdowski wrote: } Subject: Re: Return value from execstring(), or construct Options for a bu } } I think I got it. I declare the following in db.c: } } /* For casts, as below mod_export variables are void-no-arguments */ } typedef int (*DbBackendEntryPoint)(VA_ALIST1(int cmd)); } } ... } } There are three custom "db/custom[0-9]" backends. Large step in the right direction, good. I would suggest creating a hash table object in db.c whose keys are the strings passed to "ztie -d" and whose values are structs containing a DbBackendEntryPoint pointer. Then provide callable routines that can be invoked from the db module setup_ / cleanup_ functions to add/remove an entry point. By making it a struct we can later expand to more than one entry point per module if that turns out to be useful.