Skip to content

Commit

Permalink
Exposing Sym call
Browse files Browse the repository at this point in the history
  • Loading branch information
kenshaw committed Dec 31, 2017
1 parent cf55d73 commit 94c4801
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions dl.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ func cast(sym unsafe.Pointer, v interface{}) error {
return nil
}

// loadsym wraps loading symbol name from the handle, decoding the value to v.
func loadsym(h unsafe.Pointer, name string, v interface{}) error {
// Sym wraps loading symbol name from handle h, decoding the value to v.
func Sym(h unsafe.Pointer, name string, v interface{}) error {
n := C.CString(name)
defer C.free(unsafe.Pointer(n))

Expand All @@ -154,10 +154,10 @@ func loadsym(h unsafe.Pointer, name string, v interface{}) error {

// SymDefault loads symbol name into v from the RTLD_DEFAULT handle.
func SymDefault(name string, v interface{}) error {
return loadsym(C.RTLD_DEFAULT, name, v)
return Sym(C.RTLD_DEFAULT, name, v)
}

// SymNext loads symbol name into v from the RTLD_NEXT handle.
func SymNext(name string, v interface{}) error {
return loadsym(C.RTLD_NEXT, name, v)
return Sym(C.RTLD_NEXT, name, v)
}
2 changes: 1 addition & 1 deletion lib.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,5 @@ func (l *Lib) Close() error {

// Sym loads symbol name from the loaded library into v.
func (l *Lib) Sym(name string, v interface{}) error {
return loadsym(l.h, name, v)
return Sym(l.h, name, v)
}

0 comments on commit 94c4801

Please sign in to comment.