summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/luatexdir/lua
diff options
context:
space:
mode:
authorTaco Hoekwater <taco@elvenkind.com>2009-06-08 08:58:07 +0000
committerTaco Hoekwater <taco@elvenkind.com>2009-06-08 08:58:07 +0000
commit5adefaa278f30813af94c423bed99d1628b23a2c (patch)
tree76b0edd887559dcea0be9d28a569d8191f3e8307 /Build/source/texk/web2c/luatexdir/lua
parentbe2021a8a7f377786a2fba684fd950975c892533 (diff)
source code for luatex 0.40.3
git-svn-id: svn://tug.org/texlive/trunk@13669 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c/luatexdir/lua')
-rw-r--r--Build/source/texk/web2c/luatexdir/lua/lcallbacklib.c10
-rw-r--r--Build/source/texk/web2c/luatexdir/lua/lfontlib.c14
-rw-r--r--Build/source/texk/web2c/luatexdir/lua/limglib.c2
-rw-r--r--Build/source/texk/web2c/luatexdir/lua/lkpselib.c2
-rw-r--r--Build/source/texk/web2c/luatexdir/lua/llanglib.c2
-rw-r--r--Build/source/texk/web2c/luatexdir/lua/llualib.c2
-rw-r--r--Build/source/texk/web2c/luatexdir/lua/lnodelib.c20
-rw-r--r--Build/source/texk/web2c/luatexdir/lua/loslibext.c2
-rw-r--r--Build/source/texk/web2c/luatexdir/lua/lpdflib.c2
-rw-r--r--Build/source/texk/web2c/luatexdir/lua/lstatslib.c10
-rw-r--r--Build/source/texk/web2c/luatexdir/lua/ltexiolib.c2
-rw-r--r--Build/source/texk/web2c/luatexdir/lua/ltexlib.c219
-rw-r--r--Build/source/texk/web2c/luatexdir/lua/ltokenlib.c4
-rw-r--r--Build/source/texk/web2c/luatexdir/lua/luainit.c25
-rw-r--r--Build/source/texk/web2c/luatexdir/lua/luanode.c80
-rw-r--r--Build/source/texk/web2c/luatexdir/lua/luastuff.c2
-rw-r--r--Build/source/texk/web2c/luatexdir/lua/luatex.c8
-rw-r--r--Build/source/texk/web2c/luatexdir/lua/luatoken.c2
-rw-r--r--Build/source/texk/web2c/luatexdir/lua/texluac.c2
19 files changed, 204 insertions, 206 deletions
diff --git a/Build/source/texk/web2c/luatexdir/lua/lcallbacklib.c b/Build/source/texk/web2c/luatexdir/lua/lcallbacklib.c
index a5809a72bd9..5f7a656e598 100644
--- a/Build/source/texk/web2c/luatexdir/lua/lcallbacklib.c
+++ b/Build/source/texk/web2c/luatexdir/lua/lcallbacklib.c
@@ -21,7 +21,7 @@
#include <ptexlib.h>
static const char _svn_version[] =
- "$Id: lcallbacklib.c 2271 2009-04-12 23:42:21Z oneiros $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.40.2/source/texk/web2c/luatexdir/lua/lcallbacklib.c $";
+ "$Id: lcallbacklib.c 2448 2009-06-08 07:43:50Z taco $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.40.3/source/texk/web2c/luatexdir/lua/lcallbacklib.c $";
extern int do_run_callback(int special, char *values, va_list vl);
extern int lua_traceback(lua_State * L);
@@ -430,10 +430,10 @@ static int callback_register(lua_State * L)
{
int cb;
char *s;
- if (!lua_isstring(L, 1) ||
- ((!lua_isfunction(L, 2)) &&
- (!lua_isnil(L, 2)) &&
- (!(lua_isboolean(L, 2) && lua_toboolean(L,2)==0)))) {
+ if (!lua_isstring(L, 1) ||
+ ((!lua_isfunction(L, 2)) &&
+ (!lua_isnil(L, 2)) &&
+ (!(lua_isboolean(L, 2) && lua_toboolean(L, 2) == 0)))) {
lua_pushnil(L);
lua_pushstring(L, "Invalid arguments to callback.register.");
return 2;
diff --git a/Build/source/texk/web2c/luatexdir/lua/lfontlib.c b/Build/source/texk/web2c/luatexdir/lua/lfontlib.c
index a2555c3079f..6debdc768f0 100644
--- a/Build/source/texk/web2c/luatexdir/lua/lfontlib.c
+++ b/Build/source/texk/web2c/luatexdir/lua/lfontlib.c
@@ -22,7 +22,7 @@
#include "nodes.h"
static const char _svn_version[] =
- "$Id: lfontlib.c 2349 2009-04-22 12:13:26Z taco $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.40.2/source/texk/web2c/luatexdir/lua/lfontlib.c $";
+ "$Id: lfontlib.c 2448 2009-06-08 07:43:50Z taco $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.40.3/source/texk/web2c/luatexdir/lua/lfontlib.c $";
#define TIMERS 0
@@ -34,12 +34,12 @@ static const char _svn_version[] =
/* this function is in vfovf.c for the moment */
extern int make_vf_table(lua_State * L, char *name, scaled s);
-static int get_fontid (void)
+static int get_fontid(void)
{
- if (font_tables==NULL || font_tables[0]==NULL) {
- create_null_font();
- }
- return new_font();
+ if (font_tables == NULL || font_tables[0] == NULL) {
+ create_null_font();
+ }
+ return new_font();
}
static int font_read_tfm(lua_State * L)
@@ -222,7 +222,7 @@ static int deffont(lua_State * L)
tvdiff -= (double) tva.tv_usec;
tvdiff /= 1000000;
fprintf(stdout, "font.define(%s,%i): %f seconds\n",
- font_fullname(i),i, tvdiff);
+ font_fullname(i), i, tvdiff);
#endif
lua_pushnumber(L, i);
return 1;
diff --git a/Build/source/texk/web2c/luatexdir/lua/limglib.c b/Build/source/texk/web2c/luatexdir/lua/limglib.c
index 68504b87cb4..dfbf4cd5393 100644
--- a/Build/source/texk/web2c/luatexdir/lua/limglib.c
+++ b/Build/source/texk/web2c/luatexdir/lua/limglib.c
@@ -27,7 +27,7 @@
static const char _svn_version[] =
"$Id: limglib.c 2329 2009-04-18 14:25:30Z hhenkel $ "
- "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.40.2/source/texk/web2c/luatexdir/lua/limglib.c $";
+ "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.40.3/source/texk/web2c/luatexdir/lua/limglib.c $";
/**********************************************************************/
diff --git a/Build/source/texk/web2c/luatexdir/lua/lkpselib.c b/Build/source/texk/web2c/luatexdir/lua/lkpselib.c
index abe01205b61..b10266cb630 100644
--- a/Build/source/texk/web2c/luatexdir/lua/lkpselib.c
+++ b/Build/source/texk/web2c/luatexdir/lua/lkpselib.c
@@ -25,7 +25,7 @@
#include <kpathsea/readable.h>
static const char _svn_version[] =
- "$Id: lkpselib.c 2414 2009-06-03 12:57:01Z taco $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.40.2/source/texk/web2c/luatexdir/lua/lkpselib.c $";
+ "$Id: lkpselib.c 2414 2009-06-03 12:57:01Z taco $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.40.3/source/texk/web2c/luatexdir/lua/lkpselib.c $";
static const int filetypes[] = {
kpse_gf_format,
diff --git a/Build/source/texk/web2c/luatexdir/lua/llanglib.c b/Build/source/texk/web2c/luatexdir/lua/llanglib.c
index 91259aba4e2..181bd925547 100644
--- a/Build/source/texk/web2c/luatexdir/lua/llanglib.c
+++ b/Build/source/texk/web2c/luatexdir/lua/llanglib.c
@@ -23,7 +23,7 @@
#include "nodes.h"
static const char _svn_version[] =
- "$Id: llanglib.c 2271 2009-04-12 23:42:21Z oneiros $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.40.2/source/texk/web2c/luatexdir/lua/llanglib.c $";
+ "$Id: llanglib.c 2271 2009-04-12 23:42:21Z oneiros $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.40.3/source/texk/web2c/luatexdir/lua/llanglib.c $";
#define LANG_METATABLE "luatex.lang"
diff --git a/Build/source/texk/web2c/luatexdir/lua/llualib.c b/Build/source/texk/web2c/luatexdir/lua/llualib.c
index f8ddef81d23..8eac56331e7 100644
--- a/Build/source/texk/web2c/luatexdir/lua/llualib.c
+++ b/Build/source/texk/web2c/luatexdir/lua/llualib.c
@@ -21,7 +21,7 @@
#include <ptexlib.h>
static const char _svn_version[] =
- "$Id: llualib.c 2271 2009-04-12 23:42:21Z oneiros $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.40.2/source/texk/web2c/luatexdir/lua/llualib.c $";
+ "$Id: llualib.c 2271 2009-04-12 23:42:21Z oneiros $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.40.3/source/texk/web2c/luatexdir/lua/llualib.c $";
#define LOAD_BUF_SIZE 256
#define UINT_MAX32 0xFFFFFFFF
diff --git a/Build/source/texk/web2c/luatexdir/lua/lnodelib.c b/Build/source/texk/web2c/luatexdir/lua/lnodelib.c
index 18a593978a5..7caa296ab44 100644
--- a/Build/source/texk/web2c/luatexdir/lua/lnodelib.c
+++ b/Build/source/texk/web2c/luatexdir/lua/lnodelib.c
@@ -25,7 +25,7 @@
#include "commands.h"
static const char _svn_version[] =
- "$Id: lnodelib.c 2271 2009-04-12 23:42:21Z oneiros $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.40.2/source/texk/web2c/luatexdir/lua/lnodelib.c $";
+ "$Id: lnodelib.c 2448 2009-06-08 07:43:50Z taco $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.40.3/source/texk/web2c/luatexdir/lua/lnodelib.c $";
#define init_luaS_index(a) do { \
lua_pushliteral(L,#a); \
@@ -1093,11 +1093,11 @@ static void lua_nodelib_getfield_whatsit(lua_State * L, int n, int field)
lua_pushnumber(L, pdf_literal_mode(n));
break;
case 5:
- if (pdf_literal_type(n)==lua_refid_literal) {
- lua_rawgeti(Luas, LUA_REGISTRYINDEX, pdf_literal_data(n));
- } else {
- tokenlist_to_luastring(L, pdf_literal_data(n));
- }
+ if (pdf_literal_type(n) == lua_refid_literal) {
+ lua_rawgeti(Luas, LUA_REGISTRYINDEX, pdf_literal_data(n));
+ } else {
+ tokenlist_to_luastring(L, pdf_literal_data(n));
+ }
break;
default:
lua_pushnil(L);
@@ -2166,11 +2166,11 @@ static int lua_nodelib_setfield_whatsit(lua_State * L, int n, int field)
if (ini_version) {
pdf_literal_data(n) = nodelib_gettoks(L, 3);
} else {
- lua_pushvalue(L,3);
- pdf_literal_data(n) = luaL_ref(L,LUA_REGISTRYINDEX);
- pdf_literal_type(n) = lua_refid_literal;
+ lua_pushvalue(L, 3);
+ pdf_literal_data(n) = luaL_ref(L, LUA_REGISTRYINDEX);
+ pdf_literal_type(n) = lua_refid_literal;
}
- break;
+ break;
default:
return nodelib_cantset(L, field, n);
}
diff --git a/Build/source/texk/web2c/luatexdir/lua/loslibext.c b/Build/source/texk/web2c/luatexdir/lua/loslibext.c
index 847b9a56f56..d06d1c9fb22 100644
--- a/Build/source/texk/web2c/luatexdir/lua/loslibext.c
+++ b/Build/source/texk/web2c/luatexdir/lua/loslibext.c
@@ -25,7 +25,7 @@
#include <time.h>
static const char _svn_version[] =
- "$Id: loslibext.c 2376 2009-05-08 08:40:13Z taco $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.40.2/source/texk/web2c/luatexdir/lua/loslibext.c $";
+ "$Id: loslibext.c 2376 2009-05-08 08:40:13Z taco $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.40.3/source/texk/web2c/luatexdir/lua/loslibext.c $";
#if defined(_WIN32) || defined(WIN32) || defined(__NT__)
# define MKDIR(a,b) mkdir(a)
diff --git a/Build/source/texk/web2c/luatexdir/lua/lpdflib.c b/Build/source/texk/web2c/luatexdir/lua/lpdflib.c
index 35261fdc5a0..77b25b8d752 100644
--- a/Build/source/texk/web2c/luatexdir/lua/lpdflib.c
+++ b/Build/source/texk/web2c/luatexdir/lua/lpdflib.c
@@ -22,7 +22,7 @@
static const char _svn_version[] =
"$Id: lpdflib.c 2329 2009-04-18 14:25:30Z hhenkel $ "
- "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.40.2/source/texk/web2c/luatexdir/lua/lpdflib.c $";
+ "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.40.3/source/texk/web2c/luatexdir/lua/lpdflib.c $";
static int findcurv(lua_State * L)
{
diff --git a/Build/source/texk/web2c/luatexdir/lua/lstatslib.c b/Build/source/texk/web2c/luatexdir/lua/lstatslib.c
index 56494874f76..376523484f8 100644
--- a/Build/source/texk/web2c/luatexdir/lua/lstatslib.c
+++ b/Build/source/texk/web2c/luatexdir/lua/lstatslib.c
@@ -22,7 +22,7 @@
static const char _svn_version[] =
- "$Id: lstatslib.c 2306 2009-04-16 15:01:45Z taco $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.40.2/source/texk/web2c/luatexdir/lua/lstatslib.c $";
+ "$Id: lstatslib.c 2448 2009-06-08 07:43:50Z taco $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.40.3/source/texk/web2c/luatexdir/lua/lstatslib.c $";
typedef struct statistic {
const char *name;
@@ -189,10 +189,10 @@ static int do_getstat(lua_State * L, int i)
lua_pushboolean(L, g());
break;
case 'n':
- if (*(halfword *) (stats[i].value)!=0)
- lua_nodelib_push_fast(L, *(halfword *) (stats[i].value));
+ if (*(halfword *) (stats[i].value) != 0)
+ lua_nodelib_push_fast(L, *(halfword *) (stats[i].value));
else
- lua_pushnil(L);
+ lua_pushnil(L);
break;
case 'b':
lua_pushboolean(L, *(integer *) (stats[i].value));
@@ -219,7 +219,7 @@ static int getstats(lua_State * L)
static int setstats(lua_State * L)
{
- (void)L;
+ (void) L;
return 0;
}
diff --git a/Build/source/texk/web2c/luatexdir/lua/ltexiolib.c b/Build/source/texk/web2c/luatexdir/lua/ltexiolib.c
index 74f7ddb6795..670e26f90a8 100644
--- a/Build/source/texk/web2c/luatexdir/lua/ltexiolib.c
+++ b/Build/source/texk/web2c/luatexdir/lua/ltexiolib.c
@@ -21,7 +21,7 @@
#include <ptexlib.h>
static const char _svn_version[] =
- "$Id: ltexiolib.c 2321 2009-04-18 09:17:13Z hhenkel $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.40.2/source/texk/web2c/luatexdir/lua/ltexiolib.c $";
+ "$Id: ltexiolib.c 2321 2009-04-18 09:17:13Z hhenkel $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.40.3/source/texk/web2c/luatexdir/lua/ltexiolib.c $";
typedef void (*texio_printer) (str_number s);
diff --git a/Build/source/texk/web2c/luatexdir/lua/ltexlib.c b/Build/source/texk/web2c/luatexdir/lua/ltexlib.c
index 785bf67f4e4..2813caee2bc 100644
--- a/Build/source/texk/web2c/luatexdir/lua/ltexlib.c
+++ b/Build/source/texk/web2c/luatexdir/lua/ltexlib.c
@@ -24,7 +24,7 @@
#include "tokens.h"
static const char _svn_version[] =
- "$Id: ltexlib.c 2321 2009-04-18 09:17:13Z hhenkel $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.40.2/source/texk/web2c/luatexdir/lua/ltexlib.c $";
+ "$Id: ltexlib.c 2448 2009-06-08 07:43:50Z taco $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.40.3/source/texk/web2c/luatexdir/lua/ltexlib.c $";
extern halfword *check_isnode(lua_State * L, int ud);
extern void lua_nodelib_push_fast(lua_State * L, halfword n);
@@ -270,24 +270,23 @@ int dimen_to_number(lua_State * L, char *s)
}
-integer
-get_item_index (lua_State *L, int i, integer base)
+integer get_item_index(lua_State * L, int i, integer base)
{
size_t kk;
integer k;
int cur_cs;
char *s;
- if (lua_type(L, i) == LUA_TSTRING) {
- s = (char *) lua_tolstring(L, i , &kk);
+ if (lua_type(L, i) == LUA_TSTRING) {
+ s = (char *) lua_tolstring(L, i, &kk);
cur_cs = string_lookup(s, kk);
- if (cur_cs==static_undefined_control_sequence ||
- is_undefined_cs(cur_cs)) {
- k = -1; /* guarandeed invalid */
- } else {
- k = (zget_equiv(cur_cs) - base);
- }
+ if (cur_cs == static_undefined_control_sequence ||
+ is_undefined_cs(cur_cs)) {
+ k = -1; /* guarandeed invalid */
+ } else {
+ k = (zget_equiv(cur_cs) - base);
+ }
} else {
- k = (integer) luaL_checkinteger(L, i );
+ k = (integer) luaL_checkinteger(L, i);
}
return k;
}
@@ -297,9 +296,9 @@ static int vsetdimen(lua_State * L, int is_global)
{
int i, j, err;
integer k;
- integer save_global_defs = int_par(param_global_defs_code);
+ integer save_global_defs = int_par(param_global_defs_code);
if (is_global)
- int_par(param_global_defs_code) = 1;
+ int_par(param_global_defs_code) = 1;
i = lua_gettop(L);
j = 0;
/* find the value */
@@ -311,7 +310,7 @@ static int vsetdimen(lua_State * L, int is_global)
lua_error(L);
} else
j = (int) lua_tonumber(L, i);
- k = get_item_index(L, (i-1), get_scaled_base());
+ k = get_item_index(L, (i - 1), get_scaled_base());
check_index_range(k, "setdimen");
err = set_tex_dimen_register(k, j);
int_par(param_global_defs_code) = save_global_defs;
@@ -324,14 +323,14 @@ static int vsetdimen(lua_State * L, int is_global)
static int setdimen(lua_State * L)
{
- int isglobal = 0;
- int n = lua_gettop(L);
- if (n==3 && lua_isstring(L,1)) {
- char *s = (char *)lua_tostring(L,1);
- if (strcmp(s,"global")==0)
- isglobal = 1;
- }
- return vsetdimen (L, isglobal);
+ int isglobal = 0;
+ int n = lua_gettop(L);
+ if (n == 3 && lua_isstring(L, 1)) {
+ char *s = (char *) lua_tostring(L, 1);
+ if (strcmp(s, "global") == 0)
+ isglobal = 1;
+ }
+ return vsetdimen(L, isglobal);
}
static int getdimen(lua_State * L)
@@ -350,13 +349,13 @@ static int vsetskip(lua_State * L, int is_global)
int i, err;
halfword *j;
integer k;
- integer save_global_defs = int_par(param_global_defs_code);
+ integer save_global_defs = int_par(param_global_defs_code);
if (is_global)
- int_par(param_global_defs_code) = 1;
+ int_par(param_global_defs_code) = 1;
i = lua_gettop(L);
j = check_isnode(L, i); /* the value */
- k = get_item_index(L, (i-1), get_skip_base());
- check_index_range(k, "setskip"); /* the index */
+ k = get_item_index(L, (i - 1), get_skip_base());
+ check_index_range(k, "setskip"); /* the index */
err = set_tex_skip_register(k, *j);
int_par(param_global_defs_code) = save_global_defs;
if (err) {
@@ -368,14 +367,14 @@ static int vsetskip(lua_State * L, int is_global)
static int setskip(lua_State * L)
{
- int isglobal = 0;
- int n = lua_gettop(L);
- if (n==3 && lua_isstring(L,1)) {
- char *s = (char *)lua_tostring(L,1);
- if (strcmp(s,"global")==0)
- isglobal = 1;
- }
- return vsetskip (L, isglobal);
+ int isglobal = 0;
+ int n = lua_gettop(L);
+ if (n == 3 && lua_isstring(L, 1)) {
+ char *s = (char *) lua_tostring(L, 1);
+ if (strcmp(s, "global") == 0)
+ isglobal = 1;
+ }
+ return vsetskip(L, isglobal);
}
int getskip(lua_State * L)
@@ -395,12 +394,12 @@ static int vsetcount(lua_State * L, int is_global)
{
int i, j, err;
integer k;
- integer save_global_defs = int_par(param_global_defs_code);
+ integer save_global_defs = int_par(param_global_defs_code);
if (is_global)
- int_par(param_global_defs_code) = 1;
+ int_par(param_global_defs_code) = 1;
i = lua_gettop(L);
j = (int) luaL_checkinteger(L, i);
- k = get_item_index(L, (i-1), get_count_base());
+ k = get_item_index(L, (i - 1), get_count_base());
check_index_range(k, "setcount");
err = set_tex_count_register(k, j);
int_par(param_global_defs_code) = save_global_defs;
@@ -415,12 +414,12 @@ static int setcount(lua_State * L)
{
int isglobal = 0;
int n = lua_gettop(L);
- if (n==3 && lua_isstring(L,1)) {
- char *s = (char *)lua_tostring(L,1);
- if (strcmp(s,"global")==0)
- isglobal = 1;
+ if (n == 3 && lua_isstring(L, 1)) {
+ char *s = (char *) lua_tostring(L, 1);
+ if (strcmp(s, "global") == 0)
+ isglobal = 1;
}
- return vsetcount (L, isglobal);
+ return vsetcount(L, isglobal);
}
static int getcount(lua_State * L)
@@ -428,7 +427,7 @@ static int getcount(lua_State * L)
int j;
integer k;
k = get_item_index(L, lua_gettop(L), get_count_base());
- check_index_range(k,"getcount");
+ check_index_range(k, "getcount");
j = get_tex_count_register(k);
lua_pushnumber(L, j);
return 1;
@@ -439,13 +438,13 @@ static int vsetattribute(lua_State * L, int is_global)
{
int i, j, err;
integer k;
- integer save_global_defs = int_par(param_global_defs_code);
+ integer save_global_defs = int_par(param_global_defs_code);
if (is_global)
int_par(param_global_defs_code) = 1;
i = lua_gettop(L);
j = (int) luaL_checkinteger(L, i);
- k = get_item_index(L, (i-1), get_attribute_base());
- check_index_range(k,"setattribute");
+ k = get_item_index(L, (i - 1), get_attribute_base());
+ check_index_range(k, "setattribute");
err = set_tex_attribute_register(k, j);
int_par(param_global_defs_code) = save_global_defs;
if (err) {
@@ -459,12 +458,12 @@ static int setattribute(lua_State * L)
{
int isglobal = 0;
int n = lua_gettop(L);
- if (n==3 && lua_isstring(L,1)) {
- char *s = (char *)lua_tostring(L,1);
- if (strcmp(s,"global")==0)
- isglobal = 1;
+ if (n == 3 && lua_isstring(L, 1)) {
+ char *s = (char *) lua_tostring(L, 1);
+ if (strcmp(s, "global") == 0)
+ isglobal = 1;
}
- return vsetattribute (L, isglobal);
+ return vsetattribute(L, isglobal);
}
static int getattribute(lua_State * L)
@@ -472,7 +471,7 @@ static int getattribute(lua_State * L)
int j;
integer k;
k = get_item_index(L, lua_gettop(L), get_attribute_base());
- check_index_range(k,"getattribute");
+ check_index_range(k, "getattribute");
j = get_tex_attribute_register(k);
lua_pushnumber(L, j);
return 1;
@@ -484,17 +483,17 @@ int vsettoks(lua_State * L, int is_global)
size_t len;
integer k;
char *st;
- integer save_global_defs = int_par(param_global_defs_code);
+ integer save_global_defs = int_par(param_global_defs_code);
if (is_global)
- int_par(param_global_defs_code) = 1;
+ int_par(param_global_defs_code) = 1;
i = lua_gettop(L);
if (!lua_isstring(L, i)) {
lua_pushstring(L, "unsupported value type");
lua_error(L);
}
st = (char *) lua_tolstring(L, i, &len);
- k = get_item_index (L, (i-1), get_toks_base());
- check_index_range(k,"settoks");
+ k = get_item_index(L, (i - 1), get_toks_base());
+ check_index_range(k, "settoks");
j = maketexlstring(st, len);
err = zset_tex_toks_register(k, j);
int_par(param_global_defs_code) = save_global_defs;
@@ -506,24 +505,24 @@ int vsettoks(lua_State * L, int is_global)
return 0;
}
-static int settoks (lua_State * L)
+static int settoks(lua_State * L)
{
int isglobal = 0;
int n = lua_gettop(L);
- if (n==3 && lua_isstring(L,1)) {
- char *s = (char *)lua_tostring(L,1);
- if (strcmp(s,"global")==0)
- isglobal = 1;
+ if (n == 3 && lua_isstring(L, 1)) {
+ char *s = (char *) lua_tostring(L, 1);
+ if (strcmp(s, "global") == 0)
+ isglobal = 1;
}
- return vsettoks (L, isglobal);
+ return vsettoks(L, isglobal);
}
static int gettoks(lua_State * L)
{
integer k;
str_number t;
- k = get_item_index (L, lua_gettop(L), get_toks_base());
- check_index_range(k,"gettoks");
+ k = get_item_index(L, lua_gettop(L), get_toks_base());
+ check_index_range(k, "gettoks");
t = get_tex_toks_register(k);
lua_pushstring(L, makecstring(t));
flush_str(t);
@@ -554,7 +553,7 @@ static int getbox(lua_State * L)
{
int k, t;
k = get_box_id(L, -1);
- check_index_range(k,"getbox");
+ check_index_range(k, "getbox");
t = get_tex_box_register(k);
nodelist_to_lua(L, t);
return 1;
@@ -563,11 +562,11 @@ static int getbox(lua_State * L)
static int vsetbox(lua_State * L, int is_global)
{
int i, j, k, err;
- integer save_global_defs = int_par(param_global_defs_code);
+ integer save_global_defs = int_par(param_global_defs_code);
if (is_global)
- int_par(param_global_defs_code) = 1;
+ int_par(param_global_defs_code) = 1;
k = get_box_id(L, -2);
- check_index_range(k,"setbox");
+ check_index_range(k, "setbox");
i = get_tex_box_register(k);
if (lua_isboolean(L, -1)) {
j = lua_toboolean(L, -1);
@@ -591,12 +590,12 @@ static int setbox(lua_State * L)
{
int isglobal = 0;
int n = lua_gettop(L);
- if (n==3 && lua_isstring(L,1)) {
- char *s = (char *)lua_tostring(L,1);
- if (strcmp(s,"global")==0)
- isglobal = 1;
+ if (n == 3 && lua_isstring(L, 1)) {
+ char *s = (char *) lua_tostring(L, 1);
+ if (strcmp(s, "global") == 0)
+ isglobal = 1;
}
- return vsetbox (L, isglobal);
+ return vsetbox(L, isglobal);
}
static int getboxdim(lua_State * L, int whichdim)
@@ -640,9 +639,9 @@ int getboxdp(lua_State * L)
static int vsetboxdim(lua_State * L, int whichdim, int is_global)
{
int i, j, k, err;
- integer save_global_defs = int_par(param_global_defs_code);
+ integer save_global_defs = int_par(param_global_defs_code);
if (is_global)
- int_par(param_global_defs_code) = 1;
+ int_par(param_global_defs_code) = 1;
i = lua_gettop(L);
if (!lua_isnumber(L, i)) {
j = dimen_to_number(L, (char *) lua_tostring(L, i));
@@ -678,10 +677,10 @@ static int setboxwd(lua_State * L)
{
int isglobal = 0;
int n = lua_gettop(L);
- if (n==3 && lua_isstring(L,1)) {
- char *s = (char *)lua_tostring(L,1);
- if (strcmp(s,"global")==0)
- isglobal = 1;
+ if (n == 3 && lua_isstring(L, 1)) {
+ char *s = (char *) lua_tostring(L, 1);
+ if (strcmp(s, "global") == 0)
+ isglobal = 1;
}
return vsetboxdim(L, width_offset, isglobal);
}
@@ -690,10 +689,10 @@ static int setboxht(lua_State * L)
{
int isglobal = 0;
int n = lua_gettop(L);
- if (n==3 && lua_isstring(L,1)) {
- char *s = (char *)lua_tostring(L,1);
- if (strcmp(s,"global")==0)
- isglobal = 1;
+ if (n == 3 && lua_isstring(L, 1)) {
+ char *s = (char *) lua_tostring(L, 1);
+ if (strcmp(s, "global") == 0)
+ isglobal = 1;
}
return vsetboxdim(L, height_offset, isglobal);
}
@@ -702,10 +701,10 @@ static int setboxdp(lua_State * L)
{
int isglobal = 0;
int n = lua_gettop(L);
- if (n==3 && lua_isstring(L,1)) {
- char *s = (char *)lua_tostring(L,1);
- if (strcmp(s,"global")==0)
- isglobal = 1;
+ if (n == 3 && lua_isstring(L, 1)) {
+ char *s = (char *) lua_tostring(L, 1);
+ if (strcmp(s, "global") == 0)
+ isglobal = 1;
}
return vsetboxdim(L, depth_offset, isglobal);
}
@@ -723,9 +722,9 @@ int settex(lua_State * L)
st = (char *) lua_tolstring(L, (i - 1), &k);
texstr = maketexlstring(st, k);
if (is_primitive(texstr)) {
- if (i==3 && lua_isstring(L,1)) {
- char *s = (char *)lua_tostring(L,1);
- if (strcmp(s,"global")==0)
+ if (i == 3 && lua_isstring(L, 1)) {
+ char *s = (char *) lua_tostring(L, 1);
+ if (strcmp(s, "global") == 0)
isglobal = 1;
}
cur_cs = string_lookup(st, k);
@@ -733,8 +732,9 @@ int settex(lua_State * L)
cur_cmd = zget_eq_type(cur_cs);
if (is_int_assign(cur_cmd)) {
if (lua_isnumber(L, i)) {
- assign_internal_value((isglobal?4:0), zget_equiv(cur_cs),
- lua_tonumber(L, i));
+ assign_internal_value((isglobal ? 4 : 0),
+ zget_equiv(cur_cs), lua_tonumber(L,
+ i));
} else {
lua_pushstring(L, "unsupported value type");
lua_error(L);
@@ -748,9 +748,10 @@ int settex(lua_State * L)
lua_error(L);
}
} else {
- j = (int) lua_tonumber(L, i);
+ j = (int) lua_tonumber(L, i);
}
- assign_internal_value((isglobal?4:0), zget_equiv(cur_cs), j);
+ assign_internal_value((isglobal ? 4 : 0), zget_equiv(cur_cs),
+ j);
} else {
lua_pushstring(L, "unsupported tex internal assignment");
lua_error(L);
@@ -934,37 +935,37 @@ int do_lastitem(lua_State * L, int cur_code)
return retval;
}
-static int tex_setmathparm (lua_State *L)
+static int tex_setmathparm(lua_State * L)
{
int i, j;
scaled k;
int n;
int l = cur_level;
n = lua_gettop(L);
-
- if ((n == 3) || (n == 4)) {
- if (n==4 && lua_isstring(L,1)) {
- char *s = (char *)lua_tostring(L,1);
- if (strcmp(s,"global")==0)
+
+ if ((n == 3) || (n == 4)) {
+ if (n == 4 && lua_isstring(L, 1)) {
+ char *s = (char *) lua_tostring(L, 1);
+ if (strcmp(s, "global") == 0)
l = 1;
- }
- i = luaL_checkoption(L, (n-2), NULL, math_param_names);
- j = luaL_checkoption(L, (n-1), NULL, math_style_names);
- k = (scaled)lua_tonumber(L, n);
- def_math_param (i,j,k, l);
+ }
+ i = luaL_checkoption(L, (n - 2), NULL, math_param_names);
+ j = luaL_checkoption(L, (n - 1), NULL, math_style_names);
+ k = (scaled) lua_tonumber(L, n);
+ def_math_param(i, j, k, l);
}
return 0;
}
-static int tex_getmathparm (lua_State *L)
+static int tex_getmathparm(lua_State * L)
{
int i, j;
scaled k;
if ((lua_gettop(L) == 2)) {
i = luaL_checkoption(L, 1, NULL, math_param_names);
j = luaL_checkoption(L, 2, NULL, math_style_names);
- k = get_math_param (i,j);
- lua_pushnumber(L, k);
+ k = get_math_param(i, j);
+ lua_pushnumber(L, k);
}
return 1;
}
diff --git a/Build/source/texk/web2c/luatexdir/lua/ltokenlib.c b/Build/source/texk/web2c/luatexdir/lua/ltokenlib.c
index 76a7aaa8faa..673286e4666 100644
--- a/Build/source/texk/web2c/luatexdir/lua/ltokenlib.c
+++ b/Build/source/texk/web2c/luatexdir/lua/ltokenlib.c
@@ -22,7 +22,7 @@
#include "tokens.h"
static const char _svn_version[] =
- "$Id: ltokenlib.c 2306 2009-04-16 15:01:45Z taco $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.40.2/source/texk/web2c/luatexdir/lua/ltokenlib.c $";
+ "$Id: ltokenlib.c 2448 2009-06-08 07:43:50Z taco $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.40.3/source/texk/web2c/luatexdir/lua/ltokenlib.c $";
extern int get_command_id(char *);
@@ -204,7 +204,7 @@ static int run_get_next(lua_State * L)
static int run_expand(lua_State * L)
{
- (void)L;
+ (void) L;
expand();
return 0;
}
diff --git a/Build/source/texk/web2c/luatexdir/lua/luainit.c b/Build/source/texk/web2c/luatexdir/lua/luainit.c
index 11b0d8d1900..eb4a492f7b1 100644
--- a/Build/source/texk/web2c/luatexdir/lua/luainit.c
+++ b/Build/source/texk/web2c/luatexdir/lua/luainit.c
@@ -25,7 +25,7 @@
#include <luatexdir/luatexextra.h>
static const char _svn_version[] =
- "$Id: luainit.c 2376 2009-05-08 08:40:13Z taco $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.40.2/source/texk/web2c/luatexdir/lua/luainit.c $";
+ "$Id: luainit.c 2448 2009-06-08 07:43:50Z taco $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.40.3/source/texk/web2c/luatexdir/lua/luainit.c $";
/* TH: TODO
*
@@ -626,9 +626,9 @@ void lua_initialize(int ac, char **av)
}
}
-void
-check_texconfig_init (void) {
- if (Luas!=NULL) {
+void check_texconfig_init(void)
+{
+ if (Luas != NULL) {
lua_getglobal(Luas, "texconfig");
if (lua_istable(Luas, -1)) {
lua_getfield(Luas, -1, "init");
@@ -636,7 +636,8 @@ check_texconfig_init (void) {
int i = lua_pcall(Luas, 0, 0, 0);
if (i != 0) {
/* Can't be more precise here, called before TeX initialization */
- fprintf(stderr, "This went wrong: %s\n", lua_tostring(Luas, -1));
+ fprintf(stderr, "This went wrong: %s\n",
+ lua_tostring(Luas, -1));
error();
}
}
@@ -644,20 +645,20 @@ check_texconfig_init (void) {
}
}
-void write_svnversion(char *v)
-{
+void write_svnversion(char *v)
+{
char *a_head, *n;
char *a = strdup(v);
size_t l = strlen("$Id: luatex.web ");
if (a != NULL) {
a_head = a;
- if (strlen(a)>l)
- a+=l;
+ if (strlen(a) > l)
+ a += l;
n = a;
- while (*n!='\0' && *n!=' ')
+ while (*n != '\0' && *n != ' ')
n++;
*n = '\0';
- fprintf(stdout, " luatex.web >= v%s", a);
- free (a_head);
+ fprintf(stdout, " luatex.web >= v%s", a);
+ free(a_head);
}
}
diff --git a/Build/source/texk/web2c/luatexdir/lua/luanode.c b/Build/source/texk/web2c/luatexdir/lua/luanode.c
index 4ea14bbfda5..6a27fcf9f36 100644
--- a/Build/source/texk/web2c/luatexdir/lua/luanode.c
+++ b/Build/source/texk/web2c/luatexdir/lua/luanode.c
@@ -22,7 +22,7 @@
#include "nodes.h"
static const char _svn_version[] =
- "$Id: luanode.c 2284 2009-04-14 12:58:45Z taco $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.40.2/source/texk/web2c/luatexdir/lua/luanode.c $";
+ "$Id: luanode.c 2448 2009-06-08 07:43:50Z taco $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.40.3/source/texk/web2c/luatexdir/lua/luanode.c $";
#undef link /* defined by cpascal.h */
#define info(a) fixmem[(a)].hhlh
@@ -62,8 +62,8 @@ void lua_node_filter_s(int filterid, char *extrainfo)
lua_State *L = Luas;
int s_top = lua_gettop(L);
int callback_id = callback_defined(filterid);
- if (callback_id<=0)
- return;
+ if (callback_id <= 0)
+ return;
if (!get_callback(L, callback_id)) {
lua_settop(L, s_top);
return;
@@ -267,48 +267,44 @@ int visible_last_node_type(int n)
return last_known_node + 1;
}
-void
-lua_pdf_literal (int i)
+void lua_pdf_literal(int i)
{
- char *s = NULL;
- size_t l = 0;
- lua_rawgeti(Luas, LUA_REGISTRYINDEX, i);
- s = (char *)lua_tolstring(Luas,-1,&l);
- while (l--) {
- pdf_room(1);
- pdf_buf[pdf_ptr++] = *s++;
- }
- pdf_buf[pdf_ptr++] = 10; /* pdf_print_nl */
- lua_pop(Luas,1);
+ char *s = NULL;
+ size_t l = 0;
+ lua_rawgeti(Luas, LUA_REGISTRYINDEX, i);
+ s = (char *) lua_tolstring(Luas, -1, &l);
+ while (l--) {
+ pdf_room(1);
+ pdf_buf[pdf_ptr++] = *s++;
+ }
+ pdf_buf[pdf_ptr++] = 10; /* pdf_print_nl */
+ lua_pop(Luas, 1);
}
-void
-copy_pdf_literal (pointer r, pointer p)
+void copy_pdf_literal(pointer r, pointer p)
{
- pdf_literal_type(r) = pdf_literal_type(p);
- pdf_literal_mode(r) = pdf_literal_mode(p);
- if (pdf_literal_type(p)==normal) {
- pdf_literal_data(r) = pdf_literal_data(p);
- add_token_ref(pdf_literal_data(p));
- } else {
- lua_rawgeti(Luas, LUA_REGISTRYINDEX, pdf_literal_data(p));
- pdf_literal_data(r) = luaL_ref(Luas, LUA_REGISTRYINDEX);
- }
+ pdf_literal_type(r) = pdf_literal_type(p);
+ pdf_literal_mode(r) = pdf_literal_mode(p);
+ if (pdf_literal_type(p) == normal) {
+ pdf_literal_data(r) = pdf_literal_data(p);
+ add_token_ref(pdf_literal_data(p));
+ } else {
+ lua_rawgeti(Luas, LUA_REGISTRYINDEX, pdf_literal_data(p));
+ pdf_literal_data(r) = luaL_ref(Luas, LUA_REGISTRYINDEX);
+ }
}
-void
-free_pdf_literal (pointer p)
+void free_pdf_literal(pointer p)
{
- if (pdf_literal_type(p)==normal) {
- delete_token_ref(pdf_literal_data(p));
- } else {
- luaL_unref(Luas, LUA_REGISTRYINDEX, pdf_literal_data(p));
- }
+ if (pdf_literal_type(p) == normal) {
+ delete_token_ref(pdf_literal_data(p));
+ } else {
+ luaL_unref(Luas, LUA_REGISTRYINDEX, pdf_literal_data(p));
+ }
}
-void
-show_pdf_literal (pointer p)
+void show_pdf_literal(pointer p)
{
tprint_esc("pdfliteral");
switch (pdf_literal_mode(p)) {
@@ -316,19 +312,19 @@ show_pdf_literal (pointer p)
break;
case direct_page:
tprint(" page");
- break;
+ break;
case direct_always:
tprint(" direct");
- break;
+ break;
default:
tconfusion("literal2");
- break;
+ break;
}
- if (pdf_literal_type(p)==normal) {
+ if (pdf_literal_type(p) == normal) {
print_mark(pdf_literal_data(p));
} else {
lua_rawgeti(Luas, LUA_REGISTRYINDEX, pdf_literal_data(p));
- tprint((char *)lua_tostring(Luas,-1));
- lua_pop(Luas,1);
+ tprint((char *) lua_tostring(Luas, -1));
+ lua_pop(Luas, 1);
}
-}
+}
diff --git a/Build/source/texk/web2c/luatexdir/lua/luastuff.c b/Build/source/texk/web2c/luatexdir/lua/luastuff.c
index ed38e5e510f..7cc81a1799f 100644
--- a/Build/source/texk/web2c/luatexdir/lua/luastuff.c
+++ b/Build/source/texk/web2c/luatexdir/lua/luastuff.c
@@ -21,7 +21,7 @@
#include <ptexlib.h>
static const char _svn_version[] =
- "$Id: luastuff.c 2321 2009-04-18 09:17:13Z hhenkel $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.40.2/source/texk/web2c/luatexdir/lua/luastuff.c $";
+ "$Id: luastuff.c 2321 2009-04-18 09:17:13Z hhenkel $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.40.3/source/texk/web2c/luatexdir/lua/luastuff.c $";
lua_State *Luas = NULL;
diff --git a/Build/source/texk/web2c/luatexdir/lua/luatex.c b/Build/source/texk/web2c/luatexdir/lua/luatex.c
index 0c29ebfb059..11b6836cacb 100644
--- a/Build/source/texk/web2c/luatexdir/lua/luatex.c
+++ b/Build/source/texk/web2c/luatexdir/lua/luatex.c
@@ -22,7 +22,7 @@
#include <zlib.h>
static const char _svn_version[] =
- "$Id: luatex.c 2306 2009-04-16 15:01:45Z taco $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.40.2/source/texk/web2c/luatexdir/lua/luatex.c $";
+ "$Id: luatex.c 2448 2009-06-08 07:43:50Z taco $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.40.3/source/texk/web2c/luatexdir/lua/luatex.c $";
/* do this aleph stuff here, for now */
@@ -251,7 +251,7 @@ static gzFile gz_fmtfile = NULL;
void do_zdump(char *p, int item_size, int nitems, FILE * out_file)
{
int err;
- (void)out_file;
+ (void) out_file;
if (nitems == 0)
return;
if (gzwrite(gz_fmtfile, (void *) p, item_size * nitems) !=
@@ -265,7 +265,7 @@ void do_zdump(char *p, int item_size, int nitems, FILE * out_file)
void do_zundump(char *p, int item_size, int nitems, FILE * in_file)
{
int err;
- (void)in_file;
+ (void) in_file;
if (nitems == 0)
return;
if (gzread(gz_fmtfile, (void *) p, item_size * nitems) <= 0) {
@@ -325,7 +325,7 @@ boolean zopen_w_output(FILE ** f, const_string fopen_mode)
void zwclose(FILE * f)
{
- (void)f;
+ (void) f;
gzclose(gz_fmtfile);
}
diff --git a/Build/source/texk/web2c/luatexdir/lua/luatoken.c b/Build/source/texk/web2c/luatexdir/lua/luatoken.c
index c6a33ee85f0..3bd703ac515 100644
--- a/Build/source/texk/web2c/luatexdir/lua/luatoken.c
+++ b/Build/source/texk/web2c/luatexdir/lua/luatoken.c
@@ -24,7 +24,7 @@
#include "commands.h"
static const char _svn_version[] =
- "$Id: luatoken.c 2271 2009-04-12 23:42:21Z oneiros $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.40.2/source/texk/web2c/luatexdir/lua/luatoken.c $";
+ "$Id: luatoken.c 2271 2009-04-12 23:42:21Z oneiros $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.40.3/source/texk/web2c/luatexdir/lua/luatoken.c $";
command_item command_names[] = {
{"relax", relax_cmd, NULL},
diff --git a/Build/source/texk/web2c/luatexdir/lua/texluac.c b/Build/source/texk/web2c/luatexdir/lua/texluac.c
index 8d62a3a885b..ea05bb270f7 100644
--- a/Build/source/texk/web2c/luatexdir/lua/texluac.c
+++ b/Build/source/texk/web2c/luatexdir/lua/texluac.c
@@ -46,7 +46,7 @@
#include <../lua51/lundump.h>
static const char _svn_version[] =
- "$Id: texluac.c 2271 2009-04-12 23:42:21Z oneiros $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.40.2/source/texk/web2c/luatexdir/lua/texluac.c $";
+ "$Id: texluac.c 2271 2009-04-12 23:42:21Z oneiros $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.40.3/source/texk/web2c/luatexdir/lua/texluac.c $";
#define PROGNAME "texluac" /* default program name */
#define OUTPUT PROGNAME ".out" /* default output file */