I would use <code>const char *</code> here, at least for input.

Is failure supposed to contain a message if the evaluation fails? How do we know peg will not write a longer message than we have allocated for?