Debian Codegraph @

generate/searchDates.praat

raw
1 # "Search dates"
2 # Paul Boersma, 14 September 2023
3
4 form: "Search dates"
5 text: "ManPage title", ""
6 endform
7 writeInfoLine: "Searching: ", manPage_title$
8
9 previousHit$ = ""
10 volumes$# = folderNames$#: "/Volumes/sources_*"
11 for ivol to size: volumes$#
12 appendInfoLine: "Searching ", volumes$# [ivol]
13 volumePath$ = "/Volumes/" + volumes$# [ivol]
14 rootFolders$# = folderNames$#: volumePath$
15 for iroot to size: rootFolders$#
16 rootFolderPath$ = volumePath$ + "/" + rootFolders$# [iroot]
17 praatVersion$ = mid$ (rootFolders$# [iroot], 9, 1e9)
18 numberOfManualEntries = 0
19 searchFolders$# = folderNames$#: rootFolderPath$
20 for ifolder to size: searchFolders$#
21 searchFolderPath$ = rootFolderPath$ + "/" + searchFolders$# [ifolder]
22 fileNamePatterns$# = { "manual_*.c", "manual_*.cpp" }
23 for ipat to size: fileNamePatterns$#
24 fileNames$# = fileNames$#: searchFolderPath$ +
25 ... "/" + fileNamePatterns$# [ipat]
26 for ifile to size: fileNames$#
27 filePath$ = searchFolderPath$ + "/" + fileNames$# [ifile]
28 lines$# = readLinesFromFile$#: filePath$
29 for iline to size: lines$#
30 line$ = lines$# [iline]
31 if index (line$, "MAN_BEGIN") and
32 ... index (line$, manPage_title$)
33 if line$ <> previousHit$
34 appendInfoLine: line$
35 previousHit$ = line$
36 endif
37 endif
38 endfor
39 endfor
40 endfor
41 endfor
42 endfor
43 endfor
44