Changing function transfer addresses

root at MCIRPS2.MED.NYU.EDU root at MCIRPS2.MED.NYU.EDU
Sat May 5 03:02:50 AEST 1990


I want to do somthing like the following in ''c''

I want to make an array of function calls, and assign the
function call addresses into the array, and then pick the
function to be executed by the value in i.

The particular application is using pup functions. Depending on the
context of the function call, I want to change the pup function
address.

The compiler does not let me do anything like this, but this
is theme of what I would like. What am I doing wrong, or what
should I do?? (This is meta code--- I know it does not work)

======
register i;
long MyPup;
void (*function)[i](); /* an array of function call address pointers */

void function1(); /* static function calls */
void function2();
void function3();

*function[0]=*function1(); /* put in function the transfer addresses of
function[1]=*function2();     each of the static functions */
function[2]=*function3();

MyPup=defpup();
addtopup(MyPup,"What happens here ?? %f",function[i]);

=======
--
+-----------------------------------------------------------------------------+
| karron at nyu.edu                          Dan Karron                          |
| . . . . . . . . . . . . . .             New York University Medical Center  |
| 560 First Avenue           \ \    Pager <1> (212) 397 9330                  |
| New York, New York 10016    \**\        <2> 10896   <3> <your-number-here>  |
| (212) 340 5210               \**\__________________________________________ |
+-----------------------------------------------------------------------------+



More information about the Comp.sys.sgi mailing list