Skip to content

The Exported Functions Cavalcade

Jason Scott edited this page Feb 18, 2014 · 1 revision

This is a silly document where Jason just tries to whip up initial discussion of how you split out awesome functions being called in JSMESS such that a system could do "stuff" there. For example, turning on and off performance monitoring, or knowing when a disk drive is written to.

Here's what Jason found out on his own, like a dog sniffing candy wrappers.

IN THE MAKEFILE

There's an entry called EMCC_FLAGS += -s EXPORTED_FUNCTIONS= which allows you to declare functions to be exported and interacted with. For example:

EMCC_FLAGS += -s EXPORTED_FUNCTIONS="['_main', '_malloc',
'__Z14js_get_machinev', '__Z9js_get_uiv',
'__ZN10ui_manager12set_show_fpsEb', '__ZNK10ui_manager8show_fpsEv']"

In ./templates/default/post.js

There are mappings to be used by the javascript final.

In the Index.html file for the build directory.

There's a good place to shove the thing.