I have 2 linux c++ .cpp scripts that can be run as line commands with parameters and save result as text files. Each script references its own /lib folder. I need the c++ scripts rewritten to be called by external apps written in php, flash, java that pass parameters to the script and retrieve the results back.
The 1st c++ script loads a database file into RAM and processes a given file against that database. Then the result is saved in a text file and the RAM is released. The same routine occurs every time the line command is run. Now I want the c++ script to be called externally and it would load the database in RAM permanently. Then the c++ script is called repeatedly to process multiple files at anytime against the database already in RAM. The result is passed back to the calling routine. The RAM is not released until the script reloads an updated database into RAM.
The 2nd c++ script runs as a line command that processes files to create a database file. I want that the script can be called by php, java, flash.
You will only have access to 2 linux .cpp files but not to the functions or routines that they call or include. I need sample code for the calling routines in php java flash to show it works.
I want a fast executing solution that does not cause memory or other orphan process problems. There are many solutions for this. I seek expert in c++ and linux administration on CENTOS 4.5. Please propose your solution in detail in PMB. Do not use php exec(), system(), similar methods are not accepted.