Wrapping gnupg for Tcl

Jonathan Hayward jshayward at pobox.com
Wed Jul 18 05:04:02 CEST 2001


Werner Koch wrote:

> On Tue, 17 Jul 2001 13:11:27 -0500, Jonathan Hayward said:
>
> > to be executed from within another program)? Is there experience with e.g.
> > why it would exit on 2nd and subsequent invocations if used from within
> > another program? I'm resetting global variables, if that helps.
>
> Are you sure that you are zeroing out the BSS?  Anyway, GnuPG is not
> designed to be turned into a library.
>

What's the BSS? I zeroed the jmp_buf, and one other value declared as extern in
main.h; I've presumably missed something, as it behaves differently on the 2nd
invocation, but what?

>
> What you have to do is: Run the code from main once and break out the
> big switch over the commands so that you can just run this switch on
> further invocations.  Well, you have to make sure that all variable
> stuff setup before that switch does not change or you must somehow
> adjust this initialization.  Simply running main() multiple times
> won't work.
>

I've moved the switch; most of the switch is

    case foo: set_cmd(&cmd, foo); break;

but there are other variables set.  How do I deal with that? Comment out things
that don't meet this pattern (and leave in main a trimmed-down switch to pick
up the slack?) Giving the switch a long signature with pointers to all those
values looks like a losing solution; I could also make the variables global.

>
> --
> Werner Koch        Omnis enim res, quae dando non deficit, dum habetur
> g10 Code GmbH      et non datur, nondum habetur, quomodo habenda est.
> Privacy Solutions                                        -- Augustinus
>
> _______________________________________________
> Gnupg-devel mailing list
> Gnupg-devel at gnupg.org
> http://lists.gnupg.org/mailman/listinfo/gnupg-devel

--
Jonathan Hayward
jshayward at pobox.com
http://JonathansCorner.com


-------------- next part --------------
An HTML attachment was scrubbed...
URL: /pipermail/attachments/20010718/6d072e5a/attachment.htm


More information about the Gnupg-devel mailing list