BlitzMax Extended  0.8.11
Pushing Blitz to the Max.
Defines | Functions
blitz_incbin.h File Reference

Functionality to include any binary data in the binary. More...

#include "_common.h"

Go to the source code of this file.

Defines

#define BBINCBIN_MAX_SIZE   BBSIZE_MAX
 The maximum size of a file that can be included via bbIncbinAdd.

Functions

BBInt bbIncbinAdd (BBString *file, const void *ptr, BBSize size)
 Adds a file to the binary included data.
void * bbIncbinPtr (const BBString *file)
 Gives a pointer to the data stored under the given file name.
BBSize bbIncbinLen (const BBString *file)
 Gives the length of the data stored under the given file name.

Detailed Description

Functionality to include any binary data in the binary.

'Incbin' is a BlitzMax keyword. When executed, the compiler looks for the file which is given as the parameter. If the file is found, it is included in the application's binary file by the compiler.

When the application is run, the function bbIncbinAdd is called and automatically given the right parameters. This fills the internal structure with the information which can then be accessed via bbIncbinPtr and bbIncbinLen.

At least that's what I figured out so far - Fabian

Author:
Mark Sibly

Define Documentation

#define BBINCBIN_MAX_SIZE   BBSIZE_MAX

The maximum size of a file that can be included via bbIncbinAdd.

See also:
bbIncbindAdd, bbIncbindLen

Referenced by bbIncbinAdd().


Function Documentation

BBInt bbIncbinAdd ( BBString file,
const void *  ptr,
BBSize  size 
)

Adds a file to the binary included data.

Parameters:
fileThe file where the data came from
ptrA pointer to the binary included data
sizeThe size of the data in the range [0 .. BBINCBIN_MAX_SIZE]
Return values:
1if the file was successfully incbin'd
0if the file was already included
BBSize bbIncbinLen ( const BBString file)

Gives the length of the data stored under the given file name.

Parameters:
fileThe file where the data came from
Returns:
The length of the included data or 0 if the file was not incbin'd yet
void* bbIncbinPtr ( const BBString file)

Gives a pointer to the data stored under the given file name.

Parameters:
fileThe file where the data came from
Returns:
A pointer to the included data or NULL if there is none for this file