C Export Functions

This module contains function to wrap C code into C file and C header file.

img2gb.c_export.generate_c_file(code)[source]

Generate the content of a C file that contains the given code.

Parameters:code (str) – The C code to embed in the C file.
Return type:str
img2gb.c_export.generate_c_header_file(code, filename='header.h')[source]

Generate the content of a C header file that contains the given code.

Parameters:
  • code (str) – The C code to embed in the C header file.
  • filename (str) – The header file name (default = "header.h")
Return type:

str