ZOO-Project
|
#include "service.h"
#include "service_internal.h"
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include "ulinet.h"
Go to the source code of this file.
Functions | |
char * | JSValToChar (JSContext *, jsval *) |
Convert a JavaScript value to a char*. More... | |
JSObject * | JSObject_FromMaps (JSContext *, maps *) |
Convert a maps to a JavaScript Object. More... | |
JSObject * | JSObject_FromMap (JSContext *, map *) |
Convert a map to a JavaScript Object. More... | |
maps * | mapsFromJSObject (JSContext *, jsval) |
Convert a JavaScript Object to a maps. More... | |
map * | mapFromJSObject (JSContext *, jsval) |
Convert a JavaScript Object to a map. More... | |
JSBool | JSTranslate (JSContext *, uintN, jsval *) |
The function used as ZOOTranslate from the JavaScript environment. More... | |
JSBool | JSRequest (JSContext *, uintN, jsval *) |
The function used as ZOORequest from the JavaScript environment (ZOO-API) More... | |
JSBool | JSUpdateStatus (JSContext *, uintN, jsval *) |
The function used as ZOOUpdateStatus from the JavaScript environment (ZOO-API). More... | |
JSBool | JSSleep (JSContext *, uintN, jsval *) |
The function used as sleep from the JavaScript environment (ZOO-API). More... | |
void | reportError (JSContext *cx, const char *message, JSErrorReport *report) |
Print debug information messages on stderr. More... | |
int | zoo_js_support (maps **, map *, service *, maps **, maps **) |
Load a JavaScript file then run the function corresponding to the service by passing the conf, inputs and outputs parameters by value as JavaScript Objects. More... | |
JSObject * | loadZooApiFile (JSContext *, JSObject *, char *) |
Load a JavaScript file. More... | |
JSObject* JSObject_FromMap | ( | JSContext * | cx, |
map * | t | ||
) |
Convert a map to a JavaScript Object.
cx | the JavaScript context |
t | the map to convert |
JSObject* JSObject_FromMaps | ( | JSContext * | cx, |
maps * | t | ||
) |
Convert a maps to a JavaScript Object.
cx | the JavaScript context |
t | the maps to convert |
JSBool JSRequest | ( | JSContext * | cx, |
uintN | argc, | ||
jsval * | argv1 | ||
) |
The function used as ZOORequest from the JavaScript environment (ZOO-API)
cx | the JavaScript context |
argc | the number of parameters |
argv1 | the parameter values |
JSBool JSSleep | ( | JSContext * | cx, |
uintN | argc, | ||
jsval * | argv1 | ||
) |
The function used as sleep from the JavaScript environment (ZOO-API).
cx | the JavaScript context |
argc | the number of parameters |
argv1 | the parameter values |
JSBool JSTranslate | ( | JSContext * | cx, |
uintN | argc, | ||
jsval * | argv1 | ||
) |
The function used as ZOOTranslate from the JavaScript environment.
Use the ZOO-Services messages translation function from the Python environment (ZOO-API)
cx | the JavaScript context |
argc | the number of parameters |
argv1 | the parameter values |
JSBool JSUpdateStatus | ( | JSContext * | cx, |
uintN | argc, | ||
jsval * | argv1 | ||
) |
The function used as ZOOUpdateStatus from the JavaScript environment (ZOO-API).
cx | the JavaScript context |
argc | the number of parameters |
argv1 | the parameter values |
char* JSValToChar | ( | JSContext * | context, |
jsval * | arg | ||
) |
Convert a JavaScript value to a char*.
context | the JavaScript context |
arg | the JavaScript value |
JSObject* loadZooApiFile | ( | JSContext * | cx, |
JSObject * | global, | ||
char * | filename | ||
) |
Load a JavaScript file.
cx | the JavaScript context |
global | the global JavaScript object (not used) |
filename | the file name to load |
map* mapFromJSObject | ( | JSContext * | cx, |
jsval | t | ||
) |
Convert a JavaScript Object to a map.
cx | the JavaScript context |
t | the JavaScript Object to convert |
maps* mapsFromJSObject | ( | JSContext * | cx, |
jsval | t | ||
) |
Convert a JavaScript Object to a maps.
cx | the JavaScript context |
t | the JavaScript Object to convert |
void reportError | ( | JSContext * | cx, |
const char * | message, | ||
JSErrorReport * | report | ||
) |
Print debug information messages on stderr.
cx | the JavaScript context |
message | the error message |
report | the JavaScript Error Report |
int zoo_js_support | ( | maps ** | main_conf, |
map * | request, | ||
service * | s, | ||
maps ** | inputs, | ||
maps ** | outputs | ||
) |
Load a JavaScript file then run the function corresponding to the service by passing the conf, inputs and outputs parameters by value as JavaScript Objects.
main_conf | the conf maps containing the main.cfg settings |
request | the map containing the HTTP request |
s | the service structure |
inputs | the maps containing the inputs |
outputs | the maps containing the outputs |
Add private context object
Load the first part of the ZOO-API
Extract result
Extract outputs when available.
Extract conf when available.