Skip to main content
Expand description

I suspect that these are unused, and were for an older version of DGO.

All DGO stuff is handled on the IOP.

see also load-dgo.gc's dgo-header.

Types


dgo-entry

dgo-entry: structuresource
Fields
offset: uint32
length: uint32

dgo-file

dgo-file: basicsource
Fields
type: type
num-go-files: uint32
total-length: uint32
rsvd: uint32
data: uint8

gcommon

source

Types


bfloat

bfloat: basicsource
Fields
type: type
data: float

inline-array-class

inline-array-class: basicsource
Fields
type: type
length: int32
allocated-length: int32
_data: uint8

vec4s

vec4s: uint128source

vector

vector: structuresource
Fields
data: float
x: float
y: float
z: float
w: float
quad: uint128

Functions


*

*(arg0: int, arg1: int) => intsource

Multiply two integers (32-bit)

+(arg0: int, arg1: int) => intsource

Add two integers (64-bit).

-(arg0: int, arg1: int) => intsource

Subtract two integers (64-bit).

/(arg0: int, arg1: int) => intsource

Divide two integers (32-bit, signed)

1/

1/(arg0: float) => floatsource

Floating point reciprocal

abs

abs(a: int) => intsource

Take the absolute value of a 64-bit signed integer

append!

append!(arg0: object, arg1: object) => objectsource

Append back to front, return the combined list.

ash

ash(value: int, shift-amount: int) => intsource

Arithmetic shift value by shift-amount.
A positive shift-amount will shift to the left and a negative will shift to the right.

assoc

assoc(arg0: object, arg1: object) => objectsource

Is item in the association list alist?
Returns the key-value pair.

assoce

assoce(arg0: object, arg1: object) => objectsource

Is there an entry with key item in the association list alist?
Returns the key-value pair.
Treats a key of 'else like an else case

basic-type?

basic-type?(arg0: basic, arg1: type) => symbolsource

Is the given basic an object of the given type?

breakpoint-range-set!

breakpoint-range-set!(arg0: uint, arg1: uint, arg2: uint) => intsource

Sets some debug register (COP0 Debug, dab, dabm) to break on memory access.
This is not supported in OpenGOAL.

delete!

delete!(arg0: object, arg1: object) => pairsource

Remove the first occurance of item from lst (where item is actual a pair in the list)

delete-car!

delete-car!(arg0: object, arg1: object) => objectsource

Remove the first first occurance of an element from the list where (car elt) is item.

fact

fact(x: int) => intsource

false-func

false-func() => symbolsource

Return #f.

find-parent-method

find-parent-method(arg0: type, arg1: int) => functionsource

Go up the type tree and find the first parent type that has a different implementation for the given method.

identity

identity(arg0: object) => objectsource

Return the input. Works for any 64-bit value.

insert-cons!

insert-cons!(arg0: object, arg1: object) => pairsource

Update an association list to have the given (key . value) pair kv.
If it already exists in the list, remove it.
DANGER: this function allocates memory on the global heap.

inspect

inspect(arg0: object) => objectsource

Inspect any boxed object.

last

last(arg0: object) => objectsource

Get the last object in a list.

logand

logand(arg0: int, arg1: int) => intsource

Logical and (64-bit)

logior

logior(arg0: int, arg1: int) => intsource

Logical or (64-bit)

lognor

lognor(a: int, b: int) => intsource

Compute not or (64-bit).

lognot

lognot(arg0: int) => intsource

Logical not (64-bit)

logxor

logxor(arg0: int, arg1: int) => intsource

Logical exclusive or (64-bit)

max

max(a: int, b: int) => intsource

Compute maximum of two 64-bit signed integer.

mem-copy!

mem-copy!(arg0: pointer, arg1: pointer, arg2: int) => pointersource

Memory copy. Not a very efficient optimization, but has no restrictions.
Increasing address copy.

mem-or!

mem-or!(arg0: pointer, arg1: pointer, arg2: int) => pointersource

Set the dst to (logior dst src) byte by byte.
Not very efficient.

mem-print

mem-print(arg0: pointer, arg1: int) => symbolsource

mem-set32!

mem-set32!(arg0: pointer, arg1: int, arg2: int) => pointersource

Normal memset, but by 32-bit word.
NOTE: argument order is swapped from C

member

member(arg0: object, arg1: object) => objectsource

Is obj in the list lst? Returns pair with obj as its car, or #f if not found.

min

min(a: int, b: int) => intsource

Compute minimum of two 64-bit signed integers.

mod

mod(arg0: int, arg1: int) => intsource

Integer mod (signed, 32-bit)

nassoc

nassoc(arg0: string, arg1: object) => objectsource

Is there an entry named item-name in the association list alist?
Checks name with nmember or name= so you can have multiple keys.
Returns the ([key|(key..)] . value) pair.

nassoce

nassoce(arg0: string, arg1: object) => objectsource

Is there an entry named item-name in the association list alist?
Checks name with nmember for multiple keys or name= for single.
Allows else as a single key that always matches

nmember

nmember(arg0: basic, arg1: object) => objectsource

Is obj in the list lst? Check with the name= function.

print

print(arg0: object) => objectsource

Print out any boxed object. Does NOT insert a newline.

print-tree-bitmask(arg0: int, arg1: int) => symbolsource

Print out a single entry for a process tree 'tree' diagram

printl

printl(arg0: object) => objectsource

Print out any boxed object and a newline at the end.

qmem-copy->!

qmem-copy->!(arg0: pointer, arg1: pointer, arg2: int) => pointersource

Memory copy by quadword (16-bytes). More efficient, but has restrictions:
- dst and src should be 16-byte aligned.
- size in bytes will be rounding up to nearest 16-bytes
- Descending address copy

qmem-copy<-!

qmem-copy<-!(arg0: pointer, arg1: pointer, arg2: int) => pointersource

Memory copy by quadword. More efficient, but has restrictions:
- dst and src should be 16-byte aligned.
- size in bytes will be rounded up to 16-bytes
- Ascending address copy.

quad-copy!

quad-copy!(dst: pointer, src: pointer, qwc: int) => nonesource

Optimized memory copy. The original is pretty clever, but this isn't.

ref

ref(arg0: object, arg1: int) => objectsource

Get the n-th item in a linked list. No range checking.

rem

rem(arg0: int, arg1: int) => intsource

Integer mod (signed, 32-bit). Even though it's called rem, it behaves the same as mod.

sort

sort(arg0: pair, arg1: function) => pairsource

Sort a list, using compare-func to compare elements.
The comparison function can return either an integer or a true/false.
For integers, use a positive number to represent first > second
Ex: (sort lst -) will sort in ascending order
For booleans, you must explicitly use TRUE and not a truthy value.
Ex: (sort my-list (lambda ((x int) (y int)) (< x y))) will sort ascending.
NOTE: if you use an integer, don't accidentally return TRUE.

true-func

true-func() => symbolsource

Return #t.

type-type?

type-type?(arg0: type, arg1: type) => symbolsource

Is the given type equal to, or a child of, the second type?

type?

type?(arg0: object, arg1: type) => symbolsource

Is the given object an object of the given type? Works for any boxed object (basic, symbol, binteger, pair).

valid?

valid?(obj: object, expected-type: type, name: string, allow-false: symbol, print-dest: object) => symbolsource

Check if the given object is valid. This will work for structures, pairs, basics, bintegers, symbols, and types.
If you set expected-type to #f, it just checks for a 4-byte aligned address that's in GOAL memory.
If you're checking a structure, set expected-type to structure. This requires 16-byte alignment
Note: packed inline structures in arrays or fields will not pass this check.
Otherwise, set it to the type you expect. More specific types will pass.

If allow-false is #t, a #f will always pass. Otherwise, #f will fail (unless you're looking for a symbol).
Use allow-false if you want to allow a 'null' reference.

The name is only used when printing out an error if the check fails.
Use a name of #f to suppress error prints.

Variables


*print-column*: bintegersource

*trace-list*

*trace-list*: pairsource

BIG_MEMORY

const BIG_MEMORY: unknownsource

END_OF_MEMORY

END_OF_MEMORY: unknownsource

format

const format: functionsource

PC_BIG_MEMORY

PC_BIG_MEMORY: unknownsource

PC_PORT

PC_PORT: unknownsource

PC_PROFILER_ENABLE

PC_PROFILER_ENABLE: unknownsource

SYM_TO_STRING_OFFSET

SYM_TO_STRING_OFFSET: unknownsource

USE_VM

USE_VM: unknownsource

gkernel-h

source

Types


catch-frame

catch-frame: stack-framesource
Fields
type: type
name: symbol
next: stack-frame
sp: int32
ra: int32
freg: float
rreg: uint128

clock

clock: basicsource
Fields
type: type
index: int32
mask: process-mask
clock-ratio: float
accum: float
integral-accum: float
frame-counter: time-frame
old-frame-counter: time-frame
integral-frame-counter: uint64
old-integral-frame-counter: uint64
sparticle-data: vector
seconds-per-frame: float
frames-per-second: float
time-adjust-ratio: float
Methods
update-rates!(obj: clock, arg0: float) => floatsource

Recompute all clock values for the given clock ratio (arg0).

advance-by!(obj: clock, arg0: float) => clocksource

Advance the clock by arg0 timeframes (as a float).
Both counters keep a separate fractional and integer counter.

tick!(obj: clock) => clocksource

Per-game-frame clock tick forward.

save!(obj: clock, arg0: pointer) => intsource

Save a clock's state to a buffer, return bytes used.

load!(obj: clock, arg0: pointer) => intsource

Load a clock's state from a buffer, return bytes used.

reset!(obj: clock) => nonesource

Reset a clock to 1000s, rate of 1.

cpu-thread

cpu-thread: threadsource
Fields
type: type
name: symbol
process: process
previous: thread
suspend-hook: function
resume-hook: function
pc: pointer
sp: pointer
stack-top: pointer
stack-size: int32
rreg: uint64
freg: float
stack: uint8

dead-pool

dead-pool: process-treesource
Fields
type: type
name: string
mask: process-mask
clock: clock
parent: pointer
brother: pointer
child: pointer
ppointer: pointer
self: process-tree
Methods
get-process(obj: dead-pool, arg0: type, arg1: int) => processsource

Try to get a process from this dead pool. If it fails, try the debug dead pool and complain.

return-process(obj: dead-pool, arg0: process) => nonesource

Return a process to the dead pool.

dead-pool-heap

dead-pool-heap: dead-poolsource
Fields
type: type
name: string
mask: process-mask
clock: clock
parent: pointer
brother: pointer
child: pointer
ppointer: pointer
self: process-tree
allocated-length: int32
compact-time: uint32
compact-count-targ: uint32
compact-count: uint32
fill-percent: float
first-gap: dead-pool-heap-rec
first-shrink: dead-pool-heap-rec
heap: kheap
alive-list: dead-pool-heap-rec
last: dead-pool-heap-rec
dead-list: dead-pool-heap-rec
process-list: dead-pool-heap-rec
Methods
init(obj: dead-pool-heap, arg0: symbol, arg1: int) => nonesource

Initialize the heap.

compact(obj: dead-pool-heap, arg0: int) => nonesource

Relocate processes to remove gaps and increase free memory.

shrink-heap(obj: dead-pool-heap, proc: process) => dead-pool-heapsource

Shrink the heap of a process.
This resizes the process heap to be the exact size it is currently using.

churn(obj: dead-pool-heap, arg0: int) => nonesource

Relocate processes to debug process relocation.

memory-used(obj: dead-pool-heap) => intsource

Get the amount of used memory. Gaps in between processes are considered used.

memory-total(obj: dead-pool-heap) => intsource

Get the total size of the heap.

memory-free(obj: dead-pool-heap) => intsource

Get the amount of free memory. Does not include gaps in between processes.

compact-time(obj: dead-pool-heap) => uintsource

Not working, likely was supposed to return how long the compaction took.

gap-size(obj: dead-pool-heap, arg0: dead-pool-heap-rec) => intsource

Get the size of the gap after the given record (possibly 0)

gap-location(obj: dead-pool-heap, arg0: dead-pool-heap-rec) => pointersource

Get the location of the first possible gap after the given record.

find-gap(obj: dead-pool-heap, arg0: dead-pool-heap-rec) => dead-pool-heap-recsource

Iterate through records, starting at the given one, and find the first one with a gap after it.

find-gap-by-size(obj: dead-pool-heap, arg0: int) => dead-pool-heap-recsource

Find the first gap which is at least the given size.

dead-pool-heap-rec

dead-pool-heap-rec: structuresource

event-message-block

event-message-block: structuresource
Fields
to-handle: handle
to: pointer
form-handle: handle
from: pointer
param: uint64
message: symbol
num-params: int32

event-message-block-array

event-message-block-array: inline-array-classsource
Fields
type: type
length: int32
allocated-length: int32
_data: uint8
data: event-message-block
Methods
send-all!(obj: event-message-block-array) => nonesource

Send all pending messages. Will only do the send if both the sender and receiver are still alive.

handle

handle: uint64source

kernel-context

kernel-context: basicsource
Fields
type: type
prevent-from-run: process-mask
require-for-run: process-mask
allow-to-run: process-mask
next-pid: int32
fast-stack-top: pointer
current-process: process
relocating-process: basic
relocating-min: int32
relocating-max: int32
relocating-offset: int32
relocating-level: level
low-memory-message: symbol
login-object: basic

process

process: process-treesource
Fields
type: type
name: string
mask: process-mask
clock: clock
parent: pointer
brother: pointer
child: pointer
ppointer: pointer
self: process-tree
pool: dead-pool
status: symbol
pid: int32
main-thread: cpu-thread
top-thread: cpu-thread
entity: entity-actor
level: level
state: state
next-state: state
trans-hook: function
post-hook: function
event-hook: function
allocated-length: int32
pad-unknown-0: uint32
heap-base: pointer
heap-top: pointer
heap-cur: pointer
stack-frame-top: stack-frame
connection-list: connectable
stack: uint8
States
dead-state: TODO
empty-state: TODO

process-tree

process-tree: basicsource
Fields
type: type
name: string
mask: process-mask
clock: clock
parent: pointer
brother: pointer
child: pointer
ppointer: pointer
self: process-tree
Methods
activate(obj: process, arg0: process-tree, arg1: basic, arg2: pointer) => process-treesource

Start a process!

deactivate(obj: sig) => nonesource
init-from-entity!(obj: enemy, arg0: entity-actor) => nonesource

Typically the method that does the initial setup on the process, potentially using the entity-actor provided as part of that.
This commonly includes things such as:
- stack size
- collision information
- loading the skeleton group / bones
- sounds

run-logic?(obj: enemy) => symbolsource
process-tree-method-13: unknown

protect-frame

protect-frame: stack-framesource
Fields
type: type
name: symbol
next: stack-frame
exit: function

sql-result

sql-result: basicsource
Fields
type: type
len: int32
allocated-length: uint32
error: symbol
data: string

stack-frame

stack-frame: basicsource
Fields
type: type
name: symbol
next: stack-frame

state

state: protect-framesource
Fields
type: type
name: symbol
next: stack-frame
exit: function
code: function
trans: function
post: function
enter: function
event: function

thread

thread: basicsource
Fields
type: type
name: symbol
process: process
previous: thread
suspend-hook: function
resume-hook: function
pc: pointer
sp: pointer
stack-top: pointer
stack-size: int32
Methods
stack-size-set!(obj: thread, arg0: int) => nonesource

Modify the backup stack size of a thread. Must be called from the main thread, before any
allocations have been done on the process heap.

thread-suspend(unused: cpu-thread) => nonesource

Suspend the thread and return to the kernel.

thread-resume(thread-to-resume: cpu-thread) => nonesource

Resume a suspended thread. Call this from the kernel only.
This is also used to start a thread initialized with set-to-run.
As a result of MIPS/x86 differences, there is a hack for this.

time-frame

time-frame: int64source

Variables


*gtype-basic-offset*

*gtype-basic-offset*: unknownsource

*kernel-major-version*

*kernel-major-version*: unknownsource

*kernel-minor-version*

*kernel-minor-version*: unknownsource

*scratch-memory-top*

*scratch-memory-top*: unknownsource

*sql-result*

*sql-result*: sql-resultsource

*tab-size*

*tab-size*: unknownsource

DPROCESS_STACK_SIZE

DPROCESS_STACK_SIZE: unknownsource

KERNEL_DEBUG

KERNEL_DEBUG: unknownsource

PP

PP: unknownsource

PROCESS_HEAP_MAX

PROCESS_HEAP_MAX: unknownsource

PROCESS_HEAP_MULT

PROCESS_HEAP_MULT: unknownsource

PROCESS_HEAP_SIZE

PROCESS_HEAP_SIZE: unknownsource

PROCESS_STACK_SIZE

PROCESS_STACK_SIZE: unknownsource

TICKS_PER_SECOND

TICKS_PER_SECOND: unknownsource

gkernel

source

Functions


change-brother

change-brother(arg0: process-tree, arg1: process-tree) => objectsource

change-parent

change-parent(arg0: process-tree, arg1: process-tree) => process-treesource

change-to-last-brother

change-to-last-brother(arg0: process-tree) => process-treesource

execute-process-tree

execute-process-tree(arg0: process-tree, arg1: function, arg2: kernel-context) => objectsource

Iterate over the process tree, running only if the mask doesn't prevent it.
Update the mask of the process-tree to have kernel-run if and only if we run at least one process.

inspect-process-heap

inspect-process-heap(obj: process) => symbolsource

Inspect each object on the process heap.

inspect-process-tree

inspect-process-tree(arg0: process-tree, arg1: int, arg2: int, arg3: symbol) => process-treesource

Print out a process tree diagram.

iterate-process-tree

iterate-process-tree(arg0: process-tree, arg1: function, arg2: kernel-context) => objectsource

Iterate over the process tree, calling the function on each process.

kernel-dispatcher

kernel-dispatcher() => objectsource

Main entry point to GOAL from C++.

kill-by-name

kill-by-name(arg0: string, arg1: process-tree) => symbolsource

Kill all processes with the given name.

kill-by-type

kill-by-type(arg0: type, arg1: process-tree) => symbolsource

Kill all processes with the given type.

kill-not-name

kill-not-name(arg0: string, arg1: process-tree) => symbolsource

Kill all processes, except for ones named this.

kill-not-type

kill-not-type(arg0: type, arg1: process-tree) => symbolsource

Kill all processes not of the given type.

load-package

load-package(arg0: string, arg1: kheap) => pairsource

Load a package by name to the given heap.

method-state

method-state(arg0: type, arg1: basic) => statesource

Get a state by name from the method table of a type.

previous-brother

previous-brother(arg0: process-tree) => objectsource

process-by-name

process-by-name(arg0: string, arg1: process-tree) => processsource

Get a process by name.

process-count

process-count(arg0: process-tree) => intsource

Count the number of processes in the given tree.

process-not-name

process-not-name(arg0: string, arg1: process-tree) => processsource

Get a process that doesn't have the given name.

remove-exit

remove-exit() => nonesource

reset-and-call

reset-and-call(obj: thread, func: function) => objectsource

Make the given thread the top thread, reset the stack, and call the function.
Sets up a return trampoline so when the function returns it will return to the
kernel context. Will NOT deactivate on return, so this is intended for temporary threads.
NOTE: this should only be done from the kernel, running on the
kernel's stack.

return-from-thread

return-from-thread() => nonesource

Context switch to the saved kernel context now.
This is intended to be jumped to with the ret instruction (return trampoline)
at the end of a normal function, so this should preserve rax.
To make sure this happens, all ops should be asm ops and we should have no
GOAL expressions.

return-from-thread-dead

return-from-thread-dead() => nonesource

Like return from thread, but we clean up our process with deactivate first.
The return register is not preserved here, instead we return the value of deactivate

run-function-in-process

run-function-in-process(obj: process, func: function, a0: object, a1: object, a2: object, a3: object, a4: object, a5: object) => objectsource

Switch to the given process and run the function. This is used to initialize a process.
The function will run until it attempts to change state. At the first attempt to change state,
this function will return. The idea is that you use this when you want to initialize a process NOW.
This will then return the value of the function you called!

search-process-tree

search-process-tree(arg0: process-tree, arg1: function) => process-treesource

Iterate process tree, returning the process that returns #t first.

set-to-run

set-to-run(thread: cpu-thread, func: function, a0: object, a1: object, a2: object, a3: object, a4: object, a5: object) => pointersource

Set the given thread to call the given function with the given arguments next time it resumes.
Only for main threads.
Once the function returns, the process deactivates.

set-to-run-bootstrap

set-to-run-bootstrap() => nonesource

This function is a clever hack.
To reset a thread to running a new function, we stash the arguments as saved registers.
These are then restored by thread-resume on the next run of the kernel.
This stub remaps these saved registers to argument registers.
It also creates a return trampoline to return-from-thread-dead, so if the main thread returns, the
process is properly cleaned up by deactivate.

stream<-process-mask

stream<-process-mask(arg0: object, arg1: process-mask) => process-masksource

sync-dispatcher

sync-dispatcher() => objectsource

Run just the listener function. Used for SQL query stuff.

throw

throw(name: symbol, value: object) => intsource

Dynamic throw.

throw-dispatch

throw-dispatch(obj: catch-frame, value: object) => nonesource

Throw the given value to the catch frame.
Only can throw a 64-bit value. The original could throw 128 bits.

unload-package

unload-package(arg0: string) => pairsource

Mark a package as unloaded.

Variables


*16k-dead-pool*

*16k-dead-pool*: dead-poolsource

*4k-dead-pool*

*4k-dead-pool*: dead-poolsource

*8k-dead-pool*

*8k-dead-pool*: dead-poolsource

*active-pool*

*active-pool*: process-treesource

*bg-pool*

*bg-pool*: process-treesource

*camera-dead-pool*

*camera-dead-pool*: dead-poolsource

*camera-master-dead-pool*

*camera-master-dead-pool*: dead-poolsource

*camera-pool*

*camera-pool*: process-treesource

*city-dead-pool*

*city-dead-pool*: dead-pool-heapsource

*dead-pool-list*

*dead-pool-list*: pairsource

*debug-dead-pool*

*debug-dead-pool*: dead-pool-heapsource

*deci-count*

*deci-count*: intsource

*default-dead-pool*

*default-dead-pool*: dead-poolsource

*default-pool*

*default-pool*: process-treesource

*display-pool*

*display-pool*: process-treesource

*dram-stack*

*dram-stack*: pointersource

*entity-pool*

*entity-pool*: process-treesource

*fake-scratchpad-data*

*fake-scratchpad-data*: pointersource

*fake-scratchpad-stack*

*fake-scratchpad-stack*: pointersource

*global-search-count*

*global-search-count*: intsource

*global-search-name*

*global-search-name*: basicsource

*irx-version*

*irx-version*: bintegersource

*kernel-boot-level*

*kernel-boot-level*: symbolsource

*kernel-boot-mode*

*kernel-boot-mode*: symbolsource

*kernel-clock*

*kernel-clock*: clocksource

*kernel-context*

*kernel-context*: kernel-contextsource

*kernel-dram-stack*

*kernel-dram-stack*: unknownsource

*kernel-packages*

*kernel-packages*: pairsource

*kernel-version*

*kernel-version*: bintegersource

*last-loado-debug-usage*

*last-loado-debug-usage*: intsource

*last-loado-global-usage*

*last-loado-global-usage*: intsource

*last-loado-length*

*last-loado-length*: intsource

*listener-process*

*listener-process*: processsource

*master-mode*

*master-mode*: symbolsource

*mid-pool*

*mid-pool*: process-treesource

*nk-dead-pool*

*nk-dead-pool*: dead-pool-heapsource

*null-kernel-context*

*null-kernel-context*: kernel-contextsource

*null-process*

*null-process*: processsource

*pause-lock*

*pause-lock*: symbolsource

*pickup-dead-pool*

*pickup-dead-pool*: dead-poolsource

*pusher-pool*

*pusher-pool*: process-treesource

*target-dead-pool*

*target-dead-pool*: dead-poolsource

*target-pool*

*target-pool*: process-treesource

*use-old-listener-print*

*use-old-listener-print*: symbolsource

*vis-boot*

*vis-boot*: symbolsource

dead-state

const dead-state: statesource

entity-deactivate-handler

const entity-deactivate-handler: functionsource

gstate

source
Expand description

Summary of state system:



A process can be put into a state, using enter-state, or the go macro.

This will set up the process to run the appropriate handler functions defined by the state.

The state handlers are:

- enter : gets run before trans on the first time the state is used. Can be #f. Must return.

- trans : gets run before code each time the code is run. Can be #f. Must return.

- code : main thread. Can suspend. If it returns, the process dies

- exit : gets run when leaving a state. must return.

- event : not sure of the details here yet.



You can use "go" to change the state of a process. This causes the process main thread execution to be abandoned.

If the main thread has exits/protects on the stack frame, they will be run first to clean up.



There are several ways to "go"

- go during init: when a process is being initialized with run-function-in-process, you can "go".

this causes the run-function-in-process to return immediately, and the next time the process is dispatched

it will go into the other state. This will automatically set the process to waiting-to-run,

and shrink the process heap, if appropriate



- go from outside the process. You can temporarily set pp to another process, and have that

process go to another state. The actual go will occur the next time the process is scheduled.

Use the go-process macro to do this.



- go from a non-main thread in the right process. You can do a go from a temporary thread, like trans or post.

If you do it from post, the go returns and the rest of the post runs. If you do it from any other thread, the temporary thread

is immediately abandonded. Like the previous two, it will defer the actual go until the next time the

process runs.



- go from the main thread of the main process. This causes the (-> pp state) to change, the stack frames

to be cleaned up, and the old state's exit to be called. It will reset the stack, then run the code.

Unlike the others, this means you "go" immediately.



The compiler has two special hooks related to states: go-hook and define-state-hook.

These take care of doing a go and a state definition and properly checking types.



The define-state-hook takes a state object and handlers and defines a global symbol

with the appropriate state type.



The go-hook calls enter state and sets (-> proc next-state) for the given process.

It type checks the arguments for the entry function.

Functions


enter-state

enter-state(arg0: object, arg1: object, arg2: object, arg3: object, arg4: object, arg5: object) => objectsource

Make the process stored in pp enter the state in pp next-state

inherit-state

inherit-state(child: state, parent: state) => statesource

Copy handler functions from parent to child

looping-code

looping-code() => symbolsource

Function which calls suspend in a loop. Can be used to create a thread that does nothing.

send-event-function

send-event-function(arg0: process-tree, arg1: event-message-block) => objectsource

Send an event block to a process.

Variables


*event-queue*

*event-queue*: event-message-block-arraysource

gstring

source

Functions


append-character-to-string

append-character-to-string(arg0: string, arg1: uint8) => intsource

Append char to the end of the given string.

cat-string<-string

cat-string<-string(arg0: string, arg1: string) => stringsource

Append b to a. No length checks

cat-string<-string_to_charp

cat-string<-string_to_charp(arg0: string, arg1: string, arg2: pointer) => pointersource

Append b to a, using chars of b up to (and including) the one pointed to by end-ptr,
or, until the end of b, whichever comes first.

catn-string<-charp

catn-string<-charp(arg0: string, arg1: pointer, arg2: int) => stringsource

Append b to a, exactly len chars

charp-basename

charp-basename(arg0: pointer) => pointersource

Like basename in C

charp-prefix=

charp-prefix=(arg0: pointer, arg1: pointer) => symbolsource

Is the first cstring a prefix of the second?

charp<-string

charp<-string(arg0: pointer, arg1: string) => intsource

Copy a GOAL string into a character array.

clear

clear(arg0: string) => stringsource

Make string empty

copy-charp<-charp

copy-charp<-charp(arg0: pointer, arg1: pointer) => pointersource

C string copy.

copy-string<-string

copy-string<-string(arg0: string, arg1: string) => stringsource

Copy data from one string to another, like strcpy

copyn-charp<-string

copyn-charp<-string(arg0: pointer, arg1: string, arg2: int) => nonesource

Copy n chars from string to character array.

copyn-string<-charp

copyn-string<-charp(arg0: string, arg1: pointer, arg2: int) => stringsource

Copy data from a charp to a GOAL string. Copies len chars, plus a null.

name=

name=(arg0: object, arg1: object) => symbolsource

Do arg0 and arg1 have the same name?
This can use either strings or symbols

string->float

string->float(arg0: string) => floatsource

They implemented it!

string->int

string->int(arg0: string) => intsource

String to int. Supports binary, hex, and decimal. Negative is implemented for decimal and hex
But I think it's broken?

string-cat-to-last-char

string-cat-to-last-char(arg0: string, arg1: string, arg2: uint) => pointersource

Append append-str to the end of base-str, up to the last occurance of char in append-str

string-charp=

string-charp=(arg0: string, arg1: pointer) => symbolsource

Is the data in str equal to the C string charp?

string-get-arg!!

string-get-arg!!(arg0: string, arg1: string) => symbolsource

Get the first argument from a whitespace separated list of arguments.
The arguments can be in quotes or not.
Removes argument from arg string, sucks up white space before the next one
Outputs argument to a-str.

string-get-flag!!

string-get-flag!!(arg0: pointer, arg1: string, arg2: string, arg3: string) => symbolsource

Get a flag argument (either arg2 or arg3) from a list of arugments.

string-get-float!!

string-get-float!!(arg0: pointer, arg1: string) => symbolsource

Get a float from a list of arguments.

string-get-int32!!

string-get-int32!!(arg0: pointer, arg1: string) => symbolsource

Get an int32 from a list of arguments

string-position

string-position(arg0: string, arg1: string) => intsource

Find the position of the first string in the second.

string-prefix=

string-prefix=(arg0: string, arg1: string) => symbolsource

Is the first string a prefix of the second? (string-prefix= 'foo' 'foobar') = #t

string-skip-to-char

string-skip-to-char(arg0: pointer, arg1: uint) => pointersource

Return pointer to first instance of char in C string, or to the null terminator if none

string-skip-whitespace

string-skip-whitespace(arg0: pointer) => pointersource

Skip over spaces, tabs, r's and n's

string-strip-leading-whitespace!

string-strip-leading-whitespace!(arg0: string) => symbolsource

Remove whitespace at the front of a string

string-strip-trailing-whitespace!

string-strip-trailing-whitespace!(arg0: string) => symbolsource

Remove whitespace at the end of a string

string-strip-whitespace!

string-strip-whitespace!(arg0: string) => symbolsource

Remove whitespace at the beginning and end of a string

string-suck-up!

string-suck-up!(arg0: string, arg1: pointer) => symbolsource

Remove character between the start of string and location.
The char pointed to by location is now the first.

string-suffix=

string-suffix=(arg0: string, arg1: string) => symbolsource

Is the second string a suffix of the first?

string-upcase

string-upcase(arg0: string, arg1: string) => nonesource

Uppercase the given string.

string<-charp

string<-charp(arg0: string, arg1: pointer) => stringsource

Copy all chars from a char* to a GOAL string.
Does NO length checking.

string<=?

string<=?(arg0: string, arg1: string) => symbolsource

string<?

string<?(arg0: string, arg1: string) => symbolsource

In dictionary order, is a < b?

string=

string=(arg0: string, arg1: string) => symbolsource

Does str-a hold the same data as str-b?.
If either string is null, returns #f.

string>=?

string>=?(arg0: string, arg1: string) => symbolsource

string>?

string>?(arg0: string, arg1: string) => symbolsource

In dictionary order, is a > b?

Variables


*debug-draw-pauseable*

*debug-draw-pauseable*: symbolsource

*stdcon*

*stdcon*: stringsource

*stdcon0*

*stdcon0*: stringsource

*stdcon1*

*stdcon1*: stringsource

*string-tmp-str*

*string-tmp-str*: stringsource

*temp-string*

*temp-string*: stringsource