Record your work

glaurung proto

Show or set a function prototype.

writes files or project state 2 worked examples

use it for

Prototypes are keyed by function name. --check-arity warns when the parameters do not match the recovered call shape.

Run glaurung proto --help on your installed version before putting the command in a script. Glaurung is still pre-1.0.

input
A project, function name, return type, and zero or more name:type parameters.
output
A function prototype stored by name with provenance.
mode
writes state. Setting a prototype updates the project.

command shape

syntax

short form
$ glaurung proto PROJECT NAME [RETURN_TYPE] [NAME:TYPE ...]

The installed parser is authoritative: glaurung proto --help

before the examples

project setup

The examples use the checked-in hello-c-clang-debug fixture and a project named hello.glaurung.

$ glaurung kickoff samples/binaries/platforms/linux/amd64/export/native/clang/debug/hello-c-clang-debug --db hello.glaurung

run it

examples

Type print_sum

The fixture calls print_sum with one integer value.

run

from the engine checkout
$ glaurung proto hello.glaurung print_sum void total:int --check-arity --binary samples/binaries/platforms/linux/amd64/export/native/clang/debug/hello-c-clang-debug

output

captured result captured 2026-08-31
void print_sum(int total)  [manual]

captured 2026-08-31.

Read the result: The arity check catches a prototype that decompile would otherwise ignore without a visible error.

Read the current prototype

Omit the return type and parameters for a read-only lookup.

run

from the engine checkout
$ glaurung proto hello.glaurung print_sum

output

captured result captured from a fresh kickoff project, 2026-08-31
(no prototype for print_sum)

captured from a fresh kickoff project, 2026-08-31.

Read the result: The function name exists, but kickoff did not infer a prototype for it. The preceding example records one only after checking the call shape.

used above

important options

--variadic
Mark the function as variadic.
--check-arity
Compare parameter count with recovered call shape.
--binary PATH
Supply bytes for the arity check.
--by SOURCE
Record where the prototype came from.

These are the flags used by the examples. Run glaurung proto --help for the complete parser help.

before you rely on it

checks

keep working

related commands

← all 40 commands