I need some suggestions. What would be the best way to make an hton for data stored as a long long? Should I make a brand new function or use a type of manipulation of the already made hton's? I have been attempting to write my own function but I am having a tough time.
Your thoughts?
Well, I finally found something to do it? Is this some decent code?
Code:
unsigned long long htonll (unsigned long long hostlonglong)
{
unsigned long long retval;
retval = hostlonglong;
retval = ((unsigned long long) htonl(hostlonglong & 0xFFFFFFFF)) << 32;
retval |= htonl((hostlonglong & 0xFFFFFFFF00000000) >> 32);
return(retval);
}