824N/A * (c) Copyright 1990-1994 Adobe Systems Incorporated. 824N/A * Permission to use, copy, modify, distribute, and sublicense this software 824N/A * and its documentation for any purpose and without fee is hereby granted, 824N/A * provided that the above copyright notices appear in all copies and that 824N/A * both those copyright notices and this permission notice appear in 824N/A * supporting documentation and that the name of Adobe Systems Incorporated 824N/A * not be used in advertising or publicity pertaining to distribution of the 824N/A * software without specific, written prior permission. No trademark license 824N/A * to use the Adobe trademarks is hereby granted. If the Adobe trademark 824N/A * "Display PostScript"(tm) is used to describe this software, its 824N/A * functionality or for any other purpose, such use shall be limited to a 824N/A * statement that this software works in conjunction with the Display 824N/A * PostScript system. Proper trademark attribution to reflect Adobe's 824N/A * ownership of the trademark shall be given whenever any such reference to 824N/A * the Display PostScript system is made. 824N/A * ADOBE MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THE SOFTWARE FOR 824N/A * ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. 824N/A * ADOBE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL 824N/A * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 824N/A * NON- INFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL ADOBE BE LIABLE 824N/A * TO YOU OR ANY OTHER PARTY FOR ANY SPECIAL, INDIRECT, OR CONSEQUENTIAL 824N/A * DAMAGES OR ANY DAMAGES WHATSOEVER WHETHER IN AN ACTION OF CONTRACT, 824N/A * NEGLIGENCE, STRICT LIABILITY OR ANY OTHER ACTION ARISING OUT OF OR IN 824N/A * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ADOBE WILL NOT 824N/A * PROVIDE ANY TRAINING OR OTHER SUPPORT FOR THE SOFTWARE. 824N/A * Adobe, PostScript, and Display PostScript are trademarks of Adobe Systems 824N/A * Incorporated which may be registered in certain jurisdictions 824N/A * Portions Copyright Massachusetts Institute of Technology 1985, 1986 824N/A * Permission to use, copy, modify, distribute, and sell this software and its 824N/A * documentation for any purpose is hereby granted without fee, provided that 824N/A * the above copyright notice appear in all copies and that both that 824N/A * copyright notice and this permission notice appear in supporting 824N/A * documentation, and that the name of M.I.T. not be used in advertising or 824N/A * publicity pertaining to distribution of the software without specific, 824N/A * written prior permission. M.I.T. makes no representations about the 824N/A * suitability of this software for any purpose. It is provided "as is" 824N/A * without express or implied warranty. 824N/A * Author: Adobe Systems Incorporated and MIT X Consortium 824N/Astatic int lock;
/* get rid of ifdefs when locking implemented */ 824N/A/* +++ Someday make this common with XDPS.c version */ 824N/A * First, a routine for setting authorization data 824N/A * Connects to a server, creates a Display object and returns a pointer to 824N/A * the newly created Display back to the caller. 824N/A * Find an agent to talk to. 824N/A /* try to start-up an NX? */ 824N/A /* cons-up an arg. to pass to Agent we are forking */ 824N/A /* ASSERT: first argument in additionalArgs must be 824N/A }
else {
/* autoLaunch != True */ 824N/A /* Free agentHost later */ 824N/A * Attempt to allocate a display structure. Return NULL if allocation fails. 824N/A * Call the Connect routine to get the network socket. If -1 is returned, the 824N/A * connection failed. The connect routine will set fullname to point to the 824N/A * Look up the authorization protocol name and data if necessary. 824N/A * build XDM-AUTHORIZATION-1 data 824N/A for (i = 0; i <
8; i++)
824N/A for (i =
3; i >= 0; i--)
824N/A * We succeeded at authorization, so let us move the data into 824N/A * the display structure. 824N/A /* this field is not present in post X11R5 */ 824N/A /* Salt away the host:display string for later use. 824N/A Storage owned by agent, Xmalloc'd by connection 824N/A /* Set up the output buffers. */ 824N/A /* Create extension data */ 824N/A /* Parse names to get true display name */ 824N/A /* Agent is not on the same host as client, so fix 824N/A up the stupid abbreviations used for the display, 824N/A and whoever came up with the syntax should be shot. */ 824N/A/* OutOfMemory is called if malloc fails. XOpenDisplay returns NULL 824N/A/* XFreeDisplayStructure frees all the storage associated with a 824N/A * Display. It is used by XOpenDisplay if it runs out of memory, 824N/A * and also by XCloseDisplay. It needs to check whether all pointers 824N/A * are non-NULL before dereferencing them, since it may be called 824N/A * by XOpenDisplay before the Display structure is fully formed. 824N/A * XOpenDisplay must be sure to initialize all the pointers to NULL 824N/A * before the first possible call on this.