Skip to content

Commit d97f069

Browse files
committed
Fixes mpaland#89, mpaland#90: Parameter rename to match the C standard and significant doxygen comment edits.
1 parent a67c8dd commit d97f069

File tree

3 files changed

+167
-135
lines changed

3 files changed

+167
-135
lines changed

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -112,18 +112,18 @@ Note: The preprocessor definitions are taken into account when compiling `printf
112112
The library offers the following, with the same signatures as in the standard C library (plus an extra underscore):
113113
```
114114
int printf_(const char* format, ...);
115-
int sprintf_(char* buffer, const char* format, ...);
116-
int vsprintf_(char* buffer, const char* format, va_list va);
117-
int snprintf_(char* buffer, size_t count, const char* format, ...);
118-
int vsnprintf_(char* buffer, size_t count, const char* format, va_list va);
119-
int vprintf_(const char* format, va_list va);
115+
int sprintf_(char* s, const char* format, ...);
116+
int vsprintf_(char* s, const char* format, va_list arg);
117+
int snprintf_(char* s, size_t n, const char* format, ...);
118+
int vsnprintf_(char* s, size_t n, const char* format, va_list arg);
119+
int vprintf_(const char* format, va_list arg);
120120
```
121121
Note that `printf()` and `vprintf()` don't actually write anything on their own: In addition to their parameters, you must provide them with a lower-level `putchar_()` function which they can call for actual printing. This is part of this library's independence: It is isolated from dealing with console/serial output, files etc.
122122

123123
Two additional functions are provided beyond those available in the standard library:
124124
```
125-
int fctprintf(void (*out)(char character, void* arg), void* arg, const char* format, ...);
126-
int vfctprintf(void (*out)(char character, void* arg), void* arg, const char* format, va_list va);
125+
int fctprintf(void (*out)(char c, void* extra_arg), void* extra_arg, const char* format, ...);
126+
int vfctprintf(void (*out)(char c, void* extra_arg), void* extra_arg, const char* format, va_list arg);
127127
```
128128
These higher-order functions allow for better flexibility of use: You can decide to do different things with the individual output characters: Encode them, compress them, filter them, append them to a buffer or a file, or just discard them. This is achieved by you passing a pointer to your own state information - through `(v)fctprintf()` and all the way to your own `out()` function.
129129

0 commit comments

Comments
 (0)