The following patch makes the VendorString and VendorRelease run-time
settable.  This is useful more than one X server is being built in a
single build tree (e.g., XFree86, Xnest, and Xdmx can all set different
Vendor* information at run time without using three independent build
trees).  It has also been entered into the XFree86 bugzilla database as
#1270: http://bugs.xfree86.org/show_bug.cgi?id=1270

Rik Faith and Kevin Martin

======================================================================

 main.c |   21 ++++++++++++++++++---
 1 files changed, 18 insertions(+), 3 deletions(-)


diff -u -p -r1.1.1.2 -r1.2
--- xc/programs/Xserver/dix/main.c      5 Mar 2003 10:32:51 -0000       1.1.1.2
+++ xc/programs/Xserver/dix/main.c      22 Oct 2003 22:55:17 -0000      1.2
@@ -482,6 +482,21 @@ main(int argc, char *argv[], char *envp[
     return(0);
 }
 
+static int  VendorRelease = VENDOR_RELEASE;
+static char *VendorString = VENDOR_STRING;
+
+void
+SetVendorRelease(int release)
+{
+    VendorRelease = release;
+}
+
+void
+SetVendorString(char *string)
+{
+    VendorString = string;
+}
+
 static int padlength[4] = {0, 3, 2, 1};
 
 #ifndef PANORAMIX
@@ -505,7 +520,7 @@ CreateConnectionBlock()
     /* Leave off the ridBase and ridMask, these must be sent with 
        connection */
 
-    setup.release = VENDOR_RELEASE;
+    setup.release = VendorRelease;
     /*
      * per-server image and bitmap parameters are defined in Xmd.h
      */
@@ -517,7 +532,7 @@ CreateConnectionBlock()
     setup.bitmapBitOrder = screenInfo.bitmapBitOrder;
     setup.motionBufferSize = NumMotionEvents();
     setup.numRoots = screenInfo.numScreens;
-    setup.nbytesVendor = strlen(VENDOR_STRING); 
+    setup.nbytesVendor = strlen(VendorString); 
     setup.numFormats = screenInfo.numPixmapFormats;
     setup.maxRequestSize = MAX_REQUEST_SIZE;
     QueryMinMaxKeyCodes(&setup.minKeyCode, &setup.maxKeyCode);
@@ -534,7 +549,7 @@ CreateConnectionBlock()
     sizesofar = sizeof(xConnSetup);
     pBuf = ConnectionInfo + sizeof(xConnSetup);
 
-    memmove(pBuf, VENDOR_STRING, (int)setup.nbytesVendor);
+    memmove(pBuf, VendorString, (int)setup.nbytesVendor);
     sizesofar += setup.nbytesVendor;
     pBuf += setup.nbytesVendor;
     i = padlength[setup.nbytesVendor & 3];

_______________________________________________
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel

Reply via email to