The API is not unified because some platforms (notably, Windows) do
not allow for unification of the various types. There were problems
with doing a select() type of operation on files, iirc (tho you could
with pipes and sockets). For basic read/write, unification is no
problem. I don't think you can unify the creation, and certainly not
the type-specific APIs.

Having N entry points version N enum variatns is no big deal. I would
prefer the N functions instead of a parameterized function. Note that
you cannot open "stdout" on Windows unless you use the special
function.

readv makes sense, as it is easy to simulate if the platform does not have it.

Cheers,
-g

On 6/25/06, david reid <[EMAIL PROTECTED]> wrote:
I've done some work over last 24 hours and have an outline of
abstracting the io functions. The aim is to remove the distinction
between files, socket and pipes - replacing them with a single apr_io_t
type. The exercise of figure out how it should work certainly opened my
eyes to how complex we've made the whole thing!

I've simply added the new code at present, but in order to gain much
we'd need to ditch the older code, hence it's really a change for 2.x
and beyond.

So far I have basic creation and closing working, but now the
architecture is in place getting read/write working shouldn't be hard.
There's also a small test app to make sure it's all working as expected.

Providing the same level of access we have at present isn't as easy as
it looks, and finding a simple api that covers everything may well be
impossible, but I'm hopeful we can cover most things under a nice simple
api. Exactly how much the perf will be hurt by the changes - I'm not
sure at present but may know once I have read/write working.

A few things have cropped up though that I'm not really sure about.

Why don't we have readv?
Why don't we just have a "flagged" version of the functions to open
stdxxx? Having both seems a touch silly and dramatic overkill.

Unless people scream about this not being the right direction to go I'll
try and find some time to progress the work a little more over the next
few days.

david



--
Greg Stein, http://www.lyra.org/

Reply via email to