Metrologic Optimus S Programming Manual page 170

"c" programming guide
Table of Contents

Advertisement

164
"C" Programming Guide For Optimus S/R
ntohl
ntohs
Purpose
To convert an unsigned long integer from network byte order to host byte
order.
Syntax
unsigned long ntohl (unsigned long val);
unsigned long val;
Example
(?)
Description
This routine converts an unsigned long integer from network byte order to host
byte order.
If successful, it returns the value of conversion.
Return
Otherwise (?)
See Also
htonl
Purpose
To convert an unsigned (short) integer from network byte order to host byte
order.
Syntax
unsigned ntohs (unsigned val);
unsigned val;
struct sockaddr_in name;
Example
int port;
.......................
port = ntohs (name.sin_port);
printf ("Remote Port: %d", port);
Description
This routine converts an unsigned (short) integer from network byte order to
host byte order.
Return
If successful, it returns the value of conversion.
Otherwise (?)
See Also
htons
/* an unsigned long integer to be converted */
/* an unsigned integer to be converted */

Advertisement

Table of Contents
loading

This manual is also suitable for:

Optimus r

Table of Contents