71 lines
1.6 KiB
C
71 lines
1.6 KiB
C
#ifndef INCLUDED_C_FMT_H
|
|||
|
|
#define INCLUDED_C_FMT_H
|
||
|
|
|
||
|
|
#ifndef INCLUDED_C_TYPES_H
|
||
|
|
#include <c_Types.h>
|
||
|
|
#endif /*INCLUDED_C_TYPES_H*/
|
||
|
|
|
||
|
|
#ifndef INCLUDED_STDIO_H
|
||
|
|
#define INCLUDED_STDIO_H
|
||
|
|
#include <stdio.h>
|
||
|
|
#endif /*INCLUDED_STDIO_H*/
|
||
|
|
|
||
|
|
#ifndef INCLUDED_STDARG_H
|
||
|
|
#define INCLUDED_STDARG_H
|
||
|
|
#include <stdarg.h>
|
||
|
|
#endif /*INCLUDED_STDARG_H*/
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
/* ------------------------------------------------------------------------------------------------------------------ */
|
||
|
|
/* */
|
||
|
|
|
||
|
|
typedef struct va_list_box {
|
||
|
|
va_list ap;
|
||
|
|
} va_list_box;
|
||
|
|
|
||
|
|
#ifdef T
|
||
|
|
#undef T
|
||
|
|
#endif
|
||
|
|
|
||
|
|
#define T c_Fmt_t
|
||
|
|
|
||
|
|
typedef void (*T)(int code, va_list_box *box,
|
||
|
|
int put(int c, void *cl), void *cl,
|
||
|
|
unsigned char flags[256], int width, int precision);
|
||
|
|
|
||
|
|
extern void c_Fmt_fmt (int put(int c, void *cl), void *cl,
|
||
|
|
const char *fmt, ...);
|
||
|
|
|
||
|
|
extern void c_Fmt_vfmt(int put(int c, void *cl), void *cl,
|
||
|
|
const char *fmt, va_list_box *box);
|
||
|
|
|
||
|
|
extern void c_Fmt_print (const char *fmt, ...);
|
||
|
|
|
||
|
|
extern void c_Fmt_fprint(FILE *stream,
|
||
|
|
const char *fmt, ...);
|
||
|
|
|
||
|
|
extern int c_Fmt_sfmt (char *buf, int size,
|
||
|
|
const char *fmt, ...);
|
||
|
|
|
||
|
|
extern int c_Fmt_vsfmt(char *buf, int size,
|
||
|
|
const char *fmt, va_list_box *box);
|
||
|
|
|
||
|
|
extern char *c_Fmt_string (const char *fmt, ...);
|
||
|
|
|
||
|
|
extern char *c_Fmt_vstring(const char *fmt, va_list_box *box);
|
||
|
|
|
||
|
|
extern T c_Fmt_register(int code, T cvt);
|
||
|
|
|
||
|
|
extern void c_Fmt_putd(const char *str, int len,
|
||
|
|
int put(int c, void *cl), void *cl,
|
||
|
|
unsigned char flags[256], int width, int precision);
|
||
|
|
|
||
|
|
extern void c_Fmt_puts(const char *str, int len,
|
||
|
|
int put(int c, void *cl), void *cl,
|
||
|
|
unsigned char flags[256], int width, int precision);
|
||
|
|
|
||
|
|
#undef T
|
||
|
|
|
||
|
|
#endif /*INCLUDED_C_FMT_H*/
|