On Mon, Aug 08, 2005 at 08:18:42AM -0600, Jim wrote:
> I believe that off_t will will work
Jim, you're right.
The problem started with the 32-bit/2G file addressing limit. Does
anyone know where POSIX is going with this one? I think Linux quietly
replaced off_t with loff_t (long vs. long long), while FreeBSD probably
redefined the size of a off_t. (I'm just guessing here.)
Anyways, for libifp, I'm going to create (*shudder*) yet another
typedef.
> I tried the fix for multi-national filenames. It seems to work - at
> least no reports of problems.
This certainly looks like the "right direction". What I'm confused
about is what I should replace strlen(ib) with. I mean, if ib's locale
isn't guaranteed to be ASCII or UTF-8, strlen(ib) will no longer do the
job.
What is the locale-aware version of strlen? It's not wcslen.. any
ideas?
(I've checkpointed everything in CVS in the libifp-1_0 branch.)
Geoff
> I made changes to ifp_os_libusb.c. My changes are followed by the
> comment //JMC
>
> ifp_os_libusb.c
>
> int ifp_utf8_to_utf16(char * ob, int max_o, const char * ib, int max_i)
> {
> int i;
>
> if (max_i)
> {
> // satisfy compiler
> }
> setlocale(LC_ALL, ""); //JMC
> i = local_iconv(nl_langinfo(CODESET), "UTF-16LE", ob, max_o, ib,
> strlen(ib)+1); //JMC
> //i = local_iconv("UTF-8", "UTF-16LE", ob, max_o, ib, strlen(ib)+1);
> ifp_err_jump(i, err, "conversion failed");
>
> err:
> return i;
> }
>
> int ifp_utf16_to_utf8(char * ob, int max_o, const char * ib, int max_i)
> {
> int i;
> int n;
>
> setlocale(LC_ALL, ""); //JMC
> n = utf16_sizeof((uint16_t *)ib, max_i/sizeof(uint16_t));
>
> i = local_iconv("UTF-16LE", nl_langinfo(CODESET), ob, max_o, ib,
> (n+1)*sizeof(uint16_t)); //JMC
> //i = local_iconv("UTF-16LE", "UTF-8", ob, max_o, ib,
> (n+1)*sizeof(uint16_t));
> ifp_err_jump(i, err, "conversion failed");
>
> err:
> return i;
> }
> Geoff Oakham wrote:
> >Hi Jim,
> >
> >It looks like I picked up a Linux-specific type by accident. Off the
> >top of my head, I can't remember why I needed it, so I'd have to look
> >into what it should be replaced with.
> >
> >Thanks for the report,
> >
> >Geoff
> >
> >On Sun, Aug 07, 2005 at 04:30:59PM -0700, jdc wrote:
> >
> >>Is there anyone that used BSD and libifp?
> >>If so what changes were necessary to built libifp?
> >>Did you have any problems with the type "loff_t"?
> >>
> >
> >
>
|