home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sources.x
- From: adam@iset.scan.mc.xerox.com (Adam Stein)
- Subject: v19i077: Xtoolplaces - save current X desktop window information, Part03/03
- Message-ID: <1993Apr6.143533.15371@sparky.imd.sterling.com>
- X-Md4-Signature: ae256ebdfdbc157b76b012e1aaafe720
- Date: Tue, 6 Apr 1993 14:35:33 GMT
- Approved: chris@sparky.imd.sterling.com
-
- Submitted-by: adam@iset.scan.mc.xerox.com (Adam Stein)
- Posting-number: Volume 19, Issue 77
- Archive-name: Xtoolplaces/part03
- Environment: X11, !mwm, !tvtwm
- Supersedes: Xtoolplaces: Volume 14, Issue 2-3
-
- #! /bin/sh
- # This is a shell archive. Remove anything before this line, then feed it
- # into a shell via "sh file" or similar. To overwrite existing files,
- # type "sh file -c".
- # Contents: MANIFEST CHANGES Xtoolplaces.ad addon.h addon.sample
- # missing.sample patchlevel.h strdup.c strstr.c xtoolplaces.h
- # Wrapped by chris@sparky on Tue Apr 6 09:15:54 1993
- PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin ; export PATH
- echo If this archive is complete, you will see the following message:
- echo ' "shar: End of archive 3 (of 3)."'
- if test -f 'MANIFEST' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'MANIFEST'\"
- else
- echo shar: Extracting \"'MANIFEST'\" \(1324 characters\)
- sed "s/^X//" >'MANIFEST' <<'END_OF_FILE'
- X File Name Shar # Description
- X-----------------------------------------------------------
- XCHANGES 1 List of changes release to release
- XImakefile 1 Imake Makefile
- XMANIFEST 1 This list of files
- XMakefile.simple 1 Simple makefile
- XREADME 1 Details about program
- XXtoolplaces.ad 1 Default resource file
- Xadddisplay.c 1 Add '-display' for multiple screens
- Xaddon.c 1 Add on arguments routines
- Xaddon.h 2 Addon structure definition
- Xaddon.sample 2 Sample addon file (used with '-a')
- Xcombine.c 1 Combine multiple args into 1 string
- Xcopyright.c 1 Copyright notice for executable
- Xfix_command.c 1 Fix xview problem routine
- Xgetargs.c 1 Get resource databases
- Xgetgeom.c 1 Get geometry information
- Xgetinfo.c 2 Get window information routines
- Xis.c 2 Query routines
- Xmake_list.c 2 Generate list of screens to save
- Xmissing.c 2 Missing applications routines
- Xmissing.sample 2 Sample missing file (used with '-m')
- Xpatchlevel.h 2 Patchlevel info
- Xstrdup.c 2 BSD strdup() function
- Xstrstr.c 2 System 5 strstr() function
- Xxtoolplaces.c 2 The xtoolplaces program
- Xxtoolplaces.h 2 Common definitions
- Xxtoolplaces.man 1 Xtoolplaces man page
- X
- END_OF_FILE
- if test 1324 -ne `wc -c <'MANIFEST'`; then
- echo shar: \"'MANIFEST'\" unpacked with wrong size!
- fi
- # end of 'MANIFEST'
- fi
- if test -f 'CHANGES' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'CHANGES'\"
- else
- echo shar: Extracting \"'CHANGES'\" \(1879 characters\)
- sed "s/^X//" >'CHANGES' <<'END_OF_FILE'
- XFrom 1.3 (patchlevel 3) -> 1.3.1 (patchlevel 3.1):
- X-------------------------------------------------
- X
- X - Changed the adding of geometry options to be the first options as opposed
- X to adding them onto the end. This is especially needed for programs that
- X have an option that needs to go at the end (i.e. xterm's -e option).
- X (brought to my attention by etj90)
- X
- XFrom 1.2 (patchlevel 2) -> 1.3 (patchlevel 3):
- X---------------------------------------------
- X
- X - Fixed compile bugs as reported by gcc. Add gcc support in Imakefile
- X and Makefile.simple (they are commented out). (compile bugs brought
- X to my addention by Michael Salmon, Chung Tin Kwok, Simon Leinen, Nelson
- X Minar, Malcolm C. Strickland)
- X
- X - Fixed bug which caused xtoolplaces to core dump (when epoch is around).
- X (brought to my attention by Ted Rodriguez-Bell).
- X
- XFrom 1.2 Beta (patchlevel 1) -> 1.2 Final (patchlevel 2):
- X--------------------------------------------------------
- X - Added support for emacs (source code supplied by Kresten).
- X
- X - Added support for xconsole (suggested by Matthias Pfuetzner).
- X
- X - The function strdup() was added for systems that don't have it
- X (brought to my attention by Renato).
- X
- X - Put double quotes around options with whitespace in them (brought to
- X my attention by Larry W. Virden).
- X
- XFrom 1.1 Beta (patchlevel 1) -> 1.2 Beta (patchlevel 1):
- X-------------------------------------------------------
- X
- X - Added checking of a null WM_COMMAND (Filemgr's wastebasket and
- X Mailtool's Compose window) (problem found by Larry E. Wagner).
- X
- XFrom 1.0 -> 1.1 Beta (patchlevel 1):
- X-----------------------------------
- X
- X - Added handling of resources as defined in Volume One, Xlib Programming
- X Manual, p. 346 (suggested by Larry W. Virden).
- X
- X - Fixed bug in fix_command(), didn't take into account that X positions
- X can have + and - signs in them.
- X
- END_OF_FILE
- if test 1879 -ne `wc -c <'CHANGES'`; then
- echo shar: \"'CHANGES'\" unpacked with wrong size!
- fi
- # end of 'CHANGES'
- fi
- if test -f 'Xtoolplaces.ad' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'Xtoolplaces.ad'\"
- else
- echo shar: Extracting \"'Xtoolplaces.ad'\" \(934 characters\)
- sed "s/^X//" >'Xtoolplaces.ad' <<'END_OF_FILE'
- X Xtoolplaces.app - Resource file for xtoolplaces. This file
- X defines most of the values for options.
- X
- X Copyright (c) 1993 Xerox Corporation. All Rights Reserved.
- X
- X Permission to use, copy, modify and distribute without
- X charge this software, documentation, images, etc. is grant-
- X ed, provided that this copyright and the author's name is
- X retained.
- X
- X A fee may be charged for this program ONLY to recover costs
- X for distribution (i.e. media costs). No profit can be made
- X on this program.
- X
- X The author assumes no responsibility for disasters (natural
- X or otherwise) as a consequence of use of this software.
- X
- X Adam Stein (adam@iset.scan.mc.xerox.com)
- X
- X NOTE: The value doesn't matter for xtoolplaces.console since
- X the only thing being checked is it's presence.
- X
- X
- Xxtoolplaces.console:
- Xxtoolplaces.display: :0
- Xxtoolplaces.remote: rsh
- Xxtoolplaces.saveto: .xtoolplaces
- Xxtoolplaces.screens: all
- X
- END_OF_FILE
- if test 934 -ne `wc -c <'Xtoolplaces.ad'`; then
- echo shar: \"'Xtoolplaces.ad'\" unpacked with wrong size!
- fi
- # end of 'Xtoolplaces.ad'
- fi
- if test -f 'addon.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'addon.h'\"
- else
- echo shar: Extracting \"'addon.h'\" \(777 characters\)
- sed "s/^X//" >'addon.h' <<'END_OF_FILE'
- X/*Copyright (c) 1993 Xerox Corporation. All Rights Reserved.
- X
- X Permission to use, copy, modify and distribute without
- X charge this software, documentation, images, etc. is grant-
- X ed, provided that this copyright and the author's name is
- X retained.
- X
- X A fee may be charged for this program ONLY to recover costs
- X for distribution (i.e. media costs). No profit can be made
- X on this program.
- X
- X The author assumes no responsibility for disasters (natural
- X or otherwise) as a consequence of use of this software.
- X
- X Adam Stein (adam@iset.scan.mc.xerox.com)
- X*/
- X
- X/*Structure for items to addon*/
- Xtypedef struct _addon {
- X char *program; /*Program to add onto*/
- X char *cmmd_line; /*Command line to add*/
- X struct _addon *next; /*Pointer to next link*/
- X} ADDON;
- X
- END_OF_FILE
- if test 777 -ne `wc -c <'addon.h'`; then
- echo shar: \"'addon.h'\" unpacked with wrong size!
- fi
- # end of 'addon.h'
- fi
- if test -f 'addon.sample' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'addon.sample'\"
- else
- echo shar: Extracting \"'addon.sample'\" \(101 characters\)
- sed "s/^X//" >'addon.sample' <<'END_OF_FILE'
- X# Sample addon file to add the '.work' argument to the end of the xrolo
- X# command line
- X
- Xxrolo: .work
- END_OF_FILE
- if test 101 -ne `wc -c <'addon.sample'`; then
- echo shar: \"'addon.sample'\" unpacked with wrong size!
- fi
- # end of 'addon.sample'
- fi
- if test -f 'missing.sample' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'missing.sample'\"
- else
- echo shar: Extracting \"'missing.sample'\" \(54 characters\)
- sed "s/^X//" >'missing.sample' <<'END_OF_FILE'
- X# Sample missing applications file to save xman
- XXman
- X
- END_OF_FILE
- if test 54 -ne `wc -c <'missing.sample'`; then
- echo shar: \"'missing.sample'\" unpacked with wrong size!
- fi
- # end of 'missing.sample'
- fi
- if test -f 'patchlevel.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'patchlevel.h'\"
- else
- echo shar: Extracting \"'patchlevel.h'\" \(600 characters\)
- sed "s/^X//" >'patchlevel.h' <<'END_OF_FILE'
- X/*Copyright (c) 1993 Xerox Corporation. All Rights Reserved.
- X
- X Permission to use, copy, modify and distribute without
- X charge this software, documentation, images, etc. is grant-
- X ed, provided that this copyright and the author's name is
- X retained.
- X
- X A fee may be charged for this program ONLY to recover costs
- X for distribution (i.e. media costs). No profit can be made
- X on this program.
- X
- X The author assumes no responsibility for disasters (natural
- X or otherwise) as a consequence of use of this software.
- X
- X Adam Stein (adam@iset.scan.mc.xerox.com)
- X*/
- X
- X#define PATCHLEVEL "3.1"
- X
- END_OF_FILE
- if test 600 -ne `wc -c <'patchlevel.h'`; then
- echo shar: \"'patchlevel.h'\" unpacked with wrong size!
- fi
- # end of 'patchlevel.h'
- fi
- if test -f 'strdup.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'strdup.c'\"
- else
- echo shar: Extracting \"'strdup.c'\" \(1149 characters\)
- sed "s/^X//" >'strdup.c' <<'END_OF_FILE'
- X/*Copyright (c) 1993 Xerox Corporation. All Rights Reserved.
- X
- X Permission to use, copy, modify and distribute without
- X charge this software, documentation, images, etc. is grant-
- X ed, provided that this copyright and the author's name is
- X retained.
- X
- X A fee may be charged for this program ONLY to recover costs
- X for distribution (i.e. media costs). No profit can be made
- X on this program.
- X
- X The author assumes no responsibility for disasters (natural
- X or otherwise) as a consequence of use of this software.
- X
- X Adam Stein (adam@iset.scan.mc.xerox.com)
- X*/
- X
- X#include <stdio.h>
- X
- Xextern char *program;
- X
- X/*Copy a string.
- X
- X Inputs: s1 - string to copy
- X Outputs: save_to - copied string
- X Locals: loop - loop thru characters in string
- X save_to - copied string
- X Globals: program - name of currently executing program
- X NULL - 0
- X*/
- Xchar *strdup(s1)
- Xregister char *s1;
- X{
- X register int loop;
- X register char *save_to;
- X char *malloc();
- X
- X if((save_to = malloc(strlen(s1) + 1)) == NULL) {
- X perror(program);
- X exit(1);
- X }
- X
- X for(loop = 0;*s1;++s1,++loop)
- X save_to[loop] = *s1;
- X save_to[loop] = '\0';
- X
- X return(save_to);
- X}
- X
- END_OF_FILE
- if test 1149 -ne `wc -c <'strdup.c'`; then
- echo shar: \"'strdup.c'\" unpacked with wrong size!
- fi
- # end of 'strdup.c'
- fi
- if test -f 'strstr.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'strstr.c'\"
- else
- echo shar: Extracting \"'strstr.c'\" \(1585 characters\)
- sed "s/^X//" >'strstr.c' <<'END_OF_FILE'
- X/*Copyright (c) 1993 Xerox Corporation. All Rights Reserved.
- X
- X Permission to use, copy, modify and distribute without
- X charge this software, documentation, images, etc. is grant-
- X ed, provided that this copyright and the author's name is
- X retained.
- X
- X A fee may be charged for this program ONLY to recover costs
- X for distribution (i.e. media costs). No profit can be made
- X on this program.
- X
- X The author assumes no responsibility for disasters (natural
- X or otherwise) as a consequence of use of this software.
- X
- X Adam Stein (adam@iset.scan.mc.xerox.com)
- X*/
- X
- X#include <stdio.h>
- X
- X/*This function will find the first occurrence of a midstring (s2) in a
- X string (s1). This function is here because BSD systems don't have it.
- X
- X Inputs: s1 - string to search through
- X s2 - midstring to search for
- X Outputs: pointer - start of midstring in string, NULL if midstring not found
- X Locals: pointer - pointer to go through string
- X save_s2 - save s2 since s2 changes when checking
- X Globals: NULL - 0
- X*/
- Xchar *strstr(s1,s2)
- Xregister char *s1,*s2;
- X{
- X register char *pointer,*save_s2;
- X
- X save_s2 = s2;
- X
- X for(pointer = s1;*pointer;++pointer) {
- X if(*pointer == *s2)
- X while(*pointer && *s2 && *(++pointer) == *(++s2)) ;
- X
- X /*If we matched every character from s2 then return pointer
- X (which is pointing to the end of the substring in the main
- X string) - the length of the substring. Else, return s2 to
- X what it was originally and start looking again*/
- X if(!(*s2)) return(pointer-strlen(save_s2));
- X else s2 = save_s2;
- X }
- X
- X return(NULL);
- X}
- X
- END_OF_FILE
- if test 1585 -ne `wc -c <'strstr.c'`; then
- echo shar: \"'strstr.c'\" unpacked with wrong size!
- fi
- # end of 'strstr.c'
- fi
- if test -f 'xtoolplaces.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'xtoolplaces.h'\"
- else
- echo shar: Extracting \"'xtoolplaces.h'\" \(1602 characters\)
- sed "s/^X//" >'xtoolplaces.h' <<'END_OF_FILE'
- X/*Copyright (c) 1993 Xerox Corporation. All Rights Reserved.
- X
- X Permission to use, copy, modify and distribute without
- X charge this software, documentation, images, etc. is grant-
- X ed, provided that this copyright and the author's name is
- X retained.
- X
- X A fee may be charged for this program ONLY to recover costs
- X for distribution (i.e. media costs). No profit can be made
- X on this program.
- X
- X The author assumes no responsibility for disasters (natural
- X or otherwise) as a consequence of use of this software.
- X
- X Adam Stein (adam@iset.scan.mc.xerox.com)
- X*/
- X
- X/*User modifiable defines*/
- X#define APPSDIR "/usr/lib/X11/app-defaults" /*Default resource directory*/
- X#define APPSFILENAME "Xtoolplaces" /*Class name*/
- X#define CONSOLE_CLASS "XConsole" /*Class of console windows*/
- X#define DEFAULT_FILENAME ".xtoolplaces" /*Default name to save to*/
- X#define DEFAULT_REMOTE "rsh -n" /*Default remote command*/
- X#define HOME "HOME" /*Home environment variable*/
- X#define USER "USER" /*User environment variable*/
- X
- X/*3 popular console terminal windows and the method to identify when
- X they are present and in console mode since there is no console class*/
- X#define CONTOOL_NAME "Contool" /*Name given to contool window*/
- X#define SUN_TOOLS_ICON_NAME "CONSOLE" /*Icon name for sun consoles*/
- X#define XTERM_OPTION "-C" /*Console option for xterm*/
- X
- X
- X/*Do not modify anything below this line*/
- X
- X/*Global definitions*/
- X#define USAGE "[-a filename] [-c] [-display host:display.screen] [-f filename] [-m filename] [-r command] [-s {list | all}] [-v]"
- X#define VERSION "1.3.1" /*Version*/
- X
- END_OF_FILE
- if test 1602 -ne `wc -c <'xtoolplaces.h'`; then
- echo shar: \"'xtoolplaces.h'\" unpacked with wrong size!
- fi
- # end of 'xtoolplaces.h'
- fi
- echo shar: End of archive 3 \(of 3\).
- cp /dev/null ark3isdone
- MISSING=""
- for I in 1 2 3 ; do
- if test ! -f ark${I}isdone ; then
- MISSING="${MISSING} ${I}"
- fi
- done
- if test "${MISSING}" = "" ; then
- echo You have unpacked all 3 archives.
- rm -f ark[1-9]isdone
- else
- echo You still must unpack the following archives:
- echo " " ${MISSING}
- fi
- exit 0
- exit 0 # Just in case...
- --
- // chris@IMD.Sterling.COM | Send comp.sources.x submissions to:
- \X/ Amiga - The only way to fly! |
- "It's intuitively obvious to the most | sources-x@imd.sterling.com
- casual observer..." |
-