jazykc
2013.3
upoljazykc
Main Page
Related Pages
Classes
Files
File List
File Members
All
Classes
Files
Functions
Variables
Typedefs
Macros
Pages
celkova-koncepce-programu
file_h.c
Go to the documentation of this file.
1
5
#include <stdio.h>
6
#include <stdlib.h>
7
#include <string.h>
8
#include <ctype.h>
9
10
/* pomucka/utilita na vytvoreni mustru file.h souboru
11
*
12
* umistit do $HOME/bin, pomoci make install, viz Makefile
13
*/
14
int
main(
int
argc,
char
*argv[]) {
15
char
*FILE_H, *file_h;
16
int
i;
17
if
(argc <= 1) {
18
printf(
"Usage: %s file.h\n"
, argv[0]);
19
exit(1);
//false, neo return 1;
20
}
21
22
file_h = argv[1];
23
FILE_H = strdup(file_h);
24
for
(i=0; file_h[i]; i++) {
25
FILE_H[i] = (isalnum(file_h[i])) ? toupper(file_h[i]) :
'_'
;
26
}
27
printf(
"#ifndef %s_INCLUDED\n#define %s_INCLUDED\n#endif\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n"
, FILE_H, FILE_H);
28
//nasl. je citelnejsi (pomoci concat string literalu):
29
printf(
"\n#ifdef __cplusplus\n"
30
"}\n"
31
"#endif\n#undef %s_INCLUDED\n"
, FILE_H);
32
return
0;
33
}
Generated on Sat Dec 7 2013 22:57:26 for jazykc by
1.8.5