BB2 C port
API reference: Blitz libraries in C and the shared code
Loading...
Searching...
No Matches
xtra_mode.c File Reference
#include "xtra.h"

Functions

int xtra_mode (int force, const uint8_t *src, size_t len, const char *path, const uint8_t *xtra, size_t xlen)
 The mode of a source (xtra_mode.c; docs/ab3/variant.md).

Function Documentation

◆ xtra_mode()

int xtra_mode ( int force,
const uint8_t * src,
size_t len,
const char * path,
const uint8_t * xtra,
size_t xlen )

The mode of a source (xtra_mode.c; docs/ab3/variant.md).

force XTRA_MODE_BB2 or XTRA_MODE_AB3 (the command line's -mode): that mode. Otherwise by xtra_detect: XTRA_T_AB3 (a text with the embedded header, or a text named *.ab3) is AB3; XTRA_T_TED (tokenised) is AB3 if its companion .xtra has AmiBlitz3's format (xtra_is_ab3_xtra), else BB2; everything else (BB22, text without header) is BB2. The same rule gives the mode of a tokenised include.

Parameters
forcean enum xtra_mode; XTRA_MODE_DETECT (or another value): detect
srcthe source, src[0..len)
lenits length
pathits file name (may be NULL)
xtraits companion .xtra, xtra[0..xlen) (NULL: none)
xlenits length
Returns
XTRA_MODE_BB2 or XTRA_MODE_AB3