Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
luatex
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeXLive
luatex
Commits
f446611e
Commit
f446611e
authored
8 years ago
by
Luigi Scarso
Browse files
Options
Downloads
Patches
Plain Diff
clean up -- !!! WARNING: WORK IN PROGRESS !!!
parent
6fadd64a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
source/texk/web2c/luatexdir/lua/liolibext.c
+4
-11
4 additions, 11 deletions
source/texk/web2c/luatexdir/lua/liolibext.c
source/texk/web2c/luatexdir/lua/lstrlibext.c
+17
-7
17 additions, 7 deletions
source/texk/web2c/luatexdir/lua/lstrlibext.c
with
21 additions
and
18 deletions
source/texk/web2c/luatexdir/lua/liolibext.c
+
4
−
11
View file @
f446611e
...
...
@@ -181,12 +181,10 @@ static int read2dot14(lua_State *L) {
FILE
*
f
=
tofile
(
L
);
int
a
=
getc
(
f
);
int
b
=
getc
(
f
);
int
c
=
getc
(
f
);
int
d
=
getc
(
f
);
if
(
d
==
EOF
)
{
if
(
b
==
EOF
)
{
lua_pushnil
(
L
);
}
else
{
int
n
=
(
0x100
0000
*
a
+
0x10000
*
b
+
0x100
*
c
+
d
)
;
int
n
=
0x100
*
a
+
b
;
lua_pushnumber
(
L
,
(
n
>>
14
)
+
((
n
&
0x3fff
)
/
16384
.
0
));
}
return
1
;
...
...
@@ -377,12 +375,7 @@ static const luaL_Reg fiolib[] = {
{
NULL
,
NULL
}
};
int
luaopen_fio
(
lua_State
*
L
)
{
luaL_register
(
L
,
"fio"
,
fiolib
);
#if defined(_MSC_VER)
return
luaopen_io
(
L
);
#else
return
1
;
#endif
/* _MSC_VER */
luaL_register
(
L
,
"fio"
,
fiolib
);
return
1
;
}
This diff is collapsed.
Click to expand it.
source/texk/web2c/luatexdir/lua/lstrlibext.c
+
17
−
7
View file @
f446611e
/* lstrlibext.c
Copyright 2012 Taco Hoekwater <taco@luatex.org>
This file is part of LuaTeX.
...
...
@@ -92,7 +92,7 @@ static int str_split (lua_State *L) {
}
free
(
orig
);
return
1
;
}
}
static
int
characters_aux
(
lua_State
*
L
)
{
size_t
ls
;
...
...
@@ -152,7 +152,7 @@ static int utfcharacters_aux (lua_State *L) {
}
}
return
utf_failed
(
L
,
ind
+
1
);
/* we found a follow byte! */
}
}
static
int
str_utfcharacters
(
lua_State
*
L
)
{
...
...
@@ -180,7 +180,7 @@ static int utfvalues_aux (lua_State *L) {
if
(
i
<
0x80
)
{
v
=
i
;
}
else
if
(
i
>=
0xF0
)
{
if
((
ind
+
3
)
<
(
int
)
ls
&&
((
unsigned
)
*
(
s
+
ind
+
1
))
>=
0x80
if
((
ind
+
3
)
<
(
int
)
ls
&&
((
unsigned
)
*
(
s
+
ind
+
1
))
>=
0x80
&&
((
unsigned
)
*
(
s
+
ind
+
2
))
>=
0x80
&&
((
unsigned
)
*
(
s
+
ind
+
3
))
>=
0x80
)
{
numbytes
=
4
;
j
=
((
unsigned
)
*
(
s
+
ind
+
1
))
-
128
;
...
...
@@ -237,7 +237,7 @@ static int characterpairs_aux (lua_State *L) {
b
[
0
]
=
*
(
s
+
ind
);
b
[
1
]
=
0
;
lua_pushlstring
(
L
,
b
,
1
);
if
(
ind
+
1
<
(
int
)
ls
)
{
b
[
0
]
=
*
(
s
+
ind
+
1
);
b
[
0
]
=
*
(
s
+
ind
+
1
);
lua_pushlstring
(
L
,
b
,
1
);
}
else
{
lua_pushlstring
(
L
,
b
+
1
,
0
);
...
...
@@ -350,7 +350,17 @@ static int str_dump (lua_State *L) {
return
1
;
}
static
int
str_bytetable
(
lua_State
*
L
)
{
size_t
l
;
int
i
;
const
char
*
s
=
luaL_checklstring
(
L
,
1
,
&
l
);
lua_createtable
(
L
,
l
,
0
);
for
(
i
=
0
;
i
<
l
;
i
++
)
{
lua_pushinteger
(
L
,(
unsigned
char
)
*
(
s
+
i
));
lua_rawseti
(
L
,
-
2
,
i
+
1
);
}
return
1
;
}
static
const
luaL_Reg
strlibext
[]
=
{
{
"utfvalues"
,
str_utfvalues
},
...
...
@@ -359,6 +369,7 @@ static const luaL_Reg strlibext[] = {
{
"characterpairs"
,
str_characterpairs
},
{
"bytes"
,
str_bytes
},
{
"bytepairs"
,
str_bytepairs
},
{
"bytetable"
,
str_bytetable
},
{
"explode"
,
str_split
},
{
"dump"
,
str_dump
},
{
NULL
,
NULL
}
...
...
@@ -374,4 +385,3 @@ void open_strlibext(lua_State * L)
}
lua_pop
(
L
,
1
);
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment