Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Return value from execstring(), or construct Options for a builtin?
- X-seq: zsh-workers 41257
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: Return value from execstring(), or construct Options for a builtin?
- Date: Thu, 8 Jun 2017 16:14:36 -0700
- 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==
- In-reply-to: <etPan.59392116.2eb141f2.8e19@MacMini.local>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <etPan.5937d363.6b8b4567.2787@MacMini.local> <170607091113.ZM17152@torch.brasslantern.com> <etPan.59392116.2eb141f2.8e19@MacMini.local>
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.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author