[xml] PocketPC (Windows CE) Port



Hi there,

somewhere about a week ago, Javier said he managed to compile libxml2 on a
Pocket PC with Windows CE. He sent his changes to me, because of the lack of
possibility to make a regular diff.

Now, WinCE spacific files he placed in a subdirectory of ./win32, which is
okay and hurts noone. He also modified the IO somewhat, in a way I
personally found less appealing :=) Basically there are three things I am
not fond about:

1. Replaced every call to read/write with calls to fread/fwrite, with
apropriate #ifdefs.
2. Excluded every call to getenv.
3. Called SetLastError, a native API, in the middle of the code.

Number one alone uglifies the code, for fread and read have different
parameters and different local variables are needed in functions which call
these. I find, few more of these and noone will be able to read the code
anymore without preprocessing it first :-)

The fact is that Windows CE does not have open/read/write/close functions. I
believe that Windows CE does have all required IO functionality, but exposed
through the native API. Unlike desktop Windows, the C-runtime in WinCE does
not wrap the required part.

Now, I thought about make an implementation of open/read/write/close, based
on the native WinCE API, which then can be kept in a separate C file. I
think that is a cleaner solution.

The C-runtime in desktop Windows does have implementations of these, and
these implementations do nothing else but call the native API internally.
The source code for MS C-Runtime is also available, at least the relevant
part. Looking at that code and porting it to WinCE should not be a big
problem.

What do you think?

Ciao
Igor




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]