Skip to content

Instantly share code, notes, and snippets.

@adriweb
adriweb / hook_manager.md
Last active February 23, 2020 13:59 — forked from commandblockguy/hook_manager.txt
Random incomprehensible scrawlings about hook manager spec

@commandblockguy's currently unnamed CE hook manager:

Hook system components:

  • Executors - Each TI-OS hook has an associated entry point responsible for calling all user hooks for that type.
  • Arrays - A null-terminated array of pointers to user hooks for a particular hook subtype, sorted by priority. The array is read by the hook executor each time it is called, and is completely overwritten by the hook manager every time a change is necessary.
  • Manager - A library that is responsible for installing the hook executors and maintaining the hook arrays. The hook manager is only called when installing, changing, or viewing metadata of user hooks.
  • Database - Internal data storage for the hook manager than consists of a list of hooks and their metadata.

User hooks principles:

  • User hooks are like OS hooks, but are called by the hook executor rather than TI-OS.