diff libfaim/aim_util.c @ 2:68b230f8da5f

[gaim-migrate @ 11] A few more commits :) committer: Tailor Script <tailor@pidgin.im>
author Rob Flynn <gaim@robflynn.com>
date Thu, 23 Mar 2000 03:16:06 +0000
parents
children 6ced2f1c8b24
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/libfaim/aim_util.c	Thu Mar 23 03:16:06 2000 +0000
@@ -0,0 +1,38 @@
+/*
+ *
+ *
+ *
+ */
+
+#include "aim.h"
+
+int aimutil_put8(u_char *buf, u_short data)
+{
+  buf[0] = data&0xff;
+  return 1;
+}
+
+/*
+ * Endian-ness issues here?
+ */
+int aimutil_put16(u_char *buf, u_short data)
+{
+  buf[0] = (data>>8)&0xff;
+  buf[1] = (data)&0xff;
+  return 2;
+}
+
+int aimutil_put32(u_char *buf, u_long data)
+{
+  buf[0] = (data>>24)&0xff;
+  buf[1] = (data>>16)&0xff;
+  buf[2] = (data>>8)&0xff;
+  buf[3] = (data)&0xff;
+  return 4;
+}
+
+int aimutil_putstr(u_char *dest, u_char *src, int len)
+{
+  memcpy(dest, src, len);
+  return len;
+}