diff options
Diffstat (limited to 'contrib/tools/data2header.c')
-rw-r--r-- | contrib/tools/data2header.c | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/contrib/tools/data2header.c b/contrib/tools/data2header.c deleted file mode 100644 index 885a5a7b..00000000 --- a/contrib/tools/data2header.c +++ /dev/null | |||
@@ -1,41 +0,0 @@ | |||
1 | /* | ||
2 | * by Luis Figueiredo (stdio@netc.pt) | ||
3 | */ | ||
4 | #include <stdio.h> | ||
5 | #include <fcntl.h> | ||
6 | #include <stdlib.h> | ||
7 | #include <string.h> | ||
8 | #ifdef WIN32 | ||
9 | #include <io.h> | ||
10 | #endif | ||
11 | |||
12 | |||
13 | |||
14 | int main(int argc, char *argv[]) { // Johannes E. Schindelin | ||
15 | unsigned char ch; | ||
16 | char *vn; | ||
17 | unsigned int i=0; | ||
18 | if(argc<2) { | ||
19 | fprintf(stderr,"Need a name for VAR\n"); | ||
20 | exit(1); // Johannes E. Schindelin | ||
21 | }; | ||
22 | vn=malloc(strlen(argv[1])+1); | ||
23 | for(i=0;i<strlen(argv[1]);i++)vn[i]=toupper(argv[1][i]); | ||
24 | vn[i]='\0'; | ||
25 | printf("/*\n * by data2header by Luis Figueiredo (stdio@netc.pt)\n */\n"); | ||
26 | printf("#ifndef _%s_H_\n",vn); | ||
27 | printf("#define _%s_H_\n\n",vn); | ||
28 | free(vn); | ||
29 | i=0; | ||
30 | printf("char %s[]=\"",argv[1]); | ||
31 | while(read(0,&ch,1)) { | ||
32 | i++;if(i>25){i=0;printf("\"\n\"");}; | ||
33 | printf("\\x%X",ch); | ||
34 | }; | ||
35 | printf("\";\n\n"); | ||
36 | printf("#endif\n"); | ||
37 | return 0; // Johannes E. Schindelin | ||
38 | }; | ||
39 | |||
40 | |||
41 | |||