jsproc.h
Last updated: 17-Sep-2025
Go to the documentation of this file.
1Â // -*- Mode: C++; -*- 2Â #ifndef JSPROC_H_20150609 3Â #define JSPROC_H_20150609 4Â 7Â #include <string> 8Â #include <vector> 9Â #include <map> 10Â 11Â #if defined _WIN32 && defined VFI_JSPROC_SHARED_EXPORT 12Â # define DllSpec __declspec(dllexport) 13Â #elif defined __GNUC__ && defined VFI_JSPROC_SHARED_EXPORT 14Â # define DllSpec __attribute__((visibility ("default"))) 15Â #else 16Â # define DllSpec 17Â #endif 18Â 19Â namespace vfihtml { class ExtContext; } 20Â 21Â #ifndef DOXYGEN 22Â namespace js { 23Â #endif 24Â 34Â DllSpec bool jsProcessor(void *data, 35Â const std::string &sourcecode, 36Â std::map<std::string,std::string> &arg, 37Â std::string &out, 38Â std::string &err, 39Â std::string &exitcode); 40Â 51Â DllSpec bool jsProcessorExt(void *data, 52Â const std::string &sourcecode, 53Â std::map<std::string,std::string> &arg, 54Â std::string &out, 55Â std::string &err, 56Â std::string &exitcode, 57Â vfihtml::ExtContext *context); 58Â 60Â DllSpec const char *jsProcVersion(); 61Â 62Â 66Â DllSpec void jsSetHttpProxy(const char *proxy); 67Â 71Â DllSpec const char *jsGetHttpProxy(); 72Â 85Â DllSpec void jsSetConsole( void (*cb)(void *data, const char *text), void *data); 86Â 91Â DllSpec void jsGetConsole( void (*&cb)(void *, const char *), void *&data); 92Â 110Â DllSpec void jsSetNotify( int (*cb)(void *data, 111Â const char *to, 112Â const char *notification_id, 113Â const char *json_param, 114Â unsigned flags, 115Â const char *from), void *data); 116Â 121Â DllSpec void jsGetNotify( int (*&cb)(void *data, 122Â const char *to, 123Â const char *notification_id, 124Â const char *json_param, 125Â unsigned flags, 126Â const char *from), void *&data); 127Â 148Â DllSpec void jsSetNotifyAndWait( int (*cb)(void *data, 149Â const char *to, 150Â const char *notification_id, 151Â const char *json_param, 152Â unsigned flags, 153Â const char *from, 154Â const char *wait_id, 155Â std::string &result, 156Â int timeout_msec), void *data); 157Â 162Â DllSpec void jsGetNotifyAndWait( int (*&cb)(void *data, 163Â const char *to, 164Â const char *notification_id, 165Â const char *json_param, 166Â unsigned flags, 167Â const char *from, 168Â const char *wait_id, 169Â std::string &result, 170Â int timeout_msec), void *&data); 171Â 173Â enum JSTraceType { 174Â JST_HTTPGET, 175Â JST_HTTPPOST, 176Â JST_HTTPRESULT 177Â }; 178Â 193Â DllSpec void jsSetTrace( void (*cb)(void *data, 194Â JSTraceType type, 195Â const std::string &app_id, 196Â std::map<std::string,std::string> &trace), void *data); 197Â 202Â DllSpec void jsGetTrace( void (*&cb)(void *data, 203Â JSTraceType type, 204Â const std::string &app_id, 205Â std::map<std::string,std::string> &trace), void *&data); 206Â 207Â 208Â enum JSLogLevel { 209Â JSL_EMERGENCY=0, 210Â JSL_ALERT=1, 211Â JSL_CRITICAL=2, 212Â JSL_ERROR=3, 213Â JSL_WARNING=4, 214Â JSL_NOTICE=5, 215Â JSL_INFO=6, 216Â JSL_DEBUG=7 217Â }; 218Â 233Â DllSpec void jsSetLog( void (*cb)(void *data, 234Â const std::string &app_id, 235Â JSLogLevel log_level, 236Â const std::vector<std::string> &msg), void *data); 237Â 242Â DllSpec void jsGetLog( void (*&cb)(void *data, 243Â const std::string &app_id, 244Â JSLogLevel log_level, 245Â const std::vector<std::string> &msg), void *&data); 246Â 247Â #ifndef DOXYGEN 248Â } // namespace 249Â #endif 250Â 251Â #undef DllSpec 252Â 253Â #endif
Rate this article: