17a0395d0Smrg/*
296402570Smrg *
37a0395d0SmrgCopyright 1989, 1998  The Open Group
47a0395d0Smrg
57a0395d0SmrgPermission to use, copy, modify, distribute, and sell this software and its
67a0395d0Smrgdocumentation for any purpose is hereby granted without fee, provided that
77a0395d0Smrgthe above copyright notice appear in all copies and that both that
87a0395d0Smrgcopyright notice and this permission notice appear in supporting
97a0395d0Smrgdocumentation.
107a0395d0Smrg
117a0395d0SmrgThe above copyright notice and this permission notice shall be included in
127a0395d0Smrgall copies or substantial portions of the Software.
137a0395d0Smrg
147a0395d0SmrgTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
157a0395d0SmrgIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
167a0395d0SmrgFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
177a0395d0SmrgOPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
187a0395d0SmrgAN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
197a0395d0SmrgCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
207a0395d0Smrg
217a0395d0SmrgExcept as contained in this notice, the name of The Open Group shall not be
227a0395d0Smrgused in advertising or otherwise to promote the sale, use or other dealings
237a0395d0Smrgin this Software without prior written authorization from The Open Group.
247a0395d0Smrg * *
257a0395d0Smrg * Author:  Jim Fulton, MIT X Consortium
267a0395d0Smrg */
277a0395d0Smrg
287a0395d0Smrg#include <stdio.h>
297a0395d0Smrg#include <X11/Xos.h>
307a0395d0Smrg#include <X11/Xauth.h>
317a0395d0Smrg#include <X11/Xfuncs.h>
327a0395d0Smrg
337a0395d0Smrg#ifndef True
347a0395d0Smrgtypedef int Bool;
357a0395d0Smrg#define False 0
367a0395d0Smrg#define True 1
377a0395d0Smrg#endif
387a0395d0Smrg
3996402570Smrgextern const char *ProgramName;
407a0395d0Smrg
417a0395d0Smrg#include <stdlib.h>
427a0395d0Smrg
437a0395d0Smrgstruct addrlist {
447a0395d0Smrg    struct addrlist *next;
457a0395d0Smrg    char	    *address;
467a0395d0Smrg    int		    len;
477a0395d0Smrg    int		    family;
487a0395d0Smrg};
497a0395d0Smrg
5096402570Smrgextern const char *get_hostname ( Xauth *auth );
5196402570Smrgextern struct addrlist *get_address_info ( int family, const char *fulldpyname, int prefix, char *host);
5296402570Smrgextern char *copystring ( const char *src, int len );
537a0395d0Smrgextern char *get_local_hostname ( char *buf, int maxlen );
5496402570Smrgextern Bool parse_displayname ( const char *displayname, int *familyp, char **hostp, int *dpynump, int *scrnump, char **restp );
5596402570Smrgextern int auth_initialize ( const char *authfilename );
567a0395d0Smrgextern int auth_finalize ( void );
5796402570Smrgextern int process_command ( const char *inputfilename, int lineno, int argc, const char **argv );
5896402570Smrgextern int print_help ( FILE *fp, const char *cmd, const char *prefix );
597a0395d0Smrgextern int verbose;
607a0395d0Smrgextern Bool ignore_locks;
617a0395d0Smrgextern Bool break_locks;
627a0395d0Smrgextern Bool no_name_lookups;
63