91 lines
2.6 KiB
C
91 lines
2.6 KiB
C
#ifndef __EXTERNAL_RENDERER_INTERFACES_H__
|
|
#define __EXTERNAL_RENDERER_INTERFACES_H__
|
|
|
|
#ifndef xstr
|
|
|
|
#define xstr(a) str(a)
|
|
#define str(a) #a
|
|
|
|
#endif /* xstr */
|
|
|
|
/**
|
|
* @addtogroup ExternalRenderer
|
|
* @{
|
|
*/
|
|
|
|
/**
|
|
* @brief This define is used to export a function from a shared object
|
|
*/
|
|
#define EXPORT_FUNC __attribute__((visibility("default")))
|
|
|
|
/**
|
|
* @brief This define is used to export a variable symbol from a shared object
|
|
*/
|
|
#define EXPORT_VAR EXPORT_FUNC
|
|
|
|
/**
|
|
* @brief Function name expected to be found in external library for rendering.
|
|
*
|
|
* The function has to be defined as follows:
|
|
* @code
|
|
* int EXTERNAL_LIBRARY_RENDER_FUNCTION(struct gds_cell *toplevel, GList *layer_info_list, const char *output_file_name, double scale);
|
|
* @endcode
|
|
*/
|
|
#define EXTERNAL_LIBRARY_RENDER_FUNCTION exported_render_cell_to_file
|
|
|
|
/**
|
|
* @brief Function name expected to be found in external library for initialization.
|
|
*
|
|
* @code
|
|
* int EXTERNAL_LIBRARY_INIT_FUNCTION(const char *option_string, const char *version_string);
|
|
* @endcode
|
|
*/
|
|
#define EXTERNAL_LIBRARY_INIT_FUNCTION exported_init
|
|
|
|
/**
|
|
* @brief Function name expected to be found in external library for finalizing.
|
|
*
|
|
* @code
|
|
* int EXTERNAL_LIBRARY_FINALIZE_FUNCTION(void);
|
|
* @endcode
|
|
*/
|
|
#define EXTERNAL_LIBRARY_FINALIZE_FUNCTION exported_finalize
|
|
|
|
/**
|
|
* @brief Global integer specified by an external renderer to signal, that the init and render functions shall be executed in a subprocess
|
|
*
|
|
* The pure presence of this symbol name causes forking. The content of this variable is don't care.
|
|
* @note Use this if you mess with the internal structures of gds-render
|
|
*/
|
|
#define EXTERNAL_LIBRARY_FORK_REQUEST exported_fork_request
|
|
|
|
/**
|
|
* @brief Define for declaring the exported functions.
|
|
*
|
|
* This not only helps with the declaration but also makes the symbols visible, so they can be called form outside the library
|
|
*/
|
|
#define EXPORTED_FUNC_DECL(FUNC) EXPORT_FUNC FUNC
|
|
|
|
/**
|
|
* @brief Define for declaring exported variables
|
|
*
|
|
* This not only helps with the declaration but also makes the symbols visible, so they can be accessed form outside the library
|
|
*/
|
|
#define EXPORTED_VAR_DECL(VAR) EXPORT_VAR VAR
|
|
|
|
/**
|
|
* @brief Define for declaring variables based on a define expansion
|
|
* @note If you want to declare an exported variable use @ref EXPORTED_VAR_DECL
|
|
*/
|
|
#define VAR_DECL(VAR) VAR
|
|
|
|
/**
|
|
* @brief Define for declaring functions based on a define expansion
|
|
* @note If you want to declare an exported function use @ref EXPORTED_FUNC_DECL
|
|
*/
|
|
#define FUNC_DECL(FUNC) FUNC
|
|
|
|
/** @} */
|
|
|
|
#endif /* __EXTERNAL_RENDERER_INTERFACES_H__ */
|