| @@ -1,4 +1,8 @@ |
| 1 | | − |
| 1 | +#ifndef _FMT_H_ |
| 2 | +#define _FMT_H_ 1 |
| 3 | +#if defined(__cplusplus) |
| 4 | +extern "C" { |
| 5 | +#endif |
| 2 | 6 | /* |
| 3 | 7 | * The authors of this software are Rob Pike and Ken Thompson. |
| 4 | 8 | * Copyright (c) 2002 by Lucent Technologies. |
| @@ -13,14 +17,8 @@ · 8 unmodified lines |
| 13 | 17 | * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. |
| 14 | 18 | */ |
| 15 | 19 | |
| 16 | | −#ifndef _FMTH_ |
| 17 | | −#define _FMTH_ 1 |
| 18 | | − |
| 19 | 20 | #include <stdarg.h> |
| 20 | | − |
| 21 | | −#ifndef _UTFH_ |
| 22 | 21 | #include <utf.h> |
| 23 | | −#endif |
| 24 | 22 | |
| 25 | 23 | typedef struct Fmt Fmt; |
| 26 | 24 | struct Fmt{ |
| @@ -57,43 +55,47 @@ enum{ · 30 unmodified lines |
| 57 | 55 | FmtFlag = FmtLDouble << 1 |
| 58 | 56 | }; |
| 59 | 57 | |
| 60 | | −extern int print(char*, ...); |
| 61 | | −extern char* seprint(char*, char*, char*, ...); |
| 62 | | −extern char* vseprint(char*, char*, char*, va_list); |
| 63 | | −extern int snprint(char*, int, char*, ...); |
| 64 | | −extern int vsnprint(char*, int, char*, va_list); |
| 65 | | −extern char* smprint(char*, ...); |
| 66 | | −extern char* vsmprint(char*, va_list); |
| 67 | | −extern int sprint(char*, char*, ...); |
| 68 | | −extern int fprint(int, char*, ...); |
| 69 | | −extern int vfprint(int, char*, va_list); |
| 70 | | − |
| 71 | | −extern int runesprint(Rune*, char*, ...); |
| 72 | | −extern int runesnprint(Rune*, int, char*, ...); |
| 73 | | −extern int runevsnprint(Rune*, int, char*, va_list); |
| 74 | | −extern Rune* runeseprint(Rune*, Rune*, char*, ...); |
| 75 | | −extern Rune* runevseprint(Rune*, Rune*, char*, va_list); |
| 76 | | −extern Rune* runesmprint(char*, ...); |
| 77 | | −extern Rune* runevsmprint(char*, va_list); |
| 78 | | − |
| 79 | | −extern int fmtfdinit(Fmt*, int, char*, int); |
| 80 | | −extern int fmtfdflush(Fmt*); |
| 81 | | −extern int fmtstrinit(Fmt*); |
| 82 | | −extern char* fmtstrflush(Fmt*); |
| 83 | | − |
| 84 | | −extern int quotestrfmt(Fmt *f); |
| 85 | | −extern void quotefmtinstall(void); |
| 86 | 58 | extern int (*fmtdoquote)(int); |
| 87 | 59 | |
| 60 | +/* Edit .+1,/^$/ | cfn $PLAN9/src/lib9/fmt/?*.c | grep -v static |grep -v __ */ |
| 61 | +int dofmt(Fmt *f, char *fmt); |
| 62 | +int dorfmt(Fmt *f, const Rune *fmt); |
| 63 | +double fmtcharstod(int(*f)(void*), void *vp); |
| 64 | +int fmtfdflush(Fmt *f); |
| 65 | +int fmtfdinit(Fmt *f, int fd, char *buf, int size); |
| 66 | +int fmtinstall(int c, int (*f)(Fmt*)); |
| 67 | +int fmtprint(Fmt *f, char *fmt, ...); |
| 68 | +int fmtrune(Fmt *f, int r); |
| 69 | +int fmtrunestrcpy(Fmt *f, Rune *s); |
| 70 | +int fmtstrcpy(Fmt *f, char *s); |
| 71 | +char* fmtstrflush(Fmt *f); |
| 72 | +int fmtstrinit(Fmt *f); |
| 73 | +double fmtstrtod(const char *as, char **aas); |
| 74 | +int fmtvprint(Fmt *f, char *fmt, va_list args); |
| 75 | +int fprint(int fd, char *fmt, ...); |
| 76 | +int print(char *fmt, ...); |
| 77 | +void quotefmtinstall(void); |
| 78 | +int quoterunestrfmt(Fmt *f); |
| 79 | +int quotestrfmt(Fmt *f); |
| 80 | +Rune* runefmtstrflush(Fmt *f); |
| 81 | +int runefmtstrinit(Fmt *f); |
| 82 | +Rune* runeseprint(Rune *buf, Rune *e, char *fmt, ...); |
| 83 | +Rune* runesmprint(char *fmt, ...); |
| 84 | +int runesnprint(Rune *buf, int len, char *fmt, ...); |
| 85 | +int runesprint(Rune *buf, char *fmt, ...); |
| 86 | +Rune* runevseprint(Rune *buf, Rune *e, char *fmt, va_list args); |
| 87 | +Rune* runevsmprint(char *fmt, va_list args); |
| 88 | +int runevsnprint(Rune *buf, int len, char *fmt, va_list args); |
| 89 | +char* seprint(char *buf, char *e, char *fmt, ...); |
| 90 | +char* smprint(char *fmt, ...); |
| 91 | +int snprint(char *buf, int len, char *fmt, ...); |
| 92 | +int sprint(char *buf, char *fmt, ...); |
| 93 | +int vfprint(int fd, char *fmt, va_list args); |
| 94 | +char* vseprint(char *buf, char *e, char *fmt, va_list args); |
| 95 | +char* vsmprint(char *fmt, va_list args); |
| 96 | +int vsnprint(char *buf, int len, char *fmt, va_list args); |
| 88 | 97 | |
| 89 | | −extern int fmtinstall(int, int (*)(Fmt*)); |
| 90 | | −extern int dofmt(Fmt*, char*); |
| 91 | | −extern int fmtprint(Fmt*, char*, ...); |
| 92 | | −extern int fmtvprint(Fmt*, char*, va_list); |
| 93 | | −extern int fmtrune(Fmt*, int); |
| 94 | | −extern int fmtstrcpy(Fmt*, char*); |
| 95 | | − |
| 96 | | −extern double fmtstrtod(const char *, char **); |
| 97 | | −extern double fmtcharstod(int(*)(void*), void*); |
| 98 | | − |
| 98 | +#if defined(__cplusplus) |
| 99 | +} |
| 100 | +#endif |
| 99 | 101 | #endif |