This repository was archived by the owner on Apr 27, 2023. It is now read-only.
File tree 3 files changed +72
-2
lines changed
3 files changed +72
-2
lines changed Original file line number Diff line number Diff line change
1
+ package = " lua-struct"
2
+ version = " @VERSION@-@REVISION@"
3
+
4
+ source = {
5
+ url = " git://github.com/iryont/lua-struct.git"
6
+ }
7
+
8
+ description = {
9
+ summary = " Implementation of binary packing/unpacking in pure lua" ,
10
+ detailed = [[
11
+ Implementation of binary packing/unpacking in pure lua
12
+ You can use it to pack and unpack binary data in pure lua. The idea is very similar to PHP unpack and pack functions."
13
+ ]] ,
14
+ homepage = " https://github.com/iryont/lua-struct" ,
15
+ license = " MIT/X11"
16
+ }
17
+
18
+ dependencies = {}
19
+
20
+ build = {
21
+ type = ' none' ,
22
+ install = {
23
+ lua = {
24
+ [' struct' ] = ' struct.lua'
25
+ }
26
+ }
27
+ }
Original file line number Diff line number Diff line change
1
+ # version=$(git tag -l | tail -1)
2
+
3
+ version="1.0.0"
4
+ rev="1" # rev="1"
5
+
6
+ name="lua-struct-$version-$rev"
7
+
8
+ tmp="$TEMPDIR"
9
+ if [ -z "$tmp" ]; then
10
+ tmp="$HOME"
11
+ fi
12
+
13
+ src="$(cd "$(dirname $0)" && pwd)"
14
+
15
+ cd $tmp
16
+ rm -f "$name"
17
+ ln -sf "$src" "$name"
18
+
19
+ echo "Creating $tmp/$name.src.rock"
20
+ tar -czvpf "$name.src.rock" \
21
+ --dereference \
22
+ --exclude "$name/.git*" \
23
+ --exclude "$name/*.o" \
24
+ --exclude "$name/*.so" \
25
+ --exclude "$name/lua-struct.rockspec" \
26
+ --exclude "$name/rockspecs" \
27
+ --exclude "$name/server" \
28
+ --exclude "$name/coronasdk-example" \
29
+ --exclude "$name/example" \
30
+ --exclude "$name/*~" \
31
+ --exclude "$name/.DS_Store" \
32
+ --exclude "$name/publish" \
33
+ --exclude "$name/$(basename $0)" \
34
+ "$name"
35
+
36
+ echo "Creating $tmp/$name.rockspec"
37
+ cat "$src/lua-struct.rockspec" | \
38
+ sed \
39
+ -e s/@VERSION@/$version/ \
40
+ -e s/@REVISION@/$rev/ > \
41
+ "$name.rockspec"
Original file line number Diff line number Diff line change @@ -30,8 +30,8 @@ function struct.pack(format, ...)
30
30
local sign = 0
31
31
32
32
if val < 0 then
33
- sign = 1
34
- val = - val
33
+ sign = 1
34
+ val = - val
35
35
end
36
36
37
37
local mantissa , exponent = math.frexp (val )
@@ -167,3 +167,5 @@ function struct.unpack(format, stream)
167
167
168
168
return unpack (vars )
169
169
end
170
+
171
+ return struct
You can’t perform that action at this time.
0 commit comments