This is the mail archive of the cygwin-developers mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: New API call for path conversion


On Feb 22 14:11, Christopher Faylor wrote:
> On Fri, Feb 22, 2008 at 01:19:57PM +0100, Corinna Vinschen wrote:
> >I don't think the cygwin_internal interface is the right way to go for
> >the new path conversion function.  It's an unintuitive API which should
> >only be used for internals mostly by Cygwin utils.
> >
> >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);
> 
> One of the reasons I implemented the cygwin_internal stuff was to reduce
> the need to add a new function every time we thought to expose something
> non-POSIXy.
> 
> Maybe we need the extra argument checking, which is not possible with
> cygwin_internal, but did you consider using that and rejected it for
> that reason?

Yes, I considered it and I don't think cygwin_internal is feasible.
It's a sort of swiss-army knife for almost every dubious purpose a
Cyvwin tool could have, but it's lacking a cleanliness of definition
which I think is required for a well-defined path conversion API.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]