This is the mail archive of the
docbook-apps@lists.oasis-open.org
mailing list .
Re: Need help including c source
- To: docbook <docbook-apps at lists dot oasis-open dot org>
- Subject: Re: DOCBOOK-APPS: Need help including c source
- From: "Juan R. Migoya" <jmigoya at ingeteam dot es>
- Date: Thu, 18 Oct 2001 18:21:17 +0200
- Cc: Eric Richardson <eric dot richardson at milagrosoft dot com>
- List-Id: <docbook-apps.lists.oasis-open.org>
- Organization: TEAM S.L.
- References: <3BCEFF81.5060801@milagrosoft.com>
<!ENTITY myfunc SYSTEM "myfunc.c">
should be:
<!ENTITY % myfunc SYSTEM "myfunc.c">
Perhaps you can ommit CDATA.
Regards
Juan R.Migoya
SPAIN
Eric Richardson wrote:
>
> Hi,
> I'm trying to include C source into docbook but I'm having problems with
> the #include <stdio.h>. I really would like to have the source compile
> as is and include as is into the document.
>
> I did something like this but then the entity doesn't get included.
>
> <!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
> "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [
> <!ENTITY myfunc SYSTEM "myfunc.c">
> ]>
> <chapter>
> <title>Exceptions</title>
>
> <programlisting>
> <![CDATA[&myfunc;]]>
> </programlisting>
>
> </chapter>
>
> If I leave out the CDATA then it won't parse.
>
> Thanks for any help,
> Eric
>
> myfunc.c
> #include <stdio.h>
>
> int myfunc(int value) {
> if (value == 4) {
> return 0;
> }
> return 1;
> }
>
> int main() {
> int error = myfunc(4);
> if (error != 0) {
> /* handle problem */
> printf("myfunc problem\n");
> }
> /* continue */
> printf("myfunc okay\n");
> error = myfunc(3);
> if (error != 0) {
> printf("myfunc problem\n");
> }
> return 0;
> }
>
> ----------------------------------------------------------------
> To subscribe or unsubscribe from this elist use the subscription
> manager: <http://lists.oasis-open.org/ob/adm.pl>
----------------------------------------------------------------
To subscribe or unsubscribe from this elist use the subscription
manager: <http://lists.oasis-open.org/ob/adm.pl>