blob: 91356488c1b8dc3299553c606353791f0c2e05e4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
_ _
| | (_)
| |__ _ ___
| '_ \| |/ _ \
| |_) | | __/
|_.__/|_|\___|
---------------------------------------------------------------------
bie is a tool for generating a simple indexed flat archive.
Example:
========
$ echo "foo" >a
$ dd if=/dev/urandom of=b bs=30 count=1
$ zlib-flate -compress <bie.c >c
$ bie archive.bie archive.idx a b c
$ hexdump -C archive.bie
00000000 66 6f 6f 0a 00 00 00 00 00 00 00 00 00 00 00 00 |foo.............|
00000010 1b c9 01 82 4f df 1a ec 01 2a dc 0e 3e f1 e7 52 |....O....*..>..R|
00000020 ed e3 99 3e 70 b0 eb 6f f8 20 49 ba b9 8d 00 00 |...>p..o. I.....|
00000030 78 9c 95 54 6d 6f d3 30 10 fe 9c fc 8a a3 a8 6b |x..Tmo.0.......k|
00000040 d2 76 5d 37 10 42 7d 19 2f a5 43 15 65 a0 ad 93 |.v]7.B}./.C.e...|
00000050 40 6c 1a 21 71 5a ab 89 1d c5 4e c7 c6 fa df b9 |@l.!qZ....N.....|
... SNIP ...
$ cat archive.idx
BIE_ENTRY(a, 0, 4)
BIE_ENTRY(b, 16, 30)
BIE_ENTRY(c, 48, 750)
Use:
====
Create an archive and index from a list of files you wish to access
from your program.
Use the CPP or another macro processor to expand BIE_ENTRY to some
code which stores this information in your program.
Read the archive into memory (or link it in) and use the offset and
size data from the index to read from the archive.
Dependencies:
=============
eprintf - https://the-tk.com/cgit/eprintf/
Place in a directory adjacent to the location of the bie sources or
override EPRINTF_PATH in config.mk
Compilation and Installation:
=============================
$ echo prefix=/usr >config.mk
$ make
# make install
|