[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]
Subject: Re: DOCBOOK-APPS: Need help including c source
<!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>
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]
Powered by eList eXpress LLC