Back to index

glibc  2.9
Defines | Functions | Variables
_itoa.h File Reference
#include <limits.h>

Go to the source code of this file.

Defines

#define _itoa(value, buf, base, upper_case)   _itoa_word (value, buf, base, upper_case)
#define _fitoa(value, buf, base, upper_case)   _fitoa_word (value, buf, base, upper_case)

Functions

char * _itoa (unsigned long long int value, char *buflim, unsigned int base, int upper_case)
char * _itoa_word (unsigned long value, char *buflim, unsigned int base, int upper_case)
char * _fitoa_word (unsigned long value, char *buf, unsigned int base, int upper_case) attribute_hidden
char * _fitoa (unsigned long long value, char *buf, unsigned int base, int upper_case) attribute_hidden

Variables

const char _itoa_upper_digits []
const char
_itoa_upper_digits_internal[] 
attribute_hidden
const char _itoa_lower_digits []

Define Documentation

#define _fitoa (   value,
  buf,
  base,
  upper_case 
)    _fitoa_word (value, buf, base, upper_case)

Definition at line 89 of file _itoa.h.

#define _itoa (   value,
  buf,
  base,
  upper_case 
)    _itoa_word (value, buf, base, upper_case)

Definition at line 87 of file _itoa.h.


Function Documentation

char* _fitoa ( unsigned long long  value,
char *  buf,
unsigned int  base,
int  upper_case 
)

Here is the caller graph for this function:

char* _fitoa_word ( unsigned long  value,
char *  buf,
unsigned int  base,
int  upper_case 
)

Definition at line 474 of file _itoa.c.

{
  char tmpbuf[sizeof (value) * 4];       /* Worst case length: base 2.  */
  char *cp = _itoa_word (value, tmpbuf + sizeof (value) * 4, base, upper_case);
  while (cp < tmpbuf + sizeof (value) * 4)
    *buf++ = *cp++;
  return buf;
}

Here is the call graph for this function:

Here is the caller graph for this function:

char* _itoa ( unsigned long long int  value,
char *  buflim,
unsigned int  base,
int  upper_case 
)

Definition at line 305 of file dl-minimal.c.

{
  extern const char INTUSE(_itoa_lower_digits)[] attribute_hidden;

  assert (! upper_case);

  do
    *--buflim = INTUSE(_itoa_lower_digits)[value % base];
  while ((value /= base) != 0);

  return buflim;
}
char* _itoa_word ( unsigned long  value,
char *  buflim,
unsigned int  base,
int  upper_case 
)

Definition at line 173 of file _itoa.c.

{
  const char *digits = (upper_case
#if !defined NOT_IN_libc || defined IS_IN_rtld
                     ? INTUSE(_itoa_upper_digits)
                     : INTUSE(_itoa_lower_digits)
#else
                     ? _itoa_upper_digits
                     : _itoa_lower_digits
#endif
                     );

  switch (base)
    {
#define SPECIAL(Base)                                                       \
    case Base:                                                              \
      do                                                             \
       *--buflim = digits[value % Base];                             \
      while ((value /= Base) != 0);                                         \
      break

      SPECIAL (10);
      SPECIAL (16);
      SPECIAL (8);
    default:
      do
       *--buflim = digits[value % base];
      while ((value /= base) != 0);
    }
  return buflim;
}

Here is the caller graph for this function:


Variable Documentation

Definition at line 22 of file itoa-digits.c.

Definition at line 22 of file itoa-udigits.c.

const char _itoa_lower_digits_internal [] attribute_hidden

Definition at line 36 of file _itoa.h.