Subversion Repositories HelenOS

Rev

Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. #include<stdio.h>
  2. #include<stdlib.h>
  3.  
  4. int main(int argc,char** argv)
  5. {
  6.     FILE *fi,*fo;
  7.     int count=0;
  8.     int ch;
  9.     fi=fopen("image.bin","rb");
  10.     fo=fopen("image.c","wb");
  11.     fprintf(fo,"char HOSimage[]={\n");
  12.     if((ch=getc(fi))!=EOF) {fprintf(fo,"0x%02X",ch);count++;}
  13.     while((ch=getc(fi))!=EOF) {fprintf(fo,",0x%02X",ch);count++;}
  14.     fprintf(fo,"};\nint HOSimagesize=%d;\n",count);
  15.     return EXIT_SUCCESS;
  16. }
  17.  
  18.