I used to do this to get a program of an external class in c:
... push_text("Someclass"); SAFE_APPLY_MASTER("resolv", 1);
if (((struct svalue *)(Pike_sp - 1))->type != PIKE_T_PROGRAM) { Pike_error("Could not resolv program Someclass.\n"); } prog = ((struct svalue *)(Pike_sp - 1))->u.program;
The reason you run into a problem is probably that the program you attempt to resolve uses the parent pointer, so you get a T_FUNCTION rather than a T_PROGRAM. For what purpose do you need the program pointer? For some purposes, program.c:program_from_svalue() may return something you can use. You may also want to have a look at object.c:parent_clone_object().
arne