mirror of
https://github.com/ProgramSnail/Lama.git
synced 2025-12-05 22:38:44 +00:00
add new function for debug in Lama: LprintfPerrror --- synonym for fprintf(perror,...)
This commit is contained in:
parent
7541ea64c2
commit
539e9712e5
2 changed files with 16 additions and 2 deletions
|
|
@ -23,6 +23,7 @@ F,regexpMatch;
|
||||||
F,sprintf;
|
F,sprintf;
|
||||||
F,makeString;
|
F,makeString;
|
||||||
F,printf;
|
F,printf;
|
||||||
|
F,printfPerror;
|
||||||
F,fprintf;
|
F,fprintf;
|
||||||
F,fopen;
|
F,fopen;
|
||||||
F,fclose;
|
F,fclose;
|
||||||
|
|
|
||||||
|
|
@ -987,6 +987,19 @@ extern void Lfailure (char *s, ...) {
|
||||||
vfailure(s, args);
|
vfailure(s, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern void LprintfPerror (char *s, ...) {
|
||||||
|
va_list args = (va_list)BOX(NULL);
|
||||||
|
|
||||||
|
ASSERT_STRING("printfPerror:1", s);
|
||||||
|
|
||||||
|
va_start(args, s);
|
||||||
|
fix_unboxed(s, args);
|
||||||
|
|
||||||
|
if (vfprintf(stderr, s, args) < 0) { failure("printfPerror (...): %s\n", strerror(errno)); }
|
||||||
|
|
||||||
|
fflush(stderr);
|
||||||
|
}
|
||||||
|
|
||||||
extern void Bmatch_failure (void *v, char *fname, int line, int col) {
|
extern void Bmatch_failure (void *v, char *fname, int line, int col) {
|
||||||
createStringBuf();
|
createStringBuf();
|
||||||
printValue(v);
|
printValue(v);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue