Thu Jan 4 21:33:38 1996 Theodore Y. Ts'o <tytso@dcl>
+ * gssapiP_generic.h (TWRITE_INT16, TREAD_INT16): Added new macros
+ to read and write two byte integers from the wire.
+
* gssapiP_generic.h: Don't include <sys/types.h> since it's
already included by gssapi.h.
(ptr)[3] = (char) ((bigend)?((num)&0xff):((num)>>24)); \
(ptr) += 4;
+#define TWRITE_INT16(ptr, num, bigend) \
+ (ptr)[0] = (char) ((bigend)?((num)>>24):((num)&0xff)); \
+ (ptr)[1] = (char) ((bigend)?(((num)>>16)&0xff):(((num)>>8)&0xff)); \
+ (ptr) += 2;
+
#define TREAD_INT(ptr, num, bigend) \
(num) = (((ptr)[0]<<((bigend)?24: 0)) | \
((ptr)[1]<<((bigend)?16: 8)) | \
((ptr)[3]<<((bigend)? 0:24))); \
(ptr) += 4;
+#define TREAD_INT16(ptr, num, bigend) \
+ (num) = (((ptr)[0]<<((bigend)?24: 0)) | \
+ ((ptr)[1]<<((bigend)?16: 8))); \
+ (ptr) += 2;
+
#define TWRITE_STR(ptr, str, len) \
memcpy((ptr), (char *) (str), (len)); \
(ptr) += (len);