This is the mail archive of the
docbook-apps@lists.oasis-open.org
mailing list .
Need help including c source
- To: docbook <docbook-apps at lists dot oasis-open dot org>
- Subject: DOCBOOK-APPS: Need help including c source
- From: Eric Richardson <eric dot richardson at milagrosoft dot com>
- Date: Thu, 18 Oct 2001 09:12:49 -0700
- List-Id: <docbook-apps.lists.oasis-open.org>
- Organization: MilagroSoft Inc.
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>