home *** CD-ROM | disk | FTP | other *** search
/ PC Extra Super CD 1998 January / PCPLUS131.iso / DJGPP / V2 / DJLSR201.ZIP / src / libc / pc_hw / endian / htons.txh < prev    next >
Encoding:
Text File  |  1995-07-10  |  481 b   |  27 lines

  1. @node htons, cpu
  2. @subheading Syntax
  3.  
  4. @example
  5. #include <netinet/in.h>
  6.  
  7. unsigned short htons(unsigned short val);
  8. @end example
  9.  
  10. @subheading Description
  11.  
  12. This function converts from host formatted shorts to network formatted
  13. shorts.  For the i386 and higher processors, this means that the bytes
  14. are swapped from 12 order to 21 order.
  15.  
  16. @subheading Return Value
  17.  
  18. The network-order value.
  19.  
  20. @subheading Example
  21.  
  22. @example
  23. tcp.port = htons(port);
  24. @end example
  25.  
  26.  
  27.