Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Return value from execstring(), or construct Options for a builtin?



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