haxegoruntime

package
v0.0.0-...-e0dd9a7 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2016 License: BSD-3-Clause, MIT Imports: 6 Imported by: 0

Documentation

Overview

Package haxegoruntime is automatically included in every TARDIS Go transpilation. This Go code is used by the Haxe runtime, it must be entirely self-sufficent. This Go code is always in the runtime. TODO consider how to slim it down...

Index

Constants

This section is empty.

Variables

View Source
var JScallbackOK = false
View Source
var TypeTable = make([]*rtype, hx.GetInt("", "TypeInfo.nextTypeID"))

TypeTable provides a mapping between used type numbers (the index) to their reflect definitions but reflect is not used here in order to avoid pulling it into every build

View Source
var ZiLen int

ZiLen is the runtime native string length of the chinese character "字", meaning "written character", which is pronounced "zi" in Mandarin. It is initialised by the haxe Go.init() code generated by goclass.go because otherwise the string will be escaped and always be 3 long

Functions

func AddHaxeType

func AddHaxeType(ptr unsafe.Pointer)

func BrowserMain

func BrowserMain(mainFN func(), msInvocationInterval, runLimit int)

Main allows code that might be targeted to broser-based JS code to schedule TARDISgo code periodically, separate from call-backs. For non-JS targets it simply calls the given mainFN. This should be the last function called in main.main()

func GetURL

func GetURL(url string) (string, error)

func HaxeTimer

func HaxeTimer(up unsafe.Pointer)

func HaxeWait

func HaxeWait(target *int64, whileTrue *bool)

TODO optimize to use the Timer call-back methods for the targets - flash, java, js, python

func Raw2Runes

func Raw2Runes(s []uint) []rune

Raw2Runes takes the UTF-8 contents of a string and returns the equivalent rune slice TODO review if this can be optimized away

func Rune2Raw

func Rune2Raw(oneRune rune) []uint

Rune2Raw takes an individual rune and returns the UTF-8 integer slice representing it

func Runes2Raw

func Runes2Raw(r []rune) []uint

Runes2Raw takes a rune slice and returns a UTF-8 integer slice representing the underlying string TODO review if this can be optimized away

func RunesToUTF16

func RunesToUTF16(r []rune) []uint16

RunesToUTF16 is a wrapper for utf16.Encode TODO review if this can be optimized away

func RunesToUTF8

func RunesToUTF8(r []rune) []byte

RunesToUTF8 takes a rune slice and returns the equivalent utf8 byte slice

func RuntimeNano

func RuntimeNano() int64

RuntimeNano returns the current value of the runtime clock in nanoseconds.

func StartTimer

func StartTimer(up unsafe.Pointer)

func StopTimer

func StopTimer(up unsafe.Pointer) bool

func UTF16toRunes

func UTF16toRunes(s []uint16) []rune

UTF16toRunes is a wrapper for utf16.Decode TODO review if this can be optimized away

func UTF8toRunes

func UTF8toRunes(s []byte) []rune

UTF8toRunes takes a utf8 byte slice and returns the equivalent rune slice

Types

type Kind

type Kind uint8 // Haxe change, was uint

NOTE types below MUST be clones of the reflect package structs A Kind represents the specific kind of type that a Type represents. The zero Kind is not a valid kind.

const (
	Invalid Kind = iota
	Bool
	Int
	Int8
	Int16
	Int32
	Int64
	Uint
	Uint8
	Uint16
	Uint32
	Uint64
	Uintptr
	Float32
	Float64
	Complex64
	Complex128
	Array
	Chan
	Func
	Interface
	Map
	Ptr
	Slice
	String
	Struct
	UnsafePointer
)

Jump to

Keyboard shortcuts

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