X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Flibcore%2Flc_printf.h;h=ca8169cb53f4204d581553544d965996e7afc9ff;hb=6ccff2965d94c272f71df2a1655336af47bb7753;hp=0048c0229d4597f0cda8dcdb0848ab58ef7c5041;hpb=a4ee47bd186b7384dc857e41ce0f5ac86eb30272;p=libfirm diff --git a/ir/libcore/lc_printf.h b/ir/libcore/lc_printf.h index 0048c0229..ca8169cb5 100644 --- a/ir/libcore/lc_printf.h +++ b/ir/libcore/lc_printf.h @@ -17,14 +17,11 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ - - /** * Flexible printf(). * @author Sebastian Hack * @date 3.1.2005 */ - #ifndef _LIBCORE_LC_PRINTF_H #define _LIBCORE_LC_PRINTF_H @@ -35,27 +32,28 @@ #include -#include "lc_config.h" #include "lc_appendable.h" typedef struct lc_arg_occ_t { - int width; /**< The width, or 0 if not given. */ - int precision; /**< The precision, or 0 if not given */ - - const char *modifier; /**< A string of of modifiers preceding the - conversion specifier. Attention: This string is not - zero terminated. Use @c modifier_length to get the - number of valid chars in it. */ - size_t modifier_length; /**< The number of valid chars in @c modifier. */ - char conversion; /**< The conversion specifier. */ - int lc_arg_type; /**< The type of the argument as determined by the - @c get_lc_arg_type member function of the handler. */ - - unsigned flag_hash : 1; /**< @c # flag was seen. */ - unsigned flag_zero : 1; /**< @c 0 flag was seen. */ - unsigned flag_minus : 1; /**< @c - flag was seen. */ - unsigned flag_plus : 1; /**< @c + flag was seen. */ - unsigned flag_space : 1; /**< A space flag was seen. */ + int width; /**< The width, or 0 if not given. */ + int precision; /**< The precision, or 0 if not given */ + + const char *modifier; /**< A string of of modifiers preceding the + conversion specifier. Attention: This string + is not zero terminated. Use + @c modifier_length to get the number of + valid chars in it. */ + size_t modifier_length; /**< The number of valid chars in @c modifier. */ + char conversion; /**< The conversion specifier. */ + int lc_arg_type; /**< The type of the argument as determined by + the @c get_lc_arg_type member function of + the handler. */ + + unsigned flag_hash : 1; /**< @c # flag was seen. */ + unsigned flag_zero : 1; /**< @c 0 flag was seen. */ + unsigned flag_minus : 1; /**< @c - flag was seen. */ + unsigned flag_plus : 1; /**< @c + flag was seen. */ + unsigned flag_space : 1; /**< A space flag was seen. */ } lc_arg_occ_t; /** @@ -64,13 +62,13 @@ typedef struct lc_arg_occ_t { * @c ARG_TYPE macro is the name of the union member preceded by $c v_ */ typedef union { -#define LC_ARG_TYPE(type,name) type v_ ## name; +#define LC_ARG_TYPE(type,name,va_type) type v_ ## name; #include "lc_printf_arg_types.def" #undef LC_ARG_TYPE } lc_arg_value_t; enum { -#define LC_ARG_TYPE(type,name) lc_arg_type_ ## name, +#define LC_ARG_TYPE(type,name,va_type) lc_arg_type_ ## name, #include "lc_printf_arg_types.def" #undef LC_ARG_TYPE lc_arg_type_last @@ -94,25 +92,25 @@ lc_arg_env_t *lc_arg_add_std(lc_arg_env_t *env); int lc_arg_append(lc_appendable_t *app, const lc_arg_occ_t *occ, const char *str, size_t len); -int lc_epprintf(const lc_arg_env_t *env, lc_appendable_t *app, const char *fmt, ...) LC_PRINTF(3); +int lc_epprintf(const lc_arg_env_t *env, lc_appendable_t *app, const char *fmt, ...); int lc_evpprintf(const lc_arg_env_t *env, lc_appendable_t *app, const char *fmt, va_list args); -int lc_pprintf(lc_appendable_t *app, const char *fmt, ...) LC_PRINTF(2); +int lc_pprintf(lc_appendable_t *app, const char *fmt, ...); int lc_vpprintf(lc_appendable_t *app, const char *fmt, va_list args); -int lc_eprintf(const lc_arg_env_t *env, const char *fmt, ...) LC_PRINTF(2); -int lc_esnprintf(const lc_arg_env_t *env, char *buf, size_t len, const char *fmt, ...) LC_PRINTF(4); -int lc_efprintf(const lc_arg_env_t *env, FILE *file, const char *fmt, ...) LC_PRINTF(3); -int lc_eoprintf(const lc_arg_env_t *env, struct obstack *obst, const char *fmt, ...) LC_PRINTF(3); +int lc_eprintf(const lc_arg_env_t *env, const char *fmt, ...); +int lc_esnprintf(const lc_arg_env_t *env, char *buf, size_t len, const char *fmt, ...); +int lc_efprintf(const lc_arg_env_t *env, FILE *file, const char *fmt, ...); +int lc_eoprintf(const lc_arg_env_t *env, struct obstack *obst, const char *fmt, ...); int lc_evprintf(const lc_arg_env_t *env, const char *fmt, va_list args); int lc_evsnprintf(const lc_arg_env_t *env, char *buf, size_t len, const char *fmt, va_list args); int lc_evfprintf(const lc_arg_env_t *env, FILE *f, const char *fmt, va_list args); int lc_evoprintf(const lc_arg_env_t *env, struct obstack *obst, const char *fmt, va_list args); -int lc_printf(const char *fmt, ...) LC_PRINTF(1); -int lc_snprintf(char *buf, size_t len, const char *fmt, ...) LC_PRINTF(3); -int lc_fprintf(FILE *f, const char *fmt, ...) LC_PRINTF(2); -int lc_oprintf(struct obstack *obst, const char *fmt, ...) LC_PRINTF(2); +int lc_printf(const char *fmt, ...); +int lc_snprintf(char *buf, size_t len, const char *fmt, ...); +int lc_fprintf(FILE *f, const char *fmt, ...); +int lc_oprintf(struct obstack *obst, const char *fmt, ...); int lc_vprintf(const char *fmt, va_list args); int lc_vsnprintf(char *buf, size_t len, const char *fmt, va_list args);