This PR adds a new API function char *texerrors_str(), which is similar to texerrors() but returns a string (of ;-delimited error messages) rather than printing to stderr.
Rationale: returning a string makes it easier for the caller to decide what to do with the error message, and is especially important for calling from higher-level languages where the error message is typically wrapped in a thrown exception. (cc @Suavesito-Olimpiada)
It adds a test script testerrors.sh to check that it is working. I also updated the test scripts so that they use a $utftex environment variable (set by the Makefile) rather than running utftex from the $PATH. On my machine, make check gives:
This PR adds a new API function
char *texerrors_str()
, which is similar totexerrors()
but returns a string (of;
-delimited error messages) rather than printing tostderr
.Rationale: returning a string makes it easier for the caller to decide what to do with the error message, and is especially important for calling from higher-level languages where the error message is typically wrapped in a thrown exception. (cc @Suavesito-Olimpiada)
It adds a test script
testerrors.sh
to check that it is working. I also updated the test scripts so that they use a$utftex
environment variable (set by theMakefile
) rather than runningutftex
from the$PATH
. On my machine,make check
gives:Plus a couple of other minor cleanups: I added a
.gitignore
file, and added a missing fileerrormessages.h
to the list ofBUILT_SOURCES
.