Improved Windows support
This commit is contained in:
parent
201f783a4d
commit
fa1dce31f3
6 changed files with 127 additions and 63 deletions
6
src/dll/DLL.go
Normal file
6
src/dll/DLL.go
Normal file
|
@ -0,0 +1,6 @@
|
|||
package dll
|
||||
|
||||
type DLL struct {
|
||||
Name string
|
||||
Functions []string
|
||||
}
|
24
src/dll/List.go
Normal file
24
src/dll/List.go
Normal file
|
@ -0,0 +1,24 @@
|
|||
package dll
|
||||
|
||||
// List is a slice of DLLs.
|
||||
type List []DLL
|
||||
|
||||
// Index returns the position of the given function name.
|
||||
func (list List) Index(dllName string, funcName string) int {
|
||||
index := 0
|
||||
|
||||
for _, dll := range list {
|
||||
if dll.Name != dllName {
|
||||
index += len(dll.Functions) + 1
|
||||
continue
|
||||
}
|
||||
|
||||
for i, fn := range dll.Functions {
|
||||
if fn == funcName {
|
||||
return index + i
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return -1
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue