> > UTF-8 support should be there, and should be driven from the LANG /
> > LC_* / locale. It's a non-trivial amount of work to get this to work
> > of course.
>
> I could contribute this. I have working code for Camomile. But, it
> requires small C code to call ISO-C functions. What do you think,
> N(i)colas?
That's little troublesome.
Even if we have only one C little file, the installation, compilation ---
for a lot of different kind of systems --- is troublesome.
Oh ! just's got a good idea.
If we have to add a C part, then what we should do is a C emulator.
How does it works ?
- it's a C program that can resolve and call dynlinked C functions
- it can also manipulate basic C data structures (convert from and to OCaml
data, and also "raw" access , a little like Obj module)
- it can alloc and free some C memory
Then when we need to add some C parts, we just need to write some Caml code
that will use Emu-C, and which will handle the system particularities... at
runtime.
exemple (far from being correct, just give an idea) :
let strstr = EmuC.resolve "libc" "strstr" in
let found = EmuC.call strstr ["my_string";"_s"] in
if found = EmuC.null then
None
else
Some (EmuC.alloc_string found)
> Windows (proper) supports all ISO-C functions? and (for the future
> reference) how about strcol?
I don't know about that. There is strcoll ANSI compatible function. ( and
wcscoll for Unicode strings )
> In addition, I'm thinking of UTF-16 support (for Windows and Java) A
> major problem is lack of 16-bit interger array in OCaml. We could use
> a string and do type-cast when it is passed to C functions. This
> would involve detecting endianness in installtion time and providing
> some C-macros.
>
> Alternatively, we could use Bigarray, but Bigarray is not efficient.
>
> I'm interested in other people's opinions.
Use (future) EmuC :-)
let block = EmuC.alloc size in
and then EmuC.setw / EmuC.getw to access 16-bits values into block.
Nicolas Cannasse
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
|