dlbindings

package module
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 14, 2024 License: 0BSD Imports: 2 Imported by: 0

README

DLBindings

This module allows you to use ready-made DinoLang functions when using it as a plugin.

Only Linux, macOS and FreeBSD currently supports.

Documentation

Index

Examples

Constants

This section is empty.

Variables

View Source
var AddClass func(name string, usedByDefault bool, caller func(args []string, segmentName string) bool, loader func() bool) bool
View Source
var CheckOnVariable func(str string) bool
View Source
var CleanUp func(cleanClasses bool) bool
View Source
var Execute func(code, segmentName string, line int, isInIfElse bool) bool
View Source
var GetType func(str string) string
View Source
var GetTypeEx func(str string) string
View Source
var GetTypeOfVar func(str string) string
View Source
var GetVariableValue func(v string) interface{}
View Source
var IfVariableReplaceIt func(str string) interface{}
View Source
var ParseFile func(path string) bool
View Source
var PiniginShell func()
View Source
var PrintError func(str string)
View Source
var RemoveClass func(name string) bool
View Source
var RunCode func(code string) bool
View Source
var SetReturned func(varType string, value interface{}, segmentName string)
View Source
var SetVariable func(name string, value interface{}) bool
View Source
var StringToText func(str string) string
View Source
var TextToString func(str string) string

Functions

func InitDinolang

func InitDinolang(dlPath string) error
Example
package main

import (
	"log"

	"github.com/estintax/dlbindings"
)

func main() {
	err := dlbindings.InitDinolang("dinolang.so")
	if err != nil {
		log.Fatalln(err.Error())
		return
	}

	dlbindings.AddClass("myclass", false, func(args []string, segmentName string) bool {
		switch args[0] {
		case "hello":
			dlbindings.SetReturned("string", "Hello, World!", segmentName)
		}
		return true
	}, nil)

	dlbindings.RunCode("use, \"myclass\"\nmyclass:hello\n")
	log.Println(dlbindings.GetVariableValue("returned").(string))
}
Output:

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL