update readme and add gitignore
[client-tools.git] / tools / ScanInc.btm
blob4650814fd20726ed61a194cf26fc1790ab25e97e
1 @echo off
2 @rem This file is to be used on includePaths.rsp files to check the validity of included folders
4 set slMode=delete
6 set slIncludeFile=%1
7 @rem echo %slIncludeFile
8 if not exist "%slIncludeFile" (echo %slIncludeFile not found & goto end)
10 set slFileLine=%@TRIM[%@LINE[%slIncludeFile, 0]]
11 set slInclude=%@INSTR[1, 8, %slFileLine]
12 if "%slInclude" == "#include" goto process
13 if "%slInclude" == "#ifndef" p4 edit %slIncludeFile
14 if "%slInclude" == "#error o" p4 delete %slIncludeFile
15 goto skip
17 :process
18 set slFileLine2=%@INSTR[17, 100, %slFileLine]
19 set slLineLength=%@LEN[%slFileLine2]
20 set slLine=%@LEFT[%slLineLength, %slFileLine2]
21 set slLine=%@REPLACE[/,\,%slLine]
22 set slLine=%@TRIM[%slLine]
24 if not exist "%slLine" (if not "%slLine" == "" (echo   %2/%slIncludeFile & echo   x "%slLine" & p4 %slMode %slIncludeFile))
25 goto end
27 :skip
28 echo skipping %slIncludeFile {%slInclude} [%slFileLine]
30 :end
31 @rem cleanup variables
32 set slFileCount=
33 set i=
34 set slFileLine=
35 set slErrors=
36 set slIncludeFile=
37 set slLine=