Good!
So, to remove plibc form code we need:
* implement simplified errnoFromLastErr()
* add _win_recv, _win_send, _win_accept, _win_socket, _win_setsockopt,
_win_bind and _win_listen to MHD.
And all of them will be
{
_type ret = func();
errnoFromLastErr();
return ret;
}
For compilers with inline support they can be inlined.
* add simplified implementation of _win_socketpair(). I'd name it MHD_pipe and
remove #ifdef from code.
* add very simplified implementation of _win_strerror(): it must process only
winsock specific errors and call host strerror() for rest of errors.
* add native Win32 parts to memorypool.c
Is implementation of select() really required? Isn't simple wrapper enough?
I created public repo to work on this task:
https://github.com/Karlson2k/libmicrohttpd/ (branch
https://github.com/Karlson2k/libmicrohttpd/tree/remove_plibc)
LRN and grothoff have write access to this repo.
We can start by removing not used already functions/wrappers.
Evgeny
26.01.2014, 04:21, "LRN" <[email protected]>:
> Going back to the list of imports:
> Wrappers that ARE needed (require errno conversion):
> _win_recv
> _win_send
> _win_accept
> _win_socket
>
> Wrappers that are NOT needed, but are good to have for error reporting
> (again, they do errno conversion):
> _win_setsockopt
> _win_bind
> _win_listen
>
> Implementations (may or may not be simplified, depends on the case):
> _win_mmap
> _win_munmap
> _win_select
> _win_socketpair
> _win_strerror
>
> Wrappers that are not needed:
> _win_close - define CLOSE(s) closesocket(s)
> _win_shutdown - define SHUTDOWN(s) shutdown(s)
> _win_write - wrapper
>
> Utility functions that are likely not needed:
> _SetErrnoFromWinError - client and wrapper/implementation code will be
> synchronized with regards to error handling (i.e. the function will
> only convert the errors that the caller checks for), so this generic
> function is only needed for error reporting (and having actual W32
> error codes is usually better for that purpose anyway).
> plibc_init - they mostly do unneeded stuff, however WS2 startup
> plibc_shutdown - and cleanup functions may need to be called in MHD.
>
> Implementations that are not needed (already in MHD):
> _win_tdelete
> _win_tfind
> _win_tsearch