Back to index

glibc  2.9
Functions | Variables
reg-printf.c File Reference
#include <errno.h>
#include <limits.h>
#include <printf.h>
#include <stddef.h>
#include <stdlib.h>

Go to the source code of this file.

Functions

 libc_freeres_ptr (printf_arginfo_function **__printf_arginfo_table) attribute_hidden
int __register_printf_function (int, printf_function, printf_arginfo_function)

Variables

printf_function
**__printf_function_table 
attribute_hidden

Function Documentation

Definition at line 30 of file reg-printf.c.

{
  if (spec < 0 || spec > (int) UCHAR_MAX)
    {
      __set_errno (EINVAL);
      return -1;
    }

  if (__printf_function_table == NULL)
    {
      __printf_arginfo_table = (printf_arginfo_function **)
       calloc (UCHAR_MAX + 1, sizeof (void *) * 2);
      if (__printf_arginfo_table == NULL)
       return -1;
      __printf_function_table = (printf_function **)
       (__printf_arginfo_table + UCHAR_MAX + 1);
    }

  __printf_function_table[spec] = converter;
  __printf_arginfo_table[spec] = arginfo;

  return 0;
}

Here is the call graph for this function:

libc_freeres_ptr ( printf_arginfo_function **  __printf_arginfo_table)

Variable Documentation

printf_function** __printf_function_table attribute_hidden

Definition at line 28 of file reg-printf.c.