aboutsummaryrefslogtreecommitdiffstats
path: root/Plugins/DbSqliteWx/add_prefix.tcl
blob: 74e3e9f04e8cb29c5a85dadf582eab583ed8e675 (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
#!/usr/bin/env tclsh

proc process {f} {
  set fd [open $f r]
  set data [read $fd]  
  close $fd
  
  set data [string map [list sqlite3 wx_sqlite3] $data]
  set data [string map [list wx_sqlite3.c wxsqlite3.c] $data]
  set data [string map [list wx_sqlite3.h wxsqlite3.h] $data]
  
  set fd [open $f w]
  puts $fd $data
  close $fd
}

if {[file exists sqlite3.c]} {
	file rename -force sqlite3.c wxsqlite3.c
}

if {[file exists sqlite3.h]} {
	file rename -force sqlite3.h wxsqlite3.h
	file copy -force wxsqlite3.h wxsqlite3_unmodified.h
}

foreach f [concat [glob -nocomplain *.c] [glob -nocomplain *.h]] {
	if {[string match -nocase "dbsqlitewx*" $f]} continue
	process $f
}