home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / sys / amiga / programm / 18108 < prev    next >
Encoding:
Internet Message Format  |  1993-01-04  |  1.2 KB

  1. Path: sparky!uunet!zaphod.mps.ohio-state.edu!caen!spool.mu.edu!torn!nott!bnrgate!bcars664!leibniz!walt
  2. From: walt@bcarh1d7.bnr.ca (Walt Sullivan)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: What is htonl() ?
  5. Message-ID: <WALT.93Jan4095659@bcarh1d7.bnr.ca>
  6. Date: 4 Jan 93 14:56:58 GMT
  7. References: <72250@cup.portal.com>
  8. Sender: news@bcars664.bnr.ca
  9. Distribution: world
  10. Organization: Bell-Northern Research, Ottawa, Canada
  11. Lines: 26
  12. In-reply-to: Counsellor@cup.portal.com's message of 23 Dec 92 07:10:38 GMT
  13.  
  14. >>>>> "Benjamin" == Benjamin Counsellor Reich <Counsellor@cup.portal.com> writes:
  15.  
  16. Benjamin> I am writing a program based on another's source code.
  17.  
  18. Benjamin> I am stumped by one line of code:
  19.  
  20. Benjamin>      *lmark = htonl(*lmark);
  21.  
  22. htonl() is a byte-reordering function that converts an unsigned
  23. long quantity (32 bits) from host byte order to network byte order.
  24.  
  25. If the host and network byte orders are the same for your application,
  26. you could:
  27.  
  28. #define htonl(l) l
  29.  
  30. Other byte-reordering functions are:
  31. htons() host-to-network-short
  32. ntohl() network-to-host-long
  33. ntohs() network-to-host-short
  34.  
  35. --
  36. Walt Sullivan
  37. INTERNET: walt@bnr.ca (work)
  38. UUCP: walt@orbit.ocunix.on.ca (home)
  39. FIDO: 1:163/109.4
  40.