From: "Frank Joppe" <[EMAIL PROTECTED]>
> > 2) How would you rate your code for platform-independence and
portability,
> > especially to platforms like Windoze?
>
> Interesting question, how about the difference between PC (Intel) and
Apple
> (Motorola)? big/low endian... you can trust a protocol-complience on one
> machine, but can you trust it on another?
As long as there's a layer of functions which converts numeric fields within
a data stream into the machine's internal representation of numbers, and
back again, big endian versus little endian shouldn't be a problem. Taking
care of pointer arithmetic behaviour between platforms as well, of course.
The bigger issues come up with operating system facilities, like files and
sockets.
For instance, in *nix, sockets are treated much like file descriptors, and
are compatible with file functions such as open(), close(), read(), write(),
fdopen() etc. But in windoze, there are separate socket primitives - send(),
recv() etc. Also, WSAStartup() must be called before any sockets are used.
Also, differences in file path syntax: Unix: /dir1/dir2/../dirn/filename,
Windows: C:\dir1\dir2\..\dirn\filename.ext
Also, line terminators for text files: Unix: \n, Windows: \r\n
And so on.
A very good example of portable code is the Junkbusters proxy, at
http://www.junkbusters.com/ijb.html
I feel really enthusiastic at the thought of a Freenet client in C that
compiles on Windows and Unix (perhaps Mac as well). Keep it up.
Cheers
David
>
> ----- Original Message -----
> From: "David McNab" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Friday, April 27, 2001 4:59 AM
> Subject: Re: [freenet-devl] YAEFNIIC
>
>
> > From: "Kalle A. Sandstr"om" <[EMAIL PROTECTED]>
> >
> > >Right. I've written a deeply hackerware experimental freenet node
> > >implementation (in C) -- currently it can connect to the 'testserver'
> >
> > Two questions:
> >
> > 1) How do you rate the prospect of you keeping it protocol-compatible
with
> > the official Java Freenet as it evolves from version to version?
> >
> > 2) How would you rate your code for platform-independence and
portability,
> > especially to platforms like Windoze?
> >
> > I can anticipate that in time, Windows node installations will vastly
> > outnumber *nix ones (if they don't already).
> >
> >
> >
> > _______________________________________________
> > Devl mailing list
> > [EMAIL PROTECTED]
> > http://lists.freenetproject.org/mailman/listinfo/devl
>
>
> _______________________________________________
> Devl mailing list
> [EMAIL PROTECTED]
> http://lists.freenetproject.org/mailman/listinfo/devl
>
_______________________________________________
Devl mailing list
[EMAIL PROTECTED]
http://lists.freenetproject.org/mailman/listinfo/devl