Back to index

cell-binutils  2.17cvs20070401
Defines | Functions | Variables
hex.c File Reference
#include <stdio.h>
#include "libiberty.h"
#include "safe-ctype.h"

Go to the source code of this file.

Defines

#define HEX_TABLE_INITIALIZED

Functions

void hex_init (void)

Variables

const unsigned char _hex_value [_hex_array_size]

Define Documentation

Definition at line 150 of file hex.c.


Function Documentation

void hex_init ( void  )

Definition at line 159 of file hex.c.

{
#ifndef HEX_TABLE_INITIALIZED
  int i;

  for (i=0; i<_hex_array_size; i++)
    {
      switch (i)
       {
       case '0': _hex_value[i] = 0; break;
       case '1': _hex_value[i] = 1; break;
       case '2': _hex_value[i] = 2; break;
       case '3': _hex_value[i] = 3; break;
       case '4': _hex_value[i] = 4; break;
       case '5': _hex_value[i] = 5; break;
       case '6': _hex_value[i] = 6; break;
       case '7': _hex_value[i] = 7; break;
       case '8': _hex_value[i] = 8; break;
       case '9': _hex_value[i] = 9; break;

       case 'a': case 'A': _hex_value[i] = 10; break;
       case 'b': case 'B': _hex_value[i] = 11; break;
       case 'c': case 'C': _hex_value[i] = 12; break;
       case 'd': case 'D': _hex_value[i] = 13; break;
       case 'e': case 'E': _hex_value[i] = 14; break;
       case 'f': case 'F': _hex_value[i] = 15; break;

       default:
         _hex_value[i] = _hex_bad;
         break;
       }
    }
#endif
}

Here is the caller graph for this function:


Variable Documentation

Definition at line 75 of file hex.c.