16.01.2013 2:38, Max Kellermann пишет:
> Hm, ok, I think wrapping everything in our own functions is not
> exactly the most beautiful solution, but will do.  (It creates a third
> character set: UTF-8 for data/protocol strings, internal FS charset,
> external FS charset)

Well I was thinking this way: external FS charset is really not 
important for the most of the code. Let's consider this some 
implementation detail for ustdio.cxx and Win32Util.cxx
The rest of the code could assume that FS charset is UTF-8.

> Though I believe your change in server_socket.c is wrong.  The
> "narrow" path is used in s_un.sun_path, but you delete the "wide" path
> name in the u_unlink() call.  Anyway, that part of the MPD code isn't
> portable to Windows.

You're right. I've started with changing all the functions to their u_ 
counterparts. Then reverted some changes for the files that are not to 
be compiled on Windows in a whole (such a daemonizing support code).

There are corner cases like in server_socket: some functions are to be 
compiled on Windows but some are not. Do we need to use wrapper in 
functions that are "ifndef WIN32" ? If some day such function will 
became compilable on Windows somebody might easily forget to add the 
prefix. This would introduce the bug.

> What's your plan for path names that are passed to other libraries?
> Will MPD work for some codecs, but not for others?  Known
> bug/limitation?

There is a workaround in decoder_plugin/archive_plugin.
If library is going to use file name directly (for example 
decoder_plugin_file_decode) it's converted to what is expected by real 
open()/fopen()/etc.

This does not degrade our support for opening such files,
but decoders without support for arbitrary IO functions will stick to he 
currently supported file names.

There is a possible improvement for this (not yet implemented):

Some libraries can accept file descriptor or FILE*.
So we can pre-open such files for them using our u_ wrappers.
This requires some thinking how to avoid adding many new methods for 
decoders (i.e. decoder_plugin_fd_decode, decoder_plugin_FILE_decode).

-- 
Denis

------------------------------------------------------------------------------
Master SQL Server Development, Administration, T-SQL, SSAS, SSIS, SSRS
and more. Get SQL Server skills now (including 2012) with LearnDevNow -
200+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
SALE $99.99 this month only - learn more at:
http://p.sf.net/sfu/learnmore_122512
_______________________________________________
Musicpd-dev-team mailing list
Musicpd-dev-team@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/musicpd-dev-team

Reply via email to