Refactored working with external prototypes.
Previously, njs_vm_external_prototype() returned the pointer to a
created prototype structure. Which were expected to be passed to
njs_vm_external_create() as is. The returned pointer is needed to be
stored somewhere by user code which complicates user code in cases when
many prototypes are created.
Instead, an index in the VM internal table is returned.
njs_vm_external_create() is changed accordingly. This simplifies
user code because the index is known at static time for most cases.
12 files changed