Guy wrote:
I hope by "strings" you mean "arrays of bytes" rather than "character
strings"; unless something really is a character string, it shouldn't be
treated as one.
Yes, I was unclear. I meant to handle them as pointers to arrays
of unsigned characters stored in network order.
Something like :
unsigned char u64[8];
Right now I have implemented and tested the support functions:
unsigned char *atou64(char *u64string, unsigned char *u64ptr);
char *u64toa(unsigned char *u64ptr);
u64ptr should be declared as unsigned char u64ptr[8];
The u64toa() function is very efficient and optimized since this function
can be expected to be used a lot.
(everytime a 64bit integer gets translated to a string for display purposes)
atou64() is less efficient but I guess will not be used as often, perhaps
only when reading/parsing display filters?
I will implement the following support functions and show what the code
looks like in the next few days :
s64toa
atos64
h64toa
atoh64
As previously noted, I think it is essential that the x64toa functions
are efficient and fast.
These functions can then really be used on all platforms including
those that have native 64bit support in the compiler since this
would eliminate the need for any #ifdef conditionals.
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp