if (!load_fmt_file ())
{
+#ifdef COMPACTFORMAT
+ gzclose(gz_fmt_file);
+#else
w_close(fmt_file);
+#endif
goto lab9999;
}
+#ifdef COMPACTFORMAT
+ gzclose(gz_fmt_file);
+#else
w_close(fmt_file);
+#endif
while ((cur_input.loc_field < cur_input.limit_field) &&
(buffer[cur_input.loc_field] == ' '))
print_int(dyn_used);
k = active_base;
+
do
{
j = k;
dump_int(trie_used[k]);
}
}
+
dump_int(interaction);
dump_int(format_ident);
dump_int(ENDFMTCHECKSUM); /* magic checksum end of FMT file --- change ??? */
tracing_stats = 0;
+#ifdef COMPACTFORMAT
+ gzclose(gz_fmt_file);
+#else
w_close(fmt_file);
+#endif
}
#endif /* INITEX */
# Release version
# CFLAGS=/c /Ge /Gy /Gf /Ox /W4 /DMSDOS /DTeX /DPHARLAP /DNDEBUG /Ilib /YX
CFLAGS=/nologo /c /MT /GF /Gy /Ox /W4 /DMSDOS /DTeX /DPHARLAP /DNDEBUG \
- /I"kpathsea" /I"libharu/include" /I"libharu/win32/include"
+ /I"kpathsea" /I"libharu/include" /I"libharu/win32/include" /I"zlib"
# Debugging version
# CFLAGS=/c /Ge /Gy /Gf /Od /Zi /W4 /DMSDOS /DTeX /DPHARLAP /Ilib /YX
{
format_file = xstrdup((char *) name_of_file + 1);
}
+
+#ifdef COMPACTFORMAT
+ gz_fmt_file = gzdopen(fileno(*f), "rbR9");
+#endif
}
else if (strstr((char *)name_of_file+1, ".tfm") != NULL)
{
}
}
+#ifdef COMPACTFORMAT
+ if (strstr((char *) name_of_file + 1, ".fmt") != NULL)
+ {
+ gz_fmt_file = gzdopen(fileno(*f), "wbR9");
+ }
+#endif
+
if (strstr((char *) name_of_file + 1, ".dvi") != NULL)
{
if (qualified(name_of_file + 1))
/* make hash table htwo_halves == 32 bit instead of two_halves == 64 bit */
/* increase trie_op_size from 751 to 3001 96/Oct/12 */
#define INCREASETRIEOP
+#define COMPACTFORMAT
/* With old PharLap linker it was important to avoid large fixed allocation */
EXTERN bool long_help_seen;
EXTERN str_number format_ident;
EXTERN word_file fmt_file;
+EXTERN gzFile gz_fmt_file;
EXTERN integer ready_already;
EXTERN alpha_file write_file[16]; /* hard wired limit in TeX */
#define w_open_out b_open_out
#define b_close a_close
#define w_close a_close
+#define gz_w_close gzclose
/* sec 0241 */
#define fix_date_and_time() get_date_and_time (&(tex_time), &(day), &(month), &(year))
#define dump_default_length format_default_length
#define main_program texbody
#define edit_value tex_edit_value
-#define edit_var "UFYFEJU" /* shrouded 93/Nov/20 */
+#define edit_var "UFYFEJU"
-extern char * replacement[]; /* pointers to replacement strings */
+extern char * replacement[];
#ifdef FUNNY_CORE_DUMP
void funny_core_dump (void);
swap_items (p, nitems, item_size);
#endif
+#ifdef COMPACTFORMAT
+ if (gzwrite(gz_fmt_file, p, (item_size * nitems)) != (item_size * nitems))
+#else
if ((int) fwrite (p, item_size, nitems, out_file) != nitems)
+#endif
{
show_line("\n", 0);
sprintf(log_line, "! Could not write %d %d-byte item%s.\n",
/* Here is the dual of the writing routine. */
int do_undump (char *p, int item_size, int nitems, FILE *in_file)
{
+#ifdef COMPACTFORMAT
+ if (gzread(gz_fmt_file, (void *) p, (unsigned int) (item_size * nitems)) <= 0)
+#else
if ((int) fread((void *) p, item_size, nitems, in_file) != nitems)
+#endif
{
show_line("\n", 0);
sprintf(log_line, "! Could not read %d %d-byte item%s.\n",
#else
#include <unistd.h>
#endif
+#include <zlib.h>
#include "hpdf.h"
#include "hpdf_utils.h"
#define fabs(x) ((x) >= 0.0 ? (x) : -(x))
#define PATHMAX PATH_MAX
#define toint(x) ((integer) (x))
-#define a_open_in(f,p) open_input (&(f), p, FOPEN_R_MODE)
+#define a_open_in(f, p) open_input (&(f), p, FOPEN_R_MODE)
#define a_open_out(f) open_output (&(f), FOPEN_W_MODE)
-#define a_close(f) check_fclose (f)
+#define a_close(f) check_fclose (f)
#define MAXLINE 256 // for log_line buffer