diff options
Diffstat (limited to 'Build/source/texk/web2c/luatexdir')
-rw-r--r-- | Build/source/texk/web2c/luatexdir/NEWS | 2 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/lua/lnewtokenlib.c | 22 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/lua/lstatslib.c | 47 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/lua/ltexlib.c | 4 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/lua/luainit.w | 4 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/lua/luatex-api.h | 2 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/luatex.c | 4 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/luazip/src/luazip.c | 17 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/pdf/pdfgen.w | 7 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/tex/commands.h | 7 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/tex/commands.w | 7 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/tex/dumpdata.w | 2 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/tex/mainbody.w | 4 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/tex/printing.w | 4 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/utils/utils.h | 2 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/utils/utils.w | 26 |
16 files changed, 79 insertions, 82 deletions
diff --git a/Build/source/texk/web2c/luatexdir/NEWS b/Build/source/texk/web2c/luatexdir/NEWS index 37986449445..3ae7880d3bb 100644 --- a/Build/source/texk/web2c/luatexdir/NEWS +++ b/Build/source/texk/web2c/luatexdir/NEWS @@ -2310,7 +2310,7 @@ Other news: we probably introduced new problems as well). * Most (all?) files now have a corrected Copyright header, - and link in $Id: NEWS 5081 2014-11-07 18:38:33Z luigi $ and $URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/NEWS $ into the object file. + and link in $Id: NEWS 5205 2015-03-27 19:28:05Z luigi $ and $URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/NEWS $ into the object file. * Some unnecessary files were removed from the distribution. diff --git a/Build/source/texk/web2c/luatexdir/lua/lnewtokenlib.c b/Build/source/texk/web2c/luatexdir/lua/lnewtokenlib.c index 1c5806d5814..df7bebf9c67 100644 --- a/Build/source/texk/web2c/luatexdir/lua/lnewtokenlib.c +++ b/Build/source/texk/web2c/luatexdir/lua/lnewtokenlib.c @@ -218,7 +218,7 @@ static int run_scan_dimen(lua_State * L) if (t>0) inf = lua_toboolean(L,1); /* inf values allowed ?*/ if (t>1) - mu = lua_toboolean(L,2); /* mu units required ?*/ + mu = lua_toboolean(L,2); /* mu units required ?*/ save_tex_scanner(texstate); scan_dimen( mu,inf, false); /* arg3 = shortcut */ v = cur_val; @@ -572,10 +572,11 @@ static int run_scan_token(lua_State * L) /* experiment */ -/* [catcodetable] csname content : \def\csname{content} */ +/* [catcodetable] csname content : \def\csname{content} */ /* [catcodetable] csname content global : \gdef\csname{content} */ -/* [catcodetable] csname : \def\csname{} */ +/* [catcodetable] csname : \def\csname{} */ +/* TODO: check for a quick way to set a macro to empty (HH) */ static int set_macro(lua_State * L) { const char *name = null; @@ -632,9 +633,9 @@ static int set_macro(lua_State * L) t = (halfword) str2uni((const unsigned char *) str); str += utf8_size(t); cc = get_cat_code(ct,t); - /* this is a relating simple converter; if more is needed one can just use */ + /* this is a relating simple converter; if more is needed one can just use */ /* tex.print with a regular \def or \gdef and feed the string into the regular */ - /* scanner; */ + /* scanner; */ if (cc == 0) { /* we have a potential control sequence so we check for it */ int _lname = 0 ; @@ -669,7 +670,7 @@ static int set_macro(lua_State * L) } } else { /* just a character with some meaning, so \unknown becomes effectively */ - /* \\unknown assuming that \\ has some useful meaning of course */ + /* \\unknown assuming that \\ has some useful meaning of course */ t = cc * (1<<21) + t ; str = _name ; } @@ -684,11 +685,18 @@ static int set_macro(lua_State * L) /* there is no fast_store_new_token(right_brace_token) needed */ define(cs, call_cmd + (a % 4), token_link(temp_token_head)); } else { - define(cs, call_cmd + (a % 4), null); + halfword p ; + halfword q; /* new node being added to the token list via |store_new_token| */ + p = temp_token_head; + set_token_info(p,null); + fast_store_new_token(left_brace_token); + fast_store_new_token(end_match_token); + define(cs, call_cmd + (a % 4), token_link(temp_token_head)); } return 0; } + static const struct luaL_Reg tokenlib[] = { {"is_token", lua_tokenlib_is_token}, {"get_next", run_get_next}, diff --git a/Build/source/texk/web2c/luatexdir/lua/lstatslib.c b/Build/source/texk/web2c/luatexdir/lua/lstatslib.c index bafe5f37a33..3d995cefa0e 100644 --- a/Build/source/texk/web2c/luatexdir/lua/lstatslib.c +++ b/Build/source/texk/web2c/luatexdir/lua/lstatslib.c @@ -35,7 +35,7 @@ const char *last_lua_error; static const char *getbanner(void) { - return (const char *) ptexbanner; + return (const char *) luatex_banner; } static const char *getlogname(void) @@ -43,10 +43,11 @@ static const char *getlogname(void) return (const char *) texmf_log_name; } -static const char *get_pdftex_banner(void) -{ - return (const char *) pdftex_banner; -} +/* Obsolete in 0.80.0 */ +/* static const char *get_pdftex_banner(void) */ +/* { */ +/* return (const char *) pdftex_banner; */ +/* } */ static const char *get_output_file_name(void) { @@ -84,15 +85,15 @@ static const char *luatexrevision(void) return (const char *) (strrchr(luatex_version_string, '.') + 1); } -static lua_Number get_luatexhashchars(void) +static lua_Number get_luatexhashchars(void) { return (lua_Number) LUAI_HASHLIMIT; } -static const char *get_luatexhashtype(void) +static const char *get_luatexhashtype(void) { #ifdef LuajitTeX - return (const char *)jithash_hashname; + return (const char *)jithash_hashname; #else return "lua"; #endif @@ -181,6 +182,21 @@ static int luastate_max = 1; /* fixed value */ static int init_pool_ptr = 0; static struct statistic stats[] = { + + /* most likely accessed */ + + {"output_active", 'b', &output_active}, + {"best_page_break", 'n', &best_page_break}, + + {"filename", 'S', (void *) &getfilename}, + {"inputid", 'g', &(iname)}, + {"linenumber", 'g', &line}, + + {"lasterrorstring", 'S', (void *) &getlasterror}, + {"lastluaerrorstring", 'S', (void *) &getlastluaerror}, + + /* seldom or never accessed */ + {"pdf_gone", 'N', &get_pdf_gone}, {"pdf_ptr", 'N', &get_pdf_ptr}, {"dvi_gone", 'g', &dvi_offset}, @@ -189,14 +205,13 @@ static struct statistic stats[] = { {"output_file_name", 'S', (void *) &get_output_file_name}, {"log_name", 'S', (void *) &getlogname}, {"banner", 'S', (void *) &getbanner}, - {"pdftex_banner", 'S', (void *) &get_pdftex_banner}, + {"pdftex_banner", 'S', (void *) &getbanner}, {"luatex_svn", 'G', &get_luatexsvn}, {"luatex_version", 'G', &get_luatexversion}, {"luatex_revision", 'S', (void *) &luatexrevision}, {"luatex_hashtype", 'S', (void *) &get_luatexhashtype}, {"luatex_hashchars", 'N', &get_luatexhashchars}, - {"ini_version", 'b', &ini_version}, /* * mem stat @@ -243,12 +258,6 @@ static struct statistic stats[] = { {"largest_used_mark", 'g', &biggest_used_mark}, - {"filename", 'S', (void *) &getfilename}, - {"inputid", 'g', &(iname)}, - {"linenumber", 'g', &line}, - {"lasterrorstring", 'S', (void *) &getlasterror}, - {"lastluaerrorstring", 'S', (void *) &getlastluaerror}, - {"luabytecodes", 'g', &luabytecode_max}, {"luabytecode_bytes", 'g', &luabytecode_bytes}, {"luastates", 'g', &luastate_max}, @@ -256,8 +265,6 @@ static struct statistic stats[] = { {"callbacks", 'g', &callback_count}, {"indirect_callbacks", 'g', &saved_callback_count}, - {"output_active", 'b', &output_active}, - {"best_page_break", 'n', &best_page_break}, {NULL, 0, 0} }; @@ -268,7 +275,7 @@ static int stats_name_to_id(const char *name) if (strcmp(stats[i].name, name) == 0) return i; } - return 0; + return -1; } static int do_getstat(lua_State * L, int i) @@ -333,7 +340,7 @@ static int getstats(lua_State * L) if (lua_isstring(L, -1)) { st = lua_tostring(L, -1); i = stats_name_to_id(st); - if (i > 0) { + if (i >= 0) { return do_getstat(L, i); } } diff --git a/Build/source/texk/web2c/luatexdir/lua/ltexlib.c b/Build/source/texk/web2c/luatexdir/lua/ltexlib.c index 6082e337693..8883174ed2f 100644 --- a/Build/source/texk/web2c/luatexdir/lua/ltexlib.c +++ b/Build/source/texk/web2c/luatexdir/lua/ltexlib.c @@ -2415,8 +2415,8 @@ static int tex_run_boot(lua_State * L) zwclose(fmt_file); } fix_date_and_time(); - if (format == NULL) - make_pdftex_banner(); + /* if (format == NULL) */ + /* make_pdftex_banner(); */ random_seed = (microseconds * 1000) + (epochseconds % 1000000); init_randoms(random_seed); initialize_math(); diff --git a/Build/source/texk/web2c/luatexdir/lua/luainit.w b/Build/source/texk/web2c/luatexdir/lua/luainit.w index 37ec143f5b4..139b888cb8e 100644 --- a/Build/source/texk/web2c/luatexdir/lua/luainit.w +++ b/Build/source/texk/web2c/luatexdir/lua/luainit.w @@ -852,6 +852,7 @@ static void mk_suffixlist(void) } #endif + @ @c void lua_initialize(int ac, char **av) { @@ -882,8 +883,7 @@ void lua_initialize(int ac, char **av) banner = xmalloc(len); sprintf(banner, fmt, luatex_version_string, luatex_svn); } - ptexbanner = banner; - + luatex_banner = banner; kpse_invocation_name = kpse_program_basename(argv[0]); /* be 'luac' */ diff --git a/Build/source/texk/web2c/luatexdir/lua/luatex-api.h b/Build/source/texk/web2c/luatexdir/lua/luatex-api.h index 8d4f2a371d3..4313b812ae4 100644 --- a/Build/source/texk/web2c/luatexdir/lua/luatex-api.h +++ b/Build/source/texk/web2c/luatexdir/lua/luatex-api.h @@ -170,7 +170,7 @@ extern int luastate_bytes; extern int callback_count; extern int saved_callback_count; -extern const char *ptexbanner; +extern const char *luatex_banner; extern const char *last_lua_error; diff --git a/Build/source/texk/web2c/luatexdir/luatex.c b/Build/source/texk/web2c/luatexdir/luatex.c index 396b1f934de..43a53861e7f 100644 --- a/Build/source/texk/web2c/luatexdir/luatex.c +++ b/Build/source/texk/web2c/luatexdir/luatex.c @@ -26,7 +26,7 @@ #define TeX -int luatex_svn = 5195; +int luatex_svn = 5208; int luatex_version = 80; /* \.{\\luatexversion} */ int luatex_revision = '0'; /* \.{\\luatexrevision} */ int luatex_date_info = 2015031900; /* the compile date is now hardwired */ @@ -442,7 +442,7 @@ string dump_name; /* The C version of the jobname, if given. */ const_string c_job_name; -const char *ptexbanner; +const char *luatex_banner; #ifdef _MSC_VER /* Invalid parameter handler */ diff --git a/Build/source/texk/web2c/luatexdir/luazip/src/luazip.c b/Build/source/texk/web2c/luatexdir/luazip/src/luazip.c index eb731349f0d..a7248ae4759 100644 --- a/Build/source/texk/web2c/luatexdir/luazip/src/luazip.c +++ b/Build/source/texk/web2c/luatexdir/luazip/src/luazip.c @@ -97,15 +97,22 @@ static int zip_open (lua_State *L) { return 1; } + static int zip_close (lua_State *L) { ZZIP_DIR* f = tofile(L, 1); - if (zzip_dir_close(f) == 0) + if (zzip_dir_refcount(f) != 0) { - *(ZZIP_DIR**)lua_touserdata(L, 1) = NULL; /* mark file as close */ - lua_pushboolean(L, 1); - } - else lua_pushboolean(L, 0); + } else { + if (zzip_dir_close(f) == 0) + { + *(ZZIP_DIR**)lua_touserdata(L, 1) = NULL; /* mark file as close */ + lua_pushboolean(L, 1); + } + else { + lua_pushboolean(L, 0); + } + } return 1; } diff --git a/Build/source/texk/web2c/luatexdir/pdf/pdfgen.w b/Build/source/texk/web2c/luatexdir/pdf/pdfgen.w index 04bc321ba7f..c818c39e08a 100644 --- a/Build/source/texk/web2c/luatexdir/pdf/pdfgen.w +++ b/Build/source/texk/web2c/luatexdir/pdf/pdfgen.w @@ -1778,15 +1778,14 @@ void set_job_id(PDF pdf, int year, int month, int day, int time) name_string = makecstring(job_name); format_string = makecstring(format_ident); - make_pdftex_banner(); slen = SMALL_BUF_SIZE + - strlen(name_string) + strlen(format_string) + strlen(pdftex_banner); + strlen(name_string) + strlen(format_string) + strlen(luatex_banner); s = xtalloc(slen, char); /* The Web2c version string starts with a space. */ i = snprintf(s, slen, "%.4d/%.2d/%.2d %.2d:%.2d %s %s %s", year, month, day, time / 60, time % 60, - name_string, format_string, pdftex_banner); + name_string, format_string, luatex_banner); check_nprintf(i, slen); pdf->job_id_string = xstrdup(s); xfree(s); @@ -2355,7 +2354,7 @@ static int pdf_print_info(PDF pdf, int luatexversion, if (!trapped_given) { pdf_dict_add_name(pdf, "Trapped", "False"); } - pdf_dict_add_string(pdf, "PTEX.Fullbanner", pdftex_banner); + pdf_dict_add_string(pdf, "PTEX.Fullbanner", luatex_banner); pdf_end_dict(pdf); pdf_end_obj(pdf); return k; diff --git a/Build/source/texk/web2c/luatexdir/tex/commands.h b/Build/source/texk/web2c/luatexdir/tex/commands.h index 52857215b51..0a0663f428b 100644 --- a/Build/source/texk/web2c/luatexdir/tex/commands.h +++ b/Build/source/texk/web2c/luatexdir/tex/commands.h @@ -235,9 +235,10 @@ typedef enum { font_name_code, /* command code for \.{\\fontname} */ etex_code, /* command code for \.{\\eTeXVersion} */ format_name_code, /* command code for \.{\\AlephVersion} */ - pdftex_revision_code, /* command code for \.{\\pdftexrevision} */ + pdftex_revision_code, /* command code for \.{\\pdftexrevision}: OBSOLETE */ # define pdftex_first_expand_code pdftex_revision_code /* base for \pdfTeX's command codes */ - pdftex_banner_code, /* command code for \.{\\pdftexbanner} */ + /*pdftex_banner_code,*/ /* command code for \.{\\pdftexbanner}: OBSOLETE */ + luatex_banner_code, /* command code for \.{\\luatexbanner}: */ pdf_font_name_code, /* command code for \.{\\pdffontname} */ pdf_font_objnum_code, /* command code for \.{\\pdffontobjnum} */ pdf_font_size_code, /* command code for \.{\\pdffontsize} */ @@ -273,7 +274,7 @@ typedef enum { last_node_type_code, /* code for \.{\\lastnodetype} */ input_line_no_code, /* code for \.{\\inputlineno} */ badness_code, /* code for \.{\\badness} */ - pdftex_version_code, /* code for \.{\\pdftexversion} */ + pdftex_version_code, /* code for \.{\\pdftexversion} */ /*OBSOLETE */ # define pdftex_first_rint_code pdftex_version_code /* base for \pdfTeX's command codes */ pdf_last_obj_code, /* code for \.{\\pdflastobj} */ pdf_last_xform_code, /* code for \.{\\pdflastxform} */ diff --git a/Build/source/texk/web2c/luatexdir/tex/commands.w b/Build/source/texk/web2c/luatexdir/tex/commands.w index 1ba433884b0..fe52171a438 100644 --- a/Build/source/texk/web2c/luatexdir/tex/commands.w +++ b/Build/source/texk/web2c/luatexdir/tex/commands.w @@ -448,7 +448,7 @@ void initialize_commands(void) primitive_tex("lastskip", last_item_cmd, lastskip_code, 0); primitive_tex("inputlineno", last_item_cmd, input_line_no_code, 0); primitive_tex("badness", last_item_cmd, badness_code, 0); - primitive_pdftex("pdftexversion", last_item_cmd, pdftex_version_code, 0); + primitive_pdftex("pdftexversion", last_item_cmd, luatex_version_code, 0); /*OBSOLETE */ primitive_luatex("luatexversion", last_item_cmd, luatex_version_code, 0); primitive_pdftex("pdflastobj", last_item_cmd, pdf_last_obj_code, 0); primitive_pdftex("pdflastxform", last_item_cmd, pdf_last_xform_code, 0); @@ -471,10 +471,11 @@ void initialize_commands(void) primitive_etex("eTeXVersion", convert_cmd, etex_code, 0); primitive_tex("fontname", convert_cmd, font_name_code, 0); primitive_luatex("fontid", convert_cmd, font_id_code, 0); - primitive_pdftex("pdftexrevision", convert_cmd, pdftex_revision_code, 0); + primitive_pdftex("pdftexrevision", convert_cmd, luatex_revision_code, 0); /*OBSOLETE*/ primitive_luatex("luatexrevision", convert_cmd, luatex_revision_code, 0); primitive_luatex("luatexdatestamp", convert_cmd, luatex_date_code, 0); - primitive_pdftex("pdftexbanner", convert_cmd, pdftex_banner_code, 0); + primitive_pdftex("pdftexbanner", convert_cmd, luatex_banner_code, 0); /*OBSOLETE*/ + primitive_pdftex("luatexbanner", convert_cmd, luatex_banner_code, 0); /*will replace pdftexbanner*/ primitive_pdftex("pdffontname", convert_cmd, pdf_font_name_code, 0); primitive_pdftex("pdffontobjnum", convert_cmd, pdf_font_objnum_code, 0); primitive_pdftex("pdffontsize", convert_cmd, pdf_font_size_code, 0); diff --git a/Build/source/texk/web2c/luatexdir/tex/dumpdata.w b/Build/source/texk/web2c/luatexdir/tex/dumpdata.w index 674a7cd7ae4..c3ac9dbf37a 100644 --- a/Build/source/texk/web2c/luatexdir/tex/dumpdata.w +++ b/Build/source/texk/web2c/luatexdir/tex/dumpdata.w @@ -506,7 +506,7 @@ boolean load_fmt_file(const char *fmtname) undump_font(k); } undump_math_data(); - make_pdftex_banner(); + /*make_pdftex_banner();*/ /* Undump the hyphenation tables */ undump_language_data(); diff --git a/Build/source/texk/web2c/luatexdir/tex/mainbody.w b/Build/source/texk/web2c/luatexdir/tex/mainbody.w index 56191cbe25e..a98bd74a9e0 100644 --- a/Build/source/texk/web2c/luatexdir/tex/mainbody.w +++ b/Build/source/texk/web2c/luatexdir/tex/mainbody.w @@ -446,8 +446,8 @@ void main_body(void) else buffer[ilimit] = (packed_ASCII_code) int_par(end_line_char_code); fix_date_and_time(); - if (ini_version) - make_pdftex_banner(); + /*if (ini_version)*/ + /* make_pdftex_banner();*/ random_seed = (microseconds * 1000) + (epochseconds % 1000000); init_randoms(random_seed); initialize_math(); diff --git a/Build/source/texk/web2c/luatexdir/tex/printing.w b/Build/source/texk/web2c/luatexdir/tex/printing.w index 0cc4185823a..72889583191 100644 --- a/Build/source/texk/web2c/luatexdir/tex/printing.w +++ b/Build/source/texk/web2c/luatexdir/tex/printing.w @@ -21,7 +21,7 @@ #include "ptexlib.h" -#include "lua/luatex-api.h" /* for ptexbanner */ +#include "lua/luatex-api.h" /* for luatex_banner */ @ @c #define font_id_text(A) cs_text(font_id_base+(A)) @@ -533,7 +533,7 @@ void log_banner(const char *v, int ver) @ @c void print_version_banner(void) { - fprintf(term_out, "%s", ptexbanner); + fprintf(term_out, "%s", luatex_banner); } @ The procedure |print_esc| prints a string that is preceded by diff --git a/Build/source/texk/web2c/luatexdir/utils/utils.h b/Build/source/texk/web2c/luatexdir/utils/utils.h index 135bd5dafc0..6818c33c765 100644 --- a/Build/source/texk/web2c/luatexdir/utils/utils.h +++ b/Build/source/texk/web2c/luatexdir/utils/utils.h @@ -24,7 +24,6 @@ extern int epochseconds; extern int microseconds; -extern char *pdftex_banner; void make_subset_tag(fd_entry *); @@ -32,7 +31,6 @@ __attribute__ ((format(printf, 1, 2))) void tex_printf(const char *, ...); void garbage_warning(void); -void make_pdftex_banner(void); size_t xfwrite(void *, size_t size, size_t nmemb, FILE *); int xfflush(FILE *); int xgetc(FILE *); diff --git a/Build/source/texk/web2c/luatexdir/utils/utils.w b/Build/source/texk/web2c/luatexdir/utils/utils.w index c1ada7c5e93..131ee3b6bc2 100644 --- a/Build/source/texk/web2c/luatexdir/utils/utils.w +++ b/Build/source/texk/web2c/luatexdir/utils/utils.w @@ -35,7 +35,7 @@ #include "zlib.h" #include "md5.h" -#include "lua/luatex-api.h" /* for ptexbanner */ +#include "lua/luatex-api.h" /* for luatex_banner */ #include "png.h" #include "mplib.h" @@ -195,30 +195,6 @@ void garbage_warning(void) remove_pdffile(static_pdf); } -@ @c -char *pdftex_banner = NULL; - -@ @c -void make_pdftex_banner(void) -{ - char *s; - unsigned int slen; - int i; - - if (pdftex_banner != NULL) - return; - - slen = (unsigned int) (SMALL_BUF_SIZE + - strlen(ptexbanner) + - strlen(versionstring) + - strlen(kpathsea_version_string)); - s = xtalloc(slen, char); - /* The Web2c version string starts with a space. */ - i = snprintf(s, slen, - "%s%s %s", ptexbanner, versionstring, kpathsea_version_string); - check_nprintf(i, slen); - pdftex_banner = s; -} @ @c size_t xfwrite(void *ptr, size_t size, size_t nmemb, FILE * stream) |