diff --git a/wmail/COPYING b/wmail/COPYING new file mode 100644 index 0000000..278d1e6 --- /dev/null +++ b/wmail/COPYING @@ -0,0 +1,24 @@ +Copyright 2000~2002, Sven Geisenhainer . +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions, and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions, and the following disclaimer in the + documentation and/or other materials provided with the distribution. +3. The name of the author may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/wmail/Makefile.in b/wmail/Makefile.in new file mode 100644 index 0000000..6c61e44 --- /dev/null +++ b/wmail/Makefile.in @@ -0,0 +1,34 @@ +# process this file with configure to create a Makefile from it +# +# Makefile for wmail. +# Toplevel Makefile. +# Usage: make ..........: creates the wmail binary. +# make install ..: installs the binary under your default user binary +# directory and the rc-file in your home, respectively. +# make uninstall : removes any installed wmail files. +# make clean ....: cleans the src directory. + +@SET_MAKE@ + +default all target: wmail + +wmail: + @cd src; $(MAKE) -f Makefile wmail + +install: + @if ! test -f src/wmail; then $(MAKE) wmail; fi + @echo "Installing the binary under @bindir@." + @cp -f src/wmail @bindir@ + @echo "Copying .wmailrc to your home directory - you may have a look into" + @echo "this file and change it appropriately to suit your personal needs." + @cp -f wmailrc-sample $(HOME)/.wmailrc + +uninstall: + @echo "Removing wmail files from your system." + @rm -f @bindir@/wmail + @rm -f $(HOME)/.wmailrc + @rm -f $(HOME)/.wmail-cksums + +clean: + @echo "Cleaning src directory." + @cd src; $(MAKE) -f Makefile clean \ No newline at end of file diff --git a/wmail/README b/wmail/README new file mode 100644 index 0000000..485b634 --- /dev/null +++ b/wmail/README @@ -0,0 +1,358 @@ +Name : wmail +Description : a enhanced Window Maker email flagging docklet +Current version : 2.0 +Last updated : SEP 30 2002 +Licence : see file COPYING for licencing details +Web/Home : www.informatik.uni-jena.de/~topical/sveng/wmail.html +Author : (c) 2000~2002 Sven Geisenhainer +Contact : sveng@informatik.uni-jena.de + +Change Log: + + v 2.0 + - Autoconf based package configuration support added. + - Support for real X11 fonts when drawing the ticker. + Use the new option "-fn X11_FONT_NAME" or ~/.wmailrc-file statement + "Ticker.X11Font = X11_FONT_NAME" to enable it. If you wish to see latin1 + characters not covered by the buildin font you MUST make use of this. + - Removed support of two buildin fonts (one seems enough when native + X11 font rendering is supported...) -> cmdline option "-bf" and + rcfile statement "Ticker.BoldFont" are no longer available + - added a window name when called with the -w option (libdockapp windowing + mode), this workarounds a dockapp library bug and makes wmail work docked + in Gnomes panel bar + - Fixed some reconfiguration memleaks + - Fixed button-keeps-up-when-pressed-and-empty-inbox bug + - Fixed Maildir file-parsing bug + - Fixed wmail-crash on dual-headed displays (Thanx to Michael Hocke!) + - Changed upper M@il symbol a bit ;-) + + v 1.9 + - Comment support added (by Juergen A. Erhard - thank you!) + - Status field content recognition enhanced: now you can supply the + content of the status field that markes you email as read. This is due + to different behaviour of different mbox readers - pine seems using "ro" + to mark a mail as read. The given value is substring-matched. + + v 1.8 + - Support for qmails Maildir format added: if you specify a directory + as your inbox then wmail assumes 'Maildir' functionality, + searches for the subdirectories "new" and "cur" and interprets all + files found directly under these directories as text-files containing + one single email message. When in Maildir-mode, checksums and the + file ~/.wmail-cksums are not used. + - Combining of equal sender-names before tickering them is not done + anymore - this hasn't worked if for example wmail shows only unread + emails and there are two emails from the same sender and one of them + is read, the other isn't. + + v 1.72 + - Now redrawing is done only if there are some changes to be drawn + (previous versions had redrawn the screen fps-times per sec. even if + the inbox was empty...) + + v 1.71 + - File parsing bug fixed: searching for "From"-directive is now + case-sensitive. + + v 1.7 + - Support for mail-header-field "Status" added: if this field + is set to "RO" the mail is assumed to be read. Turn this feature on + either by adding "Mail.UseStatusField = Yes" to your ~/.wmailrc-file + or using the new cmd-line option "-sf" + + v 1.61 + - Minor changes: signal-handling stuff reimplemented + - Included another set of xpms (thanx to delt!); to use it, + change the #includes in wmail.c to point to the xpm_delt dir + + v 1.6 + - Sender-skipping added: use this by adding some + "Mail.SkipSender = XYZ" to your ~/.wmailrc file. Note that you can + use the known wildcards here (i.e. "Mail.SkipSender = *Foo*" matches + all names containing "Foo") + - Support for execution of a custom command when receiving a new mail + added: either use the new option "-e" or a + "Mail.OnNew.Command = some-cmd" in the rc-file (for example this + makes it possible to play some sound file using the command + "/usr/bin/play some-sound.wav") + + v 1.5 + - Config-file support (~/.wmailrc), re-configuration of most options + during run-time is possible - a click on the docklets main-area + forces wmail to read its config-file. Note that this can also be + used to do a mailbox update... + - Bolder tickerfont added -> new option "-bf" + - Polling bug fixed (wmail has queried for new mail fps-times per + second...) + - Mailbox made configurable via cmdline -> new cmd-option "-mb" + - Color of inactive (off-switched) symbols made customizable -> new + cmd-option "-oc" + + v 1.41 + - Minor fixes, debugging-aid macro TRACE made more portable + + v 1.4 + - Made mails identifiable by a checksum to (hopefully) fix some + wrong behaviour of the recent-mails-only feature introduced with + v1.3 - this is also used to make wmail able to keep the current state + in mind, even after a restart. These checksums are written to the + file ".wmail-cksums" in the users home directory + + v 1.3 + - wmail is now able to show only recent mails in ticker and counter + (such ones you don't have read/opened yet since startup of wmail) + this is quite nice if you use your mail-file as an inbox storing + loads of mails there -> new cmd-option "-n" + - Solaris port got working (signal-handler bug fixed) + - Image of run-client-button changed + + v 1.2 + - Message counter now displays up to 3 digits + - Made ticker scroll-refresh customizable (30 fps by default) + -> new cmd-option "-fps" + + v 1.1 + - Parsing of from-header fixed/improved + - Added windowed mode support (only works with libdockapp v >0.4.0) and + support for a non-shaped window -> new cmd-options "-w" and "-ns" + - Made background color customizable (useful in windowed mode) + -> new cmd-option "-bg" + - Ticker either fullname, short-address-name or total-address + -> new cmd-option "-s" + - Changed pixmaps a bit + + v 1.0 + - Initial release + +Description: + + This is wmail - a nifty Window Maker docklet watching your inbox, which is + either a ordinary mbox or a directory conforming to qmails Maildir format. + It provides a nice little GUI displaying some useful pieces of information + about your inbox (as many other nice wm-apps doing nearly the same thing...). + Per default it uses the $MAIL environment-variable to locate the inbox you + are using, other mailing mechanisms like POP or IMAP are not supported - use + a tool like fetchmail to retrieve POP- or IMAP-based mail. + + It displays the following: + + - a mail-icon in the upper-left if your inbox contains some mails + - a frequently flashing "M@iL" in the upper-right if there are unread mails + - a ticker displaying either complete mail-address, it's name-part or the + full sender's name (without the "-n" option each sender found in the inbox + is tickered, else only the unread ones) + - the number of new and read emails found (or the number of unread messages + if invoked with the "-n" option) + + In addition, the lower-right button allowes you to quickly launch your + preferred email user agent (xterm -e mail, mutt, pine, etc.) + + wmail is highly customizable, both command-line and configuration-file support + is provided. The following list describes all customizable items, + their associated cmd-line options, config-file statements and default values: + + item : X11 display + cmd-line option : -display + rc-file statement: Window.Display = "" + default value : + + item : toggle nonshaped mode + cmd-line option : -ns + rc-file statement: Window.NonShaped = Yes|No + default value : No + + item : button command to execute + cmd-line option : -c + rc-file statement: Window.Button.Command = "" + default value : "xterm -e mail" + + item : your mailbox (file => mbox, directory => Maildir) + cmd-line option : -mb + rc-file statement: Mail.MailBox = "" + default value : + + item : file to store the checksums used to identify mbox mails + cmd-line option : + rc-file statement: Mail.ChecksumFile = "" + default value : "~/.wmail-cksums" + + item : ticker (and count) only unread mails + cmd-line option : -n + rc-file statement: Mail.ShowOnlyNew = Yes|No + default value : No + + item : mail check intervall (sec) + cmd-line option : -i + rc-file statement: Mail.CheckIntervall = + default value : 1 + + item : consider status-field (not used when in maildir mode) + cmd-line option : -sf + rc-file statement: Mail.UseStatusField = Yes|No + default value : No + + item : custom status field content used for read mails + cmd-line option : -rs + rc-file statement: Mail.ReadStatus = "" + default value : "O" + + item : show nick names in the ticker (all before the @) + cmd-line option : -s + rc-file statement: Ticker.Mode = NickName + default value : Address + + item : show family names in the ticker (if available) + cmd-line option : -f + rc-file statement: Ticker.Mode = FamilyName + default value : Address + + item : how many ticker frames per sec + cmd-line option : -fps + rc-file statement: Ticker.Frames = + default value : 30 + + item : use a real X11 font when drawing the ticker + cmd-line option : -fn + rc-file statement: Ticker.X11Font = "" + default value : + + item : command to execute when new mail has arrived + cmd-line option : -e + rc-file statement: Mail.OnNew.Command = "" + default value : + + item : sender-names to skip (don't ticker and count them) + cmd-line option : + rc-file statement: Mail.SkipSender = "" + default value : + + item : color for upper symbols (envelope and MAiL) + cmd-line option : -sc + rc-file statement: Colors.Symbols = "" + default value : "#20B2AA" + + item : ticker font color + cmd-line option : -fc + rc-file statement: Colors.Font = "" + default value : "#D3D3D3" + + item : backlight color (dockapp background) + cmd-line option : -bc + rc-file statement: Colors.Backlight = "" + default value : "#282828" + + item : color of inactive symbols + cmd-line option : -oc + rc-file statement: Colors.OffLight = "" + default value : "#282828" + + item : outer frame color (used in nonshaped window mode) + cmd-line option : -bg + rc-file statement: Colors.NonShapedFrame = "" + default value : + + libdockapp provides the following additional cmd-line options: + + windowed-mode : -w + + show help and exit : -h + + show version and exit: -v + +Known bugs: + + - Solaris: sometimes wmail gets terminated by Xlib displaying the message: + XIO: fatal IO error 0 (Error 0) on X server ":0.0" + after XXX requests (YYY known processed) with 0 events remaining. + I do not have any ideas on how to fix this ... :-( --> PLEASE HELP!!! + - "From" header field folding (see RFC822) is not supported + - Reconfiguration during run-time results in a complete state-lost -> all + email in your mbox is assumed to be unread again + + Please keep in mind this code is free and comes with absolutly no warranty + (see file COPYING included in the package) - but if you think something goes + wrong, please let me know! + +What is still missing (and when it will be done :) + + - Pop3/Imap support (never - use fetchmail) + - Character encoding in ticker - at least latin1 (currently in progress) + - Multiple mailslots (never) + - Displaying/tickering of other email header fields (hmm, i don't know...) + - Your needs/ideas...? + +Requirements: + + This application needs a running X window system and libdockapp v0.2 or newer + (0.4.0 required for windowed-mode), that for itself has some requirements + (Xpm support for example). libdockapp comes with Window Maker - if not sure, + see what the configure-script says when running it. + +Compile: + + Simply follow these steps: + 1. Call "./configure", try "./configure --help" for a list of options. + 2. Call "make" to build the binary (or gmake if make is't GNU make compliant) + + If compiling does not succeed due to missed header files or libraries + you have to make use of configures `--includedir=DIR' and/or `--libdir=DIR' + cmdline options in order to specify paths to those files. + +Porting: + + This code (without using the new Maildir code and autoconf package setup) + is known to work under: + - Linux >=2.4.10 on x86 + - Osf 3.2 on Dec/Alpha + - Sun Solaris 4.0 on Sparc Station 4 and 10 + - Sun Solaris 6, 7 and 8 (thanx to Kristian Borum!) + - SunOs 5.7 on Ultra Sparc 5 (thanx to Alessandro!) + + ...together with Window Maker v0.60.0 or better (or standalone of course) and + libdockapp v0.4.0. + + Please let me know if you have ported this to a platform not listed + above to mention it (and your name of cource ;). Some users had + trouble porting wmail to Solaris because the original timer signal handling + has not worked properly. This was caused by different semantics of libc's + signal function and should got fixed since releases >= v1.3. + +Install: + + Call "make install" or copy the binary found in the src subdirectory by hand. + Make based installation also copies the provided sample rc-file to ~/.wmailrc + but wmail even runs without it. + + Keep in mind, libdockapp must be installed properly (i.e. let reside it in + your X11 base library directory or let $LD_LIBRARY_PATH point to the lib). + If you would like to use rc-based configuration, look into the provided + sample-file "wmailrc-sample" and use it as a base for your particular needs + by copying it to ~/.wmailrc (make install has done this automatically). + Note: the name of this rc-file is hard-wired and cannot be customized. + +Run: + + Try wmail -h to see a list of all available options. + +Web/Home: + + www.informatik.uni-jena.de/~topical/sveng/wmail.html + +Author and maintainer: + + Sven Geisenhainer + + There is also a Debian package available under "http://jerhard.org/files/" + maintained by Juergen A. Erhard - Thank you, Juergen! + +Final words: + + Thanx to Thomas Kurschel for his suggestions and coding assistance. + Thanx to Juergen A. Erhard for his codings and Debian packaging efforts. + Thanx to many users on the web for their ideas, test- and bug reports. + + And many great thanx to all the GNUstep and Window Maker people who've + provided us with such a great user environment! + + Hope you will ENJOY! diff --git a/wmail/configure b/wmail/configure new file mode 100755 index 0000000..1f51cba --- /dev/null +++ b/wmail/configure @@ -0,0 +1,2721 @@ +#! /bin/sh + +# Guess values for system-dependent variables and create Makefiles. +# Generated automatically using autoconf version 2.13 +# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. + +# Defaults: +ac_help= +ac_default_prefix=/usr/local +# Any additions from configure.in: +ac_help="$ac_help + --with-x use the X Window System" +ac_help="$ac_help + --enable-debug enable debugging " +ac_help="$ac_help + --enable-delt-xpms enable delt's pixmaps " + +# Initialize some variables set by options. +# The variables have the same names as the options, with +# dashes changed to underlines. +build=NONE +cache_file=./config.cache +exec_prefix=NONE +host=NONE +no_create= +nonopt=NONE +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +target=NONE +verbose= +x_includes=NONE +x_libraries=NONE +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + +# Initialize some other variables. +subdirs= +MFLAGS= MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} +# Maximum number of lines to put in a shell here document. +ac_max_here_lines=12 + +ac_prev= +for ac_option +do + + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + case "$ac_option" in + -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) ac_optarg= ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case "$ac_option" in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir="$ac_optarg" ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build="$ac_optarg" ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file="$ac_optarg" ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir="$ac_optarg" ;; + + -disable-* | --disable-*) + ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + eval "enable_${ac_feature}=no" ;; + + -enable-* | --enable-*) + ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "enable_${ac_feature}='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix="$ac_optarg" ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he) + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat << EOF +Usage: configure [options] [host] +Options: [defaults in brackets after descriptions] +Configuration: + --cache-file=FILE cache test results in FILE + --help print this message + --no-create do not create output files + --quiet, --silent do not print \`checking...' messages + --version print the version of autoconf that created configure +Directory and file names: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [same as prefix] + --bindir=DIR user executables in DIR [EPREFIX/bin] + --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] + --libexecdir=DIR program executables in DIR [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data in DIR + [PREFIX/share] + --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data in DIR + [PREFIX/com] + --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] + --libdir=DIR object code libraries in DIR [EPREFIX/lib] + --includedir=DIR C header files in DIR [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] + --infodir=DIR info documentation in DIR [PREFIX/info] + --mandir=DIR man documentation in DIR [PREFIX/man] + --srcdir=DIR find the sources in DIR [configure dir or ..] + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM + run sed PROGRAM on installed program names +EOF + cat << EOF +Host type: + --build=BUILD configure for building on BUILD [BUILD=HOST] + --host=HOST configure for HOST [guessed] + --target=TARGET configure for TARGET [TARGET=HOST] +Features and packages: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --x-includes=DIR X include files are in DIR + --x-libraries=DIR X library files are in DIR +EOF + if test -n "$ac_help"; then + echo "--enable and --with options recognized:$ac_help" + fi + exit 0 ;; + + -host | --host | --hos | --ho) + ac_prev=host ;; + -host=* | --host=* | --hos=* | --ho=*) + host="$ac_optarg" ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir="$ac_optarg" ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir="$ac_optarg" ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir="$ac_optarg" ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir="$ac_optarg" ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir="$ac_optarg" ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir="$ac_optarg" ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir="$ac_optarg" ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix="$ac_optarg" ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix="$ac_optarg" ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix="$ac_optarg" ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name="$ac_optarg" ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir="$ac_optarg" ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir="$ac_optarg" ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site="$ac_optarg" ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir="$ac_optarg" ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir="$ac_optarg" ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target="$ac_optarg" ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers) + echo "configure generated by autoconf version 2.13" + exit 0 ;; + + -with-* | --with-*) + ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "with_${ac_package}='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`echo $ac_option|sed -e 's/-*without-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + eval "with_${ac_package}=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes="$ac_optarg" ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries="$ac_optarg" ;; + + -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } + ;; + + *) + if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then + echo "configure: warning: $ac_option: invalid host type" 1>&2 + fi + if test "x$nonopt" != xNONE; then + { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } + fi + nonopt="$ac_option" + ;; + + esac +done + +if test -n "$ac_prev"; then + { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } +fi + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +# File descriptor usage: +# 0 standard input +# 1 file creation +# 2 errors and warnings +# 3 some systems may open it to /dev/tty +# 4 used on the Kubota Titan +# 6 checking for... messages and results +# 5 compiler messages saved in config.log +if test "$silent" = yes; then + exec 6>/dev/null +else + exec 6>&1 +fi +exec 5>./config.log + +echo "\ +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. +" 1>&5 + +# Strip out --no-create and --no-recursion so they do not pile up. +# Also quote any args containing shell metacharacters. +ac_configure_args= +for ac_arg +do + case "$ac_arg" in + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) ;; + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) + ac_configure_args="$ac_configure_args '$ac_arg'" ;; + *) ac_configure_args="$ac_configure_args $ac_arg" ;; + esac +done + +# NLS nuisances. +# Only set these to C if already set. These must not be set unconditionally +# because not all systems understand e.g. LANG=C (notably SCO). +# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! +# Non-C LC_CTYPE values break the ctype check. +if test "${LANG+set}" = set; then LANG=C; export LANG; fi +if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi +if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi +if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo > confdefs.h + +# A filename unique to this package, relative to the directory that +# configure is in, which we can look for to find out if srcdir is correct. +ac_unique_file=src/wmail.c + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_prog=$0 + ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` + test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } + else + { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } + fi +fi +srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` + +# Prefer explicitly selected file to automatically selected ones. +if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + echo "loading site script $ac_site_file" + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + echo "loading cache $cache_file" + . $cache_file +else + echo "creating cache $cache_file" + > $cache_file +fi + +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +ac_exeext= +ac_objext=o +if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then + # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. + if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then + ac_n= ac_c=' +' ac_t=' ' + else + ac_n=-n ac_c= ac_t= + fi +else + ac_n= ac_c='\c' ac_t= +fi + + + +# Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:535: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="gcc" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:565: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_prog_rejected=no + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + break + fi + done + IFS="$ac_save_ifs" +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# -gt 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + set dummy "$ac_dir/$ac_word" "$@" + shift + ac_cv_prog_CC="$@" + fi +fi +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + if test -z "$CC"; then + case "`uname -s`" in + *win32* | *WIN32*) + # Extract the first word of "cl", so it can be a program name with args. +set dummy cl; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:616: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="cl" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + ;; + esac + fi + test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } +fi + +echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 +echo "configure:648: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 + +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +cat > conftest.$ac_ext << EOF + +#line 659 "configure" +#include "confdefs.h" + +main(){return(0);} +EOF +if { (eval echo configure:664: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + ac_cv_prog_cc_works=yes + # If we can't run a trivial program, we are probably using a cross compiler. + if (./conftest; exit) 2>/dev/null; then + ac_cv_prog_cc_cross=no + else + ac_cv_prog_cc_cross=yes + fi +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_cv_prog_cc_works=no +fi +rm -fr conftest* +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 +if test $ac_cv_prog_cc_works = no; then + { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } +fi +echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 +echo "configure:690: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 +cross_compiling=$ac_cv_prog_cc_cross + +echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 +echo "configure:695: checking whether we are using GNU C" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then + ac_cv_prog_gcc=yes +else + ac_cv_prog_gcc=no +fi +fi + +echo "$ac_t""$ac_cv_prog_gcc" 1>&6 + +if test $ac_cv_prog_gcc = yes; then + GCC=yes +else + GCC= +fi + +ac_test_CFLAGS="${CFLAGS+set}" +ac_save_CFLAGS="$CFLAGS" +CFLAGS= +echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 +echo "configure:723: checking whether ${CC-cc} accepts -g" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + echo 'void f(){}' > conftest.c +if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then + ac_cv_prog_cc_g=yes +else + ac_cv_prog_cc_g=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 +if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi + +echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 +echo "configure:755: checking whether ${MAKE-make} sets \${MAKE}" >&5 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftestmake <<\EOF +all: + @echo 'ac_maketemp="${MAKE}"' +EOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftestmake +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$ac_t""yes" 1>&6 + SET_MAKE= +else + echo "$ac_t""no" 1>&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + + +#AC_PATH_X +ac_header_dirent=no +for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6 +echo "configure:788: checking for $ac_hdr that defines DIR" >&5 +if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#include <$ac_hdr> +int main() { +DIR *dirp = 0; +; return 0; } +EOF +if { (eval echo configure:801: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + eval "ac_cv_header_dirent_$ac_safe=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_dirent_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done +# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. +if test $ac_header_dirent = dirent.h; then +echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6 +echo "configure:826: checking for opendir in -ldir" >&5 +ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-ldir $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + LIBS="$LIBS -ldir" +else + echo "$ac_t""no" 1>&6 +fi + +else +echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6 +echo "configure:867: checking for opendir in -lx" >&5 +ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lx $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + LIBS="$LIBS -lx" +else + echo "$ac_t""no" 1>&6 +fi + +fi + +echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 +echo "configure:909: checking how to run the C preprocessor" >&5 +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then +if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + # This must be in double quotes, not single quotes, because CPP may get + # substituted into the Makefile and "${CC-cc}" will confuse make. + CPP="${CC-cc} -E" + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. + cat > conftest.$ac_ext < +Syntax Error +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:930: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + : +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + CPP="${CC-cc} -E -traditional-cpp" + cat > conftest.$ac_ext < +Syntax Error +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:947: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + : +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + CPP="${CC-cc} -nologo -E" + cat > conftest.$ac_ext < +Syntax Error +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:964: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + : +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + CPP=/lib/cpp +fi +rm -f conftest* +fi +rm -f conftest* +fi +rm -f conftest* + ac_cv_prog_CPP="$CPP" +fi + CPP="$ac_cv_prog_CPP" +else + ac_cv_prog_CPP="$CPP" +fi +echo "$ac_t""$CPP" 1>&6 + +echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 +echo "configure:989: checking for ANSI C header files" >&5 +if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#include +#include +#include +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1002: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + ac_cv_header_stdc=yes +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_header_stdc=no +fi +rm -f conftest* + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. +cat > conftest.$ac_ext < +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "memchr" >/dev/null 2>&1; then + : +else + rm -rf conftest* + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. +cat > conftest.$ac_ext < +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "free" >/dev/null 2>&1; then + : +else + rm -rf conftest* + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. +if test "$cross_compiling" = yes; then + : +else + cat > conftest.$ac_ext < +#define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int main () { int i; for (i = 0; i < 256; i++) +if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); +exit (0); } + +EOF +if { (eval echo configure:1069: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +then + : +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + ac_cv_header_stdc=no +fi +rm -fr conftest* +fi + +fi +fi + +echo "$ac_t""$ac_cv_header_stdc" 1>&6 +if test $ac_cv_header_stdc = yes; then + cat >> confdefs.h <<\EOF +#define STDC_HEADERS 1 +EOF + +fi + +for ac_hdr in limits.h sys/time.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:1096: checking for $ac_hdr" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1106: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + + +# If we find X, set shell vars x_includes and x_libraries to the +# paths, otherwise set no_x=yes. +# Uses ac_ vars as temps to allow command line to override cache and checks. +# --without-x overrides everything else, but does not touch the cache. +echo $ac_n "checking for X""... $ac_c" 1>&6 +echo "configure:1138: checking for X" >&5 + +# Check whether --with-x or --without-x was given. +if test "${with_x+set}" = set; then + withval="$with_x" + : +fi + +# $have_x is `yes', `no', `disabled', or empty when we do not yet know. +if test "x$with_x" = xno; then + # The user explicitly disabled X. + have_x=disabled +else + if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then + # Both variables are already set. + have_x=yes + else +if eval "test \"`echo '$''{'ac_cv_have_x'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + # One or both of the vars are not set, and there is no cached value. +ac_x_includes=NO ac_x_libraries=NO +rm -fr conftestdir +if mkdir conftestdir; then + cd conftestdir + # Make sure to not put "make" in the Imakefile rules, since we grep it out. + cat > Imakefile <<'EOF' +acfindx: + @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"' +EOF + if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then + # GNU make sometimes prints "make[1]: Entering...", which would confuse us. + eval `${MAKE-make} acfindx 2>/dev/null | grep -v make` + # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR. + for ac_extension in a so sl; do + if test ! -f $ac_im_usrlibdir/libX11.$ac_extension && + test -f $ac_im_libdir/libX11.$ac_extension; then + ac_im_usrlibdir=$ac_im_libdir; break + fi + done + # Screen out bogus values from the imake configuration. They are + # bogus both because they are the default anyway, and because + # using them would break gcc on systems where it needs fixed includes. + case "$ac_im_incroot" in + /usr/include) ;; + *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes="$ac_im_incroot" ;; + esac + case "$ac_im_usrlibdir" in + /usr/lib | /lib) ;; + *) test -d "$ac_im_usrlibdir" && ac_x_libraries="$ac_im_usrlibdir" ;; + esac + fi + cd .. + rm -fr conftestdir +fi + +if test "$ac_x_includes" = NO; then + # Guess where to find include files, by looking for this one X11 .h file. + test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h + + # First, try using that file with no special directory specified. +cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1205: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + # We can compile using X headers with no special include directory. +ac_x_includes= +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + # Look for the header file in a standard set of common directories. +# Check X11 before X11Rn because it is often a symlink to the current release. + for ac_dir in \ + /usr/X11/include \ + /usr/X11R6/include \ + /usr/X11R5/include \ + /usr/X11R4/include \ + \ + /usr/include/X11 \ + /usr/include/X11R6 \ + /usr/include/X11R5 \ + /usr/include/X11R4 \ + \ + /usr/local/X11/include \ + /usr/local/X11R6/include \ + /usr/local/X11R5/include \ + /usr/local/X11R4/include \ + \ + /usr/local/include/X11 \ + /usr/local/include/X11R6 \ + /usr/local/include/X11R5 \ + /usr/local/include/X11R4 \ + \ + /usr/X386/include \ + /usr/x386/include \ + /usr/XFree86/include/X11 \ + \ + /usr/include \ + /usr/local/include \ + /usr/unsupported/include \ + /usr/athena/include \ + /usr/local/x11r5/include \ + /usr/lpp/Xamples/include \ + \ + /usr/openwin/include \ + /usr/openwin/share/include \ + ; \ + do + if test -r "$ac_dir/$x_direct_test_include"; then + ac_x_includes=$ac_dir + break + fi + done +fi +rm -f conftest* +fi # $ac_x_includes = NO + +if test "$ac_x_libraries" = NO; then + # Check for the libraries. + + test -z "$x_direct_test_library" && x_direct_test_library=Xt + test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc + + # See if we find them without any special options. + # Don't add to $LIBS permanently. + ac_save_LIBS="$LIBS" + LIBS="-l$x_direct_test_library $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + LIBS="$ac_save_LIBS" +# We can link X programs with no special library path. +ac_x_libraries= +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + LIBS="$ac_save_LIBS" +# First see if replacing the include by lib works. +# Check X11 before X11Rn because it is often a symlink to the current release. +for ac_dir in `echo "$ac_x_includes" | sed s/include/lib/` \ + /usr/X11/lib \ + /usr/X11R6/lib \ + /usr/X11R5/lib \ + /usr/X11R4/lib \ + \ + /usr/lib/X11 \ + /usr/lib/X11R6 \ + /usr/lib/X11R5 \ + /usr/lib/X11R4 \ + \ + /usr/local/X11/lib \ + /usr/local/X11R6/lib \ + /usr/local/X11R5/lib \ + /usr/local/X11R4/lib \ + \ + /usr/local/lib/X11 \ + /usr/local/lib/X11R6 \ + /usr/local/lib/X11R5 \ + /usr/local/lib/X11R4 \ + \ + /usr/X386/lib \ + /usr/x386/lib \ + /usr/XFree86/lib/X11 \ + \ + /usr/lib \ + /usr/local/lib \ + /usr/unsupported/lib \ + /usr/athena/lib \ + /usr/local/x11r5/lib \ + /usr/lpp/Xamples/lib \ + /lib/usr/lib/X11 \ + \ + /usr/openwin/lib \ + /usr/openwin/share/lib \ + ; \ +do + for ac_extension in a so sl; do + if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then + ac_x_libraries=$ac_dir + break 2 + fi + done +done +fi +rm -f conftest* +fi # $ac_x_libraries = NO + +if test "$ac_x_includes" = NO || test "$ac_x_libraries" = NO; then + # Didn't find X anywhere. Cache the known absence of X. + ac_cv_have_x="have_x=no" +else + # Record where we found X for the cache. + ac_cv_have_x="have_x=yes \ + ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries" +fi +fi + fi + eval "$ac_cv_have_x" +fi # $with_x != no + +if test "$have_x" != yes; then + echo "$ac_t""$have_x" 1>&6 + no_x=yes +else + # If each of the values was on the command line, it overrides each guess. + test "x$x_includes" = xNONE && x_includes=$ac_x_includes + test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries + # Update the cache value to reflect the command line values. + ac_cv_have_x="have_x=yes \ + ac_x_includes=$x_includes ac_x_libraries=$x_libraries" + echo "$ac_t""libraries $x_libraries, headers $x_includes" 1>&6 +fi + +if test "$no_x" = yes; then + # Not all programs may use this symbol, but it does not hurt to define it. + cat >> confdefs.h <<\EOF +#define X_DISPLAY_MISSING 1 +EOF + + X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS= +else + if test -n "$x_includes"; then + X_CFLAGS="$X_CFLAGS -I$x_includes" + fi + + # It would also be nice to do this for all -L options, not just this one. + if test -n "$x_libraries"; then + X_LIBS="$X_LIBS -L$x_libraries" + # For Solaris; some versions of Sun CC require a space after -R and + # others require no space. Words are not sufficient . . . . + case "`(uname -sr) 2>/dev/null`" in + "SunOS 5"*) + echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6 +echo "configure:1387: checking whether -R must be followed by a space" >&5 + ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + ac_R_nospace=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_R_nospace=no +fi +rm -f conftest* + if test $ac_R_nospace = yes; then + echo "$ac_t""no" 1>&6 + X_LIBS="$X_LIBS -R$x_libraries" + else + LIBS="$ac_xsave_LIBS -R $x_libraries" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + ac_R_space=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_R_space=no +fi +rm -f conftest* + if test $ac_R_space = yes; then + echo "$ac_t""yes" 1>&6 + X_LIBS="$X_LIBS -R $x_libraries" + else + echo "$ac_t""neither works" 1>&6 + fi + fi + LIBS="$ac_xsave_LIBS" + esac + fi + + # Check for system-dependent libraries X programs must link with. + # Do this before checking for the system-independent R6 libraries + # (-lICE), since we may need -lsocket or whatever for X linking. + + if test "$ISC" = yes; then + X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet" + else + # Martyn.Johnson@cl.cam.ac.uk says this is needed for Ultrix, if the X + # libraries were built with DECnet support. And karl@cs.umb.edu says + # the Alpha needs dnet_stub (dnet does not exist). + echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6 +echo "configure:1452: checking for dnet_ntoa in -ldnet" >&5 +ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-ldnet $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet" +else + echo "$ac_t""no" 1>&6 +fi + + if test $ac_cv_lib_dnet_dnet_ntoa = no; then + echo $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>&6 +echo "configure:1493: checking for dnet_ntoa in -ldnet_stub" >&5 +ac_lib_var=`echo dnet_stub'_'dnet_ntoa | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-ldnet_stub $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub" +else + echo "$ac_t""no" 1>&6 +fi + + fi + + # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT, + # to get the SysV transport functions. + # chad@anasazi.com says the Pyramis MIS-ES running DC/OSx (SVR4) + # needs -lnsl. + # The nsl library prevents programs from opening the X display + # on Irix 5.2, according to dickey@clark.net. + echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6 +echo "configure:1541: checking for gethostbyname" >&5 +if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char gethostbyname(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_gethostbyname) || defined (__stub___gethostbyname) +choke me +#else +gethostbyname(); +#endif + +; return 0; } +EOF +if { (eval echo configure:1569: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_gethostbyname=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_gethostbyname=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'gethostbyname`\" = yes"; then + echo "$ac_t""yes" 1>&6 + : +else + echo "$ac_t""no" 1>&6 +fi + + if test $ac_cv_func_gethostbyname = no; then + echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6 +echo "configure:1590: checking for gethostbyname in -lnsl" >&5 +ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lnsl $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl" +else + echo "$ac_t""no" 1>&6 +fi + + fi + + # lieder@skyler.mavd.honeywell.com says without -lsocket, + # socket/setsockopt and other routines are undefined under SCO ODT + # 2.0. But -lsocket is broken on IRIX 5.2 (and is not necessary + # on later versions), says simon@lia.di.epfl.ch: it contains + # gethostby* variants that don't use the nameserver (or something). + # -lsocket must be given before -lnsl if both are needed. + # We assume that if connect needs -lnsl, so does gethostbyname. + echo $ac_n "checking for connect""... $ac_c" 1>&6 +echo "configure:1639: checking for connect" >&5 +if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char connect(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_connect) || defined (__stub___connect) +choke me +#else +connect(); +#endif + +; return 0; } +EOF +if { (eval echo configure:1667: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_connect=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_connect=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'connect`\" = yes"; then + echo "$ac_t""yes" 1>&6 + : +else + echo "$ac_t""no" 1>&6 +fi + + if test $ac_cv_func_connect = no; then + echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6 +echo "configure:1688: checking for connect in -lsocket" >&5 +ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lsocket $X_EXTRA_LIBS $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS" +else + echo "$ac_t""no" 1>&6 +fi + + fi + + # gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX. + echo $ac_n "checking for remove""... $ac_c" 1>&6 +echo "configure:1731: checking for remove" >&5 +if eval "test \"`echo '$''{'ac_cv_func_remove'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char remove(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_remove) || defined (__stub___remove) +choke me +#else +remove(); +#endif + +; return 0; } +EOF +if { (eval echo configure:1759: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_remove=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_remove=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'remove`\" = yes"; then + echo "$ac_t""yes" 1>&6 + : +else + echo "$ac_t""no" 1>&6 +fi + + if test $ac_cv_func_remove = no; then + echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6 +echo "configure:1780: checking for remove in -lposix" >&5 +ac_lib_var=`echo posix'_'remove | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lposix $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix" +else + echo "$ac_t""no" 1>&6 +fi + + fi + + # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. + echo $ac_n "checking for shmat""... $ac_c" 1>&6 +echo "configure:1823: checking for shmat" >&5 +if eval "test \"`echo '$''{'ac_cv_func_shmat'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char shmat(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_shmat) || defined (__stub___shmat) +choke me +#else +shmat(); +#endif + +; return 0; } +EOF +if { (eval echo configure:1851: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_shmat=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_shmat=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'shmat`\" = yes"; then + echo "$ac_t""yes" 1>&6 + : +else + echo "$ac_t""no" 1>&6 +fi + + if test $ac_cv_func_shmat = no; then + echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6 +echo "configure:1872: checking for shmat in -lipc" >&5 +ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lipc $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc" +else + echo "$ac_t""no" 1>&6 +fi + + fi + fi + + # Check for libraries that X11R6 Xt/Xaw programs need. + ac_save_LDFLAGS="$LDFLAGS" + test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries" + # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to + # check for ICE first), but we must link in the order -lSM -lICE or + # we get undefined symbols. So assume we have SM if we have ICE. + # These have to be linked with before -lX11, unlike the other + # libraries we check for below, so use a different variable. + # --interran@uluru.Stanford.EDU, kb@cs.umb.edu. + echo $ac_n "checking for IceConnectionNumber in -lICE""... $ac_c" 1>&6 +echo "configure:1924: checking for IceConnectionNumber in -lICE" >&5 +ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lICE $X_EXTRA_LIBS $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE" +else + echo "$ac_t""no" 1>&6 +fi + + LDFLAGS="$ac_save_LDFLAGS" + +fi + +X_LIBRARY_PATH="$x_libraries" +XLIBS="-lX11 $X_EXTRA_LIBS" +XCFLAGS="$X_CFLAGS" +XLFLAGS="$X_LIBS" + +if test -n "$includedir"; then + XCFLAGS="$XCFLAGS -I$includedir" +fi + +if test -n "$libdir"; then + XLIBS="$XLIBS -L$libdir" +fi + +CPPFLAGS_old="$CPPFLAGS" +CPPFLAGS="$CPPFLAGS $XCFLAGS" +ac_safe=`echo "dockapp.h" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for dockapp.h""... $ac_c" 1>&6 +echo "configure:1984: checking for dockapp.h" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1994: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + : +else + echo "$ac_t""no" 1>&6 +fi + +CPPFLAGS="$CPPFLAGS_old" + + + + + + +echo $ac_n "checking for working const""... $ac_c" 1>&6 +echo "configure:2023: checking for working const" >&5 +if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <j = 5; +} +{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ + const int foo = 10; +} + +; return 0; } +EOF +if { (eval echo configure:2077: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_c_const=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_c_const=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_c_const" 1>&6 +if test $ac_cv_c_const = no; then + cat >> confdefs.h <<\EOF +#define const +EOF + +fi + + +echo $ac_n "checking for working fnmatch""... $ac_c" 1>&6 +echo "configure:2099: checking for working fnmatch" >&5 +if eval "test \"`echo '$''{'ac_cv_func_fnmatch_works'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + # Some versions of Solaris or SCO have a broken fnmatch function. +# So we run a test program. If we are cross-compiling, take no chance. +# Thanks to John Oleynick and Franc,ois Pinard for this test. +if test "$cross_compiling" = yes; then + ac_cv_func_fnmatch_works=no +else + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +then + ac_cv_func_fnmatch_works=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + ac_cv_func_fnmatch_works=no +fi +rm -fr conftest* +fi + +fi + +echo "$ac_t""$ac_cv_func_fnmatch_works" 1>&6 +if test $ac_cv_func_fnmatch_works = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_FNMATCH 1 +EOF + +fi + +echo $ac_n "checking whether utime accepts a null argument""... $ac_c" 1>&6 +echo "configure:2137: checking whether utime accepts a null argument" >&5 +if eval "test \"`echo '$''{'ac_cv_func_utime_null'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + rm -f conftestdata; > conftestdata +# Sequent interprets utime(file, 0) to mean use start of epoch. Wrong. +if test "$cross_compiling" = yes; then + ac_cv_func_utime_null=no +else + cat > conftest.$ac_ext < +#include +main() { +struct stat s, t; +exit(!(stat ("conftestdata", &s) == 0 && utime("conftestdata", (long *)0) == 0 +&& stat("conftestdata", &t) == 0 && t.st_mtime >= s.st_mtime +&& t.st_mtime - s.st_mtime < 120)); +} +EOF +if { (eval echo configure:2158: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +then + ac_cv_func_utime_null=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + ac_cv_func_utime_null=no +fi +rm -fr conftest* +fi + +rm -f core core.* *.core +fi + +echo "$ac_t""$ac_cv_func_utime_null" 1>&6 +if test $ac_cv_func_utime_null = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_UTIME_NULL 1 +EOF + +fi + +echo $ac_n "checking for vprintf""... $ac_c" 1>&6 +echo "configure:2182: checking for vprintf" >&5 +if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char vprintf(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_vprintf) || defined (__stub___vprintf) +choke me +#else +vprintf(); +#endif + +; return 0; } +EOF +if { (eval echo configure:2210: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_vprintf=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_vprintf=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'vprintf`\" = yes"; then + echo "$ac_t""yes" 1>&6 + cat >> confdefs.h <<\EOF +#define HAVE_VPRINTF 1 +EOF + +else + echo "$ac_t""no" 1>&6 +fi + +if test "$ac_cv_func_vprintf" != yes; then +echo $ac_n "checking for _doprnt""... $ac_c" 1>&6 +echo "configure:2234: checking for _doprnt" >&5 +if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char _doprnt(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub__doprnt) || defined (__stub____doprnt) +choke me +#else +_doprnt(); +#endif + +; return 0; } +EOF +if { (eval echo configure:2262: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func__doprnt=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func__doprnt=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'_doprnt`\" = yes"; then + echo "$ac_t""yes" 1>&6 + cat >> confdefs.h <<\EOF +#define HAVE_DOPRNT 1 +EOF + +else + echo "$ac_t""no" 1>&6 +fi + +fi + +for ac_func in strdup strstr memcpy +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:2289: checking for $ac_func" >&5 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:2317: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 +fi +done + + +echo $ac_n "checking for XCreateGC in -lX11""... $ac_c" 1>&6 +echo "configure:2343: checking for XCreateGC in -lX11" >&5 +ac_lib_var=`echo X11'_'XCreateGC | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lX11 $XLFLAGS $XLIBS $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_lib=HAVE_LIB`echo X11 | sed -e 's/[^a-zA-Z0-9_]/_/g' \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` + cat >> confdefs.h <&6 +fi + +echo $ac_n "checking for DAInitialize in -ldockapp""... $ac_c" 1>&6 +echo "configure:2390: checking for DAInitialize in -ldockapp" >&5 +ac_lib_var=`echo dockapp'_'DAInitialize | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-ldockapp $XLFLAGS $XLIBS $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_lib=HAVE_LIB`echo dockapp | sed -e 's/[^a-zA-Z0-9_]/_/g' \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` + cat >> confdefs.h <&6 +fi + + +# Check whether --enable-debug or --disable-debug was given. +if test "${enable_debug+set}" = set; then + enableval="$enable_debug" + : +else + enable_debug=no +fi + +if test "$enable_debug" = yes; then + CFLAGS="-Wall -g -DDEBUG" +fi + +# Check whether --enable-delt_xpms or --disable-delt_xpms was given. +if test "${enable_delt_xpms+set}" = set; then + enableval="$enable_delt_xpms" + : +else + enable_delt_xpms=no +fi + +if test "$enable_delt_xpms" = yes; then + CFLAGS="$CFLAGS -DUSE_DELT_XPMS" +fi + +trap '' 1 2 15 +cat > confcache <<\EOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs. It is not useful on other systems. +# If it contains results you don't want to keep, you may remove or edit it. +# +# By default, configure uses ./config.cache as the cache file, +# creating it if it does not exist already. You can give configure +# the --cache-file=FILE option to use a different cache file; that is +# what configure does when it calls configure scripts in +# subdirectories, so they share the cache. +# Giving --cache-file=/dev/null disables caching, for debugging configure. +# config.status only pays attention to the cache file if you give it the +# --recheck option to rerun configure. +# +EOF +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +(set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote substitution + # turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + -e "s/'/'\\\\''/g" \ + -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' + ;; + esac >> confcache +if cmp -s $cache_file confcache; then + : +else + if test -w $cache_file; then + echo "updating cache $cache_file" + cat confcache > $cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# Any assignment to VPATH causes Sun make to only execute +# the first set of double-colon rules, so remove it if not needed. +# If there is a colon in the path, we need to keep it. +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' +fi + +trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 + +# Transform confdefs.h into DEFS. +# Protect against shell expansion while executing Makefile rules. +# Protect against Makefile macro expansion. +cat > conftest.defs <<\EOF +s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g +s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g +s%\[%\\&%g +s%\]%\\&%g +s%\$%$$%g +EOF +DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` +rm -f conftest.defs + + +# Without the "./", some shells look in PATH for config.status. +: ${CONFIG_STATUS=./config.status} + +echo creating $CONFIG_STATUS +rm -f $CONFIG_STATUS +cat > $CONFIG_STATUS </dev/null | sed 1q`: +# +# $0 $ac_configure_args +# +# Compiler output produced by configure, useful for debugging +# configure, is in ./config.log if it exists. + +ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" +for ac_option +do + case "\$ac_option" in + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" + exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; + -version | --version | --versio | --versi | --vers | --ver | --ve | --v) + echo "$CONFIG_STATUS generated by autoconf version 2.13" + exit 0 ;; + -help | --help | --hel | --he | --h) + echo "\$ac_cs_usage"; exit 0 ;; + *) echo "\$ac_cs_usage"; exit 1 ;; + esac +done + +ac_given_srcdir=$srcdir + +trap 'rm -fr `echo "Makefile src/Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +EOF +cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF +$ac_vpsub +$extrasub +s%@SHELL@%$SHELL%g +s%@CFLAGS@%$CFLAGS%g +s%@CPPFLAGS@%$CPPFLAGS%g +s%@CXXFLAGS@%$CXXFLAGS%g +s%@FFLAGS@%$FFLAGS%g +s%@DEFS@%$DEFS%g +s%@LDFLAGS@%$LDFLAGS%g +s%@LIBS@%$LIBS%g +s%@exec_prefix@%$exec_prefix%g +s%@prefix@%$prefix%g +s%@program_transform_name@%$program_transform_name%g +s%@bindir@%$bindir%g +s%@sbindir@%$sbindir%g +s%@libexecdir@%$libexecdir%g +s%@datadir@%$datadir%g +s%@sysconfdir@%$sysconfdir%g +s%@sharedstatedir@%$sharedstatedir%g +s%@localstatedir@%$localstatedir%g +s%@libdir@%$libdir%g +s%@includedir@%$includedir%g +s%@oldincludedir@%$oldincludedir%g +s%@infodir@%$infodir%g +s%@mandir@%$mandir%g +s%@CC@%$CC%g +s%@SET_MAKE@%$SET_MAKE%g +s%@CPP@%$CPP%g +s%@X_CFLAGS@%$X_CFLAGS%g +s%@X_PRE_LIBS@%$X_PRE_LIBS%g +s%@X_LIBS@%$X_LIBS%g +s%@X_EXTRA_LIBS@%$X_EXTRA_LIBS%g +s%@XCFLAGS@%$XCFLAGS%g +s%@XLFLAGS@%$XLFLAGS%g +s%@XLIBS@%$XLIBS%g +s%@X_LIBRARY_PATH@%$X_LIBRARY_PATH%g + +CEOF +EOF + +cat >> $CONFIG_STATUS <<\EOF + +# Split the substitutions into bite-sized pieces for seds with +# small command number limits, like on Digital OSF/1 and HP-UX. +ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. +ac_file=1 # Number of current file. +ac_beg=1 # First line for current file. +ac_end=$ac_max_sed_cmds # Line after last line for current file. +ac_more_lines=: +ac_sed_cmds="" +while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file + else + sed "${ac_end}q" conftest.subs > conftest.s$ac_file + fi + if test ! -s conftest.s$ac_file; then + ac_more_lines=false + rm -f conftest.s$ac_file + else + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f conftest.s$ac_file" + else + ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" + fi + ac_file=`expr $ac_file + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_cmds` + fi +done +if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat +fi +EOF + +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF +for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. + + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + # The file is in a subdirectory. + test ! -d "$ac_dir" && mkdir "$ac_dir" + ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" + # A "../" for each directory in $ac_dir_suffix. + ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` + else + ac_dir_suffix= ac_dots= + fi + + case "$ac_given_srcdir" in + .) srcdir=. + if test -z "$ac_dots"; then top_srcdir=. + else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; + /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; + *) # Relative path. + srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" + top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + + + echo creating "$ac_file" + rm -f "$ac_file" + configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." + case "$ac_file" in + *Makefile*) ac_comsub="1i\\ +# $configure_input" ;; + *) ac_comsub= ;; + esac + + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` + sed -e "$ac_comsub +s%@configure_input@%$configure_input%g +s%@srcdir@%$srcdir%g +s%@top_srcdir@%$top_srcdir%g +" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file +fi; done +rm -f conftest.s* + +EOF +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF + +exit 0 +EOF +chmod +x $CONFIG_STATUS +rm -fr confdefs* $ac_clean_files +test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 + diff --git a/wmail/configure.in b/wmail/configure.in new file mode 100644 index 0000000..454919a --- /dev/null +++ b/wmail/configure.in @@ -0,0 +1,66 @@ +dnl Process this file with autoconf to produce a configure script. +AC_INIT(src/wmail.c) + +dnl Checks for programs. +AC_PROG_CC +AC_PROG_MAKE_SET + +dnl Checks for header files. +#AC_PATH_X +AC_HEADER_DIRENT +AC_HEADER_STDC +AC_CHECK_HEADERS(limits.h sys/time.h) + +dnl Checks for X installation root directory. +AC_PATH_XTRA +X_LIBRARY_PATH="$x_libraries" +XLIBS="-lX11 $X_EXTRA_LIBS" +XCFLAGS="$X_CFLAGS" +XLFLAGS="$X_LIBS" + +if test -n "$includedir"; then + XCFLAGS="$XCFLAGS -I$includedir" +fi + +if test -n "$libdir"; then + XLIBS="$XLIBS -L$libdir" +fi + +CPPFLAGS_old="$CPPFLAGS" +CPPFLAGS="$CPPFLAGS $XCFLAGS" +AC_CHECK_HEADER(dockapp.h,,) +CPPFLAGS="$CPPFLAGS_old" + +AC_SUBST(XCFLAGS) +AC_SUBST(XLFLAGS) +AC_SUBST(XLIBS) +AC_SUBST(X_LIBRARY_PATH) + +dnl Checks for typedefs, structures, and compiler characteristics. +AC_C_CONST + +dnl Checks for library functions. +AC_FUNC_FNMATCH +AC_FUNC_UTIME_NULL +AC_FUNC_VPRINTF +AC_CHECK_FUNCS(strdup strstr memcpy) + +dnl Checks for libraries. +AC_CHECK_LIB(X11, XCreateGC,,,$XLFLAGS $XLIBS) +AC_CHECK_LIB(dockapp, DAInitialize,,,$XLFLAGS $XLIBS) + +dnl Enable Debugging? +AC_ARG_ENABLE(debug, + [ --enable-debug enable debugging ],, enable_debug=no) +if test "$enable_debug" = yes; then + CFLAGS="-Wall -g -DDEBUG" +fi + +dnl Use delt's pixmaps instead of the default ones? +AC_ARG_ENABLE(delt_xpms, + [ --enable-delt-xpms enable delt's pixmaps ],, enable_delt_xpms=no) +if test "$enable_delt_xpms" = yes; then + CFLAGS="$CFLAGS -DUSE_DELT_XPMS" +fi + +AC_OUTPUT(Makefile src/Makefile) diff --git a/wmail/src/Makefile.in b/wmail/src/Makefile.in new file mode 100644 index 0000000..1901884 --- /dev/null +++ b/wmail/src/Makefile.in @@ -0,0 +1,25 @@ +# process this file with configure to create a Makefile from it +# +# Makefile for wmail. +# Makes the wmail dockapp binary and cleans the directory, respectively. + +LIBS = @LIBS@ @XLFLAGS@ @XLIBS@ +CC = @CC@ +CFLAGS = @CFLAGS@ @XCFLAGS@ + +default all target: wmail + +wmail: wmail.o common.o config.o + $(CC) $(CFLAGS) $(LIBS) -o $@ $^ + +wmail.o: wmail.c common.h config.h xpm/main.xpm xpm/symbols.xpm xpm/numbers.xpm xpm/button.xpm xpm/chars.xpm + $(CC) $(CFLAGS) -o $@ -c $< + +common.o: common.c common.h + $(CC) $(CFLAGS) -o $@ -c $< + +config.o: config.c config.h common.h + $(CC) $(CFLAGS) -o $@ -c $< + +clean: + rm -f wmail core *.o *~ diff --git a/wmail/src/common.c b/wmail/src/common.c new file mode 100644 index 0000000..4f564ae --- /dev/null +++ b/wmail/src/common.c @@ -0,0 +1,88 @@ +/////////////////////////////////////////////////////////////////////////////// +// common.c +// common defines and typedefs, part of wmail +// +// Copyright 2000~2002, Sven Geisenhainer . +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions, and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions, and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. The name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +#include +#include +#include +#include +#include "common.h" + + +#if defined(DEBUG) || defined(DEBUG2) || defined(_DEBUG) +void TRACE( const char *fmt, ... ) +{ + va_list args; + va_start( args, fmt ); + vfprintf( stderr, fmt, args ); + fflush( stderr ); + va_end( args ); +} +#endif + +void ABORT( const char *fmt, ... ) +{ + va_list args; + va_start( args, fmt ); + fprintf( stderr, "wmail error: " ); + vfprintf( stderr, fmt, args ); + fflush( stderr ); + va_end( args ); + + exit( 1 ); +} + +void WARNING( const char *fmt, ... ) +{ + va_list args; + va_start( args, fmt ); + fprintf( stderr, "wmail warning: " ); + vfprintf( stderr, fmt, args ); + fflush( stderr ); + va_end( args ); +} + +char *MakePathName( const char *dir, const char *file ) +{ + char *fullName; + int len1 = strlen( dir ); + int len2 = strlen( file ); + + if( dir[len1-1] != '/' ) + fullName = malloc( len1 + len2 + 2 ); + else + fullName = malloc( len1 + len2 + 1 ); + + memcpy( fullName, dir, len1 ); + if( dir[len1-1] != '/' ) + fullName[len1++] = '/'; + memcpy( fullName + len1, file, len2 + 1 ); + + return fullName; +} diff --git a/wmail/src/common.h b/wmail/src/common.h new file mode 100644 index 0000000..7074365 --- /dev/null +++ b/wmail/src/common.h @@ -0,0 +1,93 @@ +/////////////////////////////////////////////////////////////////////////////// +// common.h +// common defines and typedefs, part of wmail +// +// Copyright 2000~2002, Sven Geisenhainer . +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions, and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions, and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. The name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +#ifndef _COMMON_H_fdda99de15ce3f21ce7faf607a5b4985_ +#define _COMMON_H_fdda99de15ce3f21ce7faf607a5b4985_ + + +/////////////////////////////////////////////////////////////////////////////// +// defines + +// X display to open +#define WMAIL_DISPLAY "" + +// ticker scroll frame rate per seconds +#define WMAIL_FPS 60 + +// default mail check interval in seconds +#define WMAIL_CHECK_INTERVAL 1 + +// default client-button command +#define WMAIL_CLIENT_CMD "xterm -e mail" + +// filename of the checksum-file +#define WMAIL_CHECKSUM_FILE ".wmail-cksums" + +// filename of the config-file +#define WMAIL_RC_FILE ".wmailrc" + +#define WMAIL_NAME "wmail" +#define WMAIL_VERSION "wmail v2.0 (C) 2000~2002 Sven Geisenhainer " + +#define WMAIL_READSTATUS "O" + +/////////////////////////////////////////////////////////////////////////////// +// typedefs + +#if !defined(__cplusplus) && !defined(c_plusplus) +typedef enum { + false = 0, + true = 1 +} bool; +#endif + + +/////////////////////////////////////////////////////////////////////////////// +// prototypes + +void ABORT( const char *fmt, ... ); +void WARNING( const char *fmt, ... ); +char *MakePathName( const char *dir, const char *file ); + +#if defined(DEBUG) || defined(DEBUG2) || defined(_DEBUG) + +void TRACE( const char *fmt, ... ); +#define ASSERT( EXPR ) ((void)(EXPR ? 0 : ABORT( "%s(%i): Assertion failed: \"%s\"\n", __FILE__, __LINE__, #EXPR ))) +#define VERIFY( EXPR ) ASSERT( EXPR ) + +#else + +#define TRACE 0 && // hopefully rejected by the optimizing compiler (as gcc does...) +#define ASSERT(EXPR) ((void)0) +#define VERIFY(EXPR) (EXPR) + +#endif + +#endif diff --git a/wmail/src/config.c b/wmail/src/config.c new file mode 100644 index 0000000..b73d29f --- /dev/null +++ b/wmail/src/config.c @@ -0,0 +1,502 @@ +/////////////////////////////////////////////////////////////////////////////// +// config.c +// configuration file parser, part of wmail +// +// Copyright 2000~2002, Sven Geisenhainer . +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions, and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions, and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. The name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +#include +#include +#include +#include +#include "common.h" +#include "config.h" + + +/////////////////////////////////////////////////////////////////////////////// +// wmailrc file format +// +// # - comment-lines +// Window.Display = "string" +// Window.NonShaped = On|Off +// Window.Button.Command = "string" +// Mail.MailBox = "string" +// Mail.ChecksumFile = "string" +// Mail.CheckIntervall = number +// Mail.ShowOnlyNew = On|Off +// Mail.SkipSender = "string" +// Mail.OnNew.Command = "string" +// Mail.UseStatusField = On|Off +// Ticker.Mode = Address|NickName|FamilyName +// Ticker.Frames = number +// Ticker.BoldFont = On|Off +// Ticker.X11Font = "string" +// Colors.Symbols = "string" +// Colors.Font = "string" +// Colors.Backlight = "string" +// Colors.OffLight = "string" +// Colors.NonShapedFrame = "string" + + + +/////////////////////////////////////////////////////////////////////////////// +// typedefs + + +// list of enum-identifiers and their associated values +typedef struct { char *id; int value; } enumList_t; + + + +/////////////////////////////////////////////////////////////////////////////// +// local prototypes + + +bool ReadString( const char *from, unsigned int line, char **to ); +bool ReadEnum( const char *from, unsigned int line, int *to, const enumList_t *enumList ); +bool ReadBool( const char *from, unsigned int line, bool *to ); +bool ReadInt( const char *from, unsigned int line, int *to ); +bool IsWhiteSpace( const char *chr ); +const char *SkipWhiteSpaces( const char *str ); + +// current configuration +config_t config = { + NULL, + NULL, // use $MAIL environment-variable + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + WMAIL_CHECK_INTERVAL, + WMAIL_FPS, + false, + false, + TICKER_ADDRESS, + NULL, + NULL, + false, + NULL, + 0, + 0 +}; + +// enumeration names for ticker mode +enumList_t tickerEnum[] = +{ + { "address", TICKER_ADDRESS }, + { "familyname", TICKER_FAMILYNAME }, + { "nickname", TICKER_NICKNAME }, + { NULL, 0 } +}; + +bool Tokenize( const char *line, const char **id, const char **value ) +{ + int len; + const char *token1, *token2; + + if( line != NULL ) + { + token1 = SkipWhiteSpaces( line ); + + if(( len = strlen( token1 )) != 0 && token1[0] != '#' ) + { + token2 = strchr( token1, '=' ); + if( token2 != NULL ) + token2 = SkipWhiteSpaces( token2+1 ); + + if( !IsWhiteSpace( token2 )) + { + *id = token1; + *value = token2; + + return true; + } + } + } + + return false; +} + +void AddSenderToSkipList( char *sender ) +{ + int numNames, i; + char **skipName, **newList; + + for( skipName = config.skipNames, numNames = 0; + skipName != NULL && *skipName != NULL; skipName++ ) + { + if( !strcmp( *skipName, sender )) + return; + + numNames++; + } + + TRACE( "adding \"%s\" to skip-list of currently %d names\n", sender, numNames ); + newList = malloc( sizeof(char *) * (numNames + 2) ); + + for( i = 0; i < numNames; ++i ) + newList[i] = config.skipNames[i]; + + newList[i] = strdup( sender ); + newList[i+1] = NULL; + free( config.skipNames ); + config.skipNames = newList; +} + +void ResetConfigStrings() +{ + if( !( config.givenOptions & CL_MAILBOX )) { + free( config.mailBox ); + config.mailBox = NULL; + } + + if( !( config.givenOptions & CL_RUNCMD )) { + free( config.runCmd ); + config.runCmd = NULL; + } + + if( !( config.givenOptions & CL_SYMBOLCOLOR )) { + free( config.symbolColor ); + config.symbolColor = NULL; + } + + if( !( config.givenOptions & CL_FONTCOLOR )) { + free( config.fontColor ); + config.fontColor = NULL; + } + + if( !( config.givenOptions & CL_BACKCOLOR )) { + free( config.backColor ); + config.backColor = NULL; + } + + if( !( config.givenOptions & CL_OFFLIGHTCOLOR )) { + free( config.offlightColor ); + config.offlightColor = NULL; + } + + if( !( config.givenOptions & CL_BACKGROUNDCOLOR )) { + free( config.backgroundColor ); + config.backgroundColor = NULL; + } + + if( !( config.givenOptions & CL_CHECKSUMFILENAME )) { + free( config.checksumFileName ); + config.checksumFileName = NULL; + } + + if( !( config.givenOptions & CL_CMDONMAIL )) { + free( config.cmdOnMail ); + config.cmdOnMail = NULL; + } + + if( !( config.givenOptions & CL_USEX11FONT )) { + free( config.useX11Font ); + config.useX11Font = NULL; + } +} + +void PostProcessConfiguration() +{ + if( config.display == NULL ) + config.display = strdup( WMAIL_DISPLAY ); + + if( config.runCmd == NULL ) + config.runCmd = strdup( WMAIL_CLIENT_CMD ); + + if( config.mailBox == NULL ) + { + char *envMBox = getenv( "MAIL" ); + if( envMBox != NULL ) + config.mailBox = strdup( envMBox ); + } +} + +void ReadConfigFile( bool resetConfigStrings ) +{ + char *usersHome; + + // free all config strings and reset their pointers if required + if( resetConfigStrings ) + ResetConfigStrings(); + + if(( usersHome = getenv( "HOME" )) != NULL ) + { + char *fileName = MakePathName( usersHome, WMAIL_RC_FILE ); + FILE *f = fopen( fileName, "rt" ); + + if( f != NULL ) + { + char buf[1024]; + int line = 1; + + for( ; !feof( f ); ++line ) + { + const char *id, *value; + unsigned int len; + + if( fgets( buf, 1024, f ) == NULL ) + break; + + // first eliminate the trailing whitespaces + for( len = strlen( buf ); + len > 0 && IsWhiteSpace(buf+(--len)); ) + *(buf+len) = '\0'; + + if( !Tokenize( buf, &id, &value )) + continue; + + if( !strncasecmp( id, "Window.Display", 14 )) { + if( !( config.givenOptions & CL_DISPLAY )) + ReadString( value, line, &config.display ); + } else if( !strncasecmp( id, "Window.NonShaped", 16 )) { + if( !( config.givenOptions & CL_NOSHAPE )) + ReadBool( value, line, &config.noshape ); + } else if( !strncasecmp( id, "Window.Button.Command", 21 )) { + if( !( config.givenOptions & CL_RUNCMD )) + ReadString( value, line, &config.runCmd ); + } else if( !strncasecmp( id, "Mail.MailBox", 12 )) { + if( !( config.givenOptions & CL_MAILBOX )) + ReadString( value, line, &config.mailBox ); + } else if( !strncasecmp( id, "Mail.ChecksumFile", 17 )) // no corresponding cmdline option + ReadString( value, line, &config.checksumFileName ); + else if( !strncasecmp( id, "Mail.CheckIntervall", 19 )) { + if( !( config.givenOptions & CL_CHECKINTERVAL )) + ReadInt( value, line, &config.checkInterval ); + } else if( !strncasecmp( id, "Mail.ShowOnlyNew", 16 )) { + if( !( config.givenOptions & CL_NEWMAILONLY )) + ReadBool( value, line, &config.newMailsOnly ); + } else if( !strncasecmp( id, "Ticker.Mode", 11 )) { + if( !( config.givenOptions & CL_TICKERMODE )) + ReadEnum( value, line, (int *)&config.tickerMode, tickerEnum ); + } else if( !strncasecmp( id, "Ticker.Frames", 13 )) { + if( !( config.givenOptions & CL_FPS )) + ReadInt( value, line, &config.fps ); + } else if( !strncasecmp( id, "Colors.Symbols", 14 )) { + if( !( config.givenOptions & CL_SYMBOLCOLOR )) + ReadString( value, line, &config.symbolColor ); + } else if( !strncasecmp( id, "Colors.Font", 11 )) { + if( !( config.givenOptions & CL_FONTCOLOR )) + ReadString( value, line, &config.fontColor ); + } else if( !strncasecmp( id, "Colors.Backlight", 16 )) { + if( !( config.givenOptions & CL_BACKCOLOR )) + ReadString( value, line, &config.backColor ); + } else if( !strncasecmp( id, "Colors.OffLight", 15 )) { + if( !( config.givenOptions & CL_OFFLIGHTCOLOR )) + ReadString( value, line, &config.offlightColor ); + } else if( !strncasecmp( id, "Colors.NonShapedFrame", 21 )) { + if( !( config.givenOptions & CL_NOSHAPE )) + ReadString( value, line, &config.backgroundColor ); + } else if( !strncasecmp( id, "Ticker.X11Font", 14 )) { + if( !( config.givenOptions & CL_USEX11FONT )) + ReadString( value, line, &config.useX11Font ); + } else if( !strncasecmp( id, "Mail.SkipSender", 15 )) { // no corresponding cmdline options + char *skip; + if( ReadString( value, line, &skip )) + AddSenderToSkipList( skip ); + } else if( !strncasecmp( id, "Mail.OnNew.Command", 18 )) { + if( !( config.givenOptions & CL_CMDONMAIL )) + ReadString( value, line, &config.cmdOnMail ); + } else if( !strncasecmp( id, "Mail.UseStatusField", 19 )) { + if( !( config.givenOptions & CL_CONSIDERSTATUSFIELD )) + ReadBool( value, line, &config.considerStatusField ); + } else if( !strncasecmp( id, "Mail.ReadStatus", 15 )) { + if( !( config.givenOptions & CL_READSTATUS )) + ReadString( value, line, &config.readStatus ); + } else + WARNING( "cfg-file(%i): unrecognized: \"%s\"\n", line, buf ); + } + + fclose( f ); + } else { + TRACE( "unable to open config-file \"%s\"\n", fileName ); + } + } else { + TRACE( "no $HOME defined - config-file not read\n" ); + } + + PostProcessConfiguration(); +} + +bool ReadString( const char *from, unsigned int line, char **to ) +{ + if( *from++ == '"' ) { + const char *trailingQuote; + + for( trailingQuote = strchr( from, '"' ); + trailingQuote != NULL; + trailingQuote = strchr( trailingQuote, '"' )) + { + if( *(trailingQuote-1) != '\\' ) + break; + + ++trailingQuote; + } + + if( trailingQuote != NULL ) { + // valid string found, copy and translate escape sequences + const char *c; + char *to_c; + + // disposing of "to" is up to the caller... + *to = malloc( trailingQuote - from + 1 ); + to_c = *to; + + for( c = from; c != trailingQuote; ++c ) { + if( *c == '\\' ) { + switch( *(++c) ) { + case 'n': *to_c = '\n'; break; + case 'b': *to_c = '\b'; break; + case '\\': *to_c = '\\'; break; + case 'r': *to_c = '\r'; break; + case 't': *to_c = '\t'; break; + case '"': *to_c = '"'; break; + default: { + int value, i; + for( i = 0, value = 0; i < 3; ++i ) { + if( c+i == NULL || *(c+i) < '0' || *(c+i) > '9' ) + break; + value = value * 10 + *(c+i) - '0'; + } + if( value == 0 ) + WARNING( "cfg-file(%i): '\\0' in string or unknown escape sequence found\n", line ); + else { + *to_c = (char)value; + c += i-1; + } + } + } + } else + *to_c = *c; + + ++to_c; + } + + *to_c = '\0'; + TRACE( "ReadString read \"%s\"\n", *to ); + + return true; + } + } + + WARNING( "cfg-file(%i): invalid string\n" ); + return false; +} + +bool ReadBool( const char *from, unsigned int line, bool *to ) +{ + if( !strcasecmp( from, "on" ) || !strcasecmp( from, "yes" ) || !strcasecmp( from, "true" )) + *to = true; + else if( !strcasecmp( from, "off" ) || !strcasecmp( from, "no" ) || !strcasecmp( from, "false" )) + *to = false; + else { + WARNING( "cfg-file(%i): invalid boolean value: \"%s\"\n", line, from ); + return false; + } + + TRACE( "ReadBool read \"%s\"\n", *to ? "True" : "False" ); + + return true; +} + +bool ReadInt( const char *from, unsigned int line, int *to ) +{ + int value = 0; + + if( *from == '0' && (*(from+1) == 'x' || *(from+1) == 'X') ) { + for( from += 2; *from != '\0' && !IsWhiteSpace( from ); ++from ) + { + if( value > (INT_MAX - 0xf) / 0x10 ) { + WARNING( "cfg-file(%i): hexadecimal-number too large: \">%x\"\n", line, INT_MAX ); + return false; + } + + if( *from >= '0' && *from <= '9') + value = value * 16 + *from - '0'; + else if( *from >= 'a' && *from >= 'f' ) + value = value * 16 + *from - 'a' + 10; + else if( *from >= 'A' && *from >= 'F' ) + value = value * 16 + *from - 'A' + 10; + else { + WARNING( "cfg-file(%i): invalid hex-digit: \"%c\"\n", line, *from ); + return false; + } + } + } else for( ; *from != '\0' && !IsWhiteSpace( from ); ++from ) { + if( value > (INT_MAX - 9) / 10 ) { + WARNING( "cfg-file(%i): decimal-number too large: \">%i\"\n", line, INT_MAX ); + return false; + } + if( *from >= '0' && *from <= '9' ) + value = value * 10 + *from - '0'; + else { + WARNING( "cfg-file(%i): invalid decimal-digit: \"%c\"\n", line, *from ); + return false; + } + } + + *to = value; + + TRACE( "ReadInt read \"%i\"\n", *to ); + + return true; +} + +bool ReadEnum( const char *from, unsigned int line, int *to, const enumList_t *enumList ) +{ + int index; + + for( index = 0; enumList[index].id != NULL; ++index ) + if( !strcasecmp( enumList[index].id, from )) { + *to = enumList[index].value; + + TRACE( "ReadEnum read \"%i\"\n", *to ); + + return true; + } + + WARNING( "cfg-file(%i): unknown modifier: \"%s\"\n", line, from ); + + return false; +} + +bool IsWhiteSpace( const char *chr ) +{ + return ( chr != NULL && ( *chr == ' ' || *chr == '\t' || *chr == '\n' )) ? true : false; +} + +const char *SkipWhiteSpaces( const char *str ) +{ + const char *c; + + for( c = str; IsWhiteSpace( c ); ++c ) + ; + + return c; +} diff --git a/wmail/src/config.h b/wmail/src/config.h new file mode 100644 index 0000000..ff33f91 --- /dev/null +++ b/wmail/src/config.h @@ -0,0 +1,104 @@ +/////////////////////////////////////////////////////////////////////////////// +// config.h +// configuration file parser, part of wmail +// +// Copyright 2000~2002, Sven Geisenhainer . +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions, and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions, and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. The name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +#ifndef _CONFIG_H_a6ebf0e22e2f5e21fc1657a8d9975e5c_ +#define _CONFIG_H_a6ebf0e22e2f5e21fc1657a8d9975e5c_ + +typedef enum { + TICKER_ADDRESS = 0, + TICKER_FAMILYNAME = 1, + TICKER_NICKNAME = 2 +} ticker_mode_t; + +// re-allocated color-names (to enable disposing of them on reconfiguration) +enum { + SYM_COLOR = 1<<0, + FNT_COLOR = 1<<1, + BCK_COLOR = 1<<2, + OFF_COLOR = 1<<3, + BGR_COLOR = 1<<4 +}; + +// flags to mark used cmdline options +enum { + CL_DISPLAY = 1<<0, + CL_MAILBOX = 1<<1, + CL_RUNCMD = 1<<2, + CL_SYMBOLCOLOR = 1<<3, + CL_FONTCOLOR = 1<<4, + CL_BACKCOLOR = 1<<5, + CL_OFFLIGHTCOLOR = 1<<6, + CL_BACKGROUNDCOLOR = 1<<7, + CL_CHECKSUMFILENAME = 1<<8, + CL_CHECKINTERVAL = 1<<9, + CL_FPS = 1<<10, + CL_NEWMAILONLY = 1<<11, + CL_NOSHAPE = 1<<12, + CL_TICKERMODE = 1<<13, + CL_SKIPNAMES = 1<<14, + CL_CMDONMAIL = 1<<15, + CL_CONSIDERSTATUSFIELD = 1<<16, + CL_READSTATUS = 1<<17, + CL_USEX11FONT = 1<<18 +}; + +typedef struct _config_t { + char *display; // display-name + char *mailBox; // mailbox-name + char *runCmd; // command to run when the run-btn was pressed + char *symbolColor; // colorname of the upper-symbols while they are active + char *fontColor; // colorname of the ticker- and counter-digits-font + char *backColor; // colorname of the background + char *offlightColor; // colorname of inactive symbols and counter-digits + char *backgroundColor; // colorname of the frame when in noshape-mode + char *checksumFileName; // name of the checksum-file + int checkInterval; // sesonds between mailbox-checks + int fps; // ticker-frames per second + bool newMailsOnly; // true means only ticker and count new (unread) mail + bool noshape; // true means don't use shape the dockapp + ticker_mode_t tickerMode; // ticker senders adress, family-name or nick-name + char **skipNames; // sender-names that wmail has to skip + char *cmdOnMail; // command to execute when a new mail has received + bool considerStatusField; // use the status-field of the mail-header to determine its read-status + char *readStatus; // status field content that indicates read mails ("O" for netscape, "ro" for pine etc.) + char *useX11Font; // X11 font to render the ticker (NULL -> fallback to buildin font) + // ---------------------- // + int colorsUsed; // used (malloced) color-names + int givenOptions; // bitfield flags all options specified on the cmd-line +} config_t; + + +// app configuration data (declared in config.c) +extern config_t config; + +// config manipulation functions +void ReadConfigFile( bool resetConfigStrings ); + +#endif diff --git a/wmail/src/wmail.c b/wmail/src/wmail.c new file mode 100644 index 0000000..1ef93b3 --- /dev/null +++ b/wmail/src/wmail.c @@ -0,0 +1,1362 @@ +/////////////////////////////////////////////////////////////////////////////// +// wmail.c +// email indicator tool designed as docklet for Window Maker +// main c source-file +// +// wmail version 2.0 +// +// Copyright 2000~2002, Sven Geisenhainer . +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions, and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions, and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. The name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +/////////////////////////////////////////////////////////////////////////////// +// includes + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "common.h" +#include "config.h" + +// pixmaps +#ifdef USE_DELT_XPMS +#include "xpm_delt/main.xpm" +#include "xpm_delt/symbols.xpm" +#include "xpm_delt/numbers.xpm" +#include "xpm_delt/button.xpm" +#include "xpm_delt/chars.xpm" +#else +#include "xpm/main.xpm" +#include "xpm/symbols.xpm" +#include "xpm/numbers.xpm" +#include "xpm/button.xpm" +#include "xpm/chars.xpm" +#endif + + +/////////////////////////////////////////////////////////////////////////////// +// typedefs + +typedef enum { + FLAG_INITIAL = 0, + FLAG_READ = 1 +} flag_t; + +typedef struct _name_t { + char *name; + unsigned long checksum; + flag_t flag; + bool visited; + struct _name_t *next; +} name_t; + +typedef enum { + STATE_NOMAIL, + STATE_NEWMAIL, + STATE_READMAIL +} mail_state_t; + +typedef enum { + STATE_ADDRESS, + STATE_QUOTED_ADDRESS, + STATE_FULLNAME, + STATE_QUOTED_FULLNAME, + STATE_ENCODED_FULLNAME, + STATE_COMMENT +} parse_state_t; + + +/////////////////////////////////////////////////////////////////////////////// +// data + +mail_state_t state = STATE_NOMAIL; +int numMails = 0; +bool namesChanged = false; +bool buttonPressed = false; +bool readConfigFile = false; +bool isMaildir = false; +bool forceRead = false; +bool forceRedraw = true; +time_t lastModifySeconds = 0; +time_t lastAccessSeconds = 0; +Pixmap mainPixmap; +Pixmap mainPixmap_mask; +Pixmap symbolsPixmap; +Pixmap charsPixmap; +Pixmap numbersPixmap; +Pixmap buttonPixmap; +Pixmap outPixmap; +GC tickerGC; +XFontStruct *tickerFS = NULL; +name_t *names = NULL; +name_t *curTickerName = NULL; + +static DAProgramOption options[] = { + {"-display", NULL, "display to use", DOString, False, {&config.display}}, + {"-c", "--command", "cmd to run on btn-click (\"xterm -e mail\" is default)", + DOString, False, {&config.runCmd} }, + {"-i", "--intervall", + "number of secs between mail-status updates (1 is default)", DONatural, + False, {&config.checkInterval} }, + {"-f", "--familyname", "tickers the family-name if available", DONone, + False, {NULL} }, + {"-fps", "--frames", "ticker frames per second", DONatural, + False, {&config.fps} }, + {"-s", "--shortname", "tickers the nickname (all before the '@')", DONone, + False, {NULL} }, + {"-sc", "--symbolcolor", "symbol color-name", + DOString, False, {&config.symbolColor} }, + {"-fc", "--fontcolor", "ticker-font color-name", + DOString, False, {&config.fontColor} }, + {"-bc", "--backcolor", "backlight color-name", + DOString, False, {&config.backColor} }, + {"-oc", "--offcolor", "off-light color-name", + DOString, False, {&config.offlightColor} }, + {"-bg", "--background", "frame-background for non-shaped window", + DOString, False, {&config.backgroundColor} }, + {"-ns", "--noshape", "make the dockapp non-shaped (combine with -w)", + DONone, False, {NULL} }, + {"-n", "--new", "forces wmail to show new mail exclusively", DONone, False, {NULL} }, + {"-mb", "--mailbox", "specify another mailbox ($MAIL is default)", DOString, False, {&config.mailBox} }, + {"-e", "--execute", "command to execute when receiving a new mail", DOString, False, {&config.cmdOnMail} }, + {"-sf", "--statusfield", "consider the status-field of the mail header to distinguish unread mails", DONone, False, {NULL} }, + {"-rs", "--readstatus", "status field content that your client uses to mark read mails", DOString, False, {&config.readStatus} }, + {"-fn", "--tickerfont", "use specified X11 font to draw the ticker", DOString, False, {&config.useX11Font} } +}; + + +/////////////////////////////////////////////////////////////////////////////// +// prototypes + +void PreparePixmaps( bool freeThemFirst ); +void TimerHandler( int dummy ); +void CheckMBox(); +void CheckMaildir(); +int TraverseDirectory( const char *name, bool isNewMail ); +name_t *GetMail( unsigned long checksum ); +void UpdatePixmap( bool flashMailSymbol ); +void ParseMBoxFile( struct stat *fileStat ); +void ParseMaildirFile( const char *fileName, unsigned long checksum, + struct stat *fileStat, bool isNewMail ); +char *ParseFromField( char *buf ); +bool SkipSender( char *address ); +void InsertName( char *name, unsigned long checksum, flag_t flag ); +void RemoveLastName(); +void ClearAllNames(); +void DrawTickerX11Font(); +void DrawTickerBuildinFont(); +void ButtonPressed( int button, int state, int x, int y ); +void ButtonReleased( int button, int state, int x, int y ); +char *XpmColorLine( const char *colorName, char *colorLine, bool disposeLine ); +void ReadChecksumFile(); +void WriteChecksumFile( bool writeAll ); +void UpdateChecksum( unsigned long *checksum, const char *buf ); +void RemoveChecksumFile(); +void SetMailFlags( flag_t flag ); +void MarkName( unsigned long checksum ); +void DetermineState(); +void UpdateConfiguration(); +void CleanupNames(); +char *FileNameConcat( const char *path, const char *fileName ); +bool HasTickerWork(); + + +/////////////////////////////////////////////////////////////////////////////// +// implementation + + +void SetTimer() +{ + struct itimerval timerVal; + + timerVal.it_interval.tv_sec = 0; + timerVal.it_interval.tv_usec = 1000000/config.fps; + timerVal.it_value.tv_sec = 0; + timerVal.it_value.tv_usec = 1000000/config.fps; + + setitimer( ITIMER_REAL, &timerVal, NULL ); +} + +int main( int argc, char **argv ) +{ + char *usersHome; + struct sigaction sa; + int ret; + struct stat fileStat; + XTextProperty windowName; + char *name = argv[0]; + DACallbacks callbacks = { NULL, &ButtonPressed, &ButtonReleased, + NULL, NULL, NULL, NULL }; + + // read the config file and overide the default-settings + ReadConfigFile( false ); + + if( config.checksumFileName == NULL ) { + if(( usersHome = getenv( "HOME" )) == NULL ) { + WARNING( "HOME environment-variable is not set, placing %s in current directory!\n", WMAIL_CHECKSUM_FILE ); + config.checksumFileName = WMAIL_CHECKSUM_FILE; + } else + config.checksumFileName = MakePathName( usersHome, WMAIL_CHECKSUM_FILE ); + } + + TRACE( "using checksum-file \"%s\"\n", config.checksumFileName ); + + // parse cmdline-args and overide defaults and cfg-file settings + DAParseArguments( argc, argv, options, + sizeof(options) / sizeof(DAProgramOption), + WMAIL_NAME, WMAIL_VERSION ); + + if( options[0].used ) + config.givenOptions |= CL_DISPLAY; + if( options[1].used ) + config.givenOptions |= CL_RUNCMD; + if( options[2].used ) + config.givenOptions |= CL_CHECKINTERVAL; + if( options[3].used ) { + config.givenOptions |= CL_TICKERMODE; + config.tickerMode = TICKER_FAMILYNAME; + } + if( options[4].used ) + config.givenOptions |= CL_FPS; + if( options[5].used ) { + config.givenOptions |= CL_TICKERMODE; + config.tickerMode = TICKER_NICKNAME; + } + if( options[6].used ) + config.givenOptions |= CL_SYMBOLCOLOR; + if( options[7].used ) + config.givenOptions |= CL_FONTCOLOR; + if( options[8].used ) + config.givenOptions |= CL_BACKCOLOR; + if( options[9].used ) + config.givenOptions |= CL_OFFLIGHTCOLOR; + if( options[10].used ) + config.givenOptions |= CL_BACKGROUNDCOLOR; + if( options[11].used ) { + config.givenOptions |= CL_NOSHAPE; + config.noshape = true; + } + if( options[12].used ) { + config.givenOptions |= CL_NEWMAILONLY; + config.newMailsOnly = true; + } + if( options[13].used ) + config.givenOptions |= CL_MAILBOX; + if( options[14].used ) + config.givenOptions |= CL_CMDONMAIL; + if( options[15].used ) { + config.givenOptions |= CL_CONSIDERSTATUSFIELD; + config.considerStatusField = true; + } + if( options[16].used ) + config.givenOptions |= CL_READSTATUS; + if( options[17].used ) + config.givenOptions |= CL_USEX11FONT; + + if( config.mailBox == NULL ) + ABORT( "no mailbox specified - please define at least your $MAIL environment-variable!\n" ); + else if( stat( config.mailBox, &fileStat ) == 0 ) + isMaildir = S_ISDIR( fileStat.st_mode ) != 0; + + TRACE( "mailbox is of type %s\n", isMaildir ? "maildir" : "mbox" ); + + // dockapp size hard wired - sorry... + DAInitialize( config.display, "wmail", 64, 64, argc, argv ); + + outPixmap = DAMakePixmap(); + PreparePixmaps( false ); + + DASetCallbacks( &callbacks ); + DASetTimeout( -1 ); + + sa.sa_handler = TimerHandler; + sigemptyset( &sa.sa_mask ); + sa.sa_flags = SA_RESTART; + ret = sigaction( SIGALRM, &sa, 0 ); + + if( ret ) { + perror( "wmail error: sigaction" ); + exit( 1 ); + } + + XStringListToTextProperty( &name, 1, &windowName ); + XSetWMName( DADisplay, DAWindow, &windowName ); + + UpdatePixmap( false ); + DAShow(); + SetTimer(); + + DAEventLoop(); + + return 0; +} + +void PreparePixmaps( bool freeMem ) +{ + // simple recoloring of the raw xpms befor creating Pixmaps of them + // this works as long as you don't "touch" the images... + + unsigned dummy; + XGCValues values; + + if( config.symbolColor != NULL ) { // symbol color ? + symbols_xpm[2] = XpmColorLine( config.symbolColor, symbols_xpm[2], + freeMem && ( config.colorsUsed & SYM_COLOR )); + config.colorsUsed |= SYM_COLOR; + } else { + symbols_xpm[2] = XpmColorLine( "#20B2AA", symbols_xpm[2], + freeMem && ( config.colorsUsed & SYM_COLOR )); + config.colorsUsed |= SYM_COLOR; + } + + if( config.fontColor != NULL ) { // font color ? + chars_xpm[3] = XpmColorLine( config.fontColor, chars_xpm[3], + freeMem && ( config.colorsUsed & FNT_COLOR )); + numbers_xpm[3] = XpmColorLine( config.fontColor, numbers_xpm[3], + freeMem && ( config.colorsUsed & FNT_COLOR )); + config.colorsUsed |= FNT_COLOR; + } else { + chars_xpm[3] = XpmColorLine( "#D3D3D3", chars_xpm[3], + freeMem && ( config.colorsUsed & FNT_COLOR )); + numbers_xpm[3] = XpmColorLine( "#D3D3D3", numbers_xpm[3], + freeMem && ( config.colorsUsed & FNT_COLOR )); + config.colorsUsed |= FNT_COLOR; + } + + if( config.backColor != NULL ) { // backlight color ? + main_xpm[3] = XpmColorLine( config.backColor, main_xpm[3], + freeMem && ( config.colorsUsed & BCK_COLOR )); + symbols_xpm[3] = XpmColorLine( config.backColor, symbols_xpm[3], + freeMem && ( config.colorsUsed & BCK_COLOR )); + chars_xpm[2] = XpmColorLine( config.backColor, chars_xpm[2], + freeMem && ( config.colorsUsed & BCK_COLOR )); + numbers_xpm[2] = XpmColorLine( config.backColor, numbers_xpm[2], + freeMem && ( config.colorsUsed & BCK_COLOR )); + config.colorsUsed |= BCK_COLOR; + } else { + main_xpm[3] = XpmColorLine( "#282828", main_xpm[3], + freeMem && ( config.colorsUsed & BCK_COLOR )); + symbols_xpm[3] = XpmColorLine( "#282828", symbols_xpm[3], + freeMem && ( config.colorsUsed & BCK_COLOR )); + chars_xpm[2] = XpmColorLine( "#282828", chars_xpm[2], + freeMem && ( config.colorsUsed & BCK_COLOR )); + numbers_xpm[2] = XpmColorLine( "#282828", numbers_xpm[2], + freeMem && ( config.colorsUsed & BCK_COLOR )); + config.colorsUsed |= BCK_COLOR; + } + + if( config.offlightColor != NULL ) { // off-light color ? + main_xpm[2] = XpmColorLine( config.offlightColor, main_xpm[2], + freeMem && ( config.colorsUsed & OFF_COLOR )); + numbers_xpm[4] = XpmColorLine( config.offlightColor, numbers_xpm[4], + freeMem && ( config.colorsUsed & OFF_COLOR )); + config.colorsUsed |= OFF_COLOR; + } else { + main_xpm[2] = XpmColorLine( "#000000", main_xpm[2], + freeMem && ( config.colorsUsed & OFF_COLOR )); + numbers_xpm[4] = XpmColorLine( "#000000", numbers_xpm[4], + freeMem && ( config.colorsUsed & OFF_COLOR )); + config.colorsUsed |= OFF_COLOR; + } + + if( config.backgroundColor != NULL ) { // window-frame background (only seen if nonshaped) ? + main_xpm[1] = XpmColorLine( config.backgroundColor, main_xpm[1], + freeMem && ( config.colorsUsed & BGR_COLOR )); + config.colorsUsed |= BGR_COLOR; + } + + if( freeMem ) + { + XFreePixmap( DADisplay, mainPixmap ); + XFreePixmap( DADisplay, mainPixmap_mask ); + XFreePixmap( DADisplay, symbolsPixmap ); + XFreePixmap( DADisplay, charsPixmap ); + XFreePixmap( DADisplay, numbersPixmap ); + XFreePixmap( DADisplay, buttonPixmap ); + + if( tickerGC != NULL ) + { + XFreeGC( DADisplay, tickerGC ); + tickerGC = NULL; + if( tickerFS != NULL ) { + XFreeFont( DADisplay, tickerFS ); + tickerFS = NULL; + } + } + } + + DAMakePixmapFromData( main_xpm, &mainPixmap, &mainPixmap_mask, &dummy, &dummy ); + DAMakePixmapFromData( symbols_xpm, &symbolsPixmap, NULL, &dummy, &dummy ); + DAMakePixmapFromData( chars_xpm, &charsPixmap, NULL, &dummy, &dummy ); + DAMakePixmapFromData( numbers_xpm, &numbersPixmap, NULL, &dummy, &dummy ); + DAMakePixmapFromData( button_xpm, &buttonPixmap, NULL, &dummy, &dummy ); + + if( config.useX11Font != NULL ) + { + XRectangle clipRect; + + if( config.fontColor != NULL ) + values.foreground = DAGetColor( config.fontColor ); + else + values.foreground = DAGetColor( "#D3D3D3" ); + + tickerFS = XLoadQueryFont( DADisplay, config.useX11Font ); + if( tickerFS == NULL ) + ABORT( "Cannot load font \"%s\"", config.useX11Font ); + + values.font = tickerFS->fid; + tickerGC = XCreateGC( DADisplay, DAWindow, GCForeground | GCFont, + &values ); + clipRect.x = 6; + clipRect.y = 19; + clipRect.width = 52; + clipRect.height = 23; + + XSetClipRectangles( DADisplay, tickerGC, 0, 0, &clipRect, 1, Unsorted ); + } + + if( config.noshape ) // non-shaped dockapp ? + DASetShape( None ); + else + DASetShape( mainPixmap_mask ); +} + +void MarkName( unsigned long checksum ) +{ + name_t *name; + + for( name = names; name != NULL; name = name->next ) { + if( name->checksum == checksum ) { + name->flag |= FLAG_READ; + if( config.newMailsOnly ) + numMails--; + break; + } + } +} + +void DetermineState() +{ + name_t *name; + + for( name = names; name != NULL; name = name->next ) + if(!( name->flag & FLAG_READ )) { + state = STATE_NEWMAIL; + + if( config.cmdOnMail != NULL ) { + int ret = system( config.cmdOnMail ); + + if( ret == 127 || ret == -1 ) + WARNING( "execution of command \"%s\" failed.\n", config.cmdOnMail ); + } + + break; + } +} + +void ReadChecksumFile() +{ + FILE *f = fopen( config.checksumFileName, "rb" ); + if( f != NULL ) while( !feof( f )) { + unsigned long checksum; + if( fread( &checksum, sizeof(long), 1, f ) != 1 ) + continue; + + MarkName( checksum ); + } else + return; + + fclose( f ); +} + +void WriteChecksumFile( bool writeAll ) +{ + FILE *f; + TRACE( "writing checksums:" ); + + if(( f = fopen( config.checksumFileName, "wb" )) != NULL ) { + name_t *name; + for( name = names; name != NULL; name = name->next ) { + if( writeAll || (name->flag & FLAG_READ)) { + fwrite( &name->checksum, sizeof(long), 1, f ); + TRACE( " %X", name->checksum ); + } + } + } else + return; + + TRACE( "\n" ); + + fclose( f ); +} + +void UpdateChecksum( unsigned long *checksum, const char *buf ) +{ + if( buf != NULL ) { + unsigned int i, len = strlen( buf ); + + for( i = 0; i < len; ++i ) + *checksum += buf[i] << (( i % sizeof(long) ) * 8 ); + } +} + +void RemoveChecksumFile() +{ + TRACE( "removing checksum-file\n" ); + remove( config.checksumFileName ); +} + +// dummy needed because this func is a signal-handler +void TimerHandler( int dummy ) +{ + static int checkMail = 0; + + if( readConfigFile ) { + readConfigFile = false; + UpdateConfiguration(); + checkMail = 0; + forceRead = true; + } + + if( checkMail == 0 ) + { + TRACE( "checking for new mail...\n" ); + + if( isMaildir ) + CheckMaildir(); + else + CheckMBox(); + } + + UpdatePixmap( checkMail % config.fps < config.fps/2 ); + + if( ++checkMail >= config.fps * config.checkInterval ) + checkMail = 0; +} + +void CheckMBox() +{ + struct stat fileStat; + + // error retrieving file-stats -> no/zero-size file and no new/read mails + // available + if( stat( config.mailBox, &fileStat ) == -1 || fileStat.st_size == 0 ) { + if( state != STATE_NOMAIL ) { + state = STATE_NOMAIL; + ClearAllNames(); + RemoveChecksumFile(); + forceRedraw = true; + } + } else { + // file has changed -> new mails arrived or some mails removed + if( lastModifySeconds != fileStat.st_mtime || forceRead ) { + forceRead = false; + ParseMBoxFile( &fileStat ); + stat( config.mailBox, &fileStat ); + forceRedraw = true; + // file has accessed (read) -> mark all mails as "read", because + // it cannot be decided which mails the user has read... + } else if( lastAccessSeconds != fileStat.st_atime ) { + state = STATE_READMAIL; + WriteChecksumFile( true ); + if( config.newMailsOnly ) { + numMails = 0; + SetMailFlags( FLAG_READ ); + } + forceRedraw = true; + } + + lastModifySeconds = fileStat.st_mtime; + lastAccessSeconds = fileStat.st_atime; + } +} + +void CheckMaildir() +{ + DIR *dir = NULL; + int lastState = state; + int lastMailCount = numMails; + + if( forceRead ) { + forceRead = false; + ClearAllNames(); + TRACE( "all names cleared\n" ); + } + + state = STATE_NOMAIL; + + if(( dir = opendir( config.mailBox )) != NULL ) + { + struct dirent *dirEnt = NULL; + //bool writeChecksums = false; + name_t *name; + + for( name = names; name != NULL; name = name->next ) + name->visited = false; + + while(( dirEnt = readdir( dir )) != NULL ) + { + char *fullName = FileNameConcat( config.mailBox, dirEnt->d_name ); + struct stat fileStat; + + if( !stat( fullName, &fileStat ) == 0 ) { + WARNING( "Can't stat file/path \"%s\"\n", fullName ); + free( fullName ); + continue; + } + + if( S_ISDIR( fileStat.st_mode )) + { + if( strcmp( dirEnt->d_name, "new" ) == 0 ) { + if( TraverseDirectory( fullName, true ) > 0 ) + state = STATE_NEWMAIL; + } + else if( strcmp( dirEnt->d_name, "cur" ) == 0 ) { + if( TraverseDirectory( fullName, false ) > 0 ) + if( state != STATE_NEWMAIL ) + state = STATE_READMAIL; + } + // directories ".", ".." and "tmp" discarded + } + } + closedir( dir ); + CleanupNames(); + } else + WARNING( "can't open directory \"%s\"\n", config.mailBox ); + + if( lastState != state || lastMailCount != numMails ) + forceRedraw = true; +} + +int TraverseDirectory( const char *name, bool isNewMail ) +{ + DIR *dir = NULL; + int mails = 0; + + if(( dir = opendir( name )) != NULL ) + { + struct dirent *dirEnt = NULL; + + while(( dirEnt = readdir( dir )) != NULL ) + { + char *fullName = FileNameConcat( name, dirEnt->d_name ); + struct stat fileStat; + unsigned long checksum = 0; + name_t *name; + + if( !stat( fullName, &fileStat ) == 0 ) { + WARNING( "Can't stat file/path \"%s\"\n", fullName ); + free( fullName ); + continue; + } + + if( !S_ISDIR( fileStat.st_mode )) + { + TRACE( "found email-file \"%s\"\n", fullName ); + UpdateChecksum( &checksum, dirEnt->d_name ); + + if(( name = GetMail( checksum )) == NULL ) + { + TRACE( "-> new file - parsing it\n" ); + ParseMaildirFile( fullName, checksum, &fileStat, isNewMail ); + } + else { + name->flag = isNewMail ? FLAG_INITIAL : FLAG_READ; + name->visited = true; + } + ++mails; + } + } + } + + closedir( dir ); + + return mails; +} + +char *FileNameConcat( const char *path, const char *fileName ) +{ + int len1 = strlen( path ); + int len2 = strlen( fileName ); + char *buf; + + if( path[len1-1] == '/' ) + --len1; + + buf = (char *)malloc( len1 + len2 + 2 ); + + memcpy( buf, path, len1 ); + buf[len1] = '/'; + memcpy( &buf[len1+1], fileName, len2 ); + buf[len1+len2+1] = '\0'; + + return buf; +} + +name_t *GetMail( unsigned long checksum ) +{ + name_t *name; + + for( name = names; name != NULL; name = name->next ) + if( name->checksum == checksum ) + return name; + + return NULL; +} + +void UpdatePixmap( bool flashMailSymbol ) +{ + int drawCount, i; + + if( !forceRedraw && !HasTickerWork() ) + return; + + forceRedraw = false; + + XCopyArea( DADisplay, mainPixmap, outPixmap, DAGC, + 0, 0, 64, 64, 0, 0 ); + + if( numMails > 999 ) + { + XCopyArea( DADisplay, numbersPixmap, outPixmap, DAGC, + 50, 0, 5, 9, 6, 49 ); + drawCount = 999; + } else + drawCount = numMails; + + for( i = 0; i < 3; ++i, drawCount /= 10 ) + { + XCopyArea( DADisplay, numbersPixmap, outPixmap, DAGC, + (drawCount%10)*5, 0, 5, 9, 24-i*6, 49 ); + if( drawCount <= 9 ) + break; + } + + if( buttonPressed ) + { + XCopyArea( DADisplay, buttonPixmap, outPixmap, DAGC, + 0, 0, 23, 11, 36, 48 ); + } + + switch( state ) { + case STATE_NEWMAIL: + if( flashMailSymbol ) + XCopyArea( DADisplay, symbolsPixmap, outPixmap, DAGC, + 13, 0, 37, 12, 20, 7 ); + case STATE_READMAIL: + XCopyArea( DADisplay, symbolsPixmap, outPixmap, DAGC, + 0, 0, 13, 12, 7, 7 ); + + if( config.useX11Font == NULL ) + DrawTickerBuildinFont(); + else + DrawTickerX11Font(); + default: // make compiler happy + ; + } + + DASetPixmap( outPixmap ); +} + +void ParseMBoxFile( struct stat *fileStat ) +{ + char buf[1024]; + struct utimbuf timeStruct; + int fromFound = 0; + FILE *f = fopen( config.mailBox, "rt" ); + unsigned long checksum; + + state = STATE_READMAIL; + ClearAllNames(); + + numMails = 0; + + if( f == NULL ) { + WARNING( "can't open mbox \"%s\"\n", config.mailBox ); + return; + } + + while( fgets( buf, 1024, f ) != NULL ) + { + if( strncmp( buf, "From ", 5 ) == 0 ) { + fromFound = 1; + checksum = 0; + continue; + } + + if( fromFound ) + UpdateChecksum( &checksum, buf ); + + if( fromFound && strncasecmp( buf, "from: ", 6 ) == 0 ) + { + if( SkipSender( buf+6 )) + goto NEXTMAIL; + + InsertName( ParseFromField( buf+6 ), checksum, FLAG_INITIAL ); + + ++numMails; + fromFound = 0; + checksum = 0; + } else if( config.considerStatusField && strncasecmp( buf, "status: ", 8 ) == 0 && + strstr( buf+8, config.readStatus ) == NULL ) + { + RemoveLastName(); + --numMails; + } + NEXTMAIL: + ; + } + + fclose( f ); + ReadChecksumFile(); + + DetermineState(); + + timeStruct.actime = fileStat->st_atime; + timeStruct.modtime = fileStat->st_mtime; + utime( config.mailBox, &timeStruct ); +} + +void ParseMaildirFile( const char *fileName, unsigned long checksum, + struct stat *fileStat, bool isNewMail ) +{ + char buf[1024]; + struct utimbuf timeStruct; + FILE *f = fopen( fileName, "rt" ); + + if( f == NULL ) + { + WARNING( "can't open maildir file \"%s\"\n", fileName ); + return; + } + + while( fgets( buf, 1024, f ) != NULL ) + { + if( strncasecmp( buf, "from: ", 6 ) == 0 ) + { + if( SkipSender( buf+6 )) + break; + + InsertName( ParseFromField( buf+6 ), checksum, + isNewMail ? FLAG_INITIAL : FLAG_READ ); + + //++numMails; + } + } + + fclose( f ); + + timeStruct.actime = fileStat->st_atime; + timeStruct.modtime = fileStat->st_mtime; + utime( fileName, &timeStruct ); +} + +char *ParseFromField( char *buf ) +{ + parse_state_t state = STATE_FULLNAME; + int fullNameEncoded = 0; + int saveAtCharPos = -1; + char *fullName; + char *addressName; + char *atChar = NULL; + char *c; + int maxLen = strlen( buf ) + 1; + char *comment; + + // FIXME: Uhm, those mallocs might fail... + + fullName = malloc( maxLen ); + addressName = malloc( maxLen ); + comment = malloc( maxLen ); + + memset( fullName, '\0', maxLen ); + memset( addressName, '\0', maxLen ); + memset( comment, '\0', maxLen ); + + // FIXME: Don't do that "encoded" dance. It's not intended by + // RFC2047, and it's better to just do it in the end. + // Cleaner. + + for( c = buf; *c != '\0'; ++c ) + { + switch( state ) { + case STATE_FULLNAME: + + switch( *c ) { + case '"': + state = STATE_QUOTED_FULLNAME; + continue; + case '<': + if( fullName[0] != '\0' && + fullName[ strlen( fullName ) - 1 ] == ' ' ) + fullName[ strlen( fullName ) - 1 ] = '\0'; + state = STATE_ADDRESS; + continue; + case '@': + saveAtCharPos = strlen( fullName ); + fullName[ saveAtCharPos ] = *c; + continue; + case '(': + state = STATE_COMMENT; + continue; + case '=': + if( *(c+1) == '?' ) { + ++c; + fullNameEncoded = 1; + state = STATE_ENCODED_FULLNAME; + continue; + } // else do the default action + default: + fullName[ strlen( fullName ) ] = *c; + } + continue; + + case STATE_QUOTED_FULLNAME: + + switch( *c ) { + case '\\': + fullName[ strlen( fullName ) ] = *(++c); + continue; + case '"': + state = STATE_FULLNAME; + continue; + default: + fullName[ strlen( fullName ) ] = *c; + } + continue; + + case STATE_ENCODED_FULLNAME: + + switch( *c ) { + case '?': + if( *(c+1) == '=' ) { + ++c; + state = STATE_FULLNAME; + continue; + } + default: + ; // do nothing... COMING SOON: decode at least latin1 + } + continue; + + case STATE_ADDRESS: + + switch( *c ) { + case '"': + state = STATE_QUOTED_ADDRESS; + case '>': + case '\n': + // FIXME: Shouldn't it break here? + // Since the address is finished? + continue; + case '@': + atChar = &addressName[ strlen( addressName ) ]; + *atChar = *c; + continue; + default: + addressName[ strlen( addressName ) ] = *c; + } + continue; + + case STATE_QUOTED_ADDRESS: + + switch( *c ) { + case '"': + state = STATE_ADDRESS; + continue; + case '\\': + addressName[ strlen( addressName ) ] = *(++c); + continue; + default: + addressName[ strlen( addressName ) ] = *c; + } + continue; + case STATE_COMMENT: + switch( *c ) { + case ')': + state = STATE_FULLNAME; + continue; + default: + comment[ strlen( comment ) ] = *c; + continue; + } + continue; + } + } + + if (*comment) { + //WARNING("Comment seen: %s\nIn: %s\nFullname: %s\nAddress: %s\n", comment, buf, fullName, addressName); + // Comment seen: if there's an address, append to + // fullname. If no address, copy fullname to address + // and comment to fullname. + if (*addressName) { + strcat(fullName, "("); + strcat(fullName, comment); + strcat(fullName, ")"); + } else { + strcpy(addressName, fullName); + strcpy(fullName, comment); + } + } + + //WARNING("Fullname: %s\nAddress: %s\n", fullName, addressName); + + // what name should be tickered + if( config.tickerMode == TICKER_FAMILYNAME && fullName[0] != '\0' && !fullNameEncoded ) { + free( addressName ); + return fullName; + } else { + if( state == STATE_FULLNAME ) { + strcpy( addressName, fullName ); + if( saveAtCharPos != -1 ) + atChar = &addressName[saveAtCharPos]; + } + if( config.tickerMode == TICKER_NICKNAME ) { + if( atChar != NULL ) + *atChar = '\0'; + } + free( fullName ); + return addressName; + } +} + +bool SkipSender( char *address ) +{ + char **skipName; + int len = strlen( address ); + + // remove trailing '\n' got from fgets + if( address[len-1] == '\n' ) + address[len-1] = '\0'; + + for( skipName = config.skipNames; + skipName != NULL && *skipName != NULL; skipName++ ) + { + TRACE( "comparing \"%s\" and \"%s\"\n", *skipName, address ); + + // call libc-fnmatch (wildcard-match :-) ! + if( !fnmatch( *skipName, address, 0 )) { + TRACE( "skipping sender \"%s\"\n", *skipName ); + return true; + } + } + + return false; +} + +void InsertName( char *name, unsigned long checksum, flag_t flag ) +{ + name_t *item; + + TRACE( "insertName: %X, \"%s\"\n", checksum, name ); + item = (name_t *)malloc( sizeof( name_t )); + item->name = name; /*strdup( name );*/ + item->checksum = checksum; + item->flag = flag; + item->visited = true; + item->next = names; + names = item; + + namesChanged = true; +} + +void RemoveLastName() +{ + if( names != NULL ) { + name_t *name = names; + names = names->next; + free( name ); + } +} + +void ClearAllNames() +{ + name_t *name, *nextName; + + for( name = names; name != NULL; name = nextName ) { + nextName = name->next; + + free( name->name ); + free( name ); + } + + names = NULL; + numMails = 0; + + namesChanged = true; +} + +void SetMailFlags( flag_t flag ) +{ + name_t *name; + + for( name = names; name != NULL; name = name->next ) + name->flag |= flag; +} + +void DrawTickerX11Font() +{ + // 49x21+7+20 out-drawable size + + static int insertAt; + + if( curTickerName == NULL || namesChanged ) + { + for( curTickerName = names; + curTickerName != NULL && config.newMailsOnly && ( curTickerName->flag & FLAG_READ ); + curTickerName = curTickerName->next ); + + if( curTickerName == NULL ) + return; + + namesChanged = false; + insertAt = 54; + } + + XDrawString( DADisplay, outPixmap, tickerGC, insertAt, + 41-tickerFS->max_bounds.descent, + curTickerName->name, strlen( curTickerName->name )); + + --insertAt; + + if( insertAt < -XTextWidth( tickerFS, curTickerName->name, + strlen( curTickerName->name )) + 6 ) + { + do { + curTickerName = curTickerName->next; + } while( curTickerName != NULL && config.newMailsOnly && ( curTickerName->flag & FLAG_READ )); + + if( curTickerName != NULL ) { + insertAt = 54; + } + } +} + +void DrawTickerBuildinFont() +{ + // 49x21+7+20 out-drawable size + // 14x21 font-character size + + static int insertAt; + static int takeItFrom; + + int leftSpace; + int drawTo; + unsigned char *currentChar; + + if( names == NULL ) + return; + + if( curTickerName == NULL || namesChanged ) { + + for( curTickerName = names; + curTickerName != NULL && config.newMailsOnly && ( curTickerName->flag & FLAG_READ ); + curTickerName = curTickerName->next ); + + if( curTickerName == NULL ) + return; + + insertAt = 57; + takeItFrom = 0; + namesChanged = false; + } + + leftSpace = takeItFrom % 14; + + for( currentChar = (unsigned char *)&curTickerName->name[takeItFrom/14], + drawTo = insertAt; *currentChar != '\0'; ++currentChar ) + { + + int outChar = (*currentChar < 32 || *currentChar >= 128) ? '?' : + *currentChar; + int charWidth = 57-drawTo >= 14 ? 14 - leftSpace : 57-drawTo; + + XCopyArea( DADisplay, charsPixmap, outPixmap, DAGC, + (outChar-32)*14+leftSpace, 0, charWidth, 21, drawTo, 20 ); + + leftSpace = 0; + drawTo += charWidth; + + if( drawTo > 57 ) + break; + } + + if( --insertAt < 7 ) { + insertAt = 7; + takeItFrom++; + + if( takeItFrom/14 >= strlen( curTickerName->name )) { + + do { + curTickerName = curTickerName->next; + } while( curTickerName != NULL && config.newMailsOnly && ( curTickerName->flag & FLAG_READ )); + + if( curTickerName != NULL ) { + takeItFrom = 0; + insertAt = 57; + } + } + } +} + +void ButtonPressed( int button, int state, int x, int y ) +{ + if( x >= 35 && x <= 59 && y >= 47 && y <= 59 ) { + buttonPressed = true; + forceRedraw = true; + } else + // reread the config file + readConfigFile = true; +} + +void ButtonReleased( int button, int state, int x, int y ) +{ + buttonPressed = false; + forceRedraw = true; + + if( x >= 35 && x <= 59 && y >= 47 && y <= 59 ) { + int ret = system( config.runCmd ); + + if( ret == 127 || ret == -1 ) + WARNING( "execution of command \"%s\" failed.\n", config.runCmd ); + } +} + +void GetHexColorString( const char *colorName, char *xpmLine ) +{ + XColor color; + + if( XParseColor( DADisplay, + DefaultColormap( DADisplay, DefaultScreen( DADisplay )), + colorName, &color )) + { + sprintf( xpmLine, "%02X%02X%02X", color.red>>8, color.green>>8, + color.blue>>8 ); + } else + WARNING( "unknown colorname: \"%s\"\n", colorName ); +} + +char *XpmColorLine( const char *colorName, char *colorLine, bool disposeLine ) +{ + char *newLine = strdup( colorLine ); + char *from = strrchr( newLine, '#' ); + + if( from == NULL && !strcasecmp( &colorLine[ strlen( colorLine ) - 4 ], "none" )) { + // if no # found, it should be a None-color line + free( newLine ); + newLine = malloc( 12 ); + strcpy( newLine, " \tc #" ); + newLine[11] = '\0'; + from = newLine + 4; + } + + if( disposeLine ) + free( colorLine ); + + GetHexColorString( colorName, from+1 ); + + return newLine; +} + +void UpdateConfiguration() +{ + struct stat fileStat; + + TRACE( "reading configuration file...\n" ); + + ReadConfigFile( true ); + + // if no path/name to an mbox or maildir inbox directory was given, + // use the environment + if( config.mailBox == NULL ) + config.mailBox = getenv( "MAIL" ); + + // mbox or maildir ? + if( config.mailBox != NULL && stat( config.mailBox, &fileStat ) == 0 ) + isMaildir = S_ISDIR( fileStat.st_mode ) != 0; + else + isMaildir = false; + + TRACE( "mailbox is of type %s\n", isMaildir ? "maildir" : "mbox" ); + + PreparePixmaps( true ); + + SetTimer(); +} + +void CleanupNames() +{ + name_t *name, *last = NULL, *nextName; + + numMails = 0; + + for( name = names; name != NULL; name = nextName ) + { + nextName = name->next; + + if( !name->visited ) { + if( last == NULL ) + names = name->next; + else + last->next = name->next; + + free( name ); + } else { + last = name; + + if( !config.newMailsOnly || (name->flag & FLAG_READ) == 0 ) + ++numMails; + } + } +} + +bool HasTickerWork() +{ + name_t *nextTickerName; + + if( names == NULL ) + return false; + + if( curTickerName == NULL || namesChanged ) { + + for( nextTickerName = names; + nextTickerName != NULL && ( config.newMailsOnly && ( nextTickerName->flag & FLAG_READ )); + nextTickerName = nextTickerName->next ); + + if( nextTickerName == NULL ) + return false; + } + + return true; +} diff --git a/wmail/src/xpm/button.xpm b/wmail/src/xpm/button.xpm new file mode 100644 index 0000000..d06524d --- /dev/null +++ b/wmail/src/xpm/button.xpm @@ -0,0 +1,18 @@ +/* XPM */ +static char * button_xpm[] = { +"23 11 4 1", +" c None", +". c #000000", +"+ c #A7A7A7", +"@ c #FFFFFF", +"......................+", +".+++++++++++++++++++++@", +".+++++++++++++++++++++@", +".++@++@++@++@++@++@+++@", +".+++.++.++.++.++.++.++@", +".+++++++++++++++++++++@", +".++@++@++@++@++@++@+++@", +".+++.++.++.++.++.++.++@", +".+++++++++++++++++++++@", +".+++++++++++++++++++++@", +"+@@@@@@@@@@@@@@@@@@@@@@"}; diff --git a/wmail/src/xpm/chars.xpm b/wmail/src/xpm/chars.xpm new file mode 100644 index 0000000..94cd191 --- /dev/null +++ b/wmail/src/xpm/chars.xpm @@ -0,0 +1,27 @@ +/* XPM */ +char * chars_xpm[] = { +"1330 21 3 1", +" c None", +". c #282828", +"+ c #D3D3D3", +"..................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................", +"...................+...........+...+......................+++++++.....+++++.....+.......+...............+++.............+.........+.................................................................................................+++.............+.........+++++++.....+++++++++++...........+.....+++++++++++.......+++++.....+++++++++++.....+++++++.......+++++++.............................................................................+++++++.......+++++++...........+.......+++++++++.......+++++++.....+++++++++.....+++++++++++...+++++++++++.....+++++++.....+.........+.....+++++...........+++++++...+.......+.....+.............+.........+...+.........+.....+++++++.....+++++++++.......+++++++.....+++++++++.......+++++++.....+++++++++.....+.........+...+.........+...+.........+...+.........+...+...........+.+++++++++++.....+++++...........+.............+++++...........+...........................+++...................+.....................................+.......................+++...................+...............+++.................+++...+...............+++...............................................................................................................+...................................................................................................+++...........+...........+++.........+.....+.....", +"...................+...........+...+.....................+..+.+..+....+...+.....+......+.+................+............+...........+...............................................................................................+...+...........++........+.......+.............+...........++.....+................+...................+.....+.......+.....+.......+...........................................................................+.......+.....+.......+.........+.+........+......+.....+.......+......+......+......+.............+............+.......+....+.........+.......+.................+.....+......+......+.............++.......++...++........+....+.......+....+........+.....+.......+....+........+.....+.......+........+.........+.........+...+.........+...+.........+...+.........+...+...........+...........+.....+...............+.................+..........+.+..........................+.....................+.....................................+......................+...+..................+.........................................+.................+...............................................................................................................+..................................................................................................+..............+..............+.......+.+....+.....", +"...................+...........+...+........+.....+.....+...+.+...+...+...+.....+.....+...+...............+...........+.............+.........+...+...+.........+...........................................................+.....+.....+.........+.+.......+.........+...........+...........+.+.....+...............+...................+.....+.........+...+.........+.......................................+.....................+...........+.........+...+.........+.......+...+.......+.......+...+.........+.....+.......+.....+.............+...........+.........+...+.........+.......+.................+.....+.....+.......+.............+++.....+++...+.+.......+...+.........+...+.........+...+.........+...+.........+...+.........+.......+.........+.........+...+.........+...+.........+...+.........+...+...........+...........+.....+...............+.................+.........+...+.........................+.....................+.....................................+.....................+.....+.................+.........................................+.................+...............................................................................................................+.................................................................................................+...............+...............+.....+...+...+.....", +"...................+...........+...+........+.....+.....+...+.+.......+...+....+......+...+..............+...........+...............+.........+..+..+..........+...........................................................+....+.......+.......+..+.................+..........+...........+..+.....+..............+...................+......+.........+...+.........+......................................+.......................+....................+...+.........+......+.....+......+.......+...+...............+.......+.....+.............+...........+.............+.........+.......+.................+.....+....+........+.............+.++...++.+...+..+......+...+.........+...+.........+...+.........+...+.........+...+.................+.........+.........+...+.........+...+.........+....+.......+.....+.........+...........+......+................+................+........+.....+.........................+....................+.....................................+.....................+.......................+.........................................+.................+...............................................................................................................+.................................................................................................+...............+...............+.....+....+.+......", +"...................+...........+...+......+++++++++++...+...+.+.......+++++...+.......+...+.............+...........+.................+.........+.+.+...........+...........................................................+...+.........+.....+...+.................+.........+...........+...+.....+...+++++.....+...................+.......+.........+...+.........+.........+++...........+++...........+.........................+...................+...+.....+++++.....+.......+.....+.......+...+...............+.......+.....+.............+...........+.............+.........+.......+.................+.....+...+.........+.............+..++.++..+...+...+.....+...+.........+...+.........+...+.........+...+.........+...+.................+.........+.........+...+.........+...+.........+.....+.....+.......+.......+...........+.......+.................+...............+.......+.......+.........................+.......+++++++.....+...+++++.......+++++++.......+++++...+.....+++++++.........+...........+++++++++...+...+++++.......+++.................+++...+.......+++.......+.........+++++++.......+...+++++.......+++++++.....+...+++++.......+++++...+...+...+++++.......+++++++.......+++++++.....+.........+...+.........+...+.......+.....+.........+...+.........+...+++++++++++.......+...............+...............+.....+.....+.......", +"...................+........................+.....+......+..+.+..............+.........+.+..........................+.................+..........+++............+..........................................................+....+.........+....+....+................+.........+...........+....+.....+..+.....+....+..................+.........+.......+....+........++.........+++...........+++..........+...........................+.................+....+....+....+.....+.......+.....+......+....+...............+.......+.....+.............+...........+.............+.........+.......+.................+.....+..+..........+.............+...+++...+...+....+....+...+.........+...+........+....+.........+...+........+.....+................+.........+.........+....+.......+....+.........+......+...+.........+.....+...........+........+.................+...............+........................................................+....+..+.....+.....+.......+.....+.....+..+....+.......+........+..........+........+...+..+.....+........+...................+...+......+..........+.........+...+..+......+..+.....+.....+.......+....+..+.....+.....+.....+..+....+.+.....+.....+................+.........+.........+...+.........+...+.......+......+.......+....+.........+............+.........+..............+..............+....................", +"...................+........................+.....+.......+++++++...........+...........+...........................+.................+...........+.........+++++++++...................+++++++++.........................+.....+.....+++++...+.....+...............+.........+++++.......+.....+.....+++.......+...+...+++++.........+...........+++++++.....+.......+.+.........+++...........+++.........+.........+++++++++++.........+...............+.....+...+.....+.....+++++++++.....+++++++.....+...............+.......+.....+++++.........+++++.......+.....+++++...+++++++++++.......+.................+.....+++...........+.............+....+....+...+.....+...+...+.........+...+++++++++.....+.........+...+++++++++.......+++++++.........+.........+.........+.....+.....+.....+.........+.......+.+...........+...+...........+.........+.................+...............+.........................................................+...+.+.......+...+.........+...+.......+.+...+.........+.....+++++.......+.........+...+.+.......+.......+...................+...+...+++...........+.........+...+...+.....+.+.......+...+.........+...+.+.......+...+.......+.+.....+.......+...+.................+.........+.........+...+.........+...+.......+.......+.....+.....+.........+...........+...........+.............+.............+.....................", +"...................+........................+.....+.........+.+..+.........+...........+.+..........................+.................+..........+++............+.........................................................+.....+....+....+.........+..............+...............+.....+......+...............+...+..+.....+........+..........+.......+.....+.....+..+..................................+...............................+.............+......+...+....++.....+.......+.....+......+....+...............+.......+.....+.............+...........+.........+...+.........+.......+.................+.....+..+..........+.............+.........+...+......+..+...+.........+...+.............+.........+...+..+...................+........+.........+.........+.....+.....+.....+.........+........+.............+.+...........+..........+..................+..............+.........................................................+...++........+...+.............+........++...+.........+.......+.........+.........+...++........+.......+...................+...+..+..............+.........+...+...+.....++........+...+.........+...++........+...+........++.....+.......+....+................+.........+.........+....+.......+....+.......+........+...+......+.........+..........+...........+.............................+....................", +"...................+........................+.....+.........+.+...+.......+...........+...+...+.....................+.................+.........+.+.+...........+.........................................................+.....+++++.....+.........+.............+.................+...+++++++++++.............+...+.+.......+.......+.........+.........+.....+++++...+.................................+.................................+...........+.......+...+...+.+.....+.......+.....+.......+...+...............+.......+.....+.............+...........+.........+...+.........+.......+.................+.....+...+.........+.............+.........+...+.......+.+...+.........+...+.............+.........+...+...+...................+.......+.........+.........+.....+.....+.....+.........+.......+.+.............+...........+...........+...................+.............+.................................................+++++++++...+.........+...+.............+.........+...+++++++++++.......+.........+.........+...+.........+.......+...................+...+.+...............+.........+...+...+.....+.........+...+.........+...+.........+...+.........+.....+.......+.....+++++++.........+.........+.........+.....+.....+.....+...+...+.........+.+.......+.........+.........+...........+...............................+...................", +"...................+........................+.....+.........+.+...+......+...........+.....+.+......................+.................+........+..+..+..........+........................................................+......+.........+.........+............+..................+...........+...............+...++........+......+..........+.........+.............+..................................+...............................+............+.......+...+..+..+.....+.......+.....+.......+...+...............+.......+.....+.............+...........+.........+...+.........+.......+.................+.....+....+........+.............+.........+...+........++...+.........+...+.............+.........+...+....+..................+.......+.........+.........+.....+.....+.....+....+....+......+...+............+..........+............+...................+.............+................................................+........+...+.........+...+.............+.........+...+.................+..........+.......+....+.........+.......+...................+...++................+.........+...+...+.....+.........+...+.........+...+.........+...+.........+.....+....................+........+.........+.........+.....+.....+.....+...+...+..........+........+.........+........+.............+.............................+....................", +"...................+........................+.....+.........+.+...+.....+...+++++...+.......+.......................+.................+.......+...+...+.........+.............+++.......................................+.......+.........+.........+...........+...................+...........+...............+...+.........+.....+...........+.........+.............+.........+++...........+++.........+.........+++++++++++.........+.............+.......+...+++...+.....+.......+.....+.......+...+...............+.......+.....+.............+...........+.........+...+.........+.......+.................+.....+.....+.......+.............+.........+...+.........+...+.........+...+.............+.........+...+.....+.................+.......+.........+.........+.....+.....+.....+....+....+.....+.....+...........+.........+.............+...................+.............+...............................................+.........+...+.........+...+.............+.........+...+.................+...........+++++++.....+.........+.......+...................+...+.+...............+.........+...+...+.....+.........+...+.........+...+.........+...+.........+.....+.....................+.......+.........+.........+.....+.....+.....+...+...+.........+.+.......+.........+.......+...............+.............+.............+.....................", +"............................................+.....+.........+.+...+....+....+...+...+......+.+.......................+...............+........................................+++.......................................+........+.......+..........+..........+....................+...........+...............+...+.........+.....+...........+.........+............+..........+++...........+++..........+...........................+......................+...............+.......+.....+.......+...+...............+.......+.....+.............+...........+.........+...+.........+.......+.................+.....+......+......+.............+.........+...+.........+...+.........+...+.............+.........+...+......+................+.......+.........+.........+......+...+......+...+.+...+....+.......+..........+........+..............+....................+............+...............................................+.........+...++........+...+.............+........++...+.................+..........+............+.........+.......+...................+...+..+..............+.........+...+...+.....+.........+...+.........+...++........+...+........++.....+.....................+.......+.........+........++......+...+......+...+...+........+...+......+........++......+...............+..............+..............+....................", +"..........................................+++++++++++...+...+.+...+...+.....+...+...+.....+...+.......................+.............+.........................................+++.........................+++...........+.........+.....+...........+.........+...........+.........+...........+.....+.........+...+.........+.....+...........+.........+...........+...........+++...........+++...........+.........................+.......................+...............+.......+.....+.......+...+.........+.....+.......+.....+.............+...........+.........+...+.........+.......+.........+.......+.....+.......+.....+.............+.........+...+.........+...+.........+...+.............+...+.....+...+.......+.....+.........+.......+.........+.........+.......+.+.......+...+.+...+...+.........+.........+.......+...............+.....................+...........+...............................................+.......+++...+.+.......+...+.........+...+.......+.+...+.........+.......+.........+.............+.........+.......+...................+...+...+++...........+.........+...+...+.....+.........+...+.........+...+.+.......+...+.......+.+.....+...........+.........+.......+.....+...+.......+.+.......+.+.......+...+...+.......+.....+.....+.......+.+.....+...............+...............+...............+...................", +"............................................+.....+......+..+.+..+....+.....+...+....+...+....+........................+...........+............................................+.........................+++..........+...........+...+............+........+.............+.......+............+......+.......+.....+.......+......+............+.......+...........+............................+............+.......................+.........................+..............+.......+.....+......+.....+.......+......+......+......+.............+............+.......+....+.........+.......+..........+.....+......+........+....+.............+.........+...+.........+....+.......+....+..............+...+...+....+........+.....+.......+........+..........+.......+........+.+........+.+...+.+....+.........+.........+.......+...............+.....................+...........+................................................+.....+..+...+..+.....+.....+.......+.....+.....+..+....+.......+........+..........+............+.........+.......+...................+...+......+..........+.........+.......+.....+.........+....+.......+....+..+.....+.....+.....+..+.....+............+.......+.........+...+.....+.....+..+.......+.+........+.+.+.+.......+.......+.....+.....+..+....+................+...............+...............+...................", +"...................+........................+.....+.......+++++++.....+.....+++++.....+++.....+.........................+.........+.............................................+.........................+++.........+.............+++.........+++++++++...+++++++++++.....+++++++.............+.......+++++++.......+++++++.......+.............+++++++.......+++++.............................+.............+.....................+.................+.........+++++++.......+.......+...+++++++++.......+++++++.....+++++++++.....+++++++++++.....+.............+++++++.....+.........+.....+++++.........+++++.......+.........+...+++++++++++...+.........+...+.........+.....+++++++.....+...............+++++++.....+.........+.....+++++++.........+...........+++++++.........+++.........+.....+.....+.........+.........+.......+++++++++++.....+++++.................+.......+++++...................+++++++++++...................+++++...+...+...+++++.......+++++++.......+++++...+.....+++++++.........+...........+++++++.....+.........+...+++++++++.......+.......+...+.......+++...+++++++++.....+.......+.....+.........+.....+++++++.....+...+++++.......+++++...+.....+.............+++++++...........+++.......+++++...+.......+++.........+...+.......+.........+.....+++++...+...+++++++++++.......+...............+...............+...................", +"...............................................................................................................................................................................+......................................+..........................................................................................................................................................................+...................................................................................................................................................................................................................................................................................................................+.............................................................................................................................................................................................................................................................................................................+.......+..................................+.......+.........................................................................+.......................+...............................................................................................................+......................+..............+..............+....................", +"..............................................................................................................................................................................+.......................................+.........................................................................................................................................................................+.....................................................................................................................................................................................................................................................................................................................+++.........................................................................................................................................................................................................................................................................................................+.........+.................................+.......+.........................................................................+.......................+.....................................................................................................+.........+.......................+++...........+...........+++.....................", +"...................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................+.......+...................................+.....+..........................................................................+.......................+......................................................................................................+.......+..........................................................................", +"....................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................+++++++.....................................+++++...........................................................................+.......................+.......................................................................................................+++++++...........................................................................", +".................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................."}; diff --git a/wmail/src/xpm/main.xpm b/wmail/src/xpm/main.xpm new file mode 100644 index 0000000..25ca4ed --- /dev/null +++ b/wmail/src/xpm/main.xpm @@ -0,0 +1,74 @@ +/* XPM */ +static char * main_xpm[] = { +"64 64 7 1", +" c None", +". c #000000", +"+ c #282828", +"@ c #C0C4C0", +"# c #FFFFFF", +"$ c #A7A7A7", +"* c #000000", +" ", +" ", +" ", +" ", +" ******************************************************* ", +" *++++++++++++++++++++++++++++++++++++++++++++++++++++++@ ", +" *++++++++++++++++++++++++++++++++++++++++++++++++++++++@ ", +" *++++++++++++++++++++++++++++++++.....+++++++++++++++++@ ", +" *++.............+++..+++++..+++..+++++..+++..++..++++++@ ", +" *++..+++++++++..+++..+++++..++.+++...+++.++..++..++++++@ ", +" *++...+++++++...+++...+++...+..+..+++..++.+++++..++++++@ ", +" *++.+..+++++..+.+++...+++...+.++.++++.+++.+..++..++++++@ ", +" *++.++..+++..++.+++....+....+.+..++++.+++.+..++..++++++@ ", +" *++.++...+...++.+++..+.+.+..+.+.++++..++.++..++..++++++@ ", +" *++.+..+...+..+.+++..+...+..+.+.++++..+..++..++..++++++@ ", +" *++...+++.+++...+++..++.++..++.+....+..+..+..++..++++++@ ", +" *++..+++++++++..+++..++.++..++..++++++++.++..++..++++++@ ", +" *++.............+++..+++++..+++..+++++..+++..++......++@ ", +" *++++++++++++++++++++++++++++++++.....+++++++++++++++++@ ", +" *++++++++++++++++++++++++++++++++++++++++++++++++++++++@ ", +" *++++++++++++++++++++++++++++++++++++++++++++++++++++++@ ", +" *++++++++++++++++++++++++++++++++++++++++++++++++++++++@ ", +" *++++++++++++++++++++++++++++++++++++++++++++++++++++++@ ", +" *++++++++++++++++++++++++++++++++++++++++++++++++++++++@ ", +" *++++++++++++++++++++++++++++++++++++++++++++++++++++++@ ", +" *++++++++++++++++++++++++++++++++++++++++++++++++++++++@ ", +" *++++++++++++++++++++++++++++++++++++++++++++++++++++++@ ", +" *++++++++++++++++++++++++++++++++++++++++++++++++++++++@ ", +" *++++++++++++++++++++++++++++++++++++++++++++++++++++++@ ", +" *++++++++++++++++++++++++++++++++++++++++++++++++++++++@ ", +" *++++++++++++++++++++++++++++++++++++++++++++++++++++++@ ", +" *++++++++++++++++++++++++++++++++++++++++++++++++++++++@ ", +" *++++++++++++++++++++++++++++++++++++++++++++++++++++++@ ", +" *++++++++++++++++++++++++++++++++++++++++++++++++++++++@ ", +" *++++++++++++++++++++++++++++++++++++++++++++++++++++++@ ", +" *++++++++++++++++++++++++++++++++++++++++++++++++++++++@ ", +" *++++++++++++++++++++++++++++++++++++++++++++++++++++++@ ", +" *++++++++++++++++++++++++++++++++++++++++++++++++++++++@ ", +" *++++++++++++++++++++++++++++++++++++++++++++++++++++++@ ", +" *++++++++++++++++++++++++++++++++++++++++++++++++++++++@ ", +" *++++++++++++++++++++++++++++++++++++++++++++++++++++++@ ", +" *++++++++++++++++++++++++++++++++++++++++++++++++++++++@ ", +" *++++++++++++++++++++++++++++++++++++++++++++++++++++++@ ", +" @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ ", +" ", +" ", +" ", +" *************************** ************************ ", +" *++++++++++++++++++++++++++@ *######################$@ ", +" *++++++++...+++...+++...+++@ *#$$$$$$$$$$$$$$$$$$$$$*@ ", +" *+..++++.+++.+.+++.+.+++.++@ *#$$$$$$$$$$$$$$$$$$$$$*@ ", +" *++..+++.+++.+.+++.+.+++.++@ *#$$#$$#$$#$$#$$#$$#$$$*@ ", +" *+++..++.+++.+.+++.+.+++.++@ *#$$$.$$.$$.$$.$$.$$.$$*@ ", +" *++++..++...+++...+++...+++@ *#$$$$$$$$$$$$$$$$$$$$$*@ ", +" *+++..++.+++.+.+++.+.+++.++@ *#$$#$$#$$#$$#$$#$$#$$$*@ ", +" *++..+++.+++.+.+++.+.+++.++@ *#$$$.$$.$$.$$.$$.$$.$$*@ ", +" *+..++++.+++.+.+++.+.+++.++@ *#$$$$$$$$$$$$$$$$$$$$$*@ ", +" *++++++++...+++...+++...+++@ *#$$$$$$$$$$$$$$$$$$$$$*@ ", +" *++++++++++++++++++++++++++@ *$**********************@ ", +" @@@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@ ", +" ", +" ", +" ", +" "}; diff --git a/wmail/src/xpm/numbers.xpm b/wmail/src/xpm/numbers.xpm new file mode 100644 index 0000000..3aa383c --- /dev/null +++ b/wmail/src/xpm/numbers.xpm @@ -0,0 +1,16 @@ +/* XPM */ +static char * numbers_xpm[] = { +"55 9 4 1", +" c None", +". c #282828", +"+ c #D3D3D3", +"@ c #000000", +".+++..@@@..+++..+++..@@@..+++..+++..+++..+++..+++......", +"+...+@...+@...+@...++...++...@+...@@...++...++...+++...", +"+...+@...+@...+@...++...++...@+...@@...++...++...+.++..", +"+...+@...+@...+@...++...++...@+...@@...++...++...+..++.", +".@@@..@@@..+++..+++..+++..+++..+++..@@@..+++..+++....++", +"+...+@...++...@@...+@...+@...++...+@...++...+@...+..++.", +"+...+@...++...@@...+@...+@...++...+@...++...+@...+.++..", +"+...+@...++...@@...+@...+@...++...+@...++...+@...+++...", +".+++..@@@..+++..+++..@@@..+++..+++..@@@..+++..+++......"}; diff --git a/wmail/src/xpm/symbols.xpm b/wmail/src/xpm/symbols.xpm new file mode 100644 index 0000000..47c1cda --- /dev/null +++ b/wmail/src/xpm/symbols.xpm @@ -0,0 +1,18 @@ +/* XPM */ +static char * symbols_xpm[] = { +"50 12 3 1", +" c None", +". c #20B2AA", +"+ c #282828", +"++++++++++++++++++++++++++++++.....+++++++++++++++", +".............+++..+++++..+++..+++++..+++..++..++++", +"..+++++++++..+++..+++++..++.+++...+++.++..++..++++", +"...+++++++...+++...+++...+..+..+++..++.+++++..++++", +".+..+++++..+.+++...+++...+.++.++++.+++.+..++..++++", +".++..+++..++.+++....+....+.+..++++.+++.+..++..++++", +".++...+...++.+++..+.+.+..+.+.++++..++.++..++..++++", +".+..+...+..+.+++..+...+..+.+.++++..+..++..++..++++", +"...+++.+++...+++..++.++..++.+....+..+..+..++..++++", +"..+++++++++..+++..++.++..++..++++++++.++..++..++++", +".............+++..+++++..+++..+++++..+++..++......", +"++++++++++++++++++++++++++++++.....+++++++++++++++"}; diff --git a/wmail/src/xpm_delt/button.xpm b/wmail/src/xpm_delt/button.xpm new file mode 100644 index 0000000..f73dcbb --- /dev/null +++ b/wmail/src/xpm_delt/button.xpm @@ -0,0 +1,18 @@ +/* XPM */ +static char * button_xpm[] = { +"23 11 4 1", +" c None", +". c #000000", +"+ c #A7A7A7", +"@ c #FFFFFF", +"......................+", +".+++++++++++++++++++++@", +".+++++++++++++++++++.+@", +".+...+++++++++++++++.+@", +".+.++.++++++++++++++.+@", +".+.++.++..+++...++...+@", +".+...++.+..+.++.+.++.+@", +".+.++.+..+++.++.+.++.+@", +".+.++.++...++...++...+@", +".+++++++++++++++++++++@", +"+@@@@@@@@@@@@@@@@@@@@@@"}; diff --git a/wmail/src/xpm_delt/chars.xpm b/wmail/src/xpm_delt/chars.xpm new file mode 100644 index 0000000..94cd191 --- /dev/null +++ b/wmail/src/xpm_delt/chars.xpm @@ -0,0 +1,27 @@ +/* XPM */ +char * chars_xpm[] = { +"1330 21 3 1", +" c None", +". c #282828", +"+ c #D3D3D3", +"..................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................", +"...................+...........+...+......................+++++++.....+++++.....+.......+...............+++.............+.........+.................................................................................................+++.............+.........+++++++.....+++++++++++...........+.....+++++++++++.......+++++.....+++++++++++.....+++++++.......+++++++.............................................................................+++++++.......+++++++...........+.......+++++++++.......+++++++.....+++++++++.....+++++++++++...+++++++++++.....+++++++.....+.........+.....+++++...........+++++++...+.......+.....+.............+.........+...+.........+.....+++++++.....+++++++++.......+++++++.....+++++++++.......+++++++.....+++++++++.....+.........+...+.........+...+.........+...+.........+...+...........+.+++++++++++.....+++++...........+.............+++++...........+...........................+++...................+.....................................+.......................+++...................+...............+++.................+++...+...............+++...............................................................................................................+...................................................................................................+++...........+...........+++.........+.....+.....", +"...................+...........+...+.....................+..+.+..+....+...+.....+......+.+................+............+...........+...............................................................................................+...+...........++........+.......+.............+...........++.....+................+...................+.....+.......+.....+.......+...........................................................................+.......+.....+.......+.........+.+........+......+.....+.......+......+......+......+.............+............+.......+....+.........+.......+.................+.....+......+......+.............++.......++...++........+....+.......+....+........+.....+.......+....+........+.....+.......+........+.........+.........+...+.........+...+.........+...+.........+...+...........+...........+.....+...............+.................+..........+.+..........................+.....................+.....................................+......................+...+..................+.........................................+.................+...............................................................................................................+..................................................................................................+..............+..............+.......+.+....+.....", +"...................+...........+...+........+.....+.....+...+.+...+...+...+.....+.....+...+...............+...........+.............+.........+...+...+.........+...........................................................+.....+.....+.........+.+.......+.........+...........+...........+.+.....+...............+...................+.....+.........+...+.........+.......................................+.....................+...........+.........+...+.........+.......+...+.......+.......+...+.........+.....+.......+.....+.............+...........+.........+...+.........+.......+.................+.....+.....+.......+.............+++.....+++...+.+.......+...+.........+...+.........+...+.........+...+.........+...+.........+.......+.........+.........+...+.........+...+.........+...+.........+...+...........+...........+.....+...............+.................+.........+...+.........................+.....................+.....................................+.....................+.....+.................+.........................................+.................+...............................................................................................................+.................................................................................................+...............+...............+.....+...+...+.....", +"...................+...........+...+........+.....+.....+...+.+.......+...+....+......+...+..............+...........+...............+.........+..+..+..........+...........................................................+....+.......+.......+..+.................+..........+...........+..+.....+..............+...................+......+.........+...+.........+......................................+.......................+....................+...+.........+......+.....+......+.......+...+...............+.......+.....+.............+...........+.............+.........+.......+.................+.....+....+........+.............+.++...++.+...+..+......+...+.........+...+.........+...+.........+...+.........+...+.................+.........+.........+...+.........+...+.........+....+.......+.....+.........+...........+......+................+................+........+.....+.........................+....................+.....................................+.....................+.......................+.........................................+.................+...............................................................................................................+.................................................................................................+...............+...............+.....+....+.+......", +"...................+...........+...+......+++++++++++...+...+.+.......+++++...+.......+...+.............+...........+.................+.........+.+.+...........+...........................................................+...+.........+.....+...+.................+.........+...........+...+.....+...+++++.....+...................+.......+.........+...+.........+.........+++...........+++...........+.........................+...................+...+.....+++++.....+.......+.....+.......+...+...............+.......+.....+.............+...........+.............+.........+.......+.................+.....+...+.........+.............+..++.++..+...+...+.....+...+.........+...+.........+...+.........+...+.........+...+.................+.........+.........+...+.........+...+.........+.....+.....+.......+.......+...........+.......+.................+...............+.......+.......+.........................+.......+++++++.....+...+++++.......+++++++.......+++++...+.....+++++++.........+...........+++++++++...+...+++++.......+++.................+++...+.......+++.......+.........+++++++.......+...+++++.......+++++++.....+...+++++.......+++++...+...+...+++++.......+++++++.......+++++++.....+.........+...+.........+...+.......+.....+.........+...+.........+...+++++++++++.......+...............+...............+.....+.....+.......", +"...................+........................+.....+......+..+.+..............+.........+.+..........................+.................+..........+++............+..........................................................+....+.........+....+....+................+.........+...........+....+.....+..+.....+....+..................+.........+.......+....+........++.........+++...........+++..........+...........................+.................+....+....+....+.....+.......+.....+......+....+...............+.......+.....+.............+...........+.............+.........+.......+.................+.....+..+..........+.............+...+++...+...+....+....+...+.........+...+........+....+.........+...+........+.....+................+.........+.........+....+.......+....+.........+......+...+.........+.....+...........+........+.................+...............+........................................................+....+..+.....+.....+.......+.....+.....+..+....+.......+........+..........+........+...+..+.....+........+...................+...+......+..........+.........+...+..+......+..+.....+.....+.......+....+..+.....+.....+.....+..+....+.+.....+.....+................+.........+.........+...+.........+...+.......+......+.......+....+.........+............+.........+..............+..............+....................", +"...................+........................+.....+.......+++++++...........+...........+...........................+.................+...........+.........+++++++++...................+++++++++.........................+.....+.....+++++...+.....+...............+.........+++++.......+.....+.....+++.......+...+...+++++.........+...........+++++++.....+.......+.+.........+++...........+++.........+.........+++++++++++.........+...............+.....+...+.....+.....+++++++++.....+++++++.....+...............+.......+.....+++++.........+++++.......+.....+++++...+++++++++++.......+.................+.....+++...........+.............+....+....+...+.....+...+...+.........+...+++++++++.....+.........+...+++++++++.......+++++++.........+.........+.........+.....+.....+.....+.........+.......+.+...........+...+...........+.........+.................+...............+.........................................................+...+.+.......+...+.........+...+.......+.+...+.........+.....+++++.......+.........+...+.+.......+.......+...................+...+...+++...........+.........+...+...+.....+.+.......+...+.........+...+.+.......+...+.......+.+.....+.......+...+.................+.........+.........+...+.........+...+.......+.......+.....+.....+.........+...........+...........+.............+.............+.....................", +"...................+........................+.....+.........+.+..+.........+...........+.+..........................+.................+..........+++............+.........................................................+.....+....+....+.........+..............+...............+.....+......+...............+...+..+.....+........+..........+.......+.....+.....+..+..................................+...............................+.............+......+...+....++.....+.......+.....+......+....+...............+.......+.....+.............+...........+.........+...+.........+.......+.................+.....+..+..........+.............+.........+...+......+..+...+.........+...+.............+.........+...+..+...................+........+.........+.........+.....+.....+.....+.........+........+.............+.+...........+..........+..................+..............+.........................................................+...++........+...+.............+........++...+.........+.......+.........+.........+...++........+.......+...................+...+..+..............+.........+...+...+.....++........+...+.........+...++........+...+........++.....+.......+....+................+.........+.........+....+.......+....+.......+........+...+......+.........+..........+...........+.............................+....................", +"...................+........................+.....+.........+.+...+.......+...........+...+...+.....................+.................+.........+.+.+...........+.........................................................+.....+++++.....+.........+.............+.................+...+++++++++++.............+...+.+.......+.......+.........+.........+.....+++++...+.................................+.................................+...........+.......+...+...+.+.....+.......+.....+.......+...+...............+.......+.....+.............+...........+.........+...+.........+.......+.................+.....+...+.........+.............+.........+...+.......+.+...+.........+...+.............+.........+...+...+...................+.......+.........+.........+.....+.....+.....+.........+.......+.+.............+...........+...........+...................+.............+.................................................+++++++++...+.........+...+.............+.........+...+++++++++++.......+.........+.........+...+.........+.......+...................+...+.+...............+.........+...+...+.....+.........+...+.........+...+.........+...+.........+.....+.......+.....+++++++.........+.........+.........+.....+.....+.....+...+...+.........+.+.......+.........+.........+...........+...............................+...................", +"...................+........................+.....+.........+.+...+......+...........+.....+.+......................+.................+........+..+..+..........+........................................................+......+.........+.........+............+..................+...........+...............+...++........+......+..........+.........+.............+..................................+...............................+............+.......+...+..+..+.....+.......+.....+.......+...+...............+.......+.....+.............+...........+.........+...+.........+.......+.................+.....+....+........+.............+.........+...+........++...+.........+...+.............+.........+...+....+..................+.......+.........+.........+.....+.....+.....+....+....+......+...+............+..........+............+...................+.............+................................................+........+...+.........+...+.............+.........+...+.................+..........+.......+....+.........+.......+...................+...++................+.........+...+...+.....+.........+...+.........+...+.........+...+.........+.....+....................+........+.........+.........+.....+.....+.....+...+...+..........+........+.........+........+.............+.............................+....................", +"...................+........................+.....+.........+.+...+.....+...+++++...+.......+.......................+.................+.......+...+...+.........+.............+++.......................................+.......+.........+.........+...........+...................+...........+...............+...+.........+.....+...........+.........+.............+.........+++...........+++.........+.........+++++++++++.........+.............+.......+...+++...+.....+.......+.....+.......+...+...............+.......+.....+.............+...........+.........+...+.........+.......+.................+.....+.....+.......+.............+.........+...+.........+...+.........+...+.............+.........+...+.....+.................+.......+.........+.........+.....+.....+.....+....+....+.....+.....+...........+.........+.............+...................+.............+...............................................+.........+...+.........+...+.............+.........+...+.................+...........+++++++.....+.........+.......+...................+...+.+...............+.........+...+...+.....+.........+...+.........+...+.........+...+.........+.....+.....................+.......+.........+.........+.....+.....+.....+...+...+.........+.+.......+.........+.......+...............+.............+.............+.....................", +"............................................+.....+.........+.+...+....+....+...+...+......+.+.......................+...............+........................................+++.......................................+........+.......+..........+..........+....................+...........+...............+...+.........+.....+...........+.........+............+..........+++...........+++..........+...........................+......................+...............+.......+.....+.......+...+...............+.......+.....+.............+...........+.........+...+.........+.......+.................+.....+......+......+.............+.........+...+.........+...+.........+...+.............+.........+...+......+................+.......+.........+.........+......+...+......+...+.+...+....+.......+..........+........+..............+....................+............+...............................................+.........+...++........+...+.............+........++...+.................+..........+............+.........+.......+...................+...+..+..............+.........+...+...+.....+.........+...+.........+...++........+...+........++.....+.....................+.......+.........+........++......+...+......+...+...+........+...+......+........++......+...............+..............+..............+....................", +"..........................................+++++++++++...+...+.+...+...+.....+...+...+.....+...+.......................+.............+.........................................+++.........................+++...........+.........+.....+...........+.........+...........+.........+...........+.....+.........+...+.........+.....+...........+.........+...........+...........+++...........+++...........+.........................+.......................+...............+.......+.....+.......+...+.........+.....+.......+.....+.............+...........+.........+...+.........+.......+.........+.......+.....+.......+.....+.............+.........+...+.........+...+.........+...+.............+...+.....+...+.......+.....+.........+.......+.........+.........+.......+.+.......+...+.+...+...+.........+.........+.......+...............+.....................+...........+...............................................+.......+++...+.+.......+...+.........+...+.......+.+...+.........+.......+.........+.............+.........+.......+...................+...+...+++...........+.........+...+...+.....+.........+...+.........+...+.+.......+...+.......+.+.....+...........+.........+.......+.....+...+.......+.+.......+.+.......+...+...+.......+.....+.....+.......+.+.....+...............+...............+...............+...................", +"............................................+.....+......+..+.+..+....+.....+...+....+...+....+........................+...........+............................................+.........................+++..........+...........+...+............+........+.............+.......+............+......+.......+.....+.......+......+............+.......+...........+............................+............+.......................+.........................+..............+.......+.....+......+.....+.......+......+......+......+.............+............+.......+....+.........+.......+..........+.....+......+........+....+.............+.........+...+.........+....+.......+....+..............+...+...+....+........+.....+.......+........+..........+.......+........+.+........+.+...+.+....+.........+.........+.......+...............+.....................+...........+................................................+.....+..+...+..+.....+.....+.......+.....+.....+..+....+.......+........+..........+............+.........+.......+...................+...+......+..........+.........+.......+.....+.........+....+.......+....+..+.....+.....+.....+..+.....+............+.......+.........+...+.....+.....+..+.......+.+........+.+.+.+.......+.......+.....+.....+..+....+................+...............+...............+...................", +"...................+........................+.....+.......+++++++.....+.....+++++.....+++.....+.........................+.........+.............................................+.........................+++.........+.............+++.........+++++++++...+++++++++++.....+++++++.............+.......+++++++.......+++++++.......+.............+++++++.......+++++.............................+.............+.....................+.................+.........+++++++.......+.......+...+++++++++.......+++++++.....+++++++++.....+++++++++++.....+.............+++++++.....+.........+.....+++++.........+++++.......+.........+...+++++++++++...+.........+...+.........+.....+++++++.....+...............+++++++.....+.........+.....+++++++.........+...........+++++++.........+++.........+.....+.....+.........+.........+.......+++++++++++.....+++++.................+.......+++++...................+++++++++++...................+++++...+...+...+++++.......+++++++.......+++++...+.....+++++++.........+...........+++++++.....+.........+...+++++++++.......+.......+...+.......+++...+++++++++.....+.......+.....+.........+.....+++++++.....+...+++++.......+++++...+.....+.............+++++++...........+++.......+++++...+.......+++.........+...+.......+.........+.....+++++...+...+++++++++++.......+...............+...............+...................", +"...............................................................................................................................................................................+......................................+..........................................................................................................................................................................+...................................................................................................................................................................................................................................................................................................................+.............................................................................................................................................................................................................................................................................................................+.......+..................................+.......+.........................................................................+.......................+...............................................................................................................+......................+..............+..............+....................", +"..............................................................................................................................................................................+.......................................+.........................................................................................................................................................................+.....................................................................................................................................................................................................................................................................................................................+++.........................................................................................................................................................................................................................................................................................................+.........+.................................+.......+.........................................................................+.......................+.....................................................................................................+.........+.......................+++...........+...........+++.....................", +"...................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................+.......+...................................+.....+..........................................................................+.......................+......................................................................................................+.......+..........................................................................", +"....................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................+++++++.....................................+++++...........................................................................+.......................+.......................................................................................................+++++++...........................................................................", +".................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................."}; diff --git a/wmail/src/xpm_delt/main.xpm b/wmail/src/xpm_delt/main.xpm new file mode 100644 index 0000000..ab98b32 --- /dev/null +++ b/wmail/src/xpm_delt/main.xpm @@ -0,0 +1,73 @@ +/* XPM */ +static char * main_xpm[] = { +"64 64 6 1", +" c None", +". c #000000", +"+ c #282828", +"@ c #C0C4C0", +"# c #FFFFFF", +"$ c #A7A7A7", +" ", +" ", +" ", +" ", +" ....................................................... ", +" .++++++++++++++++++++++++++++++++++++++++++++++++++++++@ ", +" .++++++++++++++++++++++++++++++++++++++++++++++++++++++@ ", +" .++++++++++++++++++++++++++++++++++++++++++++++++++++++@ ", +" .++.............+++++++++++++++++++++++++++++++++++++++@ ", +" .++..+++++++++..+++.......+++......+++....++..+++++++++@ ", +" .++...+++++++...+++..+..+..++..+++..+++..+++..+++++++++@ ", +" .++.+..+++++..+.+++..+..+..++..+++..+++..+++..+++++++++@ ", +" .++.++..+++..++.+++..+..+..++..+++..+++..+++..+++++++++@ ", +" .++.++...+...++.+++..+..+..++.......+++..+++..+++++++++@ ", +" .++.+..+...+..+.+++..++++..++..+++..+++..+++..+++++++++@ ", +" .++...+++.+++...+++..++++..++..+++..+++..+++..+++++++++@ ", +" .++..+++++++++..+++..++++..++..+++..++....++......+++++@ ", +" .++.............+++++++++++++++++++++++++++++++++++++++@ ", +" .++++++++++++++++++++++++++++++++++++++++++++++++++++++@ ", +" .++++++++++++++++++++++++++++++++++++++++++++++++++++++@ ", +" .++++++++++++++++++++++++++++++++++++++++++++++++++++++@ ", +" .++++++++++++++++++++++++++++++++++++++++++++++++++++++@ ", +" .++++++++++++++++++++++++++++++++++++++++++++++++++++++@ ", +" .++++++++++++++++++++++++++++++++++++++++++++++++++++++@ ", +" .++++++++++++++++++++++++++++++++++++++++++++++++++++++@ ", +" .++++++++++++++++++++++++++++++++++++++++++++++++++++++@ ", +" .++++++++++++++++++++++++++++++++++++++++++++++++++++++@ ", +" .++++++++++++++++++++++++++++++++++++++++++++++++++++++@ ", +" .++++++++++++++++++++++++++++++++++++++++++++++++++++++@ ", +" .++++++++++++++++++++++++++++++++++++++++++++++++++++++@ ", +" .++++++++++++++++++++++++++++++++++++++++++++++++++++++@ ", +" .++++++++++++++++++++++++++++++++++++++++++++++++++++++@ ", +" .++++++++++++++++++++++++++++++++++++++++++++++++++++++@ ", +" .++++++++++++++++++++++++++++++++++++++++++++++++++++++@ ", +" .++++++++++++++++++++++++++++++++++++++++++++++++++++++@ ", +" .++++++++++++++++++++++++++++++++++++++++++++++++++++++@ ", +" .++++++++++++++++++++++++++++++++++++++++++++++++++++++@ ", +" .++++++++++++++++++++++++++++++++++++++++++++++++++++++@ ", +" .++++++++++++++++++++++++++++++++++++++++++++++++++++++@ ", +" .++++++++++++++++++++++++++++++++++++++++++++++++++++++@ ", +" .++++++++++++++++++++++++++++++++++++++++++++++++++++++@ ", +" .++++++++++++++++++++++++++++++++++++++++++++++++++++++@ ", +" .++++++++++++++++++++++++++++++++++++++++++++++++++++++@ ", +" @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ ", +" ", +" ", +" ", +" ........................... ........................ ", +" .++++++++++++++++++++++++++@ .######################$@ ", +" .++++++++...+++...+++...+++@ .#$$$$$$$$$$$$$$$$$$$$$.@ ", +" .+..++++.+++.+.+++.+.+++.++@ .#$$$$$$$$$$$$$$$$$$$+$.@ ", +" .++..+++.+++.+.+++.+.+++.++@ .#$+++$$$$$$$$$$$$$$$+$.@ ", +" .+++..++.+++.+.+++.+.+++.++@ .#$+$$+$$$$$$$$$$$$$$+$.@ ", +" .++++..++...+++...+++...+++@ .#$+$$+$$++$$$+++$$+++$.@ ", +" .+++..++.+++.+.+++.+.+++.++@ .#$+++$$+$++$+$$+$+$$+$.@ ", +" .++..+++.+++.+.+++.+.+++.++@ .#$+$$+$++$$$+$$+$+$$+$.@ ", +" .+..++++.+++.+.+++.+.+++.++@ .#$+$$+$$+++$$+++$$+++$.@ ", +" .++++++++...+++...+++...+++@ .#$$$$$$$$$$$$$$$$$$$$$.@ ", +" .++++++++++++++++++++++++++@ .$......................@ ", +" @@@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@ ", +" ", +" ", +" ", +" "}; diff --git a/wmail/src/xpm_delt/numbers.xpm b/wmail/src/xpm_delt/numbers.xpm new file mode 100644 index 0000000..3aa383c --- /dev/null +++ b/wmail/src/xpm_delt/numbers.xpm @@ -0,0 +1,16 @@ +/* XPM */ +static char * numbers_xpm[] = { +"55 9 4 1", +" c None", +". c #282828", +"+ c #D3D3D3", +"@ c #000000", +".+++..@@@..+++..+++..@@@..+++..+++..+++..+++..+++......", +"+...+@...+@...+@...++...++...@+...@@...++...++...+++...", +"+...+@...+@...+@...++...++...@+...@@...++...++...+.++..", +"+...+@...+@...+@...++...++...@+...@@...++...++...+..++.", +".@@@..@@@..+++..+++..+++..+++..+++..@@@..+++..+++....++", +"+...+@...++...@@...+@...+@...++...+@...++...+@...+..++.", +"+...+@...++...@@...+@...+@...++...+@...++...+@...+.++..", +"+...+@...++...@@...+@...+@...++...+@...++...+@...+++...", +".+++..@@@..+++..+++..@@@..+++..+++..@@@..+++..+++......"}; diff --git a/wmail/src/xpm_delt/symbols.xpm b/wmail/src/xpm_delt/symbols.xpm new file mode 100644 index 0000000..87b1468 --- /dev/null +++ b/wmail/src/xpm_delt/symbols.xpm @@ -0,0 +1,18 @@ +/* XPM */ +static char * symbols_xpm[] = { +"51 12 3 1", +" c None", +". c #20B2AA", +"+ c #282828", +"+++++++++++++++++++++++++++++++++++++++++++++++++++", +".............++++++++++++++++++++++++++++++++++++++", +"..+++++++++..+++.......+++......+++....++..++++++++", +"...+++++++...+++..+..+..++..+++..+++..+++..++++++++", +".+..+++++..+.+++..+..+..++..+++..+++..+++..++++++++", +".++..+++..++.+++..+..+..++..+++..+++..+++..++++++++", +".++...+...++.+++..+..+..++.......+++..+++..++++++++", +".+..+...+..+.+++..++++..++..+++..+++..+++..++++++++", +"...+++.+++...+++..++++..++..+++..+++..+++..++++++++", +"..+++++++++..+++..++++..++..+++..++....++......++++", +".............++++++++++++++++++++++++++++++++++++++", +"+++++++++++++++++++++++++++++++++++++++++++++++++++"}; diff --git a/wmail/wmailrc-sample b/wmail/wmailrc-sample new file mode 100644 index 0000000..d5776d2 --- /dev/null +++ b/wmail/wmailrc-sample @@ -0,0 +1,120 @@ +#-*-shell-script-*-############################################################ +# +# .wmailrc - wmail v2.0 configuration file +# note: cmd-line options always overide the settings in this file unless you +# force runtime reconfiguration by clicking on the docklets display area +# +# Format: +# identifier '=' value +# - identifiers are not case-sensitive +# - each identifier expects a typed value to be assigned with +# - typed value means either "string", boolean-switch (yes,on,true|no,off,false), some enum or int number +# - string values must be enclosed with `"'-characters (quoting) +# - string values supportes escape-sequences like \n,\r,\b,\t and decimal numbers \XXX (except \0) +# - # comments (only at beginning of lines) + + +# specify X display to open (not re-configurable during run-time) +# string value, default: "" +# Window.Display = "localhost:0.0" + +# turn on non-shaped window-mode +# boolean value, default: No +# Window.NonShaped = Yes + +# command to execute on button-click +# string value, default: "xterm -e mail" +Window.Button.Command = "wterm -fg white -bg black -T Pine -e pine &" + +# specify your mailbox (if not, the $MAIL evironment-variable is used) +# string value, default: unset +# Mail.MailBox = "/var/spool/mail/YOUR_LOGIN" + +# what file to use to store the cksums which help identify the mails +# string value, default: "" (causes fallback to $HOME/.wmail-cksums) +# Mail.ChecksumFile = "/home/YOUR_LOGIN/.wmail-cksums" + +# enable wmail to ticker (and count) only new (unread) mails +# boolean value, default: No +Mail.ShowOnlyNew = Yes + +# mail-check interval in seconds +# integer value, default: 1 +Mail.CheckIntervall = 5 + +# setup the ticker-line: allowed values are: Address | NickName | FamilyName +# enum value, default: Address +Ticker.Mode = FamilyName + +# set the ticker-frame-rate per seconds +# integer value, default: 60 +# Ticker.Frames = 100 + +# like to use a real X11 font instead of the buildin ? +# Note the buildin font does not support all possible latin1 characters, so +# if you would like to see them you must make use of this. +# Ticker.X11Font = "-*-helvetica-medium-r-*-*-16-*-*-*-*-*-*-*" + +# command to execute when receiving new mail (for example "/usr/bin/play somefile.wav &") +# string value, default: unset +# Mail.OnNew.Command = "/usr/bin/play /hda1/win98/media/notify.wav &" + +# sender-skip-list, use this command multiple times to skip more then one sender-name +# string value, default: unset +Mail.SkipSender = "MAILER-DAEMON" + +# force wmail to display and count only those mails who have their Status-field +# not set to RO (old read mail) +# this is useful if you do not remove your mails from the mbox after reading them +# default: Off +# Mail.UseStatusField = On + +# supply the content of the status field that markes you email as read +# (The given value is substring-matched) +# default: "O" +# Mail.ReadStatus = "ro" + +# color definitions follow: note that you can specify either +# - a X color-name like "Grey", "White", "light green" etc. or +# - a rgb-value using a hex-string like "#RRGGBB" + + +# color of the upper symbols +# string value, default: "#20B2AA" +# Colors.Symbols = "yellow" + +# color of the ticker +# string value, default: "#D3D3D3" +# Colors.Font = "light grey" + +# color of the dockapps background +# string value, default: "#282828" +# Colors.Backlight = "dark slate grey" + +# color of inactive symbols +# string value, default: "black" +# Colors.OffLight = "#282828" + +# color of the outer frame (using it will force non-shaped window mode) +# string value, default: unset +# Colors.NonShapedFrame = "grey" + + +### some color schemes :) + +############################# +# wmcpuload like colors +# +# Colors.Symbols = "#131313" +# Colors.Font = "black" +# Colors.Backlight = "#6e766e" +# Colors.OffLight = "#5e665a" + +############################# +# dark blue +# +# Colors.Symbols = "Yellow" +# Colors.Font = "White" +# Colors.Backlight = "DarkBlue" +# Colors.OffLight = "Black" +