summaryrefslogtreecommitdiff
path: root/scope.c
AgeCommit message (Collapse)AuthorFilesLines
2012-10-22Add -V option to print version and exitAlan Coopersmith1-0/+5
Can't use -v, as that's already in use for verbosity level Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-10-02Add experimental support for reading a previously recorded fileAlan Coopersmith1-4/+326
If you run "xscope -r -v0 > xscope.raw", then you can later run "xscope -f xscope.raw" to decode the data. Mainly adding this to aid in testing decoding of new extensions, so I don't have to re-run the commands over and over, just replay a log file. (Which may or may not have been edited to include additional request data for further testing of types & formats that clients may not make it easy to generate.) Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2012-10-02Refactor fd closing into CloseFD helper functionAlan Coopersmith1-9/+3
All versions now perform same check for XtransConn data to decide whether to use _X11TransClose or regular close, which is needed for being able to read data from pre-recorded files instead of live sockets. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
2012-10-02Add -I command line flag to enter interactive mode at startupAlan Coopersmith1-0/+5
Avoids having to try to time a ^C after the signal handler is set up but before any data is handled. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2012-10-02Print UTF8_STRING properties as text if locale uses UTF-8 charsetAlan Coopersmith1-1/+23
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
2012-10-02Add _X_NORETURN to additional functions suggested by gcc warningsAlan Coopersmith1-2/+2
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2012-10-02Convert remaining sprintf calls to snprintfAlan Coopersmith1-3/+3
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
2012-07-21Combine usage message into single string for fprintfAlan Coopersmith1-12/+13
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2012-07-21Convert to X.Org standard indentation & cleanup whitespaceAlan Coopersmith1-912/+797
Performed with util/modular/x-indent-all.sh, followed by manual fixups Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2012-07-08Bug 46691 - xscope-1.3.1 deadlocks if client or server would blockPeter Jeremy1-1/+1
https://bugs.freedesktop.org/show_bug.cgi?id=46691 Use correct write FD to select() on. FlushFD() contains logic to handle the Xclient or Xserver blocking on a write() by changing the global read and write fd_set's so that MainLoop() will select() on the blocking write FD instead of the peer read FD. Unfortunately, the code contains a logic error so that it winds up select()ing for write on the peer FD instead of the blocked FD. Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-12-04Fix builds of scope.c with Solaris Studio compilersAlan Coopersmith1-0/+5
Required in order to build with Studio cc now that xorg-macros is setting -errwarn=E_FUNC_HAS_NO_RETURN_STMT since a bug in the Solaris system headers causes the noreturn attribute to not be correctly applied to the exit() prototype in <stdlib.h> when building with Studio instead of gcc. Otherwise compiler exits with error: "scope.c", line 643: Function has no return statement : CMDQuit Uses Studio-specific pragma instead of adding another exit() prototype with a noreturn attribute to avoid causing gcc to warn about having a redundant prototype for the exit() function. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-09-30Add const attributes to clear gcc -Wwrite-strings warningsAlan Coopersmith1-5/+5
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-09-30Store ClientNumber as int instead of converting back & forth to longAlan Coopersmith1-1/+1
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-09-30File descriptors should be stored in ints not shortsAlan Coopersmith1-3/+3
All OS routines take and return ints for file descriptors, so stop converting back and forth to shorts. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-09-30Make FDinfo dynamically allocatedAlan Coopersmith1-1/+1
We still allocate one fdinfo struct for every possible FD up front instead of resizing as needed, but they're much smaller now that we just have a pointer to the 32k buffer instead of including it directly in the fdinfo. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-09-30Allocate buffers dynamically as needed instead of as part of fdinfo structAlan Coopersmith1-0/+16
Previously we'd allocate a buffer of 32k each for each fd up to the compiled in StaticMaxFD, which could be as large as 65535 on some systems (that's the Solaris 64-bit default FD_SETSIZE), resulting in gigabytes of bss allocation on startup. Now we don't allocate until we're actually setting up the fdinfo for use as part of a client<->server connection. Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-09-30Stop wrapping malloc & freeAlan Coopersmith1-1/+1
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-09-30Clean up existing malloc callsAlan Coopersmith1-1/+1
Remove unnecessary casts from (void *) Ensure return value is checked. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2010-10-30Sun's copyrights now belong to OracleAlan Coopersmith1-1/+1
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2010-06-09Use strncpy rather than strlcpy as it is not available on LinuxGaetan Nadon1-1/+1
Because it is available on other platforms, it only fails on Linux. strncpy should be safe enough in this situation where a constant is copied. The xserver private impl of strlcpy is not available to apps. Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
2010-05-14Allow quitting via EOF (^D) on the command lineJeremy Huddleston1-2/+8
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2010-04-29Eliminate a few compiler warnings for style and signedness.Jeremy Huddleston1-3/+2
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2010-01-14Update Sun license notices to current X.Org standard formAlan Coopersmith1-23/+17
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
2009-09-30Fix breakpoint disablingAlan Coopersmith1-6/+9
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
2009-09-29Add support for setting breakpoints on extension requestsAlan Coopersmith1-4/+35
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
2009-09-29Fix typo in "Enabling all breakpoints" messageAlan Coopersmith1-1/+1
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
2009-09-29Show request name, not just number, in breakpoint listAlan Coopersmith1-2/+5
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
2009-09-28Replace platform #ifdefs with autoconf testsAlan Coopersmith1-6/+1
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
2009-09-27Enable raw mode option codeAlan Coopersmith1-6/+1
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
2009-06-15Include sys/param.h earlierYanko Kaneti1-1/+0
MAXHOSTNAMELEN is also needed for some scope.h declarations
2009-05-06Clear many compiler & sparse warningsAlan Coopersmith1-36/+35
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
2009-05-06Constify many char pointersAlan Coopersmith1-4/+5
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
2009-05-06Convert select() arguments back to fd_set structuresAlan Coopersmith1-10/+13
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
2009-05-06Ansify prototypes and move extern declarations to header filesAlan Coopersmith1-127/+128
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
2009-05-06Delete DECnet supportAlan Coopersmith1-238/+2
2009-05-06Delete PEX codeAlan Coopersmith1-4/+0
2009-05-06Merge branch 'keithp'Alan Coopersmith1-217/+761
Conflicts: common.c decode11.c fd.c fd.h print11.c prtype.c scope.c scope.h server.c table11.c x11.h xscope.man
2009-05-04Import xscope bits into keithp.com CVSKeith Packard1-233/+736
2008-11-05X.Org bug #18392: #include <sys/param.h> for MAXHOSTNAMELEN on CygwinAlan Coopersmith1-0/+1
<http://bugs.freedesktop.org/show_bug.cgi?id=18392>
2008-09-11Merge Sun's version of xscope inStuart Kreitman1-161/+464
Conversion to ANSI C SysVR4 support Conversion of networking code to use xtrans
2008-09-11Import initial version from James PetersonAlan Coopersmith1-0/+692