Wrapping gnupg for Tcl

Jonathan Hayward jshayward@pobox.com
Wed Jul 18 04:04:02 2001


--------------1B2767B5234ADF0C6521FFF6
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

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@gnupg.org
> http://lists.gnupg.org/mailman/listinfo/gnupg-devel
-- Jonathan Hayward jshayward@pobox.com http://JonathansCorner.com --------------1B2767B5234ADF0C6521FFF6 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit <!doctype html public "-//w3c//dtd html 4.0 transitional//en"> <html> <body text="#000000" bgcolor="#FFFFFF" link="#0000FF" vlink="#FF0000" alink="#000088"> Werner Koch wrote: <blockquote TYPE=CITE>On Tue, 17 Jul 2001 13:11:27 -0500, Jonathan Hayward said: <p>> to be executed from within another program)? Is there experience with e.g. <br>> why it would exit on 2nd and subsequent invocations if used from within <br>> another program? I'm resetting global variables, if that helps. <p>Are you sure that you are zeroing out the BSS?&nbsp; Anyway, GnuPG is not <br>designed to be turned into a library. <br>&nbsp;</blockquote> What's the BSS? I&nbsp;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? <blockquote TYPE=CITE>&nbsp; <br>What you have to do is: Run the code from main once and break out the <br>big switch over the commands so that you can just run this switch on <br>further invocations.&nbsp; Well, you have to make sure that all variable <br>stuff setup before that switch does not change or you must somehow <br>adjust this initialization.&nbsp; Simply running main() multiple times <br>won't work. <br>&nbsp;</blockquote> I've moved the switch; most of the switch is <p>&nbsp;&nbsp;&nbsp; case foo: set_cmd(&amp;cmd, foo); break; <p>but there are other variables set.&nbsp; How do I&nbsp;deal with that?&nbsp;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. <blockquote TYPE=CITE>&nbsp; <br>-- <br>Werner Koch&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Omnis enim res, quae dando non deficit, dum habetur <br>g10 Code GmbH&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; et non datur, nondum habetur, quomodo habenda est. <br>Privacy Solutions&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- Augustinus <p>_______________________________________________ <br>Gnupg-devel mailing list <br>Gnupg-devel@gnupg.org <br><a href="http://lists.gnupg.org/mailman/listinfo/gnupg-devel">http://lists.gnupg.org/mailman/listinfo/gnupg-devel</a></blockquote> <pre>--&nbsp; Jonathan Hayward jshayward@pobox.com <A HREF="http://JonathansCorner.com">http://JonathansCorner.com</A></pre> &nbsp; </body> </html> --------------1B2767B5234ADF0C6521FFF6--