Skip to content

Commit

Permalink
Merge pull request #710 from diamondburned/stalone/add/glist-fns
Browse files Browse the repository at this point in the history
Add extra GList functions
  • Loading branch information
andre-hub committed Jan 3, 2021
2 parents f282e2f + 9c52c26 commit d006e59
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions glib/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,21 @@ func (v *List) Previous() *List {
return v.wrapNewHead(v.native().prev)
}

// First is a wrapper around g_list_first().
func (v *List) First() *List {
return v.wrapNewHead(C.g_list_first(v.native()))
}

// Last is a wrapper around g_list_last().
func (v *List) Last() *List {
return v.wrapNewHead(C.g_list_last(v.native()))
}

// Reverse is a wrapper around g_list_reverse().
func (v *List) Reverse() *List {
return v.wrapNewHead(C.g_list_reverse(v.native()))
}

// dataRaw is a wrapper around the data struct field
func (v *List) dataRaw() unsafe.Pointer {
return unsafe.Pointer(v.native().data)
Expand Down

0 comments on commit d006e59

Please sign in to comment.