// Package glib was automatically generated by github.com/bnema/puregotk DO NOT EDIT package glib import ( "github.com/ebitengine/purego" "github.com/bnema/puregotk/pkg/core" ) var xFprintf func(uintptr, string, ...interface{}) int // An implementation of the standard `fprintf()` function which supports // positional parameters, as specified in the Single Unix Specification. // // `glib/gprintf.h` must be explicitly included in order to use this function. func Fprintf(FileVar uintptr, FormatVar string, varArgs ...interface{}) int { cret := xFprintf(FileVar, FormatVar, varArgs...) return cret } var xPrintf func(string, ...interface{}) int // An implementation of the standard `printf()` function which supports // positional parameters, as specified in the Single Unix Specification. // // As with the standard `printf()`, this does not automatically append a trailing // new-line character to the message, so typically @format should end with its // own new-line character. // // `glib/gprintf.h` must be explicitly included in order to use this function. func Printf(FormatVar string, varArgs ...interface{}) int { cret := xPrintf(FormatVar, varArgs...) return cret } var xSprintf func(string, string, ...interface{}) int // An implementation of the standard `sprintf()` function which supports // positional parameters, as specified in the Single Unix Specification. // // Note that it is usually better to use [func@GLib.snprintf], to avoid the // risk of buffer overflow. // // `glib/gprintf.h` must be explicitly included in order to use this function. // // See also [func@GLib.strdup_printf]. func Sprintf(StringVar string, FormatVar string, varArgs ...interface{}) int { cret := xSprintf(StringVar, FormatVar, varArgs...) return cret } var xVasprintf func(*string, string, []interface{}) int // An implementation of the GNU `vasprintf()` function which supports // positional parameters, as specified in the Single Unix Specification. // This function is similar to [func@GLib.vsprintf], except that it allocates a // string to hold the output, instead of putting the output in a buffer // you allocate in advance. // // The returned value in @string is guaranteed to be non-`NULL`, unless // @format contains `%lc` or `%ls` conversions, which can fail if no // multibyte representation is available for the given character. // // `glib/gprintf.h` must be explicitly included in order to use this function. func Vasprintf(StringVar *string, FormatVar string, ArgsVar []interface{}) int { cret := xVasprintf(StringVar, FormatVar, ArgsVar) return cret } var xVfprintf func(uintptr, string, []interface{}) int // An implementation of the standard `fprintf()` function which supports // positional parameters, as specified in the Single Unix Specification. // // `glib/gprintf.h` must be explicitly included in order to use this function. func Vfprintf(FileVar uintptr, FormatVar string, ArgsVar []interface{}) int { cret := xVfprintf(FileVar, FormatVar, ArgsVar) return cret } var xVprintf func(string, []interface{}) int // An implementation of the standard `vprintf()` function which supports // positional parameters, as specified in the Single Unix Specification. // // `glib/gprintf.h` must be explicitly included in order to use this function. func Vprintf(FormatVar string, ArgsVar []interface{}) int { cret := xVprintf(FormatVar, ArgsVar) return cret } var xVsprintf func(string, string, []interface{}) int // An implementation of the standard `vsprintf()` function which supports // positional parameters, as specified in the Single Unix Specification. // // `glib/gprintf.h` must be explicitly included in order to use this function. func Vsprintf(StringVar string, FormatVar string, ArgsVar []interface{}) int { cret := xVsprintf(StringVar, FormatVar, ArgsVar) return cret } func init() { core.SetPackageName("GLIB", "glib-2.0") core.SetSharedLibraries("GLIB", []string{"libgobject-2.0.so.0", "libglib-2.0.so.0"}) var libs []uintptr for _, libPath := range core.GetPaths("GLIB") { lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL) if err != nil { panic(err) } libs = append(libs, lib) } core.PuregoSafeRegister(&xFprintf, libs, "g_fprintf") core.PuregoSafeRegister(&xPrintf, libs, "g_printf") core.PuregoSafeRegister(&xSprintf, libs, "g_sprintf") core.PuregoSafeRegister(&xVasprintf, libs, "g_vasprintf") core.PuregoSafeRegister(&xVfprintf, libs, "g_vfprintf") core.PuregoSafeRegister(&xVprintf, libs, "g_vprintf") core.PuregoSafeRegister(&xVsprintf, libs, "g_vsprintf") }