src/protocols/zephyr/ZLocations.c

changeset 10867
b39f9b646d6c
parent 10328
b097a5cc92f3
child 10897
98867eee9779
equal deleted inserted replaced
10866:40eab743e22b 10867:b39f9b646d6c
18 "$Zephyr: /afs/athena.mit.edu/astaff/project/zephyr/src/lib/RCS/ZLocations.c,v 1.30 90/12/20 03:04:39 raeburn Exp $"; 18 "$Zephyr: /afs/athena.mit.edu/astaff/project/zephyr/src/lib/RCS/ZLocations.c,v 1.30 90/12/20 03:04:39 raeburn Exp $";
19 #endif 19 #endif
20 20
21 #include "internal.h" 21 #include "internal.h"
22 22
23 #ifndef WIN32
23 #include <pwd.h> 24 #include <pwd.h>
25 #endif
24 26
25 extern char *getenv(); 27 extern char *getenv();
26 extern int errno; 28 extern int errno;
27 29
28 Code_t ZSetLocation(exposure) 30 Code_t ZSetLocation(exposure)
53 char *format; 55 char *format;
54 { 56 {
55 int retval; 57 int retval;
56 time_t ourtime; 58 time_t ourtime;
57 ZNotice_t notice, retnotice; 59 ZNotice_t notice, retnotice;
58 char *bptr[3], *p; 60 char *bptr[3];
59 #ifndef X_DISPLAY_MISSING 61 #ifndef X_DISPLAY_MISSING
60 char *display; 62 char *display;
61 #endif 63 #endif
64 #ifndef WIN32
62 char *ttyp; 65 char *ttyp;
66 char *p;
67 #endif
63 struct hostent *hent; 68 struct hostent *hent;
64 short wg_port = ZGetWGPort(); 69 short wg_port = ZGetWGPort();
65 70
66 (void) memset((char *)&notice, 0, sizeof(notice)); 71 (void) memset((char *)&notice, 0, sizeof(notice));
67 notice.z_kind = ACKED; 72 notice.z_kind = ACKED;
93 if ((display = getenv("DISPLAY")) && *display) { 98 if ((display = getenv("DISPLAY")) && *display) {
94 (void) strncpy(mytty, display, sizeof(mytty)); 99 (void) strncpy(mytty, display, sizeof(mytty));
95 mytty[sizeof(mytty)-1] = '\0'; 100 mytty[sizeof(mytty)-1] = '\0';
96 } else { 101 } else {
97 #endif 102 #endif
103 #ifdef WIN32
104 strcpy(mytty,"WinGaim");
105 #else
98 ttyp = ttyname(0); 106 ttyp = ttyname(0);
99 if (ttyp && *ttyp) { 107 if (ttyp && *ttyp) {
100 p = strchr(ttyp + 1, '/'); 108 p = strchr(ttyp + 1, '/');
101 strcpy(mytty, (p) ? p + 1 : ttyp); 109 strcpy(mytty, (p) ? p + 1 : ttyp);
102 } else { 110 } else {
103 strcpy(mytty, "unknown"); 111 strcpy(mytty, "unknown");
104 } 112 }
113 #endif
105 #ifndef X_DISPLAY_MISSING 114 #ifndef X_DISPLAY_MISSING
106 } 115 }
107 #endif 116 #endif
108 reenter = 1; 117 reenter = 1;
109 } 118 }

mercurial