From e625e11d52dab085703dbd798e8a00852d36968e Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Sat, 1 Apr 2006 14:36:59 +0000 Subject: [PATCH] * Added cucul_get_export_list(). Returns a list of known export formats. --- cucul/cucul.c | 26 ++++++++++++++++++++++++++ cucul/cucul.h | 1 + 2 files changed, 27 insertions(+) diff --git a/cucul/cucul.c b/cucul/cucul.c index a444ac9..d6ad43c 100644 --- a/cucul/cucul.c +++ b/cucul/cucul.c @@ -344,6 +344,32 @@ struct cucul_export * cucul_create_export(cucul_t *qq, char const *format) return ex; } +/** + * \brief Get available export formats + * + * Return a list of available export formats. The list is a NULL-terminated + * array of strings, interleaving a string containing the internal value for + * the export format, to be used with \e cucul_export(), and a string + * containing the natural language description for that export format. + * + * \return An array of strings. + */ +char const * const * cucul_get_export_list(void) +{ + static char const * const list[] = + { + "ansi", "ANSI", + "html", "HTML", + "html3", "backwards-compatible HTML", + "irc", "IRC (mIRC colours)", + "ps", "PostScript", + "svg", "SVG", + NULL, NULL + }; + + return list; +} + void cucul_free_export(struct cucul_export *ex) { free(ex->buffer); diff --git a/cucul/cucul.h b/cucul/cucul.h index cfa2edb..5703881 100644 --- a/cucul/cucul.h +++ b/cucul/cucul.h @@ -228,6 +228,7 @@ struct cucul_export }; struct cucul_export * cucul_create_export(cucul_t *, char const *); +char const * const * cucul_get_export_list(void); void cucul_free_export(struct cucul_export *); /* @} */