diff options
| author | Tyge Løvset <[email protected]> | 2023-04-05 14:44:31 +0200 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2023-04-05 14:44:31 +0200 |
| commit | 2ad41420a973a3f1bd1ca47ab0f61b8f59ab9e66 (patch) | |
| tree | 047454272a19544d0a99db7ca07394c81894b474 /include/c11/print.h | |
| parent | a3dc31d5393d051ad4dacb314452d3c6ec8a74b7 (diff) | |
| download | STC-modified-2ad41420a973a3f1bd1ca47ab0f61b8f59ab9e66.tar.gz STC-modified-2ad41420a973a3f1bd1ca47ab0f61b8f59ab9e66.zip | |
Internal: renamed untemplate.h to template2.h
Diffstat (limited to 'include/c11/print.h')
| -rw-r--r-- | include/c11/print.h | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/include/c11/print.h b/include/c11/print.h index 1302d9cc..7c155875 100644 --- a/include/c11/print.h +++ b/include/c11/print.h @@ -1,7 +1,10 @@ #ifndef FMT_H_INCLUDED
#define FMT_H_INCLUDED
/*
-VER 2.0: NEW API:
+VER 2.1: NEW API:
+void print(fmt, ...);
+void println(fmt, ...);
+void printd(dest, fmt, ...);
void fmt_print(fmt, ...);
void fmt_println(fmt, ...);
@@ -40,21 +43,21 @@ int main() { unsigned char r = 123, g = 214, b = 90, w = 110;
char buffer[64];
- fmt_print("Color: ({} {} {}), {}\n", r, g, b, flag);
- fmt_println("Wide: {}, {}", wstr, L"wide world");
- fmt_println("{:10} {:10} {:10.2f}", 42ull, 43, pi);
- fmt_println("{:>10} {:>10} {:>10}", z, z, w);
- fmt_printd(stdout, "{:10} {:10} {:10}\n", "Hello", "Mad", "World");
- fmt_printd(stderr, "100%: {:<20} {:.*} {}\n", string, 4, pi, x);
- fmt_printd(buffer, "Precision: {} {:.10} {}", string, pi, x);
- fmt_println("{}", buffer);
- fmt_println("Vector: ({}, {}, {})", 3.2, 3.3, pi);
+ print("Color: ({} {} {}), {}\n", r, g, b, flag);
+ println("Wide: {}, {}", wstr, L"wide world");
+ println("{:10} {:10} {:10.2f}", 42ull, 43, pi);
+ println("{:>10} {:>10} {:>10}", z, z, w);
+ printd(stdout, "{:10} {:10} {:10}\n", "Hello", "Mad", "World");
+ printd(stderr, "100%: {:<20} {:.*} {}\n", string, 4, pi, x);
+ printd(buffer, "Precision: {} {:.10} {}", string, pi, x);
+ println("{}", buffer);
+ println("Vector: ({}, {}, {})", 3.2, 3.3, pi);
fmt_buffer out[1] = {{.stream=1}};
- fmt_printd(out, "{} {}", "Pi is:", pi);
- fmt_print("{}, len={}, cap={}\n", out->data, out->len, out->cap);
- fmt_printd(out, "{} {}", ", Pi squared is:", pi*pi);
- fmt_print("{}, len={}, cap={}\n", out->data, out->len, out->cap);
+ printd(out, "{} {}", "Pi is:", pi);
+ print("{}, len={}, cap={}\n", out->data, out->len, out->cap);
+ printd(out, "{} {}", ", Pi squared is:", pi*pi);
+ print("{}, len={}, cap={}\n", out->data, out->len, out->cap);
fmt_destroy(out);
}
*/
|
