Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!sun-barr!rutgers!psuvax1!shire.cs.psu.edu!ehrlich From: ehrlich@shire.cs.psu.edu (Daniel Ehrlich) Newsgroups: comp.windows.x Subject: Patch for xrdb.c Message-ID: <4570@psuvax1.cs.psu.edu> Date: 11 May 89 13:58:31 GMT Sender: news@psuvax1.cs.psu.edu Reply-To: ehrlich@shire.cs.psu.edu (Daniel Ehrlich) Organization: Department of Computer Science, Penn State University Lines: 46 A while back I had asked if there was a way to determine which version of the X Window System the server a client was speaking to was running. After poking around and looking at things that get returned in the Display structure from XOpenWindow I have come up with the following patch for xrdb.c that will define a preprocessor symbol XnRm that correctly reflects this information: RCS file: RCS/xrdb.c,v retrieving revision 1.1 diff -c -r1.1 xrdb.c *** /tmp/,RCSt1020258 Thu May 11 09:48:44 1989 --- xrdb.c Thu May 11 09:26:10 1989 *************** *** 41,46 **** --- 41,50 ---- #include #include + #ifndef XlibProtoVersion + #define XlibProtoVersion(dpy) ((dpy)->vnumber) + #endif /* XlibProtoVersion */ + #ifndef CPP #define CPP "/usr/lib/cpp" #endif /* CPP */ *************** *** 307,312 **** --- 311,319 ---- if (temp[0] == '\0') /* must be connected to :0 */ gethostname(temp, MAXHOSTNAME); AddDef(defs, "HOST", temp); + (void) sprintf(temp, "X%dR%d", XlibProtoVersion(display), + VendorRelease(display)); + AddNum(defs, temp, 1); screen = DefaultScreenOfDisplay(display); visual = DefaultVisualOfScreen(screen); AddNum(defs, "WIDTH", screen->width); Dan Ehrlich | Disclaimer: The opinions expressed are The Pennsylvania State University | my own, and should not be attributed Department of Computer Science | to anyone else, living or dead. University Park, PA 16802 | Dan Ehrlich | Disclaimer: The opinions expressed are The Pennsylvania State University | my own, and should not be attributed Department of Computer Science | to anyone else, living or dead. University Park, PA 16802 |