Exemplo n.º 1
0
/**
 * Get an int16 from the server.
 */
TDS_SMALLINT
tds_get_smallint(TDSSOCKET * tds)
{
	unsigned char bytes[2];

	tds_get_n(tds, bytes, 2);
#if WORDS_BIGENDIAN
	if (tds->emul_little_endian)
		return (TDS_SMALLINT) TDS_GET_A2LE(bytes);
#endif
	return (TDS_SMALLINT) TDS_GET_A2(bytes);
}
Exemplo n.º 2
0
/**
 * Get an int16 from the server.
 */
TDS_USMALLINT
tds_get_usmallint(TDSSOCKET * tds)
{
	TDS_USMALLINT bytes[1];

	tds_get_n(tds, &bytes, 2);
#if WORDS_BIGENDIAN
	if (tds->conn->emul_little_endian)
		return (TDS_USMALLINT) TDS_GET_A2LE(&bytes);
#endif
	return (TDS_USMALLINT) TDS_GET_A2(&bytes);
}