summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/SMlibint.h7
-rw-r--r--src/globals.h8
-rw-r--r--src/sm_error.c5
-rw-r--r--src/sm_genid.c37
4 files changed, 34 insertions, 23 deletions
diff --git a/src/SMlibint.h b/src/SMlibint.h
index 030fc45..2e559de 100644
--- a/src/SMlibint.h
+++ b/src/SMlibint.h
@@ -25,6 +25,7 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
+/* $XFree86: xc/lib/SM/SMlibint.h,v 1.4 2001/12/14 19:53:55 dawes Exp $ */
/*
* Author: Ralph Mor, X Consortium
@@ -40,14 +41,10 @@ in this Software without prior written authorization from The Open Group.
#include <X11/ICE/ICEproto.h>
#include <X11/SM/SMproto.h>
-#ifndef X_NOT_STDC_ENV
#include <stdlib.h>
-#else
-char *malloc();
-#endif
#ifndef NULL
-#define NULL 0
+#include <stddef.h>
#endif
diff --git a/src/globals.h b/src/globals.h
index 6cd12e4..b3ef69f 100644
--- a/src/globals.h
+++ b/src/globals.h
@@ -25,6 +25,7 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
+/* $XFree86: xc/lib/SM/globals.h,v 1.5 2002/05/31 18:45:41 dawes Exp $ */
/*
* Author: Ralph Mor, X Consortium
@@ -55,8 +56,13 @@ char *_SmAuthNames[] = {"MIT-MAGIC-COOKIE-1"};
IcePoAuthProc _SmcAuthProcs[] = {_IcePoMagicCookie1Proc};
IcePaAuthProc _SmsAuthProcs[] = {_IcePaMagicCookie1Proc};
+#ifndef __UNIXOS2__
SmsNewClientProc _SmsNewClientProc;
-SmPointer _SmsNewClientData;
+SmPointer _SmsNewClientData;
+#else
+SmsNewClientProc _SmsNewClientProc = 0;
+SmPointer _SmsNewClientData = 0;
+#endif
SmcErrorHandler _SmcErrorHandler = _SmcDefaultErrorHandler;
SmsErrorHandler _SmsErrorHandler = _SmsDefaultErrorHandler;
diff --git a/src/sm_error.c b/src/sm_error.c
index 241d587..728de79 100644
--- a/src/sm_error.c
+++ b/src/sm_error.c
@@ -25,6 +25,7 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
+/* $XFree86: xc/lib/SM/sm_error.c,v 1.3 2001/12/14 19:53:55 dawes Exp $ */
/*
* Author: Ralph Mor, X Consortium
@@ -89,7 +90,7 @@ SmPointer values;
fprintf (stderr, "XSMP error: Offending minor opcode = %d (%s)\n",
offendingMinorOpcode, str);
- fprintf (stderr, " Offending sequence number = %d\n",
+ fprintf (stderr, " Offending sequence number = %ld\n",
offendingSequence);
switch (errorClass)
@@ -212,7 +213,7 @@ SmPointer values;
fprintf (stderr, "XSMP error: Offending minor opcode = %d (%s)\n",
offendingMinorOpcode, str);
- fprintf (stderr, " Offending sequence number = %d\n",
+ fprintf (stderr, " Offending sequence number = %ld\n",
offendingSequence);
switch (errorClass)
diff --git a/src/sm_genid.c b/src/sm_genid.c
index 024e24f..bc79d7e 100644
--- a/src/sm_genid.c
+++ b/src/sm_genid.c
@@ -25,6 +25,7 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
+/* $XFree86: xc/lib/SM/sm_genid.c,v 3.15 2001/12/14 19:53:55 dawes Exp $ */
/*
* Author: Ralph Mor, X Consortium
@@ -41,19 +42,19 @@ in this Software without prior written authorization from The Open Group.
#endif
#include <stdio.h>
-#ifdef X_NOT_STDC_ENV
-#define Time_t long
-extern Time_t time ();
-#else
#include <time.h>
#define Time_t time_t
-#endif
#ifndef WIN32
#if defined(TCPCONN) || defined(STREAMSCONN)
+#ifndef Lynx
#include <sys/socket.h>
+#else
+#include <socket.h>
+#endif
#include <netinet/in.h>
+#include <arpa/inet.h>
#define XOS_USE_NO_LOCKING
#define X_INCLUDE_NETDB_H
#include <X11/Xos_r.h>
@@ -69,6 +70,12 @@ extern Time_t time ();
#endif /* WIN32 */
+#ifdef MNX_TCPCONN
+#include <net/gen/netdb.h>
+
+#define TCPCONN
+#endif
+
static char *hex_table[] = { /* for generating client IDs */
"00", "01", "02", "03", "04", "05", "06", "07",
@@ -109,10 +116,9 @@ static char *hex_table[] = { /* for generating client IDs */
char *
SmsGenerateClientID (smsConn)
-
-SmsConn smsConn;
-
+ SmsConn smsConn;
{
+#if defined(TCPCONN) || defined(STREAMSCONN)
char hostname[256];
char address[14];
char temp[256];
@@ -122,17 +128,18 @@ SmsConn smsConn;
if (gethostname (hostname, sizeof (hostname)))
return (NULL);
-#if defined(TCPCONN) || defined(STREAMSCONN)
{
char* inet_addr;
char temp[4], *ptr1, *ptr2;
unsigned char decimal[4];
int i, len;
+#ifdef XTHREADS_NEEDS_BYNAMEPARAMS
_Xgethostbynameparams hparams;
+#endif
struct hostent *hostp;
if ((hostp = _XGethostbyname (hostname,hparams)) != NULL)
- inet_addr = (char *) inet_ntoa (*(struct in_addr *)(hostp->h_addr));
+ inet_addr = inet_ntoa (*(struct in_addr *)(hostp->h_addr));
else
return NULL;
for (i = 0, ptr1 = inet_addr; i < 3; i++)
@@ -154,12 +161,9 @@ SmsConn smsConn;
for (i = 0; i < 4; i++)
strcat (address, hex_table[decimal[i]]);
}
-#else
- return (NULL);
-#endif
- sprintf (temp, "1%s%.13ld%.10d%.4d", address, time((Time_t*)0),
- getpid (), sequence);
+ sprintf (temp, "1%s%.13ld%.10ld%.4d", address, time((Time_t*)0),
+ (long)getpid(), sequence);
if (++sequence > 9999)
sequence = 0;
@@ -168,4 +172,7 @@ SmsConn smsConn;
strcpy (id, temp);
return (id);
+#else
+ return (NULL);
+#endif
}