2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
6 * These libraries and programs are free software; you can
7 * redistribute them and/or modify them under the terms of the GNU
8 * Lesser General Public License as published by the Free Software
9 * Foundation; either version 2 of the License, or (at your option)
12 * These libraries and programs are distributed in the hope that
13 * they will be useful, but WITHOUT ANY WARRANTY; without even the
14 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU Lesser General Public License for more
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with these librararies and programs; if not, write
20 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21 * Floor, Boston, MA 02110-1301 USA
24 * File: connect.h $XConsortium: connect.h /main/3 1995/10/26 15:47:00 rswiston $
27 * (c) Copyright 1988, Hewlett-Packard Company, all rights reserved.
29 * (c) Copyright 1993, 1994 Hewlett-Packard Company *
30 * (c) Copyright 1993, 1994 International Business Machines Corp. *
31 * (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
32 * (c) Copyright 1993, 1994 Novell, Inc. *
38 #if defined(__cplusplus) && defined(__c_callable)
43 #if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)
44 (XeString line, XeString *host_addr, XeString *path_addr);
48 #if defined(__cplusplus) && defined(__c_callable)
53 Take the filespec as a line and return a path the host and path
54 components as separate fields (finds the ':' and replaces it with
55 NULL). THIS FUNCTION MUNGES THE ORIGINAL LINE.
58 extern XeString XeFindHost
59 #if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)
65 extern XeString XeFindShortHost
66 #if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)
72 Returns a host name corresponding to host_spec.
74 In all cases a NEW STRING, OWNED BY THE
75 CALLER, is returned. XeFindHost returns the full host specification
76 including domain if there is one. XeFindShortHost does not
77 include the domain. These functions can be used to convert between
78 domain and simple names when needed. The domain names should be
79 used always internally and the simple names only used for display.
82 extern int Xegethostname
83 #if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)
84 (XeString hostname, unsigned int size);
89 #if defined(__cplusplus) && defined(__c_callable)
94 int Xegetshorthostname
95 #if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)
96 (XeString hostname, unsigned int size);
100 #if defined(__cplusplus) && defined(__c_callable)
105 Identical to the libc function gethostname, except that Xegethostname
106 returns a full domain qualified name and Xegetshorthostname returns
107 a simple name. These functions are necessary because the system
108 hostname may or may not contain a domain name and the internal
109 representation should always be canonical form (domain qualified).
110 Use Xegethostname except when the name is being used for display
111 purposes only. Storage allocation is identical to gethostname
112 (it copies into the caller's buffer).
115 #if defined(__cplusplus) && defined(__c_callable)
120 Boolean XeIsLocalHostP
121 #if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)
126 #if defined(__cplusplus) && defined(__c_callable)
131 Returns true if the hostname passed in identifies the host on which
132 this function is executed. This is needed in order to handle all
133 combinations of simple and domain-qualified names for either the
134 hostname passed in or the one defined on the local host. Be sure
135 to include Xe.h or provide a local declaration for this function
136 as Boolean is not the same length as int and it won't function
137 correctly without the declaration.
139 #if defined(__cplusplus) && defined(__c_callable)
144 Boolean XeIsSameHostP
145 #if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)
146 (XeString host1, XeString host2);
150 #if defined(__cplusplus) && defined(__c_callable)
155 Returns true if host1 and host2 specify the same host. This is
156 needed, because either or both hosts may be specified with or
157 without domain qualifiers, and the correct result must be
158 obtained. This function canonicalizes both and compares them
159 only in canonical form.
162 extern Boolean XeIsSameHostP
163 #if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)
164 (XeString host1, XeString host2);
169 Returns true if host1 and host2 specify the same host. This is
170 needed, because either or both hosts may be specified with or
171 without domain qualifiers, and the correct result must be
172 obtained. This function canonicalizes both and compares them
173 only in canonical form.
176 XeString XeCreateContextString
177 #if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)
178 (XeString host, XeString directory, XeString file);
183 XeCreateContextString changes the given context into a
184 label which is exactly the same as the one shown in a
185 fileview modeline. A NEW STRING, OWNED BY THE CALLER,
189 #define XeEliminateDots(path) (XeString)pathcollapse(path, path, FALSE)
191 Removes /./'s and /../ 's from path. THIS ROUTINE OVERWRITES
192 THE path IT WAS PASSED. If there are too many ..'s in path,
193 NULL is returned, so you better keep a pointer to path if you hope
194 to reclaim it. Does not handle host:/path, shell variables or other
199 #if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)
205 performs a chdir and caches the new directory in $PWD so that
206 Xegetcwd() can get the current directory without slow stat calls
210 #if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)
217 version of getcwd() which uses cached $PWD (or $PWD from shell)
218 if available and calls getcwd only when PWD not set
221 /* DON'T ADD STUFF AFTER THIS #endif */
222 #endif /* _connect_h */