home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / x / volume19 / xtolplcs / part03 < prev    next >
Encoding:
Text File  |  1993-04-27  |  15.4 KB  |  450 lines

  1. Newsgroups: comp.sources.x
  2. From: adam@iset.scan.mc.xerox.com (Adam Stein)
  3. Subject: v19i077:  Xtoolplaces - save current X desktop window information, Part03/03
  4. Message-ID: <1993Apr6.143533.15371@sparky.imd.sterling.com>
  5. X-Md4-Signature: ae256ebdfdbc157b76b012e1aaafe720
  6. Date: Tue, 6 Apr 1993 14:35:33 GMT
  7. Approved: chris@sparky.imd.sterling.com
  8.  
  9. Submitted-by: adam@iset.scan.mc.xerox.com (Adam Stein)
  10. Posting-number: Volume 19, Issue 77
  11. Archive-name: Xtoolplaces/part03
  12. Environment: X11, !mwm, !tvtwm
  13. Supersedes: Xtoolplaces: Volume 14, Issue 2-3
  14.  
  15. #! /bin/sh
  16. # This is a shell archive.  Remove anything before this line, then feed it
  17. # into a shell via "sh file" or similar.  To overwrite existing files,
  18. # type "sh file -c".
  19. # Contents:  MANIFEST CHANGES Xtoolplaces.ad addon.h addon.sample
  20. #   missing.sample patchlevel.h strdup.c strstr.c xtoolplaces.h
  21. # Wrapped by chris@sparky on Tue Apr  6 09:15:54 1993
  22. PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin ; export PATH
  23. echo If this archive is complete, you will see the following message:
  24. echo '          "shar: End of archive 3 (of 3)."'
  25. if test -f 'MANIFEST' -a "${1}" != "-c" ; then 
  26.   echo shar: Will not clobber existing file \"'MANIFEST'\"
  27. else
  28.   echo shar: Extracting \"'MANIFEST'\" \(1324 characters\)
  29.   sed "s/^X//" >'MANIFEST' <<'END_OF_FILE'
  30. X   File Name            Shar #           Description
  31. X-----------------------------------------------------------
  32. XCHANGES               1          List of changes release to release
  33. XImakefile           1          Imake Makefile
  34. XMANIFEST           1          This list of files
  35. XMakefile.simple           1          Simple makefile
  36. XREADME               1          Details about program
  37. XXtoolplaces.ad           1          Default resource file
  38. Xadddisplay.c           1          Add '-display' for multiple screens
  39. Xaddon.c               1          Add on arguments routines
  40. Xaddon.h                  2          Addon structure definition
  41. Xaddon.sample           2              Sample addon file (used with '-a')
  42. Xcombine.c           1          Combine multiple args into 1 string
  43. Xcopyright.c           1          Copyright notice for executable
  44. Xfix_command.c              1          Fix xview problem routine
  45. Xgetargs.c           1          Get resource databases
  46. Xgetgeom.c           1          Get geometry information
  47. Xgetinfo.c           2          Get window information routines
  48. Xis.c               2          Query routines
  49. Xmake_list.c           2          Generate list of screens to save
  50. Xmissing.c           2          Missing applications routines
  51. Xmissing.sample           2          Sample missing file (used with '-m')
  52. Xpatchlevel.h           2          Patchlevel info
  53. Xstrdup.c           2          BSD strdup() function
  54. Xstrstr.c           2          System 5 strstr() function
  55. Xxtoolplaces.c           2          The xtoolplaces program
  56. Xxtoolplaces.h           2          Common definitions
  57. Xxtoolplaces.man           1          Xtoolplaces man page
  58. X
  59. END_OF_FILE
  60.   if test 1324 -ne `wc -c <'MANIFEST'`; then
  61.     echo shar: \"'MANIFEST'\" unpacked with wrong size!
  62.   fi
  63.   # end of 'MANIFEST'
  64. fi
  65. if test -f 'CHANGES' -a "${1}" != "-c" ; then 
  66.   echo shar: Will not clobber existing file \"'CHANGES'\"
  67. else
  68.   echo shar: Extracting \"'CHANGES'\" \(1879 characters\)
  69.   sed "s/^X//" >'CHANGES' <<'END_OF_FILE'
  70. XFrom 1.3 (patchlevel 3) -> 1.3.1 (patchlevel 3.1):
  71. X-------------------------------------------------
  72. X
  73. X  - Changed the adding of geometry options to be the first options as opposed
  74. X    to adding them onto the end.  This is especially needed for programs that
  75. X    have an option that needs to go at the end (i.e. xterm's -e option).
  76. X    (brought to my attention by etj90)
  77. X
  78. XFrom 1.2 (patchlevel 2) -> 1.3 (patchlevel 3):
  79. X---------------------------------------------
  80. X
  81. X  - Fixed compile bugs as reported by gcc.  Add gcc support in Imakefile
  82. X    and Makefile.simple (they are commented out). (compile bugs brought
  83. X    to my addention by Michael Salmon, Chung Tin Kwok, Simon Leinen, Nelson
  84. X    Minar, Malcolm C. Strickland)
  85. X
  86. X  - Fixed bug which caused xtoolplaces to core dump (when epoch is around).
  87. X    (brought to my attention by Ted Rodriguez-Bell).
  88. X
  89. XFrom 1.2 Beta (patchlevel 1) -> 1.2 Final (patchlevel 2):
  90. X--------------------------------------------------------
  91. X  - Added support for emacs (source code supplied by Kresten).
  92. X
  93. X  - Added support for xconsole (suggested by Matthias Pfuetzner).
  94. X
  95. X  - The function strdup() was added for systems that don't have it
  96. X    (brought to my attention by Renato).
  97. X
  98. X  - Put double quotes around options with whitespace in them (brought to
  99. X    my attention by Larry W. Virden).
  100. X
  101. XFrom 1.1 Beta (patchlevel 1) -> 1.2 Beta (patchlevel 1):
  102. X-------------------------------------------------------
  103. X
  104. X  - Added checking of a null WM_COMMAND (Filemgr's wastebasket and
  105. X    Mailtool's Compose window) (problem found by Larry E. Wagner).
  106. X
  107. XFrom 1.0 -> 1.1 Beta (patchlevel 1):
  108. X-----------------------------------
  109. X
  110. X  - Added handling of resources as defined in Volume One, Xlib Programming
  111. X    Manual, p. 346 (suggested by Larry W. Virden).
  112. X
  113. X  - Fixed bug in fix_command(), didn't take into account that X positions
  114. X    can have + and - signs in them.
  115. X
  116. END_OF_FILE
  117.   if test 1879 -ne `wc -c <'CHANGES'`; then
  118.     echo shar: \"'CHANGES'\" unpacked with wrong size!
  119.   fi
  120.   # end of 'CHANGES'
  121. fi
  122. if test -f 'Xtoolplaces.ad' -a "${1}" != "-c" ; then 
  123.   echo shar: Will not clobber existing file \"'Xtoolplaces.ad'\"
  124. else
  125.   echo shar: Extracting \"'Xtoolplaces.ad'\" \(934 characters\)
  126.   sed "s/^X//" >'Xtoolplaces.ad' <<'END_OF_FILE'
  127. X   Xtoolplaces.app - Resource file for xtoolplaces.  This file
  128. X   defines most of the values for options.
  129. X
  130. X   Copyright (c) 1993 Xerox Corporation.  All Rights Reserved.
  131. X
  132. X   Permission to use,  copy,  modify  and  distribute  without
  133. X   charge this software, documentation, images, etc. is grant-
  134. X   ed, provided that this copyright and the author's  name  is
  135. X   retained.
  136. X
  137. X   A fee may be charged for this program ONLY to recover costs
  138. X   for distribution (i.e. media costs).  No profit can be made
  139. X   on this program.
  140. X
  141. X   The author assumes no responsibility for disasters (natural
  142. X   or otherwise) as a consequence of use of this software.
  143. X
  144. X   Adam Stein (adam@iset.scan.mc.xerox.com)
  145. X
  146. X   NOTE:  The value doesn't matter for xtoolplaces.console since
  147. X   the only thing being checked is it's presence.
  148. X
  149. X
  150. Xxtoolplaces.console:
  151. Xxtoolplaces.display:    :0
  152. Xxtoolplaces.remote:    rsh
  153. Xxtoolplaces.saveto:    .xtoolplaces
  154. Xxtoolplaces.screens:    all
  155. X
  156. END_OF_FILE
  157.   if test 934 -ne `wc -c <'Xtoolplaces.ad'`; then
  158.     echo shar: \"'Xtoolplaces.ad'\" unpacked with wrong size!
  159.   fi
  160.   # end of 'Xtoolplaces.ad'
  161. fi
  162. if test -f 'addon.h' -a "${1}" != "-c" ; then 
  163.   echo shar: Will not clobber existing file \"'addon.h'\"
  164. else
  165.   echo shar: Extracting \"'addon.h'\" \(777 characters\)
  166.   sed "s/^X//" >'addon.h' <<'END_OF_FILE'
  167. X/*Copyright (c) 1993 Xerox Corporation.  All Rights Reserved.
  168. X
  169. X  Permission to use,  copy,  modify  and  distribute  without
  170. X  charge this software, documentation, images, etc. is grant-
  171. X  ed, provided that this copyright and the author's  name  is
  172. X  retained.
  173. X
  174. X  A fee may be charged for this program ONLY to recover costs
  175. X  for distribution (i.e. media costs).  No profit can be made
  176. X  on this program.
  177. X
  178. X  The author assumes no responsibility for disasters (natural
  179. X  or otherwise) as a consequence of use of this software.
  180. X
  181. X  Adam Stein (adam@iset.scan.mc.xerox.com)
  182. X*/
  183. X
  184. X/*Structure for items to addon*/
  185. Xtypedef struct _addon {
  186. X    char *program;                /*Program to add onto*/
  187. X    char *cmmd_line;            /*Command line to add*/
  188. X    struct _addon *next;            /*Pointer to next link*/
  189. X} ADDON;
  190. X
  191. END_OF_FILE
  192.   if test 777 -ne `wc -c <'addon.h'`; then
  193.     echo shar: \"'addon.h'\" unpacked with wrong size!
  194.   fi
  195.   # end of 'addon.h'
  196. fi
  197. if test -f 'addon.sample' -a "${1}" != "-c" ; then 
  198.   echo shar: Will not clobber existing file \"'addon.sample'\"
  199. else
  200.   echo shar: Extracting \"'addon.sample'\" \(101 characters\)
  201.   sed "s/^X//" >'addon.sample' <<'END_OF_FILE'
  202. X# Sample addon file to add the '.work' argument to the end of the xrolo
  203. X# command line
  204. X
  205. Xxrolo: .work
  206. END_OF_FILE
  207.   if test 101 -ne `wc -c <'addon.sample'`; then
  208.     echo shar: \"'addon.sample'\" unpacked with wrong size!
  209.   fi
  210.   # end of 'addon.sample'
  211. fi
  212. if test -f 'missing.sample' -a "${1}" != "-c" ; then 
  213.   echo shar: Will not clobber existing file \"'missing.sample'\"
  214. else
  215.   echo shar: Extracting \"'missing.sample'\" \(54 characters\)
  216.   sed "s/^X//" >'missing.sample' <<'END_OF_FILE'
  217. X# Sample missing applications file to save xman
  218. XXman
  219. X
  220. END_OF_FILE
  221.   if test 54 -ne `wc -c <'missing.sample'`; then
  222.     echo shar: \"'missing.sample'\" unpacked with wrong size!
  223.   fi
  224.   # end of 'missing.sample'
  225. fi
  226. if test -f 'patchlevel.h' -a "${1}" != "-c" ; then 
  227.   echo shar: Will not clobber existing file \"'patchlevel.h'\"
  228. else
  229.   echo shar: Extracting \"'patchlevel.h'\" \(600 characters\)
  230.   sed "s/^X//" >'patchlevel.h' <<'END_OF_FILE'
  231. X/*Copyright (c) 1993 Xerox Corporation.  All Rights Reserved.
  232. X
  233. X  Permission to use,  copy,  modify  and  distribute  without
  234. X  charge this software, documentation, images, etc. is grant-
  235. X  ed, provided that this copyright and the author's  name  is
  236. X  retained.
  237. X
  238. X  A fee may be charged for this program ONLY to recover costs
  239. X  for distribution (i.e. media costs).  No profit can be made
  240. X  on this program.
  241. X
  242. X  The author assumes no responsibility for disasters (natural
  243. X  or otherwise) as a consequence of use of this software.
  244. X
  245. X  Adam Stein (adam@iset.scan.mc.xerox.com)
  246. X*/
  247. X
  248. X#define PATCHLEVEL "3.1"
  249. X
  250. END_OF_FILE
  251.   if test 600 -ne `wc -c <'patchlevel.h'`; then
  252.     echo shar: \"'patchlevel.h'\" unpacked with wrong size!
  253.   fi
  254.   # end of 'patchlevel.h'
  255. fi
  256. if test -f 'strdup.c' -a "${1}" != "-c" ; then 
  257.   echo shar: Will not clobber existing file \"'strdup.c'\"
  258. else
  259.   echo shar: Extracting \"'strdup.c'\" \(1149 characters\)
  260.   sed "s/^X//" >'strdup.c' <<'END_OF_FILE'
  261. X/*Copyright (c) 1993 Xerox Corporation.  All Rights Reserved.
  262. X
  263. X  Permission to use,  copy,  modify  and  distribute  without
  264. X  charge this software, documentation, images, etc. is grant-
  265. X  ed, provided that this copyright and the author's  name  is
  266. X  retained.
  267. X
  268. X  A fee may be charged for this program ONLY to recover costs
  269. X  for distribution (i.e. media costs).  No profit can be made
  270. X  on this program.
  271. X
  272. X  The author assumes no responsibility for disasters (natural
  273. X  or otherwise) as a consequence of use of this software.
  274. X
  275. X  Adam Stein (adam@iset.scan.mc.xerox.com)
  276. X*/
  277. X
  278. X#include <stdio.h>
  279. X
  280. Xextern char *program;
  281. X
  282. X/*Copy a string.
  283. X
  284. X  Inputs:  s1      - string to copy
  285. X  Outputs: save_to - copied string
  286. X  Locals:  loop    - loop thru characters in string
  287. X       save_to - copied string
  288. X  Globals: program - name of currently executing program
  289. X       NULL    - 0
  290. X*/
  291. Xchar *strdup(s1)
  292. Xregister char *s1;
  293. X{
  294. X    register int loop;
  295. X    register char *save_to;
  296. X    char *malloc();
  297. X
  298. X    if((save_to = malloc(strlen(s1) + 1)) == NULL) {
  299. X      perror(program);
  300. X      exit(1);
  301. X    }
  302. X
  303. X    for(loop = 0;*s1;++s1,++loop)
  304. X      save_to[loop] = *s1;
  305. X    save_to[loop] = '\0';
  306. X
  307. X    return(save_to);
  308. X}
  309. X
  310. END_OF_FILE
  311.   if test 1149 -ne `wc -c <'strdup.c'`; then
  312.     echo shar: \"'strdup.c'\" unpacked with wrong size!
  313.   fi
  314.   # end of 'strdup.c'
  315. fi
  316. if test -f 'strstr.c' -a "${1}" != "-c" ; then 
  317.   echo shar: Will not clobber existing file \"'strstr.c'\"
  318. else
  319.   echo shar: Extracting \"'strstr.c'\" \(1585 characters\)
  320.   sed "s/^X//" >'strstr.c' <<'END_OF_FILE'
  321. X/*Copyright (c) 1993 Xerox Corporation.  All Rights Reserved.
  322. X
  323. X  Permission to use,  copy,  modify  and  distribute  without
  324. X  charge this software, documentation, images, etc. is grant-
  325. X  ed, provided that this copyright and the author's  name  is
  326. X  retained.
  327. X
  328. X  A fee may be charged for this program ONLY to recover costs
  329. X  for distribution (i.e. media costs).  No profit can be made
  330. X  on this program.
  331. X
  332. X  The author assumes no responsibility for disasters (natural
  333. X  or otherwise) as a consequence of use of this software.
  334. X
  335. X  Adam Stein (adam@iset.scan.mc.xerox.com)
  336. X*/
  337. X
  338. X#include <stdio.h>
  339. X
  340. X/*This function will find the first occurrence of a midstring (s2) in a
  341. X  string (s1).  This function is here because BSD systems don't have it.
  342. X
  343. X  Inputs:  s1      - string to search through
  344. X       s2      - midstring to search for
  345. X  Outputs: pointer - start of midstring in string, NULL if midstring not found
  346. X  Locals:  pointer - pointer to go through string
  347. X       save_s2 - save s2 since s2 changes when checking
  348. X  Globals: NULL    - 0
  349. X*/
  350. Xchar *strstr(s1,s2)
  351. Xregister char *s1,*s2;
  352. X{
  353. X    register char *pointer,*save_s2;
  354. X
  355. X    save_s2 = s2;
  356. X
  357. X    for(pointer = s1;*pointer;++pointer) {
  358. X      if(*pointer == *s2)
  359. X        while(*pointer && *s2 && *(++pointer) == *(++s2)) ;
  360. X
  361. X      /*If we matched every character from s2 then return pointer
  362. X        (which is pointing to the end of the substring in the main
  363. X        string) - the length of the substring.  Else, return s2 to
  364. X        what it was originally and start looking again*/
  365. X      if(!(*s2)) return(pointer-strlen(save_s2));
  366. X      else s2 = save_s2;
  367. X    }
  368. X
  369. X    return(NULL);
  370. X}
  371. X
  372. END_OF_FILE
  373.   if test 1585 -ne `wc -c <'strstr.c'`; then
  374.     echo shar: \"'strstr.c'\" unpacked with wrong size!
  375.   fi
  376.   # end of 'strstr.c'
  377. fi
  378. if test -f 'xtoolplaces.h' -a "${1}" != "-c" ; then 
  379.   echo shar: Will not clobber existing file \"'xtoolplaces.h'\"
  380. else
  381.   echo shar: Extracting \"'xtoolplaces.h'\" \(1602 characters\)
  382.   sed "s/^X//" >'xtoolplaces.h' <<'END_OF_FILE'
  383. X/*Copyright (c) 1993 Xerox Corporation.  All Rights Reserved.
  384. X
  385. X  Permission to use,  copy,  modify  and  distribute  without
  386. X  charge this software, documentation, images, etc. is grant-
  387. X  ed, provided that this copyright and the author's  name  is
  388. X  retained.
  389. X
  390. X  A fee may be charged for this program ONLY to recover costs
  391. X  for distribution (i.e. media costs).  No profit can be made
  392. X  on this program.
  393. X
  394. X  The author assumes no responsibility for disasters (natural
  395. X  or otherwise) as a consequence of use of this software.
  396. X
  397. X  Adam Stein (adam@iset.scan.mc.xerox.com)
  398. X*/
  399. X
  400. X/*User modifiable defines*/
  401. X#define APPSDIR "/usr/lib/X11/app-defaults"    /*Default resource directory*/
  402. X#define APPSFILENAME "Xtoolplaces"        /*Class name*/
  403. X#define CONSOLE_CLASS "XConsole"        /*Class of console windows*/
  404. X#define DEFAULT_FILENAME ".xtoolplaces"        /*Default name to save to*/
  405. X#define DEFAULT_REMOTE "rsh -n"            /*Default remote command*/
  406. X#define HOME "HOME"                /*Home environment variable*/
  407. X#define USER "USER"                /*User environment variable*/
  408. X
  409. X/*3 popular console terminal windows and the method to identify when
  410. X  they are present and in console mode since there is no console class*/
  411. X#define CONTOOL_NAME "Contool"            /*Name given to contool window*/
  412. X#define SUN_TOOLS_ICON_NAME "CONSOLE"        /*Icon name for sun consoles*/
  413. X#define XTERM_OPTION "-C"            /*Console option for xterm*/
  414. X
  415. X
  416. X/*Do not modify anything below this line*/
  417. X
  418. X/*Global definitions*/
  419. X#define USAGE "[-a filename] [-c] [-display host:display.screen] [-f filename] [-m filename] [-r command] [-s {list | all}] [-v]"
  420. X#define VERSION "1.3.1"                /*Version*/
  421. X
  422. END_OF_FILE
  423.   if test 1602 -ne `wc -c <'xtoolplaces.h'`; then
  424.     echo shar: \"'xtoolplaces.h'\" unpacked with wrong size!
  425.   fi
  426.   # end of 'xtoolplaces.h'
  427. fi
  428. echo shar: End of archive 3 \(of 3\).
  429. cp /dev/null ark3isdone
  430. MISSING=""
  431. for I in 1 2 3 ; do
  432.     if test ! -f ark${I}isdone ; then
  433.     MISSING="${MISSING} ${I}"
  434.     fi
  435. done
  436. if test "${MISSING}" = "" ; then
  437.     echo You have unpacked all 3 archives.
  438.     rm -f ark[1-9]isdone
  439. else
  440.     echo You still must unpack the following archives:
  441.     echo "        " ${MISSING}
  442. fi
  443. exit 0
  444. exit 0 # Just in case...
  445. -- 
  446.   // chris@IMD.Sterling.COM            | Send comp.sources.x submissions to:
  447. \X/  Amiga - The only way to fly!      |
  448.  "It's intuitively obvious to the most |    sources-x@imd.sterling.com
  449.   casual observer..."                  |
  450.