Re: gprolog extended via C interface ignores command-line interface arguments
Daniel Diaz <[email protected]> Tue, 9 Jan 2018 16:04:54 +0100
| Newsgroups | gmane.comp.gnu.prolog.bugs |
|---|---|
| Message-ID | <[email protected]> |
--===============4398276912143192229==
Content-Type: text/html; charset=utf-8
Content-Language: en-US
Content-Transfer-Encoding: quoted-printable
<html>
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dutf=
-8">
</head>
<body text=3D"#000000" bgcolor=3D"#FFFFFF">
<div class=3D"moz-cite-prefix">Hi Simon,<br>
<br>
sorry for the late reply.<br>
<br>
The top-level is a specific application which its own main()
(testing filtering command-line arguments to handle some like
--query-goal).<br>
It is not the case of user defined application for which the
default main() does not scan the command-line (the user is free to
use any command).<br>
Your executable is such an application, only the default main() is
used.<br>
<br>
To provide an executable with your own C code which behaves like
the actual top-level (resulting in an augmented top-level with new
functionalities built-in) it is necessary to add a compiler option
(e.g. --new-top-level) to force the inclusion of the top-level
main(). <br>
Do you need this ?<br>
<br>
Daniel<br>
<br>
<br>
<br>
Le 02/12/2017 =C3=A0 07:14, Simon Curry a =C3=A9crit=C2=A0:<br>
</div>
<blockquote type=3D"cite"
cite=3D"mid:[email protected]">
<meta http-equiv=3D"content-type" content=3D"text/html; charset=3Du=
tf-8">
<p>Hi,</p>
<p>I am using:</p>
<p>GNU Prolog 1.4.4 (64 bits)<br>
Compiled Dec=C2=A0 1 2017, 19:56:55 with gcc<br>
By Daniel Diaz<br>
Copyright (C) 1999-2013 Daniel Diaz</p>
<p>running on a ubuntu machine:</p>
<p>Linux simon-Leopard-Extreme 4.4.0-98-generic #121-Ubuntu SMP
Tue Oct 10 14:24:03 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux<br>
</p>
<p>I am extending gprolog with a significant library of crypto
functions in C and in general this works very well. The only
exception is that the new instance of gprolog, extended with
these functions ignores the '--init-goal', '--query-goal'
command line arguments. These are useful for running the prolog
application from a cron job, for example.</p>
<p>"Fortunately", <b>your own example</b> in
/usr/local/gprolog-1.4.4/examples/ExamplesC manifests the same
problem, so I need not burden you with all of my code.</p>
<p>For example, when I build your example and compare the
operation of the new executable with that of the base gprolog, I
get:</p>
<p><br>
</p>
<p>sjswc@simon-Leopard-Extreme:ExamplesC$ gprolog --query-goal
"format('Hi Mom', [])"<br>
GNU Prolog 1.4.4 (64 bits)<br>
Compiled May 15 2017, 21:17:39 with gcc<br>
By Daniel Diaz<br>
Copyright (C) 1999-2013 Daniel Diaz<br>
| ?- format('Hi Mom', []).<br>
Hi Mom<br>
<br>
yes<br>
| ?- <br>
<br>
</p>
<p>sjswc@simon-Leopard-Extreme:ExamplesC$ ./examp --query-goal
"format('Hi Mom', [])"<br>
GNU Prolog 1.4.4 (64 bits)<br>
Compiled May 15 2017, 21:17:39 with gcc<br>
By Daniel Diaz<br>
Copyright (C) 1999-2013 Daniel Diaz<br>
| ?-<br>
</p>
<p>Everything else works perfectly. Have I misunderstood what is
supposed to happen or is this a bug?<br>
</p>
<p>Regards</p>
<p>Simon Curry<br>
</p>
<br>
<fieldset class=3D"mimeAttachmentHeader"></fieldset>
<br>
<pre wrap=3D"">_______________________________________________
Bug-prolog mailing list
<a class=3D"moz-txt-link-abbreviated" href=3D"mailto:[email protected]">=
[email protected]</a>
<a class=3D"moz-txt-link-freetext" href=3D"https://lists.gnu.org/mailman/=
listinfo/bug-prolog">https://lists.gnu.org/mailman/listinfo/bug-prolog</a=
>
</pre>
</blockquote>
<p><br>
</p>
</body>
</html>
--===============4398276912143192229==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
Bug-prolog mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-prolog
--===============4398276912143192229==--