httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "William A. Rowe, Jr." <>
Subject RE: ap_file_t typedef (was: cvs commit: apache-2.0/src/lib/apr/includeapr_file_io.h)
Date Mon, 03 Apr 2000 20:30:12 GMT
> From: []On Behalf Of
> Sent: Monday, April 03, 2000 2:42 PM
> > I only raised it early for discussion... I would anticipate
> > it it's apr_general.h declaration to look like:
> >
> > typedef ap_status_t APR_THREAD_FUNC ap_cleanup_fn_t(void *);
> >
> > ergo it's use is ap_somefunc (ap_cleanup_fn_t *cleanup);
> I would like to understand what the ap_cleanup_fn_t typedef
> would be used
> for.  The fact that APR_THREAD_FUNC is in the typedef causes
> me a bit of
> concern.

It replaces declarations like this;

ap_status_t ap_set_userdata(void *data, char *key,
                            ap_status_t (*cleanup) (void *),
                            ap_context_t *cont);


ap_status_t ap_set_userdata(void *data, char *key,
                            ap_cleanup_fn_t *cleanup,
                            ap_context_t *cont);

And it's ABSOLUTELY CRITICAL on the windows platform that the
callback function model matches the callback pointer declaration.
This isn't the only place in Apache we use this convention.

Under non-Win32, the noop is declared:


Under Win32, depending on how Win32 is built, it looks like:

#define APR_THREAD_FUNC _stdcall

under another build, it might read

#define APR_THREAD_FUNC _cdecl

But the model must match for both the APR build and the client build.

There are tradeoffs to the two models, and I'm not making the arguement for
either, just for the consistency that this structure imposes.

View raw message