5 /* Copy files from source directories to ./src changing
6 file names and #include names to 8x3 lower case */
8 char *usage
= "You must be in the \"pc\" directory.\n";
9 char *list
[] = {"..\\Include", "..\\Modules", "..\\Objects", "..\\Parser", "..\\Python", ".", 0};
16 char *pt1
, *pt2
, *name
;
17 char dest_path
[256], src_path
[256], buf256
[256];
20 for (plist
= list
; *plist
; plist
++){
21 if ((dpath
= opendir(*plist
)) == NULL
){
26 while (dir
= readdir(dpath
)){
29 if (len
> 2 && name
[len
- 2] == '.' &&
30 (name
[len
- 1] == 'c' || name
[len
- 1] == 'h')){
34 buf256
[9] = name
[len
- 1];
38 strncpy(src_path
, *plist
, 256);
39 strncat(src_path
, "\\", 256);
40 strncat(src_path
, name
, 256);
41 strncpy(dest_path
, ".\\src\\", 256);
42 strncat(dest_path
, buf256
, 256);
43 printf("Copying %-30s to %s\n", src_path
, dest_path
);
44 fpin
= fopen(src_path
, "r");
45 fpout
= fopen(dest_path
, "w");
46 while (fgets(buf256
, 256, fpin
)){
47 if (!strncmp(buf256
, "#include", 8)){
49 if ((pt1
= strstr(buf256
, "\"")) &&
50 (pt2
= strstr(buf256
, ".")) &&
51 (*(pt2
+ 1) == 'h') &&
53 for (pt1
+= 9; *pt2
; pt1
++, pt2
++)