At 11:11 AM 4/26/2003, Ben Laurie wrote: >William A. Rowe, Jr. wrote: > >> I'm attempting to come up with some more clever tracing semantics. >> One thing I would like out of the user's foo_hook_method() invocation >> is the stringized 'name' of their hook entry point. Seems I hit a wall. >> >> Right now, apr_hooks uses the global 'apr_hook_debug_current' >> pointer to track which module is registering hooks. Mostly painless >> for the usual cases, since Apache sets up that pointer as it invokes >> a module's register_hooks() entry point. But if a hook is registered >> outside of that function, whoa boy. > >Why does thuis happen?
Well, it shouldn't on Apache. But hooks shouldn't be tied to Apache :-) Besides, you know that foo registered the bar hook, but you don't know the callback function name, which may be more useful. >> #define APR_IMPLEMENT_HOOK_TRACE_PROTO(ns,name) \ >> #define ns##_hook_##name(pf, aszPre, aszSucc, nOrder) \ >> (ns##_hook_##name)(pf, aszPre, aszSucc, nOrder, #pf) > >Surely you can't do this??? No, but Mladen pointed out some tricks I will try ;-) Bill