~ubuntu-branches/ubuntu/maverick/luatex/maverick

« back to all changes in this revision

Viewing changes to source/texk/web2c/luatexdir/lua/llualib.c

  • Committer: Bazaar Package Importer
  • Author(s): Norbert Preining
  • Date: 2009-12-25 09:47:05 UTC
  • mfrom: (1.1.9 upstream) (4.2.3 squeeze)
  • Revision ID: james.westby@ubuntu.com-20091225094705-y33rpflo8t4u9nag
Tags: 0.50.0-1
* new upstream release
* disable fix-hurd-ftbfs patch, included upstream
* disable upstram-fixes, included upstream
* disable ubuntu_libpoppler-0.11, not needed anymore

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
   You should have received a copy of the GNU General Public License along
18
18
   with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
19
19
 
20
 
#include "luatex-api.h"
 
20
#include "lua/luatex-api.h"
21
21
#include <ptexlib.h>
22
22
 
23
23
static const char _svn_version[] =
24
 
    "$Id: llualib.c 2271 2009-04-12 23:42:21Z oneiros $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.40.6/source/texk/web2c/luatexdir/lua/llualib.c $";
 
24
    "$Id: llualib.c 3261 2009-12-18 11:38:21Z taco $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/lua/llualib.c $";
25
25
 
26
26
#define LOAD_BUF_SIZE 256
27
27
#define UINT_MAX32 0xFFFFFFFF
35
35
 
36
36
static bytecode *lua_bytecode_registers = NULL;
37
37
 
38
 
integer luabytecode_max = -1;
 
38
int luabytecode_max = -1;
39
39
unsigned int luabytecode_bytes = 0;
40
40
 
41
41
char *luanames[65536] = { NULL };
51
51
 
52
52
void dump_luac_registers(void)
53
53
{
54
 
    integer x;
55
 
    integer k, n;
 
54
    int x;
 
55
    int k, n;
56
56
    bytecode b;
57
57
    dump_int(luabytecode_max);
58
58
    if (lua_bytecode_registers != NULL) {
86
86
 
87
87
void undump_luac_registers(void)
88
88
{
89
 
    integer x;
90
 
    integer k, n;
 
89
    int x;
 
90
    int k, n;
91
91
    unsigned int i;
92
92
    bytecode b;
93
93
    undump_int(luabytecode_max);
94
94
    if (luabytecode_max >= 0) {
95
95
        i = (luabytecode_max + 1);
96
96
        if ((int) (UINT_MAX32 / sizeof(bytecode) + 1) <= i) {
97
 
            lua_fatal_error(maketexstring("Corrupt format file"));
 
97
            lua_fatal_error("Corrupt format file");
98
98
        }
99
99
        lua_bytecode_registers = xmalloc(i * sizeof(bytecode));
100
100
        luabytecode_bytes = i * sizeof(bytecode);