Back to index

glibc  2.9
Classes | Defines | Functions | Variables
_itoa.c File Reference
#include <gmp-mparam.h>
#include <gmp.h>
#include <limits.h>
#include <stdlib/gmp-impl.h>
#include <stdlib/longlong.h>
#include "_itoa.h"

Go to the source code of this file.

Classes

struct  base_table_t

Defines

#define UMUL_TIME   1
#define UDIV_TIME   3
#define PACK
#define SEL1(X)   X,
#define SEL2(X)   ,X
#define SPECIAL(Base)

Functions

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)

Variables

struct base_table_t __attribute__
const char _itoa_lower_digits []
const char
_itoa_lower_digits_internal[] 
attribute_hidden
const char _itoa_upper_digits []

Class Documentation

struct base_table_t

Definition at line 51 of file _itoa.c.

Class Members
mp_limb_t base_multiplier
char flag
char post_shift

Define Documentation

#define PACK

Definition at line 46 of file _itoa.c.

#define SEL1 (   X)    X,

Definition at line 74 of file _itoa.c.

#define SEL2 (   X)    ,X

Definition at line 75 of file _itoa.c.

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

Definition at line 38 of file _itoa.c.

#define UMUL_TIME   1

Definition at line 35 of file _itoa.c.


Function Documentation

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_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_upper_digits_internal [] attribute_hidden

Definition at line 169 of file _itoa.c.