httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@apache.org
Subject Re: [PATCH] let ap_open() work on Win9x
Date Mon, 20 Mar 2000 15:44:45 GMT

> follow-on issues...
> 
> . define ap_get_oslevel() in a header file 
>   (lib/apr/include/apr_general.h?)

My impression, is that this hasn't been decided yet.  I am still waiting
for a good reason to expose this to external programs.  I really believe
this should be an internal APR function.  If you externalize this, you are
basically telling people code like the following is good.

ap_get_os_level(c, &level);
if (level == APR_WIN_NT) {
    ...
} else if (level == APR_WIN98) {
    ...
}

This is checking for functionality based on platform and version of that
platform.  I consider this a bad idea.  We are forced to do this on
Windows, because this is how Windows does things.  But, this is the exact
coding style that APR was supposed to help us get away from.  I find it
much cleaner to do:

if (ap_function != APR_ENOTIMPL) { /*platform doesn't support this func*/
  ...
} else if (ap_other_func != APR_ENOTIMPLE) {
  ...
}

This is choosing run-time options based on what the platform can do, not
which platform it is.  IMHO, this almost always creates more portable,
more easily understandably code.

I am -1 on this change, until somebody convinces me this is a good idea.




> . perhaps change ap_get_oslevel() so you can ask does this have NT 
>   functionality or not?  Win32's GetVersionEx() lets us ask the right 
>   question without getting into the details of which release; we
>   don't want to end up with various code that has to be changed when
>   Microsoft updates Win2K or Win98

I don't understand what you want to do to ap_get_oslevel.  Perhaps if you
could explain the new prototype and the what it allows us to do.

Ryan

_______________________________________________________________________________
Ryan Bloom                        	rbb@apache.org
406 29th St.
San Francisco, CA 94131
-------------------------------------------------------------------------------




Mime
View raw message