zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-workers@zsh.org
Subject: Re: Return value from execstring(), or construct Options for a builtin?
Date: Thu, 8 Jun 2017 16:14:36 -0700	[thread overview]
Message-ID: <170608161436.ZM21724@torch.brasslantern.com> (raw)
In-Reply-To: <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.


  reply	other threads:[~2017-06-08 23:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-07 10:20 Sebastian Gniazdowski
2017-06-07 16:11 ` Bart Schaefer
2017-06-08 10:04   ` Sebastian Gniazdowski
2017-06-08 23:14     ` Bart Schaefer [this message]
2017-06-08 23:31       ` Bart Schaefer
2017-06-09  8:53       ` Sebastian Gniazdowski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=170608161436.ZM21724@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).