added assfile
[raydungeon] / libs / assfile / README.md
1 assfile
2 ======
3
4 About
5 -----
6 Assman is a library for accessing assets (read only access to data files) in
7 multiple ways through a simple file I/O interface designed as a drop-in
8 replacement to C fopen/fread/etc I/O calls. In most cases you can just prefix
9 all your I/O calls with `ass_` and change `FILE*` to `ass_file*`, and it will
10 just work.
11
12 The access modules provided are:
13  - `mod_path`: maps an arbitrary filesystem path to your chosen prefix. For
14    instance, after calling `ass_add_path("data", "/usr/share/mygame")` you can
15    access the data file `/usr/share/mygame/foo.png` by calling
16    `ass_fopen("data/foo.png", "rb")`.
17
18  - `mod_archive`: mounts the contents of an archive to your chosen prefix. For
19    example, after calling `ass_add_archive("data", "data.tar")` you can access
20    the contents of the tarball as if they where contents of a virtual `data`
21    directory.
22
23  - `mod_url`: maps a url prefix to your chosen prefix. For example, after
24    calling `ass_add_url("data", "http://mydomain/myapp/data")` you can access
25    `http://mydomain/myapp/data/foo.png` by calling
26    `ass_fopen("data/foo.png", "rb")`.
27
28 License
29 -------
30 Copyright (C) 2018 John Tsiombikas <nuclear@member.fsf.org>
31
32 The assfile library is free software. Feel free to use, modify, and/or
33 redistribute it under the terms of the GNU Lesser General Public License
34 version 3, or at your option any later version published by the Free Software
35 Foundation. See COPYING and COPYING.LESSER for details.
36
37 Build
38 -----
39 To build and install assfile on UNIX, run the usual:
40
41     ./configure
42     make
43     make install
44
45 The `mod_url` module depends on `libcurl` and uses POSIX threads. If you don't
46 want that dependency, you can disable `mod_url` by passing `--disable-url` to
47 `configure`.
48
49 See `./configure --help` for a complete list of build-time options.
50
51 To cross-compile for windows with mingw-w64, try the following incantation:
52
53     ./configure --prefix=/usr/i686-w64-mingw32
54     make CC=i686-w64-mingw32-gcc AR=i686-w64-mingw32-ar sys=mingw
55     make install sys=mingw