467
|
1 int printf(const char *format, ...);
|
|
2
|
702
|
3 #define LBUFSIZE 10
|
|
4 static char current_file_dir[LBUFSIZE]; // keep track include file directory
|
|
5
|
|
6 void
|
|
7 copy_current_file_dir(char *name)
|
|
8 {
|
|
9 char *s = name;
|
|
10 char *d = current_file_dir;
|
|
11 char *p;
|
|
12 for(p = d;d<current_file_dir+LBUFSIZE && *s; ) {
|
|
13 if (*s=='/') p = d+1;
|
|
14 *d++ = *s++;
|
|
15 }
|
|
16 *p = 0;
|
|
17 }
|
|
18
|
170
|
19
|
|
20 main(int ac,char *av[])
|
|
21 {
|
491
|
22 printf("#0005:%d %d %d %s\n",1,2,3,&av[ac-1][3]);
|
702
|
23 copy_current_file_dir("test/hoge");
|
|
24 printf("#0006:%s\n",current_file_dir);
|
|
25
|
172
|
26 return 0;
|
170
|
27 }
|