It sounds like you're building some kind of replication mechanism. Node A performs actions 1 through N, and then you want to replicate those same actions on Node B.
There are lots of options here, but they all fall into two categories:
Option 1: Write the log file in a format that can be consumed by an existing utility. If you were using JavaScript, or some other language that has an "eval" function, then this would be really easy. You'd just write JavaScript to the log file on Node A, then "eval" it from Node B.
The sample log you provided reflects this approach, although it will be a little more complicated for you because C doesn't have an "eval" function. Basically you'll have to ship your log file from Node A to B, compile it and link it with libraries or other C modules that implement the functions used by the C log, then run the resulting program. You can turn the log file into a complete C source file by including it in a template like this:
int main(int argc, char *argv[]) {
// Do your setup stuff here.
#include "/path/to/the/log/file"
// Clean up.
return 0
}
Option 2. Create a parser that parses and executes the log within the context of some other program.
In this case, since your log statements look like C, you'll essentially be writing a C interpreter.