2009-06-08 18:17:06 -04:00
|
|
|
/* Partially specialized functions for dumping to a file.
|
2009-06-08 16:30:44 -04:00
|
|
|
*
|
2009-06-08 18:17:06 -04:00
|
|
|
* This include file defines a function that dumps the document to a
|
|
|
|
* file. The function is specialized to one color mode. This is
|
|
|
|
* supposedly faster than runtime checks. The file that includes this
|
|
|
|
* file must define several macros to select the specialization.
|
|
|
|
*
|
|
|
|
* The following macros must be defined as names of functions that
|
|
|
|
* this file should define:
|
|
|
|
*
|
|
|
|
* - DUMP_FUNCTION_COLOR: The main function. It calls one of the others.
|
|
|
|
* - DUMP_FUNCTION_UNIBYTE: For dumping in unibyte charsets.
|
|
|
|
* - DUMP_FUNCTION_UTF8: For dumping in the UTF-8 charset.
|
|
|
|
* (The function names could be generated with the ## preprocessor
|
|
|
|
* operator, but that would make grepping more difficult.)
|
|
|
|
*
|
2009-06-21 12:05:26 -04:00
|
|
|
* One of the following macros must be defined:
|
2009-06-08 16:30:44 -04:00
|
|
|
*
|
2009-06-21 12:05:26 -04:00
|
|
|
* - DUMP_COLOR_MODE_NONE
|
2009-06-08 16:30:44 -04:00
|
|
|
* - DUMP_COLOR_MODE_16
|
|
|
|
* - DUMP_COLOR_MODE_256
|
|
|
|
* - DUMP_COLOR_MODE_TRUE
|
2009-06-08 18:17:06 -04:00
|
|
|
*/
|
2009-06-08 16:30:44 -04:00
|
|
|
|
2020-10-05 14:14:55 -04:00
|
|
|
|
|
|
|
|
2009-06-08 18:17:06 -04:00
|
|
|
#define DUMP_FUNCTION_SPECIALIZED DUMP_FUNCTION_UNIBYTE
|
|
|
|
#include "dump-specialized.h"
|
|
|
|
#undef DUMP_FUNCTION_SPECIALIZED
|
2009-06-08 16:30:44 -04:00
|
|
|
|
|
|
|
#ifdef CONFIG_UTF8
|
2009-06-08 18:17:06 -04:00
|
|
|
# define DUMP_CHARSET_UTF8
|
|
|
|
# define DUMP_FUNCTION_SPECIALIZED DUMP_FUNCTION_UTF8
|
|
|
|
# include "dump-specialized.h"
|
|
|
|
# undef DUMP_FUNCTION_SPECIALIZED
|
|
|
|
# undef DUMP_CHARSET_UTF8
|
|
|
|
#endif /* CONFIG_UTF8 */
|
2009-06-08 16:30:44 -04:00
|
|
|
|
2020-10-05 14:14:55 -04:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2009-06-08 18:17:06 -04:00
|
|
|
static int
|
2009-06-19 07:34:51 -04:00
|
|
|
DUMP_FUNCTION_COLOR(struct document *document, struct dump_output *out)
|
2009-06-08 18:17:06 -04:00
|
|
|
{
|
2009-06-08 16:30:44 -04:00
|
|
|
#ifdef CONFIG_UTF8
|
2009-06-08 18:17:06 -04:00
|
|
|
if (is_cp_utf8(document->options.cp))
|
2009-06-19 07:34:51 -04:00
|
|
|
return DUMP_FUNCTION_UTF8(document, out);
|
2009-06-08 18:17:06 -04:00
|
|
|
#endif /* CONFIG_UTF8 */
|
2009-06-08 16:30:44 -04:00
|
|
|
|
2009-06-19 07:34:51 -04:00
|
|
|
return DUMP_FUNCTION_UNIBYTE(document, out);
|
2009-06-08 16:30:44 -04:00
|
|
|
}
|
2020-10-05 14:14:55 -04:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|