No release numbers
------------------
+ - Sun Sep 3 23:58:17 UTC 2000
+ - Portability fixes (for solaris, set the SOLARIS env var first)
+
- Sat Sep 2 23:42:37 UTC 2000
- Hopefully fix aim_snac.c bugs
- Add Buddy List Rights parser (max buddies and max watchers)
libfaim: mkbuildinfo $(LIBFAIM_OBJECTS)
$(AR) cru libfaim.a $(LIBFAIM_OBJECTS)
$(RANLIB) libfaim.a
+ifdef SOLARIS
+ ld -G -o $(SONAME) $(LIBFAIM_OBJECTS) -lresolv
+else
ld -o $(SONAME) $(LIBFAIM_OBJECTS) -shared -soname $(SONAME)
+endif
allutils: libfaim
@echo "LIBFAIM_INC = $$PWD" > utils/Makefile.dynamicrules; \
LDFLAGS += -lfaim -L$(LIBFAIM_LIB)
endif
+ifdef SOLARIS
+CC = gcc
+MAKE = gmake
+endif
+
AR = ar
RANLIB = ranlib
#include <faim/aim.h>
+/*
+ * Since not all implementations support MSG_WAITALL, define
+ * an alternate guarenteed read function...
+ */
+static int aim_recv(int fd, void *buf, size_t count)
+{
+#ifdef FAIM_HAS_MSG_WAITALL
+ return recv(fd, buf, count, MSG_WAITALL);
+#else
+ int left, ret, cur = 0;
+
+ left = count;
+
+ while (left) {
+ ret = read(fd, buf+cur, left);
+ if (ret == -1)
+ return -1;
+ if (ret == 0)
+ return cur;
+
+ cur += ret;
+ left -= ret;
+ }
+
+ return cur;
+#endif
+}
+
/*
* Grab a single command sequence off the socket, and enqueue
* it in the incoming event queue in a seperate struct.
* 4 short -- Number of data bytes that follow.
*/
faim_mutex_lock(&conn->active);
- if (recv(conn->fd, generic, 6, MSG_WAITALL) < 6){
+ if (aim_recv(conn->fd, generic, 6) < 6){
aim_conn_close(conn);
faim_mutex_unlock(&conn->active);
return -1;
}
/* read the data portion of the packet */
- if (recv(conn->fd, newrx->data, newrx->commandlen, MSG_WAITALL) < newrx->commandlen){
+ if (aim_recv(conn->fd, newrx->data, newrx->commandlen) < newrx->commandlen){
free(newrx->data);
free(newrx);
aim_conn_close(conn);
return 0;
}
+
+/* strsep Copyright (C) 1992, 1993 Free Software Foundation, Inc.
+ strsep is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If
+ not, write to the Free Software Foundation, Inc., 675 Mass Ave,
+ Cambridge, MA 02139, USA. */
+
+/* Minor changes by and1000 on 15/1/97 to make it go under Nemesis */
+
+char *aim_strsep(char **pp, const char *delim)
+{
+ char *p, *q;
+
+ if (!(p = *pp))
+ return 0;
+
+ if ((q = strpbrk (p, delim)))
+ {
+ *pp = q + 1;
+ *q = '\0';
+ }
+ else
+ *pp = 0;
+
+ return p;
+}
#define gethostbyname(x) gethostbyname2(x, AF_INET)
#endif
-#if !defined(MSG_WAITALL)
-#warning FIX YOUR LIBC! MSG_WAITALL is required!
-#define MSG_WAITALL 0x100
+#if defined(MSG_WAITALL)
+#define FAIM_HAS_MSG_WAITALL
#endif
/*
int aim_snlen(const char *sn);
int aim_sncmp(const char *sn1, const char *sn2);
+/* for libc's that dont have it */
+char *aim_strsep(char **pp, const char *delim);
+
/* aim_meta.c */
char *aim_getbuilddate(void);
char *aim_getbuildtime(void);
#!/bin/sh
rm -rf aim_meta.o aim_buildcode.h
-echo -n "#define AIM_BUILDDATE \"" > aim_buildcode.h
-echo -n `date +%Y%m%d` >> aim_buildcode.h
-echo "\"" >> aim_buildcode.h
-
-echo -n "#define AIM_BUILDTIME \"" >> aim_buildcode.h
-echo -n `date +%H%M%S` >> aim_buildcode.h
-echo "\"" >> aim_buildcode.h
+echo "#define AIM_BUILDDATE \"`date +%Y%m%d`\"" > aim_buildcode.h
+echo "#define AIM_BUILDTIME \"`date +%H%M%S`\"" >> aim_buildcode.h
{
char *sn, *msg;
buf = nextwhite(buf)+1;
- sn = strsep(&buf, "/");
- msg = strsep(&buf, "/");
+ sn = aim_strsep(&buf, "/");
+ msg = aim_strsep(&buf, "/");
sendimtoclient(sess, aim_getconn_type(sess, AIM_CONN_TYPE_BOS), sn, 0, msg);
}
break;
newconn = aim_directim_initiate(sess, command->conn, NULL, userinfo->sn);
//aim_conn_addhandler(sess, newconn, AIM_CB_FAM_OFT, AIM_CB_OFT_DIRECTIMINITIATE, faimtest_directim_initiate, 0);
} else if (!strncmp(tmpstr, "reqsendmsg", 10)) {
- aim_send_im(sess, command->conn, "vaxherder", 0, "sendmsg 7986");
+ aim_send_im(sess, command->conn, "vaxherder", 0, "sendmsg 7900");
} else if (!strncmp(tmpstr, "sendmsg", 7)) {
int i;
i = atoi(tmpstr+8);