Add abstraction layer to load module from memory

Libxmp should be able to load a module from memory in order to replace
fmod in a project that delivers a pointer to module data already in
memory.

Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>
Use hio_ prefix for handle I/O calls

Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>
Fix build of multi-file loaders

Multi-file loaders must handle memory I/O wrappers in a special way
because extra files are always read from files.

Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>
[test] Fix sample loading tests to use handle I/O

Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>
Fix prowizard loader to use memory I/O

Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>
Use macro to get memory i/o handle type

Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>
Add stat function to memory i/o wrappers

Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>
Add memory operations to memory i/o wrappers

Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>
Add load_module_from_memory API call

Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>
Update version number

Change version to 4.2 since we added a new API call.

Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>
[test] Add handle i/o memory reading tests

Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>
[test] Update hio test

Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>
[test] Add hio_seek SEEK_END test

Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>
[test] Check if module was correctly loaded from memory

Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>
Fix module loading from memory

If we're loading a module from memory, don't compute the file md5 digest
because we don't know the file size. Also fix memory pointer update in
hio_read().

Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>
Merge branch 'master' of ssh://git.code.sf.net/p/xmp/libxmp into memory_io

Conflicts:
	Makefile.in
	include/xmp.h
	libxmp.pc.in
	src/loaders/okt_load.c

Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>
Merge branch 'master' into memory_io

Resolve conflicts:

CONFLICT (content): Merge conflict in src/loaders/okt_load.c
CONFLICT (content): Merge conflict in libxmp.pc.in
CONFLICT (content): Merge conflict in include/xmp.h
CONFLICT (content): Merge conflict in Makefile.in

Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>
Merge tag 'libxmp-4.1.5' of ssh://git.code.sf.net/p/xmp/libxmp into memory_io

Conflicts:
	Makefile.in
	include/xmp.h
	libxmp.pc.in
	src/loaders/okt_load.c

Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>
Add missing hio header to distribution package
Change memory i/o access to allow us to set a file size

When opening a file from memory, add the option to set a file size. This
will allow us to test some file formats and compute the MD5 digest of a
file in memory.

Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>