/* cvt2h.h 7/11/2012 dwg - Copyright (C) 2012 Douglas Goodall */ /* This is an include file for a function which takes a pointer, a length, and a filename, and converts a buffer into a C header file that can be later incuded in some other compilation. */ #include "stdio.h" #include "visible.h" cvt2h(buffer,length,name) unsigned char * buffer; int length; char * name; { FILE * fd; int i,j,k,l; char szTemp[32]; fd = fopen(name,"w"); fprintf(fd, "/* %s produced automatically by cvt2h.h */\n",name); strcpy(szTemp,name); szTemp[8] = 0; fprintf(fd, "unsigned char %s[%d] = {\n\t", szTemp,length); for(i=0;i