[metapost] Trying to figure out MPLib

Taco Hoekwater taco at elvenkind.com
Fri Aug 3 15:14:06 CEST 2012


On 08/03/2012 02:39 PM, Shriramana Sharma wrote:
> Until then (I'm still looking at MPLib so) I wonder why mp_execute
> requires me to input the length of the string myself. Basically I'm
> doing mp_execute ( mp, command, strlen ( command ) ) -- so can't the
> library calculate the length itself using strlen? Why put the burden
> on the API user?

For embedded zeroes, of course. I honestly thought that would be

Coming back to a remark you made earlier: the silly dependency to
libkpathsea is an error that happens because by including config.h,
which includes kpathsea/config.h, mp.w accidentally includes
kpathsea/debug.h indirectly. That last one redefines fopen() and
fclose() unless -DNO_DEBUG is passed along. Alternatively, you
could define kpse_fopen_trace() and kpse_fclose_trace() funcitons
in your own C source, then the linker will find those instead.

Sorry about this, but I never expected kpathsea to be that sneaky.

Best wishes,

More information about the metapost mailing list