From 54d79e995d5a6d0a393ed913b6e26dccc63de5b7 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Fri, 15 Nov 1996 04:08:00 +0000 Subject: update from main archive 961114 --- manual/examples/rprintf.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'manual/examples/rprintf.c') diff --git a/manual/examples/rprintf.c b/manual/examples/rprintf.c index eff1d8e7cf..723b3a3ef0 100644 --- a/manual/examples/rprintf.c +++ b/manual/examples/rprintf.c @@ -9,7 +9,7 @@ typedef struct } Widget; /*@end group*/ -int +int print_widget (FILE *stream, const struct printf_info *info, va_list *app) { Widget *w; @@ -33,6 +33,18 @@ print_widget (FILE *stream, const struct printf_info *info, va_list *app) } +int +print_widget_arginfo (const struct printf_info *info, size_t n, + int *argtypes) +{ + /* We always take exactly one argument and this is a pointer to the + structure.. */ + if (n > 0) + argtypes[0] = PA_POINTER; + return 1; +} + + int main (void) { @@ -41,7 +53,7 @@ main (void) mywidget.name = "mywidget"; /* Register the print function for widgets. */ - register_printf_function ('W', print_widget, NULL); /* No arginfo. */ + register_printf_function ('W', print_widget, print_widget_arginfo); /* Now print the widget. */ printf ("|%W|\n", &mywidget); -- cgit 1.4.1