Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
incbin.h File Reference

Utility for including binary files. More...

#include <limits.h>
Include dependency graph for incbin.h:

Go to the source code of this file.

Macros

#define INCBIN_ALIGNMENT_INDEX   3
 
#define INCBIN_ALIGN_SHIFT_0   1
 
#define INCBIN_ALIGN_SHIFT_1   2
 
#define INCBIN_ALIGN_SHIFT_2   4
 
#define INCBIN_ALIGN_SHIFT_3   8
 
#define INCBIN_ALIGN_SHIFT_4   16
 
#define INCBIN_ALIGN_SHIFT_5   32
 
#define INCBIN_ALIGN_SHIFT_6   64
 
#define INCBIN_ALIGNMENT
 
#define INCBIN_STR(X)
 
#define INCBIN_STRINGIZE(X)
 
#define INCBIN_CAT(X, Y)
 
#define INCBIN_CONCATENATE(X, Y)
 
#define INCBIN_EVAL(X)
 
#define INCBIN_INVOKE(N, ...)
 
#define INCBIN_VA_ARG_COUNTER(_1, _2, _3, N, ...)
 
#define INCBIN_VA_ARGC(...)
 
#define INCBIN_MACRO   ".incbin"
 
#define INCBIN_ALIGN    __attribute__((aligned(INCBIN_ALIGNMENT)))
 
#define INCBIN_ALIGN_HOST   ".align " INCBIN_STRINGIZE(INCBIN_ALIGNMENT) "\n"
 
#define INCBIN_ALIGN_BYTE   ".align 1\n"
 
#define INCBIN_EXTERNAL   extern
 
#define INCBIN_CONST   const
 
#define INCBIN_OUTPUT_SECTION   ".rodata"
 Optionally override the linker section into which size and data is emitted.
 
#define INCBIN_OUTPUT_DATA_SECTION   INCBIN_OUTPUT_SECTION
 Optionally override the linker section into which data is emitted.
 
#define INCBIN_OUTPUT_SIZE_SECTION   INCBIN_OUTPUT_SECTION
 Optionally override the linker section into which size is emitted.
 
#define INCBIN_SECTION   ".section " INCBIN_OUTPUT_SECTION "\n"
 
#define INCBIN_GLOBAL(NAME)
 
#define INCBIN_INT   ".int "
 
#define INCBIN_MANGLE   ""
 
#define INCBIN_TYPE(NAME)
 
#define INCBIN_BYTE   ".byte "
 
#define INCBIN_STYLE_CAMEL   0
 
#define INCBIN_STYLE_SNAKE   1
 
#define INCBIN_PREFIX   g
 Specify the prefix to use for symbol names.
 
#define INCBIN_STYLE   INCBIN_STYLE_CAMEL
 Specify the style used for symbol names.
 
#define INCBIN_STYLE_0_DATA   Data
 
#define INCBIN_STYLE_0_END   End
 
#define INCBIN_STYLE_0_SIZE   Size
 
#define INCBIN_STYLE_1_DATA   _data
 
#define INCBIN_STYLE_1_END   _end
 
#define INCBIN_STYLE_1_SIZE   _size
 
#define INCBIN_STYLE_IDENT(TYPE)
 
#define INCBIN_STYLE_STRING(TYPE)
 
#define INCBIN_GLOBAL_LABELS(NAME, TYPE)
 
#define INCBIN_EXTERN(...)
 Externally reference binary data included in another translation unit.
 
#define INCBIN_EXTERN_1(NAME, ...)
 
#define INCBIN_EXTERN_2(TYPE, NAME)
 
#define INCTXT_EXTERN(NAME)
 Externally reference textual data included in another translation unit.
 
#define INCBIN(...)
 Include a binary file into the current translation unit.
 
#define INCBIN_1(...)
 
#define INCBIN_2(NAME, FILENAME)
 
#define INCBIN_3(TYPE, NAME, FILENAME)
 
#define INCBIN_COMMON(TYPE, NAME, FILENAME, TERMINATOR)
 
#define INCTXT(NAME, FILENAME)
 Include a textual file into the current translation unit.
 

Detailed Description

Author
Dale Weiler

Facilities for including binary files into the current translation unit and making use from them externally in other translation units.

From https://github.com/graphitemaster/incbin licenced in public domain

Definition in file incbin.h.

Macro Definition Documentation

◆ INCBIN

#define INCBIN ( ...)
Value:
INCBIN_CONCATENATE(INCBIN_, INCBIN_VA_ARGC(__VA_ARGS__))(__VA_ARGS__)
#define INCBIN_VA_ARGC(...)
Definition incbin.h:73
#define INCBIN_CONCATENATE(X, Y)
Definition incbin.h:64

Includes a binary file into the current translation unit, producing three symbols for objects that encode the data and size respectively.

The symbol names are a concatenation of ‘INCBIN_PREFIX’ before NAME; with "Data", as well as "End" and "Size" after. An example is provided below.

Parameters
TYPEOptional array type. Omitting this picks a default of unsigned char.
NAMEThe name to associate with this binary data (as an identifier.)
FILENAMEThe file to include (as a string literal.)
INCBIN(Icon, "icon.png");
// Now you have the following symbols:
// const unsigned char <prefix>Icon<data>[];
// const unsigned char *const <prefix>Icon<end>;
// const unsigned int <prefix>Icon<size>;
#define INCBIN(...)
Include a binary file into the current translation unit.
Definition incbin.h:405

You may specify a custom optional data type as well as the first argument. These macros are specialized by arity.

INCBIN(custom_type, Icon, "icon.png");
// Now you have the following symbols:
// const custom_type <prefix>Icon<data>[];
// const custom_type *const <prefix>Icon<end>;
// const unsigned int <prefix>Icon<size>;
Warning
This must be used in global scope
The identifiers may be different if INCBIN_STYLE is not default

To externally reference the data included by this in another translation unit please

See also
INCBIN_EXTERN.

Definition at line 405 of file incbin.h.

405# define INCBIN(...) \
406 INCBIN_CONCATENATE(INCBIN_, INCBIN_VA_ARGC(__VA_ARGS__))(__VA_ARGS__)

◆ INCBIN_1

#define INCBIN_1 ( ...)
Value:
/* Cannot do anything here */

Definition at line 412 of file incbin.h.

◆ INCBIN_2

#define INCBIN_2 ( NAME,
FILENAME )
Value:
INCBIN_3(unsigned char, NAME, FILENAME)
#define INCBIN_3(TYPE, NAME, FILENAME)
Definition incbin.h:416
#define NAME(s)

Definition at line 414 of file incbin.h.

414# define INCBIN_2(NAME, FILENAME) \
415 INCBIN_3(unsigned char, NAME, FILENAME)

◆ INCBIN_3

#define INCBIN_3 ( TYPE,
NAME,
FILENAME )
Value:
INCBIN_COMMON(TYPE, NAME, FILENAME, /* No terminator for binary data */)
#define INCBIN_COMMON(TYPE, NAME, FILENAME, TERMINATOR)
Definition incbin.h:417

Definition at line 416 of file incbin.h.

◆ INCBIN_ALIGN

#define INCBIN_ALIGN    __attribute__((aligned(INCBIN_ALIGNMENT)))

Definition at line 88 of file incbin.h.

88# define INCBIN_ALIGN \
89 __attribute__((aligned(INCBIN_ALIGNMENT)))

◆ INCBIN_ALIGN_BYTE

#define INCBIN_ALIGN_BYTE   ".align 1\n"

Definition at line 114 of file incbin.h.

◆ INCBIN_ALIGN_HOST

#define INCBIN_ALIGN_HOST   ".align " INCBIN_STRINGIZE(INCBIN_ALIGNMENT) "\n"

Definition at line 113 of file incbin.h.

◆ INCBIN_ALIGN_SHIFT_0

#define INCBIN_ALIGN_SHIFT_0   1

Definition at line 42 of file incbin.h.

◆ INCBIN_ALIGN_SHIFT_1

#define INCBIN_ALIGN_SHIFT_1   2

Definition at line 43 of file incbin.h.

◆ INCBIN_ALIGN_SHIFT_2

#define INCBIN_ALIGN_SHIFT_2   4

Definition at line 44 of file incbin.h.

◆ INCBIN_ALIGN_SHIFT_3

#define INCBIN_ALIGN_SHIFT_3   8

Definition at line 45 of file incbin.h.

◆ INCBIN_ALIGN_SHIFT_4

#define INCBIN_ALIGN_SHIFT_4   16

Definition at line 46 of file incbin.h.

◆ INCBIN_ALIGN_SHIFT_5

#define INCBIN_ALIGN_SHIFT_5   32

Definition at line 47 of file incbin.h.

◆ INCBIN_ALIGN_SHIFT_6

#define INCBIN_ALIGN_SHIFT_6   64

Definition at line 48 of file incbin.h.

◆ INCBIN_ALIGNMENT

#define INCBIN_ALIGNMENT
Value:
INCBIN_CONCATENATE(INCBIN_ALIGN_SHIFT, _), \
#define INCBIN_ALIGNMENT_INDEX
Definition incbin.h:36

Definition at line 51 of file incbin.h.

51#define INCBIN_ALIGNMENT \
52 INCBIN_CONCATENATE( \
53 INCBIN_CONCATENATE(INCBIN_ALIGN_SHIFT, _), \
54 INCBIN_ALIGNMENT_INDEX)

◆ INCBIN_ALIGNMENT_INDEX

#define INCBIN_ALIGNMENT_INDEX   3

Definition at line 36 of file incbin.h.

◆ INCBIN_BYTE

#define INCBIN_BYTE   ".byte "

Definition at line 200 of file incbin.h.

◆ INCBIN_CAT

#define INCBIN_CAT ( X,
Y )
Value:
X ## Y
Definition lib.h:43

Definition at line 62 of file incbin.h.

62#define INCBIN_CAT(X, Y) \
63 X ## Y

◆ INCBIN_COMMON

#define INCBIN_COMMON ( TYPE,
NAME,
FILENAME,
TERMINATOR )
Value:
__asm__(INCBIN_SECTION \
INCBIN_MACRO " \"" FILENAME "\"\n" \
TERMINATOR \
INCBIN_BYTE "1\n" \
".text\n" \
); \
INCBIN_EXTERN(TYPE, NAME)
#define INCBIN_ALIGN_BYTE
Definition incbin.h:114
#define INCBIN_ALIGN_HOST
Definition incbin.h:113
#define INCBIN_INT
Definition incbin.h:183
#define INCBIN_GLOBAL_LABELS(NAME, TYPE)
Definition incbin.h:274
#define INCBIN_MACRO
Definition incbin.h:84
#define INCBIN_BYTE
Definition incbin.h:200
#define INCBIN_STYLE_STRING(TYPE)
Definition incbin.h:268
#define INCBIN_MANGLE
Definition incbin.h:188
#define INCBIN_SECTION
Definition incbin.h:178
#define INCBIN_STRINGIZE(X)
Definition incbin.h:59
#define INCBIN_PREFIX
Specify the prefix to use for symbol names.
Definition incbin.h:224

Definition at line 417 of file incbin.h.

417# define INCBIN_COMMON(TYPE, NAME, FILENAME, TERMINATOR) \
418 __asm__(INCBIN_SECTION \
419 INCBIN_GLOBAL_LABELS(NAME, DATA) \
420 INCBIN_ALIGN_HOST \
421 INCBIN_MANGLE INCBIN_STRINGIZE(INCBIN_PREFIX) #NAME INCBIN_STYLE_STRING(DATA) ":\n" \
422 INCBIN_MACRO " \"" FILENAME "\"\n" \
423 TERMINATOR \
424 INCBIN_GLOBAL_LABELS(NAME, END) \
425 INCBIN_ALIGN_BYTE \
426 INCBIN_MANGLE INCBIN_STRINGIZE(INCBIN_PREFIX) #NAME INCBIN_STYLE_STRING(END) ":\n" \
427 INCBIN_BYTE "1\n" \
428 INCBIN_GLOBAL_LABELS(NAME, SIZE) \
429 INCBIN_ALIGN_HOST \
430 INCBIN_MANGLE INCBIN_STRINGIZE(INCBIN_PREFIX) #NAME INCBIN_STYLE_STRING(SIZE) ":\n" \
431 INCBIN_INT INCBIN_MANGLE INCBIN_STRINGIZE(INCBIN_PREFIX) #NAME INCBIN_STYLE_STRING(END) " - " \
432 INCBIN_MANGLE INCBIN_STRINGIZE(INCBIN_PREFIX) #NAME INCBIN_STYLE_STRING(DATA) "\n" \
433 INCBIN_ALIGN_HOST \
434 ".text\n" \
435 ); \
436 INCBIN_EXTERN(TYPE, NAME)

◆ INCBIN_CONCATENATE

#define INCBIN_CONCATENATE ( X,
Y )
Value:
#define INCBIN_CAT(X, Y)
Definition incbin.h:62

Definition at line 64 of file incbin.h.

64#define INCBIN_CONCATENATE(X, Y) \
65 INCBIN_CAT(X, Y)

◆ INCBIN_CONST

#define INCBIN_CONST   const

Definition at line 123 of file incbin.h.

◆ INCBIN_EVAL

#define INCBIN_EVAL ( X)
Value:
X

Definition at line 67 of file incbin.h.

67#define INCBIN_EVAL(X) \
68 X

◆ INCBIN_EXTERN

#define INCBIN_EXTERN ( ...)
Value:
INCBIN_CONCATENATE(INCBIN_EXTERN_, INCBIN_VA_ARGC(__VA_ARGS__))(__VA_ARGS__)

Produces three external symbols that reference the binary data included in another translation unit.

The symbol names are a concatenation of ‘INCBIN_PREFIX’ before NAME; with "Data", as well as "End" and "Size" after. An example is provided below.

Parameters
TYPEOptional array type. Omitting this picks a default of unsigned char.
NAMEThe name given for the binary data
// Now you have the following symbols:
// extern const unsigned char <prefix>Foo<data>[];
// extern const unsigned char *const <prefix>Foo<end>;
// extern const unsigned int <prefix>Foo<size>;
#define INCBIN_EXTERN(...)
Externally reference binary data included in another translation unit.
Definition incbin.h:321

You may specify a custom optional data type as well as the first argument.

INCBIN_EXTERN(custom_type, Foo);
// Now you have the following symbols:
// extern const custom_type <prefix>Foo<data>[];
// extern const custom_type *const <prefix>Foo<end>;
// extern const unsigned int <prefix>Foo<size>;

Definition at line 321 of file incbin.h.

321#define INCBIN_EXTERN(...) \
322 INCBIN_CONCATENATE(INCBIN_EXTERN_, INCBIN_VA_ARGC(__VA_ARGS__))(__VA_ARGS__)

◆ INCBIN_EXTERN_1

#define INCBIN_EXTERN_1 ( NAME,
... )
Value:
INCBIN_EXTERN_2(unsigned char, NAME)
#define INCBIN_EXTERN_2(TYPE, NAME)
Definition incbin.h:325

Definition at line 323 of file incbin.h.

323#define INCBIN_EXTERN_1(NAME, ...) \
324 INCBIN_EXTERN_2(unsigned char, NAME)

◆ INCBIN_EXTERN_2

#define INCBIN_EXTERN_2 ( TYPE,
NAME )
Value:
INCBIN_CONCATENATE( \
INCBIN_STYLE_IDENT(DATA))[]; \
INCBIN_EXTERNAL const INCBIN_ALIGN TYPE *const \
INCBIN_CONCATENATE( \
INCBIN_EXTERNAL const unsigned int \
INCBIN_CONCATENATE( \
#define INCBIN_ALIGN
Definition incbin.h:88
#define INCBIN_STYLE_IDENT(TYPE)
Definition incbin.h:260
#define INCBIN_EXTERNAL
Definition incbin.h:122

Definition at line 325 of file incbin.h.

325#define INCBIN_EXTERN_2(TYPE, NAME) \
326 INCBIN_EXTERNAL const INCBIN_ALIGN TYPE \
327 INCBIN_CONCATENATE( \
328 INCBIN_CONCATENATE(INCBIN_PREFIX, NAME), \
329 INCBIN_STYLE_IDENT(DATA))[]; \
330 INCBIN_EXTERNAL const INCBIN_ALIGN TYPE *const \
331 INCBIN_CONCATENATE( \
332 INCBIN_CONCATENATE(INCBIN_PREFIX, NAME), \
333 INCBIN_STYLE_IDENT(END)); \
334 INCBIN_EXTERNAL const unsigned int \
335 INCBIN_CONCATENATE( \
336 INCBIN_CONCATENATE(INCBIN_PREFIX, NAME), \
337 INCBIN_STYLE_IDENT(SIZE))

◆ INCBIN_EXTERNAL

#define INCBIN_EXTERNAL   extern

Definition at line 122 of file incbin.h.

◆ INCBIN_GLOBAL

#define INCBIN_GLOBAL ( NAME)
Value:
".global " INCBIN_STRINGIZE(INCBIN_PREFIX) #NAME "\n"

Definition at line 179 of file incbin.h.

◆ INCBIN_GLOBAL_LABELS

#define INCBIN_GLOBAL_LABELS ( NAME,
TYPE )
Value:
NAME, \
TYPE))) \
INCBIN_INVOKE( \
NAME, \
TYPE)))
#define INCBIN_INVOKE(N,...)
Definition incbin.h:69
#define INCBIN_TYPE(NAME)
Definition incbin.h:198
#define INCBIN_GLOBAL(NAME)
Definition incbin.h:179

Definition at line 274 of file incbin.h.

274#define INCBIN_GLOBAL_LABELS(NAME, TYPE) \
275 INCBIN_INVOKE( \
276 INCBIN_GLOBAL, \
277 INCBIN_CONCATENATE( \
278 NAME, \
279 INCBIN_INVOKE( \
280 INCBIN_STYLE_IDENT, \
281 TYPE))) \
282 INCBIN_INVOKE( \
283 INCBIN_TYPE, \
284 INCBIN_CONCATENATE( \
285 NAME, \
286 INCBIN_INVOKE( \
287 INCBIN_STYLE_IDENT, \
288 TYPE)))

◆ INCBIN_INT

#define INCBIN_INT   ".int "

Definition at line 183 of file incbin.h.

◆ INCBIN_INVOKE

#define INCBIN_INVOKE ( N,
... )
Value:
INCBIN_EVAL(N(__VA_ARGS__))
#define INCBIN_EVAL(X)
Definition incbin.h:67
const int N
Definition quantize.cpp:54

Definition at line 69 of file incbin.h.

69#define INCBIN_INVOKE(N, ...) \
70 INCBIN_EVAL(N(__VA_ARGS__))

◆ INCBIN_MACRO

#define INCBIN_MACRO   ".incbin"

Definition at line 84 of file incbin.h.

◆ INCBIN_MANGLE

#define INCBIN_MANGLE   ""

Definition at line 188 of file incbin.h.

◆ INCBIN_OUTPUT_DATA_SECTION

#define INCBIN_OUTPUT_DATA_SECTION   INCBIN_OUTPUT_SECTION
Warning
If you use this facility, you might have to deal with platform-specific linker output section naming on your own.

Definition at line 148 of file incbin.h.

◆ INCBIN_OUTPUT_SECTION

#define INCBIN_OUTPUT_SECTION   ".rodata"
Warning
If you use this facility, you might have to deal with platform-specific linker output section naming on your own.

Definition at line 137 of file incbin.h.

◆ INCBIN_OUTPUT_SIZE_SECTION

#define INCBIN_OUTPUT_SIZE_SECTION   INCBIN_OUTPUT_SECTION
Warning
If you use this facility, you might have to deal with platform-specific linker output section naming on your own.
Note
This is useful for Harvard architectures where program memory cannot be directly read from the program without special instructions. With this you can chose to put the size variable in RAM rather than ROM.

Definition at line 162 of file incbin.h.

◆ INCBIN_PREFIX

#define INCBIN_PREFIX   g
Note
By default this is "g".
#define INCBIN_PREFIX incbin
#include "incbin.h"
INCBIN(Foo, "foo.txt");
// Now you have the following symbols instead:
// const unsigned char incbinFoo<data>[];
// const unsigned char *const incbinFoo<end>;
// const unsigned int incbinFoo<size>;
Utility for including binary files.

Definition at line 224 of file incbin.h.

◆ INCBIN_SECTION

#define INCBIN_SECTION   ".section " INCBIN_OUTPUT_SECTION "\n"

Definition at line 178 of file incbin.h.

◆ INCBIN_STR

#define INCBIN_STR ( X)
Value:
#X

Definition at line 57 of file incbin.h.

57#define INCBIN_STR(X) \
58 #X

◆ INCBIN_STRINGIZE

#define INCBIN_STRINGIZE ( X)
Value:
#define INCBIN_STR(X)
Definition incbin.h:57

Definition at line 59 of file incbin.h.

59#define INCBIN_STRINGIZE(X) \
60 INCBIN_STR(X)

◆ INCBIN_STYLE

#define INCBIN_STYLE   INCBIN_STYLE_CAMEL

Possible options are

  • INCBIN_STYLE_CAMEL "CamelCase"
  • INCBIN_STYLE_SNAKE "snake_case"
Note
By default this is INCBIN_STYLE_CAMEL
#define INCBIN_STYLE INCBIN_STYLE_SNAKE
#include "incbin.h"
INCBIN(foo, "foo.txt");
// Now you have the following symbols:
// const unsigned char <prefix>foo_data[];
// const unsigned char *const <prefix>foo_end;
// const unsigned int <prefix>foo_size;

Definition at line 248 of file incbin.h.

◆ INCBIN_STYLE_0_DATA

#define INCBIN_STYLE_0_DATA   Data

Definition at line 252 of file incbin.h.

◆ INCBIN_STYLE_0_END

#define INCBIN_STYLE_0_END   End

Definition at line 253 of file incbin.h.

◆ INCBIN_STYLE_0_SIZE

#define INCBIN_STYLE_0_SIZE   Size

Definition at line 254 of file incbin.h.

◆ INCBIN_STYLE_1_DATA

#define INCBIN_STYLE_1_DATA   _data

Definition at line 255 of file incbin.h.

◆ INCBIN_STYLE_1_END

#define INCBIN_STYLE_1_END   _end

Definition at line 256 of file incbin.h.

◆ INCBIN_STYLE_1_SIZE

#define INCBIN_STYLE_1_SIZE   _size

Definition at line 257 of file incbin.h.

◆ INCBIN_STYLE_CAMEL

#define INCBIN_STYLE_CAMEL   0

Definition at line 204 of file incbin.h.

◆ INCBIN_STYLE_IDENT

#define INCBIN_STYLE_IDENT ( TYPE)
Value:
INCBIN_STYLE_, \
INCBIN_CONCATENATE(_, TYPE)))
#define INCBIN_STYLE
Specify the style used for symbol names.
Definition incbin.h:248

Definition at line 260 of file incbin.h.

260#define INCBIN_STYLE_IDENT(TYPE) \
261 INCBIN_CONCATENATE( \
262 INCBIN_STYLE_, \
263 INCBIN_CONCATENATE( \
264 INCBIN_EVAL(INCBIN_STYLE), \
265 INCBIN_CONCATENATE(_, TYPE)))

◆ INCBIN_STYLE_SNAKE

#define INCBIN_STYLE_SNAKE   1

Definition at line 205 of file incbin.h.

◆ INCBIN_STYLE_STRING

#define INCBIN_STYLE_STRING ( TYPE)
Value:

Definition at line 268 of file incbin.h.

268#define INCBIN_STYLE_STRING(TYPE) \
269 INCBIN_STRINGIZE( \
270 INCBIN_STYLE_IDENT(TYPE)) \
271

◆ INCBIN_TYPE

#define INCBIN_TYPE ( NAME)
Value:
".type " INCBIN_STRINGIZE(INCBIN_PREFIX) #NAME ", @object\n"

Definition at line 198 of file incbin.h.

◆ INCBIN_VA_ARG_COUNTER

#define INCBIN_VA_ARG_COUNTER ( _1,
_2,
_3,
N,
... )
Value:

Definition at line 72 of file incbin.h.

◆ INCBIN_VA_ARGC

#define INCBIN_VA_ARGC ( ...)
Value:
INCBIN_VA_ARG_COUNTER(__VA_ARGS__, 3, 2, 1, 0)
#define INCBIN_VA_ARG_COUNTER(_1, _2, _3, N,...)
Definition incbin.h:72

Definition at line 73 of file incbin.h.

◆ INCTXT

#define INCTXT ( NAME,
FILENAME )
Value:
INCBIN_COMMON(char, NAME, FILENAME, INCBIN_BYTE "0\n")

This behaves the same as INCBIN except it produces char compatible arrays and implicitly adds a null-terminator byte, thus the size of data included by this is one byte larger than that of INCBIN.

Includes a textual file into the current translation unit, producing three symbols for objects that encode the data and size respectively.

The symbol names are a concatenation of ‘INCBIN_PREFIX’ before NAME; with "Data", as well as "End" and "Size" after. An example is provided below.

Parameters
NAMEThe name to associate with this binary data (as an identifier.)
FILENAMEThe file to include (as a string literal.)
INCTXT(Readme, "readme.txt");
// Now you have the following symbols:
// const char <prefix>Readme<data>[];
// const char *const <prefix>Readme<end>;
// const unsigned int <prefix>Readme<size>;
#define INCTXT(NAME, FILENAME)
Include a textual file into the current translation unit.
Definition incbin.h:474
Warning
This must be used in global scope
The identifiers may be different if INCBIN_STYLE is not default

To externally reference the data included by this in another translation unit please

See also
INCBIN_EXTERN.

Definition at line 474 of file incbin.h.

474# define INCTXT(NAME, FILENAME) \
475 INCBIN_COMMON(char, NAME, FILENAME, INCBIN_BYTE "0\n")

◆ INCTXT_EXTERN

#define INCTXT_EXTERN ( NAME)
Value:

Produces three external symbols that reference the textual data included in another translation unit.

The symbol names are a concatenation of ‘INCBIN_PREFIX’ before NAME; with "Data", as well as "End" and "Size" after. An example is provided below.

Parameters
NAMEThe name given for the textual data
// Now you have the following symbols:
// extern const char <prefix>Foo<data>[];
// extern const char *const <prefix>Foo<end>;
// extern const unsigned int <prefix>Foo<size>;

Definition at line 359 of file incbin.h.

359#define INCTXT_EXTERN(NAME) \
360 INCBIN_EXTERN_2(char, NAME)