Add doc comment to SetCallout function

This commit is contained in:
Elara 2023-07-16 23:27:57 -07:00
parent 23f1d484df
commit 709b261b4e
1 changed files with 3 additions and 0 deletions

View File

@ -626,6 +626,9 @@ type CalloutBlock struct {
CalloutFlags CalloutFlags
}
// SetCallout sets a callout function that will be called at specified points in the matching operation.
// fn should return zero if it ran successfully or a non-zero integer to force an error.
// See https://www.pcre.org/current/doc/html/pcre2callout.html for more information.
func (r *Regexp) SetCallout(fn func(cb *CalloutBlock) int32) error {
cfn := func(tls *libc.TLS, cbptr, data uintptr) int32 {
ccb := (*lib.Tpcre2_callout_block_8)(unsafe.Pointer(cbptr))