diff options
author | Ulrich Drepper <drepper@redhat.com> | 1996-11-15 04:08:00 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 1996-11-15 04:08:00 +0000 |
commit | 54d79e995d5a6d0a393ed913b6e26dccc63de5b7 (patch) | |
tree | b758eeac8325f123f161c8d62c5956dc2a6d2556 /manual/examples | |
parent | b296c233447a37f77ccd9989fce24b45a8db1afa (diff) | |
download | glibc-54d79e995d5a6d0a393ed913b6e26dccc63de5b7.zip glibc-54d79e995d5a6d0a393ed913b6e26dccc63de5b7.tar.gz glibc-54d79e995d5a6d0a393ed913b6e26dccc63de5b7.tar.bz2 |
update from main archive 961114cvs/libc-961115
Diffstat (limited to 'manual/examples')
-rw-r--r-- | manual/examples/rprintf.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/manual/examples/rprintf.c b/manual/examples/rprintf.c index eff1d8e..723b3a3 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; @@ -34,6 +34,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) { /* Make a widget to print. */ @@ -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); |