824N/A * (c) Copyright 1992-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 * Author: Adobe Systems Incorporated 824N/A/* ---Private Functions--- */ 824N/A unsigned long *
nitems,
/* IN: if non-null then RETURN val */ 824N/A GetAgentIdList returns a list of agents advertising on the passed display (dpy), 824N/A and it returns the number of agents in the list in the parameter nAgents. 824N/A The returned list is sorted in most to least willing order. 824N/A GetAgentIdList assumes that it has exclusive access to the server associated with 824N/A dpy (ie. it assumes that the caller has done an XGrabServer). 824N/A unsigned long *
nAgents)
/* RETURN: number of agents in list */ 824N/A /* let's go through the list and figure out which servers are okay */ 824N/A for (k=0; k < i; k++)
/* Search for duplicate ids */ 824N/A if (k == i) {
/* No duplicate ids */ 824N/A /* Assume that Agent i is dead... */ 824N/A /* insert the agents into agentList in "most to least willing" order */ 824N/A /* write the list back out onto the root window */ 824N/A /* NOTE: agentList was sorted most to least willing by GetAgentIdList */ 824N/A /* Masterkey bypass code */ 824N/A /* We have a willing agent and the client has masterkeys so... */ 824N/A }
else /* Search for appropriate agent */ 824N/A /* need to get licensing info from dpy */ 824N/A Check to see if the agent supports either our desired license method or 824N/A if it is an open service. 824N/A if (
match) {
/* We had a match on license method */ 824N/A }
else {
/* We got one! */ 824N/A * If transport is TCP, but we are on the same host as the agent then 824N/A * trade-up to the more efficient UNIX transport... 824N/A * Exit Clauses: status inited to FAILURE. Therefore cleanup "assumes" 824N/A * a failure unless noted otherwise. 824N/A * Step 1, find the hostname. This is delimited by a required colon. 824N/A for (; *p && *p !=
':'; p++);
824N/A * Step 2, get the port number. It follows the colon(s) 824N/A if (*p ==
'\0')
/* No port number specified... */ 824N/A else {
/* no hostname, so must be UNIX */ 824N/A /* find the delimiting '/' */ 824N/A }
else /* no transport specified */ 824N/A /* identify protocol */ 824N/A /* try to get application defaults file, if there is any */ 824N/A /* try to merge the server defaults. if not defined then use .Xdefaults */ 824N/A }
else {
/* use the .Xdefaults */ 824N/A /* try the XENVIRONMENT file, or if not defined, then .Xdefaults */ 824N/A /* Now that the database is built, try to extract the values we want. */ 824N/A/* ---Public Functions--- */ 824N/A /* check DPSNXHOST environment variable */ 824N/A /* check advertisements... */ 824N/A /* check XrmDatabase */