New API call for path conversion
Václav Haisman
v.haisman@sh.cvut.cz
Sat Feb 23 17:51:00 GMT 2008
Corinna Vinschen wrote, On 22.2.2008 13:19:
> Hi,
[...]
> Therefore, as a first cut, I'd propose something along the lines of:
>
> typedef enum
> {
> CCP_WIN_A_TO_POSIX, /* from is char*, to is char* */
> CCP_WIN_W_TO_POSIX, /* from is wchar_t*, to is char* */
> CCP_POSIX_TO_WIN_A, /* from is char*, to is char* */
> CCP_POSIX_TO_WIN_W /* from is char*, to is wchar_t* */
> } cygwin_conv_path_t;
>
> ssize_t cygwin_conv_path (cygwin_conv_path_t what, const void *from,
> void *to, size_t size);
>
> "size" is the size of the "to" buffer in bytes (not in characters).
>
> If size is 0, cygwin_conv_path returns the required buffer size in
> bytes.
>
> Otherwise, it returns 0 on success, or -1 on error and errno is set to
> one of the below values:
[...]
>
> Does that sound reasonable?
I suggest that you use four different functions with different signatures
instead of one with void pointers to buffers. Using just one function like
that seems too error prone.
>
>
> Corinna
>
>
--
VH
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 250 bytes
Desc: OpenPGP digital signature
URL: <http://cygwin.com/pipermail/cygwin-developers/attachments/20080223/1c2102a1/attachment.sig>
More information about the Cygwin-developers
mailing list