|
| static void | zero (void *p, size_t n) |
| static void | copy (void *to, const void *from, size_t n) |
| static uint16_t | get16 (const uint8_t *p) |
| static uint32_t | get32 (const uint8_t *p) |
| static void | put16 (uint8_t *p, uint16_t v) |
| static void | put32 (uint8_t *p, uint32_t v) |
| static size_t | fieldlen (const uint8_t *p, size_t n) |
| int | xtra_fail (struct xtra_error *err, int code, int in, size_t offset, uint32_t line) |
| static int | fail (struct xtra_error *err, int code, int in, size_t offset) |
| const char * | xtra_strerror (int code) |
| | The message of an error code (English, without position).
|
| void | xtra_init (struct xtra *x) |
| | Initialise settings with the defaults.
|
| void | xtra_apply_vers0 (struct xtra *x) |
| | What blitz2's loadxtra does after reading a vers 0 file.
|
| size_t | xtra_text_cap (int field) |
| | The bytes of a text field in a Blitz 2 .xtra (with the 0): a text is shorter than this.
|
| const uint8_t * | xtra_get_text (const struct xtra *x, const struct xtra_base *b, int field, size_t *len) |
| | A text field.
|
| int | xtra_set_text (struct xtra *x, int field, const void *p, size_t len) |
| | Set a text field to the caller's bytes.
|
| void | xtra_set_maxima (struct xtra *x, const struct xtra_max *m, uint32_t n) |
| | The maxima from the caller's array instead of those of the .xtra/header.
|
| void | xtra_max_begin (struct xtra_iter *it, const struct xtra *x, const struct xtra_base *b) |
| | Start iterating the maxima of x.
|
| int | xtra_next_max (struct xtra_iter *it, struct xtra_max *m) |
| | The next maximum.
|
| void | xtra_take_blitz2 (struct xtra *to, const struct xtra *from) |
| | Take what a Blitz 2 .xtra holds from from into to.
|
| int | xtra_detect (const uint8_t *buf, size_t len, const char *path) |
| | The type of a source.
|
| int | xtra_has_companion (int type) |
| | Whether the settings of a source of this type are in NAME.xtra.
|
| int | xtra_companion_name (const char *path, char *out, size_t cap) |
| | The name of the companion of the source path: path + ".xtra" (as TED and blitz2 make it).
|
| int | xtra_is_ab3_xtra (const uint8_t *xtra, size_t len) |
| | Whether a companion .xtra has AmiBlitz3's binary format with 15 switch words (since AmiBlitz/AmiBlitz3@bdae3f9e, docs/formats.md 1.3) - not Blitz 2's 14.
|
| static int | read_blitz2 (struct xtra *x, const uint8_t *buf, size_t size, struct xtra_error *err) |
| static int | read_bb22 (struct xtra *x, const uint8_t *buf, size_t size, struct xtra_error *err) |
| int | xtra_load (struct xtra *x, int type, const uint8_t *src, size_t len, const uint8_t *xtra, size_t xlen, struct xtra_error *err) |
| | Load the settings of a source.
|
| size_t | xtra_blitz2_size (const struct xtra *x) |
| | The bytes xtra_write_blitz2 writes: the fixed part of x->vers and 4 per maximum with a library number.
|
| static int | put_text (const struct xtra *x, const struct xtra_base *b, int f, uint8_t *out, size_t cap) |
| int | xtra_write_blitz2 (const struct xtra *x, const struct xtra_base *b, uint8_t *out, size_t cap, size_t *len, unsigned *skipped, struct xtra_error *err) |
| | Write x as Blitz 2 .xtra.
|
| int xtra_is_ab3_xtra |
( |
const uint8_t * | xtra, |
|
|
size_t | len ) |
Whether a companion .xtra has AmiBlitz3's binary format with 15 switch words (since AmiBlitz/AmiBlitz3@bdae3f9e, docs/formats.md 1.3) - not Blitz 2's 14.
The layout as AmiBlitz3's write_xtrafile writes it: vers 1, icon, 15 switch words, 6 buffer sizes at 32, 8 residents at 56, path and name of the executable at 600 and 792, CLI argument (116 bytes) and stack, version, builds at 984 (fixed part XTRA_AB3_FIXED), the {lib, max} pairs, 4 more bytes, maybe PED's XtraExtend. Recognised by: at least the fixed part + 4 bytes, a multiple of 4 (a Blitz 2 .xtra is 982/1110
- 4n), vers 1, icon and switch words 0 or XTRA_ON, every buffer size below 16 MB (in the 14-word layout's place a buffer's low word would be the next one's high word), the text fields 0-terminated. An older AmiBlitz3 .xtra with 14 switch words is not recognised.
- Parameters
-
| xtra | the file, xtra[0..len) (NULL: none) |
| len | its length |
- Returns
- 1 or 0
| void xtra_take_blitz2 |
( |
struct xtra * | to, |
|
|
const struct xtra * | from ) |
Take what a Blitz 2 .xtra holds from from into to.
vers, icon, switches, buffers, residents (texts, pointers), executable path and name, CLI argument - not the maxima, the editor part, AmiBlitz3's own fields. from's views keep pointing into its .xtra: the base used with to needs from's .xtra (e.g. an .ab3 header updated from a .xtra).
- Parameters
-
| to | the settings to change |
| from | the settings to take from |