Thread (9 messages) 9 messages, 3 authors, 2017-04-10

Re: [PATCH 2/3] column: allow for custom printf

flat view

From: Jeff King <hidden>
Date: 2017-03-30 03:12:41

On Wed, Mar 29, 2017 at 06:42:37PM -0700, Stefan Beller wrote:
Signed-off-by: Stefan Beller <redacted>
No justification?

I assume it will be used in a future patch.
quoted hunk ↗ jump to hunk
diff --git a/column.h b/column.h
index 0a61917fa7..c44a1525a9 100644
--- a/column.h
+++ b/column.h
@@ -24,6 +24,9 @@ struct column_options {
 	int padding;
 	const char *indent;
 	const char *nl;
+
+	/* when non-NULL, use this printing function, fallback to printf */
+	int (*_printf)(const char *__format, ...);
 };
Avoid names with leading underscores. They're reserved by the C
standard.

I wonder if gcc is smart enough to let us mark this function pointer
with a "format" attribute so we can get compile-time checking of the
format string.

-Peff
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help