/*
* $XConsortium: xlswins.c,v 1.12 89/12/10 17:14:02 rws Exp $
*
* Copyright 1989 Massachusetts Institute of Technology
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
* the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the name of M.I.T. not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. M.I.T. makes no representations about the
* suitability of this software for any purpose. It is provided "as is"
* without express or implied warranty.
*
* M.I.T. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL M.I.T.
* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
* Author: Jim Fulton, MIT X Consortium
*/
/*
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
#include <stdio.h>
#include <stdlib.h>
char *ProgramName;
static void
usage (void)
{
static const char *help[] = {
" -display displayname X server to contact",
" -format {hex, decimal, octal} format used to print window id",
" -indent number amount to indent per level",
" -long print a long listing",
" -resources print a listing of widget resources",
"",
NULL};
const char **cpp;
}
exit (1);
}
static long
parse_long (const char *s)
{
long retval = 0;
if (s && *s) {
}
return retval;
}
static int got_xerror = 0;
static int
myxerror (
{
got_xerror++;
return 0;
}
exit (1);
}
int
main (
int argc,
char *argv[])
{
int i;
ProgramName = argv[0];
for (i = 1; i < argc; i++) {
if (arg[0] == '-') {
switch (arg[1]) {
case 'd': /* -display displayname */
displayname = argv[i];
continue;
case 'i': /* -indent number */
continue;
case 'l':
continue;
case 'r': /* -resources */
continue;
case 'f': /* -format [odh] */
switch (argv[i][0]) {
case 'd': /* decimal */
output_format = "%lu";
continue;
case 'o': /* octal */
output_format = "0%lo";
continue;
case 'h': /* hex */
output_format = "0x%lx";
continue;
}
usage ();
default:
usage ();
}
} else {
break; /* out of for loop */
}
}
if (!dpy) {
exit (1);
}
if (i >= argc) {
} else {
for (; i < argc; i++) {
if (w == 0) {
ProgramName, argv[i]);
} else {
}
}
}
XCloseDisplay (dpy);
exit (0);
}
static void
Window w,
int depth,
int indent,
{
unsigned int nchildren;
int n;
if (!print_resources) {
if (long_version) {
}
putchar (' ');
}
printf (output_format, w);
}
/*
* if we put anything before the XFetchName then we'll have to change the
* error handler
*/
got_xerror = 0;
if (!print_resources) {
if (long_version && got_xerror == 0) {
printf ("; (%s)(%s)",
} else {
printf ("; ()()");
}
}
}
}
} else {
if (got_xerror == 0) {
}
}
putchar ('\n');
if (got_xerror) goto done;
goto done;
for (n = 0; n < nchildren; n++) {
}
done:
return;
}