>>It would be interesting to know of contraints which would not allow you to open the file in A()
the reason is ,
The call to B() in A() , is not a normal function call as in I don't insert call it explicitly. But I am modifying the interemediate code of the compiled program and inserting a call instruction [ which is a call to B() ]
the process is something like this
A() is in file fileA.c , and B() is in fileB.c
intially in A() there is no call to B() ,
while compiling fileA.c , the compiler inserts a call to B().
and later I link both the compiled object files. B() is basically a logging function , which I may decide to change to do nothing , so i want everything to do with file pointers to be done in B() itself, otherwise there will be filepointer related junk on A() which may be totally unnecessary.
Hope I confused you enough :)
-------
am leaving this question open for a few days , to see if ppl have other techniques .
Thanks,
abhijit
Main Topics
Browse All Topics





by: sunnycoderPosted on 2005-04-08 at 01:09:54ID: 13734031
Hi avizit,
Way 2 is the way to go.
Other options would be to use global variables which is not a good idea ...
It would be interesting to know of contraints which would not allow you to open the file in A()
Cheers!
sunnycoder