xtrace-1.3.1/0000755000175100017510000000000011765365454010025 500000000000000xtrace-1.3.1/config.h.in0000644000175100017510000000504511765365454011774 00000000000000/* config.h.in. Generated from configure.ac by autoheader. */ /* Define to 1 if you have the `asprintf' function. */ #undef HAVE_ASPRINTF /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the `rt' library (-lrt). */ #undef HAVE_LIBRT /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define if clock_gettime(CLOCK_MONOTONIC) should work */ #undef HAVE_MONOTONIC_CLOCK /* Define to 1 if you have the `socket' function. */ #undef HAVE_SOCKET /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the `strndup' function. */ #undef HAVE_STRNDUP /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Enable extensions on AIX 3, Interix. */ #ifndef _ALL_SOURCE # undef _ALL_SOURCE #endif /* Enable GNU extensions on systems that have them. */ #ifndef _GNU_SOURCE # undef _GNU_SOURCE #endif /* Enable threading extensions on Solaris. */ #ifndef _POSIX_PTHREAD_SEMANTICS # undef _POSIX_PTHREAD_SEMANTICS #endif /* Enable extensions on HP NonStop. */ #ifndef _TANDEM_SOURCE # undef _TANDEM_SOURCE #endif /* Enable general extensions on Solaris. */ #ifndef __EXTENSIONS__ # undef __EXTENSIONS__ #endif /* Version number of package */ #undef VERSION /* Define to 1 if on MINIX. */ #undef _MINIX /* Define to 2 if the system does not provide POSIX.1 features except with this defined. */ #undef _POSIX_1_SOURCE /* Define to 1 if you need to in order for `stat' and other things to work. */ #undef _POSIX_SOURCE xtrace-1.3.1/NEWS0000644000175100017510000000466511765365304010451 00000000000000new after 1.3.0: - fix query extension parsing new after 1.2.0: - support XFree86-DGA - fix --timestamp description in manpage new after 1.1.0: - support XVideo, Composite, SYNC - bugfixes (GetWindowAttributes on big endian) - improved GLX support new after 1.0.2: - bugfixes - support Generic Events (XGE) - support XInputExtension 1.5, and partially XInputExtension 2.0 - support DRI2 new after 1.0.1: - bugfixes (SelectionNotify, NoOperation, initial server response) - show more details of the initial X server response new after 1.0.0: - bugfixes (RenderTrapezoids and server errors) new after 1.0.0~alpha1: - fix bug in when to terminate when run with a command new after 0.11.0: - add parser so that protocol descriptions are no longer compiled in but read from text files in a language for the virtual parsing machine of previous versions. - partial support for GLX extension - bugfix in BE32 and hex/non-hex fixes in different places new after 0.10.1: - bugfix: correct field length in GetAtomName, added missing field in RRGetOutputInfo reply. - output FIXED values as fixed point numbers instead of multiples of 1/65536 - RANDR 1.3 support - bugfix: set the address family when listening on a tcp socket - new --timestamps and --relative-timestamps options - XInputExtension support new after 0.10.0: - bugfix: correct field offsets in ConfigureWindow, RandrDeleteOutputProperty and XF86BigfontQueryVersion. new after 0.9.1: - XFIXES, DAMAGE, DPMS and MIT-SCREEN-SAVER extension support - start program given at command line new after 0.9.0: - bugfix in new RANDR rules new after 0.8.1: - RANDR 1.2 support - XINERAMA extension supported new after 0.8: - minor beautifiers new after 0.7: - XFree86-Bigfont extension added - several cleanups and beautifiers new after 0.6: - --outfile and --buffered options new after 0.5: - pretty print ListFonts, SetFontPath, GetFontPath and ListExtensions - compiles on Solaris now - support for XFree86-VidModeExtension (used by xvidtune and sdl) new after 0.4: - fix ATOMs for big-endian (by making them 32bit properly) - pretty print for ATOMs and some properties of format STRING. new after 0.3: - RANDR extension supported new after 0.2.1: - added --interactive - RENDER extension supported new from 0.2 to 0.2.1: - --keeprunning should work now - better extension support for multiple clients new from 0.1 to 0.2: - some cleanup - SHAPE extension supported (and some little framework for extensions) - added --help option xtrace-1.3.1/Makefile.am0000644000175100017510000000152311704002604011754 00000000000000bin_PROGRAMS = xtrace AM_CPPFLAGS = -DPKGDATADIR='"$(pkgdatadir)"' xtrace_SOURCES = main.c x11common.c x11client.c x11server.c parse.c copyauth.c atoms.c translate.c stringlist.c noinst_HEADERS = xtrace.h parse.h stringlist.h translate.h dist_man_MANS = xtrace.1 MAINTAINERCLEANFILES = $(srcdir)/Makefile.in $(srcdir)/configure $(srcdir)/stamp-h.in $(srcdir)/aclocal.m4 $(srcdir)/config.h.in dist_pkgdata_DATA = all.proto bigfont.proto bigrequest.proto damage.proto dpms.proto dri2.proto errors.proto events.proto fixes.proto genericevents.proto glx.proto mitshm.proto randr.proto render.proto requests.proto saver.proto setup.proto shape.proto sync.proto vidmode.proto xinerama.proto xinput.proto xkb.proto xvideo.proto composite.proto dga.proto distclean-local: -rm -rf $(srcdir)/autom4te.cache maintainer-clean-local: -rm -rf $(srcdir)/ac xtrace-1.3.1/stringlist.c0000644000175100017510000000732111704002604012270 00000000000000/* This file is part of "xtrace" * Copyright (C) 2009 Bernhard R. Link * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include #include #include "stringlist.h" static struct string_bucket { struct string_bucket *next; size_t ofs; char data[]; } *stringlist; static struct bucket { struct bucket *next; size_t size, ofs; char data[]; } *buckets; #define STRINGLIST_SIZE 16 * 1024 #define BUCKET_SIZE 32 * 1024 void stringlist_init(void) { stringlist = malloc(STRINGLIST_SIZE); if( stringlist == NULL ) { fputs("Out of memory!\n", stderr); return; } stringlist->ofs = STRINGLIST_SIZE - ((char*)&stringlist->data-(char*)stringlist); stringlist->next = NULL; buckets = malloc(BUCKET_SIZE); if( buckets == NULL ) { fputs("Out of memory!\n", stderr); return; } buckets->size = BUCKET_SIZE; buckets->ofs = sizeof(struct bucket); buckets->next = NULL; } void stringlist_done(void) { while( stringlist != NULL ) { struct string_bucket *n = stringlist->next; free(stringlist); stringlist = n; } while( buckets != NULL ) { struct bucket *n = buckets->next; free(buckets); buckets = n; } } const void *finalize_data(const void *data, size_t len, size_t align) { void *p; size_t next_ofs; if( buckets == NULL ) return NULL; next_ofs = ((buckets->ofs + align - 1)/align)*align; if( next_ofs >= buckets->size || len > buckets->size - next_ofs ) { struct bucket *n; size_t size; if( len >= BUCKET_SIZE/2 ) size = len; else size = BUCKET_SIZE; next_ofs = ((sizeof(struct bucket) + align - 1)/align)*align; size += next_ofs; n = malloc(size); if( n == NULL ) { fputs("Out of memory!\n", stderr); stringlist_done(); return NULL; } n->size = size; n->ofs = next_ofs; if( n->size - n->ofs == len ) { n->ofs = n->size; p = ((char*)buckets) + next_ofs; memcpy(p, data, len); n->next = buckets->next; buckets->next = n; return p; } n->next = buckets; buckets = n; } assert( len <= buckets->size - next_ofs ); p = ((char*)buckets) + next_ofs; memcpy(p, data, len); buckets->ofs = next_ofs + len; return p; } const char *string_add_l(const char *string, size_t len) { char *p; if( stringlist == NULL ) return NULL; if( stringlist->ofs <= len ) { struct string_bucket *n; size_t size; size = STRINGLIST_SIZE; if( len >= size ) size = ((char*)&stringlist->data-(char*)stringlist) + 1 + len; n = malloc(size); if( n == NULL ) { fputs("Out of memory!\n", stderr); stringlist_done(); return NULL; } n->ofs = size - ((char*)&n->data-(char*)n); assert( n->ofs > len ); if( n->ofs == len + 1 ) { n->ofs = 0; memcpy(n->data, string, len); n->data[len] = '\0'; n->next = stringlist->next; stringlist->next = n; return n->data; } n->next = stringlist; stringlist = n; } assert( stringlist->ofs > len ); stringlist->ofs -= len + 1; p = stringlist->data + stringlist->ofs; memcpy(p, string, len); p[len] = '\0'; return p; } const char *string_add(const char *string) { return string_add_l(string, strlen(string)); } xtrace-1.3.1/atoms.c0000644000175100017510000000674111704002604011216 00000000000000/* This file is part of "xtrace" * Copyright (C) 2006 Bernhard R. Link * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include #include #include #include #include #include #include #include #include "xtrace.h" #define CONSTANT_ATOMS 68 static const char *constant_atoms[CONSTANT_ATOMS] = { "PRIMARY", "SECONDARY", "ARC", "ATOM", "BITMAP", "CARDINAL", "COLORMAP", "CURSOR", "CUT_BUFFER0", "CUT_BUFFER1", "CUT_BUFFER2", "CUT_BUFFER3", "CUT_BUFFER4", "CUT_BUFFER5", "CUT_BUFFER6", "CUT_BUFFER7", "DRAWABLE", "FONT", "INTEGER", "PIXMAP", "POINT", "RECTANGLE", "RESOURCE_MANAGER", "RGB_COLOR_MAP", "RGB_BEST_MAP", "RGB_BLUE_MAP", "RGB_DEFAULT_MAP", "RGB_GRAY_MAP", "RGB_GREEN_MAP", "RGB_RED_MAP", "STRING", "VISUALID", "WINDOW", "WM_COMMAND", "WM_HINTS", "WM_CLIENT_MACHINE", "WM_ICON_NAME", "WM_ICON_SIZE", "WM_NAME", "WM_NORMAL_HINTS", "WM_SIZE_HINTS", "WM_ZOOM_HINTS", "MIN_SPACE", "NORM_SPACE", "MAX_SPACE", "END_SPACE", "SUPERSCRIPT_X", "SUPERSCRIPT_Y", "SUBSCRIPT_X", "SUBSCRIPT_Y", "UNDERLINE_POSITION", "UNDERLINE_THICKNESS", "STRIKEOUT_ASCENT", "STRIKEOUT_DESCENT", "ITALIC_ANGLE", "X_HEIGHT", "QUAD_WIDTH", "WEIGHT", "POINT_SIZE", "RESOLUTION", "COPYRIGHT", "NOTICE", "FONT_NAME", "FAMILY_NAME", "FULL_NAME", "CAP_HEIGHT", "WM_CLASS", "WM_TRANSIENT_FOR" }; struct atom { struct atom *left,*right; uint32_t atom; char name[]; }; /* TODO: add connection specific values, too, to be activated on mismatch */ struct atom *atom_root = NULL; struct atom *newAtom(const char *name, size_t len) { struct atom *atom; atom = malloc(sizeof(struct atom)+len+1); if( atom == NULL ) abort(); memcpy(atom->name,name,len); atom->name[len] = '\0'; return atom; } const char *getAtom(struct connection *c UNUSED, uint32_t atom) { struct atom *p; if( atom <= 0 ) return NULL; if( atom <= CONSTANT_ATOMS ) return constant_atoms[atom-1]; atom -= CONSTANT_ATOMS; p = atom_root; while( p != NULL ) { if( p->atom == atom ) return p->name; if( p->atom > atom ) p = p->left; else p = p->right; } return NULL; } void internAtom(struct connection *c UNUSED, uint32_t atom, struct atom *data) { struct atom **p; uint32_t lastmask; if( atom <= CONSTANT_ATOMS ) { free(data); return; } assert( data != NULL ); atom -= CONSTANT_ATOMS; /* still always > 0 */ data->atom = atom; p = &atom_root; lastmask = 0; while( *p != NULL ) { uint32_t k; k = (*p)->atom; if( atom == k ) { if( strcmp((*p)->name, data->name) != 0 ) fprintf(stderr,"Mismatch in InternAtom: Got %x = '%s', but remember = '%s'!\n",(unsigned int)atom,data->name,(*p)->name); free(data); return; } else if( atom > k ) { p = &(*p)->right; } else { /* atom < k */ p = &(*p)->left; } } *p = data; data->left = NULL; data->right = NULL; } xtrace-1.3.1/configure0000755000175100017510000052112411765365440011654 00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for xtrace 1.3.1. # # Report bugs to . # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org and brlink@debian.org $0: about your system, including any error possibly output $0: before this message. Then install a modern shell, or $0: manually run the script under such a shell if you do $0: have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='xtrace' PACKAGE_TARNAME='xtrace' PACKAGE_VERSION='1.3.1' PACKAGE_STRING='xtrace 1.3.1' PACKAGE_BUGREPORT='brlink@debian.org' PACKAGE_URL='' ac_unique_file="main.c" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS EGREP GREP CPP am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__quote am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC MAINT MAINTAINER_MODE_FALSE MAINTAINER_MODE_TRUE am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_maintainer_mode enable_dependency_tracking ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures xtrace 1.3.1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/xtrace] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of xtrace 1.3.1:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF xtrace configure 1.3.1 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ( $as_echo "## -------------------------------- ## ## Report this to brlink@debian.org ## ## -------------------------------- ##" ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_mongrel # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by xtrace $as_me 1.3.1, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_aux_dir= for ac_dir in ac "$srcdir"/ac; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in ac \"$srcdir\"/ac" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. ac_config_headers="$ac_config_headers config.h" am__api_version='1.11' # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Just in case sleep 1 echo timestamp > conftest.file # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;; esac # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi rm -f conftest.file if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } mkdir_p="$MKDIR_P" case $mkdir_p in [\\/$]* | ?:[\\/]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='xtrace' VERSION='1.3.1' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 $as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } # Check whether --enable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then : enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval else USE_MAINTAINER_MODE=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 $as_echo "$USE_MAINTAINER_MODE" >&6; } if test $USE_MAINTAINER_MODE = yes; then MAINTAINER_MODE_TRUE= MAINTAINER_MODE_FALSE='#' else MAINTAINER_MODE_TRUE='#' MAINTAINER_MODE_FALSE= fi MAINT=$MAINTAINER_MODE_TRUE DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 $as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from `make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 $as_echo "$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default" if test "x$ac_cv_header_minix_config_h" = xyes; then : MINIX=yes else MINIX= fi if test "$MINIX" = yes; then $as_echo "#define _POSIX_SOURCE 1" >>confdefs.h $as_echo "#define _POSIX_1_SOURCE 2" >>confdefs.h $as_echo "#define _MINIX 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5 $as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; } if ${ac_cv_safe_to_define___extensions__+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ # define __EXTENSIONS__ 1 $ac_includes_default int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_safe_to_define___extensions__=yes else ac_cv_safe_to_define___extensions__=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5 $as_echo "$ac_cv_safe_to_define___extensions__" >&6; } test $ac_cv_safe_to_define___extensions__ = yes && $as_echo "#define __EXTENSIONS__ 1" >>confdefs.h $as_echo "#define _ALL_SOURCE 1" >>confdefs.h $as_echo "#define _GNU_SOURCE 1" >>confdefs.h $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h $as_echo "#define _TANDEM_SOURCE 1" >>confdefs.h if test "${CFLAGS:+set}" != set ; then CFLAGS="-Wall -O2 -g -Wmissing-prototypes -Wstrict-prototypes -Wshadow" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C99" >&5 $as_echo_n "checking for $CC option to accept ISO C99... " >&6; } if ${ac_cv_prog_cc_c99+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c99=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include #include // Check varargs macros. These examples are taken from C99 6.10.3.5. #define debug(...) fprintf (stderr, __VA_ARGS__) #define showlist(...) puts (#__VA_ARGS__) #define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) static void test_varargs_macros (void) { int x = 1234; int y = 5678; debug ("Flag"); debug ("X = %d\n", x); showlist (The first, second, and third items.); report (x>y, "x is %d but y is %d", x, y); } // Check long long types. #define BIG64 18446744073709551615ull #define BIG32 4294967295ul #define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) #if !BIG_OK your preprocessor is broken; #endif #if BIG_OK #else your preprocessor is broken; #endif static long long int bignum = -9223372036854775807LL; static unsigned long long int ubignum = BIG64; struct incomplete_array { int datasize; double data[]; }; struct named_init { int number; const wchar_t *name; double average; }; typedef const char *ccp; static inline int test_restrict (ccp restrict text) { // See if C++-style comments work. // Iterate through items via the restricted pointer. // Also check for declarations in for loops. for (unsigned int i = 0; *(text+i) != '\0'; ++i) continue; return 0; } // Check varargs and va_copy. static void test_varargs (const char *format, ...) { va_list args; va_start (args, format); va_list args_copy; va_copy (args_copy, args); const char *str; int number; float fnumber; while (*format) { switch (*format++) { case 's': // string str = va_arg (args_copy, const char *); break; case 'd': // int number = va_arg (args_copy, int); break; case 'f': // float fnumber = va_arg (args_copy, double); break; default: break; } } va_end (args_copy); va_end (args); } int main () { // Check bool. _Bool success = false; // Check restrict. if (test_restrict ("String literal") == 0) success = true; char *restrict newvar = "Another string"; // Check varargs. test_varargs ("s, d' f .", "string", 65, 34.234); test_varargs_macros (); // Check flexible array members. struct incomplete_array *ia = malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); ia->datasize = 10; for (int i = 0; i < ia->datasize; ++i) ia->data[i] = i * 1.234; // Check named initializers. struct named_init ni = { .number = 34, .name = L"Test wide string", .average = 543.34343, }; ni.number = 58; int dynamic_array[ni.number]; dynamic_array[ni.number - 1] = 543; // work around unused variable warnings return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x' || dynamic_array[ni.number - 1] != 543); ; return 0; } _ACEOF for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -D_STDC_C99= -qlanglvl=extc99 do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c99=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c99" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c99" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c99" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 $as_echo "$ac_cv_prog_cc_c99" >&6; } ;; esac if test "x$ac_cv_prog_cc_c99" != xno; then : fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking Checking for _POSIX_TIMERS and _POSIX_MONOTONIC_CLOCK" >&5 $as_echo_n "checking Checking for _POSIX_TIMERS and _POSIX_MONOTONIC_CLOCK... " >&6; } if ${ac_cv_monotonic_clock+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { #ifdef _POSIX_TIMERS #if defined(_POSIX_MONOTONIC_CLOCK) && _POSIX_MONOTONIC_CLOCK >= 0 1 #else #error _POSIX_MONOTONIC_CLOCK not defined, or not positive, not using clock_gettime #endif #else #error _POSIX_TIMERS not defined, not using clock_gettime #endif ; return 0; } _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : ac_cv_monotonic_clock=yes else ac_cv_monotonic_clock=no fi rm -f conftest.err conftest.i conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_monotonic_clock" >&5 $as_echo "$ac_cv_monotonic_clock" >&6; } if test $ac_cv_monotonic_clock = yes ; then $as_echo "#define HAVE_MONOTONIC_CLOCK 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clock_gettime in -lrt" >&5 $as_echo_n "checking for clock_gettime in -lrt... " >&6; } if ${ac_cv_lib_rt_clock_gettime+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lrt $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char clock_gettime (); int main () { return clock_gettime (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_rt_clock_gettime=yes else ac_cv_lib_rt_clock_gettime=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_clock_gettime" >&5 $as_echo "$ac_cv_lib_rt_clock_gettime" >&6; } if test "x$ac_cv_lib_rt_clock_gettime" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBRT 1 _ACEOF LIBS="-lrt $LIBS" else as_fn_error $? "_POSIX_TIMERS suggests clock_gettime should work but it seems not to work, though" "$LINENO" 5 fi fi for ac_func in strndup asprintf socket do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done if test $ac_cv_func_socket = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for socket in -lsocket" >&5 $as_echo_n "checking for socket in -lsocket... " >&6; } if ${ac_cv_lib_socket_socket+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char socket (); int main () { return socket (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_socket_socket=yes else ac_cv_lib_socket_socket=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_socket" >&5 $as_echo "$ac_cv_lib_socket_socket" >&6; } if test "x$ac_cv_lib_socket_socket" = xyes; then : $as_echo "#define HAVE_SOCKET 1" >>confdefs.h LIBS="$LIBS -lsocket -lnsl"; break else as_fn_error $? "Could not find socket library function" "$LINENO" 5 fi fi ac_fn_c_check_func "$LINENO" "getaddrinfo" "ac_cv_func_getaddrinfo" if test "x$ac_cv_func_getaddrinfo" = xyes; then : else as_fn_error $? "Could not find getaddrinfo library function" "$LINENO" 5 fi ac_config_files="$ac_config_files Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by xtrace $as_me 1.3.1, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ xtrace config.status 1.3.1 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Autoconf 2.62 quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir=$dirpart/$fdir; as_fn_mkdir_p # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi xtrace-1.3.1/main.c0000644000175100017510000004314011704002604011011 00000000000000/* This file is part of "xtrace" * Copyright (C) 2005, 2007, 2010 Bernhard R. Link * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02111-1301 USA */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "xtrace.h" #include "stringlist.h" #include "translate.h" FILE *out; bool readwritedebug = false; bool copyauth = true; bool stopwhennone = true; bool waitforclient = false; bool denyallextensions = false; bool interactive = false; bool print_timestamps = false; bool print_reltimestamps = false; bool print_uptimestamps = false; static bool buffered = false; size_t maxshownlistlen = SIZE_MAX; const char *out_displayname = NULL; char *out_protocol,*out_hostname; int out_family,out_display,out_screen; const char *in_displayname = NULL; char *in_protocol,*in_hostname; int in_family,in_display,in_screen; static volatile bool caught_child_signal = false; static pid_t child_pid = 0; struct connection *connections = NULL ; static void acceptConnection(int listener) { struct timeval tv; struct connection *c; static int id = 0; c = calloc(1,sizeof(struct connection)); if( c == NULL ) { fprintf(stderr,"Out of memory!\n"); exit(EXIT_FAILURE); } if( print_reltimestamps ) { if( gettimeofday(&tv, NULL) != 0 ) { int e = errno; fprintf(stderr, "gettimeofday error %d : %s!\n", e, strerror(e)); exit(EXIT_FAILURE); } c->starttime = tv.tv_sec*(unsigned long long)1000 + tv.tv_usec/1000; } c->next = connections; c->client_fd = acceptClient(in_family,listener, &c->from); if( c->client_fd < 0 ) { free(c); return; } waitforclient = false; fprintf(stderr,"Got connection from %s\n",c->from); c->server_fd = connectToServer(out_displayname,out_family,out_hostname,out_display); if( c->server_fd < 0 ) { close(c->client_fd); free(c->from); free(c); fprintf(stderr,"Error connecting to server %s\n",out_displayname); return; } c->id = id++; connections = c; } static int mainqueue(int listener) { int n, r = 0; fd_set readfds,writefds,exceptfds; struct connection *c; unsigned int allowsent = 1; int status; while( 1 ) { n = listener+1; FD_ZERO(&readfds); FD_ZERO(&writefds); FD_ZERO(&exceptfds); FD_SET(listener,&readfds); c = connections; while( c != NULL ) { if( c->client_fd != -1 && c->server_fd == -1 && c->servercount == 0 ) { close(c->client_fd); c->client_fd = -1; if( readwritedebug ) fprintf(out,"%03d:>:sent EOF\n",c->id); } if( c->client_fd != -1 ) { if( sizeof(c->clientbuffer) > c->clientcount ) FD_SET(c->client_fd,&readfds); FD_SET(c->client_fd,&exceptfds); if( c->client_fd >= n ) n = c->client_fd+1; if(c->serverignore > 0 && c->servercount > 0 ) FD_SET(c->client_fd,&writefds); } else if( c->server_fd != -1 && c->clientcount == 0 ) { close(c->server_fd); c->server_fd = -1; if( readwritedebug ) fprintf(out,"%03d:<:sent EOF\n",c->id); } if( c->server_fd != -1 ) { if( sizeof(c->serverbuffer) > c->servercount ) FD_SET(c->server_fd,&readfds); FD_SET(c->server_fd,&exceptfds); if( c->server_fd >= n ) n = c->server_fd+1; if(c->clientignore > 0 && c->clientcount > 0 && allowsent > 0) FD_SET(c->server_fd,&writefds); } if( c->client_fd == -1 && c->server_fd == -1 ) { if( c == connections ) { free_usedextensions(c->usedextensions); free_unknownextensions(c->unknownextensions); free_unknownextensions(c->waiting); free(c->from); connections = c->next; free(c); c = connections; if( connections == NULL && stopwhennone && child_pid == 0 ) return EXIT_SUCCESS; continue; } } c = c->next; } if( interactive ) { FD_SET(0,&readfds); } if( child_pid != 0 && (r == -1 || caught_child_signal) ) { caught_child_signal = false; if( waitpid(child_pid,&status,WNOHANG) == child_pid ) { child_pid = 0; if( connections == NULL && !waitforclient ) { /* TODO: instead wait a bit before * terminating? */ if( WIFEXITED(status) ) return WEXITSTATUS(status); else return WTERMSIG(status) + 128; } } } r = select(n,&readfds,&writefds,&exceptfds,NULL); if( r == -1 ) { int e = errno; if( e != 0 && e != EINTR ) { fprintf(stderr,"Error %d in select: %s\n", e, strerror(e)); } continue; } for( c = connections ; c != NULL ; c = c->next ) { if( interactive && FD_ISSET(0,&readfds) ) { char buffer[201]; ssize_t isread; isread = read(0,buffer,200); if( isread == 0 ) exit(EXIT_SUCCESS); if( isread > 0 ) { buffer[isread]='\0'; int number = atoi(buffer); if( number <= 0 ) number = 1; allowsent += number; } } if( c->client_fd != -1 ) { if( FD_ISSET(c->client_fd,&exceptfds) ) { close(c->client_fd); c->client_fd = -1; fprintf(stdout,"%03d: exception in communication with client\n",c->id); continue; } if( FD_ISSET(c->client_fd,&writefds) ) { size_t towrite = c->servercount; ssize_t written; if( c->serverignore < towrite ) towrite = c->serverignore; written = write(c->client_fd,c->serverbuffer,towrite); if( written >= 0 ) { if( readwritedebug ) fprintf(stdout,"%03d:>:wrote %u bytes\n",c->id,(unsigned int)written); if( (size_t)written < c->servercount ) memmove(c->serverbuffer,c->serverbuffer+written,c->servercount-written); c->servercount -= written; c->serverignore -= written; if( c->servercount == 0 ) { if( c->server_fd == -1 ) { close(c->client_fd); c->client_fd = -1; if( readwritedebug ) fprintf(stdout,"%03d:>:send EOF\n",c->id); continue; } } else if( c->serverignore == 0 ) { parse_server(c); } } else { int e = errno; close(c->client_fd); c->client_fd = -1; if( readwritedebug ) fprintf(stdout,"%03d: error writing to client: %d=%s\n",c->id,e,strerror(e)); continue; } } if( FD_ISSET(c->client_fd,&readfds) ) { size_t toread = sizeof(c->clientbuffer)-c->clientcount; ssize_t wasread = read(c->client_fd,c->clientbuffer+c->clientcount,toread); assert( toread > 0 ); if( wasread > 0 ) { if( readwritedebug ) fprintf(stdout,"%03d:<:received %u bytes\n",c->id,(unsigned int)wasread); c->clientcount += wasread; } else { if( readwritedebug ) fprintf(stdout,"%03d:<:got EOF\n",c->id); close(c->client_fd); c->client_fd = -1; continue; } if( c->clientignore == 0 && c->clientcount > 0) { parse_client(c); } } } else if( c->servercount > 0 && c->serverignore > 0 ) { unsigned int min; /* discard additional events */ min = c->servercount; if( min > c->serverignore ) min = c->serverignore; fprintf(stdout,"%03d:s->?: discarded last answer of %u bytes\n",c->id,min); if( min < c->servercount ) memmove(c->serverbuffer,c->serverbuffer+min,c->servercount-min); c->servercount -= min; c->serverignore -= min; if( c->serverignore == 0 && c->servercount > 0 ) { parse_server(c); } } if( c->server_fd != -1 ) { if( FD_ISSET(c->server_fd,&exceptfds) ) { close(c->server_fd); c->server_fd = -1; fprintf(stdout,"%03d: exception in communication with server\n",c->id); continue; } if( FD_ISSET(c->server_fd,&writefds) ) { size_t towrite = c->clientcount; ssize_t written; if( c->clientignore < towrite ) towrite = c->clientignore; written = write(c->server_fd,c->clientbuffer,towrite); if( interactive && allowsent > 0 ) allowsent--; if( written >= 0 ) { if( readwritedebug ) fprintf(stdout,"%03d:<:wrote %u bytes\n",c->id,(unsigned int)written); if( (size_t)written < c->clientcount ) memmove(c->clientbuffer,c->clientbuffer+written,c->clientcount-written); c->clientcount -= written; c->clientignore -= written; if( c->clientcount != 0 && c->clientignore == 0 ) { parse_client(c); } } else { int e = errno; close(c->server_fd); c->server_fd = -1; if( readwritedebug ) fprintf(stdout,"%03d: error writing to server: %d=%s\n",c->id,e,strerror(e)); continue; } } if( FD_ISSET(c->server_fd,&readfds) ) { size_t toread = sizeof(c->serverbuffer)-c->servercount; ssize_t wasread = read(c->server_fd,c->serverbuffer+c->servercount,toread); assert( toread > 0 ); if( wasread > 0 ) { if( readwritedebug ) fprintf(stdout,"%03d:>:received %u bytes\n",c->id,(unsigned int)wasread); c->servercount += wasread; } else { if( readwritedebug ) fprintf(stdout,"%03d:>:got EOF\n",c->id); close(c->server_fd); c->server_fd = -1; } if( c->serverignore == 0 && c->servercount > 0 ) { parse_server(c); } } } else if( c->clientcount > 0 && c->clientignore > 0 ) { unsigned int min; /* discard additional events */ min = c->clientcount; if( min > c->clientignore ) min = c->clientignore; fprintf(stdout,"%03d:<: discarding last request of %u bytes\n",c->id,min); if( min < c->clientcount ) memmove(c->clientbuffer,c->clientbuffer+min,c->clientcount-min); c->clientcount -= min; c->clientignore -= min; if( c->clientignore == 0 && c->clientcount > 0 ) { parse_client(c); } } } if( FD_ISSET(listener,&readfds) ) { acceptConnection(listener); } } return EXIT_SUCCESS; } static void startClient(char *argv[]) { child_pid = fork(); if( child_pid == -1 ) { fprintf(stderr, "Error forking: %s\n", strerror(errno)); exit(EXIT_FAILURE); } if( child_pid == 0 ) { if (setenv("DISPLAY", in_displayname, 1) != 0) { fprintf(stderr,"Error setting $DISPLAY: %s\n", strerror(errno)); exit(EXIT_FAILURE); } execvp(argv[0], argv); fprintf(stderr, "Could not exec '%s': %s\n", argv[0], strerror(errno)); exit(EXIT_FAILURE); } } #ifndef HAVE_STRNDUP /* That's not the best possible strndup implementation, but it suffices for what * it is used here */ char *strndup(const char *str,size_t n) { char *r = malloc(n+1); if( r == NULL ) return r; memcpy(r,str,n); r[n] = '\0'; return r; } #endif enum {LO_DEFAULT=0, LO_TIMESTAMPS, LO_RELTIMESTAMPS, LO_UPTIMESTAMPS, LO_VERSION, LO_HELP, LO_PRINTCOUNTS, LO_PRINTOFFSETS}; static int long_only_option = 0; static const struct option longoptions[] = { {"display", required_argument, NULL, 'd'}, {"fakedisplay", required_argument, NULL, 'D'}, {"authfile", required_argument, NULL, 'f'}, {"newauthfile", required_argument, NULL, 'F'}, {"copyauthentication", no_argument, NULL, 'c'}, {"nocopyauthentication",no_argument, NULL, 'n'}, {"waitforclient", no_argument, NULL, 'w'}, {"stopwhendone", no_argument, NULL, 's'}, {"keeprunning", no_argument, NULL, 'k'}, {"denyextensions", no_argument, NULL, 'e'}, {"readwritedebug", no_argument, NULL, 'w'}, {"maxlistlength",required_argument, NULL, 'm'}, {"outfile", required_argument, NULL, 'o'}, {"buffered", no_argument, NULL, 'b'}, {"interactive", no_argument, NULL, 'i'}, {"help", no_argument, &long_only_option, LO_HELP}, {"version", no_argument, &long_only_option, LO_VERSION}, {"timestamps", no_argument, &long_only_option, LO_TIMESTAMPS}, {"relative-timestamps", no_argument, &long_only_option, LO_RELTIMESTAMPS}, {"monotonic-timestamps",no_argument, &long_only_option, LO_UPTIMESTAMPS}, {"print-counts", no_argument, &long_only_option, LO_PRINTCOUNTS}, {"print-offsets", no_argument, &long_only_option, LO_PRINTOFFSETS}, {NULL, 0, NULL, 0} }; static void catchsig(int signum UNUSED) { caught_child_signal = true; } extern bool print_counts; extern bool print_offsets; int main(int argc, char *argv[]) { int listener,r; const char *msg; int c; const char *out_authfile=NULL, *in_authfile = NULL; struct parser *parser; stringlist_init(); parser = parser_init(); if( parser == NULL ) return EXIT_FAILURE; out = stdout; while( (c=getopt_long(argc,argv,"+I:d:D:f:F:cnWskiewm:o:b",longoptions,NULL)) != -1 ) { switch( c ) { case 'I': add_searchpath(parser, optarg); break; case 'd': out_displayname = optarg; break; case 'D': in_displayname = optarg; break; case 'f': out_authfile = optarg; break; case 'F': in_authfile = optarg; break; case 'c': copyauth = true; break; case 'n': copyauth = false; break; case 'W': waitforclient = true; break; case 's': stopwhennone = true; break; case 'k': stopwhennone = false; break; case 'e': denyallextensions = true; break; case 'w': readwritedebug = true; break; case 'm': maxshownlistlen = strtoll(optarg,NULL,0); break; case 'i': interactive = true; break; case 'b': buffered = true; break; case 'o': if( out != stdout ) { fprintf(stderr, "Multiple -o options!\n"); exit(EXIT_FAILURE); } if( strcmp(optarg,"-") == 0 ) out = stdout; else out = fopen(optarg,"a"); if( out == NULL ) { fprintf(stderr, "Error opening %s: %s\n", optarg,strerror(errno)); exit(EXIT_FAILURE); } break; case '\0': switch( long_only_option ) { case LO_HELP: printf( "%s: Dump all X protocol data being tunneled from a fake X display to a real one.\n" "usage: xtrace [options] [[--] command args ...]\n" "--display, -d \n" "--fakedisplay, -D \n" "--copyauthentication, -c Copy credentials\n" "--nocopyauthentication, -n Do not copy credentials\n" "--authfile, -f \n" "--newauthfile, -F \n" "--waitforclient, -W wait for connection even if command terminates\n" "--stopwhendone, -s Return when last client disconnects\n" "--keeprunning, -k Keep running\n" "--denyextensions, -e Fake unavailability of all extensions\n" "--readwritedebug, -w Print amounts of data read/sent\n" "--maxlistlength, -m \n" "--outfile, -o Output to file instead of stdout\n" "--buffered, -b Do not output every line but only when buffer is full\n", argv[0]); exit(EXIT_SUCCESS); case LO_VERSION: puts(PACKAGE " version " VERSION); exit(EXIT_SUCCESS); case LO_TIMESTAMPS: print_timestamps = true; break; case LO_RELTIMESTAMPS: print_reltimestamps = true; break; case LO_UPTIMESTAMPS: #ifndef HAVE_MONOTONIC_CLOCK fprintf(stderr, "--monotonic-timestamps not supported as clock_gettime(MONOTONIC_CLOCK, ) was not available at compile time\n"); exit(EXIT_FAILURE); #else if (sysconf(_SC_MONOTONIC_CLOCK) < 0) { fprintf(stderr, "--monotonic-timestamps not supported on this system\n"); exit(EXIT_FAILURE); } print_uptimestamps = true; #endif break; case LO_PRINTCOUNTS: print_counts = true; break; case LO_PRINTOFFSETS: print_offsets = true; break; } break; case ':': case '?': default: exit(EXIT_FAILURE); } } add_searchpath(parser, PKGDATADIR); translate(parser, "all.proto"); finalize_everything(parser); if( !parser_free(parser) ) { return EXIT_FAILURE; } signal(SIGPIPE,SIG_IGN); if( out_displayname == NULL ) { out_displayname = getenv("DISPLAY"); if( out_displayname == NULL ) { fprintf(stderr,"No X server display to connect to specified\n"); exit(EXIT_FAILURE); } } if( in_displayname == NULL ) { in_displayname = getenv("FAKEDISPLAY"); if( in_displayname == NULL ) { fprintf(stderr,"No display name to create specified, trying :9\n"); in_displayname = ":9"; } } msg = parseDisplay(in_displayname,&in_protocol,&in_hostname,&in_display,&in_screen,&in_family); if( msg != NULL ) { fprintf(stderr,"Parsing '%s' failed: %s\n",in_displayname,msg); return -1; } msg = parseDisplay(out_displayname,&out_protocol,&out_hostname,&out_display,&out_screen,&out_family); if( msg != NULL ) { fprintf(stderr,"Parsing '%s' failed: %s\n",out_displayname,msg); return -1; } // generateAuthorisation(out_displayname); if( copyauth ) { /* TODO: normalize them? or keep them so the user has more * control? */ if( !copy_authentication(in_displayname,out_displayname,in_authfile,out_authfile) ) return -1; } setvbuf(out, NULL, buffered?_IOFBF:_IOLBF, BUFSIZ); listener = listenForClients(in_displayname,in_family,in_display); if( listener < 0 ) { exit(EXIT_FAILURE); } if( optind < argc && strcmp(argv[optind],"--") != 0 ) { signal(SIGCHLD, catchsig); startClient(argv + optind); } r = mainqueue(listener); close(listener); if( out != stdout ) { if( fclose(out) != 0 ) { fprintf(stderr, "Error writing to output file!\n"); return EXIT_FAILURE; } } stringlist_done(); return r; } xtrace-1.3.1/genericevents.proto0000644000175100017510000000207211704002604013646 00000000000000# This file is part of "xtrace" # Copyright (C) 2008 Bernhard R. Link # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA EXTENSION "Generic Event Extension" ge USE core REQUESTS QueryVersion RESPONDS END EVENTS Generic SPECIAL END ERRORS END REQUEST QueryVersion 4 "major version" UINT16 6 "minor version" UINT16 END RESPONSE QueryVersion 8 "major version" UINT16 10 "minor version" UINT16 END EVENT Generic 1 extension CARD8 4 length UINT32 8 evtype CARD16 10 data LISTofCARD8 END EOF xtrace-1.3.1/render.proto0000644000175100017510000002322711704002604012271 00000000000000# This file is part of "xtrace" # Copyright (C) 2005, 2009 Bernhard R. Link # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #/ # This file is based on the render.h and renderproto.h files # from the Xorg server: # Copyright © 2000 SuSE, Inc. # # 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 SuSE not be used in advertising or # publicity pertaining to distribution of the software without specific, # written prior permission. SuSE makes no representations about the # suitability of this software for any purpose. It is provided "as is" # without express or implied warranty. # # SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE # 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: Keith Packard, SuSE, Inc. #/ NEEDS "requests.proto" EXTENSION "RENDER" Render USE core REQUESTS QueryVersion RESPONDS QueryPictFormats RESPONDS QueryPictIndexValues RESPONDS UNKNOWN CreatePicture ChangePicture SetPictureClipRectangles FreePicture Composite Scale Trapezoids Triangles TriStrip TriFan UNKNOWN UNKNOWN UNKNOWN CreateGlyphSet ReferenceGlyphSet FreeGlyphSet AddGlyphs UNKNOWN FreeGlyphs CompositeGlyphs8 CompositeGlyphs16 CompositeGlyphs32 FillRectangles CreateCursor SetPictureTransform QueryFilters RESPONDS SetPictureFilter # 0.8 CreateAnimCursor # 0.9 AddTraps /*32*/ END EVENTS END ERRORS BadPictFormat BadPicture BadPictOp BadGlyphSet BadGlyph END CONSTANTS picttype 0 Indexed 1 Direct END TYPE PictType ENUM8 picttype CONSTANTS pictop 0 Minimum/Clear 1 Src 2 Dst 3 Over 4 OverReverse 5 In 6 InReverse 7 Out 8 OutReverse 9 Atop 10 AtopReverse 11 Xor 12 Add 13 Saturate/Maximum 0x10 DisjointMinimum #0x10 DisjointClear 0x11 DisjointSrc 0x12 DisjointDst 0x13 DisjointOver 0x14 DisjointOverReverse 0x15 DisjointIn 0x16 DisjointInReverse 0x17 DisjointOut 0x18 DisjointOutReverse 0x19 DisjointAtop 0x1a DisjointAtopReverse #0x1b DisjointXor 0x1b DisjointMaximum 0x20 ConjointMinimum #0x20 ConjointClear 0x21 ConjointSrc 0x22 ConjointDst 0x23 ConjointOver 0x24 ConjointOverReverse 0x25 ConjointIn 0x26 ConjointInReverse 0x27 ConjointOut 0x28 ConjointOutReverse 0x29 ConjointAtop 0x2a ConjointAtopReverse 0x2b ConjointXor #0x2b ConjointMaximum END TYPE PictOp ENUM8 pictop CONSTANTS polyedge 0 Sharp 1 Smooth END TYPE PolyEdge ENUM8 polyedge CONSTANTS polymode 0 Precise 1 Imprecise END TYPE PolyMode ENUM8 polymode CONSTANTS subpixel 0 Unknown 1 HorizontalRGB 2 HorizontalBGR 3 VerticalRGB 4 VerticalBGR 5 None END TYPE SUBPIXEL ENUM8 subpixel TYPE VisualID CARD32 TYPE PICTURE CARD32 TYPE PICTFORMAT CARD32 TYPE GLYPHSET CARD32 LIST PictFormInfo length 28 0 id PICTFORMAT 4 type PictType 5 depth CARD8 8 red CARD16 10 redMask CARD16 12 green CARD16 14 greenMask CARD16 16 blue CARD16 18 blueMask CARD16 20 alpha CARD16 22 alphaMask CARD16 24 colormap COLORMAP END LIST PictFormats variable min-length 28 GET 0 0 formats LISTofPictFormInfo END LIST PictVisual length 8 0 visual VisualID 4 format PICTFORMAT END LIST PictDepth variable min-length 8 0 depth CARD8 2 nPictVisuals COUNT16 8 visuals LISTofPictVisual END LIST PictScreen variable min-length 8 0 nDepth COUNT32 4 fallback PICTFORMAT 8 depths LISTofPictDepth END REQUEST QueryPictFormats ALIASES Empty RESPONSE QueryPictFormats 8 numFormats PUSH32 12 numScreens COUNT32 32 formats LISTofPictFormats 12 numScreens COUNT32 LATER screens LISTofPictScreen 24 numSubpixel COUNT32 LATER subpixels LISTofCARD32 constants subpixel END LIST IndexValue length 12 0 pixel CARD32 4 red CARD16 6 green CARD16 8 blue CARD16 10 alpha CARD16 END LIST POINTFIXED length 8 0 x FIXED 4 y FIXED END STRUCT LineFixed length 16 0 x1 FIXED 4 y1 FIXED 8 x2 FIXED 12 y2 FIXED END LIST TRIANGLE length 24 0 x1 FIXED 4 y1 FIXED 8 x2 FIXED 12 y2 FIXED 16 x3 FIXED 20 y3 FIXED END LIST TRAPEZOID length 40 0 top FIXED 4 bottom FIXED 8 left LineFixed 24 right LineFixed END #/* # * requests and replies # */ REQUEST QueryVersion 4 majorVersion UINT32 8 minorVersion UINT32 END RESPONSE QueryVersion 8 majorVersion UINT32 12 minorVersion UINT32 END REQUEST QueryPictIndexValues 4 format PICTFORMAT END RESPONSE QueryPictIndexValues 8 numIndexValues COUNT32 32 IndexValues LISTofIndexValue END VALUES RenderCP 1<<0 repeat BOOL 1<<1 alphaMap PICTURE constants none 1<<2 alpha-x-origin INT16 1<<3 alpha-y-origin INT16 1<<4 clip-x-origin INT16 1<<5 clip-y-origin INT16 1<<6 clip-mask PIXMAP constants none 1<<7 graphics-exposure BOOL 1<<8 subwindow-mode SubwindowMode 1<<9 poly-edge PolyEdge 1<<10 poly-mode PolyMode 1<<11 dither ATOM constants none 1<<12 component-alpha BOOL END REQUEST CreatePicture 4 pid PICTURE 8 drawable DRAWABLE 12 format PICTFORMAT 16 mask STORE32 20 values LISTofRenderCP END REQUEST ChangePicture 4 picture PICTURE 8 mask STORE32 12 values LISTofRenderCP END REQUEST SetPictureClipRectangles 4 picture PICTURE 8 xOrigin INT16 10 yOrigin INT16 12 rectangles LISTofRECTANGLE END REQUEST FreePicture 4 picture PICTURE END REQUEST Composite 4 op PictOp 8 src PICTURE 12 mask PICTURE constants none 16 dst PICTURE 20 xSrc INT16 22 ySrc INT16 24 xMask INT16 26 yMask INT16 28 xDst INT16 30 yDst INT16 32 width UINT16 34 height UINT16 END REQUEST Scale 4 src PICTURE 8 dst PICTURE 12 colorScale UINT32 16 alphaScale UINT32 20 xSrc INT16 22 ySrc INT16 24 xDst INT16 26 yDst INT16 28 width UINT16 30 height UINT16 END REQUEST Trapezoids 4 op PictOp 8 src PICTURE 20 xSrc INT16 22 ySrc INT16 12 dst PICTURE 16 maskFormat PICTFORMAT constants none 24 trapezoids LISTofTRAPEZOID END REQUEST Triangles 4 op PictOp 8 src PICTURE 20 xSrc INT16 22 ySrc INT16 12 dst PICTURE 16 maskFormat PICTFORMAT constants none 20 triangles LISTofTRIANGLE END REQUEST TriStrip 4 op PictOp 8 src PICTURE 20 xSrc INT16 22 ySrc INT16 12 dst PICTURE 16 maskFormat PICTFORMAT constants none 20 points LISTofPOINTFIXED END REQUEST TriFan 4 op PictOp 8 src PICTURE 20 xSrc INT16 22 ySrc INT16 12 dst PICTURE 16 maskFormat PICTFORMAT constants none 20 points LISTofPOINTFIXED END REQUEST CreateGlyphSet 4 gsid GLYPHSET 8 format PICTFORMAT END REQUEST ReferenceGlyphSet 4 gsid GLYPHSET 8 existing GLYPHSET END REQUEST FreeGlyphSet 4 glyphset GLYPHSET END LIST GLYPHINFO length 12 0 width UINT16 2 height UINT16 4 x INT16 6 y INT16 8 xOff INT16 10 yOff INT16 END REQUEST AddGlyphs 4 glyphset GLYPHSET 8 nglyphs COUNT32 12 glyphids LISTofCARD32 8 nglyphs COUNT32 LATER glyphs LISTofGLYPHINFO RESET_COUNTER LATER data LISTofCARD8 END REQUEST FreeGlyphs 4 glyphset GLYPHSET 8 glyphs LISTofCARD32 END LIST GlyphElt8 variable min-length 8 4 deltax INT16 6 deltay INT16 IF 0 CARD8 255 8 glyphset GLYPHSET NEXT 12 ELSE 0 len COUNT8 8 glyphs LISTofCARD8 ROUND END LIST GlyphElt16 variable min-length 8 4 deltax INT16 6 deltay INT16 IF 0 CARD8 255 8 glyphset GLYPHSET NEXT 12 ELSE 0 len COUNT8 8 glyphs LISTofCARD16 ROUND END LIST GlyphElt32 variable min-length 8 4 deltax INT16 6 deltay INT16 IF 0 CARD8 255 8 glyphset GLYPHSET NEXT 12 ELSE 0 len COUNT8 8 glyphs LISTofCARD32 END REQUEST CompositeGlyphs8 4 op PictOp 8 src PICTURE 12 dst PICTURE 16 maskFormat PICTFORMAT constants none 20 glyphset GLYPHSET 24 xSrc INT16 26 ySrc INT16 28 glyphcmds LISTofGlyphElt8 END REQUEST CompositeGlyphs16 4 op PictOp 8 src PICTURE 12 dst PICTURE 16 maskFormat PICTFORMAT constants none 20 glyphset GLYPHSET 24 xSrc INT16 26 ySrc INT16 28 glyphcmds LISTofGlyphElt16 END REQUEST CompositeGlyphs32 4 op PictOp 8 src PICTURE 12 dst PICTURE 16 maskFormat PICTFORMAT constants none 20 glyphset GLYPHSET 24 xSrc INT16 26 ySrc INT16 28 glyphcmds LISTofGlyphElt32 END # 0.1 and higher REQUEST FillRectangles 4 op PictOp 8 dst PICTURE 12 red CARD16 14 green CARD16 16 blue CARD16 18 alpha CARD16 20 rects LISTofRECTANGLE END # 0.5 and higher REQUEST CreateCursor 4 cid CURSOR 8 src PICTURE 12 x UINT16 14 y UINT16 END # 0.6 and higher REQUEST SetPictureTransform 4 picture PICTURE 8 transform LISTofFIXED END REQUEST QueryFilters 4 drawable DRAWABLE END RESPONSE QueryFilters 8 numAliases COUNT32 32 Aliases LISTofCARD16 ROUND 12 numFilters COUNT32 LATER Filters LISTofSTRING8 END REQUEST SetPictureFilter 4 picture PICTURE 8 nbytes COUNT16 12 name STRING8 ROUND RESET_COUNTER LATER values LISTofFIXED END # 0.8 and higher LIST AnimCursorElt length 8 0 cursor CURSOR 4 delay CARD32 END REQUEST CreateAnimCursor 4 cid CURSOR 8 cursors LISTofAnimCursorElt END # 0.9 and higher STRUCT SPANFIX length 12 0 l FIXED 4 r FIXED 8 y FIXED END LIST TRAP length 24 0 top SPANFIX 12 bottom SPANFIX END REQUEST AddTraps 4 picture PICTURE 8 x-ofs INT16 10 y-ofs INT16 12 traps LISTofTRAP END EOF xtrace-1.3.1/events.proto0000644000175100017510000002052611704002604012315 00000000000000# This file is part of "xtrace" # Copyright (C) 2005 Bernhard R. Link # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # # This file is based on the # X Window System Protocol # X Consortium Standard # X Version 11, Release 6.4 # # Robert W. Scheifler # X Consortium, Inc. # # with the following trademark and copyright notices and acknowlegdgments: ## ## X Window System is a trademark of X Consortium, Inc. ## ## Copyright (C) 1986, 1987, 1988, 1994 X Consortium ## ## Permission is hereby granted, free of charge, to any person ## obtaining a copy of this software and associated documenta- ## tion files (the ``Software''), to deal in the Software with- ## out restriction, including without limitation the rights to ## use, copy, modify, merge, publish, distribute, sublicense, ## and/or sell copies of the Software, and to permit persons to ## whom the Software is furnished to do so, subject to the fol- ## lowing conditions: ## ## The above copyright notice and this permission notice 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 PUR- ## POSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE X CONSOR- ## TIUM 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. ## ## Except as contained in this notice, the name of the X Con- ## sortium shall not be used in advertising or otherwise to ## promote the sale, use or other dealings in this Software ## without prior written authorization from the X Consortium. ## ## Acknowledgments ## ## The primary contributers to the X11 protocol are: ## ## Dave Carver (Digital HPW) ## Branko Gerovac (Digital HPW) ## Jim Gettys (MIT/Project Athena, Digital) ## Phil Karlton (Digital WSL) ## Scott McGregor (Digital SSG) ## Ram Rao (Digital UEG) ## David Rosenthal (Sun) ## Dave Winchell (Digital UEG) ## ## The implementors of initial server who provided useful input ## are: ## ## Susan Angebranndt (Digital) ## Raymond Drewry (Digital) ## Todd Newman (Digital) ## ## The invited reviewers who provided useful input are: ## ## Andrew Cherenson (Berkeley) ## Burns Fisher (Digital) ## Dan Garfinkel (HP) ## Leo Hourvitz (Next) ## Brock Krizan (HP) ## David Laidlaw (Stellar) ## Dave Mellinger (Interleaf) ## Ron Newman (MIT) ## John Ousterhout (Berkeley) ## Andrew Palay (ITC CMU) ## Ralph Swick (MIT) ## Craig Taylor (Sun) ## Jeffery Vroom (Stellar) ## NEEDS "requests.proto" NAMESPACE core EVENTS UNKNOWN UNKNOWN KeyPress KeyRelease ButtonPress ButtonRelease MotionNotify EnterNotify LeaveNotify FocusIn FocusOut KeymapNotify Expose GraphicsExposure NoExposure VisibilityNotify CreateNotify DestroyNotify UnmapNotify MapNotify MapRequest ReparentNotify ConfigureNotify ConfigureRequest GravityNotify ResizeRequest CirculateNotify CirculateRequest PropertyNotify SelectionClear SelectionRequest SelectionNotify ColormapNotify ClientMessage MappingNotify Generic SPECIAL END templateEVENT Key 1 keycode KEYCODE 4 time TIMESTAMP 8 root WINDOW 12 event WINDOW 16 child WINDOW constants none 20 root-x INT16 22 root-y INT16 24 event-x INT16 26 event-y INT16 28 state SETofKEYBUTMASK 30 same-screen BOOL END EVENT KeyPress ALIASES Key EVENT KeyRelease ALIASES Key templateEVENT Button 1 button BUTTON 4 time TIMESTAMP 8 root WINDOW 12 event WINDOW 16 child WINDOW constants none 20 root-x INT16 22 root-y INT16 24 event-x INT16 26 event-y INT16 28 state SETofKEYBUTMASK 30 same-screen BOOL END EVENT ButtonPress ALIASES Button EVENT ButtonRelease ALIASES Button CONSTANTS normalhint 0 Normal 1 Hint END EVENT MotionNotify 1 detail ENUM8 normalhint 4 time TIMESTAMP 8 root WINDOW 12 event WINDOW 16 child WINDOW constants none 20 root-x INT16 22 root-y INT16 24 event-x INT16 26 event-y INT16 28 state SETofKEYBUTMASK 30 same-screen BOOL END CONSTANTS enterdetail 0 Ancestor 1 Virtual 2 Inferior 3 Nonlinear 4 NonlinearVirtual 5 Pointer 6 PointerRoot 7 None END CONSTANTS grabmode 0 Normal 1 Grab 2 Ungrab 3 WhileGrabbed END BITMASK focusscreen 0x01 focus 0x02 same-screen 0xFC unused END EVENT EnterNotify 1 detail ENUM8 enterdetail 30 mode ENUM8 grabmode 31 flags BITMASK8 focusscreen 4 time TIMESTAMP 8 root WINDOW 12 event WINDOW 16 child WINDOW constants none 20 root-x INT16 22 root-y INT16 24 event-x INT16 26 event-y INT16 28 state SETofKEYBUTMASK END EVENT LeaveNotify ALIASES EnterNotify EVENT FocusIn 1 detail ENUM8 enterdetail 4 event WINDOW 8 mode ENUM8 grabmode END EVENT FocusOut ALIASES FocusIn EVENT KeymapNotify 1 "keys(0-7 omitted)" LISTofCARD8 END EVENT Expose 4 window WINDOW 8 x UINT16 10 y UINT16 12 width UINT16 14 height UINT16 16 count CARD16 END EVENT GraphicsExposure 4 drawable DRAWABLE 8 x UINT16 10 y UINT16 12 width UINT16 13 height UINT16 14 minor-opcode CARD16 18 count CARD16 20 major-opcode CARD8 END EVENT NoExposure 4 drawable DRAWABLE 8 minor-opcode CARD16 10 major-opcode CARD8 END CONSTANTS obscure 0 Unobscured 1 PartiallyObscured 2 FullyObscured END EVENT VisibilityNotify 4 window WINDOW 8 state ENUM8 obscure END EVENT CreateNotify 4 parent WINDOW 8 window WINDOW 12 x INT16 14 y INT16 16 width UINT16 18 height UINT16 20 border-width UINT16 22 override-redirect BOOL END EVENT DestroyNotify 4 event WINDOW 8 window WINDOW END EVENT UnmapNotify 4 event WINDOW 8 window WINDOW 12 from-configure BOOL END EVENT MapNotify 4 event WINDOW 8 window WINDOW 12 override-redirect BOOL END EVENT MapRequest 4 parent WINDOW 8 window WINDOW END EVENT ReparentNotify 4 event WINDOW 8 window WINDOW 12 parent WINDOW 16 x INT16 18 y INT16 20 override-redirect BOOL END EVENT ConfigureNotify 4 event WINDOW 8 window WINDOW 12 above-sibling WINDOW constants none 16 x INT16 18 y INT16 20 width UINT16 22 height UINT16 24 border-width UINT16 26 override-redirect BOOL END BITMASK configure_mask 0x0001 x 0x0002 y 0x0004 width 0x0008 height 0x0010 border-width 0x0020 sibling 0x0040 stack-mode END EVENT ConfigureRequest 4 parent WINDOW 8 window WINDOW 26 value-mask BITMASK16 configure_mask 1 stack-mode ENUM8 stack_mode 12 sibling WINDOW constants none 16 x INT16 18 y INT16 20 width UINT16 22 height UINT16 24 border-width UINT16 END EVENT GravityNotify 4 event WINDOW 8 window WINDOW 12 x INT16 14 y INT16 END EVENT ResizeRequest 4 window WINDOW 8 width UINT16 10 height UINT16 END CONSTANTS topbottom 0 Top 1 Bottom END EVENT CirculateNotify 4 event WINDOW 8 window WINDOW 16 place ENUM8 topbottom END EVENT CirculateRequest ALIASES CirculateNotify CONSTANTS newdeleted 0 NewValue 1 Deleted END EVENT PropertyNotify 4 window WINDOW 8 atom ATOM 12 time TIMESTAMP 16 state ENUM8 newdeleted END EVENT SelectionClear 4 time TIMESTAMP 8 owner WINDOW 12 selection ATOM END EVENT SelectionRequest 4 time TIMESTAMP constants curtime 8 owner WINDOW 12 requestor WINDOW 16 selection ATOM 20 target ATOM 24 property ATOM constants none END EVENT SelectionNotify 4 time TIMESTAMP constants curtime 8 requestor WINDOW 12 selection ATOM 16 target ATOM 20 property ATOM constants none END CONSTANTS uninstalledinstalled 0 Uninstalled 1 Installed END EVENT ColormapNotify 4 window WINDOW 8 colormap COLORMAP constants none 12 new BOOL 13 state ENUM8 uninstalledinstalled END EVENT ClientMessage 1 format CARD8 4 window WINDOW 8 type ATOM 12 data LISTofCARD8 END CONSTANTS modkeypoi 0 Modifier 1 Keyboard 2 Pointer END EVENT MappingNotify 4 request ENUM8 modkeypoi 5 first-keycode KEYCODE 6 count CARD8 END EVENT Generic 1 extension CARD8 4 length UINT32 8 evtype CARD16 10 data LISTofCARD8 END EOF xtrace-1.3.1/x11server.c0000644000175100017510000000674611704002604011740 00000000000000/* This file is part of "xtrace" * Copyright (C) 2005 Bernhard R. Link * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "xtrace.h" int listenForClients(const char *displayname,int family,int display) { int fd; const char *msg; struct sockaddr_in inaddr; struct sockaddr_un unaddr; struct sockaddr *address; size_t addresslen; fd = socket(family,SOCK_STREAM,0); if( fd < 0 ) { int e = errno; fprintf(stderr,"Error opening socket for '%s': %d=%s\n",displayname,e,strerror(e)); return -1; } if( family == AF_INET ) { int tmp=1; inaddr.sin_family = family; inaddr.sin_port = calculateTCPport(display); inaddr.sin_addr.s_addr = htonl(INADDR_ANY); setsockopt(fd,SOL_SOCKET,SO_KEEPALIVE,(char *)&tmp,sizeof(tmp)); address = (struct sockaddr*)&inaddr; addresslen = sizeof(inaddr); } else { msg = generateSocketName(&unaddr,display); if( msg != NULL ) { close(fd); fprintf(stderr,"Error calculating socket name for '%s': %s\n",displayname,msg); return -1; } unlink(unaddr.sun_path); address = (struct sockaddr*)&unaddr; addresslen = sizeof(unaddr); } if( bind(fd,address,addresslen) < 0 ) { int e = errno; close(fd); fprintf(stderr,"Error binding socket for '%s': %d=%s\n",displayname,e,strerror(e)); return -1; } if( listen(fd,20) < 0 ) { int e = errno; close(fd); fprintf(stderr,"Error listening for '%s': %d=%s\n",displayname,e,strerror(e)); return -1; } return fd; } #ifndef HAVE_ASPRINTF #warning using asprint replacement static int asprintf(char **r, const char *fmt, ...) { va_list ap; /* that's ugly, but we will not need longer values here... */ char buffer[100]; int len; va_start(ap, fmt); len = vsnprintf(buffer, 99, fmt, ap); buffer[99] = '\0'; *r = strdup(buffer); if( *r == NULL ) return -1; return len; } #endif int acceptClient(int family,int listener, char **from) { int fd; socklen_t len; if( family == AF_INET ) { struct sockaddr_in inaddr; len = sizeof(inaddr); fd = accept(listener, (struct sockaddr*)&inaddr, &len); if( asprintf(from,"%s:%d",inet_ntoa(inaddr.sin_addr),ntohs(inaddr.sin_port)) < 0 || *from == NULL ) { close(fd); return -1; } } else if( family == AF_UNIX ) { struct sockaddr_un unaddr; len = sizeof(unaddr); fd = accept(listener, (struct sockaddr*)&unaddr, &len); if( len > sizeof(sa_family_t) ) { *from = strndup(unaddr.sun_path,len-sizeof(sa_family_t)); } else *from = strdup("unknown(local)"); if( *from == NULL ) { close(fd); return -1; } } else return -1; return fd; } xtrace-1.3.1/Makefile.in0000644000175100017510000006615011765365443012020 00000000000000# Makefile.in generated by automake 1.11.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : bin_PROGRAMS = xtrace$(EXEEXT) subdir = . DIST_COMMON = README $(am__configure_deps) $(dist_man_MANS) \ $(dist_pkgdata_DATA) $(noinst_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/config.h.in \ $(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \ ac/depcomp ac/install-sh ac/missing ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" \ "$(DESTDIR)$(pkgdatadir)" PROGRAMS = $(bin_PROGRAMS) am_xtrace_OBJECTS = main.$(OBJEXT) x11common.$(OBJEXT) \ x11client.$(OBJEXT) x11server.$(OBJEXT) parse.$(OBJEXT) \ copyauth.$(OBJEXT) atoms.$(OBJEXT) translate.$(OBJEXT) \ stringlist.$(OBJEXT) xtrace_OBJECTS = $(am_xtrace_OBJECTS) xtrace_LDADD = $(LDADD) DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/ac/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(xtrace_SOURCES) DIST_SOURCES = $(xtrace_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } man1dir = $(mandir)/man1 NROFF = nroff MANS = $(dist_man_MANS) DATA = $(dist_pkgdata_DATA) HEADERS = $(noinst_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ if test -d "$(distdir)"; then \ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CPPFLAGS = -DPKGDATADIR='"$(pkgdatadir)"' xtrace_SOURCES = main.c x11common.c x11client.c x11server.c parse.c copyauth.c atoms.c translate.c stringlist.c noinst_HEADERS = xtrace.h parse.h stringlist.h translate.h dist_man_MANS = xtrace.1 MAINTAINERCLEANFILES = $(srcdir)/Makefile.in $(srcdir)/configure $(srcdir)/stamp-h.in $(srcdir)/aclocal.m4 $(srcdir)/config.h.in dist_pkgdata_DATA = all.proto bigfont.proto bigrequest.proto damage.proto dpms.proto dri2.proto errors.proto events.proto fixes.proto genericevents.proto glx.proto mitshm.proto randr.proto render.proto requests.proto saver.proto setup.proto shape.proto sync.proto vidmode.proto xinerama.proto xinput.proto xkb.proto xvideo.proto composite.proto dga.proto all: config.h $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .o .obj am--refresh: Makefile @: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): config.h: stamp-h1 @if test ! -f $@; then rm -f stamp-h1; else :; fi @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p; \ then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) xtrace$(EXEEXT): $(xtrace_OBJECTS) $(xtrace_DEPENDENCIES) $(EXTRA_xtrace_DEPENDENCIES) @rm -f xtrace$(EXEEXT) $(LINK) $(xtrace_OBJECTS) $(xtrace_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atoms.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/copyauth.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stringlist.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/translate.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/x11client.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/x11common.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/x11server.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` install-man1: $(dist_man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(dist_man_MANS)'; \ test -n "$(man1dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.1[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ done; } uninstall-man1: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man1dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(dist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.1[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) install-dist_pkgdataDATA: $(dist_pkgdata_DATA) @$(NORMAL_INSTALL) @list='$(dist_pkgdata_DATA)'; test -n "$(pkgdatadir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pkgdatadir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkgdatadir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgdatadir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgdatadir)" || exit $$?; \ done uninstall-dist_pkgdataDATA: @$(NORMAL_UNINSTALL) @list='$(dist_pkgdata_DATA)'; test -n "$(pkgdatadir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(pkgdatadir)'; $(am__uninstall_files_from_dir) ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @list='$(MANS)'; if test -n "$$list"; then \ list=`for p in $$list; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \ if test -n "$$list" && \ grep 'ab help2man is required to generate this page' $$list >/dev/null; then \ echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \ grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \ echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \ echo " typically \`make maintainer-clean' will remove them" >&2; \ exit 1; \ else :; fi; \ else :; fi $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__remove_distdir) dist-lzma: distdir tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma $(am__remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__remove_distdir) dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) dist-shar: distdir shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__remove_distdir) dist dist-all: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lzma*) \ lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir); chmod a+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @test -n '$(distuninstallcheck_dir)' || { \ echo 'ERROR: trying to run $@ with an empty' \ '$$(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ $(am__cd) '$(distuninstallcheck_dir)' || { \ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(MANS) $(DATA) $(HEADERS) config.h installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(pkgdatadir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-binPROGRAMS clean-generic mostlyclean-am distclean: distclean-am -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-hdr distclean-local distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dist_pkgdataDATA install-man install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man1 install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic \ maintainer-clean-local mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-dist_pkgdataDATA \ uninstall-man uninstall-man: uninstall-man1 .MAKE: all install-am install-strip .PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \ clean-binPROGRAMS clean-generic ctags dist dist-all dist-bzip2 \ dist-gzip dist-lzip dist-lzma dist-shar dist-tarZ dist-xz \ dist-zip distcheck distclean distclean-compile \ distclean-generic distclean-hdr distclean-local distclean-tags \ distcleancheck distdir distuninstallcheck dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-dist_pkgdataDATA \ install-dvi install-dvi-am install-exec install-exec-am \ install-html install-html-am install-info install-info-am \ install-man install-man1 install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ maintainer-clean-local mostlyclean mostlyclean-compile \ mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ uninstall-am uninstall-binPROGRAMS uninstall-dist_pkgdataDATA \ uninstall-man uninstall-man1 distclean-local: -rm -rf $(srcdir)/autom4te.cache maintainer-clean-local: -rm -rf $(srcdir)/ac # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: xtrace-1.3.1/AUTHORS0000644000175100017510000000042311704002604010766 00000000000000Bernhard R. Link Julien Cristau (jcristau%debian.org) Contributions by: Justin Pryzby (justinpryzby%users.sourceforge.net) manpage fixes Bruce Guenter (bruce%untroubled.org) starting a client given at the command line RALOVICH, Kristóf glx.inc xtrace-1.3.1/bigfont.proto0000644000175100017510000000632211704002604012437 00000000000000# This file is part of "xtrace" # Copyright (C) 2007 Bernhard R. Link # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # # This file is based on /usr/include/X11/extensions/xf86bigf{ont,str}.h, which is: ## Copyright (c) 1999-2000 Bruno Haible ## Copyright (c) 1999-2000 The XFree86 Project, Inc. ## ## 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, and/or sell ## copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice 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 ## XFREE86 PROJECT 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. ## ## Except as contained in this notice, the name of the XFree86 Project shall not ## be used in advertising or otherwise to promote the sale, use or other dealings ## in this Software without prior written authorization from the XFree86 Project. EXTENSION "XFree86-Bigfont" bigfont USE core REQUESTS QueryVersion RESPONDS QueryFont RESPONDS END EVENTS END ERRORS END BITMASK xf86bigfont_capabilities 1 LocalShm END TYPE xf86bigfont_capabilities BITMASK32 xf86bigfont_capabilities BITMASK xf86bigfont_flags 1 Shm END TYPE xf86bigfont_flags BITMASK32 xf86bigfont_flags REQUEST QueryVersion END RESPONSE QueryVersion 8 major-version UINT16 10 minor-version UINT16 1 capabilities xf86bigfont_capabilities 12 uid UINT32 16 gid UINT32 20 signature UINT32 END REQUEST QueryFont 4 id UINT32 8 flags xf86bigfont_flags END RESPONSE QueryFont 8 min-bounds CHARINFO 24 max-bounds CHARINFO 40 min-char-or-byte2 CARD16 42 max-char-or-byte2 CARD16 44 default-char CARD16 48 draw-direction ENUM8 direction 49 min-byte1 CARD8 50 max-byte1 CARD8 51 all-chars-exists BOOL 52 font-ascent INT16 54 font-descent INT16 64 shmid COUNT32 68 shmsegoffset COUNT32 46 nFontProps COUNT16 72 properties LISTofFONTPROP 60 nUniqCharInfos COUNT32 LATER uniq-char-infos LISTofCHARINFO 56 nCharInfos COUNT32 LATER char-info-offsets LISTofCARD16 END EOF xtrace-1.3.1/xtrace.10000644000175100017510000001323511704002604011273 00000000000000.TH XTRACE 1 "26 June 2009" "xtrace" XTRACE .SH NAME xtrace \- trace communication between X11 client and server .SH SYNOPSIS .BR xtrace " [ " \fIoptions\fP " ] [ " \-s " | " \-k " ] [ [ " \-W " ] [ " -- " ] " "\fIcommand args ...\fP" " ]" .SH DESCRIPTION Xtrace fakes an X server and forwards all connections to a real X server, displaying the communication between clients in (well, theoretically) human readable form. If a command is given, .B xtrace executes the named command with .B $DISPLAY set to the faked X server. If that command exits before any connections are made, .B xtrace exits immediately unless .B \-W is specified. .SH OPTIONS .TP .B \-I \fIdirectory\fP Look into \fIdirectory\fP for protocol description files. (i.e. the directory where the \fB.proto\fP files can be found). .TP .B \-s \fR|\fP \-\-stopwhendone \fR(default)\fP Terminate when all forwarded clients have disconnected. (Or when a program was run once the program has finished and all connections are closed). .TP .B \-k \fR|\fP \-\-keeprunning If all clients disconnected, wait for new ones to connect. .TP .B \-W \fR|\fP \-\-waitforclient Do not stop when the started program terminates before any connection was made. (Might be necessary if the program forks to background). .TP .B \-d \fIname\fP \fR|\fP \-\-display \fIname\fP Forward connections to the X server specified by \fIname\fP instead of the one specified by the environment variable \fBDISPLAY\fP. .TP .B \-D \fIname\fP \fR|\fP \-\-fakedisplay \fIname\fP Fake display \fIname\fP instead of \fB$FAKEDISPLAY\fP or \fB:9\fP respectively. .TP .B \-f \fIfilename\fP \fR|\fP \-\-authfile \fIfilename\fP Add an \fB-f\fP \fIfilename\fP to the arguments for all calls to xauth to get the authentication tokens of the X server to connect to. .TP .B \-F \fIfilename\fP \fR|\fP \-\-newauthfile \fIfilename\fP Add an \fB-f\fP \fIfilename\fP to the arguments for all calls to xauth to save the authentication tokens to connect to the faked X server. .TP .B \-c \fR|\fP \-\-copyauthentication \fR(default)\fP Copy the authentication tokens for the X server to connect to so that clients connecting to our fake server will use them. The commands run are roughly equivalent to: \fBxauth add $FAKEDISPLAY . `xauth list $DISPLAY | awk '$2=="MIT-MAGIC-COOKIE-1" {print $3}'`\fP Not that only \fBMIT-MAGIC-COOKIE-1\fP tokens are copied as xtrace does not yet support to change the authentication tokens so that \fBXDM-AUTHORIZATION-1\fP would be possible. .TP .B \-n \fR|\fP \-\-nocopyauthentication Do not call \fBxauth\fP and do fiddle with authentication tokens but leave that to the user to handle. .TP .B \-e \fR|\fP \-\-denyextensions Modify all server replies to say there are no extensions available. (As xtrace does supports only a small number of extensions anyway and calls all extended requests "unknown" and all replies to such requests "unexpected"). .TP .B \-w \fR|\fP \-\-readwritedebug Print how many bytes are read and/or written when. .TP .B \-m \fIcount\fP \fR|\fP \-\-maxklistlength \fIcount\fP Print only the first \fIcount\fP many elements of all lists. .TP .B \-i \fR|\fP \-\-interactive Only sent requests from the client to the server after interactive confirmation. Confirmation is given by pressing enter or a number followed by enter via stdin. This can give funny results when multiple clients are tunneled. .TP .B \-o \fR|\fP \-\-outfile \fIfilename\fP Dump output into \fIfilename\fP instead of stdout. .TP .B \-b \fR|\fP \-\-buffered Do not write every line on its own but wait until buffers are full. Speeds up things a little bit when outputting to a file. Not very useful at all together with \fB\-i\fP. .TP .B \-\-timestamps Print a timestamp before each line. Note that the time a packet is printed is between the time a packet is received and the time a packet is sent, but it gives no other information than that. .TP .B \-\-relative-timestamps Print a timestamp relative to the beginning of the connection before each line. Note that the time a packet is printed is between the time a packet is received and the time a packet is sent, but it gives no other information than that. .TP .B \-\-monotonic-timestamps Print a CLOCK_MONOTONIC (see .BR clock_gettime (3)) timestamp each time a package is printed. This is likely to be the uptime of your system. Note that the time a packet is printed is between the time a packet is received and the time a packet is sent, but it gives no other information than that. .TP .B \-\-print-offsets Print offsets of all fields (useful to debug nested lists in protocol descriptions) .TP .B \-\-print-counts Print counts (useful to debug lists in protocol descriptions) .SH "ENVIRONMENT VARIABLES" .TP .B DISPLAY Without \fB\-\-display\fP the content of this variable is used to determine the server to connect to. (And without \fB\-n\fP given to \fBxauth\fP to get the authentication tokens for this display.) .TP .B FAKEDISPLAY Without \fB\-\-fakedisplay\fP the content of this variable is used to determine how to listen for clients. (And without \fB\-n\fP given to \fBxauth\fP to set the authentication tokens for this display.) If neither is given, \fBxtrace\fP will try \fB:9\fP .TP .B XAUTHORITY Without \fB-n\fP and without \fB-f\fP or \fB-F\fP your \fBxauth\fP program will most likely look into this variable for the file to get/save the authentication tokens from/into. If this is not set it will most likely use \fI$HOME\fP\fB/.Xauthority\fP. .SH "REPORTING BUGS" Report bugs to or the Debian BTS. .SH "SEE ALSO" .BR xauth (1), .BR x (7x), .SH COPYRIGHT Copyright \(co 2005 Bernhard R. Link .br This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. xtrace-1.3.1/dpms.proto0000644000175100017510000000304711704002604011753 00000000000000# This file is part of "xtrace" # Copyright (C) 2008 Bernhard R. Link # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA EXTENSION "DPMS" Dpms USE core REQUESTS GetVersion RESPONDS Capable RESPONDS GetTimeouts RESPONDS SetTimeouts Enable Disable ForceLevel Info RESPONDS END EVENTS END ERRORS END CONSTANTS dpms_level 0 on 1 standby 2 suspend 3 off END TYPE DPMS_LEVEL ENUM16 dpms_level REQUEST GetVersion 4 "major version" UINT16 6 "minor version" UINT16 END RESPONSE GetVersion 8 "major version" UINT16 10 "minor version" UINT16 END REQUEST Capable ALIASES Empty RESPONSE Capable 8 capable BOOL END REQUEST GetTimeouts ALIASES Empty RESPONSE GetTimeouts 8 standby UINT16 10 suspend UINT16 12 off UINT16 END REQUEST SetTimeouts 4 standby UINT16 6 suspend UINT16 8 off UINT16 END REQUEST Enable ALIASES Empty REQUEST Disable ALIASES Empty REQUEST ForceLevel 4 level DPMS_LEVEL END REQUEST Info ALIASES Empty RESPONSE Info 8 power_level DPMS_LEVEL 10 state BOOL END EOF xtrace-1.3.1/xinerama.proto0000644000175100017510000000173211704002604012613 00000000000000EXTENSION "XINERAMA" Xinerama USE core REQUESTS QueryVersion RESPONDS GetState RESPONDS GetScreenCount RESPONDS GetScreenSize RESPONDS IsActive RESPONDS QueryScreens RESPONDS END EVENTS END ERRORS END LIST ScreenInfo length 8 0 x INT16 2 y INT16 4 width UINT16 6 height UINT16 END REQUEST QueryVersion 4 major-version UINT8 5 minor-version UINT8 END RESPONSE QueryVersion 8 major-version UINT16 10 minor-version UINT16 END REQUEST GetState 4 window WINDOW END RESPONSE GetState 1 state CARD8 constants bool 8 window WINDOW END REQUEST GetScreenCount 4 window WINDOW END RESPONSE GetScreenCount 1 ScreenCount INT8 8 window WINDOW END REQUEST GetScreenSize 4 window WINDOW 8 screen UINT32 END RESPONSE GetScreenSize 8 width UINT32 12 height UINT32 16 window WINDOW 20 screen UINT32 END REQUEST IsActive END RESPONSE IsActive 8 state CARD32 constants bool END REQUEST QueryScreens END RESPONSE QueryScreens 8 number COUNT32 32 screens LISTofScreenInfo END EOF xtrace-1.3.1/glx.proto0000644000175100017510000007120411704002604011602 00000000000000# This file is part of "xtrace" # Copyright (C) 2008,2009 RALOVICH, Kristóf # modifications/reformating Copyright (C) 2009 Bernhard R. Link # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA EXTENSION "GLX" glx USE core REQUESTS UNKNOWN glXRender glXRenderLarge glXCreateContext glXDestroyContext glXMakeCurrent RESPONDS glXIsDirect RESPONDS glXQueryVersion RESPONDS glXWaitGL UNSUPPORTED glXWaitX UNSUPPORTED glXCopyContext UNSUPPORTED /* 10 */ glXSwapBuffers glXUseXFont UNSUPPORTED glXCreateGLXPixmap UNSUPPORTED glXGetVisualConfigs RESPONDS glXDestroyGLXPixmap UNSUPPORTED glXVendorPrivate UNSUPPORTED glXVendorPrivateWithReply RESPONDS glXQueryExtensionsString RESPONDS UNSUPPORTED glXQueryServerString RESPONDS glXClientInfo /* 20 */ glXGetFBConfigs RESPONDS UNSUPPORTED glXCreatePixmap UNSUPPORTED glXDestroyPixmap UNSUPPORTED glXCreateNewContext UNSUPPORTED glXQueryContext RESPONDS UNSUPPORTED glXMakeContextCurrent RESPONDS UNSUPPORTED glXCreatePbuffer UNSUPPORTED glXDestroyPbuffer UNSUPPORTED glXGetDrawableAttributes RESPONDS UNSUPPORTED glXChangeDrawableAttributes UNSUPPORTED /* 30 */ glXCreateWindow UNSUPPORTED glXDeleteWindow UNSUPPORTED glXSetClientInfoARB UNSUPPORTED glXCreateContextAttribsARB UNSUPPORTED UNKNOWN UNKNOWN UNKNOWN UNKNOWN UNKNOWN UNKNOWN /* 40 */ UNKNOWN UNKNOWN UNKNOWN UNKNOWN UNKNOWN UNKNOWN UNKNOWN UNKNOWN UNKNOWN UNKNOWN /* 50 */ UNKNOWN UNKNOWN UNKNOWN UNKNOWN UNKNOWN UNKNOWN UNKNOWN UNKNOWN UNKNOWN UNKNOWN /* 60 */ UNKNOWN UNKNOWN UNKNOWN UNKNOWN UNKNOWN UNKNOWN UNKNOWN UNKNOWN UNKNOWN UNKNOWN /* 70 */ UNKNOWN UNKNOWN UNKNOWN UNKNOWN UNKNOWN UNKNOWN UNKNOWN UNKNOWN UNKNOWN UNKNOWN /* 80 */ UNKNOWN UNKNOWN UNKNOWN UNKNOWN UNKNOWN UNKNOWN UNKNOWN UNKNOWN UNKNOWN UNKNOWN /* 90 */ UNKNOWN UNKNOWN UNKNOWN UNKNOWN UNKNOWN UNKNOWN UNKNOWN UNKNOWN UNKNOWN UNKNOWN /* 100 */ glNewList glEndList glDeleteLists glGenLists RESPONDS glFeedbackBuffer UNSUPPORTED glSelectBuffer UNSUPPORTED glRenderMode RESPONDS UNSUPPORTED glFinish RESPONDS UNSUPPORTED glPixelStoref UNSUPPORTED glPixelStorei UNSUPPORTED /* 110 */ glReadPixels RESPONDS UNSUPPORTED glGetBooleanv RESPONDS UNSUPPORTED glGetClipPlane RESPONDS UNSUPPORTED glGetDoublev RESPONDS UNSUPPORTED glGetError RESPONDS glXGetFloatv RESPONDS UNSUPPORTED glGetIntegerv RESPONDS glGetLightfv RESPONDS UNSUPPORTED glGetLightiv RESPONDS UNSUPPORTED glGetMapdv RESPONDS UNSUPPORTED /* 120 */ glGetMapfv RESPONDS UNSUPPORTED glGetMapiv RESPONDS UNSUPPORTED glGetMaterialfv RESPONDS UNSUPPORTED glGetMaterialiv RESPONDS UNSUPPORTED glGetPixelMapfv RESPONDS UNSUPPORTED glGetPixelMapuiv RESPONDS UNSUPPORTED glGetPixelMapusv RESPONDS UNSUPPORTED glGetPolygonStipple RESPONDS UNSUPPORTED glGetString RESPONDS glGetTexEnvfv RESPONDS UNSUPPORTED /* 130 */ glGetTexEnviv RESPONDS UNSUPPORTED glGetTexGendv RESPONDS UNSUPPORTED glGetTexGenfv RESPONDS UNSUPPORTED glGetTexGeniv RESPONDS UNSUPPORTED glGetTexImage RESPONDS UNSUPPORTED glGetTexParameterfv RESPONDS UNSUPPORTED glGetTexParameteriv RESPONDS UNSUPPORTED glGetTexLevelParameterfv RESPONDS UNSUPPORTED glGetTexLevelParameteriv RESPONDS UNSUPPORTED glIsEnabled RESPONDS UNSUPPORTED /* 140 */ glIsList RESPONDS UNSUPPORTED glFlush UNSUPPORTED glAreTexturesResident RESPONDS UNSUPPORTED glDeleteTextures UNSUPPORTED glGenTextures RESPONDS UNSUPPORTED glIsTexture RESPONDS UNSUPPORTED glGetColorTable RESPONDS UNSUPPORTED glGetColorTableParameterfv RESPONDS UNSUPPORTED glGetColorTableParameteriv RESPONDS UNSUPPORTED glGetConvolutionFilter RESPONDS UNSUPPORTED /* 150 */ glGetConvolutionParameterfv RESPONDS UNSUPPORTED glGetConvolutionParameteriv RESPONDS UNSUPPORTED glGetSeparableFilter RESPONDS UNSUPPORTED glGetHistogram RESPONDS UNSUPPORTED glGetHistogramParameterfv RESPONDS UNSUPPORTED glGetHistogramParameteriv RESPONDS UNSUPPORTED glGetMinmax RESPONDS UNSUPPORTED glGetMinmaxParameterfv RESPONDS UNSUPPORTED glGetMinmaxParameteriv RESPONDS UNSUPPORTED glGetCompressedTexImage RESPONDS UNSUPPORTED /* 160 */ glDeleteQueries UNSUPPORTED glGenQueries RESPONDS UNSUPPORTED glIsQuery RESPONDS UNSUPPORTED glGetQueryiv RESPONDS UNSUPPORTED glGetQueryObjectiv RESPONDS UNSUPPORTED glGetQueryObjectuiv RESPONDS UNSUPPORTED END EVENTS PbufferClobber END ERRORS GLXBadContext GLXBadContextState GLXBadDrawable GLXBadPixmap GLXBadContextTag GLXBadCurrentWindow GLXBadRenderRequest GLXBadLargeRequest GLXUnsupportedPrivateRequest GLXBadFBConfig GLXBadPbuffer GLXBadCurrentDrawable GLXBadWindow END CONSTANTS gl_command 1 CallList 2 CallLists 3 ListBase 4 Begin 5 Bitmap 6 Color3bv 7 Color3dv 8 Color3fv 9 Color3iv 10 Color3sv 11 Color3ubv 12 Color3uiv 13 Color3usv 14 Color4bv 15 Color4dv 16 Color4fv 17 Color4iv 18 Color4sv 19 Color4ubv 20 Color4uiv 21 Color4usv 22 EdgeFlagv 23 End 24 Indexdv 25 Indexfv 26 Indexiv 27 Indexsv 28 Normal3bv 29 Normal3dv 30 Normal3fv 31 Normal3iv 32 Normal3sv 33 RasterPos2dv 34 RasterPos2fv 35 RasterPos2iv 36 RasterPos2sv 37 RasterPos3dv 38 RasterPos3fv 39 RasterPos3iv 40 RasterPos3sv 41 RasterPos4dv 42 RasterPos4fv 43 RasterPos4iv 44 RasterPos4sv 45 Rectdv 46 Rectfv 47 Rectiv 48 Rectsv 49 TexCoord1dv 50 TexCoord1fv 51 TexCoord1iv 52 TexCoord1sv 53 TexCoord2dv 54 TexCoord2fv 55 TexCoord2iv 56 TexCoord2sv 57 TexCoord3dv 58 TexCoord3fv 59 TexCoord3iv 60 TexCoord3sv 61 TexCoord4dv 62 TexCoord4fv 63 TexCoord4iv 64 TexCoord4sv 65 Vertex2dv 66 Vertex2fv 67 Vertex2iv 68 Vertex2sv 69 Vertex3dv 70 Vertex3fv 71 Vertex3iv 72 Vertex3sv 73 Vertex4dv 74 Vertex4fv 75 Vertex4iv 76 Vertex4sv 77 ClipPlane 78 ColorMaterial 79 CullFace 80 Fogf 81 Fogfv 82 Fogi 83 Fogiv 84 FrontFace 85 Hint 86 Lightf 87 Lightfv 88 Lighti 89 Lightiv 90 LightModelf 91 LightModelfv 92 LightModeli 93 LightModeliv 94 LineStipple 95 LineWidth 96 Materialf 97 Materialfv 98 Materiali 99 Materialiv 100 PointSize 101 PolygonMode 102 PolygonStipple 103 Scissor 104 ShadeModel 105 TexParameterf 106 TexParameterfv 107 TexParameteri 108 TexParameteriv 109 TexImage1D 110 TexImage2D 111 TexEnvf 112 TexEnvfv 113 TexEnvi 114 TexEnviv 115 TexGend 116 TexGendv 117 TexGenf 118 TexGenfv 119 TexGeni 120 TexGeniv 121 InitNames 122 LoadName 123 PassThrough 124 PopName 125 PushName 126 DrawBuffer 127 Clear 128 ClearAccum 129 ClearIndex 130 ClearColor 131 ClearStencil 132 ClearDepth 133 StencilMask 134 ColorMask 135 DepthMask 136 IndexMask 137 Accum 141 PopAttrib 142 PushAttrib 147 MapGrid1d 148 MapGrid1f 149 MapGrid2d 150 MapGrid2f 151 EvalCoord1dv 152 EvalCoord1fv 153 EvalCoord2dv 154 EvalCoord2fv 155 EvalMesh1 156 EvalPoint1 157 EvalMesh2 158 EvalPoint2 159 AlphaFunc 160 BlendFunc 161 LogicOp 162 StencilFunc 163 StencilOp 164 DepthFunc 165 PixelZoom 166 PixelTransferf 167 PixelTransferi 168 PixelMapfv 169 PixelMapuiv 170 PixelMapusv 171 ReadBuffer 172 CopyPixels 173 DrawPixels 174 DepthRange 175 Frustum 176 LoadIdentity 177 LoadMatrixf 178 LoadMatrixd 179 MatrixMode 180 MultMatrixf 181 MultMatrixd 182 Ortho 183 PopMatrix 184 PushMatrix 185 Rotated 186 Rotatef 187 Scaled 188 Scalef 189 Translated 190 Translatef 191 Viewport 192 PolygonOffset 194 Indexubv 195 ColorSubTable 196 CopyColorSubTable 197 ActiveTextureARB 198 MultiTexCoord1dvARB 199 MultiTexCoord1fvARB 200 MultiTexCoord1ivARB 201 MultiTexCoord1svARB 202 MultiTexCoord2dvARB 203 MultiTexCoord2fvARB 204 MultiTexCoord2ivARB 205 MultiTexCoord2svARB 206 MultiTexCoord3dvARB 207 MultiTexCoord3fvARB 208 MultiTexCoord3ivARB 209 MultiTexCoord3svARB 210 MultiTexCoord4dvARB 211 MultiTexCoord4fvARB 212 MultiTexCoord4ivARB 213 MultiTexCoord4svARB 229 SampleCoverageARB 230 WindowPos3fvMESA 231 BeginQueryARB 232 EndQueryARB 233 DrawBuffersARB 2048 SampleMaskSGIS 2049 SamplePatternSGIS 2053 ColorTable 2054 ColorTableParameterfv 2055 ColorTableParameteriv 2056 CopyColorTable 2065 PointParameterfEXT 2066 PointParameterfvEXT 4096 BlendColor 4097 BlendEquation 4099 TexSubImage1D 4100 TexSubImage2D 4101 ConvolutionFilter1D 4102 ConvolutionFilter2D 4103 ConvolutionParameterf 4104 ConvolutionParameterfv 4105 ConvolutionParameteri 4106 ConvolutionParameteriv 4107 CopyConvolutionFilter1D 4108 CopyConvolutionFilter2D 4110 Histogram 4111 Minmax 4112 ResetHistogram 4113 ResetMinmax 4114 TexImage3D 4115 TexSubImage3D 4117 BindTexture 4118 PrioritizeTextures 4119 CopyTexImage1D 4120 CopyTexImage2D 4121 CopyTexSubImage1D 4122 CopyTexSubImage2D 4123 CopyTexSubImage3D 4124 FogCoordfvEXT 4125 FogCoorddvEXT 4126 SecondaryColor3bvEXT 4127 SecondaryColor3svEXT 4128 SecondaryColor3ivEXT 4129 SecondaryColor3fvEXT 4130 SecondaryColor3dvEXT 4131 SecondaryColor3ubvEXT 4132 SecondaryColor3usvEXT 4133 SecondaryColor3uivEXT 4134 BlendFuncSeparateEXT 4180 BindProgramNV 4181 ExecuteProgramNV 4182 RequestResidentProgramsNV 4183 LoadProgramNV 4184 ProgramEnvParameter4fvARB 4185 ProgramEnvParameter4dvARB 4186 ProgramParameters4fvNV 4187 ProgramParameters4dvNV 4188 TrackMatrixNV 4189 VertexAttrib1svARB 4190 VertexAttrib2svARB 4191 VertexAttrib3svARB 4192 VertexAttrib4svARB 4193 VertexAttrib1fvARB 4194 VertexAttrib2fvARB 4195 VertexAttrib3fvARB 4196 VertexAttrib4fvARB 4197 VertexAttrib1dvARB 4198 VertexAttrib2dvARB 4199 VertexAttrib3dvARB 4200 VertexAttrib4dvARB 4201 VertexAttrib4NubvARB 4202 VertexAttribs1svNV 4203 VertexAttribs2svNV 4204 VertexAttribs3svNV 4205 VertexAttribs4svNV 4206 VertexAttribs1fvNV 4207 VertexAttribs2fvNV 4208 VertexAttribs3fvNV 4209 VertexAttribs4fvNV 4210 VertexAttribs1dvNV 4211 VertexAttribs2dvNV 4212 VertexAttribs3dvNV 4213 VertexAttribs4dvNV 4214 VertexAttribs4ubvNV 4215 ProgramLocalParameter4fvARB 4216 ProgramLocalParameter4dvARB 4217 ProgramStringARB 4218 ProgramNamedParameter4fvNV 4219 ProgramNamedParameter4dvNV 4220 ActiveStencilFaceEXT 4221 PointParameteriNV 4222 PointParameterivNV 4228 BlendEquationSeparateEXT 4230 VertexAttrib4bvARB 4231 VertexAttrib4ivARB 4232 VertexAttrib4ubvARB 4233 VertexAttrib4usvARB 4234 VertexAttrib4uivARB 4235 VertexAttrib4NbvARB 4236 VertexAttrib4NsvARB 4237 VertexAttrib4NivARB 4238 VertexAttrib4NusvARB 4239 VertexAttrib4NuivARB 4265 VertexAttrib1svNV 4266 VertexAttrib2svNV 4267 VertexAttrib3svNV 4268 VertexAttrib4svNV 4269 VertexAttrib1fvNV 4270 VertexAttrib2fvNV 4271 VertexAttrib3fvNV 4272 VertexAttrib4fvNV 4273 VertexAttrib1dvNV 4274 VertexAttrib2dvNV 4275 VertexAttrib3dvNV 4276 VertexAttrib4dvNV 4277 VertexAttrib4ubvNV 4316 BindRenderbufferEXT 4317 DeleteRenderbuffersEXT 4318 RenderbufferStorageEXT 4319 BindFramebufferEXT 4320 DeleteFramebuffersEXT 4321 FramebufferTexture1DEXT 4322 FramebufferTexture2DEXT 4323 FramebufferTexture3DEXT 4324 FramebufferRenderbufferEXT 4325 GenerateMipmapEXT END TYPE LISTID CARD32 CONSTANTS glENUM 0x0000 POINTS 0x0001 LINES 0x0002 LINE_LOOP 0x0003 LINE_STRIP 0x0004 TRIANGLES 0x0005 TRIANGLE_STRIP 0x0006 TRIANGLE_FAN 0x0007 QUADS 0x0008 QUAD_STRIP 0x0009 POLYGON 0x0100 ACCUM 0x0101 LOAD 0x0102 RETURN 0x0103 MULT 0x0104 ADD 0x0200 NEVER 0x0201 LESS 0x0202 EQUAL 0x0203 LEQUAL 0x0204 GREATER 0x0205 NOTEQUAL 0x0206 GEQUAL 0x0207 ALWAYS 0x0300 SRC_COLOR 0x0301 ONE_MINUS_SRC_COLOR 0x0302 SRC_ALPHA 0x0303 ONE_MINUS_SRC_ALPHA 0x0304 DST_ALPHA 0x0305 ONE_MINUS_DST_ALPHA 0x0306 DST_COLOR 0x0307 ONE_MINUS_DST_COLOR 0x0308 SRC_ALPHA_SATURATE 0x0400 FRONT_LEFT 0x0401 FRONT_RIGHT 0x0402 BACK_LEFT 0x0403 BACK_RIGHT 0x0404 FRONT 0x0405 BACK 0x0406 LEFT 0x0407 RIGHT 0x0408 FRONT_AND_BACK 0x0409 AUX0 0x040A AUX1 0x040B AUX2 0x040C AUX3 0x0600 2D 0x0601 3D 0x0602 3D_COLOR 0x0603 3D_COLOR_TEXTURE 0x0604 4D_COLOR_TEXTURE 0x0700 PASS_THROUGH_TOKEN 0x0701 POINT_TOKEN 0x0702 LINE_TOKEN 0x0703 POLYGON_TOKEN 0x0704 BITMAP_TOKEN 0x0705 DRAW_PIXEL_TOKEN 0x0706 COPY_PIXEL_TOKEN 0x0707 LINE_RESET_TOKEN 0x0800 EXP 0x0801 EXP2 0x0900 CW 0x0901 CCW 0x0A00 COEFF 0x0A01 ORDER 0x0A02 DOMAIN 0x0B00 CURRENT_COLOR 0x0B01 CURRENT_INDEX 0x0B02 CURRENT_NORMAL 0x0B03 CURRENT_TEXTURE_COORDS 0x0B04 CURRENT_RASTER_COLOR 0x0B05 CURRENT_RASTER_INDEX 0x0B06 CURRENT_RASTER_TEXTURE_COORDS 0x0B07 CURRENT_RASTER_POSITION 0x0B08 CURRENT_RASTER_POSITION_VALID 0x0B09 CURRENT_RASTER_DISTANCE 0x0B10 POINT_SMOOTH 0x0B11 POINT_SIZE 0x0B12 POINT_SIZE_RANGE 0x0B13 POINT_SIZE_GRANULARITY 0x0B20 LINE_SMOOTH 0x0B21 LINE_WIDTH 0x0B22 LINE_WIDTH_RANGE 0x0B23 LINE_WIDTH_GRANULARITY 0x0B24 LINE_STIPPLE 0x0B25 LINE_STIPPLE_PATTERN 0x0B26 LINE_STIPPLE_REPEAT 0x0B30 LIST_MODE 0x0B31 MAX_LIST_NESTING 0x0B32 LIST_BASE 0x0B33 LIST_INDEX 0x0B40 POLYGON_MODE 0x0B41 POLYGON_SMOOTH 0x0B42 POLYGON_STIPPLE 0x0B43 EDGE_FLAG 0x0B44 CULL_FACE 0x0B45 CULL_FACE_MODE 0x0B46 FRONT_FACE 0x0B50 LIGHTING 0x0B51 LIGHT_MODEL_LOCAL_VIEWER 0x0B52 LIGHT_MODEL_TWO_SIDE 0x0B53 LIGHT_MODEL_AMBIENT 0x0B54 SHADE_MODEL 0x0B55 COLOR_MATERIAL_FACE 0x0B56 COLOR_MATERIAL_PARAMETER 0x0B57 COLOR_MATERIAL 0x0B60 FOG 0x0B61 FOG_INDEX 0x0B62 FOG_DENSITY 0x0B63 FOG_START 0x0B64 FOG_END 0x0B65 FOG_MODE 0x0B66 FOG_COLOR 0x0B70 DEPTH_RANGE 0x0B71 DEPTH_TEST 0x0B72 DEPTH_WRITEMASK 0x0B73 DEPTH_CLEAR_VALUE 0x0B74 DEPTH_FUNC 0x0B80 ACCUM_CLEAR_VALUE 0x0B90 STENCIL_TEST 0x0B91 STENCIL_CLEAR_VALUE 0x0B92 STENCIL_FUNC 0x0B93 STENCIL_VALUE_MASK 0x0B94 STENCIL_FAIL 0x0B95 STENCIL_PASS_DEPTH_FAIL 0x0B96 STENCIL_PASS_DEPTH_PASS 0x0B97 STENCIL_REF 0x0B98 STENCIL_WRITEMASK 0x0BA0 MATRIX_MODE 0x0BA1 NORMALIZE 0x0BA2 VIEWPORT 0x0BA3 MODELVIEW_STACK_DEPTH 0x0BA4 PROJECTION_STACK_DEPTH 0x0BA5 TEXTURE_STACK_DEPTH 0x0BA6 MODELVIEW_MATRIX 0x0BA7 PROJECTION_MATRIX 0x0BA8 TEXTURE_MATRIX 0x0BB0 ATTRIB_STACK_DEPTH 0x0BB1 CLIENT_ATTRIB_STACK_DEPTH 0x0BC0 ALPHA_TEST 0x0BC1 ALPHA_TEST_FUNC 0x0BC2 ALPHA_TEST_REF 0x0BD0 DITHER 0x0BE0 BLEND_DST 0x0BE1 BLEND_SRC 0x0BE2 BLEND 0x0BF0 LOGIC_OP_MODE 0x0BF1 INDEX_LOGIC_OP 0x0BF2 COLOR_LOGIC_OP 0x0C00 AUX_BUFFERS 0x0C01 DRAW_BUFFER 0x0C02 READ_BUFFER 0x0C10 SCISSOR_BOX 0x0C11 SCISSOR_TEST 0x0C20 INDEX_CLEAR_VALUE 0x0C21 INDEX_WRITEMASK 0x0C22 COLOR_CLEAR_VALUE 0x0C23 COLOR_WRITEMASK 0x0C30 INDEX_MODE 0x0C31 RGBA_MODE 0x0C32 DOUBLEBUFFER 0x0C33 STEREO 0x0C40 RENDER_MODE 0x0C50 PERSPECTIVE_CORRECTION_HINT 0x0C51 POINT_SMOOTH_HINT 0x0C52 LINE_SMOOTH_HINT 0x0C53 POLYGON_SMOOTH_HINT 0x0C54 FOG_HINT 0x0C60 TEXTURE_GEN_S 0x0C61 TEXTURE_GEN_T 0x0C62 TEXTURE_GEN_R 0x0C63 TEXTURE_GEN_Q 0x0C70 PIXEL_MAP_I_TO_I 0x0C71 PIXEL_MAP_S_TO_S 0x0C72 PIXEL_MAP_I_TO_R 0x0C73 PIXEL_MAP_I_TO_G 0x0C74 PIXEL_MAP_I_TO_B 0x0C75 PIXEL_MAP_I_TO_A 0x0C76 PIXEL_MAP_R_TO_R 0x0C77 PIXEL_MAP_G_TO_G 0x0C78 PIXEL_MAP_B_TO_B 0x0C79 PIXEL_MAP_A_TO_A 0x0CB0 PIXEL_MAP_I_TO_I_SIZE 0x0CB1 PIXEL_MAP_S_TO_S_SIZE 0x0CB2 PIXEL_MAP_I_TO_R_SIZE 0x0CB3 PIXEL_MAP_I_TO_G_SIZE 0x0CB4 PIXEL_MAP_I_TO_B_SIZE 0x0CB5 PIXEL_MAP_I_TO_A_SIZE 0x0CB6 PIXEL_MAP_R_TO_R_SIZE 0x0CB7 PIXEL_MAP_G_TO_G_SIZE 0x0CB8 PIXEL_MAP_B_TO_B_SIZE 0x0CB9 PIXEL_MAP_A_TO_A_SIZE 0x0CF0 UNPACK_SWAP_BYTES 0x0CF1 UNPACK_LSB_FIRST 0x0CF2 UNPACK_ROW_LENGTH 0x0CF3 UNPACK_SKIP_ROWS 0x0CF4 UNPACK_SKIP_PIXELS 0x0CF5 UNPACK_ALIGNMENT 0x0D00 PACK_SWAP_BYTES 0x0D01 PACK_LSB_FIRST 0x0D02 PACK_ROW_LENGTH 0x0D03 PACK_SKIP_ROWS 0x0D04 PACK_SKIP_PIXELS 0x0D05 PACK_ALIGNMENT 0x0D10 MAP_COLOR 0x0D11 MAP_STENCIL 0x0D12 INDEX_SHIFT 0x0D13 INDEX_OFFSET 0x0D14 RED_SCALE 0x0D15 RED_BIAS 0x0D16 ZOOM_X 0x0D17 ZOOM_Y 0x0D18 GREEN_SCALE 0x0D19 GREEN_BIAS 0x0D1A BLUE_SCALE 0x0D1B BLUE_BIAS 0x0D1C ALPHA_SCALE 0x0D1D ALPHA_BIAS 0x0D1E DEPTH_SCALE 0x0D1F DEPTH_BIAS 0x0D30 MAX_EVAL_ORDER 0x0D31 MAX_LIGHTS 0x0D32 MAX_CLIP_PLANES 0x0D33 MAX_TEXTURE_SIZE 0x0D34 MAX_PIXEL_MAP_TABLE 0x0D35 MAX_ATTRIB_STACK_DEPTH 0x0D36 MAX_MODELVIEW_STACK_DEPTH 0x0D37 MAX_NAME_STACK_DEPTH 0x0D38 MAX_PROJECTION_STACK_DEPTH 0x0D39 MAX_TEXTURE_STACK_DEPTH 0x0D3A MAX_VIEWPORT_DIMS 0x0D3B MAX_CLIENT_ATTRIB_STACK_DEPTH 0x0D50 SUBPIXEL_BITS 0x0D51 INDEX_BITS 0x0D52 RED_BITS 0x0D53 GREEN_BITS 0x0D54 BLUE_BITS 0x0D55 ALPHA_BITS 0x0D56 DEPTH_BITS 0x0D57 STENCIL_BITS 0x0D58 ACCUM_RED_BITS 0x0D59 ACCUM_GREEN_BITS 0x0D5A ACCUM_BLUE_BITS 0x0D5B ACCUM_ALPHA_BITS 0x0D70 NAME_STACK_DEPTH 0x0D80 AUTO_NORMAL 0x0D90 MAP1_COLOR_4 0x0D91 MAP1_INDEX 0x0D92 MAP1_NORMAL 0x0D93 MAP1_TEXTURE_COORD_1 0x0D94 MAP1_TEXTURE_COORD_2 0x0D95 MAP1_TEXTURE_COORD_3 0x0D96 MAP1_TEXTURE_COORD_4 0x0D97 MAP1_VERTEX_3 0x0D98 MAP1_VERTEX_4 0x0DB0 MAP2_COLOR_4 0x0DB1 MAP2_INDEX 0x0DB2 MAP2_NORMAL 0x0DB3 MAP2_TEXTURE_COORD_1 0x0DB4 MAP2_TEXTURE_COORD_2 0x0DB5 MAP2_TEXTURE_COORD_3 0x0DB6 MAP2_TEXTURE_COORD_4 0x0DB7 MAP2_VERTEX_3 0x0DB8 MAP2_VERTEX_4 0x0DD0 MAP1_GRID_DOMAIN 0x0DD1 MAP1_GRID_SEGMENTS 0x0DD2 MAP2_GRID_DOMAIN 0x0DD3 MAP2_GRID_SEGMENTS 0x0DE0 TEXTURE_1D 0x0DE1 TEXTURE_2D 0x0DF0 FEEDBACK_BUFFER_POINTER 0x0DF1 FEEDBACK_BUFFER_SIZE 0x0DF2 FEEDBACK_BUFFER_TYPE 0x0DF3 SELECTION_BUFFER_POINTER 0x0DF4 SELECTION_BUFFER_SIZE 0x1000 TEXTURE_WIDTH 0x1001 TEXTURE_HEIGHT 0x1003 TEXTURE_COMPONENTS 0x1004 TEXTURE_BORDER_COLOR 0x1005 TEXTURE_BORDER 0x1100 DONT_CARE 0x1101 FASTEST 0x1102 NICEST 0x1200 AMBIENT 0x1201 DIFFUSE 0x1202 SPECULAR 0x1203 POSITION 0x1204 SPOT_DIRECTION 0x1205 SPOT_EXPONENT 0x1206 SPOT_CUTOFF 0x1207 CONSTANT_ATTENUATION 0x1208 LINEAR_ATTENUATION 0x1209 QUADRATIC_ATTENUATION 0x1300 COMPILE 0x1301 COMPILE_AND_EXECUTE 0x1400 BYTE 0x1401 UNSIGNED_BYTE 0x1402 SHORT 0x1403 UNSIGNED_SHORT 0x1404 INT 0x1405 UNSIGNED_INT 0x1406 FLOAT 0x1407 2_BYTES 0x1408 3_BYTES 0x1409 4_BYTES 0x140A DOUBLE 0x1500 CLEAR 0x1501 AND 0x1502 AND_REVERSE 0x1503 COPY 0x1504 AND_INVERTED 0x1505 NOOP 0x1506 XOR 0x1507 OR 0x1508 NOR 0x1509 EQUIV 0x150A INVERT 0x150B OR_REVERSE 0x150C COPY_INVERTED 0x150D OR_INVERTED 0x150E NAND 0x150F SET 0x1600 EMISSION 0x1601 SHININESS 0x1602 AMBIENT_AND_DIFFUSE 0x1603 COLOR_INDEXES 0x1700 MODELVIEW 0x1701 PROJECTION 0x1702 TEXTURE 0x1800 COLOR 0x1801 DEPTH 0x1802 STENCIL 0x1900 COLOR_INDEX 0x1901 STENCIL_INDEX 0x1902 DEPTH_COMPONENT 0x1903 RED 0x1904 GREEN 0x1905 BLUE 0x1906 ALPHA 0x1907 RGB 0x1908 RGBA 0x1909 LUMINANCE 0x190A LUMINANCE_ALPHA 0x1A00 BITMAP 0x1B00 POINT 0x1B01 LINE 0x1B02 FILL 0x1C00 RENDER 0x1C01 FEEDBACK 0x1C02 SELECT 0x1D00 FLAT 0x1D01 SMOOTH 0x1E00 KEEP 0x1E01 REPLACE 0x1E02 INCR 0x1E03 DECR 0x1F00 VENDOR 0x1F01 RENDERER 0x1F02 VERSION 0x1F03 EXTENSIONS 0x2000 S 0x2001 T 0x2002 R 0x2003 Q 0x2100 MODULATE 0x2101 DECAL 0x2200 TEXTURE_ENV_MODE 0x2201 TEXTURE_ENV_COLOR 0x2300 TEXTURE_ENV 0x2400 EYE_LINEAR 0x2401 OBJECT_LINEAR 0x2402 SPHERE_MAP 0x2500 TEXTURE_GEN_MODE 0x2501 OBJECT_PLANE 0x2502 EYE_PLANE 0x2600 NEAREST 0x2601 LINEAR 0x2700 NEAREST_MIPMAP_NEAREST 0x2701 LINEAR_MIPMAP_NEAREST 0x2702 NEAREST_MIPMAP_LINEAR 0x2703 LINEAR_MIPMAP_LINEAR 0x2800 TEXTURE_MAG_FILTER 0x2801 TEXTURE_MIN_FILTER 0x2802 TEXTURE_WRAP_S 0x2803 TEXTURE_WRAP_T 0x2900 CLAMP 0x2901 REPEAT 0x2A00 POLYGON_OFFSET_UNITS 0x2A01 POLYGON_OFFSET_POINT 0x2A02 POLYGON_OFFSET_LINE 0x2A10 R3_G3_B2 0x2A20 V2F 0x2A21 V3F 0x2A22 C4UB_V2F 0x2A23 C4UB_V3F 0x2A24 C3F_V3F 0x2A25 N3F_V3F 0x2A26 C4F_N3F_V3F 0x2A27 T2F_V3F 0x2A28 T4F_V4F 0x2A29 T2F_C4UB_V3F 0x2A2A T2F_C3F_V3F 0x2A2B T2F_N3F_V3F 0x2A2C T2F_C4F_N3F_V3F 0x2A2D T4F_C4F_N3F_V4F 0x3000 CLIP_PLANE0 0x3001 CLIP_PLANE1 0x3002 CLIP_PLANE2 0x3003 CLIP_PLANE3 0x3004 CLIP_PLANE4 0x3005 CLIP_PLANE5 0x4000 LIGHT0 0x4001 LIGHT1 0x4002 LIGHT2 0x4003 LIGHT3 0x4004 LIGHT4 0x4005 LIGHT5 0x4006 LIGHT6 0x4007 LIGHT7 0x8037 POLYGON_OFFSET_FILL 0x8038 POLYGON_OFFSET_FACTOR 0x803B ALPHA4 0x803C ALPHA8 0x803D ALPHA12 0x803E ALPHA16 0x803F LUMINANCE4 0x8040 LUMINANCE8 0x8041 LUMINANCE12 0x8042 LUMINANCE16 0x8043 LUMINANCE4_ALPHA4 0x8044 LUMINANCE6_ALPHA2 0x8045 LUMINANCE8_ALPHA8 0x8046 LUMINANCE12_ALPHA4 0x8047 LUMINANCE12_ALPHA12 0x8048 LUMINANCE16_ALPHA16 0x8049 INTENSITY 0x804A INTENSITY4 0x804B INTENSITY8 0x804C INTENSITY12 0x804D INTENSITY16 0x804F RGB4 0x8050 RGB5 0x8051 RGB8 0x8052 RGB10 0x8053 RGB12 0x8054 RGB16 0x8055 RGBA2 0x8056 RGBA4 0x8057 RGB5_A1 0x8058 RGBA8 0x8059 RGB10_A2 0x805A RGBA12 0x805B RGBA16 0x805C TEXTURE_RED_SIZE 0x805D TEXTURE_GREEN_SIZE 0x805E TEXTURE_BLUE_SIZE 0x805F TEXTURE_ALPHA_SIZE 0x8060 TEXTURE_LUMINANCE_SIZE 0x8061 TEXTURE_INTENSITY_SIZE 0x8063 PROXY_TEXTURE_1D 0x8064 PROXY_TEXTURE_2D 0x8066 TEXTURE_PRIORITY 0x8067 TEXTURE_RESIDENT 0x8068 TEXTURE_BINDING_1D 0x8069 TEXTURE_BINDING_2D 0x8074 VERTEX_ARRAY 0x8075 NORMAL_ARRAY 0x8076 COLOR_ARRAY 0x8077 INDEX_ARRAY 0x8078 TEXTURE_COORD_ARRAY 0x8079 EDGE_FLAG_ARRAY 0x807A VERTEX_ARRAY_SIZE 0x807B VERTEX_ARRAY_TYPE 0x807C VERTEX_ARRAY_STRIDE 0x807E NORMAL_ARRAY_TYPE 0x807F NORMAL_ARRAY_STRIDE 0x8081 COLOR_ARRAY_SIZE 0x8082 COLOR_ARRAY_TYPE 0x8083 COLOR_ARRAY_STRIDE 0x8085 INDEX_ARRAY_TYPE 0x8086 INDEX_ARRAY_STRIDE 0x8088 TEXTURE_COORD_ARRAY_SIZE 0x8089 TEXTURE_COORD_ARRAY_TYPE 0x808A TEXTURE_COORD_ARRAY_STRIDE 0x808C EDGE_FLAG_ARRAY_STRIDE 0x808E VERTEX_ARRAY_POINTER 0x808F NORMAL_ARRAY_POINTER 0x8090 COLOR_ARRAY_POINTER 0x8091 INDEX_ARRAY_POINTER 0x8092 TEXTURE_COORD_ARRAY_POINTER 0x8093 EDGE_FLAG_ARRAY_POINTER END TYPE glENUM ENUM32 glENUM LIST 2BYTES length 2 SET_COUNTER 2 0 bytes LISTofCARD8 END LIST 3BYTES length 3 SET_COUNTER 3 0 bytes LISTofCARD8 END LIST 4BYTES length 4 SET_COUNTER 4 0 bytes LISTofCARD8 END LIST RenderCommand variable min-length 4 0 length COUNT16 SIZE COUNT 2 command ENUM16 gl_command IF 2 CARD16 $gl_command:Begin 4 mode glENUM NEXT 8 ELSEIF 2 CARD16 $gl_command:CallList 4 list LISTID NEXT 8 ELSEIF 2 CARD16 $gl_command:CallLists 4 n COUNT32 8 type glENUM IF 8 CARD32 $glENUM:BYTE 12 lists LISTofINT8 ELSEIF 8 CARD32 $glENUM:UNSIGNED_BYTE 12 lists LISTofUINT8 ELSEIF 8 CARD32 $glENUM:SHORT 12 lists LISTofINT16 ELSEIF 8 CARD32 $glENUM:UNSIGNED_SHORT 12 lists LISTofUINT16 ELSEIF 8 CARD32 $glENUM:2_BYTES # GL_2_BYTES: TODO: decide how to print 12 lists LISTof2BYTES ELSEIF 8 CARD32 $glENUM:3_BYTES # GL_3_BYTES: TODO: decide how to print 12 lists LISTof3BYTES ELSEIF 8 CARD32 $glENUM:INT 12 lists LISTofINT32 ELSEIF 8 CARD32 $glENUM:UNSIGNED_INT 12 lists LISTofCARD32 ELSEIF 8 CARD32 $glENUM:FLOAT 12 lists LISTofFLOAT32 ELSEIF 8 CARD32 $glENUM:4_BYTES 12 lists LISTof4BYTES ELSE 0 n CARD16 RESET_COUNTER 12 strange-data LISTofCARD8 ELSEIF 2 CARD16 $gl_command:Clear # TODO: what's this mask? 4 mask CARD32 NEXT 8 ELSEIF 2 CARD16 $gl_command:End NEXT 4 ELSEIF 2 CARD16 $gl_command:Lightfv 4 light glENUM 8 pname glENUM # TODO: don't those floats have a meaning? IF 8 CARD32 $glENUM:AMBIENT SET_COUNTER 4 12 data LISTofFLOAT32 ELSEIF 8 CARD32 $glENUM:DIFFUSE SET_COUNTER 4 12 data LISTofFLOAT32 ELSEIF 8 CARD32 $glENUM:SPECULAR SET_COUNTER 4 12 data LISTofFLOAT32 ELSEIF 8 CARD32 $glENUM:POSITION SET_COUNTER 4 12 data LISTofFLOAT32 ELSEIF 8 CARD32 $glENUM:SPOT_DIRECTION SET_COUNTER 3 12 data LISTofFLOAT32 ELSEIF 8 CARD32 $glENUM:SPOT_EXPONENT 12 data FLOAT32 NEXT 16 ELSEIF 8 CARD32 $glENUM:SPOT_CUTOFF 12 data FLOAT32 NEXT 16 ELSEIF 8 CARD32 $glENUM:CONSTANT_ATTENUATION 12 data FLOAT32 NEXT 16 ELSEIF 8 CARD32 $glENUM:LINEAR_ATTENUATION 12 data FLOAT32 NEXT 16 ELSEIF 8 CARD32 $glENUM:QUADRATIC_ATTENUATION 12 data FLOAT32 NEXT 16 ELSE 8 pname CARD32 RESET_COUNTER 4 unknown-light LISTofCARD8 ELSEIF 2 CARD16 $gl_command:ListBase 4 base CARD32 NEXT 8 ELSEIF 2 CARD16 $gl_command:Materialfv 4 face glENUM 8 pname glENUM # TODO: what is the meaning of those arrays? IF 8 CARD32 $glENUM:AMBIENT SET_COUNTER 4 12 data LISTofFLOAT32 ELSEIF 8 CARD32 $glENUM:DIFFUSE SET_COUNTER 4 12 data LISTofFLOAT32 ELSEIF 8 CARD32 $glENUM:SPECULAR SET_COUNTER 4 12 data LISTofFLOAT32 ELSEIF 8 CARD32 $glENUM:EMISSION SET_COUNTER 4 12 data LISTofFLOAT32 ELSEIF 8 CARD32 $glENUM:SHININESS 12 data FLOAT32 NEXT 16 ELSEIF 8 CARD32 $glENUM:AMBIENT_AND_DIFFUSE SET_COUNTER 4 12 data LISTofFLOAT32 ELSEIF 8 CARD32 $glENUM:COLOR_INDEXES SET_COUNTER 3 12 data LISTofFLOAT32 ELSE RESET_COUNTER 12 unknown-material-data LISTofCARD8 ELSEIF 2 CARD16 $gl_command:Normal3fv SET_COUNTER 3 4 v LISTofFLOAT32 NEXT 16 ELSEIF 2 CARD16 $gl_command:PopName NEXT 4 ELSEIF 2 CARD16 $gl_command:PopAttrib NEXT 4 ELSEIF 2 CARD16 $gl_command:PopMatrix NEXT 4 ELSEIF 2 CARD16 $gl_command:PushName 4 name CARD32 NEXT 8 ELSEIF 2 CARD16 $gl_command:PushAttrib # TODO: what's this mask? 4 mask CARD32 NEXT 8 ELSEIF 2 CARD16 $gl_command:PushMatrix NEXT 4 ELSEIF 2 CARD16 $gl_command:Rotatef 4 angle FLOAT32 8 x FLOAT32 12 y FLOAT32 16 z FLOAT32 NEXT 20 ELSEIF 2 CARD16 $gl_command:ShadeModel 4 mode glENUM NEXT 8 ELSEIF 2 CARD16 $gl_command:Translatef 4 x FLOAT32 8 y FLOAT32 12 z FLOAT32 NEXT 16 ELSEIF 2 CARD16 $gl_command:Vertex3fv SET_COUNTER 3 4 v LISTofFLOAT32 NEXT 16 # TODO: all the other commands still need to be implemented ELSE 4 unknown LISTofCARD8 END REQUEST glXRender 4 context_tag CARD32 8 "render commands" LISTofRenderCommand END # opcode 2 REQUEST glXRenderLarge 4 context_tag CARD32 8 req_num CARD16 10 req_tot CARD16 12 n CARD32 END # opcode 3 REQUEST glXCreateContext 4 context CARD32 8 visual_id UINT32 12 screen CARD32 16 share_list CARD32 20 is_direct UINT8 END # opcode 4 REQUEST glXDestroyContext 4 context CARD32 END # opcode 5 REQUEST glXMakeCurrent 4 drawable CARD32 8 context CARD32 12 old_context_tag CARD32 END RESPONSE glXMakeCurrent 8 new_context_tag CARD32 END # opcode 6 REQUEST glXIsDirect 4 context CARD32 END RESPONSE glXIsDirect 8 is_direct UINT8 END # opcode 7 REQUEST glXQueryVersion 4 client_major_version UINT32 8 client_minor_version UINT32 END RESPONSE glXQueryVersion 8 server_major_version UINT32 12 server_minor_version UINT32 END # opcode 11 REQUEST glXSwapBuffers 4 context_tag CARD32 8 drawable CARD32 END TYPE BOOL32 ENUM32 bool CONSTANTS proptype 0x20 GLX_VISUAL_CAVEAT_EXT 0x23 GLX_TRANSPARENT_TYPE 0x25 GLX_TRANSPARENT_RED_VALUE 0x26 GLX_TRANSPARENT_GREEN_VALUE 0x27 GLX_TRANSPARENT_BLUE_VALUE 0x28 GLX_TRANSPARENT_ALPHA_VALUE 0x24 GLX_TRANSPARENT_INDEX_VALUE 100001 GLX_SAMPLES_SGIS 100000 GLX_SAMPLE_BUFFERS_SGIS 0x800b GLX_VISUAL_ID 0x8013 GLX_FBCONFIG_ID 0x8012 GLX_X_RENDERABLE 4 GLX_RGBA 0x8011 GLX_RENDER_TYPE 5 GLX_DOUBLEBUFFER 6 GLX_STEREO 2 GLX_BUFFER_SIZE 3 GLX_LEVEL 7 GLX_AUX_BUFFERS 8 GLX_RED_SIZE 9 GLX_GREEN_SIZE 10 GLX_BLUE_SIZE 11 GLX_ALPHA_SIZE 14 GLX_ACCUM_RED_SIZE 15 GLX_ACCUM_GREEN_SIZE 16 GLX_ACCUM_BLUE_SIZE 17 GLX_ACCUM_ALPHA_SIZE 12 GLX_DEPTH_SIZE 13 GLX_STENCIL_SIZE 0x22 GLX_X_VISUAL_TYPE 0x8060 GLX_SWAP_METHOD_OML 0x8010 GLX_DRAWABLE_TYPE 0x20d0 GLX_BIND_TO_TEXTURE_RGB_EXT 0x20d1 GLX_BIND_TO_TEXTURE_RGBA_EXT 0x20d2 GLX_BIND_TO_MIPMAP_TEXTURE_EXT 0x20d3 GLX_BIND_TO_TEXTURE_TARGETS_EXT END STRUCT property length 8 0 type ENUM32 proptype 4 value CARD32 END LIST visualconfig variable min-length 72 0 visualid CARD32 4 class CARD32 8 rgba BOOL32 12 red_size UINT32 16 green_size UINT32 20 blue_size UINT32 24 alpha_size UINT32 28 accum_red_size UINT32 32 accum_green_size UINT32 36 accum_blue_size UINT32 40 accum_alpha_size UINT32 44 double_buffer BOOL32 48 stereo BOOL32 52 buffer_size UINT32 56 depth_size UINT32 60 stencil_size UINT32 64 aux_buffers UINT32 68 level UINT32 GET 0 DECREMENT_COUNT 18 DIVIDE_COUNT 2 72 props LISTofproperty END # opcode 14 REQUEST glXGetVisualConfigs 4 screen CARD32 END RESPONSE glXGetVisualConfigs 12 num_properties UINT32 12 num_properties PUSH32 8 num_visuals COUNT32 32 visualconfigs LISTofvisualconfig RESET_COUNTER END CONSTANTS vendor_op 65540 GetFBConfigsSGIX END LIST fbconfigattribs variable min-length 8 GET 0 0 props LISTofproperty END # opcode 17 REQUEST glXVendorPrivateWithReply TRANSFER=1 4 vendor_op ENUM32 vendor_op 4 vendor_op PUSH32 IF 4 CARD32 $vendor_op:GetFBConfigsSGIX 12 screen UINT32 ELSE 8 vendor_data LISTofCARD8 # FIXME proper size END RESPONSE glXVendorPrivateWithReply GET 0 IF STORED CARD32 $vendor_op:GetFBConfigsSGIX 8 num_fbconfigs COUNT32 12 num_attribs UINT32 12 num_attribs PUSH32 32 fbconfigs LISToffbconfigattribs RESET_COUNTER ELSE RESET_COUNTER 8 data1 LISTofCARD8 #32 data2 LISTofCARD8 END CONSTANTS server_string 1 GLX_VENDOR 2 GLX_VERSION 3 GLX_EXTENSIONS END # opcode 19 REQUEST glXQueryServerString 4 context_tag CARD32 8 name ENUM32 server_string END RESPONSE glXQueryServerString 12 n COUNT32 DECREMENT_COUNT 1 32 string STRING8 # FIXME proper size END # opcode 20 REQUEST glXClientInfo 4 gl_client_major UINT32 8 gl_client_minor UINT32 12 n COUNT32 DECREMENT_COUNT 1 16 extension_string STRING8 # FIXME proper size END # opcode 117 REQUEST glGetIntegerv 4 context_tag CARD32 8 pname CARD32 END RESPONSE glGetIntegerv 12 n UINT32 # FIXME extend END # opcode 101 REQUEST glNewList 4 context_tag CARD32 8 list CARD32 12 mode CARD32 END # opcode 102 REQUEST glEndList 4 context_tag CARD32 END # opcode 103 REQUEST glDeleteLists 4 context_tag CARD32 8 list CARD32 12 range INT32 END # opcode 104 REQUEST glGenLists 4 context_tag CARD32 8 range INT32 END RESPONSE glGenLists 8 retval UINT32 12 unused LISTofCARD8 END # opcode 115 REQUEST glGetError 4 context_tag CARD32 END RESPONSE glGetError 8 error UINT32 12 unused LISTofCARD8 END # opcode 129 REQUEST glGetString 4 context_tag CARD32 8 name glENUM END RESPONSE glGetString 12 n COUNT32 32 string STRING8 END EVENT PbufferClobber 4 event_type CARD16 6 draw_type CARD16 8 drawable CARD32 12 buffer_mask CARD32 16 aux_buffer CARD16 18 x CARD16 20 y CARD16 22 width CARD16 24 height CARD16 26 count CARD16 END EOF xtrace-1.3.1/dga.proto0000644000175100017510000001713711704002604011550 00000000000000# This file is part of "xtrace" # Copyright (C) 2011 Ville Syrjala # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # # This file is based on /usr/include/X11/extensions/xf86dga1const.h, # /usr/include/X11/extensions/xf86dga1proto.h and # /usr/include/X11/extensions/xf86dgaproto.h which state: # # Copyright (c) 1995 Jon Tombs # Copyright (c) 1995 XFree86 Inc # # This file is based on /usr/include/X11/extensions/xf86dgaconst.h which states: # # Copyright (c) 1999 XFree86 Inc # # and those files it is based on are available under: # # 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, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice 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 # XFREE86 PROJECT 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. # # Except as contained in this notice, the name of the XFree86 Project shall not # be used in advertising or otherwise to promote the sale, use or other dealings # in this Software without prior written authorization from the XFree86 Project. EXTENSION "XFree86-DGA" DGA USE core REQUESTS DGAQueryVersion RESPONDS DGA1GetVideoLL RESPONDS DGA1DirectVideo DGA1GetViewPortSize RESPONDS DGA1SetViewPort DGA1GetVidPage RESPONDS DGA1SetVidPage DGA1InstallColormap DGA1QueryDirectVideo RESPONDS DGA1ViewPortChanged RESPONDS UNKNOWN UNKNOWN DGA2QueryModes RESPONDS DGA2SetMode RESPONDS DGA2SetViewport DGA2InstallColormap DGA2SelectInput DGA2FillRectangle DGA2CopyArea DGA2CopyTransparentArea DGA2GetViewportStatus RESPONDS DGA2Sync RESPONDS DGA2OpenFrameBuffer RESPONDS DGA2CloseFrameBuffer DGA2SetClientVersion DGA2ChangePixmapMode RESPONDS DGA2CreateColormap END EVENTS UNKNOWN UNKNOWN KeyPress KeyRelease ButtonPress ButtonRelease MotionNotify END ERRORS ClientNotLocal NoDirectVideoMode ScreenNotActive DirectNotActivated OperationNotSupported END BITMASK directvideoflags 0x0001 DirectPresent 0x0002 DirectGraphics 0x0004 DirectMouse 0x0008 DirectKeyb 0x0100 HasColormap 0x0200 DirectColormap END TYPE DIRECTVIDEOFLAGS16 BITMASK16 directvideoflags TYPE DIRECTVIDEOFLAGS32 BITMASK32 directvideoflags BITMASK viewportflags 0x00000001 FlipImmediate 0x00000002 FlipRetrace END TYPE VIEWPORTFLAGS BITMASK32 viewportflags BITMASK modeflags 0x00000001 ConcurrentAccess 0x00000002 SolidFillRect 0x00000004 BlitRect 0x00000008 BlitTransRect 0x00000010 Pixmap 0x00010000 Interlaced 0x00020000 Doublescan END TYPE MODEFLAGS BITMASK32 modeflags CONSTANTS pixmapmodeflags 0 PixmapModeLarge 1 PixmapModeSmall END TYPE PIXMAPMODEFLAGS CARD32 constants pixmapmodeflags BITMASK fbextraflags 0x00000001 NeedRoot END TYPE FBEXTRAFLAGS BITMASK32 fbextraflags REQUEST DGAQueryVersion END RESPONSE DGAQueryVersion 8 major-version UINT16 10 minor-version UINT16 END REQUEST DGA1GetVideoLL 4 screen UINT16 END RESPONSE DGA1GetVideoLL 8 offset UINT32 12 width UINT32 16 bank-size UINT32 20 ram-size UINT32 END REQUEST DGA1InstallColormap 4 screen UINT16 8 id COLORMAP END REQUEST DGA1DirectVideo 4 screen UINT16 6 enable DIRECTVIDEOFLAGS16 END REQUEST DGA1GetViewPortSize 4 screen UINT16 END RESPONSE DGA1GetViewPortSize 8 width UINT32 12 height UINT32 END REQUEST DGA1SetViewPort 4 screen UINT16 8 x UINT32 12 y UINT32 END REQUEST DGA1GetVidPage 4 screen UINT16 END RESPONSE DGA1GetVidPage 8 vpage UINT32 END REQUEST DGA1SetVidPage 4 screen UINT16 6 vpage UINT16 END REQUEST DGA1QueryDirectVideo 4 screen UINT16 END RESPONSE DGA1QueryDirectVideo 8 flags DIRECTVIDEOFLAGS32 END REQUEST DGA1ViewPortChanged 4 screen UINT16 6 num_pages UINT16 END RESPONSE DGA1ViewPortChanged 8 result UINT32 END LIST MODEINFO variable min-length 72 0 byte-order UINT8 1 depth UINT8 2 num UINT16 4 bpp UINT16 6 name-size COUNT16 8 vsync UFRACTION32_32 16 flags MODEFLAGS 20 image-width UINT16 22 image-height UINT16 24 pixmap-width UINT16 26 pixmap-height UINT16 28 bytes-per-scanline UINT32 32 red-mask CARD32 36 green-mask CARD32 40 blue-mask CARD32 44 visual-class UINT16 48 viewport-width UINT16 50 viewport-height UINT16 52 viewport-xstep UINT16 54 viewport-ystep UINT16 56 viewport-xmax UINT16 58 viewport-ymax UINT16 60 viewport-flags VIEWPORTFLAGS 64 reserved1 UINT32 68 reserved2 UINT32 72 name STRING8 ROUND END REQUEST DGA2QueryModes 4 screen UINT32 END RESPONSE DGA2QueryModes 8 number COUNT32 32 modes LISTofMODEINFO END REQUEST DGA2SetMode 4 screen UINT32 8 mode UINT32 12 pid PIXMAP END RESPONSE DGA2SetMode 8 flags MODEFLAGS 32 mode LISTofMODEINFO END REQUEST DGA2OpenFrameBuffer 4 screen UINT32 END RESPONSE DGA2OpenFrameBuffer 8 mem1 CARD32 12 mem2 CARD32 16 size CARD32 20 offset UINT32 24 extra FBEXTRAFLAGS 32 device-name STRING8 END REQUEST DGA2CloseFrameBuffer 4 screen UINT32 END REQUEST DGA2SetViewport 4 screen UINT32 8 x UINT16 10 y UINT16 12 flags VIEWPORTFLAGS END REQUEST DGA2InstallColormap 4 screen UINT32 8 cmap COLORMAP END REQUEST DGA2SelectInput 4 screen UINT32 8 mask SETofDEVICEEVENT END REQUEST DGA2FillRectangle 4 screen UINT32 8 x UINT16 10 y UINT16 12 width UINT16 14 height UINT16 16 color CARD32 END REQUEST DGA2CopyArea 4 screen UINT32 8 src-x UINT16 10 src-y UINT16 12 width UINT16 14 height UINT16 16 dst-x UINT16 18 dst-y UINT16 END REQUEST DGA2CopyTransparentArea 4 screen UINT32 8 src-x UINT16 10 src-y UINT16 12 width UINT16 14 height UINT16 16 dst-x UINT16 18 dst-y UINT16 20 key UINT32 END REQUEST DGA2GetViewportStatus 4 screen UINT32 END RESPONSE DGA2GetViewportStatus 8 status CARD32 END REQUEST DGA2Sync 4 screen UINT32 END RESPONSE DGA2Sync END REQUEST DGA2SetClientVersion 4 major UINT16 6 minor UINT16 END REQUEST DGA2ChangePixmapMode 4 screen UINT32 8 x UINT16 10 y UINT16 12 flags PIXMAPMODEFLAGS END RESPONSE DGA2ChangePixmapMode 8 screen UINT32 12 x UINT16 14 y UINT16 END REQUEST DGA2CreateColormap 4 screen UINT32 8 id COLORMAP 12 mode UINT32 16 alloc ENUM8 alloc END templateEVENT Key 1 keycode KEYCODE 8 time TIMESTAMP 16 screen INT16 18 state SETofKEYBUTMASK END EVENT KeyPress ALIASES Key EVENT KeyRelease ALIASES Key templateEVENT Button 1 button BUTTON 8 time TIMESTAMP 16 screen INT16 18 state SETofKEYBUTMASK END EVENT ButtonPress ALIASES Button EVENT ButtonRelease ALIASES Button EVENT MotionNotify 8 time TIMESTAMP 12 dx INT16 14 dy INT16 16 screen INT16 18 state SETofKEYBUTMASK END EOF xtrace-1.3.1/requests.proto0000644000175100017510000007454511704002604012676 00000000000000# This file is part of xtrace # Copyright (C) 2005 Bernhard R. Link # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not write to the Free Software # Foundation Inc. 51 Franklin St Fifth Floor Boston MA 02110-1301 USA # This file is based on the # X Window System Protocol # X Consortium Standard # X Version 11 Release 6.4 # # Robert W. Scheifler # X Consortium Inc. # # with the following trademark and copyright notices and acknowlegdgments: # # X Window System is a trademark of X Consortium Inc. # # Copyright (C) 1986 1987 1988 1994 X Consortium # # Permission is hereby granted free of charge to any person # obtaining a copy of this software and associated documenta- # tion files (the ``Software'') to deal in the Software with- # out restriction including without limitation the rights to # use copy modify merge publish distribute sublicense # and/or sell copies of the Software and to permit persons to # whom the Software is furnished to do so subject to the fol- # lowing conditions: # # The above copyright notice and this permission notice 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 PUR- # POSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE X CONSOR- # TIUM 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. # # Except as contained in this notice the name of the X Con- # sortium shall not be used in advertising or otherwise to # promote the sale use or other dealings in this Software # without prior written authorization from the X Consortium. # # Acknowledgments # # The primary contributers to the X11 protocol are: # # Dave Carver (Digital HPW) # Branko Gerovac (Digital HPW) # Jim Gettys (MIT/Project Athena Digital) # Phil Karlton (Digital WSL) # Scott McGregor (Digital SSG) # Ram Rao (Digital UEG) # David Rosenthal (Sun) # Dave Winchell (Digital UEG) # # The implementors of initial server who provided useful input # are: # # Susan Angebranndt (Digital) # Raymond Drewry (Digital) # Todd Newman (Digital) # # The invited reviewers who provided useful input are: # # Andrew Cherenson (Berkeley) # Burns Fisher (Digital) # Dan Garfinkel (HP) # Leo Hourvitz (Next) # Brock Krizan (HP) # David Laidlaw (Stellar) # Dave Mellinger (Interleaf) # Ron Newman (MIT) # John Ousterhout (Berkeley) # Andrew Palay (ITC CMU) # Ralph Swick (MIT) # Craig Taylor (Sun) # Jeffery Vroom (Stellar) NAMESPACE core REQUESTS UNKNOWN CreateWindow ChangeWindowAttributes GetWindowAttributes RESPONDS DestroyWindow DestroySubwindows ChangeSaveSet ReparentWindow MapWindow /*8*/ MapSubwindows UnmapWindow UnmapSubwindows ConfigureWindow CirculateWindow GetGeometry RESPONDS QueryTree RESPONDS InternAtom RESPONDS SPECIAL GetAtomName RESPONDS ChangeProperty DeleteProperty GetProperty RESPONDS /* 20*/ ListProperties RESPONDS SetSelectionOwner GetSelectionOwner RESPONDS ConvertSelection SendEvent GrabPointer RESPONDS UngrabPointer GrabButton UngrabButton ChangeActivePointerGrab /* 30 */ GrabKeyboard RESPONDS UngrabKeyboard GrabKey UngrabKey AllowEvents GrabServer UngrabServer QueryPointer RESPONDS GetMotionEvents RESPONDS TranslateCoordinates RESPONDS /*40*/ WarpPointer SetInputFocus GetInputFocus RESPONDS QueryKeymap RESPONDS OpenFont CloseFont QueryFont RESPONDS QueryTextExtents RESPONDS ListFonts RESPONDS ListFontsWithInfo RESPONDS SPECIAL SetFontPath GetFontPath RESPONDS CreatePixmap FreePixmap CreateGC ChangeGC CopyGC SetDashes SetClipRectangles FreeGC /*60*/ ClearArea CopyArea CopyPlane PolyPoint PolyLine PolySegment PolyRectangle PolyArc FillPoly PolyFillRectangle PolyFillArc PutImage GetImage RESPONDS PolyText8 PolyText16 ImageText8 ImageText16 CreateColormap FreeColormap CopyColormapAndFree InstallColormap UninstallColormap ListInstalledColormaps RESPONDS AllocColor RESPONDS AllocNamedColor RESPONDS AllocColorCells RESPONDS AllocColorPlanes RESPONDS FreeColors StoreColors StoreNamedColor QueryColors RESPONDS LookupColor RESPONDS CreateCursor CreateGlyphCursor FreeCursor RecolorCursor QueryBestSize RESPONDS QueryExtension RESPONDS SPECIAL ListExtensions RESPONDS ChangeKeyboardMapping /*100*/ GetKeyboardMapping RESPONDS ChangeKeyboardControl GetKeyboardControl RESPONDS Bell ChangePointerControl GetPointerControl RESPONDS SetScreenSaver GetScreenSaver RESPONDS ChangeHosts ListHosts RESPONDS SetAccessControl SetCloseDownMode KillClient RotateProperties ForceScreenSaver /*115*/ SetPointerMapping RESPONDS GetPointerMapping RESPONDS SetModifierMapping RESPONDS GetModifierMapping RESPONDS UNKNOWN /*120*/ UNKNOWN UNKNOWN UNKNOWN UNKNOWN UNKNOWN UNKNOWN NoOperation /*127*/ END CONSTANTS function 0 Clear 1 And 2 AndReverse 3 Copy 4 AndInverted 5 NoOp 6 Xor 7 Or 8 Nor 9 Equiv 10 Invert 11 OrReverse 12 CopyInverted 13 OrInverted 14 Nand 15 Set END CONSTANTS line_style 0 Solid 1 OnOffDash 2 DoubleDash END CONSTANTS cap_style 0 NotLast 1 Butt 2 Round 3 Projecting END CONSTANTS join_style 0 Miter 1 Round 2 Bevel END CONSTANTS fill_style 0 Solid 1 Tiled 2 Stippled 3 OpaqueStippled END CONSTANTS fill_rule 0 EvenOdd 1 Winding END CONSTANTS subwindow_mode 0 ClipByChildren 1 IncludeInferiors END TYPE SubwindowMode ENUM8 subwindow_mode CONSTANTS arc_mode 0 Chord 1 PieSlice END CONSTANTS insert_delete 0 Insert 1 Delete END CONSTANTS windowclass 0 CopyFromParent 1 InputOutput 2 InputOnly END CONSTANTS copyfromparent 0 CopyFromParent END CONSTANTS store 0 NotUseful 1 WhenMapped 2 Always END CONSTANTS bitgravity 0 Forget 1 NorthWest 2 North 3 NorthEast 4 West 5 Center 6 East 7 SouthWest 8 South 9 SouthEast 10 Static END CONSTANTS wingravity 0 Unmap 1 NorthWest 2 North 3 NorthEast 4 West 5 Center 6 East 7 SouthWest 8 South 9 SouthEast 10 Static END TYPE WINGRAVITY ENUM8 wingravity TYPE BITGRAVITY ENUM8 bitgravity CONSTANTS mapstate 0 Unmapped 1 Unviewable 2 Viewable END CONSTANTS none 0 None END CONSTANTS nonerelative 0 None 1 ParentRelative END CONSTANTS any 0 any END BITMASK setofevent 0x00000001 KeyPress 0x00000002 KeyRelease 0x00000004 ButtonPress 0x00000008 ButtonRelease 0x00000010 EnterWindow 0x00000020 LeaveWindow 0x00000040 PointerMotion 0x00000080 PointerMotionHint 0x00000100 Button1Motion 0x00000200 Button2Motion 0x00000400 Button3Motion 0x00000800 Button4Motion 0x00001000 Button5Motion 0x00002000 ButtonMotion 0x00004000 KeymapState 0x00008000 Exposure 0x00010000 VisibilityChange 0x00020000 StructureNotify 0x00040000 ResizeRedirect 0x00080000 SubstructureNotify 0x00100000 SubstructureRedirect 0x00200000 FocusChange 0x00400000 PropertyChange 0x00800000 ColormapChange 0x01000000 OwnerGrabButton END TYPE SETofEVENT BITMASK32 setofevent TYPE SETofDEVICEEVENT SETofEVENT TYPE SETofPOINTEREVENT SETofEVENT BITMASK setofkeybutmask 0x0001 Shift 0x0002 Lock 0x0004 Control 0x0008 Mod1 0x0010 Mod2 0x0020 Mod3 0x0040 Mod4 0x0080 Mod5 0x0100 Button1 0x0200 Button2 0x0400 Button3 0x0800 Button4 0x1000 Button5 0x8000 AnyModifier END TYPE SETofKEYBUTMASK BITMASK16 setofkeybutmask TYPE SETofKEYMASK SETofKEYBUTMASK CONSTANTS bool 0 false 1 true END TYPE BOOL ENUM8 bool CONSTANTS circulate 0 RaiseLowest 1 LowerHighest END CONSTANTS change_mode 0 Replace 1 Prepend 2 Append END CONSTANTS curtime 0 CurrentTime END CONSTANTS choosewindow 0 PointerWindow 1 InputFocus END CONSTANTS synmode 0 Synchronous 1 Asynchronous END CONSTANTS grabsuccess 0 Success 1 AlreadyGrabbed 2 InvalidTime 3 NotViewable 4 Frozen END CONSTANTS button 0 "any button" 1 "left button" 2 "middle button" 3 "right button" END TYPE BUTTON CARD8 constants button CONSTANTS allowevents 0 AsyncPointer 1 SyncPointer 2 ReplayPointer 3 AsyncKeyboard 4 SyncKeyboard 5 ReplayKeyboard 6 AsyncBoth 7 SyncBoth END CONSTANTS revertto 0 None 1 PointerRoot 2 Parent 3 FollowKeyboard END CONSTANTS noneroot 0 None 1 PointerRoot END BITMASK copygcvalues 0x00000001 function 0x00000002 plane-mask 0x00000004 foreground 0x00000008 background 0x00000010 line-width 0x00000020 line-style 0x00000040 cap-style 0x00000080 join-style 0x00000100 fill-style 0x00000200 fill-rule 0x00000400 tile 0x00000800 stipple 0x00001000 tile-stipple-x-origin 0x00002000 tile-stipple-y-origin 0x00004000 font 0x00008000 subwindow-mode 0x00010000 graphics-exposures 0x00020000 clip-x-origin 0x00040000 clip-y-origin 0x00080000 clip-mask 0x00100000 dash-offset 0x00200000 dashes 0x00400000 arc-mode END CONSTANTS direction 0 LeftToRight 1 RightToLeft END CONSTANTS rect_ordering 0 UnSorted 1 YSorted 2 YXSorted 3 YXBanded END CONSTANTS coordinate_mode 0 Origin 1 Previous END CONSTANTS shape 0 Complex 1 Nonconvex 2 Convex END CONSTANTS bitmap_format 0 Bitmap 1 XYPixmap 2 ZPixmap END CONSTANTS alloc 0 None 1 All END BITMASK doredgreenblue 0x01 red 0x02 green 0x04 blue END CONSTANTS sizeclass 0 Cursor 1 Tile 2 Stipple END CONSTANTS nyd 0 No 1 Yes 2 Default END CONSTANTS insertdelete 0 Insert 1 Delete END CONSTANTS family 0 Internet 1 DECnet 2 Chaos END CONSTANTS disabledenabled 0 Disabled 1 Enabled END CONSTANTS disableenable 0 Disable 1 Enable END CONSTANTS closemode 0 Destroy 1 RetainPermanent 2 RetainTemporary END CONSTANTS alltemporary 0 AllTemporary END CONSTANTS resetactivate 0 Reset 1 Activate END CONSTANTS successbusyfailed 0 Success 1 Busy 2 Failed END CONSTANTS stack_mode 0 Above 1 Below 2 TopIf 3 BottomIf 4 Opposite END TYPE WINDOW CARD32 TYPE VISUALID CARD32 TYPE COLORMAP CARD32 TYPE PIXMAP CARD32 TYPE CURSOR CARD32 TYPE COUNT8 STORE8 TYPE COUNT16 STORE16 TYPE COUNT32 STORE32 templateREQUEST Empty END VALUES WindowAttributes 0x00000001 background-pixmap PIXMAP constants nonerelative 0x00000002 background-pixel CARD32 0x00000004 border-pixmap PIXMAP constants copyfromparent 0x00000008 border-pixel CARD32 0x00000010 bit-gravity ENUM8 bitgravity 0x00000020 win-gravity ENUM8 wingravity 0x00000040 backing-store ENUM8 store 0x00000080 backing-planes CARD32 0x00000100 backing-pixel CARD32 0x00000200 override-redirect BOOL 0x00000400 save-under BOOL 0x00000800 event-mask SETofEVENT 0x00001000 do-not-propagate-mask SETofDEVICEEVENT 0x00002000 colormap COLORMAP constants copyfromparent 0x00004000 cursor CURSOR constants none END REQUEST CreateWindow 1 depth CARD8 4 window WINDOW 8 parent WINDOW 12 x INT16 14 y INT16 16 width UINT16 18 height UINT16 20 border-width UINT16 22 class ENUM16 windowclass 24 visual VISUALID constants copyfromparent 28 value-mask STORE32 32 value-list LISTofWindowAttributes END REQUEST ChangeWindowAttributes 4 window WINDOW 8 value-mask STORE32 12 value-list LISTofWindowAttributes END # This is used for all UNKNOWN or unsupported requests: templateREQUEST unknown 0 opcode CARD8 1 opcode2 CARD8 4 unparsed-data LISTofCARD8 END # reply to an UNKNOWN, UNSUPPORTED or unexpected reply templateRESPONSE unknown 0 data1 CARD8 1 data2 CARD8 8 unparsed-data LISTofCARD8 END templateREQUEST WINDOW 4 window WINDOW END REQUEST GetWindowAttributes ALIASES WINDOW RESPONSE GetWindowAttributes 1 backing-store ENUM8 store 8 visual VISUALID 12 class ENUM16 windowclass 14 bit-gravity BITGRAVITY 15 win-gravity WINGRAVITY 16 backing-planes CARD32 20 backing-pixel CARD32 24 save-under BOOL 25 map-is-installed BOOL 26 map-state ENUM8 mapstate 27 override-redirect BOOL 28 colormap COLORMAP constants none 32 all-event-masks SETofEVENT 36 your-event-mask SETofEVENT 38 do-not-propagate-mask BITMASK16 setofevent 40 unused CARD16 END REQUEST ChangeSaveSet 1 mode ENUM8 insert_delete 4 window WINDOW END REQUEST ReparentWindow 4 window WINDOW 8 parent WINDOW 12 x INT16 14 y INT16 END VALUES ConfigureWindow 0x0001 x INT16 0x0002 y INT16 0x0004 width UINT16 0x0008 height UINT16 0x0010 border-width UINT16 0x0020 sibling WINDOW 0x0040 stack-mode ENUM8 stack_mode END REQUEST ConfigureWindow 4 window WINDOW 8 value-mask STORE16 12 values LISTofConfigureWindow END REQUEST CirculateWindow 1 direction ENUM8 circulate 4 window WINDOW END TYPE DRAWABLE CARD32 REQUEST GetGeometry 4 drawable DRAWABLE END RESPONSE GetGeometry 1 depth CARD8 8 root WINDOW 12 x INT16 14 y INT16 16 width UINT16 18 height UINT16 20 border-width UINT16 END REQUEST QueryTree ALIASES WINDOW TYPE LISTofWINDOW LISTofCARD32 RESPONSE QueryTree 8 root WINDOW 12 parent WINDOW constants none 16 count COUNT16 32 children LISTofWINDOW END REQUEST InternAtom 1 only-if-exists BOOL 4 length COUNT16 8 name STRING8 END RESPONSE InternAtom 8 atom ATOM constants none END templateREQUEST Atom 4 atom ATOM END REQUEST GetAtomName ALIASES Atom RESPONSE GetAtomName 8 length COUNT16 32 name STRING8 END REQUEST ChangeProperty 1 mode ENUM8 change_mode 4 window WINDOW 8 property ATOM 12 type ATOM 16 format FORMAT8 20 length COUNT32 IF 12 ATOM "STRING" 24 data STRING8 ELSEIF 12 ATOM "ATOM" 24 data LISTofATOM ELSE 24 data LISTofFormat END REQUEST DeleteProperty 4 window WINDOW 8 property ATOM END REQUEST GetProperty 1 delete BOOL 4 window WINDOW 8 property ATOM 12 type ATOM constants any 16 long-offset CARD32 20 long-length CARD32 END RESPONSE GetProperty 1 format FORMAT8 8 type ATOM constants none 12 bytes-after CARD32 16 length COUNT32 IF 8 ATOM "STRING" 32 data STRING8 ELSEIF 8 ATOM "ATOM" 32 data LISTofATOM ELSE 32 data LISTofFormat END REQUEST ListProperties ALIASES WINDOW RESPONSE ListProperties 8 count COUNT16 32 atoms LISTofATOM END TYPE TIMESTAMP CARD32 REQUEST SetSelectionOwner 4 owner WINDOW constants none 8 selection ATOM 12 time TIMESTAMP constants curtime END REQUEST GetSelectionOwner ALIASES Atom RESPONSE GetSelectionOwner 8 owner WINDOW constants none END REQUEST ConvertSelection 4 requestor WINDOW 8 selection ATOM 12 target ATOM 16 property ATOM constants none 20 time TIMESTAMP constants curtime END REQUEST SendEvent 1 propagate BOOL 4 destination WINDOW constants choosewindow 8 event-mask SETofEVENT 12 event EVENT END REQUEST GrabPointer 1 owner-events BOOL 4 grab-window WINDOW 8 event-mask SETofPOINTEREVENT 10 pointer-mode ENUM8 synmode 11 keyboard-mode ENUM8 synmode 12 confine-to WINDOW constants none 16 cursor CURSOR constants none 20 time TIMESTAMP constants curtime END RESPONSE GrabPointer 1 status ENUM8 grabsuccess END templateREQUEST Timestamp 4 time TIMESTAMP constants curtime END REQUEST UngrabPointer ALIASES Timestamp REQUEST GrabButton 1 owner-events BOOL 4 grab-window WINDOW 8 event-mask SETofPOINTEREVENT 10 pointer-mode ENUM8 synmode 11 keyboard-mode ENUM8 synmode 12 confine-to WINDOW constants none 16 cursor CURSOR constants none 20 button BUTTON 22 modifiers SETofKEYMASK END REQUEST UngrabButton 1 button BUTTON 4 grab-window WINDOW 8 modifiers SETofKEYMASK END REQUEST ChangeActivePointerGrab 4 cursor CURSOR constants none 8 time TIMESTAMP constants curtime 12 event-mask SETofPOINTEREVENT END TYPE SYNMODE CARD8 constants synmode REQUEST GrabKeyboard 4 grab-window WINDOW 8 time TIMESTAMP constants curtime 12 pointer-mode SYNMODE 13 keyboard-mode SYNMODE END RESPONSE GrabKeyboard ALIASES GrabPointer REQUEST UngrabKeyboard ALIASES Timestamp TYPE KEYCODE CARD8 REQUEST GrabKey 1 owner-events BOOL 4 grab-window WINDOW 8 modifiers SETofKEYMASK 10 key KEYCODE constants any 11 pointer-mode SYNMODE 12 keyboard-mode SYNMODE END REQUEST UngrabKey 1 key KEYCODE constants any 4 grab-window WINDOW 8 modifiers SETofKEYMASK END REQUEST AllowEvents 1 mode ENUM8 allowevents 5 time TIMESTAMP constants curtime END REQUEST QueryPointer ALIASES WINDOW RESPONSE QueryPointer 1 same-screen BOOL 8 root WINDOW 12 child WINDOW constants none 16 root-x INT16 18 root-y INT16 20 win-x INT16 22 win-y INT16 24 mask SETofKEYBUTMASK END REQUEST GetMotionEvents 4 window WINDOW 8 start TIMESTAMP constants curtime 12 stop TIMESTAMP constants curtime END LIST TIMECOORD length 8 0 time TIMESTAMP 4 x INT16 6 y INT16 END RESPONSE GetMotionEvents 8 count COUNT32 32 events LISTofTIMECOORD END REQUEST TranslateCoordinates 4 src-window WINDOW 8 dst-window WINDOW 12 src-x INT16 14 src-y INT16 END RESPONSE TranslateCoordinates 1 same-screen BOOL 8 child WINDOW constants none 12 dst-x INT16 14 dst-y INT16 END REQUEST WarpPointer 4 src-window WINDOW constants none 8 dst-window WINDOW constants none 12 src-x INT16 14 src-y INT16 16 src-width UINT16 18 src-height UINT16 20 dst-x INT16 22 dst-y INT16 END REQUEST SetInputFocus 1 revert-to ENUM8 revertto 4 focus WINDOW constants noneroot 8 time TIMESTAMP constants curtime END REQUEST GetInputFocus ALIASES Empty RESPONSE GetInputFocus 1 revert-to ENUM8 revertto 8 focus WINDOW constants noneroot END REQUEST QueryKeymap ALIASES Empty RESPONSE QueryKeymap 8 keys LISTofCARD8 END TYPE FONT CARD32 REQUEST OpenFont 4 fid FONT 8 length COUNT16 12 name STRING8 END templateREQUEST FONT 4 font FONT END REQUEST CloseFont ALIASES FONT REQUEST QueryFont ALIASES FONT #// What is that really? TYPE 32bits CARD32 LIST FONTPROP length 8 0 name ATOM 4 value 32bits END STRUCT CHARINFO length 12 0 left-side-bearing INT16 2 right-side-bearing INT16 4 character-width INT16 6 ascent INT16 8 descent INT16 10 attributes CARD16 END RESPONSE QueryFont 8 min-bounds CHARINFO 24 max-bounds CHARINFO 40 min-char-or-byte2 CARD16 42 max-char-or-byte2 CARD16 44 default-char CARD16 46 "#FONTPROPs" COUNT16 48 draw-direction ENUM8 direction 49 min-byte1 CARD8 50 max-byte1 CARD8 51 all-chars-exist BOOL 52 font-ascent INT16 54 font-descent INT16 60 properties LISTofFONTPROP 56 "#CHARINFOs" COUNT32 LATER char-infos LISTofCHARINFO END TYPE FONTABLE CARD32 TYPE STRING16 LISTofCARD16 REQUEST QueryTextExtents 1 lastunused BOOL 4 font FONTABLE 8 string STRING16 END RESPONSE QueryTextExtents 1 draw-direction ENUM8 direction 8 font-ascent INT16 10 font-descent INT16 12 overall-ascent INT16 14 overall-descent INT16 16 overall-width INT32 20 overall-left INT32 24 overall-right INT32 END REQUEST ListFonts 4 max-names CARD16 6 length COUNT16 8 pattern STRING8 END LIST STRING8 variable min-length 1 0 c COUNT8 1 s STRING8 END RESPONSE ListFonts 8 count COUNT16 32 names LISTofSTRING8 END REQUEST ListFontsWithInfo ALIASES ListFonts RESPONSE ListFontsWithInfo 8 min-bounds CHARINFO 24 max-bounds CHARINFO 40 min-char-or-byte2 CARD16 42 max-char-or-byte2 CARD16 44 default-char CARD16 48 draw-direction ENUM8 direction 49 min-byte1 CARD8 50 max-byte1 CARD8 51 all-chars-exist BOOL 52 font-ascent INT16 54 font-descent INT16 56 replies-hint CARD32 46 count COUNT16 60 properties LISTofFONTPROP 1 length COUNT8 LATER name STRING8 END REQUEST SetFontPath 4 count CARD16 8 path LISTofSTRING8 END REQUEST GetFontPath ALIASES Empty RESPONSE GetFontPath 8 count CARD16 32 path LISTofSTRING8 END REQUEST CreatePixmap 1 depth CARD8 4 pid PIXMAP 8 drawable DRAWABLE 12 width UINT16 14 height UINT16 END REQUEST FreePixmap 4 drawable DRAWABLE END TYPE GCONTEXT CARD32 VALUES GCattributes 0x00000001 function ENUM8 function 0x00000002 plane-mask CARD32 0x00000004 foreground CARD32 0x00000008 background CARD32 0x00000010 line-width UINT16 0x00000020 line-style ENUM8 line_style 0x00000040 cap-style ENUM8 cap_style 0x00000080 join-style ENUM8 join_style 0x00000100 fill-style ENUM8 fill_style 0x00000200 fill-rule ENUM8 fill_rule 0x00000400 tile PIXMAP 0x00000800 stipple PIXMAP 0x00001000 tile-stipple-x-origin INT16 0x00002000 tile-stipple-y-origin INT16 0x00004000 font FONT 0x00008000 subwindow-mode SubwindowMode 0x00010000 graphics-exposures BOOL 0x00020000 clip-x-origin INT16 0x00040000 clip-y-origin INT16 0x00080000 clip-mask PIXMAP constants none 0x00100000 dash-offset UINT16 0x00200000 dashes UINT8 0x00400000 arc-mode ENUM8 arc_mode 0x00800000 unknown22 CARD32 0x01000000 unknown23 CARD32 0x02000000 unknown24 CARD32 0x04000000 unknown25 CARD32 0x08000000 unknown26 CARD32 0x10000000 unknown28 CARD32 0x20000000 unknown29 CARD32 0x40000000 unknown30 CARD32 0x80000000 unknown31 CARD32 END REQUEST CreateGC 4 cid GCONTEXT 8 drawable DRAWABLE 12 value-mask STORE32 16 values LISTofGCattributes END REQUEST ChangeGC 4 gc GCONTEXT 8 value-mask STORE32 12 values LISTofGCattributes END REQUEST CopyGC 4 src-gc GCONTEXT 8 dst-gc GCONTEXT 12 value-mask BITMASK32 copygcvalues END REQUEST SetDashes 4 gc GCONTEXT 8 dash-offset CARD16 10 count COUNT16 12 dashes LISTofCARD8 END STRUCT RECTANGLE length 8 0 x INT16 2 y INT16 4 w UINT16 6 h UINT16 END REQUEST SetClipRectangles 1 ordering ENUM8 rect_ordering 4 gc GCONTEXT 8 clip-x-origin INT16 10 clip-y-origin INT16 12 rectangles LISTofRECTANGLE END templateREQUEST GC 4 gc GCONTEXT END REQUEST FreeGC ALIASES GC REQUEST ClearArea 1 exposures BOOL 4 window WINDOW 8 x INT16 10 y INT16 12 width UINT16 14 height UINT16 END REQUEST CopyArea 4 src-drawable DRAWABLE 8 dst-drawable DRAWABLE 12 gc GCONTEXT 16 src-x INT16 18 src-y INT16 20 dst-x INT16 22 dst-y INT16 24 width UINT16 26 height UINT16 END REQUEST CopyPlane 4 src-drawable DRAWABLE 8 dst-drawable DRAWABLE 12 gc GCONTEXT 16 src-x INT16 18 src-y INT16 20 dst-x INT16 22 dst-y INT16 24 width UINT16 26 height UINT16 28 bit-plane CARD32 END LIST POINT length 4 0 x INT16 2 y INT16 END REQUEST PolyPoint 1 coordinate-mode ENUM8 coordinate_mode 4 drawable DRAWABLE 8 gc GCONTEXT 12 points LISTofPOINT END REQUEST PolyLine 1 coordinate-mode ENUM8 coordinate_mode 4 drawable DRAWABLE 8 gc GCONTEXT 12 points LISTofPOINT END LIST SEGMENT length 8 0 x1 INT16 2 y1 INT16 4 x2 INT16 6 y2 INT16 END REQUEST PolySegment 4 drawable DRAWABLE 8 gc GCONTEXT 12 segments LISTofSEGMENT END REQUEST PolyRectangle 4 drawable DRAWABLE 8 gc GCONTEXT 12 rectangles LISTofRECTANGLE END LIST ARC length 12 0 x INT16 2 y INT16 4 w UINT16 6 h UINT16 8 angle1 INT16 10 angle2 INT16 END REQUEST PolyArc 4 drawable DRAWABLE 8 gc GCONTEXT 12 arcs LISTofARC END REQUEST FillPoly 4 drawable DRAWABLE 8 gc GCONTEXT 12 shape ENUM8 shape 13 coordinate-mode ENUM8 coordinate_mode 16 points LISTofPOINT END REQUEST PolyFillRectangle 4 drawable DRAWABLE 8 gc GCONTEXT 12 rectangles LISTofRECTANGLE END REQUEST PolyFillArc ALIASES PolyArc REQUEST PutImage 1 format ENUM8 bitmap_format 4 drawable DRAWABLE 8 gc GCONTEXT 12 width UINT16 14 height UINT16 16 dst-x INT16 18 dst-y INT16 20 left-pad CARD8 21 depth CARD8 END REQUEST GetImage 1 format ENUM8 bitmap_format 4 drawable DRAWABLE 8 x INT16 10 y INT16 12 width UINT16 14 height UINT16 16 plane-mask CARD32 END RESPONSE GetImage 1 depth CARD8 4 "32-bit values got" UINT32 8 visual VISUALID constants none END LIST PolyText8 variable min-length 3 IF 0 CARD8 255 1 font BE32 NEXT 5 ELSEIF 0 CARD8 0 # prevent a empty string fitting in the last 3 pad bytes # showing up. (as this 3 pad bytes could contain a # string of length 1 I think) NEXT 2 ELSE 1 delta INT8 0 length COUNT8 2 s STRING8 END REQUEST PolyText8 4 drawable DRAWABLE 8 gc GCONTEXT 12 x INT16 14 y INT16 16 texts LISTofPolyText8 END LIST PolyText16 variable min-length 4 IF 0 CARD8 255 1 font BE32 NEXT 5 ELSE 1 delta INT8 0 length COUNT8 2 s STRING16 END REQUEST PolyText16 4 drawable DRAWABLE 8 gc GCONTEXT 12 x INT16 14 y INT16 16 texts LISTofPolyText16 END REQUEST ImageText8 4 drawable DRAWABLE 8 gc GCONTEXT 12 x INT16 14 y INT16 1 length COUNT8 16 string STRING8 END REQUEST ImageText16 4 drawable DRAWABLE 8 gc GCONTEXT 12 x INT16 14 y INT16 1 length COUNT8 16 string STRING16 END REQUEST CreateColormap 1 alloc ENUM8 alloc 4 mid COLORMAP 8 window WINDOW 12 visual VISUALID END templateREQUEST COLORMAP 4 cmap COLORMAP END REQUEST FreeColormap ALIASES COLORMAP REQUEST CopyColormapAndFree 4 mid COLORMAP 8 src-cmap COLORMAP END REQUEST InstallColormap ALIASES COLORMAP REQUEST UninstallColormap ALIASES COLORMAP REQUEST ListInstalledColormaps ALIASES WINDOW TYPE LISTofCOLORMAP LISTofCARD32 RESPONSE ListInstalledColormaps 8 count COUNT16 32 cmaps LISTofCOLORMAP END REQUEST AllocColor 4 cmap COLORMAP 8 red CARD16 10 green CARD16 12 blue CARD16 END RESPONSE AllocColor 8 red CARD16 10 green CARD16 12 blue CARD16 16 pixel CARD32 END REQUEST AllocNamedColor 4 cmap COLORMAP 8 count COUNT16 12 name STRING8 END RESPONSE AllocNamedColor 8 pixel CARD32 12 exact-red CARD16 14 exact-green CARD16 16 exact-blue CARD16 18 visual-red CARD16 20 visual-green CARD16 22 visual-blue CARD16 END REQUEST AllocColorCells 1 contiguous BOOL 4 cmap COLORMAP 8 colors CARD16 10 planes CARD16 END RESPONSE AllocColorCells 8 "#pixels" COUNT16 32 pixels LISTofCARD32 10 "#masks" COUNT16 LATER masks LISTofCARD32 END REQUEST AllocColorPlanes 1 contiguous BOOL 4 cmap COLORMAP 8 colors CARD16 10 reds CARD16 12 greens CARD16 14 blues CARD16 END RESPONSE AllocColorPlanes 8 count COUNT16 12 red-mask CARD32 16 green-mask CARD32 20 blue-mask CARD32 32 pixels LISTofCARD32 END REQUEST FreeColors 4 cmap COLORMAP 8 plane-mask CARD32 12 pixels LISTofCARD32 END LIST COLORITEM length 12 0 pixel CARD32 4 red CARD16 6 green CARD16 8 blue CARD16 10 do BITMASK8 doredgreenblue END REQUEST StoreColors 4 cmap COLORMAP 8 items LISTofCOLORITEM END REQUEST StoreNamedColor 1 do ENUM8 doredgreenblue 4 cmap COLORMAP 8 pixel CARD32 12 "#" COUNT16 16 name STRING8 END REQUEST QueryColors 4 cmap COLORMAP 12 pixels LISTofCARD32 END LIST RGB length 8 0 r CARD16 2 g CARD16 4 b CARD16 END RESPONSE QueryColors 8 "#" COUNT16 32 colors LISTofRGB END REQUEST LookupColor 4 cmap COLORMAP 8 "#" COUNT16 12 name STRING8 END RESPONSE LookupColor 8 exact-red CARD16 10 exact-green CARD16 12 exact-blue CARD16 14 visual-red CARD16 16 visual-green CARD16 18 visual-blue CARD16 END REQUEST CreateCursor 4 cid CURSOR 8 source PIXMAP 12 mask PIXMAP constants none 16 fore-red CARD16 18 fore-green CARD16 20 fore-blue CARD16 22 back-red CARD16 24 back-green CARD16 26 back-blue CARD16 28 x UINT16 30 y UINT16 END REQUEST CreateGlyphCursor 4 cid CURSOR 8 source-font FONT 12 mask-font FONT constants none 16 source-char CARD16 18 mask-char CARD16 20 fore-red CARD16 22 fore-green CARD16 24 fore-blue CARD16 26 back-red CARD16 28 back-green CARD16 30 back-blue CARD16 END templateREQUEST CURSOR 4 cursor CURSOR END REQUEST FreeCursor ALIASES CURSOR REQUEST RecolorCursor 4 cursor CURSOR 8 fore-red CARD16 10 fore-green CARD16 12 fore-blue CARD16 14 back-red CARD16 16 back-green CARD16 18 back-blue CARD16 END REQUEST QueryBestSize 1 class ENUM8 sizeclass 4 drawable DRAWABLE 8 width UINT16 10 height UINT16 END RESPONSE QueryBestSize 8 width UINT16 10 height UINT16 END REQUEST QueryExtension 4 "#" COUNT16 8 name STRING8 END RESPONSE QueryExtension 8 present BOOL 9 major-opcode UINT8 10 first-event UINT8 11 first-error UINT8 END REQUEST ListExtensions ALIASES Empty RESPONSE ListExtensions 1 "number of STRs in names" COUNT8 32 names LISTofSTRING8 END TYPE LISTofKEYSYM LISTofCARD32 REQUEST ChangeKeyboardMapping 2 keycode-count CARD8 4 first-keycode KEYCODE 5 keysyms-per-keycode CARD8 ## it's CARD8(2)*CARD8(5) many just list until end of package: 8 keysyms LISTofKEYSYM END REQUEST GetKeyboardMapping 4 first-keycode KEYCODE 5 count CARD8 END RESPONSE GetKeyboardMapping 1 keysyms-per-keycode CARD8 32 keysyms LISTofKEYSYM END CONSTANTS OnOffDefault 0 Off 1 On 2 Default END VALUES KeyboardControl 0x0001 key-click-percent INT8 0x0002 bell-percent INT8 0x0004 bell-pitch INT16 0x0008 bell-duration INT16 0x0010 led CARD8 0x0020 led-mode ENUM8 OnOffDefault 0x0040 key KEYCODE 0x0080 auto-repeat-mode ENUM8 OnOffDefault END REQUEST ChangeKeyboardControl 4 value-mask STORE16 8 values LISTofKeyboardControl END REQUEST GetKeyboardControl ALIASES Empty RESPONSE GetKeyboardControl 1 global-auto-repeat BOOL 8 led-mask CARD32 12 key-click-percent CARD8 13 bell-percent CARD8 14 bell-pitch CARD16 16 bell-duration CARD16 20 auto-repeats LISTofCARD8 END REQUEST Bell 1 percent INT8 END REQUEST ChangePointerControl 4 acceleration FRACTION16_16 8 threshold INT16 10 do-acceleration BOOL 11 do-threshold BOOL END REQUEST GetPointerControl ALIASES Empty RESPONSE GetPointerControl 8 acceleration FRACTION16_16 12 threshold CARD16 END REQUEST SetScreenSaver 4 timeout INT16 6 interval INT16 8 prefer-blanking ENUM8 nyd 9 allow-exposures ENUM8 nyd END REQUEST GetScreenSaver ALIASES Empty RESPONSE GetScreenSaver 8 timeout UINT16 10 interval UINT16 12 prefer-blanking ENUM8 nyd 13 allow-exposures ENUM8 nyd END REQUEST ChangeHosts 1 mode ENUM8 insertdelete 4 family ENUM8 family 6 "#" COUNT16 8 address LISTofCARD8 END REQUEST ListHosts ALIASES Empty TYPE LISTofHOST LISTofCARD32 RESPONSE ListHosts 1 mode ENUM8 disabledenabled 8 "#" COUNT16 32 hosts LISTofHOST END REQUEST SetAccessControl 1 mode ENUM8 disableenable END REQUEST SetCloseDownMode 1 mode ENUM8 closemode END REQUEST KillClient 4 resource CARD32 constants alltemporary END REQUEST RotateProperties 4 window WINDOW 8 "#" COUNT16 10 delta INT16 12 properties LISTofATOM END REQUEST ForceScreenSaver 1 mode ENUM8 resetactivate END REQUEST SetPointerMapping 1 "#" COUNT8 4 map LISTofCARD8 END templateRESPONSE SuccessBusyFailed 1 status ENUM8 successbusyfailed END RESPONSE SetPointerMapping ALIASES SuccessBusyFailed REQUEST GetPointerMapping ALIASES Empty RESPONSE GetPointerMapping 1 length COUNT8 32 map LISTofCARD8 END TYPE LISTofKEYCODE LISTofCARD8 REQUEST SetModifierMapping 1 keycodes-per-modifier CARD8 4 keycodes LISTofKEYCODE END RESPONSE SetModifierMapping ALIASES SuccessBusyFailed REQUEST GetModifierMapping ALIASES Empty RESPONSE GetModifierMapping 1 keycodes-per-modifier CARD8 32 keycodes LISTofKEYCODE END REQUEST DestroyWindow ALIASES WINDOW REQUEST DestroySubwindows ALIASES WINDOW REQUEST MapWindow ALIASES WINDOW REQUEST MapSubwindows ALIASES WINDOW REQUEST UnmapWindow ALIASES WINDOW REQUEST UnmapSubwindows ALIASES WINDOW REQUEST GrabServer ALIASES Empty REQUEST UngrabServer ALIASES Empty REQUEST NoOperation ALIASES Empty EOF xtrace-1.3.1/all.proto0000644000175100017510000000102211704002604011547 00000000000000NEEDS "requests.proto" NEEDS "events.proto" NEEDS "errors.proto" NEEDS "setup.proto" NEEDS "bigfont.proto" NEEDS "bigrequest.proto" NEEDS "damage.proto" NEEDS "dpms.proto" NEEDS "dri2.proto" NEEDS "fixes.proto" NEEDS "genericevents.proto" NEEDS "glx.proto" NEEDS "mitshm.proto" NEEDS "randr.proto" NEEDS "render.proto" NEEDS "saver.proto" NEEDS "shape.proto" NEEDS "sync.proto" NEEDS "vidmode.proto" NEEDS "xinerama.proto" NEEDS "xinput.proto" NEEDS "xkb.proto" NEEDS "xvideo.proto" NEEDS "composite.proto" NEEDS "dga.proto" EOF xtrace-1.3.1/COPYING0000644000175100017510000004310311704002604010753 00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. xtrace-1.3.1/composite.proto0000644000175100017510000000222311704002604013005 00000000000000NEEDS "requests.proto" NEEDS "fixes.proto" EXTENSION "Composite" Composite USE core REQUESTS QueryVersion RESPONDS RedirectWindow RedirectSubwindows UnredirectWindow UnredirectSubwindows CreateRegionFromBorderClip NameWindowPixmap GetOverlayWindow RESPONDS ReleaseOverlayWindow /*8*/ END CONSTANTS updateType 0 Automatic 1 Manual END TYPE UpdateType ENUM8 updateType REQUEST QueryVersion 4 majorVersion UINT32 8 minorVersion UINT32 END RESPONSE QueryVersion 8 majorVersion UINT32 12 minorVersion UINT32 END REQUEST RedirectWindow 4 window WINDOW 8 update UpdateType END REQUEST RedirectSubwindows 4 window WINDOW 8 update UpdateType END # UpdateType doesn't make sense, but it's transmitted through the wire REQUEST UnredirectWindow 4 window WINDOW 8 update UpdateType END # Likewise REQUEST UnredirectSubwindows 4 window WINDOW 8 update UpdateType END REQUEST CreateRegionFromBorderClip 4 region Fixes::REGION 8 window WINDOW END REQUEST NameWindowPixmap 4 window WINDOW 8 pixmap PIXMAP END REQUEST GetOverlayWindow 4 window WINDOW END RESPONSE GetOverlayWindow 4 overlayWin WINDOW END REQUEST ReleaseOverlayWindow 4 window WINDOW END EOF xtrace-1.3.1/dri2.proto0000644000175100017510000001271311704002604011650 00000000000000# This file is part of "xtrace" # Copyright (C) 2010 Julien Cristau # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # # This file is based on /usr/include/X11/extensions/dri2proto.h which states: # # Copyright © 2008 Red Hat, Inc. # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "Soft- # ware"), to deal in the Software without restriction, including without # limitation the rights to use, copy, modify, merge, publish, distribute, # and/or sell copies of the Software, and to permit persons to whom the # Software is furnished to do so, provided that the above copyright # notice(s) and this permission notice appear in all copies of the Soft- # ware and that both the above copyright notice(s) and this permission # notice appear in supporting documentation. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY # RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN # THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSE- # QUENTIAL 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 PERFOR- # MANCE OF THIS SOFTWARE. # # Except as contained in this notice, the name of a copyright holder shall # not be used in advertising or otherwise to promote the sale, use or # other dealings in this Software without prior written authorization of # the copyright holder. # # Authors: # Kristian Høgsberg (krh@redhat.com) # NEEDS "fixes.proto" EXTENSION "DRI2" DRI2 USE core REQUESTS QueryVersion RESPONDS Connect RESPONDS Authenticate RESPONDS CreateDrawable DestroyDrawable GetBuffers RESPONDS CopyRegion RESPONDS GetBuffersWithFormat RESPONDS SwapBuffers RESPONDS GetMSC RESPONDS WaitMSC RESPONDS WaitSBC RESPONDS SwapInterval END EVENTS BufferSwapComplete InvalidateBuffers END ERRORS END REQUEST QueryVersion 4 major-version UINT32 8 minor-version UINT32 END RESPONSE QueryVersion 8 major-version UINT32 12 minor-version UINT32 END CONSTANTS driver_type 0 DRI 1 VDPAU END REQUEST Connect 4 window WINDOW 8 driver-type ENUM32 driver_type END RESPONSE Connect 8 driver-name-len COUNT32 32 driver-name STRING8 12 device-name-len COUNT32 ROUND LATER device-name STRING8 END REQUEST Authenticate 4 window WINDOW 8 token CARD32 END RESPONSE Authenticate 8 authenticated ENUM32 bool END REQUEST CreateDrawable 4 drawable DRAWABLE END REQUEST DestroyDrawable 4 drawable DRAWABLE END CONSTANTS attachment 0x0 FrontLeft 0x1 BackLeft 0x2 FrontRight 0x3 BackRight 0x4 Depth 0x5 Stencil 0x6 Accum 0x7 FakeFrontLeft 0x8 FakeFrontRight 0x9 DepthStencil END TYPE DRI2ATTACHMENT ENUM32 attachment LIST DRI2ATTACHMENT length 4 0 attachment DRI2ATTACHMENT END LIST DRI2BUFFER length 20 0 attachment DRI2ATTACHMENT 4 name CARD32 8 pitch UINT32 12 cpp UINT32 16 flags CARD32 END REQUEST GetBuffers 4 drawable DRAWABLE 8 count COUNT32 12 attachments LISTofDRI2ATTACHMENT END RESPONSE GetBuffers 8 width UINT32 12 height UINT32 16 count COUNT32 32 buffers LISTofDRI2BUFFER END REQUEST CopyRegion 4 drawable DRAWABLE 8 region Fixes::REGION 12 dest DRI2ATTACHMENT 16 src DRI2ATTACHMENT END RESPONSE CopyRegion END LIST DRI2ATTACH_FORMAT length 8 0 attachment DRI2ATTACHMENT 4 format CARD32 END REQUEST GetBuffersWithFormat 4 drawable DRAWABLE 8 count COUNT32 12 attachments LISTofDRI2ATTACH_FORMAT END RESPONSE GetBuffersWithFormat 8 width UINT32 12 height UINT32 16 count COUNT32 32 buffers LISTofDRI2BUFFER END REQUEST SwapBuffers 4 drawable DRAWABLE 8 target_msc_hi UINT32 12 target_msc_lo UINT32 16 divisor_hi UINT32 20 divisor_lo UINT32 24 remainder_hi UINT32 28 remainder_lo UINT32 END RESPONSE SwapBuffers 8 swap_hi UINT32 12 swap_lo UINT32 END REQUEST GetMSC 4 drawable DRAWABLE END RESPONSE GetMSC 8 ust_hi UINT32 12 ust_lo UINT32 16 msc_hi UINT32 20 msc_lo UINT32 24 sbc_hi UINT32 28 sbc_lo UINT32 END REQUEST WaitMSC 4 drawable DRAWABLE 8 target_msc_hi UINT32 12 target_msc_lo UINT32 16 divisor_hi UINT32 20 divisor_lo UINT32 24 remainder_hi UINT32 28 remainder_lo UINT32 END RESPONSE WaitMSC 8 ust_hi UINT32 12 ust_lo UINT32 16 msc_hi UINT32 20 msc_lo UINT32 24 sbc_hi UINT32 28 sbc_lo UINT32 END REQUEST WaitSBC 4 drawable DRAWABLE 8 target_sbc_hi UINT32 12 target_sbc_lo UINT32 END RESPONSE WaitSBC 8 ust_hi UINT32 12 ust_lo UINT32 16 msc_hi UINT32 20 msc_lo UINT32 24 sbc_hi UINT32 28 sbc_lo UINT32 END REQUEST SwapInterval 4 drawable DRAWABLE 8 interval UINT32 END EVENT BufferSwapComplete 4 drawable DRAWABLE 8 ust_hi UINT32 12 ust_lo UINT32 16 msc_hi UINT32 20 msc_lo UINT32 24 sbc_hi UINT32 28 sbc_lo UINT32 END EVENT InvalidateBuffers 4 drawable DRAWABLE END EOF xtrace-1.3.1/aclocal.m40000644000175100017510000011036411765365436011612 00000000000000# generated automatically by aclocal 1.11.5 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, # Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, [m4_warning([this file was generated for autoconf 2.69. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically `autoreconf'.])]) # Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software # Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.11' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.11.5], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.11.5])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to # `$srcdir', `$srcdir/..', or `$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is `.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50])dnl # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 9 # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ(2.52)dnl ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009, # 2010, 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 12 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "GCJ", or "OBJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl ifelse([$1], CC, [depcc="$CC" am_compiler_list=], [$1], CXX, [depcc="$CXX" am_compiler_list=], [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], UPC, [depcc="$UPC" am_compiler_list=], [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE(dependency-tracking, [ --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl AC_SUBST([am__nodep])dnl _AM_SUBST_NOTMAKE([am__nodep])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. #serial 5 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Autoconf 2.62 quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each `.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 8 # AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2008, 2009 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 16 # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.62])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) AM_MISSING_PROG(AUTOCONF, autoconf) AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) AM_MISSING_PROG(AUTOHEADER, autoheader) AM_MISSING_PROG(MAKEINFO, makeinfo) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AM_PROG_MKDIR_P])dnl # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES(CC)], [define([AC_PROG_CC], defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES(CXX)], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES(OBJC)], [define([AC_PROG_OBJC], defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl ]) _AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl dnl The `parallel-tests' driver may need to know about EXEEXT, so add the dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl ]) dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001, 2003, 2005, 2008, 2011 Free Software Foundation, # Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST(install_sh)]) # Copyright (C) 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Add --enable-maintainer-mode option to configure. -*- Autoconf -*- # From Jim Meyering # Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008, # 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 5 # AM_MAINTAINER_MODE([DEFAULT-MODE]) # ---------------------------------- # Control maintainer-specific portions of Makefiles. # Default is to disable them, unless `enable' is passed literally. # For symmetry, `disable' may be passed as well. Anyway, the user # can override the default with the --enable/--disable switch. AC_DEFUN([AM_MAINTAINER_MODE], [m4_case(m4_default([$1], [disable]), [enable], [m4_define([am_maintainer_other], [disable])], [disable], [m4_define([am_maintainer_other], [enable])], [m4_define([am_maintainer_other], [enable]) m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) dnl maintainer-mode's default is 'disable' unless 'enable' is passed AC_ARG_ENABLE([maintainer-mode], [ --][am_maintainer_other][-maintainer-mode am_maintainer_other make rules and dependencies not useful (and sometimes confusing) to the casual installer], [USE_MAINTAINER_MODE=$enableval], [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes])) AC_MSG_RESULT([$USE_MAINTAINER_MODE]) AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes]) MAINT=$MAINTAINER_MODE_TRUE AC_SUBST([MAINT])dnl ] ) AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 4 # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from `make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 6 # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it supports --run. # If it does, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= AC_MSG_WARN([`missing' script is too old or missing]) fi ]) # Copyright (C) 2003, 2004, 2005, 2006, 2011 Free Software Foundation, # Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # AM_PROG_MKDIR_P # --------------- # Check for `mkdir -p'. AC_DEFUN([AM_PROG_MKDIR_P], [AC_PREREQ([2.60])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, dnl while keeping a definition of mkdir_p for backward compatibility. dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of dnl Makefile.ins that do not define MKDIR_P, so we do our own dnl adjustment using top_builddir (which is defined more often than dnl MKDIR_P). AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl case $mkdir_p in [[\\/$]]* | ?:[[\\/]]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software # Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 5 # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) # _AM_SET_OPTIONS(OPTIONS) # ------------------------ # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 5 # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftest.file # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; esac # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi rm -f conftest.file if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT(yes)]) # Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor `install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in `make install-strip', and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be `maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 3 # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # -------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004, 2005, 2012 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of `v7', `ustar', or `pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AC_SUBST([AMTAR], ['$${TAR-tar}']) m4_if([$1], [v7], [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar],, [pax],, [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' _am_tools=${am_cv_prog_tar_$1-$_am_tools} # Do not fold the above two line into one, because Tru64 sh and # Solaris sh will not grok spaces in the rhs of `-'. for _am_tool in $_am_tools do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR xtrace-1.3.1/copyauth.c0000644000175100017510000001617011704002604011724 00000000000000/* This file is part of "xtrace" * Copyright (C) 2005 Bernhard R. Link * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include "xtrace.h" /* This file is responsible for getting the autorisation tokens of the * device we are connecting to and saving them for the fake device we * are creating. This is done by calling xauth. (This allows to * to set PATH to an alternative utility to do even more funny things, * and is simpler than reimplementing xauth by using libXau) */ static inline ssize_t readtoend(int fd, char *buffer, size_t len) { size_t bytesgottotal = 0; ssize_t bytesgotlast; do { bytesgotlast = read(fd,buffer+bytesgottotal,len-bytesgottotal); if( bytesgotlast < 0 ) { int e = errno; fprintf(stderr,"Error reading from xauth pipe: %d=%s\n",e,strerror(e)); return bytesgotlast; } else if( bytesgotlast > 0 ) { bytesgottotal += bytesgotlast; if( bytesgottotal >= len ) { fprintf(stderr,"Too much data from xauth command: more than %u\n",(unsigned int)len); return -1; } } } while( bytesgotlast != 0 ); return bytesgottotal; } static inline bool parseauthdata(char *buffer,const char **name,const char **data) { char *p; bool foundsomething = false; char *thisname; char *thisdata; p = buffer; do { while( *p != '\0' && *p != '\n' && *p != ' ' && *p != '\t') p++; while( *p != '\0' && *p != '\n' && (*p == ' ' || *p == '\t') ) p++; thisname = p; while( *p != '\0' && *p != '\n' && *p != ' ' && *p != '\t' ) p++; if( *p != '\0' && *p != '\n' ) { *p = '\0'; p++; } while( *p != '\0' && *p != '\n' && (*p == ' ' || *p == '\t') ) p++; thisdata = p; while( *p != '\0' && *p != '\n' && *p != ' ' && *p != '\t' ) p++; if( *p != '\0' && *p != '\n' ) { *p = '\0'; p++; } while( *p != '\0' && *p != '\n' && (*p == ' ' || *p == '\t') ) p++; if( *p == '\n' ) { *p = '\0'; } else if( *p != '\0' ) { fprintf(stderr,"Error parsing xauth list data: more than three things in a line!\n"); return false; } if( thisname[0] == '\0' || thisdata[0] == '\0' ) { fprintf(stderr,"Error parsing xauth list data: less than three things in a line!\n"); return false; } if( strcmp(thisname,"MIT-MAGIC-COOKIE-1") == 0) { *name = thisname; *data = thisdata; foundsomething = true; } } while( *p != '\0' ); return foundsomething; } bool copy_authentication(const char *fakedisplay,const char *display, const char *infile, const char *outfile) { int pipe_fds[2]; int r,e; pid_t pid,waitresult; /* if this is not enough, copy manually */ char buffer[4096]; ssize_t bytesgot; #ifdef STUPIDCC const char *name = NULL, *data = NULL; #else const char *name,*data; #endif int status; if( strncmp(display,"localhost:",10) == 0 ) { /* copy with remote X DISPLAYs */ display += 9; } pid = fork(); if( pid < 0 ) { e = errno; fprintf(stderr,"Error forking: %d=%s\n",e,strerror(e)); return false; } if( pid == 0 ) { int fd = open("/dev/null",O_RDONLY); if( fd >= 0 ) { (void)dup2(fd,0); (void)dup2(fd,1); if( fd > 2 ) (void)close(fd); } if( outfile != NULL ) r = execlp("xauth","xauth","-f",outfile,"remove",fakedisplay,(char*)NULL); else r = execlp("xauth","xauth","remove",fakedisplay,(char*)NULL); exit(EXIT_FAILURE); } do { waitresult = waitpid(pid,&status,0); } while( waitresult < 0 && errno == EINTR ); if( waitresult < 0 ) { e = errno; fprintf(stderr,"Error waiting for xauth remove: %d=%s\n",e,strerror(e)); return false; } if( !WIFEXITED(status) ) { fprintf(stderr,"Abnormal termination of xauth remove!\n"); return false; } if( WEXITSTATUS(status) != 0 ) { fprintf(stderr,"xauth remove terminated with exit code %d!\n",(int)(WEXITSTATUS(status))); return false; } r = pipe(pipe_fds); if( r != 0 ) { e = errno; fprintf(stderr,"Error creating pipe: %d=%s\n",e,strerror(e)); return false; } pid = fork(); if( pid < 0 ) { e = errno; fprintf(stderr,"Error forking: %d=%s\n",e,strerror(e)); return false; } if( pid == 0 ) { int fd = open("/dev/null",O_RDONLY); if( fd >= 0 ) { (void)dup2(fd,0); if( fd > 2 ) (void)close(fd); } (void)close(pipe_fds[0]); r = dup2(pipe_fds[1],1); if( r < 0 ) { e = errno; fprintf(stderr,"Error connecting pipe to stdin in child process: %d=%s\n",e,strerror(e)); exit(EXIT_FAILURE); } (void)close(pipe_fds[1]); if( infile != NULL ) r = execlp("xauth","xauth","-f",infile,"list",display,(char*)NULL); else r = execlp("xauth","xauth","list",display,(char*)NULL); exit(EXIT_FAILURE); } (void)close(pipe_fds[1]); bytesgot = readtoend(pipe_fds[0],buffer,sizeof(buffer)-1); if( bytesgot < 0 ) { return false; } r = close(pipe_fds[0]); if( r != 0 ) { e = errno; fprintf(stderr,"Error reading from pipe from xauth: %d=%s\n",e,strerror(e)); return false; } buffer[bytesgot-1] = '\0'; do { waitresult = waitpid(pid,&status,0); } while( waitresult < 0 && errno == EINTR ); if( waitresult < 0 ) { e = errno; fprintf(stderr,"Error waiting for xauth list: %d=%s\n",e,strerror(e)); return false; } if( !WIFEXITED(status) ) { fprintf(stderr,"Abnormal termination of xauth list!\n"); return false; } if( WEXITSTATUS(status) != 0 ) { fprintf(stderr,"xauth list terminated with exit code %d!\n",(int)(WEXITSTATUS(status))); return false; } if( !parseauthdata(buffer,&name,&data) ) { return false; } pid = fork(); if( pid < 0 ) { e = errno; fprintf(stderr,"Error forking: %d=%s\n",e,strerror(e)); return false; } if( pid == 0 ) { int fd = open("/dev/null",O_RDONLY); if( fd >= 0 ) { (void)dup2(fd,0); (void)dup2(fd,1); if( fd > 2 ) (void)close(fd); } if( outfile != NULL ) r = execlp("xauth","xauth","-f",outfile,"add",fakedisplay,name,data,(char*)NULL); else r = execlp("xauth","xauth","add",fakedisplay,name,data,(char*)NULL); exit(EXIT_FAILURE); } do { waitresult = waitpid(pid,&status,0); } while( waitresult < 0 && errno == EINTR ); if( waitresult < 0 ) { e = errno; fprintf(stderr,"Error waiting for xauth add: %d=%s\n",e,strerror(e)); return false; } if( !WIFEXITED(status) ) { fprintf(stderr,"Abnormal termination of xauth add!\n"); return false; } if( WEXITSTATUS(status) != 0 ) { fprintf(stderr,"xauth add terminated with exit code %d!\n",(int)(WEXITSTATUS(status))); return false; } return true; } xtrace-1.3.1/stringlist.h0000644000175100017510000000042111704002604012267 00000000000000#ifndef XTRACE_STRINGLIST_H #define XTRACE_STRINGLIST_H const char *string_add_l(const char *, size_t); const char *string_add(const char *); const void *finalize_data(const void *, size_t len, size_t align); void stringlist_init(void); void stringlist_done(void); #endif xtrace-1.3.1/README0000644000175100017510000000274011704002604010602 00000000000000 XTRACE 1.1 ---------- What strace is for system calls, xtrace is for X11 connections: you hook it between one or more X11 clients and an X server and it prints the requests going from client to server and the replies, events and errors going the other way. Short howto: Run xtrace, which defaults to listening at :9 and forwarding to your current $DISPLAY. Then simply start other clients after setting DISPLAY=:9 or giving them -display :9 and see all the data flowing in a far to verbose form. Things still to do (any volunteers?): - test, test, test (currently only what I needed is tested, and as I calculated offsets by hand and copy&pasted a lot, there might still be some errors). - implement the common extensions. (currently only implemented are the base protocol and a limted number of extensions) - make it less verbose or even better allow to control verbosity. - implement some filtering - implement life modification. (Currently only supported by changing the source, look for requestButtonGrab in parse.c for an example. Being able to do this via command line would be nice.) - more checking of protocol specifications, there are many easy to make errors that are still not tested for. - script to translate xorg's protocol xml files to .proto language - allow generic dictionaries (generalizing the hard-coded atom support) and giving symbolic names to things (like GC1, GC2,..., that would make some logs much easier to compare). xtrace-1.3.1/bigrequest.proto0000644000175100017510000000157711704002604013170 00000000000000# This file is part of "xtrace" # Copyright (C) 2009 Bernhard R. Link # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA EXTENSION "BIG-REQUESTS" BigRequest USE core REQUESTS Enable RESPONDS END EVENTS END ERRORS END REQUEST Enable ALIASES Empty RESPONSE Enable 8 maximum-request-length UINT32 END EOF xtrace-1.3.1/xkb.proto0000644000175100017510000000360511704002604011574 00000000000000EXTENSION "XKEYBOARD" Xkb USE core REQUESTS UseExtension RESPONDS /* 0 */ # TODO: SelectEvents UNSUPPORTED /* 1 */ Unknown UNSUPPORTED Bell /* 3 */ GetState RESPONDS UNSUPPORTED /* 4 */ LatchLockState UNSUPPORTED /* 5 */ GetControls RESPONDS UNSUPPORTED /* 6 */ SetControls UNSUPPORTED /* 7 */ GetMap RESPONDS UNSUPPORTED /* 8 */ SetMap UNSUPPORTED /* 9 */ GetCompatMap RESPONDS UNSUPPORTED /* 10 */ SetCompatMap UNSUPPORTED /* 11 */ GetIndicatorState RESPONDS UNSUPPORTED /* 12 */ GetIndicatorMap RESPONDS UNSUPPORTED /* 13 */ SetIndicatorMap UNSUPPORTED /* 14 */ GetNamedIndicator RESPONDS UNSUPPORTED /* 15 */ SetNamedIndicator UNSUPPORTED /* 16 */ GetNames RESPONDS UNSUPPORTED /* 17 */ SetNames UNSUPPORTED /* 18 */ GetGeometry RESPONDS UNSUPPORTED /* 19 */ SetGeometry UNSUPPORTED /* 20 */ PerClientFlags UNSUPPORTED /* 21 */ ListComponents RESPONDS UNSUPPORTED /* 22 */ GetKbdByName RESPONDS UNSUPPORTED /* 23 */ GetDeviceInfo RESPONDS UNSUPPORTED /* 24 */ SetDeviceInfo UNSUPPORTED /* 25 */ END EVENTS XkbEvent END ERRORS # this also packs the type in subvalues, # to support this we need support of parsing error packets, too "Keyboard" END REQUEST UseExtension 4 major UINT16 6 minor UINT16 END RESPONSE UseExtension 8 major UINT16 10 minor UINT16 END CONSTANTS DEVICESPEC 0x100 UseCoreKbd 0x200 UseCorePtr END TYPE DEVICESPEC UINT16 constants DEVICESPEC CONSTANTS BELLCLASSSPEC 0 KbdFeedback 5 LedFeedback 0x300 DefaultXI # AllXI ??? END TYPE BELLCLASSSPEC ENUM16 BELLCLASSSPEC CONSTANTS IDSPEC 0x400 DfltXIId END TYPE IDSPEC UINT16 constants IDSPEC REQUEST Bell 4 deviceSpec DEVICESPEC 6 bellClass BELLCLASSSPEC 8 bellID IDSPEC 10 percent INT8 11 forceSound BOOL 12 eventOnly BOOL 14 pitch INT16 16 duration INT16 20 name ATOM 24 window WINDOW END EVENT XkbEvent # all events packaged into one? WTF? 1 type UINT8 4 time TIMESTAMP 8 device CARD8 # TODO: 9 not-yet-supported LISTofCARD8 END EOF xtrace-1.3.1/damage.proto0000644000175100017510000000342111704002604012222 00000000000000# This file is part of "xtrace" # Copyright (C) 2008 Bernhard R. Link # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA EXTENSION "DAMAGE" Damage USE core REQUESTS QueryVersion RESPONDS Create Destroy Subtract END EVENTS Notify END ERRORS BadDamage END CONSTANTS damage_level 0 "report raw rectangles" 1 "report delta rectangles" 2 "report bounding box" 3 "report non-empty" END TYPE DAMAGE_LEVEL ENUM8 damage_level CONSTANTS damage_state 0 off 1 on 2 cycle 3 disable END TYPE DAMAGE_STATE ENUM8 damage_state CONSTANTS damage_kind 0 blanked 1 internal 2 external END TYPE DAMAGE_KIND ENUM8 damage_kind BITMASK damage_mask 0x00000001 notify 0x00000002 cycle END TYPE DAMAGE_MASK BITMASK32 damage_mask REQUEST QueryVersion 4 "major version" UINT32 8 "minor version" UINT32 END RESPONSE QueryVersion 8 "major version" UINT32 12 "minor version" UINT32 END REQUEST Create 4 damage CARD32 8 drawable DRAWABLE 12 level DAMAGE_LEVEL END REQUEST Destroy 4 damage CARD32 END REQUEST Subtract 4 damage CARD32 8 repair-region CARD32 12 parts-region CARD32 END EVENT Notify 1 level DAMAGE_LEVEL 4 drawable DRAWABLE 8 damage CARD32 12 timestamp TIMESTAMP 16 area RECTANGLE 24 geometry RECTANGLE END EOF xtrace-1.3.1/xvideo.proto0000644000175100017510000002011311704002604012277 00000000000000# This file is part of xtrace. # Copyright (C) 2006 Bernhard R. Link # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # # This file is based on /usr/include/X11/extensions/Xvproto.h which states: # Copyright 1991 by Digital Equipment Corporation, Maynard, Massachusetts, # and the Massachusetts Institute of Technology, Cambridge, Massachusetts. # # All Rights Reserved # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose and without fee is hereby granted, # 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 names of Digital or MIT not be # used in advertising or publicity pertaining to distribution of the # software without specific, written prior permission. # # DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING # ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL # DIGITAL 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. # # and on /usr/share/xcb/xv.xml, which states: # Copyright (C) 2006 Jeremy Kolb. # All Rights Reserved. # # 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, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice 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 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. # # Except as contained in this notice, the names of the authors or their # institutions shall not be used in advertising or otherwise to promote the # sale, use or other dealings in this Software without prior written # authorization from the authors. EXTENSION "XVideo" XV USE core REQUESTS QueryExtension RESPONDS /* 0 */ QueryAdaptors RESPONDS QueryEncodings RESPONDS GrabPort RESPONDS UngrabPort PutVideo PutStill GetVideo GetStill StopVideo SelectVideoNotify /* 10 */ SelectPortNotify QueryBestSize RESPONDS SetPortAttribute GetPortAttribute RESPONDS QueryPortAttributes RESPONDS ListImageFormats RESPONDS QueryImageAttributes RESPONDS PutImage ShmPutImage END EVENTS VideoNotify PortNotify END ERRORS BadPort BadEncoding BadMode END TYPE PORT UINT32 TYPE ENCODING UINT32 BITMASK xvtype 1<<0 Input 1<<1 Output 1<<2 Video 1<<3 Still 1<<4 Image END CONSTANTS ImageFormatInfoType 0 RGB 1 YUV END CONSTANTS ImageFormatInfoFormat 0 Packed 1 Planar END BITMASK attribute_flag 1 Gettable 2 Settable END CONSTANTS video_notify_reason 0 Started 1 Stopped 2 Busy 3 Preempted 4 HardError END CONSTANTS scanline_order 0 TopToBottom 1 BottomToTop END CONSTANTS grab_port_status 0 Success 1 BadExtension 2 AlreadyGrabbed 3 InvalidTime 4 BadReply 5 BadAlloc END STRUCT Rational length 8 0 numerator INT32 4 denominator INT32 END LIST XVFormat length 8 0 visual VISUALID 4 depth UINT8 END LIST AdaptorInfo variable min-length 12 0 base_id PORT 6 num_ports UINT16 10 type BITMASK8 xvtype 4 name_size COUNT16 12 name STRING8 ROUND 8 num_formats COUNT16 LATER formats LISTofXVFormat END LIST EncodingInfo variable min-length 20 0 encoding ENCODING 4 name_size COUNT16 6 width UINT16 8 height UINT16 12 rate Rational 20 name STRING8 ROUND END LIST AttributeInfo variable min-length 16 0 flags BITMASK32 attribute_flag 4 min INT32 8 max INT32 12 size COUNT32 16 name STRING8 ROUND END LIST ImageFormatInfo length 128 0 id CARD32 4 type ENUM8 ImageFormatInfoType 5 byte_order CARD8 SET_COUNTER 16 8 guid STRING8 24 bpp UINT8 25 num_planes UINT8 28 depth UINT8 32 red_mask CARD32 36 green_mask CARD32 40 blue_mask CARD32 44 format ENUM8 ImageFormatInfoFormat 48 y_sample_bits CARD32 52 u_sample_bits CARD32 56 v_sample_bits CARD32 60 vhorz_y_period CARD32 64 vhorz_u_period CARD32 68 vhorz_v_period CARD32 72 vvert_y_period CARD32 76 vvert_u_period CARD32 80 vvert_v_period CARD32 SET_COUNTER 32 84 vcomp_order LISTofCARD8 116 vscanline_order ENUM8 scanline_order END REQUEST QueryExtension END RESPONSE QueryExtension 8 major UINT16 10 minor UINT16 END REQUEST QueryAdaptors 4 window WINDOW END RESPONSE QueryAdaptors 8 num_adaptors COUNT16 32 adaptors LISTofAdaptorInfo END REQUEST QueryEncodings 4 port PORT END RESPONSE QueryEncodings 8 num_encodings COUNT16 32 encodings LISTofEncodingInfo END REQUEST GrabPort 4 port PORT 8 time TIMESTAMP END RESPONSE GrabPort 1 result ENUM8 grab_port_status END REQUEST UngrabPort 4 port PORT 8 time TIMESTAMP END templateREQUEST Put 4 port PORT 8 drawable DRAWABLE 12 gc GCONTEXT 16 vid_x INT16 18 vid_y INT16 20 vid_w UINT16 22 vid_h UINT16 24 drw_x INT16 26 drw_y INT16 28 drw_w UINT16 30 drw_h UINT16 END REQUEST PutVideo ALIASES Put REQUEST PutStill ALIASES Put REQUEST GetVideo ALIASES Put REQUEST GetStill ALIASES Put REQUEST StopVideo 4 port PORT 8 drawable DRAWABLE END REQUEST SelectVideoNotify 4 drawable DRAWABLE 8 onoff BOOL END REQUEST SelectPortNotify 4 port PORT 8 onoff BOOL END REQUEST QueryBestSize 4 port PORT 8 vid_w UINT16 10 vid_h UINT16 12 drw_w UINT16 14 drw_h UINT16 16 motion BOOL END RESPONSE QueryBestSize 8 actual_width UINT16 10 actual_height UINT16 END REQUEST SetPortAttribute 4 port PORT 8 attribute ATOM 12 value INT32 END REQUEST GetPortAttribute 4 port PORT 8 attribute ATOM END RESPONSE GetPortAttribute 8 value INT32 END REQUEST QueryPortAttributes 4 port PORT END RESPONSE QueryPortAttributes 8 num_attributes COUNT32 12 text_size UINT32 32 attributes LISTofAttributeInfo END REQUEST ListImageFormats 4 port PORT END RESPONSE ListImageFormats 8 num_formats COUNT32 32 format LISTofImageFormatInfo END REQUEST QueryImageAttributes 4 port PORT 8 id CARD32 12 width UINT16 14 height UINT16 END RESPONSE QueryImageAttributes 12 data_size UINT32 16 width UINT16 18 height UINT16 8 num_planes COUNT32 32 pitches LISTofUINT32 RESET_COUNTER LATER offsets LISTofUINT32 END REQUEST PutImage 4 port PORT 8 drawable DRAWABLE 12 gc GCONTEXT 16 id CARD32 20 src_x INT16 22 src_y INT16 24 src_w UINT16 26 src_h UINT16 28 drw_x INT16 30 drw_y INT16 32 drw_w UINT16 34 drw_h UINT16 36 width UINT16 38 height UINT16 40 data LISTofCARD8 END REQUEST ShmPutImage 4 port PORT 8 drawable DRAWABLE 12 gc GCONTEXT 16 shmseg Shm::ShmSeg 20 id CARD32 24 offset UINT32 28 src_x INT16 30 src_y INT16 32 src_w UINT16 34 src_h UINT16 36 drw_x INT16 38 drw_y INT16 40 drw_w UINT16 42 drw_h UINT16 44 width UINT16 46 height UINT16 48 send_event BOOL END EVENT VideoNotify 1 reason ENUM8 video_notify_reason 4 timestamp TIMESTAMP 8 drawable DRAWABLE 12 port PORT END EVENT PortNotify 4 timestamp TIMESTAMP 8 port PORT 12 attribute ATOM 16 value INT32 END EOF xtrace-1.3.1/saver.proto0000644000175100017510000000421611704002604012127 00000000000000# This file is part of "xtrace" # Copyright (C) 2008 Bernhard R. Link # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA EXTENSION "MIT-SCREEN-SAVER" Saver USE core REQUESTS QueryVersion RESPONDS QueryInfo RESPONDS SelectInput SetAttributes UnsetAttributes Suspend END EVENTS SaverNotify END ERRORS END CONSTANTS saver_level 0 on 1 standby 2 suspend 3 off END TYPE Saver_LEVEL ENUM16 saver_level CONSTANTS saver_state 0 off 1 on 2 cycle 3 disable END TYPE Saver_STATE ENUM8 saver_state CONSTANTS saver_kind 0 blanked 1 internal 2 external END TYPE Saver_KIND ENUM8 saver_kind BITMASK saver_mask 0x00000001 notify 0x00000002 cycle END TYPE Saver_MASK BITMASK32 saver_mask REQUEST QueryVersion 4 "major version" UINT8 5 "minor version" UINT8 END RESPONSE QueryVersion 8 "major version" UINT16 10 "minor version" UINT16 END templateREQUEST DRAWABLE 4 drawable DRAWABLE END REQUEST QueryInfo ALIASES DRAWABLE #define parameterSaverQueryInfo parameterDRAWABLE RESPONSE QueryInfo 1 state Saver_STATE 8 window WINDOW 12 "til or since" UINT32 16 idle UINT32 20 "event mask" Saver_MASK 24 kind Saver_KIND END REQUEST SelectInput 4 drawable DRAWABLE 8 mask Saver_MASK END REQUEST SetAttributes 4 drawable DRAWABLE 8 x INT16 10 y INT16 12 width UINT16 14 height UINT16 16 border-height UINT16 18 c_class CARD8 19 depth UINT8 20 visual-id CARD32 24 mask Saver_MASK END REQUEST UnsetAttributes ALIASES DRAWABLE REQUEST Suspend 4 suspend BOOL END EVENT SaverNotify 1 state Saver_STATE 8 root WINDOW 12 window WINDOW 16 kind Saver_KIND 17 forced BOOL END EOF xtrace-1.3.1/setup.proto0000644000175100017510000000433211704002604012146 00000000000000# This file is part of xtrace # Copyright (C) 2010 Bernhard R. Link # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not write to the Free Software # Foundation Inc. 51 Franklin St Fifth Floor Boston MA 02110-1301 USA NAMESPACE core CONSTANTS visualtypeclass 0 StaticGray 1 GrayScale 2 StaticColor 3 PseudoColor 4 TrueColor 5 DirectColor END LIST VISUALTYPE length 24 0 id CARD32 4 class ENUM8 visualtypeclass 5 bits/rgb-value UINT8 6 colormap-entries UINT16 8 red-mask CARD32 12 green-mask CARD32 16 blue-mask CARD32 #20 pad CARD32 END LIST DEPTH variable min-length 8 0 depth UINT8 2 "#types" COUNT16 8 visuals LISTofVISUALTYPE END CONSTANTS backingstore 0 Never 1 WhenMapped 2 Always END LIST SCREEN variable min-length 40 0 root WINDOW 4 default-colormap COLORMAP 8 white-pixel CARD32 12 black-pixel CARD32 16 input-mask SETofEVENT 20 width[pixel] UINT16 22 height[pixel] UINT16 24 width[mm] UINT16 26 height[mm] UINT16 28 min-installed-maps UINT16 30 max-installed-maps UINT16 32 root VISUALID 36 backing-stores ENUM8 backingstore 37 save-unders BOOL 38 root-depth UINT8 39 "#depths" COUNT8 40 "allowed depths" LISTofDEPTH END LIST FORMAT length 8 0 depth UINT8 1 bits/pixel UINT8 2 scanline-pad UINT8 END CONSTANTS lsbmsb 0 LSBFirst 1 MSBFirst END CONSTANTS lsms 0 LeastSignificant 1 MostSignificant END SETUP 24 len(vendor) COUNT16 40 vendor STRING8 ROUND 8 release UINT32 12 resource-id CARD32 16 resource-mask CARD32 20 motion-buffer-size UINT32 26 max-request-len UINT16 30 image-byte-order ENUM8 lsbmsb 31 bitmap-bit-order ENUM8 lsms 32 scanline-unit UINT8 33 scanline-pad UINT8 34 min-keycode KEYCODE 36 max-keycode KEYCODE 29 "#formats" COUNT8 LATER pixmap-formats LISTofFORMAT 28 "#screens" COUNT8 LATER roots LISTofSCREEN END EOF xtrace-1.3.1/INSTALL0000644000175100017510000001722711704002604010761 00000000000000Basic Installation ================== These are generic installation instructions. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, a file `config.cache' that saves the results of its tests to speed up reconfiguring, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.in' is used to create `configure' by a program called `autoconf'. You only need `configure.in' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. If you're using `csh' on an old version of System V, you might need to type `sh ./configure' instead to prevent `csh' from trying to execute `configure' itself. Running `configure' takes awhile. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with the package. 4. Type `make install' to install the programs and any data files and documentation. 5. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. You can give `configure' initial values for variables by setting them in the environment. Using a Bourne-compatible shell, you can do that on the command line like this: CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure Or on systems that have the `env' program, you can do it like this: env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you must use a version of `make' that supports the `VPATH' variable, such as GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. If you have to use a `make' that does not supports the `VPATH' variable, you have to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. Installation Names ================== By default, `make install' will install the package's files in `/usr/local/bin', `/usr/local/man', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PATH'. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you give `configure' the option `--exec-prefix=PATH', the package will use PATH as the prefix for installing programs and libraries. Documentation and other data files will still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=PATH' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Optional Features ================= Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. Specifying the System Type ========================== There may be some features `configure' can not figure out automatically, but needs to determine by the type of host the package will run on. Usually `configure' can figure that out, but if it prints a message saying it can not guess the host type, give it the `--host=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name with three fields: CPU-COMPANY-SYSTEM See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the host type. If you are building compiler tools for cross-compiling, you can also use the `--target=TYPE' option to select the type of system they will produce code for and the `--build=TYPE' option to select the type of system on which you are compiling the package. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Operation Controls ================== `configure' recognizes the following options to control how it operates. `--cache-file=FILE' Use and save the results of the tests in FILE instead of `./config.cache'. Set FILE to `/dev/null' to disable caching, for debugging `configure'. `--help' Print a summary of the options to `configure', and exit. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to `/dev/null' (any error messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `--version' Print the version of Autoconf used to generate the `configure' script, and exit. `configure' also accepts some other, not widely useful, options. xtrace-1.3.1/xtrace.h0000644000175100017510000000411111704002604011353 00000000000000 extern size_t authdata_len; extern char *authdata; extern FILE *out; bool generateAuthorisation(const char *displayname); const char *parseDisplay(const char *displayname, char **protocol, char **hostname, int *display, int *screen, int *family ); int connectToServer(const char *displayname,int family,const char *hostname,int display); int listenForClients(const char *displayname,int family,int display); struct sockaddr_un; const char *generateSocketName(struct sockaddr_un *addr,int display); uint16_t calculateTCPport(int display); int acceptClient(int family,int listener, char **from); extern struct connection { struct connection *next; int id; char *from; int client_fd,server_fd; bool bigendian; unsigned char clientbuffer[16*4096]; unsigned int clientcount,clientignore; enum client_state { c_start=0, c_normal, c_amlost } clientstate; unsigned char serverbuffer[16*4096]; unsigned int servercount,serverignore; enum server_state { s_start=0, s_normal, s_amlost} serverstate; struct expectedreply *expectedreplies; uint64_t seq; struct usedextension *usedextensions; struct unknownextension *waiting, *unknownextensions; unsigned long long starttime; } *connections; void parse_server(struct connection *c); void parse_client(struct connection *c); void free_usedextensions(struct usedextension *); void free_unknownextensions(struct unknownextension *); bool copy_authentication(const char *fakedisplay,const char *display, const char *infile, const char *outfile); struct atom; struct atom *newAtom(const char *name, size_t len); const char *getAtom(struct connection *c, uint32_t atom); void internAtom(struct connection *c, uint32_t atom, struct atom *data); extern bool denyallextensions; extern size_t maxshownlistlen; extern bool print_timestamps; extern bool print_reltimestamps; extern bool print_uptimestamps; #ifdef __GNUC__ #define UNUSED __attribute__ ((unused)) #define FORMAT(func,fmtarg,dotarg) __attribute__((format(func,fmtarg,dotarg))); #else #define UNUSED #define FORMAT(func,fmtarg,dotarg) #endif #ifndef HAVE_STRNDUP char *strndup(const char *,size_t); #endif xtrace-1.3.1/xinput.proto0000644000175100017510000006272511704002604012347 00000000000000EXTENSION "XInputExtension" XInput USE core TYPE FP1616 FIXED TYPE FP3232 FIXED3232 #define ra(a) { #a , parameterXInput ## a , NULL,NULL,NULL} #define rb(a) { #a , parameterXInput ## a , returnXInput ## a ,NULL,NULL} REQUESTS UNKNOWN /* 0 */ GetExtensionVersion RESPONDS /* 1 */ ListInputDevices RESPONDS /* 2 */ OpenDevice RESPONDS /* 3 */ CloseDevice /* 4 */ SetDeviceMode RESPONDS /* 5 */ SelectExtensionEvent /* 6 */ GetSelectedExtensionEvents RESPONDS /* 7 */ ChangeDeviceDontPropagateList /* 8 */ GetDeviceDontPropagateList RESPONDS /* 9 */ GetDeviceMotionEvents RESPONDS /* 10 */ ChangeKeyboardDevice RESPONDS /* 11 */ ChangePointerDevice RESPONDS /* 12 */ GrabDevice RESPONDS /* 13 */ UngrabDevice /* 14 */ GrabDeviceKey /* 15 */ UngrabDeviceKey /* 16 */ GrabDeviceButton /* 17 */ UngrabDeviceButton /* 18 */ AllowDeviceEvents /* 19 */ GetDeviceFocus RESPONDS /* 20 */ SetDeviceFocus /* 21 */ GetFeedbackControl RESPONDS /* 22 */ ChangeFeedbackControl /* 23 */ GetDeviceKeyMapping RESPONDS /* 24 */ ChangeDeviceKeyMapping /* 25 */ GetDeviceModifierMapping RESPONDS /* 26 */ SetDeviceModifierMapping RESPONDS /* 27 */ GetDeviceButtonMapping RESPONDS /* 28 */ SetDeviceButtonMapping RESPONDS /* 29 */ QueryDeviceState RESPONDS /* 30 */ SendExtensionEvent /* 31 */ DeviceBell /* 32 */ SetDeviceValuators RESPONDS /* 33 */ GetDeviceControl RESPONDS /* 34 */ ChangeDeviceControl RESPONDS /* 35 */ # XI 1.5 ListDeviceProperties RESPONDS /* 36 */ ChangeDeviceProperty /* 37 */ DeleteDeviceProperty /* 38 */ GetDeviceProperty RESPONDS /* 39 */ # XI 2 XIQueryPointer RESPONDS /* 40 */ XIWarpPointer /* 41 */ XIChangeCursor /* 42 */ XIChangeHierarchy /* 43 */ XISetClientPointer /* 44 */ XIGetClientPointer RESPONDS /* 45 */ XISelectEvents /* 46 */ XIQueryVersion RESPONDS /* 47 */ XIQueryDevice RESPONDS /* 48 */ XISetFocus /* 49 */ XIGetFocus RESPONDS /* 50 */ XIGrabDevice /* 51 */ XIUngrabDevice UNSUPPORTED /* 52 */ XIAllowEvents UNSUPPORTED /* 53 */ XIPassiveGrabDevice UNSUPPORTED RESPONDS /* 54 */ XIPassiveUngrabDevice UNSUPPORTED /* 55 */ XIListProperties RESPONDS /* 56 */ XIChangeProperty /* 57 */ XIDeleteProperty /* 58 */ XIGetProperty RESPONDS /* 59 */ XIGetSelectedEvents UNSUPPORTED /* 60 */ END EVENTS DeviceValuator DeviceKeyPress DeviceKeyRelease DeviceButtonPress DeviceButtonRelease DeviceMotionNotify DeviceFocusIn DeviceFocusOut ProximityIn ProximityOut DeviceStateNotify DeviceMappingNotify ChangeDeviceNotify DeviceKeystateNotify DeviceButtonstateNotify DevicePresenceNotify DevicePropertyNotify END ERRORS BadDevice BadEvent BadMode DeviceBusy BadClass END XGEVENTS UNKNOWN DeviceChanged /* 1 */ UNSUPPORTED KeyPress /* 2 */ KeyRelease /* 3 */ ButtonPress /* 4 */ ButtonRelease /* 5 */ Motion /* 6 */ Enter /* 7 */ Leave /* 8 */ FocusIn /* 9 */ FocusOut /* 10 */ HierarchyChanged /* 11 */ UNSUPPORTED PropertyEvent /* 12 */ UNSUPPORTED RawKeyPress /* 13 */ UNSUPPORTED RawKeyRelease /* 14 */ UNSUPPORTED RawButtonPress /* 15 */ UNSUPPORTED RawButtonRelease /* 16 */ UNSUPPORTED RawMotion /* 17 */ UNSUPPORTED END CONSTANTS device_change 0 Added 1 Removed 2 Enabled 3 Disabled 4 Unrecoverable END CONSTANTS syncmode 0 AsyncThisDevice 1 SyncThisDevice 2 ReplayThisDevice 3 AsyncOtherDevice 4 AsyncAll 5 SyncAll END CONSTANTS device_use 0 Pointer 1 Keyboard 2 ExtensionDevice 3 ExtensionKeyboard 4 ExtensionPointer END CONSTANTS notify_mode 0 Normal 1 Grab 2 Ungrab 3 WhileGrabbed 4 PassiveGrab 5 PassiveUngrab END CONSTANTS notify_detail 0 Ancestor 1 Virtual 2 Inferior 3 Nonlinear 4 NonlinearVirtual 5 Pointer 6 PointerRoot 7 DetailNone END CONSTANTS usexkeyboard 0xFF UseXKeyboard END CONSTANTS anykey 0x00 AnyKey END CONSTANTS anybutton 0x00 AnyButton END # there is only one set of constants in the header files for this, # so I assume this are the correct values and what is described for most # other status values in the XIproto.ps is just bogus CONSTANTS device_status 0 Success 1 AlreadyGrabbed 2 InvalidTime 3 NotViewable 4 Frozen END CONSTANTS input_class_id 0 key 1 button 2 valuator 3 feedback 4 proximity 5 focus 6 other END CONSTANTS device_mode 0 relative 1 absolute END CONSTANTS device_mode_and_prox 0 "relative, in proximity" 1 "absolute, in proximity" 2 "relative, out of proximity" 3 "absolute, out of proximity" END BITMASK classes_reported 0x01 "reporting keys" 0x02 "reporting buttons" 0x04 "reporting valuators" 0x40 absolute 0x80 "out of proximity" END CONSTANTS feedback_class 0 Kbd 1 Ptr 2 String 3 Integer 4 Led 5 Bell END CONSTANTS auto_repeat_mode 0 Off 1 On 2 Default END BITMASK dv_pointer 1<<0 AccelNum 1<<1 AccelDenom 1<<2 Threshold END BITMASK dv_keyboardbellled 1<<0 KeyClickPercent 1<<1 Percent 1<<2 Pitch 1<<3 Duration 1<<4 Led 1<<5 LedMode 1<<6 Key 1<<7 AutoRepeatMode END BITMASK dv_string 1<<0 String END BITMASK dv_integer 1<<0 Integer END CONSTANTS devicecontroltype 0 Resolution? 1 RESOLUTION 2 ABS_CALIB 3 CORE 4 ENABLE 5 ABS_AREA END CONSTANTS changereason 1 SlaveSwitch 2 DeviceChange END TYPE CHANGEREASON ENUM8 changereason REQUEST GetExtensionVersion 4 len COUNT16 8 name STRING8 END RESPONSE GetExtensionVersion 8 major_version UINT16 10 minor_version UINT16 12 present BOOL END REQUEST ListInputDevices ALIASES Empty LIST AXISINFO length 12 0 resolution UINT32 4 min UINT32 8 max UINT32 END # /* that's what xspecs says it would like: # LIST INPUTINFO variable length 4 # // { 0, "class id", ft_ENUM8, c_class_id}, # { 0, "\0", ft_IF8, (void*)structpartKEYINFO}, # { 0, "\1", ft_IF8, (void*)structpartBUTTONINFO}, # { 0, "\2", ft_IF8, (void*)structpartVALUATORINFO}, # 1 len COUNT8 # 0 unsupported LISTofCARD8 # END # # LIST DEVICEINFO length 8 # 0 type CARD32 # 4 id CARD8 # 6 use ENUM8 device_use # 5 "#classes" COUNT8 # 8 classes LISTofINPUTINFO # LATER name LISTofSTRING8 # END # # RESPONSE ListInputDevices # 8 #devices COUNT8 # 32 devices LISTofDEVICEINFO # END # # but the implementation in reality it is totally different: # # first come all the device structs, then all the INPUTINFO structs, # then all the names. To know how many INPUTINFO structs there are, # one would need to sum the numbers from the devices, which we cannot # do yet. So we assume that none will have a name with at most 2 characters: LIST INPUTINFO variable min-length 4 IF 0 CARD8 0 2 "min keycode" CARD8 3 "max keycode" CARD8 4 "#keys" UINT16 NEXT 8 ELSEIF 0 CARD8 1 2 "#buttons" CARD16 NEXT 4 ELSEIF 0 CARD8 2 2 "#axes" CARD16 3 mode ENUM8 device_mode 4 "motion buffer size" UINT32 2 "#axes" COUNT16 8 axes LISTofAXISINFO ELSE # otherwise we assume that it is time for the strings 0 len COUNT8 1 name STRING8 END LIST DEVICEINFO length 8 0 type CARD32 4 id CARD8 5 "#classes" UINT8 6 use ENUM8 device_use END RESPONSE ListInputDevices 8 "#devices" COUNT8 32 devices LISTofDEVICEINFO RESET_COUNTER LATER infos LISTofINPUTINFO END # The rest I had no program to test with. Judging from the problems # above, that might mean the actual code is totally different, too templateREQUEST Device 4 device CARD8 END REQUEST OpenDevice ALIASES Device LIST INPUTCLASSINFO length 2 0 class ENUM8 input_class_id 1 "event type base" CARD8 END RESPONSE OpenDevice 8 "#classes" COUNT8 32 classes LISTofINPUTCLASSINFO END REQUEST CloseDevice ALIASES Device REQUEST SetDeviceMode 4 device CARD8 5 mode ENUM8 device_mode END templateRESPONSE Status 8 status CARD8 constants device_status END RESPONSE SetDeviceMode ALIASES Status TYPE LISTofEVENTCLASS LISTofCARD32 REQUEST SelectExtensionEvent 4 window WINDOW 8 count UINT16 12 "desired events" LISTofEVENTCLASS END REQUEST GetSelectedExtensionEvents 4 window WINDOW END RESPONSE GetSelectedExtensionEvents 8 "#this client" COUNT16 32 "this client" LISTofEVENTCLASS 10 "#all clients" COUNT16 LATER "all clients" LISTofEVENTCLASS END REQUEST ChangeDeviceDontPropagateList 4 window WINDOW 8 count COUNT16 10 mode ENUM8 device_mode 12 "desired events" LISTofEVENTCLASS END REQUEST GetDeviceDontPropagateList ALIASES GetSelectedExtensionEvents RESPONSE GetDeviceDontPropagateList 8 count COUNT16 32 list LISTofEVENTCLASS END REQUEST GetDeviceMotionEvents 4 start-time TIMESTAMP constants curtime 8 stop-time TIMESTAMP constants curtime 10 device CARD8 END LIST DEVICETIMECOORD variable min-length 4 0 time TIMESTAMP GET 0 # TODO huch? 0 valuators LISTofUINT32 END RESPONSE GetDeviceMotionEvents 8 "#events" UINT32 12 axes UINT8 12 axes PUSH8 13 mode ENUM8 device_mode 32 events LISTofDEVICETIMECOORD END REQUEST ChangeKeyboardDevice ALIASES Device RESPONSE ChangeKeyboardDevice ALIASES Status REQUEST ChangePointerDevice 4 xaxis CARD8 5 yaxis CARD8 6 device CARD8 END RESPONSE ChangePointerDevice ALIASES Status REQUEST GrabDevice 4 window WINDOW 8 time TIMESTAMP constants curtime 12 "#event" COUNT16 14 this-device-mode ENUM8 synmode 15 other-device-mode ENUM8 synmode 16 owner-events BOOL 17 device CARD8 20 events LISTofEVENTCLASS END RESPONSE GrabDevice ALIASES Status REQUEST UngrabDevice 4 time TIMESTAMP constants curtime 8 device CARD8 END REQUEST GrabDeviceKey 4 window WINDOW 8 "#event" COUNT16 10 modifiers SETofKEYMASK 12 modifier_device CARD8 constants usexkeyboard 13 grabbed_device CARD8 14 key CARD8 constants anykey 15 this-device-mode ENUM8 synmode 16 other-device-mode ENUM8 synmode 17 owner-events BOOL 20 events LISTofEVENTCLASS END REQUEST UngrabDeviceKey 4 window WINDOW 8 modifiers SETofKEYMASK 10 modifier_device CARD8 constants usexkeyboard 11 key CARD8 constants anykey 12 grabbed_device CARD8 END REQUEST GrabDeviceButton 4 window WINDOW 8 grabbed_device CARD8 9 modifier_device CARD8 constants usexkeyboard 10 "#event" COUNT16 12 modifiers SETofKEYMASK 14 this-device-mode ENUM8 synmode 15 other-device-mode ENUM8 synmode 16 button UINT8 constants anybutton 17 owner-events BOOL 20 events LISTofEVENTCLASS END REQUEST UngrabDeviceButton 4 window WINDOW 8 modifiers SETofKEYMASK 10 modifier_device CARD8 constants usexkeyboard 11 button UINT8 constants anybutton 12 grabbed_device CARD8 END REQUEST AllowDeviceEvents 4 time TIMESTAMP constants curtime 8 mode ENUM8 syncmode 9 device CARD8 END REQUEST GetDeviceFocus ALIASES Device RESPONSE GetDeviceFocus 8 focus WINDOW constants revertto 12 time TIMESTAMP 16 revert-to ENUM8 revertto END REQUEST SetDeviceFocus 4 focus WINDOW constants revertto 8 time TIMESTAMP 12 revert-to ENUM8 revertto 13 device CARD8 END LIST FEEDBACKSTATE variable min-length 4 # XIproto.ps has strange values here, XI.h looks more reasonable: 0 "feedback class" ENUM8 feedback_class 1 id CARD8 IF 0 CARD8 $feedback_class:Kbd 4 pitch UINT16 6 duration UINT16 8 led_mask CARD32 12 led_values CARD32 16 global-auto-repeat BOOL 17 click UINT8 18 percent UINT8 SET_COUNTER 32 20 auto-repeats LISTofCARD8 ELSEIF 0 CARD8 $feedback_class:Ptr # PTR 6 acceleration FRACTION16_16 10 treshold UINT16 NEXT 12 ELSEIF 0 CARD8 $feedback_class:String 4 "max symbols" UINT16 6 "#keysyms" COUNT16 8 keysyms LISTofKEYSYM ELSEIF 0 CARD8 $feedback_class:Integer 4 resolution UINT32 8 min INT32 12 max INT32 NEXT 16 ELSEIF 0 CARD8 $feedback_class:Led 4 mask CARD32 8 values CARD32 NEXT 12 ELSEIF 0 CARD8 $feedback_class:Bell 4 percent UINT8 8 pitch UINT16 10 duration UINT16 NEXT 12 ELSE # fallback in case of unsupported: 2 length COUNT16 0 unsupported LISTofCARD8 END REQUEST GetFeedbackControl ALIASES Device RESPONSE GetFeedbackControl 8 "#feedbacks" COUNT16 32 feedbacks LISTofFEEDBACKSTATE END REQUEST ChangeFeedbackControl 8 device CARD8 9 "feedback id" CARD8 12 "feedback class" ENUM8 feedback_class 13 "feedback id" CARD8 IF 12 CARD8 $feedback_class:Kbd 4 mask BITMASK32 dv_keyboardbellled 16 key CARD8 17 auto-repeat ENUM8 auto_repeat_mode 18 click-percent UINT8 19 bell-percent UINT8 20 bell-pitch UINT16 22 bell-duration UINT16 24 led_mask CARD32 28 led_values CARD32 ELSEIF 12 CARD8 $feedback_class:Ptr 4 mask BITMASK32 dv_pointer 18 acceleration FRACTION16_16 22 treshold UINT16 ELSEIF 12 CARD8 $feedback_class:String 4 mask BITMASK32 dv_string 18 "#keysyms" COUNT16 20 keysyms LISTofCARD32 ELSEIF 12 CARD8 $feedback_class:Integer 4 mask BITMASK32 dv_integer 16 integer INT32 ELSEIF 12 CARD8 $feedback_class:Led 4 mask BITMASK32 dv_keyboardbellled 16 led_mask CARD32 20 led_values CARD32 ELSEIF 12 CARD8 $feedback_class:Bell 4 mask BITMASK32 dv_keyboardbellled 16 percent UINT8 20 pitch INT16 22 duration INT16 ELSE 14 length COUNT16 12 unsupported LISTofCARD8 END REQUEST GetDeviceKeyMapping 4 device CARD8 5 firstKeyCode CARD8 6 count UINT8 END RESPONSE GetDeviceKeyMapping 8 keysSyms/keyCode UINT8 32 keysyms LISTofCARD32 END REQUEST ChangeDeviceKeyMapping 4 device CARD8 5 firstKeyCode CARD8 6 "#keycodes" UINT8 7 "#keySyms/keyCode" UINT8 8 keysyms LISTofCARD32 END REQUEST GetDeviceModifierMapping ALIASES Device RESPONSE GetDeviceModifierMapping 8 keycodes/modifier UINT8 32 keycodes LISTofCARD8 END REQUEST SetDeviceModifierMapping 4 device CARD8 5 keycodes/modifier UINT8 8 keycodes LISTofCARD8 END RESPONSE SetDeviceModifierMapping ALIASES Status REQUEST GetDeviceButtonMapping ALIASES Device RESPONSE GetDeviceButtonMapping 8 l(map) COUNT8 32 map LISTofCARD8 END REQUEST SetDeviceButtonMapping 4 device CARD8 5 l(map) COUNT8 8 map LISTofCARD8 END RESPONSE SetDeviceButtonMapping ALIASES Status LIST INPUTSTATE variable min-length 2 0 class ENUM8 input_class_id IF 0 CARD8 $input_class_id:key 2 "#keys" UINT8 SET_COUNTER 32 4 "key states" LISTofCARD8 ELSEIF 0 CARD8 $input_class_id:button 2 "#buttons" UINT8 SET_COUNTER 32 4 "button states" LISTofCARD8 ELSEIF 0 CARD8 $input_class_id:valuator 2 "#valuators" COUNT8 3 mode ENUM8 device_mode_and_prox 4 "valuator states" LISTofCARD32 ELSE 1 length COUNT8 0 unsupported LISTofCARD8 END REQUEST QueryDeviceState ALIASES Device RESPONSE QueryDeviceState 8 "#classes" COUNT8 32 classes LISTofINPUTSTATE END LIST XiEVENT length 32 0 event EVENT END REQUEST SendExtensionEvent 4 destinatione WINDOW 8 device CARD8 9 propagate BOOL 12 "#events" COUNT8 16 events LISTofXiEVENT 10 "#event classes" COUNT16 LATER "desired events" LISTofEVENTCLASS END REQUEST DeviceBell 4 device CARD8 5 "feedback id" CARD8 6 "feedback class" ENUM8 feedback_class 7 percent INT8 END REQUEST SetDeviceValuators 4 device CARD8 5 "first valuator" UINT8 6 "#valuators" COUNT8 8 valuators LISTofUINT32 END RESPONSE SetDeviceValuators ALIASES Status LIST DEVICESTATE variable min-length 4 # this is supposed to be the length, but at least in # lenny the xserver is still buggy and returns bogus values: 2 "length (often faulty)" UINT16 # Xspecs says 0, DEVICE_RESOLUTION is 1... IF 0 CARD16 0 # RESOLUTIONSTATE 4 "#valuators" COUNT32 8 values LISTofUINT32 4 "#valuators" COUNT32 LATER min_values LISTofUINT32 4 "#valuators" COUNT32 LATER max_values LISTofUINT32 ELSEIF 0 CARD16 1 # RESOLUTIONSTATE 4 "#valuators" COUNT32 8 values LISTofUINT32 4 "#valuators" COUNT32 LATER min_values LISTofUINT32 4 "#valuators" COUNT32 LATER max_values LISTofUINT32 ELSEIF 0 CARD16 2 # ABSCALIBSTATE 4 min_x UINT32 8 max_x UINT32 12 min_y UINT32 16 max_y UINT32 20 flip_x UINT32 24 flip_y UINT32 28 rotation UINT32 32 button_threshold UINT32 NEXT 36 ELSEIF 0 CARD16 3 # CORESTATE 4 status CARD8 5 iscore BOOL NEXT 8 ELSEIF 0 CARD16 4 # ENABLESTATE 4 enable CARD8 NEXT 8 ELSEIF 0 CARD16 5 # ABSAREASTATE 4 offset_x UINT32 8 offset_y UINT32 12 width UINT32 16 height UINT32 20 screen CARD32 24 following CARD32 NEXT 28 ELSE 2 length COUNT16 0 unsupported LISTofCARD8 END REQUEST GetDeviceControl 6 device CARD8 4 "device control type" ENUM16 devicecontroltype END RESPONSE GetDeviceControl 8 status CARD8 constants device_status 32 states LISTofDEVICESTATE END LIST DEVICECONTROL variable min-length 4 2 length UINT16 # Xspecs says 0, DEVICE_RESOLUTION is 1... IF 0 CARD16 0 # RESOLUTIONCONTOL 4 "first valuator" UINT8 5 "#valuators" COUNT8 8 values LISTofUINT32 ELSEIF 0 CARD16 1 # RESOLUTIONCONTOL 4 "first valuator" UINT8 5 "#valuators" COUNT8 8 values LISTofUINT32 ELSEIF 0 CARD16 2 # ABSCALIBCONTOL 4 min_x UINT32 8 max_x UINT32 12 min_y UINT32 16 max_y UINT32 20 flip_x UINT32 24 flip_y UINT32 28 rotation UINT32 32 button_threshold UINT32 NEXT 36 ELSEIF 0 CARD16 3 # CORECONTOL 4 status CARD8 NEXT 8 ELSEIF 0 CARD16 4 # ENABLECONTOL 4 enable CARD8 NEXT 8 ELSEIF 0 CARD16 5 # ABSAREACONTOL 4 offset_x UINT32 8 offset_y UINT32 12 width UINT32 16 height UINT32 20 screen CARD32 24 following CARD32 NEXT 28 ELSE 2 length COUNT16 0 unsupported LISTofCARD8 END REQUEST ChangeDeviceControl 6 device CARD8 4 "device control type" ENUM16 devicecontroltype 8 data LISTofDEVICECONTROL END RESPONSE ChangeDeviceControl ALIASES Status REQUEST ListDeviceProperties 4 device UINT8 END RESPONSE ListDeviceProperties 8 nAtoms COUNT16 32 Atoms LISTofATOM END REQUEST ChangeDeviceProperty 4 property ATOM 8 type ATOM 12 device UINT8 13 format FORMAT8 14 mode ENUM8 change_mode 16 nUnits COUNT32 IF 8 ATOM "ATOM" 20 value LISTofATOM ELSEIF 8 ATOM "FLOAT" 20 value LISTofFLOAT32 ELSE 20 value LISTofFormat END REQUEST DeleteDeviceProperty 4 property ATOM 8 device UINT8 END REQUEST GetDeviceProperty 4 property ATOM 8 type ATOM 12 longOffset UINT32 16 longLength UINT32 20 device UINT8 21 delete BOOL END RESPONSE GetDeviceProperty 8 type ATOM 12 bytesAfter UINT32 16 nItems COUNT32 20 format FORMAT8 21 device UINT8 IF 8 ATOM "ATOM" 32 value LISTofATOM ELSEIF 8 ATOM "FLOAT" 32 value LISTofFLOAT32 ELSE 32 value LISTofFormat END STRUCT MODIFIERINFO length 16 0 base_mods CARD32 4 latched_mods CARD32 8 locked_mods CARD32 12 effective_mods CARD32 END STRUCT GROUPINFO length 4 0 base_group CARD8 1 latched_group CARD8 2 locked_group CARD8 3 effective_group CARD8 END REQUEST XIQueryPointer 4 window WINDOW 8 device UINT16 END RESPONSE XIQueryPointer 8 root WINDOW 12 child WINDOW 16 root_x FIXED 20 root_y FIXED 24 win_x FIXED 28 win_y FIXED 32 same_screen BOOL 34 buttons_len COUNT16 36 mods MODIFIERINFO 52 groups GROUPINFO 56 buttons LISTofCARD8 END REQUEST XIWarpPointer 4 src_win WINDOW 8 dst_win WINDOW 12 src_x FIXED 16 src_y FIXED 20 src_width UINT16 22 src_height UINT16 24 dst_x FIXED 28 dst_y FIXED 32 device CARD16 END REQUEST XIChangeCursor 4 win WINDOW 8 cursor CURSOR 12 device CARD16 END CONSTANTS hierarchy_change 1 AddMaster 2 RemoveMaster 3 AttachSlave 4 DetachSlave END CONSTANTS change_mode 1 Attach 2 Float END LIST HIERARCHYCHANGE variable min-length 8 0 type ENUM16 hierarchy_change 2 length COUNT16 IF 0 CARD16 $hierarchy_change:AddMaster 4 name_len COUNT16 6 send_core BOOL 7 enable BOOL 8 name STRING8 ELSEIF 0 CARD16 $hierarchy_change:RemoveMaster 4 device UINT16 6 return_mode ENUM8 change_mode 8 return_pointer UINT16 10 return_keyboard UINT16 NEXT 12 ELSEIF 0 CARD16 $hierarchy_change:AttachSlave 4 device UINT16 6 new_master UINT16 NEXT 8 ELSEIF 0 CARD16 $hierarchy_change:DetachSlave 4 device UINT16 NEXT 8 ELSE 0 pad LISTofCARD32 END REQUEST XIChangeHierarchy 4 num_changes COUNT8 8 changes LISTofHIERARCHYCHANGE END REQUEST XISetClientPointer 4 win WINDOW 8 device UINT16 END REQUEST XIGetClientPointer 4 win WINDOW END RESPONSE XIGetClientPointer 8 set BOOL 10 device UINT16 END LIST EVENTMASK variable min-length 4 0 device UINT16 2 mask_len COUNT16 4 mask LISTofCARD32 END REQUEST XISelectEvents 4 win WINDOW 8 num_masks COUNT16 12 masks LISTofEVENTMASK END REQUEST XIQueryVersion 4 major UINT16 6 minor UINT16 END RESPONSE XIQueryVersion 8 major UINT16 10 minor UINT16 END # TODO: could be > 32bits if the device has more than 2^32 buttons TYPE SETofBUTTONMASK CARD32 CONSTANTS class 0 KeyClass 1 ButtonClass 2 AxisClass END LIST CLASS variable min-length 8 0 type ENUM16 class 2 length COUNT16 4 sourceid UINT16 IF 0 CARD16 $class:KeyClass 6 num_keys COUNT16 8 keys LISTofCARD32 ELSEIF 0 CARD16 $class:ButtonClass 6 num_buttons COUNT16 8 state SETofBUTTONMASK 12 labels LISTofATOM ELSEIF 0 CARD16 $class:AxisClass 6 axisnumber COUNT16 8 label ATOM 12 min FRACTION32_32 20 max FRACTION32_32 28 value FRACTION32_32 36 resolution UINT32 40 mode CARD8 NEXT 44 ELSE 0 pad LISTofCARD32 END CONSTANTS xi_device_use 1 MasterPointer 2 MasterKeyboard 3 SlavePointer 4 SlaveKeyboard 5 FloatingSlave END LIST XIDEVICEINFO variable min-length 12 0 device UINT16 2 use ENUM16 xi_device_use 4 attachment CARD16 10 enabled BOOL 8 name_len COUNT16 12 name STRING8 ROUND 6 num_classes COUNT16 LATER classes LISTofCLASS END CONSTANTS xidevice 0 AllDevices 1 AllMasterDevices END REQUEST XIQueryDevice 4 device ENUM16 xidevice END RESPONSE XIQueryDevice 8 num_devices COUNT16 32 deviceinfo LISTofXIDEVICEINFO END REQUEST XISetFocus 4 focus WINDOW 8 time TIMESTAMP 10 device UINT16 END REQUEST XIGetFocus 4 device UINT16 END RESPONSE XIGetFocus 8 focus WINDOW END REQUEST XIGrabDevice 4 grab_window WINDOW 8 time TIMESTAMP 12 cursor CURSOR 16 device UINT16 18 grab_mode ENUM8 synmode 19 paired_device_mode ENUM8 synmode 20 owner_events BOOL 22 mask_len COUNT16 24 masks LISTofCARD32 END REQUEST XIListProperties 4 device UINT16 END RESPONSE XIListProperties 8 "#properties" COUNT16 32 properties LISTofATOM END REQUEST XIChangeProperty 4 device UINT16 6 mode ENUM8 device_mode 7 format FORMAT8 8 property ATOM 12 type ATOM 16 num_items COUNT32 IF 12 ATOM "ATOM" 20 value LISTofATOM ELSEIF 12 ATOM "FLOAT" 20 value LISTofFLOAT32 ELSE 20 value LISTofFormat END REQUEST XIDeleteProperty 4 device UINT16 8 property ATOM END REQUEST XIGetProperty 4 device UINT16 6 delete BOOL 8 property ATOM 12 type ATOM 16 offset UINT32 20 len UINT32 END RESPONSE XIGetProperty 8 type ATOM 12 bytes_after UINT32 16 num_items COUNT32 20 format FORMAT8 IF 8 ATOM "ATOM" 32 value LISTofATOM ELSEIF 8 ATOM "FLOAT" 32 value LISTofFLOAT32 ELSE 32 value LISTofFormat END # Events # the top-most bit of the device-id (0x80) always means more events to follow. # TODO: how to express that? EVENT DeviceValuator 1 device CARD8 4 state SETofKEYBUTMASK 6 "#valuators" COUNT8 7 "first axis" CARD8 # should be LISTofINT32? 8 valuators LISTofUINT32 END templateEVENT KeyButtonPointer # keycode, button, ... depending on actual even 1 detail CARD8 4 "timestamp" TIMESTAMP 8 "root window" WINDOW 12 "event window" WINDOW 16 "child window" WINDOW constants none 20 root-x INT16 22 root-y INT16 24 event-x INT16 26 event-y INT16 28 state SETofKEYBUTMASK 30 same-screen BOOL 31 device CARD8 END EVENT DeviceKeyPress ALIASES KeyButtonPointer EVENT DeviceKeyRelease ALIASES KeyButtonPointer EVENT DeviceButtonPress ALIASES KeyButtonPointer EVENT DeviceButtonRelease ALIASES KeyButtonPointer EVENT DeviceMotionNotify 1 detail ENUM8 normalhint 4 "timestamp" TIMESTAMP 8 "root window" WINDOW 12 "event window" WINDOW 16 "child window" WINDOW constants none 20 root-x INT16 22 root-y INT16 24 event-x INT16 26 event-y INT16 28 state SETofKEYBUTMASK 30 same-screen BOOL 31 device CARD8 END templateEVENT Proximity 4 "timestamp" TIMESTAMP 8 "root window" WINDOW 12 "event window" WINDOW 16 "child window" WINDOW constants none 20 root-x INT16 22 root-y INT16 24 event-x INT16 26 event-y INT16 28 state SETofKEYBUTMASK 30 same-screen BOOL 31 device CARD8 END EVENT ProximityIn ALIASES Proximity EVENT ProximityOut ALIASES Proximity templateEVENT DeviceFocus 1 detail ENUM8 enterdetail 4 "timestamp" TIMESTAMP 8 "event window" WINDOW 12 mode ENUM8 grabmode 13 device CARD8 END EVENT DeviceFocusOut ALIASES DeviceFocus EVENT DeviceFocusIn ALIASES DeviceFocus EVENT DeviceStateNotify 1 device CARD8 4 "timestamp" TIMESTAMP 11 reported BITMASK8 classes_reported 8 "#keys" COUNT8 12 keys LISTofCARD8 9 "#buttons" COUNT8 LATER buttons LISTofCARD8 10 "#valuators" COUNT8 LATER valuators LISTofCARD32 END EVENT DeviceKeystateNotify 1 device CARD8 4 keys LISTofCARD8 END EVENT DeviceButtonstateNotify 1 device CARD8 4 buttons LISTofCARD8 END EVENT DeviceMappingNotify 1 device CARD8 4 request CARD8 5 "first key code" KEYCODE 6 count UINT8 8 "timestamp" TIMESTAMP END EVENT ChangeDeviceNotify 1 device CARD8 4 "timestamp" TIMESTAMP 8 request CARD8 END EVENT DevicePresenceNotify 4 timestamp TIMESTAMP 8 change ENUM8 device_change 9 device CARD8 10 control CARD16 END EVENT DevicePropertyNotify 1 state ENUM8 newdeleted 4 timestamp TIMESTAMP 8 atom ATOM 31 device CARD8 END STRUCT ModifierInfo length 16 0 base_mods CARD32 4 latched_mods CARD32 8 locked_mods CARD32 12 effective_mods CARD32 END STRUCT GroupInfo length 4 0 base_group CARD8 1 latched_group CARD8 2 locked_group CARD8 3 effective_group CARD8 END # This does not work. I do not know if XIDEVICEINFO # is broken or if the event encodes it differently... # XGEVENT DeviceChanged # 10 deviceid CARD8 # 12 time TIMESTAMP # 16 "#classes" COUNT16 # 18 sourceid CARD8 # 20 reason CHANGEREASON # 32 classes LISTofXIDEVICEINFO # END templateEVENT Device 10 deviceid CARD8 12 time TIMESTAMP 16 detail CARD32 20 root WINDOW 24 event WINDOW 28 child WINDOW 32 root_x FP1616 36 root_y FP1616 40 event_x FP1616 44 event_y FP1616 52 sourceid CARD16 # TODO: meaning of flags... 56 flags CARD32 60 mods ModifierInfo 76 group GroupInfo 48 buttons_len COUNT16 80 buttons LISTofCARD32 50 valuators_len COUNT16 LATER valuators LISTofCARD32 RESET_COUNTER LATER axisvalues LISTofFIXED3232 END XGEVENT KeyPress ALIASES Device XGEVENT KeyRelease ALIASES Device XGEVENT ButtonPress ALIASES Device XGEVENT ButtonRelease ALIASES Device XGEVENT Motion ALIASES Device templateEVENT Notify 10 deviceid CARD8 12 time TIMESTAMP 16 sourceid CARD8 18 mode ENUM8 notify_mode 19 detail ENUM8 notify_detail 20 root WINDOW 24 event WINDOW 28 child WINDOW 32 root_x FP1616 36 root_y FP1616 40 event_x FP1616 44 event_y FP1616 48 same_screen BOOL 49 focus BOOL 52 mods ModifierInfo 68 group GroupInfo 50 buttons_len COUNT16 72 masks LISTofCARD32 END XGEVENT Enter ALIASES Notify XGEVENT Leave ALIASES Notify XGEVENT FocusIn ALIASES Notify XGEVENT FocusOut ALIASES Notify EOF xtrace-1.3.1/errors.proto0000644000175100017510000000025211704002604012317 00000000000000NAMESPACE core ERRORS "no error" Request Value Window Pixmap Atom Cursor Font Match Drawable Access Alloc Colormap GContext IDChoice Name Length Implementation END EOF xtrace-1.3.1/sync.proto0000644000175100017510000000626611704002604011772 00000000000000EXTENSION "SYNC" XSync USE core REQUESTS Initialize RESPONDS ListSystemCounters RESPONDS CreateCounter SetCounter ChangeCounter QueryCounter RESPONDS DestroyCounter Await CreateAlarm ChangeAlarm QueryAlarm RESPONDS DestroyAlarm SetPriority GetPriority RESPONDS CreateFence TriggerFence ResetFence DestroyFence QueryFence RESPONDS AwaitFence /* 19 */ END EVENTS CounterNotify AlarmNotify END ERRORS BadCounter BadAlarm END # XSyncCounter, XSyncAlarm and XSyncFence are just IDs: TYPE Counter CARD32 TYPE Alarm CARD32 TYPE Fence CARD32 # a XSyncValue is two 32 bit integers meaning on 64 bit one: TYPE Value INT32_32 CONSTANTS alarm_state 0 Active 1 Inactive 2 Destroyed END TYPE AlarmState ENUM8 alarm_state CONSTANTS test_type 0 PositiveTransition 1 NegativeTransition 2 PositiveComparison 3 NegativeComparison END TYPE TestType ENUM32 test_type CONSTANTS value_type 0 Absolute 1 Relative END TYPE ValueType ENUM32 value_type REQUEST Initialize 4 major-version UINT8 5 minor-version UINT8 END RESPONSE Initialize 8 major-version UINT8 9 minor-version UINT8 END LIST SystemCounter variable min-length 14 0 counter Counter 4 resolution Value 12 name_length COUNT16 14 name STRING8 ROUND END REQUEST ListSystemCounters ALIASES Empty RESPONSE ListSystemCounters 8 num-counters COUNT32 32 counter LISTofSystemCounter END REQUEST CreateCounter 4 counter Counter 8 initial-value Value END REQUEST SetCounter 4 counter Counter 8 value Value END REQUEST ChangeCounter 4 counter Counter 8 value Value END REQUEST QueryCounter 4 counter Counter END RESPONSE QueryCounter 8 value Value END REQUEST DestroyCounter 4 counter Counter END LIST WaitCondition length 28 0 counter Counter 4 value-type ValueType 8 wait-value Value 16 test-type TestType 20 event-threshold Value END REQUEST Await 4 conditions LISTofWaitCondition END VALUES AlarmAttributes 1<<0 Counter Counter 1<<1 ValueType ValueType 1<<2 Value Value 1<<3 TestType TestType 1<<4 Delta Value 1<<5 Events BOOL END REQUEST CreateAlarm 4 alarm Alarm 8 value-mask STORE16 12 values LISTofAlarmAttributes END REQUEST ChangeAlarm 4 alarm Alarm 8 value-mask STORE16 12 values LISTofAlarmAttributes END REQUEST QueryAlarm 4 alarm Alarm END RESPONSE QueryAlarm 8 counter Counter 12 value-type ValueType 16 wait-value Value 24 test-type TestType 28 delta Value 36 events BOOL 37 state AlarmState END REQUEST DestroyAlarm 4 alarm Alarm END REQUEST SetPriority 4 client-resource-id CARD32 constants none 8 priority INT32 END REQUEST GetPriority 4 client-resource-id CARD32 constants none END RESPONSE GetPriority 8 priority INT32 END REQUEST CreateFence 4 drawable DRAWABLE 8 fid Fence 12 initial-triggered BOOL END templateREQUEST Fence 4 fid Fence END REQUEST TriggerFence ALIASES Fence REQUEST ResetFence ALIASES Fence REQUEST DestroyFence ALIASES Fence REQUEST QueryFence ALIASES Fence RESPONSE QueryFence 8 triggered BOOL END REQUEST AwaitFence ALIASES Empty EVENT CounterNotify 4 counter Counter 8 wait-value Value 16 counter-value Value 24 time TIMESTAMP 28 count UINT16 30 destroyed BOOL END EVENT AlarmNotify 4 alarm Alarm 8 counter-value Value 16 alarm-value Value 24 time TIMESTAMP 28 state AlarmState END EOF xtrace-1.3.1/translate.c0000644000175100017510000021351611704002604012070 00000000000000/* This file is part of "xtrace" * Copyright (C) 2009,2010,2011 Bernhard R. Link * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "xtrace.h" #include "parse.h" #include "stringlist.h" #include "translate.h" /* This parses an file to generate the description how packets look like. */ enum variable_type { vt_namespace = 0, vt_request, vt_response, vt_event, vt_setup, vt_type, vt_constants, vt_values, vt_struct, vt_COUNT }; static const char * const typename[vt_COUNT] = { "namespace", "request", "response", "event", "type", "constants", "values", "struct"}; static const struct base_type { const char *name; enum fieldtype type; unsigned int flags; int size; #define NEEDS_CONSTANTS 1 #define NEEDS_BITMASK 3 #define ALLOWS_CONSTANTS 4 #define USES_STORE 8 #define SETS_STORE 0x10 #define USES_FORMAT 0x20 #define SETS_FORMAT 0x40 #define ELEMENTARY 0x80 #define PUSHES 0x100 #define SETS_NEXT 0x200 #define NEEDS_STORE 0x400 } base_types [] = { { "BITMASK8", ft_BITMASK8, NEEDS_BITMASK|ELEMENTARY, 1}, { "BITMASK16", ft_BITMASK16, NEEDS_BITMASK|ELEMENTARY, 2}, { "BITMASK32", ft_BITMASK32, NEEDS_BITMASK|ELEMENTARY, 4}, { "ENUM8", ft_ENUM8, NEEDS_CONSTANTS|ELEMENTARY, 1}, { "ENUM16", ft_ENUM16, NEEDS_CONSTANTS|ELEMENTARY, 2}, { "ENUM32", ft_ENUM32, NEEDS_CONSTANTS|ELEMENTARY, 4}, { "CARD8", ft_CARD8, ALLOWS_CONSTANTS|ELEMENTARY, 1}, { "CARD16", ft_CARD16, ALLOWS_CONSTANTS|ELEMENTARY, 2}, { "CARD32", ft_CARD32, ALLOWS_CONSTANTS|ELEMENTARY, 4}, { "INT8", ft_INT8, ALLOWS_CONSTANTS|ELEMENTARY, 1}, { "INT16", ft_INT16, ALLOWS_CONSTANTS|ELEMENTARY, 2}, { "INT32", ft_INT32, ALLOWS_CONSTANTS|ELEMENTARY, 4}, { "UINT8", ft_UINT8, ALLOWS_CONSTANTS|ELEMENTARY, 1}, { "UINT16", ft_UINT16, ALLOWS_CONSTANTS|ELEMENTARY, 2}, { "UINT32", ft_UINT32, ALLOWS_CONSTANTS|ELEMENTARY, 4}, { "STRING8", ft_STRING8, USES_STORE|SETS_NEXT, 0}, { "LISTofCARD8", ft_LISTofCARD8, ALLOWS_CONSTANTS|USES_STORE|SETS_NEXT, 0}, { "LISTofCARD16", ft_LISTofCARD16, ALLOWS_CONSTANTS|USES_STORE|SETS_NEXT, 0}, { "LISTofCARD32", ft_LISTofCARD32, ALLOWS_CONSTANTS|USES_STORE|SETS_NEXT, 0}, { "LISTofUINT8", ft_LISTofUINT8, ALLOWS_CONSTANTS|USES_STORE|SETS_NEXT, 0}, { "LISTofUINT16", ft_LISTofUINT16, ALLOWS_CONSTANTS|USES_STORE|SETS_NEXT, 0}, { "LISTofUINT32", ft_LISTofUINT32, ALLOWS_CONSTANTS|USES_STORE|SETS_NEXT, 0}, { "LISTofINT8", ft_LISTofINT8, ALLOWS_CONSTANTS|USES_STORE|SETS_NEXT, 0}, { "LISTofINT16", ft_LISTofINT16, ALLOWS_CONSTANTS|USES_STORE|SETS_NEXT, 0}, { "LISTofINT32", ft_LISTofINT32, ALLOWS_CONSTANTS|USES_STORE|SETS_NEXT, 0}, { "EVENT", ft_EVENT, 0, 0}, { "ATOM", ft_ATOM, ALLOWS_CONSTANTS|ELEMENTARY, 4}, { "LISTofFormat", ft_LISTofFormat, USES_FORMAT|USES_STORE|SETS_NEXT, 0}, { "LISTofATOM", ft_LISTofATOM, ALLOWS_CONSTANTS|USES_STORE|SETS_NEXT, 0}, { "FORMAT8", ft_FORMAT8, SETS_FORMAT, 1}, { "BE32", ft_BE32, ALLOWS_CONSTANTS, 4}, { "FRACTION16_16", ft_FRACTION16_16, 0, 4}, { "FRACTION32_32", ft_FRACTION32_32, 0, 8}, { "UFRACTION32_32", ft_UFRACTION32_32, 0, 8}, { "INT32_32", ft_INT32_32, ELEMENTARY, 8}, { "FIXED", ft_FIXED, 0, 4}, { "FIXED1616", ft_FIXED, 0, 4}, { "FIXED3232", ft_FIXED3232, 0, 8}, { "LISTofFIXED", ft_LISTofFIXED, USES_STORE|SETS_NEXT, 0}, { "LISTofFIXED1616", ft_LISTofFIXED, USES_STORE|SETS_NEXT, 0}, { "LISTofFIXED3232", ft_LISTofFIXED3232, USES_STORE|SETS_NEXT, 0}, { "FLOAT32", ft_FLOAT32, 0, 4}, { "LISTofFLOAT32", ft_LISTofFLOAT32, USES_STORE|SETS_NEXT, 0}, { "PUSH8", ft_PUSH8, PUSHES, 1}, { "PUSH16", ft_PUSH16, PUSHES, 2}, { "PUSH32", ft_PUSH32, PUSHES, 4}, { "STORE8", ft_STORE8, SETS_STORE, 1}, { "STORE16", ft_STORE16, SETS_STORE, 2}, { "STORE32", ft_STORE32, SETS_STORE, 4}, { NULL, 0, 0, 0} }; /* some types are only implicitable buildable: */ static const struct base_type base_type_list_of_value = { "LISTofVALUE", ft_LISTofVALUE, NEEDS_STORE, 0}; static const struct base_type base_type_list_of_struct = { "LISTofStruct", ft_LISTofStruct, USES_STORE|SETS_NEXT, 0}; static const struct base_type base_type_list_of_varstruct = { "LISTofVarStruct", ft_LISTofVarStruct, USES_STORE|SETS_NEXT, 0}; static const struct base_type base_type_struct = { "Struct", ft_Struct, 0, -1}; //static const struct base_type base_type_varstruct = // { "VarStruct", ft_VarStruct, SETS_NEXT, 0}; #define C(td, f) ((td->flags & f) == f) struct typespec { const struct base_type *base_type; /* constants for most, unless values for LISTofVALUE, or struct for Struct and List */ struct variable *data; }; struct variable { enum variable_type type; int refcount; union { struct unfinished_parameter { struct unfinished_parameter *next; bool isspecial; union { struct { size_t offse; const char *name; struct typespec type; } regular; struct { enum fieldtype type; size_t offse; const char *condition; bool isjunction; struct unfinished_parameter *iftrue; const struct parameter *finalized; } special; }; } *parameter; struct { struct constant *constants; size_t size; bool bitmask; } c; struct unfinished_value { struct unfinished_value *next; unsigned long flag; const char *name; struct typespec type; } *values; struct typespec t; }; union parameter_option finalized; }; struct namespace { struct namespace *next; char *name; int refcount; char *extension; int num_requests; struct request_data { const char *name; int number; bool has_response; bool unsupported; bool special; int record_variables; struct variable *request, *response; } *requests; int num_events[event_COUNT]; struct event_data { const char *name; int number; bool unsupported; bool special; struct variable *event; } *events[event_COUNT]; int num_errors; const char **errors; struct variable *setup; void *variables[vt_COUNT]; /* namespaces that can be used without prefix: */ int used_count; struct namespace **used; }; struct varname { struct variable *variable; char name[]; }; static int compare_variables(const void *a, const void *b) { const char *v1 = a, *v2 = b; return strcmp(v1 + sizeof(struct varname), v2 + sizeof(struct varname)); } static void variable_unref(struct variable *v); static inline void typespec_done(struct typespec *t) { variable_unref(t->data); } static void typespec_copy(struct typespec *dst, const struct typespec *src) { *dst = *src; if( dst->data != NULL ) dst->data->refcount++; } static void parameter_free(struct unfinished_parameter *parameter) { while( parameter != NULL ) { struct unfinished_parameter *p = parameter; parameter = p->next; if( p->isspecial ) { parameter_free(p->special.iftrue); } else { typespec_done(&p->regular.type); } free(p); } } static void variable_unref(struct variable *v) { if( v == NULL ) return; assert( v->refcount > 0 ); if( -- (v->refcount) > 0 ) return; if( v->type == vt_values ) { while( v->values != NULL ) { struct unfinished_value *n = v->values->next; typespec_done(&v->values->type); free(v->values); v->values = n; } } else if( v->type == vt_constants ) { free(v->c.constants); } else if( v->type == vt_type ) { typespec_done(&v->t); } else if( v->type == vt_struct || v->type == vt_request || v->type == vt_setup || v->type == vt_response || v->type == vt_event ) { parameter_free(v->parameter); } else assert( v->type != v->type ); free(v); } #define namespace_unlock(n) do {if(n != NULL ){(n)->refcount--;}} while(0) struct parser { char buffer[300], *position, *last; struct namespace *namespaces; struct source_file { struct source_file *next; char *name; char *filename; FILE *file; long lineno; struct namespace *namespace; } *current; struct searchpath_entry { struct searchpath_entry *next; const char *dir; size_t len; } *searchpath; bool error; }; static void file_free(struct source_file *current) { while( current != NULL ) { struct source_file *n = current->next; free(current->name); free(current->filename); if( current->file != NULL ) (void)fclose(current->file); namespace_unlock(current->namespace); free(current); current = n; } } static void error(struct parser *parser, const char *fmt, ...) FORMAT(printf,2,3); static bool get_next_line(struct parser *parser, long firstline) { char *p; do { if( parser->error ) return false; parser->position = parser->buffer; parser->last = parser->buffer; if( fgets(parser->buffer, sizeof(parser->buffer), parser->current->file) == NULL ) { int e = ferror(parser->current->file); if( e != 0 ) { fprintf(stderr, "Error %d reading from file '%s': %s\n", e, parser->current->filename, strerror(e)); } else { if( firstline > 0 ) { error(parser, "Unexpected end of file (forgot END (awaited since %ld) and EOF?)", firstline+1); } error(parser, "Unexpected end of file (forgot EOF?)"); } parser->error = true; return false; } parser->current->lineno++; p = strchr(parser->buffer, '\0'); while( p-- > parser->buffer && ( *p == '\n' || *p == '\r' || *p == '\t' || *p == ' ' ) ) *p = '\0'; } while ( parser->buffer[0] == '#' || parser->buffer[0] == '\0' ); return true; } static bool file_done(struct parser *parser) { struct source_file *last_done, *first_unfinished; int i, e; if( parser->error ) return false; e = ferror(parser->current->file); if( e != 0 ) { fprintf(stderr, "Error %d reading from file '%s': %s\n", e, parser->current->filename, strerror(e)); parser->error = true; return false; } i = fclose(parser->current->file); parser->current->file = NULL; if( i != 0 ) { e = errno; fprintf(stderr, "Error %d reading from file '%s': %s\n", e, parser->current->filename, strerror(e)); parser->error = true; return false; } /* check if there is more to do: */ last_done = parser->current; while( last_done->next != NULL && last_done->next->file == NULL ) last_done = last_done->next; first_unfinished = last_done->next; if( first_unfinished == NULL ) return true; /* move the first not yet processed file to here: */ last_done->next = first_unfinished->next; first_unfinished->next = parser->current; parser->current = first_unfinished; return false; } static const char *get_const_token(struct parser *parser, bool optional) { char *p, *q; if( parser->error ) return NULL; p = parser->position; while( *p != '\0' && (*p == ' ' || *p == '\t') ) p++; parser->last = p; if( *p == '\0' ) { if( !optional ) error(parser, "unexpected end of line"); return NULL; } if( *p == '"' ) { q = p; p++; while( *p != '\0' && *p != '"' ) { if( *p == '\\' && p[1] != '\0' ) { p++; if( *p < '0' || *p > '7' ) *q++ = *p++; else { *q = *(p++) - '0'; if( *p >= '0' || *p <= '7' ) *q = *q * 8 + *(p++) - '0'; if( *p >= '0' || *p <= '7' ) *q = *q * 8 + *(p++) - '0'; q++; } } else { *q++ = *p++; } } if( *p != '"' ) { error(parser, "Unterminated string!"); return NULL; } *q = '\0'; p++; } else { while( *p != '\0' && *p != ' ' && *p != '\t' ) { if( *p == '#' ) { error(parser, "Unescaped '#'"); return NULL; } p++; } } while( *p != '\0' && (*p == ' ' || *p == '\t') ) *(p++) = '\0'; parser->position = p; return parser->last; } static void oom(struct parser *parser) { if( parser->error ) return; fputs("Out of memory!", stderr); parser->error = true; } static char *get_token(struct parser *parser, bool optional) { const char *v; char *p; v = get_const_token(parser, optional); if( v == NULL ) return NULL; p = strdup(v); if( p == NULL ) { oom(parser); } return p; } static char *get_token_with_len(struct parser *parser, size_t *l) { char *p; if( parser->error ) return NULL; p = parser->position; parser->last = p; if( *p == '\0' ) { error(parser, "unespected end of line"); return NULL; } while( *p != '\0' && *p != ' ' && *p != '\t' ) p++; *l = p - parser->last; while( *p != '\0' && (*p == ' ' || *p == '\t') ) *(p++) = '\0'; parser->position = p; return parser->last; } static void error(struct parser *parser, const char *fmt, ...) { va_list ap; if( parser->error ) return; parser->error = true; if( parser->last != NULL ) fprintf(stderr, "%s:%ld:%d: ", parser->current->filename, parser->current->lineno, (int)(1 + (parser->last - parser->buffer))); else fprintf(stderr, "%s:%ld: ", parser->current->filename, parser->current->lineno); va_start(ap, fmt); vfprintf(stderr, fmt, ap); va_end(ap); fputc('\n', stderr); } static void no_more_arguments(struct parser *parser) { if( parser->position[0] != '\0' ) { parser->last = parser->position; error(parser, "End of line expected!"); } } void add_searchpath(struct parser *parser, const char *dir) { struct searchpath_entry **last; last = &parser->searchpath; while( *last != NULL ) last = &(*last)->next; *last = malloc(sizeof(struct searchpath_entry)); if( *last == NULL ) { oom(parser); return; } (*last)->next = NULL; (*last)->dir = dir; (*last)->len = strlen(dir); } static FILE *find_file(struct parser *parser, const char *name, char **filename_p) { size_t l = strlen(name); struct searchpath_entry *r; assert( parser->searchpath != NULL ); for( r = parser->searchpath ; r != NULL ; r = r->next ) { char *filename = NULL; FILE *f; filename = malloc(l + r->len + 2); if( filename == NULL ) { oom(parser); return NULL; } memcpy(filename, r->dir, r->len); filename[r->len] = '/'; memcpy(filename + r->len + 1, name, l + 1); f = fopen(filename, "r"); if( f != NULL ) { *filename_p = filename; return f; } free(filename); } fprintf(stderr, "Unable to find '%s' in search path!\n", name); parser->error = true; *filename_p = NULL; return NULL; } static void open_next_file(struct parser *parser, char *name) { struct source_file *current; if( name == NULL ) oom(parser); if( parser->error ) { free(name); return; } current = parser->current; while( current != NULL && strcmp(current->name, name) != 0 ) current = current->next; if( current != NULL ) { if( current->file != NULL ) error(parser, "Circular dependency! '%s' requested while parsing it!", name); free(name); return; } current = calloc(1, sizeof(*current)); if( current == NULL ) { oom(parser); free(name); return; } current->name = name; current->file = find_file(parser, name, ¤t->filename); if( current->file == NULL ) { int e = errno; error(parser, "Error %d opening '%s': %s", e, current->filename, strerror(e)); file_free(current); return; } current->lineno = 0; current->namespace = NULL; parser->position = NULL; parser->last = NULL; current->next = parser->current; parser->current = current; } static bool add_variable(struct parser *parser, const char *prefix, const char *name, const char **varname, struct variable *variable) { struct varname *v, **vv; size_t pl = strlen(prefix), l = strlen(name); struct namespace *namespace = parser->current->namespace; v = malloc(sizeof(struct varname) + l + pl + 1); if( v == NULL ) { oom(parser); return false; } memcpy(v->name, prefix, pl); memcpy(v->name + pl, name, l + 1); v->variable = NULL; vv = tsearch(v, &namespace->variables[variable->type], compare_variables); if( vv == NULL ) { free(v); oom(parser); return false; } if( *vv != v ) { // free(v); /* already defined */ return false; } if( varname != NULL ) *varname = v->name; v->variable = variable; variable->refcount ++; return true; } static struct variable *add_var(struct parser *parser, const char *prefix, const char *name, const char **varname, enum variable_type vt) { struct variable *variable; if( name == NULL ) return NULL; variable = calloc(1, sizeof(struct variable)); if( variable == NULL ) { oom(parser); return NULL; } variable->type = vt; if( add_variable(parser, prefix, name, varname, variable) ) return variable; error(parser, "%s '%s%s' already defined!", typename[vt], prefix, name); free(variable); return NULL; } static struct variable *find_variable(struct parser *parser, enum variable_type vt, const char *name) { struct varname **v; const char *e; int i; if( name == NULL ) return NULL; e = strchr(name, ':'); if( e != NULL ) { struct namespace *n; if( e[1] != ':' ) { error(parser, "Unexpected colon (':') in '%s'!", name); return NULL; } for( n = parser->namespaces ; n != NULL ; n = n->next ) { if( strncmp(n->name, name, e - name) != 0 ) continue; if( n->name[e-name] != '\0' ) continue; v = tfind(e + 2 - sizeof(struct varname), &n->variables[vt], compare_variables); if( v == NULL || *v == NULL ) { error(parser, "Unknown %s '%s' ('%s')!", typename[vt], name, e+2); return NULL; } else return (*v)->variable; } error(parser, "Unknown namespace '%.*s'", (int)(e-name), name); return NULL; } v = tfind(name - sizeof(struct varname), &parser->current->namespace->variables[vt], compare_variables); if( v != NULL && *v != NULL ) return (*v)->variable; // check imported namespaces for( i = 0 ; i < parser->current->namespace->used_count ; i++ ) { struct namespace *n = parser->current->namespace->used[i]; v = tfind(name - sizeof(struct varname), &n->variables[vt], compare_variables); if( v != NULL && *v != NULL ) return (*v)->variable; } error(parser, "Unknown %s %s!", typename[vt], name); return NULL; } #define command_is(name) l == sizeof(name)-1 && memcmp(command, name, sizeof(name)-1) == 0 static void parse_errors(struct parser *parser) { long first_line = parser->current->lineno; struct namespace *ns = parser->current->namespace; if( ns->num_errors != 0 || ns->errors != NULL ) { error(parser, "second ERRORS for namespace '%s'!", ns->name); return; } while( get_next_line(parser, first_line) ) { const char *name = get_const_token(parser, false); const char **n; if( strcmp(name, "END") == 0 ) { no_more_arguments(parser); return; } else if( strcmp(name, "EOF") == 0 ) { no_more_arguments(parser); error(parser, "Missing END (beginning at line %ld)", first_line); } no_more_arguments(parser); name = string_add(name); if( name == NULL ) { parser->error = true; return; } ns->num_errors++; n = realloc(ns->errors, ns->num_errors * sizeof(const char*)); if( n == NULL ) { oom(parser); return; } ns->errors = n; ns->errors[ns->num_errors - 1] = name; } error(parser, "missing END!"); } static unsigned long parse_number(struct parser *parser, const char *value) { char *e; unsigned long number = 0; if( parser->error ) return 0; assert( value != NULL ); if( value[0] == '$' ) { char *v; struct variable *var; const struct constant *c; e = strrchr(value, ':'); if( e == NULL || ( e > value && *(e-1) == ':' ) ) { error(parser, "Constants name and member must be separated with a single colon!"); return 0; } v = strndup(value + 1, e - (value+1)); if( v == NULL ) { oom(parser); return 0; } var = find_variable(parser, vt_constants, v); if( var == NULL ) { free(v); return 0; } for( c = var->c.constants ; c->name != NULL ; c++ ) { if( strcmp(c->name, e+1) == 0 ) { free(v); return c->value; } } error(parser, "Unable to find '%s' in constants %s!", e+1, v); free(v); return 0; } if( value[0] == '0' && value[1] == '\0' ) { e = (char*)value + 1; } else if( value[0] == '0' && value[1] == 'x' ) number = strtoll(value+2, &e, 16); else if( value[0] == '0' && value[1] == 'o' ) number = strtoll(value+2, &e, 8); else if( value[0] == '0' && value[1] == 'b' ) number = strtoll(value+2, &e, 2); else if( value[0] != '0' ) number = strtoll(value, &e, 10); else { error(parser, "Leading zeros in numbers are forbidden to avoid confusion!"); e = (char*)value; } if( e[0] == '<' && e[1] == '<' ) { char *ee; long long shift = strtoll(e + 2, &ee, 10); if( ee > e + 2 && shift >= 0 && shift < 32 ) { number = number << (unsigned long)shift; e = ee; } } if( *e != '\0' ) { error(parser, "Error parsing number!"); return 0; } return number; } static bool parse_typespec(struct parser *parser, struct typespec *t) { const char *type, *attribute; struct variable *tv; const struct base_type *td; memset(t, 0, sizeof(*t)); type = get_const_token(parser, false); if( parser->error ) { return false; } td = base_types; while( td->name != NULL && strcmp(td->name, type) != 0 ) td++; if( td->name != NULL ) { t->base_type = td; if( C(td, NEEDS_CONSTANTS) ) { struct variable *cv; attribute = get_const_token(parser, false); cv = find_variable(parser, vt_constants, attribute); if( cv == NULL ) return false; if( C(td, NEEDS_BITMASK) && ! cv->c.bitmask ) { error(parser, "Not-BITMASK constants %s used for bitmask!", attribute); } t->data = cv; cv->refcount++; } } else { tv = find_variable(parser, vt_type, type); if( tv == NULL ) return false; assert( tv->type == vt_type ); typespec_copy(t, &tv->t); } attribute = get_const_token(parser, true); if( attribute != NULL ) { if( strcmp(attribute, "constants") == 0 ) { if( !C(t->base_type, ALLOWS_CONSTANTS) ) { error(parser, "constants not allowed here!"); } else if( t->data != NULL ) { error(parser, "multiple constants not allowed!"); } else { struct variable *cv; attribute = get_const_token(parser, false); cv = find_variable(parser, vt_constants, attribute); if( cv == NULL ) return false; t->data = cv; cv->refcount++; } } else error(parser, "unknown type attribute!"); } no_more_arguments(parser); return !parser->error; } static struct unfinished_parameter *new_parameter_special(struct parser *parser, struct unfinished_parameter ***last_pp, enum fieldtype ft, size_t offse, const char *condition) { struct unfinished_parameter *n; if( parser->error ) return NULL; n = calloc(1, sizeof(struct unfinished_parameter)); if( n == NULL ) { oom(parser); return NULL; } n->isspecial = true; n->special.offse = offse; n->special.type = ft; /* NULL is termination condition */ if( condition == NULL ) n->special.condition = ""; else n->special.condition = condition; **last_pp = n; *last_pp = &n->next; return n; } /* here many things can still be checked: if nothing is accessed past the length in a struct, if things overlap, ... */ struct parameter_state { struct parameter_state *parent; struct unfinished_parameter *junction; size_t maxsize, minsize; bool store_set, store_used, format_set, sizemarker_set, nextmarker_set, nextmarker_at_end_of_packet; }; static void field_accessed(struct parser *parser, struct parameter_state *state, size_t ofs, size_t fieldlen) { if( ofs == (size_t)-1 ) return; if( ofs + fieldlen > state->minsize ) { if( ofs + fieldlen > state->maxsize ) { error(parser, "Accessing field past specified SIZE of %lu!", (unsigned long)state->maxsize); } state->minsize = ofs + fieldlen; } /* TODO: record here what areas are used to avoid overlaps and * gaps? */ } static bool parse_parameters(struct parser *parser, struct variable *variable, bool needsnextmarker) { long first_line = parser->current->lineno; struct parameter_state *state; struct unfinished_parameter *parameters = NULL, **last = ¶meters; assert( variable->parameter == NULL ); state = calloc(1, sizeof(struct parameter_state)); if( state == NULL ) { oom(parser); return false; } state->maxsize = SIZE_MAX; while( get_next_line(parser, first_line) ) { const char *position, *name; unsigned long number; struct typespec type; position = get_const_token(parser, false); if( strcmp(position, "EOF") == 0 ) { error(parser, "Missing 'END' (closing block opened at line %ld)!", first_line + 1); break; } if( strcmp(position, "END") == 0 ) { no_more_arguments(parser); if( state->parent != NULL ) error(parser, "missing ELSE"); if( needsnextmarker && !state->nextmarker_set ) error(parser, "Missing NEXT (or LISTof...)!"); free(state); variable->parameter = parameters; return true; } if( strcmp(position, "ALIAS") == 0 ) { error(parser, "ALIAS is no longer a valid keyword!"); break; } if( strcmp(position, "ELSE") == 0 ) { struct parameter_state *s; if( state->parent == NULL ) error(parser, "ELSE without IF"); no_more_arguments(parser); if( needsnextmarker && !state->nextmarker_set ) error(parser, "Missing NEXT (or LISTof...)!"); last = &state->junction->next; s = state->parent; free(state); state = s; continue; } if( strcmp(position, "IF") == 0 || strcmp(position, "ELSEIF") == 0 ) { struct parameter_state *s; struct unfinished_parameter *i; const char *v, *condition; enum fieldtype ft; size_t fieldlen; bool inelseif = strcmp(position, "ELSEIF") == 0; if( inelseif ) { /* this is like an END here */ if( state->parent == NULL ) error(parser, "ELSEIF without IF"); if( needsnextmarker && !state->nextmarker_set ) error(parser, "Missing NEXT (or LISTof...)!"); } v = get_const_token(parser, false); if( strcmp(v, "STORED") == 0 ) number = (size_t)-1; // compare store value else number = parse_number(parser, v); v = get_const_token(parser, false); if( v == NULL ) break; if( strcmp(v, "ATOM") == 0 ) { ft = ft_IFATOM; v = get_const_token(parser, false); condition = string_add(v); fieldlen = 4; } else if( strcmp(v, "CARD8") == 0 ) { unsigned char c; ft = ft_IF8; v = get_const_token(parser, false); c = parse_number(parser, v); condition = string_add_l((const char*)&c, 1); fieldlen = 1; } else if( strcmp(v, "CARD16") == 0 ) { unsigned char c[2]; unsigned long l; ft = ft_IF16; v = get_const_token(parser, false); l = parse_number(parser, v); c[1] = l & 0xFF; c[0] = l >> 8; condition = string_add_l((const char*)c, 2); fieldlen = 2; } else if( strcmp(v, "CARD32") == 0 ) { unsigned char c[4]; unsigned long l; ft = ft_IF32; v = get_const_token(parser, false); l = parse_number(parser, v); c[3] = l & 0xFF; c[2] = (l >> 8) & 0xFF; c[1] = (l >> 16) & 0xFF; c[0] = l >> 24; condition = string_add_l((const char*)c, 4); fieldlen = 4; } else { error(parser, "unknown IF type '%s'!", v); break; } no_more_arguments(parser); field_accessed(parser, state, number, fieldlen); if( inelseif ) last = &state->junction->next; i = new_parameter_special(parser, &last, ft, number, condition); if( inelseif ) { s = state->parent; } else { s = state; state = malloc(sizeof(*state)); if( state == NULL ) { oom(parser); break; } } *state = *s; state->parent = s; state->junction = i; if( i != NULL ) { last = &i->special.iftrue; i->special.isjunction = true; } continue; } if( strcmp(position, "ROUND") == 0 ) { if( !state->nextmarker_set ) error(parser, "ROUND makes no sense if nextmarker not set!"); no_more_arguments(parser); new_parameter_special(parser, &last, ft_LASTMARKER, (size_t)-1 /* ROUND32 */, NULL ); continue; } if( strcmp(position, "GET") == 0 ) { const char *v; v = get_const_token(parser, false); number = parse_number(parser, v); no_more_arguments(parser); // TODO: remember what is needed for checking state->store_set = true; new_parameter_special(parser, &last, ft_GET, number, NULL); continue; } if( strcmp(position, "SET_COUNTER") == 0 ) { const char *v; v = get_const_token(parser, false); number = parse_number(parser, v); no_more_arguments(parser); state->store_set = true; new_parameter_special(parser, &last, ft_SET, number, NULL); continue; } if( strcmp(position, "DECREMENT_STORED") == 0 || strcmp(position, "DECREMENT_COUNT") == 0 ) { const char *v; if( !state->store_set ) { error(parser, "store variable must be set before it can be changed!"); } v = get_const_token(parser, false); number = parse_number(parser, v); no_more_arguments(parser); new_parameter_special(parser, &last, ft_DECREMENT_STORED, number, NULL); continue; } if( strcmp(position, "DIVIDE_COUNT") == 0) { const char *v; if( !state->store_set ) { error(parser, "store variable must be set before it can be changed!"); } v = get_const_token(parser, false); number = parse_number(parser, v); no_more_arguments(parser); new_parameter_special(parser, &last, ft_DIVIDE_STORED, number, NULL); continue; } if( strcmp(position, "RESET_COUNTER") == 0 ) { no_more_arguments(parser); state->store_set = false; state->store_used = false; new_parameter_special(parser, &last, ft_SET, INT_MAX, NULL); continue; } if( strcmp(position, "SIZE") == 0 ) { const char *v; unsigned long t = 1; v = get_const_token(parser, false); if( v == NULL ) break; if( strcmp(v, "STORE") == 0 || strcmp(v, "COUNT") == 0 ) { if( !state->store_set ) error(parser, "store variable not yet set, so cannot be used!"); state->store_used = true; number = (size_t)-1; } else if( strcmp(v, "GET") == 0 ) { // TODO: check if stack can have something... number = parse_number(parser, v); if( number >= 30 ) { error(parser, "Absurd big stack index: %lu\n", number); continue; } number |= 0x80000000; } else { number = parse_number(parser, v); if( number > 65536 ) { error(parser, "Absurd big number for length of substructure: %lu\n", number); continue; } state->maxsize = number; if( state->minsize > state->maxsize ) { error(parser, "Setting size to %lu >= Data yet looked at up to %lu!", (unsigned long)state->maxsize, (unsigned long)state->minsize); continue; } } v = get_const_token(parser, true); if( v != NULL ) { if( strcmp(v, "TIMES") != 0 ) { error(parser, "Unexpected argument '%s'!", v); continue; } error(parser, "'TIMES' not yet supported!"); continue; v = get_const_token(parser, false); t = parse_number(parser, v); } no_more_arguments(parser); state->sizemarker_set = true; new_parameter_special(parser, &last, ft_SET_SIZE, number, NULL); continue; } if( strcmp(position, "NEXT") == 0 ) { const char *v; v = get_const_token(parser, false); number = parse_number(parser, v); no_more_arguments(parser); state->nextmarker_set = true; state->nextmarker_at_end_of_packet = false; new_parameter_special(parser, &last, ft_LASTMARKER, number, NULL); continue; } if( strcmp(position, "LATER") == 0 ) { if( state->nextmarker_at_end_of_packet ) error(parser, "LATER makes no sense after all-consuming LIST (i.e. list without limiting count)"); if( !state->nextmarker_set ) error(parser, "LATER needs a command setting nextmarker before!"); number = (size_t)-1; //OFS_LATER; } else number = parse_number(parser, position); name = get_const_token(parser, false); parse_typespec(parser, &type); if( parser->error ) { typespec_done(&type); break; } assert( type.base_type != NULL ); if( C(type.base_type, SETS_NEXT) ) state->nextmarker_set = true; if( C(type.base_type, NEEDS_STORE) && !state->store_set ) { error(parser, "This commands needs store variable set, but this does not seem to be the case!"); } if( C(type.base_type, USES_STORE) ) { if( !state->store_set ) { if( state->store_used ) error(parser, "store variable consumed and not ready here!"); state->nextmarker_at_end_of_packet = true; } state->store_set = false; state->store_used = true; } if( C(type.base_type, SETS_STORE) ) { state->store_set = true; state->store_used = false; } if( C(type.base_type, USES_FORMAT) && !state->format_set ) { error(parser, "Format variable not set!"); } if( C(type.base_type, SETS_FORMAT) ) { state->format_set = true; } if( C(type.base_type, PUSHES) ) { } name = string_add(name); if( name == NULL ) parser->error = true; *last = calloc(1, sizeof(struct unfinished_parameter)); if( *last == NULL ) oom(parser); if( parser->error ) { typespec_done(&type); break; } (*last)->isspecial = false; (*last)->regular.offse = number; (*last)->regular.name = string_add(name);; (*last)->regular.type = type; /* TODO: better size estimate for structs and for lists * where the counter was explicitly set */ field_accessed(parser, state, number, type.base_type->size); last = &(*last)->next; } error(parser, "missing END!"); parameter_free(parameters); while( state != NULL ) { struct parameter_state *s = state->parent; free(state); state = s; } return false; } static struct request_data *find_request(struct parser *parser, const char *name) { struct namespace *n = parser->current->namespace; int i; if( parser->error ) return NULL; if( n->requests == NULL || n->num_requests <= 0 ) return NULL; for( i = 0 ; i < n->num_requests ; i++ ) { struct request_data *r = &n->requests[i]; if( r->name == NULL ) continue; if( strcmp(name, r->name) == 0 ) return r; } return NULL; } static void parse_request(struct parser *parser, bool template) { const char *name, *attribute; struct variable *v = NULL; bool complete = false; struct request_data *request; long record = 0; name = get_const_token(parser, false); while( (attribute = get_const_token(parser, true)) != NULL ) { if( strcmp(attribute, "ALIASES") == 0 ) { const char *t = get_const_token(parser, false); v = find_variable(parser, vt_request, t); if( v == NULL ) return; } else if( strcmp(attribute, "TRANSFER") == 0 || strcmp(attribute, "transfer") == 0 ) { char *e; attribute = get_const_token(parser, false); if( attribute == NULL ) return; record = strtoll(attribute, &e, 10); if( *e != '\0' || record > 30 || record <= 0 ) error(parser, "Parse error: invalid number after 'transfer'!"); } else if( strncmp(attribute, "TRANSFER=", 9) == 0 || strncmp(attribute, "transfer=", 9) == 0 ) { char *e; record = strtoll(attribute + 9, &e, 10); if( *e != '\0' || record > 30 || record <= 0 ) error(parser, "Parse error: invalid number after 'transfer='!"); } else { error(parser, "Unknown REQUEST attribute '%s'!", attribute); return; } } if( v != NULL ) { complete = true; if( !add_variable(parser, "", name, &name, v) ) return; } else { v = add_var(parser, "", name, &name, vt_request); if( v == NULL ) return; } request = find_request(parser, name); if( template ) { if( request != NULL ) { error(parser, "'%s' is already listed in REQUESTS, thus cannot be a template!", name); return; } if( record > 0 ) { error(parser, "TRANSFER not possible for templated"); return; } } else { if( request == NULL ) { error(parser, "Unknow request '%s'! (Must be listed in REQUESTS or use templateREQUEST", name); return; } if( request->request != NULL ) { error(parser, "Multiple definition of request '%s::%s'!", parser->current->namespace->name, name); } if( request->unsupported ) { error(parser, "Unexpected definition of unsupported request '%s::%s'!", parser->current->namespace->name, name); } if( record > 0 ) { if( !request->has_response ) { error(parser, "TRANSFER only possible if it RESPONDS!"); return; } request->record_variables = record; } request->request = v; v->refcount ++; } if( !complete ) parse_parameters(parser, v, false); } static void parse_setup(struct parser *parser) { const char *attribute; struct variable *v = NULL; struct namespace *n = parser->current->namespace; assert( n != NULL ); if( n->extension != NULL || strcmp(n->name, "core") != 0 ) { error(parser, "'SETUP' only allowed in namespace 'core'!"); return; } if( n->setup != NULL ) { error(parser, "multiple 'SETUP' in the same namespace!"); return; } while( (attribute = get_const_token(parser, true)) != NULL ) { error(parser, "Unknown SETUP attribute '%s'!", attribute); return; } v = add_var(parser, "", "setup", NULL, vt_setup); if( v == NULL ) return; n->setup = v; v->refcount ++; parse_parameters(parser, v, false); } static void parse_response(struct parser *parser, bool template) { const char *name, *attribute; struct variable *v = NULL; bool complete = false; name = get_const_token(parser, false); while( (attribute = get_const_token(parser, true)) != NULL ) { if( strcmp(attribute, "ALIASES") == 0 ) { const char *t = get_const_token(parser, false); v = find_variable(parser, vt_response, t); if( v == NULL ) return; } else { error(parser, "Unknown RESPONSE attribute '%s'!", attribute); return; } } if( v != NULL ) { complete = true; if( !add_variable(parser, "", name, &name, v) ) return; } else { v = add_var(parser, "", name, &name, vt_response); if( v == NULL ) return; } if( ! template ) { struct request_data *request; request = find_request(parser, name); if( request == NULL ) return; if( !request->has_response ) { error(parser, "Unexpected response '%s' (must be listed in REQUESTS with RESPONDS!)", name); } if( request->response != NULL ) { error(parser, "Multiple definition of response '%s::%s'!", parser->current->namespace->name, name); } if( request->unsupported ) { error(parser, "Unexpected definition of unsupported response '%s::%s'!", parser->current->namespace->name, name); } request->response = v; v->refcount ++; } if( !complete ) parse_parameters(parser, v, false); } static struct event_data *find_event(struct parser *parser, enum event_type et, const char *name) { struct namespace *n = parser->current->namespace; struct event_data *e; int i, num = n->num_events[et]; if( parser->error ) return NULL; if( n->events[et] == NULL || num <= 0 ) { return NULL; } for( i = 0, e = n->events[et] ; i < num ; i++, e++ ) { if( e->name == NULL ) continue; if( strcmp(name, e->name) == 0 ) return e; } return NULL; } static void parse_events(struct parser *parser, enum event_type et) { struct namespace *n = parser->current->namespace; long firstline = parser->current->lineno; assert( n != NULL ); if( n->extension == NULL && strcmp(n->name, "core") != 0 ) { error(parser, "'%sEVENTS' only allowed in extension or namespace 'core'!", (et==event_xge)?"XG":""); return; } if( n->events[et] != NULL || n->num_events[et] != 0 ) { error(parser, "multiple '%sEVENTS' in the same namespace!", (et==event_xge)?"XG":""); return; } while( get_next_line(parser, firstline) ) { const char *name; const char *attribute; struct event_data event, *newevents; memset(&event, 0, sizeof(event)); /* TODO: allow excplicit setting */ event.number = n->num_events[et]; name = get_const_token(parser, false); if( name == NULL ) break; if( strcmp(name, "EOF") == 0 ) { error(parser, "Missing 'END' (expected since line %ld)!", firstline + 1); return; } if( strcmp(name, "END") == 0 ) { return; } if( strcmp(name, "UNKNOWN") == 0 ) { event.unsupported = true; event.name = NULL; } else { event.name = string_add(name); if( event.name == NULL ) { parser->error = true; return; } } while( (attribute = get_const_token(parser, true)) != NULL ) { if( strcmp(attribute, "SPECIAL") == 0 ) { if( event.name == NULL ) error(parser, "SPECIAL not possible with UNKNOWN!"); event.special = true; } else if( strcmp(attribute, "UNSUPPORTED") == 0 ) event.unsupported = true; else if( attribute[0] == '/' && attribute[1] == '*' ) { char *e; long l; if( attribute[2] == '\0' ) attribute = get_const_token(parser, false); else attribute += 2; if( attribute == NULL ) break; l = strtol(attribute, &e, 0); if( *e == '\0' ) attribute = get_const_token(parser, false); else attribute = e; if( attribute == NULL || attribute[0] != '*' || attribute[1] != '/' ) error(parser, "Parse error, '/*' only allowed as '/* number */'!"); else if( event.number != l ) error(parser, "Event '%s' is %d but asserted to be %ld", name, event.number, l); } else { error(parser, "Unexpected response attribute '%s'!", attribute); } } newevents = realloc(n->events[et], sizeof(struct event_data)*(n->num_events[et]+1)); if( newevents == NULL ) { oom(parser); break; } n->events[et] = newevents; newevents[n->num_events[et]] = event; n->num_events[et]++; } } static void parse_event(struct parser *parser, bool template, enum event_type et) { const char *name, *attribute; struct variable *v = NULL; bool complete = false; struct event_data *event; name = get_const_token(parser, false); while( (attribute = get_const_token(parser, true)) != NULL ) { if( strcmp(attribute, "ALIASES") == 0 ) { const char *t = get_const_token(parser, false); v = find_variable(parser, vt_event, t); if( v == NULL ) return; } else { error(parser, "Unknown EVENT attribute '%s'!", attribute); return; } } if( v != NULL ) { complete = true; if( !add_variable(parser, "", name, &name, v) ) return; } else { v = add_var(parser, "", name, &name, vt_event); if( v == NULL ) return; } event = find_event(parser, et, name); if( template ) { if( event != NULL ) { error(parser, "'%s' cannot be the name for a templateEvent as it is already the name for an event in EVENTS or XGEVENTS!\n", name); return; } } else { if( event == NULL ) { error(parser, "%sEVENT '%s' not listed in previous %sEVENTS!\n", (et == event_xge)?"XG":"", name, (et == event_xge)?"XG":""); return; } event->event = v; v->refcount ++; } if( !complete ) parse_parameters(parser, v, false); } static void add_namespace(struct parser *parser, const char *namespace, const char *extension ) { struct namespace *n; if( parser->error ) return; assert(parser->current != NULL ); assert(parser->current->namespace == NULL ); n = parser->namespaces; while( n != NULL && strcmp(n->name, namespace) != 0 ) n = n->next; if( n != NULL ) { if( n->extension != NULL && extension != NULL ) { error(parser, "Redefinition of extension in namespace '%s'!", namespace); return; } if( extension != NULL ) { n->extension = strdup(extension); if( n->extension == NULL ) { oom(parser); return; } } n->refcount++; parser->current->namespace = n; return; } n = calloc(1, sizeof(struct namespace)); if( n == NULL ) { oom(parser); return; } n->name = strdup(namespace); if( n->name == NULL ) { oom(parser); free(n); return; } if( extension != NULL ) { n->extension = strdup(extension); if( n->extension == NULL ) { oom(parser); free(n->name); free(n); return; } } n->refcount = 1; parser->current->namespace = n; n->next = parser->namespaces; parser->namespaces = n; } static void parse_struct(struct parser *parser, bool list) { const char *name, *modifier; bool have_length = false, isvariable = false; struct variable *v, *vl, *vt = NULL; struct unfinished_parameter *p; size_t length = 0; name = get_const_token(parser, false); v = add_var(parser, "", name, &name, vt_struct); vl = add_var(parser, "LISTof", name, NULL, vt_type); if( !v || !vl ) return; vl->t.data = v; v->refcount++; if( !list ) { vt = add_var(parser, "", name, NULL, vt_type); vt->t.data = v; v->refcount++; } while( (modifier = get_const_token(parser, have_length)) != NULL ) { if( strcmp(modifier, "variable") == 0 ) { if( have_length ) { error(parser, "variable keyword not allowed after length keyword!"); } if( !list ) { error(parser, "variable keyword not yet allowed for STRUCT, only for LIST!"); } isvariable = true; } else if( strcmp(modifier, "length") == 0 ) { if( isvariable ) error(parser, "variable STRUCTs have no length, use min-length instead!"); modifier = get_const_token(parser, false); length = parse_number(parser, modifier); have_length = true; } else if( strcmp(modifier, "min-length") == 0 ) { if( !isvariable ) error(parser, "min-length only allowed after variable keyword!"); modifier = get_const_token(parser, false); length = parse_number(parser, modifier); if( length == 0 ) { error(parser, "min-length 0 currently not supported to avoid endless loops.\nIf you find a case where it is needed, let me know."); } have_length = true; } else { error(parser, "Unknown attribute '%s'", modifier); } } if( !have_length ) { if( isvariable ) error(parser, "Missing min-length statement!"); else error(parser, "Missing length statement!"); } if( isvariable ) { vl->t.base_type = &base_type_list_of_varstruct; // if( !list ) // vt->t.base_type = &base_type_varstruct; } else { vl->t.base_type = &base_type_list_of_struct; if( !list ) vt->t.base_type = &base_type_struct; } parse_parameters(parser, v, isvariable); /* add (min-)length information: */ p = calloc(1, sizeof(*p)); if( p == NULL ) { oom(parser); return; } p->next = v->parameter; v->parameter = p; p->isspecial = true; p->special.offse = length; } static void parse_type(struct parser *parser) { const char *name; struct variable *v; name = get_const_token(parser, false); v = add_var(parser, "", name, &name, vt_type); if( v == NULL ) return; parse_typespec(parser, &v->t); } static void parse_requests(struct parser *parser) { struct namespace *n = parser->current->namespace; long firstline = parser->current->lineno; assert( n != NULL ); if( n->extension == NULL && strcmp(n->name, "core") != 0 ) { error(parser, "'REQUESTS' only allowed in extension or namespace 'core'!"); return; } if( n->requests != NULL || n->num_requests != 0 ) { error(parser, "multiple 'REQUESTS' in the same namespace!"); return; } while( get_next_line(parser, firstline) ) { const char *name; const char *attribute; struct request_data request, *r; memset(&request, 0, sizeof(request)); /* TODO: allow excplicit setting */ request.number = n->num_requests; name = get_const_token(parser, false); if( name == NULL ) break; if( strcmp(name, "EOF") == 0 ) { error(parser, "Missing 'END' (expected since line %ld)!", firstline + 1); return; } if( strcmp(name, "END") == 0 ) { return; } if( strcmp(name, "UNKNOWN") == 0 ) { request.unsupported = true; request.name = NULL; } else { request.name = string_add(name); if( request.name == NULL ) { parser->error = true; return; } } while( (attribute = get_const_token(parser, true)) != NULL ) { if( strcmp(attribute, "RESPONDS") == 0 ) request.has_response = true; else if( strcmp(attribute, "SPECIAL") == 0 ) { if( request.name == NULL ) error(parser, "SPECIAL not possible with UNKNOWN!"); request.special = true; } else if( strcmp(attribute, "UNSUPPORTED") == 0 ) request.unsupported = true; else if( attribute[0] == '/' && attribute[1] == '*' ) { char *e; long l; if( attribute[2] == '\0' ) attribute = get_const_token(parser, false); else attribute += 2; if( attribute == NULL ) break; l = strtol(attribute, &e, 0); if( *e == '\0' ) attribute = get_const_token(parser, false); else attribute = e; if( attribute == NULL || attribute[0] != '*' || attribute[1] != '/' ) error(parser, "Parse error, '/*' only allowed as '/* number */'!"); else if( request.number != l ) error(parser, "Request '%s' is %d but asserted to be %ld", name, request.number, l); } else { error(parser, "Unexpected response attribute '%s'!", attribute); } } r = realloc(n->requests, sizeof(struct request_data)*(n->num_requests+1)); if( r == NULL ) { oom(parser); break; } n->requests = r; r[n->num_requests] = request; n->num_requests++; } } static void parse_constants(struct parser *parser, bool bitmasks) { struct namespace *n = parser->current->namespace; long firstline = parser->current->lineno; const char *valuesname; size_t count = 0; struct constant *constants; struct variable *v; assert( n != NULL ); valuesname = get_const_token(parser, false); no_more_arguments(parser); v = add_var(parser, "", valuesname, &valuesname, vt_constants); if( v == NULL ) return; constants = malloc(sizeof(struct constant)*8); if( constants == NULL ) { oom(parser); return; } while( get_next_line(parser, firstline) ) { const char *value; const char *text; unsigned long number; int j; value = get_const_token(parser, false); if( value == NULL ) break; if( strcmp(value, "END") == 0 ) { struct constant *nc; nc = realloc(constants, sizeof(struct constant)*(count+1)); if( nc == NULL ) { oom(parser); break; } constants = nc; constants[count].name = NULL; constants[count].value = 0; v->c.constants = constants; v->c.size = sizeof(struct constant)*(count+1); v->c.bitmask = bitmasks; return; } if( strcmp(value, "EOF") == 0 ) { error(parser, "Missing 'END' (for values opened at %ld)!", firstline + 1); break; } number = parse_number(parser, value); text = get_const_token(parser, false); constants[count].value = number; no_more_arguments(parser); constants[count].name = string_add(text); if( bitmasks && constants[count].value == 0 ) error(parser, "Value 0 is not allowed in a BITMASK field!"); for( j = 0 ; (size_t)j < count ; j++ ) { if( constants[count].value == constants[j].value ) { error(parser, "'%s' and '%s' have the same value in '%s'\n", constants[count].name, constants[j].name, valuesname); } if( bitmasks && (constants[count].value && ~constants[j].value) == 0 ) { error(parser, "'%s' shadowed by '%s' in BITMASK '%s'\n", constants[count].name, constants[j].name, valuesname); } } count++; if( (count & 7) == 0 ) { struct constant *nc; nc = realloc(constants, sizeof(struct constant)*(count+8)); if( nc == NULL ) { oom(parser); break; } constants = nc; } } /* some error happened */ free(constants); } static void parse_values(struct parser *parser) { struct namespace *n = parser->current->namespace; long first_line = parser->current->lineno; const char *valuesname; struct variable *v, *lv; struct unfinished_value *values = NULL, **last_val = &values; assert( n != NULL ); valuesname = get_const_token(parser, false); no_more_arguments(parser); v = add_var(parser, "", valuesname, &valuesname, vt_values); lv = add_var(parser, "LISTof", valuesname, NULL, vt_type); if( v == NULL || lv == NULL ) return; lv->t.base_type = &base_type_list_of_value; lv->t.data = v; v->refcount++; v->values = NULL; while( get_next_line(parser, first_line) ) { struct unfinished_value *nv; const char *mask, *name; unsigned long number; struct typespec type; mask = get_const_token(parser, false); if( strcmp(mask, "EOF") == 0 ) { error(parser, "Missing 'END' (closing VALUES opened at line %ld)!", first_line + 1); break; } if( strcmp(mask, "END") == 0 ) { no_more_arguments(parser); if( values == NULL ) { error(parser, "Empty VALUES information!"); return; } v->values = values; return; } number = parse_number(parser, mask); name = get_const_token(parser, false); if( name == NULL ) break; name = string_add(name); if( name == NULL ) { parser->error = true; break; } memset(&type, 0, sizeof(type)); parse_typespec(parser, &type); /* LISTofVALUES only supports some types */ if( !C(type.base_type, ELEMENTARY) ) error(parser, "Only elementary types allowed in VALUES (%s is not)!", type.base_type->name); nv = malloc(sizeof(struct unfinished_value)); if( nv == NULL ) oom(parser); if( parser->error ) { typespec_done(&type); break; } nv->flag = number; nv->name = name; nv->type = type; nv->next = NULL; *last_val = nv; last_val = &nv->next; } error(parser, "missing END!"); while( values != NULL ) { struct unfinished_value *nv = values->next; typespec_done(&values->type); free(values); values = nv; } } static void parse_use(struct parser *parser) { const char *name; struct namespace *ns = parser->current->namespace; while( (name = get_const_token(parser, true)) != NULL ) { struct namespace *n, **nn = realloc(ns->used, sizeof(struct namespace*) * (ns->used_count+1)); if( nn == NULL ) { oom(parser); return; } ns->used = nn; for( n = parser->namespaces ; n != NULL ; n = n->next ) { if( strcmp(n->name, name) == 0 ) break; } // TODO: check if the used namespace is defined // in one of the needed files... ns->used[ns->used_count++] = n; if( n == NULL ) { error(parser, "Unknown namespace '%s'!", name); return; } } } static void check_namespace_complete(struct parser *parser) { struct namespace *n = parser->current->namespace; if( n->requests != NULL ) { int i; for( i = 0 ; i < n->num_requests ; i++ ) { const struct request_data *r = &n->requests[i]; if( r->name == NULL ) continue; if( !r->unsupported && r->request == NULL ) error(parser, "Expected 'REQUEST %s'!", r->name); if( !r->unsupported && r->has_response && r->response == NULL ) error(parser, "Expected 'RESPONSE %s'!", r->name); } } if( n->events[event_normal] != NULL ) { int i; for( i = 0 ; i < n->num_events[event_normal] ; i++ ) { const struct event_data *e = &n->events[event_normal][i]; if( e->name == NULL ) continue; if( !e->unsupported && e->event == NULL ) error(parser, "Missing 'EVENT %s'!", e->name); } } if( n->events[event_xge] != NULL ) { int i; for( i = 0 ; i < n->num_events[event_xge] ; i++ ) { const struct event_data *e = &n->events[event_xge][i]; if( e->name == NULL ) continue; if( !e->unsupported && e->event == NULL ) error(parser, "Missing 'XGEVENT %s'!", e->name); } } } struct parser *parser_init(void) { return calloc(1, sizeof(struct parser)); } bool translate(struct parser *parser, const char *name) { open_next_file(parser, strdup(name)); while( get_next_line(parser, -1) ) { size_t l; char *command; command = get_token_with_len(parser, &l); if( command == NULL ) break; if( command_is("EOF") ) { no_more_arguments(parser); if( parser->current->namespace != NULL ) { check_namespace_complete(parser); } if( file_done(parser) ) return true; } else if( command_is("NEEDS") ) { char *filename = get_token(parser, false); no_more_arguments(parser); open_next_file(parser, filename); } else if( command_is("EXTENSION") ) { if( parser->current->namespace != NULL ) error(parser, "Only one EXTENSION or NAMESPACE is allowed in each file!"); else { const char *extension, *n; extension = get_const_token(parser, false); n = get_const_token(parser, false); no_more_arguments(parser); add_namespace(parser, n, extension); } } else if( command_is("NAMESPACE") ) { if( parser->current->namespace != NULL ) error(parser, "Only one EXTENSION or NAMESPACE is allowed in each file!"); else { name = get_const_token(parser, false); no_more_arguments(parser); add_namespace(parser, name, NULL); } } else if( parser->current->namespace == NULL ) { error(parser, "First command must be EXTENSION or NAMESPACE!"); } else if( command_is("USE") ) { parse_use(parser); } else if( command_is("SETUP") ) { parse_setup(parser); } else if( command_is("REQUESTS") ) { parse_requests(parser); } else if( command_is("EVENTS") ) { parse_events(parser, event_normal); } else if( command_is("XGEVENTS") ) { parse_events(parser, event_xge); } else if( command_is("ERRORS") ) { parse_errors(parser); } else if( command_is("TYPE") ) { parse_type(parser); } else if( command_is("VALUES") ) { parse_values(parser); } else if( command_is("STRUCT") ) { parse_struct(parser, false); } else if( command_is("LIST") ) { parse_struct(parser, true); } else if( command_is("CONSTANTS") ) { parse_constants(parser, false); } else if( command_is("BITMASK") ) { parse_constants(parser, true); } else if( command_is("templateRESPONSE") ) { parse_response(parser, true); } else if( command_is("RESPONSE") ) { parse_response(parser, false); } else if( command_is("templateREQUEST") ) { parse_request(parser, true); } else if( command_is("REQUEST") ) { parse_request(parser, false); } else if( command_is("templateEVENT") ) { parse_event(parser, true, event_normal); } else if( command_is("EVENT") ) { parse_event(parser, false, event_normal); } else if( command_is("XGEVENT") ) { parse_event(parser, false, event_xge); } else { error(parser, "Unknown command '%s'\n", command); } } return false; } static void free_varname(void *nodep) { struct varname *vn = nodep; variable_unref(vn->variable); free(vn); } bool parser_free(struct parser *parser) { bool success = !parser->error; file_free(parser->current); while( parser->namespaces != NULL ) { struct namespace *ns = parser->namespaces; parser->namespaces = ns->next; int i; enum variable_type vt; assert( ns->refcount == 0 ); for( vt = 0 ; vt < vt_COUNT ; vt ++ ) { tdestroy(ns->variables[vt], free_varname); } free(ns->name); free(ns->extension); for( i = 0 ; i < ns->num_requests ; i++ ) { variable_unref(ns->requests[i].request); variable_unref(ns->requests[i].response); } free(ns->requests); for( i = 0 ; i < ns->num_events[event_normal] ; i++ ) { variable_unref(ns->events[event_normal][i].event); } for( i = 0 ; i < ns->num_events[event_xge] ; i++ ) { variable_unref(ns->events[event_xge][i].event); } if( ns->setup != NULL ) variable_unref(ns->setup); free(ns->events[event_normal]); free(ns->events[event_xge]); free(ns->errors); free(ns->used); free(ns); } while( parser->searchpath != NULL ) { struct searchpath_entry *e = parser->searchpath; parser->searchpath = e->next; free(e); } parser->current = NULL; free(parser); return success; } static void variable_finalize(struct parser *, struct variable *, union parameter_option *); static const struct parameter *parameter_finalize(struct parser *parser, struct unfinished_parameter *parameter) { struct unfinished_parameter *p; size_t count = 0; struct parameter *prepared, *f; const struct parameter *finalized; /* no need to do add empty ones all the time, just take the last one... */ static const struct parameter *empty = NULL; if( parameter == NULL && empty != NULL ) { return empty; } for( p = parameter ; p != NULL ; p = p->next ) { count++; assert( !p->isspecial || !p->special.isjunction || p->special.finalized != NULL ); } prepared = calloc(count + 1, sizeof(struct parameter)); if( prepared == NULL ) { oom(parser); return NULL; } for( f = prepared, p = parameter ; p != NULL ; p = p->next, f++ ) { assert( (size_t)(f - prepared) < count ); if( p->isspecial ) { f->offse = p->special.offse; f->name = p->special.condition; f->type = p->special.type; f->o.parameters = p->special.finalized; } else { f->offse = p->regular.offse; f->name = p->regular.name; f->type = p->regular.type.base_type->type; variable_finalize(parser, p->regular.type.data, &f->o); } } assert( (size_t)(f - prepared) == count ); finalized = finalize_data(prepared, (count + 1)*sizeof(struct parameter), __alignof__(struct parameter)); free(prepared); /* remember last terminator as next empty jump target */ empty = finalized; empty += count; return finalized; } static const struct parameter *parameters_finalize(struct parser *parser, struct variable *v) { struct unfinished_parameter *p, *todo, *startat; if( v == NULL ) return NULL; assert( v->type == vt_struct || v->type == vt_response || v->type == vt_setup || v->type == vt_request || v->type == vt_event ); if( v->finalized.parameters != NULL ) return v->finalized.parameters; do { todo = NULL; startat = v->parameter; p = startat; while( p != NULL ) { if( !p->isspecial ) { p = p->next; continue; } if( p->special.finalized != NULL ) { p = p->next; continue; } if( !p->special.isjunction ) { p = p->next; continue; } if( p->special.iftrue == NULL ) { /* empty branch still needs an end command, but no recursion for that */ p->special.finalized = parameter_finalize(parser, NULL); p = p->next; continue; } todo = p; startat = p->special.iftrue; p = startat; } if( todo != NULL ) { todo->special.finalized = parameter_finalize(parser, startat); } else { v->finalized.parameters = parameter_finalize(parser, startat); } } while( todo != NULL ); return v->finalized.parameters; } static const struct constant *constants_finalize(struct parser *parser, struct variable *v) { if( v == NULL ) return NULL; assert( v->type == vt_constants ); if( v->finalized.constants != NULL ) return v->finalized.constants; v->finalized.constants = finalize_data(v->c.constants, v->c.size, __alignof__(struct constant)); if( v->finalized.constants == NULL ) parser->error = true; return v->finalized.constants; } static inline const struct value *values_finalize(struct parser *parser, struct variable *v) { struct value *values; struct unfinished_value *uv; size_t i = 0, count = 0; if( v == NULL ) return NULL; assert( v->type == vt_values ); if( v->finalized.values != NULL ) return v->finalized.values; for( uv = v->values; uv != NULL ; uv = uv->next ) count++; values = calloc(count + 1, sizeof(struct value)); if( values == NULL ) { oom(parser); return NULL; } for( uv = v->values; uv != NULL ; uv = uv->next ) { assert( i < count); values[i].flag = uv->flag; values[i].name = uv->name; assert( C(uv->type.base_type, ELEMENTARY) ); values[i].type = uv->type.base_type->type; values[i].constants = constants_finalize( parser, uv->type.data); i++; } v->finalized.values = finalize_data(values, (count+1)*sizeof(struct value), __alignof__(struct value)); free(values); if( v->finalized.values == NULL ) parser->error = true; return v->finalized.values; } static void variable_finalize(struct parser *parser, struct variable *v, union parameter_option *o) { if( v == NULL ) { memset(o, 0, sizeof(union parameter_option)); } else if( v->type == vt_values ) { o->values = values_finalize(parser, v); } else if( v->type == vt_constants ) { o->constants = constants_finalize(parser, v); } else if( v->type == vt_struct || v->type == vt_response || v->type == vt_setup || v->type == vt_request || v->type == vt_event ) { o->parameters = parameters_finalize(parser, v); } else { memset(o, 0, sizeof(union parameter_option)); assert( v->type != v->type ); } } static const struct request *finalize_requests(struct parser *parser, struct namespace *ns, const struct parameter *unknownrequest, const struct parameter *unknownresponse) { struct request *rs; const struct request *f; int i; rs = calloc(ns->num_requests, sizeof(struct request)); if( rs == NULL ) { oom(parser); return NULL; } for( i = 0 ; i < ns->num_requests ; i++ ) { rs[i].name = ns->requests[i].name; if( ns->requests[i].unsupported ) { assert( ns->requests[i].request == NULL); rs[i].parameters = unknownrequest; } else { assert( ns->requests[i].request != NULL); rs[i].parameters = parameters_finalize(parser, ns->requests[i].request); } if( ns->requests[i].has_response ) { if( ns->requests[i].unsupported ) { assert( ns->requests[i].response == NULL); rs[i].answers = unknownresponse; } else { assert( ns->requests[i].response != NULL); rs[i].answers = parameters_finalize(parser, ns->requests[i].response); } } else assert( ns->requests[i].response == NULL); rs[i].record_variables = ns->requests[i].record_variables; if( !ns->requests[i].special ) continue; assert( rs[i].name != NULL ); if( strcmp(ns->name, "core") != 0 ) { fprintf(stderr, "No specials available in namespace '%s'!\n", ns->name); parser->error = true; } else if( strcmp(rs[i].name, "QueryExtension") == 0 ) { rs[i].request_func = requestQueryExtension; rs[i].reply_func = replyQueryExtension; } else if( strcmp(rs[i].name, "InternAtom") == 0 ) { /* atoms are not the only names, in the future that might be something general... */ rs[i].request_func = requestInternAtom; rs[i].reply_func = replyInternAtom; } else if( strcmp(rs[i].name, "ListFontsWithInfo") == 0 ) { /* this should be changed to a general approach */ rs[i].reply_func = replyListFontsWithInfo; } else { fprintf(stderr, "No specials available for '%s::%s'!\n", ns->name, rs[i].name); parser->error = true; } } f = finalize_data(rs, ns->num_requests * sizeof(struct request), __alignof__(struct request)); if( f == NULL ) parser->error = true; free(rs); return f; } static const struct event *finalize_events(struct parser *parser, struct namespace *ns, enum event_type et) { struct event *es; const struct event *f; int i; es = calloc(ns->num_events[et], sizeof(struct event)); if( es == NULL ) { oom(parser); return NULL; } for( i = 0 ; i < ns->num_events[et] ; i++ ) { es[i].name = ns->events[et][i].name; es[i].parameters = parameters_finalize(parser, ns->events[et][i].event); if( !ns->events[et][i].special ) continue; assert( es[i].name != NULL ); if( strcmp(ns->name, "ge") != 0 && strcmp(ns->name, "core") != 0) { fprintf(stderr, "No specials available in namespace '%s'!\n", ns->name); parser->error = true; } else if( strcmp(es[i].name, "Generic") == 0 ) { es[i].type = event_xge; } else { fprintf(stderr, "No specials available for '%s::%s'!\n", ns->name, es[i].name); parser->error = true; } } f = finalize_data(es, ns->num_events[et] * sizeof(struct event), __alignof__(struct event)); if( f == NULL ) parser->error = true; free(es); return f; } void finalize_everything(struct parser *parser) { struct extension *es, *e; size_t count = 0; struct namespace *ns, *core = NULL; struct variable *v; const struct parameter *unknownrequest, *unknownresponse; if( parser->error ) return; assert( extensions == NULL /* only to be called one time */ ); for( ns = parser->namespaces ; ns != NULL ; ns = ns->next ) { if( strcmp(ns->name, "core") == 0 ) core = ns; if( ns->extension != NULL ) count++; } if( core == NULL ) { fputs("No core namespace defined!\n", stderr); parser->error = true; return; } if( core->num_requests == 0 ) { fputs("No core requests defined!\n", stderr); parser->error = true; return; } if( core->num_events[event_normal] == 0 ) { fputs("No core events defined!\n", stderr); parser->error = true; return; } if( core->num_events[event_xge] != 0 ) { fputs("Generic Events (XGE) outside of extensions not yet supported!\n", stderr); parser->error = true; return; } if( core->num_errors == 0 ) { fputs("No core errors defined!\n", stderr); parser->error = true; return; } if( core->setup == NULL ) { fputs("No setup parser defined!\n", stderr); parser->error = true; return; } v = find_variable(parser, vt_request, "core::unknown"); unknownrequest = parameters_finalize(parser, v); v = find_variable(parser, vt_response, "core::unknown"); unknownresponse = parameters_finalize(parser, v); unexpected_reply = unknownresponse; if( parser->error ) return; if( count == 0 ) { num_extensions = count; extensions = NULL; return; } else { es = calloc(count, sizeof(struct extension)); if( es == NULL ) { oom(parser); return; } e = es; for( ns = parser->namespaces ; ns != NULL ; ns = ns->next ) { if( ns->extension == NULL ) continue; e->name = string_add(ns->extension); if( e->name == NULL ) parser->error = true; e->namelen = strlen(ns->extension); e->numsubrequests = ns->num_requests; e->subrequests = finalize_requests(parser, ns, unknownrequest, unknownresponse); e->numevents = ns->num_events[event_normal]; e->events = finalize_events(parser, ns, event_normal); e->numxgevents = ns->num_events[event_xge]; e->xgevents = finalize_events(parser, ns, event_xge); e->numerrors = ns->num_errors; e->errors = finalize_data(ns->errors, ns->num_errors*sizeof(const char*), __alignof__(const char*)); if( e->errors == NULL ) parser->error = true; e++; } assert( (size_t)(e-es) == count ); extensions = finalize_data(es, count*sizeof(struct extension), __alignof__(struct extension)); free(es); if( extensions == NULL ) { oom(parser); return; } num_extensions = count; } requests = finalize_requests(parser, core, unknownrequest, unknownresponse); num_requests = core->num_requests; events = finalize_events(parser, core, event_normal); num_events = core->num_events[event_normal]; errors = finalize_data(core->errors, core->num_errors*sizeof(const char*), __alignof__(const char*)); if( errors == NULL ) parser->error = true; num_errors = core->num_errors; setup_parameters = parameters_finalize(parser, core->setup); } /* int main() { bool success; struct parser *parser; stringlist_init(); parser = parser_init(parser); if( parser == NULL ) exit(EXIT_FAILURE); translate(&parser, "all.proto"); finalize_everything(parser); success = parser_free(parser); stringlist_done(); return success?EXIT_SUCCESS:EXIT_FAILURE; } */ xtrace-1.3.1/translate.h0000644000175100017510000000044211704002604012065 00000000000000#ifndef XTRACE_TRANSLATE_H #define XTRACE_TRANSLATE_H struct parser; void finalize_everything(struct parser *); struct parser *parser_init(void); void add_searchpath(struct parser *, const char *); bool translate(struct parser *, const char *); bool parser_free(struct parser *); #endif xtrace-1.3.1/x11client.c0000644000175100017510000000536411704002604011703 00000000000000/* This file is part of "xtrace" * Copyright (C) 2005 Bernhard R. Link * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "xtrace.h" int connectToServer(const char *displayname,int family,const char *hostname,int display) { const char *msg; int fd; fd = socket(family,SOCK_STREAM,0); if( fd < 0 ) { int e = errno; fprintf(stderr,"Error opening socket for '%s': %d=%s\n",displayname,e,strerror(e)); return fd; } if( family == AF_INET ) { struct sockaddr_in addr; struct addrinfo hints; struct addrinfo *res; int tmp=1; int r; memset(&hints,0,sizeof(struct addrinfo)); hints.ai_family = family; hints.ai_socktype = SOCK_STREAM; r = getaddrinfo(hostname, NULL, &hints, &res); if( r != 0 ) { close(fd); fprintf(stderr,"Error resolving hostname '%s' taken from '%s'\nError was: %s\n",hostname,displayname,gai_strerror(r)); return -1; } assert( res->ai_addrlen == sizeof(addr)); memcpy(&addr,res->ai_addr,sizeof(addr)); freeaddrinfo(res); addr.sin_port = calculateTCPport(display); setsockopt(fd,SOL_SOCKET,SO_KEEPALIVE,(char *)&tmp,sizeof(tmp)); if( connect(fd,(struct sockaddr*)&addr,sizeof(addr)) < 0 ) { int e = errno; close(fd); fprintf(stderr,"Error connecting to '%s' (resolved to '%s') for '%s': %d=%s\n",hostname,inet_ntoa(addr.sin_addr),displayname,e,strerror(e)); return -1; } } else { struct sockaddr_un addr; msg = generateSocketName(&addr,display); if( msg != NULL ) { close(fd); fprintf(stderr,"Error calculating socket name for '%s': %s\n",displayname,msg); return -1; } if( connect(fd,(struct sockaddr*)&addr,sizeof(addr)) < 0 ) { int e = errno; close(fd); fprintf(stderr,"Error connecting to unix socket '%s' for '%s': %d=%s\n",addr.sun_path,displayname,e,strerror(e)); return -1; } } return fd; } xtrace-1.3.1/mitshm.proto0000644000175100017510000000644211704002604012313 00000000000000# This file is part of xtrace # Copyright (C) 2006 Bernhard R. Link # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # This file is based on /usr/include/X11/extensions/shmstr.h which states: #Copyright 1989, 1998 The Open Group # #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. # #The above copyright notice and this permission notice 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 #OPEN GROUP 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. # #Except as contained in this notice, the name of The Open Group shall not be #used in advertising or otherwise to promote the sale, use or other dealings #in this Software without prior written authorization from The Open Group. NEEDS "requests.proto" NEEDS "render.proto" EXTENSION "MIT-SHM" Shm USE core REQUESTS QueryVersion RESPONDS Attach Detach PutImage GetImage RESPONDS CreatePixmap END EVENTS Completion END ERRORS BadShmSeg END TYPE ShmSeg CARD32 TYPE Drawable CARD32 TYPE Visualid CARD32 TYPE GContext CARD32 TYPE Pixmap CARD32 TYPE format CARD8 constants core::bitmap_format REQUEST QueryVersion ALIASES Empty RESPONSE QueryVersion 8 major-version UINT16 10 minor-version UINT16 12 uid UINT16 14 gid UINT16 16 pixmap-format format END REQUEST Attach 4 shmseg ShmSeg 8 shmid CARD32 12 readonly BOOL END REQUEST Detach 4 shmseg ShmSeg END REQUEST PutImage 4 drawable Drawable 8 gc GContext 12 total-width UINT16 14 total-height UINT16 16 src-x UINT16 18 src-y UINT16 20 src-width UINT16 22 src-height UINT16 24 dst-x INT16 26 dst-y INT16 28 depth UINT8 29 format format 30 send-event BOOL 32 shmseg ShmSeg 36 offset CARD32 END REQUEST GetImage 4 drawable Drawable 8 x INT16 10 y INT16 12 width UINT16 14 height UINT16 16 planeMask UINT32 20 format format 24 shmseg ShmSeg 28 offset CARD32 END RESPONSE GetImage 8 visual Render::VisualID 12 size UINT32 END REQUEST CreatePixmap 4 pid Pixmap 8 drawable Drawable 12 width UINT16 14 height UINT16 16 depth UINT8 20 shmseg ShmSeg 24 offset CARD32 END EVENT Completion 4 drawable Drawable 12 shmseg ShmSeg 16 offset CARD32 END EOF xtrace-1.3.1/fixes.proto0000644000175100017510000001246511704002604012132 00000000000000# This file is part of "xtrace" # Copyright (C) 2008 Bernhard R. Link # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA NEEDS "render.proto" NEEDS "shape.proto" EXTENSION "XFIXES" Fixes USE core TYPE PICTURE Render::PICTURE REQUESTS QueryVersion RESPONDS ChangeSaveSet SelectSelectionInput SelectCursorInput GetCursorImage RESPONDS CreateRegion CreateRegionFromBitmap CreateRegionFromWindow CreateRegionFromGC CreateRegionFromPicture DestroyRegion SetRegion CopyRegion UnionRegion IntersectRegion SubtractRegion InvertRegion TranslateRegion RegionExtents FetchRegion RESPONDS SetGCClipRegion SetWindowShapeRegion SetPictureClipRegion SetCursorName GetCursorName RESPONDS GetCursorImageAndName RESPONDS ChangeCursor ChangeCursorByName ExpandRegion HideCursor ShowCursor END EVENTS SelectionNotify CursorNotify END ERRORS BadRegion END CONSTANTS fixes_mode 0 insert 1 delete END TYPE FIXES_MODE ENUM8 fixes_mode CONSTANTS fixes_target 0 nearest 1 root END TYPE FIXES_TARGET ENUM8 fixes_target CONSTANTS fixes_map 0 set 1 unset END TYPE FIXES_MAP ENUM8 fixes_map CONSTANTS fixes_region_kind 0 bounding 1 clip END TYPE FIXES_REGION_KIND ENUM8 fixes_region_kind TYPE REGION CARD32 BITMASK fixes_mask 0x00000001 "owner notify" 0x00000002 "destroy notify" 0x00000004 "client close notify" END TYPE FIXES_MASK BITMASK32 fixes_mask CONSTANTS fixes_subtype 0 "set owner" 1 destroy 2 "client close" END TYPE FIXES_SUBTYPE ENUM8 fixes_subtype BITMASK fixes_cursor_mask 0x00000001 "display cursor notify" END TYPE FIXES_CURSOR_MASK BITMASK32 fixes_cursor_mask CONSTANTS fixes_cursor_subtype 0 "display cursor" END TYPE FIXES_CURSOR_SUBTYPE ENUM8 fixes_cursor_subtype REQUEST QueryVersion 4 "major version" UINT32 8 "minor version" UINT32 END RESPONSE QueryVersion 8 "major version" UINT32 12 "minor version" UINT32 END REQUEST ChangeSaveSet 4 mode FIXES_MODE 5 target FIXES_TARGET 6 map FIXES_MAP 8 window WINDOW END REQUEST SelectSelectionInput 4 window WINDOW 8 selection ATOM 12 eventMask FIXES_MASK END REQUEST SelectCursorInput 4 window WINDOW 8 eventMask FIXES_CURSOR_MASK END REQUEST GetCursorImage ALIASES Empty RESPONSE GetCursorImage 8 x INT16 10 y INT16 12 width UINT16 14 height UINT16 16 xhot UINT16 18 yhot UINT16 20 "cursor serial" CARD32 END REQUEST CreateRegion 4 region REGION 8 rectangles LISTofRECTANGLE END REQUEST CreateRegionFromBitmap 4 region REGION 8 bitmap PIXMAP END REQUEST CreateRegionFromWindow 4 region REGION 8 window WINDOW 12 kind FIXES_REGION_KIND END REQUEST CreateRegionFromGC 4 region REGION 8 gc GCONTEXT END REQUEST CreateRegionFromPicture 4 region REGION 8 picture PICTURE END templateREQUEST Region 4 region REGION END REQUEST DestroyRegion ALIASES Region REQUEST SetRegion ALIASES Region REQUEST CopyRegion 4 src-region REGION 8 dst-region REGION END templateREQUEST CombineRegion 4 region1 REGION 8 region2 REGION 12 dst-region REGION END REQUEST UnionRegion ALIASES CombineRegion REQUEST IntersectRegion ALIASES CombineRegion REQUEST SubtractRegion ALIASES CombineRegion REQUEST InvertRegion 4 src-region REGION 8 x INT16 10 y INT16 12 width UINT16 14 height UINT16 16 dst-region REGION END REQUEST TranslateRegion 4 region REGION 8 delta-x INT16 10 delta-y INT16 END REQUEST RegionExtents ALIASES CopyRegion REQUEST FetchRegion ALIASES Region RESPONSE FetchRegion 8 x INT16 10 y INT16 12 width UINT16 14 height UINT16 32 rects LISTofRECTANGLE END REQUEST SetGCClipRegion 4 gc GCONTEXT 8 region REGION 12 "x origin" INT16 14 "y origin" INT16 END REQUEST SetWindowShapeRegion 4 window WINDOW 8 kind Shape::SHAPE_KIND 12 "x offset" INT16 14 "y offset" INT16 16 region REGION END REQUEST SetPictureClipRegion 4 picture PICTURE 8 region REGION 12 "x origin" INT16 14 "y origin" INT16 END REQUEST SetCursorName 4 cursor CARD32 8 "" COUNT16 12 name STRING8 END REQUEST GetCursorName 4 cursor CARD32 END RESPONSE GetCursorName 8 atom ATOM 12 "" COUNT16 32 name STRING8 END REQUEST GetCursorImageAndName ALIASES Empty RESPONSE GetCursorImageAndName 8 x INT16 10 y INT16 12 width UINT16 14 height UINT16 16 xhot UINT16 18 yhot UINT16 20 "cursor serial" CARD32 24 "cursor name" ATOM 28 "" COUNT16 32 name STRING8 # cursor image?? END REQUEST ChangeCursor 4 src-cursor CARD32 8 dst-cursor CARD32 END REQUEST ChangeCursorByName 4 src-cursor CARD32 8 "" COUNT16 12 name STRING8 END REQUEST ExpandRegion 4 src-region REGION 8 dst-region REGION 12 left UINT16 14 right UINT16 16 top UINT16 18 bottom UINT16 END REQUEST HideCursor ALIASES WINDOW REQUEST ShowCursor ALIASES WINDOW EVENT SelectionNotify 1 subtype FIXES_SUBTYPE 4 window WINDOW 8 owner WINDOW 12 selection ATOM 16 timestamp TIMESTAMP 20 selectionTimestamp TIMESTAMP END EVENT CursorNotify 1 subtype FIXES_CURSOR_SUBTYPE 4 window WINDOW 8 "cursor serial" CARD32 12 timestamp TIMESTAMP 16 name ATOM END EOF xtrace-1.3.1/randr.proto0000644000175100017510000003327711704002604012126 00000000000000# This file is part of "xtrace" # Copyright (C) 2006 Bernhard R. Link # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # # This file is based on /usr/include/X11/extensions/randr{,proto}.h which state: ## Copyright © 2000 Compaq Computer Corporation ## Copyright © 2002 Hewlett-Packard Company ## and ## Copyright © 2000, Compaq Computer Corporation, ## Copyright © 2002, Hewlett Packard, Inc. ## ## 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 Compaq or HP not be used in advertising ## or publicity pertaining to distribution of the software without specific, ## written prior permission. Compaq and HP makes no representations about the ## suitability of this software for any purpose. It is provided "as is" ## without express or implied warranty. ## ## HP DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL ## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL COMPAQ ## 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 Gettys, HP Labs, Hewlett-Packard, Inc. ## # modified for Xrandr1.2 using /usr/share/doc/x11proto-randr-dev/randrproto.txt.gz: ## The X Resize, Rotate and Reflect Extension ## Version 1.2 ## 2006-4-13 ## ## Jim Gettys ## Jim.Gettys@hp.com ## Cambridge Research Laboratory ## HP Labs ## Hewlett Packard Company ## ## Keith Packard ## keith.packard@intel.com ## Open Source Technology Center ## Intel Corporation ## # from x11proto-randr-dev which states: ## Copyright © 2000 Compaq Computer Corporation ## Copyright © 2002 Hewlett-Packard Company ## Copyright © 2006 Intel Corporation ## ## 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 the copyright holders not be used in advertising or ## publicity pertaining to distribution of the software without specific, ## written prior permission. The copyright holders make no representations ## about the suitability of this software for any purpose. It is provided "as ## is" without express or implied warranty. ## ## THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, ## INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO ## EVENT SHALL THE COPYRIGHT HOLDERS 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. EXTENSION "RANDR" RandR USE core REQUESTS QueryVersion RESPONDS RandrOldGetScreenInfo UNSUPPORTED SetScreenConfig RESPONDS RandrOldScreenChangeSelectInput UNSUPPORTED SelectInput GetScreenInfo RESPONDS # RandR 1.2: GetScreenSizeRange RESPONDS SetScreenSize GetScreenResources RESPONDS GetOutputInfo RESPONDS ListOutputProperties RESPONDS QueryOutputProperty RESPONDS ConfigureOutputProperty ChangeOutputProperty DeleteOutputProperty GetOutputProperty RESPONDS CreateMode RESPONDS DestroyMode AddOutputMode DeleteOutputMode GetCrtcInfo RESPONDS SetCrtcConfig RESPONDS GetCrtcGammaSize RESPONDS GetCrtcGamma RESPONDS SetCrtcGamma # RandR 1.3: GetScreenResourcesCurrent RESPONDS SetCrtcTransform GetCrtcTransform RESPONDS GetPanning RESPONDS SetPanning RESPONDS SetOutputPrimary GetOutputPrimary RESPONDS END EVENTS RRScreenChangeNotify RRNotify END ERRORS BadOutput BadCrtc BadMode END CONSTANTS randr_notify 0 ScreenChangeNotify END TYPE RANDR_NOTIFY ENUM8 randr_notify BITMASK randr_notify_mask 1<<0 ScreenChangeNotifyMask 1<<2 OutputChangeNotifyMask 1<<3 OutputPropertyNotifyMask END TYPE RANDR_NOTIFY_MASK BITMASK8 randr_notify_mask BITMASK randr_rr 1 Rotate_0 2 Rotate_90 4 Rotate_180 8 Rotate_270 16 Reflect_X 32 Reflect_Y END TYPE RANDR_RR BITMASK16 randr_rr CONSTANTS subpixelorder 0 Unknown 1 HorizontalRGB 2 HorizontalBGR 3 VerticalRGB 4 VerticalBGR 5 None END TYPE SUBPIXELORDER CARD16 constants subpixelorder CONSTANTS randr_status 0 Success 1 InvalidConfigTime 2 InvalidTime 3 Failed END TYPE RRCONFIGSTATUS ENUM8 randr_status CONSTANTS appropriate 0 appropriate END CONSTANTS randr_connection 0 Connected 1 Disconnected 2 UnknownConnection END TYPE CONNECTION CARD8 constants randr_connection BITMASK randr_modeflags 0x00000001 HSyncPositive 0x00000002 HSyncNegative 0x00000004 VSyncPositive 0x00000008 VSyncNegative 0x00000010 Interlace 0x00000020 DoubleScan 0x00000040 CSync 0x00000080 CSyncPositive 0x00000100 CSyncNegative 0x00000200 HSkewPresent 0x00000400 BCast 0x00000800 PixelMultiplex 0x00001000 DoubleClock 0x00002000 ClockDivideBy2 END TYPE SETofMODEFLAG BITMASK32 randr_modeflags CONSTANTS randr_changemode 0 Replace 1 Prepend 2 Append END CONSTANTS randr_changenotifystate 0 NewValue 1 Deleted END TYPE OUTPUT CARD32 TYPE LISTofOUTPUT LISTofCARD32 TYPE CRTC CARD32 TYPE LISTofCRTC LISTofCARD32 TYPE MODE CARD32 TYPE LISTofMODE LISTofCARD32 STRUCT MODEINFO length 32 0 id CARD32 4 width[pixels] UINT16 6 height[pixels] UINT16 8 dot_clock UINT32 12 h_sync_start UINT16 14 h_sync_end UINT16 16 h_total UINT16 18 h_skew UINT16 20 v_sync_start UINT16 22 v_sync_end UINT16 24 v_total UINT16 26 name_length UINT16 28 mode_flags SETofMODEFLAG END STRUCT TRANSFORM length 36 0 matrix LISTofFIXED END REQUEST QueryVersion 4 major-version UINT32 8 minor-version UINT32 END RESPONSE QueryVersion 8 major-version UINT32 12 minor-version UINT32 END REQUEST GetScreenInfo 4 window WINDOW END STRUCT ScreenSizes length 8 0 width[pixels] UINT16 2 height[pixels] UINT16 4 width[mm] UINT16 6 height[mm] UINT16 END LIST Rates variable min-length 2 0 count COUNT16 2 r LISTofUINT16 END RESPONSE GetScreenInfo 1 rotations RANDR_RR 8 root WINDOW 12 timestamp TIMESTAMP 16 config-timestamp TIMESTAMP 20 nSizes COUNT16 22 sizeID CARD16 24 rotation RANDR_RR 32 sizes LISTofScreenSizes 26 rate UINT16 28 nrateEnts COUNT16 LATER rates LISTofRates END REQUEST SetScreenConfig 4 window CARD32 8 timestamp TIMESTAMP constants curtime 12 config-timestamp TIMESTAMP 16 "sizei index" CARD16 18 "rotation" RANDR_RR 20 rate UINT16 constants appropriate END RESPONSE SetScreenConfig 1 status RRCONFIGSTATUS 8 timestamp TIMESTAMP 12 config-timestamp TIMESTAMP 16 root WINDOW 20 subpixelOrder SUBPIXELORDER END REQUEST SelectInput 4 window WINDOW 8 enable RANDR_NOTIFY_MASK END REQUEST GetScreenSizeRange 4 window WINDOW END RESPONSE GetScreenSizeRange 8 minWidth UINT16 10 minHeight UINT16 12 maxWidth UINT16 14 maxHeight UINT16 END REQUEST SetScreenSize 4 window WINDOW 8 width UINT16 10 height UINT16 12 width[mm] UINT32 16 height[mm] UINT32 END REQUEST GetScreenResources 4 window WINDOW END RESPONSE GetScreenResources 8 timestamp TIMESTAMP 12 config-timestamp TIMESTAMP 16 "#CRTCs" COUNT16 32 crtcs LISTofCRTC 18 "#outputs" COUNT16 LATER outputs LISTofOUTPUT 20 "#modeinfos" COUNT16 LATER modeinfos LISTofMODEINFO 22 "total bytes in mode names" COUNT16 # a way to seperate them would be nice: LATER "mode names" STRING8 END REQUEST GetScreenResourcesCurrent ALIASES GetScreenResources RESPONSE GetScreenResourcesCurrent ALIASES GetScreenResources REQUEST GetOutputInfo 4 output OUTPUT 8 config-timestamp TIMESTAMP END RESPONSE GetOutputInfo 8 timestamp TIMESTAMP 12 "current connected crtc" CRTC 16 width[mm] UINT32 20 height[mm] UINT32 24 connection CONNECTION 25 subpixel-order SUBPIXELORDER 26 "#CRTCs" COUNT16 36 crtcs LISTofCRTC 28 "#modes" COUNT16 LATER modes LISTofMODE 30 "preferred modes" UINT16 32 clonecount COUNT16 LATER clones LISTofOUTPUT 34 "length of name" COUNT16 LATER name STRING8 END REQUEST ListOutputProperties 4 output OUTPUT END RESPONSE ListOutputProperties 8 "#atoms" COUNT16 32 atoms LISTofATOM END REQUEST QueryOutputProperty 4 output OUTPUT 8 property ATOM END RESPONSE QueryOutputProperty 8 pending BOOL 9 range BOOL 10 immutable BOOL 32 "valid values" LISTofUINT32 END REQUEST ConfigureOutputProperty 4 output OUTPUT 8 property ATOM 12 pending BOOL 13 range BOOL 16 "valid values" LISTofUINT32 END REQUEST ChangeOutputProperty 4 output OUTPUT 8 property ATOM 12 type ATOM 16 format FORMAT8 17 mode ENUM8 randr_changemode 20 length COUNT32 24 data LISTofFormat END REQUEST DeleteOutputProperty 4 output OUTPUT 8 property ATOM END REQUEST GetOutputProperty 4 output OUTPUT 8 property ATOM 12 type ATOM constants any 16 offset CARD32 20 length CARD32 24 delete BOOL 25 pending BOOL END RESPONSE GetOutputProperty 1 format FORMAT8 8 type ATOM constants none 12 bytes-after CARD32 16 length COUNT32 32 value LISTofFormat END REQUEST CreateMode 4 window WINDOW 8 mode MODEINFO 40 "mode name" STRING8 END RESPONSE CreateMode 8 mode MODE END REQUEST DestroyMode 4 mode MODE END REQUEST AddOutputMode 4 output OUTPUT 8 mode MODE END REQUEST DeleteOutputMode ALIASES AddOutputMode REQUEST GetCrtcInfo 4 crtc CRTC 8 config-timestamp TIMESTAMP END RESPONSE GetCrtcInfo 1 status RRCONFIGSTATUS 8 timestamp TIMESTAMP 12 x INT16 14 y INT16 16 width UINT16 18 height UINT16 20 mode MODE 24 "current rr" RANDR_RR 26 "possible rr" RANDR_RR 28 "#outputs" COUNT16 32 outputs LISTofOUTPUT 30 "#possible outputs" COUNT16 LATER "possible outputs" LISTofOUTPUT END REQUEST SetCrtcConfig 4 crtc CRTC 8 timestamp TIMESTAMP 12 "config timestamp" TIMESTAMP 16 x INT16 18 y INT16 20 mode MODE 24 rr RANDR_RR 28 outputs LISTofOUTPUT END RESPONSE SetCrtcConfig 1 status RRCONFIGSTATUS END REQUEST GetCrtcGammaSize 4 crtc CRTC END RESPONSE GetCrtcGammaSize 8 size CARD16 END REQUEST GetCrtcGamma ALIASES GetCrtcGammaSize RESPONSE GetCrtcGamma 8 size COUNT16 # is this really 22?? 22 red LISTofCARD16 8 size COUNT16 LATER green LISTofCARD16 8 size COUNT16 LATER blue LISTofCARD16 END REQUEST SetCrtcGamma 4 crtc CRTC 8 size COUNT16 12 red LISTofCARD16 8 size COUNT16 LATER green LISTofCARD16 8 size COUNT16 LATER blue LISTofCARD16 END REQUEST SetCrtcTransform 4 crtc CRTC 8 transform TRANSFORM 44 "filter length" COUNT16 48 "filter name" STRING8 ROUND RESET_COUNTER LATER "filter params" LISTofFIXED END REQUEST GetCrtcTransform 4 crtc CRTC END RESPONSE GetCrtcTransform 8 "pending transform" TRANSFORM 44 "has transforms" BOOL 48 "current transform" TRANSFORM 88 "pending filter name length" COUNT16 96 "pending filter name" STRING8 ROUND 90 "pending filter num params" COUNT16 LATER "pending filter params" LISTofFIXED 92 "current filter name length" COUNT16 LATER "current filter name" STRING8 ROUND 94 "current filter num params" COUNT16 LATER "current filter params" LISTofFIXED END REQUEST GetPanning 4 crtc CRTC END RESPONSE GetPanning 1 status RRCONFIGSTATUS 8 timestamp TIMESTAMP 12 left UINT16 14 top UINT16 16 width UINT16 18 height UINT16 20 track_left UINT16 22 track_top UINT16 24 track_width UINT16 26 track_height UINT16 28 border_left INT16 30 border_top INT16 32 border_right INT16 34 border_bottom INT16 END REQUEST SetPanning 4 crtc CRTC 8 timestamp TIMESTAMP 12 left UINT16 14 top UINT16 16 width UINT16 18 height UINT16 20 track_left UINT16 22 track_top UINT16 24 track_width UINT16 26 track_height UINT16 28 border_left INT16 30 border_top INT16 32 border_right INT16 34 border_bottom INT16 END RESPONSE SetPanning 1 status RRCONFIGSTATUS 8 timestamp TIMESTAMP END REQUEST SetOutputPrimary 4 window WINDOW 8 output OUTPUT END REQUEST GetOutputPrimary 4 window WINDOW END RESPONSE GetOutputPrimary 8 output OUTPUT END EVENT RRScreenChangeNotify 1 rotation RANDR_RR 4 timestamp TIMESTAMP 8 configTimestamp TIMESTAMP 12 root WINDOW 16 window WINDOW 20 size-id CARD16 22 subpixelOrder SUBPIXELORDER 24 width[pixels] UINT16 26 height[pixels] UINT16 28 width[mm] UINT16 30 height[mm] UINT16 END CONSTANTS RRNotify_kind 0 CrtcChange 1 OutputChange 2 OutputProperty END EVENT RRNotify 1 kind ENUM8 RRNotify_kind IF 1 CARD8 0 4 timestamp TIMESTAMP 8 "request window" WINDOW 12 "crtc affected" CRTC 16 "mode in use" MODE 20 "new rr" RANDR_RR 24 x INT16 26 y INT16 28 width UINT16 30 height UINT16 ELSEIF 1 CARD8 1 4 timestamp TIMESTAMP 8 "config timestamp" TIMESTAMP 12 "request window" WINDOW 16 "output affected" OUTPUT 20 "crtc in use" CRTC 24 "mode in use" MODE 28 rr RANDR_RR 30 "connection status" CONNECTION 31 "subpixel order" SUBPIXELORDER ELSEIF 1 CARD8 2 4 window WINDOW 8 output OUTPUT 12 atom ATOM 16 time TIMESTAMP 20 state ENUM8 randr_changenotifystate ELSE 4 unknown LISTofCARD8 END EOF xtrace-1.3.1/shape.proto0000644000175100017510000001070211704002604012104 00000000000000# This file is part of "xtrace" # Copyright (C) 2005 Bernhard R. Link # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # This file is based on the ## X Nonrectangular Window ## Shape Extension Protocol ## Version 1.0 ## X Consortium Standard ## X Version 11, Release 6.4 ## Keith Packard ## MIT X Consortium ## Copyright (C) 1989 X Consortium ## ## Permission is hereby granted, free of charge, to any person ## obtaining a copy of this software and associated documenta- ## tion files (the ``Software''), to deal in the Software with- ## out restriction, including without limitation the rights to ## use, copy, modify, merge, publish, distribute, sublicense, ## and/or sell copies of the Software, and to permit persons to ## whom the Software is furnished to do so, subject to the fol- ## lowing conditions: ## ## The above copyright notice and this permission notice 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 PUR- ## POSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE X ## CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABIL- ## ITY, 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. ## ## Except as contained in this notice, the name of the X Con- ## sortium shall not be used in advertising or otherwise to ## promote the sale, use or other dealings in this Software ## without prior written authorization from the X Consortium. EXTENSION "SHAPE" Shape USE core REQUESTS QueryVersion RESPONDS Rectangles Mask Combine Offset QueryExtents RESPONDS SelectInput InputSelected RESPONDS GetRectangles RESPONDS END EVENTS ShapeNotify END ERRORS END CONSTANTS shape_kind 0 Bounding 1 Clip 2 Input END TYPE SHAPE_KIND ENUM8 shape_kind CONSTANTS shape_op 0 Set 1 Union 2 Intersect 3 Subtract 4 Invert END TYPE SHAPE_OP ENUM8 shape_op CONSTANTS shape_sort 0 UnSorted 1 YSorted 2 YXSorted 3 YXBanded END REQUEST QueryVersion ALIASES Empty RESPONSE QueryVersion 8 "major version" UINT16 10 "minor version" UINT16 END REQUEST Rectangles 4 operation SHAPE_OP 5 "destination kind" SHAPE_KIND 6 ordering ENUM8 shape_sort 8 "destination window" WINDOW 12 x-offset INT16 14 y-offset INT16 16 rectangles LISTofRECTANGLE END REQUEST Mask 4 operation SHAPE_OP 5 destination-kind SHAPE_KIND 8 destination-window WINDOW 12 x-offset INT16 14 y-offset INT16 16 source-bitmap PIXMAP constants none END REQUEST Combine 4 operation SHAPE_OP 5 destination-kind SHAPE_KIND 6 source-kind SHAPE_KIND 8 "destination window" WINDOW 12 "x offset" INT16 14 "y offset" INT16 16 source-window WINDOW END REQUEST Offset 4 "destination kind" SHAPE_KIND 8 "destination window" WINDOW 12 "x offset" INT16 14 "y offset" INT16 END REQUEST QueryExtents ALIASES WINDOW RESPONSE QueryExtents 8 "bounding shaped" BOOL 9 "clip shaped" BOOL 12 "bounding shape extents x" INT16 14 "bounding shape extents y" INT16 16 "bounding shape extents width" UINT16 18 "bounding shape extents height" UINT16 20 "clip shape extents x" INT16 22 "clip shape extents y" INT16 24 "clip shape extents width" UINT16 26 "clip shape extents height" UINT16 END REQUEST SelectInput 4 "destination window" WINDOW 8 enable BOOL END REQUEST InputSelected ALIASES WINDOW RESPONSE InputSelected 1 enabled BOOL END REQUEST GetRectangles 4 window WINDOW 8 source-kind SHAPE_KIND END RESPONSE GetRectangles 1 ordering ENUM8 shape_sort 8 nrects COUNT32 32 rectangles LISTofRECTANGLE END EVENT ShapeNotify 1 "shape kind" SHAPE_KIND 4 "affected window" WINDOW 8 "x value of extents" INT16 10 "y value of extents" INT16 12 "width of extents" UINT16 14 "height of extents" UINT16 16 "server time" TIMESTAMP 22 shaped BOOL END EOF xtrace-1.3.1/vidmode.proto0000644000175100017510000001544511704002604012444 00000000000000# This file is part of "xtrace" # Copyright (C) 2006 Bernhard R. Link # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # # This file is based on /usr/include/X11/extensions/xf86vmstr.h which states: ## Copyright 1995 Kaleb S. KEITHLEY ## ## 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, and/or sell copies of the Software, and to ## permit persons to whom the Software is furnished to do so, subject to ## the following conditions: ## ## The above copyright notice and this permission notice 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 Kaleb S. KEITHLEY 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. ## ## Except as contained in this notice, the name of Kaleb S. KEITHLEY ## shall not be used in advertising or otherwise to promote the sale, use ## or other dealings in this Software without prior written authorization ## from Kaleb S. KEITHLEY EXTENSION "XFree86-VidModeExtension" VidMode USE core REQUESTS QueryVersion RESPONDS GetModeLine RESPONDS ModModeLine SwitchMode GetMonitor RESPONDS LockModeSwitch GetAllModeLines RESPONDS AddModeLine DeleteModeLine ValidateModeLine RESPONDS SwitchToMode GetViewPort RESPONDS SetViewPort GetDotClocks RESPONDS SetClientVersion SetGamma GetGamma RESPONDS GetGammaRamp RESPONDS SetGammaRamp GetGammaRampSize RESPONDS GetPermissions RESPONDS END EVENTS END ERRORS BadClock BadHTimings BadVTimings ModeUnsuitable ExtensionDisabled ClientNotLocal ZoomLocked END BITMASK xf86vidmode_perms 1 read 2 write END BITMASK xf86vidmode_flags # taken from xvidtune: 1 +hsync 2 -hsync 4 +vsync 8 -vsync 16 interlace 32 doublescan 64 csync 128 +csync 256 -csync END REQUEST QueryVersion END RESPONSE QueryVersion 8 major-version UINT16 10 minor-version UINT16 END REQUEST GetModeLine 4 screen UINT16 END REQUEST GetAllModeLines ALIASES GetModeLine REQUEST GetMonitor ALIASES GetModeLine REQUEST GetViewPort ALIASES GetModeLine REQUEST GetDotClocks ALIASES GetModeLine REQUEST GetPermissions ALIASES GetModeLine REQUEST GetGamma ALIASES GetModeLine RESPONSE GetModeLine 8 dotclock UINT32 12 hdisplay UINT16 14 hsyncstart UINT16 16 hsyncend UINT16 18 htotal UINT16 20 hskew UINT16 22 vdisplay UINT16 24 vsyncstart UINT16 26 vsyncend UINT16 28 vtotal UINT16 32 flags BITMASK32 xf86vidmode_flags 36 reserved1 UINT32 40 reserved2 UINT32 44 reserved3 UINT32 48 privsize UINT32 END LIST Modes length 48 # This is somehow buggy, xf86vmstr.h values cannot # be, this looks a bit better, but I'm still not sure 0 dotclock UINT32 4 hdisplay UINT16 6 hsyncstart UINT16 8 hsyncend UINT16 10 htotal UINT16 12 hskew UINT32 16 vdisplay UINT16 18 vsyncstart UINT16 20 vsyncend UINT16 22 vtotal UINT16 28 flags BITMASK32 xf86vidmode_flags 32 reserved1 UINT32 36 reserved2 UINT32 40 reserved3 UINT32 44 privsize UINT32 END RESPONSE GetAllModeLines 8 modecount UINT32 8 modecount COUNT32 32 modes LISTofModes END LIST Sync length 4 0 min UINT16 2 max UINT16 END RESPONSE GetMonitor 8 vendorLength COUNT8 32 vendor STRING8 9 modelLength COUNT8 LATER model STRING8 10 nhsync COUNT8 LATER hsync LISTofSync 11 nvsync COUNT8 LATER vsync LISTofSync END REQUEST AddModeLine 4 screen CARD32 8 dotclock UINT32 12 hdisplay UINT16 14 hsyncstart UINT16 16 hsyncend UINT16 18 htotal UINT16 20 hskew UINT16 22 vdisplay UINT16 24 vsyncstart UINT16 26 vsyncend UINT16 28 vtotal UINT16 32 flags BITMASK32 xf86vidmode_flags 36 reserved1 UINT32 40 reserved2 UINT32 44 reserved3 UINT32 48 privsize UINT32 52 after_dotclock UINT32 56 after_hdisplay UINT16 58 after_hsyncstart UINT16 60 after_hsyncend UINT16 62 after_htotal UINT16 64 after_hskew UINT16 66 after_vdisplay UINT16 68 after_vsyncstart UINT16 70 after_vsyncend UINT16 72 after_vtotal UINT16 76 after_flags CARD32 80 reserved4 UINT32 84 reserved5 UINT32 88 reserved6 UINT32 END REQUEST ModModeLine 4 screen CARD32 8 hdisplay UINT16 10 hsyncstart UINT16 12 hsyncend UINT16 14 htotal UINT16 16 hskew UINT16 18 vdisplay UINT16 20 vsyncstart UINT16 22 vsyncend UINT16 24 vtotal UINT16 28 flags BITMASK32 xf86vidmode_flags 32 reserved1 UINT32 36 reserved2 UINT32 40 reserved3 UINT32 44 privsize UINT32 END REQUEST ValidateModeLine 4 screen CARD32 8 dotclock UINT32 12 hdisplay UINT16 14 hsyncstart UINT16 16 hsyncend UINT16 18 htotal UINT16 20 hskew UINT16 22 vdisplay UINT16 24 vsyncstart UINT16 26 vsyncend UINT16 28 vtotal UINT16 32 flags BITMASK32 xf86vidmode_flags 36 reserved1 UINT32 40 reserved2 UINT32 44 reserved3 UINT32 48 privsize UINT32 END RESPONSE ValidateModeLine 8 status CARD32 END REQUEST DeleteModeLine ALIASES ValidateModeLine REQUEST SwitchToMode ALIASES ValidateModeLine REQUEST SwitchMode 4 screen CARD16 6 zoom UINT16 END REQUEST LockModeSwitch 4 screen CARD16 6 lock CARD16 END RESPONSE GetViewPort 8 x UINT32 12 y UINT32 END REQUEST SetViewPort 4 screen CARD16 8 x UINT32 12 y UINT32 END RESPONSE GetDotClocks 8 flags BITMASK32 xf86vidmode_flags 12 clocks UINT32 16 maxclocks UINT32 END REQUEST SetClientVersion 4 major UINT16 6 minor UINT16 END RESPONSE GetGamma 8 red UINT32 12 green UINT32 16 blue UINT32 END REQUEST SetGamma 4 screen CARD16 8 red UINT32 12 green UINT32 16 blue UINT32 END REQUEST SetGammaRamp 4 screen CARD16 8 size COUNT32 12 red LISTofUINT16 8 size COUNT32 LATER green LISTofUINT16 8 size COUNT32 LATER blue LISTofUINT16 END REQUEST GetGammaRamp 4 screen CARD16 6 size UINT16 END RESPONSE GetGammaRamp 8 size COUNT16 32 red LISTofUINT16 8 size COUNT16 LATER green LISTofUINT16 8 size COUNT16 LATER blue LISTofUINT16 END REQUEST GetGammaRampSize 4 screen CARD16 END RESPONSE GetGammaRampSize 8 size UINT16 END RESPONSE GetPermissions 8 permissions BITMASK32 xf86vidmode_perms END EOF xtrace-1.3.1/ChangeLog0000644000175100017510000001552111765365316011520 000000000000002012-06-01 * fix parsing of unusual QueryExtension requests 2012-01-09 * fix --timestamp description in manpage 2011-05-07 * add support for XFree86-DGA 2011-05-06 * add UFRACTION32_32 2011-02-12 * configure.ac: change monotonic clock cache-id to make autoconf happy 2011-02-06 * add a 'DIVIDE_COUNT' directive * enhance GLX support (GetVisualConfigs, GetFBConfigsSGIX, QueryServerString, ClientInfo) 2011-01-29 * add a 'SIZE' directive to limit some structure to an explicit size (in VarStructs everything after that size is printed as unexpected data and otherwise ignored, also all field output or list length is automatically truncated to that value) * allow 'ELSEIF STORED ...' * use AC_PROG_CC_C99 to be sure to get C99 semantics 2011-01-28 * allow to 'transfer' data from REQUEST to RESPONSE on the stack * allow 'IF STORED ...' to compare stored value * fix PUSH32 (was PUSH16 by mistake) * error out early in case of not yet supported min-length 0 2010-12-22 * Add INT32_32 type for a 64 bit integer stored in two 32 bit integers * Add SYNC extension 2010-12-21 * Add --monotonic-timestamps to print timestamps relative to system start (or whatever CLOCK_MONOTONIC returns on your system). 2010-10-26 * Add Composite (Thanks to Adam Endrodi) 2010-10-20 * fix size of do-not-propagate-mask in GetWindowAttributes results (Thanks to Pierre-Yves Baccou for noticing). 2010-06-20 * Add XVideo (version 2.2) 2010-05-06 * Add DRI2 (up to version 1.3) 2010-04-07 * Add support for Generic Events (XGE) * Fix bug in error reporting when multiple STRUCTs have the same name * add --print-counts --print-offsets * add FIXED3232 (fixed point with 32 bits before and 32 after the dot) * add some of the generic events of XI2 2010-03-30 * Add support for XInputExtension 1.5, and partial support for XInputExtension 2.0 2010-03-22 * fix FRACTION16_16 on big-endian systems * add FRACTION32_32 2010-01-21 * fix extension name output to not go to stdout unconditionaly (Thanks to Tommi Komulainen) * fix missing contants in shape kind and wrong kind in fixes extension (Thanks to Tommi Komulainen) 2010-01-05 * fix parsing initial server response (old bug, but became obvious on big endian with the new code) 2010-01-02 * fix SelectionNotify (thanks to Peter Collingbourne) * show more details of the initial X server response * fix segfault after some protocol description parsing errors * correctly identify core request NoOperation 2009-10-18 * fix printing of column in protocoal description parser errors on 64 bit architectures. 2009-10-05 * bugfix: the major/minor codes were transposed in print_server_error() (thanks to Chris Wilson) 2009-09-11 * bugfix: fix LISTofTRAPEZOIDS offset in RenderTrapezoids (thanks to Chris Wilson) 2009-08-11 * bugfix: when running xtrace with command, it was terminating when all connections were closed while the command still run (and this even when -k was specified). 2009-08-10 * zero-pad fractial timestamp part 2009-07-02 * print raw data of unsupported or unknown requests and of unexpected replies. 2009-06-29 * remove unecessary output of spaces for ft_IF,... 2009-06-28 * references to constants allowed in .proto files where numbers are expected. * add FLOAT32, LISTofFLOAT32, IF32, LISTofINT8, LISTofINT16, LISTofIN32, DECREMENT_COUNTER * some bugfixes in BE32 and LISTofUINT32 2009-06-27 * add FRACTION16_16 2009-06-26 * protocol specification is now read at run-time and no longer needs to be compiled in. Translated all the .inc files to the new .proto file format. 2009-06-15 * add start of GLX support contributed by Kristof Ralovich 2009-06-01 * complete XInputExtension support (if there is a price for worst documented extension, this would be my current candidate) 2009-05-19 * omit "0x" when printing the sequence number for replies, to make the output more consistent with requests and events. 2009-04-18 * start with XInputExtension support (only some opcodes yet) 2009-04-16 * add --timestamps and --relative-timestamps options to print timestamps before each line. 2009-04-04 * move start of output lines generation into common function (this makes some messages that until now got to stderr to go to the usual output, too. While that might hide them a bit, this also ensures they appear at the right place, which might be better). 2009-03-25 * Properly set the address family when listening on a tcp socket 2009-02-19 * fix decoding of GetAtomName reply * (cosmetic) use ft_RRCONFIGSTATUS for RRSetScreenConfig reply * fix decoding of RRGetOutputInfo reply * display FIXED as fixed-point numbers * RandR 1.3 support 2009-01-06 * fix decoding of ConfigureWindow request (thanks to Yann Droneaud) * fix similar errors in RandrDeleteOutputProperty and XF86BigfontQueryVersion. 2008-08-02 * add support for XFIXES and DAMAGE extensions 2008-08-01 * add support for DPMS and MIT-SCREEN-SAVER extensions * print GetScreenSaver timeout and interval in decimal 2008-02-11 * allow to give a program to start (based on patch supplied by Bruce Guenter) * actually use FAKEDISPLAY as manpage says (was INDISPLAY before) 2007-12-10 * fix ROUND_32 (thanks to Julien Cristau) 2007-12-09 * fix bug in RANDR 1.2 parsing (thanks to Julien Cristau) 2007-12-08 * add support for XRANDR 1.2 * add support for XINERAMA extension 2007-10-03 * make some x and y UINT instead of CARD 2007-07-05 * add support for XFree86-Bigfont extension * show extension names even in requests from unknown extensions * quiet some compiler warnings * fix typo to mismatch replies after 65535 requests * don't wait for replies for requests that got an error 2006-08-10 * add --outfile and --buffered command line options 2006-07-24 * add support for XFree86-VidModeExtension extension 2006-07-14 * switch to stdint.h and uint* instead of u_int* * use getaddrinfo instead of gethostbyname2 * implement fall-backs for strndup and asprintf 2006-07-12 * print stringlists in ListFonts, SetFontPath, GetFontPath and ListExtensions 2006-06-10 * fix ATOMs to be 32 bit * ChangeProperty pretty-prints types STRING and ATOM now 2006-06-09 * remember atom names and print them when atoms are used * STRING8 fields now print \n and \t instead of \012 and \010 * fix ft_IF8 processing, add ft_IFATOM * GetProperty pretty-prints type "STRING" now. 2006-06-08 * fix QueryVersion of RANDR * implement MIT-SHM 2006-03-09 * support RANDR extension 2006-03-08 * manpage fixup. (Thanks to Justin Pryzby) 2006-02-28 * work around copyauth problems with "localhost:" DISPLAYs (like ssh -X sets them) 2006-02-27 * fix some problems with 16 bit ints shown as uints. 2006-02-24 * support RENDER extension * fix handling of variable length structures (only those before the minimal length were shown) 2005-12-04 Bernhard R. Link * add --interactive option * make some widths and heights UINT instead of CARD xtrace-1.3.1/configure.ac0000644000175100017510000000345011765365327012234 00000000000000dnl dnl Process this file with autoconf to produce a configure script dnl AC_INIT(xtrace, 1.3.1, brlink@debian.org) AC_CONFIG_SRCDIR(main.c) AC_CONFIG_AUX_DIR(ac) AM_CONFIG_HEADER(config.h) AM_INIT_AUTOMAKE([-Wall -Werror]) AM_MAINTAINER_MODE AC_GNU_SOURCE if test "${CFLAGS:+set}" != set ; then CFLAGS="-Wall -O2 -g -Wmissing-prototypes -Wstrict-prototypes -Wshadow" fi AC_LANG(C) AC_PROG_CC_C99 AC_PROG_INSTALL AC_CACHE_CHECK([Checking for _POSIX_TIMERS and _POSIX_MONOTONIC_CLOCK],[ac_cv_monotonic_clock], [AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[ #include #include ]],[[ #ifdef _POSIX_TIMERS #if defined(_POSIX_MONOTONIC_CLOCK) && _POSIX_MONOTONIC_CLOCK >= 0 1 #else #error _POSIX_MONOTONIC_CLOCK not defined, or not positive, not using clock_gettime #endif #else #error _POSIX_TIMERS not defined, not using clock_gettime #endif ]])], [ac_cv_monotonic_clock=yes], [ac_cv_monotonic_clock=no])]) if test $ac_cv_monotonic_clock = yes ; then AC_DEFINE([HAVE_MONOTONIC_CLOCK], 1, [Define if clock_gettime(CLOCK_MONOTONIC) should work]) AC_CHECK_LIB(rt, clock_gettime, [], [AC_MSG_ERROR([_POSIX_TIMERS suggests clock_gettime should work but it seems not to work, though])]) fi AC_CHECK_FUNCS([strndup asprintf socket]) if test $ac_cv_func_socket = no; then AC_CHECK_LIB(socket, socket, [AC_DEFINE(HAVE_SOCKET) LIBS="$LIBS -lsocket -lnsl"; break],[AC_MSG_ERROR([Could not find socket library function])]) fi AC_CHECK_FUNC([getaddrinfo],,[AC_MSG_ERROR([Could not find getaddrinfo library function])]) dnl AC_CHECK_HEADER(X11/X.h,[],[AC_MSG_ERROR([Could not find X11/X.h])]) dnl AC_CHECK_HEADER(X11/Xlib.h,[],[AC_MSG_ERROR([Could not find X11/Xlib.h])]) dnl AC_CHECK_HEADER(X11/extensions/security.h,[],[AC_MSG_ERROR([Could not find X11/extensions/secruity.h])],[#include ]) AC_OUTPUT(Makefile) xtrace-1.3.1/parse.h0000644000175100017510000001175611704002604011214 00000000000000#ifndef XTRACE_PARSE_H #define XTRACE_PARSE_H struct constant { unsigned long value; const char *name; }; struct event; typedef bool request_func(struct connection*, bool, bool, struct expectedreply *); typedef void reply_func(struct connection*, bool*, bool*, struct expectedreply *); typedef void event_func(struct connection *, const unsigned char *, const struct event *); struct request { const char *name; const struct parameter *parameters; const struct parameter *answers; request_func *request_func; reply_func *reply_func; /* stack values to be transfered to the reply code */ int record_variables; }; struct event { const char *name; const struct parameter *parameters; enum event_type { event_normal = 0, event_xge = 1} type; #define event_COUNT 2 }; struct extension { const char *name; size_t namelen; const struct request *subrequests; unsigned char numsubrequests; const struct event *events; unsigned char numevents; const char * const *errors; unsigned char numerrors; unsigned short numxgevents; const struct event *xgevents; }; struct parameter { /* The offset within the event, request, reply or Struct this * applies to. If OFS_LATER it is after the last list item * in this parameter-list. */ size_t offse; /* NULL means end of list */ const char *name; enum fieldtype { /* signed endian specific: */ ft_INT8, ft_INT16, ft_INT32, /* unsigned decimal endian specific: */ ft_UINT8, ft_UINT16, ft_UINT32, /* unsigned hex endian specific: */ ft_CARD8, ft_CARD16, ft_CARD32, /* enums (not in constant list is error): */ ft_ENUM8, ft_ENUM16, ft_ENUM32, /* counts for following strings, lists, ... * value-mask for LISTofFormat */ ft_STORE8, ft_STORE16, ft_STORE32, /* to be ft_GET later into the store register */ ft_PUSH8, ft_PUSH16, ft_PUSH32, /* bitfields: multiple values are possible */ ft_BITMASK8, ft_BITMASK16, ft_BITMASK32, /* Different forms of lists: */ /* - boring ones */ ft_STRING8, ft_LISTofCARD32, ft_LISTofATOM, ft_LISTofCARD8, ft_LISTofCARD16, ft_LISTofUINT8, ft_LISTofUINT16, ft_LISTofUINT32, ft_LISTofINT8, ft_LISTofINT16, ft_LISTofINT32, /* - one of the above depening on last FORMAT */ ft_LISTofFormat, /* - iterate of list description in constants field */ ft_LISTofStruct, /* - same but length is mininum length and * actual length is taken from end of last list * or LASTMARKER, unless there is a SIZESET */ ft_LISTofVarStruct, /* - like ENUM for last STORE, but constants * are of type (struct value*) interpreteted at this * offset */ ft_LISTofVALUE, /* an LISTofStruct with count = 1 */ ft_Struct, /* specify bits per item for LISTofFormat */ ft_FORMAT8, /* an event * (would have also been possible with Struct and many IF)*/ ft_EVENT, /* jump to other parameter list if matches */ ft_IF8, ft_IF16, ft_IF32, /* jump to other parameter list if matches atom name */ ft_IFATOM, /* set end of last list manually, (for LISTofVarStruct) */ ft_LASTMARKER, /* set the end of the current context, also change length * of a VarStruct: */ ft_SET_SIZE, /* a ft_CARD32 looking into the ATOM list */ ft_ATOM, /* always big endian */ ft_BE32, /* get the #ofs value from the stack. (0 is the last pushed) */ ft_GET, /* a fixed-point number 16+16 bit */ ft_FIXED, /* a list of those */ ft_LISTofFIXED, /* a fixed-point number 32+32 bit */ ft_FIXED3232, /* a list of those */ ft_LISTofFIXED3232, /* a 32 bit floating pointer number */ ft_FLOAT32, /* a list of those */ ft_LISTofFLOAT32, /* fraction with nominator and denominator 16 bit */ ft_FRACTION16_16, /* dito 32 bit */ ft_FRACTION32_32, /* nominator is unsigned */ ft_UFRACTION32_32, /* a 64 bit number consisting of first the high 32 bit, then * the low 32 bti */ ft_INT32_32, /* decrement stored value by specific value */ ft_DECREMENT_STORED, ft_DIVIDE_STORED, /* set stored value to specific value */ ft_SET } type; union parameter_option { /* for integers and fields of integers */ const struct constant *constants; /* for IFs, Structs, ... */ const struct parameter *parameters; /* for LISTofVALUE */ const struct value *values; } o; }; struct value { unsigned long flag; /* NULL means EndOfValues */ const char *name; /* only elementary type (<= ft_BITMASK32 are allowed ), */ enum fieldtype type; const struct constant *constants; }; extern const struct request *requests; extern size_t num_requests; extern const struct event *events; extern size_t num_events; extern const const char * const *errors; extern size_t num_errors; extern const struct extension *extensions; extern size_t num_extensions; extern const struct parameter *unexpected_reply; extern const struct parameter *setup_parameters; /* special handlers, for the SPECIAL requests/events */ extern request_func requestQueryExtension; extern request_func requestInternAtom; extern reply_func replyListFontsWithInfo; extern reply_func replyQueryExtension; extern reply_func replyInternAtom; #endif xtrace-1.3.1/ac/0000755000175100017510000000000011765365454010410 500000000000000xtrace-1.3.1/ac/depcomp0000755000175100017510000005064311755376316011713 00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2012-03-27.16; # UTC # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009, 2010, # 2011, 2012 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by 'PROGRAMS ARGS'. object Object file output by 'PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputting dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac # A tabulation character. tab=' ' # A newline character. nl=' ' if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvisualcpp fi if test "$depmode" = msvc7msys; then # This is just like msvc7 but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvc7 fi if test "$depmode" = xlc; then # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency informations. gccflag=-qmakedep=gcc,-MF depmode=gcc fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ## The second -e expression handles DOS-style file names with drive letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the "deleted header file" problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. tr ' ' "$nl" < "$tmpdepfile" | ## Some versions of gcc put a space before the ':'. On the theory ## that the space means something, we add a space to the output as ## well. hp depmode also adds that space, but also prefixes the VPATH ## to the object. Take care to not repeat it in the output. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like '#:fec' to the end of the # dependency line. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ tr "$nl" ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; xlc) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts '$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then # Each line is of the form 'foo.o: dependent.h'. # Do two passes, one to just change these to # '$object: dependent.h' and one to simply 'dependent.h:'. sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; icc) # Intel's C compiler anf tcc (Tiny C Compiler) understand '-MD -MF file'. # However on # $CC -MD -MF foo.d -c -o sub/foo.o sub/foo.c # ICC 7.0 will fill foo.d with something like # foo.o: sub/foo.c # foo.o: sub/foo.h # which is wrong. We want # sub/foo.o: sub/foo.c # sub/foo.o: sub/foo.h # sub/foo.c: # sub/foo.h: # ICC 7.1 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using '\': # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... # tcc 0.9.26 (FIXME still under development at the moment of writing) # will emit a similar output, but also prepend the continuation lines # with horizontal tabulation characters. "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form 'foo.o: dependent.h', # or 'foo.o: dep1.h dep2.h \', or ' dep3.h dep4.h \'. # Do two passes, one to just change these to # '$object: dependent.h' and one to simply 'dependent.h:'. sed -e "s/^[ $tab][ $tab]*/ /" -e "s,^[^:]*:,$object :," \ < "$tmpdepfile" > "$depfile" sed ' s/[ '"$tab"'][ '"$tab"']*/ /g s/^ *// s/ *\\*$// s/^[^:]*: *// /^$/d /:$/d s/$/ :/ ' < "$tmpdepfile" >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" # Add 'dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in 'foo.d' instead, so we check for that too. # Subdirectories are respected. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then # With Tru64 cc, shared objects can also be used to make a # static library. This mechanism is used in libtool 1.4 series to # handle both shared and static libraries in a single compilation. # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. # # With libtool 1.5 this exception was removed, and libtool now # generates 2 separate objects for the 2 libraries. These two # compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 tmpdepfile2=$dir$base.o.d # libtool 1.5 tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.o.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d tmpdepfile4=$dir$base.d "$@" -MD fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; msvc7) if test "$libtool" = yes; then showIncludes=-Wc,-showIncludes else showIncludes=-showIncludes fi "$@" $showIncludes > "$tmpdepfile" stat=$? grep -v '^Note: including file: ' "$tmpdepfile" if test "$stat" = 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The first sed program below extracts the file names and escapes # backslashes for cygpath. The second sed program outputs the file # name when reading, but also accumulates all include files in the # hold buffer in order to output them again at the end. This only # works with sed implementations that can handle large buffers. sed < "$tmpdepfile" -n ' /^Note: including file: *\(.*\)/ { s//\1/ s/\\/\\\\/g p }' | $cygpath_u | sort -u | sed -n ' s/ /\\ /g s/\(.*\)/'"$tab"'\1 \\/p s/.\(.*\) \\/\1:/ H $ { s/.*/'"$tab"'/ G p }' >> "$depfile" rm -f "$tmpdepfile" ;; msvc7msys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for ':' # in the target name. This is to cope with DOS-style filenames: # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. "$@" $dashmflag | sed 's:^['"$tab"' ]*[^:'"$tab"' ][^:][^:]*\:['"$tab"' ]*:'"$object"'\: :' > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" tr ' ' "$nl" < "$tmpdepfile" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift cleared=no eat=no for arg do case $cleared in no) set ""; shift cleared=yes ;; esac if test $eat = yes; then eat=no continue fi case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -arch) eat=yes ;; -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix=`echo "$object" | sed 's/^.*\././'` touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" # makedepend may prepend the VPATH from the source file name to the object. # No need to regex-escape $object, excess matching of '.' is harmless. sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" sed '1,2d' "$tmpdepfile" | tr ' ' "$nl" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi IFS=" " for arg do case "$arg" in -o) shift ;; $object) shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" echo "$tab" >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; msvcmsys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: xtrace-1.3.1/ac/install-sh0000755000175100017510000003325611755376315012342 00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2011-01-19.21; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 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, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice 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 # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. nl=' ' IFS=" "" $nl" # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit=${DOITPROG-} if test -z "$doit"; then doit_exec=exec else doit_exec=$doit fi # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_glob='?' initialize_posix_glob=' test "$posix_glob" != "?" || { if (set -f) 2>/dev/null; then posix_glob= else posix_glob=: fi } ' posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false no_target_directory= usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *' '* | *' '* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) dst_arg=$2 # Protect names problematic for `test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) no_target_directory=true;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg # Protect names problematic for `test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call `install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names problematic for `test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else # Prefer dirname, but fall back on a substitute if dirname fails. dstdir=` (dirname "$dst") 2>/dev/null || expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$dst" : 'X\(//\)[^/]' \| \ X"$dst" : 'X\(//\)$' \| \ X"$dst" : 'X\(/\)' \| . 2>/dev/null || echo X"$dst" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q' ` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 if (umask $mkdir_umask && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writeable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/d" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; [-=\(\)!]*) prefix='./';; *) prefix='';; esac eval "$initialize_posix_glob" oIFS=$IFS IFS=/ $posix_glob set -f set fnord $dstdir shift $posix_glob set +f IFS=$oIFS prefixes= for d do test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && eval "$initialize_posix_glob" && $posix_glob set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && $posix_glob set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: xtrace-1.3.1/ac/missing0000755000175100017510000002415211755376315011730 00000000000000#! /bin/sh # Common stub for a few missing GNU programs while installing. scriptversion=2012-01-06.13; # UTC # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, # 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi run=: sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' sed_minuso='s/.* -o \([^ ]*\).*/\1/p' # In the cases where this matters, `missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac else configure_ac=configure.in fi msg="missing on your system" case $1 in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 # Exit code 63 means version mismatch. This often happens # when the user try to use an ancient version of a tool on # a file that requires a minimum version. In this case we # we should proceed has if the program had been absent, or # if --run hadn't been passed. if test $? = 63; then run=: msg="probably too old" fi ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit --run try to run the given command, and emulate it if it fails Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' autom4te touch the output file, or create a stub one automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file yacc create \`y.tab.[ch]', if possible, from existing .[ch] Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and \`g' are ignored when checking the name. Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; esac # normalize program name to check for. program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` # Now exit if we have it, but it failed. Also exit now if we # don't have it and --version was passed (most likely to detect # the program). This is about non-GNU programs, so use $1 not # $program. case $1 in lex*|yacc*) # Not GNU programs, they don't have --version. ;; *) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then # Could not run --version or --help. This is probably someone # running `$TOOL --version' or `$TOOL --help' to check whether # $TOOL exists and not knowing $TOOL uses missing. exit 1 fi ;; esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. case $program in aclocal*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acconfig.h' or \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` test -z "$files" && files="config.h" touch_files= for f in $files; do case $f in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; autom4te*) echo 1>&2 "\ WARNING: \`$1' is needed, but is $msg. You might have modified some files without having the proper tools for further handling them. You can get \`$1' as part of \`Autoconf' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo "#! /bin/sh" echo "# Created by GNU Automake missing as a replacement of" echo "# $ $@" echo "exit 0" chmod +x $file exit 1 fi ;; bison*|yacc*) echo 1>&2 "\ WARNING: \`$1' $msg. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if test $# -ne 1; then eval LASTARG=\${$#} case $LASTARG in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.h fi ;; esac fi if test ! -f y.tab.h; then echo >y.tab.h fi if test ! -f y.tab.c; then echo 'main() { return 0; }' >y.tab.c fi ;; lex*|flex*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if test $# -ne 1; then eval LASTARG=\${$#} case $LASTARG in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if test ! -f lex.yy.c; then echo 'main() { return 0; }' >lex.yy.c fi ;; help2man*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a dependency of a manual page. You may need the \`Help2man' package in order for those modifications to take effect. You can get \`Help2man' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" exit $? fi ;; makeinfo*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." # The file to touch is that specified with -o ... file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -z "$file"; then # ... or it is the one specified with @setfilename ... infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n ' /^@setfilename/{ s/.* \([^ ]*\) *$/\1/ p q }' $infile` # ... or it is derived from the source name (dir/f.texi becomes f.info) test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info fi # If the file does not exist, the user really needs makeinfo; # let's fail without touching anything. test -f $file || exit 1 touch $file ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and is $msg. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequisites for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: xtrace-1.3.1/parse.c0000644000175100017510000014662711765362063011234 00000000000000/* This file is part of "xtrace" * Copyright (C) 2005,2006,2009,2010,2011 Bernhard R. Link * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "xtrace.h" #include "parse.h" enum package_direction { TO_SERVER, TO_CLIENT }; static void startline(struct connection *c, enum package_direction d, const char *format, ...) FORMAT(printf,3,4); const bool print_counts; const bool print_offsets; static inline unsigned int padded(unsigned int s) { return (s+3)&(~3); } static void startline(struct connection *c, enum package_direction d, const char *format, ...) { va_list ap; struct timeval tv; if( (print_timestamps || print_reltimestamps) && gettimeofday(&tv, NULL) == 0 ) { if( print_timestamps ) fprintf(out, "%lu.%03u ", (unsigned long)tv.tv_sec, (unsigned int)(tv.tv_usec/1000)); if( print_reltimestamps ) { unsigned long long tt = ((unsigned long long)1000)*tv.tv_sec + (tv.tv_usec/1000); fprintf(out, "%lu.%03u ", (unsigned long)((tt - c->starttime)/1000), (unsigned int)((tt - c->starttime)%1000)); } } #ifdef HAVE_MONOTONIC_CLOCK if( print_uptimestamps ) { static bool already_warned = false; struct timespec ts; int i; i = clock_gettime(CLOCK_MONOTONIC, &ts); if( i == 0 ) { fprintf(out, "%lu.%03u ", (unsigned long)ts.tv_sec, (unsigned int)(ts.tv_nsec/1000000L)); } else if (!already_warned) { int e = errno; fprintf(stderr, "Error %d from clock_gettime(CLOCK_MONOTIC,): %s\n", e, strerror(e)); already_warned = true; } } #endif va_start(ap, format); fprintf(out, "%03d:%c:", c->id, (d == TO_SERVER)?'<':'>'); vfprintf(out, format, ap); va_end(ap); } #define U256 ((unsigned int)256) #define UL256 ((unsigned long)256) #define CARD16(bigendian,buffer,ofs) ((bigendian)?(buffer[ofs]*U256+buffer[ofs+1]):(buffer[ofs+1]*U256+buffer[ofs])) #define CARD32(bigendian,buffer,ofs) ((bigendian)?(((buffer[ofs]*U256+buffer[ofs+1])*UL256+buffer[ofs+2])*UL256+buffer[ofs+3]):(buffer[ofs]+UL256*(buffer[ofs+1]+UL256*(buffer[ofs+2]+U256*buffer[ofs+3])))) #define clientCARD32(ofs) CARD32(c->bigendian,c->clientbuffer,ofs) #define clientCARD16(ofs) CARD16(c->bigendian,c->clientbuffer,ofs) #define clientCARD8(ofs) c->clientbuffer[ofs] #define serverCARD32(ofs) CARD32(c->bigendian,c->serverbuffer,ofs) #define serverCARD16(ofs) CARD16(c->bigendian,c->serverbuffer,ofs) #define serverCARD8(ofs) c->serverbuffer[ofs] #define getCARD32(ofs) CARD32(c->bigendian,buffer,ofs) #define getCARD16(ofs) CARD16(c->bigendian,buffer,ofs) #define getCARD8(ofs) buffer[ofs] #define getCARD32(ofs) CARD32(c->bigendian,buffer,ofs) #define getBE32(ofs) (((buffer[ofs]*UL256+buffer[ofs+1])*UL256+buffer[ofs+2])*UL256+buffer[ofs+3]) struct usedextension { struct usedextension *next; const struct extension *extension; unsigned char major_opcode; unsigned char first_event; unsigned char first_error; }; void free_usedextensions(struct usedextension *e) { while( e != NULL ) { struct usedextension *h = e->next; free(e); e = h; } } struct unknownextension { struct unknownextension *next; const char *name; size_t namelen; unsigned char major_opcode; unsigned char first_event; unsigned char first_error; }; void free_unknownextensions(struct unknownextension *e) { while( e != NULL ) { struct unknownextension *h = e->next; free(e); e = h; } } static struct unknownextension *register_unknown_extension(struct connection *c, const unsigned char *name, size_t namelen) { const struct unknownextension *e; struct unknownextension *n; for( e = c->unknownextensions ; e != NULL ; e = e->next ) { if( e->namelen != namelen ) continue; if( strncmp((char*)name, e->name, namelen) != 0 ) continue; return NULL; } for( n = c->waiting ; n != NULL ; n = n->next ) { if( n->namelen != namelen ) continue; if( strncmp((char*)name, n->name, namelen) != 0 ) continue; return n; } n = malloc(sizeof(struct unknownextension)); if( n == NULL ) abort(); n->name = strndup((char*)name, namelen); if( n->name == NULL ) abort(); n->namelen = namelen; n->next = c->waiting; c->waiting = n; return n; } struct expectedreply { struct expectedreply *next; uint64_t seq; const struct request *from; enum datatype { dt_NONE = 0, dt_UNKNOWN_EXTENSION, /* uextension used */ dt_EXTENSION, /* extension used */ dt_ATOM, /* atom used */ } data_type; union { void *data; struct atom *atom; const struct extension *extension; struct unknownextension *uextension; } data; unsigned long values[]; }; const struct extension *find_extension(const uint8_t *name,size_t len); static void print_bitfield(const char *name,const struct constant *constants, unsigned long l){ const struct constant *c; const char *zeroname = "0"; bool first = true; /* bitmasks should have some */ assert(constants != NULL); fprintf(out,"%s=",name); for( c = constants; c->name != NULL ; c++ ) { if( c->value == 0 ) zeroname = c->name; else if( (l & c->value) != 0 ) { if( !first ) putc(',',out); first = false; fputs(c->name,out); } } if( first ) fputs(zeroname,out); }; static const char *findConstant(const struct constant *constants, unsigned long l){ const struct constant *c; if( constants == NULL ) return NULL; for( c = constants; c->name != NULL ; c++ ) { if( c->value == l ) return c->name; } return NULL; }; #define OFS_LATER ((size_t)-1) #define ROUND_32 ((size_t)-1) #define ROUND { ROUND_32, "", ft_LASTMARKER, NULL} static size_t printSTRING8(const uint8_t *buffer,size_t buflen,const struct parameter *p,size_t len,size_t ofs){ size_t nr = 0; if( buflen < ofs ) return ofs; if( buflen - ofs <= len ) len = buflen - ofs; if( print_offsets ) fprintf(out,"[%d]",(int)ofs); fprintf(out,"%s='",p->name); while( len > 0 ) { if( nr == maxshownlistlen ) { fputs("'...",out); } else if( nr < maxshownlistlen ) { unsigned char c = getCARD8(ofs); if( c == '\n' ) { putc('\\',out);putc('n',out); } else if( c == '\t' ) { putc('\\',out);putc('t',out); } else if( (c >= ' ' && c <= '~' ) ) putc(c,out); else fprintf(out,"\\%03hho", c); } ofs++;len--;nr++; } if( nr <= maxshownlistlen ) putc('\'',out); return ofs; } static size_t printLISTofCARD8(const uint8_t *buffer, size_t buflen, const char *name, const struct constant *constants, size_t len, size_t ofs){ bool notfirst = false; size_t nr = 0; if( buflen < ofs ) return ofs; if( buflen - ofs <= len ) len = buflen - ofs; if( print_offsets ) fprintf(out,"[%d]",(int)ofs); fprintf(out, "%s=", name); while( len > 0 ) { const char *value; unsigned char u8; if( nr == maxshownlistlen ) { fputs(",...",out); } else if( nr < maxshownlistlen ) { if( notfirst ) putc(',',out); notfirst = true; u8 = getCARD8(ofs); value = findConstant(constants, u8); if( value ) fprintf(out,"%s(0x%hhx)",value,u8); else fprintf(out,"0x%02hhx",u8); } len--;ofs++;nr++; } putc(';',out); return ofs; } static size_t printLISTofCARD16(struct connection *c,const uint8_t *buffer,size_t buflen,const struct parameter *p,size_t len, size_t ofs){ bool notfirst = false; size_t nr = 0; if( buflen < ofs ) return ofs; if( (buflen - ofs)/2 <= len ) len = (buflen - ofs)/2; if( print_offsets ) fprintf(out,"[%d]",(int)ofs); fprintf(out,"%s=",p->name); while( len > 0 ) { const char *value; uint16_t u16; if( nr == maxshownlistlen ) { fputs(",...",out); } else if( nr < maxshownlistlen ) { if( notfirst ) putc(',',out); notfirst = true; u16 = getCARD16(ofs); value = findConstant(p->o.constants, u16); if( value ) fprintf(out,"%s(0x%hx)",value,(unsigned short int)u16); else fprintf(out,"0x%04hx",(unsigned short int)u16); } len--;ofs+=2;nr++; } putc(';',out); return ofs; } static size_t printLISTofCARD32(struct connection *c,const uint8_t *buffer,size_t buflen,const struct parameter *p,size_t len, size_t ofs){ bool notfirst = false; size_t nr = 0; if( buflen < ofs ) return ofs; if( (buflen - ofs)/4 <= len ) len = (buflen - ofs)/4; if( print_offsets ) fprintf(out,"[%d]",(int)ofs); fprintf(out,"%s=",p->name); while( len > 0 ) { const char *value; uint32_t u32; if( nr == maxshownlistlen ) { fputs(",...",out); } else if( nr < maxshownlistlen ) { if( notfirst ) putc(',',out); notfirst = true; u32 = getCARD32(ofs); value = findConstant(p->o.constants, u32); if( value ) fprintf(out,"%s(0x%x)",value,(unsigned int)u32); else fprintf(out,"0x%08x",(unsigned int)u32); } len--;ofs+=4;nr++; } putc(';',out); return ofs; } static size_t printLISTofFIXED(struct connection *c,const uint8_t *buffer,size_t buflen,const struct parameter *p,size_t len, size_t ofs){ bool notfirst = false; size_t nr = 0; if( buflen < ofs ) return ofs; if( (buflen - ofs)/4 <= len ) len = (buflen - ofs)/4; if( print_offsets ) fprintf(out,"[%d]",(int)ofs); fprintf(out,"%s=",p->name); while( len > 0 ) { int32_t i32; double d; if( nr == maxshownlistlen ) { fputs(",...",out); } else if( nr < maxshownlistlen ) { if( notfirst ) putc(',',out); notfirst = true; i32 = getCARD32(ofs); d = i32 / 65536.0; fprintf(out,"%.6f", d); } len--;ofs+=4;nr++; } putc(';',out); return ofs; } static size_t printLISTofFIXED3232(struct connection *c, const uint8_t *buffer, size_t buflen, const struct parameter *p, size_t len, size_t ofs){ bool notfirst = false; size_t nr = 0; if( buflen < ofs ) return ofs; if( (buflen - ofs)/8 <= len ) len = (buflen - ofs)/8; if( print_offsets ) fprintf(out,"[%d]", (int)ofs); fprintf(out, "%s=", p->name); while( len > 0 ) { int32_t i32; uint32_t u32; double d; if( nr == maxshownlistlen ) { fputs(",...", out); } else if( nr < maxshownlistlen ) { if( notfirst ) putc(',', out); notfirst = true; i32 = getCARD32(ofs); u32 = getCARD32(ofs + 4); d = i32 + (u32 / ((double)65536.0 * (double)65536.0)) ; fprintf(out, "%.11f", d); } len--; ofs += 8; nr++; } putc(';', out); return ofs; } static size_t printLISTofFLOAT32(struct connection *c, const uint8_t *buffer, size_t buflen, const struct parameter *p, size_t len, size_t ofs){ bool notfirst = false; size_t nr = 0; if( buflen < ofs ) return ofs; if( (buflen - ofs)/4 <= len ) len = (buflen - ofs)/4; if( print_offsets ) fprintf(out,"[%d]",(int)ofs); fprintf(out,"%s=",p->name); while( len > 0 ) { uint32_t u32; float f; if( nr == maxshownlistlen ) { fputs(",...",out); } else if( nr < maxshownlistlen ) { if( notfirst ) putc(',',out); notfirst = true; u32 = getCARD32(ofs); memcpy(&f, &u32, 4); fprintf(out, "%f", f); } len--;ofs+=4;nr++; } putc(';',out); return ofs; } static size_t printLISTofATOM(struct connection *c,const uint8_t *buffer,size_t buflen,const struct parameter *p,size_t len, size_t ofs){ bool notfirst = false; size_t nr = 0; if( buflen < ofs ) return ofs; if( (buflen - ofs)/4 <= len ) len = (buflen - ofs)/4; if( print_offsets ) fprintf(out,"[%d]",(int)ofs); fprintf(out,"%s=",p->name); while( len > 0 ) { const char *value; uint32_t u32; if( nr == maxshownlistlen ) { fputs(",...",out); } else if( nr < maxshownlistlen ) { if( notfirst ) putc(',',out); notfirst = true; u32 = getCARD32(ofs); value = findConstant(p->o.constants, u32); if( value ) fprintf(out,"%s(0x%x)",value,(unsigned int)u32); else if( (value = getAtom(c,u32)) == NULL ) fprintf(out,"0x%x",(unsigned int)u32); else fprintf(out,"0x%x(\"%s\")",(unsigned int)u32,value); } len--;ofs+=4;nr++; } putc(';',out); return ofs; } static size_t printLISTofINT8(const uint8_t *buffer,size_t buflen,const struct parameter *p,size_t len, size_t ofs){ bool notfirst = false; size_t nr = 0; if( buflen < ofs ) return ofs; if( buflen - ofs <= len ) len = buflen - ofs; if( print_offsets ) fprintf(out,"[%d]",(int)ofs); fprintf(out,"%s=",p->name); while( len > 0 ) { const char *value; signed char i8; if( nr == maxshownlistlen ) { fputs(",...",out); } else if( nr < maxshownlistlen ) { if( notfirst ) putc(',',out); notfirst = true; i8 = getCARD8(ofs); value = findConstant(p->o.constants, i8); if( value ) fprintf(out,"%s(%d)",value,(int)i8); else fprintf(out,"%d",(int)i8); } len--;ofs++;nr++; } putc(';',out); return ofs; } static size_t printLISTofINT16(struct connection *c,const uint8_t *buffer,size_t buflen,const struct parameter *p,size_t len, size_t ofs){ bool notfirst = false; size_t nr = 0; if( buflen < ofs ) return ofs; if( (buflen - ofs)/2 <= len ) len = (buflen - ofs)/2; if( print_offsets ) fprintf(out,"[%d]",(int)ofs); fprintf(out,"%s=",p->name); while( len > 0 ) { const char *value; int16_t i16; if( nr == maxshownlistlen ) { fputs(",...",out); } else if( nr < maxshownlistlen ) { if( notfirst ) putc(',',out); notfirst = true; i16 = getCARD16(ofs); value = findConstant(p->o.constants, i16); if( value ) fprintf(out,"%s(%d)",value,(int)i16); else fprintf(out,"%d",(int)i16); } len--;ofs+=2;nr++; } putc(';',out); return ofs; } static size_t printLISTofINT32(struct connection *c,const uint8_t *buffer,size_t buflen,const struct parameter *p,size_t len, size_t ofs){ bool notfirst = false; size_t nr = 0; if( buflen < ofs ) return ofs; if( (buflen - ofs)/4 <= len ) len = (buflen - ofs)/4; if( print_offsets ) fprintf(out,"[%d]",(int)ofs); fprintf(out,"%s=",p->name); while( len > 0 ) { const char *value; int32_t i32; if( nr == maxshownlistlen ) { fputs(",...",out); } else if( nr < maxshownlistlen ) { if( notfirst ) putc(',',out); notfirst = true; i32 = getCARD32(ofs); value = findConstant(p->o.constants, i32); if( value ) fprintf(out,"%s(%d)",value,(int)i32); else fprintf(out,"%d",(int)i32); } len--;ofs+=4;nr++; } putc(';',out); return ofs; } static size_t printLISTofUINT8(const uint8_t *buffer,size_t buflen,const struct parameter *p,size_t len, size_t ofs){ bool notfirst = false; size_t nr = 0; if( buflen < ofs ) return ofs; if( buflen - ofs <= len ) len = buflen - ofs; if( print_offsets ) fprintf(out,"[%d]",(int)ofs); fprintf(out,"%s=",p->name); while( len > 0 ) { const char *value; unsigned char u8; if( nr == maxshownlistlen ) { fputs(",...",out); } else if( nr < maxshownlistlen ) { if( notfirst ) putc(',',out); notfirst = true; u8 = getCARD8(ofs); value = findConstant(p->o.constants, u8); if( value ) fprintf(out,"%s(%u)",value,(unsigned int)u8); else fprintf(out,"%u",(unsigned int)u8); } len--;ofs++;nr++; } putc(';',out); return ofs; } static size_t printLISTofUINT16(struct connection *c,const uint8_t *buffer,size_t buflen,const struct parameter *p,size_t len, size_t ofs){ bool notfirst = false; size_t nr = 0; if( buflen < ofs ) return ofs; if( (buflen - ofs)/2 <= len ) len = (buflen - ofs)/2; if( print_offsets ) fprintf(out,"[%d]",(int)ofs); fprintf(out,"%s=",p->name); while( len > 0 ) { const char *value; uint16_t u16; if( nr == maxshownlistlen ) { fputs(",...",out); } else if( nr < maxshownlistlen ) { if( notfirst ) putc(',',out); notfirst = true; u16 = getCARD16(ofs); value = findConstant(p->o.constants, u16); if( value ) fprintf(out,"%s(%u)",value,(unsigned int)u16); else fprintf(out,"%u",(unsigned int)u16); } len--;ofs+=2;nr++; } putc(';',out); return ofs; } static size_t printLISTofUINT32(struct connection *c,const uint8_t *buffer,size_t buflen,const struct parameter *p,size_t len, size_t ofs){ bool notfirst = false; size_t nr = 0; if( buflen < ofs ) return ofs; if( (buflen - ofs)/4 <= len ) len = (buflen - ofs)/4; if( print_offsets ) fprintf(out,"[%d]",(int)ofs); fprintf(out,"%s=",p->name); while( len > 0 ) { const char *value; uint32_t u32; if( nr == maxshownlistlen ) { fputs(",...",out); } else if( nr < maxshownlistlen ) { if( notfirst ) putc(',',out); notfirst = true; u32 = getCARD32(ofs); value = findConstant(p->o.constants, u32); if( value ) fprintf(out,"%s(%u)",value,(unsigned int)u32); else fprintf(out,"%u",(unsigned int)u32); } len--;ofs+=4;nr++; } putc(';',out); return ofs; } static size_t printLISTofVALUE(struct connection *c,const uint8_t *buffer,size_t buflen,const struct parameter *param,unsigned long valuemask, size_t ofs){ const struct value *v = param->o.values; const char *atom; bool notfirst = false; assert( v != NULL ); if( ofs > buflen ) return ofs; if( print_offsets ) fprintf(out,"[%d]",(int)ofs); fprintf(out,"%s={",param->name); while( buflen > ofs && buflen-ofs >= 4 ) { uint32_t u32; uint16_t u16; uint8_t u8; int32_t i32; int16_t i16; int8_t i8; const char *constant; if( v->name == NULL ) /* EOV */ break; if( (valuemask & v->flag) == 0 ) { v++; continue; } if( notfirst ) putc(' ',out); notfirst = true; /* this is funny, but that is the protocol... */ u32 = getCARD32(ofs); i32 = u32; u16 = u32 & 65535; i16 = u16; u8 = u32 & 255; i8 = u8; if( v->type == ft_INT32_32 ) { long long ll; /* XSync suddenly has 64 bit values allowed in * VALUES... */ if( buflen-ofs < 8 ) { c++; continue; } u32 = getCARD32(ofs + 4); ll = (((long long)i32)<< 32LL) + (long long)u32; fprintf(out, "%s=%lld", v->name, ll); ofs += 8;v++; continue; } if( v->type >= ft_BITMASK8 ) { assert(v->type <= ft_BITMASK32 ); print_bitfield(v->name,v->constants,u32); ofs += 4;v++; continue; } assert( v->type < ft_STORE8 || v->type == ft_ATOM ); switch( (v->type==ft_ATOM)?2:(v->type % 3) ) { case 0: constant = findConstant(v->constants,u8); break; case 1: constant = findConstant(v->constants,u16); break; default: constant = findConstant(v->constants,u32); break; } fputs(v->name,out);putc('=',out); if( constant != NULL ) { fputs(constant,out); putc('(',out); } switch( v->type ) { case ft_INT8: fprintf(out,"%d",(int)i8); break; case ft_INT16: fprintf(out,"%d",(int)i16); break; case ft_INT32: fprintf(out,"%d",(int)i32); break; case ft_UINT8: fprintf(out,"%u",(unsigned int)u8); break; case ft_UINT16: fprintf(out,"%u",(unsigned int)u16); break; case ft_UINT32: fprintf(out,"%u",(unsigned int)u32); break; case ft_ENUM8: if( constant == NULL ) fputs("unknown:",out); case ft_CARD8: fprintf(out,"0x%02x",(unsigned int)u8); break; case ft_ENUM16: if( constant == NULL ) fputs("unknown:",out); case ft_CARD16: fprintf(out,"0x%04x",(unsigned int)u16); break; case ft_ATOM: fprintf(out,"0x%x",(unsigned int)u32); atom = getAtom(c, u32); if( atom != NULL ) fprintf(out,"(\"%s\")", atom); break; case ft_ENUM32: if( constant == NULL ) fputs("unknown:",out); case ft_CARD32: fprintf(out,"0x%08x",(unsigned int)u32); break; default: assert(0); } if( constant != NULL ) { putc(')',out); } ofs += 4; v++; } putc('}',out); /* TODO: print error if flags left or v!=EOV? */ return ofs; } struct stack { unsigned long *base; int num; int ofs; }; static unsigned long getFromStack(struct stack *stack, size_t depth) { assert(stack != NULL && stack->ofs > (int)depth ); return stack->base[stack->ofs - 1 - depth]; } static void push(struct stack *stack, unsigned long value) { stack->base[stack->ofs] = value; stack->ofs++; assert(stack->ofsnum); } static void pop(struct stack *stack UNUSED, struct stack *oldstack UNUSED) { } static size_t print_parameters(struct connection *c, const unsigned char *buffer, unsigned int len, const struct parameter *parameters, bool bigrequest, struct stack *oldstack, bool returnstack); static size_t printLISTofStruct(struct connection *c,const uint8_t *buffer,size_t buflen,const struct parameter *p,size_t count, size_t ofs, struct stack *stack){ bool notfirst = false; const struct parameter *substruct = p->o.parameters; size_t len; size_t nr = 0; /* and the first item includes the length of an item */ assert( substruct != NULL && substruct->name == NULL && substruct->offse > 0); len = substruct->offse; substruct++; if( print_offsets ) fprintf(out,"[%d]",(int)ofs); fprintf(out,"%s=",p->name); while( buflen > ofs && buflen-ofs >= len && count > 0) { if( nr == maxshownlistlen ) { fputs(",...",out); if( len == 0 ) ofs = SIZE_MAX; break; } else if( nr < maxshownlistlen ) { if( notfirst ) putc(',',out); notfirst = true; putc('{',out); print_parameters(c, buffer+ofs, len, substruct, false, stack, false); putc('}',out); } ofs += len; count--; nr++; } putc(';',out); return ofs; } static size_t printLISTofVarStruct(struct connection *c,const uint8_t *buffer,size_t buflen,const struct parameter *p,size_t count, size_t ofs, struct stack *stack){ bool notfirst = false; // size_t ofs = (p->offset<0)?lastofs:p->offset; const struct parameter *substruct = p->o.parameters; size_t len; size_t nr = 0; /* in this case this is only the minimum value */ assert( substruct != NULL && substruct->name == NULL && substruct->offse > 0); len = substruct->offse; substruct++; if( print_offsets ) fprintf(out,"[%d]",(int)ofs); fprintf(out,"%s=",p->name); while( buflen > ofs && buflen-ofs >= len && count > 0) { size_t lentoadd; if( nr >= maxshownlistlen ) { fputs(",...;",out); /* there is nothing here to calculate the rest, * so just return the unreachable */ return SIZE_MAX; } if( notfirst ) { putc(',',out); if( print_offsets ) fprintf(out,"[%d]",(int)ofs); } notfirst = true; putc('{',out); lentoadd = print_parameters(c, buffer+ofs, buflen-ofs, substruct, false, stack, false); putc('}',out); ofs += lentoadd; count--; nr++; } putc(';',out); return ofs; } /* buffer must have at least 32 valid bytes */ static const struct event *find_event(struct connection *c, const unsigned char *buffe, const char **extension_name); static void print_event_data(struct connection *c, const unsigned char *buffer, size_t len, const struct event *event, const char *extension); static inline void print_event(struct connection *c, const unsigned char *buffer, size_t len) { const struct event *event; const char *name; size_t l; event = find_event(c, buffer, &name); if( event != NULL && event->type == event_xge) l = 32 + 4*getCARD32(4); else l = 32; if( len < l ) { // TODO: warn about incomplete? return; } print_event_data(c, buffer, l, event, name); } static size_t print_parameters(struct connection *c, const unsigned char *buffer, unsigned int len, const struct parameter *parameters, bool bigrequest, struct stack *oldstack, bool returnstack) { const struct parameter *p; unsigned long stored = INT_MAX; unsigned char format = 0; bool printspace = false; size_t lastofs = 0; struct stack newstack = *oldstack; bool sizeset = false; for( p = parameters; p->name != NULL; p++ ) { size_t s; int8_t i8; int16_t i16; int32_t i32; uint32_t uu; #ifdef STUPIDCC uint8_t u8=0; uint16_t u16=0; uint32_t u32=0; unsigned long l=0; #else uint8_t u8; uint16_t u16; uint32_t u32; unsigned long l; #endif size_t ofs; const char *value; const char *atom; double d; float f; long long ll; if( p->offse == OFS_LATER ) ofs = lastofs; else if( bigrequest && p->offse >= 4 ) /* jump over 32 bit extended length */ ofs = p->offse+4; else ofs = p->offse; if( p->type == ft_IF8 ) { unsigned char v; if( p->offse == OFS_LATER ) v = stored & 0xFF; else if( ofs name[0]) ) p = (p->o.parameters)-1; continue; } else if( p->type == ft_IF16 ) { unsigned int v; if( p->offse == OFS_LATER ) v = stored & 0xFFFF; else if( ofs+1 name[1]) + (unsigned int)0x100*(unsigned char)(p->name[0]) ) p = (p->o.parameters)-1; continue; } else if( p->type == ft_IF32 ) { unsigned long v; if( p->offse == OFS_LATER ) v = stored; else if( ofs+3 name[3]) + (((unsigned long)((unsigned char)(p->name[2])))<<8) + (((unsigned long)((unsigned char)(p->name[1])))<<16) + (((unsigned long)((unsigned char)(p->name[0])))<<24) ) p = (p->o.parameters)-1; continue; } else if( p->type == ft_IFATOM ) { const char *atomname; if( p->offse == OFS_LATER ) atomname = getAtom(c, stored); else if( ofs+4 >= len ) continue; else atomname = getAtom(c, getCARD32(ofs)); if( atomname == NULL ) continue; if( strcmp(atomname, p->name) == 0 ) p = (p->o.parameters)-1; continue; } if( printspace ) putc(' ', out); printspace = true; switch( p->type ) { case ft_LASTMARKER: if( p->offse == ROUND_32 ) lastofs = (lastofs+3)& ~3; else lastofs = ofs; printspace = false; continue; case ft_SET_SIZE: printspace = false; sizeset = true; if( p->offse == (size_t)-1 ) s = stored; else if( (p->offse & 0x80000000U) != 0 ) s = getFromStack(&newstack, p->offse - 0x80000000U); else s = p->offse; if( p->name != NULL && p->name[0] != '\0' ) s *= (unsigned char)(p->name[0]); if( len > s ) len = s; continue; case ft_FORMAT8: if( ofs < len ) format = getCARD8(ofs); printspace = false; continue; case ft_STRING8: lastofs = printSTRING8(buffer,len,p,stored,ofs); continue; case ft_LISTofCARD8: lastofs = printLISTofCARD8(buffer, len, p->name, p->o.constants, stored, ofs); continue; case ft_LISTofCARD16: lastofs = printLISTofCARD16(c,buffer,len,p,stored,ofs); continue; case ft_LISTofCARD32: lastofs = printLISTofCARD32(c,buffer,len,p,stored,ofs); continue; case ft_LISTofATOM: lastofs = printLISTofATOM(c,buffer,len,p,stored,ofs); continue; case ft_LISTofUINT8: lastofs = printLISTofUINT8(buffer,len,p,stored,ofs); continue; case ft_LISTofUINT16: lastofs = printLISTofUINT16(c,buffer,len,p,stored,ofs); continue; case ft_LISTofUINT32: lastofs = printLISTofUINT32(c,buffer,len,p,stored,ofs); continue; case ft_LISTofINT8: lastofs = printLISTofINT8(buffer,len,p,stored,ofs); continue; case ft_LISTofINT16: lastofs = printLISTofINT16(c,buffer,len,p,stored,ofs); continue; case ft_LISTofINT32: lastofs = printLISTofINT32(c,buffer,len,p,stored,ofs); continue; case ft_LISTofFormat: switch( format ) { case 8: lastofs = printLISTofCARD8(buffer, len, p->name, p->o.constants, stored, ofs); break; case 16: lastofs = printLISTofCARD16(c,buffer,len,p,stored,ofs); break; case 32: lastofs = printLISTofCARD32(c,buffer,len,p,stored,ofs); break; default: lastofs = ofs; break; } continue; case ft_Struct: printLISTofStruct(c,buffer,len,p,1,ofs,&newstack); continue; case ft_LISTofStruct: lastofs = printLISTofStruct(c,buffer,len,p,stored,ofs,&newstack); continue; case ft_LISTofVarStruct: lastofs = printLISTofVarStruct(c,buffer,len,p,stored,ofs,&newstack); continue; case ft_LISTofVALUE: lastofs = printLISTofVALUE(c,buffer,len,p,stored,ofs); continue; case ft_FIXED: if( ofs + 4 > len ) continue; if( print_offsets ) fprintf(out,"[%d]",(int)ofs); fputs(p->name,out);putc('=',out); i32 = getCARD32(ofs); d = i32 / 65536.0; fprintf(out,"%.6f", d); continue; case ft_LISTofFIXED: lastofs = printLISTofFIXED(c,buffer,len,p,stored,ofs); continue; case ft_FIXED3232: if( ofs + 8 > len ) continue; if( print_offsets ) fprintf(out, "[%d]", (int)ofs); fputs(p->name, out); putc('=', out); i32 = getCARD32(ofs); u32 = getCARD32(ofs + 4); d = i32 + (u32 / ((double)65536.0 * (double)65536.0)); fprintf(out, "%.11f", d); continue; case ft_LISTofFIXED3232: lastofs = printLISTofFIXED3232(c, buffer, len, p, stored, ofs); continue; case ft_FLOAT32: if( ofs + 4 > len ) continue; if( print_offsets ) fprintf(out,"[%d]",(int)ofs); fputs(p->name,out);putc('=',out); /* how exactly is this float transfered? */ u32 = getCARD32(ofs); memcpy(&f, &u32, 4); fprintf(out,"%f", f); continue; case ft_LISTofFLOAT32: lastofs = printLISTofFLOAT32(c,buffer,len,p,stored,ofs); continue; case ft_FRACTION16_16: if( ofs + 4 > len ) continue; if( print_offsets ) fprintf(out,"[%d]",(int)ofs); fputs(p->name,out);putc('=',out); i16 = getCARD16(ofs); u16 = getCARD16(ofs + 2); fprintf(out,"%hd/%hu", i16, u16); continue; case ft_FRACTION32_32: if( ofs + 8 > len ) continue; if( print_offsets ) fprintf(out,"[%d]",(int)ofs); fputs(p->name,out);putc('=',out); i32 = getCARD32(ofs); u32 = getCARD32(ofs + 4); fprintf(out,"%d/%u", i32, u32); continue; case ft_UFRACTION32_32: if( ofs + 8 > len ) continue; if( print_offsets ) fprintf(out,"[%d]",(int)ofs); fputs(p->name,out);putc('=',out); uu = getCARD32(ofs); u32 = getCARD32(ofs + 4); fprintf(out,"%u/%u", uu, u32); continue; case ft_INT32_32: if( ofs + 8 > len ) continue; if( print_offsets ) fprintf(out,"[%d]",(int)ofs); fputs(p->name,out);putc('=',out); i32 = getCARD32(ofs); u32 = getCARD32(ofs + 4); ll = (((long long)i32)<< 32LL) + (long long)u32; fprintf(out, "%lld", ll); continue; case ft_EVENT: if( len >= ofs + 32 ) print_event(c, buffer + ofs, len - ofs); // TODO: do something with the size here? continue; case ft_ATOM: if( ofs + 4 > len ) continue; if( print_offsets ) fprintf(out,"[%d]",(int)ofs); fputs(p->name,out);putc('=',out); u32 = getCARD32(ofs); value = findConstant(p->o.constants, u32); atom = getAtom(c, u32); if( value != NULL ) fprintf(out,"%s(0x%x)",value, (unsigned int)u32); else if( atom == NULL ) fprintf(out,"0x%x(unrecognized atom)",(unsigned int)u32); else fprintf(out,"0x%x(\"%s\")",(unsigned int)u32, atom); continue; case ft_BE32: if( ofs + 4 > len ) continue; fputs(p->name,out);putc('=',out); fprintf(out,"0x%08x",(unsigned int)getBE32(ofs)); continue; case ft_GET: stored = getFromStack(&newstack,p->offse); printspace = false; continue; case ft_DECREMENT_STORED: if( stored < p->offse ) stored = 0; else stored -= p->offse; printspace = false; continue; case ft_DIVIDE_STORED: if (stored % p->offse) fprintf(stderr, "count (%lu) not divisible by %zu\n", stored, p->offse); stored /= p->offse; printspace = false; continue; case ft_SET: stored = p->offse; printspace = false; continue; default: break; } assert( p->type <= ft_BITMASK32); switch( p->type % 3) { case 0: if( (ofs+1) > len ) /* this field is missing */ continue; u8 = getCARD8(ofs); l = u8; break; case 1: if( (ofs+2) > len ) /* this field is missing */ continue; u16 = getCARD16(ofs); l = u16; break; case 2: if( (ofs+4) > len ) /* this field is missing */ continue; u32 = getCARD32(ofs); l = u32; break; } if( p->type >= ft_BITMASK8 ) { assert(p->type <= ft_BITMASK32 ); print_bitfield(p->name, p->o.constants, l); continue; } if( p->type >= ft_PUSH8 ) { assert(p->type <= ft_PUSH32 ); push(&newstack,l); if( !print_counts) { printspace = false; continue; } } else if( p->type >= ft_STORE8 ) { assert(p->type <= ft_STORE32); stored = l; if( !print_counts) { printspace = false; continue; } } value = findConstant(p->o.constants, l); if( print_offsets ) fprintf(out,"[%d]",(int)ofs); fputs(p->name,out);putc('=',out); if( value != NULL ) { fputs(value,out); putc('(',out); } switch( p->type ) { case ft_INT8: i8 = u8; fprintf(out,"%d",(int)i8); break; case ft_INT16: i16 = u16; fprintf(out,"%d",(int)i16); break; case ft_INT32: i32 = u32; fprintf(out,"%d",(int)i32); break; case ft_PUSH8: case ft_STORE8: case ft_UINT8: fprintf(out,"%u",(unsigned int)u8); break; case ft_PUSH16: case ft_STORE16: case ft_UINT16: fprintf(out,"%u",(unsigned int)u16); break; case ft_PUSH32: case ft_STORE32: case ft_UINT32: fprintf(out,"%u",(unsigned int)u32); break; case ft_ENUM8: if( value == NULL ) fputs("unknown:",out); case ft_CARD8: fprintf(out,"0x%02x",(unsigned int)u8); break; case ft_ENUM16: if( value == NULL ) fputs("unknown:",out); case ft_CARD16: fprintf(out,"0x%04x",(unsigned int)u16); break; case ft_ENUM32: if( value == NULL ) fputs("unknown:",out); case ft_CARD32: fprintf(out,"0x%08x",(unsigned int)u32); break; case ft_BITMASK8: case ft_BITMASK16: case ft_BITMASK32: case ft_STRING8: case ft_FORMAT8: case ft_LISTofCARD8: case ft_LISTofCARD16: case ft_LISTofCARD32: case ft_LISTofATOM: case ft_LISTofUINT8: case ft_LISTofUINT16: case ft_LISTofUINT32: case ft_LISTofINT8: case ft_LISTofINT16: case ft_LISTofINT32: case ft_LISTofFormat: case ft_LISTofVALUE: case ft_Struct: case ft_LISTofStruct: case ft_LISTofVarStruct: case ft_IF8: case ft_IF16: case ft_IF32: case ft_IFATOM: case ft_BE32: case ft_ATOM: case ft_LASTMARKER: case ft_SET_SIZE: case ft_GET: case ft_DECREMENT_STORED: case ft_DIVIDE_STORED: case ft_SET: case ft_EVENT: case ft_FRACTION16_16: case ft_FRACTION32_32: case ft_UFRACTION32_32: case ft_INT32_32: case ft_FIXED: case ft_LISTofFIXED: case ft_FIXED3232: case ft_LISTofFIXED3232: case ft_FLOAT32: case ft_LISTofFLOAT32: assert(0); } if( value != NULL ) { putc(')',out); } } if( returnstack ) *oldstack = newstack; else pop(&newstack,oldstack); if( sizeset ) { if( lastofs < len ) { if( printspace ) putc(' ', out); lastofs = printLISTofCARD8(buffer, len, "unexpected-data", NULL, len - lastofs, lastofs); assert( lastofs == len ); } else if( lastofs > len ) { fprintf(out, "[strange: size-len=%d]", (int)(lastofs-len)); } return len; } else return lastofs; } /* replace ra(GrabButton) in requests.inc by ra2(GrabButton) * and add this function and all * GrabButton requests will have an AnyModifier set before * being forwarded to the server... >:-] * static bool requestGrabButton(struct connection *c, bool pre, bool bigrequest,struct expectedreply *reply) { if( !pre ) return false; if( c->bigendian ) c->clientbuffer[22] |= 0x80; else c->clientbuffer[23] |= 0x80; return false; } */ bool requestQueryExtension(struct connection *c, bool pre, bool bigrequest UNUSED, struct expectedreply *reply) { size_t len; if( pre ) return false; if( reply == NULL) return false; if( c->clientignore <= 8 ) return false; reply->data_type = dt_EXTENSION; len = c->clientignore-8; if( len > clientCARD16(4) ) len = clientCARD16(4); reply->data.extension = find_extension(c->clientbuffer+8, len); if( reply->data.extension == NULL ) { reply->data_type = dt_UNKNOWN_EXTENSION; reply->data.uextension = register_unknown_extension(c, c->clientbuffer+8, len); } return false; } bool requestInternAtom(struct connection *c, bool pre, bool bigrequest UNUSED, struct expectedreply *reply) { uint16_t len; if( pre ) return false; if( reply == NULL) return false; if( c->clientignore <= 8 ) return false; len = clientCARD16(4); if( c->clientignore < (unsigned int)8 + len) return false; reply->data_type = dt_ATOM; reply->data.atom = newAtom((const char*)c->clientbuffer+8, len); return false; } /* Reactions to some replies */ void replyListFontsWithInfo(struct connection *c, bool *ignore, bool *dontremove, struct expectedreply *dummy UNUSED) { unsigned int seq = serverCARD16(2); if( serverCARD8(1) == 0 ) { startline(c, TO_CLIENT, "%04x:%u: Reply to ListFontsWithInfo: end of list\n", seq, c->serverignore); *ignore = true; } else *dontremove = true; } void replyQueryExtension(struct connection *c, bool *ignore UNUSED, bool *dontremove UNUSED, struct expectedreply *d) { /* nothing to do if the extension is not available */ if( serverCARD8(8) == 0) return; if( d->data_type == dt_UNKNOWN_EXTENSION && d->data.uextension != NULL ) { struct unknownextension *n, **e = &c->waiting; while( *e != NULL && *e != d->data.uextension ) e = &(*e)->next; if( *e != NULL ) { d->data.uextension = NULL; n = *e; *e = n->next; n->next = c->unknownextensions; c->unknownextensions = n; n->major_opcode = serverCARD8(9); n->first_event = serverCARD8(10); n->first_error = serverCARD8(11); } } if( d->data_type == dt_EXTENSION && d->data.extension != NULL ) { struct usedextension *u; u = malloc(sizeof(struct usedextension)); if( u == NULL ) abort(); u->next = c->usedextensions; u->extension = d->data.extension; u->major_opcode = serverCARD8(9); u->first_event = serverCARD8(10); u->first_error = serverCARD8(11); c->usedextensions = u; } if( denyallextensions ) { /* disable all extensions */ c->serverbuffer[8] = 0; } } void replyInternAtom(struct connection *c, bool *ignore UNUSED, bool *dontremove UNUSED, struct expectedreply *d) { uint32_t atom; if( d->data_type != dt_ATOM || d->data.atom == NULL ) return; atom = serverCARD32(8); internAtom(c, atom, d->data.atom); } #define ft_COUNT8 ft_STORE8 #define ft_COUNT16 ft_STORE16 #define ft_COUNT32 ft_STORE32 #define RESET_COUNTER { INT_MAX, "", ft_SET, NULL} #define SET_COUNTER(cnt) { cnt, "", ft_SET, NULL} const struct request *requests; size_t num_requests; const struct parameter *unexpected_reply; static inline void free_expectedreplylist(struct expectedreply *r) { while( r != NULL ) { struct expectedreply *n = r->next; free(r); r = n; } } static inline const struct extension *find_extension_by_opcode(struct connection *c, unsigned char req) { struct usedextension *u; for( u = c->usedextensions; u != NULL ; u = u->next ) { if( req != u->major_opcode ) continue; return u->extension; } return NULL; } static inline const char *find_unknown_extension(struct connection *c, unsigned char req) { struct unknownextension *e; for( e = c->unknownextensions ; e != NULL ; e = e->next ) { if( req == e->major_opcode ) { return e->name; } } return NULL; } static inline const struct request *find_extension_request(struct connection *c,unsigned char req,unsigned char subreq,const char **extension) { const struct extension *e; const char *name; e = find_extension_by_opcode(c, req); if( e != NULL ) { *extension = e->name; if( subreq < e->numsubrequests ) return e->subrequests + subreq; else return NULL; } name = find_unknown_extension(c, req); if( name != NULL ) *extension = name; return NULL; } static inline void print_client_request(struct connection *c,bool bigrequest) { unsigned char req = clientCARD8(0); unsigned char subreq = clientCARD8(1); const struct request *r; const char *extensionname = ""; bool ignore; size_t len; unsigned long stackvalues[30]; struct stack stack; stack.base = stackvalues; stack.num = 30; stack.ofs = 0; len = c->clientignore; if( len > c->clientcount ) len = c->clientcount; r = find_extension_request(c,req,subreq,&extensionname); if( r == NULL ) { if( req < num_requests ) r = &requests[req]; else r = &requests[0]; } c->seq++; if( r->request_func == NULL ) ignore = false; else ignore = r->request_func(c,true,bigrequest,NULL); if( !ignore ) { const char *name; name = r->name; if( name == NULL ) name = "UNKNOWN"; assert( r->parameters != NULL); if( extensionname[0] == '\0' ) startline(c, TO_SERVER, "%04x:%3u: Request(%hhu): %s ", (unsigned int)(c->seq),c->clientignore, req, name ); else startline(c, TO_SERVER, "%04x:%3u: %s-Request(%hhu,%hhu): %s ", (unsigned int)(c->seq), c->clientignore, extensionname, req, subreq, name ); if( r->parameters != NULL ) print_parameters(c, c->clientbuffer, len, r->parameters, bigrequest, &stack, true); if( r->request_func != NULL ) (void)r->request_func(c,false,bigrequest,NULL); putc('\n',out); } if( r->answers != NULL ) { /* register an awaited response */ int vc = r->record_variables;; struct expectedreply *a = malloc(sizeof(struct expectedreply) + vc * sizeof(long)); if( a == NULL ) abort(); a->next = c->expectedreplies; a->seq = c->seq; a->from = r; a->data_type = dt_NONE; a->data.data = NULL; while( vc > 0 ) { if( stack.ofs > 0 ) a->values[--vc] = stack.base[--stack.ofs]; else a->values[--vc] = 0; } if( r->request_func != NULL ) (void)r->request_func(c,false,bigrequest,a); c->expectedreplies = a; } } static inline void print_generic_event(struct connection *c, const unsigned char *buffer, size_t len, const struct event *event) { unsigned long stackvalues[30]; struct stack stack; stack.base = stackvalues; stack.num = 30; stack.ofs = 0; uint8_t opcode = getCARD8(1); uint16_t evtype = getCARD16(8); const struct extension *extension; extension = find_extension_by_opcode(c, opcode); if( extension == NULL ) { const char *name = find_unknown_extension(c, opcode); if( name != NULL ) { fprintf(out, "%s(%hhu) ", name, opcode); } else { fprintf(out, "unknown extension %hhu ", opcode); } print_parameters(c, buffer, len, event->parameters, false, &stack, false); return; } fprintf(out, "%s(%hhu) ", extension->name, opcode); if( evtype > extension->numxgevents || extension->xgevents[evtype].name == NULL ) { fprintf(out, "unknown(%hu) ", evtype); print_parameters(c, buffer, len, event->parameters, false, &stack, false); } else { const struct event *xgevent = &extension->xgevents[evtype]; const struct parameter *parameters = xgevent->parameters; if( parameters == NULL ) parameters = event->parameters; fprintf(out, "%s(%hu) ", xgevent->name, evtype); print_parameters(c, buffer, len, parameters, false, &stack, false); } } static void print_event_data(struct connection *c, const unsigned char *buffer, size_t len, const struct event *event, const char *extension) { uint8_t code = getCARD8(0); unsigned long stackvalues[30]; struct stack stack; stack.base = stackvalues; stack.num = 30; stack.ofs = 0; if( (code & 0x80) != 0 ) fputs("(generated) ",out); code &= 0x7F; if( event == NULL ) { fprintf(out, "unknown code %hhu", code); // TODO: print data as LISTofCARD8 ? return; } if( extension != NULL ) { fputs(extension, out); putc('-', out); } fprintf(out,"%s(%hhu) ", event->name, code); switch( event->type ) { case event_normal: print_parameters(c, buffer, len, event->parameters, false, &stack, false); break; case event_xge: print_generic_event(c, buffer, len, event); break; } } static inline void print_server_event(struct connection *c) { const struct event *event; const char *name; event = find_event(c, c->serverbuffer, &name); if( event != NULL && event->type == event_xge) { if( c->servercount < 32 + 4*serverCARD32(4) ) { /* wait till fully received */ return; } c->serverignore = 32 + 4*serverCARD32(4); } else c->serverignore = 32; startline(c, TO_CLIENT, "%04llx: Event ", (unsigned long long)c->seq); print_event_data(c, c->serverbuffer, c->serverignore, event, name); putc('\n',out); } static inline void print_server_reply(struct connection *c) { unsigned int cmd,seq; struct expectedreply *replyto,**lastp; size_t len; unsigned long stackvalues[30]; struct stack stack; stack.base = stackvalues; stack.num = 30; stack.ofs = 0; c->serverignore = 32 + 4*serverCARD32(4); len = c->serverignore; if( len > c->servercount ) len = c->servercount; cmd = serverCARD8(1); seq = serverCARD16(2); for( lastp = &c->expectedreplies ; (replyto=*lastp) != NULL ; lastp=&replyto->next){ if( (replyto->seq & 0xFFFF ) == seq ) { bool ignore = false, dontremove = false; assert( replyto->from != NULL); if( replyto->from->reply_func != NULL ) replyto->from->reply_func(c, &ignore, &dontremove, replyto); if( !ignore ) { const char *name = replyto->from->name; int i; if( name == NULL ) name = "UNKNOWN"; startline(c, TO_CLIENT, "%04x:%u: Reply to %s: ", seq, (unsigned int)c->serverignore, name); for( i = 0; i < replyto->from->record_variables; i++ ) { push(&stack, replyto->values[i]); } print_parameters(c, c->serverbuffer, len, replyto->from->answers, false, &stack, false); putc('\n',out); } if( !dontremove ) { *lastp = replyto->next; if( replyto->next != NULL ) { startline(c, TO_CLIENT, " still waiting for reply to seq=%04llx\n", (unsigned long long)replyto->next->seq); } free(replyto); } return; } } startline(c, TO_CLIENT, "%04x:%u: unexpected Reply: ", seq, (unsigned int)c->serverignore); print_parameters(c, c->serverbuffer, len, unexpected_reply, false, &stack, false); putc('\n',out); } const char * const *errors; size_t num_errors; static inline void print_server_error(struct connection *c) { unsigned int cmd = serverCARD8(1); struct usedextension *u; const char *errorname; uint16_t seq; struct expectedreply *replyto, **lastp; c->serverignore = 32; if( cmd < num_errors ) errorname = errors[cmd]; else { errorname = "unknown"; for( u = c->usedextensions; u != NULL ; u = u->next ) { unsigned int i; if( cmd < u->first_error ) continue; i = cmd-u->first_error; if( i >= u->extension->numerrors ) continue; errorname = u->extension->errors[i]; break; } } seq = (unsigned int)serverCARD16(2); startline(c, TO_CLIENT, "%04x:Error %hhu=%s: major=%u, minor=%u, bad=%u\n", seq, cmd, errorname, (int)serverCARD8(10), (int)serverCARD16(8), (int)serverCARD32(4)); /* don't wait for any answer */ for( lastp = &c->expectedreplies ; (replyto=*lastp) != NULL ; lastp=&replyto->next){ if( (replyto->seq & 0xFFFF ) == seq ) { *lastp = replyto->next; free(replyto); return; } } } const struct parameter *setup_parameters; void parse_client(struct connection *c) { size_t l; bool bigrequest; switch( c->clientstate ) { case c_start: if( c->clientcount < 12 ) { return; } if( c->clientbuffer[0] == 'B' ) c->bigendian = true; else if( c->clientbuffer[0] == 'l' ) c->bigendian = false; else { startline(c, TO_SERVER, " Byteorder (%d='%c') is neither 'B' nor 'l', ignoring all further data!", (int)c->clientbuffer[0],c->clientbuffer[0]); c->clientstate = c_amlost; c->serverstate = s_amlost; return; } l = 12 + padded(clientCARD16(6)) + padded(clientCARD16(8)); if( c->clientcount < l ) { /* wait for auth data first */ return; } c->clientignore = l; startline(c, TO_SERVER, " am %s want %d:%d authorising with '%*s' of length %d\n", c->bigendian?"msb-first":"lsb-first", (int)clientCARD16(2), (int)clientCARD16(4), (int)clientCARD16(6), &c->clientbuffer[12], (int)clientCARD16(8)); c->clientstate = c_normal; return; case c_normal: if( c->clientcount < 4 ) { startline(c, TO_SERVER, " Warning: Waiting for rest of package (yet only got %u)!\n", c->clientcount); return; } l = 4*clientCARD16(2); if( l == 0 ) { if( c->clientcount < 8 ) { startline(c, TO_SERVER, " Warning: Waiting for rest of package (yet only got %u)!\n", c->clientcount); return; } l = 4*clientCARD32(4); bigrequest = true; } else bigrequest = false; if( c->clientcount == sizeof(c->clientbuffer) ) startline(c, TO_SERVER, " Warning: buffer filled!\n"); else if( c->clientcount < l ) { startline(c, TO_SERVER, " Warning: Waiting for rest of package (yet got %u of %u)!\n", c->clientcount,(unsigned int)l); return; } c->clientignore = l; print_client_request(c,bigrequest); return; case c_amlost: c->clientignore = c->clientcount; return; } assert(false); } void parse_server(struct connection *c) { /* additional len in multiple of 4 */ unsigned int len,cmd; if( c->serverstate == s_amlost ) { c->serverignore = c->servercount; return; } if( c->servercount < 8 ) return; switch( c->serverstate ) { case s_start: len = serverCARD16(6); if( c->servercount/4 < 2+len ) return; c->serverignore = 8+4*len; cmd = serverCARD8(0); switch( cmd ) { case 0: startline(c, TO_CLIENT, " Failed, version is %d:%d reason is '%*s'.\n", (int)serverCARD16(2), (int)serverCARD16(4), (int)(4*len), &c->serverbuffer[8]); break; case 2: startline(c, TO_CLIENT, " More authentication needed, reason is '%*s'.\n", (int)(4*len), &c->serverbuffer[8]); break; case 1: startline(c, TO_CLIENT, " Success, version is %d:%d ", (int)serverCARD16(2), (int)serverCARD16(4)); { unsigned long stackvalues[30]; struct stack stack; stack.base = stackvalues; stack.num = 30; stack.ofs = 0; print_parameters(c, c->serverbuffer, c->serverignore, setup_parameters, false, &stack, false); putc('\n',out); } c->serverstate = s_normal; break; } return; case s_normal: if( c->servercount < 32 ) return; switch( c->serverbuffer[0] ) { case 0: /* Error */ print_server_error(c); break; case 1: /* Reply */ print_server_reply(c); break; default: print_server_event(c); break; } return; case s_amlost: break; } assert(false); } const struct event *events; size_t num_events; static const struct event *find_event(struct connection *c, const unsigned char *buffer, const char **extension_name) { struct usedextension *u; uint8_t code = getCARD8(0); code &= 0x7F; /* first look in extensions, in case we are on an xserver that * uses some of the new core event codes for extensions */ for( u = c->usedextensions ; u != NULL ; u = u->next ) { if( u->first_event == 0) continue; if( code >= u->first_event && code-u->first_event < u->extension->numevents) { *extension_name = u->extension->name; return u->extension->events + (code - u->first_event); } } if( code > 1 || code <= num_events ) { *extension_name = NULL; return &events[code]; } return NULL; } const struct extension *extensions; size_t num_extensions; const struct extension *find_extension(const uint8_t *name,size_t len) { unsigned int i; for( i = 0 ; i < num_extensions ; i++ ) { if( len < extensions[i].namelen ) continue; // TODO: why only compare up the length here? if( strncmp((const char*)extensions[i].name,(const char*)name,len) == 0 ) return extensions + i; } return NULL; } xtrace-1.3.1/x11common.c0000644000175100017510000000613211704002604011707 00000000000000/* This file is part of "xtrace" * Copyright (C) 2005 Bernhard R. Link * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include #include #include #include #include #include #include #include #include "xtrace.h" #define X_TCP_PORT 6000 const char *parseDisplay(const char *displayname, char **protocol, char **hostname, int *display, int *screen, int *family ) { const char *p = displayname; const char *q; /* Xlib reads display names as * [protocol/] [hostname] : displaynumber [.screennumber] */ /* find the protocol */ while( *p != '\0' && *p != ':' && *p != '/' ) p++; if( *p == '/' ) { if( p != displayname ) { *protocol = strndup(displayname,p-displayname); if( *protocol == NULL ) return "Out of Memory"; } else *protocol = NULL; p++; q = p; while( *p != '\0' && *p != ':' ) p++; } else { *protocol = NULL; q = displayname; } if( *p == '\0' ) { free(*protocol); *protocol = NULL; return "No colon (':') found"; } if( p != q && !(p-q == 4 && strncmp(q,"unix",4) == 0)) { *hostname = strndup(q,p-q); if( *hostname == NULL ) return "Out of Memory"; if( *protocol == NULL ) *protocol = strdup("tcp"); } else { *hostname = NULL; free(*protocol); *protocol = strdup("local"); } if( *protocol == NULL ) { free(*hostname); *hostname = NULL; return "Out of Memory"; } assert( *p == ':' ); /* TODO: make sure we are in C locale, otherwise this can go wrong */ p++; *display = strtol(p,(char**)&q,10); if( *q == '.' ) { p = q + 1; *screen = strtol(p,(char**)&q,10); } if( *q != '\0' ) { free(*protocol); *protocol = NULL; free(*hostname); *hostname = NULL; return "Garbage after first colon, only digits and a single dot allowed"; } if( strcasecmp(*protocol,"inet")==0||strcasecmp(*protocol,"tcp")==0 ) { *family = AF_INET; } else if( strcasecmp(*protocol,"unix")==0||strcasecmp(*protocol,"local")==0 ) { *family = AF_UNIX; } else { free(*protocol); free(*hostname); *protocol = NULL; *hostname = NULL; return "Unknown protocol"; } return NULL; } const char *generateSocketName(struct sockaddr_un *addr,int display) { addr->sun_family = AF_UNIX; /* TODO: length-check ? */ snprintf(addr->sun_path,sizeof(addr->sun_path),"/tmp/.X11-unix/X%d",display); return NULL; } uint16_t calculateTCPport(int display) { return htons(X_TCP_PORT+display); }