xwatch-2.11/ 40755 1750 1750 0 6730214600 11661 5ustar rhogeerhogeexwatch-2.11/ChangeLog100644 1750 1750 510 6707077736 13531 0ustar rhogeerhogee1999-04-19 Peter S Galbraith * Version 2.11 released. * New license (GPL + permission to link against XForms). * Added the Debian man page to upstream package. * Makefile did not build properly ui.h and xwatch.c now have #include Hacked the Makefile a little to add library path. xwatch-2.11/INSTALL100644 1750 1750 6546 6730212631 13024 0ustar rhogeerhogee TITLE INFORMATION: XWatch: short installation guide Contents Chapter 1: Obtaining xwatch Chapter 2: Compiling xwatch Chapter 3: Copyright Chapter 1: Obtaining xwatch XWatch can be obtained at the ftp site ftp.icce.rug.nl, in the directory /pub/unix, as the file xwatch-X.YY.tar.gz. X.YY is the version number, e.g., 1.00. This site is the primary site, so check here for new versions. To unpack the archive, change-dir to your `sources' directory (e.g., /usr/local/src) and type tar xvzf /where/ever/you/put/it/xwatch-X.YY.tar.gz Next, change-dir to the unpacked subdirectory xwatch and check there. You will find a subdirectory src with the full sources. Chapter 2: Compiling xwatch This file is automatically generated from doc/xwatch.yo. Please also read the full docs in HTML format as doc/xwatch.html or in LaTeX format as doc/xwatch.tex. A poor-mans document is doc/xwatch.txt, that's plain ASCII for those who can't handle HTML or LaTeX. Follow these steps. o You will need the XForms library and include files to compile xwatch. Check the Makefile in the src subdirectory for two ftp sites that carry XForms for Linux. Obtain the library and install it. XWatch will happily run with XForms version 0.81 or 0.88. o In the src subdirectory, edit the Makefile and adjust some defines at the top. E.g., a make install copies the binary by default to /usr/local/X11/bin; adjust that if you don't like this behavior. o Next, do a make install, followed by a make clean. o Copy the file XWatch.ap from the source directory to /usr/lib/X11/app-defaults/XWatch. Edit the file and state your favorite settings. o Next, start the program xwatch with some file arguments in your logfiles directory. If you're satisfied with the appearance and workings of xwatch, add the invocation to your script that starts an X session. Chapter 3: Copyright XWatch - a tool to monitor logfiles and display new logs in an X window. Copyright (C) 1995 Karel Kubat. All rights reserved. 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. You may link this software with XForms (Copyright (C) by T.C. Zhao and Mark Overmars) and distribute the resulting binary, under the restrictions in clause 3 of the GPL, even though the resulting binary is not, as a whole, covered by the GPL. (You still need a separate license to do so from the owner(s) of the copyright for XForms, however). If a derivative no longer requires XForms, you may use the unsupplemented GPL as its license by deleting this paragraph and therefore removing this exemption for XForms. 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA xwatch-2.11/MAINTAINER.README100644 1750 1750 5000 6706647233 14276 0ustar rhogeerhogee Just a couple of random notes for the maintainer. NOTE BY THE MAINTAINER ---------------------- Due to the impressive nature (and the amount of) mail I receive about xwatch, I must conclude that xwatch is at most a half-product: xwatch crashes, consumes memory, doesn't do things it's supposed to do: you name it. Consequently, the amount of work to be done on xwatch is way too much for a 'maintainer', and maintenance is therefore very infrequent and low-priority. The best thing I can suggest is to use xwatch for some time, kill it, and restart it, or don't use xwatch at all, until version 3.00 arrives (whenever). Note by Peter Galbraith, the Debian packager of this package: I've been using xwatch for years, and have not experienced _any_ of these problems! IN GENERAL ---------- Work from Bambix, as root. All scripts and stuff expects this, e.g., ftp will go automatically. DOCUMENTATION ------------- All docs are in doc/xwatch.yo (YODL article). Change all documentation there. The Makefile will convert things to .tex, .txt and .html later. SOURCES ------- All sources are of course under src/, one file per C-function. If you add a new function: - put it in a separate file (of course, what else) - add the prototype to xwatch.h - add the filename, but with extension .o to the OBJ setting in the Makefile If you need more global data: put it in data.inc, that file gets included in xwatch.c (to define the data) and in xwatch.h (to declare them). If you want to change the XForms design: use fdesign, with ui.fd as the file argument (ui for User Interface). When saving the design, make sure that "alt format" is on. MAKING A NEW VERSION -------------------- Once you have the sources and all at hand, edit the Makefile in the src/ directory to update the version number. Then do a "make install". If all still works, edit the files .xwatch.ANNOUNCEMENT (NOTE THE DOT!!) and possibly .xwatch.README (NOTE THE DOT!!) or .xwatch.lsm (NOTE THE DOT!!). Next, do a "make dist" to upload to our ftp server. The files will get moved from /home/ftp/pub/karel/tounix to .../pub/unix during the next night. Also, upload the stuff to sunsite and tsx-11, I don't have a script to do that: do it by hand. When distributing, mail xwatch.lsm to the LSM maintainer and mail xwatch.ANNOUNCE to c.o.l.announces. That's all! xwatch-2.11/XWatch.ap100644 1750 1750 4675 6170411462 13515 0ustar rhogeerhogee! ! Application defaults for xwatch. ! -------------------------------- ! ! Start up with a border or not: 0 or 1 (default: 1) *border: 0 ! Geometry setting (default: 550x70+0+0) *geometry: 400x70-2-175 ! Start up with what foreground? (default: black) ! *foreground: black ! Start up with what background? (default: white) *background: skyblue ! Print filenames as xwatch sees new info? 0 or 1 (default: 1) ! *printname: 1 ! Print timestamp as xwatch sees new info? 0 or 1 (default: 1) *printtime: 0 ! Print a newline following a name and/or timestamp? 0 or 1 (default 0) ! *newline: 0 ! Number of lines that xwatch should store for scrollback: 10 to 1000 ! (default: 200) *nlines: 500 ! Scanning interval: once N seconds xwatch will check the files ! (default: 5) ! *interval: 5 ! Used font: between 1 and 4, 4 is biggest one (default: 2) ! *font: 2 ! Issue warnings about files at startup: yes or no. Warnings may be that ! e.g. file is a binary one, or that it's not a regular file. ! (default: 1) *firstwarnings: 0 ! Print version and copyright info in the browser window upon startup? ! (Default: 1) ! *printversion: 1 ! Hide lines containing some text? Default: show all lines. If you have more ! stuff to gag, separate the strings by | . *gag: last message repeated | Too much work at interrupt ! Title to use for the window, only visible when you have *border: 1. ! *title: XWatch ! Special colorations when some string is matched in any logfile. Syntax is: ! red/green/blue:string to match: | red/green/blue:string to match | .... ! Instead of the r/g/b numbers, you can use a colorname. *.colorstring: red:finger connection: | blue:auth connection: ! Files never showing up in the xwatch-window. No wildcards, just a list ! Separate multiple files by | *.ignore: /var/adm/mgetty-ttyS2.log ! -------------------------------------------------------------------------- ! The following resources are obsolete, just left-overs from previous ! XWatch versions. ! Start up at what screen position (default: 0 0) ! *xpos: -2 ! *ypos: -175 ! Start up with what width/height (Default: 550 70) ! *width: 400 ! *height: 70 ! Start up with what foreground red/green/blue code (default: black ! which is R/G/B all 0) ! *fred: 0 ! *fgreen: 0 ! *fblue: 0 ! Same for the background (default: white which is R/G/B all 255) ! *bred: 135 ! *bgreen: 206 ! *bblue: 235 xwatch-2.11/GPL100644 1750 1750 43077 6016561535 12367 0ustar rhogeerhogee GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 675 Mass Ave, Cambridge, MA 02139, 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 Library 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 Appendix: 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) 19yy 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., 675 Mass Ave, Cambridge, MA 02139, 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) 19yy 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 Library General Public License instead of this License. xwatch-2.11/doc/ 40755 1750 1750 0 6730212657 12440 5ustar rhogeerhogeexwatch-2.11/doc/xwatch.html100644 1750 1750 1644 6730212636 14723 0ustar rhogeerhogee XWatch <br> The Logfiles Watcher

XWatch
The Logfiles Watcher

Karel Kubat (karel@icce.rug.nl)
State University of Groningen
Westerhaven 16, 9718 AW Groningen
The Netherlands

1996



Table of Contents

Chapter 1: Introduction

Chapter 2: Using xwatch

2.1: Options to the xwatch program

2.2: File arguments

Chapter 3: Obtaining xwatch

Chapter 4: Compiling xwatch

Chapter 5: Copyright



xwatch-2.11/doc/xwatch.txt100644 1750 1750 30544 6730212651 14614 0ustar rhogeerhogee TITLE INFORMATION: XWatch The Logfiles Watcher AUTHOR INFORMATION: Karel Kubat (karel@icce.rug.nl) State University of Groningen Westerhaven 16, 9718 AW Groningen The Netherlands DATE INFORMATION: 1996 Contents Chapter 1: Introduction Chapter 2: Using xwatch 2.1: Options to the xwatch program 2.2: File arguments Chapter 3: Obtaining xwatch Chapter 4: Compiling xwatch Chapter 5: Copyright Chapter 1: Introduction XWatch is a small program that I wrote to monitor logfiles and to see any changes directly (instead of having to read all the logs after a breakin or a crash). XWatch is simply started with a few file arguments, and any information that appears on the files is displayed. With a slider you can see past information; i.e., lines that scroll in xwatch's window. That's all there is to it. The appearance of the xwatch window can furthermore be modified via command line flags or via an application defaults file. (Older versions of XWatch had a button to activate an `options' window. I removed this code, almost no-one uses it.) XWatch is incidentally my first applications with the XForms GUI library for X, which I can highly recommend for developers who want to start `X programming' but who don't want to go through the hassle of having to learn about intrinsics. XForms is really excellent. Congrats, T.C. Zhao and Mark Overmars (the latter is rumored to bootleg at a soccer club in his free time ;). Instructions on where and how to get the XForms library are in the Makefile, contained in xwatch's distribution. Chapter 2: Using xwatch You typically start xwatch when activating an X session; e.g., from the file which xdm uses to fire up a user's session (this file is normally /usr/X11/lib/X11/xdm/Xsession). The command that starts xwatch is something like xwatch [options] files & where `options' are optional flags, files are the files to watch, and the ampersand character is used to start xwatch in the background. The files to watch are typically in the directory /var/adm/: files which are created by the syslog daemon (see the file syslogd.conf.SAMPLE in the distribution for an example). XWatch accepts only filenames which are: o ordinary files, no sockets, directory names, o which are not binary files. Other files as stated on the commandline are not monitored. When any `non-proper' file is given on the commandline, xwatch warns about the file not being acceptable and deletes it from its list of names. 2.1: Options to the xwatch program The options are many, start xwatch without arguments to see what is supported. All options can also be stated in the file /usr/lib/X11/app-defaults/XWatch as X resources (see the file XWatch.ap as an example). In the following enumeration, a nr denotes a number: o -border nr: Specifies whether xwatch should start with a border. The nr must be 0 or 1. When you start xwatch without a border, your window manager may not be able to resize or even recognize it. Incidentally, this may be what you want -- I use it to `hide' the presence of xwatch from my window manager fvwm. o -geometry geom: Specifies the display geometry, a-la other X programs. You can express the geometry in terms of WxH (width by height), optionally postfixed by +X+Y (x and y offset) or -X-Y (offsets relative to the lower right corner) and other combinations. Note that previous switches that emulated the geometry specification, such as -xpos and -height, are now obsolete. Use the geometry setting. o -fg color and -bg color: These options define the default foreground and background of the watch window. Note that previous switches, such as -bred and -bblue, are now obsolete. o -printtime nr: Defines whether xwatch should prefix any info on the watched files with a timestamp. The nr can be 0 or zero; the timestamp is printed when nr is 1. o -printname nr: Defines whether xwatch should prefix any info on the watched files with the filename. The nr is again a flag, 0 or 1. o -newline nr: Defines whether xwatch should let a newline follow the time and/or filename stamp, so that the actual information is displayed on its own line. o -interval nr: Defines the scanning interval. Each nr seconds, xwatch will check if new information has arrived on the watched files. The nr may be between 1 and 30 seconds. o -fontsize nr: Defines the initial size of the display font. The nr may range from 1 to 4; 1 being the smallest font and 4 being the largest. o -fontstyle nr: Defines the style of the used font. The nr is a number between 0 and 15 (0 being the default). Start xwatch without arguments or read the application defaults file to see what fonts the numbers choose. o -firstwarnings nr: Defines whether xwatch should print initial warnings into the watch window. E.g., you might like to set firstwarnings to zero, and then start xwatch with the file argument /var/adm/*. Warnings about, e.g., utmp being a binary file would then be suppressed. o -printversion nr: Controls whether xwatch prints its version number and copyright notice upon startup in the watch window. o -gag text: This option, when present, prevents all lines with text in them from being shown in the display window. You can specify more than one string to `gag', in that case, separate the strings with |. o -colorstring col:string: This option causes lines that contain string to be displayed using the specified color. The string is matched literally. E.g., if you use the option -colorstring blue:connection then all lines containing connection are displayed in pure blue. You can specify several colorstrings by separating all options with a | character, as in -colorstring blue:connection|red:error. Note that, for reasons of shell expansion, you should quote such options on the commandline. o -title name: This option sets the window title of the watch window. Note that the title will only be visible when border is not 0. This option may be useful if you have several XWatch windows, monitoring different things. o -ignore fileA|fileB|fileC|...: This option is handy if you start XWatch with a wildcard file argument, but when you want XWatch not to process some files. The -ignore flag removes the stated files from the watchlist. Note that, for reasons of shell commandline expansion, you must quote the file specification (or the shell will interpret the | characters as pipes). (Thanks, Frank Brokken, frank@icce.rug.nl for the code). Before you extensively use the options, create an application defaults file /usr/lib/X11/app-defaults/XWatch. You can do so by copying the file XWatch.ap, extracted from the archive, to /usr/lib/X11/app-defaults/XWatch. The comments in the distributed application defaults file explain what you can configure and show examples. Some systems do not have the directory /usr/lib/X11/app-defaults. In that case, you should create the following links: o /usr/X11 should point to your X11 distribution; e.g. to /usr/X11R6. That way, you always have e.g. /usr/X11/bin, even after upgrading your X11 distribution. All that is needed is one new link. o /usr/lib/X11 should point to /usr/X11/lib/X11. Then edit the file XWatch in the application defaults directory, and follow the instructions therein to define your favorite settings. If you need to start xwatch incidentally with another setting, use a flag. 2.2: File arguments The filename arguments can optionally be followed by a color specification that applies only to that particular file. E.g., say you want to see all the files in /var/adm normally in blue text; but you want to see /var/adm/critical (critical messages from applications) in yellow and /var/adm/auth (authentification messages) in red. In that case, the course to follow would be: o The default foreground color would be blue. You could set this with the flags -fg blue, or in the application defaults file. o The color for /var/adm/critical should be yellow. Hence, the first file argument would be /var/adm/critical:yellow. o The color for file /var/adm/auth should be red, hence the second file argument would be /var/adm/auth:red. o The following arguments would be the files, using the standard foreground (blue): /var/adm/*, without any extra color specifications. Such a commandline would cause xwatch to complain about the multiple presence of /var/adm/critical (once from the separate argument, and once from the wildcard argument) and similarly about /var/adm/auth. If this bothers you, turn off the initial warnings (e.g., using -firstwarnings 0 or in the application defaults file). Note that besides the color specifications for filenames, you can also specify coloring for lines that match a given string in all files. See the above description of the switch -colorstring for more information. Chapter 3: Obtaining xwatch XWatch can be obtained at the ftp site ftp.icce.rug.nl, in the directory /pub/unix, as the file xwatch-X.YY.tar.gz. X.YY is the version number, e.g., 1.00. This site is the primary site, so check here for new versions. To unpack the archive, change-dir to your `sources' directory (e.g., /usr/local/src) and type tar xvzf /where/ever/you/put/it/xwatch-X.YY.tar.gz Next, change-dir to the unpacked subdirectory xwatch and check there. You will find a subdirectory src with the full sources. Chapter 4: Compiling xwatch Follow these steps. o You will need the XForms library and include files to compile xwatch. Check the Makefile in the src subdirectory for two ftp sites that carry XForms for Linux. Obtain the library and install it. XWatch will happily run with XForms version 0.81 or 0.88. o In the src subdirectory, edit the Makefile and adjust some defines at the top. E.g., a make install copies the binary by default to /usr/local/X11/bin; adjust that if you don't like this behavior. o Next, do a make install, followed by a make clean. o Copy the file XWatch.ap from the source directory to /usr/lib/X11/app-defaults/XWatch. Edit the file and state your favorite settings. o Next, start the program xwatch with some file arguments in your logfiles directory. If you're satisfied with the appearance and workings of xwatch, add the invocation to your script that starts an X session. Chapter 5: Copyright XWatch - a tool to monitor logfiles and display new logs in an X window. Copyright (C) 1995 Karel Kubat. All rights reserved. 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. You may link this software with XForms (Copyright (C) by T.C. Zhao and Mark Overmars) and distribute the resulting binary, under the restrictions in clause 3 of the GPL, even though the resulting binary is not, as a whole, covered by the GPL. (You still need a separate license to do so from the owner(s) of the copyright for XForms, however). If a derivative no longer requires XForms, you may use the unsupplemented GPL as its license by deleting this paragraph and therefore removing this exemption for XForms. 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA xwatch-2.11/doc/xwatch.man100644 1750 1750 32352 6730212657 14555 0ustar rhogeerhogee.TH XWatch 1 .SH XWatch xwatch \- The Logfiles Watcher .SH Karel Kubat (karel@icce\&.rug\&.nl) State University of Groningen .br Westerhaven 16, 9718 AW Groningen .br The Netherlands .bp .SH Contents Chapter 1: Introduction .br Chapter 2: Using xwatch .br 2\&.1: Options to the xwatch program .br 2\&.2: File arguments .br Chapter 3: Obtaining xwatch .br Chapter 4: Compiling xwatch .br Chapter 5: Copyright .br .bp .PP .SH "Chapter 1: Introduction" .PP \f(CWXWatch\fP is a small program that I wrote to monitor logfiles and to see any changes \fBdirectly\fP (instead of having to read all the logs after a breakin or a crash)\&. \f(CWXWatch\fP is simply started with a few file arguments, and any information that appears on the files is displayed\&. With a slider you can see past information; i\&.e\&., lines that scroll in \f(CWxwatch\fP\'s window\&. That\'s all there is to it\&. The appearance of the \f(CWxwatch\fP window can furthermore be modified via command line flags or via an application defaults file\&. (Older versions of \f(CWXWatch\fP had a button to activate an `options\' window\&. I removed this code, almost no-one uses it\&.) .PP \f(CWXWatch\fP is incidentally my first applications with the XForms GUI library for X, which I can highly recommend for developers who want to start `X programming\' but who don\'t want to go through the hassle of having to learn about intrinsics\&. XForms is really excellent\&. Congrats, T\&.C\&. Zhao and Mark Overmars (the latter is rumored to bootleg at a soccer club in his free time ;)\&. Instructions on where and how to get the XForms library are in the \f(CWMakefile\fP, contained in \f(CWxwatch\fP\'s distribution\&. .PP .SH "Chapter 2: Using xwatch" .PP You typically start \f(CWxwatch\fP when activating an X session; e\&.g\&., from the file which xdm uses to fire up a user\'s session (this file is normally \f(CW/usr/X11/lib/X11/xdm/Xsession\fP)\&. The command that starts \f(CWxwatch\fP is something like .PP .DS xwatch [options] files & .DE .PP where `options\' are optional flags, files are the files to watch, and the ampersand character is used to start \f(CWxwatch\fP in the background\&. The files to watch are typically in the directory \f(CW/var/adm/\fP: files which are created by the syslog daemon (see the file \f(CWsyslogd\&.conf\&.SAMPLE\fP in the distribution for an example)\&. \f(CWXWatch\fP accepts only filenames which are: .PP .IP .IP o ordinary files, no sockets, directory names, .IP .IP o which are not binary files\&. .IP .PP Other files as stated on the commandline are not monitored\&. When any `non-proper\' file is given on the commandline, \f(CWxwatch\fP warns about the file not being acceptable and deletes it from its list of names\&. .PP .SH "2\&.1: Options to the xwatch program" .PP The options are many, start \f(CWxwatch\fP without arguments to see what is supported\&. All options can also be stated in the file \f(CW/usr/lib/X11/app-defaults/XWatch\fP as X resources (see the file \f(CWXWatch\&.ap\fP as an example)\&. In the following enumeration, a \fInr\fP denotes a number: .PP .IP .IP o \f(CW-border\fP \fInr\fP: Specifies whether \f(CWxwatch\fP should start with a border\&. The \fInr\fP must be 0 or 1\&. When you start \f(CWxwatch\fP without a border, your window manager may not be able to resize or even recognize it\&. Incidentally, this may be what you want -- I use it to `hide\' the presence of \f(CWxwatch\fP from my window manager \f(CWfvwm\fP\&. .IP .IP o \f(CW-geometry\fP \fIgeom\fP: Specifies the display geometry, a-la other X programs\&. You can express the geometry in terms of \fIWxH\fP (width by height), optionally postfixed by \fI+X+Y\fP (x and y offset) or \fI-X-Y\fP (offsets relative to the lower right corner) and other combinations\&. .IP Note that previous switches that emulated the geometry specification, such as \f(CW-xpos\fP and \f(CW-height\fP, are now obsolete\&. Use the geometry setting\&. .IP .IP o \f(CW-fg\fP \fIcolor\fP and \f(CW-bg\fP \fIcolor\fP: These options define the default foreground and background of the watch window\&. .IP Note that previous switches, such as \f(CW-bred\fP and \f(CW-bblue\fP, are now obsolete\&. .IP .IP o \f(CW-printtime\fP \fInr\fP: Defines whether \f(CWxwatch\fP should prefix any info on the watched files with a timestamp\&. The \f(CWnr\fP can be 0 or zero; the timestamp is printed when \fInr\fP is 1\&. .IP .IP o \f(CW-printname\fP \fInr\fP: Defines whether \f(CWxwatch\fP should prefix any info on the watched files with the filename\&. The \fInr\fP is again a flag, 0 or 1\&. .IP .IP o \f(CW-newline\fP \fInr\fP: Defines whether \f(CWxwatch\fP should let a newline follow the time and/or filename stamp, so that the actual information is displayed on its own line\&. .IP .IP o \f(CW-interval\fP \fInr\fP: Defines the scanning interval\&. Each \fInr\fP seconds, \f(CWxwatch\fP will check if new information has arrived on the watched files\&. The \fInr\fP may be between 1 and 30 seconds\&. .IP .IP o \f(CW-fontsize\fP \fInr\fP: Defines the initial size of the display font\&. The \fInr\fP may range from 1 to 4; 1 being the smallest font and 4 being the largest\&. .IP .IP o \f(CW-fontstyle\fP \fInr\fP: Defines the style of the used font\&. The \fInr\fP is a number between 0 and 15 (0 being the default)\&. Start \f(CWxwatch\fP without arguments or read the application defaults file to see what fonts the numbers choose\&. .IP .IP o \f(CW-firstwarnings\fP \fInr\fP: Defines whether \f(CWxwatch\fP should print initial warnings into the watch window\&. E\&.g\&., you might like to set \f(CWfirstwarnings\fP to zero, and then start \f(CWxwatch\fP with the file argument \f(CW/var/adm/*\fP\&. Warnings about, e\&.g\&., \f(CWutmp\fP being a binary file would then be suppressed\&. .IP .IP o \f(CW-printversion\fP \fInr\fP: Controls whether \f(CWxwatch\fP prints its version number and copyright notice upon startup in the watch window\&. .IP .IP o \f(CW-gag\fP \fItext\fP: This option, when present, prevents all lines with \fItext\fP in them from being shown in the display window\&. You can specify more than one string to `gag\', in that case, separate the strings with \f(CW|\fP\&. .IP .IP o \f(CW-colorstring\fP \fIcol:string\fP: This option causes lines that contain \f(CWstring\fP to be displayed using the specified color\&. The string is matched literally\&. E\&.g\&., if you use the option \f(CW-colorstring blue:connection\fP then all lines containing \f(CWconnection\fP are displayed in pure blue\&. .IP You can specify several colorstrings by separating all options with a | character, as in \f(CW-colorstring blue:connection|red:error\fP\&. Note that, for reasons of shell expansion, you should quote such options on the commandline\&. .IP .IP o \f(CW-title\fP \fIname\fP: This option sets the window title of the watch window\&. Note that the title will only be visible when \f(CWborder\fP is not 0\&. This option may be useful if you have several XWatch windows, monitoring different things\&. .IP .IP o \f(CW-ignore\fP \fIfileA|fileB|fileC|\&.\&.\&.\fP: This option is handy if you start XWatch with a wildcard file argument, but when you want XWatch \fBnot\fP to process some files\&. The \f(CW-ignore\fP flag removes the stated files from the watchlist\&. Note that, for reasons of shell commandline expansion, you must quote the file specification (or the shell will interpret the | characters as pipes)\&. (Thanks, Frank Brokken, \f(CWfrank@icce\&.rug\&.nl\fP for the code)\&. .IP .PP Before you extensively use the options, create an application defaults file \f(CW/usr/lib/X11/app-defaults/XWatch\fP\&. You can do so by copying the file \f(CWXWatch\&.ap\fP, extracted from the archive, to \f(CW/usr/lib/X11/app-defaults/XWatch\fP\&. The comments in the distributed application defaults file explain what you can configure and show examples\&. .PP Some systems do not have the directory \f(CW/usr/lib/X11/app-defaults\fP\&. In that case, you should create the following links: .PP .IP .IP o \f(CW/usr/X11\fP should point to your X11 distribution; e\&.g\&. to \f(CW/usr/X11R6\fP\&. That way, you always have e\&.g\&. \f(CW/usr/X11/bin\fP, even after upgrading your X11 distribution\&. All that is needed is one new link\&. .IP .IP o \f(CW/usr/lib/X11\fP should point to \f(CW/usr/X11/lib/X11\fP\&. .IP .PP Then edit the file \f(CWXWatch\fP in the application defaults directory, and follow the instructions therein to define your favorite settings\&. If you need to start \f(CWxwatch\fP incidentally with another setting, use a flag\&. .PP .SH "2\&.2: File arguments" .PP The filename arguments can optionally be followed by a color specification that applies only to that particular file\&. E\&.g\&., say you want to see all the files in \f(CW/var/adm\fP normally in blue text; but you want to see \f(CW/var/adm/critical\fP (critical messages from applications) in yellow and \f(CW/var/adm/auth\fP (authentification messages) in red\&. In that case, the course to follow would be: .PP .IP .IP o The default foreground color would be blue\&. You could set this with the flags \f(CW-fg blue\fP, or in the application defaults file\&. .IP .IP o The color for \f(CW/var/adm/critical\fP should be yellow\&. Hence, the first file argument would be \f(CW/var/adm/critical:yellow\fP\&. .IP .IP o The color for file \f(CW/var/adm/auth\fP should be red, hence the second file argument would be \f(CW/var/adm/auth:red\fP\&. .IP .IP o The following arguments would be the files, using the standard foreground (blue): \f(CW/var/adm/*\fP, without any extra color specifications\&. .IP .PP Such a commandline would cause \f(CWxwatch\fP to complain about the multiple presence of \f(CW/var/adm/critical\fP (once from the separate argument, and once from the wildcard argument) and similarly about \f(CW/var/adm/auth\fP\&. If this bothers you, turn off the initial warnings (e\&.g\&., using \f(CW-firstwarnings 0\fP or in the application defaults file)\&. .PP Note that besides the color specifications for filenames, you can also specify coloring for lines that match a given string in all files\&. See the above description of the switch \f(CW-colorstring\fP for more information\&. .PP .PP .PP .SH "Chapter 3: Obtaining xwatch" .PP \f(CWXWatch\fP can be obtained at the ftp site \f(CWftp\&.icce\&.rug\&.nl\fP, in the directory \f(CW/pub/unix\fP, as the file \f(CWxwatch-X\&.YY\&.tar\&.gz\fP\&. \f(CWX\&.YY\fP is the version number, e\&.g\&., 1\&.00\&. This site is the primary site, so check here for new versions\&. .PP To unpack the archive, change-dir to your `sources\' directory (e\&.g\&., \f(CW/usr/local/src\fP) and type .PP .DS tar xvzf /where/ever/you/put/it/xwatch-X\&.YY\&.tar\&.gz .DE .PP Next, change-dir to the unpacked subdirectory \f(CWxwatch\fP and check there\&. You will find a subdirectory \f(CWsrc\fP with the full sources\&. .PP .SH "Chapter 4: Compiling xwatch" .PP .PP Follow these steps\&. .PP .IP .IP o You will need the XForms library and include files to compile \f(CWxwatch\fP\&. Check the \f(CWMakefile\fP in the \f(CWsrc\fP subdirectory for two ftp sites that carry XForms for Linux\&. Obtain the library and install it\&. XWatch will happily run with XForms version 0\&.81 or 0\&.88\&. .IP .IP o In the \f(CWsrc\fP subdirectory, edit the \f(CWMakefile\fP and adjust some defines at the top\&. E\&.g\&., a \f(CWmake install\fP copies the binary by default to \f(CW/usr/local/X11/bin\fP; adjust that if you don\'t like this behavior\&. .IP .IP o Next, do a \f(CWmake install\fP, followed by a \f(CWmake clean\fP\&. .IP .IP o Copy the file \f(CWXWatch\&.ap\fP from the source directory to \f(CW/usr/lib/X11/app-defaults/XWatch\fP\&. Edit the file and state your favorite settings\&. .IP .IP o Next, start the program \f(CWxwatch\fP with some file arguments in your logfiles directory\&. If you\'re satisfied with the appearance and workings of \f(CWxwatch\fP, add the invocation to your script that starts an X session\&. .IP .PP .SH "Chapter 5: Copyright" .PP XWatch - a tool to monitor logfiles and display new logs in an X window\&. Copyright (C) 1995 Karel Kubat\&. All rights reserved\&. .PP 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\&. .PP You may link this software with XForms (Copyright (C) by T\&.C\&. Zhao and Mark Overmars) and distribute the resulting binary, under the restrictions in clause 3 of the GPL, even though the resulting binary is not, as a whole, covered by the GPL\&. (You still need a separate license to do so from the owner(s) of the copyright for XForms, however)\&. If a derivative no longer requires XForms, you may use the unsupplemented GPL as its license by deleting this paragraph and therefore removing this exemption for XForms\&. .PP 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\&. .PP 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\&., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA xwatch-2.11/doc/xwatch01.html100644 1750 1750 3253 6730212636 15062 0ustar rhogeerhogee XWatch <br> The Logfiles Watcher



Chapter 1: Introduction

XWatch is a small program that I wrote to monitor logfiles and to see any changes directly (instead of having to read all the logs after a breakin or a crash). XWatch is simply started with a few file arguments, and any information that appears on the files is displayed. With a slider you can see past information; i.e., lines that scroll in xwatch's window. That's all there is to it. The appearance of the xwatch window can furthermore be modified via command line flags or via an application defaults file. (Older versions of XWatch had a button to activate an `options' window. I removed this code, almost no-one uses it.)

XWatch is incidentally my first applications with the XForms GUI library for X, which I can highly recommend for developers who want to start `X programming' but who don't want to go through the hassle of having to learn about intrinsics. XForms is really excellent. Congrats, T.C. Zhao and Mark Overmars (the latter is rumored to bootleg at a soccer club in his free time ;). Instructions on where and how to get the XForms library are in the Makefile, contained in xwatch's distribution.



xwatch-2.11/doc/xwatch02.html100644 1750 1750 23402 6730212636 15101 0ustar rhogeerhogee XWatch <br> The Logfiles Watcher

Chapter 2: Using xwatch

You typically start xwatch when activating an X session; e.g., from the file which xdm uses to fire up a user's session (this file is normally /usr/X11/lib/X11/xdm/Xsession). The command that starts xwatch is something like

xwatch [options] files &

where `options' are optional flags, files are the files to watch, and the ampersand character is used to start xwatch in the background. The files to watch are typically in the directory /var/adm/: files which are created by the syslog daemon (see the file syslogd.conf.SAMPLE in the distribution for an example). XWatch accepts only filenames which are:

  • ordinary files, no sockets, directory names,

  • which are not binary files.

  • Other files as stated on the commandline are not monitored. When any `non-proper' file is given on the commandline, xwatch warns about the file not being acceptable and deletes it from its list of names.

    2.1: Options to the xwatch program

    The options are many, start xwatch without arguments to see what is supported. All options can also be stated in the file /usr/lib/X11/app-defaults/XWatch as X resources (see the file XWatch.ap as an example). In the following enumeration, a nr denotes a number:

  • -border nr: Specifies whether xwatch should start with a border. The nr must be 0 or 1. When you start xwatch without a border, your window manager may not be able to resize or even recognize it. Incidentally, this may be what you want -- I use it to `hide' the presence of xwatch from my window manager fvwm.

  • -geometry geom: Specifies the display geometry, á-la other X programs. You can express the geometry in terms of WxH (width by height), optionally postfixed by +X+Y (x and y offset) or -X-Y (offsets relative to the lower right corner) and other combinations.

    Note that previous switches that emulated the geometry specification, such as -xpos and -height, are now obsolete. Use the geometry setting.

  • -fg color and -bg color: These options define the default foreground and background of the watch window.

    Note that previous switches, such as -bred and -bblue, are now obsolete.

  • -printtime nr: Defines whether xwatch should prefix any info on the watched files with a timestamp. The nr can be 0 or zero; the timestamp is printed when nr is 1.

  • -printname nr: Defines whether xwatch should prefix any info on the watched files with the filename. The nr is again a flag, 0 or 1.

  • -newline nr: Defines whether xwatch should let a newline follow the time and/or filename stamp, so that the actual information is displayed on its own line.

  • -interval nr: Defines the scanning interval. Each nr seconds, xwatch will check if new information has arrived on the watched files. The nr may be between 1 and 30 seconds.

  • -fontsize nr: Defines the initial size of the display font. The nr may range from 1 to 4; 1 being the smallest font and 4 being the largest.

  • -fontstyle nr: Defines the style of the used font. The nr is a number between 0 and 15 (0 being the default). Start xwatch without arguments or read the application defaults file to see what fonts the numbers choose.

  • -firstwarnings nr: Defines whether xwatch should print initial warnings into the watch window. E.g., you might like to set firstwarnings to zero, and then start xwatch with the file argument /var/adm/*. Warnings about, e.g., utmp being a binary file would then be suppressed.

  • -printversion nr: Controls whether xwatch prints its version number and copyright notice upon startup in the watch window.

  • -gag text: This option, when present, prevents all lines with text in them from being shown in the display window. You can specify more than one string to `gag', in that case, separate the strings with |.

  • -colorstring col:string: This option causes lines that contain string to be displayed using the specified color. The string is matched literally. E.g., if you use the option -colorstring blue:connection then all lines containing connection are displayed in pure blue.

    You can specify several colorstrings by separating all options with a | character, as in -colorstring blue:connection|red:error. Note that, for reasons of shell expansion, you should quote such options on the commandline.

  • -title name: This option sets the window title of the watch window. Note that the title will only be visible when border is not 0. This option may be useful if you have several XWatch windows, monitoring different things.

  • -ignore fileA|fileB|fileC|...: This option is handy if you start XWatch with a wildcard file argument, but when you want XWatch not to process some files. The -ignore flag removes the stated files from the watchlist. Note that, for reasons of shell commandline expansion, you must quote the file specification (or the shell will interpret the | characters as pipes). (Thanks, Frank Brokken, frank@icce.rug.nl for the code).

  • Before you extensively use the options, create an application defaults file /usr/lib/X11/app-defaults/XWatch. You can do so by copying the file XWatch.ap, extracted from the archive, to /usr/lib/X11/app-defaults/XWatch. The comments in the distributed application defaults file explain what you can configure and show examples.

    Some systems do not have the directory /usr/lib/X11/app-defaults. In that case, you should create the following links:

  • /usr/X11 should point to your X11 distribution; e.g. to /usr/X11R6. That way, you always have e.g. /usr/X11/bin, even after upgrading your X11 distribution. All that is needed is one new link.

  • /usr/lib/X11 should point to /usr/X11/lib/X11.

  • Then edit the file XWatch in the application defaults directory, and follow the instructions therein to define your favorite settings. If you need to start xwatch incidentally with another setting, use a flag.

    2.2: File arguments

    The filename arguments can optionally be followed by a color specification that applies only to that particular file. E.g., say you want to see all the files in /var/adm normally in blue text; but you want to see /var/adm/critical (critical messages from applications) in yellow and /var/adm/auth (authentification messages) in red. In that case, the course to follow would be:

  • The default foreground color would be blue. You could set this with the flags -fg blue, or in the application defaults file.

  • The color for /var/adm/critical should be yellow. Hence, the first file argument would be /var/adm/critical:yellow.

  • The color for file /var/adm/auth should be red, hence the second file argument would be /var/adm/auth:red.

  • The following arguments would be the files, using the standard foreground (blue): /var/adm/*, without any extra color specifications.

  • Such a commandline would cause xwatch to complain about the multiple presence of /var/adm/critical (once from the separate argument, and once from the wildcard argument) and similarly about /var/adm/auth. If this bothers you, turn off the initial warnings (e.g., using -firstwarnings 0 or in the application defaults file).

    Note that besides the color specifications for filenames, you can also specify coloring for lines that match a given string in all files. See the above description of the switch -colorstring for more information.



    xwatch-2.11/doc/xwatch03.html100644 1750 1750 2321 6730212636 15057 0ustar rhogeerhogee XWatch <br> The Logfiles Watcher

    Chapter 3: Obtaining xwatch

    XWatch can be obtained at the ftp site ftp.icce.rug.nl, in the directory /pub/unix, as the file xwatch-X.YY.tar.gz. X.YY is the version number, e.g., 1.00. This site is the primary site, so check here for new versions.

    To unpack the archive, change-dir to your `sources' directory (e.g., /usr/local/src) and type

    tar xvzf /where/ever/you/put/it/xwatch-X.YY.tar.gz
    
    

    Next, change-dir to the unpacked subdirectory xwatch and check there. You will find a subdirectory src with the full sources.



    xwatch-2.11/doc/xwatch04.html100644 1750 1750 3246 6730212636 15067 0ustar rhogeerhogee XWatch <br> The Logfiles Watcher

    Chapter 4: Compiling xwatch

    Follow these steps.

  • You will need the XForms library and include files to compile xwatch. Check the Makefile in the src subdirectory for two ftp sites that carry XForms for Linux. Obtain the library and install it. XWatch will happily run with XForms version 0.81 or 0.88.

  • In the src subdirectory, edit the Makefile and adjust some defines at the top. E.g., a make install copies the binary by default to /usr/local/X11/bin; adjust that if you don't like this behavior.

  • Next, do a make install, followed by a make clean.

  • Copy the file XWatch.ap from the source directory to /usr/lib/X11/app-defaults/XWatch. Edit the file and state your favorite settings.

  • Next, start the program xwatch with some file arguments in your logfiles directory. If you're satisfied with the appearance and workings of xwatch, add the invocation to your script that starts an X session.



  • xwatch-2.11/doc/xwatch05.html100644 1750 1750 3406 6730212636 15066 0ustar rhogeerhogee XWatch <br> The Logfiles Watcher

    Chapter 5: Copyright

    XWatch - a tool to monitor logfiles and display new logs in an X window. Copyright (C) 1995 Karel Kubat. All rights reserved.

    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.

    You may link this software with XForms (Copyright (C) by T.C. Zhao and Mark Overmars) and distribute the resulting binary, under the restrictions in clause 3 of the GPL, even though the resulting binary is not, as a whole, covered by the GPL. (You still need a separate license to do so from the owner(s) of the copyright for XForms, however). If a derivative no longer requires XForms, you may use the unsupplemented GPL as its license by deleting this paragraph and therefore removing this exemption for XForms.

    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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA



    xwatch-2.11/doc/xwatch.yo100644 1750 1750 33132 6730211503 14413 0ustar rhogeerhogeemailto(karel@icce.rug.nl) report(\ XWatch nl() \ The Logfiles Watcher) (Karel Kubat (karel@icce.rug.nl) nl() \ State University of Groningen nl() \ Westerhaven 16, 9718 AW Groningen nl() \ The Netherlands) (1996) chapter(Introduction) tt(XWatch) is a small program that I wrote to monitor logfiles and to see any changes bf(directly) (instead of having to read all the logs after a breakin or a crash). tt(XWatch) is simply started with a few file arguments, and any information that appears on the files is displayed. With a slider you can see past information; i.e., lines that scroll in tt(xwatch)'s window. That's all there is to it. The appearance of the tt(xwatch) window can furthermore be modified via command line flags or via an application defaults file. (Older versions of tt(XWatch) had a button to activate an `options' window. I removed this code, almost no-one uses it.) tt(XWatch) is incidentally my first applications with the XForms GUI library for X, which I can highly recommend for developers who want to start `X programming' but who don't want to go through the hassle of having to learn about intrinsics. XForms is really excellent. Congrats, T.C. Zhao and Mark Overmars (the latter is rumored to bootleg at a soccer club in his free time ;). Instructions on where and how to get the XForms library are in the tt(Makefile), contained in tt(xwatch)'s distribution. chapter(Using xwatch) You typically start tt(xwatch) when activating an X session; e.g., from the file which xdm uses to fire up a user's session (this file is normally tt(/usr/X11/lib/X11/xdm/Xsession)). The command that starts tt(xwatch) is something like verb(\ xwatch [options] files & ) where `options' are optional flags, files are the files to watch, and the ampersand character is used to start tt(xwatch) in the background. The files to watch are typically in the directory tt(/var/adm/): files which are created by the syslog daemon (see the file tt(syslogd.conf.SAMPLE) in the distribution for an example). tt(XWatch) accepts only filenames which are: startit() it() ordinary files, no sockets, directory names, it() which are not binary files. endit() Other files as stated on the commandline are not monitored. When any `non-proper' file is given on the commandline, tt(xwatch) warns about the file not being acceptable and deletes it from its list of names. sect(Options to the xwatch program) The options are many, start tt(xwatch) without arguments to see what is supported. All options can also be stated in the file tt(/usr/lib/X11/app-defaults/XWatch) as X resources (see the file tt(XWatch.ap) as an example). In the following enumeration, a em(nr) denotes a number: startit() it() tt(-border) em(nr): Specifies whether tt(xwatch) should start with a border. The em(nr) must be 0 or 1. When you start tt(xwatch) without a border, your window manager may not be able to resize or even recognize it. Incidentally, this may be what you want -- I use it to `hide' the presence of tt(xwatch) from my window manager tt(fvwm). it() tt(-geometry) em(geom): Specifies the display geometry, \'a-la other X programs. You can express the geometry in terms of em(WxH) (width by height), optionally postfixed by em(+X+Y) (x and y offset) or em(-X-Y) (offsets relative to the lower right corner) and other combinations. Note that previous switches that emulated the geometry specification, such as tt(-xpos) and tt(-height), are now obsolete. Use the geometry setting. it() tt(-fg) em(color) and tt(-bg) em(color): These options define the default foreground and background of the watch window. Note that previous switches, such as tt(-bred) and tt(-bblue), are now obsolete. it() tt(-printtime) em(nr): Defines whether tt(xwatch) should prefix any info on the watched files with a timestamp. The tt(nr) can be 0 or zero; the timestamp is printed when em(nr) is 1. it() tt(-printname) em(nr): Defines whether tt(xwatch) should prefix any info on the watched files with the filename. The em(nr) is again a flag, 0 or 1. it() tt(-newline) em(nr): Defines whether tt(xwatch) should let a newline follow the time and/or filename stamp, so that the actual information is displayed on its own line. it() tt(-interval) em(nr): Defines the scanning interval. Each em(nr) seconds, tt(xwatch) will check if new information has arrived on the watched files. The em(nr) may be between 1 and 30 seconds. it() tt(-fontsize) em(nr): Defines the initial size of the display font. The em(nr) may range from 1 to 4; 1 being the smallest font and 4 being the largest. it() tt(-fontstyle) em(nr): Defines the style of the used font. The em(nr) is a number between 0 and 15 (0 being the default). Start tt(xwatch) without arguments or read the application defaults file to see what fonts the numbers choose. it() tt(-firstwarnings) em(nr): Defines whether tt(xwatch) should print initial warnings into the watch window. E.g., you might like to set tt(firstwarnings) to zero, and then start tt(xwatch) with the file argument tt(/var/adm/*). Warnings about, e.g., tt(utmp) being a binary file would then be suppressed. it() tt(-printversion) em(nr): Controls whether tt(xwatch) prints its version number and copyright notice upon startup in the watch window. it() tt(-gag) em(text): This option, when present, prevents all lines with em(text) in them from being shown in the display window. You can specify more than one string to `gag', in that case, separate the strings with tt(|). it() tt(-colorstring) em(col:string): This option causes lines that contain tt(string) to be displayed using the specified color. The string is matched literally. E.g., if you use the option tt(-colorstring blue:connection) then all lines containing tt(connection) are displayed in pure blue. You can specify several colorstrings by separating all options with a | character, as in tt(-colorstring blue:connection|red:error). Note that, for reasons of shell expansion, you should quote such options on the commandline. it() tt(-title) em(name): This option sets the window title of the watch window. Note that the title will only be visible when tt(border) is not 0. This option may be useful if you have several XWatch windows, monitoring different things. it() tt(-ignore) em(fileA|fileB|fileC|...): This option is handy if you start XWatch with a wildcard file argument, but when you want XWatch bf(not) to process some files. The tt(-ignore) flag removes the stated files from the watchlist. Note that, for reasons of shell commandline expansion, you must quote the file specification (or the shell will interpret the | characters as pipes). (Thanks, Frank Brokken, tt(frank@icce.rug.nl) for the code). endit() Before you extensively use the options, create an application defaults file tt(/usr/lib/X11/app-defaults/XWatch). You can do so by copying the file tt(XWatch.ap), extracted from the archive, to tt(/usr/lib/X11/app-defaults/XWatch). The comments in the distributed application defaults file explain what you can configure and show examples. Some systems do not have the directory tt(/usr/lib/X11/app-defaults). In that case, you should create the following links: startit() it() tt(/usr/X11) should point to your X11 distribution; e.g. to tt(/usr/X11R6). That way, you always have e.g. tt(/usr/X11/bin), even after upgrading your X11 distribution. All that is needed is one new link. it() tt(/usr/lib/X11) should point to tt(/usr/X11/lib/X11). endit() Then edit the file tt(XWatch) in the application defaults directory, and follow the instructions therein to define your favorite settings. If you need to start tt(xwatch) incidentally with another setting, use a flag. sect(File arguments) The filename arguments can optionally be followed by a color specification that applies only to that particular file. E.g., say you want to see all the files in tt(/var/adm) normally in blue text; but you want to see tt(/var/adm/critical) (critical messages from applications) in yellow and tt(/var/adm/auth) (authentification messages) in red. In that case, the course to follow would be: startit() it() The default foreground color would be blue. You could set this with the flags tt(-fg blue), or in the application defaults file. it() The color for tt(/var/adm/critical) should be yellow. Hence, the first file argument would be tt(/var/adm/critical:yellow). it() The color for file tt(/var/adm/auth) should be red, hence the second file argument would be tt(/var/adm/auth:red). it() The following arguments would be the files, using the standard foreground (blue): tt(/var/adm/*), without any extra color specifications. endit() Such a commandline would cause tt(xwatch) to complain about the multiple presence of tt(/var/adm/critical) (once from the separate argument, and once from the wildcard argument) and similarly about tt(/var/adm/auth). If this bothers you, turn off the initial warnings (e.g., using tt(-firstwarnings 0) or in the application defaults file). Note that besides the color specifications for filenames, you can also specify coloring for lines that match a given string in all files. See the above description of the switch tt(-colorstring) for more information. COMMENT(**** Leave this tag in place, it's used to generate the INSTALL file: STARTINSTALL ) IFDEF(INSTALL) (report(XWatch: short installation guide)()()) () chapter(Obtaining xwatch) tt(XWatch) can be obtained at the ftp site url(tt(ftp.icce.rug.nl)) (ftp://ftp.icce.rug.nl), in the directory url(tt(/pub/unix)) (ftp://ftp.icce.rug.nl/pub/unix), as the file tt(xwatch-X.YY.tar.gz). tt(X.YY) is the version number, e.g., 1.00. This site is the primary site, so check here for new versions. To unpack the archive, change-dir to your `sources' directory (e.g., tt(/usr/local/src)) and type verb(\ tar xvzf /where/ever/you/put/it/xwatch-X.YY.tar.gz ) Next, change-dir to the unpacked subdirectory tt(xwatch) and check there. You will find a subdirectory tt(src) with the full sources. chapter(Compiling xwatch) IFDEF(INSTALL)(\ This file is automatically generated from tt(doc/xwatch.yo). Please also read the full docs in HTML format as tt(doc/xwatch.html) or in LaTeX format as tt(doc/xwatch.tex). A poor-mans document is tt(doc/xwatch.txt), that's plain ASCII for those who can't handle HTML or LaTeX. ) () Follow these steps. startit() it() You will need the XForms library and include files to compile tt(xwatch). Check the tt(Makefile) in the tt(src) subdirectory for two ftp sites that carry XForms for Linux. Obtain the library and install it. XWatch will happily run with XForms version 0.81 or 0.88. it() In the tt(src) subdirectory, edit the tt(Makefile) and adjust some defines at the top. E.g., a tt(make install) copies the binary by default to tt(/usr/local/X11/bin); adjust that if you don't like this behavior. it() Next, do a tt(make install), followed by a tt(make clean). it() Copy the file tt(XWatch.ap) from the source directory to tt(/usr/lib/X11/app-defaults/XWatch). Edit the file and state your favorite settings. it() Next, start the program tt(xwatch) with some file arguments in your logfiles directory. If you're satisfied with the appearance and workings of tt(xwatch), add the invocation to your script that starts an X session. endit() chapter(Copyright) XWatch - a tool to monitor logfiles and display new logs in an X window. Copyright (C) 1995 Karel Kubat. All rights reserved. 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. You may link this software with XForms (Copyright (C) by T.C. Zhao and Mark Overmars) and distribute the resulting binary, under the restrictions in clause 3 of the GPL, even though the resulting binary is not, as a whole, covered by the GPL. (You still need a separate license to do so from the owner(s) of the copyright for XForms, however). If a derivative no longer requires XForms, you may use the unsupplemented GPL as its license by deleting this paragraph and therefore removing this exemption for XForms. 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA xwatch-2.11/doc/xwatch.tex100644 1750 1750 34254 6730212644 14601 0ustar rhogeerhogee \documentclass{report} \usepackage[T1]{fontenc} \hfuzz=4pt % don't fuss when less than 4pt \input{/usr/share/yodl/xlatin1.tex} \setlength{\parskip}{3mm} % height between par \setlength{\parindent}{0mm} % no par indent \title{XWatch \ \\ The Logfiles Watcher} \author{Karel Kubat (karel@icce.rug.nl) \ \\ State University of Groningen \ \\ Westerhaven 16, 9718 AW Groningen \ \\ The Netherlands} \date{1996} \begin{document} \maketitle \clearpage\tableofcontents \clearpage \chapter{Introduction} \texttt{XWatch} is a small program that I wrote to monitor logfiles and to see any changes \textbf{directly} (instead of having to read all the logs after a breakin or a crash). \texttt{XWatch} is simply started with a few file arguments, and any information that appears on the files is displayed. With a slider you can see past information; i.e., lines that scroll in \texttt{xwatch}'s window. That's all there is to it. The appearance of the \texttt{xwatch} window can furthermore be modified via command line flags or via an application defaults file. (Older versions of \texttt{XWatch} had a button to activate an `options' window. I removed this code, almost no-one uses it.) \texttt{XWatch} is incidentally my first applications with the XForms GUI library for X, which I can highly recommend for developers who want to start `X programming' but who don't want to go through the hassle of having to learn about intrinsics. XForms is really excellent. Congrats, T.C. Zhao and Mark Overmars (the latter is rumored to bootleg at a soccer club in his free time ;). Instructions on where and how to get the XForms library are in the \texttt{Makefile}, contained in \texttt{xwatch}'s distribution. \chapter{Using xwatch} You typically start \texttt{xwatch} when activating an X session; e.g., from the file which xdm uses to fire up a user's session (this file is normally \texttt{/usr/X11/lib/X11/xdm/Xsession}). The command that starts \texttt{xwatch} is something like \begin{verbatim} xwatch [options] files & \end{verbatim} where `options' are optional flags, files are the files to watch, and the ampersand character is used to start \texttt{xwatch} in the background. The files to watch are typically in the directory \texttt{/var/adm/}: files which are created by the syslog daemon (see the file \texttt{syslogd.conf.SAMPLE} in the distribution for an example). \texttt{XWatch} accepts only filenames which are: \begin{itemize} \item ordinary files, no sockets, directory names, \item which are not binary files. \end{itemize} Other files as stated on the commandline are not monitored. When any `non-proper' file is given on the commandline, \texttt{xwatch} warns about the file not being acceptable and deletes it from its list of names. \section{Options to the xwatch program} The options are many, start \texttt{xwatch} without arguments to see what is supported. All options can also be stated in the file \texttt{/usr/lib/X11/app-defaults/XWatch} as X resources (see the file \texttt{XWatch.ap} as an example). In the following enumeration, a \emph{nr} denotes a number: \begin{itemize} \item \texttt{-border} \emph{nr}: Specifies whether \texttt{xwatch} should start with a border. The \emph{nr} must be 0 or 1. When you start \texttt{xwatch} without a border, your window manager may not be able to resize or even recognize it. Incidentally, this may be what you want -- I use it to `hide' the presence of \texttt{xwatch} from my window manager \texttt{fvwm}. \item \texttt{-geometry} \emph{geom}: Specifies the display geometry, \'{a}-la other X programs. You can express the geometry in terms of \emph{WxH} (width by height), optionally postfixed by \emph{+X+Y} (x and y offset) or \emph{-X-Y} (offsets relative to the lower right corner) and other combinations. Note that previous switches that emulated the geometry specification, such as \texttt{-xpos} and \texttt{-height}, are now obsolete. Use the geometry setting. \item \texttt{-fg} \emph{color} and \texttt{-bg} \emph{color}: These options define the default foreground and background of the watch window. Note that previous switches, such as \texttt{-bred} and \texttt{-bblue}, are now obsolete. \item \texttt{-printtime} \emph{nr}: Defines whether \texttt{xwatch} should prefix any info on the watched files with a timestamp. The \texttt{nr} can be 0 or zero; the timestamp is printed when \emph{nr} is 1. \item \texttt{-printname} \emph{nr}: Defines whether \texttt{xwatch} should prefix any info on the watched files with the filename. The \emph{nr} is again a flag, 0 or 1. \item \texttt{-newline} \emph{nr}: Defines whether \texttt{xwatch} should let a newline follow the time and/or filename stamp, so that the actual information is displayed on its own line. \item \texttt{-interval} \emph{nr}: Defines the scanning interval. Each \emph{nr} seconds, \texttt{xwatch} will check if new information has arrived on the watched files. The \emph{nr} may be between 1 and 30 seconds. \item \texttt{-fontsize} \emph{nr}: Defines the initial size of the display font. The \emph{nr} may range from 1 to 4; 1 being the smallest font and 4 being the largest. \item \texttt{-fontstyle} \emph{nr}: Defines the style of the used font. The \emph{nr} is a number between 0 and 15 (0 being the default). Start \texttt{xwatch} without arguments or read the application defaults file to see what fonts the numbers choose. \item \texttt{-firstwarnings} \emph{nr}: Defines whether \texttt{xwatch} should print initial warnings into the watch window. E.g., you might like to set \texttt{firstwarnings} to zero, and then start \texttt{xwatch} with the file argument \texttt{/var/adm/*}. Warnings about, e.g., \texttt{utmp} being a binary file would then be suppressed. \item \texttt{-printversion} \emph{nr}: Controls whether \texttt{xwatch} prints its version number and copyright notice upon startup in the watch window. \item \texttt{-gag} \emph{text}: This option, when present, prevents all lines with \emph{text} in them from being shown in the display window. You can specify more than one string to `gag', in that case, separate the strings with \texttt{\textbar }. \item \texttt{-colorstring} \emph{col:string}: This option causes lines that contain \texttt{string} to be displayed using the specified color. The string is matched literally. E.g., if you use the option \texttt{-colorstring blue:connection} then all lines containing \texttt{connection} are displayed in pure blue. You can specify several colorstrings by separating all options with a \textbar character, as in \texttt{-colorstring blue:connection\textbar red:error}. Note that, for reasons of shell expansion, you should quote such options on the commandline. \item \texttt{-title} \emph{name}: This option sets the window title of the watch window. Note that the title will only be visible when \texttt{border} is not 0. This option may be useful if you have several XWatch windows, monitoring different things. \item \texttt{-ignore} \emph{fileA\textbar fileB\textbar fileC\textbar ...}: This option is handy if you start XWatch with a wildcard file argument, but when you want XWatch \textbf{not} to process some files. The \texttt{-ignore} flag removes the stated files from the watchlist. Note that, for reasons of shell commandline expansion, you must quote the file specification (or the shell will interpret the \textbar characters as pipes). (Thanks, Frank Brokken, \texttt{frank@icce.rug.nl} for the code). \end{itemize} Before you extensively use the options, create an application defaults file \texttt{/usr/lib/X11/app-defaults/XWatch}. You can do so by copying the file \texttt{XWatch.ap}, extracted from the archive, to \texttt{/usr/lib/X11/app-defaults/XWatch}. The comments in the distributed application defaults file explain what you can configure and show examples. Some systems do not have the directory \texttt{/usr/lib/X11/app-defaults}. In that case, you should create the following links: \begin{itemize} \item \texttt{/usr/X11} should point to your X11 distribution; e.g. to \texttt{/usr/X11R6}. That way, you always have e.g. \texttt{/usr/X11/bin}, even after upgrading your X11 distribution. All that is needed is one new link. \item \texttt{/usr/lib/X11} should point to \texttt{/usr/X11/lib/X11}. \end{itemize} Then edit the file \texttt{XWatch} in the application defaults directory, and follow the instructions therein to define your favorite settings. If you need to start \texttt{xwatch} incidentally with another setting, use a flag. \section{File arguments} The filename arguments can optionally be followed by a color specification that applies only to that particular file. E.g., say you want to see all the files in \texttt{/var/adm} normally in blue text; but you want to see \texttt{/var/adm/critical} (critical messages from applications) in yellow and \texttt{/var/adm/auth} (authentification messages) in red. In that case, the course to follow would be: \begin{itemize} \item The default foreground color would be blue. You could set this with the flags \texttt{-fg blue}, or in the application defaults file. \item The color for \texttt{/var/adm/critical} should be yellow. Hence, the first file argument would be \texttt{/var/adm/critical:yellow}. \item The color for file \texttt{/var/adm/auth} should be red, hence the second file argument would be \texttt{/var/adm/auth:red}. \item The following arguments would be the files, using the standard foreground (blue): \texttt{/var/adm/*}, without any extra color specifications. \end{itemize} Such a commandline would cause \texttt{xwatch} to complain about the multiple presence of \texttt{/var/adm/critical} (once from the separate argument, and once from the wildcard argument) and similarly about \texttt{/var/adm/auth}. If this bothers you, turn off the initial warnings (e.g., using \texttt{-firstwarnings 0} or in the application defaults file). Note that besides the color specifications for filenames, you can also specify coloring for lines that match a given string in all files. See the above description of the switch \texttt{-colorstring} for more information. \chapter{Obtaining xwatch} \texttt{XWatch} can be obtained at the ftp site \texttt{ftp.icce.rug.nl}, in the directory \texttt{/pub/unix}, as the file \texttt{xwatch-X.YY.tar.gz}. \texttt{X.YY} is the version number, e.g., 1.00. This site is the primary site, so check here for new versions. To unpack the archive, change-dir to your `sources' directory (e.g., \texttt{/usr/local/src}) and type \begin{verbatim} tar xvzf /where/ever/you/put/it/xwatch-X.YY.tar.gz \end{verbatim} Next, change-dir to the unpacked subdirectory \texttt{xwatch} and check there. You will find a subdirectory \texttt{src} with the full sources. \chapter{Compiling xwatch} Follow these steps. \begin{itemize} \item You will need the XForms library and include files to compile \texttt{xwatch}. Check the \texttt{Makefile} in the \texttt{src} subdirectory for two ftp sites that carry XForms for Linux. Obtain the library and install it. XWatch will happily run with XForms version 0.81 or 0.88. \item In the \texttt{src} subdirectory, edit the \texttt{Makefile} and adjust some defines at the top. E.g., a \texttt{make install} copies the binary by default to \texttt{/usr/local/X11/bin}; adjust that if you don't like this behavior. \item Next, do a \texttt{make install}, followed by a \texttt{make clean}. \item Copy the file \texttt{XWatch.ap} from the source directory to \texttt{/usr/lib/X11/app-defaults/XWatch}. Edit the file and state your favorite settings. \item Next, start the program \texttt{xwatch} with some file arguments in your logfiles directory. If you're satisfied with the appearance and workings of \texttt{xwatch}, add the invocation to your script that starts an X session. \end{itemize} \chapter{Copyright} XWatch - a tool to monitor logfiles and display new logs in an X window. Copyright (C) 1995 Karel Kubat. All rights reserved. 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. You may link this software with XForms (Copyright (C) by T.C. Zhao and Mark Overmars) and distribute the resulting binary, under the restrictions in clause 3 of the GPL, even though the resulting binary is not, as a whole, covered by the GPL. (You still need a separate license to do so from the owner(s) of the copyright for XForms, however). If a derivative no longer requires XForms, you may use the unsupplemented GPL as its license by deleting this paragraph and therefore removing this exemption for XForms. 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA \end{document}xwatch-2.11/doc/xwatch.man.patch100644 1750 1750 1441 6706466256 15637 0ustar rhogeerhogee*** xwatch.man~ Sun Apr 18 19:34:40 1999 --- xwatch.man Sun Apr 18 19:36:52 1999 *************** *** 1,14 **** ! .TH "XWatch .YODLTAGSTART. roffcmd .br ! The Logfiles Watcher" "1996" .YODLTAGEND. ! .SH "XWatch .YODLTAGSTART. roffcmd .br ! The Logfiles Watcher" .YODLTAGEND. ! .SH "Karel Kubat (karel@icce\&.rug\&.nl) .YODLTAGSTART. roffcmd .br State University of Groningen .br Westerhaven 16, 9718 AW Groningen .br ! The Netherlands" .YODLTAGEND. ! .SH "1996" .bp .SH Contents Chapter 1: Introduction --- 1,12 ---- ! .TH XWatch 1 ! .SH XWatch ! xwatch \- The Logfiles Watcher ! .SH Karel Kubat (karel@icce\&.rug\&.nl) State University of Groningen .br Westerhaven 16, 9718 AW Groningen .br ! The Netherlands .bp .SH Contents Chapter 1: Introduction xwatch-2.11/src/ 40755 1750 1750 0 6730212625 12455 5ustar rhogeerhogeexwatch-2.11/src/Makefile100644 1750 1750 10246 6730210135 14227 0ustar rhogeerhogee# -------------------------------------------------------------------------- # # Makefile for xwatch # # -------------------------------------------------------------------------- # Note: you will need the XForms library to get things compiled. You can # obtain the library at one of the Linux ftp sites (sunsite.unc.edu, # tsx-11.mit.edu) or at the primary sites: bloch.phys.uwm.edu:/pub/xforms # and ftp.cs.ruu.nl:/pub/XFORMS. This XWatch will compile with version 0.81 # of XForms. If you can't access the primary sites, get bxform-081.tar.gz # (or similar) from ftp.icce.rug.nl/pub/unix. That's the Linux ELF version. # For other platforms you're on your own, but XForms is available for _lots_ # of systems. # If you have installed XForms as the Makefile of the package does, you won't # have any problems compiling all. Otherwise, set XFLIBDIR to "-L..." (the # directory where the library lives) and XFLIBINC to "-I..." (the directory # where the include file forms.h lives). # XFLIBDIR = -L/usr/local/lib # XFINCDIR = -I/usr/local/inc # A `make install' will create a stripped version of xwatch and install it # to BINDIR. Define that directory here. If you want to make the program first # to check it out, before installing it, must do a `make final' and test the # program. Then do the "make install" when you're satisfied. BINDIR = /usr/local/X11/bin MANDIR = /usr/local/man/man1 # X barfs on too long commandlines (X11R6 does at least). Comment this out # if you don't want commandline length checks. XWatch might get too long # commandlines if you do something like "xwatch /var/adm/*". CMDLINEFLAG = -DMAXCMDLINE=1024 # Where is the with the rgb values. The default is "/usr/lib/X11/rgb.txt". # Modify the following RGB_FILEFLAG if your file is named differently. # Thanks, Christian Motschke, motschke@first.gmd.de. # RGB_FILEFLAG = -DRGB_FILE=\\\"/usr/lib/X11/rgb.txt\\\" # If you're on a Sun, you might not have the function strerror(). # If the linkage phase barfs about a missing symbol _strerror or something # similar, undefine the following: # STRERROR = strerror.o # I've seen a report from someone who needed a "-lXpm" flag in the linkage # phase. I never needed that, but you might, who knows. # If the linkage fails, try adding the -lXpm to the below STDLFLAGS and # DEBUGLFLAGS definitions. # Standard compilation flags. You probably won't have to change these, if # you are using gcc. STDCFLAGS = -c -O2 -Wall $(CMDLINEFLAG) $(RGB_FILEFLAG) $(XFINCDIR) STDLFLAGS = -s -L/usr/X11R6/lib # Compilation flags for `make debug'. Again, OK for gcc. Probably only relevant # for me, the developer. The DEBUGLFLAGS may need -static, depends on your # compiler and stuff. DEBUGCFLAGS = -g DEBUGLFLAGS = # You have edited enough. Now run `make'. # # -------------------------------------------------------------------------- # Version of this XWatch. VER = 2.11 # How to get to an object file. .c.o: $(CC) $(CFLAGS) -DVER=\"$(VER)\" $< # objects we need for the program OBJ = xwatch.o usage.o ui.o parsegag.o xmalloc.o xrealloc.o xstrdup.o \ alarmhandler.o addfile.o scanfile.o parsecolorstring.o \ warning.o addline.o error.o checksetting.o getcolorindex.o \ parsegeometry.o parseignore.o colorname2rgb.o parsecolors.o \ colorname2index.o \ $(STRERROR) foobar: @echo 'Make what? Choose one of:' @echo 'make final : make final version of xwatch' @echo 'make debug : make debugging version of xwatch' @echo 'make clean : remove objects and binary' @echo 'make install : make final version and install to' $(BINDIR) @echo 'make dist : make distribution (for me, Karel, only)' exit 1 final: make xwatch CFLAGS="$(STDCFLAGS)" LFLAGS="$(STDLFLAGS)" debug: make xwatch CFLAGS="$(STDCFLAGS) $(DEBUGCFLAGS)" \ LFLAGS="$(DEBUGLFLAGS)" clean: rm -f xwatch $(OBJ) core install: final install -m 755 xwatch $(BINDIR)/xwatch install -m 644 ../doc/xwatch.man $(MANDIR)/xwatch.1 xwatch: $(OBJ) $(CC) -o xwatch $(OBJ) $(XFLIBDIR) -lforms -lX11 -lm $(LFLAGS) dist: clean header -0ak *.c *.h header -rk *.c *.h ./.makedist $(BINDIR) $(VER) # extra deps xwatch.o: xwatch.c Makefile flres.h settings.h data.inc usage.o: usage.c Makefile colorname2rgb.o: colorname2rgb.c Makefile xwatch-2.11/src/addfile.c100644 1750 1750 10650 6171373416 14335 0ustar rhogeerhogee/* <<< Start of information >>> */ /* This file is part of the xwatch package. */ /* Copyright (C) 1995 Karel Kubat. All rights reserved. */ /* */ /* 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. */ /* */ /* You may link this software with XForms (Copyright (C) by T.C. Zhao and */ /* Mark Overmars) and distribute the resulting binary, under the */ /* restrictions in clause 3 of the GPL, even though the resulting binary is */ /* not, as a whole, covered by the GPL. (You still need a separate license */ /* to do so from the owner(s) of the copyright for XForms, however). If a */ /* derivative no longer requires XForms, you may use the unsupplemented GPL */ /* as its license by deleting this paragraph and therefore removing this */ /* exemption for XForms. */ /* */ /* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* <<< End of information >>> */ #include "xwatch.h" void addfile (char *filename) { struct stat statbuf; char buf [512], fname [1000], *cp; FILE *f; int i, inode, readres, colorindex; colorindex = foregr; /* assume std foregr */ cp = strchr (filename, ':'); /* try to split name */ if (cp) { *cp = '\0'; /* cut off : part */ cp++; /* cp points to */ if (! *cp) /* color info */ cp = NULL; } strcpy (fname, filename); /* get filename */ if (cp) /* handle color */ colorindex = colorname2index (cp); /* colorspec here */ if (stat (fname, &statbuf)) /* see if file */ { /* exists */ if (firstwarnings) warning ("Cannot find %s: %s", fname, strerror (errno)); return; } if (! S_ISREG (statbuf.st_mode)) /* is it ordinary */ { /* file */ if (firstwarnings) warning ("%s is not a regular file", fname); return; } inode = statbuf.st_ino; if (! (f = fopen (fname, "r")) ) /* is it a textfile */ { if (firstwarnings) warning ("Cannot read %s: %s", fname, strerror (errno)); return; } readres = fread (buf, 1, sizeof (buf), f); for (i = 0; i < readres; i++) if (! buf [i]) { if (firstwarnings) warning ("File %s is a binary file", fname); fclose (f); return; } fclose (f); for (i = 0; i < nfinfo; i++) /* do we already */ if (finfo [i].inode == inode) /* have the file */ { if (firstwarnings) warning ("Names %s and %s are the the same file", fname, finfo [i].name); return; } /* after all the checks, add it to our list */ finfo = (Fileinfo *) xrealloc (finfo, (nfinfo + 1) * sizeof (Fileinfo)); finfo [nfinfo].name = xstrdup (fname); finfo [nfinfo].active = 1; finfo [nfinfo].inode = inode; finfo [nfinfo].offset = statbuf.st_size; finfo [nfinfo].colorindex = colorindex; nfinfo++; } xwatch-2.11/src/addline.c100644 1750 1750 12517 6210107734 14341 0ustar rhogeerhogee/* <<< Start of information >>> */ /* This file is part of the xwatch package. */ /* Copyright (C) 1995 Karel Kubat. All rights reserved. */ /* */ /* 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. */ /* */ /* You may link this software with XForms (Copyright (C) by T.C. Zhao and */ /* Mark Overmars) and distribute the resulting binary, under the */ /* restrictions in clause 3 of the GPL, even though the resulting binary is */ /* not, as a whole, covered by the GPL. (You still need a separate license */ /* to do so from the owner(s) of the copyright for XForms, however). If a */ /* derivative no longer requires XForms, you may use the unsupplemented GPL */ /* as its license by deleting this paragraph and therefore removing this */ /* exemption for XForms. */ /* */ /* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* <<< End of information >>> */ #include "xwatch.h" void addline (char *buf, int colindex) { char outbuf [1000]; int i, length_so_far, extra_length, curwidth, curheight, curx, cury; char *bufcopy, *cp; /* clear trailing \n chars */ if ( (cp = strchr (buf, '\n')) && cp > buf ) *cp = '\0'; if (! *buf) return; /* see if the contents of the line is `gagged' */ for (i = 0; i < ngagstring; i++) if (strstr (buf, gagstring [i])) return; /* determine width to use */ fl_get_browser_dimension (watch_browser, &curx, &cury, &curwidth, &curheight); curwidth -= 5; /* reset outbuffer */ outbuf [0] = '\0'; /* process whole buf, cut it up if necessary */ bufcopy = xstrdup (buf); cp = strtok (bufcopy, " \t"); while (cp) { int empty_outbuf = 0; /* add color code if necessary */ if (! outbuf [0]) { if (colindex != foregr) sprintf (outbuf, "@C%d ", colindex); else strcpy (outbuf, " "); empty_outbuf = 1; } /* determine length of string so far, flush if necessary */ length_so_far = fl_get_string_width (fontstyle, fontsize, outbuf, strlen (outbuf)); extra_length = fl_get_string_width (fontstyle, fontsize, cp, strlen (cp)); /* If the next word is too long to fit, and we have nothing */ /* to print, */ if (empty_outbuf && length_so_far + extra_length > curwidth) { /* print it anyway */ /* break it into width-sized chunks */ while (*cp) { int len_to_print, len_of_color_code; /* start each line with color code */ if (colindex != foregr) sprintf (outbuf, "@C%d ", colindex); else strcpy (outbuf, " "); strcat (outbuf, " "); len_of_color_code = strlen(outbuf); strcat(outbuf, cp); len_to_print = strlen(outbuf); while (fl_get_string_width (fontstyle, fontsize, outbuf, len_to_print) > curwidth && len_to_print > len_of_color_code) { --len_to_print; } /* Make sure we manage to print at least one new character */ if (len_to_print <= len_of_color_code) len_to_print = len_of_color_code + 1; outbuf[len_to_print] = '\0'; fl_addto_browser (watch_browser, outbuf); cp += len_to_print - len_of_color_code; } outbuf[0] = '\0'; /* and get the next word */ cp = strtok (NULL, " \t"); } else if (length_so_far + extra_length > curwidth) { fl_addto_browser (watch_browser, outbuf); outbuf [0] = '\0'; } else { strcat (outbuf, " "); strcat (outbuf, cp); cp = strtok (NULL, " \t"); } } /* flush whatever's left */ if (cp) strcat (outbuf, cp); if (outbuf [0]) fl_addto_browser (watch_browser, outbuf); /* release memory */ free (bufcopy); } xwatch-2.11/src/alarmhandler.c100644 1750 1750 5161 6154563203 15354 0ustar rhogeerhogee/* <<< Start of information >>> */ /* This file is part of the xwatch package. */ /* Copyright (C) 1995 Karel Kubat. All rights reserved. */ /* */ /* 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. */ /* */ /* You may link this software with XForms (Copyright (C) by T.C. Zhao and */ /* Mark Overmars) and distribute the resulting binary, under the */ /* restrictions in clause 3 of the GPL, even though the resulting binary is */ /* not, as a whole, covered by the GPL. (You still need a separate license */ /* to do so from the owner(s) of the copyright for XForms, however). If a */ /* derivative no longer requires XForms, you may use the unsupplemented GPL */ /* as its license by deleting this paragraph and therefore removing this */ /* exemption for XForms. */ /* */ /* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* <<< End of information >>> */ #include "xwatch.h" void alarmhandler (int sig) { register int i; /* check up on all files */ for (i = 0; i < nfinfo; i++) scanfile (i, 1); /* remember only max lines */ if (fl_get_browser_maxline (watch_browser) > nlines) { fl_freeze_form (browser_form); do fl_delete_browser_line (watch_browser, 1); while (fl_get_browser_maxline (watch_browser) > nlines); fl_unfreeze_form (browser_form); } /* reload scanning alarm */ signal (SIGALRM, alarmhandler); alarm (interval); } xwatch-2.11/src/ui.c100644 1750 1750 5326 6706422623 13345 0ustar rhogeerhogee/* <<< Start of information >>> */ /* This file is part of the xwatch package. */ /* Copyright (C) 1995 Karel Kubat. All rights reserved. */ /* */ /* 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. */ /* */ /* You may link this software with XForms (Copyright (C) by T.C. Zhao and */ /* Mark Overmars) and distribute the resulting binary, under the */ /* restrictions in clause 3 of the GPL, even though the resulting binary is */ /* not, as a whole, covered by the GPL. (You still need a separate license */ /* to do so from the owner(s) of the copyright for XForms, however). If a */ /* derivative no longer requires XForms, you may use the unsupplemented GPL */ /* as its license by deleting this paragraph and therefore removing this */ /* exemption for XForms. */ /* */ /* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* <<< End of information >>> */ /* Form definition file generated with fdesign. */ #include #include #include "ui.h" FL_FORM *browser_form; FL_OBJECT *watch_browser; void create_form_browser_form(void) { FL_OBJECT *obj; if (browser_form) return; browser_form = fl_bgn_form(FL_NO_BOX,550,70); obj = fl_add_box(FL_UP_BOX,0,0,550,70,""); watch_browser = obj = fl_add_browser(FL_NORMAL_BROWSER,0,0,550,70,""); fl_set_object_color(obj,FL_WHITE,FL_YELLOW); fl_set_object_lcol(obj,FL_RED); fl_end_form(); } /*---------------------------------------*/ void create_the_forms(void) { create_form_browser_form(); } xwatch-2.11/src/ui.h100644 1750 1750 4644 6155762363 13362 0ustar rhogeerhogee/* <<< Start of information >>> */ /* This file is part of the xwatch package. */ /* Copyright (C) 1995 Karel Kubat. All rights reserved. */ /* */ /* 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. */ /* */ /* You may link this software with XForms (Copyright (C) by T.C. Zhao and */ /* Mark Overmars) and distribute the resulting binary, under the */ /* restrictions in clause 3 of the GPL, even though the resulting binary is */ /* not, as a whole, covered by the GPL. (You still need a separate license */ /* to do so from the owner(s) of the copyright for XForms, however). If a */ /* derivative no longer requires XForms, you may use the unsupplemented GPL */ /* as its license by deleting this paragraph and therefore removing this */ /* exemption for XForms. */ /* */ /* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* <<< End of information >>> */ #ifndef FD_browser_form_h_ #define FD_browser_form_h_ /* Header file generated with fdesign. */ /**** Callback routines ****/ /**** Forms and Objects ****/ extern FL_FORM *browser_form; extern FL_OBJECT *watch_browser; /**** Creation Routine ****/ extern void create_the_forms(void); #endif /* FD_browser_form_h_ */ xwatch-2.11/src/error.c100644 1750 1750 4454 6017312104 14045 0ustar rhogeerhogee/* <<< Start of information >>> */ /* This file is part of the xwatch package. */ /* Copyright (C) 1995 Karel Kubat. All rights reserved. */ /* */ /* 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. */ /* */ /* You may link this software with XForms (Copyright (C) by T.C. Zhao and */ /* Mark Overmars) and distribute the resulting binary, under the */ /* restrictions in clause 3 of the GPL, even though the resulting binary is */ /* not, as a whole, covered by the GPL. (You still need a separate license */ /* to do so from the owner(s) of the copyright for XForms, however). If a */ /* derivative no longer requires XForms, you may use the unsupplemented GPL */ /* as its license by deleting this paragraph and therefore removing this */ /* exemption for XForms. */ /* */ /* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* <<< End of information >>> */ #include "xwatch.h" void error (char *fmt, ...) { va_list args; fprintf (stderr, "xwatch: "); va_start (args, fmt); vfprintf (stderr, fmt, args); fputc ('\n', stderr); exit (1); } xwatch-2.11/src/parsegeometry.c100644 1750 1750 6040 6162210724 15601 0ustar rhogeerhogee/* <<< Start of information >>> */ /* This file is part of the xwatch package. */ /* Copyright (C) 1995 Karel Kubat. All rights reserved. */ /* */ /* 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. */ /* */ /* You may link this software with XForms (Copyright (C) by T.C. Zhao and */ /* Mark Overmars) and distribute the resulting binary, under the */ /* restrictions in clause 3 of the GPL, even though the resulting binary is */ /* not, as a whole, covered by the GPL. (You still need a separate license */ /* to do so from the owner(s) of the copyright for XForms, however). If a */ /* derivative no longer requires XForms, you may use the unsupplemented GPL */ /* as its license by deleting this paragraph and therefore removing this */ /* exemption for XForms. */ /* */ /* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* <<< End of information >>> */ #include "xwatch.h" /* convert geometry string to xpos, ypos, width, height */ void parsegeometry (char *str, int *xp, int *yp, int *wp, int *hp) { int x, y, w, h, nread; if (! str || ! *str) /* no string, no parsing */ return; /* try to match NRxNR as first part of the string */ if (sscanf (str, "%dx%d%n", &w, &h, &nread) > 1) { *wp = w; *hp = h; str += nread; if (! *str) return; } /* now try all forms +NR+NR, -NR-NR, etc.. */ if (sscanf (str, "+%d+%d", &x, &y) > 1) { *xp = x; *yp = y; } else if (sscanf (str, "-%d+%d", &x, &y) > 1) { *xp = -x; *yp = y; } else if (sscanf (str, "+%d-%d", &x, &y) > 1) { *xp = x; *yp = -y; } else if (sscanf (str, "-%d-%d", &x, &y) > 1) { *xp = -x; *yp = -y; } } xwatch-2.11/src/checksetting.c100644 1750 1750 4541 6017313016 15367 0ustar rhogeerhogee/* <<< Start of information >>> */ /* This file is part of the xwatch package. */ /* Copyright (C) 1995 Karel Kubat. All rights reserved. */ /* */ /* 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. */ /* */ /* You may link this software with XForms (Copyright (C) by T.C. Zhao and */ /* Mark Overmars) and distribute the resulting binary, under the */ /* restrictions in clause 3 of the GPL, even though the resulting binary is */ /* not, as a whole, covered by the GPL. (You still need a separate license */ /* to do so from the owner(s) of the copyright for XForms, however). If a */ /* derivative no longer requires XForms, you may use the unsupplemented GPL */ /* as its license by deleting this paragraph and therefore removing this */ /* exemption for XForms. */ /* */ /* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* <<< End of information >>> */ #include "xwatch.h" void checksetting (int var, int min, int max, char *desc) { if (var < min || var > max) { if (max - min == 1) error ("%s must be %d or %d", desc, min, max); else error ("%s must be between %d and %d", desc, min, max); } } xwatch-2.11/src/scanfile.c100644 1750 1750 10531 6161533470 14524 0ustar rhogeerhogee/* <<< Start of information >>> */ /* This file is part of the xwatch package. */ /* Copyright (C) 1995 Karel Kubat. All rights reserved. */ /* */ /* 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. */ /* */ /* You may link this software with XForms (Copyright (C) by T.C. Zhao and */ /* Mark Overmars) and distribute the resulting binary, under the */ /* restrictions in clause 3 of the GPL, even though the resulting binary is */ /* not, as a whole, covered by the GPL. (You still need a separate license */ /* to do so from the owner(s) of the copyright for XForms, however). If a */ /* derivative no longer requires XForms, you may use the unsupplemented GPL */ /* as its license by deleting this paragraph and therefore removing this */ /* exemption for XForms. */ /* */ /* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* <<< End of information >>> */ #include "xwatch.h" void scanfile (int i, int showinfo) { struct stat statbuf; register FILE *f; char buf [1000]; time_t now; struct tm *loctime; int index, old_offset, current_offset, bufpos; /* check that file is still here */ if (stat (finfo [i].name, &statbuf)) { if (finfo [i].active) { warning ("File %s has disappeared", finfo [i].name); finfo [i].active = 0; } return; } /* check for reappeared files */ if (! finfo [i].active) { warning ("File %s has reappeared", finfo [i].name); finfo [i].active = 1; finfo [i].offset = 0; } current_offset = statbuf.st_size; old_offset = finfo [i].offset; finfo [i].offset = current_offset; /* just adjust offset if we don't have to show it */ if (! showinfo) return; /* check that file hasn't shortened */ if (current_offset < old_offset) { warning ("File %s has shortened", finfo [i].name); return; } /* check that something at all happened */ if (current_offset == old_offset) return; /* now open the file */ if (! (f = fopen (finfo [i].name, "r")) ) { warning ("Cannot read %s: %s", finfo [i].name, strerror (errno)); finfo [i].active = 0; return; } /* create first text: HH:MM:SS file */ buf [0] = '\0'; if (printtime) { time (&now); loctime = localtime (&now); sprintf (buf, "%2.2d:%2.2d'%2.2d ", loctime->tm_hour, loctime->tm_min, loctime->tm_sec); } if (printname) { strcat (buf, finfo [i].name); strcat (buf, ": "); } if ( newline && (printtime || printname) ) { addline (buf, finfo [i].colorindex); buf [0] = '\0'; } fseek (f, old_offset, SEEK_SET); bufpos = strlen (buf); while (1) { fgets (buf + bufpos, 999 - bufpos, f); if (feof (f)) break; /* see if this string is colored */ for (index = 0; index < ncolorstring; index++) if (strstr (buf, colorstring [index].str)) { addline (buf, colorstring [index].colorindex); break; } /* otherwise, add with file coloring */ if (index >= ncolorstring) addline (buf, finfo [i].colorindex); } fclose (f); } xwatch-2.11/src/usage.c100644 1750 1750 12514 6706467073 14061 0ustar rhogeerhogee/* <<< Start of information >>> */ /* This file is part of the xwatch package. */ /* Copyright (C) 1995 Karel Kubat. All rights reserved. */ /* */ /* 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. */ /* */ /* You may link this software with XForms (Copyright (C) by T.C. Zhao and */ /* Mark Overmars) and distribute the resulting binary, under the */ /* restrictions in clause 3 of the GPL, even though the resulting binary is */ /* not, as a whole, covered by the GPL. (You still need a separate license */ /* to do so from the owner(s) of the copyright for XForms, however). If a */ /* derivative no longer requires XForms, you may use the unsupplemented GPL */ /* as its license by deleting this paragraph and therefore removing this */ /* exemption for XForms. */ /* */ /* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* <<< End of information >>> */ #include "xwatch.h" void usage () { printf ( "\n" "XWatch - an X Log File Watcher V" VER "\n" "Copyright (C) 1995, 1996 Karel Kubat .\n" "\n" "Usage: xwatch [options] file(s)\n" "where:\n" " options may be:\n" " XForms options:\n" " -bw width - specifies border width\n" " -debug level - debugging level\n" " -depth d - visual depth\n" " -double - turns on double buffering\n" " -display host:display - the display, default: $DISPLAY\n" " -name applicationname - application name, default: XWatch\n" " -private, -shared, -stdcmap - private or shared or standard colormap\n" " -rgamma red, -ggamma green,\n" " -bgamma blue - gamma for red/green/blue components\n" " -sync - forces synchronous mode\n" " -vid id - preferred visual ID\n" " -visual class - visual class, e.g. TrueColor\n" " Xwatch options: (# stands for a number, [..] means default)\n" " -border 0|1 - start text window with or without border [1]\n" " -bg R/G/B or -bg col - states background color, either as three\n" " red/green/blue numbers or as one name [white]\n" " -colorstring col:text - uses color for lines having text in them\n" " -firstwarnings 0|1 - print warnings about files upon startup [1]\n" " -fg R/G/B or -fg col - states foreground [black]\n" " -fontsize # - size of font: 1=smallest, 4=largest [2]\n" " -fontstyle # - used font:\n" " 0=helvetica, 1=+bold, 2=+italic, 3=bold/it\n" " 4=courier, 5=+bold, 6=+italic, 7=bold/it\n" " 8=times, 9=+bold,10=+italic,11=bold/it\n" " 12=charter, 13=+bold,14=+italic,\n" " 15=symbol [0]\n" " -gag text - don't show lines with text [none]\n" " -ignore file|file|... - do not add named files to the watchlist\n" " -interval # - scanning interval in sec, 1 to 30 [5]\n" " -newline 0|1 - print newline after stamp and name [0]\n" " -nlines # - nr of lines to store; 10 to 1000 [200]\n" " -printname 0|1 - print filenames [1]\n" " -printtime 0|1 - print timestamps [1]\n" " -printversion 0|1 - print version/copyright upon startup [1]\n" " -title name - use name for window title [XWatch]\n" " -geometry geom - display geometry [550x70+0+0]\n" " Obsolete options, replace with newer alternatives:\n" " -width, -height, -xpos, -ypos: replace by -geometry\n" " -bred, -bgreen, -bblue: replace by -bg\n" " -fred, -fgreen, -fblue: replace by -fg\n" " file(s): the files to monitor. You can specify an alternate color for\n" " a file using the syntax filename:colorname, in which the colorname\n" " overrules the default foreground color.\n" "\n" ); exit (1); } xwatch-2.11/src/xwatch.c100644 1750 1750 12236 6706653555 14256 0ustar rhogeerhogee/* <<< Start of information >>> */ /* This file is part of the xwatch package. */ /* Copyright (C) 1995 Karel Kubat. All rights reserved. */ /* */ /* 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. */ /* */ /* You may link this software with XForms (Copyright (C) by T.C. Zhao and */ /* Mark Overmars) and distribute the resulting binary, under the */ /* restrictions in clause 3 of the GPL, even though the resulting binary is */ /* not, as a whole, covered by the GPL. (You still need a separate license */ /* to do so from the owner(s) of the copyright for XForms, however). If a */ /* derivative no longer requires XForms, you may use the unsupplemented GPL */ /* as its license by deleting this paragraph and therefore removing this */ /* exemption for XForms. */ /* */ /* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* <<< End of information >>> */ #include "xwatch.h" /* global data section */ #undef EXTERN #define EXTERN #include "data.inc" /* main function */ void main(int argc, char *argv[]) { int i; static int border, /* flag: use border? */ xpos, ypos, /* startup screen coords */ height, /* initial height */ printversion; /* flag: print version/copyright? */ static char *copyrightmsg [] = /* our copyright msg */ { "XWatch V" VER "\n", "Copyright (C) 1995, 1996 Karel Kubat .\n", "See /usr/doc/xwatch/README.debian\n", }, titlebuffer [128], /* window title */ gagbuffer [1024], /* things to gag */ colorstring [1024], /* messages to color */ ignorestring [1024], /* files to be ignored */ geometry [80], /* geometry string */ fgstring [80], bgstring [80]; /* foreground/background strings */ #include "flres.h" #include "settings.h" /* count total cmdline length.. X barfs on too long cmdlines (!) */ #ifdef MAXCMDLINE register int totlength = 0; for (i = 0; i < argc; i++) totlength += strlen (argv [i]) + 1; if (totlength > MAXCMDLINE) error ("too many strings on the commandline"); #endif /* parse in options */ fl_initialize (&argc, argv, "XWatch", cmdopt, sizeof (cmdopt) / sizeof (FL_CMD_OPT)); fl_get_app_resources (res, sizeof (res) / sizeof (FL_resource)); /* check the settings */ for (i = 0; i < sizeof (setting) / sizeof (Setting); i++) checksetting (*setting [i].var, setting [i].min, setting [i].max, setting [i].desc); /* show usage if no args */ if (argc < 2) usage (); /* parse gag strings and color strings */ parsegag (gagbuffer); parsecolorstring (colorstring); parsegeometry (geometry, &xpos, &ypos, &width, &height); parsecolors (fgstring, bgstring); argc = parseignore(ignorestring, argc, argv); /* now create and initialize the forms */ create_the_forms (); /* fontsize is now 1..4, remap to 8/10/12/14 */ fontsize <<= 1; fontsize += 6; fl_set_browser_fontsize (watch_browser, fontsize); fl_set_browser_fontstyle (watch_browser, fontstyle); fl_set_object_color (watch_browser, backgr, foregr); fl_set_object_lcol (watch_browser, foregr); /* show browser form */ fl_set_form_geometry (browser_form, xpos, ypos, width, height); fl_set_form_position (browser_form, xpos, ypos); fl_show_form (browser_form, FL_PLACE_GEOMETRY, border ? FL_FULLBORDER : FL_NOBORDER, *titlebuffer ? titlebuffer : "XWatch"); /* add our own message */ if (printversion) for (i = 0; i < sizeof (copyrightmsg) / sizeof (char *); i++) warning (copyrightmsg [i]); /* add all files */ for (i = 1; i < argc; i++) addfile (argv [i]); /* forms action loop , interrupted each `interval' secs */ signal (SIGALRM, alarmhandler); alarm (interval); /* here goes.. */ fl_do_forms(); /* never reached, exit is from `quit' button */ } xwatch-2.11/src/warning.c100644 1750 1750 4460 6170145110 14357 0ustar rhogeerhogee/* <<< Start of information >>> */ /* This file is part of the xwatch package. */ /* Copyright (C) 1995 Karel Kubat. All rights reserved. */ /* */ /* 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. */ /* */ /* You may link this software with XForms (Copyright (C) by T.C. Zhao and */ /* Mark Overmars) and distribute the resulting binary, under the */ /* restrictions in clause 3 of the GPL, even though the resulting binary is */ /* not, as a whole, covered by the GPL. (You still need a separate license */ /* to do so from the owner(s) of the copyright for XForms, however). If a */ /* derivative no longer requires XForms, you may use the unsupplemented GPL */ /* as its license by deleting this paragraph and therefore removing this */ /* exemption for XForms. */ /* */ /* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* <<< End of information >>> */ #include "xwatch.h" void warning (char *fmt, ...) { char buf [1000]; va_list args; va_start (args, fmt); vsprintf (buf, fmt, args); /* buf is now the msg */ addline (buf, foregr); } xwatch-2.11/src/flres.h100644 1750 1750 11140 6170407462 14056 0ustar rhogeerhogee/* <<< Start of information >>> */ /* This file is part of the xwatch package. */ /* Copyright (C) 1995 Karel Kubat. All rights reserved. */ /* */ /* 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. */ /* */ /* You may link this software with XForms (Copyright (C) by T.C. Zhao and */ /* Mark Overmars) and distribute the resulting binary, under the */ /* restrictions in clause 3 of the GPL, even though the resulting binary is */ /* not, as a whole, covered by the GPL. (You still need a separate license */ /* to do so from the owner(s) of the copyright for XForms, however). If a */ /* derivative no longer requires XForms, you may use the unsupplemented GPL */ /* as its license by deleting this paragraph and therefore removing this */ /* exemption for XForms. */ /* */ /* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* <<< End of information >>> */ static FL_CMD_OPT cmdopt [] = /* resource options */ { { "-border", "*.border", XrmoptionSepArg, 0 }, { "-printtime", "*.printtime", XrmoptionSepArg, 0 }, { "-printname", "*.filename", XrmoptionSepArg, 0 }, { "-newline", "*.newline", XrmoptionSepArg, 0 }, { "-nlines", "*.nlines", XrmoptionSepArg, 0 }, { "-interval", "*.interval", XrmoptionSepArg, 0 }, { "-linelen", "*.linelen", XrmoptionSepArg, 0 }, { "-fontsize", "*.fontsize", XrmoptionSepArg, 0 }, { "-fontstyle", "*.fontstyle", XrmoptionSepArg, 0 }, { "-firstwarnings", "*.firstwarnings", XrmoptionSepArg, 0 }, { "-printversion", "*.printversion", XrmoptionSepArg, 0 }, { "-gag", "*.gag", XrmoptionSepArg, 0 }, { "-title", "*.title", XrmoptionSepArg, 0 }, { "-colorstring", "*.colorstring", XrmoptionSepArg, 0 }, { "-geometry", "*.geometry", XrmoptionSepArg, 0 }, { "-ignore", "*.ignore", XrmoptionSepArg, 0 }, { "-fg", "*.foreground", XrmoptionSepArg, 0 }, { "-bg", "*.background", XrmoptionSepArg, 0 }, }; static FL_resource res [] = { { "border", "XWatch", FL_INT, &border, "1", 0 }, { "printtime", "XWatch", FL_INT, &printtime, "1", 0 }, { "printname", "XWatch", FL_INT, &printname, "1", 0 }, { "newline", "XWatch", FL_INT, &newline, "0", 0 }, { "nlines", "XWatch", FL_INT, &nlines, "200", 0 }, { "interval", "XWatch", FL_INT, &interval, "5", 0 }, { "fontsize", "XWatch", FL_INT, &fontsize, "2", 0 }, { "fontstyle", "XWatch", FL_INT, &fontstyle, "0", 0 }, { "firstwarnings", "XWatch", FL_INT, &firstwarnings, "1", 0 }, { "printversion", "XWatch", FL_INT, &printversion, "1", 0 }, { "gag", "XWatch", FL_STRING, gagbuffer, "", 1023 }, { "title", "XWatch", FL_STRING, titlebuffer, "", 127 }, { "colorstring", "XWatch", FL_STRING, colorstring, "", 1023 }, { "geometry", "XWatch", FL_STRING, geometry, "550x70+0+0", 79 }, { "ignore", "XWatch", FL_STRING, ignorestring, "", 1023 }, { "foreground", "XWatch", FL_STRING, fgstring, "black", 79 }, { "background", "XWatch", FL_STRING, bgstring, "white", 79 }, }; xwatch-2.11/src/settings.h100644 1750 1750 5041 6170411025 14554 0ustar rhogeerhogee/* <<< Start of information >>> */ /* This file is part of the xwatch package. */ /* Copyright (C) 1995 Karel Kubat. All rights reserved. */ /* */ /* 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. */ /* */ /* You may link this software with XForms (Copyright (C) by T.C. Zhao and */ /* Mark Overmars) and distribute the resulting binary, under the */ /* restrictions in clause 3 of the GPL, even though the resulting binary is */ /* not, as a whole, covered by the GPL. (You still need a separate license */ /* to do so from the owner(s) of the copyright for XForms, however). If a */ /* derivative no longer requires XForms, you may use the unsupplemented GPL */ /* as its license by deleting this paragraph and therefore removing this */ /* exemption for XForms. */ /* */ /* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* <<< End of information >>> */ static Setting setting [] = { { &border, 0, 1, "border" }, { &printtime, 0, 1, "printtime" }, { &printname, 0, 1, "printname" }, { &newline, 0, 1, "newline" }, { &nlines, 10,1000, "nlines" }, { &interval, 1, 30, "interval" }, { &fontsize, 1, 4, "fontsize" }, { &fontstyle, 0, 15, "fontstyle" }, { &firstwarnings, 0, 1, "firstwarnings" }, { &printversion, 0, 1, "printversion" }, }; xwatch-2.11/src/xwatch.h100644 1750 1750 11250 6706422643 14246 0ustar rhogeerhogee/* <<< Start of information >>> */ /* This file is part of the xwatch package. */ /* Copyright (C) 1995 Karel Kubat. All rights reserved. */ /* */ /* 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. */ /* */ /* You may link this software with XForms (Copyright (C) by T.C. Zhao and */ /* Mark Overmars) and distribute the resulting binary, under the */ /* restrictions in clause 3 of the GPL, even though the resulting binary is */ /* not, as a whole, covered by the GPL. (You still need a separate license */ /* to do so from the owner(s) of the copyright for XForms, however). If a */ /* derivative no longer requires XForms, you may use the unsupplemented GPL */ /* as its license by deleting this paragraph and therefore removing this */ /* exemption for XForms. */ /* */ /* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* <<< End of information >>> */ /* Header for xwatch */ #include #include #include #include #include #include #include #include #include #include #include #include "ui.h" typedef struct /* scanned files: */ { char *name; /* name of file */ int inode; /* inode, for same file check */ int active; /* are we scanning it? */ int offset; /* offset at which we started */ int colorindex; /* color index for the file */ } Fileinfo; typedef struct /* allowed values */ { int *var; /* the variable */ int min, max; /* min/max value */ char *desc; /* descriptive string */ } Setting; typedef struct /* colorstring info */ { char *str; /* the color name */ int colorindex; /* and its index */ } Colorstring; #undef EXTERN #define EXTERN extern #include "data.inc" extern void addfile (char *fname); extern void addline (char *line, int colindex); extern void alarmhandler (int sig); extern void checksetting (int var, int min, int max, char *desc); extern void error (char *fmt, ...); extern int getcolorindex (int r, int g, int b); extern void init_forms (int *argcp, char **argv); extern void init_xwatch (void); extern void interval_slider_callback (FL_OBJECT *, long); extern void linelen_slider_callback (FL_OBJECT *, long); extern void lines_slider_callback (FL_OBJECT *, long); extern void medium_font_button_callback (FL_OBJECT *, long); extern void normal_font_button_callback (FL_OBJECT *, long); extern void options_button_callback (FL_OBJECT *, long); extern void ok_button_callback (FL_OBJECT *, long); extern void parsegag (char *buf); extern void parsegeometry (char *str, int *xp, int *yp, int *wp, int *hp); extern int colorname2index (char *col); extern int colorname2rgb(char *col, int *r, int *g, int *b); extern void parsecolors (char *fg, char *bg); extern void parsecolorstring (char *buf); extern int parseignore (char *buf, int argc, char **argv); extern void quit_button_callback (FL_OBJECT *, long); extern void rescan_button_callback (FL_OBJECT *, long); extern void rescan_files (void); extern void scanfile (int index, int dumpinfo); extern void small_font_button_callback (FL_OBJECT *, long); extern void tiny_font_button_callback (FL_OBJECT *, long); extern void usage (void); extern void warning (char *fmt, ...); extern void *xmalloc (int sz); extern void *xrealloc (void *mem, int newsz); extern char *xstrdup (char *str); xwatch-2.11/src/.makedist100755 1750 1750 3452 6730212575 14367 0ustar rhogeerhogee#!/bin/sh if [ "$1" = "" ] ; then echo 'Usage: .makedist bin-directory version' echo 'You should really run this script from "make dist".' exit 1 fi echo "Making xwatch distribution.. Current version: $2" # echo 'Copying binary..' # cp -p $1/xwatch ../bin-linux/xwatch # # echo 'Copying syslogd.conf example..' # cp -p /etc/syslog.conf ../syslog.conf.SAMPLE # # echo 'Copying app-defaults file..' # cp -p /usr/lib/X11/app-defaults/XWatch ../XWatch.ap echo 'Making xwatch.ANNOUNCEMENT and xwatch.lsm..' cd .. for name in ANNOUNCEMENT lsm README ; do template=.xwatch.$name dest=xwatch.$name if [ ! -f $template ] ; then echo 'Cannot find template' $template exit 1 fi echo "($template -> $dest)" sed "s/_VER_/$2/g" < $template > $dest done cd src echo 'Making docs..' cd ../doc gawk '{ if (active) print; else if ($1 == "STARTINSTALL") active = 1; }' xwatch.yo > xinst.yo yodl2txt -DINSTALL xinst || exit 1 mv xinst.txt ../INSTALL rm xinst.yo (yodl2html xwatch && yodl2latex xwatch && mv xwatch.latex xwatch.tex && yodl2txt xwatch && yodl2man xwatch && patch < xwatch.man.patch) || exit 1 cd ../src # echo 'Making archive..' # cd ../.. # tar cvzf xwatch-$2.tar.gz xwatch # # if [ `hostname` = bambix ] ; then # echo 'Uploading archive to ftp site..' # ftp ftp << ENDFTP # cd /home/ftp/pub/karel/tounix # put xwatch-$2.tar.gz # put xwatch/xwatch.README xwatch.README # put xwatch/xwatch.lsm xwatch.lsm # quit # ENDFTP # echo 'Uploading WWW docs..' # cd xwatch/doc # ftp www << ENDWWW # cd docs/programs/xwatch # prompt off # mput xwatch*.html # quit # ENDWWW # else # echo 'NOT UPLOADED TO FTP/WWW SITE: NOT AT BAMBIX!' # fi xwatch-2.11/src/getcolorindex.c100644 1750 1750 5300 6154571144 15566 0ustar rhogeerhogee/* <<< Start of information >>> */ /* This file is part of the xwatch package. */ /* Copyright (C) 1995 Karel Kubat. All rights reserved. */ /* */ /* 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. */ /* */ /* You may link this software with XForms (Copyright (C) by T.C. Zhao and */ /* Mark Overmars) and distribute the resulting binary, under the */ /* restrictions in clause 3 of the GPL, even though the resulting binary is */ /* not, as a whole, covered by the GPL. (You still need a separate license */ /* to do so from the owner(s) of the copyright for XForms, however). If a */ /* derivative no longer requires XForms, you may use the unsupplemented GPL */ /* as its license by deleting this paragraph and therefore removing this */ /* exemption for XForms. */ /* */ /* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* <<< End of information >>> */ #include "xwatch.h" int getcolorindex (int red, int green, int blue) { register int i; int r, g, b; static int lastdefined = FL_FREE_COL1 - 1; /* see if color table already has the r/g/b */ for (i = 0; i <= lastdefined; i++) { fl_getmcolor (i, &r, &g, &b); if (red == r && g == green && b == blue) return (i); } /* now reassign it */ lastdefined++; if (lastdefined > FL_FREE_COL16) { warning ("Failure to create color %d/%d/%d", red, green, blue); return (FL_BLACK); } fl_mapcolor (lastdefined, red, green, blue); return (lastdefined); } xwatch-2.11/src/strerror.c100644 1750 1750 5211 6157735602 14607 0ustar rhogeerhogee/* <<< Start of information >>> */ /* This file is part of the xwatch package. */ /* Copyright (C) 1995 Karel Kubat. All rights reserved. */ /* */ /* 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. */ /* */ /* You may link this software with XForms (Copyright (C) by T.C. Zhao and */ /* Mark Overmars) and distribute the resulting binary, under the */ /* restrictions in clause 3 of the GPL, even though the resulting binary is */ /* not, as a whole, covered by the GPL. (You still need a separate license */ /* to do so from the owner(s) of the copyright for XForms, however). If a */ /* derivative no longer requires XForms, you may use the unsupplemented GPL */ /* as its license by deleting this paragraph and therefore removing this */ /* exemption for XForms. */ /* */ /* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* <<< End of information >>> */ /* ** File - strerror.c ** Description - strerror() replacement for Suns ** History - 05/10/95 Quick hack ** Copyright - (c) Arrigo Triulzi, 1995 */ /* ** RCS Info */ static char *rcsid="$Id$"; /* ** Include files */ #include #include /* ** Globals */ extern char *sys_errlist[]; /* ** Code */ char *strerror(int err) { return(sys_errlist[err]); } /* ** Function - char *strerror(int err) ** Description - Returns descriptive string for given err ** Expects - err error code from errno.h ** Returns - string from sys_errlist[] */ xwatch-2.11/src/.header100644 1750 1750 2410 6730207764 14010 0ustar rhogeerhogeeThis file is part of the xwatch package. Copyright (C) 1995 Karel Kubat. All rights reserved. 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. You may link this software with XForms (Copyright (C) by T.C. Zhao and Mark Overmars) and distribute the resulting binary, under the restrictions in clause 3 of the GPL, even though the resulting binary is not, as a whole, covered by the GPL. (You still need a separate license to do so from the owner(s) of the copyright for XForms, however). If a derivative no longer requires XForms, you may use the unsupplemented GPL as its license by deleting this paragraph and therefore removing this exemption for XForms. 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA xwatch-2.11/src/ui.fd100644 1750 1750 1575 6155762363 13524 0ustar rhogeerhogeeMagic: 13000 Internal Form Definition File (do not change) Number of forms: 1 Unit of measure: FL_COORD_PIXEL =============== FORM =============== Name: browser_form Width: 550 Height: 70 Number of Objects: 2 -------------------- class: FL_BOX type: UP_BOX box: 0 0 550 70 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BROWSER type: NORMAL_BROWSER box: 0 0 550 70 boxtype: FL_DOWN_BOX colors: FL_WHITE FL_YELLOW alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_RED label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: watch_browser callback: argument: ============================== create_the_forms xwatch-2.11/src/data.inc100644 1750 1750 2062 6170407462 14161 0ustar rhogeerhogee EXTERN Fileinfo *finfo; /* info on all watched files */ EXTERN int nfinfo, /* # of info's */ nlines, /* max lines to store */ interval, /* scanning interval */ printtime, /* flag: print timestamp? */ printname, /* flag: print name? */ newline, /* flag: print newline after time/name? */ firstwarnings, /* print initial warnings? */ foregr, backgr, /* background/foreground indices */ width, /* window width */ fontstyle, fontsize; /* used font */ EXTERN char **gagstring, /* strings to gag */ ignorestring[]; /* files to ignore */ EXTERN int ngagstring; /* # of strings to gag */ EXTERN Colorstring *colorstring; /* colorstring info */ EXTERN int ncolorstring; /* # of colorinfo structs */ xwatch-2.11/src/xmalloc.c100644 1750 1750 4366 6160235070 14362 0ustar rhogeerhogee/* <<< Start of information >>> */ /* This file is part of the xwatch package. */ /* Copyright (C) 1995 Karel Kubat. All rights reserved. */ /* */ /* 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. */ /* */ /* You may link this software with XForms (Copyright (C) by T.C. Zhao and */ /* Mark Overmars) and distribute the resulting binary, under the */ /* restrictions in clause 3 of the GPL, even though the resulting binary is */ /* not, as a whole, covered by the GPL. (You still need a separate license */ /* to do so from the owner(s) of the copyright for XForms, however). If a */ /* derivative no longer requires XForms, you may use the unsupplemented GPL */ /* as its license by deleting this paragraph and therefore removing this */ /* exemption for XForms. */ /* */ /* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* <<< End of information >>> */ #include "xwatch.h" void *xmalloc (int sz) { void *ret; if (! (ret = malloc (sz)) ) error ("out of memory"); return (ret); } xwatch-2.11/src/xrealloc.c100644 1750 1750 5101 6162206453 14525 0ustar rhogeerhogee/* <<< Start of information >>> */ /* This file is part of the xwatch package. */ /* Copyright (C) 1995 Karel Kubat. All rights reserved. */ /* */ /* 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. */ /* */ /* You may link this software with XForms (Copyright (C) by T.C. Zhao and */ /* Mark Overmars) and distribute the resulting binary, under the */ /* restrictions in clause 3 of the GPL, even though the resulting binary is */ /* not, as a whole, covered by the GPL. (You still need a separate license */ /* to do so from the owner(s) of the copyright for XForms, however). If a */ /* derivative no longer requires XForms, you may use the unsupplemented GPL */ /* as its license by deleting this paragraph and therefore removing this */ /* exemption for XForms. */ /* */ /* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* <<< End of information >>> */ #include "xwatch.h" void *xrealloc (void *mem, int newsz) { if (! mem) /* SUN's realloc() doesn't handle */ mem = malloc (newsz); /* a 0-pointer too well as first */ else /* argument.. thanx, */ mem = realloc (mem, newsz); /* Christian Motschke, */ /* */ if (! mem) error ("out of memory"); return (mem); } xwatch-2.11/src/parsegag.c100644 1750 1750 5351 6160235536 14516 0ustar rhogeerhogee/* <<< Start of information >>> */ /* This file is part of the xwatch package. */ /* Copyright (C) 1995 Karel Kubat. All rights reserved. */ /* */ /* 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. */ /* */ /* You may link this software with XForms (Copyright (C) by T.C. Zhao and */ /* Mark Overmars) and distribute the resulting binary, under the */ /* restrictions in clause 3 of the GPL, even though the resulting binary is */ /* not, as a whole, covered by the GPL. (You still need a separate license */ /* to do so from the owner(s) of the copyright for XForms, however). If a */ /* derivative no longer requires XForms, you may use the unsupplemented GPL */ /* as its license by deleting this paragraph and therefore removing this */ /* exemption for XForms. */ /* */ /* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* <<< End of information >>> */ #include "xwatch.h" void parsegag (char *buf) { char *cp, str [256]; if (! *buf) return; cp = strtok (buf, "|"); while (cp && *cp) { strncpy (str, cp, 255); while (isspace (str [0])) strcpy (str, str + 1); cp = str + strlen (str) - 1; while (isspace (*cp) && cp > str) { *cp = '\0'; cp--; } if (str [0]) { gagstring = xrealloc (gagstring, (ngagstring + 1) * sizeof (char*)); gagstring [ngagstring++] = xstrdup (str); } cp = strtok (NULL, "|"); } } xwatch-2.11/src/xstrdup.c100644 1750 1750 4335 6160235130 14425 0ustar rhogeerhogee/* <<< Start of information >>> */ /* This file is part of the xwatch package. */ /* Copyright (C) 1995 Karel Kubat. All rights reserved. */ /* */ /* 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. */ /* */ /* You may link this software with XForms (Copyright (C) by T.C. Zhao and */ /* Mark Overmars) and distribute the resulting binary, under the */ /* restrictions in clause 3 of the GPL, even though the resulting binary is */ /* not, as a whole, covered by the GPL. (You still need a separate license */ /* to do so from the owner(s) of the copyright for XForms, however). If a */ /* derivative no longer requires XForms, you may use the unsupplemented GPL */ /* as its license by deleting this paragraph and therefore removing this */ /* exemption for XForms. */ /* */ /* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* <<< End of information >>> */ #include "xwatch.h" char *xstrdup (char *str) { if (! (str = strdup (str)) ) error ("out of memory"); return (str); } xwatch-2.11/src/parsecolorstring.c100644 1750 1750 6246 6170413044 16322 0ustar rhogeerhogee/* <<< Start of information >>> */ /* This file is part of the xwatch package. */ /* Copyright (C) 1995 Karel Kubat. All rights reserved. */ /* */ /* 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. */ /* */ /* You may link this software with XForms (Copyright (C) by T.C. Zhao and */ /* Mark Overmars) and distribute the resulting binary, under the */ /* restrictions in clause 3 of the GPL, even though the resulting binary is */ /* not, as a whole, covered by the GPL. (You still need a separate license */ /* to do so from the owner(s) of the copyright for XForms, however). If a */ /* derivative no longer requires XForms, you may use the unsupplemented GPL */ /* as its license by deleting this paragraph and therefore removing this */ /* exemption for XForms. */ /* */ /* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* <<< End of information >>> */ #include "xwatch.h" void parsecolorstring (char *buf) { char *cp, str [256], matchstr [256], colorname [256]; int r, g, b; if (! *buf) return; cp = strtok (buf, "|"); while (cp && *cp) { strncpy (str, cp, 255); while (isspace (str [0])) strcpy (str, str + 1); cp = str + strlen (str) - 1; while (isspace (*cp) && cp > str) { *cp = '\0'; cp--; } if (str [0]) { if (sscanf (str,"%[^:]:%s", colorname, matchstr) > 1 && colorname2rgb (colorname, &r, &g, &b)) { colorstring = xrealloc (colorstring, (ncolorstring + 1) * sizeof (Colorstring)); colorstring [ncolorstring].colorindex = getcolorindex (r, g, b); colorstring [ncolorstring].str = xstrdup (matchstr); ncolorstring++; } } cp = strtok (NULL, "|"); } } xwatch-2.11/src/parseignore.c100644 1750 1750 5227 6164463740 15251 0ustar rhogeerhogee/* <<< Start of information >>> */ /* This file is part of the xwatch package. */ /* Copyright (C) 1995 Karel Kubat. All rights reserved. */ /* */ /* 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. */ /* */ /* You may link this software with XForms (Copyright (C) by T.C. Zhao and */ /* Mark Overmars) and distribute the resulting binary, under the */ /* restrictions in clause 3 of the GPL, even though the resulting binary is */ /* not, as a whole, covered by the GPL. (You still need a separate license */ /* to do so from the owner(s) of the copyright for XForms, however). If a */ /* derivative no longer requires XForms, you may use the unsupplemented GPL */ /* as its license by deleting this paragraph and therefore removing this */ /* exemption for XForms. */ /* */ /* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* <<< End of information >>> */ #include "xwatch.h" int parseignore (char *buf, int argc, char **argv) { char *cp; if (! *buf) return (argc); cp = strtok (buf, "|"); while (cp && *cp) { int idx; for (idx = 1; idx < argc; idx++) { if (!strcmp(cp, argv[idx])) { argc--; memmove(argv + idx, argv + idx + 1, (argc - idx) * sizeof(char *)); break; } } cp = strtok(NULL, "|"); } return (argc); } xwatch-2.11/src/colorname2rgb.c100644 1750 1750 6763 6170410572 15465 0ustar rhogeerhogee/* <<< Start of information >>> */ /* This file is part of the xwatch package. */ /* Copyright (C) 1995 Karel Kubat. All rights reserved. */ /* */ /* 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. */ /* */ /* You may link this software with XForms (Copyright (C) by T.C. Zhao and */ /* Mark Overmars) and distribute the resulting binary, under the */ /* restrictions in clause 3 of the GPL, even though the resulting binary is */ /* not, as a whole, covered by the GPL. (You still need a separate license */ /* to do so from the owner(s) of the copyright for XForms, however). If a */ /* derivative no longer requires XForms, you may use the unsupplemented GPL */ /* as its license by deleting this paragraph and therefore removing this */ /* exemption for XForms. */ /* */ /* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* <<< End of information >>> */ #include "xwatch.h" #ifndef RGB_FILE #define RGB_FILE "/usr/lib/X11/rgb.txt" #endif int colorname2rgb (char *name, int *r, int *g, int *b) { FILE *fp = NULL; char dummy[256], line [256]; int red, green, blue, retval = 0; if (! name || ! *name) /* need a real name arg */ return (0); if (! (fp = fopen(RGB_FILE, "r")) ) /* open database file */ { warning ("Cannot read RGB database %s", RGB_FILE); warning ("(%s)", strerror (errno)); return (0); } while (1) /* scan whole file */ { fgets (line, 256, fp); /* read one line */ if (feof (fp)) /* eof? done.. */ { warning ("Couldn't find color %s in RGB database %s", name, RGB_FILE); break; } /* convert to number number number name */ if (sscanf (line, "%d %d %d %[^\n]", &red, &green, &blue, dummy) > 3) { while (isspace (dummy[0])) strcpy (dummy, dummy + 1); if (! strcasecmp (dummy, name)) { *r = red; *g = green; *b = blue; retval = 1; break; } } } fclose (fp); return (retval); } xwatch-2.11/src/parsecolors.c100644 1750 1750 4762 6170410737 15265 0ustar rhogeerhogee/* <<< Start of information >>> */ /* This file is part of the xwatch package. */ /* Copyright (C) 1995 Karel Kubat. All rights reserved. */ /* */ /* 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. */ /* */ /* You may link this software with XForms (Copyright (C) by T.C. Zhao and */ /* Mark Overmars) and distribute the resulting binary, under the */ /* restrictions in clause 3 of the GPL, even though the resulting binary is */ /* not, as a whole, covered by the GPL. (You still need a separate license */ /* to do so from the owner(s) of the copyright for XForms, however). If a */ /* derivative no longer requires XForms, you may use the unsupplemented GPL */ /* as its license by deleting this paragraph and therefore removing this */ /* exemption for XForms. */ /* */ /* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* <<< End of information >>> */ #include "xwatch.h" void parsecolors (char *fgstring, char *bgstring) { int r, g, b; if (fgstring && *fgstring && colorname2rgb (fgstring, &r, &g, &b)) foregr = getcolorindex (r, g, b); else foregr = FL_BLACK; if (bgstring && *bgstring && colorname2rgb (bgstring, &r, &g, &b)) backgr = getcolorindex (r, g, b); else backgr = FL_WHITE; } xwatch-2.11/src/colorname2index.c100644 1750 1750 4450 6170411317 16007 0ustar rhogeerhogee/* <<< Start of information >>> */ /* This file is part of the xwatch package. */ /* Copyright (C) 1995 Karel Kubat. All rights reserved. */ /* */ /* 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. */ /* */ /* You may link this software with XForms (Copyright (C) by T.C. Zhao and */ /* Mark Overmars) and distribute the resulting binary, under the */ /* restrictions in clause 3 of the GPL, even though the resulting binary is */ /* not, as a whole, covered by the GPL. (You still need a separate license */ /* to do so from the owner(s) of the copyright for XForms, however). If a */ /* derivative no longer requires XForms, you may use the unsupplemented GPL */ /* as its license by deleting this paragraph and therefore removing this */ /* exemption for XForms. */ /* */ /* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* <<< End of information >>> */ #include "xwatch.h" int colorname2index (char *col) { int r, g, b; if (colorname2rgb (col, &r, &g, &b)) return (getcolorindex (r, g, b)); return (FL_BLACK); } xwatch-2.11/src/addline.c.orig100644 1750 1750 5210 6160216417 15253 0ustar rhogeerhogee/* <<< Start of information >>> */ /* ------------------------------------------------------------------ */ /* This file is part of the xwatch program. Copyright (C) ICCE / */ /* Karel Kubat 1995. All rights reserved. You are permitted to */ /* redistribute this package, if you include all unmodified sources */ /* and all unmodified documentation (including this text). You are */ /* NOT permitted to distribute files of this package with */ /* modifications. See the file COPYING for more information. When in */ /* doubt, mail me at karel@icce.rug.nl. */ /* XWatch is maintained by Frank Brokken, frank@icce.rug.nl. If you */ /* have remarks about bugs or features, please mail Frank. */ /* ------------------------------------------------------------------ */ /* <<< End of information >>> */ #include "xwatch.h" void addline (char *buf, int colindex) { char outbuf [1000]; int i, length_so_far, extra_length, curwidth, curheight, curx, cury; char *bufcopy, *cp; /* clear trailing \n chars */ if ( (cp = strchr (buf, '\n')) && cp > buf ) *cp = '\0'; if (! *buf) return; /* see if the contents of the line is `gagged' */ for (i = 0; i < ngagstring; i++) if (strstr (buf, gagstring [i])) return; /* determine width to use */ fl_get_browser_dimension (watch_browser, &curx, &cury, &curwidth, &curheight); curwidth -= 5; /* reset outbuffer */ outbuf [0] = '\0'; /* process whole buf, cut it up if necessary */ bufcopy = xstrdup (buf); cp = strtok (bufcopy, " \t"); while (cp) { /* add color code if necessary */ if (! outbuf [0]) { if (colindex != foregr) sprintf (outbuf, "@C%d ", colindex); else strcpy (outbuf, " "); } /* determine length of string so far, flush if necessary */ length_so_far = fl_get_string_width (fontstyle, fontsize, outbuf, strlen (outbuf)); extra_length = fl_get_string_width (fontstyle, fontsize, cp, strlen (cp)); if (length_so_far + extra_length > curwidth) { fl_addto_browser (watch_browser, outbuf); outbuf [0] = '\0'; } else { strcat (outbuf, " "); strcat (outbuf, cp); cp = strtok (NULL, " \t"); } } /* flush whatever's left */ if (cp) strcat (outbuf, cp); if (outbuf [0]) fl_addto_browser (watch_browser, outbuf); /* release memory */ free (bufcopy); } xwatch-2.11/src/.makedist.orig100755 1750 1750 3170 6171413713 15317 0ustar rhogeerhogee#!/bin/sh if [ "$1" = "" ] ; then echo 'Usage: .makedist bin-directory version' echo 'You should really run this script from "make dist".' exit 1 fi echo "Making xwatch distribution.. Current version: $2" echo 'Copying binary..' cp -p $1/xwatch ../bin-linux/xwatch echo 'Copying syslogd.conf example..' cp -p /etc/syslog.conf ../syslog.conf.SAMPLE echo 'Copying app-defaults file..' cp -p /usr/lib/X11/app-defaults/XWatch ../XWatch.ap echo 'Making xwatch.ANNOUNCEMENT and xwatch.lsm..' cd .. for name in ANNOUNCEMENT lsm README ; do template=.xwatch.$name dest=xwatch.$name if [ ! -f $template ] ; then echo 'Cannot find template' $template exit 1 fi echo "($template -> $dest)" sed "s/_VER_/$2/g" < $template > $dest done cd src echo 'Making docs..' cd ../doc gawk '{ if (active) print; else if ($1 == "STARTINSTALL") active = 1; }' xwatch.yo > xinst.yo yodl2txt -DINSTALL xinst || exit 1 mv xinst.txt ../INSTALL rm xinst.yo (yodl2html xwatch && yodl2tex xwatch && yodl2txt xwatch) || exit 1 cd ../src echo 'Making archive..' cd ../.. tar cvzf xwatch-$2.tar.gz xwatch if [ `hostname` = bambix ] ; then echo 'Uploading archive to ftp site..' ftp ftp << ENDFTP cd /home/ftp/pub/karel/tounix put xwatch-$2.tar.gz put xwatch/xwatch.README xwatch.README put xwatch/xwatch.lsm xwatch.lsm quit ENDFTP echo 'Uploading WWW docs..' cd xwatch/doc ftp www << ENDWWW cd docs/programs/xwatch prompt off mput xwatch*.html quit ENDWWW else echo 'NOT UPLOADED TO FTP/WWW SITE: NOT AT BAMBIX!' fi xwatch-2.11/syslog.conf.SAMPLE100640 1750 1750 4661 6201337624 15135 0ustar rhogeerhogee# bambix:/conf/net/syslog.conf (/etc/syslog.conf) pwp 96 08 05 # # NOTE: # - columns must be separated by at least one TAB # - maximum of 20 active lines in this file # (otherwise syslogd will die with a segmentation fault)! # # See the tail of this file for syntax instructions. # Kernel: info and higher to /var/log/kernel # warning and higher written to all logged-in users kern.info /var/log/kernel kern.warning /var/log/critical # Authentification: info and higher to /var/log/auth auth.info /var/log/auth # Printing: err and higher to /var/log/lpr lpr.err /var/log/lpr # Sendmail: info, notice and warning to /var/log/sendmail mail.=info;mail.=notice;mail.=warning /var/log/sendmail # Name daemon: debug (yuck!), info, notice and warning to /var/log/daemon.log daemon.=debug;daemon.=info;daemon.=notice;daemon.=warning /var/log/daemon.log # Catch-all for criticals, except for the kern, auth and lpr services mail.err;daemon.err;news.err;user.crit;cron.crit /var/log/critical ############################################################################ # Information about the format of the syslog file. ############################################################################ # For info about the format of this file, see "man syslog.conf" # and /usr/doc/sysklogd/README.linux. # Lines have the format # selector s action # selector is # facility.level [ ; facility.level ] # # Facility is one of: # user, kern, mail, daemon, auth, lpr, news, uucp, cron, # mark (timestamp), local0-local7 (user-defined), * (all except mark) # # Level is (lowest to higest priority): # none, debug, info, notice, warning, err, crit, alert, emerg # Priority none is no logging. # Selecting a level (e.g. auth.info) means log that level (info) and all # higher levels (notice ... emerg) for the given facility (auth). # Level can also be preceeded by an =. This means: log only that level. # For example: auth.=notice logs only the notice level for auth. # A level of * is equivalent of debug. # # Action is: # - a file or device (should start with leading slash): # information is appended to file, or written to the device # - a comma separated list of usernames or a *: # information is written (using the write program) to # the specified users resp. all (when the * is specified). # - an @ followed by a hostname: send to host's syslog ############################################################################# xwatch-2.11/xwatch.ANNOUNCEMENT100644 1750 1750 5007 6730212625 15077 0ustar rhogeerhogeeHi all, [ This mail goes to several persons: the sysops of tsx-11.mit.edu and of sunsite.unc.edu, to the LSM maintainers, and to the moderators of c.o.l.announce. So it's a bit unpersonal.. ] I recently uploaded xwatch-2.11.tar.gz to sunsite and tsx-11, a new version of my watchdog program for logfiles under X. What the program does, is that it just sits there and lets you see what new texts arrive on your logfiles. The advantage of xwatch over, say an rxvt window with a "tail -f" running in it, is: - XWatch lets you define colors for the different shown files. E.g., you might want to let /var/log/auth messages (about wrong passwords etc.) be shown in red. Also, XWatch lets you define colors by message content, so you might have all lines with "error" in them in bright red, if you chose so. - XWatch won't display binary files, so even if you start it as "xwatch /var/adm/*" it won't try to dump the file "utmp" (if you have one there). - XWatch can suppress the display of some messages, when you want that. E.g., "Too much work at interrupt" is a message that I have suppressed, it just tells me that the NFS is somewhat crowded and that doesn't further interest me. - XWatch has lots of parameters that can be configured via an application defaults file that are specific for a watcher. E.g., i have "*border: 0" in my file, which starts XWatch without a border. That's handy under fvwm; because, fvwm doesn't even know that XWatch is there. The XWatch window just becomes part of the root window. What's new: - Bugfix. I must've been braindead when releasing 2.08. What was previously new: - I fixed an error message about the RGB database file, the old message was not too helpful (to say the least). - All colors are now specified by a name, instead of the old R/G/B method. - XWatch now should also run on Sun's. Sun's realloc() function doesn't handle a 0-pointer as first argument, so on Sun's, the program used to coredump. Should be fixed now. - The resources and commandline flags now have -geometry, -bg and -fg. More of a 'standard' thing to do. Anyway, if you're interested, get the archive and see for yourself. The primary ftp site is (still) ftp.icce.rug.nl/pub/unix, and you can also get the archive from sunsite.unc.edu:/pub/Linux/Incoming or from tsx-11.mit.edu:/incoming. I guess that the sysops there will move things to their right places. For completeness, the LSM entry follows: xwatch-2.11/xwatch.README100644 1750 1750 6520 6730212625 14143 0ustar rhogeerhogee ----------------------------------------------------------------------------- XWATCH 2.11 Logfile watcher for X Karel Kubat (karel@icce.rug.nl) Maintained by Frank Brokken (frank@icce.rug.nl) ----------------------------------------------------------------------------- Xwatch is a small program that I wrote to monitor logfiles and to see any changes _directly_ (instead of having to read all the logs after a breakin or a crash). Xwatch is simply started with a few file arguments, and any information that appears on the files is displayed. With a slider you can see past information; i.e., lines that scroll in xwatch's window. To obtain xwatch, ftp to ftp.icce.rug.nl and get the file xwatch-2.11.tar.gz from the directory /pub/unix. Unpack the archive and change-dir to xwatch/doc. Then read the docs. They are provided in three formats: - xwatch.html - HTML format, view with your favorite WWW browser; - xwatch.tex - LaTeX format, latex it and print it; - xwatch.txt - plain ascii, the ugliest, but a poor-man's solution. The directory doc furthermore contains xwatch.yo, the sourcefile from which the above are created. (If you want to know how that doc file is organized, get yodl from the same site, ftp.icce.rug.nl:/pub/unix). NOTE BY THE MAINTAINER Due to the impressive nature (and the amount of) mail I receive about xwatch, I must conclude that xwatch is at most a half-product: xwatch crashes, consumes memory, doesn't do things it's supposed to do: you name it. Consequently, the amount of work to be done on xwatch is way too much for a 'maintainer', and maintenance is therefore very infrequent and low-priority. The best thing I can suggest is to use xwatch for some time, kill it, and restart it, or don't use xwatch at all, until version 3.00 arrives (whenever). end of note Copyright policy: 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. You may link this software with XForms (Copyright (C) by T.C. Zhao and Mark Overmars) and distribute the resulting binary, under the restrictions in clause 3 of the GPL, even though the resulting binary is not, as a whole, covered by the GPL. (You still need a separate license to do so from the owner(s) of the copyright for XForms, however). If a derivative no longer requires XForms, you may use the unsupplemented GPL as its license by deleting this paragraph and therefore removing this exemption for XForms. 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Karel Kubat karel@icce.rug.nl xwatch-2.11/xwatch.lsm100644 1750 1750 2044 6730212625 13776 0ustar rhogeerhogeeBegin3 Title: xwatch: Logfile watcher under X-windows Version: 2.11 Entered-date: 1995,1996 Description: Xwatch will monitor logfiles and display new information on them in a window under X. Basically, you get to see what's going on _during_ say a break-in, instead of having to check the logfiles after the damage is done. Of course, you need to have the syslog daemons configured right, so that the logfiles are created.. Xwatch reads options from its commandline as well as from a app-defaults resource file (example supplied). XWatch requires the XForms libraries to run, see the Makefile for sites where to get XForms. Keywords: logfiles watcher Author: karel@icce.rug.nl (Karel Kubat) Maintained-by: Noboby. Want to do it? No problem. Contact the author! Primary-site: ftp.icce.rug.nl:/pub/unix, file:xwatch-2.11.tar.gz Alternate-site: sunsite.unc.edu: no idea where tsx-11.mit.edu:/pub/linux/sources/usr.bin.X11 Copying-policy: GPL + okay to link with XForms clause End xwatch-2.11/.xwatch.ANNOUNCEMENT100644 1750 1750 5010 6706465454 15164 0ustar rhogeerhogeeHi all, [ This mail goes to several persons: the sysops of tsx-11.mit.edu and of sunsite.unc.edu, to the LSM maintainers, and to the moderators of c.o.l.announce. So it's a bit unpersonal.. ] I recently uploaded xwatch-_VER_.tar.gz to sunsite and tsx-11, a new version of my watchdog program for logfiles under X. What the program does, is that it just sits there and lets you see what new texts arrive on your logfiles. The advantage of xwatch over, say an rxvt window with a "tail -f" running in it, is: - XWatch lets you define colors for the different shown files. E.g., you might want to let /var/log/auth messages (about wrong passwords etc.) be shown in red. Also, XWatch lets you define colors by message content, so you might have all lines with "error" in them in bright red, if you chose so. - XWatch won't display binary files, so even if you start it as "xwatch /var/adm/*" it won't try to dump the file "utmp" (if you have one there). - XWatch can suppress the display of some messages, when you want that. E.g., "Too much work at interrupt" is a message that I have suppressed, it just tells me that the NFS is somewhat crowded and that doesn't further interest me. - XWatch has lots of parameters that can be configured via an application defaults file that are specific for a watcher. E.g., i have "*border: 0" in my file, which starts XWatch without a border. That's handy under fvwm; because, fvwm doesn't even know that XWatch is there. The XWatch window just becomes part of the root window. What's new: - Bugfix. I must've been braindead when releasing 2.08. What was previously new: - I fixed an error message about the RGB database file, the old message was not too helpful (to say the least). - All colors are now specified by a name, instead of the old R/G/B method. - XWatch now should also run on Sun's. Sun's realloc() function doesn't handle a 0-pointer as first argument, so on Sun's, the program used to coredump. Should be fixed now. - The resources and commandline flags now have -geometry, -bg and -fg. More of a 'standard' thing to do. Anyway, if you're interested, get the archive and see for yourself. The primary ftp site is (still) ftp.icce.rug.nl/pub/unix, and you can also get the archive from sunsite.unc.edu:/pub/Linux/Incoming or from tsx-11.mit.edu:/incoming. I guess that the sysops there will move things to their right places. For completeness, the LSM entry follows: xwatch-2.11/.xwatch.README100644 1750 1750 6522 6730207613 14224 0ustar rhogeerhogee ----------------------------------------------------------------------------- XWATCH _VER_ Logfile watcher for X Karel Kubat (karel@icce.rug.nl) Maintained by Frank Brokken (frank@icce.rug.nl) ----------------------------------------------------------------------------- Xwatch is a small program that I wrote to monitor logfiles and to see any changes _directly_ (instead of having to read all the logs after a breakin or a crash). Xwatch is simply started with a few file arguments, and any information that appears on the files is displayed. With a slider you can see past information; i.e., lines that scroll in xwatch's window. To obtain xwatch, ftp to ftp.icce.rug.nl and get the file xwatch-_VER_.tar.gz from the directory /pub/unix. Unpack the archive and change-dir to xwatch/doc. Then read the docs. They are provided in three formats: - xwatch.html - HTML format, view with your favorite WWW browser; - xwatch.tex - LaTeX format, latex it and print it; - xwatch.txt - plain ascii, the ugliest, but a poor-man's solution. The directory doc furthermore contains xwatch.yo, the sourcefile from which the above are created. (If you want to know how that doc file is organized, get yodl from the same site, ftp.icce.rug.nl:/pub/unix). NOTE BY THE MAINTAINER Due to the impressive nature (and the amount of) mail I receive about xwatch, I must conclude that xwatch is at most a half-product: xwatch crashes, consumes memory, doesn't do things it's supposed to do: you name it. Consequently, the amount of work to be done on xwatch is way too much for a 'maintainer', and maintenance is therefore very infrequent and low-priority. The best thing I can suggest is to use xwatch for some time, kill it, and restart it, or don't use xwatch at all, until version 3.00 arrives (whenever). end of note Copyright policy: 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. You may link this software with XForms (Copyright (C) by T.C. Zhao and Mark Overmars) and distribute the resulting binary, under the restrictions in clause 3 of the GPL, even though the resulting binary is not, as a whole, covered by the GPL. (You still need a separate license to do so from the owner(s) of the copyright for XForms, however). If a derivative no longer requires XForms, you may use the unsupplemented GPL as its license by deleting this paragraph and therefore removing this exemption for XForms. 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Karel Kubat karel@icce.rug.nl xwatch-2.11/.xwatch.lsm100644 1750 1750 2046 6706645613 14070 0ustar rhogeerhogeeBegin3 Title: xwatch: Logfile watcher under X-windows Version: _VER_ Entered-date: 1995,1996 Description: Xwatch will monitor logfiles and display new information on them in a window under X. Basically, you get to see what's going on _during_ say a break-in, instead of having to check the logfiles after the damage is done. Of course, you need to have the syslog daemons configured right, so that the logfiles are created.. Xwatch reads options from its commandline as well as from a app-defaults resource file (example supplied). XWatch requires the XForms libraries to run, see the Makefile for sites where to get XForms. Keywords: logfiles watcher Author: karel@icce.rug.nl (Karel Kubat) Maintained-by: Noboby. Want to do it? No problem. Contact the author! Primary-site: ftp.icce.rug.nl:/pub/unix, file:xwatch-_VER_.tar.gz Alternate-site: sunsite.unc.edu: no idea where tsx-11.mit.edu:/pub/linux/sources/usr.bin.X11 Copying-policy: GPL + okay to link with XForms clause End