library/src/javascript/BP-Javascript.cc
// Lookup global javascript runtime and return it as a pointer.  Searches
// the GHT.
Lookup global javascript runtime and return it as a pointer.  Searches
the GHT.
Lookup global javascript runtime and return it as a pointer . Searches the GHT .
JSRuntime * BP_JSLookupGlobalRuntime()
{
	JS_VALIDATE_WORKING_ENVIRONMENT(NULL);
	size_t runtime_exists = 0;
	char * table_path_actual[10] = {0};
	BP_HASH_TABLE_TRAVERSAL_PATH table_path = (char **) &table_path_actual;
	table_path[0] = "system";
	table_path[1] = "javascript";
	table_path[2] = "runtime";
	table_path[3] = NULL;
	P_BP_HASH_TABLE_KEYED_ENTRY runtime_entry = BP_HashRegLookupTableEntryByPath(NULL, table_path);
	if(!runtime_entry)
		return NULL;
	if(!runtime_entry->data)
		return NULL;
	JSRuntime * runtime = (JSRuntime *) runtime_entry->data;
	return runtime;
}
JSRuntime * BP_JSLookupGlobalRuntime ( ) { JS_VALIDATE_WORKING_ENVIRONMENT ( NULL ) ; size_t runtime_exists = 0 ; char * table_path_actual [ 10 ] = { 0 } ; BP_HASH_TABLE_TRAVERSAL_PATH table_path = ( char * * ) & table_path_actual ; table_path [ 0 ] = " " ; table_path [ 1 ] = " " ; table_path [ 2 ] = " " ; table_path [ 3 ] = NULL ; P_BP_HASH_TABLE_KEYED_ENTRY runtime_entry = BP_HashRegLookupTableEntryByPath ( NULL , table_path ) ; if ( ! runtime_entry ) return NULL ; if ( ! runtime_entry -> data ) return NULL ; JSRuntime * runtime = ( JSRuntime * ) runtime_entry -> data ; return runtime ; }
Lookup global javascript runtime and return it as a pointer.
Lookup global javascript runtime and return it as a pointer .
// validate we have a working environment // Simple flag to indicate via logic below whether or not the runtime // exists already. // create a table path on the stack for ease of use // reference to the local stack // set path to /system/javascript // attempt to lookup the runtime in the GHT // ensure we could fetch the entry // ensure that the entry has data // set the runtime from the data pointer of the lookup // return indicating success