/* This file is part of cputemp2maxfreq. Copyright (C) 2023-2024 pa4wdh cputemp2maxfreq is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License , or (at your option) any later version. cputemp2maxfreq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with cputemp2maxfreq; see the file COPYING. If not, see . */ #include "debug.h" #ifdef NEED_DEBUG_HELPER #include #include #include void debug_print_time() { struct timeval debug_tv; struct tm *debug_tm; char debug_buffer[10]; gettimeofday(&debug_tv,NULL); debug_tm=localtime(&debug_tv.tv_sec); strftime(debug_buffer,10, "%T",debug_tm); fprintf(stderr,"%s.%06d: ",debug_buffer,(int)debug_tv.tv_usec); } #endif #ifdef NEED_HEXDUMP_HELPER #include void hexdump(unsigned char *data,int len) { int count; int count2; int max; for(count=0;countlen) max=len; for(count2=count;count2=32) && (data[count2]<127)) { fprintf(stderr,"%c",data[count2]); } else { fprintf(stderr,"."); } } fprintf(stderr,"\n"); } } #endif