mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-28 00:21:52 +03:00
update from main archive 961114
This commit is contained in:
@ -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);
|
||||
|
Reference in New Issue
Block a user