/**************************************************************************/
/*                                                                        */
/*                                 Sources                                */
/*                                from  the                               */
/*                           XSC SOFTWARE PACKAGE                         */
/*                                                                        */
/*                Copyright (c) 1997 University of Karlsruhe              */
/*                     Institute for Appl. Mathematics                    */
/*                                                                        */
/* This program is free software for non-commercial use. For details, see */
/* the file LICENSE.XSC, distributed with this software package.          */
/*                                                                        */
/* This program is distributed WITHOUT ANY WARRANTY. For details, see the */
/* file LICENSE.XSC, distributed with this software package.              */
/*                                                                        */
/**************************************************************************/

/* RCS $Id: f_bhex.c,v 1.2 1997/09/25 17:18:49 ae59 Exp $ */
/*
$Log: f_bhex.c,v $
 * Revision 1.2  1997/09/25  17:18:49  ae59
 * Copyright-message
 *
 * Revision 1.1  1994/01/27  13:22:24  ae59
 * Put under RCS control
 *
 */
/****************************************************************/
/*                                                              */
/*      Filename        : f_bhex.c                              */
/*                                                              */
/*      Entry           : void f_bhex(desc,r,mode)              */
/*                        f_text *desc;                         */
/*                        a_char r;                             */
/*                        a_char mode;                          */
/*                                                              */
/*      Arguments       : desc   - device descriptor            */
/*                        ch     - character value              */
/*                        mode   - mode value for letter        */
/*                                 generation                   */
/*                                 'x' = 'abcdef' is used       */
/*                                 'X' = 'ABCDEF' is used       */
/*                                                              */
/*      Description     : write character value in hexadecimal  */
/*                        format                                */
/*                                                              */
/*      Note            : No checking for valid descriptor done */
/*                                                              */
/*      Date            : 1992-01-14                            */
/*      1992-01-14 : output independent from collating sequence */
/****************************************************************/

#ifndef ALL_IN_ONE
#ifdef AIX
#include "/u/p88c/runtime/o_defs.h"
#else
#include "o_defs.h"
#endif
#define local
#endif

static char lc[] = "0123456789abcdef";
static char uc[] = "0123456789ABCDEF";

#ifdef LINT_ARGS
local void f_bhex(f_text *desc,a_char r,a_char mode)
#else
local void f_bhex(desc,r,mode)

f_text *desc;
a_char r;
a_char mode;
#endif
        {
        a_char c;

        E_TPUSH("f_bhex")

        c = r>>4;
        f_putc((mode=='x') ? lc[c] : uc[c],desc);
        c = r & 0x0f;
        f_putc((mode=='x') ? lc[c] : uc[c],desc);

        E_TPOPP("f_bhex")
        return;
        }

