/* $Id$ */
#define UDS "_UDS_"
+#ifdef __CYGWIN__
+#define DEFAULT_HOST "localhost"
+#else
#define DEFAULT_HOST UDS
+#endif
#define DEFAULT_PORT "citadel"
#include "sysdep.h"
/* GETU */
-/* Caller must free the struct usersupp; caller may pass an existing one */
-int CtdlIPCGetConfig(CtdlIPC *ipc, struct usersupp **uret, char *cret)
+/* Caller must free the struct ctdluser; caller may pass an existing one */
+int CtdlIPCGetConfig(CtdlIPC *ipc, struct ctdluser **uret, char *cret)
{
register int ret;
if (!cret) return -2;
if (!uret) return -2;
- if (!*uret) *uret = (struct usersupp *)calloc(1, sizeof (struct usersupp));
+ if (!*uret) *uret = (struct ctdluser *)calloc(1, sizeof (struct ctdluser));
if (!*uret) return -1;
ret = CtdlIPCGenericCommand(ipc, "GETU", NULL, 0, NULL, NULL, cret);
/* SETU */
-int CtdlIPCSetConfig(CtdlIPC *ipc, struct usersupp *uret, char *cret)
+int CtdlIPCSetConfig(CtdlIPC *ipc, struct ctdluser *uret, char *cret)
{
char aaa[48];
/* GETR */
-int CtdlIPCGetRoomAttributes(CtdlIPC *ipc, struct quickroom **qret, char *cret)
+int CtdlIPCGetRoomAttributes(CtdlIPC *ipc, struct ctdlroom **qret, char *cret)
{
register int ret;
if (!cret) return -2;
if (!qret) return -2;
- if (!*qret) *qret = (struct quickroom *)calloc(1, sizeof (struct quickroom));
+ if (!*qret) *qret = (struct ctdlroom *)calloc(1, sizeof (struct ctdlroom));
if (!*qret) return -1;
ret = CtdlIPCGenericCommand(ipc, "GETR", NULL, 0, NULL, NULL, cret);
/* SETR */
/* set forget to kick all users out of room */
-int CtdlIPCSetRoomAttributes(CtdlIPC *ipc, int forget, struct quickroom *qret, char *cret)
+int CtdlIPCSetRoomAttributes(CtdlIPC *ipc, int forget, struct ctdlroom *qret, char *cret)
{
register int ret;
char *aaa;
/* AGUP */
int CtdlIPCAideGetUserParameters(CtdlIPC *ipc, const char *who,
- struct usersupp **uret, char *cret)
+ struct ctdluser **uret, char *cret)
{
register int ret;
char aaa[SIZ];
if (!cret) return -2;
if (!uret) return -2;
- if (!*uret) *uret = (struct usersupp *)calloc(1, sizeof(struct usersupp));
+ if (!*uret) *uret = (struct ctdluser *)calloc(1, sizeof(struct ctdluser));
if (!*uret) return -1;
sprintf(aaa, "AGUP %s", who);
/* ASUP */
-int CtdlIPCAideSetUserParameters(CtdlIPC *ipc, const struct usersupp *uret, char *cret)
+int CtdlIPCAideSetUserParameters(CtdlIPC *ipc, const struct ctdluser *uret, char *cret)
{
register int ret;
char *aaa;
}
if (connect(s, (struct sockaddr *) &sin, sizeof(sin)) < 0) {
+ close(s);
return -1;
}
}
if (connect(s, (struct sockaddr *) &addr, sizeof(addr)) < 0) {
+ close(s);
return -1;
}
strcpy(cithost, DEFAULT_HOST); /* default host */
strcpy(citport, DEFAULT_PORT); /* default port */
+ /* Allow caller to supply our values (Windows) */
+ if (hostbuf && strlen(hostbuf) > 0)
+ strcpy(cithost, hostbuf);
+ if (portbuf && strlen(portbuf) > 0)
+ strcpy(citport, portbuf);
+
+ /* Read host/port from command line if present */
for (a = 0; a < argc; ++a) {
if (a == 0) {
/* do nothing */