1/* the following changes file names for PureC projects */ 2 3if (argc > 0) 4{ 5 ordner = argv[0]; 6 if (basename(ordner) == "") /* ist Ordner */ 7 { 8 ChangeFilenames(ordner); 9 } 10} 11 12proc ChangeFilenames(folder) 13local i,entries,directory,file; 14{ 15 entries = filelist(directory,folder); 16 for (i = 0; i < entries; ++i) 17 { 18 file = directory[i,0]; 19 if ((directory[i,3]&16) > 0) /* subdirectory */ 20 { 21 ChangeFilenames(folder+file+"\\"); 22 } 23 else 24 { 25 if ((stricmp(suffix(file),".h")==0)|(stricmp(suffix(file),".c")==0)) 26 ChangeFilename(folder,file); 27 } 28 } 29} 30 31proc ChangeFilename(path,datei) 32local newfile,err; 33{ 34 newfile=datei; 35 newfile[0]=(newfile[0] | 32) ^ 32; 36 err=files.rename("-q",path+datei,newfile); 37} 38