diff options
Diffstat (limited to 'Build/source/texk/web2c/hitexdir/hiformat.w')
-rw-r--r-- | Build/source/texk/web2c/hitexdir/hiformat.w | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/Build/source/texk/web2c/hitexdir/hiformat.w b/Build/source/texk/web2c/hitexdir/hiformat.w index d66e292ca53..64d45a71795 100644 --- a/Build/source/texk/web2c/hitexdir/hiformat.w +++ b/Build/source/texk/web2c/hitexdir/hiformat.w @@ -6802,9 +6802,9 @@ The big picture is captured by the |put_hint| function: @<put functions@>= static size_t hput_root(void); static size_t hput_section(uint16_t n); -static void hput_optional_sections(void); +static size_t hput_optional_sections(void); -void hput_hint(char * str) +size_t hput_hint(char * str) { size_t s; DBG(DBGBASIC,"Writing hint output %s\n",str); s=hput_banner("hint",str); @@ -6817,7 +6817,9 @@ void hput_hint(char * str) DBG(DBGDIR,@["Content section at " SIZE_F "\n"@],s); s+=hput_section(2); DBG(DBGDIR,@["Auxiliary sections at " SIZE_F "\n"@],s); - hput_optional_sections(); + s+=hput_optional_sections(); + DBG(DBGDIR,@["Total number of bytes written " SIZE_F "\n"@],s); + return s; } @ @@ -7692,8 +7694,9 @@ are described in the directory entries 3 and above to a \HINT\ file in short for \putcode @<put functions@>= -static void hput_optional_sections(void) +static size_t hput_optional_sections(void) { int i; + size_t s=0; DBG(DBGDIR,"Optional Sections\n"); for (i=3; i<=max_section_no; i++)@/ { FILE *f; @@ -7717,7 +7720,9 @@ static void hput_optional_sections(void) fclose(f); if (fsize!=dir[i].size) QUIT(@["File size " SIZE_F " does not match section[0] size %u"@],@|fsize,dir[i].size); + s=s+fsize; } + return s; } @ @@ -9298,8 +9303,11 @@ To print messages\index{message} or indicate errors, I define the following macr #include <stdio.h> extern FILE *hlog; extern uint8_t *hpos, *hstart; -#define @[LOG(...)@] @[(fprintf(hlog,__VA_ARGS__),fflush(hlog))@] -#define @[MESSAGE(...)@] @[(fprintf(hlog,__VA_ARGS__),fflush(hlog))@] +#ifndef LOG_PREFIX +#define LOG_PREFIX "HINT " +#endif +#define @[LOG(...)@] @[(fprintf(hlog,LOG_PREFIX __VA_ARGS__),fflush(hlog))@] +#define @[MESSAGE(...)@] @[(fprintf(hlog,LOG_PREFIX __VA_ARGS__),fflush(hlog))@] #define @[QUIT(...)@] (MESSAGE("ERROR: " __VA_ARGS__),fprintf(hlog,"\n"),exit(1)) #endif @@ -10689,7 +10697,7 @@ extern uint8_t hput_font_head(uint8_t f, char *n, Dimen s,@| uint16_t m, uint16 extern void hput_range_defs(void); extern void hput_xdimen_node(Xdimen *x); extern void hput_directory(void); -extern void hput_hint(char * str); +extern size_t hput_hint(char * str); extern void hput_list_size(uint32_t n, int i); extern int hcompress_depth(int n, int c); @ |