diff options
author | Hans Hagen <pragma@wxs.nl> | 2013-11-22 22:29:00 +0100 |
---|---|---|
committer | Hans Hagen <pragma@wxs.nl> | 2013-11-22 22:29:00 +0100 |
commit | 277b7556b6fe2fea89be61774a36b56e8f9a6e84 (patch) | |
tree | 211c99dd51fb8253a94eabf7affafc548bd4c7ff /tex | |
parent | b0adee8db2a65c7d482dce51bbb3261667bbcd17 (diff) | |
download | context-277b7556b6fe2fea89be61774a36b56e8f9a6e84.tar.gz |
beta 2013.11.22 22:29
Diffstat (limited to 'tex')
-rw-r--r-- | tex/context/base/cont-new.mkiv | 2 | ||||
-rw-r--r-- | tex/context/base/context-version.pdf | bin | 4110 -> 4128 bytes | |||
-rw-r--r-- | tex/context/base/context.mkiv | 2 | ||||
-rw-r--r-- | tex/context/base/page-mix.mkiv | 1 | ||||
-rw-r--r-- | tex/context/base/status-files.pdf | bin | 24704 -> 24724 bytes | |||
-rw-r--r-- | tex/context/base/status-lua.pdf | bin | 225378 -> 227331 bytes | |||
-rw-r--r-- | tex/context/base/trac-inf.lua | 5 | ||||
-rw-r--r-- | tex/context/base/util-lib.lua | 2 | ||||
-rw-r--r-- | tex/context/base/util-sql-imp-swiglib.lua | 95 | ||||
-rw-r--r-- | tex/generic/context/luatex/luatex-fonts-merged.lua | 2 |
10 files changed, 76 insertions, 33 deletions
diff --git a/tex/context/base/cont-new.mkiv b/tex/context/base/cont-new.mkiv index 9c60edbab..db204d665 100644 --- a/tex/context/base/cont-new.mkiv +++ b/tex/context/base/cont-new.mkiv @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2013.11.16 12:43} +\newcontextversion{2013.11.22 22:29} %D This file is loaded at runtime, thereby providing an excellent place for %D hacks, patches, extensions and new features. diff --git a/tex/context/base/context-version.pdf b/tex/context/base/context-version.pdf Binary files differindex b6340273b..4df980db9 100644 --- a/tex/context/base/context-version.pdf +++ b/tex/context/base/context-version.pdf diff --git a/tex/context/base/context.mkiv b/tex/context/base/context.mkiv index 1bd3fa566..2f74afd60 100644 --- a/tex/context/base/context.mkiv +++ b/tex/context/base/context.mkiv @@ -25,7 +25,7 @@ %D up and the dependencies are more consistent. \edef\contextformat {\jobname} -\edef\contextversion{2013.11.16 12:43} +\edef\contextversion{2013.11.22 22:29} \edef\contextkind {beta} %D For those who want to use this: diff --git a/tex/context/base/page-mix.mkiv b/tex/context/base/page-mix.mkiv index a40418d58..fe16be23c 100644 --- a/tex/context/base/page-mix.mkiv +++ b/tex/context/base/page-mix.mkiv @@ -547,6 +547,7 @@ \dorecurse\c_page_mix_n_of_columns{% % needs packaging anyway \setbox\scratchbox\page_mix_command_package_column + \page_marks_synchronize_column\plusone\c_page_mix_n_of_columns\recurselevel\scratchbox % for the moment a quick and dirty patch .. we need to go into the box (hence the \plusone) .. a slowdowner \page_lines_add_numbers_to_box\scratchbox\recurselevel\c_page_mix_n_of_columns\plusone % the framed needs a reset of strut, align, setups etc diff --git a/tex/context/base/status-files.pdf b/tex/context/base/status-files.pdf Binary files differindex 06c64b71b..62dd8403d 100644 --- a/tex/context/base/status-files.pdf +++ b/tex/context/base/status-files.pdf diff --git a/tex/context/base/status-lua.pdf b/tex/context/base/status-lua.pdf Binary files differindex 9feec40c2..79d1197ec 100644 --- a/tex/context/base/status-lua.pdf +++ b/tex/context/base/status-lua.pdf diff --git a/tex/context/base/trac-inf.lua b/tex/context/base/trac-inf.lua index 79cbdba3f..802f2e667 100644 --- a/tex/context/base/trac-inf.lua +++ b/tex/context/base/trac-inf.lua @@ -122,6 +122,9 @@ function statistics.show() if statistics.enable then -- this code will move local register = statistics.register + register("used platform", function() + return format("%s, type: %s, binary subtree: %s",os.platform or "unknown",os.type or "unknown", environment.texos or "unknown") + end) register("luatex banner", function() return lower(status.banner) end) @@ -179,7 +182,7 @@ function statistics.timed(action) starttiming("run") action() stoptiming("run") - report("total runtime: %s",elapsedtime("run")) + report("total runtime: %s seconds",elapsedtime("run")) end -- goodie diff --git a/tex/context/base/util-lib.lua b/tex/context/base/util-lib.lua index c5c999113..6498d2661 100644 --- a/tex/context/base/util-lib.lua +++ b/tex/context/base/util-lib.lua @@ -209,7 +209,7 @@ local function requireswiglib(required,version) if libtype == "function" then library = library() else - report_swiglib("load error: %a returns %a, message %a",opener,libtype,message or "no message") + report_swiglib("load error: %a returns %a, message %a, library %a",opener,libtype,(string.gsub(message or "no message","[%s]+$","")),found_library or "no library") library = false end dir.pop() diff --git a/tex/context/base/util-sql-imp-swiglib.lua b/tex/context/base/util-sql-imp-swiglib.lua index 5d64c02d4..1d64ac115 100644 --- a/tex/context/base/util-sql-imp-swiglib.lua +++ b/tex/context/base/util-sql-imp-swiglib.lua @@ -12,7 +12,7 @@ if not modules then modules = { } end modules ['util-sql-swiglib'] = { -- closer to the original library it's also less dependant. local concat = table.concat -local format = string.format +local format, byte = string.format, string.byte local lpegmatch = lpeg.match local setmetatable, type = setmetatable, type local sleep = os.sleep @@ -21,10 +21,16 @@ local trace_sql = false trackers.register("sql.trace", function(v local trace_queries = false trackers.register("sql.queries",function(v) trace_queries = v end) local report_state = logs.reporter("sql","swiglib") +local helpers = require("swiglib.helpers.core") local sql = utilities.sql local mysql = require("swiglib.mysql.core") -- "5.6" ----- mysql = swiglib("mysql.core") -- "5.6" +local new_u_char_array = helpers.new_u_char_array or helpers.new_ucharArray +local ucharArray_setitem = helpers.u_char_array_setitem or helpers.ucharArray_setitem +local int_p_assign = helpers.int_p_assign +local ulongArray_getitem = helpers.u_long_array_getitem or helpers.ulongArray_getitem + -- inspect(table.sortedkeys(mysql)) local nofretries = 5 @@ -57,13 +63,15 @@ local mysql_free_result = mysql.mysql_free_result local mysql_use_result = mysql.mysql_use_result local mysql_error_message = mysql.mysql_error -local mysql_options_argument = mysql.mysql_options_argument +----- mysql_options_argument = mysql.mysql_options_argument local instance = mysql.MYSQL() local mysql_constant_false = false local mysql_constant_true = true +----- util_getbytearray = mysql.util_getbytearray + -- if mysql_options_argument then -- -- mysql_constant_false = mysql_options_argument(false) -- 0 "\0" @@ -82,6 +90,48 @@ local mysql_constant_true = true -- -- end +-- some helpers: + +function mysql.options_argument(arg) + local targ = type(arg) + if targ == "boolean" then + local o = new_u_char_array(1) + ucharArray_setitem(o,0,arg == true and 64 or 0) + return o + elseif targ == "string" then + local o = new_u_char_array(#arg) + ucharArray_setitem(o,0,0) + for i=1,#arg do + ucharArray_setitem(o,i-1,byte(arg,i)) + end + return o + elseif targ == "number" then + local o = core.new_int_p() + int_p_assign(o, arg) + return o + else + return nil + end +end + +-- function mysql.util_unpackbytearray(row,noffields,len) +-- if row == nil then +-- return { } +-- elseif noffields < 1 then +-- return { } +-- else +-- local t = { } +-- for i=0,noffields-1 do +-- local l = ulongArray_getitem(len,i) -- zero based ... element from len array +-- local r = util_getbytearray(row,i,l) -- zero based ... element from len array +-- t[#t+1]= r +-- end +-- return t +-- end +-- end + +-- + local typemap = mysql.MYSQL_TYPE_VAR_STRING and { [mysql.MYSQL_TYPE_VAR_STRING ] = "string", [mysql.MYSQL_TYPE_STRING ] = "string", @@ -145,10 +195,10 @@ local function numrows(t) return t.nofrows end --- swig_type +local fetch_fields_from_current_row = mysql.util_mysql_fetch_fields_from_current_row +local fetch_all_rows = mysql.util_mysql_fetch_all_rows --- local ulongArray_getitem = mysql.ulongArray_getitem --- local util_getbytearray = mysql.util_getbytearray +-- swig_type -- local function list(t) -- local result = t._result_ @@ -163,7 +213,7 @@ end -- end -- local function hash(t) --- local list = util_mysql_fetch_fields_from_current_row(t._result_) +-- local list = fetch_fields_from_current_row(t._result_) -- local result = t._result_ -- local fields = t.names -- local row = mysql_fetch_row(result) @@ -176,15 +226,12 @@ end -- return result -- end -local util_mysql_fetch_fields_from_current_row = mysql.util_mysql_fetch_fields_from_current_row -local util_mysql_fetch_all_rows = mysql.util_mysql_fetch_all_rows - local function list(t) - return util_mysql_fetch_fields_from_current_row(t._result_) + return fetch_fields_from_current_row(t._result_) end local function hash(t) - local list = util_mysql_fetch_fields_from_current_row(t._result_) + local list = fetch_fields_from_current_row(t._result_) local fields = t.names local data = { } for i=1,t.noffields do @@ -194,7 +241,7 @@ local function hash(t) end local function wholelist(t) - return util_mysql_fetch_all_rows(t._result_) + return fetch_all_rows(t._result_) end local mt = { __index = { @@ -453,21 +500,16 @@ local function execute(specification) end local wraptemplate = [[ ------ mysql = require("swigluamysql") -- will be stored in method -local mysql = require("swiglib.mysql.core") -- will be stored in method +local mysql = require("swiglib.mysql.core") -- will be stored in method ------ mysql_fetch_row = mysql.mysql_fetch_row ------ mysql_fetch_lengths = mysql.mysql_fetch_lengths ------ util_unpackbytearray = mysql.util_unpackbytearray -local util_mysql_fetch_fields_from_current_row - = mysql.util_mysql_fetch_fields_from_current_row +local fetch_fields = mysql.util_mysql_fetch_fields_from_current_row -local converters = utilities.sql.converters -local deserialize = utilities.sql.deserialize +local converters = utilities.sql.converters +local deserialize = utilities.sql.deserialize -local tostring = tostring -local tonumber = tonumber -local booleanstring = string.booleanstring +local tostring = tostring +local tonumber = tonumber +local booleanstring = string.booleanstring %s @@ -483,10 +525,7 @@ return function(result) local target = { } -- no %s needed here result = result._result_ for i=1,nofrows do - -- local row = mysql_fetch_row(result) - -- local len = mysql_fetch_lengths(result) - -- local cells = util_unpackbytearray(row,noffields,len) - local cells = util_mysql_fetch_fields_from_current_row(result) + local cells = fetch_fields(result) target[%s] = { %s } diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua index b74bd350c..9bb358c97 100644 --- a/tex/generic/context/luatex/luatex-fonts-merged.lua +++ b/tex/generic/context/luatex/luatex-fonts-merged.lua @@ -1,6 +1,6 @@ -- merged file : luatex-fonts-merged.lua -- parent file : luatex-fonts.lua --- merge date : 11/16/13 12:43:39 +-- merge date : 11/22/13 22:29:17 do -- begin closure to overcome local limits and interference |