comparison src/libstrfunc.c @ 151:cda7c812ec01

track character set individually for each mapi element
author Carl Byington <carl@five-ten-sg.com>
date Sun, 08 Mar 2009 14:35:26 -0700
parents fc11b1d1ad34
children 6954d315aaa8
comparison
equal deleted inserted replaced
150:06aa84023b48 151:cda7c812ec01
61 *ou=0; 61 *ou=0;
62 return output; 62 return output;
63 }; 63 };
64 64
65 65
66 void hexdump(char *hbuf, int start, int stop, int ascii) /* {{{ HexDump all or a part of some buffer */
67 {
68 char c;
69 int diff,i;
70
71 while (start < stop ) {
72 diff = stop - start;
73 if (diff > 16) diff = 16;
74
75 fprintf(stderr, ":%08X ",start);
76
77 for (i = 0; i < diff; i++) {
78 if( 8 == i ) fprintf( stderr, " " );
79 fprintf(stderr, "%02X ",(unsigned char)*(hbuf+start+i));
80 }
81 if (ascii) {
82 for (i = diff; i < 16; i++) fprintf(stderr, " ");
83 for (i = 0; i < diff; i++) {
84 c = *(hbuf+start+i);
85 fprintf(stderr, "%c", isprint(c) ? c : '.');
86 }
87 }
88 fprintf(stderr, "\n");
89 start += 16;
90 }
91 }