https://github.com/jtsiomb/assfile
C library for accessing assets (read-only data) from many different sources, with an fopen/fread-like API.
https://github.com/jtsiomb/assfile
Last synced: about 1 month ago
JSON representation
C library for accessing assets (read-only data) from many different sources, with an fopen/fread-like API.
- Host: GitHub
- URL: https://github.com/jtsiomb/assfile
- Owner: jtsiomb
- License: lgpl-3.0
- Created: 2018-09-28T05:37:12.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-03-28T23:47:21.000Z (about 2 years ago)
- Last Synced: 2025-03-18T02:22:09.988Z (about 2 months ago)
- Language: C
- Homepage:
- Size: 49.8 KB
- Stars: 17
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: COPYING
Awesome Lists containing this project
- AwesomeCppGameDev - assfile - only data) from many different sources, with an fopen/fread-like API. (C++)
README
assfile
======About
-----
Assman is a library for accessing assets (read only access to data files) in
multiple ways through a simple file I/O interface designed as a drop-in
replacement to C fopen/fread/etc I/O calls. In most cases you can just prefix
all your I/O calls with `ass_` and change `FILE*` to `ass_file*`, and it will
just work.The access modules provided are:
- `mod_path`: maps an arbitrary filesystem path to your chosen prefix. For
instance, after calling `ass_add_path("data", "/usr/share/mygame")` you can
access the data file `/usr/share/mygame/foo.png` by calling
`ass_fopen("data/foo.png", "rb")`.- `mod_archive`: mounts the contents of an archive to your chosen prefix. For
example, after calling `ass_add_archive("data", "data.tar")` you can access
the contents of the tarball as if they where contents of a virtual `data`
directory.- `mod_url`: maps a url prefix to your chosen prefix. For example, after
calling `ass_add_url("data", "http://mydomain/myapp/data")` you can access
`http://mydomain/myapp/data/foo.png` by calling
`ass_fopen("data/foo.png", "rb")`.License
-------
Copyright (C) 2018 John TsiombikasThe assfile library is free software. Feel free to use, modify, and/or
redistribute it under the terms of the GNU Lesser General Public License
version 3, or at your option any later version published by the Free Software
Foundation. See COPYING and COPYING.LESSER for details.Build
-----
To build and install assfile on UNIX, run the usual:./configure
make
make installThe `mod_url` module depends on `libcurl` and uses POSIX threads. If you don't
want that dependency, you can disable `mod_url` by passing `--disable-url` to
`configure`.See `./configure --help` for a complete list of build-time options.
To cross-compile for windows with mingw-w64, try the following incantation:
./configure --prefix=/usr/i686-w64-mingw32
make CC=i686-w64-mingw32-gcc AR=i686-w64-mingw32-ar sys=mingw
make install sys=mingw