I have two processes. One is running in a sandbox (Process1), the other is modifying files and so not running in a sandbox (Process2).
The Process2 has an API to call a function:
string jsonString[MAX_JSON_LEN] IN ///< JsonString which is passed to the handler.
FileSelector fileToWrite IN, ///< select file to read from.
handler LineHandler ///< handler which gets called after a new line is read.
The implemented readLineWithHandler-Function in Process2 looks more or less like this:
void fileHandler_readLineWithHandler(fileHandler_FileSelector_t fileselector, fileHandler_LineHandlerFunc_t handlerPtr, void* contextPtr)
while( (read = getline(&line, &len, fp)) != -1 )
handlerPtr(line, NULL); //CALL PASSED FUNCTION FOR EVERY LINE WHICH IS READ.
The passed Function from Process1 has the following signature:
static void jsonParser(const char* line, void* contextPtr);
And i pass it from Process1 like this:
fileHandler_readLineWithHandler(FILEHANDLER_CONFIGFILE, &jsonParser, NULL);
But I am not able to get any callbacks. How could this be done?