Calling C code in a JavaScript HTTP script

Is it possible to call C functions in a JavaScript HTTP script?  Something similar to "Evaluate C" step in TruClient.  This is for LRE 2023R1.

Parents
  • Suggested Answer

    0  

    Hi Antonio,

    For any HTTP script, you can either generate the steps in C or Javascript as the language but cannot use the functions interchangeably within same script. Compiler can only recognize 1 language at a time based on how code is generated. However programatically, there may be ways to call c-functions from with Javascript using some wrappers. If that works in any external JS compiler, it should work in VuGen too

    Hope this answers your question. If anything specific around this, suggest to pls open a support incident with OT support and provide the sample script folder showing what you intend to do. We'd be glad to look into it further

    Thanks,

    OT Support

Reply
  • Suggested Answer

    0  

    Hi Antonio,

    For any HTTP script, you can either generate the steps in C or Javascript as the language but cannot use the functions interchangeably within same script. Compiler can only recognize 1 language at a time based on how code is generated. However programatically, there may be ways to call c-functions from with Javascript using some wrappers. If that works in any external JS compiler, it should work in VuGen too

    Hope this answers your question. If anything specific around this, suggest to pls open a support incident with OT support and provide the sample script folder showing what you intend to do. We'd be glad to look into it further

    Thanks,

    OT Support

Children
  • 0 in reply to   

      I agree with your point that you cannot use the functions from different languages interchangeably.

    My question (which I should have phrased better) was geared towards wrappers that already exist in Vugen. For example, web_js_run that allows you to run JavaScript in HTTP C scripts, or the “Evaluate C function” that runs C in JavaScript TruClient scripts.

    I was looking for something similar to the TruClient “Evaluate C function” but for JS HTTP scripts.  My intention was to use C language LRD (Database Vuser functions) to process runtime data.  I would normally use VTS, but in this case I need the additional flexibility and power of SQL.