X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/halibut/blobdiff_plain/7e976207d0b19baf112b216d64a8cf6a8af1069f..1b7bf71527db15176bb109ad097d4796068521c1:/error.c?ds=sidebyside diff --git a/error.c b/error.c index 42eea37..879d081 100644 --- a/error.c +++ b/error.c @@ -16,8 +16,9 @@ static void do_error(int code, va_list ap) { char error[1024]; char c; + int i, j; char *sp, *sp2; - wchar_t *wsp; + wchar_t *wsp, *wsp2; filepos fpos, fpos2; int flags; @@ -116,6 +117,11 @@ static void do_error(int code, va_list ap) { sprintf(error, "expected `}' after cross-reference"); flags = FILEPOS; break; + case err_codequote: + fpos = *va_arg(ap, filepos *); + sprintf(error, "unable to nest \\q{...} within \\c{...} or \\cw{...}"); + flags = FILEPOS; + break; case err_missingrbrace: fpos = *va_arg(ap, filepos *); sprintf(error, "unclosed braces at end of paragraph"); @@ -136,6 +142,20 @@ static void do_error(int code, va_list ap) { sprintf(error, "unable to nest index markings"); flags = FILEPOS; break; + case err_indexcase: + fpos = *va_arg(ap, filepos *); + wsp = va_arg(ap, wchar_t *); + sp = utoa_locale_dup(wsp); + fpos2 = *va_arg(ap, filepos *); + wsp2 = va_arg(ap, wchar_t *); + sp2 = utoa_locale_dup(wsp2); + sprintf(error, "warning: index tag `%.200s' used with ", sp); + sprintf(error + strlen(error), "different case (`%.200s') at %s:%d", + sp2, fpos2.filename, fpos2.line); + flags = FILEPOS; + sfree(sp); + sfree(sp2); + break; case err_nosuchkw: fpos = *va_arg(ap, filepos *); wsp = va_arg(ap, wchar_t *); @@ -221,6 +241,14 @@ static void do_error(int code, va_list ap) { " node names; removing", c); flags = FILEPOS; break; + case err_text_codeline: + fpos = *va_arg(ap, filepos *); + i = va_arg(ap, int); + j = va_arg(ap, int); + sprintf(error, "warning: code paragraph line is %d chars wide, wider" + " than body width %d", i, j); + flags = FILEPOS; + break; case err_whatever: sp = va_arg(ap, char *); vsprintf(error, sp, ap);