textio: add TxErrorV variant

This commit is contained in:
Johan Euphrosine 2023-07-12 05:18:47 +09:00
parent e249e7a0e3
commit 1bdf173391
3 changed files with 12 additions and 4 deletions

View File

@ -445,6 +445,9 @@ void CalmaReadError(char *format, ...)
{
TxError("Error while reading cell \"%s\" ", cifReadCellDef->cd_name);
TxError("(byte position %"DLONG_PREFIX"d): ", (dlong)filepos);
va_start(args, format);
TxErrorV(format, args);
va_end(args);
}
}
else if ((calmaTotalErrors == 100) && (CIFWarningLevel == CIF_WARN_LIMIT))

View File

@ -69,6 +69,7 @@ extern void TxStopMore();
/* printing procedures with variable arguments lists */
extern void TxError(char *, ...);
extern void TxErrorV(char *, va_list args);
extern void TxPrintf(char *, ...);
extern char *TxPrintString(char *, ...);

View File

@ -302,9 +302,15 @@ TxFlush()
*/
void
TxError(char *fmt, ...)
{
TxError(char *fmt, ...) {
va_list args;
va_start(args, fmt);
va_end(args);
}
void
TxErrorV(char *fmt, va_list args)
{
FILE *f;
TxFlushOut();
@ -312,7 +318,6 @@ TxError(char *fmt, ...)
f = TxMoreFile;
else
f = stderr;
va_start(args, fmt);
if (txHavePrompt)
{
TxUnPrompt();
@ -322,7 +327,6 @@ TxError(char *fmt, ...)
else {
Vfprintf(f, fmt, args);
}
va_end(args);
TxFlushErr();
}