-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
41 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ AC_PREREQ([2.68]) | |
|
||
|
||
# Initialize package | ||
AC_INIT([fmt], [3.0.6], [[email protected]], [fmt], [https://github.com/guillermocalvo/fmt/]) | ||
AC_INIT([fmt], [1.3], [[email protected]], [fmt], [https://github.com/guillermocalvo/fmt/]) | ||
|
||
|
||
# Information on the package | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
* | ||
* fmt header file | ||
* | ||
* @version 1.2 | ||
* @version 1.3 | ||
* @author Copyright (c) 2017 Guillermo Calvo | ||
* | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
|
||
# include "testing.h" | ||
|
||
|
||
static char buffer[128]; | ||
|
||
int format_meta(struct fmt_stream * out, const char * id, const char * options, va_list * arg); | ||
|
||
/** | ||
* Test print meta formatter | ||
*/ | ||
TEST_CASE{ | ||
|
||
struct fmt_stream out = {0}; | ||
|
||
fmt_stream_buffer(&out, buffer, sizeof(buffer)); | ||
|
||
(void)fmt_print(&out, "TEST %{@META:OPTIONS} TEST", format_meta, 123); | ||
|
||
TEST_EQUALS("TEST (META/123/OPTIONS) TEST", buffer); | ||
} | ||
|
||
int format_meta(struct fmt_stream * out, const char * id, const char * options, va_list * arg){ | ||
|
||
int number = va_arg(*arg, int); | ||
|
||
return( fmt_print_builtin(out, "(%s/%d/%s)", id, number, options) ); | ||
} |