XrdOucTrace.cc

Go to the documentation of this file.
00001 /******************************************************************************/
00002 /*                                                                            */
00003 /*                        X r d O u c T r a c e . c c                         */
00004 /*                                                                            */
00005 /* (c) 2004 by the Board of Trustees of the Leland Stanford, Jr., University  */
00006 /*       All Rights Reserved. See XrdInfo.cc for complete License Terms       */
00007 /*   Produced by Andrew Hanushevsky for Stanford University under contract    */
00008 /*              DE-AC03-76-SFO0515 with the Department of Energy              */
00009 /******************************************************************************/
00010 
00011 //           $Id: XrdOucTrace.cc 22437 2008-03-04 14:35:16Z rdm $
00012 
00013 const char *XrdOucTraceCVSID = "$Id: XrdOucTrace.cc 22437 2008-03-04 14:35:16Z rdm $";
00014 
00015 #include "XrdOuc/XrdOucTrace.hh"
00016 
00017 /******************************************************************************/
00018 /*                               b i n 2 h e x                                */
00019 /******************************************************************************/
00020   
00021 char *XrdOucTrace::bin2hex(char *inbuff, int dlen, char *buff)
00022 {
00023     static char hv[] = "0123456789abcdef";
00024     static char xbuff[56];
00025     char *outbuff = (buff ? buff : xbuff);
00026     int i;
00027     if (dlen > 24) dlen = 24;
00028     for (i = 0; i < dlen; i++) {
00029         *outbuff++ = hv[(inbuff[i] >> 4) & 0x0f];
00030         *outbuff++ = hv[ inbuff[i]       & 0x0f];
00031         if ((i & 0x03) == 0x03 || i+1 == dlen) *outbuff++ = ' ';
00032         }
00033      *outbuff = '\0';
00034      return xbuff;
00035 }

Generated on Tue Jul 5 14:46:57 2011 for ROOT_528-00b_version by  doxygen 1.5.1