# -*- Fundamental -*-
#
# (C) 2002 Georges Dagousset <georges.dagousset@orange.fr>
# $Revision: 1.1 $



#include("dump.inc");
#dump(ddata:req,dtitle:"title");


function dump(ddata,dtitle)
{
 if(dtitle)display(":::",dtitle,"\n");
 __dmaxline = strlen(ddata) / 16;
 for (__dline = 0; __dline <= __dmaxline; __dline = __dline + 1) {
  display(string(hex(__dline*16),":")-"0x");
  for (__dcol = 0; __dcol < 16; __dcol = __dcol + 1) {
   if (!__dcol % 4) display(" ");
   if (__dcol + __dline * 16 < strlen(ddata))
    display(string(hex(ord(ddata[__dcol + __dline * 16]))," ")-"0x");
   else
    display("   ");
  }
  display("   ");
  for (__dcol = 0; __dcol < 16; __dcol = __dcol + 1) {
   if (__dcol + __dline * 16 < strlen(ddata)) {
    if(ord(ddata[__dcol + __dline * 16]) >= 32)
     display(ddata[__dcol + __dline * 16]);
    else
     display(".");
   }
   else
    display("   ");
  }
  display("\n");
 }
 display("\n");
}

