source: golgotha/src/i4/string/file_2_hex.c

Last change on this file was 80, checked in by Sam Hocevar, 15 years ago
  • Adding the Golgotha source code. Not sure what's going to be interesting in there, but since it's all public domain, there's certainly stuff to pick up.
  • Property svn:keywords set to Id
File size: 410 bytes
RevLine 
[80]1#include <stdio.h>
2
3main()
4{
5  int c,x=0;
6  fprintf(stdout,"unsigned char resource_buffer[]={\n");
7  while (!feof(stdin))
8  {
9    c=fgetc(stdin);
10    if (!feof(stdin))
11    {
12      if (x==0)
13        fprintf(stdout,"  0x%x",c);
14      else if ((x%15==0))
15        fprintf(stdout,",\n  0x%x",c);
16      else
17        fprintf(stdout,",0x%x",c);
18      x++;
19    }
20  }
21  fprintf(stdout,"};\n");
22
23}
Note: See TracBrowser for help on using the repository browser.