~sircmpwn/koio

ref: 0.1.2 koio/koio.1.scd -rw-r--r-- 1.6 KiB
138cc5edSeth Hall Fix an issue with hash collisions returning incorrect values. 2 years ago
                                                                                
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
57
58
59
60
61
62
63
64
65
66
67
68
koio(1)

# NAME

koio - bundles assets for embedding in your program

# SYNOPSIS

*koio* -o _path_ [flags...] [assets...]

# OPTIONS

*-h*
	Show help message and exit.

*-d* _function_
	Specify the symbol name to assign to the deinitialization function. You may
	call this to unload any assets loaded with the function specified by *-i*.
	This defaults to *koio\_unload\_assets*.

*-i* _function_
	Specify the symbol name to assign to the initialization function. You must
	call this function in your program before using any koio-controlled assets.
	This defaults to *koio\_load\_assets*.

*-o* _path_
	Required. Specifies a _path_ at which the bundle will be written as a C
	source file.

# ASSETS

You can specify any number of files to be embedded the bundle. Simply
specifying a path is enough - the file will be available at *//that/path* via
the koio API. You may also optionally add a colon and specify the virtual path
for that file - this needn't begin with *//* if you wish to overlay files on
the genuine filesystem.

# EXAMPLE

The following command produces *asset\_bundle.c*:

```
$ koio -o asset_bundle.c \\
	images/hello.png \\
	images/world.png://hello/world.png \\
	fakepasswd:/etc/passwd
```

If you compile and link *asset\_bundle.c*, you can then use these files:

```
#include <koio.h>

int main(int argc, char **argv) {
	koio_load_assets();
	
	FILE *f = ko_fopen("//images/hello.png", "r");
	// ...
	f = ko_fopen("//hello/world.png", "r");
	// ...
	f = ko_fopen("/etc/passwd", "r");
}
```

# AUTHORS

Maintained by Drew DeVault <sir@cmpwn.com>. Upstream sources are available at
<https://git.sr.ht/~sircmpwn/koio> and patches/bugs should be emailed to Drew.