+void hexdumpTag(TAG*tag, char* prefix)
+{
+ int t;
+ printf(" %s-=> ",prefix);
+ for(t=0;t<tag->len;t++) {
+ printf("%02x ", tag->data[t]);
+ if((t && ((t&15)==15)) || (t==tag->len-1))
+ {
+ if(t==tag->len-1)
+ printf("\n");
+ else
+ printf("\n %s-=> ",prefix);
+ }
+ }
+}
+
+void dumperror(const char* format, ...)
+{
+ char buf[1024];
+ va_list arglist;
+
+ va_start(arglist, format);
+ vsprintf(buf, format, arglist);
+ va_end(arglist);
+
+ if(!html && !xy)
+ printf("==== Error: %s ====\n", buf);
+}
+
+static char strbuf[800];
+static int bufpos=0;
+
+char* timestring(double f)
+{
+ int hours = (int)(f/3600);
+ int minutes = (int)((f-hours*3600)/60);
+ int seconds = (int)((f-hours*3600-minutes*60));
+ int useconds = (int)((f-(int)f)*1000+0.5);
+ bufpos+=100;
+ bufpos%=800;
+ sprintf(&strbuf[bufpos], "%02d:%02d:%02d,%03d",hours,minutes,seconds,useconds);
+ return &strbuf[bufpos];
+}
+