The configuration object is intended for future extensions.
allow the application to override Libmarpa’s memory allocation
and fatal error handling without resorting to global
variables, and therefore in a thread-safe way.
Currently, the only function of the
class is to give
a place to put its error code.
Marpa_Config is Libmarpa’s only “major”
class which is not a time class.
There is no constructor or destructor, although
Marpa_Config objects do need to be initialized
Aside from its own accessor,
Marpa_Config objects are only used by
and no reference to their location is not kept
in any of Libmarpa’s time objects.
The intent is to that it be convenient
to have them in memory that might be deallocated
For example, they could be put on the stack.
Initialize the config information to “safe” default values. Unspecified behavior will result if an initialized configuration is used to create a grammar.
Return value: A non-negative value. Always succeeds.
Error codes are usually kept in the base grammar,
marpa_g_new() no place to put
its error code on failure.
Marpa_Config class provide such a place.
p_error_string is reserved for use by
Applications should set it to
Return value: The error code in config. Always succeeds.