aboutsummaryrefslogtreecommitdiffstats
path: root/Plugins/DbSqliteSystemData/fix_files.tcl
blob: d67abd0d21437d0ee4afd6779a1accb0a8c7948e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/env tclsh

proc process {f} {
  set shortName [string map [list systemdata_ ""] $f]
  if {[file exists $shortName]} {
    file rename -force $shortName $f
  }

  set fd [open $f r]
  set data [read $fd]  
  close $fd
  
  #set data [string map [list systemdata_systemdata_ systemdata_] $data]
  set data [string map [list \
	sqlite3 systemdata_sqlite3 \
	../core/ "" \
	interop.h systemdata_interop.h \
	../win/crypt.c systemdata_crypt.c \
	../contrib/extension-functions.c systemdata_extension-functions.c \
  ] $data]
  
  set fd [open $f w]
  puts $fd $data
  close $fd
}

foreach f {
	systemdata_sqlite3.c
	systemdata_sqlite3.h
	systemdata_sqlite3ext.h
	systemdata_interop.c
	systemdata_interop.h
	systemdata_extension-functions.c
	systemdata_crypt.c
} {
	process $f
}