aterm-1.0.1/0000755000175000001440000000000010654145567011330 5ustar vaeusersaterm-1.0.1/doc/0000755000175000001440000000000010654145553012070 5ustar vaeusersaterm-1.0.1/doc/FAQ0000644000175000001440000002503010144447040012410 0ustar vaeusers-------------------------------------------------------------------------- FAQ (mostly inherited from rxvt distribution ) -------------------------------------------------------------------------- ----- Q: I'm experiencing "can't open pseudo-tty" errors when starting aterm. What's wrong? A: Most likely you don't have Unix98 PTY configured properly. This was a limitation in aterm versions << 0.4.1. Aterm 0.4.1 uses getpt() in GLIBC systems, so it should work in Linux systems without UNIX98_PTYS and on GNU/Hurd. Read README.Unix98PTY for additional configuration steps. ----- Q: How do I know which aterm version I'm using? A: The version number is displayed with the usage (-help), or to get just version number use -V,-version or --version Also the escape sequence `ESC[8n' sets the window title to the version number. ----- Q: How do I enable pseudotransparency mode? A: use -tr option. You can also tint background with any color, for better visual effect. To do that - use -tint option, and -tinttype to specify tinting function. Colors that looks good with fast transparency/tinting are: blue, green, red, yellow, magenta, cyan. Any color can be used with true transparency mode. Also use -sh % option to darken/lighten image. ----- Q: Mouse cut/paste suddenly no longer works. A: Make sure that mouse reporting is actually turned off since killing some editors prematurely may leave the mouse in mouse report mode. I've heard that tcsh may use mouse reporting unless it otherwise specified. A quick check is to see if cut/paste works when the Alt or Shift keys are depressed. See doc/refer.txt ----- Q: What's with this bold/blink stuff? I can never get blinking text! A: It is not possible, and likely will never be, for aterm to have actual blinking text. Instead (if aterm was compiled without NO_BOLDCOLOR), bold/blink attributes are used to set high-intensity foreground/background colors ... like what you'd see on a PC video adapter. There are programs, notably John Davis' SLang-based ones , that use bold/blink attributes to permit 16 colors. color0-7 are the low-intensity colors. color8-15 are the corresponding high-intensity colors. A side issue of this bold/blink stuff is the question of how the normal default foreground/background colors are to be treated. If the default foreground/background match one of the low-intensity colors (color0-7), the bold/blink attribute will invoke the appropriate high-intensity color (color8-15). In the case that the default foreground doesn't match one of the low-intensity colors, the bold attribute will use an `overstrike' to simulate a bold font. But note this leaves pixel-droppings and so, rather than wasting an inordinate amounts of energy to fix it, its use is simply deprecated. In the case that the default background doesn't match one of the low-intensity colors, the blink attribute is simply ignored (rather than representing it as bold as xterm does). ----- Q: I don't like the screen colors. How do I change them? A: You can change the screen colors at run-time using ~/.Xdefaults resources (or as long-options) ... see the man-page. Here are values that are supposed to resemble a VGA screen, including the murky brown that passes for low-intensity yellow: Aterm*color0: #000000 Aterm*color1: #A80000 Aterm*color2: #00A800 Aterm*color3: #A8A800 Aterm*color4: #0000A8 Aterm*color5: #A800A8 Aterm*color6: #00A8A8 Aterm*color7: #A8A8A8 Aterm*color8: #000054 Aterm*color9: #FF0054 Aterm*color10: #00FF54 Aterm*color11: #FFFF54 Aterm*color12: #0000FF Aterm*color13: #FF00FF Aterm*color14: #00FFFF Aterm*color15: #FFFFFF ----- Q: What's with the strange Backspace/Delete key behaviour? A: Assuming that the physical Backspace key corresponds to the BackSpace keysym (not likely for Linux ... see the following question) there are two standard values that can be used for Backspace: ^H and ^?. Aterm tries to inherit the current stty settings and uses the value of `erase' to guess the value for backspace. If aterm wasn't started from a terminal (say, from a menu or by remote shell), then the system value of `erase', which corresponds to CERASE in , will be used (which may not be the same as your stty setting). For starting a new aterm: use Backspace = ^H $ stty erase ^H $ aterm use Backspace = ^? $ stty erase ^? $ aterm NB: generate either value with BackSpace and Ctrl/Shift-BackSpace. Toggle with "ESC[36h" / "ESC[36l" as documented in "doc/refer.txt" For an existing aterm: use Backspace = ^H $ stty erase ^H $ echo -n "^[[36h" use Backspace = ^? $ stty erase ^? $ echo -n "^[[36l" This helps satisfy some of the Backspace discrepancies that occur, but if you use Backspace = ^?, make sure that the termcap/terminfo value properly reflects that. The Delete key (which one would expect to emit ^?) is a another casualty of the ill-defined Backspace problem. To avoid confusion between the Backspace and Delete keys, the Delete key has been assigned an escape sequence to match the vt100 for Execute (ESC[3~) and is in the supplied termcap/terminfo. Some other Backspace problems: some editors use termcap/terminfo, some editors (vim I'm told) expect Backspace = ^H, GNU Emacs (and Emacs-like editors) use ^H for help. Perhaps someday this will all be resolved in a consistent manner ... and maybe xterm will have Home/End values too! ----- Q: Why doesn't the Backspace key work on my Linux machine? A: The XFree86 server has a notorious problem of mapping the Backspace key as Delete in order to match the Linux console. The correct way to fix this: 0 - Complain to your Linux distributer and the XFree86 team, maybe they'll fix it. 1 - Use xmodmap to correct the Backspace mapping ! ~/.Xmodmap ! a correctly-mapped BackSpace keycode 22 = BackSpace *** Make sure the keycode above matches the physical Backspace key on your machine!! (use xev) *** This will also fix the BackSpace problem with Motif applications, such as ``why doesn't Backspace work for Netscape?'' You now have a Backspace key that functions as described in the previous question. 1a - You may also want to fix the regular xterm if it doesn't generates the desired value for BackSpace xterm*vt100.translations: #override \ BackSpace: string(\010) \n or xterm*vt100.translations: #override \ BackSpace: string(\177) \n while you are at it, you may also want to have consistent values to Home/End/Delete xterm*vt100.translations: #override \ Home: string("\033[7~") \n\ End: string("\033[8~") \n\ Delete: string("\033[3~") \n Finally, you can also remap the aterm key-binding at run-time (next question) but you'll lose the ability to have Ctrl/Shift-Backspace work differently as well as losing the escape sequence toggling of Backspace. ----- Q: I don't like the key-bindings. How do I change them? A: There are some compile-time selections available in "feature.h" and if you've compiled with KEYSYM_RESOURCE + FAKE_RESOURCES you can use the `keysym' resource to alter the keystrings associated with keysym 0xFF00 - 0xFFFF (function, cursor keys, etc). Here's an example for a tn3270 session started using `aterm -name tn3270' !# ----- special uses ------: ! tn3270 login, remap function and arrow keys. tn3270*font: *clean-bold-*-*--15-* ! keysym - used by aterm only ! Delete - ^D tn3270*keysym.0xFFFF: \004 ! Home - ^A tn3270*keysym.0xFF50: \001 ! Left - ^B tn3270*keysym.0xFF51: \002 ! Up - ^P tn3270*keysym.0xFF52: \020 ! Right - ^F tn3270*keysym.0xFF53: \006 ! Down - ^N tn3270*keysym.0xFF54: \016 ! End - ^E tn3270*keysym.0xFF57: \005 ! F1 - F12 tn3270*keysym.0xFFBE: \e1 tn3270*keysym.0xFFBF: \e2 tn3270*keysym.0xFFC0: \e3 tn3270*keysym.0xFFC1: \e4 tn3270*keysym.0xFFC2: \e5 tn3270*keysym.0xFFC3: \e6 tn3270*keysym.0xFFC4: \e7 tn3270*keysym.0xFFC5: \e8 tn3270*keysym.0xFFC6: \e9 tn3270*keysym.0xFFC7: \e0 tn3270*keysym.0xFFC8: \e- tn3270*keysym.0xFFC9: \e= ! map Prior/Next to F7/F8 tn3270*keysym.0xFF55: \e7 tn3270*keysym.0xFF56: \e8 ----- Q: I'm using keyboard model XXX that has extra Prior/Next/Insert keys. How do I make use of them? For example, the Sun Keyboard type 4 has the following mappings that aterm doesn't recognize. KP_Insert == Insert F22 == Print F27 == Home F29 == Prior F33 == End F35 == Next A: Rather than have aterm try to accomodate all the various possible keyboard mappings, it is better to use `xmodmap' to remap the keys as required for your particular machine. ----- Q: How do I distinguish if I'm running aterm or a regular xterm? I need this to decide about setting colors etc. A: aterm always exports the variable "COLORTERM", so you can check and see if that is set. Note that several programs, JED, slrn, Midnight Commander automatically check this variable to decide whether or not to use color. ----- Q: How do I set the correct, full IP address for the DISPLAY variable? A: If you've compiled aterm with DISPLAY_IS_IP then it is possible to use the following shell script snippets to correctly set the display. If your version of aterm wasn't also compiled with ESCZ_ANSWER (as assumed in these snippets) then the COLORTERM variable can be used to distinguish aterm from a regular xterm. Courtesy of Chuck Blake with the following shell script snippets: # Bourne/Korn/POSIX family of shells: [ ${TERM:-foo} = foo ] && TERM=xterm # assume an xterm if we don't know if [ ${TERM:-foo} = xterm ]; then stty -icanon -echo min 0 time 15 # see if enhanced aterm or not echo -n '^[Z' read term_id stty icanon echo if [ ""${term_id} = '^[[?1;2C' -a ${DISPLAY:-foo} = foo ]; then echo -n '^[[7n' # query the aterm we are in for the DISPLAY string read DISPLAY # set it in our local shell fi fi csh/tcsh family of shells: if ( !(${?TERM}) ) then # if term is unset, we are probably in an xterm TERM = xterm endif if ( ${TERM} =~ xterm ) then stty -icanon -echo min 0 time 15 # see if enhanced aterm or not echo -n '^[Z' set term_id=$< stty icanon echo if ( ""${term_id} == "^[[?1;2C" && ${?DISPLAY} == 0 ) then echo -n '^[[7n' # query the aterm we're in for the DISPLAY string setenv DISPLAY "$<" # set it in our local shell endif endif -- EOF aterm-1.0.1/doc/etc/0000755000175000001440000000000010654145553012643 5ustar vaeusersaterm-1.0.1/doc/etc/rxvt.termcap0000644000175000001440000000171410144447041015215 0ustar vaeusers# Reconstructed via infocmp from file: /usr/share/terminfo/r/rxvt rxvt|rxvt terminal emulator (X Window System):\ :am:eo:km:mi:ms:xn:xo:\ :co#80:it#8:li#24:\ :AL=\E[%dL:DC=\E[%dP:DL=\E[%dM:DO=\E[%dB:IC=\E[%d@:\ :K1=\EOw:K2=\EOu:K3=\EOy:K4=\EOq:K5=\EOs:LE=\E[%dD:\ :RI=\E[%dC:UP=\E[%dA:ae=^O:al=\E[L:as=^N:bl=^G:cd=\E[J:\ :ce=\E[K:cl=\E[H\E[2J:cm=\E[%i%d;%dH:cr=^M:\ :cs=\E[%i%d;%dr:ct=\E[3g:dc=\E[P:dl=\E[M:do=^J:ei=\E[4l:\ :ho=\E[H:i1=\E[?47l\E=\E[?1l:ic=\E[@:im=\E[4h:\ :is=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;3;4;6l\E[4l:\ :k0=\E[21~:k1=\E[11~:k2=\E[12~:k3=\E[13~:k4=\E[14~:\ :k5=\E[15~:k6=\E[17~:k7=\E[18~:k8=\E[19~:k9=\E[20~:\ :kD=\E[3~:kI=\E[2~:kN=\E[6~:kP=\E[5~:kb=^H:kd=\E[B:ke=\E>:\ :kh=\E[7~:kl=\E[D:kr=\E[C:ks=\E=:ku=\E[A:le=^H:mb=\E[5m:\ :md=\E[1m:me=\E[m\017:mr=\E[7m:nd=\E[C:rc=\E8:sc=\E7:\ :se=\E[27m:sf=^J:so=\E[7m:sr=\EM:st=\EH:ta=^I:\ :te=\E[?47l\E8:ti=\E7\E[?47h:ue=\E[24m:up=\E[A:us=\E[4m:\ :vb=\E[?5h\E[?5l:ve=\E[?25h:vi=\E[?25l:vs=\E[?25h: aterm-1.0.1/doc/etc/rxvt.terminfo0000644000175000001440000000514710144447041015411 0ustar vaeusers# From: Thomas Dickey 04 Oct 1997 # Updated: Özgür Kesim 02 Nov 1997 # Notes: # rxvt 2.21b uses # smacs=\E(B\E)U^N, rmacs=\E(B\E)0^O, # but some applications don't work with that. # It also has an AIX extension # box2=lqkxjmwuvtn, # and # ech=\E[%p1%dX, # but the latter does not work correctly. # # rxvt is normally configured to look for "xterm" or "xterm-color" as $TERM. # Since rxvt is not really compatible with xterm, it should be configured as # "rxvt-basic" (monochrom) and "rxvt" rxvt-basic|rxvt terminal base (X Window System), am, bce, eo, km, mir, msgr, xenl, xon, cols#80, it#8, lines#24, acsc=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~, bel=^G, blink=\E[5m, bold=\E[1m, civis=\E[?25l, clear=\E[H\E[2J, cnorm=\E[?25h, cr=^M, csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=^H, cud=\E[%p1%dB, cud1=^J, cuf=\E[%p1%dC, cuf1=\E[C, cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\E[A, cvvis=\E[?25h, dch=\E[%p1%dP, dch1=\E[P, dl=\E[%p1%dM, dl1=\E[M, ed=\E[J, el=\E[K, el1=\E[1K, enacs=\E(B\E)0, flash=\E[?5h\E[?5l, home=\E[H, hpa=\E[%i%p1%dG, ht=^I, hts=\EH, ich=\E[%p1%d@, ich1=\E[@, il=\E[%p1%dL, il1=\E[L, ind=^J, is1=\E[?47l\E=\E[?1l, is2=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;3;4;6l\E[4l, kDC=\E[3$, kEND=\E[8$, kHOM=\E[7$, kLFT=\E[d, kNXT=\E[6$, kPRV=\E[5$, kRIT=\E[c, ka1=\EOw, ka3=\EOy, kb2=\EOu, kbs=^H, kc1=\EOq, kc3=\EOs, kcbt=\E[Z, kcub1=\E[D, kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A, kdch1=\E[3~, kel=\E[8\^, kend=\E[8~, kent=\EOM, kf0=\E[21~, kf1=\E[11~, kf10=\E[21~, kf11=\E[23~, kf12=\E[24~, kf13=\E[25~, kf14=\E[26~, kf15=\E[28~, kf16=\E[29~, kf17=\E[31~, kf18=\E[32~, kf19=\E[33~, kf2=\E[12~, kf20=\E[34~, kf3=\E[13~, kf4=\E[14~, kf5=\E[15~, kf6=\E[17~, kf7=\E[18~, kf8=\E[19~, kf9=\E[20~, kfnd=\E[1~, khome=\E[7~, kich1=\E[2~, kmous=\E[M, knp=\E[6~, kpp=\E[5~, kslt=\E[4~, rc=\E8, rev=\E[7m, ri=\EM, rmacs=^O, rmcup=\E[?47l\E8, rmir=\E[4l, rmkx=\E>, rmso=\E[27m, rmul=\E[24m, rs1=\E>\E[1;3;4;5;6l\E[?7h\E[m\E[r\E[2J\E[H, rs2=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;3;4;6l\E[4l\E>, s0ds=\E(B, s1ds=\E(0, sc=\E7, smacs=^N, smcup=\E7\E[?47h, smir=\E[4h, smkx=\E=, smso=\E[7m, smul=\E[4m, tbc=\E[3g, vpa=\E[%i%p1%dd, rxvt|rxvt terminal emulator (X Window System), colors#8, pairs#64, op=\E[39;49m, setab=\E[%p1%{40}%+%dm, sgr0=\E[m\017, setaf=\E[%p1%{30}%+%dm, use=rxvt-basic, aterm-1.0.1/doc/etc/XTerm.ad0000644000175000001440000000351610144447041014204 0ustar vaeusers! Put this into ~/.Xdefaults, or to app-defaults/XTerm or wherever ! xrm will loaded it. ! ! This will match the key sequences for a regular xterm to those used ! by rxvt and the enclosed termcap and terminfo files. ! ! As usual, the most annoying xterm keys are Home/End and the ubiquitous ! BackSpace/Delete confusion. XTerm*vt100.translations: #override \ BackSpace: string("\010") \n\ ShiftTab: string("\033[Z") \n\ Ctrlminus: string("\037") \n\ Home: string("\033[1~") \n\ End: string("\033[4~") \n\ Delete: string("\033[3~") \n\ ShiftDelete: string("\177") \n\ CtrlDelete: string("\010") \n\ AltReturn: string("\033\015") \n\ Altspace: string("\033\040") \n\ Alta: string("\033a") \n\ Altb: string("\033b") \n\ Altc: string("\033c") \n\ Altd: string("\033d") \n\ Alte: string("\033e") \n\ Altf: string("\033f") \n\ Altg: string("\033g") \n\ Alth: string("\033h") \n\ Alti: string("\033i") \n\ Altj: string("\033j") \n\ Altk: string("\033k") \n\ Altl: string("\033l") \n\ Altm: string("\033m") \n\ Altn: string("\033n") \n\ Alto: string("\033o") \n\ Altp: string("\033p") \n\ Altq: string("\033q") \n\ Altr: string("\033r") \n\ Alts: string("\033s") \n\ Altt: string("\033t") \n\ Altu: string("\033u") \n\ Altv: string("\033v") \n\ Altw: string("\033w") \n\ Altx: string("\033x") \n\ Alty: string("\033y") \n\ Altz: string("\033z") \n\ CtrlUp: string("\033Oa") \n\ CtrlDown: string("\033Ob") \n\ CtrlRight: string("\033Oc") \n\ CtrlLeft: string("\033Od") \n\ ShiftUp: string("\033[a") \n\ ShiftDown: string("\033[b") \n\ ShiftRight: string("\033[c") \n\ ShiftLeft: string("\033[d") \n !EOF aterm-1.0.1/doc/menu/0000755000175000001440000000000010654145553013034 5ustar vaeusersaterm-1.0.1/doc/menu/menu0000755000175000001440000000320410144447041013714 0ustar vaeusers#!/bin/sh -- # shell wrapper to avoid typing Menu escape sequences if test $# -eq 0; then echo "\ usage: `basename $0` cmd where the most common commands are [menu] [menu:name] [read:file] [read:file;name] [title:string] +/path/menu +/path/menu/* +/menu/path/{-} +/menu/path/{item}{rtext} action -/* -/path/menu -/path/menu/* -/path/{-} -/path/{item} BeginRightLeftUpDownEnd [done] [rm] [rm:] [rm*] [rm:*] [rm:name] [swap] [prev] [next] [clear] [show] [hide] [pixmap:file] [dump] NB: commands may need to be quoted to avoid shell expansion " exit fi Echo="echo -n" # some systems/shells don't like `echo -n' case `/bin/uname` in SunOS) Echo="echo";; esac while [ $# -gt 0 ] do case $1 in +* | -* | '<'* | '['*) # send raw commands $Echo "]10;$1" ;; *) # read in menu files if test $1 = "default"; then $Echo "]10;[read:$0]" else $Echo "]10;[read:$1]" fi if test "$COLORTERM" != "rxvt-xpm"; # remove pixmap stuff then $Echo "]10;[menu][:-/Terminal/Pixmap:][show]" fi ;; esac shift done exit # stop shell here! #------------------------------------------------------------------------- # since everything before a [menu] tag is ignored, we can put a default # menu here #------------------------------------------------------------------------- [menu:default] /Programs/* {Edit} ${EDITOR:-vi}\r {Top} top\r {Dir} ls -la|${PAGER:-more}\r {Dir-Time} ls -lat|${PAGER:-more}\r {Space Left} df\r {-} {Exit} exit\r /Shell/* {check mail} checkmail\r {Background} ^Z bg\r {Kill} ^C\r [show] [done] #--------------------------------------------------------------------- eof aterm-1.0.1/doc/menu/terminal.menu0000644000175000001440000000233310144447041015525 0ustar vaeusers# standard settings for a `terminal' control menu # only attach to an existing menubar [menu] /Terminal/* ./Font/* {Normal} ^@\E]50;# {Larger} ^@\E]50;#+ {Smaller} ^@\E]50;#- {-} {Font 1} ^@\E]50;#1 {Font 2} ^@\E]50;#2 {Font 3} ^@\E]50;#3 {Font 4} ^@\E]50;#4 ../Screen/* {ReverseVideo} ^@\E[?5t {Toggle Width} ^@\E[?3t {Cursor} ^@\E[?25t {Switch} ^@\E[?47t {-} {menuBar} ^@\E[?10t {refresh menu} ^@\E[?10h {scrollBar} ^@\E[?30t {-} {Toggle scroll-on-TTY} ^@\E[?1010t {Toggle scroll-on-Key} ^@\E[?1011t ../Keys/* {XTerm} ^@\E[?35t {Backspace} ^@\E[?67t {Cursor} ^@\E[?1t {KeyPad} ^@\E[?66t ../ {-} ./Pixmap/* {None} ^@\E[m\E]20;\a {-} # load .xpm files (assuming Rxvt*path: has been properly set) # notice there are 2 ways to do this task {background5} ^@\E]20;background5 {Mona} ^@\E]10;[pixmap:monalisa;100] {-} ./Attrib/* {Full} ^@\E]20;;100x100+50+50;? {Tiled} ^@\E]20;;0 {Centre} ^@\E]20;;=+50+50;? {-} # set `quick arrow' keys {Zoom}{200/50%} ^@\E]10;[:\^@\\E]20;;200x050x00x2000x50;?:] {Pos}{5%} ^@\E]10;[:\^@\\E]20;;+5+0-5+0+0-5+0+5;?:] ../ ../ {-} {Version} ^@\E[8n / # make sure the change gets updated [show] [done] #--------------------------------------------------------------------- eof aterm-1.0.1/doc/menu/jedmenu.sl0000644000175000001440000000567010144447041015022 0ustar vaeusers%--------------------------------*-SLang-*-------------------------------- % An example of using the rxvt menuBar for the JED editor #if$TERM xterm* %!% provide a hook to imitated the S-Lang> prompt %!% use ESC[m to shadow the ESC[M used by mouse reporting define menuFn () { variable ch, cmd; cmd = Null_String; forever { ch = getkey (); if (ch == '\r') break; cmd = strcat (cmd, char (ch)); } eval (cmd); } local_setkey ("menuFn", "\e[m"); % menu %!% allow the user to bind their owm commands define menucmd (str) { tt_send (Sprintf ("\e]10;%s\a", str, 1)); } %------------------------------------------------------------------------- % integrate these with any existing suspend/resume/exit hooks % the suspend hook works best if there was already a menu defined % before invoking JED define suspend_hook () { menucmd ("[prev]"); } define resume_hook () { menucmd ("[next]"); } define exit_hook () { menucmd ("[rm]"); exit_jed (); } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% menucmd ("[read:jedmenu.sl]"); % read this file % format _jed_version xyyzz into x.yy-zz menucmd (Sprintf ("[:[title:Jed%d.%d-%d (%%n-%%v)]:]", (_jed_version/10000), ((_jed_version mod 10000)/100), (_jed_version mod 100), 3)); % get rid off pixmap stuff if (strcmp (getenv ("COLORTERM"), "rxvt-xpm")) { menucmd ("[menu][:-/Terminal/Pixmap:][show]"); } #endif % xterm* %%%%%%%%%%%%%%%%%%%%%%%%%%% end-of-file (SLang) %%%%%%%%%%%%%%%%%%%%%%%%%% % rxvt menu database #iffalse % An example of using the rxvt menuBar for the JED editor % possibly useful things for the JED editor -- assuming Emacs bindings [menu:jed] [title:Jed menu (%n-%v)] % some convenient arrows \E[mbskip_wordbackward_paragraphforward_paragraphskip_word\r /File/* {Open}{^X^F} {Save}{^X^W} {Save Buffers}{^Xs} {Insert File}{^Xi} {-} {Shell Cmd}{M-!} {-} {Exit}{^X^C} /Edit/* {Undo}{^_} {-} {Cut}{^W} {Copy}{M-W} {Paste}{^Y} /Search/* {Forward}{^S} {Backward}{^R} {Replace}{M-%} {-} ./Regexp/* {Forward}{M-^S} {Backward}{M-^R} {Replace} \E[mquery_replace_match\r /Buffers/* {Kill}{^Xk} {List}{^X^B} {Switch}{^Xb} {-} ./Modes/* {C} \E[mc_mode\r {SLang} \E[mslang_mode\r {None} \E[mno_mode\r {LaTeX} \E[mlatex_mode\r {Text} \E[mtext_mode\r {Fortran} \E[mfortran_mode\r /Window/* {Delete}{^X0} {One}{^X1} {Split}{^X2} {Other}{^Xo} {-} {Recenter}{^L} {-} ./Color Schemes/* {White-on-Black} \E[mset_color_scheme("15;0")\r {Black-on-White} \E[mset_color_scheme("0;15")\r {White-on-default-Black}\E[mset_color_scheme("15;default;0")\r {Black-on-default-White}\E[mset_color_scheme("0;default;15")\r /Utils/* {Bufed} \E[mbufed\r {Dired} \E[mdired\r {Mail} \E[mmail\r {Rmail} \E[mrmail\r {-} {EvalBuffer} \E[mevalbuffer\r {Trim-Buffer} \E[mtrim_buffer\r [read:terminal] /?/* {Info}{^X?i} {Man}{^X?m} {-} {Apropos}{^X?a} {Show Key}{^X?k} {Where Is}{^X?w} [show] [done] #endif %%%%%%%%%%%%%%%%%%%%%%%%%%% end-of-file (SLang) %%%%%%%%%%%%%%%%%%%%%%%%%% aterm-1.0.1/doc/menu/example.menu0000644000175000001440000000310310144447041015341 0ustar vaeusersThis example illustrates how several menus could be combined together command = "[read:example]" read the file starting at "[menu]" or "[menu:???]" and continue until it "[done]" command = "[read:example;pico]" or "[read:example;shell]" read the file starting at "[menu:pico]" or "[menu:shell]", respectively and continue until "[done:pico]" or [done:shell]", respectively. #------------------------------------------------------------------------- [menu:pico] [clear] [title:Pico (%n-%v)] # a menu for the pico editor # mostly a demonstration, I don't know why anyone would need it # Prior/Next & Home/End are messed up ^A^E^Y^V /File/* {Insert File}{^R} {Save As}{^O} {-} {Suspend}{^Z} {Exit}{^X} /Edit/* {Find}{^W} {-} {Del Char}{^D} {Mark}{^^} {Kill Line}{^K} {Paste}{^U} /Basics/* {Forward}{^F} {Backward}{^B} {-} {Prev}{^P} {Next}{^N} {-} {Beg-of-Line}{^A} {End-of-Line}{^E} {-} {Prev Page}{^Y} {Next Page}{^V} /Buffer/* {Reformat}{^J} {Position}{^C} {Refresh}{^L} {Spell}{^T} [read:terminal] /?/* {Help}{^G} [show] [done:pico] #------------------------------------------------------------------------- [menu:shell] [clear] [title:shell] # [pixmap:name] # not necessarily useful, but an example of using the rxvt menuBar # assuming we have ksh with Emacs bindings ^P^N^F^B /Programs/* {Edit} ${EDITOR:-vi}\r {Mail} Mail\r {News} slrn\r {Rxvt-News} rxvt -e slrn& {Commander} mc\r /Shell/{finger} finger\r {.name} invisible label! / [read:terminal] [show] [done:shell] #--------------------------------------------------------------------- eof aterm-1.0.1/doc/menu/rxvt.menu0000755000175000001440000000447110144447041014725 0ustar vaeusers#!/bin/sh -- # an example of having different menus (even different pixmaps) # show up depending on the machine you are rlogin/telnet connecting to menu="$0" # or any convenient database exe="../../src/rxvt" # default program to execute # exe="/usr/local/bin/rxvt-2.21" # default program to execute if test $# -gt 0; then # if first argument contains "rxvt" use that instead case $1 in *rxvt*) exe="$1" shift;; esac fi while [ $# -gt 0 ] do case $1 in -h) # give usage echo " Usage: `basename $0` [rxvt-prgm] [options] start rxvt and load a menu corresponding to \"machine\" if the option -e {rlogin|telnet|tn3270} Machine.Domain ... was used" exit ;; # don't bother if we've already set it -menu) break;; # don't bother if we've already set it -e) if test $# -ge 3; then case $2 in # try to find menu for these cases *rlogin | *telnet | *tn3270) # strip domain & convert case mach=`echo $3 | sed -e 's/\..*$//' | tr [A-Z] [a-z]` if test ! -z "$mach"; then found=`egrep "^\[menu:$mach\]" $menu` if test ! -z "$found"; then mach="$menu;$mach" exe="$exe -menu $mach" fi fi ;; esac fi break ;; *) exe="$exe $1" ;; esac shift done # echo "$exe $@" $exe $@ & exit # stop shell here! #------------------------------------------------------------------------- [menu:weber] #[menu:machine1] [clear] # [pixmap:machine1.xpm] /Programs/* {Edit} ${EDITOR:-vi}\r {Mail} Mail\r {News} News\r {-} {Exit} exit\r /Jobs/* {Top} top\r {Ps u} ps aux|egrep ^$USER {Ps aux} ps aux|egrep -v "(root|ps)" # who's REALLY logged on (even with utmp logging turned off) {Who} ps aux|egrep "\-bash"|egrep -v "grep" {-} {Background} ^Z bg\r {Kill} ^C\r /Misc/* {Dir} ls -la|${PAGER:-more}\r {Dir-Time} ls -lat|${PAGER:-more}\r {Space Left} df\r [read:terminal] [show] #[done:machine1] [done:weber] #------------------------------------------------------------------------- [menu:conn] #[menu:machine2] [clear] # [pixmap:machine2.xpm] /Programs/* {Edit} ${EDITOR:-vi}\r {Checkmail} checkmail\r {Dir} ls -la|${PAGER:-more}\r {Dir-Time} ls -lat|${PAGER:-more}\r {Space Left} df\r {-} {Exit} exit\r /Jobs/* {Background} ^Z bg\r {Kill} ^C\r [read:terminal] [show] #[done:machine2] [done:conn] #--------------------------------------------------------------------- eof aterm-1.0.1/doc/README.Unix98PTY0000644000175000001440000000331110144447041014435 0ustar vaeusersFor those of you who experience errors like "can't open pseudo-tty" or any other errors related to openning tty here is the information you need to read : If you have glibc2 installed , and you compiled Unix98 PTY support in to the linux kernel, then you need to do some additional configuration stuff. Here is the excerpt from Documentation/Changes file, supplied with Linux kernel 2.2.* : ***************** Documentation/Changes excerpt starts ********************* The most current version should always be available from http://cyberbuzz.gatech.edu/kaboom/linux/ as well. As of 2.1.115, support for the deprecated major 4 /dev/ttyp* devices was removed. If necessary (eg, you get "out of pty" error messages when you obviously are not out of pty's), create major 3 /dev/tty* and major 2 /dev/pty* devices (see Documentation/devices.txt for more information). In general, you should make sure that your /dev directory is up-to-date if you are experiencing any problems. Optional support for Unix98 pty devices has also been added. If you want to use the Unix98 ptys, you should be running at least glibc-2.0.9x, and you must switch completely to Unix98 pty's. The general procedure for configuring Unix98 pty support is: - Compile your kernel with CONFIG_UNIX98_PTYS and CONFIG_DEVPTS_FS. - mknod /dev/ptmx c 5 2 chmod 666 /dev/ptmx mkdir /dev/pts - Add to /etc/fstab: none /dev/pts devpts gid=5,mode=620 0 0 (Note: gid=5 is applicable for RedHat systems for which group "tty" has gid 5. Adjust according to your distribution. Use mode=600 if you want "mesg n" to be default.) - Mount /dev/pts ***************** Documentation/Changes excerpt ends *********************** aterm-1.0.1/doc/ReleaseGuide0000644000175000001440000000224510654146170014350 0ustar vaeusersRelease guide : 1) Change version numbers in : autoconf/configure.in 2) cd autoconf; autoconf; cp configure .. 3) Commit changes with message like so "Aterm release v 1.0.5". 4) rm ChangeLog && make ChangeLog 5) Commit changes to ChangeLogs. 6) Tag everything: cvs tag -r HEAD release_1_00_05 7) Create a release directory somewhere outside aterm1 tree and cd into it. 8) cvs -d:pserver:anonymous@cvs.aftercode.net:/home/cvsroot export -r release_1_0_5 -d aterm-1.0.5 aterm1 10) tar zcpvf aterm-2.00.05.tar.gz aterm-2.00.05 11) tar jcpvf aterm-2.00.05.tar.bz2 aterm-2.00.05 19) upload tarballs, ChangeLog and NEW files on ftp.afterstep.org 20) upload tarballs on upload.sf.net/incoming/ 21) Add file release on Sourceforge. --- don't dump whole changelog! (it gets emailed to people.) 22) Announce release on freshmeat.net 23) Announce release on AS-ML 24) Update wao pages : index.php, download.php and news 25) test release on your own computer 26) realise that you fucked up and go apologise to everybody 27) watch new release not getting propagated into distros and users installing some wierd beta from yer back. 28) realise futulity of it all and go on a drinking binge aterm-1.0.1/doc/Makefile.in0000644000175000001440000000240310171021555014121 0ustar vaeusers# doc/Makefile.in -*- Makefile -*- # $Id: Makefile.in,v 1.2 2005/01/11 19:05:17 sasha Exp $ @MCOMMON@ srcdir = @srcdir@ VPATH = @srcdir@ basedir = .. thisdir = doc first_rule: all dummy: # # Distribution variables # DIST_ETC = etc/rxvt.termcap etc/rxvt.terminfo etc/XTerm.ad DIST_MENU = menu/menu menu/example.menu menu/rxvt.menu menu/terminal.menu\ menu/jedmenu.sl DIST = Makefile.in README.thai README.greek README.menu README.xvt FAQ aterm.1 #------------------------------------------------------------------------- all: distclean: $(RMF) Makefile install: $(INSTALL_DATA) aterm.1 $(DESTDIR)$(mandir)/$(manprefix)aterm.$(manext) uninstall: -cd $(mandir); $(RMF) $(manprefix)aterm.$(manext) distdirs: mkdir $(basedir)/../$(VERNAME)/$(thisdir) mkdir $(basedir)/../$(VERNAME)/$(thisdir)/etc mkdir $(basedir)/../$(VERNAME)/$(thisdir)/menu distcopy: distdepend $(CP) -p $(basedir)/$(VERNAME).lsm $(basedir)/../$(VERNAME); $(CP) -p $(DIST) $(basedir)/../$(VERNAME)/$(thisdir) $(CP) -p $(DIST_ETC) $(basedir)/../$(VERNAME)/$(thisdir)/etc $(CP) -p $(DIST_MENU) $(basedir)/../$(VERNAME)/$(thisdir)/menu distdepend: alldoc # ------------------------------------------------------------------------ # DO NOT DELETE: ugly dependency list follows aterm-1.0.1/doc/README.greek0000644000175000001440000001242610144447040014037 0ustar vaeusers ------------------------------- rxvt support for greek keyboard ------------------------------- A. Haritsis rxvt supports both ELOT-928 (ISO-8859-7 standard) and IBM-437 keyboard translations for greek character entry. It is possible to start rxvt windows in any of the two translations, making it possible to use both translations modes simultanesuly on the same screen! No need to convert your files back and forth if you don't want to. When in greek mode, type ; or : twice to emit the respective symbol. No need to switch language mode back and forth! rxvt ISO-8859-7 includes mappings for the following (usually forgotten): anw teleia = ;. << = ;< >> = ;> Also: Copyright = ;c Section = ;s For Greek Elot-928 or IBM-437 keyboard for rxvt & X greek entry support you will need to: 1) compile rxvt with an ANSI C compiler (eg gcc) as follows: Use the --enable-greek option in configure , or edit config.h and define GREEK_SUPPORT Then your rxvt executable with greek support should be created. Install it as you would do for the normal rxvt. There is no need to change its name. It works fully as a normal rxvt but if you press the 'toggle' keysym (see below) it will switch into greek translation mode. The extra memory it takes in less than 4 kBytes. 2) install greek elot & ibm437 fonts(s) for X-windows eg. cp a_greek_font.pcf.Z /usr/lib/X11/misc/ and ammend the fonts.dir and fonts.alias in /usr/lib/X11/misc/. Greek fonts are available as a separate file which you can download from sunsite (/pub/Linux/X11/misc/greek-xfont-pack.tgz). A new release of a FULL set of fixed (and proportional and Type1 for use by netscape etc) can be found in the HCR archive - see at end). I might upload them at sunsite et all as well. 3) include the following in your X resources: rxvt.font: grfixed (or the name of your preferred greek font) rxvt.bits: 8 (default) rxvt.greektoggle_key: Mode_switch (default) where grfixed is an alias for one of the elot-928 font in the pack. Remember that the default keyboard translation is ELOT928. If you need to start rxvt with suppport for IBM437, use the command line of rxvt to set mode & font (command line option -grk4 can do this). Remember to use an Elot font with the Elot translation mode and a 437 font with the IBM437 mode. You can choose any keysym you wish as the "toggler" greek_switch_keysym. Choosing `VoidSymbol' will effectively _disable_ the greek keyboard. The default is keysym `Mode_switch'. For XFree86 this is defined in the /usr/lib/X11/Xmodmap.* files as: keycode 113 = Mode_switch (it is the Right Alt key or ALtGr) You may define it to be something else with a command like: xmodmap -e "keycode ... = Mode_switch" or changing your ~/.Xmodmap file (see xmodmap(1) and X(1) about this). I personally prefer the AltGr key on PC X terminals since it allows fast switching. Of course this might not be liked by left-handed people. You can redefine it to whtever you like under X, but I would NOT recommend keycodes that have other uses. 5) Not all programs are 8-bit clean -- ie, they sometimes strip the top bit of a character which is essential for the greek fonts. Unfortunately bash is one of these programs (at least I couldn't figure out how to make it to work). Use tcsh instead: it is 8-bit clean. You will generally need to include in your ...rc files: For sh/bash: LC_CTYPE=iso_8859_1; export LC_CTYPE LESSCHARSET=latin1; export LESSCHARSET For bash to be 8-bit clean, add the following lines to ~/.inputrc: set meta-flag on set convert-meta off set output-meta on For csh/tcsh: setenv LC_CTYPE iso_8859_1 setenv LESSCHARSET latin1 Still some applications will have problems. Emacs has its own support for greek characters achieved with the .el script written by sarantos@csd.uch.gr (for 19.20 +). It might be possible to have greek support via emacs invocations with the -nw argument (with this version of rxvt) but I have not tried it. Elvis (vi clone) works fine. I highly recommend vim version 3.15 and later. I have added support for making native languge vi'ing very easy (see langmap option). It's by far the most powerful vi (or maybe editor :-) I have ever seen. If some (terminal-based) applications do not work, please direct complaints to their authors stating that you would like them to be 8-bit clean. I will soon release a linux version of an 8-bit clean curses lib and versions of some useful programs that work with it (eg ytalk). Watch the HCR archive. Do not expect programs that are not running within an rxvt window to have greek keyboard support. For this, it will be needed to change the Xlib so that it supports 4-state FSMs (rather than only 2 - I do not count shift keys or caps lock) for keyboard entry (required for greek keyboards). And something amusing and (maybe) useful: some filesystems (including SunOS and Linux filesystems -- haven't checked others) allow names with 8-bit characters; so you can create files or directories with names containing greek characters! Enjoy, Angelo Haritsis For more greek related tools/fonts etc, have a look at the HELLENIC RESOURCES ARCHIVE (HCR) : ftp://dolphin.doc.ic.ac.uk/pub/greek/ maintained by the above author. aterm-1.0.1/doc/ChangeLog.rxvt0000644000175000001440000014455710144447037014660 0ustar vaeusersSasha Vasko Fixed pseudo-transparency to handle root background changes ala Esetroot. Added background tinting option. Branched RXVT to ATERM. aterm 0.1.1 \----------------------------------- Alfredo K. Kojima added fast pseudo-transparency changed NEXT_SCROLLBAR code to produce real NEXTSTEP scrollers 2.4.7 to 2.4.8 \----------------------------------- Geoff Wing fixed XPM handling of position in geometry changed XPM tiling to have the X server tile in the basic case moved several configuration options from feature.h to configure fixed introduced pixel dropping bug when RS_DIRTY was removed added `troughColor' resource - the original patch written by Reid D Rivenburgh (noted below) was lost and never added fixed border pixel colour - if not set, use foreground not background fixed handling of cursorColor/cursorColor/colorBD/colorUL to always use the _current_ fg/bg colours appropriately if unset changed source code organisation - moved some things into screen.h - to allow other add-ons to access screen structures without including all of rxvt.h changed internals - ripped out RS_Cursor/RS_Select to make basic multichar sets (not Kanji/Big5) always enabled - thus handle selection and cursor display differently fixed bug on scroll lines affecting selection changed rmemset to use a type which is the same size as an (int *) - based on comments by Paul Slootman fixed pointer colour change on default fg colour change changed handling of backspace/delete keys - if not disabled during ./configure then settable via resources - defaults similar to previous 2.4.6 to 2.4.7 \----------------------------------- Geoff Wing moved several configuration options from feature.h to configure added configure option to use system memset() added support for no multichar sets to allow 2 byte rendition type changed rmemset for slightly more optimised execution changed source code organisation slightly Guillaume Laurent added Meta modifier selectable via resource ``modifier'' John E. Davis added print mode to accept ESC sequence variation 2.4.5 to 2.4.6 \----------------------------------- Geoff Wing merged support for Big5 & Kanji. changed short option: fk --> fm changed long options: kfont/cfont --> mfont changed long option: kanji_encoding --> multichar_encoding changed font list in feature.h - user define list of fonts fixed configure check for Xlocale() added configure option --enable-dmalloc (Gray Watson's malloc) added configure option --enable-dlmalloc (Doug Lea's malloc) added support for Cygnus Solution's GNU-Win32 extensions (b18 tested) fixed utmp/wtmp handling on machines with updwtmpx() added support for old rxvt style selection - OLD_SELECTION changed define of struct screen_t to rxvt.h changed internal handling of bold overstrike pixel dropping - prescan line changed internal handling of selection mechanism to properly support multiple methods - and optimized changed internal handling of selection sync'ing - and optimized added assert()s via DEBUG_STRICT define to catch some possible bugs fixed scrollbar colour on mono displays changed privilege revocation to before we do anything fixed selection clearing when across the screen boundary and we swap screens fixed resize / screen refresh order when changing scrollbar display fixed font handling when we're given per_char of NULL changed internal handling of row width - maximum line length is now bound by a short - not enforced changed rxvt.1 and refer.html to yodl source Bruce Stephens added support for buttons 4 and 5 (eg. on a mouse with wheel) to scroll screen Frank Chen Hsiung Chan fixed clash of use of BIG5 as define and enum. Also typo fix. John Eikenberry added window_group use to window manager properties added NeXT scrollbar style - group up and down buttons together Denis N. Antonioli fixed setting of application icon name and title Adam Spiers fixed enumeration of *.keysym.* in resources 2.4.4 to 2.4.5 *_Official Release_* \----------------------------------- Geoff Wing changed the approach at the Boldoverstrike-Pixeldroppings front temporarily fixed a bug in the exposure handling added the --enable-ttygid Oezguer Kesim switched rxvt licence to GPL changed copyrights of the modules fixed the terminfo/termcap entries Mark Olesen FINALLY added Double-Click mouse reporting. Uses the upper bits of the Button character for X11 reporting so should cause no compatibility problems. * State = ( - SPACE) & 60 4 = Shift 8 = Meta 16 = Control 32 = Double Click (Rxvt extension) NOTE: no Release is reported after a double-click and the Release for the first click of a double-click is not reported. This also means the Release event of a very fast click/release won't be reported. 2.4.3 to 2.4.4 \----------------------------------- Geoff Wing fixed a bug in the selection mechanism Oezguer Kesim fixed the fontchange-windowresize-racecondition-bug (thanks Geoff!) fixed the broken console-support under solaris added a new terminfo entry for rxvt, based on the one which comes with ncurses (thanks Larry!) some changes on aclocal.m4 and configure removed the XTERM_COLOR_TERM option from feature.h - use --with-term=NAME instead updated the man-page Kikutani Makoto fixed a bug when copy&paste with kanji Paul D. Smith fixed a bug which prevented rxvt to compile when configured with --enable-xterm-scroll 2.4.2 to 2.4.3 \----------------------------------- Geoff Wing fixed a bug in scrolling lots of text more work on avoiding the pixel droppings further cleanups Oezguer Kesim some changes on the configure script Frank Chen Hsiung Chan added experimental big5 support Reid D Rivenburgh added the "troughColor" resource Mike Hopkirk (Hops) added support of SCO OSr5 pty naming (also UW SysVr5) correction of pty hang with large paste buffer (happens on on all tested platforms) fixed Weird default scroll thumb behaviour fixed incorrect setting of WM_COMMAND if specified with -e switch fixed # of lines of context between screen pages (Shift-Prior/Next) Visual delineation of Scrollbar and vt wdw with dark internal border 2.4.1 to 2.4.2 \----------------------------------- Geoff Wing new anti-bold-overstrike-pixel-dropping (plan 3) Oezguer Kesim fixed a bug which caused rxvt to dump core after resizing and selecting 2.4.0 to 2.4.1 \----------------------------------- Geoff Wing added --with-xpm-{include,library} to autoconf/a4local.m4 added VERYBOLD feature fixed some misspelling in autoconf/configure.in added `DEC private modes' 1010 and 1011 for scroll-to-bottom on TTY output inhibit and scroll-to-bottom on keypress together with resources and switches fixed Bold Overstrike Pixel Dropping (Yes Sir!) fixed a bug in scr_E() fixed ^[[*J behaviour - clear to end, clear to beginning, clear whole screen was broken Oezguer Kesim removed DONT_GUESS_BACKSPACE. Instead, you may define either FORCE_BACKSPACE or FORCE_DELETE or leave both undefined in order to get ^H, ^? or the current stty settings for 'erase' fixed positioning of text in the top menubar. fixed some missing #define's fixed conditions for MONO_BOLD in scr_refresh() to make VERYBOLD work. Christoph L. Spiel fixed usage of KEYSYM_RESOURCE only when NO_RESOURCES is *not* defined Paul Slootman added a few XK_KP_* ifdef's in order to get rxvt work with X11R4 Major changes from 2.21b* to 2.4.0 \----------------------------------- Geoff Wing screen.c rewritten with changes including: internal management of screen lines changed rmemset() used as a fast memset() replacement selection now the same as XTerm selection several Kanji display fixes Kanji properly selectable for EUC JP encoding added continuous scrolling with scrollbar buttons fixed colours when using XPM background pixmaps smaller than the window added resources -sr/+sr, -st/+st fixed application Cursor Keys added many configure enhancements added delimiting line between XTerm scrollbars as per XTerm fixed utmp support added minimal support for proportional fonts added integrated use for Gray Watson's dmalloc package added automatic prototype generation via src/makeprotos-sed Grant McDorman added PREFER_24BIT: if the screen is 24 bit, then use 24 bit windows even if default is 8 bit fixed utmpx support added handling for Keypad left/right/up/down, etc. added META8_OPTION for all function keys added RXVT_TERMINFO for setting TERMINFO fixed some bugs in menubar added expanded keysym support Paul D. Smith fixed title setting fixed for building in other directories added pointerColor for changing pointer colour added borderColor for changing border line colour in XTerm scrollbar 2.21a3 to 2.21b* \--------------- 1. From: Conrad Link Fixed a bug in the OffiX Drag and Drop support. rxvt inserted two instances of directories or links when they were dropped onto rxvt. 2. From: Fixed a bug that makes rxvt getting constantly "NoExpose" events which it is not handling. 3. From: Mark Olesen Fixed a bug that caused rxvt to hang indefinitly waiting for a terminating ^G on an XTerm `ESC]' sequence. 4. From: Bernard PERROT Mark Olesen Fixed a bug that prevented to handle DEC VT2xx's ApLineDel correctly 5. From: Mark Olesen Now the Shift/Ctrl cursor key mappings are enabled regardless of App-Cursor settings 6. From: Kai Petzke Fixed a bug with respect to cursor movement. rxvt now handles the 'G' and 'd' sequences correctly 7. From: Geoff Wing Fixed a couple of things in utmp.c 8. From: Denis N. Antonioli Added the "-tn" option and corresponding Xresource variable "termcap". This option specifies the name of the terminal type to be set in the TERM environment variable. 2.20 to 2.21a* \------------- 1. Oops, forgot to include time headers in menubar.c 2. Finally got the correct DEC sequence to toggling the behaviour of the backspace key and removed the other non-standard ones. If anyone has a listing of DEC escape sequences they'd like to donate ... 3. Fixed a bug that prevented an XPM file from being found if it were specified with an absolute path and a geometry string. Made the default scaling zero (tiled) since this is by far the most popular use. 4. The Motif-style scrollbar is back as a compile-time option. 5. Added BUGS file and (thankfully) moved coordination of the project to Oezguer Kesim who also has a mailing list for rxvt development Rxvt Workers To subscribe to the list send email to with the body: subscribe 6. Semi-retirement and finish my thesis ... bye for now - /mark --- Oezguer started working on rxvt 7. Fixed a bug in the new menubar-feature. There were several unchecked strings strcpy'ed which caused rxvt immediately to dump core. 8. From: Robert Bihlmeyer Fixed a bug in rclock.c which prevented it to compile correctly. 9. From: Mark Olesen Overstrike boldfonts and pixmaps now work together without pixel droppings on the screen (at least under Linux). 10. From: Mark Olesen Modified autoconf support: memmove() replacement function supplied for those systems that need it, libXpm should now be correctly found (set in src/Makefile *not* in config.h) 11. From: Mark Olesen Converted doc/rxvt.ref to HTML format. doc/html/refer.html = master copy doc/refer.txt = text version saved using Netscape. All HTML documents are put in here, to ease installation elsewhere. 12. From: Mark Olesen Moved some file search function from main.c and some string functions from xdefaults.c to misc.c. Changed the implementation details so that `keysym' resource is also available as a command-line long option ... even if you have compiled with USE_XGETDEFAULT. 13. From: Mark Olesen When a new pixmap is loaded, revert to the default scaling. 14. From: Mark Olesen Reworked the menubar to permit multiple menubars in a circular linked list (and all the management functions that entains) and new functions including the following: * reading from files * dumping all the menubars * clearing a menu (without removing it) * setting a backgroudPixmap * and many other features. The menu syntax has changed very slightly from the last version, but now provides greater flexibility ... see refer.html for details. Added the `menu' resource/long-option so a startup menu can be specified. eg, rxvt -menu my.menu -e rlogin machine -l user 2.19 to 2.20 \----------- 1. You can now add snazzy looking menus to any plain (non-X) text application. At the moment, the menuing system is simple but functional. The syntax for controlling the menubar is documented in doc/rxvt.doc, but note that an XTerm sequence `ESC ] 10; Pt BEL' is used so menus created for rxvt will be ignored by an ordinary XTerm. It provides sub-menus, click-and-drag, and even some user definable `quick' arrows keys. However menu manipulation could use refinement to permit multiple menus to be defined -- and the menu refreshing could also use some improvement, but it can be extended and refined later as required/desired. The files doc/menu.sh and doc/jedmenu.sl show sample implementations of menus. --> It compiles and runs on my machine (AIX 3.2.5) but THIS IS CONSIDERED BETA (or even ALPHA) CODE! 2. DEC private modes: Bug fix for 's'ave and 'r'estore parameters, added a 't'oggle parameter to DEC private modes. 3. Made Backspace key selectable with DEC private mode ESC [ ? 36 h/l/s/r/t (high/low/save/restore/toggle) 4. Changed the way the scrollBar is realized to permit on-the-fly toggling of the scrollBar display and added a DEC private mode escape sequence for that. Smoother redraw of scrollBar. Better proportions for the arrows allows a slightly narrower scrollBar. 5. Added support for XTerm font changing sequence: `ESC ] 50; Pt BEL', with (as usual) a few extras. See doc/rxvt.ref 6. Adapted experimental XPM buffering from that supplied by Carsten Haitzler . 7. Replaced `wait' with `waitpid' in src/command.c::Child_signal to avoid a race condition and permit use of pclose() on SunOS. Patch provided by , Thanks John! 8. For easier XPM handling, added `path' resource/long-option and substantially enhanced pixmap scaling to provide very exact control over scaling and positioning of the XPM background image. The XPM XTerm escape sequence has been extended to provide a convenient facility for on-the-fly rescaling. Export COLORTERM="rxvt-xpm" instead of COLORTERM="rxvt" 9. Added export COLORFGBG to give hints to color applications. Typically one of these values is exported, in which `fg' and `bg' are numbers 00-15: COLORFGBG="default;default" -fg -bg colors don't match any of color 0-15 COLORFGBG="fg;default" -fg color matches color 0-15, but -bg color doesn't COLORFGBG="default;bg" -bg color matches color 0-15, but -fg color doesn't COLORFGBG="fg;bg" -fg -bg colors match color 0-15 When compiled with XPM support, the last two values are rendered as follows: COLORFGBG="default;default;bg" -bg color matches color 0-15, but -fg color doesn't COLORFGBG="fg;default;bg" -fg -bg colors match color 0-15 10. Disable Shift+Prior/Next and scrollBar if saveLines == 0. Slight change to key-processing so `shift+meta+key' and `shift+ctrl+key' gets processed as `shift+key'. This provides a way to avoid interpretating `Shift+Prior', `Shift+Next', and `Shift+Insert'. Also, added DEC private mode sequence `ESC [ ? 35 h/l/s/r/t' to disable Shift+key interpretation. Provide for Ctrl+Shift+ combinations for function keys. See doc/rxvt.ref 11. Always match long-option names, even when only preceded by a single -/+. 2.18 to 2.19 \----------- 1. Minor alteration to input mode for Kanji processing. 2. rclock: -adjust option, support for exec on startup syntax, date format may now also include the century 3. Made mouse double-click respect autowrap lines. 4. Added marks for folded editing. 5. Added Offix DND (Drag 'n' Drop) protocol. Added support for XA_TARGETS. 6. added Carsten Haitzler XPM patches to load an XPM file for the background of the terminal window. Uses resource `Rxvt.backgroundPixmap' or long-option `--backgroundPixmap' 7. Use these (XTerm) keybindings exclusively and remove the old equivalent bindings: Shift-Prior = scroll up Shift-Next = scroll down Shift-Insert = paste mouse selection Shift-KP_Add = bigger font Shift-KP_Subtract = smaller font 2.17 to 2.18 \----------- 1. Check for NULL pointers in command-line processing (oops) Also fixed processing of `hidden' arguments such as -d, -g, -T 2. Fixed terminfo hpa/vpa: was `\E..' instead of `\E[..' added invisible cursor (ESC[?25h / ESC[?25l) 3. Fixed broken kanji characters (?? and disappeared cursor box ??) thanks to 4. In privileges(), changed setuid/setgid to seteuid/seteguid so that it's possible to switch back to root later. Perhaps fixed svr4 problems (reports no tty, no job control) in get_tty() ... need to detect these SVR4 features in the configure script. 5. Restored scrollColor, topShadowColor, bottomShadowColor resources that somehow got lost between the beta and release versions. For monochrome displays, fixed scrollbar so it will be visible and suppress color changes. 6. Final? iteration on selection. Store selection text with LF line-endings but paste into rxvt with CR endings. Selection now preserves the newline when trailing space is stripped from non-autowrap lines. Compile-time support for using a keystroke to paste from the cut-buffer. 7. Fixed utmp.c to handle both sysv and bsd pty names. More changes in the works to improve documentation and eliminate race conditions ... this, thankfully, is being done by someone else. 8. Added European language support (X11R6) - let me know of problems and fixes since I only have X11R5. 9. Changed names of color10-color17 to color8-color15 to match with those used by color_xterm ... sorry for the inconvenience, but I didn't have an X11R6 xterm manpage until now and long-term compatibility is quite important. Added a real bold font (define USE_BOLDFONT). I still think it's too much work to avoid pixel droppings for overstrike fonts. Added support for specifying colors for bold/underline (colorBD/colorUL) but it's only done when the foreground = the default foreground ... see the manpage. Compile-time selection of TERM="xterm-color". Reduced the number of rarely-used command-line options since they are accessible on the command-line via their resource names as long options. More rigid differentiation between long and short options: long options are --/++ prefixed; short options -/+ prefixed. Added long-option help to give the resource names. Removed run-time selection of right-hand scrollbar and arrows. Removed run-time selection of (pageup_key/pagedown_key/alert_key). 10. Changed Ctrl-Up,Down,Left,Right to emit "\EOa,b,c,d" instead of the previous "\E[^A,^B,^C,^D" to avoid problems associated with having an embedded "^C" in a key-sequence. Disallow 80/132 column switching as the default (same as xterm). 11. Check for seteuid(). Add "ttcompat" module for SVR4. 12. A few people suggested removing the keystroke for toggling MapAlert and so I have. I agree that it was pointless and/or annoying since there was no way of determining the current toggled state anyhow. 13. Fixed missing `ttydev' for _sgi. Fixes for BSD utmp support. Exported WINDOWID before the window was created (oops). 14. Mouse cut&paste of autowrapped lines should be improved, fixed bug in screen.c::scroll_text(). 15. As was pointed by a user -->> in keeping with X conventions, only an application that starts with 'x' should capitalize the first two letters of the resource file, so the rxvt resource file (and class name) should be named Rxvt not RXvt, this is a minor point. 16. rclock: As well as message reminders, rclock can launch programs and (if no message text is given) act as a cron-type of program. Made default font `7x14'. Fixed graphics context when mail is waiting and a reminder is issued - so the message is actually visible! 17. As suggested by a user, changed the bolding algorithm to be slightly more intuitive: 1. colorBD (if specified) 2. color0-7 -> color8-15 (if possible) 3. boldFont (if specified and found) 4. overstrike (last resort) This takes advantage of the color capability and is the most consistent when toggling font sizes on-the-fly. If you never want overstrike (looks ugly and leaves pixel droppings) or boldFont (you like to switch font sizes on-the-fly), you can remove them at compile-time. The other elements are similarly compile-time selectable. 18. Another user suggestion: scrollbar made more distinct by having the `trough' a different color from the slider -- I opted for making it the same as the default background color so that the slider and arrows appear to `float' on the window. Also removed topShadowColor, bottomShadowColor resources as unnecessary. 19. Dropped distribution of vttest since Tom Dickey is working on an improved version. 2.16 to 2.17 \----------- 1. Fixed problem in scr_refesh_region() that was introduced in v2.16 The problem of `pixel droppings' continues when bold is simulated using overstrike. Using XCopyArea() sometimes helps, but the preferred and simplest solution is item 4 below. 2. Removed 7bit mode. Changed definition of meta so that the ESCAPE is the default and using meta to set the 8bit on an option that can be made run-time configurable (assuming people still use this). Added -/+rv command-line option, resource reverseVideo. NB: it works slightly differently from xterm's in that foreground/background are swapped even if they have been explicitly set. Removed NO_COLOR option -- no more monochrome rxvt (one too #ifdef's). Inherit existing stty settings (at least for control characters) and set value of BackSpace appropriately. Added defines DONT_GUESS_BACKSPACE and NO_DELETE_KEY 3. Added 3D style scrollbar and removed all the old bitmapped scrollbars and arrows with the only exception being the xterm lookalike XTERM_SCROLLBAR which is available in a single width. With arrows, scrollbar behaviour somewhat resembles Motif behaviour. Without arrows, it's the standard xterm behaviour. The default scrollbar (defined at compile-time or set by using scrollBar: True) is to have a scrollbar with arrows arranged on the right-hand side. The scrollBar resource is now exclusively a boolean value scrollbar resources: scrollColor topShadowColor bottomShadowColor NB: if topShadowColor/bottomShadowColor are unset, their values are calculated from scrollColor using an algorithm adapted from fvwm so it shouldn't be too hard to find scrollbar colours that look good with your window manager and don't consume an entire colormap. 4. Added smarter handling of bold/blink when applied to the default fg/bg colours: If the pixel value of fg/bg matches the pixel value of colour COLOR0 through COLOR7, then applying bold/blink to the default fg/bg will select the appropriate colour from BOLD0 through BOLD7 instead of using the overstrike bold. This seems to be the best way to handle bold/blink attributes when the foreground/background match and ANSI colour anyhow. For convenience, it is possible to use colour aliases (next item) for the foreground/background colours instead. My preference is a dull Canadian look: RXvt*foreground: 7 RXvt*background: 10 5. Changed colour aliases (item 7 of last change) and dropped the `#' prefix. This avoids confusion with the regular #rrggbb format of specifying colours and is unambiguous since there are no X11 colours starting with a digit. This also avoids the need to quote the `#' to protect against shell interpretation. 6. Added colour cursor support. -cr (cursorColor), as per XTerm -> the (rectangle) cursor colour -cr2 (cursorColor2), only RXvt -> the text colour. The cursorColor2 maintains contrast in a colour environment and is optional. Thanks Raul Garcia Garcia for the idea. Cleaned up scr_refresh (again ) to avoid some unnecessary colour changes and removed the reverse video graphics context and just swap foreground/background colours instead. 7. Typo in command.c: had seteuid() instead of seteguid() Use cfsetospeed()/cfsetispeed() for POSIX termios handling. 8. Ignore the loginShell option/resource for programs that DON'T end with "sh". A hack but it keeps `rxvt -ls -e rlogin machine' from failing and I don't know of (m)any shells that don't end in "sh". 9. Hard-code dependencies in Makefiles to avoid using X11 makedepend. Added check for atexit() to catch the problem that exists on SunOS but not on Solaris. 10. Collected command-line option parsing and X11 resources into a single file (xdefaults.c), and introduced a monolithic structure (with bit-flags for logical options) to eliminate the massive if-else-if parsing and to reduce possible overlaps/oversights Short help provided for an incorrect argument. For more consistency, more flexibility, and fewer switches, made -grk4/-grk9 options obsolete, and replaced with `-grk mode'. Added the resource `greek_keyboard' while I was there. It is also possible to use a `--' or `++' prefix to get so-called `long options' that correspond to the resource name. For example, rxvt +ls -bg Blue rxvt +loginShell -background Blue rxvt ++loginShell --background Blue rxvt ++ls --bg Blue Error! 11. Changed REFRESH_PERIOD to 1 in command.c, the old idea of providing for fast and furious scrolling needs to be reconsidered so that `cat' works. Still needs some investigation. 12. Changed scr_poweron(), which corresponds to `ESC c', to also reset the scrollback buffer. 13. Changed scr_change_screen() (when compiled with NO_SECONDARY_SCREEN) so that switching from the secondary to primary screen will push the old secondary screen into the scrollback buffer. This is fairly useful if your terminfo has have rmcup=\E[?47l\E8, smcup=\E7\E[?47h. It is NOT particularly useful if rmcup includes \E[2J, like some do. Running with NO_SECONDARY_SCREEN provides faster switching than with a real secondary screen and saves memory too. 14. Now that key values have mostly stabilized, moved the compile-time key choices to "feature.h" ("keys.h" now obsolete). 2.15 to 2.16 \----------- 1. Misc cleanup, rxvt once again passes the vttest (and reverse video works again). Kanji support tested and seems to be okay. Finally, an okay set of regular/bold colours. Compile-time option for a right-side scrollbar. 2. Ctrl-minus now (correctly) generates ^_ [0x1F]. Changed termcap/terminfo to use normal cursor keys instead of application cursor keys (rmkx/smkx, ke/ks) -- otherwise subsequent rxvt/xterm starts with the application cursor keys active. 3. Fixed scr_reset() so that resizing is a lot more sensible. Implemented the equivalent SouthWest resizeGravity (xterm X11R5) so the bottom line of text on the screen stays fixed. If the window is made taller, additional saved lines will be scrolled down onto the screen; if the window is made shorter, lines will be scrolled off the top of the screen, and the top saved lines will be dropped. The old resizing code is available with -DOLD_UGLY_RESIZE. 4. Altered code so all man-page documented command-line options will not trigger errors even if the feature wasn't compiled into rxvt. Added old, backward compatibility command-line options, but they're simply ignored. Eventually they can be removed -- perhaps Jan'97? `-8': use `+7' `-fat': use `-sb' `-thin': use `-arrows' `-meta8thbit' use `-meta8' `-metaescape' use `-meta' `-font_list' use `-font1', `-font2', etc. These ones are just too weird to support: `-ls-': use `+ls' `-ma-': use `+ma' 5. Removed secure-keyboard option, too problematic and obscure. 6. First attempt at GNU autoconfig. Still needs some work, but it's mostly okay. 7. Added minor aliases for foreground/background colours. This permits colour specifications like -fg "#13" -bg "#10", which would set the foreground to colour 13 (bright yellow) and the background to colour 10 (bright black). It's not terribly useful yet, but might eventually be a nice way to have bold/blink colour work even on with the standard fg/bg colours. 2.14 to 2.15 \----------- 1. Small bug: initial width incorrect when there was no scrollBar. 2. Close the gaping security hole. Renounce setuid/setgid privileges immediately and only take them up as needed -- chown() or writing into /etc/utmp. 3. Reverted to using `<' and '>' to toggle smaller/bigger fonts. It seems that many didn't like KP_Subtract/XK_KP_Add -- conflicts with some editors, and not all terminals have a Keypad anyhow. 4. Man page reformatted by Piercarlo Grandi so that it "now is done in the most delightful [sic] elegant 'roff style :-)" 5. Started to integrate the Kanji support based on old patches from the Linux-JE (Japanese Extensions) project. Consider it alpha until one of the JE authors gives it a thorough check. 6. Added compile-time selection of a few different scrollbar widths. 7. When reading X resources, rxvt now recognizes two class names: "XTerm" and "RXvt". The reason for two distinct names is that there are many options common between rxvt and xterm -- to which the class name "XTerm" permits easy access and configuration -- but there are also several options, notably colours and key-handling, unique to rxvt but which are useful to share between different rxvt configurations; the class name "RXvt" permits this. NB: The "RXvt" class takes precedence (in the event of a clash) and is the only one ever used for the application defaults file. 8. The initial value used for the Backspace key (^H or ^?) is now determined from the value of CERASE used to set the termios structures. This removes the need for the BACKSPACE_AS_DELETE compile-time option. 2.13 to 2.14 \----------- 1. Default HOTKEY prefix can now be choosen as `meta', `ctrl' or `shift'. Moved font toggle to KP_Add/KP_Subtract to resemble resolution toggling of the XFree86 server (Linux) and so that Alt-< can generate ESC-< for Emacs usage. Man page and usage() reflect the changes. Note that if you choose the hotkey to be `shift', to mimic the Linux console scrollback, you'll probably want different keybindings for mapAlert and Secure. The choice of the HOTKEY (ctrl or meta) prefix and some of the key-strings can be compile-time defined in "rxvtkeys.h", although probably the only changes desired will be in the string value associated with XK_Delete and in the choice of a HOTKEY (ctrl or meta) prefix. Use shift or ctrl to temporarily toggle Backspace from ^H to ^?. Use shift to temporarily toggle the application keypad. 2. Patch so that setting bold or blink works before or after changing the colour (it used to only work before changing the colour). Also added the option of having DOS VGA colours. Thanks Avery Pennarun 3. Extensive reworking of pseudo-tty handling and addition of BSD sgtty terminal handling and new utmpx (Solaris 2.x) support. MANY thanks to Raul Garcia Garcia (rgg@tid.es). POSIX wtmp support added by Piet W. Plomp (piet@icce.rug.nl) Added -/+ut option (resource: utmpInhibit) so you can sometimes be harder to find :) 4. Finally? cleaned-up selection so that it works properly -- clears a previously selected region without causing a core dump -- define NEW_SELECTION. I believe that this should fix a long-standing problem with the selection mechanism -- probably back from when selection of the scrollback was added -- whereby all accounting was done in terms of screen row values [0 .. RxvtWin.rows-1] plus the current offset value. The anchor and end points were scrolled with the screen, but the beginning point wasn't and extending a region that had its anchor scrolled-off would give complete garbage. The new selection scheme has lots of bounds-checking (too much?) to prevent these problems. If PRINT_PIPE is not defined, then you can use PrintScreen to dump some of the current selection state -- this should help debugging. Thanks to John Davis (davis@space.mit.edu) and Piet W. Plomp (piet@icce.rug.nl) for helping to diagnose the problem. 5. Use information request `ESC [ 8 n' to change the window title to the current rxvt version so you can find out what version you have. 6. Added simple code to permit run-time definition of the keysyms 0xFF00 - 0xFFFF if KEYSYM_RESOURCE (for FAKE_RESOURCES only) is defined. It's not as pretty as that used by xterm since it only works with keysym values rather that key names, but the impact on code size is quite minimal. I use it in conjunction with `-name vm' to remap arrow and function keys for tn3270 ... quite handy. At the moment the string length is only limited by the line length (currently 256) used in "resources.c" The syntax (at the moment) is rxvt*keysym.0xFFnn: "a string value" where `nn' is a 2 digit hex value 00 to FF. Of course if there were an easy and small means of converting key names to keysym values, then that would be better. The enclosing quotes are required to start/end with whitespace. Most of the usual escape values can be used: \b - backspace \e - escape \n - newline \r - carriage return \t - tab \000 - octal number Anyhow, here's a brief example of what it looks like in ~/.Xdefaults: ! F11 key - mimic the output of F1 rxvt*keysym.0xFFC8: \e[11~ ! F12 key - whatever rxvt*keysym.0xFFC9: Hello World!\n"\"String\" ends with whitespace " ! Delete key - remap rxvt*keysym.0xFFFF: "Delete :)" !Scroll_Lock as flow-control (^S) rxvt*keysym.0xFF14: \023 7. Oops -- fixed resource name from scrollbar to scrollBar. Fixed cursor colours to black on white (like xterm) for the scrollbar cursors, but I've left the xterm (`I'-bar) cursor as foreground on background because it looks so nice. Allocate all colours when creating the window so that we don't have to worry about it later and so that we can avoid potential hassles with colour-hungry applications like Netscape. 8. Added a way to distinguish an rxvt from an xterm via the obsolete ESC Z sending the vt100 answer string with 'c' -> 'C'. Added support for resolving the actual IP number of the host for remote DISPLAYs. Changed the answer back for ESC[7n to add a trailing newline to support easier input into the shell. When the display is local (i.e. :0), we add support for sending the first non-loopback interface IP number as the DISPLAY instead of just sending the incorrect ":0". This way telnet/rlogin shells can actually get the correct information into DISPLAY for xclients. Courtesy of Chuck Blake [Note: I've not had a chance to thoroughly test this -- mjo] 2.12 to 2.13 \----------- 1. Shift and Control now only work for non-application mode cursor keys and with function keys. 2. Override XTerm mouse reporting with either Mod1 or Shift. X11 mouse reporting now properly includes modifier keys (see rxvt.ref). Although this effectively degenerates to the Control modifier alone since both Shift and Meta are used to temporarily disable mouse reporting -- I don't know an easy way around this but that's what XTerm does, although since it uses Control to pop-up menus, that doesn't get transmitted either. 3. Moved a few more configuration items from Imakefile to configure.h 4. Added XAPPLOADDIR define to the Imakefile to allow use of the application defaults file XAPPLOADDIR/RXvt when rxvt has been compiled with FAKE_RESOURCES. Now, the following files are checked: XAPPLOADDIR/RXvt (compile-time defined) $HOME/.Xdefaults or $HOME/.Xresources suggested by John Gotts 5. Applied patches by Edward D.H. Liu to fix the speed of pasting rxvt's selection to motif, xew or tk. Finally! reasonable pasting speed to these applications. 6. patches by Gregory Margo for xterm-style proportional scrollbar behaviour: If pointer is near top, scroll one line. If pointer is near bottom, scroll full page. refreshPeriod resource and -refresh option ... still wishing for faster screen refreshing. 7. Bug fix for partial matches (FAKE_RESOURCES). In addition to resources for resource name `rxvt', also get resources for class name `XTerm' as well. Remove checking for `command' resource since it's not found in xterm nor was there any code in place to parse the command arguments ... better just to use the command-line -e option. Replace `fontList' with font1, font2, ... etc. for better xterm compatibility and for ease of configuration. Changed processing of string resources and command-line string options to avoid allocating redundant memory. 8. Previously selected region is now properly cleared when Button1 is pressed. Still have problems with click-and-drag when Mod1 or Shift is used to override mouse reporting -- argh! Until someone gets this properly patched, use Button1 followed by Button3 (to extend region) in these instances. 9. Understands ANSI set default fg/bg colour (\E[39m / \E[49m) 10. In the screen accounting used in screen.c, use a '\n' to terminate wrapped lines instead of '\0'. This should avoid mouse selection of wrapped lines from including a bogus newline. No known side-effects, but changes isolated by #define NEW_WRAPTYPE. 2.11 to 2.12 \----------- 1. Extra functionality for XTerm mouse report mode. If mouse reporting is enabled (the application will handle mouse events) the normal scrollbar operation is disabled -- instead rxvt sends UP/DOWN for the arrow buttons and PageUp/PageDown when Button1 or Button3 are clicked on the scrollbar. Use Mod1 (Alt) key to get the normal scrollbar/arrow button actions and also to get the normal selection functions -- so that you can still cut/paste between X applications. 2. New colour possibilities -- 16 colours. Instead of using fatter characters, a bold attribute now uses a brighter foreground colour. Similarly, a blink attribute will use a brighter background colour. It is also possible to choose these colours through the resources (color0 -- color7) permit specification of the ANSI colours (black, red, green, yellow, blue, magenta, cyan, white), the resources (color10 -- color17) are the brighter bold/blink equivalents. Define USE_FAKE_BOLD to disable. 3. Extensive clean-up of source and headers to separate interdependencies, remove unused variables. Introduced static variables wherever possible to limit scoping and reduced the number of external variables. 4. Allow NumLock to toggle on/off the application keypad. Backspace sends '\b', Ctrl-Backspace sends '\177'. Define BACKSPACE_AS_DELETE to reverse these values or use the escape sequence: ESC [ 36 h Backspace key sends BS ESC [ 36 l Backspace key sends DEL XK_End used to send "\033Ow", which is identical to XK_KP_7 and confuses EDT-type editors. Now, Home = "\033[7~" End = "\033[8~" Changed Alert & Secure keys from Alt-i & Alt-s to Alt-I & Alt-S so they aren't so easily toggled. 5. Extra keystroke info. Pass Control and Shift indicators for function keys (similar to the XJed editor) eg, F1 = ESC [11~ C-F1 = ESC [11^ S-F1 = ESC [11$ also, pass indication of shift status for arrow-keys eg, Up, Down, Right, Left = ESC [A, ESC [B, ESC [C, ESC [D S-Up, S-Down, S-Right, S-Left = ESC [a, ESC [b, ESC [c, ESC [d You wouldn't be able to use these keys for termcap/terminfo applications, but the key sequences are available for remapping within an application. 6. Added configure.h which is included by each source file and by the Imakefile. Common compilation defines are now all contained in configure.h with minor system defines remaining in Imakefile -- makes it much easier to configure. Used XCOMM macro in Imakefile so that it actually works. Also added defaults.h for defining user-specific startup defaults. 7. Added rxvt.ref to provide documentation of the various terminal sequences that are processed. Updated man page to reflect changes. 8. Use xterm-style -/+ to turn on/off options, rationalized resource names to more closely resemble xterm. Option Resource -help - -display displayname - -geometry geom geometry: -bg color background: -fg color foreground: -color color color: where = [0-7], 1[0-7] -fn fontname font: -fontList names fontList: ... -name string - -/+ls loginShell: True/False -/+ma mapAlert: True/False -/+vb visualBell: True/False -/+sb scrollbar: True/False -/+arrows scrollbar: Arrows/True/False -ic - -meta8 meta: 8bit -/+meta meta: True/False -sl number saveLines: -grk4 - -grk9 - -print-pipe name pipe-pipe: -e command arg ... command: -T string title: -n string iconName: -C - -/+7 bits: 7/8 -secure keysym secure_key: -pageup keysym pageup_key: -pagedown keysym pagedown_key: -bigfont keysym bigfont_key: -smallfont keysym smallfont_key: -prkey keysym printscreen_key: greektoggle_key: cutchars: 9. Fixed Button actions for XTerm-style scrollbar so that Button1 and Button3 do different things as they are supposed to. Replace -/+fat with -/+sb and -/+arrows for more consistency with XTerm. Decreased width of `fat' scrollbar (make closer to xterm) and increased width of `thin' scrollbar (arrows too small) -- they are now the same width. Also made it possible to remove the scrollbar altogether. Added a visual bell. Added many more defines to further reduce code size for various cases, see "configure.h". It is also possible to alter settings in "defaults.h" for configuration options that will only affect screen.c and xsetup.c, this should help with compile-time customization for those who don't want to use Xdefaults. Added the define REPLACE_SELECTION_NEWLINE to make the substitution of newlines with carriage returns for selection pasting a compile-time option. 10. Fixed the graphics samples so that if you want to it's actually possible to compile them. Added -name command-line option so that it's possible to select different sets of resources. 11. Integrated initial support for X11 mouse reporting and added Shift + Function Keys support. 2.10 to 2.11 1. If NEW_COLOR_MODEL is defined in screen.c, the new model I described in an earlier email is used. (apparantly there are two, slightly differnt models for using color extensions in a vt-compatible terminal. This flag lets you switch. 2. If XTERM_MOUSE_REPORT is defined in command.c, mouse reporting is turned on/off via the appropriate escape sequences. XTerm already provides this support. 3. If .Xdefaults does not exist, .Xresources is searched for. It seems that many here use .Xresources. 2.09 to 2.10 1. Really fixed the color problem (?) Got color-ls, and it works now. 2. Added patch to allow run-time selection of font list. 2.07 to 2.09 1. Fixed some color-usage errors. 2. Added double and triple-click support compliments of ah@doc.ic.ac.uk (Angelo Haritsis) 3. Added Print Screen capability, as in most vt-100's 2.06 to 2.07 1. Fixed problems with rxvt screwing up tty permisssions (?) 2.03 to 2.06 1. Fixed a limit which imposed a maximum width for the terminal window of 255 characters. There is no limit now. 2. Made provision for applications to get mouse-click feedback when user clicks in a graphics window. See graphics_sample 2.02 to 2.03 1. Fixed memory management just a little. 2.0 to 2.02 1. Bug fixes for color and graphics. 1.97 to 2.0 1. Added ANSI color support. Compile with -DCOLOR 2. Added a graphics mode. Compile with -DGRAPHICS 1.96 to 1.97 1. Bug in refresh() which was causing slow refreshes after clear-screens was fixed. Showed up during emacs start-up. 1.95 to 1.96 1. rxvt did bad things if it received mouse - Motion events without a preceeding button-press. Fixed. 1.94 to 1.95 1. Created a substitute for XGetDefaults, which seemed to account for 1/2 to 2/3 of the memory used by rxvt (according to the SIZE field of ps output). My substitute only reads the .Xdefaults file. Compile with -DFAKE_RESOURCES to get my mini- XDefaults handling, -DREAL_RESOURCES to keep XGetDefault. 1.93 to 1.94 1. Fixed some minor long-standing errors in the vt100 emulation. 2. Fixed ALT- handling in command.c 3. Fixed minor bug with start-of-selection location. 4. Added xterm-type "extend selection" feature using mouse button 3. Button 1 always starts a new selection. Button3 tries to extend the current selection if possible. 5. Fixed problem with bold-face fonts overflowing into the next character for some fonts. 1.92 to 1.93 1. ran gprof to find bottle-necks in the code. Halved user time, but had little effect on total time required to update the display. Seems worth keeping for the more efficient user-time, though. At this point, I think that most of the elapsed time is spent waiting for input or waiting for the X buffers to flush. 2. Used to refresh the screen every 2.2 screen-fulls during flat-out scrolling. Really cuts down on scroll-time. Now, refresh every screen-full (or when there's a pause in activity), but when flat-out scrolling starts, decrease the refresh period, so that its every 10th screenful after a little while. This has no noticeable visible effect, since the scrolling text is absolutely unintelligible anyway, but will improve the scroll "feel" when doing just one or two screenfulls, ie in an ls -l. 3. Surrounded the code which uses XCopyArea with #ifdef's I have never seen this help performance, but I think that there may be some video-systems which benefit from this, particularly in a full-screen editor or slow scrolling type of setting. 4. Performance in flat out scrolling, text only, on a sparc-10, displaying rxvt on an HDS x-terminal: nation@snoopy>/usr/bin/time rxvt -e cat k 6.1 real 3.1 user 2.5 sys nation@snoopy>/usr/bin/time xterm -e cat k 40.8 real 4.6 user 3.4 sys 1.91 to 1.92 1. Added greek-keyboard support patches. 1.85 to 1.91 1. assorted minor patches 1.82 to 1.85 1. Fixed ESC c handling. 2. Fixed minor selection handling bug. 1.81 to 1.82 1. Fixed slow refresh during selection process 2. Fixed problem of not correctly clearing selections of 1 character. 1.80 to 1.81 1. Fixed some scrolling problems, problems with partially obscured windows. 2. Added some neat debugging capability in debug.c 3. Patched up rclock. 1.74 to 1.80 1. Fixed core dump from selecting past the bottom of the screen 2. Fixed a few escape sequences, per the vttest program 3. Broke and fixed handling of moved/resize/new-font handling. 4. Still can't change tab stops correctly. 5. Ran vt-100 test suite. Added capability to change tab stops and enter reverse video, and to switch from 80 to 132 columns and back. Fixed a seg-fault in scroll(). 1.70 to 1.74 1. Fixed cursor drawing errors. 2. Improved smoothness of scroll-back operations. 3. Applied some SVR4 patches. 4. Applied HPUX patches, and a few cursor display patches 5. Fixed up font-changing routines a bit. 6. Fixed a scrolling problem for windows taller than the scroll-back buffer. 1.6 to 1.7 1. Fixed the problem with random rendition flags in the scroll back buffer 2. Fiddled with re-drawing on the scroll-bar, and with how often refreshing occurs. 3. Incorporated some AIX patches. 4. Included #ifdef'd changes to support vt100 printer. 5. Fixed send_string routine, so that it doesn't loose data. 6. Complete re-write of screen.c 1.5 to 1.6 1. Removed all use of a seperate bold font. Now uses over-striking exclusively. 2. Added some more optimizations for drawing speed when the window is re-sized or moved. 3. Implemented speed ups in screen.c 1.47 to 1.48 1. Cleaned up re-drawing on expose events, so rxvt only re-draws the newly exposed parts of the screen. 2. Fixed backspace, which must have broken in 1.45. 3. Added command line option of iconic startup. from 1.45 to 1.47 1. Incorporated improved bsd utmp handling from dperry@ringer.cs.utsa.edu (David Perry) 2. Fixed a very minor bug where the solid-cursor can leave a a bit of a ghost when you resize the window. Its stupid, but it always bothered me. from 1.4 to 1.45 1. Fixed scrolling error when switching to larger fonts 2. Fixed utmp-entry removal for SYSV type systems. 3. Icorportated patches for FreeBSD and svr4 aterm-1.0.1/doc/README.xvt0000644000175000001440000001426710144447041013571 0ustar vaeusers------------------------------------------------------------------------- Rxvt is a heavily modified version of xvt, many modifications were made by Rob Nation to make it a little more compact and to add a few simple features. This is the README that came with xvt-2.0. It is included mainly to give the original author credit for his work. README file for xvt 2.0 ----------------------- Xvt is an X terminal-emulator that is designed to be more or less compatible with xterm while using much less swap space. It is mainly intended for use at sites which use large numbers of X terminals but may also be useful on single workstations that are short of memory. On a SPARCstation running SunOS4, an initially invoked xvt uses about 1/3 megabyte of swap while xterm uses about 1.3 megabytes (obtained by running pstat rather than ps which seems to give unreliable size figures on SPARCs). The main way that xvt achieves its small size is by avoiding the use of the X toolkit. The current version of xvt is our default X terminal emulator and has been used for eight months by students, computing support staff and service users and so is fairly well tested. Supported architectures ----------------------- One of the major changes between xvt-1.0 and 2.0 is that xvt-2.0 is much more portable. The released version should build and run on all the architectures I have access to, namely: SunOS4, SunOS5, HP-UX 8.0, HP-UX 9.0, DEC OSF/1 V1.2 and ULTRIX 3.?. In addition, the teletype initialisation code has been completely restructured to make it more portable. Almost all the system dependent code is in the single source file, ttyinit.c. Xterm features not supported ---------------------------- - Tektronix 4014 emulation - Session logging - Pop-up menus. The only one of xterm's popup menu commands that is provided in xvt is displaying and hiding of the scrollbar and this is done simply by pressing any mouse key in the window with the CONTROL key held down. - Toolkit style configurability. In particular, xvt does not allow the user to remap the mouse or keyboard keys. Major xterm features that are supported --------------------------------------- - VT100 emulation. Most of the main escape sequences are supported - certainly all those used by the standard screen based UNIX applications. - Lines that scroll off the top of the window are saved can be scrolled back with a scrollbar. - Text selection and insertion including double and triple click for words and lines. Differences between xvt2.0 and xvt1.0 ------------------------------------- - xvt2.0 is eight bit clean and will generate and display eight bit characters. The META key can be used to generate characters with the eighth bit set (in eight bit mode) or prefix by escape (in seven bit mode). - The teletype setup code has been rewritten to make it much more portable. See the comments at the head of ttyinit.c. - Exposure handling has been made much more efficient so that xvt should now be useable with window managers that provide opaque window movement. - VT100 graphics characters are supported for fonts that include them. - There is now a -ls option to enable the use of a login shell. - Colored text cursors are now supported. - There is support for the -C (console window) option but only on SunOS 4. - Bold characters are generated by overstriking if no bold font is specified. - Function keys generate escape sequences as in xterm. - A number of bugs have been fixed: - Setting the title without a terminating ^G no longer locks up. - Paste followed by a keystroke will always insert in the correct order. - Pasting an uninitialised string will not cause a crash. Other differences between xvt and xterm --------------------------------------- - Xvt has a couple of additional enquiry escape sequences: ESC[7n - causes xvt to respond with the name of its X display in a form that can be used to initialise the DISPLAY environment variable. If this is done in a user's .cshrc file it provides a way to automatically update DISPLAY after an rlogin. Something like the following should work if the initial ^[ in the echo command is an ESC character: if(!($?DISPLAY)) then if($?term) then if($term =~ xterm*) then stty -echo >/dev/tty echo -n '^[[7n' >/dev/tty setenv DISPLAY `line /dev/tty endif endif endif ESC[8n - causes xvt to respond with a hex encoded copy of the server's magic cookie which can be used to update a user's .Xauthority file. We have a program to do this which could be made available if anyone is interested. Known Bugs ---------- - xvt does not know about transferring selections in installments and so making large selections or trying to insert large selections will fail. The maximum selection size supported is server dependent but seems to be a little under 64k on all our servers. - xvt does not look in all the approved places for its X resources. It does, however, work correctly with resources that have been loaded into the server using xrdb Building and installing xvt --------------------------- Xvt does not use imake but does come with a simple Makefile configuration scheme that provides some help with getting the Makefile right. If you want to build xvt on one of the supported architectures then you should uncomment the appropriate definition at the start of the Makefile and then run `make config', which will modify other Makefile comments to bring them into line with the chosen architecture. To install xvt, you should edit the MANDIR and BIN pathnames in the Makefile and then type 'make install' as root. When installed for general use, xvt needs to belong to root and have the setuid flag set so that it can make entries in the /etc/utmp file. Thanks to all the people who have mailed bug reports, patches and local improvements. Some requested additions have gone into V2.0, others perhaps should have, but were left out due to lack of time. Please send bug reports and WIBNIs to: John Bovey Computing Laboratory University of Kent at Canterbury Canterbury Kent UK email: jdb@ukc.ac.uk aterm-1.0.1/doc/README.menu0000644000175000001440000000374010144447041013706 0ustar vaeusersA few examples of constructing menubars for rxvt. Used in conjuction with the reference material (rxvtRef.html/txt), it should be possible to piece together some useful menus without too much time. C-shell users be warned. Some of the menu items contain bsh/ksh constructs like ${EDITOR:-vi}\r which will cause your shell to gag. ---------------------------------------------------------------------- example.menu: simple menus for Pico and the Shell jedmenu.sl: (almost) self-contained SLang code for loading up a menubar for the Jed editor. It doesn't need terminal.menu, but looks a bit better with it. Note for JED users: since rxvt provides an escape sequence to override the normal XTerm interpretation of Shift-Insert/Prev/Next, "wmark.sl" (MS-windows-style shift marking) works really well and is a nice bonus for those forced to switch to/from MS-windows terminal.menu common rxvt terminal functions used by the other menus menu: a small shell script to reduce the pain of typing echo "ESC]10; ... BEL" for every menubar command. It also contains a sample "default" menu at the bottom. rxvt.menu: A nice script that allows a convenient way to have different menubars used for rlogin|telnet to a machine. Of course to get it to work, you'll need to add your own machine names (and remove mine). The script is set up so that "rxvt" will be called if the first argument to the script does not contain "rxvt". So rxvt.menu [options] is the same as rxvt.menu rxvt [options] To always have this script act as the front-end for rxvt: 1) install the rxvt binary somewhere not in your path 2) set the `exe' in menu.script to point to this binary eg, exe="/usr/local/X11/rxvt-2.21/rxvt" # default program to execute 3) have rxvt.menu linked somewhere in your path as `rxvt' 4) add all the various machines/menus combinations to rxvt.menu, or else make a separate database and change the `menu' variable in rxvt.menu to suit. aterm-1.0.1/doc/README.thai0000644000175000001440000000617710144447041013676 0ustar vaeusersThaiAterm Version 0.4.3 Beta (12/30/2000) - Description: * áÊ´§¼ÅÀÒÉÒä·Â â´Â·Õè¾ÂÑ­ª¹ÐáÅÐÇÃÃ³ÂØ¡ÂìÍÂÙè㹤ÍÅÑÁà´ÕÂǡѹ * àÁ×è͵͹·Õèà¤Íà«ÍÃìÍÂÙè·ÕèµÓá˹è§ÇÃÃ³ÂØ¡µì¹Ñé¹ Áѹ¨ÐáÊ´§¼Åà»ç¹ÊÕ à´ÕÂǡѹ¡ÑºÊբͧà¤Íà«ÍÃì ´Ñ§¹Ñé¹ ¤ÇèÐãªéµÑÇàÅ×Í¡ -cr [color] à¾×èÍãËéÊÒÁÒöàËç¹à¤Íà«ÍÃìä´éªÑ´à¨¹ * àÇÅÒ·Õè select »ÃѺµÓá˹觢ͧ mouse ãËéµÃ§¡ÑºË¹éÒ¨ÍáÊ´§¼Å * á¹Ç¤ÇÒÁ¤Ô´¹Ñé¹ ÅÍ¡ÁÒ¨Ò¡¤Ø³ ÇØ²ÔªÑ ÍÑÁ¾ÃÍÃèÒÁàÇ·Âì «Öè§à¢Õ¹ â»Ãá¡ÃÁ Thai Xiterm 1.0 * ãªé aterm àÇÍÃìªÑ¹ 0.4.0 àÍÒÁÒà¾ÔèÁàµÔÁ ¨Ö§·ÓãËéÁÕÈÑ¡ÂÀÒ¾ àËÁ×͹¡Ñ¹¡Ñº aterm ¡ÅèÒǤ×ÍÊÒÁÒö·Ó transparent background ËÃ×ÍÃÙ»ÀÒ¾µèÒ§æä´é * support XIM áÅÐ Xfree86 4.0.2 * ãªéä´é¿ÃÕ µÒÁà§×è͹ä¢ÅÔ¢ÊÔ·¸Ôì¢Í§ GPL - Author: * Teepanis Chachiyo * Programmers ÍÕ¡ËÅÒ¤¹·Õèà¢Õ¹â»Ãá¡ÃÁ aterm * ÇØ²ÔªÑ ÍÑÁ¾ÃÍÃèÒÁàÇ·Âì à»ç¹¤¹ÃÔàÃÔèÁ¡ÒÃà¢Õ¹ãËé xiterm ãªé ÀÒÉÒä·Âä´é ¹Í¡¨Ò¡¹Õé algorithm ºÒ§Êèǹ¼Á¡çÅÍ¡à¢ÒÁÒ * suchness ÃèÇÁÍÍ¡¤ÇÒÁàËç¹áÅЪÕéá¹Ð bug - Examples: * bash:\# thaiaterm -ls -fn thaix17 -tr -tint red µÑÇÍÂèÒ§¢éÒ§µé¹¹Ñé¹ Ãѹ thaiaterm â´Âãªé¿é͹Êì thaix17 áÅÐãËé ©Ò¡ËÅѧà»ç¹áººâ»Ãè§ãÊ ·ÕèÁÕ filter ÊÕá´§ * bash:\# thaiaterm -ls -fn thaix17 -tr -trsb ·ÓãËéâ»Ãè§ãÊ·Ñé§ µÑÇÇÔ¹â´ÇìáÅÐ scrollbar - TODO * ¡Òà wrap á¶ÇµÑÇÍÑ¡ÉùÑ鹺ҧ·ÕÁѹ wrap µÑ´ÇÃÃ³ÂØ¡ÃìŧÁÒ * àÃÔèÁà»Ô´ screen ÁѹªéÒà¡Ô¹ä» áµèã¹ aterm ¸ÃÃÁ´Ò¡çªéÒàËÁ×͹¡Ñ¹ ´Ñ§¹Ñé¹µéͧá¡é·ÕèµÑÇ aterm àÅ - FIXED (1/3/2001) * µéͧá¡é¡Òà update cursor àÊÕÂãËÁèà¾ÃÒÐÇèÒÁѹ flicker (1/3/2001) ]d ¾º bug ·ÕèÇèÒ àÇÅÒ·Õèãªé mouse highliht ੾ÒФÓÇèÒ "·Õè" ¹Ñé¹ Ë¹éÒ¨ÍÁѹ¨ÐäÁèà¤ÅÕÂÅì highlight ʧÊÑÂÁÕ bug µÃ§·Õè ¡Òà hightlight ÊÒà˵ءç¤×ÍÇèÒµéͧàªç¤ÇèÒà»ç¹ ¾ÂѪ¹ÐËÃ×Íà»ÅèÒ¨Ö§¤èÍ XFillRec (1/2/2001) à»ç¹Ë¹éÒ·Õè¢Í§ XIM * ¶éÒÁÕÇÃÃ³ÂØ¡¹ìàÃÔèÁ·ÕèµÑÇáá¢Í§á¶Ç Áѹ¨ÐÁͧäÁèàËç¹ áµèÇèÒ¤ÇÒÁ¨ÃÔ§ àÃ×èͧ¹Õé¤ÇèÐà»ç¹Ë¹éÒ·Õè¢Í§ software ·Õè¨Ðàªç¤àͧ (1/2/2001) * àÇÅÒ·ÕèàÅ×è͹ cursor hightlight ŧÁÒÁѹ segfault (1/1/2001) * ¤Ø³à·¾ ãËé patch ¡ÒÃãªé XIM ¢Í§ Xfree86 4.x (12/28/2000) * ÁͧäÁèàËç¹ cursor µÍ¹·ÕèÁѹªÕéä»·ÕèÇÃÃ³ÂØ¡Âì (12/26/2000) (12/27/2000) * ºÒ§·ÕÁѹźµÍ¹·éÒÂæ ÍÍ¡ä» (12/27/2000) * ¶éÒãªéÍèÒ¹ä¿Åì·ÕèÁѹµéͧ swap text ŧÁÒ ÍÒ¨¨Ðµéͧ update ÍÕ¡¤ÃÑé§à¾ÃÒÐäÁè§Ñé¹áÅéÇÁѹ¨ÐÁÕ ÍÑ¡ÉкҧµÑÇàËÅ×Íà»ç¹¢ÂÐ (test2.txt) Íѹ¹ÕéÁѹÂÒ¡¨Ñ§àÅ (12/26/2000) * flicker ¹Ôé´à´ÕëÂÇÁÒ¨Ò¡ä˹ÇÐ (12/26/2000) * ¡ÒÃàµÔÁ¢éÒ§ËÅѧ¹Ñé¹ÂѧÁÕ flicker ÍÂÙè (12/26/2000) * ¾Í swap ˹éÒ¨ÐÁÒÁѹÁÕ cursor Íѹà¡èÒàËÅ×ÍÍÂÙè (12/26/2000) * [ÂѧÁÕºÒ§Êèǹ¢Í§ screen ·ÕèäÁè update àÁ×èÍãªé´Ùä¿Åì /test/test1.html] - BUG REPORT * ¶éÒ¾º¢éͼԴ¾ÅÒ´¢Í§â»Ãá¡ÃÁ ·èÒ¹ÊÒÁÒöÊè§ email ä»·Õè â»Ãá¡ÃÁàÁÍÃìâ´ÂµÃ§ ÀÒÂãµé Subject: thai-aterm bug - Algorithm * á¡é¡ÒÃáÊ´§¼ÅÀÒÉÒä·Ââ´Â¡ÒÃà»ÅÕè¹ function Col2Pixel ä»à»ç¹ ThaiCol2Pixel â´Â·Õè function ¹Õé¨Ðà»ÅÕè¹µÓáË¹è§ ¤ÍÅÑÁ¢Í§µÑÇÍÑ¡ÉÃä»à»ç¹ x coordinate ¢Í§¨Í¡ÃÒ¿¿Ô¤ * Êèǹ·éÒ¢ͧÇÔ¹â´ÃìÁѹ¨Ð¢Ò´ä» ´Ñ§¹Ñé¹àÃÒ¨Ö§µéͧàµÔÁãËéàµçÁ * á¡é¡ÒÃàÅ×Í¡´éÇ mouse â´Â¡ÒÃà»ÅÕè¹ Pixel2Col à»ç¹ ThaiPixel2Col * àªç¤ÇèÒ¤ÍÅÑÁä˹¤ÇèÐä´éÃѺ¡Òà update â´Â¡ÒÃàªç¤·ÕÅФÍÅÑÁ ´Ù ThaiUpdateMap à¾ÔèÁàµÔÁ Enjoy aterm-1.0.1/doc/aterm.10000644000175000001440000007637410307354320013270 0ustar vaeusers.TH "ATERM" "1" "05 July 05" "X Version 11" "X Tools" .SH "NAME" aterm (Afterstep XVT) \- a VT102 emulator for the X window system .PP .SH "SYNOPSIS" .PP \fBaterm\fP [options] [-e command [ args ]] .PP .SH "DESCRIPTION" .PP \fBaterm\fP, version \fB1\&.0\&.0\fP, is a colour vt102 terminal emulator, based on \fIrxvt\fP 2\&.4\&.8 with Alfredo Kojima\'s additions of fast transparency, intended as an \fIxterm\fP(1) replacement for users who do not require features such as Tektronix 4014 emulation and toolkit-style configurability\&. As a result, \fBaterm\fP uses much less swap space -- a significant advantage on a machine serving many X sessions\&. .PP It was created with \fBAfterStep\fP Window Manger users in mind, but is not tied to any libraries, and can be used anywhere\&. .PP .PP .SH "OPTIONS" .PP The \fBaterm\fP options (mostly a subset of \fIxterm\fP\'s) are listed below\&. In keeping with the smaller-is-better philosophy, options may be eliminated or default values chosen at compile-time, so options and defaults listed may not accurately reflect the version installed on your system\&. .PP Note that \fBaterm\fP permits the resource name to be used as a long-option (--/++ option) so the potential command-line options are far greater than those listed\&. For example: `aterm --loginShell --color1 Orange\'\&. .PP .IP "\fB-help\fP, \fB--help\fP" Print out a message describing available options\&. .IP "\fB-version\fP, \fB--version\fP" Print out a version with/without list of available options\&. .IP "\fB-display\fP \fIdisplayname\fP" Attempt to open a window on the named X display (\fB-d\fP still respected)\&. In the absence of this option, the display specified by the \fBDISPLAY\fP environment variable is used\&. .IP "\fB-geometry\fP \fIgeom\fP" Window geometry (-g still respected); resource \fBgeometry\fP\&. .IP "\fB-rv\fP|\fB+rv\fP" Turn on/off simulated reverse video; resource \fBreverseVideo\fP\&. .IP "\fB-bg\fP \fIcolour\fP" Window background colour; resource \fBbackground\fP\&. .IP "\fB-fg\fP \fIcolour\fP" Window foreground colour; resource \fBforeground\fP\&. .IP "\fB-pixmap:\fP \fIfile[;geom]\fP" Specify image file for the background and also optionally specify geometry of the image to be cut out of original image, to be used as background, with a geometry string\&. Note you may need to add quotes to avoid special shell interpretation of the `;\' in the command-line; resource \fBbackgroundPixmap\fP\&. .IP "\fB-mst:\fP \fIname\fP" Specify the name of the Afterstep MyStyle to be used as the base of aterm\'s look\&. ForeColor, BackColor, Font, BackPixmap (all texture options) will be used from MyStyle definition, unless some other command line option is specifyed for the same setting\&. For example -fn will override MyStyle Font\&. This is available only if used with AfterStep 1\&.9\&.28 or later and if compiled with AfterStep libraries support ( --enable-afterstep-lib)\&. resource \fBMyStyle\fP\&. .IP "\fB-tr\fP|\fB+tr\fP" Turn on/off pseudo transparency mode\&. In this mode \fBaterm\fP will use part of root background as it\'s own background, emulating see-through effect; resource \fBtransparent\fP\&. .IP "\fB-trsb\fP|\fB+trsb\fP" Turn on/off pseudo transparent scrollbar\&. Works the same as -tr; resource \fBtranspscrollbar\fP\&. .IP "\fB-tint\fP \fIcolor\fP" Turn on pseudo transparency background tinting\&. Tinting can be done fast and slow way\&. In fast way it will be done by combining of background color with tinting color using logical function\&. This function defaults to AND, and it can be changed using \fB-tinttype\fP option - see below\&. In general solid colors like Blue, Red, Green, Cyan, Magenta, Yellow are good, but you should experiment with it for each background you have\&. True tinting is more memory and CPU hungry - tinted copy of background image will be created every time you move/resize window\&. It alows for more smooth tinting thou\&. You need to build it with \fB--enable-transparency=yes\fP or \fB--enable-background-imageyes\fP option, to be able to use this feature\&. resource \fBtinting\fP\&. .IP "\fB-sh\fP \fIamount\fP" This option allows for darkening/lightening of the background image \fIamount\fP is the %value of the desired brightness, where 100 is the original\&. if \fIamount\fP is less then 100 - image will be darkened\&. if \fIamount\fP is less then 0 or more then 100 - image will be lightened\&. Lightening can cause some strange looking effects if applied on bright image\&. This option causes aterm to create shaded/lightened copy of the background - it\'s more memory cosuming as the result\&. It does not make much difference, though, if applied on non transparent background image\&. resource \fBshading\fP\&. .IP "\fB-fade\fP \fIamount\fP" This option allows for darkening/lightening of colors when aterm is loosing focus\&. \fIamount\fP is the %value of the desired brightness, where 100 is the original\&. if \fIamount\fP is less then 100 - colors will be darkened\&. if \fIamount\fP is less then 0 or more then 100 - colors will be lightened\&. Lightening can cause some strange looking effects if applied on bright colors\&. This option causes aterm to use more colors, as the result it is disabled by default\&. Use --enable-fading \&./configure option to enable it\&. resource \fBfading\fP\&. .IP "\fB-bgtype\fP \fItype\fP" Specify type of the transformation to be performed on background image\&. Possible types are : \fBtile\fP - plain vanilla tiling of the image\&. \fBscale\fP - original image will be scaled to the aterm\'s size, every time you resize window\&. \fBscalev\fP - original image will be scaled to the aterm\'s height only, every time you resize window\&. \fBscaleh\fP - original image will be scaled to the aterm\'s width only, every time you resize window\&. \fBcenter\fP - original image will be centered in aterm\'s window\&. \fBnotile\fP - background color will be padded to image\'s right/bottom to make it the same size as window is\&. \fBnotileh\fP - background color will be padded to image\'s right to make it the same width as window is\&. \fBnotilev\fP - background color will be padded to image\'s bottom to make it the same height as window is\&. \fBcut\fP - aterm background will be cut out of the source image, as if this source image was tiled across the root window\&. The portion of the image that lies underneath of window will be used\&. If AfterStep Pager, asetroot or Esetroot where used to set the root image, then this option can be used in conjunction with -tr option\&. In this case it will do mentioned transformations to the root pixmap\&. and use it as aterm\'s background\&. resource \fBbackgroundType\fP\&. .IP "\fB-txttype\fP \fItype\fP" Allows you to specify logical function to be used when displaying text\&. That will cause aterm to logically combine text with background pixels\&. That only works with transparent background and background image\&. Possible values are : \fIand\fP, \fIandReverse\fP, \fIandInverted\fP, \fIxor\fP, \fIor\fP, \fInor\fP, \fIinvert\fP, \fIequiv\fP, \fIinvert\fP, \fIorReverse\fP, \fIorInverted\fP, \fInand\fP; resource \fBtextType\fP\&. .IP "\fB-tinttype\fP \fItype\fP" Allows you to specify logical function to be used when tinting transparent background\&. That will cause aterm to logically combine text with background pixels\&. NOTE: If shading option is used, or background image is specifyed - \fItrue\fP type will always be used\&. That works with bpth transparent background and background image\&. Possible values are : .IP Fast tinting options : \fIand\fP, \fIandReverse\fP, \fIandInverted\fP, \fIxor\fP, \fIor\fP, \fInor\fP, \fIinvert\fP, \fIequiv\fP, \fIinvert\fP, \fIorReverse\fP, \fIorInverted\fP, \fInand\fP, .IP Slow tinting: \fItrue\fP - will do "true" tinting - that means that background pixel\'s RGB components will be decreased proportionaly to the RGB components of specified tinting color; resource \fBtintingType\fP\&. .IP "\fB-cr\fP \fIcolour\fP" The cursor colour; resource \fBcursorColor\fP\&. .IP "\fB-pr\fP \fIcolour\fP" The mouse pointer colour; resource \fBpointerColor\fP\&. .IP "\fB-bd\fP \fIcolour\fP" The colour of the border between the xterm scrollbar and the text; resource \fBborderColor\fP\&. .IP "\fB-bl\fP \fInumber\fP" This option specifies that aterm should askwindow manager to not have a border around term's window; resource \fBborderLess\fP\&. .IP "\fB-bw\fP \fInumber\fP" This option specifies the width in pixels of the border surrounding the window; resource \fBborderWidth\fP\&. .IP "\fB-fn\fP \fIfontname\fP" Main normal text font; resource \fBfont\fP\&. .IP "\fB-fb\fP \fIfontname\fP" Main bold text font; resource \fBboldFont\fP\&. .IP "\fB-fm\fP \fIfontname\fP" Main multicharacter font; resource \fBmfont\fP\&. .IP "\fB-ib\fP \fIwidth\fP" Width of the internal border in pixels; resource \fBinternalBorder\fP\&. .IP "\fB-km\fP \fImode\fP" Multiple-character font-set encoding mode; \fBeucj\fP: EUC Japanese encoding\&. \fBsjis\fP: Shift JIS encoding; resource \fBmultichar_encoding\fP\&. .IP "\fB-grk\fP \fImode\fP" Greek keyboard translation; \fBiso\fP: ISO-8859 mapping\&. \fBibm\fP: IBM-437 mapping; resource \fBgreek_keyboard\fP\&. .IP "\fB-name\fP \fIname\fP" Specify the application name under which resources are to be obtained, rather than the default executable file name\&. Name should not contain `\&.\' or `*\' characters\&. Also sets the icon and title name\&. .IP "\fB-ls\fP|\fB+ls\fP" Start as a login-shell/sub-shell; resource \fBloginShell\fP\&. .IP "\fB-ut\fP|\fB+ut\fP" Inhibit/enable writing a utmp entry; resource \fButmpInhibit\fP\&. .IP "\fB-vb\fP|\fB+vb\fP" Turn on/off visual bell on receipt of a bell character; resource \fBvisualBell\fP\&. .IP "\fB-sb\fP|\fB+sb\fP" Turn on/off scrollbar; resource \fBscrollBar\fP\&. .IP "\fB-si\fP|\fB+si\fP" Turn on/off scroll-to-bottom on TTY output inhibit; resource \fBscrollTtyOutput\fP has opposite effect\&. .IP "\fB-sk\fP|\fB+sk\fP" Turn on/off scroll-to-bottom on keypress; resource \fBscrollKey\fP\&. .IP "\fB-sr\fP|\fB+sr\fP" Put scrollbar on right/left; resource \fBscrollBar_right\fP\&. .IP "\fB-st\fP|\fB+st\fP" Display scrollbar without/with a trough; resource \fBscrollBar_floating\fP\&. .IP "\fB-iconic\fP" Start iconified, if the window manager supports that option\&. .IP "\fB-sl\fP \fInumber\fP" Save \fInumber\fP lines in the scrollback buffer; resource \fBsaveLines\fP\&. .IP "\fB-tn\fP \fItermname\fP" This option specifies the name of the terminal type to be set in the \fBTERM\fP environment variable\&. This terminal type must exist in the \fItermcap(5)\fP database and should have \fIli#\fP and \fIco#\fP entries; resource \fBtermName\fP\&. .IP "\fB-e\fP \fIcommand [arguments]\fP" Run the command with its command-line arguments in the \fBaterm\fP window; also sets the window title and icon name to be the basename of the program being executed if neither \fI-title\fP (\fI-T\fP) nor \fI-n\fP are given on the command line\&. If this option is used, it must be the last on the command-line\&. If there is no \fB-e\fP option then the default is to run the program specified by the \fBSHELL\fP environment variable or, failing that, \fIsh(1)\fP\&. .IP "\fB-title\fP \fItext\fP" Window title \fB-T\fP still respected); the default title is the basename of the program specified after the \ef3\e-e\efP option, if any, otherwise the application name; resource \fBtitle\fP\&. .IP "\fB-n\fP \fItext\fP" Icon name; the default name is the basename of the program specified after the \ef3\e-e\efP option, if any, otherwise the application name; resource \fBiconName\fP\&. .IP "\fB-C\fP" Capture system console messages\&. .IP .SH "RESOURCES (available also as long-options)" .PP \fBaterm\fP accepts application defaults set in XAPPLOADDIR/aterm (compile-time defined: usually \fB/etc/X11/Xresources/aterm\fP) and resources set in \fB~/\&.Xdefaults\fP or \fB~/\&.Xresources\fP\&. Note that when reading X resources, \fBaterm\fP recognizes two class names: \fBXTerm\fP and \fBAterm\fP\&. The class name \fBXTerm\fP allows resources common to both \fBaterm\fP and \fIxterm\fP to be easily configured, while the class name \fBAterm\fP allows resources unique to \fBaterm\fP, notably colours and key-handling, to be shared between different \fBaterm\fP configurations\&. If no resources are specified, suitable defaults will be used\&. Command-line arguments can be used to override resource settings\&. The following resources are allowed: .PP .IP "\fBgeometry:\fP \fIgeom\fP" Create the window with the specified X window geometry [default 80x24]; option \fB-geometry\fP\&. .IP "\fBbackground:\fP \fIcolour\fP" Use the specified colour as the window\'s background colour [default White]; option \fB-bg\fP\&. .IP "\fBforeground:\fP \fIcolour\fP" Use the specified colour as the window\'s foreground colour [default Black]; option \fB-fg\fP\&. .IP "\fBcolor\fP\fIn\fP\fB:\fP \fIcolour\fP" Use the specified colour for the colour value \fIn\fP, where 0-7 corresponds to low-intensity (normal) colours and 8-15 corresponds to high-intensity (bold = bright foreground, blink = bright background) colours\&. The canonical names are as follows: 0=black, 1=red, 2=green, 3=yellow, 4=blue, 5=magenta, 6=cyan, 7=white, but the actual colour names used are listed in the \fBCOLORS AND GRAPHICS\fP section\&. .IP "\fBcolorBD:\fP \fIcolour\fP" Use the specified colour to display bold characters when the foreground colour is the default\&. .IP "\fBcolorUL:\fP \fIcolour\fP" Use the specified colour to display underlined characters when the foreground colour is the default\&. .IP "\fBcursorColor:\fP \fIcolour\fP" Use the specified colour for the cursor\&. The default is to use the foreground colour; option \fB-cr\fP\&. .IP "\fBcursorColor2:\fP \fIcolour\fP" Use the specified colour for the colour of the cursor text\&. For this to take effect, \fBcursorColor\fP must also be specified\&. The default is to use the background colour\&. .IP "\fBreverseVideo:\fP \fIboolean\fP" \fBTrue\fP: simulate reverse video by foreground and background colours; option \fB-rv\fP, \fBFalse\fP: regular screen colours [default]; option \fB+rv\fP\&. See note in \fBCOLORS AND GRAPHICS\fP section\&. .IP "\fBscrollColor:\fP \fIcolour\fP" Use the specified colour for the scrollbar [default #B2B2B2]\&. .IP "\fBtroughColor:\fP \fIcolour\fP" Use the specified colour for the scrollbar\'s trough area [default #969696]\&. .IP "\fBbackgroundPixmap:\fP \fIfile[;geom]\fP" Use the specified image file, and cut the area defined by geometry string out of it\&. .IP "\fBMyStyle:\fP \fIname\fP" Specify the name of the Afterstep MyStyle to be used as the base of aterm\'s look\&. ForeColor, BackColor, Font, BackPixmap (all texture options) will be used from MyStyle definition, unless some other command line option is specifyed for the same setting\&. For example resource font will override MyStyle Font\&. This is available only if used with AfterStep 1\&.9\&.28 or later and if compiled with AfterStep libraries support ( --enable-afterstep-lib)\&. .IP "\fBtransparent\fP" Turn on/off pseudo transparency mode\&. In this mode \fBaterm\fP will use part of root background as it\'s own background, emulating see-through effect; .IP "\fBtinting:\fP \fIcolor\fP" Turn on pseudo transparency background tinting\&. Tinting can be done fast and slow way\&. In fast way it will be done by combining of background color with tinting color using logical function\&. This function defaults to AND, and it can be changed using \fB-tinttype\fP option - see below\&. In general solid colors like Blue, Red, Green, Cyan, Magenta, Yellow are good, but you should experiment with it for each background you have\&. True tinting is more memory and CPU hungry - tinted copy of background image will be created every time you move/resize window\&. It alows for more smooth tinting thou\&. You need to build it with \fB--enable-transparency=yes\fP or \fB--enable-background-image=yes\fP option, to be able to use this feature\&. .IP .IP "\fB-shading:\fP \fIamount\fP" This option allows for darkening/lightening of the background image \fIamount\fP is the %value of the desired brightness, where 100 is the original\&. if \fIamount\fP is less then 100 - image will be darkened\&. if \fIamount\fP is less then 0 or more then 100 - image will be lightened\&. Lightening can cause some strange looking effects if applied on bright image\&. This option causes aterm to create shaded/lightened copy of the background - it\'s more memory cosuming as the result\&. It does not make much difference, though, if applied on non transparent background image\&. .IP "\fBbackgroundType:\fP \fItype\fP" Specify type of the transformation to be performed on background image\&. Possible types are : \fBtile\fP - plain vanilla tiling of the image\&. \fBscale\fP - original image will be scaled to the aterm\'s size, every time you resize window\&. \fBscalev\fP - original image will be scaled to the aterm\'s height only, every time you resize window\&. \fBscaleh\fP - original image will be scaled to the aterm\'s width only, every time you resize window\&. \fBcenter\fP - original image will be centered in aterm\'s window\&. \fBnotile\fP - background color will be padded to image\'s right/bottom to make it the same size as window is\&. \fBnotileh\fP - background color will be padded to image\'s right to make it the same width as window is\&. \fBnotilev\fP - background color will be padded to image\'s bottom to make it the same height as window is\&. \fBcut\fP - aterm background will be cut out of the source image, as if this source image was tiled across the root window\&. The portion of the image that lies underneath of window will be used\&. If AfterStep Pager, asetroot or Esetroot where used to set the root image, then this option can be used in conjunction with -tr option\&. In this case it will do mentioned transformations to the root pixmap\&. and use it as aterm\'s background\&. .IP "\fBtextType:\fP \fItype\fP" Allows you to specify logical function to be used when displaying text\&. That will cause aterm to logically combine text with background pixels\&. That only works with transparent background and background image\&. Possible values are : \fIand\fP, \fIandReverse\fP, \fIandInverted\fP, \fIxor\fP, \fIor\fP, \fInor\fP, \fIinvert\fP, \fIequiv\fP, \fIinvert\fP, \fIorReverse\fP, \fIorInverted\fP, \fInand\fP\&. .IP "\fBtintingType\fP \fItype\fP" Allows you to specify logical function to be used when tinting transparent background\&. That will cause aterm to logically combine text with background pixels\&. NOTE: If shading option is used, or background image is specifyed - \fItrue\fP type will always be used\&. That works with bpth transparent background and background image\&. Possible values are : .IP Fast tinting options : \fIand\fP, \fIandReverse\fP, \fIandInverted\fP, \fIxor\fP, \fIor\fP, \fInor\fP, \fIinvert\fP, \fIequiv\fP, \fIinvert\fP, \fIorReverse\fP, \fIorInverted\fP, \fInand\fP, .IP Slow tinting: \fItrue\fP - will do "true" tinting - that means that background pixel\'s RGB components will be decreased proportionaly to the RGB components of specified tinting color\&. .IP .IP "\fBmenu:\fP \fIfile[;tag]\fP" Read in the specified menu file (note the `\&.menu\' extension is optional) and also optionally specify a starting tag to find\&. See the reference documentation for details on the syntax for the menuBar\&. .IP "\fBpath:\fP \fIpath\fP" Specify the colon-delimited search path for finding files (XPM and menus), in addition to the paths specified by the \fBRXVTPATH\fP and \fBPATH\fP environment variables\&. .IP "\fBfont:\fP \fIfontname\fP" Select the main text font used [default 7x14]; option \fB-fn\fP\&. .IP "\fBfont\fP\fIn\fP\fB:\fP \fIfontname\fP" Specify the alternative font \fIn\fP\&. The default font values: .br .RS .IP .TS tab(`); l l . \fBfont\fP: `\ 7x14 \fBfont1\fP: `\ 6x10 \fBfont2\fP: `\ 6x13 \fBfont3\fP: `\ 8x13 \fBfont4\fP: `\ 9x15 .TE .RE .IP .IP "\fBboldFont:\fP \fIfontname\fP" Specify the name of the bold font to use if \fBcolorBD\fP has not been specified and it is not possible to map the default foreground colour to colour 8-15 [default NONE]\&. This font must be the same height and width as the normal font; option \fB-fb\fP\&. .IP "\fBmfont:\fP \fIfontname\fP" Select the main multiple-character text font used [default k14]; option \fB-fk\fP\&. .IP "\fBmfont\fP\fIn\fP\fB:\fP \fIfontname\fP" Specify the alternative multiple-character font \fIn\fP\&. If compiled for multiple-character fonts, the Roman and multiple-character font sizes should match\&. .IP "\fBmultichar_encoding:\fP \fImode\fP" Set the encoding mode to be used when multicharacter encoding is received; \fBeucj\fP: EUC Japanese encoding [default for Kanji]\&. \fBsjis\fP: Shift JIS encoding\&. \fBbig5\fP: BIG5 encoding; option \fB-km\fP\&. .IP "\fBgreek_keyboard:\fP \fImode\fP" Set the Greek keyboard translation mode to be used; \fBiso\fP: ISO-8859 mapping (elot-928) [default]\&. \fBibm\fP: IBM-437 mapping (DOS codepage 737); option \fB-grk\fP\&. Use \fBMode_switch\fP to toggle keyboard input\&. For more details, see the distributed file \fBREADME\&.greek\fP\&. .IP "\fBtitle:\fP \fItext\fP" Set window title string, the default title is the command-line specified after the \fB-e\fP option, if any, otherwise the application name; option \fB-title\fP\&. .IP "\fBiconName:\fP \fItext\fP" Set the name used to label the window\'s icon or displayed in an icon manager window, it also sets the window\'s title unless it is explicitly set; option \fB-n\fP\&. .IP "\fBmapAlert:\fP \fIboolean\fP" \fBTrue\fP: de-iconify (map) on receipt of a bell character\&. \fBFalse\fP: no de-iconify (map) on receipt of a bell character [default]\&. .IP "\fBvisualBell:\fP \fIboolean\fP" \fBTrue\fP: use visual bell on receipt of a bell character; option \fB-vb\fP\&. \fBFalse\fP: no visual bell [default]; option \fB+vb\fP\&. .IP "\fBloginShell:\fP \fIboolean\fP" \fBTrue\fP: start as a login shell by prepending a `-\' to \fBargv[0]\fP of the shell; option \fB-ls\fP\&. \fBFalse\fP: start as a normal sub-shell [default]; option \fB+ls\fP\&. .IP "\fButmpInhibit:\fP \fIboolean\fP" \fBTrue\fP: inhibit writing record into the system log file \fButmp\fP; option \fB-ut\fP\&. \fBFalse\fP: write record into the system log file \fButmp\fP [default]; option \fB+ut\fP\&. .IP "\fBprint-pipe:\fP \fIstring\fP" Specify a command pipe for vt100 printer [default \fIlpr(1)\fP]\&. Use \fBPrint\fP to initiate a screen dump to the printer and \fBCtrl-Print\fP or \fBShift-Print\fP to include the scrollback as well\&. .IP "\fBscrollBar:\fP \fIboolean\fP" \fBTrue\fP: enable the scrollbar [default]; option \fB-sb\fP\&. \fBFalse\fP: disable the scrollbar; option \fB+sb\fP\&. Note that the scrollbar type (with/without arrows) is compile-time selected\&. .IP "\fBsmallfont_key:\fP \fIkeysym\fP" If enabled, use \fBAlt-\fP\fIkeysym\fP to toggle to a smaller font [default \fBAlt-<\fP] .IP "\fBbigfont_key:\fP \fIkeysym\fP" If enabled, use \fBAlt-\fP\fIkeysym\fP to toggle to a bigger font [default \fBAlt->\fP] .IP "\fBsaveLines:\fP \fInumber\fP" Save \fInumber\fP lines in the scrollback buffer [default 64]; option \fB-sl\fP\&. .IP "\fBtermName:\fP \fItermname\fP" Specifies the terminal type name to be set in the \fBTERM\fP environment variable; option \fB-tn\fP\&. .IP "\fBmeta8:\fP \fIboolean\fP" \fBTrue\fP: handle Meta (Alt) + keypress to set the 8th bit\&. \fBFalse\fP: handle Meta (Alt) + keypress as an escape prefix [default]\&. .IP "\fBmodifier:\fP \fIstring\fP" Set the Meta key to be enabled by modifier \fBMod1\fP, \fBMod2\fP, \fBMod3\fP, \fBMod4\fP or \fBMod5\fP\&. .IP "\fBbackspacekey:\fP \fIstring\fP" The string to send when the backspace key is pressed\&. If set to \fBDEC\fP or unset it will send \fBDelete\fP (code 127) or, if shifted, \fBBackspace\fP (code 8) - which can be reversed with the appropriate DEC private mode escape sequence\&. .IP "\fBdeletekey:\fP \fIstring\fP" The string to send when the delete key (not the keypad delete key) is pressed\&. If unset it will send the sequence traditionally associated with the \fBExecute\fP key\&. .IP "\fBcutchars:\fP \fIstring\fP" The characters used as delimiters for double-click word selection\&. The built-in default: .br \fBBACKSLASH `"\'&()*,;<=>?@[]{|}\fP .IP "\fBkeysym\&.\fP\fIsym\fP: \fIstring\fP" Associate \fIstring\fP with keysym \fIsym\fP (\fB0xFF00 - 0xFFFF\fP)\&. It may contain escape values (\ea: bell, \eb: backspace, \ee, \eE: escape, \en: newline, \er: return, \et: tab, \e000: octal number) or control characters (^?: delete, ^@: null, ^A \&.\&.\&.) and may enclosed with double quotes so that it can start or end with whitespace\&. The intervening resource name \fBkeysym\&.\fP cannot be omitted\&. This resource is only available when compiled with KEYSYM_RESOURCE\&. .SH "THE SCROLLBAR" .PP Lines of text that scroll off the top of the \fBaterm\fP window (resource: \fBsaveLines\fP) and can be scrolled back using the scrollbar or by keystrokes\&. The normal \fBaterm\fP scrollbar has arrows and its behaviour is fairly intuitive\&. The \fBxterm-scrollbar\fP is without arrows and its behaviour mimics that of \fIxterm\fP\&. When build with --enable-next-scroll \fBaterm\fP will have NeXT-ish scrollbars\&. They look nicer and easier in use, but have slightly larger size\&. Their look and size can be tweaked at compile time by modifying parameters in rxvt\&.h\&. .PP Scroll down with \fBButton1\fP (\fBxterm-scrollbar\fP) or \fBShift-Next\fP\&. Scroll up with \fBButton3\fP (\fBxterm-scrollbar\fP) or \fBShift-Prior\fP\&. Continuous scroll with \fBButton2\fP\&. .SH "MOUSE REPORTING" .PP To temporarily override mouse reporting, for either the scrollbar or the normal text selection/insertion, hold either the Shift or the Meta (Alt) key while performing the desired mouse action\&. .PP If mouse reporting mode is active, the normal scrollbar actions are disabled -- on the assumption that we are using a fullscreen application\&. Instead, pressing Button1 and Button3 sends \fBESC[6~\fP (Next) and \fBESC[5~\fP (Prior), respectively\&. Similarly, clicking on the up and down arrows sends \fBESC[A\fP (Up) and \fBESC[B\fP (Down), respectively\&. .SH "TEXT SELECTION AND INSERTION" .PP The behaviour of text selection and insertion mechanism is similar to \fIxterm\fP(1)\&. .PP .IP "\fBSelection\fP:" Left click at the beginning of the region, drag to the end of the region and release; Right click to extend the marked region; Left double-click to select a word; Left triple-click to select the entire line\&. .IP .IP "\fBInsertion\fP:" Pressing and releasing the Middle mouse button (or \fBShift-Insert\fP) in an \fBaterm\fP window causes the current text selection to be inserted as if it had been typed on the keyboard\&. .SH "CHANGING FONTS" .PP You can change fonts on-the-fly, which is to say cycle through the default font and others of various sizes, by using \fBShift-KP_Add\fP and \fBShift-KP_Subtract\fP\&. Or, alternatively (if enabled) with \fBAlt->\fP and \fBAlt-<\fP, where the actual key can be selected using resources \fBsmallfont_key\fP/\fBbigfont_key\fP\&. .SH "LOGIN STAMP" .PP \fBaterm\fP tries to write an entry into the \fIutmp\fP(5) file so that it can be seen via the \fIwho(1)\fP command, and can accept messages\&. To allow this feature, \fBaterm\fP must be installed setuid root on some systems\&. .SH "COLORS AND GRAPHICS" .PP If graphics support was enabled at compile-time, \fBaterm\fP can be queried with ANSI escape sequences and can address individual pixels instead of text characters\&. Note the graphics support is still considered beta code\&. .PP In addition to the default foreground and background colours, \fBaterm\fP can display up to 16 colours (8 ANSI colours plus high-intensity bold/blink versions of the same)\&. Here is a list of the colours with their \fBrgb\&.txt\fP names\&. .PP .TS tab(`); l l l . \fBcolor0\fP `\ (black) `\ = Black \fBcolor1\fP `\ (red) `\ = Red3 \fBcolor2\fP `\ (green) `\ = Green3 \fBcolor3\fP `\ (yellow) `\ = Yellow3 \fBcolor4\fP `\ (blue) `\ = Blue3 \fBcolor5\fP `\ (magenta) `\ = Magenta3 \fBcolor6\fP `\ (cyan) `\ = Cyan3 \fBcolor7\fP `\ (white) `\ = AntiqueWhite \fBcolor8\fP `\ (bright black) `\ = Grey25 \fBcolor9\fP `\ (bright red) `\ = Red \fBcolor10\fP `\ (bright green) `\ = Green \fBcolor11\fP `\ (bright yellow) `\ = Yellow \fBcolor12\fP `\ (bright blue) `\ = Blue \fBcolor13\fP `\ (bright magenta) `\ = Magenta \fBcolor14\fP `\ (bright cyan) `\ = Cyan \fBcolor15\fP `\ (bright white) `\ = White \fBforeground\fP `\ `\ = Black \fBbackground\fP `\ `\ = White .TE .PP It is also possible to specify the colour values of \fBforeground\fP, \fBbackground\fP, \fBcursorColor\fP, \fBcursorColor2\fP, \fBcolorBD\fP, \fBcolorUL\fP as a number 0-15, as a convenient shorthand to reference the colour name of color0-color15\&. .PP Note that \fB-rv\fP (\fB"reverseVideo: True"\fP) simulates reverse video by always swapping the foreground/background colours\&. This is in contrast to \fIxterm\fP(1) where the colours are only swapped if they have not otherwise been specified\&. For example, .PP .IP "\fBaterm -fg Black -bg White -rv\fP" would yield White on Black, while on \fIxterm\fP(1) it would yield Black on White\&. .SH "ENVIRONMENT" .PP \fBaterm\fP sets the environment variables \fBTERM\fP, \fBCOLORTERM\fP and \fBCOLORFGBG\fP\&. The environment variable \fBWINDOWID\fP is set to the X window id number of the \fBaterm\fP window and it also uses and sets the environment variable \fBDISPLAY\fP to specify which display terminal to use\&. \fBaterm\fP uses the environment variables \fBATERMPATH\fP, then \fBRXVTPATH\fP and finally \fBPATH\fP to find XPM files\&. .SH "FILES" .PP .IP "\fB/etc/utmp\fP" System file for login records\&. .IP "\fB/usr/lib/X11/rgb\&.txt\fP" Color names\&. .PP .SH "SEE ALSO" .PP \fIxterm\fP(1), \fIsh\fP(1), \fIresize\fP(1), \fIX\fP(1), \fIpty\fP(4), \fItty\fP(4), \fIutmp\fP(5) .PP Cursor change support is not yet implemented\&. .PP Click-and-drag doesn\'t work with X11 mouse report overriding\&. .PP Graphics support is fairly crude\&. .PP .SH "FTP LOCATION" .PP aterm-0\&.4\&.2\&.tar\&.gz can be found at the following ftp sites ftp://ftp\&.afterstep\&.org/apps/aterm .PP .SH "CURRENT PROJECT COORDINATOR" .PP .IP "Project Coordinator" Sasha Vasko \fI\fP .br .IP "Web page maintainter" Sasha Vasko \fI\fP .br .br .IP "Online support" You can meet maintainers online, get support, report bugs and make sugestions on \fBAfterStep\fP IRC channel: \fI#afterstep on freenode\&.net\fP\&. .IP "Mailing list" Support for \fBaterm\fP can be obtained from \fBAfterStep\fP mailing list \fIhttp://mail\&.afterstep\&.org/mailman/listinfo/as-users/\fP\&. .PP .SH "AUTHORS" .PP .IP "John Bovey" University of Kent, 1992, wrote the original Xvt\&. .IP "Rob Nation \fI\fP" very heavily modified Xvt and came up with Rxvt .IP "Angelo Haritsis \fI\fP" wrote the Greek Keyboard Input .IP "mj olesen \fI\fP" Wrote the menu system\&. .br Project Coordinator (changes\&.txt 2\&.11 to 2\&.21) .IP "Oezguer Kesim \fI\fP" Project Coordinator (changes\&.txt 2\&.21a to 2\&.4\&.5) .IP "Geoff Wing \fI\fP" Rewrote screen display and text selection routines\&. .br Project Coordinator (changes\&.txt 2\&.4\&.6 - ) .IP "Sasha Vasko \fI\fP" branched rxvt with Alfredo Kojima additions to aterm\&. .br aterm-1.0.1/src/0000755000175000001440000000000010654145567012117 5ustar vaeusersaterm-1.0.1/src/menubar.c0000644000175000001440000014426410144447052013713 0ustar vaeusers/*--------------------------------*-C-*---------------------------------* * File: menubar.c *----------------------------------------------------------------------* * Copyright (C) 1997,1998 mj olesen * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *----------------------------------------------------------------------* * refer.html (or refer.txt) contains up-to-date documentation. The * summary that appears at the end of this file was taken from there. *----------------------------------------------------------------------*/ #ifndef lint static const char rcsid[] = "$Id: menubar.c,v 1.1.1.1 2004/11/10 17:21:46 sasha Exp $"; #endif #include "rxvt.h" /* NECESSARY */ /* #define DEBUG_MENU */ /* #define DEBUG_MENU_LAYOUT */ /* #define DEBUG_MENUBAR_STACKING */ #define HSPACE 1 /* one space */ #define MENU_MARGIN 2 #define menu_height() (TermWin.fheight + 2 * MENU_MARGIN) #define MENU_DELAY_USEC 250000 /* 1/4 sec */ #define SEPARATOR_HALFHEIGHT (SHADOW + 1) #define SEPARATOR_HEIGHT (2 * SEPARATOR_HALFHEIGHT) #define isSeparator(name) ((name)[0] == '\0') #define SEPARATOR_NAME "-" #define MENUITEM_BEG '{' #define MENUITEM_END '}' #define COMMENT_CHAR '#' #define DOT "." #define DOTS ".." #ifdef MENUBAR #define Menu_PixelWidth(menu) \ (2 * SHADOW + Width2Pixel ((menu)->width + 3 * HSPACE)) static GC topShadowGC, botShadowGC, neutralGC, menubarGC; struct menu_t; static int menu_readonly = 1; /* okay to alter menu? */ static int Arrows_x = 0; static const struct { char name; /* (l)eft, (u)p, (d)own, (r)ight */ unsigned char str[4]; /* str[0] = strlen (str+1) */ } Arrows[NARROWS] = { { 'l', "\003\033[D" }, { 'u', "\003\033[A" }, { 'd', "\003\033[B" }, { 'r', "\003\033[C" } }; #if (MENUBAR_MAX > 1) static int Nbars = 0; static bar_t *CurrentBar = NULL; #else /* (MENUBAR_MAX > 1) */ static bar_t BarList; static bar_t *CurrentBar = &BarList; #endif /* (MENUBAR_MAX > 1) */ static menu_t *ActiveMenu = NULL; /* currently active menu */ #endif /*}}} */ /* * find an item called NAME in MENU */ /* PROTO */ menuitem_t * menuitem_find(menu_t * menu, char *name) { #ifdef MENUBAR menuitem_t *item; assert(name != NULL); assert(menu != NULL); /* find the last item in the menu, this is good for separators */ for (item = menu->tail; item != NULL; item = item->prev) { if (item->entry.type == MenuSubMenu) { if (!strcmp(name, (item->entry.submenu.menu)->name)) break; } else if ((isSeparator(name) && isSeparator(item->name)) || !strcmp(name, item->name)) break; } return item; #else return NULL; #endif } /* * unlink ITEM from its MENU and free its memory */ /* PROTO */ void menuitem_free(menu_t * menu, menuitem_t * item) { #ifdef MENUBAR /* disconnect */ menuitem_t *prev, *next; assert(menu != NULL); prev = item->prev; next = item->next; if (prev != NULL) prev->next = next; if (next != NULL) next->prev = prev; /* new head, tail */ if (menu->tail == item) menu->tail = prev; if (menu->head == item) menu->head = next; switch (item->entry.type) { case MenuAction: case MenuTerminalAction: FREE(item->entry.action.str); break; case MenuSubMenu: (void)menu_delete(item->entry.submenu.menu); break; } if (item->name != NULL) FREE(item->name); if (item->name2 != NULL) FREE(item->name2); FREE(item); #endif } /* * sort command vs. terminal actions and * remove the first character of STR if it's '\0' */ /* PROTO */ int action_type(action_t * action, unsigned char *str) { #ifdef MENUBAR unsigned int len; #if defined (DEBUG_MENU) || defined (DEBUG_MENUARROWS) len = strlen(str); printf("(len %d) = %s\n", len, str); #else len = Str_escaped((char *) str); #endif if (!len) return -1; /* sort command vs. terminal actions */ action->type = MenuAction; if (str[0] == '\0') { /* the functional equivalent: memmove (str, str+1, len); */ unsigned char *dst = (str); unsigned char *src = (str + 1); unsigned char *end = (str + len); while (src <= end) *dst++ = *src++; len--; /* decrement length */ if (str[0] != '\0') action->type = MenuTerminalAction; } action->str = str; action->len = len; #endif return 0; } /* PROTO */ int action_dispatch(action_t * action) { #ifdef MENUBAR switch (action->type) { case MenuTerminalAction: cmd_write(action->str, action->len); break; case MenuAction: tt_write(action->str, action->len); break; default: return -1; break; } #endif return 0; } /* return the arrow index corresponding to NAME */ /* PROTO */ int menuarrow_find(char name) { #ifdef MENUBAR int i; for (i = 0; i < NARROWS; i++) if (name == Arrows[i].name) return i; #endif return -1; } /* free the memory associated with arrow NAME of the current menubar */ /* PROTO */ void menuarrow_free(char name) { #ifdef MENUBAR int i; if (name) { i = menuarrow_find(name); if (i >= 0) { action_t *act = &(CurrentBar->arrows[i]); switch (act->type) { case MenuAction: case MenuTerminalAction: FREE(act->str); act->str = NULL; act->len = 0; break; } act->type = MenuLabel; } } else { for (i = 0; i < NARROWS; i++) menuarrow_free(Arrows[i].name); } #endif } /* PROTO */ void menuarrow_add(char *string) { #ifdef MENUBAR int i; unsigned xtra_len; char *p; struct { char *str; int len; } beg = { NULL, 0 }, end = { NULL, 0 }, *cur, parse[NARROWS]; MEMSET(parse, 0, sizeof(parse)); /* printf ("add arrows = `%s'\n", string); */ for (p = string; p != NULL && *p; string = p) { p = (string + 3); /* printf ("parsing at %s\n", string); */ switch (string[1]) { case 'b': cur = &beg; break; case 'e': cur = &end; break; default: i = menuarrow_find(string[1]); if (i >= 0) cur = &(parse[i]); else continue; /* not found */ break; } string = p; cur->str = string; cur->len = 0; if (cur == &end) { p = strchr(string, '\0'); } else { char *next = string; while (1) { p = strchr(next, '<'); if (p != NULL) { if (p[1] && p[2] == '>') break; /* parsed */ } else { if (beg.str == NULL) /* no end needed */ p = strchr(next, '\0'); break; } next = (p + 1); } } if (p == NULL) return; cur->len = (p - string); } #ifdef DEBUG_MENUARROWS cur = &beg; printf("(len %d) = %.*s\n", cur->len, cur->len, (cur->str ? cur->str : "")); for (i = 0; i < NARROWS; i++) { cur = &(parse[i]); printf("<%c>(len %d) = %.*s\n", Arrows[i].name, cur->len, cur->len, (cur->str ? cur->str : "")); } cur = &end; printf("(len %d) = %.*s\n", cur->len, cur->len, (cur->str ? cur->str : "")); #endif xtra_len = (beg.len + end.len); for (i = 0; i < NARROWS; i++) { if (xtra_len || parse[i].len) menuarrow_free(Arrows[i].name); } for (i = 0; i < NARROWS; i++) { unsigned char *str; unsigned int len; if (!parse[i].len) continue; str = MALLOC(parse[i].len + xtra_len + 1); if (str == NULL) continue; len = 0; if (beg.len) { STRNCPY(str + len, beg.str, beg.len); len += beg.len; } STRNCPY(str + len, parse[i].str, parse[i].len); len += parse[i].len; if (end.len) { STRNCPY(str + len, end.str, end.len); len += end.len; } str[len] = '\0'; #ifdef DEBUG_MENUARROWS printf("<%c>(len %d) = %s\n", Arrows[i].name, len, str); #endif if (action_type(&(CurrentBar->arrows[i]), str) < 0) FREE(str); } #endif } /* PROTO */ menuitem_t * menuitem_add(menu_t * menu, char *name, char *name2, char *action) { #ifdef MENUBAR menuitem_t *item; unsigned int len; assert(name != NULL); assert(action != NULL); if (menu == NULL) return NULL; if (isSeparator(name)) { /* add separator, no action */ name = ""; action = ""; } else { /* * add/replace existing menu item */ item = menuitem_find(menu, name); if (item != NULL) { if (item->name2 != NULL && name2 != NULL) { FREE(item->name2); item->len2 = 0; item->name2 = NULL; } switch (item->entry.type) { case MenuAction: case MenuTerminalAction: FREE(item->entry.action.str); item->entry.action.str = NULL; break; } goto Item_Found; } } /* allocate a new itemect */ if ((item = (menuitem_t *)MALLOC(sizeof(menuitem_t))) == NULL) return NULL; item->len2 = 0; item->name2 = NULL; len = strlen(name); item->name = MALLOC(len + 1); if (item->name != NULL) { STRCPY(item->name, name); if (name[0] == '.' && name[1] != '.') len = 0; /* hidden menu name */ } else { FREE(item); return NULL; } item->len = len; /* add to tail of list */ item->prev = menu->tail; item->next = NULL; if (menu->tail != NULL) (menu->tail)->next = item; menu->tail = item; /* fix head */ if (menu->head == NULL) menu->head = item; /* * add action */ Item_Found: if (name2 != NULL && item->name2 == NULL) { len = strlen(name2); if (len == 0 || (item->name2 = MALLOC(len + 1)) == NULL) { len = 0; item->name2 = NULL; } else { STRCPY(item->name2, name2); } item->len2 = len; } item->entry.type = MenuLabel; len = strlen(action); if (len == 0 && item->name2 != NULL) { action = item->name2; len = item->len2; } if (len) { unsigned char *str = MALLOC(len + 1); if (str == NULL) { menuitem_free(menu, item); return NULL; } STRCPY(str, action); if (action_type(&(item->entry.action), str) < 0) FREE(str); } /* new item and a possible increase in width */ if (menu->width < (item->len + item->len2)) menu->width = (item->len + item->len2); return item; #else return NULL; #endif } /* * search for the base starting menu for NAME. * return a pointer to the portion of NAME that remains */ /* PROTO */ char * menu_find_base(menu_t ** menu, char *path) { #ifdef MENUBAR menu_t *m = NULL; menuitem_t *item; assert(menu != NULL); assert(CurrentBar != NULL); if (path[0] == '\0') return path; if (strchr(path, '/') != NULL) { register char *p = path; while ((p = strchr(p, '/')) != NULL) { p++; if (*p == '/') path = p; } if (path[0] == '/') { path++; *menu = NULL; } while ((p = strchr(path, '/')) != NULL) { p[0] = '\0'; if (path[0] == '\0') return NULL; if (!strcmp(path, DOT)) { /* nothing to do */ } else if (!strcmp(path, DOTS)) { if (*menu != NULL) *menu = (*menu)->parent; } else { path = menu_find_base(menu, path); if (path[0] != '\0') { /* not found */ p[0] = '/'; /* fix-up name again */ return path; } } path = (p + 1); } } if (!strcmp(path, DOTS)) { path += strlen(DOTS); if (*menu != NULL) *menu = (*menu)->parent; return path; } /* find this menu */ if (*menu == NULL) { for (m = CurrentBar->tail; m != NULL; m = m->prev) { if (!strcmp(path, m->name)) break; } } else { /* find this menu */ for (item = (*menu)->tail; item != NULL; item = item->prev) { if (item->entry.type == MenuSubMenu && !strcmp(path, (item->entry.submenu.menu)->name)) { m = (item->entry.submenu.menu); break; } } } if (m != NULL) { *menu = m; path += strlen(path); } return path; #else return NULL; #endif } /* * delete this entire menu */ /* PROTO */ menu_t * menu_delete(menu_t * menu) { #ifdef MENUBAR menu_t *parent = NULL, *prev, *next; menuitem_t *item; assert(CurrentBar != NULL); /* delete the entire menu */ if (menu == NULL) return NULL; parent = menu->parent; /* unlink MENU */ prev = menu->prev; next = menu->next; if (prev != NULL) prev->next = next; if (next != NULL) next->prev = prev; /* fix the index */ if (parent == NULL) { const int len = (menu->len + HSPACE); if (CurrentBar->tail == menu) CurrentBar->tail = prev; if (CurrentBar->head == menu) CurrentBar->head = next; for (next = menu->next; next != NULL; next = next->next) next->x -= len; } else { for (item = parent->tail; item != NULL; item = item->prev) { if (item->entry.type == MenuSubMenu && item->entry.submenu.menu == menu) { item->entry.submenu.menu = NULL; menuitem_free(menu->parent, item); break; } } } item = menu->tail; while (item != NULL) { menuitem_t *p = item->prev; menuitem_free(menu, item); item = p; } if (menu->name != NULL) FREE(menu->name); FREE(menu); return parent; #else return NULL; #endif } /* PROTO */ menu_t * menu_add(menu_t * parent, char *path) { #ifdef MENUBAR menu_t *menu; assert(CurrentBar != NULL); if (strchr(path, '/') != NULL) { register char *p; if (path[0] == '/') { /* shouldn't happen */ path++; parent = NULL; } while ((p = strchr(path, '/')) != NULL) { p[0] = '\0'; if (path[0] == '\0') return NULL; parent = menu_add(parent, path); path = (p + 1); } } if (!strcmp(path, DOTS)) return (parent != NULL ? parent->parent : parent); if (!strcmp(path, DOT) || path[0] == '\0') return parent; /* allocate a new menu */ if ((menu = (menu_t *)MALLOC(sizeof(menu_t))) == NULL) return parent; menu->width = 0; menu->parent = parent; menu->len = strlen(path); menu->name = MALLOC((menu->len + 1)); if (menu->name == NULL) { FREE(menu); return parent; } STRCPY(menu->name, path); /* initialize head/tail */ menu->head = menu->tail = NULL; menu->prev = menu->next = NULL; menu->win = None; menu->x = menu->y = menu->w = menu->h = 0; menu->item = NULL; /* add to tail of list */ if (parent == NULL) { menu->prev = CurrentBar->tail; if (CurrentBar->tail != NULL) CurrentBar->tail->next = menu; CurrentBar->tail = menu; if (CurrentBar->head == NULL) CurrentBar->head = menu; /* fix head */ if (menu->prev) menu->x = (menu->prev->x + menu->prev->len + HSPACE); } else { menuitem_t *item; item = menuitem_add(parent, path, "", ""); if (item == NULL) { FREE(menu); return parent; } assert(item->entry.type == MenuLabel); item->entry.type = MenuSubMenu; item->entry.submenu.menu = menu; } return menu; #else return NULL; #endif } /* PROTO */ void drawbox_menubar(int x, int len, int state) { #ifdef MENUBAR GC top, bot; x = Width2Pixel(x); len = Width2Pixel(len + HSPACE); if (x >= TermWin.width) return; else if (x + len >= TermWin.width) len = (TermWin_TotalWidth() - x); #ifdef MENUBAR_SHADOW_IN state = -state; #endif switch (state) { case +1: top = topShadowGC; bot = botShadowGC; break; /* SHADOW_OUT */ case -1: top = botShadowGC; bot = topShadowGC; break; /* SHADOW_IN */ default: top = bot = neutralGC; break; /* neutral */ } Draw_Shadow(menuBar.win, top, bot, x, 0, len, menuBar_TotalHeight()); #endif } /* PROTO */ void drawtriangle(int x, int y, int state) { #ifdef MENUBAR GC top, bot; int w; #ifdef MENU_SHADOW_IN state = -state; #endif switch (state) { case +1: top = topShadowGC; bot = botShadowGC; break; /* SHADOW_OUT */ case -1: top = botShadowGC; bot = topShadowGC; break; /* SHADOW_IN */ default: top = bot = neutralGC; break; /* neutral */ } w = menu_height() / 2; x -= (SHADOW + MENU_MARGIN) + (3 * w / 2); y += (SHADOW + MENU_MARGIN) + (w / 2); Draw_Triangle(ActiveMenu->win, top, bot, x, y, w, 'r'); #endif } /* PROTO */ void drawbox_menuitem(int y, int state) { #ifdef MENUBAR GC top, bot; #ifdef MENU_SHADOW_IN state = -state; #endif switch (state) { case +1: top = topShadowGC; bot = botShadowGC; break; /* SHADOW_OUT */ case -1: top = botShadowGC; bot = topShadowGC; break; /* SHADOW_IN */ default: top = bot = neutralGC; break; /* neutral */ } Draw_Shadow(ActiveMenu->win, top, bot, SHADOW + 0, SHADOW + y, ActiveMenu->w - 2 * (SHADOW), menu_height() + 2 * MENU_MARGIN); XFlush(Xdisplay); #endif } #ifdef DEBUG_MENU_LAYOUT /* PROTO */ void print_menu_ancestors(menu_t * menu) { #ifdef MENUBAR if (menu == NULL) { printf("Top Level menu\n"); return; } printf("menu %s ", menu->name); if (menu->parent != NULL) { menuitem_t *item; for (item = menu->parent->head; item != NULL; item = item->next) { if (item->entry.type == MenuSubMenu && item->entry.submenu.menu == menu) { break; } } if (item == NULL) { printf("is an orphan!\n"); return; } } printf("\n"); print_menu_ancestors(menu->parent); #endif } /* PROTO */ void print_menu_descendants(menu_t * menu) { #ifdef MENUBAR menuitem_t *item; menu_t *parent; int i, level = 0; parent = menu; do { level++; parent = parent->parent; } while (parent != NULL); for (i = 0; i < level; i++) printf(">"); printf("%s\n", menu->name); for (item = menu->head; item != NULL; item = item->next) { if (item->entry.type == MenuSubMenu) { if (item->entry.submenu.menu == NULL) printf("> %s == NULL\n", item->name); else print_menu_descendants(item->entry.submenu.menu); } else { for (i = 0; i < level; i++) printf("+"); if (item->entry.type == MenuLabel) printf("label: "); printf("%s\n", item->name); } } for (i = 0; i < level; i++) printf("<"); printf("\n"); #endif } #endif /* pop up/down the current menu and redraw the menuBar button */ /* PROTO */ void menu_show(void) { #ifdef MENUBAR int x, y, xright; menuitem_t *item; if (ActiveMenu == NULL) return; x = ActiveMenu->x; if (ActiveMenu->parent == NULL) { register int h; drawbox_menubar(x, ActiveMenu->len, -1); x = Width2Pixel(x); ActiveMenu->y = 1; ActiveMenu->w = Menu_PixelWidth(ActiveMenu); if ((x + ActiveMenu->w) >= TermWin.width) x = (TermWin_TotalWidth() - ActiveMenu->w); /* find the height */ for (h = 0, item = ActiveMenu->head; item != NULL; item = item->next) { if (isSeparator(item->name)) h += SEPARATOR_HEIGHT; else h += menu_height(); } ActiveMenu->h = h + 2 * (SHADOW + MENU_MARGIN); } if (ActiveMenu->win == None) { ActiveMenu->win = XCreateSimpleWindow(Xdisplay, TermWin.vt, x, ActiveMenu->y, ActiveMenu->w, ActiveMenu->h, 0, PixColors[Color_fg], PixColors[Color_scroll]); XMapWindow(Xdisplay, ActiveMenu->win); } Draw_Shadow(ActiveMenu->win, topShadowGC, botShadowGC, 0, 0, ActiveMenu->w, ActiveMenu->h); /* determine the correct right-alignment */ for (xright = 0, item = ActiveMenu->head; item != NULL; item = item->next) if (item->len2 > xright) xright = item->len2; for (y = 0, item = ActiveMenu->head; item != NULL; item = item->next) { const int xoff = (SHADOW + Width2Pixel(HSPACE) / 2); const int yoff = (SHADOW + MENU_MARGIN); register int h; GC gc = menubarGC; if (isSeparator(item->name)) { Draw_Shadow(ActiveMenu->win, topShadowGC, botShadowGC, xoff, yoff + y + SEPARATOR_HALFHEIGHT, ActiveMenu->w - (2 * xoff), 0); h = SEPARATOR_HEIGHT; } else { char *name = item->name; int len = item->len; if (item->entry.type == MenuLabel) { gc = botShadowGC; } else if (item->entry.type == MenuSubMenu) { int x1, y1; menuitem_t *it; menu_t *menu = item->entry.submenu.menu; drawtriangle(ActiveMenu->w, y, +1); name = menu->name; len = menu->len; y1 = ActiveMenu->y + y; /* place sub-menu at midpoint of parent menu */ menu->w = Menu_PixelWidth(menu); x1 = ActiveMenu->w / 2; /* right-flush menu if it's too small */ if (x1 > menu->w) x1 += (x1 - menu->w); x1 += x; /* find the height of this submenu */ for (h = 0, it = menu->head; it != NULL; it = it->next) { if (isSeparator(it->name)) h += SEPARATOR_HEIGHT; else h += menu_height(); } menu->h = h + 2 * (SHADOW + MENU_MARGIN); /* ensure menu is in window limits */ if ((x1 + menu->w) >= TermWin.width) x1 = (TermWin_TotalWidth() - menu->w); if ((y1 + menu->h) >= TermWin.height) y1 = (TermWin_TotalHeight() - menu->h); menu->x = (x1 < 0 ? 0 : x1); menu->y = (y1 < 0 ? 0 : y1); } else if (item->name2 && !strcmp(name, item->name2)) name = NULL; if (len && name) XDrawString(Xdisplay, ActiveMenu->win, gc, xoff, yoff + y + menu_height() - (2 * MENU_MARGIN), name, len); len = item->len2; name = item->name2; if (len && name) XDrawString(Xdisplay, ActiveMenu->win, gc, ActiveMenu->w - (xoff + Width2Pixel(xright)), yoff + y + menu_height() - (2 * MENU_MARGIN), name, len); h = menu_height(); } y += h; } #endif } /* PROTO */ void menu_display(void (*update) (void)) { #ifdef MENUBAR if (ActiveMenu == NULL) return; if (ActiveMenu->win != None) XDestroyWindow(Xdisplay, ActiveMenu->win); ActiveMenu->win = None; ActiveMenu->item = NULL; if (ActiveMenu->parent == NULL) drawbox_menubar(ActiveMenu->x, ActiveMenu->len, +1); ActiveMenu = ActiveMenu->parent; update(); #endif } /* PROTO */ void menu_hide_all(void) { #ifdef MENUBAR menu_display(menu_hide_all); #endif } /* PROTO */ void menu_hide(void) { #ifdef MENUBAR menu_display(menu_show); #endif } /* PROTO */ void menu_clear(menu_t * menu) { #ifdef MENUBAR if (menu != NULL) { menuitem_t *item = menu->tail; while (item != NULL) { menuitem_free(menu, item); /* it didn't get freed ... why? */ if (item == menu->tail) return; item = menu->tail; } menu->width = 0; } #endif } /* PROTO */ void menubar_clear(void) { #ifdef MENUBAR if (CurrentBar != NULL) { menu_t *menu = CurrentBar->tail; while (menu != NULL) { menu_t *prev = menu->prev; menu_delete(menu); menu = prev; } CurrentBar->head = CurrentBar->tail = ActiveMenu = NULL; if (CurrentBar->title) { FREE(CurrentBar->title); CurrentBar->title = NULL; } menuarrow_free(0); /* remove all arrow functions */ } ActiveMenu = NULL; #endif } #if (MENUBAR_MAX > 1) /* find if menu already exists */ /* PROTO */ bar_t * menubar_find(const char *name) { #ifdef MENUBAR bar_t *bar = CurrentBar; #ifdef DEBUG_MENUBAR_STACKING printf("looking for [menu:%s] ...", name ? name : "(nil)"); #endif if (bar == NULL || name == NULL) return NULL; if (strlen(name) && strcmp(name, "*")) { do { if (!strcmp(bar->name, name)) { #ifdef DEBUG_MENUBAR_STACKING printf(" found!\n"); #endif return bar; } bar = bar->next; } while (bar != CurrentBar); bar = NULL; } #ifdef DEBUG_MENUBAR_STACKING printf("%s found!\n", (bar ? "" : " NOT")); #endif return bar; #else return NULL; #endif } /* PROTO */ int menubar_push(const char *name) { int ret = 1; #ifdef MENUBAR bar_t *bar; if (CurrentBar == NULL) { /* allocate first one */ bar = (bar_t *)MALLOC(sizeof(bar_t)); if (bar == NULL) return 0; MEMSET(bar, 0, sizeof (bar_t)); /* circular linked-list */ bar->next = bar->prev = bar; bar->head = bar->tail = NULL; bar->title = NULL; CurrentBar = bar; Nbars++; menubar_clear(); } else { /* find if menu already exists */ bar = menubar_find(name); if (bar != NULL) { /* found it, use it */ CurrentBar = bar; } else { /* create if needed, or reuse the existing empty menubar */ if (CurrentBar->head != NULL) { /* need to malloc another one */ if (Nbars < MENUBAR_MAX) bar = (bar_t *)MALLOC(sizeof(bar_t)); else bar = NULL; /* malloc failed or too many menubars, reuse another */ if (bar == NULL) { bar = CurrentBar->next; ret = -1; } else { bar->head = bar->tail = NULL; bar->title = NULL; bar->next = CurrentBar->next; CurrentBar->next = bar; bar->prev = CurrentBar; bar->next->prev = bar; Nbars++; } CurrentBar = bar; } menubar_clear(); } } /* give menubar this name */ STRNCPY(CurrentBar->name, name, MAXNAME); CurrentBar->name[MAXNAME - 1] = '\0'; #endif return ret; } /* switch to a menu called NAME and remove it */ /* PROTO */ void menubar_remove(const char *name) { #ifdef MENUBAR bar_t *bar; if ((bar = menubar_find(name)) == NULL) return; CurrentBar = bar; do { menubar_clear(); /* * pop a menubar, clean it up first */ if (CurrentBar != NULL) { bar_t *prev = CurrentBar->prev; bar_t *next = CurrentBar->next; if (prev == next && prev == CurrentBar) { /* only 1 left */ prev = NULL; Nbars = 0; /* safety */ } else { next->prev = prev; prev->next = next; Nbars--; } FREE(CurrentBar); CurrentBar = prev; } } while (CurrentBar && !strcmp(name, "*")); #endif } /* PROTO */ void action_decode(FILE * fp, action_t * act) { #ifdef MENUBAR unsigned char *str; short len; if (act == NULL || (len = act->len) == 0 || (str = act->str) == NULL) return; if (act->type == MenuTerminalAction) { fprintf(fp, "^@"); /* can strip trailing ^G from XTerm sequence */ if (str[0] == 033 && str[1] == ']' && str[len - 1] == 007) len--; } else if (str[0] == 033) { switch (str[1]) { case '[': case ']': break; case 'x': /* can strip trailing '\r' from M-x sequence */ if (str[len - 1] == '\r') len--; /* drop */ default: fprintf(fp, "M-"); /* meta prefix */ str++; len--; break; } } /* * control character form is preferred, since backslash-escaping * can be really ugly looking when the backslashes themselves also * have to be escaped to avoid Shell (or whatever scripting * language) interpretation */ while (len > 0) { unsigned char ch = *str++; switch (ch) { case 033: fprintf(fp, "\\E"); break; /* escape */ case '\r': fprintf(fp, "\\r"); break; /* carriage-return */ case '\\': fprintf(fp, "\\\\"); break; /* backslash */ case '^': fprintf(fp, "\\^"); break; /* caret */ case 127: fprintf(fp, "^?"); default: if (ch <= 31) fprintf(fp, "^%c", ('@' + ch)); else if (ch > 127) fprintf(fp, "\\%o", ch); else fprintf(fp, "%c", ch); break; } len--; } fprintf(fp, "\n"); #endif } /* PROTO */ void menu_dump(FILE * fp, menu_t * menu) { #ifdef MENUBAR menuitem_t *item; /* create a new menu and clear it */ fprintf(fp, (menu->parent ? "./%s/*\n" : "/%s/*\n"), menu->name); for (item = menu->head; item != NULL; item = item->next) { switch (item->entry.type) { case MenuSubMenu: if (item->entry.submenu.menu == NULL) fprintf(fp, "> %s == NULL\n", item->name); else menu_dump(fp, item->entry.submenu.menu); break; case MenuLabel: fprintf(fp, "{%s}\n", (strlen(item->name) ? item->name : "-")); break; case MenuTerminalAction: case MenuAction: fprintf(fp, "{%s}", item->name); if (item->name2 != NULL && strlen(item->name2)) fprintf(fp, "{%s}", item->name2); fprintf(fp, "\t"); action_decode(fp, &(item->entry.action)); break; } } fprintf(fp, (menu->parent ? "../\n" : "/\n\n")); #endif } /* PROTO */ void menubar_dump(FILE * fp) { #ifdef MENUBAR bar_t *bar = CurrentBar; time_t t; if (bar == NULL || fp == NULL) return; time(&t); fprintf(fp, "# " APL_SUBCLASS " (%s) Pid: %u\n# Date: %s\n\n", rs_name, (unsigned int)getpid(), ctime(&t)); /* dump in reverse order */ bar = CurrentBar->prev; do { menu_t *menu; int i; fprintf(fp, "[menu:%s]\n", bar->name); if (bar->title != NULL) fprintf(fp, "[title:%s]\n", bar->title); for (i = 0; i < NARROWS; i++) { switch (bar->arrows[i].type) { case MenuTerminalAction: case MenuAction: fprintf(fp, "<%c>", Arrows[i].name); action_decode(fp, &(bar->arrows[i])); break; } } fprintf(fp, "\n"); for (menu = bar->head; menu != NULL; menu = menu->next) menu_dump(fp, menu); fprintf(fp, "\n[done:%s]\n\n", bar->name); bar = bar->prev; } while (bar != CurrentBar->prev); #endif } #endif /* (MENUBAR_MAX > 1) */ /* * read in menubar commands from FILENAME * ignore all input before the tag line [menu] or [menu:???] * * Note that since File_find () is used, FILENAME can be semi-colon * delimited such that the second part can refer to a tag * so that a large `database' of menus can be collected together * * FILENAME = "file" * FILENAME = "file;" * read `file' starting with first [menu] or [menu:???] line * * FILENAME = "file;tag" * read `file' starting with [menu:tag] */ /* PROTO */ void menubar_read(const char *filename) { #ifdef MENUBAR /* read in a menu from a file */ FILE *fp; char buffer[256]; char *p, *tag = NULL; const char *file; file = File_find(filename, ".menu"); if (file == NULL || (fp = fopen(file, "rb")) == NULL) return; #if (MENUBAR_MAX > 1) /* semi-colon delimited */ if ((tag = strchr(filename, ';')) != NULL) { tag++; if (*tag == '\0') tag = NULL; } #endif /* (MENUBAR_MAX > 1) */ #ifdef DEBUG_MENU printf("[read:%s]\n", p); if (tag) printf("looking for [menu:%s]\n", tag); #endif while ((p = fgets(buffer, sizeof(buffer), fp)) != NULL) { int n; if ((n = Str_match(p, "[menu")) != 0) { if (tag) { /* looking for [menu:tag] */ if (p[n] == ':' && p[n + 1] != ']') { n++; n += Str_match(p + n, tag); if (p[n] == ']') { #ifdef DEBUG_MENU printf("[menu:%s]\n", tag); #endif break; } } } else if (p[n] == ':' || p[n] == ']') break; } } /* found [menu], [menu:???] tag */ while (p != NULL) { int n; #ifdef DEBUG_MENU printf("read line = %s\n", p); #endif /* looking for [done:tag] or [done:] */ if ((n = Str_match(p, "[done")) != 0) { if (p[n] == ']') { menu_readonly = 1; break; } else if (p[n] == ':') { n++; if (p[n] == ']') { menu_readonly = 1; break; } else if (tag) { n += Str_match(p + n, tag); if (p[n] == ']') { #ifdef DEBUG_MENU printf("[done:%s]\n", tag); #endif menu_readonly = 1; break; } } else { /* what? ... skip this line */ p[0] = COMMENT_CHAR; } } } /* * remove leading/trailing space * and strip-off leading/trailing quotes * skip blank or comment lines */ p = Str_trim(p); if (p != NULL && *p && *p != '#') { menu_readonly = 0; /* if case we read another file */ menubar_dispatch(p); } /* get another line */ p = fgets(buffer, sizeof(buffer), fp); } fclose(fp); #endif } /* * user interface for building/deleting and otherwise managing menus */ /* PROTO */ void menubar_dispatch(char *str) { #ifdef MENUBAR static menu_t *BuildMenu = NULL; /* the menu currently being built */ int n, cmd; char *path, *name, *name2; if (menubar_visible() && ActiveMenu != NULL) menubar_expose(); else ActiveMenu = NULL; cmd = *str; switch (cmd) { case '.': case '/': /* absolute & relative path */ case MENUITEM_BEG: /* menuitem */ /* add `+' prefix for these cases */ cmd = '+'; break; case '+': case '-': str++; /* skip cmd character */ break; case '<': #if (MENUBAR_MAX > 1) if (CurrentBar == NULL) break; #endif /* (MENUBAR_MAX > 1) */ if (str[1] && str[2] == '>') /* arrow commands */ menuarrow_add(str); break; case '[': /* extended command */ while (str[0] == '[') { char *next = (++str); /* skip leading '[' */ if (str[0] == ':') { /* [:command:] */ do { next++; if ((next = strchr(next, ':')) == NULL) return; /* parse error */ } while (next[1] != ']'); /* remove and skip ':]' */ *next = '\0'; next += 2; } else { if ((next = strchr(next, ']')) == NULL) return; /* parse error */ /* remove and skip ']' */ *next = '\0'; next++; } if (str[0] == ':') { int saved; /* try and dispatch it, regardless of read/write status */ saved = menu_readonly; menu_readonly = 0; menubar_dispatch(str + 1); menu_readonly = saved; } /* these ones don't require menu stacking */ else if (!strcmp(str, "clear")) { menubar_clear(); } else if (!strcmp(str, "done") || Str_match(str, "done:")) { menu_readonly = 1; } else if (!strcmp(str, "show")) { map_menuBar(1); menu_readonly = 1; } else if (!strcmp(str, "hide")) { map_menuBar(0); menu_readonly = 1; } else if ((n = Str_match(str, "read:")) != 0) { /* read in a menu from a file */ str += n; menubar_read(str); } else if ((n = Str_match(str, "title:")) != 0) { str += n; if (CurrentBar != NULL && !menu_readonly) { if (*str) { name = REALLOC(CurrentBar->title, strlen(str) + 1); if (name != NULL) { STRCPY(name, str); CurrentBar->title = name; } menubar_expose(); } else { FREE(CurrentBar->title); CurrentBar->title = NULL; } } } else if ((n = Str_match(str, "pixmap:")) != 0) { str += n; xterm_seq(XTerm_Pixmap, str); } #if (MENUBAR_MAX > 1) else if ((n = Str_match(str, "rm")) != 0) { str += n; switch (str[0]) { case ':': str++; menubar_remove(str); break; case '\0': menubar_remove(str); break; case '*': menubar_remove(str); break; } menu_readonly = 1; } else if ((n = Str_match(str, "menu")) != 0) { str += n; switch (str[0]) { case ':': str++; /* add/access menuBar */ if (*str != '\0' && *str != '*') menubar_push(str); break; default: if (CurrentBar == NULL) { menubar_push("default"); } } if (CurrentBar != NULL) menu_readonly = 0; /* allow menu build commands */ } else if (!strcmp(str, "dump")) { /* dump current menubars to a file */ FILE *fp; /* enough space to hold the results */ char buffer[32]; sprintf(buffer, "/tmp/" APL_SUBCLASS "-%u", (unsigned int)getpid()); if ((fp = fopen(buffer, "wb")) != NULL) { xterm_seq(XTerm_title, buffer); menubar_dump(fp); fclose(fp); } } else if (!strcmp(str, "next")) { if (CurrentBar) { CurrentBar = CurrentBar->next; menu_readonly = 1; } } else if (!strcmp(str, "prev")) { if (CurrentBar) { CurrentBar = CurrentBar->prev; menu_readonly = 1; } } else if (!strcmp(str, "swap")) { /* swap the top 2 menus */ if (CurrentBar) { bar_t *prev = CurrentBar->prev; bar_t *next = CurrentBar->next; prev->next = next; next->prev = prev; CurrentBar->next = prev; CurrentBar->prev = prev->prev; prev->prev->next = CurrentBar; prev->prev = CurrentBar; CurrentBar = prev; menu_readonly = 1; } } #endif /* (MENUBAR_MAX > 1) */ str = next; BuildMenu = ActiveMenu = NULL; menubar_expose(); #ifdef DEBUG_MENUBAR_STACKING printf("menus are read%s\n", menu_readonly ? "only" : "/write"); #endif } return; break; } #if (MENUBAR_MAX > 1) if (CurrentBar == NULL) return; if (menu_readonly) { #ifdef DEBUG_MENUBAR_STACKING printf("menus are read%s\n", menu_readonly ? "only" : "/write"); #endif return; } #endif /* (MENUBAR_MAX > 1) */ switch (cmd) { case '+': case '-': path = name = str; name2 = NULL; /* parse STR, allow spaces inside (name) */ if (path[0] != '\0') { name = strchr(path, MENUITEM_BEG); str = strchr(path, MENUITEM_END); if (name != NULL || str != NULL) { if (name == NULL || str == NULL || str <= (name + 1) || (name > path && name[-1] != '/')) { print_error("menu error <%s>\n", path); break; } if (str[1] == MENUITEM_BEG) { name2 = (str + 2); str = strchr(name2, MENUITEM_END); if (str == NULL) { print_error("menu error <%s>\n", path); break; } name2[-2] = '\0'; /* remove prev MENUITEM_END */ } if (name > path && name[-1] == '/') name[-1] = '\0'; *name++ = '\0'; /* delimit */ *str++ = '\0'; /* delimit */ while (isspace(*str)) str++; /* skip space */ } #ifdef DEBUG_MENU printf("`%c' path = <%s>, name = <%s>, name2 = <%s>, action = <%s>\n", cmd, (path ? path : "(nil)"), (name ? name : "(nil)"), (name2 ? name2 : "(nil)"), (str ? str : "(nil)") ); #endif } /* process the different commands */ switch (cmd) { case '+': /* add/replace existing menu or menuitem */ if (path[0] != '\0') { int len; path = menu_find_base(&BuildMenu, path); len = strlen(path); /* don't allow menus called `*' */ if (path[0] == '*') { menu_clear(BuildMenu); break; } else if (len >= 2 && !strcmp((path + len - 2), "/*")) { path[len - 2] = '\0'; } if (path[0] != '\0') BuildMenu = menu_add(BuildMenu, path); } if (name != NULL && name[0] != '\0') { if (!strcmp(name, SEPARATOR_NAME)) name = ""; menuitem_add(BuildMenu, name, name2, str); } break; case '-': /* delete menu entry */ if (!strcmp(path, "/*") && (name == NULL || name[0] == '\0')) { menubar_clear(); BuildMenu = NULL; menubar_expose(); break; } else if (path[0] != '\0') { int len; menu_t *menu = BuildMenu; path = menu_find_base(&menu, path); len = strlen(path); /* submenu called `*' clears all menu items */ if (path[0] == '*') { menu_clear(menu); break; /* done */ } else if (len >= 2 && !strcmp(&path[len - 2], "/*")) { /* done */ break; } else if (path[0] != '\0') { BuildMenu = NULL; break; } else { BuildMenu = menu; } } if (BuildMenu != NULL) { if (name == NULL || name[0] == '\0') { BuildMenu = menu_delete(BuildMenu); } else { menuitem_t *item; if (!strcmp(name, SEPARATOR_NAME)) name = ""; item = menuitem_find(BuildMenu, name); if (item != NULL && item->entry.type != MenuSubMenu) { menuitem_free(BuildMenu, item); /* fix up the width */ BuildMenu->width = 0; for (item = BuildMenu->head; item != NULL; item = item->next) { if (BuildMenu->width < (item->len + item->len2)) BuildMenu->width = (item->len + item->len2); } } } menubar_expose(); } break; } break; } #endif } /* PROTO */ void draw_Arrows(int name, int state) { #ifdef MENUBAR GC top, bot; int i; #ifdef MENU_SHADOW_IN state = -state; #endif switch (state) { case +1: top = topShadowGC; bot = botShadowGC; break; /* SHADOW_OUT */ case -1: top = botShadowGC; bot = topShadowGC; break; /* SHADOW_IN */ default: top = bot = neutralGC; break; /* neutral */ } if (!Arrows_x) return; for (i = 0; i < NARROWS; i++) { const int w = Width2Pixel(1); const int y = (menuBar_TotalHeight() - w) / 2; int x = Arrows_x + (5 * Width2Pixel(i)) / 4; if (!name || name == Arrows[i].name) Draw_Triangle(menuBar.win, top, bot, x, y, w, Arrows[i].name); } XFlush(Xdisplay); #endif } /* PROTO */ void menubar_expose(void) { #ifdef MENUBAR menu_t *menu; int x; if (delay_menu_drawing || !menubar_visible()) return; if (menubarGC == None) { /* Create the graphics context */ XGCValues gcvalue; gcvalue.font = TermWin.font->fid; gcvalue.foreground = (Xdepth <= 2 ? PixColors[Color_fg] : PixColors[Color_Black]); menubarGC = XCreateGC(Xdisplay, menuBar.win, GCForeground | GCFont, &gcvalue); gcvalue.foreground = PixColors[Color_scroll]; neutralGC = XCreateGC(Xdisplay, menuBar.win, GCForeground, &gcvalue); gcvalue.foreground = PixColors[Color_bottomShadow]; botShadowGC = XCreateGC(Xdisplay, menuBar.win, GCForeground | GCFont, &gcvalue); gcvalue.foreground = PixColors[Color_topShadow]; topShadowGC = XCreateGC(Xdisplay, menuBar.win, GCForeground, &gcvalue); } /* make sure the font is correct */ XSetFont(Xdisplay, menubarGC, TermWin.font->fid); XSetFont(Xdisplay, botShadowGC, TermWin.font->fid); XClearWindow(Xdisplay, menuBar.win); menu_hide_all(); x = 0; if (CurrentBar != NULL) { for (menu = CurrentBar->head; menu != NULL; menu = menu->next) { int len = menu->len; x = (menu->x + menu->len + HSPACE); #ifdef DEBUG_MENU_LAYOUT print_menu_descendants(menu); #endif if (x >= TermWin.ncol) len = (TermWin.ncol - (menu->x + HSPACE)); drawbox_menubar(menu->x, len, +1); XDrawString(Xdisplay, menuBar.win, menubarGC, (Width2Pixel(menu->x) + Width2Pixel(HSPACE) / 2 ), menuBar_height() - MENU_MARGIN, menu->name, len); if (x >= TermWin.ncol) break; } } drawbox_menubar(x, TermWin.ncol, (CurrentBar ? +1 : -1)); /* add the menuBar title, if it exists and there's plenty of room */ Arrows_x = 0; if (x < TermWin.ncol) { char *str, title[256]; int len, ncol = TermWin.ncol; if (x < (ncol - (NARROWS + 1))) { ncol -= (NARROWS + 1); Arrows_x = Width2Pixel(ncol); } draw_Arrows(0, +1); str = (CurrentBar && CurrentBar->title ? CurrentBar->title : "%n-%v"); for (len = 0; str[0] && len < sizeof(title) - 1; str++) { const char *s = NULL; switch (str[0]) { case '%': str++; switch (str[0]) { case 'n': s = rs_name; break; /* resource name */ case 'v': s = VERSION; break; /* version number */ case '%': s = "%"; break; /* literal '%' */ } if (s != NULL) while (*s && len < sizeof(title) - 1) title[len++] = *s++; break; default: title[len++] = str[0]; break; } } title[len] = '\0'; ncol -= (x + len + HSPACE); if (len > 0 && ncol >= 0) XDrawString(Xdisplay, menuBar.win, menubarGC, Width2Pixel(x) + Width2Pixel(ncol + HSPACE) / 2, menuBar_height() - MENU_MARGIN, title, len); } #endif } /* PROTO */ int menubar_mapping(int map) { int change = 0; #ifdef MENUBAR if (map && !menubar_visible()) { menuBar.state = 1; XMapWindow(Xdisplay, menuBar.win); change = 1; } else if (!map && menubar_visible()) { menubar_expose(); menuBar.state = 0; XUnmapWindow(Xdisplay, menuBar.win); change = 1; } else menubar_expose(); #endif return change; } /* PROTO */ int menu_select(XButtonEvent * ev) { #ifdef MENUBAR menuitem_t *thisitem, *item = NULL; int this_y, y; Window unused_root, unused_child; int unused_root_x, unused_root_y; unsigned int unused_mask; if (ActiveMenu == NULL) return 0; XQueryPointer(Xdisplay, ActiveMenu->win, &unused_root, &unused_child, &unused_root_x, &unused_root_y, &(ev->x), &(ev->y), &unused_mask); if (ActiveMenu->parent != NULL && (ev->x < 0 || ev->y < 0)) { menu_hide(); return 1; } /* determine the menu item corresponding to the Y index */ y = 0; if (ev->x >= 0 && ev->x <= (ActiveMenu->w - SHADOW)) { for (item = ActiveMenu->head; item != NULL; item = item->next) { int h = menu_height(); if (isSeparator(item->name)) { h = SEPARATOR_HEIGHT; } else if (ev->y >= y && ev->y < (y + h)) { break; } y += h; } } if (item == NULL && ev->type == ButtonRelease) { menu_hide_all(); return 0; } thisitem = item; this_y = y; /* erase the last item */ if (ActiveMenu->item != NULL) { if (ActiveMenu->item != thisitem) { for (y = 0, item = ActiveMenu->head; item != NULL; item = item->next) { int h = menu_height(); if (isSeparator(item->name)) { h = SEPARATOR_HEIGHT; } else if (item == ActiveMenu->item) { /* erase old menuitem */ drawbox_menuitem(y, 0); /* No Shadow */ if (item->entry.type == MenuSubMenu) drawtriangle(ActiveMenu->w, y, +1); break; } y += h; } } else { switch (ev->type) { case ButtonRelease: switch (item->entry.type) { case MenuLabel: case MenuSubMenu: menu_hide_all(); break; case MenuAction: case MenuTerminalAction: drawbox_menuitem(this_y, -1); /* * use select for timing * remove menu before sending keys to the application */ { #ifdef __CYGWIN32__ struct timeval tv; tv.tv_sec = 0; tv.tv_usec = MENU_DELAY_USEC; select(0, NULL, NULL, NULL, &tv); #else struct itimerval tv; tv.it_value.tv_sec = 0; tv.it_value.tv_usec = MENU_DELAY_USEC; select(0, NULL, NULL, NULL, &tv.it_value); #endif } menu_hide_all(); #ifndef DEBUG_MENU action_dispatch(&(item->entry.action)); #else /* DEBUG_MENU */ printf("%s: %s\n", item->name, item->entry.action.str); #endif /* DEBUG_MENU */ break; } break; default: if (item->entry.type == MenuSubMenu) goto DoMenu; break; } return 0; } } DoMenu: ActiveMenu->item = thisitem; y = this_y; if (thisitem != NULL) { item = ActiveMenu->item; if (item->entry.type != MenuLabel) drawbox_menuitem(y, +1); if (item->entry.type == MenuSubMenu) { int x; drawtriangle(ActiveMenu->w, y, -1); x = ev->x + (ActiveMenu->parent ? ActiveMenu->x : Width2Pixel(ActiveMenu->x)); if (x >= item->entry.submenu.menu->x) { ActiveMenu = item->entry.submenu.menu; menu_show(); return 1; } } } #endif return 0; } /* PROTO */ void menubar_select(XButtonEvent * ev) { #ifdef MENUBAR menu_t *menu = NULL; /* determine the pulldown menu corresponding to the X index */ if (ev->y >= 0 && ev->y <= menuBar_height() && CurrentBar != NULL) { for (menu = CurrentBar->head; menu != NULL; menu = menu->next) { int x = Width2Pixel(menu->x); int w = Width2Pixel(menu->len + HSPACE); if ((ev->x >= x && ev->x < x + w)) break; } } switch (ev->type) { case ButtonRelease: menu_hide_all(); break; case ButtonPress: if (menu == NULL && Arrows_x && ev->x >= Arrows_x) { int i; for (i = 0; i < NARROWS; i++) { if (ev->x >= (Arrows_x + (Width2Pixel(4 * i + i)) / 4) && ev->x < (Arrows_x + (Width2Pixel(4 * i + i + 4)) / 4)) { draw_Arrows(Arrows[i].name, -1); /* * use select for timing */ { #ifdef __CYGWIN32__ struct timeval tv; tv.tv_sec = 0; tv.tv_usec = MENU_DELAY_USEC; select(0, NULL, NULL, NULL, &tv); #else struct itimerval tv; tv.it_value.tv_sec = 0; tv.it_value.tv_usec = MENU_DELAY_USEC; select(0, NULL, NULL, NULL, &tv.it_value); #endif } draw_Arrows(Arrows[i].name, +1); #ifdef DEBUG_MENUARROWS printf("'%c': ", Arrows[i].name); if (CurrentBar == NULL || (CurrentBar->arrows[i].type != MenuAction && CurrentBar->arrows[i].type != MenuTerminalAction)) { if (Arrows[i].str != NULL && Arrows[i].str[0]) printf("(default) \\033%s\n", &(Arrows[i].str[2])); } else { printf("%s\n", CurrentBar->arrows[i].str); } #else /* DEBUG_MENUARROWS */ if (CurrentBar == NULL || action_dispatch(&(CurrentBar->arrows[i]))) { if (Arrows[i].str != NULL && Arrows[i].str[0] != 0) tt_write((Arrows[i].str + 1), Arrows[i].str[0]); } #endif /* DEBUG_MENUARROWS */ return; } } } /*drop */ default: /* * press menubar or move to a new entry */ if (menu != NULL && menu != ActiveMenu) { menu_hide_all(); /* pop down old menu */ ActiveMenu = menu; menu_show(); /* pop up new menu */ } break; } #endif } /* * general dispatch routine, * it would be nice to have `sticky' menus */ /* PROTO */ void menubar_control(XButtonEvent * ev) { #ifdef MENUBAR switch (ev->type) { case ButtonPress: if (ev->button == Button1) menubar_select(ev); break; case ButtonRelease: if (ev->button == Button1) menu_select(ev); break; case MotionNotify: while (XCheckTypedWindowEvent(Xdisplay, TermWin.parent, MotionNotify, (XEvent *) ev)) ; if (ActiveMenu) while (menu_select(ev)) ; else ev->y = -1; if (ev->y < 0) { Window unused_root, unused_child; int unused_root_x, unused_root_y; unsigned int unused_mask; XQueryPointer(Xdisplay, menuBar.win, &unused_root, &unused_child, &unused_root_x, &unused_root_y, &(ev->x), &(ev->y), &unused_mask); menubar_select(ev); } break; } #endif } /* PROTO */ void map_menuBar(int map) { #ifdef MENUBAR if (delay_menu_drawing) { delay_menu_drawing++; } else if (menubar_mapping(map)) resize(); #endif } /* PROTO */ void create_menuBar(Cursor cursor) { #ifdef MENUBAR /* menuBar: size doesn't matter */ menuBar.win = XCreateSimpleWindow(Xdisplay, TermWin.parent, 0, 0, 1, 1, 0, PixColors[Color_fg], PixColors[Color_scroll]); XDefineCursor(Xdisplay, menuBar.win, cursor); XSelectInput(Xdisplay, menuBar.win, (ExposureMask | ButtonPressMask | ButtonReleaseMask | Button1MotionMask)); #endif } /* PROTO */ void Resize_menuBar(int x, int y, unsigned int width, unsigned int height) { #ifdef MENUBAR XMoveResizeWindow(Xdisplay, menuBar.win, x, y, width, height); #endif } /*----------------------- end-of-file (C source) -----------------------*/ aterm-1.0.1/src/graphics/0000755000175000001440000000000010654145567013717 5ustar vaeusersaterm-1.0.1/src/graphics/data0000644000175000001440000000004610144447061014537 0ustar vaeusers0 1e+4 1e+4 2e+4 2e+6 5e+2 5e+2 7e+5 aterm-1.0.1/src/graphics/qplot.c0000644000175000001440000001303710144447061015212 0ustar vaeusersstatic const char rcsid[] = "$Rxvt: qplot.c,v 1.2 1998/04/20 07:26:21 mason Exp $"; #include #include #include #include #include "grxlib.h" #define Real float #ifndef GRX_SCALE # define GRX_SCALE 10000 #endif #define DEFAULT_DATA_FILE "data" static void axis_round (Real *min, Real *max, Real *grid_spacing) { int logspace; logspace = (int)(log10 ((*max - *min)/10.0) + 0.5); *grid_spacing = pow (10, (double)logspace); *min = (Real)((int)(*min / (*grid_spacing))) * (*grid_spacing); *max = (Real)((int)(*max / (*grid_spacing))+1) * (*grid_spacing); } static int nice_end (int junk) { CloseGraphics (); putchar ('\n'); exit (EXIT_SUCCESS); return 0; } int main (int argc, char **argv) { char line[256], *file = NULL; long id,winclick; int Do_Start = 1,tmp; Real x[1000000], y[1000000]; Real nls[1000]; int m, p, i, j, n, nchars, theight, twidth, xclick, yclick; int downx = 1000,downy = 1000,upx,upy; Real xmax, xmin, ymax, ymin, xdiff, ydiff, xgrid_spacing, ygrid_spacing; FILE *fd; char axis[100]; LineFunction linetype = StartLine; ymax = xmax = -HUGE_VAL; ymin = xmin = HUGE_VAL; for (i = 1; i < argc; i++) { if (*argv[i] == '-') { if (!strcmp (argv[i], "-nl")) linetype = StartPoint; else if (argv[i][1] == '\0') /* use stdin */ file = argv [i]; else { fprintf(stderr, "Usage:\n\t %s [options] [file]\n\n", argv[0]); fprintf(stderr, "where options include:\n" " -pt plot with points instead of lines\n\n"); fprintf(stderr, "file name `-' specifies stdin\n" "if no file name is specified, " "the default is \"%s\"\n\n", DEFAULT_DATA_FILE); return EXIT_FAILURE; } } else { file = argv [i]; } } if (!strcmp (file, "-")) { fd = stdin; file = "stdin"; } else { if (file == NULL) file = DEFAULT_DATA_FILE; if ((fd = fopen (file, "r")) == NULL) { fprintf (stderr, "%s: can't open file \"%s\"\n", argv[0], file); return EXIT_FAILURE; } } m = 0; p = 0; while (fgets(line, sizeof(line),fd) != NULL) { if (sscanf(line,"%f %f",&x[m], &y[m]) == 2) { if (x[m] > xmax) xmax = x[m]; else if (x[m] < xmin) xmin = x[m]; if (y[m] > ymax) ymax = y[m]; else if (y[m] < ymin) ymin = y[m]; m++; } else { nls [p] = m; p++; } } nls [p++] = m; if (m == 0) return; signal (SIGTERM, nice_end); signal (SIGSTOP, nice_end); signal (SIGTSTP, nice_end); signal (SIGINT, nice_end); signal (SIGQUIT, nice_end); if (!InitializeGraphics (1)) return EXIT_FAILURE; n = 1; do { axis_round (&xmin, &xmax, &xgrid_spacing); axis_round (&ymin, &ymax, &ygrid_spacing); id = CreateWin (0, 0, GRX_SCALE, GRX_SCALE); if (id == 0) { fprintf (stderr,"Help id = 0\n"); return EXIT_FAILURE; } /* Fill the window in black for real eye-catching graphics! */ ForeColor (0); StartFill (id); FillArea (0, 0, GRX_SCALE, GRX_SCALE); Done (); /* draw outline box in white */ ForeColor (7); /* Draw outline box */ StartLine(id); Extend (1000, 1000); Extend (1000, 9000); Extend (9000, 9000); Extend (9000, 1000); Extend (1000, 1000); Done(); /* Draw the data - either lines or dots */ xdiff = 8000 / (xmax-xmin); ydiff = 8000 / (ymax-ymin); for (i = j = 0; j < p; j++) { int n = 0; ForeColor (j%6+1); while (((x[i] < xmin) || (x[i] > xmax) || (y[i] < ymin) || (y[i] > ymax)) && (i < nls [j])) i++; while (i < nls [j]) { if (n == 0) linetype (id); Extend (1000+(x[i]-xmin)*xdiff,9000-(y[i]-ymin)*ydiff); n++; if (n > 450) { Done (); n = 0; continue; } i++; while ((i < nls [j]) && ((x [i] < xmin) || (x [i] > xmax) || (y [i] < ymin) || (y [i] > ymax))) i++; } if (n > 0) Done (); } /* Do axis labels in black */ ForeColor (7); QueryWin (id, &twidth,&theight); PlaceText (id, GRX_SCALE/2, 0, HCENTER_TEXT|TOP_TEXT, file); PlaceText (id, GRX_SCALE/2, GRX_SCALE, HCENTER_TEXT|BOTTOM_TEXT, "X"); PlaceText (id, 0, GRX_SCALE/2, LEFT_TEXT|VCENTER_TEXT, "Y"); sprintf (axis, "%f", ymax); nchars = 1000 / twidth; axis [nchars] = 0; PlaceText (id, GRX_SCALE/10, GRX_SCALE/10, RIGHT_TEXT|TOP_TEXT, axis); sprintf (axis, "%f", ymin); axis [nchars] = 0; PlaceText (id, GRX_SCALE/10, 9*GRX_SCALE/10, RIGHT_TEXT|BOTTOM_TEXT,axis); sprintf (axis, "%f",xmax); PlaceText (id, 9*GRX_SCALE/10, 9*GRX_SCALE/10, HCENTER_TEXT|TOP_TEXT,axis); sprintf (axis,"%f",xmin); PlaceText (id, GRX_SCALE/10, 9*GRX_SCALE/10, HCENTER_TEXT|TOP_TEXT,axis); fflush (stdout); do { n = WaitForCarriageReturn (&winclick, &xclick, &yclick); switch (n) { case 1: downx = xclick; downy = yclick; break; case 2: upx = xclick; upy = yclick; if (upx < downx) { tmp = downx; downx = upx; upx = tmp; } if (upy < downy) { tmp = downy; downy = upy; upy = tmp; } xmin = (xmax - xmin) * (downx - 1000) / (8000) + xmin; xmax = (xmax - xmin) * (upx - 1000) / (8000) + xmin; ymax = ymax - (ymax - ymin) * (downy - 1000) / (8000); ymin = ymax - (ymax - ymin) * (upy - 1000) / (8000); break; } } while (n && (n != 2)); } while (n); nice_end (EXIT_SUCCESS); return EXIT_SUCCESS; } /*----------------------- end-of-file (C source) -----------------------*/ aterm-1.0.1/src/graphics/README0000644000175000001440000000004510144447061014562 0ustar vaeusersThis is an example of rxvt graphics. aterm-1.0.1/src/graphics/grxlib.c0000644000175000001440000000706010144447061015341 0ustar vaeusersstatic const char rcsid[] = "$Rxvt: grxlib.c,v 1.2 1998/04/20 07:26:20 mason Exp $"; #include #include #include #include #include #ifdef _AIX # include #else # include #endif #include "grxlib.h" /*----------------------------------------------------------------------*/ void Done (void) { putchar (':'); } void StartLine (long id) { printf ("\033GL%ld", id); } void StartPoint (long id) { printf ("\033GP%ld", id); } void StartFill (long id) { printf ("\033GF%ld", id); } void Extend (int x, int y) { printf (";%d;%d", x, y); } void FillArea (int x1, int y1, int x2, int y2) { printf (";%d;%d;%d;%d", x1, y1, x2, y2); } void PlaceText (long id, int x, int y, int mode, char *text) { printf ("\033GT%ld;%d;%d;%d;%d:%s", id, x, y, mode, strlen(text), text); fflush (stdout); } void ClearWindow (long id) { printf ("\033GC%ld:", id); } void ForeColor (int col) { printf ("\033[3%dm", (col<0||col>7)?0:col); } void DefaultRendition (void) { printf ("\033[m"); } #define LINESZ 100 static char line [LINESZ]; static FILE *infd = NULL; long CreateWin (int x, int y, int w, int h) { long id = 0; fflush (stdout); printf ("\033GW%d;%d;%d;%d:", x, y, w, h); fflush (stdout); while (1) { if ((fgets (line, LINESZ, infd) != NULL) && (sscanf (line,"\033W%ld", &id) == 1)) break; } return id; } void QueryWin (long id, int *nfwidth, int *nfheight) { int id1, x, y, width, height, fwidth, fheight; printf ("\033GG%ld:",id); fflush (stdout); while (1) { if ((fgets (line, sizeof(line), infd) != NULL) && (sscanf (line,"\033G%ld %ld %ld %ld %ld %ld %ld %ld %ld", &id1, &x, &y, &width, &height, &fwidth, &fheight, nfwidth, nfheight) != 0)) break; } } int WaitForCarriageReturn (long *win, int *x, int *y) { int i, len; fgets (line, LINESZ, infd); line [LINESZ-1] = 0; len = strlen (line); for (i = 0; i < len; i++) { if (line [i] == '\033') { int ret = 1; i++; switch (line[i]) { case 'R': ret++; /* drop */ case 'P': sscanf (&line[i+1],"%ld;%d;%d", win, x, y); return ret; break; } } } return 0; } static int fno2; static struct termios ttmode; int InitializeGraphics (int scroll_text_up) { int fno, i; char *screen_tty; struct winsize winsize; fno = fileno (stdout); if (!isatty (fno)) { fprintf (stderr, "stdout must be a tty\n"); return 0; } screen_tty = ttyname (fno); ioctl (fno, TCGETS, (char *)&ttmode); ttmode.c_lflag &= ~ECHO; ioctl (fno, TCSETS, (char *)&ttmode); infd = fopen (screen_tty, "rw"); fno2 = fileno (infd); ioctl (fno2, TCGETS, (char *)&ttmode); ttmode.c_lflag &= ~ECHO; ioctl (fno2, TCSETS, (char *)&ttmode); /* query rxvt to find if graphics are available */ fflush (stdout); printf ("\033GQ"); fflush (stdout); while (1) { if ((fgets (line, LINESZ, infd) != NULL) && (sscanf (line,"\033G%d", &i) == 1)) { if (!i) { fprintf (stderr, "rxvt graphics not available\n"); CloseGraphics (); return 0; } break; } } if (scroll_text_up) { ioctl (fno, TIOCGWINSZ, &winsize); fflush (stdout); for (i = 0; i < winsize.ws_row; i++) putchar ('\n'); fflush (stdout); } return i; } void CloseGraphics (void) { DefaultRendition (); fflush (stdout); ttmode.c_lflag |= ECHO; ioctl (fno2, TCSETS, (char *)&ttmode); fclose (infd); } /*----------------------- end-of-file (C source) -----------------------*/ aterm-1.0.1/src/graphics/grxlib.h0000644000175000001440000000203010144447061015336 0ustar vaeusers/* * $Id: grxlib.h,v 1.1.1.1 2004/11/10 17:21:53 sasha Exp $ */ #include "rxvtgrx.h" /* text alignment */ /*function pointer to either StartLine or StartPoint */ typedef void (*LineFunction) (long id); #ifdef __cplusplus extern "C" { #endif extern void StartLine (long id); extern void StartPoint (long id); extern void Extend (int x, int y); extern void StartFill (long id); extern void FillArea (int x1, int y1, int x2, int y2); extern void Done (void); extern void PlaceText (long id, int x, int y, int mode, char *text); extern void ClearWindow (long id); extern long CreateWin (int x, int y, int w, int h); extern void QueryWin (long id, int *nfwidth, int *nfheight); extern void ForeColor (int color); extern void DefaultRendition (void); extern int WaitForCarriageReturn (long *win, int *x, int *y); extern int InitializeGraphics (int scroll_text_up); extern void CloseGraphics (void); #ifdef __cplusplus } #endif /*----------------------- end-of-file (C header) -----------------------*/ aterm-1.0.1/src/graphics/Makefile.in0000644000175000001440000000221010144447061015743 0ustar vaeusers# test/graphics/Makefile.in -*- Makefile -*- # $Id: Makefile.in,v 1.1.1.1 2004/11/10 17:21:53 sasha Exp $ @MCOMMON@ srcdir = @srcdir@ VPATH = @srcdir@ basedir = ../.. thisdir = src/graphics first_rule: qplot dummy: SRCS = grxlib.c qplot.c OBJS = grxlib.o qplot.o HDRS = grxlib.h # # Distribution variables # DIST = $(HDRS) $(SRCS) README data Makefile.in # inference rules .c.o: $(CC) -c $(CPPFLAGS) -I. -I$(basedir) -I$(srcdir) -I$(srcdir)/.. $(DEFS) $(CFLAGS) $< #------------------------------------------------------------------------- all: graphics: qplot qplot: $(OBJS) $(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS) -lm tags: $(SRCS) ctags $(SRCS) alldoc: allbin: qplot clean: $(RMF) qplot core a.out *.o *.bak *~ realclean: clean $(RMF) tags distclean: (cd $(srcdir); $(RMF) qplot *~ *.o core a.out) if test $(srcdir) = .; then $(MAKE) realclean; fi (cd $(srcdir); $(RMF) Makefile) install uninstall: distdirs: mkdir $(basedir)/../$(VERNAME)/$(thisdir) distcopy: $(CP) -p $(DIST) $(basedir)/../$(VERNAME)/$(thisdir) # ----------------------------------------------------------------------- # forget dependencies, there are too few aterm-1.0.1/src/command.c0000644000175000001440000032004610450020360013657 0ustar vaeusers/*--------------------------------*-C-*---------------------------------* * File: command.c *----------------------------------------------------------------------* * Copyright (C) 1997,1998 Oezguer Kesim * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *----------------------------------------------------------------------*/ /*----------------------------------------------------------------------* * Originally written: * 1992 John Bovey, University of Kent at Canterbury * Modifications: * 1994 Robert Nation * - extensive modifications * 1995 Garrett D'Amore * - vt100 printing * 1995 Steven Hirsch * - X11 mouse report mode and support for DEC "private mode" * save/restore functions. * 1995 Jakub Jelinek * - key-related changes to handle Shift+function keys properly. * 1997 MJ Olesen * - extensive modifications * 1997 Raul Garcia Garcia * - modification and cleanups for Solaris 2.x and Linux 1.2.x * 1997,1998 Oezguer Kesim * 1998 Geoff Wing * 1998 Alfredo K. Kojima * 1999 Rafal Wierzbicki * - support for Unix98 ptys with linux-2.2.x and glibc-2.1 *----------------------------------------------------------------------*/ #ifndef lint static const char rcsid[] = "$Id: command.c,v 1.24 2006/06/26 18:01:20 sasha Exp $"; #endif /*{{{ includes: */ #include "rxvt.h" /* NECESSARY */ #ifdef HAVE_AFTERSTEP #include "libAfterStep/event.h" #endif #define TT_PRINTF_LIMIT 1024 #if defined(OFFIX_DND) || defined(TRANSPARENT) # include #endif #ifdef OFFIX_DND # define DndFile 2 # define DndDir 5 # define DndLink 7 #endif #if defined __GLIBC__ && __GLIBC__ >= 2 # if defined __GLIBC_MINOR__ && __GLIBC_MINOR__ >= 1 # define __lnx21__ 1 # endif #endif #include #ifndef NO_XLOCALE # if (XtSpecificationRelease < 6) # define NO_XLOCALE # endif #endif /* NO_XLOCALE */ #ifndef NO_XSETLOCALE # define X_LOCALE # include #else # ifndef NO_SETLOCALE # include # endif #endif /* NO_XLOCALE */ #ifdef TTY_GID_SUPPORT # include #endif #if defined (__svr4__) || defined (__lnx21__) # include /* for struct rlimit */ # include /* for I_PUSH */ # define _NEW_TTY_CTRL /* to get proper defines in */ #endif /*}}} */ static unsigned int ModMetaMask, ModNumLockMask; /* pasting */ static char *v_buffer; /* pointer to physical buffer */ static char *v_bufstr = NULL; /* beginning of area to write */ static char *v_bufptr; /* end of area to write */ static char *v_bufend; /* end of physical buffer */ #define UPDATE_BACKGROUND_TIMEOUT_SEC 1 #define UPDATE_BACKGROUND_TIMEOUT_USEC 350000 /* third of a second delay */ static time_t last_update_background_request_sec = 0 ; static time_t last_update_background_request_usec = 0 ; static Bool first_background_update = True ; static void timer_get_time (time_t * sec, time_t * usec) { struct timeval tv; gettimeofday (&tv, NULL); *sec = tv.tv_sec; *usec = tv.tv_usec; } /* PROTO */ void request_background_update() { Bool repetitive = (last_update_background_request_sec!=0); timer_get_time (&last_update_background_request_sec, &last_update_background_request_usec ); if( first_background_update ) { last_update_background_request_usec += 5000; }else last_update_background_request_usec += repetitive?UPDATE_BACKGROUND_TIMEOUT_USEC:UPDATE_BACKGROUND_TIMEOUT_USEC*2 ; while( last_update_background_request_usec > 1000000 ) { ++last_update_background_request_sec ; last_update_background_request_usec -= 1000000 ; } #ifdef DEBUG_BACKGROUND_PMAP fprintf( stderr, "!!! %s\n", __FUNCTION__); #endif } /* PROTO */ void cancel_background_update() { last_update_background_request_sec = 0; #ifdef DEBUG_BACKGROUND_PMAP fprintf( stderr, "!!! %s\n", __FUNCTION__); #endif } /* PROTO */ void set_background_updated() { first_background_update = False ; last_update_background_request_sec = 0; #ifdef DEBUG_BACKGROUND_PMAP fprintf( stderr, "!!! %s\n", __FUNCTION__); #endif } void get_ourmods(void); int pixmap_error_handler (Display * dpy, XErrorEvent * error); /* #define DEBUG_TTYMODE */ /* #define DEBUG_CMD */ /*{{{ terminal mode defines: */ /* use the fastest baud-rate */ #ifdef B38400 # define BAUDRATE B38400 #else # ifdef B19200 # define BAUDRATE B19200 # else # define BAUDRATE B9600 # endif #endif /* Disable special character functions */ #ifdef _POSIX_VDISABLE # define VDISABLE _POSIX_VDISABLE #else # define VDISABLE 255 #endif /*----------------------------------------------------------------------* * system default characters if defined and reasonable */ #ifndef CINTR # define CINTR '\003' /* ^C */ #endif #ifndef CQUIT # define CQUIT '\034' /* ^\ */ #endif #ifndef CERASE # ifdef linux # define CERASE '\177' /* ^? */ # else # define CERASE '\010' /* ^H */ # endif #endif #ifndef CKILL # define CKILL '\025' /* ^U */ #endif #ifndef CEOF # define CEOF '\004' /* ^D */ #endif #ifndef CSTART # define CSTART '\021' /* ^Q */ #endif #ifndef CSTOP # define CSTOP '\023' /* ^S */ #endif #ifndef CSUSP # define CSUSP '\032' /* ^Z */ #endif #ifndef CDSUSP # define CDSUSP '\031' /* ^Y */ #endif #ifndef CRPRNT # define CRPRNT '\022' /* ^R */ #endif #ifndef CFLUSH # define CFLUSH '\017' /* ^O */ #endif #ifndef CWERASE # define CWERASE '\027' /* ^W */ #endif #ifndef CLNEXT # define CLNEXT '\026' /* ^V */ #endif #ifndef VDISCRD # ifdef VDISCARD # define VDISCRD VDISCARD # endif #endif #ifndef VWERSE # ifdef VWERASE # define VWERSE VWERASE # endif #endif /*}}} */ /*{{{ defines: */ #ifdef USE_XIM # define KBUFSZ 64 /* size of keyboard mapping buffer */ #else # define KBUFSZ 8 /* size of keyboard mapping buffer */ #endif #define STRING_MAX 512 /* max string size for process_xterm_seq() */ #define ESC_ARGS 32 /* max # of args for esc sequences */ /* a large REFRESH_PERIOD causes problems with `cat' */ #define REFRESH_PERIOD 1 #ifndef REFRESH_PERIOD # define REFRESH_PERIOD 10 #endif #ifndef MULTICLICK_TIME # define MULTICLICK_TIME 500 #endif #ifndef SCROLLBAR_INITIAL_DELAY # ifdef NEXT_SCROLLER # define SCROLLBAR_INITIAL_DELAY 20 # else # define SCROLLBAR_INITIAL_DELAY 40 # endif #endif #ifndef SCROLLBAR_CONTINUOUS_DELAY # define SCROLLBAR_CONTINUOUS_DELAY 2 #endif /* time factor to slow down a `jumpy' mouse */ #define MOUSE_THRESHOLD 50 #define CONSOLE "/dev/console" /* console device */ /* * key-strings: if only these keys were standardized */ #ifdef LINUX_KEYS # define KS_HOME "\033[1~" /* Home == Find */ # define KS_END "\033[4~" /* End == Select */ #else # define KS_HOME "\033[7~" /* Home */ # define KS_END "\033[8~" /* End */ #endif /* * ESC-Z processing: * * By stealing a sequence to which other xterms respond, and sending the * same number of characters, but having a distinguishable sequence, * we can avoid having a timeout (when not under an rxvt) for every login * shell to auto-set its DISPLAY. * * This particular sequence is even explicitly stated as obsolete since * about 1985, so only very old software is likely to be confused, a * confusion which can likely be remedied through termcap or TERM. Frankly, * I doubt anyone will even notice. We provide a #ifdef just in case they * don't care about auto-display setting. Just in case the ancient * software in question is broken enough to be case insensitive to the 'c' * character in the answerback string, we make the distinguishing * characteristic be capitalization of that character. The length of the * two strings should be the same so that identical read(2) calls may be * used. */ #define VT100_ANS "\033[?1;2c" /* vt100 answerback */ #ifndef ESCZ_ANSWER # define ESCZ_ANSWER VT100_ANS /* obsolete ANSI ESC[c */ #endif /*}}} */ /*{{{ local variables */ static char *ptydev = NULL, *ttydev = NULL; /* pty/tty name */ static int cmd_fd = -1; /* file descriptor connected to the command */ static pid_t cmd_pid = -1; /* process id if child */ static int Xfd = -1; /* file descriptor of X server connection */ static unsigned int num_fds = 0; /* number of file descriptors being used */ static struct stat ttyfd_stat; /* original status of the tty we will use */ #ifndef NO_SCROLLBAR_BUTTON_CONTINUAL_SCROLLING static int scroll_arrow_delay; #endif #ifdef META8_OPTION static unsigned char meta_char = 033; /* Alt-key prefix */ #endif static unsigned int ModXMask = Mod1Mask; /* DEC private modes */ #define PrivMode_132 (1LU<<0) #define PrivMode_132OK (1LU<<1) #define PrivMode_rVideo (1LU<<2) #define PrivMode_relOrigin (1LU<<3) #define PrivMode_Screen (1LU<<4) #define PrivMode_Autowrap (1LU<<5) #define PrivMode_aplCUR (1LU<<6) #define PrivMode_aplKP (1LU<<7) #define PrivMode_HaveBackSpace (1LU<<8) #define PrivMode_BackSpace (1LU<<9) #define PrivMode_ShiftKeys (1LU<<10) #define PrivMode_VisibleCursor (1LU<<11) #define PrivMode_MouseX10 (1LU<<12) #define PrivMode_MouseX11 (1LU<<13) #define PrivMode_scrollBar (1LU<<14) #define PrivMode_menuBar (1LU<<15) #define PrivMode_TtyOutputInh (1LU<<16) #define PrivMode_Keypress (1LU<<17) /* too annoying to implement X11 highlight tracking */ /* #define PrivMode_MouseX11Track (1LU<<18) */ #define PrivMode_mouse_report (PrivMode_MouseX10|PrivMode_MouseX11) #define PrivMode(test,bit) do { \ if (test) PrivateModes |= (bit); else PrivateModes &= ~(bit);} while (0) #define PrivMode_Default \ (PrivMode_Autowrap|PrivMode_aplKP|PrivMode_ShiftKeys|PrivMode_VisibleCursor) static unsigned long PrivateModes = PrivMode_Default; static unsigned long SavedModes = PrivMode_Default; #undef PrivMode_Default static int refresh_count = 0, refresh_limit = 1, refresh_type = SLOW_REFRESH; static Atom wmDeleteWindow; /* OffiX Dnd (drag 'n' drop) support */ #ifdef OFFIX_DND static Atom DndProtocol, DndSelection; #endif /* OFFIX_DND */ #ifdef USE_XIM static XIC Input_Context; /* input context */ #else #ifndef NO_XLOCALE static char *rs_inputMethod = ""; /* XtNinputMethod */ static char *rs_preeditType = NULL; /* XtNpreeditType */ static XIC Input_Context; /* input context */ #endif /* NO_XLOCALE */ #endif /* USE_XIM */ /* command input buffering */ #ifndef BUFSIZ # define BUFSIZ 4096 #endif static unsigned char cmdbuf_base[BUFSIZ], *cmdbuf_ptr, *cmdbuf_endp; /*}}} */ /*----------------------------------------------------------------------*/ /*}}} */ /*{{{ substitute system functions */ #ifndef _POSIX_VERSION # if defined (__svr4__) || defined (__lnx21__) /* PROTO */ int getdtablesize(void) { struct rlimit rlim; getrlimit(RLIMIT_NOFILE, &rlim); return rlim.rlim_cur; } # endif #endif /*}}} */ /*{{{ take care of suid/sgid super-user (root) privileges */ /* PROTO */ void privileges(int mode) { #ifdef HAVE_SETEUID static uid_t euid; static gid_t egid; switch (mode) { case IGNORE: /* * change effective uid/gid - not real uid/gid - so we can switch * back to root later, as required */ seteuid(getuid()); setegid(getgid()); break; case SAVE: euid = geteuid(); egid = getegid(); break; case RESTORE: seteuid(euid); setegid(egid); break; } #else # ifndef __CYGWIN32__ switch (mode) { case IGNORE: setuid(getuid()); setgid(getgid()); break; case SAVE: break; case RESTORE: break; } # endif #endif } /*}}} */ /*{{{ signal handling, exit handler */ /* * Catch a SIGCHLD signal and exit if the direct child has died */ /* ARGSUSED */ /* PROTO */ RETSIGTYPE Child_signal(int unused) { int pid, save_errno = errno; do { errno = 0; } while ((-1 == (pid = waitpid(-1, NULL, WNOHANG))) && (errno == EINTR)); if (pid == cmd_pid) exit(EXIT_SUCCESS); errno = save_errno; signal(SIGCHLD, Child_signal); } /* * Catch a fatal signal and tidy up before quitting */ /* PROTO */ RETSIGTYPE Exit_signal(int sig) { #ifdef DEBUG_CMD print_error("signal %d", sig); #endif signal(sig, SIG_DFL); #ifdef UTMP_SUPPORT privileges(RESTORE); cleanutent(); privileges(IGNORE); #endif kill(getpid(), sig); } /* * Exit gracefully, clearing the utmp entry and restoring tty attributes * TODO: this should free up any known resources if we can */ /* PROTO */ void clean_exit(void) { #ifdef DEBUG_CMD fprintf(stderr, "Restoring \"%s\" to mode %03o, uid %d, gid %d\n", ttydev, ttyfd_stat.st_mode, ttyfd_stat.st_uid, ttyfd_stat.st_gid); #endif scr_release(); privileges(RESTORE); #ifndef __CYGWIN32__ chmod(ttydev, ttyfd_stat.st_mode); chown(ttydev, ttyfd_stat.st_uid, ttyfd_stat.st_gid); #endif #ifdef UTMP_SUPPORT cleanutent(); #endif privileges(IGNORE); } /*}}} */ /*{{{ Acquire a pseudo-teletype from the system. */ /* * On failure, returns -1. * On success, returns the file descriptor. * * If successful, ttydev and ptydev point to the names of the * master and slave parts */ /* PROTO */ int get_pty(void) { int fd = -1; #if defined (__sgi) ptydev = ttydev = _getpty(&fd, O_RDWR | O_NDELAY, 0622, 0); if (ptydev == NULL) goto Failed; #elif defined (__svr4__) || defined(__CYGWIN32__) || defined(__lnx21__) { extern char *ptsname(); /* open the STREAMS, clone device /dev/ptmx (master pty) */ #ifdef HAVE_GETPT if ((fd = getpt()) < 0) { #else if ((fd = open("/dev/ptmx", O_RDWR)) < 0) { #endif goto Failed; } else { grantpt(fd); /* change slave permissions */ unlockpt(fd); /* unlock slave */ ptydev = ttydev = ptsname(fd); /* get slave's name */ goto Found; } } #elif defined (_AIX) if ((fd = open("/dev/ptc", O_RDWR)) < 0) goto Failed; else ptydev = ttydev = ttyname(fd); #elif defined(ALL_NUMERIC_PTYS) /* SCO OSr5 */ static char pty_name[] = "/dev/ptyp??\0\0\0"; static char tty_name[] = "/dev/ttyp??\0\0\0"; int len = strlen(tty_name); char *c1, *c2; int idx; ptydev = pty_name; ttydev = tty_name; for (idx = 0; idx < 256; idx++) { sprintf(ptydev, "%s%d", "/dev/ptyp", idx); sprintf(ttydev, "%s%d", "/dev/ttyp", idx); if (access(ttydev, F_OK) < 0) { idx = 256; break; } if ((fd = open(ptydev, O_RDWR)) >= 0) { if (access(ttydev, R_OK | W_OK) == 0) goto Found; close(fd); } } goto Failed; #else static char pty_name[] = "/dev/pty??"; static char tty_name[] = "/dev/tty??"; int len = strlen(tty_name); char *c1, *c2; ptydev = pty_name; ttydev = tty_name; # define PTYCHAR1 "pqrstuvwxyz" # define PTYCHAR2 "0123456789abcdefghijklmnopqrstuvwxyz" for (c1 = PTYCHAR1; *c1; c1++) { ptydev[len - 2] = ttydev[len - 2] = *c1; for (c2 = PTYCHAR2; *c2; c2++) { ptydev[len - 1] = ttydev[len - 1] = *c2; if ((fd = open(ptydev, O_RDWR)) >= 0) { if (access(ttydev, R_OK | W_OK) == 0) goto Found; close(fd); } } } goto Failed; #endif Found: fcntl(fd, F_SETFL, O_NDELAY); return fd; Failed: print_error("can't open pseudo-tty"); return -1; } /*}}} */ /*{{{ establish a controlling teletype for new session */ /* * On some systems this can be done with ioctl() but on others we * need to re-open the slave tty. */ /* PROTO */ int get_tty(void) { int fd; pid_t pid; /* * setsid() [or setpgrp] must be before open of the terminal, * otherwise there is no controlling terminal (Solaris 2.4, HP-UX 9) */ #ifndef ultrix # ifdef NO_SETSID pid = setpgrp(0, 0); # else pid = setsid(); # endif if (pid < 0) perror(rs_name); # ifdef DEBUG_TTYMODE print_error("(%s: line %d): PID = %d\n", __FILE__, __LINE__, pid); # endif #endif /* ultrix */ if ((fd = open(ttydev, O_RDWR)) < 0) { print_error("can't open slave tty %s", ttydev); exit(EXIT_FAILURE); } #if defined (__svr4__) || defined (__lnx21__) /* * Push STREAMS modules: * ptem: pseudo-terminal hardware emulation module. * ldterm: standard terminal line discipline. * ttcompat: V7, 4BSD and XENIX STREAMS compatibility module. */ ioctl(fd, I_PUSH, "ptem"); ioctl(fd, I_PUSH, "ldterm"); ioctl(fd, I_PUSH, "ttcompat"); #else /* __svr4__ */ { /* change ownership of tty to real uid and real group */ #ifndef __CYGWIN32__ unsigned int mode = 0622; gid_t gid = getgid(); # ifdef TTY_GID_SUPPORT { struct group *gr = getgrnam("tty"); if (gr) { /* change ownership of tty to real uid, "tty" gid */ gid = gr->gr_gid; mode = 0620; } } # endif /* TTY_GID_SUPPORT */ #endif privileges(RESTORE); #ifndef __CYGWIN32__ fchown(fd, getuid(), gid); /* fail silently */ fchmod(fd, mode); #endif privileges(IGNORE); } #endif /* __svr4__ */ /* * Close all file descriptors. If only stdin/out/err are closed, * child processes remain alive upon deletion of the window. */ { int i; for (i = 0; i < num_fds; i++) if (i != fd) close(i); } /* Reopen stdin, stdout and stderr over the tty file descriptor */ dup(fd); /* 0: stdin */ dup(fd); /* 1: stdout */ dup(fd); /* 2: stderr */ if (fd > 2) close(fd); #ifdef ultrix if ((fd = open("/dev/tty", O_RDONLY)) >= 0) { ioctl(fd, TIOCNOTTY, 0); close(fd); } else { pid = setpgrp(0, 0); if (pid < 0) perror(rs_name); } /* no error, we could run with no tty to begin with */ #else /* ultrix */ # ifdef TIOCSCTTY ioctl(0, TIOCSCTTY, 0); # endif /* set process group */ # if defined (_POSIX_VERSION) || defined (__svr4__) tcsetpgrp(0, pid); # elif defined (TIOCSPGRP) ioctl(0, TIOCSPGRP, &pid); # endif /* svr4 problems: reports no tty, no job control */ /* # if !defined (__svr4__) && defined (TIOCSPGRP) */ close(open(ttydev, O_RDWR, 0)); /* # endif */ #endif /* ultrix */ privileges(IGNORE); return fd; } /*}}} */ /*{{{ debug_ttymode() */ #ifdef DEBUG_TTYMODE /* PROTO */ void debug_ttymode(ttymode_t * ttymode) { # ifdef HAVE_TERMIOS_H /* c_iflag bits */ fprintf(stderr, "Input flags\n"); /* cpp token stringize doesn't work on all machines */ # define FOO(flag,name) \ if ((ttymode->c_iflag) & flag) \ fprintf (stderr, "%s ", name) /* c_iflag bits */ FOO(IGNBRK, "IGNBRK"); FOO(BRKINT, "BRKINT"); FOO(IGNPAR, "IGNPAR"); FOO(PARMRK, "PARMRK"); FOO(INPCK, "INPCK"); FOO(ISTRIP, "ISTRIP"); FOO(INLCR, "INLCR"); FOO(IGNCR, "IGNCR"); FOO(ICRNL, "ICRNL"); FOO(IXON, "IXON"); FOO(IXOFF, "IXOFF"); # ifdef IUCLC FOO(IUCLC, "IUCLC"); # endif # ifdef IXANY FOO(IXANY, "IXANY"); # endif # ifdef IMAXBEL FOO(IMAXBEL, "IMAXBEL"); # endif fprintf(stderr, "\n\n"); # undef FOO # define FOO(entry, name) \ fprintf (stderr, "%s = %#3o\n", name, ttymode->c_cc [entry]) FOO(VINTR, "VINTR"); FOO(VQUIT, "VQUIT"); FOO(VERASE, "VERASE"); FOO(VKILL, "VKILL"); FOO(VEOF, "VEOF"); FOO(VEOL, "VEOL"); # ifdef VEOL2 FOO(VEOL2, "VEOL2"); # endif # ifdef VSWTC FOO(VSWTC, "VSWTC"); # endif # ifdef VSWTCH FOO(VSWTCH, "VSWTCH"); # endif FOO(VSTART, "VSTART"); FOO(VSTOP, "VSTOP"); FOO(VSUSP, "VSUSP"); # ifdef VDSUSP FOO(VDSUSP, "VDSUSP"); # endif # ifdef VREPRINT FOO(VREPRINT, "VREPRINT"); # endif # ifdef VDISCRD FOO(VDISCRD, "VDISCRD"); # endif # ifdef VWERSE FOO(VWERSE, "VWERSE"); # endif # ifdef VLNEXT FOO(VLNEXT, "VLNEXT"); # endif fprintf(stderr, "\n\n"); # undef FOO # endif /* HAVE_TERMIOS_H */ } #endif /* DEBUG_TTYMODE */ /*}}} */ /*{{{ get_ttymode() */ /* PROTO */ void get_ttymode(ttymode_t * tio) { #ifdef HAVE_TERMIOS_H /* * standard System V termios interface */ if (GET_TERMIOS(0, tio) < 0) { /* return error - use system defaults */ tio->c_cc[VINTR] = CINTR; tio->c_cc[VQUIT] = CQUIT; tio->c_cc[VERASE] = CERASE; tio->c_cc[VKILL] = CKILL; tio->c_cc[VSTART] = CSTART; tio->c_cc[VSTOP] = CSTOP; tio->c_cc[VSUSP] = CSUSP; # ifdef VDSUSP tio->c_cc[VDSUSP] = CDSUSP; # endif # ifdef VREPRINT tio->c_cc[VREPRINT] = CRPRNT; # endif # ifdef VDISCRD tio->c_cc[VDISCRD] = CFLUSH; # endif # ifdef VWERSE tio->c_cc[VWERSE] = CWERASE; # endif # ifdef VLNEXT tio->c_cc[VLNEXT] = CLNEXT; # endif } tio->c_cc[VEOF] = CEOF; tio->c_cc[VEOL] = VDISABLE; # ifdef VEOL2 tio->c_cc[VEOL2] = VDISABLE; # endif # ifdef VSWTC tio->c_cc[VSWTC] = VDISABLE; # endif # ifdef VSWTCH tio->c_cc[VSWTCH] = VDISABLE; # endif # if VMIN != VEOF tio->c_cc[VMIN] = 1; # endif # if VTIME != VEOL tio->c_cc[VTIME] = 0; # endif /* input modes */ tio->c_iflag = (BRKINT | IGNPAR | ICRNL | IXON # ifdef IMAXBEL | IMAXBEL # endif ); /* output modes */ tio->c_oflag = (OPOST | ONLCR); /* control modes */ tio->c_cflag = (CS8 | CREAD); /* line discipline modes */ tio->c_lflag = (ISIG | ICANON | IEXTEN | ECHO | ECHOE | ECHOK # if defined (ECHOCTL) && defined (ECHOKE) | ECHOCTL | ECHOKE # endif ); #if 0 /* * guess an appropriate value for Backspace */ # ifdef FORCE_BACKSPACE PrivMode(1, PrivMode_BackSpace); # elif defined (FORCE_DELETE) PrivMode(0, PrivMode_BackSpace); # else PrivMode((tio->c_cc[VERASE] == '\b'), PrivMode_BackSpace); # endif #endif /* if 0 */ #else /* HAVE_TERMIOS_H */ /* * sgtty interface */ /* get parameters -- gtty */ if (ioctl(0, TIOCGETP, &(tio->sg)) < 0) { tio->sg.sg_erase = CERASE; /* ^H */ tio->sg.sg_kill = CKILL; /* ^U */ } tio->sg.sg_flags = (CRMOD | ECHO | EVENP | ODDP); /* get special characters */ if (ioctl(0, TIOCGETC, &(tio->tc)) < 0) { tio->tc.t_intrc = CINTR; /* ^C */ tio->tc.t_quitc = CQUIT; /* ^\ */ tio->tc.t_startc = CSTART; /* ^Q */ tio->tc.t_stopc = CSTOP; /* ^S */ tio->tc.t_eofc = CEOF; /* ^D */ tio->tc.t_brkc = -1; } /* get local special chars */ if (ioctl(0, TIOCGLTC, &(tio->lc)) < 0) { tio->lc.t_suspc = CSUSP; /* ^Z */ tio->lc.t_dsuspc = CDSUSP; /* ^Y */ tio->lc.t_rprntc = CRPRNT; /* ^R */ tio->lc.t_flushc = CFLUSH; /* ^O */ tio->lc.t_werasc = CWERASE; /* ^W */ tio->lc.t_lnextc = CLNEXT; /* ^V */ } /* get line discipline */ ioctl(0, TIOCGETD, &(tio->line)); # ifdef NTTYDISC tio->line = NTTYDISC; # endif /* NTTYDISC */ tio->local = (LCRTBS | LCRTERA | LCTLECH | LPASS8 | LCRTKIL); /* * guess an appropriate value for Backspace */ #if 0 # ifdef FORCE_BACKSPACE PrivMode(1, PrivMode_BackSpace); # elif defined (FORCE_DELETE) PrivMode(0, PrivMode_BackSpace); # else PrivMode((tio->sg.sg_erase == '\b'), PrivMode_BackSpace); # endif #endif /* if 0 */ #endif /* HAVE_TERMIOS_H */ } /*}}} */ /*{{{ run_command() */ /* * Run the command in a subprocess and return a file descriptor for the * master end of the pseudo-teletype pair with the command talking to * the slave. */ /* PROTO */ int run_command(char *argv[]) { ttymode_t tio; int ptyfd; ptyfd = get_pty(); if (ptyfd < 0) return -1; /* store original tty status for restoration clean_exit() -- rgg 04/12/95 */ lstat(ttydev, &ttyfd_stat); #ifdef DEBUG_CMD fprintf(stderr, "Original settings of %s are mode %o, uid %d, gid %d\n", ttydev, ttyfd_stat.st_mode, ttyfd_stat.st_uid, ttyfd_stat.st_gid); #endif /* install exit handler for cleanup */ #ifdef HAVE_ATEXIT atexit(clean_exit); #else # if defined (__sun__) on_exit(clean_exit, NULL); /* non-ANSI exit handler */ # else # ifdef UTMP_SUPPORT print_error("no atexit(), UTMP entries may not be cleaned"); # endif # endif #endif /* * get tty settings before fork() * and make a reasonable guess at the value for BackSpace */ get_ttymode(&tio); #if 0 /* add Backspace value */ SavedModes |= (PrivateModes & PrivMode_BackSpace); #endif /* add value for scrollBar */ if (scrollbar_visible()) { PrivateModes |= PrivMode_scrollBar; SavedModes |= PrivMode_scrollBar; } if (menubar_visible()) { PrivateModes |= PrivMode_menuBar; SavedModes |= PrivMode_menuBar; } #ifdef DEBUG_TTYMODE debug_ttymode(&tio); #endif /* spin off the command interpreter */ signal(SIGHUP, Exit_signal); #ifndef __svr4__ signal(SIGINT, Exit_signal); #endif signal(SIGQUIT, Exit_signal); signal(SIGTERM, Exit_signal); signal(SIGCHLD, Child_signal); /* apparently on FBSD that should be done at line 1085 below : */ tt_winsize(ptyfd); /* set window size */ /* need to trap SIGURG for SVR4 (Unixware) rlogin */ /* signal (SIGURG, SIG_DFL); */ cmd_pid = fork(); if (cmd_pid < 0) { print_error("can't fork"); return -1; } if (cmd_pid == 0) { /* child */ /* signal (SIGHUP, Exit_signal); */ /* signal (SIGINT, Exit_signal); */ #ifdef HAVE_UNSETENV /* avoid passing old settings and confusing term size */ unsetenv("LINES"); unsetenv("COLUMNS"); /* avoid passing termcap since terminfo should be okay */ unsetenv("TERMCAP"); #endif /* HAVE_UNSETENV */ /* establish a controlling teletype for the new session */ get_tty(); /* initialize terminal attributes */ SET_TTYMODE(0, &tio); /* become virtual console, fail silently */ if (Options & Opt_console) { #ifdef TIOCCONS unsigned int on = 1; ioctl(0, TIOCCONS, &on); #elif defined (SRIOCSREDIR) int fd = open(CONSOLE, O_WRONLY); if (fd < 0 || ioctl(fd, SRIOCSREDIR, 0) < 0) { if (fd >= 0) close(fd); } #endif /* SRIOCSREDIR */ } tt_winsize(0); /* set window size */ /* reset signals and spin off the command interpreter */ signal(SIGINT, SIG_DFL); signal(SIGQUIT, SIG_DFL); signal(SIGCHLD, SIG_DFL); /* * mimick login's behavior by disabling the job control signals * a shell that wants them can turn them back on */ #ifdef SIGTSTP signal(SIGTSTP, SIG_IGN); signal(SIGTTIN, SIG_IGN); signal(SIGTTOU, SIG_IGN); #endif /* SIGTSTP */ #ifdef __CYGWIN__ /* cygwin does not close files properly */ if( Xfd > 0 ) close(Xfd); #endif /* command interpreter path */ if (argv != NULL) { #ifdef DEBUG_CMD int i; for (i = 0; argv[i]; i++) fprintf(stderr, "argv [%d] = \"%s\"\n", i, argv[i]); #endif execvp(argv[0], argv); print_error("can't execute \"%s\"", argv[0]); } else { const char *argv0, *shell; if ((shell = getenv("SHELL")) == NULL || *shell == '\0') shell = DEFAULT_SHELL; argv0 = my_basename(shell); if (Options & Opt_loginShell) { char *p = MALLOC((strlen(argv0) + 2) * sizeof(char)); p[0] = '-'; STRCPY(&p[1], argv0); argv0 = p; } execlp(shell, argv0, NULL); print_error("can't execute \"%s\"", shell); } exit(EXIT_FAILURE); } #ifdef UTMP_SUPPORT privileges(RESTORE); if (!(Options & Opt_utmpInhibit)) makeutent(ttydev, display_name); /* stamp /etc/utmp */ privileges(IGNORE); #endif return ptyfd; } /*}}} */ /* * Probe the modifier keymap to get the Meta (Alt) and Num_Lock settings */ /* INTPROTO */ void get_ourmods(void) { int i, j, k; int got_meta, got_numlock; XModifierKeymap *map; KeyCode *kc; unsigned int modmasks[] = {Mod1Mask, Mod2Mask, Mod3Mask, Mod4Mask, Mod5Mask}; got_meta = got_numlock = 0; map = XGetModifierMapping(Xdisplay); kc = map->modifiermap; for (i = 3; i < 8; i++) { k = i * map->max_keypermod; for (j = 0; j < map->max_keypermod; j++, k++) { if (kc[k] == 0) break; switch (XKeycodeToKeysym(Xdisplay, kc[k], 0)) { case XK_Num_Lock: if (!got_numlock) { ModNumLockMask = modmasks[i - 3]; got_numlock = 1; } break; case XK_Meta_L: case XK_Meta_R: case XK_Alt_L: case XK_Alt_R: if (!got_meta) { ModMetaMask = modmasks[i - 3]; got_meta = 1; } break; } } if (got_meta && got_numlock) break; } XFreeModifiermap(map); } /*{{{ init_command() */ /* PROTO */ void init_command(char *argv[]) { /* * Initialize the command connection. * This should be called after the X server connection is established. */ /* Enable delete window protocol */ wmDeleteWindow = XInternAtom(Xdisplay, "WM_DELETE_WINDOW", False); XSetWMProtocols(Xdisplay, TermWin.parent, &wmDeleteWindow, 1); #ifdef OFFIX_DND /* Enable OffiX Dnd (drag 'n' drop) protocol */ DndProtocol = XInternAtom(Xdisplay, "DndProtocol", False); DndSelection = XInternAtom(Xdisplay, "DndSelection", False); #endif /* OFFIX_DND */ #ifndef NO_XLOCALE init_xlocale(); #else setlocale(LC_CTYPE, ""); #endif #ifdef USE_XIM setTermFontSet(); XRegisterIMInstantiateCallback(Xdisplay, NULL, NULL, NULL, IMInstantiateCallback, NULL); #endif /* get number of available file descriptors */ #ifdef _POSIX_VERSION num_fds = sysconf(_SC_OPEN_MAX); #else num_fds = getdtablesize(); #endif #ifdef META8_OPTION meta_char = (Options & Opt_meta8 ? 0x80 : 033); if (rs_modifier && strlen(rs_modifier) == 4 && toupper(*rs_modifier) == 'M' && toupper(rs_modifier[1]) == 'O' && toupper(rs_modifier[2]) == 'D') switch (rs_modifier[3]) { case '2': ModXMask = Mod2Mask; break; case '3': ModXMask = Mod3Mask; break; case '4': ModXMask = Mod4Mask; break; case '5': ModXMask = Mod5Mask; break; default: ModXMask = Mod1Mask; } #endif get_ourmods(); if (!(Options & Opt_scrollTtyOutput)) PrivateModes |= PrivMode_TtyOutputInh; if (Options & Opt_scrollKeypress) PrivateModes |= PrivMode_Keypress; #ifndef NO_BACKSPACE_KEY if (strcmp(rs_backspace_key, "DEC") == 0) PrivateModes |= PrivMode_HaveBackSpace; #endif #ifdef GREEK_SUPPORT greek_init(); #endif Xfd = XConnectionNumber(Xdisplay); /*fprintf( stderr, "%s:%d display = %p, Xfd = %d\n\n", __FUNCTION__, __LINE__, Xdisplay, Xfd ); */ /* sleep(10); */ cmdbuf_ptr = cmdbuf_endp = cmdbuf_base; if ((cmd_fd = run_command(argv)) < 0) { print_error("aborting"); exit(EXIT_FAILURE); } } /*}}} */ /*{{{ Xlocale */ /* * This is more or less stolen straight from XFree86 xterm. * This should support all European type languages. */ /* PROTO */ void init_xlocale(void) { #ifndef NO_XLOCALE #ifndef USE_XIM char *p, *s, buf[32], tmp[1024]; XIM xim = NULL; XIMStyle input_style = 0; XIMStyles *xim_styles = NULL; int found; Input_Context = NULL; # if !defined(NO_SETLOCALE) || !defined(NO_XSETLOCALE) /* setlocale(LC_CTYPE, ""); */ /* XXX: should we do this? */ # endif if (rs_inputMethod == NULL || !*rs_inputMethod) { if ((p = XSetLocaleModifiers("")) != NULL) xim = XOpenIM(Xdisplay, NULL, NULL, NULL); } else { STRCPY(tmp, rs_inputMethod); for (s = tmp; *s; s++) { char *end, *next_s; for (; *s && isspace(*s); s++) /* */ ; if (!*s) break; for (end = s; (*end && (*end != ',')); end++) /* */ ; for (next_s = end--; ((end >= s) && isspace(*end)); end--) /* */ ; *++end = '\0'; if (*s) { STRCPY(buf, "@im="); strcat(buf, s); if ((p = XSetLocaleModifiers(buf)) != NULL && (xim = XOpenIM(Xdisplay, NULL, NULL, NULL)) != NULL) break; } if (!*(s = next_s)) break; } } if (xim == NULL && (p = XSetLocaleModifiers("@im=none")) != NULL) xim = XOpenIM(Xdisplay, NULL, NULL, NULL); if (xim == NULL) { print_error("Failed to open input method"); return; } if (XGetIMValues(xim, XNQueryInputStyle, &xim_styles, NULL) || !xim_styles) { print_error("input method doesn't support any style"); XCloseIM(xim); return; } STRCPY(tmp, (rs_preeditType ? rs_preeditType : "Root")); for (found = 0, s = tmp; *s && !found; ) { unsigned short i; char *end, *next_s; for (; *s && isspace(*s); s++) /* */ ; if (!*s) break; for (end = s; (*end && (*end != ',')); end++) /* */ ; for (next_s = end--; ((end >= s) && isspace(*end));) *end-- = 0; if (!strcmp(s, "OverTheSpot")) input_style = (XIMPreeditPosition | XIMStatusArea); else if (!strcmp(s, "OffTheSpot")) input_style = (XIMPreeditArea | XIMStatusArea); else if (!strcmp(s, "Root")) input_style = (XIMPreeditNothing | XIMStatusNothing); for (i = 0; i < xim_styles->count_styles; i++) if (input_style == xim_styles->supported_styles[i]) { found = 1; break; } s = next_s; } XFree(xim_styles); if (found == 0) { print_error("input method doesn't support my preedit type"); XCloseIM(xim); return; } /* * This program only understands the Root preedit_style yet * Then misc.preedit_type should default to: * "OverTheSpot,OffTheSpot,Root" * /MaF */ if (input_style != (XIMPreeditNothing | XIMStatusNothing)) { print_error("This program only supports the \"Root\" preedit type"); XCloseIM(xim); return; } Input_Context = XCreateIC(xim, XNInputStyle, input_style, XNClientWindow, TermWin.parent, XNFocusWindow, TermWin.parent, NULL); if (Input_Context == NULL) { print_error("Failed to create input context"); XCloseIM(xim); } #endif /* USE_XIM */ #endif /* NO_XLOCALE */ } /*}}} */ /*{{{ window resizing */ /* * Tell the teletype handler what size the window is. * Called after a window size change. */ /* PROTO */ void tt_winsize(int fd) { struct winsize ws; if (fd < 0) return; ws.ws_col = (unsigned short)TermWin.ncol; ws.ws_row = (unsigned short)TermWin.nrow; #ifndef __CYGWIN32__ ws.ws_xpixel = ws.ws_ypixel = 0; #endif ioctl(fd, TIOCSWINSZ, &ws); } /* PROTO */ void tt_resize(void) { tt_winsize(cmd_fd); } /*}}} */ /*{{{ Convert the keypress event into a string */ /* PROTO */ void lookup_key(XEvent * ev) { static int numlock_state = 0; #ifdef DEBUG_CMD static int debug_key = 1; /* accessible by a debugger only */ #endif #ifdef GREEK_SUPPORT static short greek_mode = 0; #endif static XComposeStatus compose = {NULL, 0}; static unsigned char kbuf[KBUFSZ]; int ctrl, meta, shft, len; KeySym keysym = 0; /* * use Num_Lock to toggle Keypad on/off. If Num_Lock is off, allow an * escape sequence to toggle the Keypad. * * Always permit `shift' to override the current setting */ shft = (ev->xkey.state & ShiftMask); ctrl = (ev->xkey.state & ControlMask); meta = (ev->xkey.state & ModXMask); if (numlock_state || (ev->xkey.state & ModNumLockMask)) { numlock_state = (ev->xkey.state & ModNumLockMask); /* numlock toggle */ PrivMode((!numlock_state), PrivMode_aplKP); } #ifdef USE_XIM len = 0; if (Input_Context != NULL) { Status status_return; kbuf[0] = '\0'; len = XmbLookupString(Input_Context, &ev->xkey, kbuf, sizeof(kbuf), &keysym, &status_return); } else { len = XLookupString(&ev->xkey, kbuf, sizeof(kbuf), &keysym, &compose); } #else /* USE_XIM */ len = XLookupString(&ev->xkey, (char *) kbuf, sizeof(kbuf), &keysym, &compose); /* * have unmapped Latin[2-4] entries -> Latin1 * good for installations with correct fonts, but without XLOCAL */ if (!len && (keysym >= 0x0100) && (keysym < 0x0400)) { len = 1; kbuf[0] = (keysym & 0xFF); } #endif /* USE_XIM */ if (len && (Options & Opt_scrollKeypress)) TermWin.view_start = 0; /* for some backwards compatibility */ #if defined (HOTKEY_CTRL) || defined (HOTKEY_META) # ifdef HOTKEY_CTRL # define HOTKEY ctrl # else # ifdef HOTKEY_META # define HOTKEY meta # endif # endif if (HOTKEY) { if (keysym == ks_bigfont) { change_font(0, FONT_UP); return; } else if (keysym == ks_smallfont) { change_font(0, FONT_DN); return; } } # undef HOTKEY #endif if (shft) { /* Shift + F1 - F10 generates F11 - F20 */ if (keysym >= XK_F1 && keysym <= XK_F10) { keysym += (XK_F11 - XK_F1); shft = 0; /* turn off Shift */ } else if (!ctrl && !meta && (PrivateModes & PrivMode_ShiftKeys)) { int lnsppg = TermWin.nrow * 4 / 5; #ifdef PAGING_CONTEXT_LINES lnsppg = TermWin.nrow - PAGING_CONTEXT_LINES; #endif switch (keysym) { /* normal XTerm key bindings */ case XK_Prior: /* Shift+Prior = scroll back */ if (TermWin.saveLines) { scr_page(UP, lnsppg); return; } break; case XK_Up: /* Shift+XK_Up = scroll up one line */ if (TermWin.saveLines) { scr_page(UP, 1); return; } break; case XK_Down: /* Shift+XK_Down = scroll down one line */ if (TermWin.saveLines) { scr_page(DN, 1); return; } break; case XK_Next: /* Shift+Next = scroll forward */ if (TermWin.saveLines) { scr_page(DN, lnsppg); return; } break; case XK_Insert: /* Shift+Insert = paste mouse selection */ selection_request(ev->xkey.time, ev->xkey.x, ev->xkey.y); return; break; /* rxvt extras */ case XK_KP_Add: /* Shift+KP_Add = bigger font */ change_font(0, FONT_UP); return; break; case XK_KP_Subtract: /* Shift+KP_Subtract = smaller font */ change_font(0, FONT_DN); return; break; } } } #ifdef UNSHIFTED_SCROLLKEYS else if (!ctrl && !meta) { switch (keysym) { case XK_Prior: if (TermWin.saveLines) { scr_page(UP, TermWin.nrow * 4 / 5); return; } break; case XK_Next: if (TermWin.saveLines) { scr_page(DN, TermWin.nrow * 4 / 5); return; } break; } } #endif switch (keysym) { case XK_Print: #ifdef PRINTPIPE scr_printscreen(ctrl | shft); return; #endif break; case XK_Mode_switch: #ifdef GREEK_SUPPORT greek_mode = !greek_mode; if (greek_mode) { xterm_seq(XTerm_title, (greek_getmode() == GREEK_ELOT928 ? "[Greek: iso]" : "[Greek: ibm]")); greek_reset(); } else xterm_seq(XTerm_title, APL_NAME "-" VERSION); return; #endif break; } if (keysym >= 0xFF00 && keysym <= 0xFFFF) { #ifdef KEYSYM_RESOURCE if (!(shft | ctrl) && KeySym_map[keysym - 0xFF00] != NULL) { const unsigned char *kbuf; unsigned int len; kbuf = (KeySym_map[keysym - 0xFF00]); len = *kbuf++; /* escape prefix */ if (meta # ifdef META8_OPTION && (meta_char == 033) # endif ) { const unsigned char ch = '\033'; tt_write(&ch, 1); } tt_write(kbuf, len); return; } else #endif switch (keysym) { #ifndef NO_BACKSPACE_KEY case XK_BackSpace: if (PrivateModes & PrivMode_HaveBackSpace) { len = 1; kbuf[0] = (((PrivateModes & PrivMode_BackSpace) ? !(shft | ctrl) : (shft | ctrl)) ? '\b' : '\177'); } else len = strlen(STRCPY(kbuf, rs_backspace_key)); break; #endif #ifndef NO_DELETE_KEY case XK_Delete: len = strlen(STRCPY(kbuf, rs_delete_key)); break; #endif case XK_Tab: if (shft) { len = 3; STRCPY(kbuf, "\033[Z"); } break; #ifdef XK_KP_Home case XK_KP_Home: /* allow shift to override */ if ((PrivateModes & PrivMode_aplKP) ? !shft : shft) { len = 3; STRCPY(kbuf, "\033Ow"); break; } /* -> else FALL THROUGH */ #endif case XK_Home: len = strlen(STRCPY(kbuf, KS_HOME)); break; #ifdef XK_KP_Left case XK_KP_Left: /* \033Ot or standard */ case XK_KP_Up: /* \033Ox or standard */ case XK_KP_Right: /* \033Ov or standard */ case XK_KP_Down: /* \033Or or standard */ if ((PrivateModes & PrivMode_aplKP) ? !shft : shft) { len = 3; STRCPY(kbuf, "\033OZ"); kbuf[2] = ("txvr"[keysym - XK_KP_Left]); break; } else { /* translate to std. cursor key */ keysym = XK_Left + (keysym - XK_KP_Left); } /* FALL THROUGH */ #endif case XK_Left: /* "\033[D" */ case XK_Up: /* "\033[A" */ case XK_Right: /* "\033[C" */ case XK_Down: /* "\033[B" */ len = 3; STRCPY(kbuf, "\033[@"); kbuf[2] = ("DACB"[keysym - XK_Left]); /* do Shift first */ if (shft) { kbuf[2] = ("dacb"[keysym - XK_Left]); } else if (ctrl) { kbuf[1] = 'O'; kbuf[2] = ("dacb"[keysym - XK_Left]); } else if (PrivateModes & PrivMode_aplCUR) { kbuf[1] = 'O'; } break; #ifndef UNSHIFTED_SCROLLKEYS # ifdef XK_KP_Prior case XK_KP_Prior: /* allow shift to override */ if ((PrivateModes & PrivMode_aplKP) ? !shft : shft) { len = 3; STRCPY(kbuf, "\033Oy"); break; } /* -> else FALL THROUGH */ # endif case XK_Prior: len = 4; STRCPY(kbuf, "\033[5~"); break; # ifdef XK_KP_Next case XK_KP_Next: /* allow shift to override */ if ((PrivateModes & PrivMode_aplKP) ? !shft : shft) { len = 3; STRCPY(kbuf, "\033Os"); break; } /* -> else FALL THROUGH */ # endif case XK_Next: len = 4; STRCPY(kbuf, "\033[6~"); break; #endif #ifdef XK_KP_End case XK_KP_End: /* allow shift to override */ if ((PrivateModes & PrivMode_aplKP) ? !shft : shft) { len = 3; STRCPY(kbuf, "\033Oq"); break; } /* -> else FALL THROUGH */ #endif case XK_End: len = strlen(STRCPY(kbuf, KS_END)); break; case XK_Select: len = 4; STRCPY(kbuf, "\033[4~"); break; #ifdef DXK_Remove /* support for DEC remove like key */ case DXK_Remove: /* drop */ #endif case XK_Execute: len = 4; STRCPY(kbuf, "\033[3~"); break; case XK_Insert: len = 4; STRCPY(kbuf, "\033[2~"); break; case XK_Menu: len = 5; STRCPY(kbuf, "\033[29~"); break; case XK_Find: len = 4; STRCPY(kbuf, "\033[1~"); break; case XK_Help: len = 5; STRCPY(kbuf, "\033[28~"); break; case XK_KP_Enter: /* allow shift to override */ if ((PrivateModes & PrivMode_aplKP) ? !shft : shft) { len = 3; STRCPY(kbuf, "\033OM"); } else { len = 1; kbuf[0] = '\r'; } break; #ifdef XK_KP_Begin case XK_KP_Begin: len = 3; STRCPY(kbuf, "\033Ou"); break; case XK_KP_Insert: len = 3; STRCPY(kbuf, "\033Op"); break; case XK_KP_Delete: len = 3; STRCPY(kbuf, "\033On"); break; #endif case XK_KP_F1: /* "\033OP" */ case XK_KP_F2: /* "\033OQ" */ case XK_KP_F3: /* "\033OR" */ case XK_KP_F4: /* "\033OS" */ len = 3; STRCPY(kbuf, "\033OP"); kbuf[2] += (keysym - XK_KP_F1); break; case XK_KP_Multiply: /* "\033Oj" : "*" */ case XK_KP_Add: /* "\033Ok" : "+" */ case XK_KP_Separator: /* "\033Ol" : "," */ case XK_KP_Subtract: /* "\033Om" : "-" */ case XK_KP_Decimal: /* "\033On" : "." */ case XK_KP_Divide: /* "\033Oo" : "/" */ case XK_KP_0: /* "\033Op" : "0" */ case XK_KP_1: /* "\033Oq" : "1" */ case XK_KP_2: /* "\033Or" : "2" */ case XK_KP_3: /* "\033Os" : "3" */ case XK_KP_4: /* "\033Ot" : "4" */ case XK_KP_5: /* "\033Ou" : "5" */ case XK_KP_6: /* "\033Ov" : "6" */ case XK_KP_7: /* "\033Ow" : "7" */ case XK_KP_8: /* "\033Ox" : "8" */ case XK_KP_9: /* "\033Oy" : "9" */ /* allow shift to override */ if ((PrivateModes & PrivMode_aplKP) ? !shft : shft) { len = 3; STRCPY(kbuf, "\033Oj"); kbuf[2] += (keysym - XK_KP_Multiply); } else { len = 1; kbuf[0] = ('*' + (keysym - XK_KP_Multiply)); } break; case XK_F1: /* "\033OP" */ case XK_F2: /* "\033OQ" */ case XK_F3: /* "\033OR" */ case XK_F4: /* "\033OS" */ len = 3; STRCPY(kbuf, "\033OP"); kbuf[2] += (keysym - XK_F1); break; #define FKEY(n, fkey) \ len = 5; \ sprintf((char *) kbuf,"\033[%02d~", (int)((n) + (keysym - fkey))) #if 0 /* old style keymappings : */ case XK_F1: /* "\033[11~" */ case XK_F2: /* "\033[12~" */ case XK_F3: /* "\033[13~" */ case XK_F4: /* "\033[14~" */ FKEY(11, XK_F1); break; #endif case XK_F5: /* "\033[15~" */ FKEY(15, XK_F5); break; case XK_F6: /* "\033[17~" */ case XK_F7: /* "\033[18~" */ case XK_F8: /* "\033[19~" */ case XK_F9: /* "\033[20~" */ case XK_F10: /* "\033[21~" */ FKEY(17, XK_F6); break; case XK_F11: /* "\033[23~" */ case XK_F12: /* "\033[24~" */ case XK_F13: /* "\033[25~" */ case XK_F14: /* "\033[26~" */ FKEY(23, XK_F11); break; case XK_F15: /* "\033[28~" */ case XK_F16: /* "\033[29~" */ FKEY(28, XK_F15); break; case XK_F17: /* "\033[31~" */ case XK_F18: /* "\033[32~" */ case XK_F19: /* "\033[33~" */ case XK_F20: /* "\033[34~" */ case XK_F21: /* "\033[35~" */ case XK_F22: /* "\033[36~" */ case XK_F23: /* "\033[37~" */ case XK_F24: /* "\033[38~" */ case XK_F25: /* "\033[39~" */ case XK_F26: /* "\033[40~" */ case XK_F27: /* "\033[41~" */ case XK_F28: /* "\033[42~" */ case XK_F29: /* "\033[43~" */ case XK_F30: /* "\033[44~" */ case XK_F31: /* "\033[45~" */ case XK_F32: /* "\033[46~" */ case XK_F33: /* "\033[47~" */ case XK_F34: /* "\033[48~" */ case XK_F35: /* "\033[49~" */ FKEY(31, XK_F17); break; #undef FKEY } /* * Pass meta for all function keys, if 'meta' option set */ #ifdef META8_OPTION if (meta && (meta_char == 0x80) && len > 0) { kbuf[len - 1] |= 0x80; } #endif } else if (ctrl && keysym == XK_minus) { len = 1; kbuf[0] = '\037'; /* Ctrl-Minus generates ^_ (31) */ } else { #ifdef META8_OPTION /* set 8-bit on */ if (meta && (meta_char == 0x80)) { unsigned char *ch; for (ch = kbuf; ch < kbuf + len; ch++) *ch |= 0x80; meta = 0; } #endif #ifdef GREEK_SUPPORT if (greek_mode) len = greek_xlat(kbuf, len); #endif /* nil */ ; } if (len <= 0) return; /* not mapped */ /* * these modifications only affect the static keybuffer * pass Shift/Control indicators for function keys ending with `~' * * eg, * Prior = "ESC[5~" * Shift+Prior = "ESC[5~" * Ctrl+Prior = "ESC[5^" * Ctrl+Shift+Prior = "ESC[5@" * Meta adds an Escape prefix (with META8_OPTION, if meta == ). */ if (kbuf[0] == '\033' && kbuf[1] == '[' && kbuf[len - 1] == '~') kbuf[len - 1] = (shft ? (ctrl ? '@' : '$') : (ctrl ? '^' : '~')); /* escape prefix */ if (meta #ifdef META8_OPTION && (meta_char == 033) #endif ) { const unsigned char ch = '\033'; tt_write(&ch, 1); } #ifdef DEBUG_CMD if (debug_key) { /* Display keyboard buffer contents */ char *p; int i; fprintf(stderr, "key 0x%04X [%d]: `", (unsigned int)keysym, len); for (i = 0, p = kbuf; i < len; i++, p++) fprintf(stderr, (*p >= ' ' && *p < '\177' ? "%c" : "\\%03o"), *p); fprintf(stderr, "'\n"); } #endif /* DEBUG_CMD */ tt_write(kbuf, len); } /*}}} */ #if (MENUBAR_MAX) /*{{{ cmd_write(), cmd_getc() */ /* attempt to `write' COUNT to the input buffer */ /* PROTO */ unsigned int cmd_write(const unsigned char *str, unsigned int count) { int n; n = (count - (cmdbuf_ptr - cmdbuf_base)); /* need to insert more chars that space available in the front */ if (n > 0) { /* try and get more space from the end */ unsigned char *src, *dst; dst = (cmdbuf_base + sizeof(cmdbuf_base) - 1); /* max pointer */ if ((cmdbuf_ptr + n) > dst) n = (dst - cmdbuf_ptr); /* max # chars to insert */ if ((cmdbuf_endp + n) > dst) cmdbuf_endp = (dst - n); /* truncate end if needed */ /* equiv: memmove ((cmdbuf_ptr+n), cmdbuf_ptr, n); */ src = cmdbuf_endp; dst = src + n; /* FIXME: anything special to avoid possible pointer wrap? */ while (src >= cmdbuf_ptr) *dst-- = *src--; /* done */ cmdbuf_ptr += n; cmdbuf_endp += n; } while (count-- && cmdbuf_ptr > cmdbuf_base) { /* sneak one in */ cmdbuf_ptr--; *cmdbuf_ptr = str[count]; } return 0; } #endif /* MENUBAR_MAX */ /* cmd_getc() - Return next input character */ /* * Return the next input character after first passing any keyboard input * to the command. */ /* PROTO */ unsigned char cmd_getc(void) { #define TIMEOUT_USEC 5000 static short refreshed = 0; fd_set readfds; int retval; struct timeval value; #if 0 #ifdef __CYGWIN32__ struct timeval value; #else struct itimerval value; #endif #endif /* If there have been a lot of new lines, then update the screen * What the heck I'll cheat and only refresh less than every page-full. * the number of pages between refreshes is refresh_limit, which * is incremented here because we must be doing flat-out scrolling. * * refreshing should be correct for small scrolls, because of the * time-out */ if (refresh_count >= (refresh_limit * (TermWin.nrow - 1))) { if (refresh_limit < REFRESH_PERIOD) refresh_limit++; refresh_count = 0; refreshed = 1; scr_refresh(refresh_type); } /* characters already read in */ if (cmdbuf_ptr < cmdbuf_endp) goto Return_Char; for (;;) { struct timeval *timeout = &value; if (v_bufstr < v_bufptr) /* output any pending chars */ tt_write(NULL, 0); while (XPending(Xdisplay)) { /* process pending X events */ refreshed = 0; #ifdef USE_XIM XProcessEvent(Xdisplay); #else { XEvent ev; XNextEvent(Xdisplay, &ev); /*fprintf( stderr, "%s:%d Received event %d\n", __FUNCTION__, __LINE__, ev.type );*/ process_x_event(&ev); } #endif /* in case button actions pushed chars to cmdbuf */ if (cmdbuf_ptr < cmdbuf_endp) goto Return_Char; } #ifndef NO_SCROLLBAR_BUTTON_CONTINUAL_SCROLLING if (scrollbar_isUp()) { if (!scroll_arrow_delay-- && scr_page(UP, 1)) { scroll_arrow_delay = SCROLLBAR_CONTINUOUS_DELAY; refreshed = 0; refresh_type |= SMOOTH_REFRESH; } } else if (scrollbar_isDn()) { if (!scroll_arrow_delay-- && scr_page(DN, 1)) { scroll_arrow_delay = SCROLLBAR_CONTINUOUS_DELAY; refreshed = 0; refresh_type |= SMOOTH_REFRESH; } } #endif /* NO_SCROLLBAR_BUTTON_CONTINUAL_SCROLLING */ /* Nothing to do! */ FD_ZERO(&readfds); FD_SET(cmd_fd, &readfds); FD_SET(Xfd, &readfds); if( refreshed && last_update_background_request_sec == 0 #ifndef NO_SCROLLBAR_BUTTON_CONTINUAL_SCROLLING && !(scrollbar_isUpDn()) #endif ) timeout = NULL ; else if( !refreshed ) { timeout->tv_usec = TIMEOUT_USEC; timeout->tv_sec = 0; }else if( last_update_background_request_sec ) { time_t curr_t_sec, curr_t_usec, wait_usec = 0 ; timer_get_time (&curr_t_sec, &curr_t_usec); if( curr_t_sec == last_update_background_request_sec ) { if( curr_t_usec < last_update_background_request_usec ) wait_usec = last_update_background_request_usec - curr_t_usec ; }else if( curr_t_sec < last_update_background_request_sec ) { wait_usec = (last_update_background_request_sec - curr_t_sec)*1000000 ; wait_usec += last_update_background_request_usec ; wait_usec -= curr_t_usec ; } if( wait_usec == 0 ) wait_usec = TIMEOUT_USEC ; timeout->tv_usec = wait_usec; timeout->tv_sec = 0 ; /*UPDATE_BACKGROUND_TIMEOUT_SEC;*/ } /*fprintf( stderr, "%s:%d select(%d, cmd_fd = %d, Xfd = %d, %p)...", __FUNCTION__, __LINE__, num_fds, cmd_fd,Xfd ,timeout ); */ retval = select(max(cmd_fd,Xfd)+1, &readfds, NULL, NULL, timeout ); /* fprintf( stderr, "Done(retval = %d).\n", retval); */ /* See if we can read from the application */ if (FD_ISSET(cmd_fd, &readfds)) { int n; unsigned int count; cmdbuf_ptr = cmdbuf_endp = cmdbuf_base; for (count = BUFSIZ; count; count -= n, cmdbuf_endp += n) if ((n = read(cmd_fd, cmdbuf_endp, count)) > 0) continue; else if (n == 0 || (n < 0 && errno == EAGAIN)) break; else { #if !defined(HAVE_ATEXIT) && !defined(__sun__) clean_exit(); #endif exit(EXIT_SUCCESS); } /* some characters read in */ if (count != BUFSIZ) goto Return_Char; } /* select statement timed out - better update the screen */ if (retval == 0) { refresh_count = 0; refresh_limit = 1; if( last_update_background_request_sec > 0 ) { time_t curr_t_sec, curr_t_usec; timer_get_time (&curr_t_sec, &curr_t_usec); if( ( last_update_background_request_sec == curr_t_sec && last_update_background_request_usec < curr_t_usec) || last_update_background_request_sec < curr_t_sec || last_update_background_request_sec-1 > curr_t_sec ) { /* TODO update background pixmap */ RenderPixmap(1); refresh_transparent_scrollbar(); scr_clear(); scr_touch(); refreshed = True ; } } if (!refreshed) { refreshed = 1; scr_refresh(refresh_type); scrollbar_show(1); #ifdef USE_XIM IMSendSpot(); #endif } } } /* NOTREACHED */ return 0; Return_Char: refreshed = 0; return (*cmdbuf_ptr++); } /*}}} */ /* * the 'essential' information for reporting Mouse Events * pared down from XButtonEvent */ static struct { int clicks; Time time; /* milliseconds */ unsigned int state; /* key or button mask */ unsigned int button; /* detail */ } MEvent = { 0, CurrentTime, 0, AnyButton }; /* PROTO */ void mouse_report(XButtonEvent * ev) { int button_number, key_state = 0; int x, y; x = ev->x; y = ev->y; pixel_position(&x, &y); button_number = ((MEvent.button == AnyButton) ? 3 : (MEvent.button - Button1)); if (PrivateModes & PrivMode_MouseX10) { /* * do not report ButtonRelease * no state info allowed */ key_state = 0; if (button_number == 3) return; } else { /* let's be explicit here ... from * #define ShiftMask (1<<0) * #define ControlMask (1<<2) * #define Mod1Mask (1<<3) * * and XTerm mouse reporting needs these values: * 4 = Shift * 8 = Meta * 16 = Control * plus will add in our own Double-Click reporting * 32 = Double Click */ key_state = (((MEvent.state & (ShiftMask | ControlMask)) + ((MEvent.state & Mod1Mask) ? 2 : 0) #ifdef MOUSE_REPORT_DOUBLECLICK + (MEvent.clicks > 1 ? 8 : 0) #endif ) << 2); /* Report mouse wheel events. */ if (ev->button == Button4 || ev->button == Button5) { key_state |= 1 << 6; button_number = ev->button - Button4; } } #ifdef DEBUG_MOUSEREPORT fprintf(stderr, "Mouse ["); if (key_state & 16) fputc('C', stderr); if (key_state & 4) fputc('S', stderr); if (key_state & 2) fputc('A', stderr); if (key_state & 32) fputc('2', stderr); fprintf(stderr, "]: <%d>, %d/%d\n", button_number, x + 1, y + 1); #else tt_printf((unsigned char *) "\033[M%c%c%c", (32 + button_number + key_state), (32 + x + 1), (32 + y + 1)); #endif } /*{{{ process an X event */ /* PROTO */ void process_x_event(XEvent * ev) { static int bypass_keystate = 0; int reportmode; static int csrO = 0; /* Hops - csr offset in thumb/slider */ #if !defined(NO_DEBUG_OUTPUT) fprintf(stderr, "****************************************************************\n"); fprintf(stderr, "%s:%s:%d(%ld)><x.window(%lx)->send_event(%d)\n", __FILE__, __FUNCTION__, __LINE__, time(NULL), ev->type, event_type2name(ev->type), ev->xany.window, ev->xany.send_event); #endif /* to give proper Scroll behaviour */ switch (ev->type) { case KeyPress: lookup_key(ev); break; case DestroyNotify : if( ev->xdestroywindow.window == TermWin.vt || ev->xdestroywindow.window == TermWin.parent ) { #ifdef __CYGWIN__ /* cygwin does not kill shell properly */ /* fprintf( stderr, "cmd_pid = %d\n", cmd_pid ); */ kill( cmd_pid, SIGKILL ); #endif exit(EXIT_SUCCESS); } break ; case ClientMessage: if (ev->xclient.format == 32 && ev->xclient.data.l[0] == wmDeleteWindow) { #ifdef __CYGWIN__ /* cygwin does not kill shell properly */ /* fprintf( stderr, "cmd_pid = %d\n", cmd_pid ); */ kill( cmd_pid, SIGKILL ); #endif exit(EXIT_SUCCESS); } #ifdef OFFIX_DND /* OffiX Dnd (drag 'n' drop) protocol */ if (ev->xclient.message_type == DndProtocol && ((ev->xclient.data.l[0] == DndFile) || (ev->xclient.data.l[0] == DndDir) || (ev->xclient.data.l[0] == DndLink))) { /* Get Dnd data */ Atom ActualType; int ActualFormat; unsigned char *data; unsigned long Size, RemainingBytes; XGetWindowProperty(Xdisplay, Xroot, DndSelection, 0L, 1000000L, False, AnyPropertyType, &ActualType, &ActualFormat, &Size, &RemainingBytes, &data); XChangeProperty(Xdisplay, Xroot, XA_CUT_BUFFER0, XA_STRING, 8, PropModeReplace, data, strlen(data)); selection_paste(Xroot, XA_CUT_BUFFER0, True); XSetInputFocus(Xdisplay, Xroot, RevertToNone, CurrentTime); } #endif /* OFFIX_DND */ break; case MappingNotify: XRefreshKeyboardMapping(&(ev->xmapping)); break; /* Here's my conclusiion: * If the window is completely unobscured, use bitblt's * to scroll. Even then, they're only used when doing partial * screen scrolling. When partially obscured, we have to fill * in the GraphicsExpose parts, which means that after each refresh, * we need to wait for the graphics expose or Noexpose events, * which ought to make things real slow! */ case VisibilityNotify: switch (ev->xvisibility.state) { case VisibilityUnobscured: refresh_type = FAST_REFRESH; break; case VisibilityPartiallyObscured: refresh_type = SLOW_REFRESH; break; default: refresh_type = NO_REFRESH; break; } break; case FocusIn: if (!TermWin.focus) { TermWin.focus = 1; #ifdef OFF_FOCUS_FADING if( rs_fade != NULL ) { PixColors = &(PixColorsFocused[0]); on_colors_changed(Color_bg); } #endif #if !defined(USE_XIM) && !defined(NO_XLOCALE) if (Input_Context != NULL) XSetICFocus(Input_Context); #endif } break; case FocusOut: if (TermWin.focus) { TermWin.focus = 0; #ifdef OFF_FOCUS_FADING if( rs_fade != NULL ) { PixColors = &(PixColorsUnFocused[0]); on_colors_changed(Color_bg); } #endif #if !defined(USE_XIM) && !defined(NO_XLOCALE) if (Input_Context != NULL) XUnsetICFocus(Input_Context); #endif } break; case ConfigureNotify: while( XCheckTypedWindowEvent( Xdisplay, ev->xconfigure.window, ConfigureNotify, ev ) ); resize_window(ev); menubar_expose(); break; case SelectionClear: selection_clear(); break; case SelectionNotify: selection_paste(ev->xselection.requestor, ev->xselection.property, True); break; case SelectionRequest: selection_send(&(ev->xselectionrequest)); break; case PropertyNotify: #ifdef DEBUG_BACKGROUND_PMAP { char *prop_name = XGetAtomName( Xdisplay, ev->xproperty.atom ); fprintf( stderr, "PropertyNotify : %s(%lX)\n", prop_name, ev->xproperty.atom ); if( prop_name ) XFree( prop_name ); } #endif if( ev->xproperty.window == Xroot ) { #ifdef HAVE_AFTERSTEP if (ev->xproperty.atom == _AS_STYLE ) { const char *mystyle_name ; if( rs_mystyle ) mystyle_name = rs_mystyle ; else mystyle_name = GetDefaultMyStyle() ; mystyle_handle_property_event( ev ); set_mystyle( mystyle_find( mystyle_name ), True ); break; }else if( ev->xproperty.atom == _XROOTPMAP_ID ) { if( TermWin.background.trgType == BGT_MyStyle ) { if( !TransparentMS(TermWin.background.mystyle) ) { #ifdef DEBUG_BACKGROUND_PMAP fprintf( stderr, "texture type = %d\n", TermWin.background.mystyle->texture_type ); #endif break ; } destroy_asimage( &Scr.RootImage ); } } #endif #ifdef TRANSPARENT if( ev->xproperty.atom == _XROOTPMAP_ID ) { if( IsTransparentPixmap() ) { Pixmap p; if( read_32bit_property (Xroot, _XROOTPMAP_ID, &p) ) { if( p != TermWin.background.srcPixmap ) SetSrcPixmap( p ); }else ValidateSrcPixmap(True); #ifdef DEBUG_BACKGROUND_PMAP fprintf( stderr, "root pmap changed to = %lX\n", TermWin.background.srcPixmap ); #endif if( TransparentPixmapNeedsUpdate() ) request_background_update(); }else if( get_flags(Options, Opt_transparent) ) { scr_clear(); scr_touch(); } } #endif if( ev->xproperty.atom == _XA_NET_SUPPORTING_WM_CHECK ) { check_extended_wm_hints_support(); #ifdef DEBUG_BACKGROUND_PMAP fprintf( stderr, "WM change. Desktops are %ssupported\n", get_flags( ExtWM.flags, WM_SupportsDesktops )?"":"not " ); #endif }else if( ev->xproperty.atom == _XA_NET_CURRENT_DESKTOP ) { if( !read_32bit_property (Xroot, _XA_NET_CURRENT_DESKTOP, &ExtWM.current_desktop) ) clear_flags( ExtWM.flags, WM_SupportsDesktops ); else if( get_flags( ExtWM.flags, WM_ClaimSupportsDesktops ) ) set_flags( ExtWM.flags, WM_SupportsDesktops ); #ifdef DEBUG_BACKGROUND_PMAP fprintf( stderr, "Curr Desk change to %ld. Desktops are %ssupported\n", ExtWM.current_desktop, get_flags( ExtWM.flags, WM_SupportsDesktops )?"":"not " ); #endif /* Don't do it here - wait for background change : * if( TransparentPixmapNeedsUpdate() ) request_background_update(); */ } } if( ev->xproperty.window == TermWin.parent ) { if( ev->xproperty.atom == _XA_NET_WM_DESKTOP ) { #ifdef DEBUG_BACKGROUND_PMAP fprintf( stderr, "Aterm Desk change from %ld. Desktops are %ssupported\n", ExtWM.aterm_desktop, get_flags( ExtWM.flags, WM_SupportsDesktops )?"":"not " ); #endif if( !read_32bit_property (TermWin.parent, _XA_NET_WM_DESKTOP, &ExtWM.aterm_desktop) ) clear_flags( ExtWM.flags, WM_SupportsDesktops ); #ifdef DEBUG_BACKGROUND_PMAP fprintf( stderr, "Aterm Desk change to %ld. Desktops are %ssupported\n", ExtWM.aterm_desktop, get_flags( ExtWM.flags, WM_SupportsDesktops )?"":"not " ); #endif if( TransparentPixmapNeedsUpdate() ) request_background_update(); }else if( ev->xproperty.atom == _XA_NET_WM_STATE ) { if( check_extended_wm_state() ) if( TransparentPixmapNeedsUpdate() ) request_background_update(); #ifdef DEBUG_BACKGROUND_PMAP fprintf( stderr, "Aterm state change to: %sSticky, %sShaded, %sHidden\n", get_flags( ExtWM.flags, WM_AtermStateSticky )?"":"not ", get_flags( ExtWM.flags, WM_AtermStateShaded )?"":"not ", get_flags( ExtWM.flags, WM_AtermStateHidden )?"":"not " ); #endif } } break; case UnmapNotify: TermWin.bMapped = 0 ; /* fprintf(stderr, "\n aterm is UnMapped(event)");*/ break; case MapNotify: /* { XWindowAttributes attr ; XGetWindowAttributes( Xdisplay, ParentWin[0], &attr ); TermWin.bMapped = (attr.map_state == IsViewable)?1:0 ; fprintf(stderr, "\n aterm is %s", (TermWin.bMapped)?"Mapped":"UnMapped"); }*/ /* fprintf(stderr, "\n aterm is %s", (TermWin.bMapped)?"Mapped":"UnMapped");*/ TermWin.bMapped = 1 ; #ifdef TRANSPARENT if ( TransparentPixmapNeedsUpdate() ) request_background_update(); #endif #if 0 refresh_transparent_scrollbar(); if( Options & Opt_transparent) { Pixmap tmp = GetRootPixmap(None); if( tmp != TermWin.background.srcPixmap && TermWin.background.srcPixmap != None ) { if( TermWin.background.trgType != BGT_None ) { SetSrcPixmap(tmp); RenderPixmap(0); } scr_clear(); scr_touch(); } } #endif break ; case ReparentNotify: #ifdef TRANSPARENT { int n; XWindowAttributes attr ; int (*oldXErrorHandler) (Display *, XErrorEvent *) = XSetErrorHandler (pixmap_error_handler); for( n = 1 ; n < PARENTS_NUM ; n ++ ) ParentWin[n] = None; /* * Make the frame window set by the window manager have * the root background. Some window managers put few nested frame * windows for each client, so we have to take care about that. */ for( ParentWinNum = 1 ;ParentWinNumxany.window == TermWin.vt) { #if !defined(NO_DEBUG_OUTPUT) fprintf(stderr, "exposed area = %dx%d%+d%+d\n", ev->xexpose.x, ev->xexpose.y, ev->xexpose.width, ev->xexpose.height); #endif scr_expose(ev->xexpose.x, ev->xexpose.y, ev->xexpose.width, ev->xexpose.height); } else { XEvent unused_xevent; while (XCheckTypedWindowEvent(Xdisplay, ev->xany.window, Expose, &unused_xevent)) ; while (XCheckTypedWindowEvent(Xdisplay, ev->xany.window, GraphicsExpose, &unused_xevent)) ; if (isScrollbarWindow(ev->xany.window)) { scrollbar_setNone(); scrollbar_show(0); } if (menubar_visible() && isMenuBarWindow(ev->xany.window)) menubar_expose(); Gr_expose(ev->xany.window); } break; case ButtonPress: bypass_keystate = (ev->xbutton.state & (Mod1Mask | ShiftMask)); reportmode = (bypass_keystate ? 0 : (PrivateModes & PrivMode_mouse_report)); if (ev->xany.window == TermWin.vt) { if (ev->xbutton.subwindow != None) Gr_ButtonPress(ev->xbutton.x, ev->xbutton.y); else { if (reportmode) { /* mouse report from vt window */ /* save the xbutton state (for ButtonRelease) */ MEvent.state = ev->xbutton.state; #ifdef MOUSE_REPORT_DOUBLECLICK if (ev->xbutton.button == MEvent.button && (ev->xbutton.time - MEvent.time < MULTICLICK_TIME)) { /* same button, within alloted time */ MEvent.clicks++; if (MEvent.clicks > 1) { /* only report double clicks */ MEvent.clicks = 2; mouse_report(&(ev->xbutton)); /* don't report the release */ MEvent.clicks = 0; MEvent.button = AnyButton; } } else { /* different button, or time expired */ MEvent.clicks = 1; MEvent.button = ev->xbutton.button; mouse_report(&(ev->xbutton)); } #else MEvent.button = ev->xbutton.button; mouse_report(&(ev->xbutton)); #endif /* MOUSE_REPORT_DOUBLECLICK */ } else { if (ev->xbutton.button != MEvent.button) MEvent.clicks = 0; switch (ev->xbutton.button) { case Button1: if (MEvent.button == Button1 && (ev->xbutton.time - MEvent.time < MULTICLICK_TIME)) MEvent.clicks++; else MEvent.clicks = 1; selection_click(MEvent.clicks, ev->xbutton.x, ev->xbutton.y); MEvent.button = Button1; break; case Button3: if (MEvent.button == Button3 && (ev->xbutton.time - MEvent.time < MULTICLICK_TIME)) selection_rotate(ev->xbutton.x, ev->xbutton.y); else selection_extend(ev->xbutton.x, ev->xbutton.y, 1); MEvent.button = Button3; break; } } MEvent.time = ev->xbutton.time; return; } } if (isScrollbarWindow(ev->xany.window)) { scrollbar_setNone(); /* * Rxvt-style scrollbar: * move up if mouse is above slider * move dn if mouse is below slider * * XTerm-style scrollbar: * Move display proportional to pointer location * pointer near top -> scroll one line * pointer near bot -> scroll full page */ #ifndef NO_SCROLLBAR_REPORT if (reportmode) { /* * Mouse report disabled scrollbar: * arrow buttons - send up/down * click on scrollbar - send pageup/down */ if (scrollbar_upButton(ev->xbutton.y)) tt_printf((unsigned char *) "\033[A"); else if (scrollbar_dnButton(ev->xbutton.y)) tt_printf((unsigned char *) "\033[B"); else switch (ev->xbutton.button) { case Button2: tt_printf((unsigned char *) "\014"); break; case Button1: tt_printf((unsigned char *) "\033[6~"); break; case Button3: tt_printf((unsigned char *) "\033[5~"); break; } } else #endif /* NO_SCROLLBAR_REPORT */ { if (scrollbar_upButton(ev->xbutton.y)) { #ifndef NO_SCROLLBAR_BUTTON_CONTINUAL_SCROLLING scroll_arrow_delay = SCROLLBAR_INITIAL_DELAY; #endif if (scr_page(UP, 1)) scrollbar_setUp(); } else if (scrollbar_dnButton(ev->xbutton.y)) { #ifndef NO_SCROLLBAR_BUTTON_CONTINUAL_SCROLLING scroll_arrow_delay = SCROLLBAR_INITIAL_DELAY; #endif if (scr_page(DN, 1)) scrollbar_setDn(); } else switch (ev->xbutton.button) { case Button2: #ifndef FUNKY_SCROLL_BEHAVIOUR csrO = (scrollBar.bot - scrollBar.top) / 2; /* align to thumb center */ #else # ifndef XTERM_SCROLLBAR if (scrollbar_above_slider(ev->xbutton.y) || scrollbar_below_slider(ev->xbutton.y)) # endif #endif /* !FUNKY_SCROLL_BEHAVIOUR */ scr_move_to(scrollbar_position(ev->xbutton.y) - csrO, scrollbar_size()); scrollbar_setMotion(); break; case Button1: #ifndef FUNKY_SCROLL_BEHAVIOUR csrO = ev->xbutton.y - scrollBar.top; /* ptr ofset in thumb */ #endif /*drop */ case Button3: #ifndef XTERM_SCROLLBAR if (scrollbar_above_slider(ev->xbutton.y)) # ifdef RXVT_SCROLL_FULL scr_page(UP, TermWin.nrow - 1); # else scr_page(UP, TermWin.nrow / 4); # endif else if (scrollbar_below_slider(ev->xbutton.y)) # ifdef RXVT_SCROLL_FULL scr_page(DN, TermWin.nrow - 1); # else scr_page(DN, TermWin.nrow / 4); # endif else scrollbar_setMotion(); #else /* XTERM_SCROLLBAR */ scr_page((ev->xbutton.button == Button1 ? DN : UP), (TermWin.nrow * scrollbar_position(ev->xbutton.y) / scrollbar_size()) ); #endif /* XTERM_SCROLLBAR */ break; } } return; } if (isMenuBarWindow(ev->xany.window)) { menubar_control(&(ev->xbutton)); return; } break; case ButtonRelease: csrO = 0; /* reset csr Offset */ reportmode = (bypass_keystate ? 0 : (PrivateModes & PrivMode_mouse_report)); if (scrollbar_isUpDn()) { scrollbar_setNone(); scrollbar_show(0); #ifndef NO_SCROLLBAR_BUTTON_CONTINUAL_SCROLLING refresh_type &= ~SMOOTH_REFRESH; #endif } if (ev->xany.window == TermWin.vt) { if (ev->xbutton.subwindow != None) Gr_ButtonRelease(ev->xbutton.x, ev->xbutton.y); else { if (reportmode) { /* Don't report release events for the mouse wheel */ if (ev->xbutton.button == Button4 || ev->xbutton.button == Button5) return; /* mouse report from vt window */ #ifdef MOUSE_REPORT_DOUBLECLICK /* only report the release of 'slow' single clicks */ if (MEvent.button != AnyButton && (ev->xbutton.button != MEvent.button || (ev->xbutton.time - MEvent.time > MULTICLICK_TIME / 2)) ) { MEvent.clicks = 0; MEvent.button = AnyButton; mouse_report(&(ev->xbutton)); } #else /* MOUSE_REPORT_DOUBLECLICK */ MEvent.button = AnyButton; mouse_report(&(ev->xbutton)); #endif /* MOUSE_REPORT_DOUBLECLICK */ return; } /* * dumb hack to compensate for the failure of click-and-drag * when overriding mouse reporting */ if ((PrivateModes & PrivMode_mouse_report) && (bypass_keystate) && (ev->xbutton.button == Button1) && (MEvent.clicks <= 1)) selection_extend(ev->xbutton.x, ev->xbutton.y, 0); switch (ev->xbutton.button) { case Button1: case Button3: selection_make(ev->xbutton.time, ev->xbutton.state); break; case Button2: selection_request(ev->xbutton.time, ev->xbutton.x, ev->xbutton.y); break; #ifndef NO_MOUSE_WHEEL case Button4: scr_page(UP, (ev->xbutton.state & ShiftMask) ? 1 : 5); break; case Button5: scr_page(DN, (ev->xbutton.state & ShiftMask) ? 1 : 5); break; #endif } } } else if (isMenuBarWindow(ev->xany.window)) { menubar_control(&(ev->xbutton)); } break; case MotionNotify: if (isMenuBarWindow(ev->xany.window)) { menubar_control(&(ev->xbutton)); break; } if ((PrivateModes & PrivMode_mouse_report) && !(bypass_keystate)) break; if (ev->xany.window == TermWin.vt) { if ((ev->xbutton.state & (Button1Mask | Button3Mask))) { Window unused_root, unused_child; int unused_root_x, unused_root_y; unsigned int unused_mask; while (XCheckTypedWindowEvent(Xdisplay, TermWin.vt, MotionNotify, ev)) ; XQueryPointer(Xdisplay, TermWin.vt, &unused_root, &unused_child, &unused_root_x, &unused_root_y, &(ev->xbutton.x), &(ev->xbutton.y), &unused_mask); #ifdef MOUSE_THRESHOLD /* deal with a `jumpy' mouse */ if ((ev->xmotion.time - MEvent.time) > MOUSE_THRESHOLD) #endif selection_extend((ev->xbutton.x), (ev->xbutton.y), (ev->xbutton.state & Button3Mask) ? 2 : 0); } } else if ((ev->xany.window == scrollBar.win) && scrollbar_isMotion()) { Window unused_root, unused_child; int unused_root_x, unused_root_y; unsigned int unused_mask; while (XCheckTypedWindowEvent(Xdisplay, scrollBar.win, MotionNotify, ev)) ; XQueryPointer(Xdisplay, scrollBar.win, &unused_root, &unused_child, &unused_root_x, &unused_root_y, &(ev->xbutton.x), &(ev->xbutton.y), &unused_mask); scr_move_to(scrollbar_position(ev->xbutton.y) - csrO, scrollbar_size()); scr_refresh(refresh_type); refresh_count = refresh_limit = 0; scrollbar_show(1); #ifdef USE_XIM IMSendSpot(); #endif } break; } } /*}}} */ /* * Send printf() formatted output to the command. * Only use for small ammounts of data. */ /* PROTO */ void tt_printf(const unsigned char *fmt,...) { static unsigned char buf[TT_PRINTF_LIMIT]; va_list arg_ptr; va_start(arg_ptr, fmt); vsprintf((char *) buf, (char *) fmt, arg_ptr); va_end(arg_ptr); tt_write(buf, strlen(buf)); } /*}}} */ /*{{{ print pipe */ /*----------------------------------------------------------------------*/ #ifdef PRINTPIPE /* PROTO */ FILE * popen_printer(void) { FILE *stream = popen(rs_print_pipe, "w"); if (stream == NULL) print_error("can't open printer pipe"); return stream; } /* PROTO */ int pclose_printer(FILE * stream) { fflush(stream); /* pclose() reported not to work on SunOS 4.1.3 */ #if defined (__sun__) /* TODO: RESOLVE THIS */ /* pclose works provided SIGCHLD handler uses waitpid */ return pclose(stream); /* return fclose (stream); */ #else return pclose(stream); #endif } /* * simulate attached vt100 printer */ /* PROTO */ void process_print_pipe(void) { int done; FILE *fd; if ((fd = popen_printer()) == NULL) return; /* * Send all input to the printer until either ESC[4i or ESC[?4i * is received. */ for (done = 0; !done;) { unsigned char buf[8]; unsigned char ch; unsigned int i, len; if ((ch = cmd_getc()) != '\033') { if (putc(ch, fd) == EOF) break; /* done = 1 */ } else { len = 0; buf[len++] = ch; if ((buf[len++] = cmd_getc()) == '[') { if ((ch = cmd_getc()) == '?') { buf[len++] = '?'; ch = cmd_getc(); } if ((buf[len++] = ch) == '4') { if ((buf[len++] = cmd_getc()) == 'i') break; /* done = 1 */ } } for (i = 0; i < len; i++) if (putc(buf[i], fd) == EOF) { done = 1; break; } } } pclose_printer(fd); } #endif /* PRINTPIPE */ /*}}} */ /*{{{ process escape sequences */ /* PROTO */ void process_escape_seq(void) { unsigned char ch = cmd_getc(); switch (ch) { /* case 1: do_tek_mode (); break; */ case '#': if (cmd_getc() == '8') scr_E(); break; case '(': scr_charset_set(0, cmd_getc()); break; case ')': scr_charset_set(1, cmd_getc()); break; case '*': scr_charset_set(2, cmd_getc()); break; case '+': scr_charset_set(3, cmd_getc()); break; #ifdef MULTICHAR_SET case '$': scr_charset_set(-2, cmd_getc()); break; #endif case '7': scr_cursor(SAVE); break; case '8': scr_cursor(RESTORE); break; case '=': case '>': PrivMode((ch == '='), PrivMode_aplKP); break; case '@': (void)cmd_getc(); break; case 'D': scr_index(UP); break; case 'E': scr_add_lines((unsigned char *) "\n\r", 1, 2); break; case 'G': process_graphics(); break; case 'H': scr_set_tab(1); break; case 'M': scr_index(DN); break; /*case 'N': scr_single_shift (2); break; */ /*case 'O': scr_single_shift (3); break; */ case 'Z': tt_printf((unsigned char *) ESCZ_ANSWER); break; /* steal obsolete ESC [ c */ case '[': process_csi_seq(); break; case ']': process_xterm_seq(); break; case 'c': scr_poweron(); break; case 'n': scr_charset_choose(2); break; case 'o': scr_charset_choose(3); break; } } /*}}} */ /*{{{ process CSI (code sequence introducer) sequences `ESC[' */ /* PROTO */ void process_csi_seq(void) { unsigned char ch, priv; unsigned int nargs; int arg[ESC_ARGS]; nargs = 0; arg[0] = 0; arg[1] = 0; priv = 0; ch = cmd_getc(); if (ch >= '<' && ch <= '?') { priv = ch; ch = cmd_getc(); } /* read any numerical arguments */ do { int n; for (n = 0; isdigit(ch); ch = cmd_getc()) n = n * 10 + (ch - '0'); if (nargs < ESC_ARGS) arg[nargs++] = n; if (ch == '\b') { scr_backspace(); } else if (ch == 033) { process_escape_seq(); return; } else if (ch < ' ') { scr_add_lines(&ch, 0, 1); return; } if (ch < '@') ch = cmd_getc(); } while (ch >= ' ' && ch < '@'); if (ch == 033) { process_escape_seq(); return; } else if (ch < ' ') return; switch (ch) { #ifdef PRINTPIPE case 'i': /* printing */ switch (arg[0]) { case 0: scr_printscreen(0); break; case 5: process_print_pipe(); break; } break; #endif case 'A': case 'e': /* up */ scr_gotorc((arg[0] ? -arg[0] : -1), 0, RELATIVE); break; case 'B': /* down */ scr_gotorc((arg[0] ? +arg[0] : +1), 0, RELATIVE); break; case 'C': case 'a': /* right */ scr_gotorc(0, (arg[0] ? +arg[0] : +1), RELATIVE); break; case 'D': /* left */ scr_gotorc(0, (arg[0] ? -arg[0] : -1), RELATIVE); break; case 'E': /* down & to first column */ scr_gotorc((arg[0] ? +arg[0] : +1), 0, R_RELATIVE); break; case 'F': /* up & to first column */ scr_gotorc((arg[0] ? -arg[0] : -1), 0, R_RELATIVE); break; case 'G': case '`': /* move to col */ scr_gotorc(0, (arg[0] ? arg[0] - 1 : +1), R_RELATIVE); break; case 'd': /* move to row */ scr_gotorc((arg[0] ? arg[0] - 1 : +1), 0, C_RELATIVE); break; case 'H': case 'f': /* position cursor */ switch (nargs) { case 0: scr_gotorc(0, 0, 0); break; case 1: scr_gotorc((arg[0] ? arg[0] - 1 : 0), 0, 0); break; default: scr_gotorc(arg[0] - 1, arg[1] - 1, 0); break; } break; case 'I': scr_tab(arg[0] ? +arg[0] : +1); break; case 'Z': scr_tab(arg[0] ? -arg[0] : -1); break; case 'J': scr_erase_screen(arg[0]); break; case 'K': scr_erase_line(arg[0]); break; case '@': scr_insdel_chars((arg[0] ? arg[0] : 1), INSERT); break; case 'L': scr_insdel_lines((arg[0] ? arg[0] : 1), INSERT); break; case 'M': scr_insdel_lines((arg[0] ? arg[0] : 1), DELETE); break; case 'X': scr_insdel_chars((arg[0] ? arg[0] : 1), ERASE); break; case 'P': scr_insdel_chars((arg[0] ? arg[0] : 1), DELETE); break; case 'c': tt_printf((unsigned char *) VT100_ANS); break; case 'm': process_sgr_mode(nargs, arg); break; case 'n': /* request for information */ switch (arg[0]) { case 5: tt_printf((unsigned char *) "\033[0n"); break; /* ready */ case 6: scr_report_position(); break; #if defined (ENABLE_DISPLAY_ANSWER) case 7: if( strlen(display_name) < TT_PRINTF_LIMIT-2 ) tt_printf((unsigned char *) "%s\n", display_name); break; #endif case 8: xterm_seq(XTerm_title, APL_NAME "-" VERSION); break; } break; case 'r': /* set top and bottom margins */ if (priv != '?') { if (nargs < 2 || arg[0] >= arg[1]) scr_scroll_region(0, 10000); else scr_scroll_region(arg[0] - 1, arg[1] - 1); break; } /* drop */ case 's': case 't': if(arg[0] == 21) tt_printf((unsigned char *) "\033]l%s\033\\", rs_title); break; case 'h': case 'l': process_terminal_mode(ch, priv, nargs, arg); break; case 'g': switch (arg[0]) { case 0: scr_set_tab(0); break; /* delete tab */ case 3: scr_set_tab(-1); break; /* clear all tabs */ } break; case 'W': switch (arg[0]) { case 0: scr_set_tab(1); break; /* = ESC H */ case 2: scr_set_tab(0); break; /* = ESC [ 0 g */ case 5: scr_set_tab(-1); break; /* = ESC [ 3 g */ } break; } } /*}}} */ /*{{{ process xterm text parameters sequences `ESC ] Ps ; Pt BEL' */ /* PROTO */ void process_xterm_seq(void) { unsigned char ch, string[STRING_MAX]; int arg; ch = cmd_getc(); for (arg = 0; isdigit(ch); ch = cmd_getc()) arg = arg * 10 + (ch - '0'); if (ch == ';') { int n = 0; while ((ch = cmd_getc()) != 007) { if (ch) { if (ch == '\t') ch = ' '; /* translate '\t' to space */ else if (ch < ' ') return; /* control character - exit */ if (n < sizeof(string) - 1) string[n++] = ch; } } string[n] = '\0'; /* * menubar_dispatch() violates the constness of the string, * so do it here */ if (arg == XTerm_Menu) menubar_dispatch((char *) string); else xterm_seq(arg, (char *) string); } } /*}}} */ /*{{{ process DEC private mode sequences `ESC [ ? Ps mode' */ /* * mode can only have the following values: * 'l' = low * 'h' = high * 's' = save * 'r' = restore * 't' = toggle * so no need for fancy checking */ /* PROTO */ void process_terminal_mode(int mode, int priv, unsigned int nargs, int arg[]) { unsigned int i; int state; if (nargs == 0) return; /* make lo/hi boolean */ switch (mode) { case 'l': mode = 0; break; case 'h': mode = 1; break; } switch (priv) { case 0: if (mode && mode != 1) return; /* only do high/low */ for (i = 0; i < nargs; i++) switch (arg[i]) { case 4: scr_insert_mode(mode); break; /* case 38: TEK mode */ } break; #define PrivCases(bit) \ if (mode == 't') \ state = !(PrivateModes & bit); \ else \ state = mode; \ switch (state) { \ case 's': \ SavedModes |= (PrivateModes & bit); \ continue; \ break; \ case 'r': \ state = (SavedModes & bit) ? 1 : 0; \ /* FALLTHROUGH */ \ default: \ PrivMode (state, bit); \ } case '?': for (i = 0; i < nargs; i++) switch (arg[i]) { case 1: /* application cursor keys */ PrivCases(PrivMode_aplCUR); break; /* case 2: - reset charsets to USASCII */ case 3: /* 80/132 */ PrivCases(PrivMode_132); if (PrivateModes & PrivMode_132OK) set_width(state ? 132 : 80); break; /* case 4: - smooth scrolling */ case 5: /* reverse video */ PrivCases(PrivMode_rVideo); scr_rvideo_mode(state); break; case 6: /* relative/absolute origins */ PrivCases(PrivMode_relOrigin); scr_relative_origin(state); break; case 7: /* autowrap */ PrivCases(PrivMode_Autowrap); scr_autowrap(state); break; /* case 8: - auto repeat, can't do on a per window basis */ case 9: /* X10 mouse reporting */ PrivCases(PrivMode_MouseX10); /* orthogonal */ if (PrivateModes & PrivMode_MouseX10) PrivateModes &= ~(PrivMode_MouseX11); break; # ifdef menuBar_esc case menuBar_esc: PrivCases(PrivMode_menuBar); map_menuBar(state); break; # endif #ifdef scrollBar_esc case scrollBar_esc: PrivCases(PrivMode_scrollBar); map_scrollBar(state); break; #endif case 25: /* visible/invisible cursor */ PrivCases(PrivMode_VisibleCursor); scr_cursor_visible(state); break; case 35: PrivCases(PrivMode_ShiftKeys); break; case 40: /* 80 <--> 132 mode */ PrivCases(PrivMode_132OK); break; case 47: /* secondary screen */ PrivCases(PrivMode_Screen); scr_change_screen(state); break; case 66: /* application key pad */ PrivCases(PrivMode_aplKP); break; case 67: #ifndef NO_BACKSPACE_KEY if (PrivateModes & PrivMode_HaveBackSpace) { PrivCases(PrivMode_BackSpace); } #endif break; case 1000: /* X11 mouse reporting */ PrivCases(PrivMode_MouseX11); /* orthogonal */ if (PrivateModes & PrivMode_MouseX11) PrivateModes &= ~(PrivMode_MouseX10); break; #if 0 case 1001: break; /* X11 mouse highlighting */ #endif case 1010: /* scroll to bottom on TTY output inhibit */ PrivCases(PrivMode_TtyOutputInh); if (PrivateModes & PrivMode_TtyOutputInh) Options &= ~Opt_scrollTtyOutput; else Options |= Opt_scrollTtyOutput; break; case 1011: /* scroll to bottom on key press */ PrivCases(PrivMode_Keypress); if (PrivateModes & PrivMode_Keypress) Options |= Opt_scrollKeypress; else Options &= ~Opt_scrollKeypress; break; } #undef PrivCases break; } } /*}}} */ /*{{{ process sgr sequences */ /* PROTO */ void process_sgr_mode(unsigned int nargs, int arg[]) { unsigned int i; if (nargs == 0) { scr_rendition(0, ~RS_None); return; } for (i = 0; i < nargs; i++) switch (arg[i]) { case 0: scr_rendition(0, ~RS_None); break; case 1: scr_rendition(1, RS_Bold); break; case 4: scr_rendition(1, RS_Uline); break; case 5: scr_rendition(1, RS_Blink); break; case 7: scr_rendition(1, RS_RVid); break; case 22: scr_rendition(0, RS_Bold); break; case 24: scr_rendition(0, RS_Uline); break; case 25: scr_rendition(0, RS_Blink); break; case 27: scr_rendition(0, RS_RVid); break; case 30: case 31: /* set fg color */ case 32: case 33: case 34: case 35: case 36: case 37: scr_color(minCOLOR + (arg[i] - 30), RS_Bold); break; case 39: /* default fg */ scr_color(restoreFG, RS_Bold); break; case 40: case 41: /* set bg color */ case 42: case 43: case 44: case 45: case 46: case 47: scr_color(minCOLOR + (arg[i] - 40), RS_Blink); break; case 49: /* default bg */ scr_color(restoreBG, RS_Blink); break; } } /*}}} */ /*{{{ process Rob Nation's own graphics mode sequences */ /* PROTO */ void process_graphics(void) { unsigned char ch, cmd = cmd_getc(); #ifndef RXVT_GRAPHICS if (cmd == 'Q') { /* query graphics */ tt_printf((unsigned char *) "\033G0\n"); /* no graphics */ return; } /* swallow other graphics sequences until terminating ':' */ do ch = cmd_getc(); while (ch != ':'); #else int nargs; int args[NGRX_PTS]; unsigned char *text = NULL; if (cmd == 'Q') { /* query graphics */ tt_printf((unsigned char *) "\033G1\n"); /* yes, graphics (color) */ return; } for (nargs = 0; nargs < (sizeof(args) / sizeof(args[0])) - 1; ) { int neg; ch = cmd_getc(); neg = (ch == '-'); if (neg || ch == '+') ch = cmd_getc(); for (args[nargs] = 0; isdigit(ch); ch = cmd_getc()) args[nargs] = args[nargs] * 10 + (ch - '0'); if (neg) args[nargs] = -args[nargs]; nargs++; args[nargs] = 0; if (ch != ';') break; } if ((cmd == 'T') && (nargs >= 5)) { int i, len = args[4]; text = MALLOC((len + 1) * sizeof(char)); if (text != NULL) { for (i = 0; i < len; i++) text[i] = cmd_getc(); text[len] = '\0'; } } Gr_do_graphics(cmd, nargs, args, text); #ifdef USE_XIM IMSendSpot(); #endif #endif } /*}}} */ /*{{{ Read and process output from the application */ /* PROTO */ void main_loop(void) { int ch; do { while ((ch = cmd_getc()) == 0) ; /* wait for something */ /* fprintf( stderr, "%d: cmd_getc returned 0x%x(%c)\n", ++i, ch, isprint(ch)?ch:' ' ); */ if (ch >= ' ' || ch == '\t' || ch == '\n' || ch == '\r') { /* Read a text string from the input buffer */ int nlines = 0; unsigned char *str; /* * point to the start of the string, * decrement first since it was post incremented in cmd_getc() */ str = --cmdbuf_ptr; while (cmdbuf_ptr < cmdbuf_endp) { ch = *cmdbuf_ptr++; /* fprintf( stderr, "%d: cmd_getc returned 0x%x(%c)\n", ++i, ch, isprint(ch)?ch:' ' ); */ if (ch >= ' ' || ch == '\t' ) { /* nothing */ } else if (ch == '\r') { /* we better flush that stuff to create an * impression that there is something going on */ if( cmdbuf_ptr >= cmdbuf_endp || (*cmdbuf_ptr != '\n' && *cmdbuf_ptr != '\r')) break; } else if (ch == '\n') { nlines++; if (++refresh_count >= (refresh_limit * (TermWin.nrow - 1))) break; } else { /* unprintable */ cmdbuf_ptr--; break; } } scr_add_lines(str, nlines, (cmdbuf_ptr - str)); if( ch == '\r' ) { scr_refresh(refresh_type); } } else { switch (ch) { case 005: /* terminal Status */ tt_printf((unsigned char *) VT100_ANS); break; case 007: /* bell */ scr_bell(); break; case '\b': /* backspace */ scr_backspace(); break; case 013: /* vertical tab, form feed */ case 014: scr_index(UP); break; case 016: /* shift out - acs */ scr_charset_choose(1); break; case 017: /* shift in - acs */ scr_charset_choose(0); break; case 033: /* escape char */ process_escape_seq(); break; } } } while (ch != EOF); } /* ---------------------------------------------------------------------- */ /* Addresses pasting large amounts of data and rxvt hang * code pinched from xterm (v_write()) and applied originally to * rxvt-2.18 - Hops * Write data to the pty as typed by the user, pasted with the mouse, * or generated by us in response to a query ESC sequence. */ /* PROTO */ void tt_write(const unsigned char *d, int len) { int riten, p; if (v_bufstr == NULL && len > 0) { v_buffer = v_bufstr = v_bufptr = MALLOC(len); v_bufend = v_buffer + len; } /* * Append to the block we already have. Always doing this simplifies the * code, and isn't too bad, either. If this is a short block, it isn't * too expensive, and if this is a long block, we won't be able to write * it all anyway. */ if (len > 0) { if (v_bufend < v_bufptr + len) { /* we've run out of room */ if (v_bufstr != v_buffer) { /* there is unused space, move everything down */ /* possibly overlapping bcopy here */ /* bcopy(v_bufstr, v_buffer, v_bufptr - v_bufstr); */ memcpy(v_buffer, v_bufstr, v_bufptr - v_bufstr); v_bufptr -= v_bufstr - v_buffer; v_bufstr = v_buffer; } if (v_bufend < v_bufptr + len) { /* still won't fit: get more space */ /* Don't use XtRealloc because an error is not fatal. */ int size = v_bufptr - v_buffer; /* save across realloc */ v_buffer = REALLOC(v_buffer, size + len); if (v_buffer) { v_bufstr = v_buffer; v_bufptr = v_buffer + size; v_bufend = v_bufptr + len; } else { /* no memory: ignore entire write request */ print_error("cannot allocate buffer space"); v_buffer = v_bufstr; /* restore clobbered pointer */ } } } if (v_bufend >= v_bufptr + len) { /* new stuff will fit */ memcpy(v_bufptr, d, len); /* bcopy(d, v_bufptr, len); */ v_bufptr += len; } } /* * Write out as much of the buffer as we can. * Be careful not to overflow the pty's input silo. * We are conservative here and only write a small amount at a time. * * If we can't push all the data into the pty yet, we expect write * to return a non-negative number less than the length requested * (if some data written) or -1 and set errno to EAGAIN, * EWOULDBLOCK, or EINTR (if no data written). * * (Not all systems do this, sigh, so the code is actually * a little more forgiving.) */ #define MAX_PTY_WRITE 128 /* 1/2 POSIX minimum MAX_INPUT */ if ((p = v_bufptr - v_bufstr) > 0) { riten = write(cmd_fd, v_bufstr, p < MAX_PTY_WRITE ? p : MAX_PTY_WRITE); if (riten < 0) riten = 0; v_bufstr += riten; if (v_bufstr >= v_bufptr) /* we wrote it all */ v_bufstr = v_bufptr = v_buffer; } /* * If we have lots of unused memory allocated, return it */ if (v_bufend - v_bufptr > 1024) { /* arbitrary hysteresis */ /* save pointers across realloc */ int start = v_bufstr - v_buffer; int size = v_bufptr - v_buffer; int allocsize = size ? size : 1; v_buffer = REALLOC(v_buffer, allocsize); if (v_buffer) { v_bufstr = v_buffer + start; v_bufptr = v_buffer + size; v_bufend = v_buffer + allocsize; } else { /* should we print a warning if couldn't return memory? */ v_buffer = v_bufstr - start; /* restore clobbered pointer */ } } } #ifdef USE_XIM /* PROTO */ void setSize( XRectangle *size ) { size->x = TermWin_internalBorder; size->y = TermWin_internalBorder; size->width = Width2Pixel (TermWin.ncol); size->height = Height2Pixel(TermWin.nrow); return; } /* PROTO */ void setColor( unsigned long *fg, unsigned long *bg ) { *fg = PixColors[Color_fg]; *bg = PixColors[Color_bg]; return; } /* PROTO */ void IMSendSpot( void ) { XPoint spot; XVaNestedList preedit_attr; XIMStyle input_style; if( Input_Context == NULL ) return; else { XGetICValues(Input_Context,XNInputStyle,&input_style,NULL); if (!(input_style & XIMPreeditPosition)) return; } setPosition( &spot ); preedit_attr = XVaCreateNestedList( 0, XNSpotLocation, &spot, NULL ); XSetICValues( Input_Context, XNPreeditAttributes, preedit_attr, NULL ); XFree( preedit_attr ); return; } /* PROTO */ void setTermFontSet( void ) { char *string; long length, i; if( TermWin.fontset != NULL ){ XFreeFontSet( Xdisplay, TermWin.fontset ); TermWin.fontset = NULL; } length = 0; for( i = 0 ; i < NFONTS ; i ++){ if( rs_font[ i ] ) length += strlen( rs_font[ i ] ) + 1; # ifdef MULTICHAR_SET if( rs_mfont[ i ] ) length += strlen( rs_mfont[ i ] ) + 1; # endif } if( ( string = malloc( length ) ) != NULL ){ char **missing_charsetlist, *def_string; int missing_charsetcount; string[ 0 ] = '\0'; for( i = 0 ; i < NFONTS ; i ++){ if( rs_font[ i ] ){ strcat( string, rs_font[ i ] ); strcat( string, "," ); } # ifdef MULTICHAR_SET if( rs_mfont[ i ] ){ strcat( string, rs_mfont[ i ] ); strcat( string, "," ); } # endif } length = strlen( string ); if( length > 0 && string[ length - 1 ] == ',' ){ string[ length - 1 ] = '\0'; length --; } if( length > 0 ){ TermWin.fontset = XCreateFontSet ( Xdisplay, string, &missing_charsetlist, &missing_charsetcount, &def_string ); } free( string ); } else { TermWin.fontset = NULL; } return; } /* PROTO */ void setPreeditArea(XRectangle *preedit_rect, XRectangle *status_rect, XRectangle *needed_rect) { preedit_rect->x = needed_rect->width + (scrollbar_visible() && !(Options & Opt_scrollBar_right) ? (SB_WIDTH + sb_shadow * 2) : 0); preedit_rect->y = Height2Pixel(TermWin.nrow - 1) + ((menuBar.state == 1) ? menuBar_TotalHeight() : 0); preedit_rect->width = Width2Pixel(TermWin.ncol + 1) - needed_rect->width + (!(Options & Opt_scrollBar_right) ? (SB_WIDTH + sb_shadow * 2) : 0); preedit_rect->height = Height2Pixel(1); status_rect->x = (scrollbar_visible() && !(Options & Opt_scrollBar_right)) ? (SB_WIDTH + sb_shadow * 2) : 0; status_rect->y = Height2Pixel(TermWin.nrow - 1) + ((menuBar.state == 1) ? menuBar_TotalHeight() : 0); status_rect->width = needed_rect->width ? needed_rect->width : Width2Pixel(TermWin.ncol + 1); status_rect->height = Height2Pixel(1); } /* PROTO */ void IMDestroyCallback(XIM xim, XPointer client_data, XPointer call_data) { Input_Context = NULL; XRegisterIMInstantiateCallback(Xdisplay, NULL, NULL, NULL, IMInstantiateCallback, NULL); } /* PROTO */ void IMInstantiateCallback(Display *display, XPointer client_data, XPointer call_data) { char *p, *s, buf[64], tmp[1024]; char *end, *next_s; XIM xim = NULL; XIMStyle input_style = 0; XIMStyles *xim_styles = NULL; int found; XPoint spot; XRectangle rect, status_rect, needed_rect; unsigned long fg, bg; XVaNestedList preedit_attr = NULL; XVaNestedList status_attr = NULL; XIMCallback ximcallback; Input_Context = NULL; if (Input_Context) return; ximcallback.callback = IMDestroyCallback; ximcallback.client_data = NULL; if (rs_inputMethod && *rs_inputMethod) { STRNCPY(tmp, rs_inputMethod, sizeof(tmp) - 1); for (s = tmp; *s; s = next_s + 1) { for (; *s && isspace(*s); s++); if (!*s) break; for (end = s; (*end && (*end != ',')); end++); for (next_s = end--; ((end >= s) && isspace(*end)); end--); *(end + 1) = '\0'; if (*s) { STRCPY(buf, "@im="); strncat(buf, s, sizeof(buf) - 4 - 1); if ((p = XSetLocaleModifiers(buf)) != NULL && (xim = XOpenIM(Xdisplay, NULL, NULL, NULL)) != NULL) break; } if (!*next_s) break; } } /* try with XMODIFIERS env. var. */ if (xim == NULL && (p = XSetLocaleModifiers("")) != NULL) xim = XOpenIM(Xdisplay, NULL, NULL, NULL); /* try with no modifiers base */ if (xim == NULL && (p = XSetLocaleModifiers("@im=none")) != NULL) xim = XOpenIM(Xdisplay, NULL, NULL, NULL); if (xim == NULL) return; XSetIMValues(xim, XNDestroyCallback, &ximcallback, NULL); if (XGetIMValues(xim, XNQueryInputStyle, &xim_styles, NULL) || !xim_styles) { print_error("input method doesn't support any style"); XCloseIM(xim); return; } STRNCPY(tmp, (rs_preeditType ? rs_preeditType : "OverTheSpot,OffTheSpot,Root"), sizeof(tmp) - 1); for (found = 0, s = tmp; *s && !found; s = next_s + 1) { unsigned short i; for (; *s && isspace(*s); s++); if (!*s) break; for (end = s; (*end && (*end != ',')); end++); for (next_s = end--; ((end >= s) && isspace(*end)); end--); *(end + 1) = '\0'; if (!strcmp(s, "OverTheSpot")) input_style = (XIMPreeditPosition | XIMStatusNothing); else if (!strcmp(s, "OffTheSpot")) input_style = (XIMPreeditArea | XIMStatusArea); else if (!strcmp(s, "Root")) input_style = (XIMPreeditNothing | XIMStatusNothing); for (i = 0; i < xim_styles->count_styles; i++) if (input_style == xim_styles->supported_styles[i]) { found = 1; break; } } XFree(xim_styles); if (found == 0) { print_error("input method doesn't support my preedit type"); XCloseIM(xim); return; } if ((input_style != (XIMPreeditNothing | XIMStatusNothing)) && (input_style != (XIMPreeditArea | XIMStatusArea)) && (input_style != (XIMPreeditPosition | XIMStatusNothing))) { print_error("This program does not support the preedit type"); XCloseIM(xim); return; } if (input_style & XIMPreeditPosition) { setSize(&rect); setPosition(&spot); setColor(&fg, &bg); preedit_attr = XVaCreateNestedList(0, XNArea, &rect, XNSpotLocation, &spot, XNForeground, fg, XNBackground, bg, XNFontSet, TermWin.fontset, NULL); } else if (input_style & XIMPreeditArea) { setColor(&fg, &bg); /* * The necessary width of preedit area is unknown * until create input context. */ needed_rect.width = 0; setPreeditArea(&rect, &status_rect, &needed_rect); preedit_attr = XVaCreateNestedList(0, XNArea, &rect, XNForeground, fg, XNBackground, bg, XNFontSet, TermWin.fontset, NULL); status_attr = XVaCreateNestedList(0, XNArea, &status_rect, XNForeground, fg, XNBackground, bg, XNFontSet, TermWin.fontset, NULL); } Input_Context = XCreateIC(xim, XNInputStyle, input_style, XNClientWindow, TermWin.parent, XNFocusWindow, TermWin.parent, XNDestroyCallback, &ximcallback, preedit_attr ? XNPreeditAttributes : NULL, preedit_attr, status_attr ? XNStatusAttributes : NULL, status_attr, NULL); XFree(preedit_attr); XFree(status_attr); if (Input_Context == NULL) { print_error("Failed to create input context"); XCloseIM(xim); } if (input_style & XIMPreeditArea) IMSetStatusPosition(); } /* PROTO */ void IMSetStatusPosition(void) { XIMStyle input_style; XRectangle rect, status_rect, *needed_rect; XVaNestedList preedit_attr, status_attr; if (Input_Context == NULL) return; XGetICValues(Input_Context, XNInputStyle, &input_style, NULL); if (input_style & XIMPreeditArea) { status_attr = XVaCreateNestedList(0, XNAreaNeeded, &needed_rect, NULL); XGetICValues(Input_Context, XNStatusAttributes, status_attr, NULL); XFree(status_attr); rect.x = needed_rect->width; if (menuBar.state == 1) { rect.y = Height2Pixel(TermWin.nrow - 1) - menuBar_TotalHeight(); } else { rect.y = Height2Pixel(TermWin.nrow - 1); } if (Options & Opt_scrollBar_right) { rect.width = Width2Pixel(TermWin.ncol + 1) - needed_rect->width; } else { rect.width = Width2Pixel(TermWin.ncol + 1) + SB_WIDTH + SHADOW * 2 - needed_rect->width; } rect.height = needed_rect->height; preedit_attr = XVaCreateNestedList(0, XNArea, &rect, NULL); if (scrollbar_visible()) { if (Options & Opt_scrollBar_right) { status_rect.x = 0; } else { status_rect.x = SB_WIDTH + SHADOW * 2; } } else { status_rect.x = 0; } if (menuBar.state == 1) { status_rect.y = Height2Pixel(TermWin.nrow - 1) + menuBar_TotalHeight(); } else { status_rect.y = Height2Pixel(TermWin.nrow - 1); } status_rect.width = needed_rect->width; status_rect.height = needed_rect->height; status_attr = XVaCreateNestedList(0, XNArea, &status_rect, NULL); XSetICValues(Input_Context, XNPreeditAttributes, preedit_attr, XNStatusAttributes, status_attr, NULL); XFree(preedit_attr); XFree(status_attr); } } /* PROTO */ void XProcessEvent( Display *display ) { XEvent xev; XNextEvent( display, &xev ); if( !XFilterEvent( &xev, xev.xany.window ) ) process_x_event( &xev ); return; } #endif /*}}} */ /*----------------------- end-of-file (C source) -----------------------*/ aterm-1.0.1/src/xdefaults.c0000644000175000001440000007416110345342634014262 0ustar vaeusers/*--------------------------------*-C-*---------------------------------* * File: xdefaults.c *----------------------------------------------------------------------* * Copyright 1997,1998 mj olesen * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *----------------------------------------------------------------------*/ /*----------------------------------------------------------------------* * Originally written: * 1994 Robert Nation * Modifications: * 1997,1998 mj olesen *----------------------------------------------------------------------*/ /*----------------------------------------------------------------------* * get resources from ~/.Xdefaults or ~/.Xresources with the memory-saving * default or with XGetDefault() (#define USE_XGETDEFAULT) * * Coding style: * resource strings are indicated by an `rs_' prefix followed by * the resource name. * eg, `rs_saveLines' is the resource string corresponding to * the `saveLines' resource *----------------------------------------------------------------------*/ #ifndef lint static const char rcsid[] = "$Id: xdefaults.c,v 1.5 2005/12/06 17:08:44 sasha Exp $"; #endif #include "rxvt.h" /* NECESSARY */ /* #define DEBUG_RESOURCES */ /* local functions referenced */ /*{{{ local variables */ static const char *rs_borderLess = NULL; static const char *rs_loginShell = NULL; static const char *rs_utmpInhibit = NULL; static const char *rs_scrollBar = NULL; static const char *rs_scrollBar_right = NULL; static const char *rs_scrollBar_floating = NULL; static const char *rs_scrollTtyOutput = NULL; static const char *rs_scrollKeypress = NULL; #ifdef TRANSPARENT static const char *rs_transparent = NULL; static const char *rs_transparent_sb = NULL; #endif #if defined (HOTKEY_CTRL) || defined (HOTKEY_META) static const char *rs_bigfont_key = NULL; static const char *rs_smallfont_key = NULL; #endif #ifndef NO_MAPALERT # ifdef MAPALERT_OPTION static const char *rs_mapAlert = NULL; # endif #endif static const char *rs_visualBell = NULL; static const char *rs_reverseVideo = NULL; #ifdef META8_OPTION static const char *rs_meta8 = NULL; #endif #ifdef MULTICHAR_SET static const char *rs_multichar_encoding = NULL; #endif #ifdef GREEK_SUPPORT static const char *rs_greek_keyboard = NULL; #endif /*}}} */ /*{{{ monolithic option/resource structure: */ /* * `string' options MUST have a usage argument * `switch' and `boolean' options have no argument * * if there's no desc(ription), it won't appear in usage() */ static const struct { unsigned long flag; const char **dp; /* data pointer */ const char *const kw; /* keyword */ const char *const opt; /* option */ const char *const arg; /* argument */ const char *const desc; /* description */ } optList[] = { /* * INFO() - descriptive information only * STRG() - command-line option, with/without resource * RSTRG() - resource/long-option * BOOL() - regular boolean `-/+' flag * SWCH() - `-' flag */ #define INFO(opt, arg, desc) \ {0, NULL, NULL, opt, arg, desc} #define STRG(p, kw, opt, arg, desc) \ {0, &p, kw, opt, arg, desc} #define RSTRG(p, kw, arg) \ {0, &p, kw, NULL, arg, NULL} #define BOOL(p, kw, opt, flag, desc) \ {(Opt_Boolean|flag), &p, kw, opt, NULL, desc} #define SWCH(opt, flag, desc) \ {(flag), NULL, NULL, opt, NULL, desc} /* convenient macros */ #define optList_strlen(i) \ (optList[i].flag ? 0 : (optList[i].arg ? strlen (optList[i].arg) : 1)) #define optList_isBool(i) \ (optList[i].flag & Opt_Boolean) #define optList_isReverse(i) \ (optList[i].flag & Opt_Reverse) #define optList_size() \ (sizeof(optList) / sizeof(optList[0])) STRG(display_name, NULL, "display", "string", "X server to contact"), STRG(rs_term_name, "termName", "tn", "string", "value of the TERM environment variable"), STRG(rs_geometry, "geometry", "geometry", "geometry", "size (in characters) and position"), STRG(display_name, NULL, "d", NULL, NULL), /* short form */ STRG(rs_geometry, NULL, "g", NULL, NULL), /* short form */ BOOL(rs_reverseVideo, "reverseVideo", "rv", Opt_reverseVideo, "reverse video"), #ifdef _MYSTYLE_ STRG(rs_mystyle, "MyStyle", "mst", "name", "MyStyle"), #endif STRG(rs_color[Color_bg], "background", "bg", "color", "background color"), STRG(rs_color[Color_fg], "foreground", "fg", "color", "foreground color"), /* colors: command-line long-option = resource name */ RSTRG(rs_color[minCOLOR + 0], "color0", "color"), RSTRG(rs_color[minCOLOR + 1], "color1", "color"), RSTRG(rs_color[minCOLOR + 2], "color2", "color"), RSTRG(rs_color[minCOLOR + 3], "color3", "color"), RSTRG(rs_color[minCOLOR + 4], "color4", "color"), RSTRG(rs_color[minCOLOR + 5], "color5", "color"), RSTRG(rs_color[minCOLOR + 6], "color6", "color"), RSTRG(rs_color[minCOLOR + 7], "color7", "color"), #ifndef NO_BRIGHTCOLOR RSTRG(rs_color[minBrightCOLOR + 0], "color8", "color"), RSTRG(rs_color[minBrightCOLOR + 1], "color9", "color"), RSTRG(rs_color[minBrightCOLOR + 2], "color10", "color"), RSTRG(rs_color[minBrightCOLOR + 3], "color11", "color"), RSTRG(rs_color[minBrightCOLOR + 4], "color12", "color"), RSTRG(rs_color[minBrightCOLOR + 5], "color13", "color"), RSTRG(rs_color[minBrightCOLOR + 6], "color14", "color"), RSTRG(rs_color[minBrightCOLOR + 7], "color15", "color"), #endif /* NO_BRIGHTCOLOR */ #ifndef NO_BOLDUNDERLINE RSTRG(rs_color[Color_BD], "colorBD", "color"), RSTRG(rs_color[Color_UL], "colorUL", "color"), #endif /* NO_BOLDUNDERLINE */ #ifdef KEEP_SCROLLCOLOR RSTRG(rs_color[Color_scroll], "scrollColor", "color"), RSTRG(rs_color[Color_trough], "troughColor", "color"), #endif /* KEEP_SCROLLCOLOR */ #if defined (BACKGROUND_IMAGE) || (MENUBAR_MAX) RSTRG(rs_path, "path", "search path"), #endif /* defined (BACKGROUND_IMAGE) || (MENUBAR_MAX) */ #ifdef BACKGROUND_IMAGE STRG(rs_backgroundPixmap, "backgroundPixmap", "pixmap", "file[;geom]", "background pixmap"), #endif /* BACKGROUND_IMAGE */ #if defined(BACKGROUND_IMAGE) || defined(TRANSPARENT) STRG(rs_backgroundType, "backgroundType", "bgtype", BGT_ALL, "type of the background pixmap transformation"), STRG(rs_tintType, "tintingType", "tinttype", TINT_TYPE_ALL, "defines function to be used for background tinting"), STRG(rs_shade, "shading", "sh", "%", "make transparent background x% darker"), STRG(rs_color[Color_tint], "tinting", "tint", "color", "tinted transparency color"), #endif STRG(rs_textType, "textType", "txttype", GC_TYPE_ALL, "defines function to be used for text drawing"), #ifdef OFF_FOCUS_FADING STRG(rs_fade, "fading", "fade", "%", "make colors x% darker when aterm is loosing focus."), #endif #ifdef BOOL #ifdef TRANSPARENT BOOL(rs_transparent, "transparent", "tr", Opt_transparent, "transparent background"), BOOL(rs_transparent_sb, "transpscrollbar", "trsb", Opt_transparent_sb, "transparent scrollbar"), #endif #endif #if (MENUBAR_MAX) RSTRG(rs_menu, "menu", "name[;tag]"), #endif #ifndef NO_BOLDFONT STRG(rs_boldFont, "boldFont", "fb", "fontname", "bold text font"), #endif STRG(rs_font[0], "font", "fn", "fontname", "normal text font"), /* fonts: command-line option = resource name */ #if NFONTS > 1 RSTRG(rs_font[1], "font1", "fontname"), #endif #if NFONTS > 2 RSTRG(rs_font[2], "font2", "fontname"), #endif #if NFONTS > 3 RSTRG(rs_font[3], "font3", "fontname"), #endif #if NFONTS > 4 RSTRG(rs_font[4], "font4", "fontname"), #endif #if NFONTS > 5 RSTRG(rs_font[5], "font5", "fontname"), #endif #if NFONTS > 6 RSTRG(rs_font[6], "font6", "fontname"), #endif #if NFONTS > 7 RSTRG(rs_font[7], "font7", "fontname"), #endif #ifdef MULTICHAR_SET STRG(rs_mfont[0], "mfont", "fm", "fontname", "multichar font"), /* fonts: command-line option = resource name */ # if NFONTS > 1 RSTRG(rs_mfont[1], "mfont1", "fontname"), # endif # if NFONTS > 2 RSTRG(rs_mfont[2], "mfont2", "fontname"), # endif # if NFONTS > 3 RSTRG(rs_mfont[3], "mfont3", "fontname"), # endif # if NFONTS > 4 RSTRG(rs_mfont[4], "mfont4", "fontname"), # endif # if NFONTS > 5 RSTRG(rs_mfont[5], "mfont5", "fontname"), # endif # if NFONTS > 6 RSTRG(rs_mfont[6], "mfont6", "fontname"), # endif # if NFONTS > 7 RSTRG(rs_mfont[7], "mfont7", "fontname"), # endif #endif /* MULTICHAR_SET */ #ifdef MULTICHAR_SET STRG(rs_multichar_encoding, "multichar_encoding", "km", "mode", "multiple-character font encoding; mode = eucj | sjis | big5"), #endif /* MULTICHAR_SET */ #ifdef USE_XIM STRG(rs_preeditType, "preeditType", "pt", "style", "input style of input method; style = OverTheSpot | OffTheSpot | Root"), STRG(rs_inputMethod, "inputMethod", "im", "name", "name of input method"), #endif /* USE_XIM */ #ifdef GREEK_SUPPORT STRG(rs_greek_keyboard, "greek_keyboard", "grk", "mode", "greek keyboard mapping; mode = iso | ibm"), #endif SWCH("iconic", Opt_iconic, "start iconic"), SWCH("ic", Opt_iconic, NULL), /* short form */ STRG(rs_name, NULL, "name", "string", "client instance, icon, and title strings"), STRG(rs_title, "title", "title", "string", "title name for window"), STRG(rs_title, NULL, "T", NULL, NULL), /* short form */ STRG(rs_iconName, "iconName", "n", "string", "icon name for window"), #ifndef NO_CURSORCOLOR STRG(rs_color[Color_cursor], "cursorColor", "cr", "color", "cursor color"), /* command-line option = resource name */ RSTRG(rs_color[Color_cursor2], "cursorColor2", "color"), #endif /* NO_CURSORCOLOR */ STRG(rs_color[Color_pointer], "pointerColor", "pr", "color", "pointer color"), STRG(rs_borderWidth, "borderWidth", "bw", "number", "width of border"), STRG(rs_internal_border, "internalBorder", "ib", "number", "width of the internal border"), STRG(rs_color[Color_border], "borderColor", "bd", "color", "border color"), BOOL(rs_borderLess, "borderLess", "bl", Opt_borderLess, "no decoration"), BOOL(rs_loginShell, "loginShell", "ls", Opt_loginShell, "login shell"), BOOL(rs_scrollBar, "scrollBar", "sb", Opt_scrollBar, "scrollbar"), BOOL(rs_scrollBar_right, "scrollBar_right", "sr", Opt_scrollBar_right, "scrollbar right"), BOOL(rs_scrollBar_floating, "scrollBar_floating", "st", Opt_scrollBar_floating, "scrollbar without a trough"), BOOL(rs_scrollTtyOutput, "scrollTtyOutput", NULL, Opt_scrollTtyOutput, NULL), BOOL(rs_scrollTtyOutput, NULL, "si", Opt_Reverse | Opt_scrollTtyOutput, "scroll-on-tty-output inhibit"), BOOL(rs_scrollKeypress, "scrollKey", "sk", Opt_scrollKeypress, "scroll-on-keypress"), STRG(rs_minBufferWidth, "minBufferWidth", "mbw", "number", "minimum number of columns stored in buffer"), STRG(rs_saveLines, "saveLines", "sl", "number", "number of scrolled lines to save"), #ifdef USE_LINESPACE STRG(rs_lineSpace, "lineSpace", "lsp", "number", "line space"), #endif BOOL(rs_utmpInhibit, "utmpInhibit", "ut", Opt_utmpInhibit, "utmp inhibit"), BOOL(rs_visualBell, "visualBell", "vb", Opt_visualBell, "visual bell"), #ifndef NO_MAPALERT # ifdef MAPALERT_OPTION BOOL(rs_mapAlert, "mapAlert", NULL, Opt_mapAlert, NULL), # endif #endif #ifdef META8_OPTION BOOL(rs_meta8, "meta8", NULL, Opt_meta8, NULL), RSTRG(rs_modifier, "modifier", "string"), #endif #ifndef NO_BACKSPACE_KEY RSTRG(rs_backspace_key, "backspacekey", "string"), #endif #ifndef NO_DELETE_KEY RSTRG(rs_delete_key, "deletekey", "string"), #endif #ifdef PRINTPIPE RSTRG(rs_print_pipe, "print-pipe", "string"), #endif #if defined (HOTKEY_CTRL) || defined (HOTKEY_META) RSTRG(rs_bigfont_key, "bigfont_key", "keysym"), RSTRG(rs_smallfont_key, "smallfont_key", "keysym"), #endif #ifdef CUTCHAR_RESOURCE RSTRG(rs_cutchars, "cutchars", "string"), #endif /* CUTCHAR_RESOURCE */ SWCH("C", Opt_console, "intercept console messages"), INFO("e", "command arg ...", "command to execute") }; #undef INFO #undef STRG #undef RSTRG #undef SWCH #undef BOOL /*}}} */ /*{{{ list_options: */ /*----------------------------------------------------------------------*/ /* PROTO */ void list_options() { #define INDENT 30 fprintf(stderr, "("); #ifdef BACKGROUND_IMAGE fprintf(stderr, "background image,"); #endif #ifdef XPM fprintf(stderr, "XPM,"); #endif #ifdef USE_LIBASIMAGE #ifdef JPEG fprintf(stderr, "JPEG,"); #endif #ifdef PNG fprintf(stderr, "PNG,"); #endif fprintf(stderr, "AfterStep integration,"); #ifdef _MYSTYLE_ fprintf(stderr, "AfterStep MyStyles,"); #else fprintf(stderr, "no AfterStep MyStyles,"); #endif #endif #ifdef UTMP_SUPPORT fprintf(stderr, "utmp,"); #endif #ifdef MENUBAR fprintf(stderr, "menubar,"); #endif #ifdef KANJI fprintf(stderr, "Kanji,"); #endif #ifdef ZH fprintf(stderr, "Chinese,"); #endif #ifdef THAI fprintf(stderr, "Thai,"); #endif #ifdef XTERM_SCROLLBAR fprintf(stderr, "XTerm-scrollbar,"); #endif #ifdef GREEK_SUPPORT fprintf(stderr, "Greek,"); #endif #ifdef NO_BACKSPACE_KEY fprintf(stderr, "no backspace,"); #endif #ifdef NO_DELETE_KEY fprintf(stderr, "no delete,"); #endif #ifdef TRANSPARENT fprintf(stderr, "transparency,"); #else fprintf(stderr, "no transparency,"); # endif #ifdef OFF_FOCUS_FADING fprintf(stderr, "fading,"); #else fprintf(stderr, "no fading,"); # endif #ifdef NEXT_SCROLLBAR fprintf(stderr, "NeXT scrollbar,"); # endif #ifdef NO_RESOURCES fprintf(stderr, "NoResources"); #else # ifdef USE_XGETDEFAULT fprintf(stderr, "XGetDefaults"); # else fprintf(stderr, ".Xdefaults"); # endif #endif fprintf(stderr, ")" ); } /*}}} */ /*{{{ usage: */ /*----------------------------------------------------------------------*/ /* PROTO */ void version(int type) { switch (type) { case 0: /* brief listing */ fprintf(stderr, "%s version %s\n", APL_NAME,VERSION); break ; case 1: /* full command-line listing */ fprintf(stderr, "%s version %s from %s\n", APL_NAME,VERSION, DATE); list_options(); fprintf(stderr, "\n"); break ; case 2: /* full resource listing */ fprintf(stderr, "%s\n", VERSION); break ; } exit(EXIT_FAILURE); } /*}}} */ /*{{{ usage: */ /*----------------------------------------------------------------------*/ /* PROTO */ void usage(int type) { int i, col; fprintf(stderr, "\nUsage v%s :", VERSION); list_options(); fprintf(stderr, "\n%s", APL_NAME); switch (type) { case 0: /* brief listing */ fprintf(stderr, " [-help][-V]\n"); col = 3; for (i = 0; i < optList_size(); i++) { if (optList[i].desc != NULL) { int len = 2; if (!optList_isBool(i)) { len = optList_strlen(i); if (len > 0) len++; /* account for space */ } len += 4 + strlen(optList[i].opt); col += len; if (col > 79) { /* assume regular width */ fprintf(stderr, "\n"); col = 3 + len; } fprintf(stderr, " [-"); if (optList_isBool(i)) fprintf(stderr, "/+"); fprintf(stderr, "%s", optList[i].opt); if (optList_strlen(i)) fprintf(stderr, " %s]", optList[i].arg); else fprintf(stderr, "]"); } } fprintf(stderr, "\n\n"); break; case 1: /* full command-line listing */ fprintf(stderr, " [options] [-e command args]\n\n" "where options include:\n"); for (i = 0; i < optList_size(); i++) if (optList[i].desc != NULL) fprintf(stderr, " %s%s %-*s%s%s\n", (optList_isBool(i) ? "-/+" : "-"), optList[i].opt, (INDENT - strlen(optList[i].opt) + (optList_isBool(i) ? 0 : 2)), (optList[i].arg ? optList[i].arg : ""), (optList_isBool(i) ? "turn on/off " : ""), optList[i].desc); fprintf(stderr, "\n --help to list long-options\n --version for the version information\n\n"); break; case 2: /* full resource listing */ fprintf(stderr, " [options] [-e command args]\n\n" "where resources (long-options) include:\n"); for (i = 0; i < optList_size(); i++) if (optList[i].kw != NULL) fprintf(stderr, " %s: %*s\n", optList[i].kw, (INDENT - strlen(optList[i].kw)), (optList_isBool(i) ? "boolean" : optList[i].arg)); #ifdef KEYSYM_RESOURCE fprintf(stderr, " " "keysym.sym" ": %*s\n", (INDENT - strlen("keysym.sym")), "keysym"); #endif fprintf(stderr, "\n -help to list options\n -version for the version information with options list\n\n"); break; } exit(EXIT_FAILURE); } /*}}} */ /*{{{ get command-line options before getting resources */ /* PROTO */ void get_options(int argc, char *argv[]) { int i, bad_option = 0; static const char *const On = "ON"; static const char *const Off = "OFF"; for (i = 1; i < argc; i++) { int entry, longopt = 0; const char *flag; char *opt = argv[i]; #ifdef DEBUG_RESOURCES fprintf(stderr, "argv[%d] = %s: ", i, argv[i]); #endif if (*opt == '-') { flag = On; if (*++opt == '-') longopt = *opt++; /* long option */ } else if (*opt == '+') { flag = Off; if (*++opt == '+') longopt = *opt++; /* long option */ } else { bad_option = 1; print_error("bad option \"%s\"", opt); continue; } if (!strcmp(opt, "help")) usage(longopt ? 2 : 1); if (!strcmp(opt, "h")) usage(0); if (!strcmp(opt, "version")) version(longopt ? 2 : 1); if (!strcmp(opt, "V")) version(0); /* feature: always try to match long-options */ for (entry = 0; entry < optList_size(); entry++) if ((optList[entry].kw && !strcmp(opt, optList[entry].kw)) || (!longopt && optList[entry].opt && !strcmp(opt, optList[entry].opt))) break; if (entry < optList_size()) { if (optList_isReverse(entry)) flag = flag == On ? Off : On; if (optList_strlen(entry)) { /* string value */ char *str = argv[++i]; #ifdef DEBUG_RESOURCES fprintf(stderr, "string (%s,%s) = ", optList[entry].opt ? optList[entry].opt : "nil", optList[entry].kw ? optList[entry].kw : "nil"); #endif if (flag == On && str && optList[entry].dp) { #ifdef DEBUG_RESOURCES fprintf(stderr, "\"%s\"\n", str); #endif *(optList[entry].dp) = str; /* special cases are handled in main.c:main() to allow * X resources to set these values before we settle for * default values */ } #ifdef DEBUG_RESOURCES else fprintf(stderr, "???\n"); #endif } else { /* boolean value */ #ifdef DEBUG_RESOURCES fprintf(stderr, "boolean (%s,%s) = %s\n", optList[entry].opt, optList[entry].kw, flag); #endif if (flag == On) Options |= (optList[entry].flag); else Options &= ~(optList[entry].flag); if (optList[entry].dp) *(optList[entry].dp) = flag; } } else #ifdef KEYSYM_RESOURCE /* if (!strncmp (opt, "keysym.", strlen ("keysym."))) */ if (Str_match(opt, "keysym.")) { char *str = argv[++i]; /* * '7' is strlen("keysym.") */ if (str != NULL) parse_keysym(opt + 7, str); } else #endif { /* various old-style options, just ignore * Obsolete since about Jan 96, * so they can probably eventually be removed */ const char *msg = "bad"; if (longopt) { opt--; bad_option = 1; } else if (!strcmp(opt, "7") || !strcmp(opt, "8") #ifdef GREEK_SUPPORT /* obsolete 12 May 1996 (v2.17) */ || !Str_match(opt, "grk") #endif ) msg = "obsolete"; else bad_option = 1; print_error("%s option \"%s\"", msg, --opt); } } if (bad_option) usage(0); } /*}}} */ #ifndef NO_RESOURCES /*----------------------------------------------------------------------*/ /*{{{ string functions */ /* * a replacement for strcasecmp() to avoid linking an entire library */ /* PROTO */ int my_strcasecmp(const char *s1, const char *s2) { for ( /*nil */ ; (*s1 && *s2); s1++, s2++) { register int c1 = toupper(*s1); register int c2 = toupper(*s2); if (c1 != c2) return (c1 - c2); } return (int)(*s1 - *s2); } /*}}} */ # ifdef KEYSYM_RESOURCE /* * Define key from XrmEnumerateDatabase. * quarks will be something like * "rxvt" "keysym" "0xFF01" * value will be a string */ /* ARGSUSED */ /* PROTO */ Bool define_key(XrmDatabase * database, XrmBindingList bindings, XrmQuarkList quarks, XrmRepresentation * type, XrmValue * value, XPointer closure) { int last; for (last = 0; quarks[last] != NULLQUARK; last++) /* look for last quark in list */ ; last--; parse_keysym(XrmQuarkToString(quarks[last]), (char *)value->addr); return False; } /* * look for something like this (XK_Delete) * rxvt*keysym.0xFFFF: "\177" * * arg will be * NULL for ~/.Xdefaults and * non-NULL for command-line options (need to allocate) */ /* PROTO */ int parse_keysym(char *str, char *arg) { char *key_string; int n, sym; if (arg == NULL) { if ((n = Str_match(str, "keysym.")) == 0) return 0; str += n; /* skip `keysym.' */ } /* some scanf() have trouble with a 0x prefix */ if (isdigit(str[0])) { if (str[0] == '0' && toupper(str[1]) == 'X') str += 2; if (arg) { if (sscanf(str, (strchr(str, ':') ? "%x:" : "%x"), &sym) != 1) return -1; } else { if (sscanf(str, "%x:", &sym) != 1) return -1; /* cue to ':', it's there since sscanf() worked */ str = strchr(str, ':'); str++; arg = Str_trim(str); if (arg == NULL) return -1; } } else { /* * convert keysym name to keysym number */ if (arg == NULL) { arg = str; arg = strchr(str, ':'); if (arg == NULL) return -1; *arg++ = '\0'; arg = Str_trim(arg); if (arg == NULL) return -1; } sym = XStringToKeysym(str); if (sym == None) return -1; } if (sym < 0xFF00 || sym > 0xFFFF) /* we only do extended keys */ return -1; sym -= 0xFF00; if (KeySym_map[sym] != NULL) /* already set ? */ return -1; if ((n = strlen(arg)) == 0) return -1; key_string = MALLOC((n + 2) * sizeof(char)); STRCPY(key_string + 1, arg); n = Str_escaped(key_string + 1); if (n) { key_string[0] = min(n, 255); KeySym_map[sym] = (unsigned char *) key_string; } else { FREE(key_string); return -1; } return 1; } # endif /* KEYSYM_RESOURCE */ # ifndef USE_XGETDEFAULT /*{{{ get_xdefaults() */ /* * the matching algorithm used for memory-save fake resources */ /* PROTO */ void get_xdefaults(FILE * stream, const char *name) { unsigned int len; char *str, buffer[256]; if (stream == NULL) return; len = strlen(name); while ((str = fgets(buffer, sizeof(buffer), stream)) != NULL) { unsigned int entry, n; while (*str && isspace(*str)) str++; /* leading whitespace */ if ((str[len] != '*' && str[len] != '.') || (len && strncmp(str, name, len))) continue; str += (len + 1); /* skip `name*' or `name.' */ # ifdef KEYSYM_RESOURCE if (!parse_keysym(str, NULL)) # endif /* KEYSYM_RESOURCE */ for (entry = 0; entry < optList_size(); entry++) { const char *const kw = optList[entry].kw; if (kw == NULL) continue; n = strlen(kw); if (str[n] == ':' && Str_match(str, kw)) { /* skip `keyword:' */ str += (n + 1); str = Str_skip_space(str); str = Str_trim(str); n = (str ? strlen(str) : 0); if (n && *(optList[entry].dp) == NULL) { /* not already set */ int s; char *p = MALLOC((n + 1) * sizeof(char)); STRCPY(p, str); *(optList[entry].dp) = p; if (optList_isBool(entry)) { s = my_strcasecmp(p, "TRUE") == 0 || my_strcasecmp(p, "YES") == 0 || my_strcasecmp(p, "ON") == 0 || my_strcasecmp(p, "1") == 0; if (optList_isReverse(entry)) s = !s; if (s) Options |= (optList[entry].flag); else Options &= ~(optList[entry].flag); } } break; } } } rewind(stream); } /*}}} */ # endif /* ! USE_XGETDEFAULT */ #endif /* NO_RESOURCES */ /*{{{ read the resources files */ /* * using XGetDefault() or the hand-rolled replacement */ /* ARGSUSED */ /* PROTO */ void extract_resources(Display * display, const char *name) { #ifndef NO_RESOURCES # ifdef USE_XGETDEFAULT /* * get resources using the X library function */ int entry; # ifdef XrmEnumOneLevel XrmName name_prefix[3]; XrmClass class_prefix[3]; char *displayResource; XrmDatabase database; char *screenResource; XrmDatabase screenDatabase; /* * Get screen-specific resources (X11R5) and merge into common resources. */ database = NULL; screenDatabase = NULL; displayResource = XResourceManagerString(display); if (displayResource != NULL) database = XrmGetStringDatabase(displayResource); screenResource = XScreenResourceString(DefaultScreenOfDisplay(display)); if (screenResource != NULL) screenDatabase = XrmGetStringDatabase(screenResource); XrmMergeDatabases(screenDatabase, &database); XrmSetDatabase(display, database); # endif for (entry = 0; entry < optList_size(); entry++) { int s; char *p, *p0; const char *kw = optList[entry].kw; if (kw == NULL || *(optList[entry].dp) != NULL) continue; /* previously set */ #define STRCMP(x, y) strcmp((const char *)(x), (const char *)(y)) p = XGetDefault(display, name, kw); p0 = XGetDefault(display, "!INVALIDPROGRAMMENAMEDONTMATCH!", kw); if (p == NULL || (p0 && STRCMP(p, p0) == 0)) { p = XGetDefault(display, APL_SUBCLASS, kw); if (p == NULL || (p0 && STRCMP(p, p0) == 0)) p = XGetDefault(display, APL_CLASS, kw); } if (p == NULL && p0) p = p0; if (p) { *optList[entry].dp = p; if (optList_isBool(entry)) { s = my_strcasecmp(p, "TRUE") == 0 || my_strcasecmp(p, "YES") == 0 || my_strcasecmp(p, "ON") == 0 || my_strcasecmp(p, "1") == 0; if (optList_isReverse(entry)) s = !s; if (s) Options |= (optList[entry].flag); else Options &= ~(optList[entry].flag); } } } /* * [R5 or later]: enumerate the resource database */ # ifdef XrmEnumOneLevel # ifdef KEYSYM_RESOURCE name_prefix[0] = XrmStringToName(name); name_prefix[1] = XrmStringToName("keysym"); name_prefix[2] = NULLQUARK; class_prefix[0] = XrmStringToName(APL_SUBCLASS); class_prefix[1] = XrmStringToName("Keysym"); class_prefix[2] = NULLQUARK; XrmEnumerateDatabase(XrmGetDatabase(display), name_prefix, class_prefix, XrmEnumOneLevel, define_key, NULL); name_prefix[0] = XrmStringToName(APL_CLASS); name_prefix[1] = XrmStringToName("keysym"); class_prefix[0] = XrmStringToName(APL_CLASS); class_prefix[1] = XrmStringToName("Keysym"); XrmEnumerateDatabase(XrmGetDatabase(display), name_prefix, class_prefix, XrmEnumOneLevel, define_key, NULL); # endif # endif # else /* USE_XGETDEFAULT */ /* get resources the hard way, but save lots of memory */ const char *fname[] = { ".Xdefaults", ".Xresources" }; FILE *fd = NULL; char *home; if ((home = getenv("HOME")) != NULL) { int i, len = strlen(home) + 2; char *f = NULL; for (i = 0; i < (sizeof(fname) / sizeof(fname[0])); i++) { f = REALLOC(f, (len + strlen(fname[i])) * sizeof(char)); sprintf(f, "%s/%s", home, fname[i]); if ((fd = fopen(f, "r")) != NULL) break; } FREE(f); } /* * The normal order to match resources is the following: * @ global resources (partial match, ~/.Xdefaults) * @ application file resources (XAPPLOADDIR/Rxvt) * @ class resources (~/.Xdefaults) * @ private resources (~/.Xdefaults) * * However, for the hand-rolled resources, the matching algorithm * checks if a resource string value has already been allocated * and won't overwrite it with (in this case) a less specific * resource value. * * This avoids multiple allocation. Also, when we've called this * routine command-line string options have already been applied so we * needn't to allocate for those resources. * * So, search in resources from most to least specific. * * Also, use a special sub-class so that we can use either or both of * "XTerm" and "Rxvt" as class names. */ get_xdefaults(fd, name); get_xdefaults(fd, APL_SUBCLASS); # ifdef XAPPLOADDIR { FILE *ad = fopen(XAPPLOADDIR "/" APL_SUBCLASS, "r"); if (ad != NULL) { get_xdefaults(ad, ""); fclose(ad); } } # endif /* XAPPLOADDIR */ get_xdefaults(fd, APL_CLASS); get_xdefaults(fd, ""); /* partial match */ if (fd != NULL) fclose(fd); # endif /* USE_XGETDEFAULT */ #endif /* NO_RESOURCES */ /* * even without resources, at least do this setup for command-line * options and command-line long options */ #ifdef MULTICHAR_SET set_multichar_encoding(rs_multichar_encoding); #endif #ifdef GREEK_SUPPORT /* this could be a function in grkelot.c */ /* void set_greek_keyboard (const char * str); */ if (rs_greek_keyboard) { if (!strcmp(rs_greek_keyboard, "iso")) greek_setmode(GREEK_ELOT928); /* former -grk9 */ else if (!strcmp(rs_greek_keyboard, "ibm")) greek_setmode(GREEK_IBM437); /* former -grk4 */ } #endif /* GREEK_SUPPORT */ #define to_keysym(pks,str) do { KeySym sym;\ if (str && ((sym = XStringToKeysym(str)) != 0)) *pks = sym; } while (0) #if defined (HOTKEY_CTRL) || defined (HOTKEY_META) to_keysym(&ks_bigfont, rs_bigfont_key); to_keysym(&ks_smallfont, rs_smallfont_key); #endif #undef to_keysym } /*}}} */ /*----------------------- end-of-file (C source) -----------------------*/ aterm-1.0.1/src/feature.h0000644000175000001440000002317210345342634013717 0ustar vaeusers/* * File: feature.h * $Id: feature.h,v 1.3 2005/12/06 17:08:44 sasha Exp $ * * Compile-time configuration. *----------------------------------------------------------------------- * Copyright (C) 1997,1998 Oezguer Kesim * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * *----------------------------------------------------------------------*/ #ifndef _FEATURE_H #define _FEATURE_H /*-----------------------SCREEN OPTIONS AND COLOURS---------------------*/ /* * Define the name of the environment variable to be used in * addition to the "PATH" environment and the `path' resource. * Usually it should point to where you keep your background pixmaps and/or * your menu files * ATERM_PATH_ENV (if defined) gets searched first */ #define ATERM_PATH_ENV "ATERMPATH" #define PATH_ENV "RXVTPATH" /* enable by default - only needs to be disabled on 8bpp displays to * conserve colors ! */ #define OFF_FOCUS_FADING 1 /* * Avoid enabling the colour cursor (-cr, cursorColor, cursorColor2) */ /* #define NO_CURSORCOLOR */ /* * Suppress use of BOLD and BLINK attributes for setting bright foreground * and background, respectively. Simulate BOLD using colorBD, boldFont or * overstrike characters. */ /* #define NO_BRIGHTCOLOR */ /* * Disable separate colours for bold/underline */ /* #define NO_BOLDUNDERLINE */ /* * Disable using simulated bold using overstrike. You can also turn off * overstrike just for multi char fonts * Note: NO_BOLDOVERSTRIKE implies NO_BOLDOVERSTRIKE_MULTI */ /* #define NO_BOLDOVERSTRIKE */ /* #define NO_BOLDOVERSTRIKE_MULTI */ /* * Also use bold font or overstrike even if we use colour for bold */ #define VERYBOLD /* * Compile without support for real bold fonts */ /* #define NO_BOLDFONT */ /* * Limit the number of screenfulls between screen refreshes during hard & fast * scrolling [default: 1] */ /* #define REFRESH_PERIOD 1 */ /* * If the screen has 24 bit mode, use that even if the default is 8 bit. */ #define PREFER_24BIT /* * Printer pipe which will be used for emulation of attached vt100 printer */ /* #define PRINTPIPE "lpr" */ /*------------------------------RESOURCES-------------------------------*/ /* * Define where to find installed application defaults for rxvt * Only if USE_XGETDEFAULT is not defined. */ #ifndef XAPPLOADDIR /* #define XAPPLOADDIR "/usr/lib/X11/app-defaults" */ #endif /* * Add support for the Offix DND (Drag 'n' Drop) protocol */ /* #define OFFIX_DND */ /*---------------------------------KEYS---------------------------------*/ /* * Define defaults for backspace and delete keys - unless they have been * configured out with --disable-backspace-key / --disable-delete-key */ /* #define DEFAULT_BACKSPACE "DEC" */ /* SPECIAL */ /* #define DEFAULT_BACKSPACE "\177" */ /* #define DEFAULT_DELETE "\033[3~" */ /* * Choose one of these values to be the `hotkey' for changing font. * This has been superceded and is only for you older users */ /* #define HOTKEY_CTRL */ /* #define HOTKEY_META */ /* * To use * Home = "\E[1~", End = "\E[4~" * instead of * Home = "\E[7~", End = "\E[8~" [default] */ /* #define LINUX_KEYS */ /* * Enable the keysym resource which allows you to define strings associated * with various KeySyms (0xFF00 - 0xFFFF). * Only works with the default hand-rolled resources. */ #ifndef NO_RESOURCES # define KEYSYM_RESOURCE #endif /* * Allow unshifted Next/Prior keys to scroll forward/back * (in addition to shift+Next/shift+Prior) --pjh */ /* #define UNSHIFTED_SCROLLKEYS */ /*--------------------------------MOUSE---------------------------------*/ /* * Disable sending escape sequences (up, down, page up/down) * from the scrollbar when XTerm mouse reporting is enabled */ /* #define NO_SCROLLBAR_REPORT */ #ifdef NEXT_SCROLLBAR #undef SB_WIDTH /* could be anything from 13 to 19 but the true NeXT is 17 */ #define SB_WIDTH 17 /* this will define somemore parameters for shaping NeXTish scrollbars */ /* NEXT_SCROLL_CLEAN if defined removes shades of gray from buttons */ #undef NEXT_SCROLL_CLEAN #define NEXT_SCROLL_SQUARE_ARROWS #define SB_BORDER_WIDTH 1 /* this makes buttons thinner then scrollbar's base ( if more then 0 ) */ #define SIDE_STEP_WIDTH 0 /* end NeXT scrollbar specific fetures */ #else #ifdef XTERM_SCROLLBAR #undef SB_WIDTH #define SB_WIDTH 15 #else #if !defined (SB_WIDTH) || (SB_WIDTH < 8) #undef SB_WIDTH #define SB_WIDTH 11 /* scrollBar width */ #endif #endif /* XTERM_SCROLLBAR */ #endif /* * Default separating chars for multiple-click selection * Space and tab are separate separating characters and are not settable */ #define CUTCHARS "\"&'()*,;<=>?@[\\]^`{|}~" /* * Add run-time support for changing the cutchars for double click selection */ #define CUTCHAR_RESOURCE /* * Have mouse reporting include double-click info for button1 */ /* #define MOUSE_REPORT_DOUBLECLICK */ /* * Set delay between multiple click events [default: 500] */ /* #define MULTICLICK_TIME 500 */ /* * Set delay periods for continuous scrolling with scrollbar buttons */ /* #define SCROLLBAR_INITIAL_DELAY 40 */ /* #define SCROLLBAR_CONTINUOUS_DELAY 2 */ /*--------------------------------BELL----------------------------------*/ /* * Disable automatic de-iconify when a bell is received */ /* #define NO_MAPALERT */ /* * Have mapAlert behaviour selectable with mapAlert resource */ #define MAPALERT_OPTION /*-----------------------------SCROLL BAR-------------------------------*/ /* * Choose the scrollbar width - should be an even number [default: 10] * Except for XTERM_SCROLLBAR: it is *always* 15 * and for NEXT_SCROLLBAR, which is *always* 19 */ /* #define SB_WIDTH 10 */ /* * When using Rxvt scrollbar, clicking above or below the slider will move * 1/4 of the screen height, if possible. Setting RXVT_SCROLL_FULL will move * it one screen height less one line, if possible */ #define RXVT_SCROLL_FULL 1 /* * (Hops) draw an internal border line on inside edge of the scrollbar */ /* #define SB_BORDER */ /* * (Hops) Uncomment to revert to original funky behaviour of * of having scroll thumb align on thumb top rather than ptr * position in thumb (or center of thumb). * Default Behavior becomes alignment to where grab thumb. * Only for non XTERM scrollbar */ /* #define FUNKY_SCROLL_BEHAVIOUR */ /*------------------------------MENU BAR--------------------------------*/ /* * Choose how many of (experimental) menuBars you want to be able to stack at * one time. * A value of 1 disables menuBar stacking. * A value of 0 disables menuBar all together. * Note that the amount of memory overhead is the same for any value >= 2. */ #define MENUBAR_MAX 8 /* * Change the default shadow style */ /* #define MENUBAR_SHADOW_IN */ /* * Change the default shadow style */ #define MENU_SHADOW_IN /*---------------------------MULTILINGUAL-------------------------------*/ /* * Allow run-time selection of Meta (Alt) to set the 8th bit on */ #define META8_OPTION /*---------------------------DISPLAY OPTIONS----------------------------*/ /* * Have DISPLAY environment variable & "\E[7n" transmit display with IP number */ /* #define DISPLAY_IS_IP */ /* * Have "\E[7n" transmit the display name. * This has been cited as a potential security hole. */ /* #define ENABLE_DISPLAY_ANSWER */ /* * Change what ESC Z transmits instead of the default "\E[?1;2c" */ /* #define ESCZ_ANSWER "\033[?1;2C" */ /* * Check the current value of the window-time/icon-name and avoid * re-setting it to the same value -- avoids unnecessary window refreshes */ #define SMART_WINDOW_TITLE /* * Allow foreground/background colour to be changed with an * xterm escape sequence "\E]39;colour^G" -- still experimental */ #define XTERM_COLOR_CHANGE /* * Width of the term border */ #define BORDERWIDTH 1 /* Add a run-time option to disable pixmap tiling. */ #define DONT_TILE_PIXMAP_OPTION /* * Default number of lines in the scrollback buffer */ #define SAVELINES 512 /* * Default line space */ #define LINESPACE 0 /* (Hops) Set to choose a number of lines of context between pages * (rather than a proportion (1/5) of savedlines buffer) * when paging the savedlines with SHIFT-{Prior,Next} keys. */ #define PAGING_CONTEXT_LINES 1 /* */ /* * List of default fonts available * NFONTS is the number of fonts in the list * FONT0_IDX is the default font in the list (starting at 0) * Sizes between multi-char fonts sets (MFONT_LIST) and single-char font * sets (NFONT_LIST) have been matched up */ #ifdef KANJI # define NFONTS 5 # define FONT0_IDX 2 # define MFONT_LIST "k14", "jiskan16", "jiskan18", "jiskan24", "jiskan26" # define NFONT_LIST "7x14", "8x16", "9x18", "12x24", "13x26" #else # ifdef ZH # define NFONTS 5 # define FONT0_IDX 1 # define MFONT_LIST "taipei16", "taipeik20", "taipeik24", "taipeik20", \ "taipei16" # define NFONT_LIST "8x16", "10x20", "12x24", "10x20", "8x16" # else /* no Kanji or Big5 support */ # define NFONTS 5 # define FONT0_IDX 2 # undef MFONT_LIST # define NFONT_LIST "7x14", "6x10", "6x13", "8x13", "9x15" # endif #endif #endif aterm-1.0.1/src/empty.c0000644000175000001440000000177110144447046013416 0ustar vaeusers/*--------------------------------*-C-*---------------------------------* * File: utmp.c *----------------------------------------------------------------------* * Copyright 1997,1998 Sasha Vasko * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *----------------------------------------------------------------------*/ void nothing(){}; aterm-1.0.1/src/netdisp.c0000644000175000001440000001035210144447052013716 0ustar vaeusers/*--------------------------------*-C-*---------------------------------* * File: netdisp.c *----------------------------------------------------------------------* * Copyright (C) 1997,1998 Oezguer Kesim * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *----------------------------------------------------------------------*/ /*----------------------------------------------------------------------* * Originally written: * 1996 Chuck Blake * Modifications: * 1997 mj olesen *----------------------------------------------------------------------*/ /*----------------------------------------------------------------------* * support for resolving the actual IP number of the host for remote * DISPLAYs. When the display is local (i.e. :0), we add support for * sending the first non-loopback interface IP number as the DISPLAY * instead of just sending the incorrect ":0". This way telnet/rlogin * shells can actually get the correct information into DISPLAY for * xclients. *----------------------------------------------------------------------*/ #ifndef lint static const char rcsid[] = "$Id: netdisp.c,v 1.1.1.1 2004/11/10 17:21:46 sasha Exp $"; #endif #include "rxvt.h" /* NECESSARY */ /* compile an empty file if this option is disabled. */ #ifndef DISPLAY_IS_IP /* char * network_display (const char * display) { return display; } */ #endif #ifdef DISPLAY_IS_IP /* On Solaris link with -lsocket and -lnsl */ #include #include /* these next two are probably only on Sun (not Solaris) */ #ifdef HAVE_SYS_SOCKIO_H #include #endif #ifdef HAVE_SYS_BYTEORDER_H #include #endif #include #include #include #include /*}}} */ /* extern functions referenced */ /* extern variables referenced */ /* extern variables declared here */ /* local variables */ /* local functions referenced */ /*----------------------------------------------------------------------*/ /* return a pointer to a static buffer */ /* PROTO */ char * network_display(const char *display) { static char ipaddress[32] = ""; char buffer[1024], *rval = NULL; struct ifconf ifc; struct ifreq *ifr; int i, skfd; if (display[0] != ':' && strncmp(display, "unix:", 5)) return display; /* nothing to do */ ifc.ifc_len = sizeof(buffer); /* Get names of all ifaces */ ifc.ifc_buf = buffer; if ((skfd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) { perror("socket"); return NULL; } if (ioctl(skfd, SIOCGIFCONF, &ifc) < 0) { perror("SIOCGIFCONF"); close(skfd); return NULL; } for (i = 0, ifr = ifc.ifc_req; i < (ifc.ifc_len / sizeof(struct ifreq)); i++, ifr++) { struct ifreq ifr2; STRCPY(ifr2.ifr_name, ifr->ifr_name); if (ioctl(skfd, SIOCGIFADDR, &ifr2) >= 0) { unsigned long addr; struct sockaddr_in *p_addr; p_addr = (struct sockaddr_in *)&(ifr2.ifr_addr); addr = htonl((unsigned long)p_addr->sin_addr.s_addr); /* * not "0.0.0.0" or "127.0.0.1" - so format the address */ if (addr && addr != 0x7F000001) { char *colon = strchr(display, ':'); if (colon == NULL) colon = ":0.0"; sprintf(ipaddress, "%d.%d.%d.%d%s", (int)((addr >> 030) & 0xFF), (int)((addr >> 020) & 0xFF), (int)((addr >> 010) & 0xFF), (int)(addr & 0xFF), colon); rval = ipaddress; break; } } } close(skfd); return rval; } #endif /* DISPLAY_IS_IP */ /*----------------------- end-of-file (C source) -----------------------*/ aterm-1.0.1/src/screen.c0000644000175000001440000031475510412605347013546 0ustar vaeusers/*--------------------------------*-C-*--------------------------------------* * File: screen.c *---------------------------------------------------------------------------* * Copyright (C) 2001 (cursor color) Jordan DeLong * Copyright (C) 2000 Sasha Vasko * Copyright (C) 1997,1998 Geoff Wing * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------* * Originally written: * 1997,1998 Geoff Wing * - The routine names and calling structure was based upon * previous work by Robert Nation. Most things have gone * through major change. * * Michael Bruun Petersen" * - tinting fix *--------------------------------------------------------------------------*/ /* * We handle _all_ screen updates and selections */ /*#define DEBUG_SCREEN */ #ifndef lint static const char rcsid[] = "$Id: screen.c,v 1.14 2006/03/29 22:32:07 sasha Exp $"; #endif #define INTERN_SCREEN #define LIBAFTERSTEP_HEADER_INCLUDED /* Define to enforce 32 bit Atom type on 64 bit systems */ /* #define USE_ATOM32 */ #include "rxvt.h" /* NECESSARY */ #include #include /* get the typedef for CARD32 */ static screen_t screen; int colors_changed = 0 ; /* to indicate that foreground and background colors has changed*/ /* ------------------------------------------------------------------------- */ #ifdef MULTICHAR_SET short multi_byte; /* set ==> currently using 2 bytes per glyph */ short lost_multi; /* set ==> we only got half a glyph */ enum { SBYTE, WBYTE } chstat; # define RESET_CHSTAT \ if (chstat == WBYTE) \ chstat = SBYTE, lost_multi = 1 #else # define RESET_CHSTAT #endif typedef enum { EUCJ, SJIS, /* KANJI methods */ BIG5, CNS /* BIG5 methods: CNS not implemented */ } ENC_METHOD; #if defined(KANJI) || defined(ZH) ENC_METHOD encoding_method; #endif /* ------------------------------------------------------------------------- */ #define PROP_SIZE 4096 #define TABSIZE 8 /* default tab size */ #ifdef DEBUG_SCREEN # define D_SCREEN(x) fprintf x ; fputc('\n', stderr) #else # define D_SCREEN(x) #endif #ifdef DEBUG_SELECT # define D_SELECT(x) fprintf x ; fputc('\n', stderr) #else # define D_SELECT(x) #endif /* ------------------------------------------------------------------------- * * GENERAL SCREEN AND SELECTION UPDATE ROUTINES * * ------------------------------------------------------------------------- */ #define ZERO_SCROLLBACK \ if ((Options & Opt_scrollTtyOutput) == Opt_scrollTtyOutput) \ TermWin.view_start = 0 #define CHECK_SELECTION(x) \ if (selection.op) \ selection_check(x) #define CLEAR_SELECTION \ selection.beg.row = selection.beg.col \ = selection.end.row = selection.end.col = 0 #define CLEAR_ALL_SELECTION \ selection.beg.row = selection.beg.col \ = selection.mark.row = selection.mark.col \ = selection.end.row = selection.end.col = 0 #define ROW_AND_COL_IS_AFTER(A, B, C, D) \ (((A) > (C)) || (((A) == (C)) && ((B) > (D)))) #define ROW_AND_COL_IS_BEFORE(A, B, C, D) \ (((A) < (C)) || (((A) == (C)) && ((B) < (D)))) #define ROW_AND_COL_IN_ROW_AFTER(A, B, C, D) \ (((A) == (C)) && ((B) > (D))) #define ROW_AND_COL_IN_ROW_ON_OR_AFTER(A, B, C, D) \ (((A) == (C)) && ((B) >= (D))) #define ROW_AND_COL_IN_ROW_BEFORE(A, B, C, D) \ (((A) == (C)) && ((B) < (D))) #define ROW_AND_COL_IN_ROW_ON_OR_BEFORE(A, B, C, D) \ (((A) == (C)) && ((B) <= (D))) /* these must be row_col_t */ #define ROWCOL_IS_AFTER(X, Y) \ ROW_AND_COL_IS_AFTER((X).row, (X).col, (Y).row, (Y).col) #define ROWCOL_IS_BEFORE(X, Y) \ ROW_AND_COL_IS_BEFORE((X).row, (X).col, (Y).row, (Y).col) #define ROWCOL_IN_ROW_AFTER(X, Y) \ ROW_AND_COL_IN_ROW_AFTER((X).row, (X).col, (Y).row, (Y).col) #define ROWCOL_IN_ROW_BEFORE(X, Y) \ ROW_AND_COL_IN_ROW_BEFORE((X).row, (X).col, (Y).row, (Y).col) #define ROWCOL_IN_ROW_ON_OR_AFTER(X, Y) \ ROW_AND_COL_IN_ROW_ON_OR_AFTER((X).row, (X).col, (Y).row, (Y).col) #define ROWCOL_IN_ROW_ON_OR_BEFORE(X, Y) \ ROW_AND_COL_IN_ROW_ON_OR_BEFORE((X).row, (X).col, (Y).row, (Y).col) /* * CLEAR_ROWS : clear rows starting from row * CLEAR_CHARS: clear chars starting from pixel position * ERASE_ROWS : set rows starting from row to the foreground colour */ # define drawBuffer (TermWin.vt) void CLEAR_ROWS(unsigned row, unsigned num) { unsigned line_h = Height2Pixel(1)-1; register unsigned hy = (line_h+1)*num, y = Row2Pixel(row); if(!TermWin.bMapped) return ; if (y < TermWin_internalBorder+line_h) {y = 0; hy += TermWin_internalBorder;} if (y + hy > (TermWin.height+TermWin_internalBorder)-line_h) hy = (TermWin.height-y)+TermWin_internalBorders; XClearArea(Xdisplay, drawBuffer, 0, y, TermWin.width+TermWin_internalBorders, hy, 0); #if defined(BACKGROUND_IMAGE) || defined(TRANSPARENT) if (TermWin.tintGC) { XFillRectangle(Xdisplay, drawBuffer, TermWin.tintGC, 0, y, TermWin.width+TermWin_internalBorders, hy); } #endif } void CLEAR_CHARS(unsigned x, unsigned y, unsigned num) { unsigned char_w = Width2Pixel(1)-1, line_h = Height2Pixel(1)-1; register unsigned hx = (char_w+1)*num ,hy = line_h+1; if(!TermWin.bMapped) return ; if (x < TermWin_internalBorder+char_w) {x = 0; hx += TermWin_internalBorder;} if (y < TermWin_internalBorder+line_h) {y = 0; hy += TermWin_internalBorder ;} if (x + hx > (TermWin.width+TermWin_internalBorder) -char_w) hx = (TermWin.width+TermWin_internalBorders+1)-x; if (y + hy > (TermWin.height+TermWin_internalBorder) - line_h) hy = (TermWin.height+TermWin_internalBorders+1)-y; XClearArea(Xdisplay, drawBuffer, x, y, hx, hy, 0); #if defined(BACKGROUND_IMAGE) || defined(TRANSPARENT) if (TermWin.tintGC) { XFillRectangle(Xdisplay, drawBuffer, TermWin.tintGC, x, y, hx, hy); } #endif } #define ERASE_ROWS(row, num) \ XFillRectangle(Xdisplay, drawBuffer, TermWin.gc, \ Col2Pixel(0), Row2Pixel(row), \ TermWin.width, Height2Pixel(num)) /* ------------------------------------------------------------------------- * * SCREEN `COMMON' ROUTINES * * ------------------------------------------------------------------------- */ /* Fill part/all of a line with blanks. */ /* PROTO */ void blank_line(text_t * et, rend_t * er, int width, rend_t efs) { MEMSET(et, ' ', width); for (; width--;) *er++ = efs; } /* ------------------------------------------------------------------------- */ /* allocate memory for this screen line and blank it appropriately */ /* PROTO */ void make_screen_mem(text_t ** tp, rend_t ** rp, int row, rend_t rstyle) { tp[row] = MALLOC(sizeof(text_t) * TermWin.bcol); rp[row] = MALLOC(sizeof(rend_t) * TermWin.bcol); blank_line(tp[row], rp[row], TermWin.bcol, rstyle); } /* ------------------------------------------------------------------------- * * SCREEN INITIALISATION * * ------------------------------------------------------------------------- */ static int prev_nrow = -1, prev_bcol = -1; /* PROTO */ void scr_reset(void) { int i, j, k, total_rows, prev_total_rows; rend_t setrstyle; D_SCREEN((stderr, "scr_reset()")); TermWin.view_start = 0; RESET_CHSTAT; if (TermWin.bcol == prev_bcol && TermWin.nrow == prev_nrow) return; #if 0 #ifdef DEBUG_STRICT assert(TermWin.saveLines >= 0); #else /* drive with your eyes closed */ MAX_IT(TermWin.saveLines, 0); #endif #endif total_rows = TermWin.nrow + TermWin.saveLines; prev_total_rows = prev_nrow + TermWin.saveLines; screen.tscroll = 0; screen.bscroll = (TermWin.nrow - 1); /* *INDENT-OFF* */ if (prev_nrow == -1) { /* * A: first time called so just malloc everything : don't rely on realloc * Note: this is still needed so that all the scrollback lines are NULL */ screen.text = CALLOC(text_t * , total_rows ); screen.tlen = CALLOC(R_int16_t, total_rows ); buf_text = CALLOC(text_t * , total_rows ); buf_tlen = CALLOC(R_int16_t, total_rows ); drawn_text = CALLOC(text_t * , TermWin.nrow); swap.text = CALLOC(text_t * , TermWin.nrow); swap.tlen = CALLOC(R_int16_t, TermWin.nrow); screen.rend = CALLOC(rend_t *, total_rows ); buf_rend = CALLOC(rend_t *, total_rows ); drawn_rend = CALLOC(rend_t *, TermWin.nrow); swap.rend = CALLOC(rend_t *, TermWin.nrow); for (i = 0; i < TermWin.nrow; i++) { j = i + TermWin.saveLines; make_screen_mem(screen.text, screen.rend, j, DEFAULT_RSTYLE); make_screen_mem(swap.text, swap.rend, i, DEFAULT_RSTYLE); make_screen_mem(drawn_text, drawn_rend, i, DEFAULT_RSTYLE ); screen.tlen[j] = swap.tlen[i] = 0; } TermWin.nscrolled = 0; /* no saved lines */ screen.flags = swap.flags = Screen_DefaultFlags; save.cur.row = save.cur.col = 0; save.charset = 0; save.charset_char = 'B'; rstyle = save.rstyle = DEFAULT_RSTYLE; selection.text = NULL; selection.op = SELECTION_CLEAR; selection.screen = PRIMARY; selection.clicks = 0; CLEAR_ALL_SELECTION; MEMSET(charsets, 'B', sizeof(charsets)); current_screen = PRIMARY; rvideo = 0; #ifdef MULTICHAR_SET multi_byte = 0; lost_multi = 0; chstat = SBYTE; # ifdef KANJI encoding_method = EUCJ; # else encoding_method = BIG5; # endif #endif } else { /* * B1: add or delete rows as appropriate */ setrstyle = DEFAULT_RSTYLE | (rvideo ? RS_RVid : 0); if ((int)TermWin.nrow < prev_nrow) { /* delete rows */ k = min((int)TermWin.nscrolled, prev_nrow - (int)TermWin.nrow); scroll_text(0, prev_nrow - 1, k, 1); for (i = TermWin.nrow; i < prev_nrow; i++) { j = i + TermWin.saveLines; if (screen.text[j]) FREE(screen.text[j]); if (screen.rend[j]) FREE(screen.rend[j]); if (swap.text[i]) FREE(swap.text[i]); if (swap.rend[i]) FREE(swap.rend[i]); FREE(drawn_text[i]); FREE(drawn_rend[i]); } /* we have fewer rows so fix up number of scrolled lines */ MIN_IT(screen.cur.row, TermWin.nrow - 1); MIN_IT(swap.cur.row, TermWin.nrow - 1); } if(TermWin.nrow != prev_nrow) { screen.text = REALLOC(screen.text, total_rows *sizeof(text_t*)); screen.tlen = REALLOC(screen.tlen, total_rows *sizeof(R_int16_t)); buf_text = REALLOC(buf_text , total_rows *sizeof(text_t*)); buf_tlen = REALLOC(buf_tlen , total_rows *sizeof(R_int16_t)); drawn_text = REALLOC(drawn_text , TermWin.nrow*sizeof(text_t*)); swap.text = REALLOC(swap.text , TermWin.nrow*sizeof(text_t*)); swap.tlen = REALLOC(swap.tlen , total_rows *sizeof(R_int16_t)); screen.rend = REALLOC(screen.rend, total_rows *sizeof(rend_t*)); buf_rend = REALLOC(buf_rend , total_rows *sizeof(rend_t*)); drawn_rend = REALLOC(drawn_rend , TermWin.nrow*sizeof(rend_t*)); swap.rend = REALLOC(swap.rend , TermWin.nrow*sizeof(rend_t*)); } if ((int)TermWin.nrow > prev_nrow) { /* add rows */ k = min((int)TermWin.nscrolled, (int)TermWin.nrow - prev_nrow); for (i = prev_total_rows; i < total_rows - k; i++) { make_screen_mem(screen.text, screen.rend, i, setrstyle); screen.tlen[i] = 0; } for (i = total_rows - k; i < total_rows; i++) { screen.text[i] = NULL; screen.rend[i] = NULL; screen.tlen[i] = 0; } for (i = prev_nrow; i < TermWin.nrow; i++) { make_screen_mem(swap.text, swap.rend, i, setrstyle); make_screen_mem(drawn_text, drawn_rend, i, setrstyle ); swap.tlen[i] = 0; } if (k > 0) { scroll_text(0, TermWin.nrow - 1, -k, 1); screen.cur.row += k; TermWin.nscrolled -= k; for (i = TermWin.saveLines - TermWin.nscrolled; k--; i--) if (screen.text[i] == NULL) { make_screen_mem(screen.text, screen.rend, i, setrstyle); screen.tlen[i] = 0; } } #ifdef DEBUG_STRICT assert(screen.cur.row < TermWin.nrow); assert(swap.cur.row < TermWin.nrow); #else /* drive with your eyes closed */ MIN_IT(screen.cur.row, TermWin.nrow - 1); MIN_IT(swap.cur.row, TermWin.nrow - 1); #endif } /* B2: resize columns */ if (TermWin.bcol != prev_bcol) { for (i = 0; i < total_rows; i++) { if (screen.text[i]) { screen.text[i] = REALLOC(screen.text[i], TermWin.bcol * sizeof(text_t)); screen.rend[i] = REALLOC(screen.rend[i], TermWin.bcol * sizeof(rend_t)); MIN_IT(screen.tlen[i], TermWin.bcol); if (TermWin.bcol > prev_bcol) blank_line(&(screen.text[i][prev_bcol]), &(screen.rend[i][prev_bcol]), TermWin.bcol - prev_bcol, setrstyle); } } for (i = 0; i < TermWin.nrow; i++) { drawn_text[i] = REALLOC(drawn_text[i], TermWin.bcol * sizeof(text_t)); drawn_rend[i] = REALLOC(drawn_rend[i], TermWin.bcol * sizeof(rend_t)); if (swap.text[i]) { swap.text[i] = REALLOC(swap.text[i], TermWin.bcol * sizeof(text_t)); swap.rend[i] = REALLOC(swap.rend[i], TermWin.bcol * sizeof(rend_t)); MIN_IT(swap.tlen[i], TermWin.bcol); if (TermWin.bcol > prev_bcol) blank_line(&(swap.text[i][prev_bcol]), &(swap.rend[i][prev_bcol]), TermWin.bcol - prev_bcol, setrstyle); } if (TermWin.bcol > prev_bcol) blank_line(&(drawn_text[i][prev_bcol]), &(drawn_rend[i][prev_bcol]), TermWin.bcol - prev_bcol, setrstyle); } MIN_IT(screen.cur.col, TermWin.bcol - 1); MIN_IT(swap.cur.col, TermWin.bcol - 1); } if (tabs) FREE(tabs); } /* *INDENT-ON* */ tabs = MALLOC(TermWin.bcol * sizeof(char)); for (i = 0; i < TermWin.bcol; i++) tabs[i] = (i % TABSIZE == 0) ? 1 : 0; prev_nrow = TermWin.nrow; prev_bcol = TermWin.bcol; tt_resize(); } /* ------------------------------------------------------------------------- */ /* * Free everything. That way malloc debugging can find leakage. */ /* PROTO */ void scr_release(void) { int i, total_rows; total_rows = TermWin.nrow + TermWin.saveLines; for (i = 0; i < total_rows; i++) { if (screen.text[i]) { /* then so is screen.rend[i] */ FREE(screen.text[i]); FREE(screen.rend[i]); } } for (i = 0; i < TermWin.nrow; i++) { FREE(drawn_text[i]); FREE(drawn_rend[i]); FREE(swap.text[i]); FREE(swap.rend[i]); } FREE(screen.text); FREE(screen.tlen); FREE(screen.rend); FREE(drawn_text); FREE(drawn_rend); FREE(swap.text); FREE(swap.tlen); FREE(swap.rend); FREE(buf_text); FREE(buf_tlen); FREE(buf_rend); FREE(tabs); /* NULL these so if anything tries to use them, we'll know about it */ screen.text = drawn_text = swap.text = NULL; screen.rend = drawn_rend = swap.rend = NULL; screen.tlen = swap.tlen = buf_tlen = NULL; buf_text = NULL; buf_rend = NULL; tabs = NULL; } /* ------------------------------------------------------------------------- */ /* PROTO */ void scr_poweron(void) { D_SCREEN((stderr, "scr_poweron()")); MEMSET(charsets, 'B', sizeof(charsets)); rvideo = 0; swap.tscroll = 0; swap.bscroll = TermWin.nrow - 1; screen.cur.row = screen.cur.col = swap.cur.row = swap.cur.col = 0; screen.charset = swap.charset = 0; screen.flags = swap.flags = Screen_DefaultFlags; scr_cursor(SAVE); scr_release(); prev_nrow = -1; prev_bcol = -1; scr_reset(); scr_clear(); scr_refresh(SLOW_REFRESH); Gr_reset(); } /* ------------------------------------------------------------------------- * * PROCESS SCREEN COMMANDS * * ------------------------------------------------------------------------- */ /* * Save and Restore cursor * XTERM_SEQ: Save cursor : ESC 7 * XTERM_SEQ: Restore cursor: ESC 8 */ /* PROTO */ void scr_cursor(int mode) { D_SCREEN((stderr, "scr_cursor(%c)", mode)); switch (mode) { case SAVE: save.cur.row = screen.cur.row; save.cur.col = screen.cur.col; save.rstyle = rstyle; save.charset = screen.charset; save.charset_char = charsets[screen.charset]; break; case RESTORE: screen.cur.row = save.cur.row; screen.cur.col = save.cur.col; rstyle = save.rstyle; screen.charset = save.charset; charsets[screen.charset] = save.charset_char; set_font_style(); break; } /* boundary check in case screen size changed between SAVE and RESTORE */ MIN_IT(screen.cur.row, TermWin.nrow - 1); MIN_IT(screen.cur.col, TermWin.bcol - 1); #ifdef DEBUG_STRICT assert(screen.cur.row >= 0); assert(screen.cur.col >= 0); #else /* drive with your eyes closed */ MAX_IT(screen.cur.row, 0); MAX_IT(screen.cur.col, 0); #endif } /* ------------------------------------------------------------------------- */ /* * Swap between primary and secondary screens * XTERM_SEQ: Primary screen : ESC [ ? 4 7 h * XTERM_SEQ: Secondary screen: ESC [ ? 4 7 l */ /* PROTO */ int scr_change_screen(int scrn) { int i, offset, tmp; text_t *t0; rend_t *r0; R_int16_t l0; D_SCREEN((stderr, "scr_change_screen(%d)", scrn)); TermWin.view_start = 0; RESET_CHSTAT; if (current_screen == scrn) return current_screen; CHECK_SELECTION(2); /* check for boundary cross */ SWAP_IT(current_screen, scrn, tmp); #if NSCREENS offset = TermWin.saveLines; for (i = TermWin.nrow; i--;) { SWAP_IT(screen.text[i + offset], swap.text[i], t0); SWAP_IT(screen.tlen[i + offset], swap.tlen[i], l0); SWAP_IT(screen.rend[i + offset], swap.rend[i], r0); } SWAP_IT(screen.cur.row, swap.cur.row, l0); SWAP_IT(screen.cur.col, swap.cur.col, l0); # ifdef DEBUG_STRICT assert(screen.cur.row >= 0); assert(screen.cur.col >= 0); assert(screen.cur.row < TermWin.nrow); assert(screen.cur.col < TermWin.bcol); # else /* drive with your eyes closed */ MAX_IT(screen.cur.row, 0); MAX_IT(screen.cur.col, 0); MIN_IT(screen.cur.row, TermWin.nrow - 1); MIN_IT(screen.cur.col, TermWin.bcol - 1); # endif SWAP_IT(screen.charset, swap.charset, l0); SWAP_IT(screen.flags, swap.flags, tmp); screen.flags |= Screen_VisibleCursor; swap.flags |= Screen_VisibleCursor; if (Gr_Displayed()) { Gr_scroll(0); Gr_ChangeScreen(); } #else # ifndef DONT_SCROLL_ME if (Gr_Displayed()) Gr_ClearScreen(); if (current_screen == PRIMARY) { if (!Gr_Displayed()) scroll_text(0, (TermWin.nrow - 1), TermWin.nrow, 0); for (i = TermWin.saveLines; i < TermWin.nrow + TermWin.saveLines; i++) if (screen.text[i] == NULL) { make_screen_mem(screen.text, screen.rend, i, DEFAULT_RSTYLE); screen.tlen[i] = 0; } } # endif #endif return scrn; } /* ------------------------------------------------------------------------- */ /* * Change the colour for following text */ /* PROTO */ void scr_color(unsigned int color, unsigned int Intensity) { if (color == restoreFG) color = Color_fg; else if (color == restoreBG) color = Color_bg; else { if (Xdepth <= 2) { /* Monochrome - ignore colour changes */ switch (Intensity) { case RS_Bold: color = Color_fg; break; case RS_Blink: color = Color_bg; break; } } else { #ifndef NO_BRIGHTCOLOR if ((rstyle & Intensity) && color >= minCOLOR && color <= maxCOLOR) color += (minBrightCOLOR - minCOLOR); else if (color >= minBrightCOLOR && color <= maxBrightCOLOR) { if (rstyle & Intensity) return; color -= (minBrightCOLOR - minCOLOR); } #endif } } switch (Intensity) { case RS_Bold: rstyle = SET_FGCOLOR(rstyle, color); break; case RS_Blink: rstyle = SET_BGCOLOR(rstyle, color); break; } } /* ------------------------------------------------------------------------- */ /* * Change the rendition style for following text */ /* PROTO */ void scr_rendition(int set, int style) { unsigned int color; rend_t font_attr; if (set) { /* A: Set style */ rstyle |= style; switch (style) { case RS_RVid: if (rvideo) rstyle &= ~RS_RVid; break; #ifndef NO_BRIGHTCOLOR case RS_Bold: color = GET_FGCOLOR(rstyle); scr_color((color == Color_fg ? GET_FGCOLOR(colorfgbg) : color), RS_Bold); break; case RS_Blink: color = GET_BGCOLOR(rstyle); scr_color((color == Color_bg ? GET_BGCOLOR(colorfgbg) : color), RS_Blink); break; #endif } } else { /* B: Unset style */ font_attr = rstyle & RS_fontMask; rstyle &= ~style; switch (style) { case ~RS_None: /* default fg/bg colours */ rstyle = DEFAULT_RSTYLE | font_attr; /* FALLTHROUGH */ case RS_RVid: if (rvideo) rstyle |= RS_RVid; break; #ifndef NO_BRIGHTCOLOR case RS_Bold: color = GET_FGCOLOR(rstyle); if (color >= minBrightCOLOR && color <= maxBrightCOLOR) { scr_color(color, RS_Bold); if ((rstyle & RS_fgMask) == (colorfgbg & RS_fgMask)) scr_color(restoreFG, RS_Bold); } break; case RS_Blink: color = GET_BGCOLOR(rstyle); if (color >= minBrightCOLOR && color <= maxBrightCOLOR) { scr_color(color, RS_Blink); if ((rstyle & RS_bgMask) == (colorfgbg & RS_bgMask)) scr_color(restoreBG, RS_Blink); } break; #endif } } } /* ------------------------------------------------------------------------- */ /* * Scroll text between and inclusive, by lines * count positive ==> scroll up * count negative ==> scroll down * spec == 0 for normal routines */ /* PROTO */ int scroll_text(int row1, int row2, int count, int spec) { int i, j; D_SCREEN((stderr, "scroll_text(%d,%d,%d,%d): %s", row1, row2, count, spec, (current_screen == PRIMARY) ? "Primary" : "Secondary")); if (count == 0 || (row1 > row2)) return 0; if ((count > 0) && (row1 == 0) && (current_screen == PRIMARY)) { if (TermWin.saveLines - TermWin.nscrolled < count) TermWin.nscrolled += TermWin.saveLines - TermWin.nscrolled; else TermWin.nscrolled += count; MIN_IT(TermWin.nscrolled, TermWin.saveLines); } else if (!spec) row1 += TermWin.saveLines; row2 += TermWin.saveLines; if (selection.op && current_screen == selection.screen) { i = selection.beg.row + TermWin.saveLines; j = selection.end.row + TermWin.saveLines; if ((i < row1 && j > row1) || (i < row2 && j > row2) || (i - count < row1 && i >= row1) || (i - count > row2 && i <= row2) || (j - count < row1 && j >= row1) || (j - count > row2 && j <= row2)) { CLEAR_ALL_SELECTION; selection.op = SELECTION_CLEAR; /* XXX: too aggressive? */ } else if (j >= row1 && j <= row2) { /* move selected region too */ selection.beg.row -= count; selection.end.row -= count; selection.mark.row -= count; } } CHECK_SELECTION(0); /* _after_ TermWin.nscrolled update */ if (count > 0) { /* A: scroll up */ MIN_IT(count, row2 - row1 + 1); /* A1: Copy lines that will get clobbered by the rotation */ for (i = 0, j = row1; i < count; i++, j++) { buf_text[i] = screen.text[j]; buf_tlen[i] = screen.tlen[j]; buf_rend[i] = screen.rend[j]; } /* A2: Rotate lines */ for (j = row1; (j + count) <= row2; j++) { screen.text[j] = screen.text[j + count]; screen.tlen[j] = screen.tlen[j + count]; screen.rend[j] = screen.rend[j + count]; } /* A3: Resurrect lines */ for (i = 0; i < count; i++, j++) { screen.text[j] = buf_text[i]; screen.tlen[j] = buf_tlen[i]; screen.rend[j] = buf_rend[i]; } } else if (count < 0) { /* B: scroll down */ count = min(-count, row2 - row1 + 1); /* B1: Copy lines that will get clobbered by the rotation */ for (i = 0, j = row2; i < count; i++, j--) { buf_text[i] = screen.text[j]; buf_tlen[i] = screen.tlen[j]; buf_rend[i] = screen.rend[j]; } /* B2: Rotate lines */ for (j = row2; (j - count) >= row1; j--) { screen.text[j] = screen.text[j - count]; screen.tlen[j] = screen.tlen[j - count]; screen.rend[j] = screen.rend[j - count]; } /* B3: Resurrect lines */ for (i = 0, j = row1; i < count; i++, j++) { screen.text[j] = buf_text[i]; screen.tlen[j] = buf_tlen[i]; screen.rend[j] = buf_rend[i]; } count = -count; } if (Gr_Displayed()) Gr_scroll(count); return count; } /* ------------------------------------------------------------------------- */ /* * Add text given in of length to screen struct */ /* PROTO */ void scr_add_lines(const unsigned char *str, int nlines, int len) { char c; int i, j, row, last_col, wherecursor, wrotespecial; text_t *stp; rend_t *srp; if (len <= 0) /* sanity */ return; last_col = TermWin.bcol; D_SCREEN((stderr, "scr_add_lines(*,%d,%d)", nlines, len)); ZERO_SCROLLBACK; if (nlines > 0) { nlines += (screen.cur.row - screen.bscroll); if ((nlines > 0) && (screen.tscroll == 0)&& (screen.bscroll == (TermWin.nrow - 1))) {/* _at least_ this many lines need to be scrolled */ scroll_text(screen.tscroll, screen.bscroll, nlines, 0); for (i = nlines, j = screen.bscroll + TermWin.saveLines; i--; j--) { if (screen.text[j] == NULL) make_screen_mem(screen.text, screen.rend, j, rstyle); else blank_line(screen.text[j], screen.rend[j], TermWin.bcol, rstyle); screen.tlen[j] = 0; } screen.cur.row -= nlines; } } #ifdef DEBUG_STRICT assert(screen.cur.col < last_col); assert(screen.cur.row < TermWin.nrow); assert(screen.cur.row >= -TermWin.nscrolled); #else /* drive with your eyes closed */ MIN_IT(screen.cur.col, last_col - 1); MIN_IT(screen.cur.row, TermWin.nrow - 1); MAX_IT(screen.cur.row, -TermWin.nscrolled); #endif row = screen.cur.row + TermWin.saveLines; if (ROW_AND_COL_IS_BEFORE(screen.cur.row, screen.cur.col, selection.beg.row, selection.beg.col)) wherecursor = -1; else if (ROW_AND_COL_IS_BEFORE(screen.cur.row, screen.cur.col, selection.end.row, selection.end.col)) wherecursor = 0; else wherecursor = 1; stp = screen.text[row]; srp = screen.rend[row]; #ifdef MULTICHAR_SET if (lost_multi && screen.cur.col > 0 && ((srp[screen.cur.col - 1] & RS_multiMask) == RS_multi1) && *str != '\n' && *str != '\r' && *str != '\t') chstat = WBYTE; #endif for (wrotespecial = len, i = 0; i < len;) { c = str[i++]; #ifdef MULTICHAR_SET if (chstat == WBYTE) { rstyle |= RS_multiMask; /* multibyte 2nd byte */ chstat = SBYTE; if (encoding_method == EUCJ) c |= 0x80; /* maybe overkill, but makes it selectable */ } else if (chstat == SBYTE) { if (multi_byte || (c & 0x80)) { /* multibyte 1st byte */ rstyle &= ~RS_multiMask; rstyle |= RS_multi1; chstat = WBYTE; if (encoding_method == EUCJ) c |= 0x80; /* maybe overkill, but makes it selectable */ } else #endif /* MULTICHAR_SET */ switch (c) { case 127: wrotespecial--; continue; /* yummmm..... */ case '\t': wrotespecial--; scr_tab(1); continue; case '\n': wrotespecial--; if (screen.tlen[row] != -1) /* XXX: think about this */ MAX_IT(screen.tlen[row], screen.cur.col); screen.flags &= ~Screen_WrapNext; if (screen.cur.row == screen.bscroll) { scroll_text(screen.tscroll, screen.bscroll, 1, 0); j = screen.bscroll + TermWin.saveLines; if (screen.text[j] == NULL) make_screen_mem(screen.text, screen.rend, j, rstyle); else blank_line(screen.text[j], screen.rend[j], TermWin.bcol, rstyle); screen.tlen[j] = 0; } else if (screen.cur.row < (TermWin.nrow - 1)) row = (++screen.cur.row) + TermWin.saveLines; stp = screen.text[row]; /* _must_ refresh */ srp = screen.rend[row]; /* _must_ refresh */ continue; case '\r': wrotespecial--; if (screen.tlen[row] != -1) /* XXX: think about this */ MAX_IT(screen.tlen[row], screen.cur.col); screen.flags &= ~Screen_WrapNext; screen.cur.col = 0; continue; default: #ifdef MULTICHAR_SET rstyle &= ~RS_multiMask; #endif break; } #ifdef MULTICHAR_SET } #endif if (screen.flags & Screen_WrapNext) { screen.tlen[row] = -1; if (screen.cur.row == screen.bscroll) { scroll_text(screen.tscroll, screen.bscroll, 1, 0); j = screen.bscroll + TermWin.saveLines; if (screen.text[j] == NULL) make_screen_mem(screen.text, screen.rend, j, rstyle); else blank_line(screen.text[j], screen.rend[j], TermWin.bcol, rstyle); screen.tlen[j] = 0; } else if (screen.cur.row < (TermWin.nrow - 1)) row = (++screen.cur.row) + TermWin.saveLines; stp = screen.text[row]; /* _must_ refresh */ srp = screen.rend[row]; /* _must_ refresh */ screen.cur.col = 0; screen.flags &= ~Screen_WrapNext; } if (screen.flags & Screen_Insert) scr_insdel_chars(1, INSERT); stp[screen.cur.col] = c; srp[screen.cur.col] = rstyle; /* * TODO: This might end up wrapping the tone sign in Thai */ if (screen.cur.col < (last_col - 1)) screen.cur.col++; else { screen.tlen[row] = last_col; if (screen.flags & Screen_Autowrap) screen.flags |= Screen_WrapNext; else screen.flags &= ~Screen_WrapNext; } } if (screen.tlen[row] != -1) /* XXX: think about this */ MAX_IT(screen.tlen[row], screen.cur.col); /* * If we wrote anywhere in the selected area, kill the selection * XXX: should we kill the mark too? Possibly, but maybe that * should be a similar check. */ if (ROW_AND_COL_IS_BEFORE(screen.cur.row, screen.cur.col, selection.beg.row, selection.beg.col)) i = -1; else if (ROW_AND_COL_IS_BEFORE(screen.cur.row, screen.cur.col, selection.end.row, selection.end.col)) i = 0; else i = 1; if (selection.op && current_screen == selection.screen && wrotespecial != 0 && (i != wherecursor || i == 0)) CLEAR_SELECTION; #ifdef DEBUG_STRICT assert(screen.cur.row >= 0); #else /* drive with your eyes closed */ MAX_IT(screen.cur.row, 0); #endif } /* ------------------------------------------------------------------------- */ /* * Process Backspace. Move back the cursor back a position, wrap if have to * XTERM_SEQ: CTRL-H */ /* PROTO */ void scr_backspace(void) { RESET_CHSTAT; if (screen.cur.col == 0 && screen.cur.row > 0) { screen.cur.col = TermWin.bcol - 1; screen.cur.row--; } else if (screen.flags & Screen_WrapNext) { screen.flags &= ~Screen_WrapNext; } else scr_gotorc(0, -1, RELATIVE); } /* ------------------------------------------------------------------------- */ /* * Process Horizontal Tab * count: +ve = forward; -ve = backwards * XTERM_SEQ: CTRL-I */ /* PROTO */ void scr_tab(int count) { int i, x; RESET_CHSTAT; x = screen.cur.col; if (count == 0) return; else if (count > 0) { for (i = x + 1; i < TermWin.bcol; i++) { if (tabs[i]) { x = i; if (!--count) break; } } } else if (count < 0) { for (i = x - 1; i >= 0; i--) { if (tabs[i]) { x = i; if (!++count) break; } } } if (x != screen.cur.col) scr_gotorc(0, x, R_RELATIVE); } /* ------------------------------------------------------------------------- */ /* * Goto Row/Column */ /* PROTO */ void scr_gotorc(int row, int col, int relative) { ZERO_SCROLLBACK; RESET_CHSTAT; if (Gr_Displayed()) Gr_scroll(0); D_SCREEN((stderr, "scr_gotorc(r:%d,c:%d,%d): from (r:%d,c:%d)", row, col, relative, screen.cur.row, screen.cur.col)); screen.cur.col = ((relative & C_RELATIVE) ? (screen.cur.col + col) : col); MAX_IT(screen.cur.col, 0); MIN_IT(screen.cur.col, TermWin.bcol - 1); if (screen.flags & Screen_WrapNext) { screen.flags &= ~Screen_WrapNext; } if (relative & R_RELATIVE) { if (row > 0) { if (screen.cur.row <= screen.bscroll && (screen.cur.row + row) > screen.bscroll) screen.cur.row = screen.bscroll; else screen.cur.row += row; } else if (row < 0) { if (screen.cur.row >= screen.tscroll && (screen.cur.row + row) < screen.tscroll) screen.cur.row = screen.tscroll; else screen.cur.row += row; } } else { if (screen.flags & Screen_Relative) { /* relative origin mode */ screen.cur.row = row + screen.tscroll; MIN_IT(screen.cur.row, screen.bscroll); } else screen.cur.row = row; } MAX_IT(screen.cur.row, 0); MIN_IT(screen.cur.row, TermWin.nrow - 1); } /* ------------------------------------------------------------------------- */ /* * direction should be UP or DN */ /* PROTO */ void scr_index(int direction) { int dirn; dirn = ((direction == UP) ? 1 : -1); D_SCREEN((stderr, "scr_index(%d)", dirn)); ZERO_SCROLLBACK; RESET_CHSTAT; if (Gr_Displayed()) Gr_scroll(0); if (screen.flags & Screen_WrapNext) { screen.flags &= ~Screen_WrapNext; } if ((screen.cur.row == screen.bscroll && direction == UP) || (screen.cur.row == screen.tscroll && direction == DN)) { scroll_text(screen.tscroll, screen.bscroll, dirn, 0); if (direction == UP) dirn = screen.bscroll + TermWin.saveLines; else dirn = screen.tscroll + TermWin.saveLines; if (screen.text[dirn] == NULL) /* then so is screen.rend[dirn] */ make_screen_mem(screen.text, screen.rend, dirn, rstyle); else blank_line(screen.text[dirn], screen.rend[dirn], TermWin.bcol, rstyle); screen.tlen[dirn] = 0; } else screen.cur.row += dirn; MAX_IT(screen.cur.row, 0); MIN_IT(screen.cur.row, TermWin.nrow - 1); CHECK_SELECTION(0); } /* ------------------------------------------------------------------------- */ /* * Erase part or whole of a line * XTERM_SEQ: Clear line to right: ESC [ 0 K * XTERM_SEQ: Clear line to left : ESC [ 1 K * XTERM_SEQ: Clear whole line : ESC [ 2 K */ /* PROTO */ void scr_erase_line(int mode) { int row, col, num; D_SCREEN((stderr, "scr_erase_line(%d) at screen row: %d", mode, screen.cur.row)); ZERO_SCROLLBACK; RESET_CHSTAT; if (Gr_Displayed()) Gr_scroll(0); CHECK_SELECTION(1); if (screen.flags & Screen_WrapNext) screen.flags &= ~Screen_WrapNext; row = TermWin.saveLines + screen.cur.row; switch (mode) { case 0: /* erase to end of line */ col = screen.cur.col; num = TermWin.bcol - col; MIN_IT(screen.tlen[row], col); if (ROWCOL_IN_ROW_ON_OR_AFTER(selection.beg, screen.cur) || ROWCOL_IN_ROW_ON_OR_AFTER(selection.end, screen.cur)) CLEAR_SELECTION; break; case 1: /* erase to beginning of line */ col = 0; num = screen.cur.col + 1; if (ROWCOL_IN_ROW_ON_OR_BEFORE(selection.beg, screen.cur) || ROWCOL_IN_ROW_ON_OR_BEFORE(selection.end, screen.cur)) CLEAR_SELECTION; break; case 2: /* erase whole line */ col = 0; num = TermWin.bcol; screen.tlen[row] = 0; if (selection.beg.row <= screen.cur.row || selection.end.row >= screen.cur.row) CLEAR_SELECTION; break; default: return; } blank_line(&(screen.text[row][col]), &(screen.rend[row][col]), num, rstyle & ~RS_Uline); } /* ------------------------------------------------------------------------- */ /* * Erase part of whole of the screen * XTERM_SEQ: Clear screen after cursor : ESC [ 0 J * XTERM_SEQ: Clear screen before cursor: ESC [ 1 J * XTERM_SEQ: Clear whole screen : ESC [ 2 J */ /* PROTO */ void scr_erase_screen(int mode) { int row, num, row_offset; rend_t ren; long gcmask; XGCValues gcvalue; D_SCREEN((stderr, "scr_erase_screen(%d) at screen row: %d", mode, screen.cur.row)); ZERO_SCROLLBACK; RESET_CHSTAT; row_offset = TermWin.saveLines; switch (mode) { case 0: /* erase to end of screen */ CHECK_SELECTION(1); scr_erase_line(0); row = screen.cur.row + 1; /* possible OOB */ num = TermWin.nrow - row; break; case 1: /* erase to beginning of screen */ CHECK_SELECTION(3); scr_erase_line(1); row = 0; /* possible OOB */ num = screen.cur.row; break; case 2: /* erase whole screen */ CHECK_SELECTION(3); Gr_ClearScreen(); row = 0; num = TermWin.nrow; break; default: return; } if (selection.op && current_screen == selection.screen && ((selection.beg.row >= row && selection.beg.row <= row + num) || (selection.end.row >= row && selection.end.row <= row + num))) CLEAR_SELECTION; if (row >= 0 && row < TermWin.nrow) { /* check OOB */ MIN_IT(num, (TermWin.nrow - row)); if (rstyle & (RS_RVid | RS_Uline)) ren = (rend_t)~RS_None; else if (GET_BGCOLOR(rstyle) == Color_bg) { ren = DEFAULT_RSTYLE; CLEAR_ROWS(row, num); } else { ren = (rstyle & (RS_fgMask | RS_bgMask)); gcvalue.foreground = PixColors[GET_BGCOLOR(ren)]; gcmask = GCForeground; XChangeGC(Xdisplay, TermWin.gc, gcmask, &gcvalue); ERASE_ROWS(row, num); gcvalue.foreground = PixColors[Color_fg]; XChangeGC(Xdisplay, TermWin.gc, gcmask, &gcvalue); } for (; num--; row++) { blank_line(screen.text[row + row_offset], screen.rend[row + row_offset], TermWin.bcol, rstyle & ~RS_Uline); screen.tlen[row + row_offset] = 0; blank_line(drawn_text[row], drawn_rend[row], TermWin.bcol, ren); } } } /* ------------------------------------------------------------------------- */ /* * Fill the screen with `E's * XTERM_SEQ: Screen Alignment Test: ESC # 8 */ /* PROTO */ void scr_E(void) { int i, j; text_t *t; rend_t *r, fs; ZERO_SCROLLBACK; RESET_CHSTAT; CHECK_SELECTION(3); fs = rstyle; for (i = TermWin.saveLines; i < TermWin.nrow + TermWin.saveLines; i++) { t = screen.text[i]; r = screen.rend[i]; for (j = 0; j < TermWin.bcol; j++) { *t++ = 'E'; *r++ = fs; } screen.tlen[i] = TermWin.bcol; /* make the `E's selectable */ } } /* ------------------------------------------------------------------------- */ /* * Insert/Delete lines */ /* PROTO */ void scr_insdel_lines(int count, int insdel) { int end; ZERO_SCROLLBACK; RESET_CHSTAT; if (Gr_Displayed()) Gr_scroll(0); CHECK_SELECTION(1); if (screen.cur.row > screen.bscroll) return; end = screen.bscroll - screen.cur.row + 1; if (count > end) { if (insdel == DELETE) return; else if (insdel == INSERT) count = end; } if (screen.flags & Screen_WrapNext) { screen.flags &= ~Screen_WrapNext; } scroll_text(screen.cur.row, screen.bscroll, insdel * count, 0); /* fill the inserted or new lines with rstyle. TODO: correct for delete? */ if (insdel == DELETE) { end = screen.bscroll + TermWin.saveLines; } else if (insdel == INSERT) { end = screen.cur.row + count - 1 + TermWin.saveLines; } for (; count--; end--) { if (screen.text[end] == NULL) /* then so is screen.rend[end] */ make_screen_mem(screen.text, screen.rend, end, rstyle); else blank_line(screen.text[end], screen.rend[end], TermWin.bcol, rstyle); screen.tlen[end] = 0; } } /* ------------------------------------------------------------------------- */ /* * Insert/Delete characters from the current position */ /* PROTO */ void scr_insdel_chars(int count, int insdel) { int col, row; rend_t tr; ZERO_SCROLLBACK; RESET_CHSTAT; if (Gr_Displayed()) Gr_scroll(0); if (count <= 0) return; CHECK_SELECTION(1); MIN_IT(count, (TermWin.bcol - screen.cur.col)); row = screen.cur.row + TermWin.saveLines; screen.flags &= ~Screen_WrapNext; switch (insdel) { case INSERT: for (col = TermWin.bcol - 1; (col - count) >= screen.cur.col; col--) { screen.text[row][col] = screen.text[row][col - count]; screen.rend[row][col] = screen.rend[row][col - count]; } if (screen.tlen[row] != -1) { screen.tlen[row] += count; MIN_IT(screen.tlen[row], TermWin.bcol); } if (selection.op && current_screen == selection.screen && ROWCOL_IN_ROW_ON_OR_AFTER(selection.beg, screen.cur)) { if (selection.end.row != screen.cur.row || (selection.end.col + count >= TermWin.bcol)) CLEAR_SELECTION; else { /* shift selection */ selection.beg.col += count; selection.mark.col += count; /* XXX: yes? */ selection.end.col += count; } } blank_line(&(screen.text[row][screen.cur.col]), &(screen.rend[row][screen.cur.col]), count, rstyle); break; case ERASE: screen.cur.col += count; /* don't worry if > TermWin.bcol */ CHECK_SELECTION(1); screen.cur.col -= count; blank_line(&(screen.text[row][screen.cur.col]), &(screen.rend[row][screen.cur.col]), count, rstyle); break; case DELETE: tr = screen.rend[row][TermWin.bcol - 1] & (RS_fgMask | RS_bgMask | RS_baseattrMask); for (col = screen.cur.col; (col + count) < TermWin.bcol; col++) { screen.text[row][col] = screen.text[row][col + count]; screen.rend[row][col] = screen.rend[row][col + count]; } blank_line(&(screen.text[row][TermWin.bcol - count]), &(screen.rend[row][TermWin.bcol - count]), count, tr); if (screen.tlen[row] == -1) /* break line continuation */ screen.tlen[row] = TermWin.bcol; screen.tlen[row] -= count; MAX_IT(screen.tlen[row], 0); if (selection.op && current_screen == selection.screen && ROWCOL_IN_ROW_ON_OR_AFTER(selection.beg, screen.cur)) { if (selection.end.row != screen.cur.row || (screen.cur.col >= selection.beg.col - count) || selection.end.col >= TermWin.bcol) CLEAR_SELECTION; else { /* shift selection */ selection.beg.col -= count; selection.mark.col -= count; /* XXX: yes? */ selection.end.col -= count; } } break; } #ifdef MULTICHAR_SET if ((screen.rend[row][0] & RS_multiMask) == RS_multi2) { screen.rend[row][0] &= ~RS_multiMask; screen.text[row][0] = ' '; } if ((screen.rend[row][TermWin.bcol - 1] & RS_multiMask) == RS_multi1) { screen.rend[row][TermWin.bcol - 1] &= ~RS_multiMask; screen.text[row][TermWin.bcol - 1] = ' '; } #endif } /* ------------------------------------------------------------------------- */ /* * Set the scrolling region * XTERM_SEQ: Set region - inclusive: ESC [ ; r */ /* PROTO */ void scr_scroll_region(int top, int bot) { MAX_IT(top, 0); MIN_IT(bot, TermWin.nrow - 1); if (top > bot) return; screen.tscroll = top; screen.bscroll = bot; scr_gotorc(0, 0, 0); } /* ------------------------------------------------------------------------- */ /* * Make the cursor visible/invisible * XTERM_SEQ: Make cursor visible : ESC [ ? 25 h * XTERM_SEQ: Make cursor invisible: ESC [ ? 25 l */ /* PROTO */ void scr_cursor_visible(int mode) { if (mode) screen.flags |= Screen_VisibleCursor; else screen.flags &= ~Screen_VisibleCursor; } /* ------------------------------------------------------------------------- */ /* * Set/unset automatic wrapping * XTERM_SEQ: Set Wraparound : ESC [ ? 7 h * XTERM_SEQ: Unset Wraparound: ESC [ ? 7 l */ /* PROTO */ void scr_autowrap(int mode) { if (mode) screen.flags |= Screen_Autowrap; else screen.flags &= ~Screen_Autowrap; } /* ------------------------------------------------------------------------- */ /* * Set/unset margin origin mode * Absolute mode: line numbers are counted relative to top margin of screen * and the cursor can be moved outside the scrolling region. * Relative mode: line numbers are relative to top margin of scrolling region * and the cursor cannot be moved outside. * XTERM_SEQ: Set Absolute: ESC [ ? 6 h * XTERM_SEQ: Set Relative: ESC [ ? 6 l */ /* PROTO */ void scr_relative_origin(int mode) { if (mode) screen.flags |= Screen_Relative; else screen.flags &= ~Screen_Relative; scr_gotorc(0, 0, 0); } /* ------------------------------------------------------------------------- */ /* * Set insert/replace mode * XTERM_SEQ: Set Insert mode : ESC [ ? 4 h * XTERM_SEQ: Set Replace mode: ESC [ ? 4 l */ /* PROTO */ void scr_insert_mode(int mode) { if (mode) screen.flags |= Screen_Insert; else screen.flags &= ~Screen_Insert; } /* ------------------------------------------------------------------------- */ /* * Set/Unset tabs * XTERM_SEQ: Set tab at current column : ESC H * XTERM_SEQ: Clear tab at current column: ESC [ 0 g * XTERM_SEQ: Clear all tabs : ESC [ 3 g */ /* PROTO */ void scr_set_tab(int mode) { if (mode < 0) MEMSET(tabs, 0, TermWin.bcol * sizeof(char)); else if (screen.cur.col < TermWin.bcol) tabs[screen.cur.col] = (mode ? 1 : 0); } /* ------------------------------------------------------------------------- */ /* * Set reverse/normal video * XTERM_SEQ: Reverse video: ESC [ ? 5 h * XTERM_SEQ: Normal video : ESC [ ? 5 l */ /* PROTO */ void scr_rvideo_mode(int mode) { int i, j, maxlines; if (rvideo != mode) { rvideo = mode; rstyle ^= RS_RVid; maxlines = TermWin.saveLines + TermWin.nrow; for (i = TermWin.saveLines; i < maxlines; i++) for (j = 0; j < TermWin.bcol + 1; j++) screen.rend[i][j] ^= RS_RVid; scr_refresh(SLOW_REFRESH); } } /* ------------------------------------------------------------------------- */ /* * Report current cursor position * XTERM_SEQ: Report position: ESC [ 6 n */ /* PROTO */ void scr_report_position(void) { tt_printf((unsigned char *) "\033[%d;%dR", screen.cur.row + 1, screen.cur.col + 1); } /* ------------------------------------------------------------------------- * * FONTS * * ------------------------------------------------------------------------- */ /* * Set font style */ /* PROTO */ void set_font_style(void) { rstyle &= ~RS_fontMask; switch (charsets[screen.charset]) { case '0': /* DEC Special Character & Line Drawing Set */ rstyle |= RS_acsFont; break; case 'A': /* United Kingdom (UK) */ rstyle |= RS_ukFont; break; case 'B': /* United States (USASCII) */ break; case '<': /* Multinational character set */ break; case '5': /* Finnish character set */ break; case 'C': /* Finnish character set */ break; case 'K': /* German character set */ break; } } /* ------------------------------------------------------------------------- */ /* * Choose a font * XTERM_SEQ: Invoke G0 character set: CTRL-O * XTERM_SEQ: Invoke G1 character set: CTRL-N * XTERM_SEQ: Invoke G2 character set: ESC N * XTERM_SEQ: Invoke G3 character set: ESC O */ /* PROTO */ void scr_charset_choose(int set) { screen.charset = set; set_font_style(); } /* ------------------------------------------------------------------------- */ /* * Set a font * XTERM_SEQ: Set G0 character set: ESC ( * XTERM_SEQ: Set G1 character set: ESC ) * XTERM_SEQ: Set G2 character set: ESC * * XTERM_SEQ: Set G3 character set: ESC + * See set_font_style for possible values for */ /* PROTO */ void scr_charset_set(int set, unsigned int ch) { #ifdef MULTICHAR_SET multi_byte = (set < 0); set = abs(set); #endif charsets[set] = (unsigned char)ch; set_font_style(); } /* ------------------------------------------------------------------------- * * MULTIPLE-CHARACTER FONT SET MANIPULATION FUNCTIONS * * ------------------------------------------------------------------------- */ #ifdef MULTICHAR_SET # ifdef KANJI static void (*multichar_decode) (unsigned char *str, int len) = eucj2jis; # else /* then we must be BIG5 to get in here */ static void (*multichar_decode) (unsigned char *str, int len) = big5dummy; # endif /* PROTO */ void eucj2jis(unsigned char *str, int len) { register int i; for (i = 0; i < len; i++) str[i] &= 0x7F; } /* ------------------------------------------------------------------------- */ /* PROTO */ void sjis2jis(unsigned char *str, int len) { register int i; unsigned char *high, *low; for (i = 0; i < len; i += 2, str += 2) { high = str; low = str + 1; (*high) -= (*high > 0x9F ? 0xB1 : 0x71); *high = (*high) * 2 + 1; if (*low > 0x9E) { *low -= 0x7E; (*high)++; } else { if (*low > 0x7E) (*low)--; *low -= 0x1F; } } } /* PROTO */ void big5dummy(unsigned char *str, int len) { } /* PROTO */ void set_multichar_encoding(const char *str) { if (str && *str) { if (!strcmp(str, "sjis")) { encoding_method = SJIS; /* Kanji SJIS */ multichar_decode = sjis2jis; } else if (!strcmp(str, "eucj")) { encoding_method = EUCJ; /* Kanji EUCJ */ multichar_decode = eucj2jis; } } } #endif /* MULTICHAR_SET */ /* ------------------------------------------------------------------------- * * GRAPHICS COLOURS * * ------------------------------------------------------------------------- */ #ifdef RXVT_GRAPHICS /* PROTO */ int scr_get_fgcolor(void) { return GET_FGCOLOR(rstyle); } /* ------------------------------------------------------------------------- */ /* PROTO */ int scr_get_bgcolor(void) { return GET_BGCOLOR(rstyle); } #endif /* ------------------------------------------------------------------------- * * MAJOR SCREEN MANIPULATION * * ------------------------------------------------------------------------- */ /* * Refresh an area */ /* PROTO */ void scr_expose(int x, int y, int width, int height) { int i; #if 0 text_t *t; #endif row_col_t full_beg, full_end, part_beg, part_end; if (drawn_text == NULL) /* sanity check */ return; /* round down */ part_beg.col = Pixel2Col(x); part_beg.row = Pixel2Row(y); full_end.col = Pixel2Width(x + width); full_end.row = Pixel2Row(y + height); /* round up */ part_end.col = Pixel2Width(x + width + TermWin.fwidth - 1); part_end.row = Pixel2Row(y + height + TermWin.fheight - 1); full_beg.col = Pixel2Col(x + TermWin.fwidth - 1); full_beg.row = Pixel2Row(y + TermWin.fheight - 1); /* sanity checks */ MAX_IT(part_beg.col, 0); MAX_IT(full_beg.col, 0); MAX_IT(part_end.col, 0); MAX_IT(full_end.col, 0); MAX_IT(part_beg.row, 0); MAX_IT(full_beg.row, 0); MAX_IT(part_end.row, 0); MAX_IT(full_end.row, 0); MIN_IT(part_beg.col, TermWin.bcol - 1); MIN_IT(full_beg.col, TermWin.bcol - 1); MIN_IT(part_end.col, TermWin.bcol - 1); MIN_IT(full_end.col, TermWin.bcol - 1); MIN_IT(part_beg.row, TermWin.nrow - 1); MIN_IT(full_beg.row, TermWin.nrow - 1); MIN_IT(part_end.row, TermWin.nrow - 1); MIN_IT(full_end.row, TermWin.nrow - 1); D_SCREEN((stderr, "scr_expose(x:%d, y:%d, w:%d, h:%d) area (c:%d,r:%d)-(c:%d,r:%d)", x, y, width, height, part_beg.col, part_beg.row, part_end.col, part_end.row)); #if 1 /* XXX: check for backing store/save unders? */ for (i = part_beg.row; i <= part_end.row; i++) MEMSET(&(drawn_text[i][part_beg.col]), 0, part_end.col - part_beg.col + 1); #else if (full_end.col >= full_beg.col) /* set DEFAULT_RSTYLE for totally exposed characters */ for (i = full_beg.row; i <= full_end.row; i++) blank_line(&(drawn_text[i][full_beg.col]), &(drawn_rend[i][full_beg.col]), full_end.col - full_beg.col + 1, DEFAULT_RSTYLE); /* force an update for partially exposed characters */ if (part_beg.row != full_beg.row) { t = &(drawn_text[part_beg.row][part_beg.col]); for (i = part_end.col - part_beg.col + 1; i--;) *t++ = 0; } if (part_end.row != full_end.row) { t = &(drawn_text[part_end.row][part_beg.col]); for (i = part_end.col - part_beg.col + 1; i--;) *t++ = 0; } if (part_beg.col != full_beg.col) for (i = full_beg.row; i <= full_end.row; i++) drawn_text[i][part_beg.col] = 0; if (part_end.col != full_end.col) for (i = full_beg.row; i <= full_end.row; i++) drawn_text[i][part_end.col] = 0; #endif scr_refresh(SLOW_REFRESH); } /* ------------------------------------------------------------------------- */ /* * Refresh the entire screen */ /* PROTO */ void scr_touch(void) { scr_expose(0, 0, TermWin.width, TermWin.height); } /* ------------------------------------------------------------------------- */ /* * Move the display so that the line represented by scrollbar value Y is at * the top of the screen */ /* PROTO */ int scr_move_to(int y, int len) { int start, t; start = TermWin.view_start; t = ((len - y) * (TermWin.nrow - 1 + TermWin.nscrolled) / (len)) - (TermWin.nrow - 1); D_SCREEN((stderr, "scr_move_to(%d, %d) view_start:%d", y, len, t)); MAX_IT(t, 0); MIN_IT(t, TermWin.nscrolled); TermWin.view_start = t; if (Gr_Displayed()) Gr_scroll(0); return (TermWin.view_start - start); } /* ------------------------------------------------------------------------- */ /* * Page the screen up/down nlines * direction should be UP or DN */ /* PROTO */ int scr_page(int direction, int nlines) { int start, dirn; D_SCREEN((stderr, "scr_page(%s, %d) view_start:%d", ((direction == UP) ? "UP" : "DN"), nlines, TermWin.view_start)); dirn = (direction == UP) ? 1 : -1; start = TermWin.view_start; MAX_IT(nlines, 1); MIN_IT(nlines, TermWin.nrow); if ((dirn == -1 && TermWin.view_start < nlines)) TermWin.view_start = 0; else TermWin.view_start += (nlines * dirn); if (dirn == 1 && start > TermWin.view_start) TermWin.view_start = TermWin.nscrolled; /* MAX_IT(TermWin.view_start, 0); */ MIN_IT(TermWin.view_start, TermWin.nscrolled); if (Gr_Displayed()) Gr_scroll(0); return (TermWin.view_start - start); } /* ------------------------------------------------------------------------- */ /* PROTO */ void scr_bell(void) { #ifndef NO_MAPALERT # ifdef MAPALERT_OPTION if (Options & Opt_mapAlert) # endif XMapWindow(Xdisplay, TermWin.parent); #endif if (Options & Opt_visualBell) { scr_rvideo_mode(!rvideo); /* scr_refresh() also done */ scr_rvideo_mode(!rvideo); /* scr_refresh() also done */ } else XBell(Xdisplay, 0); } /* ------------------------------------------------------------------------- */ /* ARGSUSED */ /* PROTO */ void scr_printscreen(int fullhist) { #ifdef PRINTPIPE int i, r, nrows, row_offset; text_t *t; FILE *fd; if ((fd = popen_printer()) == NULL) return; nrows = TermWin.nrow; if (fullhist) nrows += TermWin.view_start; row_offset = TermWin.saveLines - TermWin.view_start; for (r = 0; r < nrows; r++) { t = screen.text[r + row_offset]; for (i = TermWin.bcol - 1; i >= 0; i--) if (!isspace(t[i])) break; fprintf(fd, "%.*s\n", (i + 1), t); } pclose_printer(fd); #endif } /* ------------------------------------------------------------------------- */ /* * Refresh the screen * drawn_text/drawn_rend contain the screen information before the update. * screen.text/screen.rend contain what the screen will change to. */ #define DRAW_STRING(Func, x, y, str, len) \ Func(Xdisplay, drawBuffer, TermWin.gc, (x), (y), (str), (len)) #if defined (NO_BRIGHTCOLOR) || defined (VERYBOLD) # define MONO_BOLD(x) ((x) & (RS_Bold|RS_Blink)) #else # define MONO_BOLD(x) (((x) & RS_Bold) && fore == Color_fg) #endif /* PROTO */ void scr_refresh(int type) { int i, j, /* tmp */ col, row, /* column/row we're processing */ scrrow, /* screen row offset */ row_offset, /* basic offset in screen structure */ currow, /* cursor row at appropriate offset */ boldlast, /* last character in some row was bold */ len, wlen, /* text length screen/buffer */ fprop, /* proportional font used */ is_cursor, /* cursor this position */ rvid, /* reverse video this position */ rend, /* rendition */ fore, back, /* desired foreground/background */ wbyte, /* we're in multibyte */ morecur = 0, xpixel, /* x offset for start of drawing (font) */ ypixel = 0; /* y offset for start of drawing (font) */ static int focus = -1; /* screen in focus? */ long gcmask; /* Graphics Context mask */ unsigned long ltmp; rend_t rt1, rt2; /* tmp rend values */ #ifndef NO_CURSORCOLOR rend_t ccol1, /* Cursor colour */ ccol2, /* Cursor colour2 */ cc1 = 0; /* store colours at cursor position(s) */ # ifdef MULTICHAR_SET rend_t cc2 = 0; /* store colours at cursor position(s) */ # endif #endif rend_t *drp, *srp; /* drawn-rend-pointer, screen-rend-pointer */ text_t *dtp, *stp; /* drawn-text-pointer, screen-text-pointer */ XGCValues gcvalue; /* Graphics Context values */ XFontStruct *wf; /* which font are we in */ static char *buffer = NULL; static int currmaxcol = 0; #ifdef MULTICHAR_SET static int oldcursormulti = 0; #endif static row_col_t oldcursor = { -1, -1}; /* is there an old outline cursor on screen? */ #ifdef THAI /* variables to clean un-touched space at the end of screen */ int thaicol_stp_offset = 0; int thaicol_dtp_offset = 0; #endif #ifndef NO_BOLDFONT int bfont = 0; /* we've changed font to bold font */ #endif int (*draw_string) (), (*draw_image_string) (); if (type == NO_REFRESH) return; /* * A: set up vars */ if (currmaxcol < TermWin.ncol) { currmaxcol = TermWin.ncol; if (buffer) buffer = REALLOC(buffer, (sizeof(char) * (currmaxcol + 1))); else buffer = MALLOC((sizeof(char) * (currmaxcol + 1))); } row_offset = TermWin.saveLines - TermWin.view_start; fprop = TermWin.fprop; is_cursor = 0; gcvalue.foreground = PixColors[Color_fg]; gcvalue.background = PixColors[Color_bg]; dtp = stp = NULL; /* * always go back to the base font - it's much safer */ wbyte = 0; XSetFont(Xdisplay, TermWin.gc, TermWin.font->fid); draw_string = XDrawString; draw_image_string = XDrawImageString; boldlast = 0; wf = TermWin.font; #ifndef NO_BOLDOVERSTRIKE /* * B: Bold Overstrike pixel dropping avoidance. Do this FIRST. * Do a pass across each line at the start, require a refresh of anything * that will need to be refreshed, due to pixels being dropped into our * area by a previous character which has now been changed. */ for (row = 0; row < TermWin.nrow; row++) { scrrow = row + row_offset; stp = screen.text[scrrow]; srp = screen.rend[scrrow]; dtp = drawn_text[row]; drp = drawn_rend[row]; # ifndef NO_BOLDFONT if (TermWin.boldFont == NULL) { # endif j = wbyte; for (col = TermWin.ncol - 2; col >= 0; col--) { int do_stuff ; # if ! defined (NO_BRIGHTCOLOR) && ! defined (VERYBOLD) fore = GET_FGCOLOR(drp[col]); # endif if (!MONO_BOLD(drp[col])) continue; if (dtp[col] == stp[col] && drp[col] == srp[col]) continue; if (wbyte) { ; /* TODO: handle multibyte */ continue; /* don't go past here */ } if (dtp[col] == ' ') { /* TODO: check character set? */ continue; } if( wf->per_char == NULL ) do_stuff = 1 ; else if( dtp[col] >= wf->min_char_or_byte2 && dtp[col] < wf->max_char_or_byte2) { int char_num = dtp[col]-wf->min_char_or_byte2 ; do_stuff = (wf->per_char[char_num].width == wf->per_char[char_num].rbearing); } else do_stuff = 0 ; if (do_stuff) { #ifndef THAI /* this mess up Thai chars, we have to implement ourselves */ dtp[col + 1] = 0; #endif # if defined(MULTICHAR_SET) && ! defined(NO_BOLDOVERSTRIKE_MULTI) if ((srp[col] & RS_multiMask) == RS_multi2) { col--; wbyte = 1; continue; } # endif } } # if ! defined (NO_BRIGHTCOLOR) && ! defined (VERYBOLD) fore = GET_FGCOLOR(srp[TermWin.ncol - 1]); # endif if (MONO_BOLD(srp[TermWin.ncol - 1])) boldlast = 1; wbyte = j; # ifndef NO_BOLDFONT } # endif } #endif /* ! NO_BOLDOVERSTRIKE */ /* * C: reverse any characters which are selected */ scr_reverse_selection(); /* * D: set the cursor character(s) */ currow = screen.cur.row + TermWin.saveLines; if (focus != TermWin.focus) focus = TermWin.focus; if (screen.flags & Screen_VisibleCursor && focus) { srp = &(screen.rend[currow][screen.cur.col]); #ifdef THAI if(CharWidth(wf,screen.text[currow][screen.cur.col])<=0) *srp ^= RS_Bold; #endif #ifndef NO_CURSORCOLOR cc1 = *srp & (RS_fgMask | RS_bgMask); if (Xdepth <= 2 || !rs_color[Color_cursor]) ccol1 = Color_fg; else ccol1 = Color_cursor; if (Xdepth <= 2 || !rs_color[Color_cursor2]) ccol2 = Color_bg; else ccol2 = Color_cursor2; /* changed by rev vide cursor patch */ *srp = SET_BGCOLOR(*srp, ccol1); *srp = SET_FGCOLOR(*srp, ccol2); #endif #ifdef MULTICHAR_SET rt1 = *srp & RS_multiMask; if (rt1 == RS_multi1) { if (screen.cur.col < TermWin.bcol - 2 && ((srp[1] & RS_multiMask) == RS_multi2)) morecur = 1; } else if (rt1 == RS_multi2) { if (screen.cur.col > 0 && ((srp[-1] & RS_multiMask) == RS_multi1)) morecur = -1; } if (morecur) { srp += morecur; *srp ^= RS_RVid; } # ifndef NO_CURSORCOLOR if (morecur) { cc2 = *srp & (RS_fgMask | RS_bgMask); *srp = SET_BGCOLOR(*srp, ccol1); *srp = SET_FGCOLOR(*srp, ccol2); } # endif #endif } i = 0; if (oldcursor.row != -1) { /* make sure no outline cursor is left around */ if (screen.cur.row != oldcursor.row || screen.cur.col != oldcursor.col) { if (oldcursor.row < TermWin.nrow && oldcursor.col < TermWin.bcol) { drawn_text[oldcursor.row][oldcursor.col] = 0; #ifdef MULTICHAR_SET if (oldcursormulti) { col = oldcursor.col + oldcursormulti; if (col < TermWin.ncol) drawn_text[oldcursor.row][col] = 0; } #endif } if (focus || !(screen.flags & Screen_VisibleCursor)) oldcursor.row = -1; else i = 1; } } else if (!focus) i = 1; if (i) { oldcursor.row = screen.cur.row; oldcursor.col = screen.cur.col; #ifdef MULTICHAR_SET oldcursormulti = morecur; #endif } /* * E: OK, now the real pass */ for (row = 0; row < TermWin.nrow; row++) { #ifdef THAI char thai_update[TermWin.ncol]; /* update map */ /* compare drawn_text and screen.text and check which to update */ ThaiUpdateMap(screen.text[row+row_offset],drawn_text[row], screen.rend[row+row_offset],drawn_rend[row], thai_update,TermWin.ncol); /* * TODO: Change this algo to scalefont compatible */ thaicol_stp_offset = 0; /* records how many column deficit */ thaicol_dtp_offset = TermWin.ncol - Thai_ColMaxPaint(dtp,TermWin.ncol); /* clean strings before redraw */ for(col = 0; col < TermWin.ncol; col++){ if(!ThaiIsMiddleLineCh(stp[col])) thaicol_stp_offset++; } if(thaicol_stp_offset > thaicol_dtp_offset){ CLEAR_CHARS(Col2Pixel( TermWin.ncol - thaicol_stp_offset ), ypixel - TermWin.font->ascent, thaicol_stp_offset); } #endif scrrow = row + row_offset; stp = screen.text[scrrow]; srp = screen.rend[scrrow]; dtp = drawn_text[row]; drp = drawn_rend[row]; for (col = 0; col < TermWin.ncol; col++) { /* compare new text with old - if exactly the same then continue */ rt1 = srp[col]; /* screen rendition */ rt2 = drp[col]; /* drawn rendition */ #ifdef THAI /* updating conditional */ if (!thai_update[col]) { #else if ((stp[col] == dtp[col]) /* must match characters to skip */ && ((rt1 == rt2) /* either rendition the same or */ || ((stp[col] == ' ') /* space w/ no bg change */ && (GET_BGATTR(rt1) == GET_BGATTR(rt2))))) { #endif #ifdef MULTICHAR_SET /* if first byte is Kanji then compare second bytes */ if ((rt1 & RS_multiMask) != RS_multi1) continue; else if (stp[col + 1] == dtp[col + 1]) { /* assume no corrupt characters on the screen */ col++; continue; } #else continue; #endif } /* redraw one or more characters */ #ifndef THAI /* can not set dtp as we go because it causes * unpredictable results (bug) */ dtp[col] = stp[col]; #endif rend = drp[col] = srp[col]; len = 0; buffer[len++] = stp[col]; ypixel = TermWin.font->ascent + Row2Pixel(row); #ifdef THAI /* compute x coordinate */ xpixel = ThaiCol2Pixel( col, screen.text[scrrow]); #else xpixel = Col2Pixel(col); #endif /* THAI */ wlen = 1; /* * Find out the longest string we can write out at once */ if (fprop == 0) { /* Fixed width font */ #ifdef MULTICHAR_SET if (((rend & RS_multiMask) == RS_multi1) && col < TermWin.ncol - 1 && ((srp[col + 1]) & RS_multiMask) == RS_multi2) { if (!wbyte) { wbyte = 1; XSetFont(Xdisplay, TermWin.gc, TermWin.mfont->fid); draw_string = XDrawString16; draw_image_string = XDrawImageString16; } /* double stepping - we're in Kanji mode */ for (; ++col < TermWin.bcol;) { /* XXX: could check sanity on 2nd byte */ dtp[col] = stp[col]; drp[col] = srp[col]; buffer[len++] = stp[col]; col++; if ((col == TermWin.bcol) || (srp[col] != rend)) break; if ((stp[col] == dtp[col]) && (srp[col] == drp[col]) && (stp[col + 1] == dtp[col + 1])) break; if (len == currmaxcol) break; dtp[col] = stp[col]; drp[col] = srp[col]; buffer[len++] = stp[col]; } col--; if (buffer[0] & 0x80) multichar_decode(buffer, len); wlen = len / 2; } else { if ((rend & RS_multiMask) == RS_multi1) { /* XXX : maybe do the same thing for RS_multi2 */ /* corrupt character - you're outta there */ rend &= ~RS_multiMask; drp[col] = rend; /* TODO check: may also want */ dtp[col] = ' '; /* to poke into stp/srp */ buffer[0] = ' '; } if (wbyte) { wbyte = 0; XSetFont(Xdisplay, TermWin.gc, TermWin.font->fid); draw_string = XDrawString; draw_image_string = XDrawImageString; } #endif /* single stepping - `normal' mode */ for (; ++col < TermWin.ncol - 1;) { if (rend != srp[col]) break; if ((stp[col] == dtp[col]) && (srp[col] == drp[col])) break; if (len == currmaxcol) break; dtp[col] = stp[col]; drp[col] = srp[col]; buffer[len++] = stp[col]; } col--; wlen = len; #ifdef MULTICHAR_SET } #endif } buffer[len] = '\0'; /* * Determine the attributes for the string */ fore = GET_FGCOLOR(rend); back = GET_BGCOLOR(rend); rend = GET_ATTR(rend); gcmask = 0; rvid = (rend & RS_RVid) ? 1 : 0; switch (rend & RS_fontMask) { case RS_acsFont: for (i = 0; i < len; i++) if (buffer[i] == 0x5f) buffer[i] = 0x7f; else if (buffer[i] > 0x5f && buffer[i] < 0x7f) buffer[i] -= 0x5f; break; case RS_ukFont: for (i = 0; i < len; i++) if (buffer[i] == '#') buffer[i] = 0x1e; break; } if (rvid) SWAP_IT(fore, back, i); if( colors_changed) { gcvalue.background = PixColors[back]; gcmask |= GCBackground; gcvalue.foreground = PixColors[fore]; gcmask |= GCForeground; colors_changed = 0 ; }else if (back != Color_bg) { gcvalue.background = PixColors[back]; gcmask |= GCBackground; } if (fore != Color_fg) { gcvalue.foreground = PixColors[fore]; gcmask |= GCForeground; } #ifndef NO_BOLDUNDERLINE else if (rend & RS_Bold) { if (Xdepth > 2 && rs_color[Color_BD] && PixColors[fore] != PixColors[Color_BD] && PixColors[back] != PixColors[Color_BD]) { gcvalue.foreground = PixColors[Color_BD]; gcmask |= GCForeground; # ifndef VERYBOLD rend &= ~RS_Bold; /* we've taken care of it */ # endif } } else if (rend & RS_Uline) { if (Xdepth > 2 && rs_color[Color_UL] && PixColors[fore] != PixColors[Color_UL] && PixColors[back] != PixColors[Color_UL]) { gcvalue.foreground = PixColors[Color_UL]; gcmask |= GCForeground; rend &= ~RS_Uline; /* we've taken care of it */ } } #endif if (gcmask) XChangeGC(Xdisplay, TermWin.gc, gcmask, &gcvalue); #ifndef NO_BOLDFONT if (!wbyte && MONO_BOLD(rend) && TermWin.boldFont != NULL) { bfont = 1; XSetFont(Xdisplay, TermWin.gc, TermWin.boldFont->fid); rend &= ~RS_Bold; /* we've taken care of it */ } else if (bfont) { bfont = 0; XSetFont(Xdisplay, TermWin.gc, TermWin.font->fid); } #endif /* * Actually do the drawing of the string here */ if (fprop) { #ifdef THAI if (rvid && CharWidth(wf,stp[col])>0) { #else if (rvid) { #endif SWAP_IT(gcvalue.foreground, gcvalue.background, ltmp); gcmask |= (GCForeground | GCBackground); XChangeGC(Xdisplay, TermWin.gc, gcmask, &gcvalue); XFillRectangle(Xdisplay, drawBuffer, TermWin.gc, xpixel, ypixel - TermWin.font->ascent, Width2Pixel(1), Height2Pixel(1)); SWAP_IT(gcvalue.foreground, gcvalue.background, ltmp); XChangeGC(Xdisplay, TermWin.gc, gcmask, &gcvalue); } else #ifdef THAI if(CharWidth(wf,stp[col])>0) #endif CLEAR_CHARS(xpixel, ypixel - TermWin.font->ascent, 1); DRAW_STRING(draw_string, xpixel, ypixel, buffer, 1); #ifdef THAI /* * Trap error */ if(wlen > 1) fprintf(stderr, "wlen > 1: %d\n", wlen); #endif #ifndef NO_BOLDOVERSTRIKE if (MONO_BOLD(rend)) DRAW_STRING(draw_string, xpixel + 1, ypixel, buffer, 1); #endif } else #ifdef TRANSPARENT if ((Options & Opt_transparent) && back == Color_bg) { #ifdef THAI if(CharWidth(wf,stp[col])>0) #endif CLEAR_CHARS(xpixel, ypixel - TermWin.font->ascent, len); DRAW_STRING(draw_string, xpixel, ypixel, buffer, wlen); } else #endif #if defined(BACKGROUND_IMAGE) || defined(_MYSTYLE_) if (TermWin.background.trgPixmapSet && back == Color_bg) { CLEAR_CHARS(xpixel, ypixel - TermWin.font->ascent, len); DRAW_STRING(draw_string, xpixel, ypixel, buffer, wlen); } else #endif DRAW_STRING(draw_image_string, xpixel, ypixel, buffer, wlen); #ifndef NO_BOLDOVERSTRIKE # ifdef NO_BOLDOVERSTRIKE_MULTI if (!wbyte) # endif if (MONO_BOLD(rend)) DRAW_STRING(draw_string, xpixel + 1, ypixel, buffer, wlen); #endif if ((rend & RS_Uline) && (TermWin.font->descent > 1)) XDrawLine(Xdisplay, drawBuffer, TermWin.gc, xpixel, ypixel + 1, xpixel + Width2Pixel(len) - 1, ypixel + 1); if (gcmask) { /* restore normal colours */ gcvalue.foreground = PixColors[Color_fg]; gcvalue.background = PixColors[Color_bg]; XChangeGC(Xdisplay, TermWin.gc, gcmask, &gcvalue); } } } #ifdef THAI /* * Hack: update drawn_text */ for (row = 0; row < TermWin.nrow; row++) { scrrow = row + row_offset; stp = screen.text[scrrow]; srp = screen.rend[scrrow]; dtp = drawn_text[row]; drp = drawn_rend[row]; for(col=0 ; col= 0 && currow < TermWin.nrow) { #ifndef NO_CURSORCOLOR gcmask = 0; if (Xdepth > 2 && rs_color[Color_cursor]) { gcvalue.foreground = PixColors[Color_cursor]; gcmask = GCForeground; XChangeGC(Xdisplay, TermWin.gc, gcmask, &gcvalue); gcvalue.foreground = PixColors[Color_fg]; } #endif #ifdef THAI XDrawRectangle(Xdisplay, drawBuffer, TermWin.gc, ThaiCol2Pixel(col,screen.text[screen.cur.row+TermWin.saveLines]), Row2Pixel(currow), Width2Pixel(1 + wbyte) - 1, Height2Pixel(1) - 1); #else XDrawRectangle(Xdisplay, drawBuffer, TermWin.gc, Col2Pixel(col), Row2Pixel(currow), Width2Pixel(1 + wbyte) - 1, Height2Pixel(1) - 1); #endif #ifndef NO_CURSORCOLOR if (gcmask) /* restore normal colours */ XChangeGC(Xdisplay, TermWin.gc, gcmask, &gcvalue); #endif } } } /* * G: cleanup selection */ scr_reverse_selection(); /* * H: other general cleanup */ if (boldlast && TermWin.bMapped) /* clear the whole screen height */ XClearArea(Xdisplay, TermWin.vt, TermWin_TotalWidth() - 2, 0, 1, TermWin_TotalHeight() - 1, 0); if (type & SMOOTH_REFRESH) XSync(Xdisplay, False); } /* PROTO */ void scr_clear_tint(int bWithTinting) { if( !TermWin.bMapped ) return ; #ifdef TRANSPARENT if (Options & Opt_transparent) { /* int n ; fprintf( stderr, "\n Clearing Parents ..."); for( n = 0 ; n < ParentWinNum ; n++ ) */ XClearWindow(Xdisplay, TermWin.parent); /* XFlush( Xdisplay ); sleep(5); fprintf( stderr, "Done."); */ } #endif XClearWindow(Xdisplay, TermWin.vt); #if defined(BACKGROUND_IMAGE) || defined(TRANSPARENT) if (TermWin.tintGC && bWithTinting) { XFillRectangle(Xdisplay, TermWin.vt, TermWin.tintGC, 0, 0, TermWin.width+TermWin_internalBorders, TermWin.height+TermWin_internalBorders); } #endif } /* ------------------------------------------------------------------------- */ /* colors has changed so we have to repaint self */ /* PROTO */ void on_colors_changed(int idx) { colors_changed = 1 ; if ( idx == Color_bg && #ifdef BACKGROUND_IMAGE TermWin.background.trgPixmapSet == 0 && #endif !(Options & Opt_transparent)) { XSetWindowBackground(Xdisplay, TermWin.vt, PixColors[Color_bg]); } /* handle Color_BD, scrollbar background, etc. */ set_colorfgbg(); set_cursor_color(); /* the only reasonable way to enforce a clean update : */ scr_clear(); scr_touch(); } /* ------------------------------------------------------------------------- */ /* PROTO */ void scr_reverse_selection(void) { int i, col, row, end_row; rend_t *srp; end_row = TermWin.saveLines - TermWin.view_start; if (selection.op && current_screen == selection.screen) { i = selection.beg.row + TermWin.saveLines; row = selection.end.row + TermWin.saveLines; if (i >= end_row) col = selection.beg.col; else { col = 0; i = end_row; } end_row += TermWin.nrow; for (; i < row && i < end_row; i++, col = 0) for (srp = screen.rend[i]; col < TermWin.bcol; col++) srp[col] ^= RS_RVid; if (i == row && i < end_row) for (srp = screen.rend[i]; col < selection.end.col; col++) srp[col] ^= RS_RVid; } } /* ------------------------------------------------------------------------- * * CHARACTER SELECTION * * ------------------------------------------------------------------------- */ /* * -TermWin.nscrolled <= (selection row) <= TermWin.nrow - 1 */ /* PROTO */ void selection_check(int check_more) { row_col_t pos; if ((selection.beg.row < -TermWin.nscrolled) || (selection.beg.row >= TermWin.nrow) || (selection.mark.row < -TermWin.nscrolled) || (selection.mark.row >= TermWin.nrow) || (selection.end.row < -TermWin.nscrolled) || (selection.end.row >= TermWin.nrow)) CLEAR_ALL_SELECTION; if (check_more == 1 && current_screen == selection.screen) { /* check for cursor position */ pos.row = screen.cur.row; pos.col = screen.cur.col; if (!ROWCOL_IS_BEFORE(pos, selection.beg) && ROWCOL_IS_BEFORE(pos, selection.end)) CLEAR_SELECTION; } else if (check_more == 2) { pos.row = 0; pos.col = 0; if (ROWCOL_IS_BEFORE(selection.beg, pos) && ROWCOL_IS_AFTER(selection.end, pos)) CLEAR_SELECTION; } else if (check_more == 3) { pos.row = 0; pos.col = 0; if (ROWCOL_IS_AFTER(selection.end, pos)) CLEAR_SELECTION; } } /* ------------------------------------------------------------------------- */ /* * Paste a selection direct to the command */ /* PROTO */ void PasteIt(unsigned char *data, unsigned int nitems) { int num; unsigned char *p, cr; cr = '\r'; for (p = data, num = 0; nitems--; p++) if (*p != '\n') num++; else { tt_write(data, num); tt_write(&cr, 1); data += (num + 1); num = 0; } if (num) tt_write(data, num); } static void paste_text_property(XTextProperty *ct) { int dummy_count; char **cl; if (XmbTextPropertyToTextList(Xdisplay, ct, &cl, &dummy_count) == Success && cl) { PasteIt(cl[0], strlen(cl[0])); XFreeStringList(cl); }else PasteIt(ct->value, (unsigned int)ct->nitems); } /* ------------------------------------------------------------------------- */ /* * Respond to a notification that a primary selection has been sent * EXT: SelectionNotify */ /* PROTO */ void selection_paste(Window win, unsigned prop, int Delete) { unsigned long bytes_after; XTextProperty ct; XEvent ev; XWindowAttributes wa; if (prop == None) { if (selection.type == 0) { selection.type++; XConvertSelection(Xdisplay, XA_PRIMARY, aterm_XA_UTF8_STRING, aterm_XA_VT_SELECTION, TermWin.vt,selection.request_time); } else if (selection.type == 1) { selection.type++; XConvertSelection(Xdisplay, XA_PRIMARY, XA_STRING, aterm_XA_VT_SELECTION, TermWin.vt,selection.request_time); } return; } ct.value = NULL ; if ((XGetWindowProperty(Xdisplay, win, prop, 0, ~0, False, AnyPropertyType, &ct.encoding, &ct.format, &ct.nitems, &bytes_after, &ct.value) == Success)) { if (ct.encoding == aterm_XA_INCR) {/* This is an INCR (incremental large) paste */ Bool success = True; XGetWindowAttributes(Xdisplay, win, &wa); if ( !get_flags(wa.your_event_mask, PropertyChangeMask) ) /* We need to register the PropertyNotify event */ XSelectInput(Xdisplay, win, (wa.your_event_mask | PropertyChangeMask) ); XDeleteProperty(Xdisplay, win, prop); do { XWindowEvent(Xdisplay, win, PropertyChangeMask, &ev); if (ev.xproperty.state != PropertyNewValue) continue; success = ( XGetWindowProperty(Xdisplay, win, prop, 0, ~0, True, AnyPropertyType, &ct.encoding, &ct.format, &ct.nitems, &bytes_after, &ct.value) == Success); if( success && ct.nitems > 0) { paste_text_property(&ct); XFree(ct.value); ct.value = NULL ; } }while ( success && ct.nitems > 0); if( !get_flags(wa.your_event_mask, PropertyChangeMask) ) /* We need to unregister the PropertyNotify event */ XSelectInput(Xdisplay, win, wa.your_event_mask); }else {/* This is a normal 1-time paste */ if (Delete) XDeleteProperty(Xdisplay, win, prop); paste_text_property(&ct); } } if( ct.value ) XFree(ct.value); } /* ------------------------------------------------------------------------- */ /* * Request the current primary selection * EXT: button 2 release */ /* PROTO */ void selection_request(Time tm, int x, int y) { selection.request_time = tm; if (selection.text != NULL) { PasteIt(selection.text, selection.len); /* internal selection */ } else if (XGetSelectionOwner(Xdisplay, XA_PRIMARY) == None) { selection_paste(Xroot, XA_CUT_BUFFER0, False); } else { selection.type = 1; /* "fix" for the high-ascii pasting? : */ /* may need to try all three : aterm_XA_UTF8_STRING, _XA_COMPAUND_TEXT and XA_STRING in that order */ XConvertSelection(Xdisplay, XA_PRIMARY, XA_STRING, aterm_XA_VT_SELECTION, TermWin.vt,tm); /* XConvertSelection(Xdisplay, XA_PRIMARY, _XA_COMPAUND_TEXT, prop, TermWin.vt,tm); */ } } #if 0 /* Here is how this is implemented in yudit : */ SString SX11Impl::getSelectionData (Atom dataName, Atom dataType, long id, Time _time) { // use encoder to encode. XEvent xevent; time_t start; Atom propty; propty = toAtom ("YUDIT_SELECTION");; XConvertSelection (display, dataName, dataType, propty, (Window)id, _time ); XFlush (display); for (start = time (0); ; ) { if (XCheckTypedWindowEvent(display, (Window)id, SelectionNotify, &xevent)) { break; } if (time (0) - start >= 8) { fprintf (stderr, "warn: clipboard timeout.\n"); return SString(); } } return getPropertyData (xevent.xselection.requestor, propty, 8); } /** * get an utf-8 string from clipboard. * FIXME */ SString SX11Impl::getClipUTF8(long id) { Window owner; SEncoder utf8e; // If we own the selection ourselves, no need for interprocess // communication. if (clipOwner==(owner=XGetSelectionOwner (display, XA_PRIMARY))) { return SString(clipBuffer); } clipBuffer.clear(); clipOwner = None; // Try UTF8_STRING first. clipBuffer = getSelectionData (XA_PRIMARY, toAtom("UTF8_STRING"), id, CurrentTime); if (clipBuffer.size()) { //fprintf (stderr, "SX11Impl::getClipUTF8: got UTF8_STRING\n"); return SString(clipBuffer); } // Then try COMPOUND_TEXT. clipBuffer = getSelectionData (XA_PRIMARY, toAtom("COMPOUND_TEXT"), id, CurrentTime); if (clipBuffer.size()) { //fprintf (stderr, "SX11Impl::getClipUTF8: got COMPOUND_TEXT\n"); clipBuffer = utf8e.encode (encoder.decode(clipBuffer)); return SString (clipBuffer); } // Finally try STRING. clipBuffer = getSelectionData (XA_PRIMARY, XA_STRING, id, CurrentTime); if (clipBuffer.size()) { //fprintf (stderr, "SX11Impl::getClipUTF8: got XA_STRING\n"); SEncoder iso_1("iso-8859-1"); clipBuffer = utf8e.encode (iso_1.decode(clipBuffer)); return SString (clipBuffer); } return SString(clipBuffer); } #endif /* ------------------------------------------------------------------------- */ /* * Clear all selected text * EXT: SelectionClear */ /* PROTO */ void selection_clear(void) { D_SELECT((stderr, "selection_clear()")); if (selection.text) FREE(selection.text); selection.text = NULL; selection.len = 0; CLEAR_SELECTION; } /* ------------------------------------------------------------------------- */ /* * Copy a selection into the cut buffer * EXT: button 1 or 3 release */ /* PROTO */ void selection_make(Time tm, unsigned int key_state) { int i, col, end_col, row, end_row; unsigned char *new_selection_text; char *str; text_t *t; D_SELECT((stderr, "selection_make(): selection.op=%d, selection.clicks=%d", selection.op, selection.clicks)); switch (selection.op) { case SELECTION_CONT: break; case SELECTION_INIT: CLEAR_SELECTION; /* FALLTHROUGH */ case SELECTION_BEGIN: selection.op = SELECTION_DONE; /* FALLTHROUGH */ default: return; } selection.op = SELECTION_DONE; if (selection.clicks == 4) return; /* nothing selected, go away */ i = (selection.end.row - selection.beg.row + 1) * (TermWin.bcol + 1) + 1; str = MALLOC(i * sizeof(char)); new_selection_text = (unsigned char *) str; col = max((int)selection.beg.col, 0); row = selection.beg.row + TermWin.saveLines; end_row = selection.end.row + TermWin.saveLines; /* * A: rows before end row */ for (; row < end_row; row++) { t = &(screen.text[row][col]); if ((end_col = screen.tlen[row]) == -1) end_col = TermWin.bcol; for (; col < end_col; col++) *str++ = *t++; col = 0; if (screen.tlen[row] != -1) *str++ = '\n'; } /* * B: end row */ t = &(screen.text[row][col]); end_col = screen.tlen[row]; if (end_col == -1 || selection.end.col <= end_col) end_col = selection.end.col; MIN_IT(end_col, TermWin.bcol); /* CHANGE */ for (; col < end_col; col++) *str++ = *t++; if (end_col != selection.end.col) *str++ = '\n'; *str = '\0'; if ((i = strlen((char *) new_selection_text)) == 0) { FREE(new_selection_text); return; } selection.len = i; if (selection.text) FREE(selection.text); selection.text = new_selection_text; // selecting with ALT will put the text to clipboard if (key_state & Mod1Mask) { XSetSelectionOwner(Xdisplay, aterm_XA_CLIPBOARD, TermWin.vt, tm); } else { XSetSelectionOwner(Xdisplay, XA_PRIMARY, TermWin.vt, tm); } if (XGetSelectionOwner(Xdisplay, XA_PRIMARY) != TermWin.vt) print_error("can't get primary selection"); XChangeProperty(Xdisplay, Xroot, XA_CUT_BUFFER0, XA_STRING, 8, PropModeReplace, selection.text, selection.len); D_SELECT((stderr, "selection_make(): selection.len=%d", selection.len)); } /* ------------------------------------------------------------------------- */ /* * Mark or select text based upon number of clicks: 1, 2, or 3 * EXT: button 1 press */ /* PROTO */ void selection_click(int clicks, int x, int y) { /* int r, c; * row_col_t ext_beg, ext_end; */ D_SELECT((stderr, "selection_click(%d, %d, %d)", clicks, x, y)); clicks = ((clicks - 1) % 3) + 1; selection.clicks = clicks; /* save clicks so extend will work */ #ifdef THAI selection_start_colrow(ThaiPixel2Col(x,y), Pixel2Row(y)); #else selection_start_colrow(Pixel2Col(x), Pixel2Row(y)); #endif if (clicks == 2 || clicks == 3) selection_extend_colrow(selection.mark.col, selection.mark.row + TermWin.view_start, 0, /* button 3 */ 1, /* button press */ 0); /* click change */ } /* ------------------------------------------------------------------------- */ /* * Mark a selection at the specified col/row */ /* PROTO */ void selection_start_colrow(int col, int row) { selection.mark.col = col; selection.mark.row = row - TermWin.view_start; MAX_IT(selection.mark.row, -TermWin.nscrolled); MIN_IT(selection.mark.row, TermWin.nrow - 1); MAX_IT(selection.mark.col, 0); MIN_IT(selection.mark.col, TermWin.bcol - 1); if (selection.op) { /* clear the old selection */ selection.beg.row = selection.end.row = selection.mark.row; selection.beg.col = selection.end.col = selection.mark.col; } selection.op = SELECTION_INIT; selection.screen = current_screen; } /* ------------------------------------------------------------------------- */ /* * Word select: select text for 2 clicks * We now only find out the boundary in one direction */ /* what do we want: spaces/tabs are delimiters or cutchars or non-cutchars */ #define DELIMIT_TEXT(x) \ (((x) == ' ' || (x) == '\t') ? 2 : (strchr(rs_cutchars, (x)) != NULL)) #ifdef MULTICHAR_SET # define DELIMIT_REND(x) (((x) & RS_multiMask) ? 1 : 0) #else # define DELIMIT_REND(x) 1 #endif /* PROTO */ void selection_delimit_word(int dirn, row_col_t * mark, row_col_t * ret) { int col, row, dirnadd, tcol, trow, w1, w2; row_col_t bound; text_t *stp; rend_t *srp; if (selection.clicks != 2) return; /* Go away: we only handle double clicks */ if (dirn == UP) { bound.row = TermWin.saveLines - TermWin.nscrolled - 1; bound.col = 0; dirnadd = -1; } else { bound.row = TermWin.saveLines + TermWin.nrow; bound.col = TermWin.bcol - 1; dirnadd = 1; } row = mark->row + TermWin.saveLines; col = mark->col; MAX_IT(col, 0); /* find the edge of a word */ stp = &(screen.text[row][col]); w1 = DELIMIT_TEXT(*stp); #ifdef OLD_WORD_SELECTION if (w1 == 1) { stp += dirnadd; if (DELIMIT_TEXT(*stp) == 1) goto Old_Word_Selection_You_Die; col += dirnadd; srp += dirnadd; } w1 = 0; #endif srp = (&screen.rend[row][col]); w2 = DELIMIT_REND(*srp); for (;;) { for (; col != bound.col; col += dirnadd) { stp += dirnadd; if (DELIMIT_TEXT(*stp) != w1) break; srp += dirnadd; if (DELIMIT_REND(*srp) != w2) break; } if ((col == bound.col) && (row != bound.row)) { if (screen.tlen[(row - (dirn == UP))] == -1) { trow = row + dirnadd; tcol = (dirn == UP) ? (TermWin.bcol - 1) : 0; if (screen.text[trow] == NULL) break; stp = &(screen.text[trow][tcol]); srp = &(screen.rend[trow][tcol]); if (DELIMIT_TEXT(*stp) != w1 || DELIMIT_REND(*srp) != w2) break; row = trow; col = tcol; continue; } } break; } #ifdef OLD_WORD_SELECTION Old_Word_Selection_You_Die: #endif D_SELECT((stderr, "selection_delimit_word(%s,...) @ (r:%3d, c:%3d) has boundary (r:%3d, c:%3d)", (dirn == UP ? "up " : "down"), mark->row, mark->col, row - TermWin.saveLines, col)); if (dirn == DN) col++; /* put us on one past the end */ /* Poke the values back in */ ret->row = row - TermWin.saveLines; ret->col = col; } /* ------------------------------------------------------------------------- */ /* * Extend the selection to the specified x/y pixel location * EXT: button 3 press; button 1 or 3 drag * flag == 0 ==> button 1 * flag == 1 ==> button 3 press * flag == 2 ==> button 3 motion */ /* PROTO */ void selection_extend(int x, int y, int flag) { int col, row; #ifdef THAI col = ThaiPixel2Col( x, y); #else col = Pixel2Col(x); #endif row = Pixel2Row(y); MAX_IT(row, 0); MIN_IT(row, TermWin.nrow - 1); MAX_IT(col, 0); MIN_IT(col, TermWin.bcol); #ifndef OLD_SELECTION /* * If we're selecting characters (single click) then we must check first * if we are at the same place as the original mark. If we are then * select nothing. Otherwise, if we're to the right of the mark, you have to * be _past_ a character for it to be selected. */ if (((selection.clicks % 3) == 1) && !flag && (col == selection.mark.col && (row == selection.mark.row + TermWin.view_start))) { /* select nothing */ selection.beg.row = selection.end.row = 0; selection.beg.col = selection.end.col = 0; selection.clicks = 4; D_SELECT((stderr, "selection_extend() selection.clicks = 4")); return; } #endif if (selection.clicks == 4) selection.clicks = 1; selection_extend_colrow(col, row, !!flag, /* ? button 3 */ flag == 1 ? 1 : 0, /* ? button press */ 0); /* no click change */ } /* ------------------------------------------------------------------------- */ /* * Extend the selection to the specified col/row */ /* PROTO */ void selection_extend_colrow(int col, int row, int button3, int buttonpress, int clickchange) { int end_col; row_col_t pos; enum { LEFT, RIGHT } closeto = RIGHT; #ifdef MULTICHAR_SET int c, r; #endif D_SELECT((stderr, "selection_extend_colrow(c:%d, r:%d, %d, %d) clicks:%d", col, row, button3, buttonpress, selection.clicks)); D_SELECT((stderr, "selection_extend_colrow() ENT b:(r:%d,c:%d) m:(r:%d,c:%d), e:(r:%d,c:%d)", selection.beg.row, selection.beg.col, selection.mark.row, selection.mark.col, selection.end.row, selection.end.col)); switch (selection.op) { case SELECTION_INIT: CLEAR_SELECTION; selection.op = SELECTION_BEGIN; /* FALLTHROUGH */ case SELECTION_BEGIN: if (row != selection.mark.row || col != selection.mark.col || (!button3 && buttonpress)) selection.op = SELECTION_CONT; break; case SELECTION_DONE: selection.op = SELECTION_CONT; /* FALLTHROUGH */ case SELECTION_CONT: break; case SELECTION_CLEAR: selection_start_colrow(col, row); /* FALLTHROUGH */ default: return; } pos.col = col; pos.row = row; pos.row -= TermWin.view_start; /* adjust for scroll */ #ifdef OLD_SELECTION /* * This mimics some of the selection behaviour of version 2.20 and before. * There are no ``selection modes'', button3 is always character extension. * Note: button3 drag is always available, c.f. v2.20 * Selection always terminates (left or right as appropriate) at the mark. */ { static int hate_those_clicks = 0; /* a.k.a. keep mark position */ if (selection.clicks == 1 || button3) { if (hate_those_clicks) { selection.mark.row = selection.beg.row; selection.mark.col = selection.beg.col; hate_those_clicks = 0; } if (ROWCOL_IS_BEFORE(pos, selection.beg)) { selection.end.row = selection.beg.row; selection.end.col = selection.beg.col + 1; selection.beg.row = pos.row; selection.beg.col = pos.col; } else { selection.beg.row = selection.mark.row; selection.beg.col = selection.mark.col; selection.end.row = pos.row; selection.end.col = pos.col + 1; } } else if (selection.clicks == 2) { selection_delimit_word(UP, &(selection.mark), &(selection.beg)); selection_delimit_word(DN, &(selection.mark), &(selection.end)); hate_those_clicks = 1; } else if (selection.clicks == 3) { selection.beg.row = selection.end.row = selection.mark.row; selection.beg.col = 0; selection.end.col = TermWin.bcol; hate_those_clicks = 1; } } #else /* ! OLD_SELECTION */ /* * This is mainly xterm style selection with a couple of differences, mainly * in the way button3 drag extension works. * We're either doing: button1 drag; button3 press; or button3 drag * a) button1 drag : select around a midpoint/word/line - that point/word/line * is always at the left/right edge of the selection. * b) button3 press: extend/contract character/word/line at whichever edge of * the selection we are closest to. * c) button3 drag : extend/contract character/word/line - we select around * a point/word/line which is either the start or end of the selection * and it was decided by whichever point/word/line was `fixed' at the * time of the most recent button3 press */ if (button3 && buttonpress) { /* button3 press */ /* * first determine which edge of the selection we are closest to */ if (ROWCOL_IS_BEFORE(pos, selection.beg) || (!ROWCOL_IS_AFTER(pos, selection.end) && (((pos.col - selection.beg.col) + ((pos.row - selection.beg.row) * TermWin.bcol)) < ((selection.end.col - pos.col) + ((selection.end.row - pos.row) * TermWin.bcol))))) closeto = LEFT; if (closeto == LEFT) { selection.beg.row = pos.row; selection.beg.col = pos.col; selection.mark.row = selection.end.row; selection.mark.col = selection.end.col - (selection.clicks == 2); } else { selection.end.row = pos.row; selection.end.col = pos.col; selection.mark.row = selection.beg.row; selection.mark.col = selection.beg.col; } } else { /* button1 drag or button3 drag */ if (ROWCOL_IS_AFTER(selection.mark, pos)) { if ((selection.mark.row == selection.end.row) && (selection.mark.col == selection.end.col) && clickchange && selection.clicks == 2) selection.mark.col--; selection.beg.row = pos.row; selection.beg.col = pos.col; selection.end.row = selection.mark.row; selection.end.col = selection.mark.col + (selection.clicks == 2); } else { selection.beg.row = selection.mark.row; selection.beg.col = selection.mark.col; selection.end.row = pos.row; selection.end.col = pos.col; } } if (selection.clicks == 1) { end_col = screen.tlen[selection.beg.row + TermWin.saveLines]; if (end_col != -1 && selection.beg.col > end_col) { #if 1 selection.beg.col = TermWin.bcol; #else if (selection.beg.row != selection.end.row) selection.beg.col = TermWin.bcol; else selection.beg.col = selection.mark.col; #endif } end_col = screen.tlen[selection.end.row + TermWin.saveLines]; if (end_col != -1 && selection.end.col > end_col) selection.end.col = TermWin.bcol; # ifdef MULTICHAR_SET if (selection.beg.col > 0) { r = selection.beg.row + TermWin.saveLines; c = selection.beg.col; if (((screen.rend[r][c] & RS_multiMask) == RS_multi2) && ((screen.rend[r][c - 1] & RS_multiMask) == RS_multi1)) selection.beg.col--; } if (selection.end.col < TermWin.bcol) { r = selection.end.row + TermWin.saveLines; c = selection.end.col; if (((screen.rend[r][c - 1] & RS_multiMask) == RS_multi1) && ((screen.rend[r][c] & RS_multiMask) == RS_multi2)) selection.end.col++; } # endif /* MULTICHAR_SET */ } else if (selection.clicks == 2) { if (ROWCOL_IS_AFTER(selection.end, selection.beg)) selection.end.col--; selection_delimit_word(UP, &(selection.beg), &(selection.beg)); selection_delimit_word(DN, &(selection.end), &(selection.end)); } else if (selection.clicks == 3) { if (ROWCOL_IS_AFTER(selection.mark, selection.beg)) selection.mark.col++; selection.beg.col = 0; selection.end.col = TermWin.bcol; } if (button3 && buttonpress) { /* mark may need to be changed */ if (closeto == LEFT) { selection.mark.row = selection.end.row; selection.mark.col = selection.end.col - (selection.clicks == 2); } else { selection.mark.row = selection.beg.row; selection.mark.col = selection.beg.col; } } #endif /* ! OLD_SELECTION */ D_SELECT((stderr, "selection_extend_colrow() EXIT b:(r:%d,c:%d) m:(r:%d,c:%d), e:(r:%d,c:%d)", selection.beg.row, selection.beg.col, selection.mark.row, selection.mark.col, selection.end.row, selection.end.col)); } /* ------------------------------------------------------------------------- */ /* * Double click on button 3 when already selected * EXT: button 3 double click */ /* PROTO */ void selection_rotate(int x, int y) { selection.clicks = selection.clicks % 3 + 1; #ifdef THAI selection_extend_colrow(ThaiPixel2Col(x,y), Pixel2Row(y), 1, 0, 1); #else selection_extend_colrow(Pixel2Col(x), Pixel2Row(y), 1, 0, 1); #endif } /* ------------------------------------------------------------------------- */ #ifdef USE_ATOM32 /* * On some systems, the Atom typedef is 64 bits wide. We need to have a type * that is exactly 32 bits wide, because a format of 64 is not allowed by * the X11 protocol. */ typedef CARD32 Atom32; #endif /* ------------------------------------------------------------------------- */ /* * Respond to a request for our current selection * EXT: SelectionRequest */ /* PROTO */ void selection_send(XSelectionRequestEvent * rq) { /* Changes are from rxvt. This fixes #205040. */ XEvent ev; #ifdef USE_ATOM32 Atom32 target_list[4]; #else Atom target_list[4]; #endif Atom target; XTextProperty ct; XICCEncodingStyle style; char *cl[4]; ev.xselection.type = SelectionNotify; ev.xselection.property = None; ev.xselection.display = rq->display; ev.xselection.requestor = rq->requestor; ev.xselection.selection = rq->selection; ev.xselection.target = rq->target; ev.xselection.time = rq->time; if (rq->target == aterm_XA_TARGETS) { #ifdef USE_ATOM32 target_list[0] = (Atom32) aterm_XA_TARGETS; target_list[1] = (Atom32) XA_STRING; target_list[2] = (Atom32) aterm_XA_TEXT; target_list[3] = (Atom32) _XA_COMPAUND_TEXT; XChangeProperty(Xdisplay, rq->requestor, rq->property, rq->target, (8 * sizeof(target_list[0])), PropModeReplace, (unsigned char *)target_list, (sizeof(target_list) / sizeof(target_list[0]))); #else target_list[0] = aterm_XA_TARGETS; target_list[1] = XA_STRING; target_list[2] = aterm_XA_TEXT; target_list[3] = _XA_COMPAUND_TEXT; XChangeProperty(Xdisplay, rq->requestor, rq->property, XA_ATOM, 32, PropModeReplace, (unsigned char *)target_list, (sizeof(target_list) / sizeof(target_list[0]))); #endif ev.xselection.property = rq->property; } else if (rq->target == XA_STRING || rq->target == _XA_COMPAUND_TEXT || rq->target == aterm_XA_TEXT) { if (rq->target == XA_STRING) { style = XStringStyle; target = XA_STRING; } else { target = _XA_COMPAUND_TEXT; style = (rq->target == _XA_COMPAUND_TEXT) ? XCompoundTextStyle : XStdICCTextStyle; } cl[0] = selection.text; XmbTextListToTextProperty(Xdisplay, cl, 1, style, &ct); XChangeProperty(Xdisplay, rq->requestor, rq->property, target, 8, PropModeReplace, ct.value, ct.nitems); ev.xselection.property = rq->property; } XSendEvent(Xdisplay, rq->requestor, False, 0, &ev); } /* ------------------------------------------------------------------------- * * MOUSE ROUTINES * * ------------------------------------------------------------------------- */ /* * return col/row values corresponding to x/y pixel values */ /* PROTO */ void pixel_position(int *x, int *y) { #ifdef THAI *x = ThaiPixel2Col(*x, *y); #else *x = Pixel2Col(*x); #endif /* MAX_IT(*x, 0); MIN_IT(*x, TermWin.bcol - 1); */ *y = Pixel2Row(*y); /* MAX_IT(*y, 0); MIN_IT(*y, TermWin.nrow - 1); */ } /* ------------------------------------------------------------------------- */ /* ARGSUSED */ /* PROTO */ void mouse_tracking(int report, int x, int y, int firstrow, int lastrow) { /* TODO */ } /* ------------------------------------------------------------------------- * * DEBUG ROUTINES * * ------------------------------------------------------------------------- */ /* ARGSUSED */ /* PROTO */ void debug_PasteIt(unsigned char *data, int nitems) { /* TODO */ } /* ------------------------------------------------------------------------- */ /* PROTO */ void debug_colors(void) { int color; char *name[] = {"fg", "bg", "black", "red", "green", "yellow", "blue", "magenta", "cyan", "white"}; fprintf(stderr, "Color ( "); if (rstyle & RS_RVid) fprintf(stderr, "rvid "); if (rstyle & RS_Bold) fprintf(stderr, "bold "); if (rstyle & RS_Blink) fprintf(stderr, "blink "); if (rstyle & RS_Uline) fprintf(stderr, "uline "); fprintf(stderr, "): "); color = GET_FGCOLOR(rstyle); #ifndef NO_BRIGHTCOLOR if (color >= minBrightCOLOR && color <= maxBrightCOLOR) { color -= (minBrightCOLOR - minCOLOR); fprintf(stderr, "bright "); } #endif fprintf(stderr, "%s on ", name[color]); color = GET_BGCOLOR(rstyle); #ifndef NO_BRIGHTCOLOR if (color >= minBrightCOLOR && color <= maxBrightCOLOR) { color -= (minBrightCOLOR - minCOLOR); fprintf(stderr, "bright "); } #endif fprintf(stderr, "%s\n", name[color]); } #ifdef USE_XIM /* PROTO */ void setPosition(XPoint *pos) { XWindowAttributes xwa ; XGetWindowAttributes( Xdisplay, TermWin.vt, &xwa ) ; pos->x = Col2Pixel ( screen.cur.col ) + xwa.x; pos->y = Height2Pixel((screen.cur.row + 1)) + xwa.y; return ; } #endif aterm-1.0.1/src/screen.h0000644000175000001440000001315610173532607013544 0ustar vaeusers/* * $Id: screen.h,v 1.2 2005/01/19 19:31:19 sasha Exp $ */ #ifndef _SCREEN_H /* include once only */ #define _SCREEN_H typedef unsigned char text_t; #if defined(MULTICHAR_SET) typedef R_u_int32_t rend_t; #else typedef R_u_int16_t rend_t; #endif /* * screen accounting: * screen_t elements * text: Contains all text information including the scrollback buffer. * Each line is length TermWin.ncol * tlen: The length of the line or -1 for wrapped lines. * rend: Contains rendition information: font, bold, colour, etc. * * Note: Each line for both text and rend are only allocated on demand, and * text[x] is allocated <=> rend[x] is allocated for all x. * row: Cursor row position : 0 <= row < TermWin.nrow * col: Cursor column position : 0 <= col < TermWin.ncol * tscroll: Scrolling region top row inclusive : 0 <= row < TermWin.nrow * bscroll: Scrolling region bottom row inclusive : 0 <= row < TermWin.nrow * Horizontal scroll region : * lscroll: Scrolling region left column inclusive: 0 <= col < TermWin.min_bcol * rscroll: Scrolling region right column inclusive : 0 <= col < TermWin.min_bcol * * selection_t elements * clicks: 1, 2 or 3 clicks - 4 indicates a special condition of 1 where * nothing is selected * beg: row/column of beginning of selection : never past mark * mark: row/column of initial click : never past end * end: row/column of one character past end of selection * * Note: -TermWin.nscrolled <= beg.row <= mark.row <= end.row < TermWin.nrow * * Note: col == -1 ==> we're left of screen * * TermWin.saveLines: * Maximum number of lines in the scrollback buffer. * This is fixed for each rxvt instance. * TermWin.nscrolled: * Actual number of lines we've used of the scrollback buffer * 0 <= TermWin.nscrolled <= TermWin.saveLines * TermWin.view_start: * Offset back into the scrollback buffer for out current view * 0 <= TermWin.view_start <= TermWin.nscrolled * * Layout of text/rend information in the screen_t text/rend structures: * Rows [0] ... [TermWin.saveLines - 1] * scrollback region : we're only here if TermWin.view_start != 0 * Rows [TermWin.saveLines] ... [TermWin.saveLines + TermWin.nrow - 1] * normal `unscrolled' screen region */ typedef struct { text_t **text; /* _all_ the text */ R_int16_t *tlen; /* length of each text line */ rend_t **rend; /* rendition, uses RS_ flags */ row_col_t cur; /* cursor position on the screen */ R_int16_t tscroll, /* top of settable scroll region */ bscroll, /* bottom of settable scroll region */ rscroll, /* right of settable scroll region */ lscroll, /* left of settable scroll region */ charset; /* character set number [0..3] */ unsigned int flags; /* see below */ } screen_t; typedef struct { row_col_t cur; /* cursor position */ R_int16_t charset; /* character set number [0..3] */ char charset_char; rend_t rstyle; /* rendition style */ } save_t; typedef struct { unsigned char *text; /* selected text */ int len; /* length of selected text */ enum { SELECTION_CLEAR = 0, /* nothing selected */ SELECTION_INIT, /* marked a point */ SELECTION_BEGIN, /* started a selection */ SELECTION_CONT, /* continued selection */ SELECTION_DONE /* selection put in CUT_BUFFER0 */ } op; /* current operation */ short screen; /* screen being used */ short clicks; /* number of clicks */ row_col_t beg, mark, end; char type; int request_time; } selection_t; /* ------------------------------------------------------------------------- */ /* screen_t flags */ #define Screen_Relative (1<<0) /* relative origin mode flag */ #define Screen_VisibleCursor (1<<1) /* cursor visible? */ #define Screen_Autowrap (1<<2) /* auto-wrap flag */ #define Screen_Insert (1<<3) /* insert mode (vs. overstrike) */ #define Screen_WrapNext (1<<4) /* need to wrap for next char? */ #define Screen_DefaultFlags (Screen_VisibleCursor|Screen_Autowrap) /* ------------------------------------------------------------------------- * * MODULE VARIABLES * * ------------------------------------------------------------------------- */ #ifdef INTERN_SCREEN # define EXTSCR #else # define EXTSCR extern #endif /* This tells what's actually on the screen */ EXTSCR text_t **drawn_text; EXTSCR rend_t **drawn_rend; EXTSCR text_t **buf_text; EXTSCR rend_t **buf_rend; EXTSCR R_int16_t *buf_tlen; EXTSCR char *tabs; /* a 1 for a location with a tab-stop */ EXTSCR screen_t swap; EXTSCR save_t save; EXTSCR selection_t selection; EXTSCR char charsets[4]; EXTSCR short current_screen; EXTSCR rend_t rstyle; EXTSCR short rvideo; #define scr_clear() scr_clear_tint(1) #endif /* repeat inclusion protection */ aterm-1.0.1/src/rmemset.c0000644000175000001440000000501710144447053013727 0ustar vaeusers/*---------------------------------------------------------------------------* * File: rmemset.c *---------------------------------------------------------------------------* * Copyright (C) 1997,1998 Geoff Wing * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------* * Originally written: * 1997,1998 Geoff Wing *--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------* * Fast memset() * presumptions: * 1) R_int_p_t write the best * 2) SIZEOF_INT_P= power of 2 *--------------------------------------------------------------------------*/ #ifndef lint static const char rcsid[] = "$Id: rmemset.c,v 1.1.1.1 2004/11/10 17:21:47 sasha Exp $"; #endif #include "rxvt.h" /* NECESSARY */ #ifdef PROTOTYPES #define __PROTO(p) p #else #define __PROTO(p) () #endif #include "rmemset.pro" /* PROTO */ void rmemset(void *p, unsigned char c, R_int_p_t len) { R_u_int_p_t i, val, *rp; unsigned char *lp; if (len < 16) /* probably not worth all the calculations */ lp = p; else { /* write out preceding characters so we align on an integer boundary */ if ((i = ((-(R_u_int_p_t)p) & (SIZEOF_INT_P - 1))) == 0) rp = p; else { len -= i; for (lp = p; i--;) *lp++ = c; rp = (R_int_p_t *)lp; } /* do the fast writing */ val = (c << 8) + c; #if SIZEOF_INT_P >= 4 val |= (val << 16); #endif #if SIZEOF_INT_P >= 8 val |= (val << 32); #endif #if SIZEOF_INT_P == 16 val |= (val << 64); #endif for (i = len / SIZEOF_INT_P; i--;) *rp++ = val; len &= (SIZEOF_INT_P - 1); lp = (unsigned char *)rp; } /* write trailing characters */ for (; len--;) *lp++ = c; } aterm-1.0.1/src/Makefile.in0000644000175000001440000000637210245376401014161 0ustar vaeusers# src/Makefile.in -*- Makefile -*- # $Id: Makefile.in,v 1.4 2005/05/26 16:44:49 sasha Exp $ @MCOMMON@ srcdir = @srcdir@ VPATH = @srcdir@ basedir = .. thisdir = src # for developers: the following debug options may be used # -DDEBUG_CMD -DDEBUG_MENU -DDEBUG_MENUARROWS -DDEBUG_MENUBAR_STACKING # -DDEBUG_MENU_LAYOUT -DDEBUG_RESOURCES -DDEBUG_SCREEN # -DDEBUG_SEARCH_PATH -DDEBUG_SELECT -DDEBUG_TTYMODE -DDEBUG_X DEBUG=@DEBUG@ first_rule: all dummy: SRCS = command.c graphics.c grkelot.c main.c menubar.c misc.c \ netdisp.c rmemset.c screen.c scrollbar.c utmp.c xdefaults.c \ pixmap.c thai.c OBJS = command.o graphics.o grkelot.o main.o menubar.o misc.o \ netdisp.o rmemset.o screen.o scrollbar.o utmp.o xdefaults.o \ pixmap.o thai.o HDRS = feature.h protos.h grkelot.h rxvt.h rxvtgrx.h screen.h version.h thai.h PROS = command.pro graphics.pro grkelot.pro main.pro menubar.pro misc.pro \ netdisp.pro rmemset.pro screen.pro scrollbar.pro utmp.pro xdefaults.pro \ pixmap.pro thai.pro DEPS = rxvt.h version.h ${basedir}/config.h feature.h # # Distribution variables # DIST = $(HDRS) $(SRCS) Makefile.in gcc-Wall .indent.pro makeprotos-sed .SUFFIXES: .c .o .pro # inference rules .c.o: $(CC) $(DEFS) $(DEBUG) -c $(CFLAGS) $(CPPFLAGS) $(CFLAGS_LIBAFTERIMAGE) $(CFLAGS_LIBAFTERSTEP) $(XINC) -I. -I$(basedir) -I$(srcdir) $(DINCLUDE) $< #------------------------------------------------------------------------- all: aterm aterm: version.h $(PROS) $(OBJS) $(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS) $(XLIB) $(DLIB) .c.pro: $(SED) -n -f $(srcdir)/makeprotos-sed $< > $@ tags: $(SRCS) ctags $(SRCS) allbin: aterm alldoc: clean: $(RMF) aterm core a.out $(OBJS) *.bak *~ realclean: clean $(RMF) tags *.pro distclean: realclean if test $(srcdir) = .; then $(MAKE) realclean; fi (cd $(srcdir); $(RMF) Makefile) install: allbin alldoc $(INSTALL_PROGRAM) aterm $(DESTDIR)$(bindir)/$(binprefix)aterm uninstall: (cd $(bindir); $(RMF) $(binprefix)aterm) distdirs: mkdir $(basedir)/../$(VERNAME)/$(thisdir) distcopy: $(CP) -p $(DIST) $(basedir)/../$(VERNAME)/$(thisdir) # Semi-automatic generation of dependencies: # Use gcc -MM because X11 `makedepend' doesn't work on all systems # and it also includes system headers. # `semi'-automatic since dependencies are generated at distribution time. #distdepend: # mv Makefile.in Makefile.in~ # sed "/^# DO NOT DELETE:/,$$ d" Makefile.in~ > Makefile.in # echo "# DO NOT DELETE: ugly dependency list follows" >> Makefile.in # gcc -MM $(CPPFLAGS) $(XINC) -I. -I$(basedir) -I$(srcdir) $(SRCS) >> Makefile.in # ----------------------------------------------------------------------- # DO NOT DELETE: nice dependency list follows command.o: command.c command.pro $(DEPS) graphics.o: graphics.c graphics.pro $(DEPS) grkelot.o: grkelot.c grkelot.pro $(DEPS) main.o: main.c main.pro $(DEPS) menubar.o: menubar.c menubar.pro $(DEPS) misc.o: misc.c misc.pro $(DEPS) netdisp.o: netdisp.c netdisp.pro $(DEPS) screen.o: screen.c screen.pro $(DEPS) screen.h scrollbar.o: scrollbar.c scrollbar.pro $(DEPS) utmp.o: utmp.c utmp.pro $(DEPS) xdefaults.o: xdefaults.c xdefaults.pro $(DEPS) pixmap.o: pixmap.c pixmap.pro $(DEPS) thai.o: thai.c thai.pro $(DEPS) thai.h aterm-1.0.1/src/libafterstep.h0000644000175000001440000000212210144447047014741 0ustar vaeusers#ifndef LIBAFTERSTEP_HEADER_INCLUDED #define LIBAFTERSTEP_HEADER_INCLUDED #include "../config.h" /* some global stuff that needs to be defined for libasimage */ #ifdef USE_LIBASIMAGE #include #ifdef LIBASIMAGE_HEADERS #define MODULE_X_INTERFACE #include #include #define name_list void #include #include #include #include #include #include #undef LEFT #undef RIGHT #ifndef MY_STYLE_FONT_ID #define MY_STYLE_FONT_ID(ms) ms.font.font #else #include #endif #else /* !LIBASIMAGE_HEADERS */ typedef struct ScreenInfo { unsigned long screen; Window Root; int d_depth; int MyDisplayWidth, MyDisplayHeight; int CurrentDesk; }ScreenInfo; #endif /* LIBASIMAGE_HEADERS */ #ifdef INTERN int DeadPipe( int nonsense ){return 1;} ScreenInfo Scr ; Display *dpy ; char *MyName; #endif /* INTERN */ #endif /* USE_LIBASIMAGE */ #endif /*LIBAFTERSTEP_HEADER_INCLUDED*/ aterm-1.0.1/src/scrollbar.c0000644000175000001440000004145410144447057014247 0ustar vaeusers/*--------------------------------*-C-*---------------------------------* * File: scrollbar2.c *----------------------------------------------------------------------* * Copyright (C) 1998 Alfredo K. Kojima * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *----------------------------------------------------------------------*/ /* * Same code as scrollbar.c, but this one is rewritten to do * N*XTSTEP like scrollbars. * * 1998 Alfredo Kojima * Wrote base NeXT Scroll bar code * 1999 Sasha Vasko * enhanced code for better portability and * configurability */ #include "rxvt.h" /* NECESSARY */ /*----------------------------------------------------------------------* */ static GC paintGC = None; static GC grayGC = None; static GC stippleGC = None; static Pixel blackPixel, whitePixel, darkPixel; static char *SCROLLER_DIMPLE[] = { ".%###.", "%#%%%%", "#%%...", "#%.. ", "#%. ", ".%. ." }; #define SCROLLER_DIMPLE_WIDTH 6 #define SCROLLER_DIMPLE_HEIGHT 6 static char *SCROLLER_ARROW_UP[] = { ".............", ".............", "......%......", "......#......", ".....%#%.....", ".....###.....", "....%###%....", "....#####....", "...%#####%...", "...#######...", "..%#######%..", ".............", "............." }; static char *SCROLLER_ARROW_DOWN[] = { ".............", ".............", "..%#######%..", "...#######...", "...%#####%...", "....#####....", "....%###%....", ".....###.....", ".....%#%.....", "......#......", "......%......", ".............", "............." }; static char *HI_SCROLLER_ARROW_UP[] = { " ", " ", " % ", " % ", " %%% ", " %%% ", " %%%%% ", " %%%%% ", " %%%%%%% ", " %%%%%%% ", " %%%%%%%%% ", " ", " " }; static char *HI_SCROLLER_ARROW_DOWN[] = { " ", " ", " %%%%%%%%% ", " %%%%%%% ", " %%%%%%% ", " %%%%% ", " %%%%% ", " %%% ", " %%% ", " % ", " % ", " ", " " }; #define ARROW_SOURCE_WIDTH 13 #define ARROW_SOURCE_HEIGHT 13 typedef struct { Pixmap icon ; Pixmap icon_mask ; int origin_x, origin_y, width, height ; } Icon; typedef struct { unsigned arrow_width, arrow_height ; int bValid ; char** Data[4] ; Icon Arrows[4] ; }ScrollArrows ; static Icon dimple = {None, None, 0, 0, SCROLLER_DIMPLE_WIDTH, SCROLLER_DIMPLE_HEIGHT}; static ScrollArrows NeXTScrollArrows = { ARROW_SOURCE_WIDTH, ARROW_SOURCE_HEIGHT, 0, {SCROLLER_ARROW_UP, HI_SCROLLER_ARROW_UP, SCROLLER_ARROW_DOWN, HI_SCROLLER_ARROW_DOWN } }; #define UP_ARROW (NeXTScrollArrows.Arrows[0]) #define UP_ARROW_HI (NeXTScrollArrows.Arrows[1]) #define DOWN_ARROW (NeXTScrollArrows.Arrows[2]) #define DOWN_ARROW_HI (NeXTScrollArrows.Arrows[3]) #define ARROW_WIDTH (NeXTScrollArrows.arrow_width) #define ARROW_HEIGHT (NeXTScrollArrows.arrow_height) #define BEVEL_HI_WIDTH 1 #ifdef NEXT_SCROLL_CLEAN # define BEVEL_LO_WIDTH 1 #else # define BEVEL_LO_WIDTH 2 #endif #define BEVEL_SIZE (BEVEL_HI_WIDTH+BEVEL_LO_WIDTH) #define SB_BUTTON_HEIGHT (BEVEL_SIZE+ARROW_HEIGHT) #define SB_BUTTONS_HEIGHT (SB_BUTTON_HEIGHT<<1) #ifndef SB_BORDER_WIDTH # define SB_BORDER_WIDTH 1 #endif #define SB_BORDER_SIZE (SB_BORDER_WIDTH<<1) #ifndef SIDE_STEP_WIDTH # define SIDE_STEP_WIDTH 0 #endif /* end unconfigurable stuff */ #define stp_width 8 #define stp_height 8 static unsigned char stp_bits[] = { 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa}; #ifdef TRANSPARENT #define IS_TRANSP_SCROLL (Options&Opt_transparent_sb) #else #define IS_TRANSP_SCROLL 0 #endif typedef struct { GC blackGC; GC whiteGC; GC darkGC; GC maskGC; GC maskGC_0; }IconGC; static void init_scroll_size(void) { NeXTScrollArrows.arrow_width = (SB_WIDTH-BEVEL_SIZE-SB_BORDER_SIZE-SIDE_STEP_WIDTH); MIN_IT( NeXTScrollArrows.arrow_width, ARROW_SOURCE_WIDTH ); #ifdef NEXT_SCROLL_SQUARE_ARROWS NeXTScrollArrows.arrow_height = NeXTScrollArrows.arrow_width ; #else NeXTScrollArrows.arrow_height = ARROW_SOURCE_HEIGHT ; #endif NeXTScrollArrows.bValid = 1 ; } /* PROTO */ unsigned GetScrollArrowsHeight() { if( !NeXTScrollArrows.bValid ) init_scroll_size(); return (SB_BUTTONS_HEIGHT); } static void CheckIconGC(IconGC* igc, Pixmap icon, Pixmap icon_mask) { XGCValues values ; unsigned long valuemask = GCForeground|GCGraphicsExposures ; values.graphics_exposures = False; if( igc == NULL ) return ; if( igc->maskGC == None ) { values.foreground = 1 ; igc->maskGC = XCreateGC( Xdisplay, icon_mask, valuemask, &values ); } if( igc->maskGC_0 == None ) { values.foreground = 0 ; igc->maskGC_0 = XCreateGC( Xdisplay, icon_mask, valuemask, &values ); } if( igc->whiteGC == None ) { values.foreground = whitePixel ; igc->whiteGC = XCreateGC( Xdisplay, icon, valuemask, &values ); } if( igc->darkGC == None ) { values.foreground = darkPixel ; igc->darkGC = XCreateGC( Xdisplay, icon, valuemask, &values ); } if( igc->blackGC == None ) { values.foreground = blackPixel ; igc->blackGC = XCreateGC( Xdisplay, icon, valuemask, &values ); } } static void FreeIconGC( IconGC* igc ) { if( igc ) { if( igc->maskGC != None ) { XFreeGC( Xdisplay, igc->maskGC ); igc->maskGC = None; } if( igc->maskGC_0 != None ) { XFreeGC( Xdisplay, igc->maskGC_0 ); igc->maskGC_0 = None; } if( igc->whiteGC == None ) { XFreeGC( Xdisplay, igc->whiteGC ); igc->whiteGC = None; } if( igc->darkGC == None ) { XFreeGC( Xdisplay, igc->darkGC ); igc->darkGC = None; } if( igc->blackGC != None ) { XFreeGC( Xdisplay, igc->blackGC ); igc->blackGC = None; } } } static void renderIcon(char **data, Icon* pIcon, IconGC* igc) { Pixmap d, mask; register int i, k ; int x, y ; GC maskgc, paintgc ; d = XCreatePixmap(Xdisplay, scrollBar.win, pIcon->width, pIcon->height, Xdepth); mask = XCreatePixmap(Xdisplay, scrollBar.win, pIcon->width, pIcon->height, 1); CheckIconGC( igc, d, mask ); y = pIcon->origin_y ; for (i = 0; i < pIcon->height ; y++, i++ ) { x = pIcon->origin_x ; for (k = 0; k < pIcon->width ; k++, x++ ) { maskgc = igc->maskGC ; switch (data[y][x]) { case ' ': case 'w': paintgc = igc->whiteGC ; break; case '%': case 'd': paintgc = igc->darkGC ; break; case '#': case 'b': paintgc = igc->blackGC ; break; case '.': case 'l': default: paintgc = grayGC; maskgc = igc->maskGC_0 ; break; } XDrawPoint(Xdisplay, d, paintgc, k, i); XDrawPoint(Xdisplay, mask, maskgc, k, i); } } pIcon->icon = d ; pIcon->icon_mask = mask ; } static void PlaceIcon( Icon* i, int x, int y, Drawable buffer ) { #ifdef TRANSPARENT if( IS_TRANSP_SCROLL ) { XSetClipMask( Xdisplay, paintGC, i->icon_mask ); XSetClipOrigin( Xdisplay, paintGC, x, y ); } #endif XCopyArea(Xdisplay, i->icon, buffer, paintGC, 0, 0, i->width, i->height,x,y ); } static void init_stuff(void) { XGCValues gcvalue; XColor xcol; Pixmap stipple; unsigned long light; unsigned arrow_x_offset, arrow_y_offset ; IconGC icongc = {None,None,None,None}; int i ; gcvalue.graphics_exposures = False; blackPixel = BlackPixelOfScreen(DefaultScreenOfDisplay(Xdisplay)); whitePixel = WhitePixelOfScreen(DefaultScreenOfDisplay(Xdisplay)); xcol.red = 0xaeba; xcol.green = 0xaaaa; xcol.blue = 0xaeba; if (!XAllocColor (Xdisplay, Xcmap, &xcol)) { print_error ("can't allocate %s", "light gray"); #ifndef NO_BRIGHTCOLOR xcol.pixel = PixColors [Color_AntiqueWhite]; #else xcol.pixel = PixColors [Color_White]; #endif } light = gcvalue.foreground = xcol.pixel; grayGC = XCreateGC(Xdisplay, scrollBar.win, GCForeground|GCGraphicsExposures, &gcvalue); xcol.red = 0x51aa; xcol.green = 0x5555; xcol.blue = 0x5144; if (!XAllocColor (Xdisplay, Xcmap, &xcol)) { print_error ("can't allocate %s", "dark gray"); #ifndef NO_BRIGHTCOLOR xcol.pixel = PixColors [Color_Grey25]; #else xcol.pixel = PixColors [Color_Black]; #endif } darkPixel = xcol.pixel; renderIcon(SCROLLER_DIMPLE, &dimple, &icongc); if( !NeXTScrollArrows.bValid ) init_scroll_size(); arrow_x_offset = (ARROW_SOURCE_WIDTH-ARROW_WIDTH)>>1; #ifdef NEXT_SCROLL_SQUARE_ARROWS arrow_y_offset = arrow_x_offset ; #else arrow_y_offset = 0; /* not implemented yet */ #endif for( i = 0 ; i < 4 ; i++ ) { NeXTScrollArrows.Arrows[i].origin_x = arrow_x_offset ; NeXTScrollArrows.Arrows[i].origin_y = arrow_y_offset ; NeXTScrollArrows.Arrows[i].width = ARROW_WIDTH ; NeXTScrollArrows.Arrows[i].height = ARROW_HEIGHT ; renderIcon(NeXTScrollArrows.Data[i], &(NeXTScrollArrows.Arrows[i]), &icongc ); } FreeIconGC( &icongc ); gcvalue.foreground = whitePixel; paintGC = XCreateGC(Xdisplay, scrollBar.win, GCForeground|GCGraphicsExposures, &gcvalue); stipple = XCreateBitmapFromData(Xdisplay, scrollBar.win, stp_bits, stp_width, stp_height); gcvalue.foreground = darkPixel; gcvalue.background = light; gcvalue.fill_style = FillStippled; gcvalue.stipple = stipple; stippleGC = XCreateGC(Xdisplay, scrollBar.win, GCForeground|GCBackground |GCStipple|GCFillStyle|GCGraphicsExposures, &gcvalue); scrollbar_show(1); } /* Draw bezel & arrows */ static void drawBevel(Drawable d, int x, int y, int w, int h) { XSetForeground( Xdisplay, paintGC, whitePixel ); XDrawLine(Xdisplay, d, paintGC, x, y, x+w-1, y); XDrawLine(Xdisplay, d, paintGC, x, y, x, y+h-1); XSetForeground( Xdisplay, paintGC, blackPixel ); XDrawLine(Xdisplay, d, paintGC, x+w-1, y, x+w-1, y+h-1); XDrawLine(Xdisplay, d, paintGC, x, y+h-1, x+w-1, y+h-1); #ifndef NEXT_SCROLL_CLEAN XSetForeground( Xdisplay, paintGC, darkPixel ); XDrawLine(Xdisplay, d, paintGC, x+1, y+h-2, x+w-2, y+h-2); XDrawLine(Xdisplay, d, paintGC, x+w-2, y+1, x+w-2, y+h-2); #endif } extern char* MyName ; /* PROTO */ int scrollbar_mapping(int map) { int change = 0; if (map && !scrollbar_visible()) { scrollBar.state = 1; XMapWindow(Xdisplay, scrollBar.win); change = 1; } else if (!map && scrollbar_visible()) { scrollBar.state = 0; XUnmapWindow(Xdisplay, scrollBar.win); change = 1; } return change; } #ifdef TRANSPARENT typedef struct { Pixmap root; unsigned int x, y, height ; Pixmap cache; }TransparencyCache ; #endif Pixmap scrollbar_fill_back( unsigned int height, int check_cache ) { Pixmap buffer = None; #ifdef TRANSPARENT static TransparencyCache tCache = {None, -1, -1, 0, None}; #endif /* create double buffer */ buffer = XCreatePixmap(Xdisplay, scrollBar.win, SB_WIDTH+SB_BORDER_WIDTH, height, Xdepth); #ifdef TRANSPARENT if( IS_TRANSP_SCROLL && scrollBar.state ) { Pixmap root_pmap = None ; unsigned int root_width = 0, root_height = 0 ; if( check_cache == 1 ) { int cache_valid = 0 ; root_pmap = ValidatePixmap(root_pmap, 1, 1, &root_width, &root_height); if( height == tCache.height && root_pmap == tCache.root ) { int my_x, my_y ; if( GetWinPosition(scrollBar.win, &my_x, &my_y) ) { if( my_x== tCache.x && my_y == tCache.y ) cache_valid = 1 ; else { tCache.x = my_x ; tCache.y = my_y ; } }else cache_valid = 1 ; }else { tCache.root = root_pmap ; tCache.height = height ; } if( cache_valid == 0 ) { if(tCache.cache) XFreePixmap( Xdisplay, tCache.cache ); tCache.cache = CutWinPixmap( scrollBar.win, root_pmap, root_width, root_height, SB_WIDTH+SB_BORDER_WIDTH, height, grayGC, &(TermWin.background.Shading)); } } if( tCache.cache != None ) { FillPixmapWithTile( buffer, tCache.cache, 0, 0, SB_WIDTH+SB_BORDER_WIDTH, height, 0, 0 ); if( TermWin.tintGC) XFillRectangle(Xdisplay, buffer, TermWin.tintGC, 0, 0, SB_WIDTH+SB_BORDER_WIDTH-1, height-1); return buffer ; } } #endif /* draw the background */ XFillRectangle(Xdisplay, buffer, grayGC, 0, 0, SB_WIDTH+SB_BORDER_WIDTH, height); XSetForeground(Xdisplay, paintGC, blackPixel ); XDrawRectangle(Xdisplay, buffer, paintGC, 0, 0, SB_WIDTH, height); if (TermWin.nscrolled > 0) { XFillRectangle( Xdisplay, buffer, stippleGC, SB_BORDER_WIDTH+SB_BORDER_WIDTH, SB_BORDER_WIDTH, SB_WIDTH-SB_BORDER_SIZE-SIDE_STEP_WIDTH, height-SB_BUTTONS_HEIGHT ); }else { XFillRectangle(Xdisplay, buffer, stippleGC, SB_BORDER_WIDTH+SB_BORDER_WIDTH, SB_BORDER_WIDTH, SB_WIDTH-SB_BORDER_SIZE, height-SB_BORDER_SIZE); } return buffer ; } int scrollbar_show_cached(int update, int check_cache) { /* old (drawn) values */ static int last_top, last_bot, last_len; static int scrollbar_len; /* length of slider */ Pixmap buffer; int height = scrollBar.end + SB_BUTTONS_HEIGHT+sb_shadow ; if (paintGC == None) init_stuff(); if (update) { int top = (TermWin.nscrolled - TermWin.view_start); int bot = top + (TermWin.nrow - 1); int len = max((TermWin.nscrolled + (TermWin.nrow - 1)),1); #define MIN_SCROLL_LENGTH (SCROLLER_DIMPLE_HEIGHT+3) scrollBar.top = (scrollBar.beg + (top * (scrollbar_size()-SB_BORDER_SIZE-MIN_SCROLL_LENGTH)) / len); scrollBar.bot = (scrollBar.beg + MIN_SCROLL_LENGTH+ (bot * (scrollbar_size()-SB_BORDER_SIZE-MIN_SCROLL_LENGTH)) / len); scrollbar_len = scrollBar.bot - scrollBar.top; /* no change */ if ((scrollBar.top == last_top) && (scrollBar.bot == last_bot)) return 0; } last_top = scrollBar.top; last_bot = scrollBar.bot; last_len = scrollbar_len; buffer = scrollbar_fill_back( height, check_cache ); if (TermWin.nscrolled > 0) { #ifdef TRANSPARENT if( !IS_TRANSP_SCROLL ) { XFillRectangle(Xdisplay, buffer, grayGC, SB_BORDER_WIDTH+BEVEL_HI_WIDTH, scrollBar.top+BEVEL_HI_WIDTH+SB_BORDER_WIDTH-SIDE_STEP_WIDTH, SB_WIDTH-SB_BORDER_WIDTH-BEVEL_LO_WIDTH, scrollbar_len); } #endif drawBevel(buffer, SB_BORDER_WIDTH+BEVEL_HI_WIDTH, scrollBar.top+BEVEL_HI_WIDTH+SB_BORDER_WIDTH, SB_WIDTH-SB_BORDER_SIZE-SIDE_STEP_WIDTH, scrollbar_len); drawBevel(buffer, SB_BORDER_WIDTH+BEVEL_HI_WIDTH, height-SB_BUTTONS_HEIGHT+BEVEL_HI_WIDTH-SB_BORDER_WIDTH, SB_WIDTH-SB_BORDER_SIZE-SIDE_STEP_WIDTH, SB_BUTTON_HEIGHT); drawBevel(buffer, SB_BORDER_WIDTH+BEVEL_HI_WIDTH, height-SB_BUTTON_HEIGHT+BEVEL_HI_WIDTH-SB_BORDER_WIDTH, SB_WIDTH-SB_BORDER_SIZE-SIDE_STEP_WIDTH, SB_BUTTON_HEIGHT); PlaceIcon(&dimple, ((SB_WIDTH)>>1)-(SCROLLER_DIMPLE_WIDTH>>1)+1-SIDE_STEP_WIDTH, scrollBar.top + BEVEL_HI_WIDTH + SB_BORDER_WIDTH + ((scrollbar_len-SCROLLER_DIMPLE_HEIGHT)>>1), buffer ); PlaceIcon((scrollbar_isUp())?&UP_ARROW_HI:&UP_ARROW, ((SB_WIDTH)>>1)-(ARROW_WIDTH>>1)+1-SIDE_STEP_WIDTH, height - SB_BUTTONS_HEIGHT + BEVEL_HI_WIDTH+1-SB_BORDER_WIDTH, buffer ); PlaceIcon((scrollbar_isDn())?&DOWN_ARROW_HI:&DOWN_ARROW, ((SB_WIDTH)>>1)-(ARROW_WIDTH>>1)+1-SIDE_STEP_WIDTH, height - SB_BUTTON_HEIGHT+BEVEL_HI_WIDTH+1-SB_BORDER_WIDTH, buffer ); #ifdef TRANSPARENT if( IS_TRANSP_SCROLL ) XSetClipMask( Xdisplay, paintGC, None ); #endif } if (Options & Opt_scrollBar_right) XCopyArea(Xdisplay, buffer, scrollBar.win, paintGC, 0, 0, SB_WIDTH+SB_BORDER_WIDTH, height, 0, 0); else XCopyArea(Xdisplay, buffer, scrollBar.win, paintGC, 0, 0, SB_WIDTH+SB_BORDER_WIDTH, height, 0-SB_BORDER_WIDTH, 0); XFreePixmap(Xdisplay, buffer); return 1; } /* PROTO */ int scrollbar_show(int update) { return scrollbar_show_cached(update, 0); } /* PROTO */ void refresh_transparent_scrollbar() { #ifdef TRANSPARENT if( IS_TRANSP_SCROLL ) scrollbar_show_cached(0, 1); #endif } /* PROTO */ void map_scrollBar(int map) { if (scrollbar_mapping(map)) { resize(); scr_touch(); } } /*----------------------- end-of-file (C source) -----------------------*/ aterm-1.0.1/src/main.c0000644000175000001440000020247010654111735013202 0ustar vaeusers/*--------------------------------*-C-*---------------------------------* * File: main.c *----------------------------------------------------------------------* * Copyright (C) 1997,1998 Oezguer Kesim * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------*/ /*---------------------------------------------------------------------* * Originally written: * 1992 John Boyey, University of Canterbury * Modifications: * 1994 Robert Nation * - extensive modifications * 1995 Garrett D'Amore * 1997 mj olesen * - extensive modifications * 1997,1998 Oezguer Kesim * 1998 Geoff Wing * 1998 Sasha Vasko *----------------------------------------------------------------------*/ #ifndef lint static const char rcsid[] = "$Id: main.c,v 1.33 2007/08/01 14:08:29 vae Exp $"; #endif #define INTERN /* assign all global vars to me */ #include "rxvt.h" /* NECESSARY */ #include "X11/Xatom.h" #include "X11/Xproto.h" #include Window ParentWin[PARENTS_NUM] = PARENTS_INIT; int ParentWinNum = 0; #ifdef HAVE_AFTERIMAGE ASVisual *asv = NULL ; #endif #ifdef HAVE_AFTERSTEP void DeadPipe( int unused ) { } #else Atom _XA_MwmAtom = None; Atom _XA_NET_WM_PID = None; Atom _XROOTPMAP_ID = None; Atom _XA_NET_SUPPORTING_WM_CHECK = None; Atom _XA_NET_SUPPORTED = None; Atom _XA_NET_CURRENT_DESKTOP = None; Atom _XA_NET_WM_DESKTOP = None; Atom _XA_NET_WM_STATE = None; Atom _XA_NET_WM_STATE_STICKY = None; Atom _XA_NET_WM_STATE_SHADED = None; Atom _XA_NET_WM_STATE_HIDDEN = None; #endif /*{{{ extern functions referenced */ #ifdef DISPLAY_IS_IP extern char *network_display(const char *display); #endif /*}}} */ /*{{{ local variables */ static Cursor TermWin_cursor; /* cursor for vt window */ static XSizeHints szHint = { PMinSize | PResizeInc | PBaseSize | PWinGravity, 0, 0, 80, 24, /* x, y, width, height */ 1, 1, /* Min width, height */ 0, 0, /* Max width, height - unused */ 1, 1, /* increments: width, height */ {1, 1}, /* increments: x, y */ {0, 0}, /* Aspect ratio - unused */ 0, 0, /* base size: width, height */ NorthWestGravity /* gravity */ }; static const char *def_colorName[] = { "White", "Black", /* fg/bg */ /* low-intensity colors */ "Black", /* 0: black (#000000) */ #ifndef NO_BRIGHTCOLOR "Red3", /* 1: red (#CD0000) */ "Green3", /* 2: green (#00CD00) */ "Yellow3", /* 3: yellow (#CDCD00) */ "Blue3", /* 4: blue (#0000CD) */ "Magenta3", /* 5: magenta (#CD00CD) */ "Cyan3", /* 6: cyan (#00CDCD) */ "AntiqueWhite", /* 7: white (#FAEBD7) */ /* high-intensity colors */ "Grey25", /* 8: bright black (#404040) */ #endif /* NO_BRIGHTCOLOR */ "Red", /* 1/9: bright red (#FF0000) */ "Green", /* 2/10: bright green (#00FF00) */ "Yellow", /* 3/11: bright yellow (#FFFF00) */ "Blue", /* 4/12: bright blue (#0000FF) */ "Magenta", /* 5/13: bright magenta (#FF00FF) */ "Cyan", /* 6/14: bright cyan (#00FFFF) */ "White", /* 7/15: bright white (#FFFFFF) */ #ifndef NO_CURSORCOLOR NULL, NULL, #endif /* NO_CURSORCOLOR */ NULL, /* pointerColor */ NULL /* borderColor */ #if defined(TRANSPARENT) || defined(BACKGROUND_IMAGE) ,NULL #endif #ifndef NO_BOLDUNDERLINE , NULL, NULL #endif /* NO_BOLDUNDERLINE */ #ifdef KEEP_SCROLLCOLOR , "#B2B2B2", /* scrollColor: `match' Netscape color */ "#969696" /* troughColor */ #endif }; #ifdef MULTICHAR_SET /* Multicharacter font names, roman fonts sized to match */ static const char *def_mfontName[] = { MFONT_LIST }; #endif /* MULTICHAR_SET */ static const char *def_fontName[] = { NFONT_LIST }; /*}}} */ #if 0 /*----------------------------------------------------------------------*/ /* ARGSUSED */ /* PROTO */ XErrorHandler xerror_handler(Display * display, XErrorEvent * event) { print_error("XError: Request: %d . %d, Error: %d", event->request_code, event->minor_code, event->error_code); /* if( *p ) return 1 ; */ if( ( event->request_code != X_GetAtomName ) && ( event->request_code != X_GetGeometry || event->error_code != BadDrawable ) ) exit(EXIT_FAILURE); return 0; } #else XErrorHandler xerror_handler (Display * dpy, XErrorEvent * event) { char *err_text; fprintf (stderr, "aterm has encountered the following problem interacting with X Windows :\n"); if (event && dpy) { err_text = malloc (128); strcpy (err_text, "unknown error"); XGetErrorText (dpy, event->error_code, err_text, 120); fprintf (stderr, " Request: %d, Error: %d(%s)\n", event->request_code, event->error_code, err_text); free (err_text); fprintf (stderr, " in resource: 0x%lX\n", event->resourceid); } return 0; } #endif #ifdef DEBUG_X #define XGetGeometry(dpy,win,r,x,y,w,h,b,d) \ trace_XGetGeometry(__FILE__,__LINE__,dpy,win,r,x,y,w,h,b,d) #endif /*{{{ color aliases, fg/bg bright-bold */ /* PROTO */ void color_aliases(int idx) { if (rs_color[idx] && isdigit(*rs_color[idx])) { int i = atoi(rs_color[idx]); if (i >= 8 && i <= 15) { /* bright colors */ i -= 8; #ifndef NO_BRIGHTCOLOR rs_color[idx] = rs_color[minBrightCOLOR + i]; return; #endif } if (i >= 0 && i <= 7) /* normal colors */ rs_color[idx] = rs_color[minCOLOR + i]; } } /* * find if fg/bg matches any of the normal (low-intensity) colors */ #ifndef NO_BRIGHTCOLOR /* PROTO */ void set_colorfgbg(void) { unsigned int i; static char colorfgbg_env[] = "COLORFGBG=default;default;bg"; char *p; int fg = -1, bg = -1; for (i = Color_Black; i <= Color_White; i++) { if (PixColors[Color_fg] == PixColors[i]) { fg = (i - Color_Black); break; } } for (i = Color_Black; i <= Color_White; i++) { if (PixColors[Color_bg] == PixColors[i]) { bg = (i - Color_Black); break; } } p = strchr(colorfgbg_env, '='); p++; if (fg >= 0) sprintf(p, "%d;", fg); else STRCPY(p, "default;"); p = strchr(p, '\0'); if (bg >= 0) sprintf(p,"%d", bg); else STRCPY(p, "default"); putenv(colorfgbg_env); colorfgbg = DEFAULT_RSTYLE; for (i = minCOLOR; i <= maxCOLOR; i++) { if (PixColors[Color_fg] == PixColors[i] # ifndef NO_BOLDUNDERLINE && PixColors[Color_fg] == PixColors[Color_BD] # endif /* NO_BOLDUNDERLINE */ /* if we wanted boldFont to have precedence */ # if 0 /* ifndef NO_BOLDFONT */ && TermWin.boldFont == NULL # endif /* NO_BOLDFONT */ ) colorfgbg = SET_FGCOLOR(colorfgbg, i); if (PixColors[Color_bg] == PixColors[i]) colorfgbg = SET_BGCOLOR(colorfgbg, i); } } #else /* NO_BRIGHTCOLOR */ # define set_colorfgbg() ((void)0) #endif /* NO_BRIGHTCOLOR */ /*}}} */ /* PROTO */ void set_terminal_size( unsigned int new_ncol, unsigned int new_nrow ) { if( new_nrow <= 0) new_nrow = 24 ; if( new_ncol <= 0) new_ncol = 80 ; TermWin.ncol = new_ncol; TermWin.nrow = new_nrow; TermWin.bcol = new_ncol; MAX_IT(TermWin.bcol, TermWin.min_bcol); } /*{{{ set_cursor_color() - Updates color of the TerWin_cursor */ /* PROTO */ void set_cursor_color() { XColor fg, bg; fg.pixel = PixColorsFocused[Color_pointer]; XQueryColor(Xdisplay, Xcmap, &fg); bg.pixel = PixColorsFocused[Color_bg]; XQueryColor(Xdisplay, Xcmap, &bg); XRecolorCursor(Xdisplay, TermWin_cursor, &fg, &bg); } /*}}} */ #if defined(BACKGROUND_IMAGE) int SetBackgroundPixmap(char* PixmapSpec) { char *geometry = strchr(PixmapSpec, ';'); int bChanged = 0 ; if (geometry != NULL) { *geometry = '\0' ; /* so to get clean pixmap filename */ bChanged = parse_pixmap_geom(geometry+1); } LoadBGPixmap(PixmapSpec); #ifdef _MYSTYLE_ if( TermWin.background.trgType == BGT_MyStyle ) TermWin.background.trgType = BGT_Tile ; #endif if( geometry ) *geometry = ';' ; return bChanged ; } #endif #if defined(BACKGROUND_IMAGE) || defined(TRANSPARENT) || defined(_MYSTYLE_) void SetBackgroundType( const char *type ) { #ifdef _MYSTYLE_ if( TermWin.background.trgType != BGT_MyStyle ) #endif TermWin.background.trgType = BGT_Tile ; #ifdef TRANSPARENT if( (Options & Opt_transparent) ) { if( TermWin.background.Shading.shading != 100) TermWin.background.trgType = BGT_Cut ; else TermWin.background.trgType = BGT_None ; } #endif if( type == NULL || TermWin.background.trgType != BGT_Tile) return ; if( strcmp( type, BGT_CENTER ) == 0 ) TermWin.background.trgType = BGT_Center ; else if( strcmp( type, BGT_SCALE ) == 0 ) TermWin.background.trgType = BGT_Scale ; else if( strcmp( type, BGT_SCALEH ) == 0 ) TermWin.background.trgType = BGT_ScaleH ; else if( strcmp( type, BGT_SCALEV ) == 0 ) TermWin.background.trgType = BGT_ScaleV ; else if( strcmp( type, BGT_NO_TILE ) == 0 ) TermWin.background.trgType = BGT_NoTile ; else if( strcmp( type, BGT_NO_TILE_H ) == 0 ) TermWin.background.trgType = BGT_NoTileH ; else if( strcmp( type, BGT_NO_TILE_V ) == 0 ) TermWin.background.trgType = BGT_NoTileV ; else if( strcmp( type, BGT_CUT ) == 0 ) TermWin.background.trgType = BGT_Cut ; } void InitBackground() { TermWin.background.srcPixmap = None ; TermWin.background.mystyle = NULL ; TermWin.background.user_flags = 0 ; TermWin.background.bMySource = 0 ; TermWin.background.trgPixmap = None ; TermWin.background.trgPixmapSet = 0 ; TermWin.background.Width = 0 ; TermWin.background.Height = 0 ; TermWin.background.srcWidth = -1 ; TermWin.background.srcHeight = -1 ; TermWin.background.srcX = -1 ; TermWin.background.srcY = -1 ; #ifdef SCALING_GEOM_ENABLED TermWin.background.trgWidth = -1 ; TermWin.background.trgHeight = -1 ; TermWin.background.trgX = -1 ; TermWin.background.trgY = -1 ; #endif TermWin.background.finWidth = 0 ; TermWin.background.finHeight = 0 ; TermWin.background.cutX = -1 ; TermWin.background.cutY = -1 ; /* some defaults here */ INIT_SHADING(TermWin.background.Shading) } #endif int ParseGCType( const char* type, int def_type ) { if( !type ) return def_type ; if( strcmp( type, GC_TYPE_AND )== 0 ) return GXand; else if( strcmp( type, GC_TYPE_AND_REV )== 0 ) return GXandReverse; else if( strcmp( type, GC_TYPE_AND_INV )== 0 ) return GXandInverted; else if( strcmp( type, GC_TYPE_XOR )== 0 ) return GXxor; else if( strcmp( type, GC_TYPE_OR )== 0 ) return GXor; else if( strcmp( type, GC_TYPE_NOR )== 0 ) return GXnor; else if( strcmp( type, GC_TYPE_INVERT )== 0 ) return GXinvert; else if( strcmp( type, GC_TYPE_EQUIV )== 0 ) return GXequiv; else if( strcmp( type, GC_TYPE_INVERT )== 0 ) return GXinvert ; else if( strcmp( type, GC_TYPE_OR_REV )== 0 ) return GXorReverse; else if( strcmp( type, GC_TYPE_OR_INV )== 0 ) return GXorInverted ; else if( strcmp( type, GC_TYPE_NAND )== 0 ) return GXnand ; return def_type ; } #ifdef OFF_FOCUS_FADING unsigned long fade_color(unsigned long pixel) { if( rs_fade ) {/* make unfocused colors here */ XColor faded_xcol; int fade = 0; fade = atoi( rs_fade ); faded_xcol.pixel = pixel ; XQueryColor( Xdisplay, Xcmap, &faded_xcol ); faded_xcol.red = (faded_xcol.red/100)*fade ; faded_xcol.green = (faded_xcol.green/100)*fade ; faded_xcol.blue = (faded_xcol.blue/100)*fade ; if( XAllocColor(Xdisplay, Xcmap, &faded_xcol) ) return faded_xcol.pixel ; } return pixel ; } #endif /*{{{ Create_Windows() - Open and map the window */ /* PROTO */ void Create_Windows(int argc, char *argv[]) { Cursor cursor; XClassHint classHint; XWMHints wmHint; MwmHints mwmhints; int i, x, y, flags; unsigned int width, height; XSetWindowAttributes attributes; unsigned long attr_mask ; #ifdef PREFER_24BIT XWindowAttributes gattr; Xcmap = DefaultColormap(Xdisplay, Xscreen); Xvisual = DefaultVisual(Xdisplay, Xscreen); if (Options & Opt_transparent) { XGetWindowAttributes(Xdisplay, RootWindow(Xdisplay, Xscreen), &gattr); Xdepth = gattr.depth; } else { Xdepth = DefaultDepth(Xdisplay, Xscreen); /* * If depth is not 24, look for a 24bit visual. */ if (Xdepth != 24) { XVisualInfo vinfo; if (XMatchVisualInfo(Xdisplay, Xscreen, 24, TrueColor, &vinfo)) { Xdepth = 24; Xvisual = vinfo.visual; Xcmap = XCreateColormap(Xdisplay, RootWindow(Xdisplay, Xscreen), Xvisual, AllocNone); } } } #endif if (Options & Opt_borderLess) { if (_XA_MwmAtom == None) { /* print_warning("Window Manager does not support MWM hints. Bypassing window manager control for borderless window.\n");*/ attributes.override_redirect = TRUE; mwmhints.flags = 0; } else { mwmhints.flags = MWM_HINTS_DECORATIONS; mwmhints.decorations = 0; } } else { mwmhints.flags = 0; } /* * grab colors before netscape does */ PixColors = &(PixColorsFocused[0]); for (i = 0; i < (Xdepth <= 2 ? 2 : NRS_COLORS); i++) { const char *const msg = "can't load color \"%s\", colorID = %d, (%d)"; XColor xcol; if (!rs_color[i]) continue; if (!XParseColor(Xdisplay, Xcmap, rs_color[i], &xcol) || !XAllocColor(Xdisplay, Xcmap, &xcol)) { print_error(msg, rs_color[i], i, TOTAL_COLORS); rs_color[i] = def_colorName[i]; if (!rs_color[i]) continue; if (!XParseColor(Xdisplay, Xcmap, rs_color[i], &xcol) || !XAllocColor(Xdisplay, Xcmap, &xcol)) { print_error(msg, rs_color[i], i, TOTAL_COLORS); switch (i) { case Color_fg: case Color_bg: /* fatal: need bg/fg color */ print_error("aborting"); exit(EXIT_FAILURE); break; #ifndef NO_CURSORCOLOR case Color_cursor: xcol.pixel = PixColors[Color_bg]; break; case Color_cursor2: xcol.pixel = PixColors[Color_fg]; break; #endif /* NO_CURSORCOLOR */ case Color_pointer: xcol.pixel = PixColors[Color_fg]; break; #if defined(TRANSPARENT) || defined(BACKGROUND_IMAGE) case Color_tint: xcol.pixel = PixColors[Color_bg]; break; #endif default: xcol.pixel = PixColors[Color_bg]; /* None */ break; } XQueryColor( Xdisplay, Xcmap,&xcol); } } PixColors[i] = xcol.pixel; #ifdef OFF_FOCUS_FADING PixColorsUnFocused[i] = fade_color(xcol.pixel); #endif #if defined(TRANSPARENT) || defined(BACKGROUND_IMAGE) if( i == Color_tint ) { TermWin.background.Shading.tintColor.pixel = xcol.pixel ; TermWin.background.Shading.tintColor.red = xcol.red ; TermWin.background.Shading.tintColor.green = xcol.green ; TermWin.background.Shading.tintColor.blue = xcol.blue ; TermWin.background.Shading.tintColor.flags = xcol.flags ; } #endif } if (Xdepth <= 2 || !rs_color[Color_pointer]) PixColors[Color_pointer] = PixColors[Color_fg]; if (Xdepth <= 2 || !rs_color[Color_border]) PixColors[Color_border] = PixColors[Color_fg]; /* * get scrollBar/menuBar shadow colors * * The calculations of topShadow/bottomShadow values are adapted * from the fvwm window manager. */ #ifdef KEEP_SCROLLCOLOR if (Xdepth <= 2) { /* Monochrome */ PixColors[Color_scroll] = PixColors[Color_fg]; PixColors[Color_topShadow] = PixColors[Color_bg]; PixColors[Color_bottomShadow] = PixColors[Color_bg]; } else { XColor xcol, white; /* bottomShadowColor */ xcol.pixel = PixColors[Color_scroll]; XQueryColor(Xdisplay, Xcmap, &xcol); xcol.red = ((xcol.red) / 2); xcol.green = ((xcol.green) / 2); xcol.blue = ((xcol.blue) / 2); if (!XAllocColor(Xdisplay, Xcmap, &xcol)) { print_error("can't allocate %s", "Color_bottomShadow"); xcol.pixel = PixColors[minCOLOR]; } PixColors[Color_bottomShadow] = xcol.pixel; /* topShadowColor */ # ifdef PREFER_24BIT white.red = white.green = white.blue = (unsigned short) ~0; XAllocColor(Xdisplay, Xcmap, &white); /* XFreeColors(Xdisplay, Xcmap, &white.pixel, 1, ~0); */ # else white.pixel = WhitePixel(Xdisplay, Xscreen); XQueryColor(Xdisplay, Xcmap, &white); # endif xcol.pixel = PixColors[Color_scroll]; XQueryColor(Xdisplay, Xcmap, &xcol); xcol.red = max((white.red / 5), (int)xcol.red); xcol.green = max((white.green / 5), (int)xcol.green); xcol.blue = max((white.blue / 5), (int)xcol.blue); xcol.red = min((int)white.red, (xcol.red * 7) / 5); xcol.green = min((int)white.green, (xcol.green * 7) / 5); xcol.blue = min((int)white.blue, (xcol.blue * 7) / 5); if (!XAllocColor(Xdisplay, Xcmap, &xcol)) { print_error("can't allocate %s", "Color_topShadow"); xcol.pixel = PixColors[Color_White]; } PixColors[Color_topShadow] = xcol.pixel; } #endif /* KEEP_SCROLLCOLOR */ szHint.base_width = (2 * TermWin_internalBorder + (Options & Opt_scrollBar ? (SB_WIDTH + 2 * sb_shadow) : 0)); szHint.base_height = (2 * TermWin_internalBorder); flags = (rs_geometry ? XParseGeometry(rs_geometry, &x, &y, &width, &height) : 0); if (flags & WidthValue) { szHint.width = width; szHint.flags |= USSize; } if (flags & HeightValue) { szHint.height = height; szHint.flags |= USSize; } set_terminal_size( szHint.width, szHint.height ); change_font(1, NULL); { /* ONLYIF MENUBAR */ szHint.base_height += (delay_menu_drawing ? menuBar_TotalHeight() : 0); } if (flags & XValue) { if (flags & XNegative) { x += (DisplayWidth(Xdisplay, Xscreen) - (szHint.width + TermWin_internalBorder)); szHint.win_gravity = NorthEastGravity; } szHint.x = x; szHint.flags |= USPosition; } if (flags & YValue) { if (flags & YNegative) { y += (DisplayHeight(Xdisplay, Xscreen) - (szHint.height + TermWin_internalBorder)); szHint.win_gravity = (szHint.win_gravity == NorthEastGravity ? SouthEastGravity : SouthWestGravity); } szHint.y = y; szHint.flags |= USPosition; } /* parent window - reverse video so we can see placement errors * sub-window placement & size in resize_subwindows() */ attributes.background_pixel = PixColors[Color_bg]; attributes.border_pixel = PixColors[Color_fg]; attributes.event_mask = ( KeyPressMask | FocusChangeMask | StructureNotifyMask | VisibilityChangeMask | PropertyChangeMask); attributes.colormap = Xcmap; attributes.background_pixmap = ParentRelative; attr_mask = CWBorderPixel | CWEventMask ; #ifdef HAVE_AFTERSTEP if( TermWin.background.trgType == BGT_MyStyle ) attr_mask |= CWBackPixmap ; #endif #ifdef TRANSPARENT if( get_flags(Options, Opt_transparent) ) attr_mask |= CWBackPixmap ; #endif if( (attr_mask & CWBackPixmap ) == 0 ) attr_mask |= CWBackPixel ; #ifdef HAVE_AFTERIMAGE TermWin.parent = create_visual_window( asv, Xroot, szHint.x, szHint.y, szHint.width, szHint.height, TermWin.borderWidth, InputOutput, attr_mask, &attributes); #else attr_mask |= CWColormap ; TermWin.parent = XCreateWindow(Xdisplay, Xroot, szHint.x, szHint.y, szHint.width, szHint.height, TermWin.borderWidth, Xdepth, InputOutput, Xvisual, attr_mask, &attributes); #endif TermWin.bMapped = 0 ; ParentWin[0] = TermWin.parent ; ParentWinNum = 1 ; xterm_seq(XTerm_title, rs_title); xterm_seq(XTerm_iconName, rs_iconName); /* ignore warning about discarded `const' */ classHint.res_name = (char *)rs_name; classHint.res_class = APL_CLASS; wmHint.input = True; wmHint.initial_state = (Options & Opt_iconic ? IconicState : NormalState); wmHint.window_group = TermWin.parent; wmHint.flags = (InputHint | StateHint | WindowGroupHint); XSetWMProperties(Xdisplay, TermWin.parent, NULL, NULL, argv, argc, &szHint, &wmHint, &classHint); /* publish our PID : */ { long ldata = getpid(); XChangeProperty (Xdisplay, TermWin.parent, _XA_NET_WM_PID, XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&ldata, 1); } if (mwmhints.flags && _XA_MwmAtom) { XChangeProperty(Xdisplay, TermWin.parent, _XA_MwmAtom, _XA_MwmAtom, 32, PropModeReplace, (unsigned char *) &mwmhints, PROP_MWM_HINTS_ELEMENTS); } /* vt cursor: Black-on-White is standard, but this is more popular */ TermWin_cursor = XCreateFontCursor(Xdisplay, XC_xterm); { XColor fg, bg; fg.pixel = PixColors[Color_pointer]; XQueryColor(Xdisplay, Xcmap, &fg); bg.pixel = PixColors[Color_bg]; XQueryColor(Xdisplay, Xcmap, &bg); XRecolorCursor(Xdisplay, TermWin_cursor, &fg, &bg); } /* cursor (menuBar/scrollBar): Black-on-White */ cursor = XCreateFontCursor(Xdisplay, XC_left_ptr); attributes.event_mask = (ExposureMask | ButtonPressMask | ButtonReleaseMask | Button1MotionMask | Button3MotionMask); attributes.cursor = TermWin_cursor ; /* the vt window */ #ifdef HAVE_AFTERIMAGE TermWin.vt = create_visual_window( asv, TermWin.parent, 0, 0, szHint.width, szHint.height, 0, InputOutput, attr_mask|CWCursor, &attributes); #else TermWin.vt = XCreateSimpleWindow(Xdisplay, TermWin.parent, 0, 0, szHint.width, szHint.height, 0, PixColors[Color_fg], PixColors[Color_bg]); XSelectInput(Xdisplay, TermWin.vt, attributes.event_mask ); XDefineCursor(Xdisplay, TermWin.vt, TermWin_cursor); #endif #ifdef TRANSPARENT if (get_flags(Options, Opt_transparent)) { if( TermWin.background.trgType != BGT_None ) SetSrcPixmap(GetRootPixmap(None)); else XSetWindowBackgroundPixmap(Xdisplay, TermWin.vt, ParentRelative); } #endif /* added by Sasha Vasko to enabling Tracking of the Background changes */ #if defined(TRANSPARENT)||defined(_MYSTYLE_) #if !defined(_MYSTYLE_) if ((Options & Opt_transparent)||(Options&Opt_transparent_sb)) #endif XSelectInput( Xdisplay, Xroot, PropertyChangeMask ); #endif /* scrollBar: size doesn't matter */ #ifdef HAVE_AFTERIMAGE scrollBar.win = create_visual_window( asv, TermWin.parent, 0, 0, 1, 1, 0, InputOutput, CWBackPixel | CWBorderPixel, &attributes); #else scrollBar.win = XCreateSimpleWindow(Xdisplay, TermWin.parent, 0, 0, 1, 1, 0, PixColors[Color_fg], PixColors[Color_bg]); #endif XDefineCursor(Xdisplay, scrollBar.win, cursor); XSelectInput(Xdisplay, scrollBar.win, (ExposureMask | ButtonPressMask | ButtonReleaseMask | Button1MotionMask | Button2MotionMask | Button3MotionMask) ); { /* ONLYIF MENUBAR */ create_menuBar(cursor); } #if defined(BACKGROUND_IMAGE) if (rs_backgroundPixmap != NULL #ifdef TRANSPARENT && !(Options & Opt_transparent) #endif ) SetBackgroundPixmap((char*)rs_backgroundPixmap); #endif /* graphics context for the vt window */ { XGCValues gcvalue; gcvalue.font = TermWin.font->fid; gcvalue.foreground = PixColors[Color_fg]; gcvalue.background = PixColors[Color_bg]; gcvalue.function = ParseGCType(rs_textType, GXcopy); gcvalue.graphics_exposures = 0; #ifdef HAVE_AFTERIMAGE TermWin.gc = create_visual_gc(asv, TermWin.vt, GCFunction| GCForeground | GCBackground | GCFont | GCGraphicsExposures, &gcvalue); #else TermWin.gc = XCreateGC(Xdisplay, TermWin.vt, GCFunction| GCForeground | GCBackground | GCFont | GCGraphicsExposures, &gcvalue); #endif #if defined(BACKGROUND_IMAGE) || defined(TRANSPARENT) if( rs_color[Color_tint] ) { if( rs_tintType ) { if( strcmp( rs_tintType, TINT_TYPE_TRUE) == 0 ) { TermWin.tintGC = None ; if( TermWin.background.trgType == BGT_None ) TermWin.background.trgType = BGT_Cut ; } } if( TermWin.background.trgType == BGT_None ) { gcvalue.function = ParseGCType(rs_tintType, GXand); gcvalue.foreground = PixColors[Color_tint]; #ifdef HAVE_AFTERIMAGE TermWin.tintGC = create_visual_gc( asv, TermWin.vt, GCFunction|GCForeground|GCGraphicsExposures, &gcvalue); #else TermWin.tintGC = XCreateGC( Xdisplay, TermWin.vt, GCFunction|GCForeground|GCGraphicsExposures, &gcvalue); #endif } } #endif } } /*}}} */ /*{{{ window resizing - assuming the parent window is the correct size */ /* PROTO */ Bool resize_subwindows(int width, int height) { int x = 0, y = 0; int old_width = TermWin.width; int old_height = TermWin.height; TermWin.width = TermWin.ncol * TermWin.fwidth; TermWin.height = TermWin.nrow * TermWin.fheight; /* size and placement */ if (scrollbar_visible()) { scrollBar.beg = 0; scrollBar.end = height; #ifndef XTERM_SCROLLBAR # ifdef NEXT_SCROLLBAR /* arrows can be different */ scrollBar.end -= GetScrollArrowsHeight(); # else /* arrows are as high as wide - leave 1 pixel gap */ scrollBar.beg += (SB_WIDTH + 1) + sb_shadow; scrollBar.end -= (SB_WIDTH + 1) + sb_shadow; # endif #endif width -= (SB_WIDTH + 2 * sb_shadow); if (Options & Opt_scrollBar_right) XMoveResizeWindow(Xdisplay, scrollBar.win, width, 0, (SB_WIDTH + 2 * sb_shadow), height); else { XMoveResizeWindow(Xdisplay, scrollBar.win, 0, 0, (SB_WIDTH + 2 * sb_shadow), height); x = (SB_WIDTH + 2 * sb_shadow); /* placement of vt window */ } } { /* ONLYIF MENUBAR */ if (menubar_visible()) { y = menuBar_TotalHeight(); /* for placement of vt window */ Resize_menuBar(x, 0, width, y); } } XMoveResizeWindow(Xdisplay, TermWin.vt, x, y, width, height + 1); request_background_update(); if (old_width) Gr_Resize(old_width, old_height); XSync(Xdisplay, 0); return (width != old_width || height != old_height ); } /* PROTO */ void resize(void) { szHint.base_width = (2 * TermWin_internalBorder); szHint.base_height = (2 * TermWin_internalBorder); szHint.base_width += (scrollbar_visible() ? (SB_WIDTH + 2 * sb_shadow) : 0); { /* ONLYIF MENUBAR */ szHint.base_height += (menubar_visible() ? menuBar_TotalHeight() : 0); } szHint.min_width = szHint.base_width + szHint.width_inc; szHint.min_height = szHint.base_height + szHint.height_inc; szHint.width = szHint.base_width + TermWin.width; szHint.height = szHint.base_height + TermWin.height; szHint.flags = PMinSize | PResizeInc | PBaseSize | PWinGravity; XSetWMNormalHints(Xdisplay, TermWin.parent, &szHint); XResizeWindow(Xdisplay, TermWin.parent, szHint.width, szHint.height); resize_subwindows(szHint.width, szHint.height); scr_clear(); } /* * Redraw window after exposure or size change */ /* PROTO */ void resize_window1(unsigned int width, unsigned int height) { static short first_time = 1; int new_ncol = (width - szHint.base_width) / TermWin.fwidth; int new_nrow = (height - szHint.base_height) / TermWin.fheight; if (first_time || (new_ncol != TermWin.ncol) || (new_nrow != TermWin.nrow)) { int curr_screen = -1; /* scr_reset only works on the primary screen */ if (!first_time) { /* this is not the first time thru */ selection_clear(); curr_screen = scr_change_screen(PRIMARY); } set_terminal_size( new_ncol, new_nrow); resize_subwindows(width, height); scr_reset(); if (curr_screen >= 0) /* this is not the first time thru */ scr_change_screen(curr_screen); first_time = 0; } } /* * good for toggling 80/132 columns */ /* PROTO */ void set_width(unsigned short width) { unsigned short height = TermWin.nrow; if (width != TermWin.ncol) { width = szHint.base_width + width * TermWin.fwidth; height = szHint.base_height + height * TermWin.fheight; XResizeWindow(Xdisplay, TermWin.parent, width, height); resize_window1(width, height); #ifdef USE_XIM IMSetStatusPosition(); #endif scr_clear(); } } /* * Redraw window after exposure or size change */ /* PROTO */ void resize_window(XEvent* ev) { int root_x = 0, root_y = 0; Window wdumm; XConfigureEvent *xconf = &(ev->xconfigure); while( XCheckTypedWindowEvent( Xdisplay, TermWin.parent, ConfigureNotify, ev ) ); /*fprintf( stderr, "config_geom = %dx%d\n", xconf->width, xconf->height );*/ resize_window1(xconf->width, xconf->height); #if 1 XTranslateCoordinates (Xdisplay, TermWin.parent, Xroot, 0, 0, &root_x, &root_y, &wdumm); /*fprintf( stderr, "root_geom = %dx%d%+d%+d, root_size = %dx%d\n", xconf->width, xconf->height, root_x, root_y, XdisplayWidth, XdisplayHeight ); */ TermWin.root_x = root_x ; TermWin.root_y = root_y ; TermWin.root_width = xconf->width ; TermWin.root_height = xconf->height ; if( TransparentPixmapNeedsUpdate() ) request_background_update(); else { Bool cancel = True ; Bool request = False ; #ifdef _MYSTYLE_ if( TermWin.background.trgType == BGT_MyStyle ) { cancel = False ; if( TermWin.LastPixmap_width != TermWin.root_width || TermWin.LastPixmap_height != TermWin.root_height ) request = True; } #endif #ifdef HAVE_AFTERIMAGE if( TermWin.background.trgType == BGT_Scale || TermWin.background.trgType == BGT_ScaleH || TermWin.background.trgType == BGT_ScaleV || TermWin.background.trgType == BGT_Cut ) { cancel = False ; if( TermWin.LastPixmap_width != TermWin.root_width || TermWin.LastPixmap_height != TermWin.root_height ) request = True; } #endif if( cancel ) cancel_background_update(); else if( request ) request_background_update(); } #else request_background_update(); #endif #if 0 #if defined(TRANSPARENT) || defined(BACKGROUND_IMAGE) || defined(_MYSTYLE_) XGetGeometry(Xdisplay, TermWin.vt, &root, &x, &y, &vt_width, &vt_height, &border, &depth); refresh_transparent_scrollbar(); if( (TermWin.bMapped && (Options & Opt_transparent)) || TermWin.background.trgType != BGT_None ) { int abs_x, abs_y; static int old_abs_x=0, old_abs_y=0, old_width=0, old_height=0; if( GetMyPosition(&abs_x, &abs_y)) { /* fprintf( stderr, "\naterm:resize_windows():old = %dx%d+%d+%d, new = %dx%d+%d+%d", old_width, old_height, old_abs_x, old_abs_y, vt_width, vt_height, abs_x, abs_y ); */ #ifdef _MYSTYLE_ if( TermWin.background.trgType == BGT_MyStyle ) { /* we want to avoid unneeded redraws if we only have gradients */ if( TransparentMS(TermWin.background.mystyle) || vt_width != old_width || vt_height!= old_height ) { RenderPixmap(1); old_width = vt_width ; old_height = vt_height ; } RenderPixmap(1); scr_clear(); scr_touch(); return ; } #endif if( TermWin.background.trgType != BGT_None ) { ValidateSrcPixmap( 1 ); if( abs_x != old_abs_x || abs_y != old_abs_y || vt_width != old_width || vt_height!= old_height || TermWin.LastPixmapUsed != TermWin.background.srcPixmap ) { RenderPixmap(1); /* we've already validated source pixmap of course user can change it in any time but for performance considerations we don't want to recheck it*/ scr_clear(); scr_touch(); old_width = vt_width ; old_height = vt_height ; old_abs_x = abs_x ; old_abs_y = abs_y ; } } #ifdef TRANSPARENT else if( abs_x != old_abs_x || abs_y != old_abs_y ) { scr_clear(); scr_touch(); old_abs_x = abs_x ; old_abs_y = abs_y ; } #endif } } } else #endif #endif { scr_clear(); scr_touch(); } } /*}}} */ /*{{{ xterm sequences - title, iconName, color (exptl) */ #ifdef SMART_WINDOW_TITLE /* PROTO */ void set_title(const char *str) { char *name; if (XFetchName(Xdisplay, TermWin.parent, &name)) name = NULL; if (name == NULL || strcmp(name, str)) XStoreName(Xdisplay, TermWin.parent, str); if (name) XFree(name); } #else # define set_title(str) XStoreName (Xdisplay, TermWin.parent, str) #endif #ifdef SMART_WINDOW_TITLE /* PROTO */ void set_iconName(const char *str) { char *name; if (XGetIconName(Xdisplay, TermWin.parent, &name)) name = NULL; if (name == NULL || strcmp(name, str)) XSetIconName(Xdisplay, TermWin.parent, str); if (name) XFree(name); } #else # define set_iconName(str) XSetIconName (Xdisplay, TermWin.parent, str) #endif #ifdef XTERM_COLOR_CHANGE /* PROTO */ void set_window_color(int idx, const char *color) { const char *const msg = "can't load color \"%s\""; XColor xcol; int i; if (color == NULL || *color == '\0') return; /* handle color aliases */ if (isdigit(*color)) { i = atoi(color); if (i >= 8 && i <= 15) { /* bright colors */ i -= 8; # ifndef NO_BRIGHTCOLOR PixColorsFocused[idx] = PixColorsFocused[minBrightCOLOR + i]; goto Done; # endif } if (i >= 0 && i <= 7) { /* normal colors */ PixColorsFocused[idx] = PixColorsFocused[minCOLOR + i]; goto Done; } } if (!XParseColor(Xdisplay, Xcmap, color, &xcol) || !XAllocColor(Xdisplay, Xcmap, &xcol)) { print_error(msg, color); return; } /* XStoreColor (Xdisplay, Xcmap, XColor*); */ /* * FIXME: should free colors here, but no idea how to do it so instead, * so just keep gobbling up the colormap */ # if 0 for (i = Color_Black; i <= Color_White; i++) if (PixColorsFocused[idx] == PixColorsFocused[i]) break; if (i > Color_White) { /* fprintf (stderr, "XFreeColors: PixColors [%d] = %lu\n", idx, PixColors [idx]); */ XFreeColors(Xdisplay, Xcmap, (PixColorsFocused + idx), 1, DisplayPlanes(Xdisplay, Xscreen)); } # endif PixColorsFocused[idx] = xcol.pixel; /* XSetWindowAttributes attr; */ /* Cursor cursor; */ Done: #ifdef OFF_FOCUS_FADING PixColorsUnFocused[idx] = fade_color(PixColorsFocused[idx]); #endif on_colors_changed(idx); } #else # define set_window_color(idx,color) ((void)0) #endif /* XTERM_COLOR_CHANGE */ /* * XTerm escape sequences: ESC ] Ps;Pt BEL * 0 = change iconName/title * 1 = change iconName * 2 = change title * 4 = change color * 12 = change cursor color * 13 = change mouse foreground color * 18 = change bold character color * 19 = change underlined character color * 46 = change logfile (not implemented) * 50 = change font * * rxvt extensions: * 10 = menu * 20 = bg pixmap * 39 = change default fg color * 49 = change default bg color */ /* PROTO */ void xterm_seq(int op, const char *str) { int color; char *buf, *name; assert(str != NULL); switch (op) { case XTerm_name: set_title(str); /* drop */ case XTerm_iconName: set_iconName(str); break; case XTerm_title: set_title(str); break; case XTerm_Color: for (buf = (char *)str; buf && *buf;) { if ((name = strchr(buf, ';')) == NULL) break; *name++ = '\0'; color = atoi(buf); if (color < 0 || color >= TOTAL_COLORS) break; if ((buf = strchr(name, ';')) != NULL) *buf++ = '\0'; set_window_color(color + minCOLOR, name); } break; #ifndef NO_CURSORCOLOR case XTerm_Color_cursor: set_window_color(Color_cursor, str); break; #endif case XTerm_Color_pointer: set_window_color(Color_pointer, str); break; #ifndef NO_BOLD_UNDERLINE case XTerm_Color_BD: set_window_color(Color_BD, str); break; case XTerm_Color_UL: set_window_color(Color_UL, str); break; #endif case XTerm_Menu: /* * menubar_dispatch() violates the constness of the string, * so DON'T do it here */ break; case XTerm_Pixmap: #if defined(BACKGROUND_IMAGE) if( SetBackgroundPixmap((char*)str) ) request_background_update(); #endif break; case XTerm_restoreFG: set_window_color(Color_fg, str); break; case XTerm_restoreBG: set_window_color(Color_bg, str); break; case XTerm_logfile: break; case XTerm_font: change_font(0, str); break; } } /*}}} */ unsigned int get_proportion_font_width( XFontStruct *font ) { int i, cw ; unsigned int fw = 0; if( font != NULL ) { for (i = font->max_char_or_byte2 - font->min_char_or_byte2 ; i >= 0; i--) { cw = font->per_char[i].width; if( cw > 0 ) MAX_IT(fw, cw); } } return fw ; } /*{{{ change_font() - Switch to a new font */ /* * init = 1 - initialize * * fontname == FONT_UP - switch to bigger font * fontname == FONT_DN - switch to smaller font */ /* PROTO */ void change_font(int init, const char *fontname) { const char *const msg = "can't load font \"%s\""; XFontStruct *xfont; static char *newfont[NFONTS]; #ifndef NO_BOLDFONT static XFontStruct *boldFont = NULL; #endif static int fnum = FONT0_IDX; /* logical font number */ int idx = 0; /* index into rs_font[] */ #if (FONT0_IDX == 0) # define IDX2FNUM(i) (i) # define FNUM2IDX(f) (f) #else # define IDX2FNUM(i) (i == 0 ? FONT0_IDX : (i <= FONT0_IDX ? (i-1) : i)) # define FNUM2IDX(f) (f == FONT0_IDX ? 0 : (f < FONT0_IDX ? (f+1) : f)) #endif /*#define FNUM_RANGE(i) (i <= 0 ? 0 : (i >= NFONTS ? (NFONTS-1) : i))*/ /* so to make it working on Sun Ultra thanks to Hari Nair */ #define FNUM_RANGE(i) (i < 0 ? (NFONTS-1) : (i >= NFONTS ? 0 : i)) if (!init) { switch (fontname[0]) { case '\0': fnum = FONT0_IDX; fontname = NULL; break; /* special (internal) prefix for font commands */ case FONT_CMD: idx = atoi(fontname + 1); switch (fontname[1]) { case '+': /* corresponds to FONT_UP */ fnum += (idx ? idx : 1); fnum = FNUM_RANGE(fnum); break; case '-': /* corresponds to FONT_DN */ fnum += (idx ? idx : -1); fnum = FNUM_RANGE(fnum); break; default: if (fontname[1] != '\0' && !isdigit(fontname[1])) return; if (idx < 0 || idx >= (NFONTS)) return; fnum = IDX2FNUM(idx); break; } fontname = NULL; break; default: if (fontname != NULL) { /* search for existing fontname */ for (idx = 0; idx < NFONTS; idx++) { if (!strcmp(rs_font[idx], fontname)) { fnum = IDX2FNUM(idx); fontname = NULL; break; } } } else return; break; } /* re-position around the normal font */ idx = FNUM2IDX(fnum); if (fontname != NULL) { char *name; xfont = XLoadQueryFont(Xdisplay, fontname); if (!xfont) return; name = MALLOC(strlen(fontname + 1) * sizeof(char)); if (name == NULL) { XFreeFont(Xdisplay, xfont); return; } STRCPY(name, fontname); if (newfont[idx] != NULL) FREE(newfont[idx]); newfont[idx] = name; rs_font[idx] = newfont[idx]; } } if (TermWin.font) XFreeFont(Xdisplay, TermWin.font); /* load font or substitute */ xfont = XLoadQueryFont(Xdisplay, rs_font[idx]); if (!xfont) { print_error(msg, rs_font[idx]); rs_font[idx] = "fixed"; xfont = XLoadQueryFont(Xdisplay, rs_font[idx]); if (!xfont) { print_error(msg, rs_font[idx]); goto Abort; } } TermWin.font = xfont; #ifndef NO_BOLDFONT /* fail silently */ if (init && rs_boldFont != NULL) boldFont = XLoadQueryFont(Xdisplay, rs_boldFont); #endif #ifdef MULTICHAR_SET if (TermWin.mfont) XFreeFont(Xdisplay, TermWin.mfont); /* load font or substitute */ xfont = XLoadQueryFont(Xdisplay, rs_mfont[idx]); if (!xfont) { print_error(msg, rs_mfont[idx]); rs_mfont[idx] = "k14"; xfont = XLoadQueryFont(Xdisplay, rs_mfont[idx]); if (!xfont) { print_error(msg, rs_mfont[idx]); goto Abort; } } TermWin.mfont = xfont; #endif /* MULTICHAR_SET */ /* alter existing GC */ if (!init) { XSetFont(Xdisplay, TermWin.gc, TermWin.font->fid); menubar_expose(); } /* set the sizes */ { int fh, fw = 0; fw = TermWin.font->min_bounds.width; /* can be error !!!! */ if( fw > 1000 ) fw = 0 ; /* added by suggestion from */ #ifdef USE_LINESPACE fh = TermWin.font->ascent + TermWin.font->descent + TermWin.lineSpace; #else fh = TermWin.font->ascent + TermWin.font->descent; #endif if (TermWin.font->min_bounds.width == TermWin.font->max_bounds.width) TermWin.fprop = 0; /* Mono-spaced (fixed width) font */ else TermWin.fprop = 1; /* Proportional font */ if (TermWin.fprop == 1) /* also, if == 0, per_char[] might be NULL */ fw = get_proportion_font_width( TermWin.font ); /* not the first time thru and sizes haven't changed */ if (fw == TermWin.fwidth && fh == TermWin.fheight) return; /* TODO: not return; check MULTI if needed */ TermWin.fwidth = fw; TermWin.fheight = fh; } /* check that size of boldFont is okay */ #ifndef NO_BOLDFONT TermWin.boldFont = NULL; if (boldFont != NULL) { int fh, fw = 0; fw = boldFont->min_bounds.width; /* can be error !!!! */ if( fw > 1000 ) fw = 0 ; fh = boldFont->ascent + boldFont->descent; if (TermWin.fprop == 0) { /* bold font must also be monospaced */ if (fw != boldFont->max_bounds.width) fw = -1; } else fw = get_proportion_font_width( boldFont ); if (fw == TermWin.fwidth && fh == TermWin.fheight) TermWin.boldFont = boldFont; } #endif /* NO_BOLDFONT */ /* TODO: check that size of Kanji font is okay */ set_colorfgbg(); TermWin.width = TermWin.ncol * TermWin.fwidth; TermWin.height = TermWin.nrow * TermWin.fheight; szHint.width_inc = TermWin.fwidth; szHint.height_inc = TermWin.fheight; szHint.min_width = szHint.base_width + szHint.width_inc; szHint.min_height = szHint.base_height + szHint.height_inc; szHint.width = szHint.base_width + TermWin.width; szHint.height = szHint.base_height + TermWin.height; { /* ONLYIF MENUBAR */ szHint.height += (delay_menu_drawing ? menuBar_TotalHeight() : 0); } szHint.flags = PMinSize | PResizeInc | PBaseSize | PWinGravity; if (!init) { resize(); } return; Abort: print_error("aborting"); /* fatal problem */ exit(EXIT_FAILURE); #undef IDX2FNUM #undef FNUM2IDX #undef FNUM_RANGE } /*}}} */ #ifdef _MYSTYLE_ char *DefaultMyStyle = NULL ; /* PROTO */ const char* GetDefaultMyStyle() { if( DefaultMyStyle == NULL ) { DefaultMyStyle = malloc( 1+strlen(MyName)+1 ); sprintf( DefaultMyStyle, "*%s", MyName ); } return DefaultMyStyle ; } char* pixel2string( unsigned long pixel, char* old_string ) { XColor xcol ; xcol.pixel = pixel ; XQueryColor( Xdisplay, DefaultColormap( Xdisplay, Xscreen), &xcol ); if( xcol.flags != 0 ) { old_string = realloc( old_string, 1+2+2+2+1 ); sprintf( old_string, "#%2.2X%2.2X%2.2X", (xcol.red)>>8, xcol.green>>8, xcol.blue>>8 ); } return old_string ; } char* argb2string( unsigned long argb, char* old_string ) { old_string = realloc( old_string, 1+2+2+2+1 ); sprintf( old_string, "#%2.2lX%2.2lX%2.2lX", (argb>>16)&0x000000FF, (argb>>8)&0x000000FF, argb&0x000000FF ); return old_string ; } char* font2string( XFontStruct *font, char* old_string ) { char* font_name ; Atom name_value ; if(XGetFontProperty(font, XA_FONT, &name_value)) { font_name=XGetAtomName(Xdisplay, name_value); if( font_name ) { /*fprintf( stderr, " font found : [%s]\n", font_name ); */ old_string = realloc( old_string, strlen( font_name)+1 ); strcpy( old_string, font_name ); } XFree( font_name ); } return old_string ; } static const char * translate_tint_color( ARGB32 tint ) { ARGB32 clean_tint = (tint<<1)|0xFF000000; static struct { ARGB32 tint; const char *name; }tint_names[6] = {{0xFFFF0000, "red"},{0xFFFFFF00, "yellow"},{0xFFFF00FF, "magenta"}, {0xFF00FF00, "green"},{0xFF00FFFF, "cyan"},{0xFF0000FF, "blue"}}; int i ; if( ARGB32_RED8(clean_tint) > 0 ) clean_tint |= 0x00030000; if( ARGB32_GREEN8(clean_tint) > 0 ) clean_tint |= 0x00000300; if( ARGB32_BLUE8(clean_tint) > 0 ) clean_tint |= 0x00000003; for( i = 0 ; i < 6 ; ++i ) if( tint_names[i].tint == clean_tint ) return tint_names[i].name; return NULL; } /* PROTO */ void set_mystyle( struct MyStyle* mystyle, Bool reset ) { int repaint = 0 ; static char* fg_color = NULL, *bg_color = NULL; TermWin.background.mystyle = mystyle ; if( mystyle == NULL ) { if( TermWin.background.trgType == BGT_MyStyle ) { if( TermWin.background.trgPixmap != None && TermWin.background.trgPixmap != TermWin.background.srcPixmap ) XFreePixmap( Xdisplay, TermWin.background.trgPixmap ); TermWin.background.trgType = BGT_None ; } return ; } if( mystyle->texture_type > TEXTURE_SOLID && ( !reset #ifdef TRANSPARENT || ( !(Options & Opt_transparent) && TermWin.background.srcPixmap == None ) #endif ) ) { #ifdef TRANSPARENT const char *tint_color = translate_tint_color( mystyle->tint ); if( mystyle->texture_type == TEXTURE_TRANSPARENT && (tint_color != NULL || mystyle->tint == 0) ) { Options |= Opt_transparent ; rs_color[Color_tint] = tint_color ; TermWin.background.mystyle = NULL ; TermWin.background.trgType = BGT_None ; }else #endif TermWin.background.trgType = BGT_MyStyle ; } if( mystyle && !get_flags(Options, Opt_transparent) ) { if( (mystyle->set_flags & F_FORECOLOR) && !(TermWin.background.user_flags & F_FORECOLOR) ) { rs_color[Color_fg] = fg_color = argb2string(mystyle->colors.fore, fg_color ) ; /* fprintf( stderr, "mystyle.fore = 0x%lX, text = \"%s\"", mystyle->colors.fore, rs_color[Color_fg] ); */ if( reset ) { PixColorsFocused[Color_fg] = mystyle->colors.fore ; #ifdef OFF_FOCUS_FADING PixColorsUnFocused[Color_fg] = fade_color(mystyle->colors.fore); #endif } repaint++ ; } if( (mystyle->set_flags & F_BACKCOLOR) && !(TermWin.background.user_flags & F_BACKCOLOR) ) { rs_color[Color_bg] = bg_color = argb2string(mystyle->colors.back, bg_color ) ; if( reset ) { PixColorsFocused[Color_bg] = mystyle->colors.back ; #ifdef OFF_FOCUS_FADING PixColorsUnFocused[Color_bg] = fade_color(mystyle->colors.back); #endif } repaint++ ; } /*if( mystyle->set_flags & F_BACKPIXMAP ) */ if( reset ) { if( repaint > 0 ) { /* we want to repaint ourselves */ on_colors_changed( Color_bg ); if( (mystyle->set_flags & F_FONT) && !(TermWin.background.user_flags & F_FONT) ) change_font( False, rs_font[0] ); } if( mystyle->texture_type > TEXTURE_SOLID ) { RenderPixmap(True); scr_clear(); scr_touch(); } } } } #endif #ifndef HAVE_AFTERSTEP /* PROTO */ Bool read_32bit_property (Window w, Atom property, CARD32* trg) { Bool res = False; if (w != None && property != None && trg) { Atom actual_type; int actual_format; unsigned long bytes_after; union { unsigned char *uc_ptr ; long *long_ptr ; }data; unsigned long nitems; data.long_ptr = NULL ; res = (XGetWindowProperty (Xdisplay, w, property, 0, 1, False, AnyPropertyType, &actual_type, &actual_format, &nitems, &bytes_after, &data.uc_ptr) == 0); /* checking property sanity */ res = (res && nitems > 0 && actual_format == 32); if (res) trg[0] = data.long_ptr[0]; if (data.long_ptr && nitems > 0) XFree (data.long_ptr); } return res; } /* PROTO */ Bool read_32bit_proplist (Window w, Atom property, long estimate, CARD32 ** list, long *nitems) { Bool res = False; #ifndef X_DISPLAY_MISSING if (w != None && property != None && list && nitems) { Atom actual_type; int actual_format; unsigned long bytes_after; unsigned long unitems = 0 ; union { unsigned char *uc_ptr ; long *long_ptr ; }buffer; buffer.long_ptr = NULL ; if (estimate <= 0) estimate = 1; res = (XGetWindowProperty (Xdisplay, w, property, 0, estimate, False, AnyPropertyType, &actual_type, &actual_format, &unitems, &bytes_after, &buffer.uc_ptr) == 0); /* checking property sanity */ res = (res && unitems > 0 && actual_format == 32); if (bytes_after > 0 && res) { XFree (buffer.long_ptr); res = (XGetWindowProperty (Xdisplay, w, property, 0, estimate + (bytes_after >> 2), False, actual_type, &actual_type, &actual_format, &unitems, &bytes_after, &buffer.uc_ptr) == 0); res = (res && (unitems > 0)); /* bad property */ } if (!res) { *nitems = 0; *list = NULL ; }else { register int i = unitems ; register CARD32 *data32 = malloc(unitems*sizeof(CARD32)); while( --i >= 0 ) data32[i] = buffer.long_ptr[i] ; *list = data32 ; *nitems = unitems ; } if ( buffer.long_ptr ) XFree (buffer.long_ptr); } #endif return res; } #endif /* PROTO */ Bool check_extended_wm_state() { CARD32 *items; long nitems = 0; unsigned long new_state = 0; Bool changed = False ; if (read_32bit_proplist (TermWin.parent, _XA_NET_WM_STATE, 6, &items, &nitems)) { int i ; for( i = 0 ; i < nitems ; ++i ) { if( items[i] == _XA_NET_WM_STATE_STICKY ) set_flags( new_state, WM_AtermStateSticky ); else if( items[i] == _XA_NET_WM_STATE_SHADED ) set_flags( new_state, WM_AtermStateShaded ); else if( items[i] == _XA_NET_WM_STATE_HIDDEN ) set_flags( new_state, WM_AtermStateHidden ); } free (items); changed = (get_flags(ExtWM.flags, WM_AtermStateSticky|WM_AtermStateShaded|WM_AtermStateHidden) != new_state) ; clear_flags(ExtWM.flags, WM_AtermStateSticky|WM_AtermStateShaded|WM_AtermStateHidden); set_flags( ExtWM.flags, new_state ); }else { changed = get_flags(ExtWM.flags, WM_AtermStateSticky|WM_AtermStateShaded|WM_AtermStateHidden); clear_flags(ExtWM.flags, WM_AtermStateSticky|WM_AtermStateShaded|WM_AtermStateHidden); } return changed; } /* PROTO */ void check_extended_wm_hints_support() { memset( &ExtWM, 0x00, sizeof(ExtWM)); if( read_32bit_property (Xroot, _XA_NET_SUPPORTING_WM_CHECK, &ExtWM.supporting_wm_check) ) if( ExtWM.supporting_wm_check != None ) { Window w; if( !read_32bit_property (ExtWM.supporting_wm_check, _XA_NET_SUPPORTING_WM_CHECK, &w) ) ExtWM.supporting_wm_check = None ; else if( w != ExtWM.supporting_wm_check ) ExtWM.supporting_wm_check = None ; else { CARD32 *supported_props = NULL; long nitems = 0 ; Bool curr_desk = False ; Bool app_desk = False ; if( read_32bit_proplist (Xroot, _XA_NET_SUPPORTED, 20, &supported_props, &nitems) ) { int i ; for( i = 0 ; i < nitems; ++i ) { if( supported_props[i] == _XA_NET_CURRENT_DESKTOP ) curr_desk = True ; else if( supported_props[i] == _XA_NET_WM_DESKTOP ) app_desk = True ; } } if( curr_desk && app_desk ) { set_flags( ExtWM.flags, WM_ClaimSupportsDesktops ); if( read_32bit_property (Xroot, _XA_NET_CURRENT_DESKTOP, &ExtWM.current_desktop) ) set_flags( ExtWM.flags, WM_SupportsDesktops ); } } } } /*{{{ main() */ /* PROTO */ int main(int argc, char *argv[]) { int i, t; char *val, **cmd_argv = NULL; /* "WINDOWID=\0" = 10 chars, UINT_MAX = 10 chars */ static char windowid_string[20], *display_string, *term_string; /* Hops - save original arglist for wdw property WM_COMMAND */ int saved_argc = argc; char **saved_argv = (char **)MALLOC((argc + 1) * sizeof(char *)); PixColors = &(PixColorsFocused[0]); for (i = 0; i < argc; i++) saved_argv[i] = argv[i]; saved_argv[i] = NULL; /* NULL terminate that sucker. */ for (i = 0; i < argc; i++) { if (!strcmp(argv[i], "-e") || !strcmp(argv[i], "-exec")) { argc = i; argv[argc] = NULL; if (argv[argc + 1] != NULL) cmd_argv = (argv + argc + 1); break; } } /* * Save and then give up any super-user privileges * If we need privileges in any area then we must specifically request it. * We should only need to be root in these cases: * 1. write utmp entries on some systems * 2. chown tty on some systems */ privileges(SAVE); privileges(IGNORE); Options = Opt_scrollBar | Opt_scrollTtyOutput; Xdisplay = NULL; display_name = NULL; rs_term_name = NULL; rs_cutchars = NULL; #ifndef NO_BOLDFONT rs_boldFont = NULL; #endif #ifdef PRINTPIPE rs_print_pipe = NULL; #endif rs_title = NULL; /* title name for window */ rs_iconName = NULL; /* icon name for window */ rs_geometry = NULL; /* window geometry */ rs_minBufferWidth = NULL; rs_saveLines = NULL; /* scrollback buffer [lines] */ #ifdef USE_LINESPACE rs_lineSpace = NULL; #endif rs_borderWidth = NULL; rs_internal_border = NULL; rs_modifier = NULL; /* modifier */ #if defined (HOTKEY_CTRL) || defined (HOTKEY_META) /* recognized when combined with HOTKEY */ ks_bigfont = XK_greater; ks_smallfont = XK_less; #endif rs_menu = NULL; rs_path = NULL; #ifdef BACKGROUND_IMAGE rs_backgroundPixmap = NULL; #endif #if defined(BACKGROUND_IMAGE) || defined(TRANSPARENT) rs_backgroundType = NULL; rs_shade = NULL; rs_tintType = NULL; #endif #ifndef NO_BACKSPACE_KEY rs_backspace_key = NULL; #endif #ifndef NO_DELETE_KEY rs_delete_key = NULL; #endif #ifndef NO_BRIGHTCOLOR colorfgbg = DEFAULT_RSTYLE; #endif rs_name = my_basename(argv[0]); if (cmd_argv != NULL && cmd_argv[0] != NULL) rs_iconName = rs_title = my_basename(cmd_argv[0]); /* * Open display, get options/resources and create the window */ get_options(argc, argv); if( display_name == NULL ) if ((display_name = getenv("DISPLAY")) == NULL) display_name = ":0"; #ifdef HAVE_AFTERSTEP #ifdef MyArgs_IS_MACRO MyArgsPtr = safecalloc(1, sizeof(ASProgArgs) ); #else memset( &MyArgs, 0x00, sizeof(ASProgArgs) ); #endif #ifdef Scr_IS_MACRO ASDefaultScr = safecalloc(1, sizeof(ScreenInfo)); #else memset( &Scr, 0x00, sizeof(ScreenInfo) ); #endif Scr.RootClipArea.width = 1 ; Scr.RootClipArea.height = 1; MyArgs.verbosity_level = OUTPUT_DEFAULT_THRESHOLD ; set_output_threshold( MyArgs.verbosity_level ); MyArgs.display_name = (char*)display_name ; SetMyName( argv[0] ); #ifdef NO_DEBUG_OUTPUT set_output_threshold( 0 ); #endif ConnectX ( &Scr, 0 ); Xdisplay = dpy ; Xscreen = Scr.screen ; asv = Scr.asv ; Xcmap = asv->colormap; Xdepth = asv->visual_info.depth; Xvisual = asv->visual_info.visual; XdisplayWidth = Scr.MyDisplayWidth ; XdisplayHeight = Scr.MyDisplayHeight ; #else Xdisplay = XOpenDisplay(display_name); if (!Xdisplay) { print_error("can't open display %s", display_name); exit(EXIT_FAILURE); } /* changed from _MOTIF_WM_INFO - Vaevictus - gentoo bug #139554 */ _XA_MwmAtom = XInternAtom(Xdisplay, "_MOTIF_WM_HINTS", True); _XA_NET_WM_PID = XInternAtom(Xdisplay, "_NET_WM_PID", False); _XROOTPMAP_ID = XInternAtom(Xdisplay, "_XROOTPMAP_ID", False); _XA_NET_SUPPORTING_WM_CHECK = XInternAtom(Xdisplay, "_NET_SUPPORTING_WM_CHECK", False); _XA_NET_SUPPORTED = XInternAtom(Xdisplay, "_NET_SUPPORTED", False); _XA_NET_CURRENT_DESKTOP = XInternAtom(Xdisplay, "_NET_CURRENT_DESKTOP", False); _XA_NET_WM_DESKTOP = XInternAtom(Xdisplay, "_NET_WM_DESKTOP", False); _XA_NET_WM_STATE = XInternAtom(Xdisplay, "_XA_NET_WM_STATE", False); _XA_NET_WM_STATE_STICKY = XInternAtom(Xdisplay, "_XA_NET_WM_STATE_STICKY", False); _XA_NET_WM_STATE_SHADED = XInternAtom(Xdisplay, "_XA_NET_WM_STATE_SHADED", False); _XA_NET_WM_STATE_HIDDEN = XInternAtom(Xdisplay, "_XA_NET_WM_STATE_HIDDEN", False); Xdepth = DefaultDepth(Xdisplay, Xscreen); Xcmap = DefaultColormap(Xdisplay, Xscreen); Xvisual = DefaultVisual(Xdisplay, Xscreen); XdisplayWidth = DisplayWidth (Xdisplay, Xscreen); XdisplayHeight = DisplayHeight (Xdisplay, Xscreen); #ifdef HAVE_AFTERIMAGE dpy = Xdisplay ; asv = create_asvisual (Xdisplay, Xscreen, Xdepth, NULL); Xcmap = asv->colormap; Xdepth = asv->visual_info.depth; Xvisual = asv->visual_info.visual; #else #ifdef PREFER_24BIT /* If depth is not 24, look for a 24bit visual. */ if (Xdepth != 24) { XVisualInfo vinfo; if (XMatchVisualInfo(Xdisplay, Xscreen, 24, TrueColor, &vinfo)) { Xdepth = 24; Xvisual = vinfo.visual; Xcmap = XCreateColormap(Xdisplay, RootWindow(Xdisplay, Xscreen), Xvisual, AllocNone); } } #endif #endif #endif /* HAVE_AFTERSTEP */ aterm_XA_TARGETS = XInternAtom(Xdisplay, "TARGETS", False); _XA_COMPAUND_TEXT = XInternAtom(Xdisplay, "COMPOUND_TEXT", False); aterm_XA_TEXT = XInternAtom(Xdisplay, "TEXT", False); aterm_XA_UTF8_STRING = XInternAtom(Xdisplay, "UTF8_STRING", False); aterm_XA_CLIPBOARD = XInternAtom(Xdisplay, "CLIPBOARD", False); aterm_XA_VT_SELECTION = XInternAtom(Xdisplay, "VT_SELECTION", False); aterm_XA_INCR = XInternAtom(Xdisplay, "INCR", False); check_extended_wm_hints_support(); #ifdef DEBUG_X XSynchronize(Xdisplay, True); XSetErrorHandler((XErrorHandler) abort); #else XSetErrorHandler((XErrorHandler) xerror_handler); #endif extract_resources(Xdisplay, rs_name); #if defined(BACKGROUND_IMAGE) || defined(TRANSPARENT) || defined(_MYSTYLE_) InitBackground(); #endif #ifdef HAVE_AFTERSTEP mystyle_get_property(Scr.wmprops ); /* lets see what options user chosen to override with other command line parameters : */ if( rs_font[0] != NULL ) TermWin.background.user_flags |= F_FONT ; if( rs_color[Color_fg] != NULL ) TermWin.background.user_flags |= F_FORECOLOR ; if( rs_color[Color_bg] != NULL ) TermWin.background.user_flags |= F_BACKCOLOR ; /* reading everything we can from default MyStyle : */ set_mystyle(mystyle_find( GetDefaultMyStyle()), False); /* overriding it with user specifyed MyStyle : */ if( rs_mystyle ) { MyStyle * mystyle = mystyle_find( rs_mystyle ); if( mystyle == NULL ) fprintf( stderr, "%s: AfterStep MyStyle \"%s\" not available - check your look file.\n", MyName, rs_mystyle ); else set_mystyle( mystyle, False ); } #endif #if defined(BACKGROUND_IMAGE) || defined(TRANSPARENT) if( rs_shade ) TermWin.background.Shading.shading = atoi(rs_shade); SetBackgroundType(rs_backgroundType); #endif #if defined(XTERM_SCROLLBAR) || defined(NEXT_SCROLLBAR) sb_shadow = 0; #else sb_shadow = (Options & Opt_scrollBar_floating) ? 0 : SHADOW; #endif /* * set any defaults not already set */ if (!rs_title) rs_title = rs_name; if (!rs_iconName) rs_iconName = rs_title; if (!rs_minBufferWidth || (t = atoi(rs_minBufferWidth)) < 0) TermWin.min_bcol = 1; else TermWin.min_bcol = t; if (!rs_saveLines || (t = atoi(rs_saveLines)) < 0) TermWin.saveLines = SAVELINES; else TermWin.saveLines = t; #ifdef USE_LINESPACE if (!rs_lineSpace || (TermWin.lineSpace = atoi(rs_lineSpace)) < 0) TermWin.lineSpace = LINESPACE; #endif if (!rs_borderWidth || (t = atoi(rs_borderWidth)) < 0) TermWin.borderWidth = BORDERWIDTH; else TermWin.borderWidth = t; if (!rs_internal_border|| (t = atoi(rs_internal_border)) < 0) TermWin_internalBorder = 2; else TermWin_internalBorder = t; TermWin_internalBorders = 2 * TermWin_internalBorder; /* no point having a scrollbar without having any scrollback! */ if (!TermWin.saveLines) Options &= ~Opt_scrollBar; #ifdef PRINTPIPE if (!rs_print_pipe) rs_print_pipe = PRINTPIPE; #endif if (!rs_cutchars) rs_cutchars = CUTCHARS; #ifndef NO_BACKSPACE_KEY if (!rs_backspace_key) # ifdef DEFAULT_BACKSPACE rs_backspace_key = DEFAULT_BACKSPACE; # else rs_backspace_key = "DEC"; /* can toggle between \033 or \177 */ # endif else (void) Str_escaped((char*)rs_backspace_key); #endif #ifndef NO_DELETE_KEY if (!rs_delete_key) # ifdef DEFAULT_DELETE rs_delete_key = DEFAULT_DELETE; # else rs_delete_key = "\033[3~"; # endif else (void) Str_escaped((char*)rs_delete_key); #endif #ifndef NO_BOLDFONT if (rs_font[0] == NULL && rs_boldFont != NULL) { rs_font[0] = rs_boldFont; rs_boldFont = NULL; } #endif for (i = 0; i < NFONTS; i++) { if (!rs_font[i]) rs_font[i] = def_fontName[i]; #ifdef MULTICHAR_SET if (!rs_mfont[i]) rs_mfont[i] = def_mfontName[i]; #endif } #ifdef USE_XIM TermWin.fontset = NULL; #endif #ifdef XTERM_REVERSE_VIDEO /* this is how xterm implements reverseVideo */ if (Options & Opt_reverseVideo) { if (!rs_color[Color_fg]) rs_color[Color_fg] = def_colorName[Color_bg]; if (!rs_color[Color_bg]) rs_color[Color_bg] = def_colorName[Color_fg]; } #endif for ( i = 0 ; i < NRS_COLORS; i++) if (!rs_color[i]) rs_color[i] = def_colorName[i]; #ifndef XTERM_REVERSE_VIDEO /* this is how we implement reverseVideo */ if (Options & Opt_reverseVideo) { const char *name; /* swap foreground/background colors */ name = rs_color[Color_fg]; rs_color[Color_fg] = rs_color[Color_bg]; rs_color[Color_bg] = name; name = def_colorName[Color_fg]; def_colorName[Color_fg] = def_colorName[Color_bg]; def_colorName[Color_bg] = name; } #endif /* convenient aliases for setting fg/bg to colors */ color_aliases(Color_fg); color_aliases(Color_bg); #ifndef NO_CURSORCOLOR color_aliases(Color_cursor); color_aliases(Color_cursor2); #endif /* NO_CURSORCOLOR */ color_aliases(Color_pointer); color_aliases(Color_border); #ifndef NO_BOLDUNDERLINE color_aliases(Color_BD); color_aliases(Color_UL); #endif /* NO_BOLDUNDERLINE */ /* add startup-menu: */ { /* ONLYIF MENUBAR */ delay_menu_drawing = 1; menubar_read(rs_menu); delay_menu_drawing--; } Create_Windows(saved_argc, saved_argv); scr_reset(); /* initialize screen */ Gr_reset(); /* reset graphics */ /* add scrollBar, do it directly to avoid resize() */ scrollbar_mapping(Options & Opt_scrollBar); /* we can now add menuBar */ { /* ONLYIF MENUBAR */ if (delay_menu_drawing) { delay_menu_drawing = 0; menubar_mapping(1); } } /* do it now to avoid unneccessary redrawing */ XMapWindow(Xdisplay, TermWin.vt); XMapWindow(Xdisplay, TermWin.parent); #if 0 #if defined(BACKGROUND_IMAGE) || defined(TRANSPARENT) || defined(_MYSTYLE_) if( TermWin.background.trgType != BGT_None ) { refresh_transparent_scrollbar(); RenderPixmap(1); scr_clear(); scr_touch(); } #endif #endif #ifdef DISPLAY_IS_IP /* Fixup display_name for export over pty to any interested terminal * clients via "ESC[7n" (e.g. shells). Note we use the pure IP number * (for the first non-loopback interface) that we get from * network_display(). This is more "name-resolution-portable", if you * will, and probably allows for faster x-client startup if your name * server is beyond a slow link or overloaded at client startup. Of * course that only helps the shell's child processes, not us. * * Giving out the display_name also affords a potential security hole */ val = display_name = network_display(display_name); if (val == NULL) #endif /* DISPLAY_IS_IP */ val = XDisplayString(Xdisplay); if (display_name == NULL) display_name = val; /* use broken `:0' value */ i = strlen(val); display_string = MALLOC((i + 9) * sizeof(char)); sprintf(display_string, "DISPLAY=%s", val); sprintf(windowid_string, "WINDOWID=%u", (unsigned int)TermWin.parent); /* add entries to the environment: * @ DISPLAY: in case we started with -display * @ WINDOWID: X window id number of the window * @ COLORTERM: terminal sub-name and also indicates its color * @ TERM: terminal name */ putenv(display_string); putenv(windowid_string); /* FREE(display_string); this cannot be freed */ #ifdef RXVT_TERMINFO putenv("TERMINFO=" RXVT_TERMINFO); #endif if (Xdepth <= 2) putenv("COLORTERM=" COLORTERMENV "-mono"); else putenv("COLORTERM=" COLORTERMENVFULL); if (rs_term_name != NULL) { i = strlen(rs_term_name); term_string = MALLOC((i + 6) * sizeof(char)); sprintf(term_string, "TERM=%s", rs_term_name); putenv(term_string); } else { putenv("TERM=" TERMENV); } if (!setlocale(LC_CTYPE, "")) print_error("Cannot set locale"); init_command(cmd_argv); main_loop(); /* main processing loop */ return EXIT_SUCCESS; } #undef XGetGeometry Status trace_XGetGeometry( char *file, int line, Display *dpy, Window w, Window *r, int *x, int *y, unsigned int *width,unsigned int *height,unsigned int *bw,unsigned int *depth) { Status res ; fprintf( stderr, "%s(%d):XGetGeometry(%lX) = ",file,line,w); res = XGetGeometry(dpy,w,r,x,y,width,height,bw,depth); fprintf( stderr, "(%ux%u%+d%+d),%d\n", *width, *height, *x, *y, res ); return res ; } /*}}} */ /*----------------------- end-of-file (C source) -----------------------*/ aterm-1.0.1/src/misc.c0000644000175000001440000002354210144447052013210 0ustar vaeusers/*--------------------------------*-C-*---------------------------------* * File: misc.c *----------------------------------------------------------------------* * Copyright (C) 1997,1998 Oezguer Kesim * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *----------------------------------------------------------------------*/ #ifndef lint static const char rcsid[] = "$Id: misc.c,v 1.1.1.1 2004/11/10 17:21:46 sasha Exp $"; #endif #include "rxvt.h" /* NECESSARY */ /*----------------------------------------------------------------------*/ /* PROTO */ const char * my_basename(const char *str) { const char *base = strrchr(str, '/'); return (base ? base + 1 : str); } /* * Print an error message */ /* PROTO */ void print_error(const char *fmt,...) { va_list arg_ptr; va_start(arg_ptr, fmt); fprintf(stderr, APL_NAME ": "); vfprintf(stderr, fmt, arg_ptr); fprintf(stderr, "\n"); va_end(arg_ptr); } /* * check that the first characters of S1 match S2 * * No Match * return: 0 * Match * return: strlen (N) */ /* PROTO */ int Str_match(const char *s1, const char *s2) { int n = 0; if (s1 == NULL || s2 == NULL) return 0; while (*s2) { if (*s1++ != *s2++) return 0; n++; } return n; } /* * remove leading/trailing space and strip-off leading/trailing quotes * Do it in-place */ /* PROTO */ char * Str_skip_space(char *str) { if (str && *str) { while (*str && isspace(*str)) str++; } return str; } /* PROTO */ char * Str_trim(char *str) { if (str && *str) { char *src; int n; src = Str_skip_space(str); n = strlen(src) - 1; while (n > 0 && isspace(src[n])) n--; src[n + 1] = '\0'; /* strip leading/trailing quotes */ if (src[0] == '"') { src++; n--; if (src[n] == '"') src[n--] = '\0'; } if (n < 0) *str = '\0'; else if (src != str) { char *dst = str; /* copy back in-place */ do { *dst++ = *src; } while (*src++ != '\0'); } } return str; } /* * in-place interpretation of string: * * backslash-escaped: "\a\b\E\e\n\r\t", "\octal" * Ctrl chars: ^@ .. ^_, ^? * * Emacs-style: "M-" prefix * * Also, * "M-x" prefixed strings, append "\r" if needed * "\E]" prefixed strings (XTerm escape sequence) append "\a" if needed * * returns the converted string length */ /* PROTO */ int Str_escaped(char *str) { register char *p = str; int i = 0, len, n, append = 0; /* use 'i' to increment through destination and p through source */ if (str == NULL || (len = strlen(str)) == 0) return 0; /* Emacs convenience, replace leading `M-..' with `\E..' */ if ((n = Str_match(p, "M-")) != 0) { str[i++] = '\033'; /* destination */ len--; p += n; if (toupper(*p) == 'X') { /* append carriage-return for `M-xcommand' */ append = '\r'; str[i++] = 'x'; /* destination */ p++; while (isspace(*p)) { p++; len--; } } } for ( /*nil */ ; i < len; i++) { register char ch = *p++; if (ch == '\\') { ch = *p; if (ch >= '0' && ch <= '7') { /* octal */ int j, num = 0; for (j = 0; j < 3 && (ch >= '0' && ch <= '7'); j++) { num = num * 010 + (ch - '0'); p++; len--; ch = *p; } ch = (unsigned char)num; } else { p++; len--; switch (ch) { case 'a': ch = 007; break; /* bell */ case 'b': ch = '\b'; break; /* backspace */ case 'E': case 'e': ch = 033; break; /* escape */ case 'n': ch = '\n'; break; /* newline */ case 'r': ch = '\r'; break; /* carriage-return */ case 't': ch = '\t'; break; /* tab */ } } } else if (ch == '^') { ch = *p; p++; len--; ch = toupper(ch); ch = (ch == '?' ? 127 : (ch - '@')); } str[i] = ch; } /* ESC] is an XTerm escape sequence, must be ^G terminated */ if (str[0] == '\0' && str[1] == '\033' && str[2] == ']') append = 007; /* add trailing character as required */ if (append && str[len - 1] != append) str[len++] = append; str[len] = '\0'; return len; } /*----------------------------------------------------------------------* * file searching */ /* #define DEBUG_SEARCH_PATH */ #if defined (BACKGROUND_IMAGE) || (MENUBAR_MAX) /* * search for FILE in the current working directory, and within the * colon-delimited PATHLIST, adding the file extension EXT if required. * * FILE is either semi-colon or zero terminated */ /* PROTO */ const char * File_search_path(const char *pathlist, const char *file, const char *ext) { static char name[256]; int maxpath, len; char *p; char *path = (char *)pathlist; /* remove const */ if (!access(file, R_OK)) return file; /* semi-colon delimited */ if ((p = strchr(file, ';')) == NULL) p = strchr(file, '\0'); len = (p - file); #ifdef DEBUG_SEARCH_PATH getcwd(name, sizeof(name)); fprintf(stderr, "pwd: \"%s\"\n", name); fprintf(stderr, "find: \"%.*s\"\n", len, file); #endif /* leave room for an extra '/' and trailing '\0' */ maxpath = sizeof(name) - (len + (ext ? strlen(ext) : 0) + 2); if (maxpath <= 0) return NULL; /* check if we can find it now */ strncpy(name, file, len); name[len] = '\0'; if (!access(name, R_OK)) return name; if (ext) { strcat(name, ext); if (!access(name, R_OK)) return name; } for ( /*nil */ ; path != NULL && *path != '\0'; path = p) { int n; /* colon delimited */ if ((p = strchr(path, ':')) == NULL) p = strchr(path, '\0'); n = (p - path); if (*p != '\0') p++; if (n > 0 && n <= maxpath) { strncpy(name, path, n); if (name[n - 1] != '/') name[n++] = '/'; name[n] = '\0'; strncat(name, file, len); if (!access(name, R_OK)) return name; if (ext) { strcat(name, ext); if (!access(name, R_OK)) return name; } } } return NULL; } /* PROTO */ const char * File_find(const char *file, const char *ext) { const char *f; if (file == NULL || *file == '\0') return NULL; /* search environment variables here too */ if ((f = File_search_path(rs_path, file, ext)) == NULL) #ifdef ATERM_PATH_ENV if ((f = File_search_path(getenv(ATERM_PATH_ENV), file, ext)) == NULL) #endif #ifdef PATH_ENV if ((f = File_search_path(getenv(PATH_ENV), file, ext)) == NULL) #endif f = File_search_path(getenv("PATH"), file, ext); #ifdef DEBUG_SEARCH_PATH if (f) fprintf(stderr, "found: \"%s\"\n", f); #endif return f; } #endif /* defined (BACKGROUND_IMAGE) || (MENUBAR_MAX) */ /*----------------------------------------------------------------------* * miscellaneous drawing routines */ /* * draw bottomShadow/highlight along top/left sides of the window */ /* PROTO */ void Draw_tl(Window win, GC gc, int x, int y, int w, int h) { int shadow = SHADOW; if (w == 0 || h == 0) shadow = 1; w += (x - 1); h += (y - 1); for ( /*nil */ ; shadow > 0; shadow--, x++, y++, w--, h--) { XDrawLine(Xdisplay, win, gc, x, y, w, y); XDrawLine(Xdisplay, win, gc, x, y, x, h); } } /* * draw bottomShadow/highlight along the bottom/right sides of the window */ /* PROTO */ void Draw_br(Window win, GC gc, int x, int y, int w, int h) { int shadow = SHADOW; if (w == 0 || h == 0) shadow = 1; w += (x - 1); h += (y - 1); x++; y++; for ( /*nil */ ; shadow > 0; shadow--, x++, y++, w--, h--) { XDrawLine(Xdisplay, win, gc, w, h, w, y); XDrawLine(Xdisplay, win, gc, w, h, x, h); } } /* PROTO */ void Draw_Shadow(Window win, GC topShadow, GC botShadow, int x, int y, int w, int h) { Draw_tl(win, topShadow, x, y, w, h); Draw_br(win, botShadow, x, y, w, h); } /* button shapes */ /* PROTO */ void Draw_Triangle(Window win, GC topShadow, GC botShadow, int x, int y, int w, int type) { switch (type) { case 'r': /* right triangle */ XDrawLine(Xdisplay, win, topShadow, x, y, x, y + w); XDrawLine(Xdisplay, win, topShadow, x, y, x + w, y + w / 2); XDrawLine(Xdisplay, win, botShadow, x, y + w, x + w, y + w / 2); break; case 'l': /* right triangle */ XDrawLine(Xdisplay, win, botShadow, x + w, y + w, x + w, y); XDrawLine(Xdisplay, win, botShadow, x + w, y + w, x, y + w / 2); XDrawLine(Xdisplay, win, topShadow, x, y + w / 2, x + w, y); break; case 'd': /* down triangle */ XDrawLine(Xdisplay, win, topShadow, x, y, x + w / 2, y + w); XDrawLine(Xdisplay, win, topShadow, x, y, x + w, y); XDrawLine(Xdisplay, win, botShadow, x + w, y, x + w / 2, y + w); break; case 'u': /* up triangle */ XDrawLine(Xdisplay, win, botShadow, x + w, y + w, x + w / 2, y); XDrawLine(Xdisplay, win, botShadow, x + w, y + w, x, y + w); XDrawLine(Xdisplay, win, topShadow, x, y + w, x + w / 2, y); break; #if 0 case 's': /* square */ XDrawLine(Xdisplay, win, topShadow, x + w, y, x, y); XDrawLine(Xdisplay, win, topShadow, x, y, x, y + w); XDrawLine(Xdisplay, win, botShadow, x, y + w, x + w, y + w); XDrawLine(Xdisplay, win, botShadow, x + w, y + w, x + w, y); break; #endif } } /*----------------------- end-of-file (C source) -----------------------*/ aterm-1.0.1/src/pixmap.c0000644000175000001440000007711310256071660013560 0ustar vaeusers/*--------------------------------*-C-*---------------------------------* * File: pixmap.c *----------------------------------------------------------------------* * Copyright (c) 1999 Ethan Fischer * Copyright (c) 1999 Sasha Vasko * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------*/ /*---------------------------------------------------------------------* * Originally written: * 1999 Sasha Vasko *----------------------------------------------------------------------*/ #ifndef lint static const char rcsid[] = "$Id: pixmap.c,v 1.17 2005/06/21 20:08:16 sasha Exp $"; #endif #include "rxvt.h" /* NECESSARY */ int pixmap_error_handler (Display * dpy, XErrorEvent * error) { #ifdef DEBUG_IMAGING show_error ("XError # %u, in resource %lu, Request: %d.%d", error->error_code, error->resourceid, error->request_code, error->minor_code); #endif return 0; } #ifndef HAVE_AFTERIMAGE #include #define dpy Xdisplay #define CREATE_TRG_PIXMAP(w,h) XCreatePixmap(Xdisplay, Xroot, w, h, Xdepth) /* PROTO */ Pixmap GetRootPixmap (Atom id) { Pixmap currentRootPixmap = None; #ifndef X_DISPLAY_MISSING Atom act_type; int act_format; unsigned long nitems, bytes_after; unsigned char *prop = NULL; /*fprintf(stderr, "\n aterm GetRootPixmap(): root pixmap is set"); */ if (XGetWindowProperty ( dpy, RootWindow(dpy,DefaultScreen(dpy)), _XROOTPMAP_ID, 0, 1, False, XA_PIXMAP, &act_type, &act_format, &nitems, &bytes_after, &prop) == Success) { if (prop) { currentRootPixmap = *((Pixmap *) prop); XFree (prop); /*fprintf(stderr, "\n aterm GetRootPixmap(): root pixmap is [%lu]", currentRootPixmap); */ } } #endif return currentRootPixmap; } /* PROTO */ Pixmap ValidatePixmap (Pixmap p, int bSetHandler, int bTransparent, unsigned int *pWidth, unsigned int *pHeight) { #ifndef X_DISPLAY_MISSING int (*oldXErrorHandler) (Display *, XErrorEvent *) = NULL; /* we need to check if pixmap is still valid */ Window root; int junk; if (bSetHandler) oldXErrorHandler = XSetErrorHandler (pixmap_error_handler); if (bTransparent) p = GetRootPixmap (None); if (!pWidth) pWidth = &junk; if (!pHeight) pHeight = &junk; if (p != None) { if (!XGetGeometry (dpy, p, &root, &junk, &junk, pWidth, pHeight, &junk, &junk)) p = None; } if(bSetHandler) XSetErrorHandler (oldXErrorHandler); return p; #else return None ; #endif } /* PROTO */ int GetRootDimensions (int *width, int *height) { #ifndef X_DISPLAY_MISSING Window root; int w_x, w_y; unsigned int junk; if( dpy == NULL ) return 0; if (!XGetGeometry (dpy, RootWindow(dpy,DefaultScreen(dpy)), &root, &w_x, &w_y, width, height, &junk, &junk)) { *width = 0; *height = 0; } return (*width > 0 && *height > 0) ? 1 : 0; #else return 0; #endif } /* PROTO */ int GetWinPosition (Window w, int *x, int *y) { #ifndef X_DISPLAY_MISSING int bRes = 1; static int rootWidth = 0, rootHeight = 0; int my_x, my_y; Window wdumm; if (!x) x = &my_x; if (!y) y = &my_y; *x = 0; *y = 0; if (!rootWidth || !rootHeight) if (!GetRootDimensions (&rootWidth, &rootHeight)) return 0; XTranslateCoordinates (dpy, w, RootWindow(dpy,DefaultScreen(dpy)), 0, 0, x, y, &wdumm); /* taking in to consideration virtual desktopping */ if (*x < 0 || *x >= rootWidth || *y < 0 || *y >= rootHeight) bRes = 0; /* don't want to return position outside the screen even if we fail */ while(*x < 0) *x += rootWidth; while (*y < 0) *y += rootHeight; if (*x > rootWidth) *x %= rootWidth; if (*y > rootHeight) *y %= rootHeight; return bRes; #endif *x = 0; *y = 0; return 0; } void ShadeXImage( XImage* srcImage, ShadingInfo* shading, GC gc ) { int sh_r, sh_g, sh_b; RUINT32T mask_r, mask_g, mask_b; RUINT32T *lookup, *lookup_r, *lookup_g, *lookup_b; unsigned int lower_lim_r, lower_lim_g, lower_lim_b; unsigned int upper_lim_r, upper_lim_g, upper_lim_b; int i; #ifdef DO_CLOCKING clock_t started = clock(); #endif #ifdef ATERM Visual* visual = DefaultVisual(Xdisplay, Xscreen); #else Visual* visual = DefaultVisual(dpy, DefaultScreen(dpy)); #endif if( visual->class != TrueColor || srcImage->format != ZPixmap ) return ; /* for convenience */ mask_r = visual->red_mask; mask_g = visual->green_mask; mask_b = visual->blue_mask; /* boring lookup table pre-initialization */ switch (srcImage->bits_per_pixel) { case 15: if ((mask_r != 0x7c00) || (mask_g != 0x03e0) || (mask_b != 0x001f)) return; lookup = (RUINT32T *) malloc (sizeof (RUINT32T)*(32+32+32)); lookup_r = lookup; lookup_g = lookup+32; lookup_b = lookup+32+32; sh_r = 10; sh_g = 5; sh_b = 0; break; case 16: if ((mask_r != 0xf800) || (mask_g != 0x07e0) || (mask_b != 0x001f)) return; lookup = (RUINT32T *) malloc (sizeof (RUINT32T)*(32+64+32)); lookup_r = lookup; lookup_g = lookup+32; lookup_b = lookup+32+64; sh_r = 11; sh_g = 5; sh_b = 0; break; case 24: if ((mask_r != 0xff0000) || (mask_g != 0x00ff00) || (mask_b != 0x0000ff)) return; lookup = (RUINT32T *) malloc (sizeof (RUINT32T)*(256+256+256)); lookup_r = lookup; lookup_g = lookup+256; lookup_b = lookup+256+256; sh_r = 16; sh_g = 8; sh_b = 0; break; case 32: if ((mask_r != 0xff0000) || (mask_g != 0x00ff00) || (mask_b != 0x0000ff)) return; lookup = (RUINT32T *) malloc (sizeof (RUINT32T)*(256+256+256)); lookup_r = lookup; lookup_g = lookup+256; lookup_b = lookup+256+256; sh_r = 16; sh_g = 8; sh_b = 0; break; default: return; /* we do not support this color depth */ } /* prepare limits for color transformation (each channel is handled separately) */ if (shading->shading < 0) { int shade; shade = -shading->shading; if (shade < 0) shade = 0; if (shade > 100) shade = 100; lower_lim_r = 65535-shading->tintColor.red; lower_lim_g = 65535-shading->tintColor.green; lower_lim_b = 65535-shading->tintColor.blue; lower_lim_r = 65535-(unsigned int)(((RUINT32T)lower_lim_r)*((RUINT32T)shade)/100); lower_lim_g = 65535-(unsigned int)(((RUINT32T)lower_lim_g)*((RUINT32T)shade)/100); lower_lim_b = 65535-(unsigned int)(((RUINT32T)lower_lim_b)*((RUINT32T)shade)/100); upper_lim_r = upper_lim_g = upper_lim_b = 65535; } else { int shade; shade = shading->shading; if (shade < 0) shade = 0; if (shade > 100) shade = 100; lower_lim_r = lower_lim_g = lower_lim_b = 0; upper_lim_r = (unsigned int)((((RUINT32T)shading->tintColor.red)*((RUINT32T)shading->shading))/100); upper_lim_g = (unsigned int)((((RUINT32T)shading->tintColor.green)*((RUINT32T)shading->shading))/100); upper_lim_b = (unsigned int)((((RUINT32T)shading->tintColor.blue)*((RUINT32T)shading->shading))/100); } /* switch red and blue bytes if necessary, we need it for some weird XServers like XFree86 3.3.3.1 */ if ((srcImage->bits_per_pixel == 24) && (mask_r >= 0xFF0000 )) { unsigned int tmp; tmp = lower_lim_r; lower_lim_r = lower_lim_b; lower_lim_b = tmp; tmp = upper_lim_r; upper_lim_r = upper_lim_b; upper_lim_b = tmp; } /* fill our lookup tables */ for (i = 0; i <= mask_r>>sh_r; i++) { RUINT32T tmp; tmp = ((RUINT32T)i)*((RUINT32T)(upper_lim_r-lower_lim_r)); tmp += ((RUINT32T)(mask_r>>sh_r))*((RUINT32T)lower_lim_r); lookup_r[i] = (tmp/65535)<>sh_g; i++) { RUINT32T tmp; tmp = ((RUINT32T)i)*((RUINT32T)(upper_lim_g-lower_lim_g)); tmp += ((RUINT32T)(mask_g>>sh_g))*((RUINT32T)lower_lim_g); lookup_g[i] = (tmp/65535)<>sh_b; i++) { RUINT32T tmp; tmp = ((RUINT32T)i)*((RUINT32T)(upper_lim_b-lower_lim_b)); tmp += ((RUINT32T)(mask_b>>sh_b))*((RUINT32T)lower_lim_b); lookup_b[i] = (tmp/65535)<bits_per_pixel) { case 15: { unsigned short *p1, *pf, *p, *pl; p1 = (unsigned short *) srcImage->data; pf = (unsigned short *) (srcImage->data + srcImage->height * srcImage->bytes_per_line); while (p1 < pf) { p = p1; pl = p1 + srcImage->width; for (; p < pl; p++) { *p = lookup_r[(*p & 0x7c00)>>10] | lookup_g[(*p & 0x03e0)>> 5] | lookup_b[(*p & 0x001f)]; } p1 = (unsigned short *) ((char *) p1 + srcImage->bytes_per_line); } break; } case 16: { unsigned short *p1, *pf, *p, *pl; p1 = (unsigned short *) srcImage->data; pf = (unsigned short *) (srcImage->data + srcImage->height * srcImage->bytes_per_line); while (p1 < pf) { p = p1; pl = p1 + srcImage->width; for (; p < pl; p++) { *p = lookup_r[(*p & 0xf800)>>11] | lookup_g[(*p & 0x07e0)>> 5] | lookup_b[(*p & 0x001f)]; } p1 = (unsigned short *) ((char *) p1 + srcImage->bytes_per_line); } break; } case 24: { unsigned char *p1, *pf, *p, *pl; p1 = (unsigned char *) srcImage->data; pf = (unsigned char *) (srcImage->data + srcImage->height * srcImage->bytes_per_line); while (p1 < pf) { p = p1; pl = p1 + srcImage->width * 3; for (; p < pl; p += 3) { p[0] = lookup_r[(p[0] & 0xff0000)>>16]; p[1] = lookup_r[(p[1] & 0x00ff00)>> 8]; p[2] = lookup_r[(p[2] & 0x0000ff)]; } p1 = (unsigned char *) ((char *) p1 + srcImage->bytes_per_line); } break; } case 32: { RUINT32T *p1, *pf, *p, *pl; p1 = (RUINT32T *) srcImage->data; pf = (RUINT32T *) (srcImage->data + srcImage->height * srcImage->bytes_per_line); while (p1 < pf) { p = p1; pl = p1 + srcImage->width; for (; p < pl; p++) { *p = lookup_r[(*p & 0xff0000)>>16] | lookup_g[(*p & 0x00ff00)>> 8] | lookup_b[(*p & 0x0000ff)] | (*p & ~0xffffff); } p1 = (RUINT32T *) ((char *) p1 + srcImage->bytes_per_line); } break; } } free (lookup); #ifdef DO_CLOCKING printf( "\n Shading time (clocks): %lu\n",clock()-started ); #endif } void CopyAndShadeArea( Drawable src, Pixmap trg, int x, int y, int w, int h, int trg_x, int trg_y, GC gc, ShadingInfo* shading ) { int (*oldXErrorHandler) (Display *, XErrorEvent *) ; /* we need to check if pixmap is still valid */ oldXErrorHandler = XSetErrorHandler (pixmap_error_handler); if( shading ) { XImage* img ; if( x <0 || y <0 ) return ; if((img = XGetImage (Xdisplay, src, x, y, w, h, AllPlanes, ZPixmap))!= NULL ) { ShadeXImage( img, shading, gc ); XPutImage(Xdisplay, trg, gc, img, 0, 0, trg_x, trg_y, w, h); #ifdef BENCHMARK_SHADING { int i; time_t before, after; double diff; before = time (NULL); for (i = 0; i < BENCHMARK_SHADING; i++) ShadeXImage (img, shading, gc); after = time (NULL); diff = difftime (after, before); printf ("CopyAndShadeArea(): %d shading runs took %.0f seconds\n", BENCHMARK_SHADING, diff); } #endif XDestroyImage( img ); return ; } } if( !XCopyArea (Xdisplay, src, trg, gc, x, y, w, h, trg_x, trg_y)) XFillRectangle( Xdisplay, trg, gc, trg_x, trg_y, w, h ); XSetErrorHandler (oldXErrorHandler); } void ShadeTiledPixmap(Pixmap src, Pixmap trg, int src_w, int src_h, int x, int y, int w, int h, GC gc, ShadingInfo* shading) { int tile_x, tile_y, left_w, bott_h; if( src_w > 0 && src_h > 0 ) { tile_x = x%src_w ; tile_y = y%src_h ; left_w = min(src_w-tile_x,w); bott_h = min(src_h-tile_y,h); /*fprintf( stderr, "\nShadeTiledPixmap(): tile_x = %d, tile_y = %d, left_w = %d, bott_h = %d, SRC = %dx%d TRG=%dx%d", tile_x, tile_y, left_w, bott_h, src_w, src_h, w, h);*/ CopyAndShadeArea( src, trg, tile_x, tile_y, left_w, bott_h, 0, 0, gc, shading ); if( bott_h < h ) { /* right-top parts */ CopyAndShadeArea( src, trg, tile_x, 0, left_w, h-bott_h, 0, bott_h, gc, shading ); } if( left_w < w ) { /* left-bott parts */ CopyAndShadeArea( src, trg, 0, tile_y, w-left_w, bott_h, left_w, 0, gc, shading ); if( bott_h < h ) /* left-top parts */ CopyAndShadeArea( src, trg, 0, 0, w-left_w, h-bott_h, left_w, bott_h, gc, shading ); } } } Pixmap ShadePixmap (Pixmap src, int x, int y, int width, int height, GC gc, ShadingInfo* shading ) { Pixmap trg = CREATE_TRG_PIXMAP(width, height); if( trg != None ) { CopyAndShadeArea( src, trg, x, y, width, height, 0, 0, gc, shading ); } return trg ; } void sleep_a_little (int n) { struct timeval value; if (n <= 0) return; value.tv_usec = n % 1000000; value.tv_sec = n / 1000000; (void) select (1, 0, 0, 0, &value); } static Pixmap CutPixmap ( Pixmap src, Pixmap trg, int x, int y, unsigned int src_w, unsigned int src_h, unsigned int width, unsigned int height, GC gc, ShadingInfo * shading) { Bool my_pixmap = (trg == None )?True:False ; int screen_w, screen_h ; int offset_x = 0, offset_y = 0 ; screen_w = DisplayWidth( Xdisplay, Xscreen ); screen_h = DisplayHeight( Xdisplay, Xscreen ); while( x+(int)width < 0 ) x+= screen_w ; while( x >= screen_w ) x-= screen_w ; while( y+(int)height < 0 ) y+= screen_h ; while( y >= screen_h ) y-= screen_h ; if (width < 2 || height < 2 ) return trg; if( x < 0 ) { offset_x = (-x) ; x = 0 ; width -= offset_x ; } if( y < 0 ) { offset_y = (-y) ; y = 0 ; height -= offset_y ; } if( x+width >= screen_w ) width = screen_w - x ; if( y+height >= screen_h ) height = screen_h - y ; if (src == None) /* we don't have root pixmap ID */ { /* we want to create Overrideredirect window overlapping out window with background type of Parent Relative and then grab it */ XSetWindowAttributes attr ; XEvent event ; int tick_count = 0 ; Bool grabbed = False ; attr.background_pixmap = ParentRelative ; attr.backing_store = Always ; attr.event_mask = ExposureMask ; attr.override_redirect = True ; src = XCreateWindow(Xdisplay, Xroot, x, y, width, height, 0, CopyFromParent, CopyFromParent, CopyFromParent, CWBackPixmap|CWBackingStore|CWOverrideRedirect|CWEventMask, &attr); if( src == None ) return trg ; XGrabServer( Xdisplay ); grabbed = True ; XMapRaised( Xdisplay, src ); XSync(Xdisplay, False ); /* now we have to wait for our window to become mapped - waiting for Expose */ for( tick_count = 0 ; !XCheckWindowEvent( Xdisplay, src, ExposureMask, &event ) && tick_count < 100 ; tick_count++) sleep_a_little(100); if( tick_count < 100 ) { if( trg == None ) trg = CREATE_TRG_PIXMAP (width+offset_x, height+offset_y); if (trg != None) { /* custom code to cut area, so to ungrab server ASAP */ if (shading) { XImage *img; img = XGetImage (Xdisplay, src, 0, 0, width, height, AllPlanes, ZPixmap); XDestroyWindow( Xdisplay, src ); src = None ; XUngrabServer( Xdisplay ); grabbed = False ; if (img != NULL) { ShadeXImage (img, shading, gc); XPutImage (Xdisplay, trg, gc, img, 0, 0, offset_x, offset_y, width, height); #ifdef BENCHMARK_SHADING { int i; time_t before, after; double diff; before = time (NULL); for (i = 0; i < BENCHMARK_SHADING; i++) ShadeXImage (img, shading, gc); after = time (NULL); diff = difftime (after, before); printf ("CutPixmap(): %d shading runs took %.0f seconds\n", BENCHMARK_SHADING, diff); } #endif XDestroyImage (img); }else if( my_pixmap ) { XFreePixmap( Xdisplay, trg ); trg = None ; } }else XCopyArea (Xdisplay, src, trg, gc, 0, 0, width, height, offset_x, offset_y); } } if( src ) XDestroyWindow( Xdisplay, src ); if( grabbed ) XUngrabServer( Xdisplay ); return trg ; } /* we have root pixmap ID */ /* find out our coordinates relative to the root window */ if (x + width > src_w || y + height > src_h) { /* tiled pixmap processing here */ Pixmap tmp ; width = min (width, src_w); height = min (height, src_h); tmp = CREATE_TRG_PIXMAP (width, height); if (tmp != None) { ShadeTiledPixmap (src, tmp, src_w, src_h, x, y, width, height, gc, shading); if( trg == None ) trg = CREATE_TRG_PIXMAP (width+offset_x, height+offset_y); if( trg != None ) XCopyArea (Xdisplay, tmp, trg, gc, 0, 0, width, height, offset_x, offset_y); XFreePixmap( Xdisplay, tmp ); return trg; } } /* create target pixmap of the size of the window */ if( trg == None ) trg = CREATE_TRG_PIXMAP (width+offset_x, height+offset_y); if (trg != None) { /* cut area */ CopyAndShadeArea (src, trg, x, y, width, height, offset_x, offset_y, gc, shading); } return trg; } /* PROTO */ Pixmap CutWinPixmap (Window win, Drawable src, int src_w, int src_h, int width, int height, GC gc, ShadingInfo * shading) { unsigned int x = 0, y = 0; if( src == None ) { #ifndef TRANSPARENT return None ; #else if( !(Options & Opt_transparent)) return None ; #endif } if (!GetWinPosition (win, &x, &y)) return None; return CutPixmap( src, None, x, y, src_w, src_h, width, height, gc, shading ); } /* PROTO */ int FillPixmapWithTile (Pixmap pixmap, Pixmap tile, int x, int y, int width, int height, int tile_x, int tile_y) { if (tile != None && pixmap != None) { GC gc; XGCValues gcv; gcv.tile = tile; gcv.fill_style = FillTiled; gcv.ts_x_origin = -tile_x; gcv.ts_y_origin = -tile_y; gc = XCreateGC (Xdisplay, tile, GCFillStyle | GCTile | GCTileStipXOrigin | GCTileStipYOrigin, &gcv); XFillRectangle (Xdisplay, pixmap, gc, x, y, width, height); XFreeGC (Xdisplay, gc); return 1; } return 0; } #endif /* HAVE_AFTERIMAGE */ /***************************************************************************/ /* Down below goes aterm specific functions */ /***************************************************************************/ #define BG TermWin.background /*for convinience*/ void FreeTargetPixmap() { if( BG.trgPixmap != None ) { XFreePixmap( Xdisplay, BG.trgPixmap ); /*just in case*/ BG.trgPixmap = None ; } } /* PROTO */ void SetSrcPixmap(Pixmap p) { #ifdef DEBUG_BACKGROUND_PMAP fprintf(stderr, "srcPixmap = %lx, new srcPixmap = %lx.\n", BG.srcPixmap, p ); #endif if( BG.srcPixmap != None && BG.bMySource && BG.srcPixmap != p ) { XFreePixmap( Xdisplay, BG.srcPixmap ); BG.srcPixmap = p ; BG.bMySource = 0 ; } BG.srcPixmap = p ; BG.Width = 0 ; BG.Height = 0 ; if( BG.srcPixmap != None ) { Window root; unsigned int dum, w, h; int dummy; #ifdef DEBUG_BACKGROUND_PMAP fprintf(stderr, "Querying geometry of the source pixmap %lX...", BG.srcPixmap ); #endif if (XGetGeometry (Xdisplay, BG.srcPixmap, &root, &dummy, &dummy, &w, &h, &dum, &dum)) { BG.Width = w ; BG.Height = h ; #ifdef DEBUG_BACKGROUND_PMAP fprintf(stderr, "success : geometry is %dx%d.\n", w, h ); #endif }else { #ifdef DEBUG_BACKGROUND_PMAP fprintf(stderr, "failed.\n" ); #endif BG.srcPixmap = None ; } } } /* PROTO */ void ValidateSrcPixmap(int bSetHandler) { if( !BG.bMySource ) { /* we need to check if pixmap is still valid */ Pixmap new_p ; new_p = ValidatePixmap( BG.srcPixmap , bSetHandler, ((Options & Opt_transparent) && BG.trgType != BGT_None), NULL, NULL ); if( new_p != BG.srcPixmap ) SetSrcPixmap(new_p); } } /* PROTO */ int GetMyPosition( int* x, int* y ) { int bRet = 0 ; int (*old) (Display *, XErrorEvent *) = XSetErrorHandler (pixmap_error_handler); bRet = GetWinPosition( TermWin.vt, x, y ); XSetErrorHandler (old); return bRet ; } /* PROTO */ Bool IsTransparentPixmap() { #ifdef _MYSTYLE_ if( BG.trgType == BGT_MyStyle && TransparentMS(TermWin.background.mystyle)) return True; #endif #ifdef TRANSPARENT if(get_flags(Options, Opt_transparent) && BG.trgType != BGT_None ) return True; #endif return False ; } /* PROTO */ Bool TransparentPixmapNeedsUpdate() { #ifdef DEBUG_BACKGROUND_PMAP fprintf( stderr, "%s: checking if transparent\n", __FUNCTION__ ); #endif if( !IsTransparentPixmap() ) return False; #ifdef DEBUG_BACKGROUND_PMAP fprintf( stderr, "%s: checking if same desktop\n", __FUNCTION__ ); #endif if( ExtWM.current_desktop != ExtWM.aterm_desktop && ExtWM.aterm_desktop != 0xFFFFFFFF && get_flags( ExtWM.flags, WM_SupportsDesktops )&& !get_flags( ExtWM.flags, WM_AtermStateSticky ) ) return False; if( get_flags( ExtWM.flags, WM_AtermStateShaded|WM_AtermStateHidden ) ) return False; #ifdef DEBUG_BACKGROUND_PMAP fprintf( stderr, "%s: checking if pixmap/position changed\n", __FUNCTION__ ); fprintf( stderr, "%s: last pixmap = %lX new pixmap = %lX\n", __FUNCTION__, TermWin.LastPixmapUsed, BG.srcPixmap ); #endif if( TermWin.LastPixmapUsed == BG.srcPixmap && TermWin.LastPixmap_root_x == TermWin.root_x && TermWin.LastPixmap_root_y == TermWin.root_y && TermWin.LastPixmap_width == TermWin.root_width && TermWin.LastPixmap_height == TermWin.root_height ) return False; #ifdef DEBUG_BACKGROUND_PMAP fprintf( stderr, "%s: checking if visible\n", __FUNCTION__ ); #endif if( TermWin.root_x+TermWin.root_width <= 0 || TermWin.root_y+TermWin.root_height <= 0 || TermWin.root_x >= XdisplayWidth || TermWin.root_y >= XdisplayHeight ) return False; #ifdef DEBUG_BACKGROUND_PMAP fprintf( stderr, "%s: all clear - needs update\n", __FUNCTION__ ); #endif return True; } #ifdef _MYSTYLE_ Pixmap RenderMyStylePixmap( MyStyle *style, Pixmap root_pmap, unsigned int root_pmap_width, unsigned int root_pmap_height, unsigned int width, unsigned int height ) { Pixmap p = None; /* fprintf( stderr, "Entering RenderMyStylePixmap : texture_type = %d\n", style->texture_type ); */ if (style->texture_type > TEXTURE_SOLID) { int real_x, real_y ; ASImage *im ; GetMyPosition( &real_x, &real_y); if( Scr.RootImage != NULL ) { if( Scr.RootClipArea.x != real_x || Scr.RootClipArea.y != real_y || Scr.RootClipArea.width != width || Scr.RootClipArea.height != height ) { destroy_asimage( &Scr.RootImage ); } } Scr.RootClipArea.x = real_x ; Scr.RootClipArea.y = real_y ; Scr.RootClipArea.width = width ; Scr.RootClipArea.height = height ; im = mystyle_make_image( style, real_x, real_y, width, height, 0 ); p = asimage2pixmap( asv, Xroot, im, NULL, True ); destroy_asimage( &im ); } return p; } #endif /* PROTO */ void RenderPixmap(int DontCheckSource ) { XGCValues gcvalue; GC gc; int width = TermWin_TotalWidth(); int height = TermWin_TotalHeight(); unsigned int fin_width, fin_height ; int (*oldXErrorHandler) (Display *, XErrorEvent *) ; set_background_updated(); /* we have some nice processing of all the X errors built in */ /* so let's not let us crash if anything goes wrong */ oldXErrorHandler = XSetErrorHandler (pixmap_error_handler); #ifdef DEBUG_BACKGROUND_PMAP XSetErrorHandler (oldXErrorHandler); #endif if( !DontCheckSource ) ValidateSrcPixmap( 0 ); if( IsTransparentPixmap() ) { if( ExtWM.current_desktop != ExtWM.aterm_desktop && get_flags( ExtWM.flags, WM_SupportsDesktops ) ) { XSetErrorHandler (oldXErrorHandler); return; } } if( BG.srcPixmap == None #ifdef _MYSTYLE_ && BG.trgType != BGT_MyStyle #endif ) { #ifdef TRANSPARENT if(!(Options & Opt_transparent) || BG.trgType == BGT_None) #endif { XSetErrorHandler (oldXErrorHandler); return ; /* nothing to do here */ } if( DontCheckSource ) ValidateSrcPixmap( 0 ); } /* for convinience only */ fin_width = width ; fin_height = height ; /*fprintf(stderr, "\n aterm: entering RenderPixmap, window size is %dx%d, trg_type = %d", width, height, BG.trgType ); */ gcvalue.foreground = PixColors[Color_bg]; #ifdef HAVE_AFTERIMAGE gc = create_visual_gc(asv, TermWin.vt, GCForeground, &gcvalue); #else gc = XCreateGC(Xdisplay, TermWin.vt, GCForeground, &gcvalue); #endif /*fprintf(stderr, "\n aterm RenderPixmap(): freeing target pixmap ..."); */ if( BG.trgPixmap != BG.srcPixmap ) FreeTargetPixmap(); #define SHADING ((BG.bMySource)?NULL:&(BG.Shading)) if( BG.trgType == BGT_Tile ) /* just copying source PixampID into trgPixmapID */ { if( BG.bMySource || NO_NEED_TO_SHADE(BG.Shading)) { BG.trgPixmap = BG.srcPixmap ; fin_width = BG.Width ; fin_height = BG.Height; }else if( (BG.finWidth != width || BG.finHeight!=height ) && (BG.Width != BG.finWidth || BG.Height != BG.finHeight)) { fin_width = min(BG.Width, width); fin_height = min(BG.Height, height); BG.trgPixmap = ShadePixmap(BG.srcPixmap, 0, 0, fin_width, fin_height, gc, SHADING); } } #ifdef HAVE_AFTERIMAGE else if( BG.trgType == BGT_Scale ) { if( BG.Width != width || BG.Height!=height ) { #ifdef DEBUG_BACKGROUND_PMAP fprintf(stderr, "aterm RenderPixmap(): (BGT_Scale) src pixmap is [%lX], scaling from %dx%d to %dx%d \n",BG.srcPixmap, BG.Width, BG.Height, width, height); #endif BG.trgPixmap = ScalePixmap( BG.srcPixmap, BG.Width, BG.Height, width, height, gc, SHADING ); fin_width = width ; fin_height = height ; #ifdef DEBUG_BACKGROUND_PMAP fprintf(stderr, "aterm RenderPixmap(): trg pixmap is [%lX]\n",BG.trgPixmap); #endif } }else if( BG.trgType == BGT_ScaleH ) { if( BG.Width != width ) { BG.trgPixmap = ScalePixmap( BG.srcPixmap, BG.Width, BG.Height, width, BG.Height, gc, SHADING ); fin_height = BG.Height; fin_width = width ; } }else if( BG.trgType == BGT_ScaleV ) { if( BG.Height!=height ) { #ifdef DEBUG_BACKGROUND_PMAP fprintf(stderr, "aterm RenderPixmap(): (BGT_Scale) src pixmap is [%lX], scaling from %dx%d to %dx%d \n",BG.srcPixmap, BG.Width, BG.Height, BG.Width, height); #endif BG.trgPixmap = ScalePixmap( BG.srcPixmap, BG.Width, BG.Height, BG.Width, height, gc, SHADING ); fin_width = BG.Width ; fin_height = height ; } } #endif else if( BG.trgType == BGT_Cut ) { #ifdef DEBUG_BACKGROUND_PMAP fprintf(stderr, "aterm RenderPixmap(): (BG_Cut)src pixmap is [%lX] %dx%d %dx%d\n", BG.srcPixmap, BG.Width, BG.Height, width, height); #endif BG.trgPixmap = CutWinPixmap( TermWin.vt, BG.srcPixmap, BG.Width, BG.Height, width, height, gc, SHADING ); #ifdef DEBUG_BACKGROUND_PMAP fprintf(stderr, "aterm RenderPixmap(): (BG_Cut)trg pixmap is [%lX]\n", BG.trgPixmap); #endif } #ifdef _MYSTYLE_ else if( BG.trgType == BGT_MyStyle ) { BG.trgPixmap = RenderMyStylePixmap( BG.mystyle, BG.srcPixmap, BG.Width, BG.Height, width, height ); if( BG.mystyle->texture_type == TEXTURE_PIXMAP) { BG.srcPixmap = BG.mystyle->back_icon.pix ; /* so not to free it later */ BG.bMySource = False ; } /* fprintf(stderr, "Mystyle generated : %lX\n", BG.trgPixmap ); */ } #endif XFreeGC(Xdisplay, gc); /* don't need anymore */ if( BG.trgPixmap != None ) { BG.finWidth = fin_width ; BG.finHeight = fin_height; XSync(Xdisplay, 0); #ifdef DEBUG_BACKGROUND_PMAP fprintf(stderr, "Setting background to %lX. srcPixmap = %lX\n", BG.trgPixmap, BG.srcPixmap ); #endif XSetWindowBackgroundPixmap(Xdisplay, TermWin.vt, BG.trgPixmap); XSync(Xdisplay, 0); TermWin.LastPixmapUsed = BG.srcPixmap ; TermWin.LastPixmap_root_x = TermWin.root_x ; TermWin.LastPixmap_root_y = TermWin.root_y ; TermWin.LastPixmap_width = TermWin.root_width ; TermWin.LastPixmap_height = TermWin.root_height ; BG.trgPixmapSet = 1 ; if( BG.trgPixmap != BG.srcPixmap ) {/* don't need it anymore server has it */ XFreePixmap( Xdisplay, BG.trgPixmap ); XSync(Xdisplay, 0); } BG.trgPixmap = None ; } /* restore old handler so we can crash again ;) */ XSetErrorHandler (oldXErrorHandler); } /******************************* RenderPixmap **********************/ #ifdef BACKGROUND_IMAGE /* we need this stuff only to load background image from file */ /* PROTO */ int parse_pixmap_geom(const char *geom) { int w = 0, h = 0, x = 0, y = 0; int flags, changed = 0; if (geom == NULL) return 0; if (!strlen(geom)) return 0; if (!strcmp(geom, "?")) { static char str[] = "[10000x10000+10000+10000]"; /* should be big enough */ sprintf(str, "[%dx%d+%d+%d]", BG.srcWidth, BG.srcHeight, BG.srcX, BG.srcY ); xterm_seq(XTerm_title, str); return 0; } /*fprintf( stderr, "\n parse_pixmap_geom(): geometry is [%s]", geom );*/ flags = XParseGeometry(geom, &x, &y, (unsigned int *) &w, (unsigned int *) &h); if(!(flags & XValue)) x = 0 ; if(!(flags & YValue)) y = 0 ; if(!(flags & WidthValue)) w = -1 ; if(!(flags & HeightValue)) h = -1 ; MIN_IT(x, 10000); MIN_IT(y, 10000); MIN_IT(w, 10000); MIN_IT(h, 10000); if( w != BG.srcWidth ) { changed++; BG.srcWidth = w ; } if( h != BG.srcHeight ) { changed++; BG.srcHeight = h ; } if( x != BG.srcX ) { changed++; BG.srcX = x ; } if( y != BG.srcY ) { changed++; BG.srcY = y ; } /*fprintf( stderr, "\n parse_pixmap_geom(): geometry is [%dx%d+%d+%d]", w,h,x,y ); */ return changed; } /* PROTO */ void LoadBGPixmap(const char *file) { #ifdef HAVE_AFTERIMAGE ASImage *im ; if (BG.srcPixmap != None && BG.bMySource ) { XFreePixmap(Xdisplay, BG.srcPixmap); BG.srcPixmap = None; } im = file2ASImage( file, 0xFFFFFFFF, SCREEN_GAMMA, 0, getenv("PATH"), NULL ); /* need to add geometry processing code here */ if( im == NULL ) { XSetWindowBackground(Xdisplay, TermWin.vt, PixColors[Color_bg]); BG.bMySource = 0 ; BG.Width = 0 ; BG.Height = 0; BG.trgPixmapSet = 0 ; }else { BG.bMySource = 1 ; BG.Width = im->width; BG.Height = im->height; BG.srcPixmap = asimage2pixmap( asv, Xroot, im, NULL, True); destroy_asimage( &im ); } RenderPixmap(1); #endif scr_touch(); } #endif /* BACKGROUND_IMAGE */ aterm-1.0.1/src/rxvtgrx.h0000644000175000001440000000301110144447054013775 0ustar vaeusers/*--------------------------------*-C-*---------------------------------* * File: rxvtgrx.h * $Id: rxvtgrx.h,v 1.1.1.1 2004/11/10 17:21:48 sasha Exp $ * * Stuff for text alignment for rxvt special graphics mode * * alignment * Top: * text is placed so that the specified point is at the top of the * capital letters * Center: * text is placed so that the specified point is equidistant from the * bottom of descenders and the top of the capital letters * Bottom: * text is placed so that the bottom of descenders is on the specified * point * Base: * text is placed so that the bottom of the characters with no descenders * is on the specified point * Caps_Center: * text is placed so that the specified point is equidistant from the * bottom and tops of capital letters *----------------------------------------------------------------------*/ #ifndef _RXVTGRX_H #define _RXVTGRX_H #define GRX_SCALE 10000 #define RIGHT_TEXT 0x10 #define HCENTER_TEXT 0x20 #define LEFT_TEXT 0x30 #define HORIZONTAL_ALIGNMENT 0x70 #define TOP_TEXT 0x01 #define VCENTER_TEXT 0x02 #define BOTTOM_TEXT 0x03 #define BASE_TEXT 0x04 #define VCAPS_CENTER_TEXT 0x05 #define VERTICAL_ALIGNMENT 0x0F #if 0 /* this would be nicer */ # define TXT_RIGHT 'r' # define TXT_CENTER 'c' # define TXT_LEFT 'l' # define TXT_TOP 't' # define TXT_VCENTER 'v' # define TXT_BOTTOM 'b' # define TXT_BASE '_' # define TXT_VCAPS_CENTER 'C' #endif #endif /* whole file */ /*----------------------- end-of-file (C header) -----------------------*/ aterm-1.0.1/src/rxvt.h0000644000175000001440000007770610375440651013304 0ustar vaeusers/* * $Id: rxvt.h,v 1.18 2006/02/17 21:35:37 sasha Exp $ */ #ifndef _RXVT_H /* include once only */ #define _RXVT_H #define NEXT_SCROLLBAR #include "version.h" #include "../config.h" #include "feature.h" /* ***************************************************************************** * SYSTEM HACKS ***************************************************************************** */ /* Consistent defines - please report on the necessity * @ Unixware: defines (__svr4__) */ #if defined (SVR4) && !defined (__svr4__) # define __svr4__ #endif #if defined (sun) && !defined (__sun__) # define __sun__ #endif #if defined (__sun__) #include #endif /* * sun isn't properly protected? * anyway, it causes problems when is also included */ #if defined (__sun__) # undef HAVE_SYS_IOCTL_H #endif /* * Solaris defines SRIOCSREDIR in sys/strredir.h . * Needed for displaying console messages under solaris */ #if defined(__sun) && defined(__SVR4) #include #endif #ifdef _SCO_DS /* SCO Osr5 - Hops */ /* Scos pty naming is /dev/[pt]typ0 - /dev/[pt]ty256 */ # define ALL_NUMERIC_PTYS #endif /* ***************************************************************************** * INCLUDES ***************************************************************************** */ #include #include #include #include #ifdef HAVE_STDARG_H # include #endif #ifdef HAVE_STDLIB_H # include #endif #ifdef HAVE_STRING_H # include #endif #ifdef HAVE_FCNTL_H # include #endif #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_UNISTD_H # include #endif #ifdef HAVE_UTIL_H # include #endif #ifdef HAVE_ASSERT_H # include #endif #if defined (HAVE_SYS_IOCTL_H) && !defined (__sun__) /* seems to cause problems when is also included on some suns */ # include #endif #ifdef TIME_WITH_SYS_TIME # include # include #else # ifdef HAVE_SYS_TIME_H # include # else # include # endif #endif #ifdef HAVE_SYS_SELECT_H # include #endif #ifdef HAVE_TERMIOS_H # include #else # include #endif #ifdef UTMP_SUPPORT # ifdef HAVE_UTMPX_H # include # define USE_SYSV_UTMP # else # include # ifdef HAVE_SETUTENT # define USE_SYSV_UTMP # endif # endif # ifdef HAVE_LASTLOG_H # include # endif # include #endif #include #include #include /* Xlib, Xutil, Xresource, Xfuncproto */ #include #include #include #ifdef HAVE_AFTERIMAGE #include extern ASVisual *asv; #define PREFER_24BIT #endif /* this is needed at all times so that .pro could work */ struct MyStyle; #ifdef HAVE_AFTERSTEP #include #include #include #include #include #include #include #else extern Atom _XROOTPMAP_ID; extern Atom _XA_MwmAtom; extern Atom _XA_NET_WM_PID; extern Atom _XA_NET_SUPPORTING_WM_CHECK ; extern Atom _XA_NET_SUPPORTED ; extern Atom _XA_NET_CURRENT_DESKTOP ; extern Atom _XA_NET_WM_DESKTOP; extern Atom _XA_NET_WM_STATE; extern Atom _XA_NET_WM_STATE_STICKY; extern Atom _XA_NET_WM_STATE_SHADED; extern Atom _XA_NET_WM_STATE_HIDDEN; #ifndef get_flags #define get_flags(var, val) (((var) & (val))) /* making it sign safe */ #define set_flags(var, val) ((var) |= (val)) #define clear_flags(var, val) ((var) &= ~(val)) #endif #endif #ifdef DEBUG_X #define XGetGeometry(dpy,win,r,x,y,w,h,b,d) \ trace_XGetGeometry(__FILE__,__LINE__,dpy,win,r,x,y,w,h,b,d) #endif #ifdef RXVT_GRAPHICS # include "rxvtgrx.h" #endif #ifdef GREEK_SUPPORT # include "grkelot.h" #endif #if defined(KANJI) || defined(ZH) # define MULTICHAR_SET /* a glyph is defined by 1 or 2 chars */ #else # undef MULTICHAR_SET /* a glyph is only ever defined by 1 char */ #endif /* * Play some size tricks: might be better * Now if only we could presume every OS has int16_t, u_int16_t, etc. */ typedef RINT16T R_int16_t; typedef RUINT16T R_u_int16_t; typedef RINT32T R_int32_t; typedef RUINT32T R_u_int32_t; typedef RINTPT R_int_p_t; typedef RUINTPT R_u_int_p_t; /* ***************************************************************************** * STRUCTURES AND TYPEDEFS ***************************************************************************** */ /* Sanitize menubar info */ #ifndef MENUBAR # undef MENUBAR_MAX #endif #ifndef MENUBAR_MAX # define MENUBAR_MAX 0 #endif /* If we're using either the fancy scrollbar or menu bars, keep the * scrollColor resource. */ #if !defined(XTERM_SCROLLBAR) || defined(MENUBAR) # define KEEP_SCROLLCOLOR 1 #else # undef KEEP_SCROLLCOLOR #endif #if defined(BACKGROUND_IMAGE) || defined(TRANSPARENT) || defined(_MYSTYLE_) #ifndef HAVE_AFTERIMAGE typedef struct ShadingInfo{ XColor tintColor ; int shading ; }ShadingInfo ; #define NO_NEED_TO_SHADE(o) (o.shading==100 && o.tintColor.red==0xFFFF && o.tintColor.green==0xFFFF && o.tintColor.blue == 0xFFFF) #endif #define INIT_SHADING(o) {o.shading=100; o.tintColor.red=0xFFFF; o.tintColor.green=0xFFFF; o.tintColor.blue = 0xFFFF;} struct MyStyle; typedef struct _BackroundInfo { Pixmap srcPixmap; /* after it was clipped out according to stuff below*/ /* x,y,width and height of the subimage to be clipped out of the specifyed image and used as background */ struct MyStyle *mystyle ; unsigned int user_flags ; int srcWidth, srcHeight, srcX, srcY ; int Width, Height ; /* width and height of the loaded pixmap */ int bMySource;/* indicates if src pixmap was loaded by us and needs to be freed */ #define BGT_TILE "tile" #define BGT_CENTER "center" #define BGT_SCALE "scale" #define BGT_SCALEH "scaleh" #define BGT_SCALEV "scalev" #define BGT_NO_TILE "notile" #define BGT_NO_TILE_H "notileh" #define BGT_NO_TILE_V "notilev" #define BGT_CUT "cut" #define BGT_ALL "tile|center|scale|scaleh|scalev|notile|notileh|notilev|cut" enum { BGT_Tile = 1, BGT_Center, BGT_Scale, BGT_ScaleH, BGT_ScaleV, BGT_NoTile, BGT_NoTileH, BGT_NoTileV, BGT_Cut, #ifdef _MYSTYLE_ BGT_MyStyle, #endif BGT_None } trgType; Pixmap trgPixmap; int trgPixmapSet; #ifdef SCALING_GEOM_ENABLED /* requested x,y,width and height of the target pixmap */ int trgWidth, trgHeight, trgX, trgY ; #endif /* final width and height of constructed pixmap */ int finWidth, finHeight ; int cutX, cutY ; ShadingInfo Shading ; }BackgroundInfo ; #endif #ifndef NO_DEBUG_OUTPUT #define DEBUG_BACKGROUND_PMAP #endif typedef struct { R_u_int16_t width, /* window width [pixels] */ height, /* window height [pixels] */ fwidth, /* font width [pixels] */ fheight, /* font height [pixels] */ fprop, /* font is proportional */ ncol, nrow, /* window size [characters] */ bcol, /* current number of columns in the buffer */ min_bcol, /* minimum horizontal columns in the buffer */ #ifdef USE_LINESPACE lineSpace, /* linespace */ #endif focus, /* window has focus */ saveLines, /* number of lines that fit in scrollback */ borderWidth,/* number of pixels in window border */ nscrolled, /* number of line actually scrolled */ view_start; /* scrollback view starts here */ Window parent, vt; /* parent (main) and vt100 window */ GC gc; /* GC for drawing text */ XFontStruct *font; /* main font structure */ #ifndef NO_BOLDFONT XFontStruct *boldFont; /* bold font */ #endif #ifdef MULTICHAR_SET XFontStruct *mfont; /* Multichar font structure */ #endif #ifdef USE_XIM XFontSet fontset; #endif #if defined(BACKGROUND_IMAGE) || defined(TRANSPARENT) || defined(_MYSTYLE_) BackgroundInfo background; #endif /* geometry of the parent window at the time of the last ConfigureNotify */ int root_x, root_y, root_width, root_height ; #define GC_TYPE_AND "and" #define GC_TYPE_AND_REV "andReverse" #define GC_TYPE_AND_INV "andInverted" #define GC_TYPE_XOR "xor" #define GC_TYPE_OR "or" #define GC_TYPE_NOR "nor" #define GC_TYPE_INVERT "invert" #define GC_TYPE_EQUIV "equiv" #define GC_TYPE_INVERT "invert" #define GC_TYPE_OR_REV "orReverse" #define GC_TYPE_OR_INV "orInverted" #define GC_TYPE_NAND "nand" #define GC_TYPE_ALL "and|andReverse|andInverted|xor|or|nor|invert|equiv|invert|orReverse|orInverted|nand" #define TINT_TYPE_TRUE "true" #define TINT_TYPE_ALL "true|and|andReverse|andInverted|xor|or|nor|invert|equiv|invert|orReverse|orInverted|nand" #if defined(BACKGROUND_IMAGE) || defined(TRANSPARENT) || defined(_MYSTYLE_) GC tintGC; Pixmap LastPixmapUsed ; int LastPixmap_width, LastPixmap_height, LastPixmap_root_x, LastPixmap_root_y ; #endif int bMapped; } TermWin_t; typedef struct { short beg, end; /* beg/end of slider sub-window */ short top, bot; /* top/bot of slider */ short state; /* scrollbar state */ Window win; } scrollBar_t; typedef struct { short state; Window win; } menuBar_t; typedef struct { short type; /* must not be changed; first element */ short len; /* strlen (str) */ unsigned char *str; /* action to take */ } action_t; typedef struct { short type; /* must not be changed; first element */ struct menu_t *menu; /* sub-menu */ } submenu_t; typedef struct menuitem_t { struct menuitem_t *prev; /* prev menu-item */ struct menuitem_t *next; /* next menu-item */ char *name; /* character string displayed */ char *name2; /* character string displayed (right) */ short len; /* strlen (name) */ short len2; /* strlen (name) */ union { short type; /* must not be changed; first element */ action_t action; submenu_t submenu; } entry; } menuitem_t; enum menuitem_t_action { MenuLabel, MenuAction, MenuTerminalAction, MenuSubMenu }; typedef struct menu_t { struct menu_t *parent; /* parent menu */ struct menu_t *prev; /* prev menu */ struct menu_t *next; /* next menu */ menuitem_t *head; /* double-linked list */ menuitem_t *tail; /* double-linked list */ menuitem_t *item; /* current item */ char *name; /* menu name */ short len; /* strlen (name) */ short width; /* maximum menu width [chars] */ Window win; /* window of the menu */ short x; /* x location [pixels] (chars if parent == NULL) */ short y; /* y location [pixels] */ short w, h; /* window width, height [pixels] */ } menu_t; typedef struct bar_t { menu_t *head, *tail; /* double-linked list of menus */ char *title; /* title to put in the empty menuBar */ #if (MENUBAR_MAX > 1) # define MAXNAME 16 char name[MAXNAME]; /* name to use to refer to menubar */ struct bar_t *next, *prev; /* circular linked-list */ #endif /* (MENUBAR_MAX > 1) */ #define NARROWS 4 action_t arrows[NARROWS]; } bar_t; typedef struct grcmd_t { char cmd; short color; short ncoords; int *coords; unsigned char *text; struct grcmd_t *next; } grcmd_t; typedef struct grwin_t { Window win; int x, y; unsigned int w, h; short screen; grcmd_t *graphics; struct grwin_t *prev, *next; } grwin_t; typedef struct { R_int16_t row, col; } row_col_t; /* ways to deal with getting/setting termios structure */ #ifdef HAVE_TERMIOS_H typedef struct termios ttymode_t; # ifdef TCSANOW /* POSIX */ # define GET_TERMIOS(fd,tios) tcgetattr (fd, tios) # define SET_TERMIOS(fd,tios) \ cfsetospeed (tios, BAUDRATE), \ cfsetispeed (tios, BAUDRATE), \ tcsetattr (fd, TCSANOW, tios) # else # ifdef TIOCSETA # define GET_TERMIOS(fd,tios) ioctl (fd, TIOCGETA, tios) # define SET_TERMIOS(fd,tios) \ tios->c_cflag |= BAUDRATE, \ ioctl (fd, TIOCSETA, tios) # else # define GET_TERMIOS(fd,tios) ioctl (fd, TCGETS, tios) # define SET_TERMIOS(fd,tios) \ tios->c_cflag |= BAUDRATE, \ ioctl (fd, TCSETS, tios) # endif # endif # define SET_TTYMODE(fd,tios) SET_TERMIOS (fd, tios) #else /* sgtty interface */ typedef struct { struct sgttyb sg; struct tchars tc; struct ltchars lc; int line; int local; } ttymode_t; # define SET_TTYMODE(fd,tt) \ tt->sg.sg_ispeed = tt->sg.sg_ospeed = BAUDRATE, \ ioctl (fd, TIOCSETP, &(tt->sg)), \ ioctl (fd, TIOCSETC, &(tt->tc)), \ ioctl (fd, TIOCSLTC, &(tt->lc)), \ ioctl (fd, TIOCSETD, &(tt->line)), \ ioctl (fd, TIOCLSET, &(tt->local)) #endif /* HAVE_TERMIOS_H */ #ifndef min # define min(a,b) (((a) < (b)) ? (a) : (b)) # define max(a,b) (((a) > (b)) ? (a) : (b)) #endif #define MAX_IT(current, other) if ((other) > (current)) (current) = (other) #define MIN_IT(current, other) if ((other) < (current)) (current) = (other) #define SWAP_IT(one, two, tmp) \ do { \ (tmp) = (one); (one) = (two); (two) = (tmp); \ } while (0) #ifndef CLIENTPROPS_H_HEADER_INCLUDED /* Motif window hints */ #define MWM_HINTS_FUNCTIONS (1L << 0) #define MWM_HINTS_DECORATIONS (1L << 1) #define MWM_HINTS_INPUT_MODE (1L << 2) #define MWM_HINTS_STATUS (1L << 3) /* bit definitions for MwmHints.functions */ #define MWM_FUNC_ALL (1L << 0) #define MWM_FUNC_RESIZE (1L << 1) #define MWM_FUNC_MOVE (1L << 2) #define MWM_FUNC_MINIMIZE (1L << 3) #define MWM_FUNC_MAXIMIZE (1L << 4) #define MWM_FUNC_CLOSE (1L << 5) /* bit definitions for MwmHints.decorations */ #define MWM_DECOR_ALL (1L << 0) #define MWM_DECOR_BORDER (1L << 1) #define MWM_DECOR_RESIZEH (1L << 2) #define MWM_DECOR_TITLE (1L << 3) #define MWM_DECOR_MENU (1L << 4) #define MWM_DECOR_MINIMIZE (1L << 5) #define MWM_DECOR_MAXIMIZE (1L << 6) /* bit definitions for MwmHints.inputMode */ #define MWM_INPUT_MODELESS 0 #define MWM_INPUT_PRIMARY_APPLICATION_MODAL 1 #define MWM_INPUT_SYSTEM_MODAL 2 #define MWM_INPUT_FULL_APPLICATION_MODAL 3 #define PROP_MWM_HINTS_ELEMENTS 5 typedef struct MwmHints { CARD32 flags; CARD32 functions; CARD32 decorations; INT32 input_mode; CARD32 status; } MwmHints; #endif /* ***************************************************************************** * NORMAL DEFINES ***************************************************************************** */ #ifdef OLD_SELECTION # define OLD_WORD_SELECTION #endif #define DEFAULT_SHELL "/bin/bash" /* sort out conflicts in feature.h */ #ifdef KANJI # undef ZH /* remove Chinese big5 support */ # undef GREEK_SUPPORT /* Kanji/Greek together is too weird */ # undef DEFINE_XTERM_COLOR /* since kterm-color doesn't exist? */ #endif #ifdef ZH # undef KANJI /* can't put Chinese/Kanji together */ # undef GREEK_SUPPORT # undef DEFINE_XTERM_COLOR #endif #define APL_CLASS "XTerm" /* class name */ #define APL_SUBCLASS "Aterm" /* also check resources under this name */ #define APL_NAME "aterm" /* normal name */ /* COLORTERM, TERM environment variables */ #define COLORTERMENV "rxvt" #ifdef BACKGROUND_IMAGE # define COLORTERMENVFULL COLORTERMENV "-xpm" #else # define COLORTERMENVFULL COLORTERMENV #endif #ifndef TERMENV # ifdef KANJI # define TERMENV "kterm" # else # define TERMENV "rxvt" # endif #endif #if defined (NO_MOUSE_REPORT) && !defined (NO_MOUSE_REPORT_SCROLLBAR) # define NO_MOUSE_REPORT_SCROLLBAR #endif #ifdef NO_RESOURCES # undef USE_XGETDEFAULT #endif /* now look for other badly set stuff */ #ifdef UTMP_SUPPORT # ifndef UTMP_FILENAME # ifdef UTMP_FILE # define UTMP_FILENAME UTMP_FILE # else # ifdef _PATH_UTMP # define UTMP_FILENAME _PATH_UTMP # else # ifdef RXVT_UTMP_FILE # define UTMP_FILENAME RXVT_UTMP_FILE # else # error define UTMP_FILENAME in config.h # endif # endif # endif # endif # ifdef USE_SYSV_UTMP # ifndef USER_PROCESS # define USER_PROCESS 7 # endif # ifndef DEAD_PROCESS # define DEAD_PROCESS 8 # endif # endif # ifdef HAVE_UTMPX_H # define UTMP struct utmpx # define setutent setutxent # define getutent getutxent # define getutid getutxid # define endutent endutxent # define pututline pututxline # else # define UTMP struct utmp # endif #endif #ifdef WTMP_SUPPORT # ifdef HAVE_UTMPX_H /* means we're on Solaris (or Irix?) */ # undef WTMP_FILENAME # if defined(WTMPX_FILE) || defined(_WTMPX_FILE) # if defined(WTMPX_FILE) # define WTMP_FILENAME WTMPX_FILE # else # define WTMP_FILENAME _WTMPX_FILE # endif # define update_wtmp updwtmpx # else # define WTMP_FILENAME RXVT_WTMP_FILE # define update_wtmp rxvt_update_wtmp # endif # else # define update_wtmp rxvt_update_wtmp # ifndef WTMP_FILENAME # ifdef WTMP_FILE # define WTMP_FILENAME WTMP_FILE # else # ifdef _PATH_WTMP # define WTMP_FILENAME _PATH_WTMP # else # ifdef RXVT_WTMP_FILE # define WTMP_FILENAME RXVT_WTMP_FILE # else # error define WTMP_FILENAME in config.h # endif # endif # endif # endif # endif #endif #if !defined (EACCESS) && defined(EAGAIN) # define EACCESS EAGAIN #endif #ifndef EXIT_SUCCESS /* missing from */ # define EXIT_SUCCESS 0 /* exit function success */ # define EXIT_FAILURE 1 /* exit function failure */ #endif #define menuBar_esc 10 #define scrollBar_esc 30 #define menuBar_margin 2 /* margin below text */ /* width of scrollBar, menuBar shadow, must be 1 or 2 */ #ifdef HALFSHADOW # define SHADOW 1 #else # define SHADOW 2 #endif #define NO_REFRESH 0 /* Window not visible at all! */ #define FAST_REFRESH (1<<1) /* Fully exposed window */ #define SLOW_REFRESH (1<<2) /* Partially exposed window */ #define SMOOTH_REFRESH (1<<3) /* Do sync'ing to make it smooth */ #ifdef NO_SECONDARY_SCREEN # define NSCREENS 0 #else # define NSCREENS 1 #endif #define IGNORE 0 #define SAVE 's' #define RESTORE 'r' /* special (internal) prefix for font commands */ #define FONT_CMD '#' #define FONT_DN "#-" #define FONT_UP "#+" /* flags for scr_gotorc() */ #define C_RELATIVE 1 /* col movement is relative */ #define R_RELATIVE 2 /* row movement is relative */ #define RELATIVE (R_RELATIVE|C_RELATIVE) /* modes for scr_insdel_chars(), scr_insdel_lines() */ #define INSERT -1 /* don't change these values */ #define DELETE +1 #define ERASE +2 /* modes for scr_page() - scroll page. used by scrollbar window */ enum { UP, DN, NO_DIR }; /* arguments for scr_change_screen() */ enum { PRIMARY, SECONDARY }; /* all basic bit-flags in first/lower 16 bits */ #define RS_None 0 /* Normal */ #define RS_fgMask 0x0000001Fu /* 32 colors */ #define RS_bgMask 0x000003E0u /* 32 colors */ #define RS_Bold 0x00000400u /* bold */ #define RS_Blink 0x00000800u /* blink */ #define RS_RVid 0x00001000u /* reverse video */ #define RS_Uline 0x00002000u /* underline */ #define RS_acsFont 0x00004000u /* ACS graphics char set */ #define RS_ukFont 0x00008000u /* UK character set */ #define RS_fontMask (RS_acsFont|RS_ukFont) #define RS_baseattrMask (RS_Bold|RS_Blink|RS_RVid|RS_Uline) /* all other bit-flags in upper 16 bits */ #ifdef MULTICHAR_SET # define RS_multi0 0x10000000u /* only multibyte characters */ # define RS_multi1 0x20000000u /* multibyte 1st byte */ # define RS_multi2 (RS_multi0|RS_multi1) /* multibyte 2nd byte */ # define RS_multiMask (RS_multi0|RS_multi1) /* multibyte mask */ #else # define RS_multiMask 0 #endif #define RS_attrMask (RS_baseattrMask|RS_fontMask|RS_multiMask) #define Opt_console (1LU<<0) #define Opt_loginShell (1LU<<1) #define Opt_iconic (1LU<<2) #define Opt_visualBell (1LU<<3) #define Opt_mapAlert (1LU<<4) #define Opt_reverseVideo (1LU<<5) #define Opt_utmpInhibit (1LU<<6) #define Opt_scrollBar (1LU<<7) #define Opt_scrollBar_right (1LU<<8) #define Opt_scrollBar_floating (1LU<<9) #define Opt_meta8 (1LU<<10) #define Opt_scrollTtyOutput (1LU<<11) #define Opt_scrollKeypress (1LU<<12) #define Opt_transparent (1LU<<13) #define Opt_transparent_sb (1LU<<14) #define Opt_borderLess (1LU<<16) /* place holder used for parsing command-line options */ #define Opt_Reverse (1LU<<30) #define Opt_Boolean (1LU<<31) /* * XTerm escape sequences: ESC ] Ps;Pt BEL */ #define XTerm_name 0 #define XTerm_iconName 1 #define XTerm_title 2 #define XTerm_Color 4 /* change colors */ #define XTerm_Color_cursor 12 /* change actual 'Cursor' color */ #define XTerm_Color_pointer 13 /* change actual 'Pointer' color */ #define XTerm_Color_BD 18 /* change actual 'Bold' color */ #define XTerm_Color_UL 19 /* change actual 'Underline' color */ #define XTerm_logfile 46 /* not implemented */ #define XTerm_font 50 /* * rxvt extensions of XTerm escape sequences: ESC ] Ps;Pt BEL */ #define XTerm_Menu 10 /* set menu item */ #define XTerm_Pixmap 20 /* new bg pixmap */ #define XTerm_restoreFG 39 /* change default fg color */ #define XTerm_restoreBG 49 /* change default bg color */ #define restoreFG 39 /* restore default fg color */ #define restoreBG 49 /* restore default bg color */ /* Words starting with `Color_' are colours. Others are counts */ enum colour_list { Color_fg, Color_bg, minCOLOR, /* 2 */ Color_Black = minCOLOR, Color_Red3, Color_Green3, Color_Yellow3, Color_Blue3, Color_Magenta3, Color_Cyan3, maxCOLOR, /* minCOLOR + 7 */ #ifndef NO_BRIGHTCOLOR Color_AntiqueWhite = maxCOLOR, minBrightCOLOR, /* maxCOLOR + 1 */ Color_Grey25 = minBrightCOLOR, Color_Red, Color_Green, Color_Yellow, Color_Blue, Color_Magenta, Color_Cyan, maxBrightCOLOR, /* minBrightCOLOR + 7 */ Color_White = maxBrightCOLOR, #else Color_White = maxCOLOR, #endif #ifndef NO_CURSORCOLOR Color_cursor, Color_cursor2, #endif Color_pointer, Color_border, #if defined(TRANSPARENT) || defined(BACKGROUND_IMAGE) Color_tint, #endif #ifndef NO_BOLDUNDERLINE Color_BD, Color_UL, #endif #ifdef KEEP_SCROLLCOLOR Color_scroll, Color_trough, #endif NRS_COLORS, /* */ #ifdef KEEP_SCROLLCOLOR Color_topShadow = NRS_COLORS, Color_bottomShadow, TOTAL_COLORS /* upto 28 */ #else TOTAL_COLORS = NRS_COLORS /* */ #endif }; #define DEFAULT_RSTYLE (RS_None | (Color_fg) | (Color_bg<<5)) /* * number of graphics points * divisible by 2 (num lines) * divisible by 4 (num rect) */ #define NGRX_PTS 1000 /* ***************************************************************************** * MACRO DEFINES ***************************************************************************** */ #define STRCPY(a, b) strcpy ((char *)(a), (char *) (b)) #define STRNCPY(a, b, c) strncpy ((char *)(a), (char *) (b), (c)) #ifdef NO_RMEMSET # define MEMSET(a, b, c) memset ((a), (b), (c)) #else # define MEMSET(a, b, c) rmemset ((a), (b), (R_int_p_t) (c)) #endif #define MALLOC(sz) malloc (sz) #define CALLOC(type, n) calloc ((n), sizeof(type)) #define REALLOC(mem, sz) ((mem) ? realloc ((mem), (sz)) : malloc(sz)) #define FREE(ptr) free (ptr) /* convert pixel dimensions to row/column values */ #define Pixel2Col(x) Pixel2Width((x) - TermWin_internalBorder) #define Pixel2Row(y) Pixel2Height((y) - TermWin_internalBorder) #define Pixel2Width(x) ((x) / TermWin.fwidth) #define Pixel2Height(y) ((y) / TermWin.fheight) #define Col2Pixel(col) (Width2Pixel(col) + TermWin_internalBorder) #define Row2Pixel(row) (Height2Pixel(row) + TermWin_internalBorder) #define Width2Pixel(n) ((n) * TermWin.fwidth) #define Height2Pixel(n) ((n) * TermWin.fheight) #ifdef THAI #define CharWidth(wf, ch) ((wf)->per_char[(unsigned char)(ch) - (wf)->min_char_or_byte2].width) #endif #define TermWin_TotalWidth() (TermWin.width + 2 * TermWin_internalBorder) #define TermWin_TotalHeight() (TermWin.height + 2 * TermWin_internalBorder) #define Xscreen DefaultScreen(Xdisplay) #define Xroot DefaultRootWindow(Xdisplay) /* how to build & extract colors and attributes */ #define GET_FGCOLOR(r) (((r) & RS_fgMask)) #define GET_BGCOLOR(r) (((r) & RS_bgMask)>>5) #define GET_ATTR(r) (((r) & RS_attrMask)) #define GET_BGATTR(r) (((r) & (RS_attrMask | RS_bgMask))) #define SET_FGCOLOR(r,fg) (((r) & ~RS_fgMask) | (fg)) #define SET_BGCOLOR(r,bg) (((r) & ~RS_bgMask) | ((bg)<<5)) #define SET_ATTR(r,a) (((r) & ~RS_attrMask)| (a)) #define scrollbar_visible() (scrollBar.state) #define scrollbar_isMotion() (scrollBar.state == 'm') #define scrollbar_isUp() (scrollBar.state == 'U') #define scrollbar_isDn() (scrollBar.state == 'D') #define scrollbar_isUpDn() isupper (scrollBar.state) #define isScrollbarWindow(w) (scrollbar_visible() && (w) == scrollBar.win) #define scrollbar_setNone() scrollBar.state = 1 #define scrollbar_setMotion() scrollBar.state = 'm' #define scrollbar_setUp() scrollBar.state = 'U' #define scrollbar_setDn() scrollBar.state = 'D' #ifdef NEXT_SCROLLBAR # define scrollbar_dnval() (scrollBar.end + (SB_WIDTH + 1)) # define scrollbar_upButton(y) ((y) > scrollBar.end \ && (y) <= scrollbar_dnval()) # define scrollbar_dnButton(y) ((y) > scrollbar_dnval()) #else # define scrollbar_upButton(y) ((y) < scrollBar.beg) # define scrollbar_dnButton(y) ((y) > scrollBar.end) #endif #define scrollbar_above_slider(y) ((y) < scrollBar.top) #define scrollbar_below_slider(y) ((y) > scrollBar.bot) #define scrollbar_position(y) ((y) - scrollBar.beg) #define scrollbar_size() (scrollBar.end - scrollBar.beg) #if (MENUBAR_MAX > 1) /* rendition style flags */ # define menubar_visible() (menuBar.state) # define menuBar_height() (TermWin.fheight + SHADOW) # define menuBar_TotalHeight() (menuBar_height() + SHADOW + menuBar_margin) # define isMenuBarWindow(w) ((w) == menuBar.win) #else # define isMenuBarWindow(w) (0) # define menuBar_height() (0) # define menuBar_TotalHeight() (0) # define menubar_visible() (0) #endif #if defined(BACKGROUND_IMAGE) || defined(_MYSTYLE_) # define XPMClearArea(a, b, c, d, e, f, g) XClearArea((a), (b), (c), (d), (e), (f), (g)) #else # define XPMClearArea(a, b, c, d, e, f, g) #endif #define Gr_ButtonPress(x,y) Gr_ButtonReport ('P',(x),(y)) #define Gr_ButtonRelease(x,y) Gr_ButtonReport ('R',(x),(y)) /* ***************************************************************************** * VARIABLES ***************************************************************************** */ #ifdef INTERN # define EXTERN #else # define EXTERN extern #endif EXTERN Colormap Xcmap; EXTERN int Xdepth; EXTERN Visual *Xvisual; EXTERN TermWin_t TermWin; #define PARENTS_NUM 3 #define PARENTS_INIT {0,0,0} extern Window ParentWin[PARENTS_NUM]; extern int ParentWinNum; /* gap between text and window edges (could be configurable) */ EXTERN int TermWin_internalBorder; /* must be two times of value above */ EXTERN int TermWin_internalBorders; EXTERN scrollBar_t scrollBar; EXTERN menuBar_t menuBar; EXTERN Display *Xdisplay; EXTERN int XdisplayWidth, XdisplayHeight; typedef struct ExtWMSupportData { #define WM_SupportsDesktops (0x01<<0) #define WM_AtermStateSticky (0x01<<1) #define WM_AtermStateShaded (0x01<<2) #define WM_AtermStateHidden (0x01<<3) #define WM_ClaimSupportsDesktops (0x01<<4) unsigned long flags ; Window supporting_wm_check ; CARD32 current_desktop; CARD32 aterm_desktop; }ExtWMSupportData; EXTERN ExtWMSupportData ExtWM; EXTERN Bool wm_supports_desktops ; EXTERN int wm_current_desktop, wm_aterm_desktop ; EXTERN unsigned long Options; EXTERN int sb_shadow; EXTERN int delay_menu_drawing; EXTERN const char *display_name; EXTERN const char *rs_name; /* client instance (resource name) */ EXTERN const char *rs_term_name; EXTERN const char *rs_color[NRS_COLORS]; EXTERN Pixel PixColorsFocused[TOTAL_COLORS]; #ifdef OFF_FOCUS_FADING EXTERN Pixel PixColorsUnFocused[TOTAL_COLORS]; #endif #ifdef _MYSTYLE_ EXTERN const char *rs_mystyle; #endif EXTERN Pixel *PixColors; EXTERN const char *rs_title; /* title name for window */ EXTERN const char *rs_iconName; /* icon name for window */ EXTERN const char *rs_geometry; /* window geometry */ EXTERN const char *rs_minBufferWidth; /* minimum buffer width - so we can scroll horizontally */ EXTERN const char *rs_saveLines; /* scrollback buffer [lines] */ #ifdef USE_LINESPACE EXTERN const char *rs_lineSpace; /* line space [pixels] */ #endif EXTERN const char *rs_borderWidth; /* border width [pixels] */ EXTERN const char *rs_internal_border; /* internal border width [pixels] */ EXTERN const char *rs_cutchars; /* chars for selection boundaries */ #ifdef META8_OPTION EXTERN const char *rs_modifier; #endif #ifndef NO_BACKSPACE_KEY EXTERN const char *rs_backspace_key; #endif #ifndef NO_DELETE_KEY EXTERN const char *rs_delete_key; #endif EXTERN const char *rs_font[NFONTS]; #ifdef MULTICHAR_SET EXTERN const char *rs_mfont[NFONTS]; #endif #ifndef NO_BOLDFONT EXTERN const char *rs_boldFont; #endif #ifdef PRINTPIPE EXTERN const char *rs_print_pipe; #endif #ifdef USE_XIM EXTERN const char *rs_preeditType; EXTERN const char *rs_inputMethod; #endif #ifndef NO_BRIGHTCOLOR EXTERN unsigned int colorfgbg; #endif #ifdef KEYSYM_RESOURCE EXTERN const unsigned char *KeySym_map[256]; #endif #if defined (HOTKEY_CTRL) || defined (HOTKEY_META) EXTERN KeySym ks_bigfont; EXTERN KeySym ks_smallfont; #endif EXTERN const char *rs_menu; EXTERN const char *rs_path; #ifdef BACKGROUND_IMAGE EXTERN const char *rs_backgroundPixmap; #endif #if defined(BACKGROUND_IMAGE) || defined(TRANSPARENT) EXTERN const char *rs_backgroundType; EXTERN const char *rs_tintType; EXTERN const char *rs_shade; #endif #ifdef OFF_FOCUS_FADING EXTERN const char *rs_fade; #endif EXTERN const char *rs_textType; EXTERN Atom aterm_XA_TARGETS; EXTERN Atom aterm_XA_TEXT; EXTERN Atom _XA_COMPAUND_TEXT; EXTERN Atom aterm_XA_UTF8_STRING; EXTERN Atom aterm_XA_CLIPBOARD; EXTERN Atom aterm_XA_VT_SELECTION; EXTERN Atom aterm_XA_INCR; /* ***************************************************************************** * PROTOTYPES ***************************************************************************** */ #include "screen.h" #ifdef PROTOTYPES # define __PROTO(p) p #else # define __PROTO(p) () #endif #include "protos.h" #ifdef DEBUG_MALLOC # include "dmalloc.h" /* This comes last */ #endif #endif /* _RXVT_H */ aterm-1.0.1/src/thai.c0000644000175000001440000001644310144447057013211 0ustar vaeusers/*--------------------------------*-C-*---------------------------------* * File: thai.c *----------------------------------------------------------------------* * * All portions of code are copyright by their respective author/s. * Copyright (C) 2000,2001 Teepanis Chachiyo * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------*/ #include "rxvt.h" #include "thai.h" #ifdef THAI #if defined (NO_BRIGHTCOLOR) || defined (VERYBOLD) # define MONO_BOLD(x) ((x) & (RS_Bold|RS_Blink)) #else # define MONO_BOLD(x) (((x) & RS_Bold) && fore == Color_fg) #endif /* * ThaiIsMiddleLineCh returns TRUE if character 'ch' * is to be displayed in the middle line. */ /* PROTO */ int ThaiIsMiddleLineCh(char ch) { if(thai_map[(unsigned char)ch]==0) return 1; else return 0; } /* * ThaiPixel2Col converts x-y coordiates in pixel * into byte offset that store character data. * This function replaces Pixel2Col in orinal * ATERM. */ /* PROTO */ int ThaiPixel2Col(int x, int y) { int row; /* row storing data */ int i; /* byte offset index */ int xpixel; /* dummy x pixel */ char *str; /* drawn_text pointer */ XFontStruct *wf; /* font */ /* locate buffer storing data */ row = Pixel2Row(y); MAX_IT(row, 0); MIN_IT(row, TermWin.nrow - 1); str = drawn_text[row]; /* access to font structure */ wf = TermWin.font; /* increase byte offset until we get to target x */ i = 0; xpixel = CharWidth(wf,str[0]); x -= TermWin_internalBorder; while(xpixel <= x && i < TermWin.ncol){ i++; xpixel += CharWidth(wf,str[i]); /* wf->per_char[char_num].width; */ } MAX_IT(i, 0); MIN_IT(i, TermWin.ncol); return i; } /* * ThaiCol2Pixel returns x cooridate of Thai strings. * It also adjusts the to the upper/lowwer Thai character. * This replaces Col2Pixel and is called repeatedly so * I use 'static' variable to speed it up. */ /* PROTO */ int ThaiCol2Pixel(int col, char *start) /* * TODO: Still have some problem with scaled font */ { static int i=0; /* index */ static char *laststart=NULL; /* strings from last call */ static unsigned int x=0; /* x coordinate for proportional font */ static XFontStruct *wf; /* font */ /* new string, so restart from the beginning */ if(laststart!=start || col < i){ i=0; x=TermWin_internalBorder; laststart=start; wf = TermWin.font; } /* old string, continue counting */ for(; i < col; i++){ x+= CharWidth(wf,start[i]); } return x; } /* PROTO */ int ThaiUpdateMap2(text_t *stp, text_t *dtp, rend_t *srp, rend_t *drp, char *map, int len) { int stpx, dtpx; /* xpixel position of screen & drawntext */ int stpi, dtpi; int char_num; XFontStruct *wf; wf = TermWin.font; stpx = dtpx = 0; stpi = dtpi = 0; for(stpi = 0; stpi < len;stpi++, char_num = (unsigned char)stp[stpi]-wf->min_char_or_byte2, stpx += wf->per_char[char_num].width){ while(dtpx < stpx && dtpi < len-1){ dtpi++; char_num = (unsigned char)dtp[dtpi]-wf->min_char_or_byte2; dtpx+= wf->per_char[char_num].width; } map[stpi] = (stp[stpi]==dtp[dtpi] && srp[stpi]==drp[dtpi]) ? 0 : 1; } return 0; } /* * ThaiUpdateMap decides which character should be redraw on * screen. It returns the number of characters to update. * The algorithm is follow: * (1) At current Thai column, check if all characters at * this column is the same * (2) If yes, no need to update * (3) If no, update entire Thai column * (4) go to next Thai column, --> (1) */ /* PROTO */ int ThaiUpdateMap(text_t *stp, text_t *dtp, rend_t *srp, rend_t *drp, char *map, int len) { int stp_col=0, dtp_col=0; /* index */ int stp_lev=0, dtp_lev=0; /* # of characters at the column */ int i=0,match=0; /* matching flag */ int lastbold=0; /* BOLD_OVERSTRIKE feature */ int nupdate; /* # chars to update */ nupdate = len; /* update by default */ for(i=0;i=0 && thai_map[(unsigned char)stp[i]]!=0;i--) map[i]=1; return 0; } /* * Thai_ColMaxPaint finds the truncated spaces needed to * paint strings str on screen. */ /* PROTO */ int Thai_ColMaxPaint(text_t *str, int len) { int i, col=0; /* truncate end space */ for(i = len-1; i>=0 && str[i]==' '; i--); for(; i>=0; i--) if(ThaiIsMiddleLineCh(str[i])) col++; return col; } #endif /* #ifdef THAI */ aterm-1.0.1/src/thai.h0000644000175000001440000000205610144447057013211 0ustar vaeusers#ifndef THAI_H #define THAI_H /* Determind if the alphabet should be displayed in the next column Thai consonants ----> 0 Some of Thai vowels and tone signs 209, 212-219, and 231-238 --> either -1 / +1 depending on the levels */ char thai_map[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1,-1,-1,-1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; #endif /* THAI_H */ aterm-1.0.1/src/utmp.c0000644000175000001440000002002410144447060013231 0ustar vaeusers/*--------------------------------*-C-*---------------------------------* * File: utmp.c *----------------------------------------------------------------------* * Copyright 1997,1998 Geoff Wing * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *----------------------------------------------------------------------*/ /*----------------------------------------------------------------------* * Originally written: * 1992 John Bovey * Modifications: * 1993 lipka * 1993 Brian Stempien * 1995 Raul Garcia Garcia * 1995 Piet W. Plomp * 1997 Raul Garcia Garcia * 1997,1998 Geoff Wing *----------------------------------------------------------------------*/ /*----------------------------------------------------------------------* * Public: * extern void cleanutent (void); * extern void makeutent (const char * pty, const char * hostname); * * Private: * write_utmp (); * update_wtmp (); *----------------------------------------------------------------------*/ #ifndef lint static const char rcsid[] = "$Id: utmp.c,v 1.1.1.1 2004/11/10 17:21:52 sasha Exp $"; #endif #include "rxvt.h" /* NECESSARY */ /* * HAVE_SETUTENT corresponds to SYSV-style utmp support. * Without it corresponds to using BSD utmp support. * SYSV-style utmp support is further divided in normal utmp support * and utmpx support (Solaris 2.x) by HAVE_UTMPX_H */ /* * update wtmp entries - only for SYSV style UTMP systems */ #ifdef UTMP_SUPPORT static char ut_id[5]; /* remember if entry to utmp made */ # ifndef USE_SYSV_UTMP static int utmp_pos; /* BSD position of utmp-stamp */ # endif #endif /* ------------------------------------------------------------------------- */ #ifndef HAVE_UTMPX_H /* supposedly we have updwtmpx ? */ #ifdef WTMP_SUPPORT /* PROTO */ void rxvt_update_wtmp(char *fname, struct utmp *putmp) { int fd, retry = 10; /* 10 attempts at locking */ struct flock lck; /* fcntl locking scheme */ if ((fd = open(fname, O_WRONLY | O_APPEND, 0)) < 0) return; lck.l_whence = SEEK_END; /* start lock at current eof */ lck.l_len = 0; /* end at ``largest possible eof'' */ lck.l_start = 0; lck.l_type = F_WRLCK; /* we want a write lock */ while (retry--) /* attempt lock with F_SETLK - F_SETLKW would cause a deadlock! */ if ((fcntl(fd, F_SETLK, &lck) < 0) && errno != EACCESS) { close(fd); return; /* failed for unknown reason: give up */ } write(fd, putmp, sizeof(struct utmp)); /* unlocking the file */ lck.l_type = F_UNLCK; fcntl(fd, F_SETLK, &lck); close(fd); } #endif /* WTMP_SUPPORT */ #endif /* !HAVE_UTMPX_H */ /* ------------------------------------------------------------------------- */ #ifdef UTMP_SUPPORT /* * make a utmp entry */ /* PROTO */ void makeutent(const char *pty, const char *hostname) { struct passwd *pwent = getpwuid(getuid()); UTMP utmp; #ifndef USE_SYSV_UTMP /* * BSD style utmp entry * ut_line, ut_name, ut_host, ut_time */ int i; FILE *fd0, *fd1; char buf[256], name[256]; #else /* * SYSV style utmp entry * ut_user, ut_id, ut_line, ut_pid, ut_type, ut_exit, ut_time */ #ifndef linux char *colon; #endif #endif /* !USE_SYSV_UTMP */ /* BSD naming is of the form /dev/tty?? or /dev/pty?? */ MEMSET(&utmp, 0, sizeof(UTMP)); if (!strncmp(pty, "/dev/", 5)) pty += 5; /* skip /dev/ prefix */ if (!strncmp(pty, "pty", 3) || !strncmp(pty, "tty", 3)) STRNCPY(ut_id, (pty + 3), sizeof(ut_id)); else #ifndef USE_SYSV_UTMP { print_error("can't parse tty name \"%s\"", pty); ut_id[0] = '\0'; /* entry not made */ return; } STRNCPY(utmp.ut_line, pty, sizeof(utmp.ut_line)); STRNCPY(utmp.ut_name, (pwent && pwent->pw_name) ? pwent->pw_name : "?", sizeof(utmp.ut_name)); STRNCPY(utmp.ut_host, hostname, sizeof(utmp.ut_host)); utmp.ut_time = time(NULL); if ((fd0 = fopen(UTMP_FILENAME, "r+")) == NULL) ut_id[0] = '\0'; /* entry not made */ else { utmp_pos = -1; if ((fd1 = fopen(TTYTAB_FILENAME, "r")) != NULL) { for (i = 1; (fgets(buf, sizeof(buf), fd1) != NULL); i++) { if (*buf == '#' || sscanf(buf, "%s", name) != 1) continue; if (!strcmp(utmp.ut_line, name)) { fclose(fd1); utmp_pos = i * sizeof(struct utmp); break; } } fclose(fd1); } if (utmp_pos < 0) ut_id[0] = '\0'; /* entry not made */ else { fseek(fd0, utmp_pos, 0); fwrite(&utmp, sizeof(UTMP), 1, fd0); } fclose(fd0); } #else /* USE_SYSV_UTMP */ { int n; if (sscanf(pty, "pts/%d", &n) == 1) sprintf(ut_id, "vt%02x", (n % 256)); /* sysv naming */ else { print_error("can't parse tty name \"%s\"", pty); ut_id[0] = '\0'; /* entry not made */ return; } } utmpname(UTMP_FILENAME); setutent(); /* XXX: should be unnecessaray */ STRNCPY(utmp.ut_id, ut_id, sizeof(utmp.ut_id)); utmp.ut_type = DEAD_PROCESS; (void)getutid(&utmp); /* position to entry in utmp file */ /* set up the new entry */ utmp.ut_type = USER_PROCESS; #ifndef linux utmp.ut_exit.e_exit = 2; #endif STRNCPY(utmp.ut_user, (pwent && pwent->pw_name) ? pwent->pw_name : "?", sizeof(utmp.ut_user)); STRNCPY(utmp.ut_id, ut_id, sizeof(utmp.ut_id)); STRNCPY(utmp.ut_line, pty, sizeof(utmp.ut_line)); #ifdef HAVE_UTMP_HOST STRNCPY(utmp.ut_host, hostname, sizeof(utmp.ut_host)); #ifndef linux if ((colon = strrchr(utmp.ut_host, ':')) != NULL) *colon = '\0'; #endif #endif /* HAVE_UTMP_HOST */ /* ut_name is normally the same as ut_user, but .... */ STRNCPY(utmp.ut_name, (pwent && pwent->pw_name) ? pwent->pw_name : "?", sizeof(utmp.ut_name)); utmp.ut_pid = getpid(); #ifdef HAVE_UTMPX_H utmp.ut_session = getsid(0); utmp.ut_tv.tv_sec = time(NULL); utmp.ut_tv.tv_usec = 0; #else utmp.ut_time = time(NULL); #endif /* HAVE_UTMPX_H */ pututline(&utmp); #ifdef WTMP_SUPPORT update_wtmp(WTMP_FILENAME, &utmp); #endif endutent(); /* close the file */ #endif /* !USE_SYSV_UTMP */ } #endif /* UTMP_SUPPORT */ /* ------------------------------------------------------------------------- */ #ifdef UTMP_SUPPORT /* * remove a utmp entry */ /* PROTO */ void cleanutent(void) { UTMP utmp; #ifndef USE_SYSV_UTMP FILE *fd; if (ut_id[0] && ((fd = fopen(UTMP_FILENAME, "r+")) != NULL)) { MEMSET(&utmp, 0, sizeof(struct utmp)); fseek(fd, utmp_pos, 0); fwrite(&utmp, sizeof(struct utmp), 1, fd); fclose(fd); } #else /* USE_SYSV_UTMP */ UTMP *putmp; if (!ut_id[0]) return; /* entry not made */ utmpname(UTMP_FILENAME); MEMSET(&utmp, 0, sizeof(UTMP)); STRNCPY(utmp.ut_id, ut_id, sizeof(utmp.ut_id)); utmp.ut_type = USER_PROCESS; setutent(); /* XXX: should be unnecessaray */ putmp = getutid(&utmp); if (!putmp || putmp->ut_pid != getpid()) return; putmp->ut_type = DEAD_PROCESS; #ifdef HAVE_UTMPX_H putmp->ut_session = getsid(0); putmp->ut_tv.tv_sec = time(NULL); putmp->ut_tv.tv_usec = 0; #else /* HAVE_UTMPX_H */ putmp->ut_time = time(NULL); #endif /* HAVE_UTMPX_H */ pututline(putmp); #ifdef WTMP_SUPPORT update_wtmp(WTMP_FILENAME, putmp); #endif endutent(); #endif /* !USE_SYSV_UTMP */ } #endif aterm-1.0.1/src/protos.h0000644000175000001440000000067610144447053013614 0ustar vaeusers/* Include prototypes for all files */ /* * $Id: protos.h,v 1.1.1.1 2004/11/10 17:21:47 sasha Exp $ */ #include "command.pro" #include "graphics.pro" #include "grkelot.pro" #include "main.pro" #include "menubar.pro" #include "misc.pro" #include "netdisp.pro" #include "rmemset.pro" #include "screen.pro" #include "thai.pro" # include "scrollbar.pro" #ifdef UTMP_SUPPORT #include "utmp.pro" #endif #include "xdefaults.pro" #include "pixmap.pro" aterm-1.0.1/src/makeprotos-sed0000755000175000001440000000063710144447050014772 0ustar vaeusers# Get prototypes from a .c file # $Id: makeprotos-sed,v 1.1.1.1 2004/11/10 17:21:44 sasha Exp $ # /* PROTO */ must be above return type which are above function. # Args are on one line # eg. # /* PROTO */ # void ------> void main(int argc, char **argv); # main(int argc, char **argv) # { # } # /^[/][*] PROTO [*][/]$/{ n N s/\n\([_a-zA-Z][_a-zA-Z0-9]* *\)(/ \1 __PROTO((/ s/$/);/ p } aterm-1.0.1/src/gcc-Wall0000755000175000001440000000134310144447046013466 0ustar vaeusers#!/bin/sh # gcc -Wall plus other important warnings not included in -Wall for arg do case $arg in -O*) Wuninitialized=-Wuninitialized;; # only makes sense with `-O' esac done exec gcc \ -Wall $Wuninitialized \ -Wwrite-strings \ -Wcast-qual \ -Wbad-function-cast \ -Wpointer-arith \ -Wstrict-prototypes \ -Wmissing-prototypes \ -Wmissing-declarations \ -Wnested-externs \ -Wtraditional \ -Wconversion \ -Wcomment \ -Wcast-align \ -Winline \ -Wshadow \ -Wredundant-decls \ -Wid-clash-31 \ "$@" # -Wall implies: # -Wimplicit # -Wreturn-type # -Wunused # -Wswitch # -Wformat # -Wchar-subscripts # -Wparentheses # -Wmissing-braces ------------------------------------------------------------------------------ aterm-1.0.1/src/graphics.c0000644000175000001440000003211110146454556014056 0ustar vaeusers/*--------------------------------*-C-*---------------------------------* * File: graphics.c *----------------------------------------------------------------------* * Copyright (C) 1997,1998 mj olesen * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *----------------------------------------------------------------------*/ /*----------------------------------------------------------------------* * Originally written: * 1994 Rob Nation * Modifications: * 1997 Raul Garcia Garcia * 1997,1998 mj olesen *----------------------------------------------------------------------*/ #ifndef lint static const char rcsid[] = "$Id: graphics.c,v 1.2 2004/11/16 19:47:58 sasha Exp $"; #endif #include "rxvt.h" /* NECESSARY */ #include /* commands: * 'C' = Clear * 'F' = Fill * 'G' = Geometry * 'L' = Line * 'P' = Points * 'T' = Text * 'W' = Window */ #ifndef GRX_SCALE # define GRX_SCALE 10000 #endif #ifdef RXVT_GRAPHICS static int graphics_up = 0; static grwin_t *gr_root = NULL; #endif /*----------------------------------------------------------------------* * local functions */ /* ARGSUSED */ /* PROTO */ void Gr_NewWindow(int nargs, int args[]) { #ifdef RXVT_GRAPHICS int x, y; unsigned int w, h; Window win; grwin_t *grwin; Cursor cursor; if (nargs != 4) { print_error("NewWindow: 4 args needed, got %d\n", nargs); return; } x = args[0] * TermWin.width / GRX_SCALE + TermWin_internalBorder; y = args[1] * TermWin.height / GRX_SCALE + TermWin_internalBorder; w = args[2] * TermWin.width / GRX_SCALE; h = args[3] * TermWin.height / GRX_SCALE; win = XCreateSimpleWindow(Xdisplay, TermWin.vt, x, y, w, h, 0, PixColors[Color_fg], PixColors[Color_bg]); cursor = XCreateFontCursor(Xdisplay, XC_crosshair); XDefineCursor(Xdisplay, win, cursor); XMapWindow(Xdisplay, win); XSelectInput(Xdisplay, win, ExposureMask); grwin = (grwin_t *) MALLOC(sizeof(grwin_t)); grwin->win = win; grwin->x = x; grwin->y = y; grwin->w = w; grwin->h = h; grwin->screen = 0; grwin->prev = NULL; grwin->next = gr_root; if (grwin->next) grwin->next->prev = grwin; gr_root = grwin; grwin->graphics = NULL; graphics_up++; tt_printf("\033W%ld\n", (long)grwin->win); #endif } /* ARGSUSED */ /* PROTO */ void Gr_ClearWindow(grwin_t * grwin) { #ifdef RXVT_GRAPHICS grcmd_t *cmd, *next; for (cmd = grwin->graphics; cmd != NULL; cmd = next) { next = cmd->next; free(cmd->coords); if (cmd->text != NULL) free(cmd->text); free(cmd); } grwin->graphics = NULL; XClearWindow(Xdisplay, grwin->win); #endif } /* * arg [0] = x * arg [1] = y * arg [2] = alignment * arg [3] = strlen (text) */ /* ARGSUSED */ /* PROTO */ void Gr_Text(grwin_t * grwin, grcmd_t * data) { #ifdef RXVT_GRAPHICS int x, y, align; if (data->ncoords < 4 || data->text == NULL || *(data->text) == '\0') return; x = data->coords[0] * grwin->w / GRX_SCALE; y = data->coords[1] * grwin->h / GRX_SCALE; align = data->coords[2]; if (align & RIGHT_TEXT) x -= XTextWidth(TermWin.font, data->text, data->coords[3]); else if (align & HCENTER_TEXT) x -= (XTextWidth(TermWin.font, data->text, data->coords[3]) >> 1); if (align & TOP_TEXT) y += TermWin.font->ascent; else if (align & BOTTOM_TEXT) y -= TermWin.font->descent; if (align & VCENTER_TEXT) y -= TermWin.font->descent + ((TermWin.font->ascent + TermWin.font->descent) >> 1); if (align & VCAPS_CENTER_TEXT) y += (TermWin.font->ascent >> 1); XPMClearArea(Xdisplay, grwin->win, x, y, Width2Pixel(data->coords[3]), Height2Pixel(1), 0); XDrawString(Xdisplay, grwin->win, TermWin.gc, x, y, data->text, data->coords[3]); #endif } /* ARGSUSED */ /* PROTO */ void Gr_Geometry(grwin_t * grwin, grcmd_t * data) { #ifdef RXVT_GRAPHICS if (grwin) tt_printf("\033G%ld %d %d %u %u %d %d %ld %ld %d\n", (long)grwin->win, grwin->x, grwin->y, grwin->w, grwin->h, TermWin.fwidth, TermWin.fheight, (long)GRX_SCALE * TermWin.fwidth / grwin->w, (long)GRX_SCALE * TermWin.fheight / grwin->h, Xdepth); else /* rxvt terminal window size */ tt_printf("\033G0 0 0 %d %d %d %d %ld %ld %d\n", TermWin.width - 2 * TermWin_internalBorder, TermWin.height - 2 * TermWin_internalBorder, TermWin.fwidth, TermWin.fheight, (long)GRX_SCALE * TermWin.fwidth / (TermWin.width - 2 * TermWin_internalBorder), (long)GRX_SCALE * TermWin.fheight / (TermWin.height - 2 * TermWin_internalBorder), Xdepth); #endif } /* ARGSUSED */ /* PROTO */ void Gr_DestroyWindow(grwin_t * grwin) { #ifdef RXVT_GRAPHICS grcmd_t *cmd, *next; if (grwin == NULL) return; for (cmd = grwin->graphics; cmd; cmd = next) { next = cmd->next; free(cmd->coords); if (cmd->text != NULL) free(cmd->text); free(cmd); } XDestroyWindow(Xdisplay, grwin->win); if (grwin->next != NULL) grwin->next->prev = grwin->prev; if (grwin->prev != NULL) grwin->prev->next = grwin->next; else gr_root = grwin->next; free(grwin); graphics_up--; #endif } /* ARGSUSED */ /* PROTO */ void Gr_Dispatch(grwin_t * grwin, grcmd_t * data) { #ifdef RXVT_GRAPHICS int i, n; union { XPoint pt[NGRX_PTS / 2]; XRectangle rect[NGRX_PTS / 4]; } xdata; if (data->color != Color_fg) { XGCValues gcv; gcv.foreground = PixColors[data->color]; XChangeGC(Xdisplay, TermWin.gc, GCForeground, &gcv); } if (grwin) switch (data->cmd) { case 'L': if (data->ncoords > 3) { for (n = i = 0; i < data->ncoords; i += 2, n++) { xdata.pt[n].x = data->coords[i] * grwin->w / GRX_SCALE; xdata.pt[n].y = data->coords[i + 1] * grwin->h / GRX_SCALE; } XDrawLines(Xdisplay, grwin->win, TermWin.gc, xdata.pt, n, CoordModeOrigin); } break; case 'P': if (data->ncoords > 3) { for (n = i = 0; i < data->ncoords; i += 2, n++) { xdata.pt[n].x = data->coords[i] * grwin->w / GRX_SCALE; xdata.pt[n].y = data->coords[i + 1] * grwin->h / GRX_SCALE; } XDrawPoints(Xdisplay, grwin->win, TermWin.gc, xdata.pt, n, CoordModeOrigin); } break; case 'F': if (data->ncoords > 0) { for (n = i = 0; i < data->ncoords; i += 4, n++) { xdata.rect[n].x = data->coords[i] * grwin->w / GRX_SCALE; xdata.rect[n].y = data->coords[i + 1] * grwin->h / GRX_SCALE; xdata.rect[n].width = ((data->coords[i + 2] - data->coords[i] + 1) * grwin->w / GRX_SCALE); xdata.rect[n].height = ((data->coords[i + 3] - data->coords[i + 1] + 1) * grwin->h / GRX_SCALE); XPMClearArea(Xdisplay, grwin->win, xdata.rect[n].x, xdata.rect[n].y, xdata.rect[n].width, xdata.rect[n].height, 0); } XFillRectangles(Xdisplay, grwin->win, TermWin.gc, xdata.rect, n); } break; case 'T': Gr_Text(grwin, data); break; case 'C': Gr_ClearWindow(grwin); break; } if (data->color != Color_fg) { XGCValues gcv; gcv.foreground = PixColors[Color_fg]; XChangeGC(Xdisplay, TermWin.gc, GCForeground, &gcv); } #endif } /* ARGSUSED */ /* PROTO */ void Gr_Redraw(grwin_t * grwin) { #ifdef RXVT_GRAPHICS grcmd_t *cmd; for (cmd = grwin->graphics; cmd != NULL; cmd = cmd->next) Gr_Dispatch(grwin, cmd); #endif } /*----------------------------------------------------------------------* * end of static functions */ /* ARGSUSED */ /* PROTO */ void Gr_ButtonReport(int but, int x, int y) { #ifdef RXVT_GRAPHICS grwin_t *grwin; for (grwin = gr_root; grwin != NULL; grwin = grwin->next) if ((x > grwin->x) && (y > grwin->y) && (x < grwin->x + grwin->w) && (y < grwin->y + grwin->h)) break; if (grwin == NULL) return; x = GRX_SCALE * (x - grwin->x) / grwin->w; y = GRX_SCALE * (y - grwin->y) / grwin->h; tt_printf("\033%c%ld;%d;%d;\n", but, (long)grwin->win, x, y); #endif } /* ARGSUSED */ /* PROTO */ void Gr_do_graphics(int cmd, int nargs, int args[], unsigned char *text) { #ifdef RXVT_GRAPHICS static Window last_id = None; long win_id; grwin_t *grwin; grcmd_t *newcmd, *oldcmd; int i; if (cmd == 'W') { Gr_NewWindow(nargs, args); return; } win_id = (nargs > 0) ? (Window) args[0] : None; if ((cmd == 'G') && (win_id == None)) { Gr_Geometry(NULL, NULL); return; } if ((win_id == None) && (last_id != None)) win_id = last_id; if (win_id == None) return; grwin = gr_root; while ((grwin != NULL) && (grwin->win != win_id)) grwin = grwin->next; if (grwin == NULL) return; if (cmd == 'G') { Gr_Geometry(grwin, NULL); return; } nargs--; args++; /* skip over window id */ /* record this new command */ newcmd = (grcmd_t *) MALLOC(sizeof(grcmd_t)); newcmd->ncoords = nargs; newcmd->coords = (int *)MALLOC((newcmd->ncoords * sizeof(int))); newcmd->next = NULL; newcmd->cmd = cmd; newcmd->color = scr_get_fgcolor(); newcmd->text = text; for (i = 0; i < newcmd->ncoords; i++) newcmd->coords[i] = args[i]; /* * If newcmd == fill, and rectangle is full window, drop all prior * commands. */ if ((newcmd->cmd == 'F') && (grwin) && (grwin->graphics)) { for (i = 0; i < newcmd->ncoords; i += 4) { if ((newcmd->coords[i] == 0) && (newcmd->coords[i + 1] == 0) && (newcmd->coords[i + 2] == GRX_SCALE) && (newcmd->coords[i + 3] == GRX_SCALE)) { /* drop previous commands */ oldcmd = grwin->graphics; while (oldcmd->next != NULL) { grcmd_t *tmp = oldcmd; oldcmd = oldcmd->next; free(tmp); } grwin->graphics = NULL; } } } /* insert new command into command list */ oldcmd = grwin->graphics; if (oldcmd == NULL) grwin->graphics = newcmd; else { while (oldcmd->next != NULL) oldcmd = oldcmd->next; oldcmd->next = newcmd; } Gr_Dispatch(grwin, newcmd); #endif } /* ARGSUSED */ /* PROTO */ void Gr_scroll(int count) { #ifdef RXVT_GRAPHICS static short prev_start = 0; grwin_t *grwin, *next; if ((count == 0) && (prev_start == TermWin.view_start)) return; prev_start = TermWin.view_start; for (grwin = gr_root; grwin != NULL; grwin = next) { next = grwin->next; grwin->y -= (count * TermWin.fheight); if ((grwin->y + grwin->h) < -(TermWin.saveLines * TermWin.fheight)) Gr_DestroyWindow(grwin); else XMoveWindow(Xdisplay, grwin->win, grwin->x, grwin->y + (TermWin.view_start * TermWin.fheight)); } #endif } /* PROTO */ void Gr_ClearScreen(void) { #ifdef RXVT_GRAPHICS grwin_t *grwin, *next; for (grwin = gr_root; grwin != NULL; grwin = next) { next = grwin->next; if ((grwin->screen == 0) && (grwin->y + grwin->h > 0)) { if (grwin->y >= 0) Gr_DestroyWindow(grwin); else XResizeWindow(Xdisplay, grwin->win, grwin->w, -grwin->y); } } #endif } /* PROTO */ void Gr_ChangeScreen(void) { #ifdef RXVT_GRAPHICS grwin_t *grwin, *next; for (grwin = gr_root; grwin != NULL; grwin = next) { next = grwin->next; if (grwin->y + grwin->h > 0) { if (grwin->screen == 1) { XMapWindow(Xdisplay, grwin->win); grwin->screen = 0; } else { XUnmapWindow(Xdisplay, grwin->win); grwin->screen = 1; } } } #endif } /* ARGSUSED */ /* PROTO */ void Gr_expose(Window win) { #ifdef RXVT_GRAPHICS grwin_t *grwin; for (grwin = gr_root; grwin != NULL; grwin = grwin->next) { if (grwin->win == win) { Gr_Redraw(grwin); break; } } #endif } /* ARGSUSED */ /* PROTO */ void Gr_Resize(int w, int h) { #ifdef RXVT_GRAPHICS grwin_t *grwin; for (grwin = gr_root; grwin != NULL; grwin = grwin->next) { if (TermWin.height != h) { grwin->y += (TermWin.height - h); XMoveWindow(Xdisplay, grwin->win, grwin->x, grwin->y + (TermWin.view_start * TermWin.fheight)); } Gr_Redraw(grwin); } #endif } /* PROTO */ void Gr_reset(void) { #ifdef RXVT_GRAPHICS grwin_t *grwin, *next; for (grwin = gr_root; grwin != NULL; grwin = next) { next = grwin->next; Gr_DestroyWindow(grwin); } graphics_up = 0; #endif } /* PROTO */ int Gr_Displayed(void) { #ifdef RXVT_GRAPHICS return graphics_up; #else return 0; #endif } /*----------------------- end-of-file (C source) -----------------------*/ aterm-1.0.1/src/grkelot.c0000644000175000001440000003176010144447047013731 0ustar vaeusers/*---------------------------------*C*--------------------------------------* * File: grkelot.c *--------------------------------------------------------------------------* * Copyright (C) 1997,1998 Oezger Kesim * Copyright (c) 1994,1995 Angelo Haritsis. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *--------------------------------------------------------------------------* * Synopsis: string -> greek ELOT928 or IBM437 string; * 4-state FSM implementation. * * System: Any (ANSI C) * * This is code derived from a more generic key remapper written by the same * author and used in other environments. It was not written only * for greek kbd bindings. An extension to other languages is easy * (well don't know how the FSM lends itself to Far East languages). * * The FSM can have MAX_STATES states (change it for more). * Each state contains: * 1. many tranlsation tables (registered via kstate_add_xlat()) * 2. many switch codes for transition to other states (registered via * kstate_add_switcher()) : limit is static now: MAX_SWITCHER * 3. life: the number of xlations allowed in a state (0 = unlimited) * * Format of tranlation strings: * -:n1,n2,n3,... * Format of switcher string: * A: * (other switchers apart from A=ascii can be supported; not in this context) * Format of life string: * L (N=0,1,...) *-------------------------------------------------------------------------* * Written by Angelo Haritis. * * Redistribution and use in source and binary forms are permitted provided * that the above copyright notice and this paragraph are duplicated in all * such forms and that any documentation, advertising materials, and other * materials related to such distribution and use acknowledge that the * software was developed by Angelo Haritsis. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * * NB: DO NOT ALTER! THIS CODE IS USED IN MANY PLATFORMS!!! * * TODO: make it more dynamic (linked lists is an idea but slower) */ #ifndef lint static const char rcsid[] = "$Id: grkelot.c,v 1.1.1.1 2004/11/10 17:21:43 sasha Exp $"; #endif #define RXVT /* define for use by rxvt */ #ifdef RXVT #include "rxvt.h" /* NECESSARY */ #endif /* RXVT */ #ifdef GREEK_SUPPORT #include "grkelot.h" #include #include /* --- Macros, Types --------- */ #define MAX_STATES 4 /* max # states for the FSM */ #define MAX_SWITCHER 2U /* per state */ #define MAX_VAL 256 /* for temp allocation */ typedef struct s_xlat { u_int first, last; u_int *pval; /* array of translated values */ } K_XLAT; typedef struct s_switch { u_char type; /* Ascii, Virtual, Scan */ u_int code; u_char nextstate; u_char on; /* current state of key: 0 = off */ } K_SWITCH; typedef struct s_state { u_int num_xlat; /* number of translations */ K_XLAT *xlat; /* State translations ((dynamic - realloc'ed) */ u_int num_switcher; /* number of switcher keys */ K_SWITCH switcher[MAX_SWITCHER]; /* switcher keys to other states */ u_char life; /* 0 = until switched by key */ u_char prev_state; /* filled when jumped to a new state */ } K_STATE; /* type for each one of the different greek standards (xlat types) */ typedef struct s_xlat_type { char *plain; char *accent; char *accent_xtra; char *umlaut; char *acc_uml; } XLAT_TYPE; /* --- Local Data ------------ */ static K_STATE State[MAX_STATES]; /* Current State */ static u_char nStateNow = 0; static K_STATE *pStateNow = &State[0]; static int GreekMode = GREEK_ELOT928; /* * The following are hard-coded for now. The idea is that such strings would * be read from a config file making it possible to change language/encodings * more flexibly. */ /* elot 928 xlations */ static char elot_xlat_plain[] = "65-122:193,194,216,196,197,214,195,199,201,206,202,203,204,205,207,208,81,209,211,212,200,217,87,215,213,198,91,92,93,94,95,96,225,226,248,228,229,246,227,231,233,238,234,235,236,237,239,240,113,241,243,244,232,249,242,247,245,230"; /* c and s give copyright and section sign */ static char elot_xlat_acc[] = "65-122:182,194,216,196,184,214,195,185,186,206,202,203,204,205,188,208,81,209,211,212,200,191,87,215,190,198,91,92,93,94,95,96,220,226," /*248 */ "169,228,221,246,227,222,223,238,234,235,236,237,252,240,113,241," /*243 */ "167,244,232,254,242,247,253,230"; static char elot_xlat_acc_xtra[] = "46-62:183,47,48,49,50,51,52,53,54,55,56,57,58,59,171,61,187"; /* anw teleia, quotes */ static char elot_xlat_uml[] = "65-122:193,194,216,196,197,214,195,199,218,206,202,203,204,205,207,208,81,209,211,212,200,217,87,215,219,198,91,92,93,94,95,96,225,226,248,228,229,246,227,231,250,238,234,235,236,237,239,240,113,241,243,244,232,249,242,247,251,230"; static char elot_xlat_umacc[] = "65-122:193,194,216,196,197,214,195,199,201,206,202,203,204,205,207,208,81,209,211,212,200,217,87,215,213,198,91,92,93,94,95,96,225,226,248,228,229,246,227,231,192,238,234,235,236,237,239,240,113,241,243,244,232,249,242,247,224,230"; /* ibm 437 xlations */ static char i437_xlat_plain[] = "65-122:128,129,150,131,132,148,130,134,136,141,137,138,139,140,142,143,81,144,145,146,135,151,87,149,147,133,91,92,93,94,95,96,152,153,175,155,156,173,154,158,160,165,161,162,163,164,166,167,113,168,169,171,159,224,170,174,172,157"; static char i437_xlat_acc[] = "65-122:234,129,150,131,235,148,130,236,237,141,137,138,139,140,238,143,81,144,145,146,135,240,87,149,239,133,91,92,93,94,95,96,225,153,175,155,226,173,154,227,229,165,161,162,163,164,230,167,113,168,169,171,159,233,170,174,231,157"; static char i437_xlat_acc_xtra[] = "46-46:250"; /* anw teleia */ static char i437_xlat_uml[] = "65-122:128,129,150,131,132,148,130,134,136,141,137,138,139,140,142,143,81,144,145,146,135,151,87,149,147,133,91,92,93,94,95,96,152,153,175,155,156,173,154,158,228,165,161,162,163,164,166,167,113,168,169,171,159,224,170,174,232,157"; static char i437_xlat_umacc[] = "65-122:128,129,150,131,132,148,130,134,136,141,137,138,139,140,142,143,81,144,145,146,135,151,87,149,147,133,91,92,93,94,95,96,152,153,175,155,156,173,154,158,42,165,161,162,163,164,166,167,113,168,169,171,159,224,170,174,42,157"; /* * currently ELOT928 and IBM437 are supported; easy to include others * (not recommended: stick to just these 2 if not only the ELOT one) */ static XLAT_TYPE xlat_type[] = { {elot_xlat_plain, elot_xlat_acc, elot_xlat_acc_xtra, elot_xlat_uml, elot_xlat_umacc}, {i437_xlat_plain, i437_xlat_acc, i437_xlat_acc_xtra, i437_xlat_uml, i437_xlat_umacc}, }; /* the current trasnaltion type */ static XLAT_TYPE *xlat_now = &xlat_type[GREEK_ELOT928]; #define NUM_XLAT_TYPES (sizeof(xlat_type) / sizeof(xlat_type[0])) static void kstate_add_xlat(char *str); static void kstate_add_switcher(char *str); static void kstate_set_life(char *str); /* --- Functions ------------- */ /* PROTO */ void kstate_setcurr(int stateno) { u_char prev_state; if ((u_int) stateno > (u_int) MAX_STATES) return; if (pStateNow->life == 1) prev_state = pStateNow->prev_state; else prev_state = nStateNow; pStateNow = &State[nStateNow = stateno]; pStateNow->prev_state = prev_state; } /* PROTO */ void kstate_init(void) { pStateNow->num_xlat = pStateNow->num_switcher = pStateNow->life = pStateNow->prev_state = 0; pStateNow->xlat = NULL; } /* PROTO */ void kstate_end(void) { int i; for (i = 0; i < pStateNow->num_xlat; i++) free(pStateNow->xlat[i].pval); if (pStateNow->num_xlat > 0) free(pStateNow->xlat); } /* * Hard coded ELOT-928 translations. Could read these from an rc-type file * to support other remappers. */ /* PROTO */ void kstate_init_all(int greek_mode) { /* the translation tables for the 4 FSM states for ELOT-928 mappings */ int i; for (i = 0; i < MAX_STATES; i++) { kstate_setcurr(i); kstate_init(); } if (greek_mode < 0 || greek_mode >= NUM_XLAT_TYPES) /* avoid death */ greek_mode = GREEK_ELOT928; xlat_now = &xlat_type[greek_mode]; kstate_setcurr(0); kstate_add_xlat(xlat_now->plain); kstate_add_switcher("A;:1"); kstate_add_switcher("A::2"); kstate_set_life("L0"); kstate_setcurr(1); kstate_add_xlat(xlat_now->accent); kstate_add_xlat(xlat_now->accent_xtra); kstate_add_switcher("A::3"); kstate_set_life("L1"); kstate_setcurr(2); kstate_add_xlat(xlat_now->umlaut); kstate_add_switcher("A;:3"); kstate_set_life("L1"); kstate_setcurr(3); kstate_add_xlat(xlat_now->acc_uml); kstate_set_life("L1"); } /* PROTO */ void kstate_end_all(void) { int i; for (i = 0; i < MAX_STATES; i++) { kstate_setcurr(i); kstate_end(); } kstate_setcurr(0); } /* * reset FSM */ /* PROTO */ void kstate_reset(void) { kstate_setcurr(0); } void kstate_add_xlat(char *str) { K_XLAT *xlat; u_int *pval_tmp; char *sval; int i; if (str == NULL) return; /* add a new xlat table in state */ if (pStateNow->num_xlat == 0) { pStateNow->xlat = malloc(sizeof(K_XLAT)); } else /* prefer contiguous data, realloc */ pStateNow->xlat = realloc(pStateNow->xlat, (pStateNow->num_xlat + 1) * sizeof(K_XLAT)); xlat = &pStateNow->xlat[pStateNow->num_xlat]; /* parse str and derive first, last, values */ xlat->first = (u_int) atoi(strtok(str, "-")); xlat->last = (u_int) atoi(strtok(NULL, ":")); i = 0; pval_tmp = calloc(MAX_VAL, sizeof(K_XLAT)); while ((sval = strtok(NULL, ",")) != NULL) pval_tmp[i++] = (u_int) (atoi(sval)); xlat->pval = calloc(i, sizeof(K_XLAT)); if (xlat->pval != NULL) memcpy(xlat->pval, pval_tmp, i * sizeof(u_int)); free(pval_tmp); pStateNow->num_xlat++; } /* * Ascii only for this implementation */ void kstate_add_switcher(char *str) { K_SWITCH *switcher; if (str == NULL) return; if (pStateNow->num_switcher >= MAX_SWITCHER) return; switcher = &pStateNow->switcher[pStateNow->num_switcher]; switch (switcher->type = str[0]) { case 'A': /* ascii eg: A;:2 */ switcher->code = str[1]; switcher->nextstate = atoi(&str[3]); break; } switcher->on = 0; pStateNow->num_switcher++; } /* L1 or L0 */ void kstate_set_life(char *str) { pStateNow->life = atoi(&str[1]); } /* PROTO */ unsigned int kstate_cxlat(unsigned int c) { int i; /* check for ascii switcher */ for (i = 0; i < pStateNow->num_switcher; i++) if (pStateNow->switcher[i].type == 'A' && /* only ascii here */ c == pStateNow->switcher[i].code) { kstate_setcurr(pStateNow->switcher[i].nextstate); pStateNow->switcher[i].on = 1; return ((unsigned int)-1); } /* do translation */ for (i = 0; i < pStateNow->num_xlat; i++) if (c >= pStateNow->xlat[i].first && c <= pStateNow->xlat[i].last) { c = pStateNow->xlat[i].pval[c - pStateNow->xlat[i].first]; break; } /* switch back to previous state if life of current is 1 */ if (pStateNow->life == 1) kstate_setcurr(pStateNow->prev_state); return (c); } #ifdef RXVT /* PROTO */ void greek_init(void) { kstate_init_all(GreekMode); } /* PROTO */ void greek_end(void) { kstate_end_all(); } /* PROTO */ void greek_reset(void) { kstate_reset(); } /* PROTO */ void greek_setmode(int greek_mode) { GreekMode = greek_mode; } /* PROTO */ int greek_getmode(void) { return (GreekMode); } /* * xlate a given string in-place - return new string length */ /* PROTO */ int greek_xlat(char *s, int num_chars) { int i, count; unsigned int c; for (i = 0, count = 0; i < num_chars; i++) { c = kstate_cxlat((unsigned int)s[i]); if (c != -1) s[count++] = (char)c; } s[count] = '\0'; return (count); } #ifdef TEST int main(void) { /*char text[] = "abcdef;aGDZXC"; */ char text[] = "abcdef;a:ibgdezhuiklmnjoprstyfxcv"; kstate_init_all(GREEK_ELOT928); printf("text: %s\n", text); greek_xlat(text, strlen(text)); printf("xlat'ed text: %s\n", text); kstate_end_all(); return 0; } #endif #endif /* RXVT */ #endif /* GREEK_SUPPORT */ aterm-1.0.1/src/grkelot.h0000644000175000001440000000256110144447047013733 0ustar vaeusers/* * File: grkelot.h * $Id: grkelot.h,v 1.1.1.1 2004/11/10 17:21:43 sasha Exp $ * * Synopsis: string -> greek ELOT928 string; 4-state FSM. * * Copyright (C) 1997,1998 Oezguer Kesim * Copyright (c) 1994 Angelo Haritsis. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef _GRKELOT_H #define _GRKELOT_H #define GREEK_ELOT928 0 #define GREEK_IBM437 1 #ifdef __cplusplus extern "C" { #endif extern void greek_init (void); extern void greek_end (void); extern void greek_reset (void); extern void greek_setmode(int greek_mode); extern int greek_getmode(void); extern int greek_xlat (char *s, int num_chars); #ifdef __cplusplus } #endif #endif /* _GRKELOT_H */ aterm-1.0.1/src/.indent.pro0000644000175000001440000000124710144447043014170 0ustar vaeusers--dont-format-comments --procnames-start-lines --parameter-indentation4 --indent-level4 --line-comments-indentation4 --cuddle-else --brace-indent0 --start-left-side-of-comments --no-blank-lines-after-commas --blank-lines-after-declarations --blank-lines-after-procedures --comment-indentation33 --declaration-comment-column33 --no-comment-delimiters-on-blank-lines --continuation-indentation4 --case-indentation0 --else-endif-column33 --no-space-after-casts --no-blank-before-sizeof --declaration-indentation16 --continue-at-parentheses --no-space-after-function-call-names --swallow-optional-blank-lines --space-special-semicolon --tab-size8 --line-length79 --braces-on-if-line aterm-1.0.1/aterm.lsm0000644000175000001440000000433310262523607013146 0ustar vaeusersBegin3 Title: aterm Version: 1.0.0 Entered-date: 05Jul05 Description: aterm is based upon rxvt v.2.4.8 with add ons of Alfredo Kojima's NeXT-ish scrollbars. Fast transparency functionality, background lightening/darkening or/and tinting(coloring). Original idea of using ParentRelative transparency mode belongs to Alfredo also, although code has been mostly reworked. It can also be integrated with AfterStep libasimage for pixmap loading from various formats. Rxvt is an 8-bit clean, colour xterm replacement that uses significantly less memory than a conventional xterm, mostly since it doesn't support toolkit configurability or Tek graphics, but also since features can be removed at compile-time to reflect your needs. Some rxvt features (compilation dependent): ANSI-color, bold/blink attributes modify foreground/background colours, scrollbars with arrow buttons, kanji and greek support, printer-pipe, XPM, JPEG and PNG backgrounds with on-the-fly scaling, user-definable menus. Keywords: rxvt colour color kanji xterm X11 vt100 terminal-emulator xbiff xpm menu aterm AfterStep Author: * John Bovey [Univ. Kent at Canterbury] was the creator of the original xvt. * Rob Nation [Lockheed] re-wrote most of xvt to make a substantiallly enhanced version called rxvt (Rob's xvt). * Mark Olesen [Queen's Univ. at Kingston] made various improvements and cleanups. Coordinated development, versions 2.11 - 2.21 * Oezguer Kesim [FU Berlin] Coordinated development, versions 2.21a - 2.4.5 * Geoff Wing rewrote much of the screen refreshing routines and mouse selection. Coordinated development, versions 2.4.6 - * Alfredo Kojima added NeXT-ish scrollbars and fast transparency * Sasha Vasko branched aterm - rewrote imaging code, other maintenance. * Ethan Fischer - contributed fast shading code to 0.3.3. * Rafal Wierzbicki - support for Unix98 ptys with linux-2.2.x and glibc-2.1 Maintained-by: Sasha Vasko Project Coordinator Original-site: ftp.afterstep.org /apps/aterm aterm-1.0.0.tar.gz Platforms: requires X11 installed Copying-policy: GPL End aterm-1.0.1/tools/0000755000175000001440000000000010654145570012462 5ustar vaeusersaterm-1.0.1/tools/cvs2cl.as.pl0000755000175000001440000023154110654145647014633 0ustar vaeusers#!/bin/sh exec perl -w -x $0 ${1+"$@"} # -*- mode: perl; perl-indent-level: 2; -*- #!perl -w ############################################################## ### ### ### cvs2cl.pl: produce ChangeLog(s) from `cvs log` output. ### ### ### ############################################################## ## $Revision: 1.1 $ ## $Date: 2007/08/01 18:06:31 $ ## $Author: vae $ ## ## (C) 2001,2002,2003 Martyn J. Pearce , under the GNU GPL. ## (C) 1999 Karl Fogel , under the GNU GPL. ## ## (Extensively hacked on by Melissa O'Neill .) ## (Gecos hacking by Robin Johnson .) ## ## cvs2cl.pl is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation; either version 2, or (at your option) ## any later version. ## ## cvs2cl.pl is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You may have received a copy of the GNU General Public License ## along with cvs2cl.pl; see the file COPYING. If not, write to the ## Free Software Foundation, Inc., 59 Temple Place - Suite 330, ## Boston, MA 02111-1307, USA. use strict; use Text::Wrap qw( ); use Time::Local; use File::Basename qw( fileparse ); use User::pwent; # The Plan: # # Read in the logs for multiple files, spit out a nice ChangeLog that # mirrors the information entered during `cvs commit'. # # The problem presents some challenges. In an ideal world, we could # detect files with the same author, log message, and checkin time -- # each would be a changelog entry. # We'd sort them; and spit them out. Unfortunately, CVS is *not atomic* # so checkins can span a range of times. Also, the directory structure # could be hierarchical. # # Another question is whether we really want to have the ChangeLog # exactly reflect commits. An author could issue two related commits, # with different log entries, reflecting a single logical change to the # source. GNU style ChangeLogs group these under a single author/date. # We try to do the same. # # So, we parse the output of `cvs log', storing log messages in a # multilevel hash that stores the mapping: # directory => author => time => message => filelist # As we go, we notice "nearby" commit times and store them together # (i.e., under the same timestamp), so they appear in the same log # entry. # # When we've read all the logs, we twist this mapping into # a time => author => message => filelist mapping for each directory. # # If we're not using the `--distributed' flag, the directory is always # considered to be `./', even as descend into subdirectories. ############### Globals ################ use constant MAILNAME => "/etc/mailname"; # What we run to generate it: my $Log_Source_Command = "cvs log"; # In case we have to print it out: my $VERSION = '$Revision: 1.1 $'; $VERSION =~ s/\S+\s+(\S+)\s+\S+/$1/; ## Vars set by options: # Print debugging messages? my $Debug = 0; # Just show version and exit? my $Print_Version = 0; # Just print usage message and exit? my $Print_Usage = 0; # Single top-level ChangeLog, or one per subdirectory? my $Distributed = 0; # What file should we generate (defaults to "ChangeLog")? my $Log_File_Name = "ChangeLog"; # Grab most recent entry date from existing ChangeLog file, just add # to that ChangeLog. my $Cumulative = 0; # `cvs log -d`, this will repeat the last entry in the old log. This is OK, # as it guarantees at least one entry in the update changelog, which means # that there will always be a date to extract for the next update. The repeat # entry can be removed in postprocessing, if necessary. # MJP 2003-08-02 # I don't think this actually does anything useful my $Update = 0; # Expand usernames to email addresses based on a map file? my $User_Map_File = ""; my $User_Passwd_File; my $Mail_Domain; # Output log in chronological order? [default is reverse chronological order] my $Chronological_Order = 0; # Grab user details via gecos my $Gecos = 0; # User domain for gecos email addresses my $Domain; # Output to a file or to stdout? my $Output_To_Stdout = 0; # Eliminate empty log messages? my $Prune_Empty_Msgs = 0; # Tags of which not to output my %ignore_tags; # Show only revisions with Tags my %show_tags; # Don't call Text::Wrap on the body of the message my $No_Wrap = 0; # Don't do any pretty print processing my $Summary = 0; # Separates header from log message. Code assumes it is either " " or # "\n\n", so if there's ever an option to set it to something else, # make sure to go through all conditionals that use this var. my $After_Header = " "; # XML Encoding my $XML_Encoding = ''; # Format more for programs than for humans. my $XML_Output = 0; my $No_XML_Namespace = 0; # Do some special tweaks for log data that was written in FSF # ChangeLog style. my $FSF_Style = 0; # Show times in UTC instead of local time my $UTC_Times = 0; # Show times in output? my $Show_Times = 1; # Show day of week in output? my $Show_Day_Of_Week = 0; # Show revision numbers in output? my $Show_Revisions = 0; # Show dead files in output? my $Show_Dead = 0; # Hide dead trunk files which were created as a result of additions on a # branch? my $Hide_Branch_Additions = 1; # Show tags (symbolic names) in output? my $Show_Tags = 0; # Show tags separately in output? my $Show_Tag_Dates = 0; # Show branches by symbolic name in output? my $Show_Branches = 0; # Show only revisions on these branches or their ancestors. my @Follow_Branches; # Don't bother with files matching this regexp. my @Ignore_Files; # How exactly we match entries. We definitely want "o", # and user might add "i" by using --case-insensitive option. my $Case_Insensitive = 0; # Maybe only show log messages matching a certain regular expression. my $Regexp_Gate = ""; # Pass this global option string along to cvs, to the left of `log': my $Global_Opts = ""; # Pass this option string along to the cvs log subcommand: my $Command_Opts = ""; # Read log output from stdin instead of invoking cvs log? my $Input_From_Stdin = 0; # Don't show filenames in output. my $Hide_Filenames = 0; # Don't shorten directory names from filenames. my $Common_Dir = 1; # Max checkin duration. CVS checkin is not atomic, so we may have checkin # times that span a range of time. We assume that checkins will last no # longer than $Max_Checkin_Duration seconds, and that similarly, no # checkins will happen from the same users with the same message less # than $Max_Checkin_Duration seconds apart. my $Max_Checkin_Duration = 180; # What to put at the front of [each] ChangeLog. my $ChangeLog_Header = ""; # Whether to enable 'delta' mode, and for what start/end tags. my $Delta_Mode = 0; my $Delta_From = ""; my $Delta_To = ""; my $TestCode; # Whether to parse filenames from the RCS filename, and if so what # prefix to strip. my $RCS_Mode = 0; my $RCS_Root = ""; ## end vars set by options. # latest observed times for the start/end tags in delta mode my $Delta_StartTime = 0; my $Delta_EndTime = 0; # In 'cvs log' output, one long unbroken line of equal signs separates # files: my $file_separator = "=======================================" . "======================================"; # In 'cvs log' output, a shorter line of dashes separates log messages # within a file: my $logmsg_separator = "----------------------------"; my $No_Ancestors = 0; ############### End globals ############ &parse_options (); if ( defined $TestCode ) { eval $TestCode; die "Eval failed: '$@'\n" if $@; } else { &derive_change_log (); } ### Everything below is subroutine definitions. ### sub run_ext { my ($cmd) = @_; $cmd = [$cmd] unless ref $cmd; local $" = ' '; my $out = qx"@$cmd 2>&1"; my $rv = $?; my ($sig, $core, $exit) = ($? & 127, $? & 128, $? >> 8); return $out, $exit, $sig, $core; } # If accumulating, grab the boundary date from pre-existing ChangeLog. sub maybe_grab_accumulation_date () { if (! $Cumulative || $Update) { return ""; } # else open (LOG, "$Log_File_Name") or die ("trouble opening $Log_File_Name for reading ($!)"); my $boundary_date; while () { if (/^(\d\d\d\d-\d\d-\d\d\s+\d\d:\d\d)/) { $boundary_date = "$1"; last; } } close (LOG); # convert time from utc to local timezone if the ChangeLog has # dates/times in utc if ($UTC_Times && $boundary_date) { # convert the utc time to a time value my ($year,$mon,$mday,$hour,$min) = $boundary_date =~ m#(\d+)-(\d+)-(\d+)\s+(\d+):(\d+)#; my $time = timegm(0,$min,$hour,$mday,$mon-1,$year-1900); # print the timevalue in the local timezone my ($ignore,$wday); ($ignore,$min,$hour,$mday,$mon,$year,$wday) = localtime($time); $boundary_date=sprintf ("%4u-%02u-%02u %02u:%02u", $year+1900,$mon+1,$mday,$hour,$min); } return $boundary_date; } # Don't call this wrap, because with 5.5.3, that clashes with the # (unconditional :-( ) export of wrap() from Text::Wrap sub mywrap { my ($indent1, $indent2, @text) = @_; # If incoming text looks preformatted, don't get clever my $text = Text::Wrap::wrap($indent1, $indent2, @text); if ( grep /^\s+/m, @text ) { return $text; } my @lines = split /\n/, $text; $indent2 =~ s!^((?: {8})+)!"\t" x (length($1)/8)!e; $lines[0] =~ s/^$indent1\s+/$indent1/; s/^$indent2\s+/$indent2/ for @lines[1..$#lines]; my $newtext = join "\n", @lines; $newtext .= "\n" if substr($text, -1) eq "\n"; return $newtext; } # Fills up a ChangeLog structure in the current directory. sub derive_change_log () { # See "The Plan" above for a full explanation. my %grand_poobah; my $file_full_path; my $time; my $revision; my $author; my $state; my $lines; my $cvsstate; my $msg_txt; my $detected_file_separator; my %tag_date_printed; # Might be adding to an existing ChangeLog my $accumulation_date = &maybe_grab_accumulation_date (); if ($accumulation_date) { # Insert -d immediately after 'cvs log' my $Log_Date_Command = "-d\'>${accumulation_date}\'"; $Log_Source_Command =~ s/(^.*log\S*)/$1 $Log_Date_Command/; &debug ("(adding log msg starting from $accumulation_date)\n"); } # We might be expanding usernames my %usermap; # In general, it's probably not very maintainable to use state # variables like this to tell the loop what it's doing at any given # moment, but this is only the first one, and if we never have more # than a few of these, it's okay. my $collecting_symbolic_names = 0; my %symbolic_names; # Where tag names get stored. my %branch_names; # We'll grab branch names while we're at it. my %branch_numbers; # Save some revisions for @Follow_Branches my @branch_roots; # For showing which files are branch ancestors. # Bleargh. Compensate for a deficiency of custom wrapping. if (($After_Header ne " ") and $FSF_Style) { $After_Header .= "\t"; } if (! $Input_From_Stdin) { &debug ("(run \"${Log_Source_Command}\")\n"); open (LOG_SOURCE, "$Log_Source_Command |") or die "unable to run \"${Log_Source_Command}\""; } else { open (LOG_SOURCE, "-") or die "unable to open stdin for reading"; } binmode LOG_SOURCE; %usermap = &maybe_read_user_map_file (); while () { # Canonicalize line endings s/\r$//; my $new_full_path; # If on a new file and don't see filename, skip until we find it, and # when we find it, grab it. if (! (defined $file_full_path)) { if (/^Working file: (.*)/) { $new_full_path = $1; } elsif ($RCS_Mode && m|^RCS file: $RCS_Root[/\\](.*),v$|) { $new_full_path = $1; } } if (defined $new_full_path) { $file_full_path = $new_full_path; if (@Ignore_Files) { my $base; ($base, undef, undef) = fileparse ($file_full_path); # Ouch, I wish trailing operators in regexps could be # evaluated on the fly! if ($Case_Insensitive) { if (grep ($file_full_path =~ m|$_|i, @Ignore_Files)) { undef $file_full_path; } } elsif (grep ($file_full_path =~ m|$_|, @Ignore_Files)) { undef $file_full_path; } } next; } # Just spin wheels if no file defined yet. next if (! $file_full_path); # Collect tag names in case we're asked to print them in the output. if (/^symbolic names:$/) { $collecting_symbolic_names = 1; next; # There's no more info on this line, so skip to next } if ($collecting_symbolic_names) { # All tag names are listed with whitespace in front in cvs log # output; so if see non-whitespace, then we're done collecting. if (/^\S/) { $collecting_symbolic_names = 0; } else # we're looking at a tag name, so parse & store it { # According to the Cederqvist manual, in node "Tags", tag # names must start with an uppercase or lowercase letter and # can contain uppercase and lowercase letters, digits, `-', # and `_'. However, it's not our place to enforce that, so # we'll allow anything CVS hands us to be a tag: /^\s+([^:]+): ([\d.]+)$/; my $tag_name = $1; my $tag_rev = $2; # A branch number either has an odd number of digit sections # (and hence an even number of dots), or has ".0." as the # second-to-last digit section. Test for these conditions. my $real_branch_rev = ""; if (($tag_rev =~ /^(\d+\.\d+\.)+\d+$/) # Even number of dots... and (! ($tag_rev =~ /^(1\.)+1$/))) # ...but not "1.[1.]1" { $real_branch_rev = $tag_rev; } elsif ($tag_rev =~ /(\d+\.(\d+\.)+)0.(\d+)/) # Has ".0." { $real_branch_rev = $1 . $3; } # If we got a branch, record its number. if ($real_branch_rev) { $branch_names{$real_branch_rev} = $tag_name; if (@Follow_Branches) { if (grep ($_ eq $tag_name, @Follow_Branches)) { $branch_numbers{$tag_name} = $real_branch_rev; } } } else { # Else it's just a regular (non-branch) tag. push (@{$symbolic_names{$tag_rev}}, $tag_name); } } } # End of code for collecting tag names. # If have file name, but not revision, and see revision, then grab # it. (We collect unconditionally, even though we may or may not # ever use it.) if ((! (defined $revision)) and (/^revision (\d+\.[\d.]+)/)) { $revision = $1; if (@Follow_Branches) { foreach my $branch (@Follow_Branches) { # Special case for following trunk revisions if (($branch =~ /^trunk$/i) and ($revision =~ /^[0-9]+\.[0-9]+$/)) { goto dengo; } my $branch_number = $branch_numbers{$branch}; if ($branch_number) { # Are we on one of the follow branches or an ancestor of # same? # # If this revision is a prefix of the branch number, or # possibly is less in the minormost number, OR if this # branch number is a prefix of the revision, then yes. # Otherwise, no. # # So below, we determine if any of those conditions are # met. # Trivial case: is this revision on the branch? # (Compare this way to avoid regexps that screw up Emacs # indentation, argh.) if ((substr ($revision, 0, ((length ($branch_number)) + 1))) eq ($branch_number . ".")) { goto dengo; } # Non-trivial case: check if rev is ancestral to branch elsif ((length ($branch_number)) > (length ($revision)) and $No_Ancestors) { $revision =~ /^((?:\d+\.)+)(\d+)$/; my $r_left = $1; # still has the trailing "." my $r_end = $2; $branch_number =~ /^((?:\d+\.)+)(\d+)\.\d+$/; my $b_left = $1; # still has trailing "." my $b_mid = $2; # has no trailing "." if (($r_left eq $b_left) && ($r_end <= $b_mid)) { goto dengo; } } } } } else # (! @Follow_Branches) { next; } # Else we are following branches, but this revision isn't on the # path. So skip it. undef $revision; dengo: next; } # If we don't have a revision right now, we couldn't possibly # be looking at anything useful. if (! (defined ($revision))) { $detected_file_separator = /^$file_separator$/o; if ($detected_file_separator) { # No revisions for this file; can happen, e.g. "cvs log -d DATE" goto CLEAR; } else { next; } } # If have file name but not date and author, and see date or # author, then grab them: unless (defined $time) { if (/^date: .*/) { ($time, $author, $state, $lines) = &parse_date_author_and_state ($_); if (defined ($usermap{$author}) and $usermap{$author}) { $author = $usermap{$author}; } elsif(defined $Domain or $Gecos == 1) { my $email = $author; if(defined $Domain && $Domain ne '') { $email = $author."@".$Domain; } my $pw = getpwnam($author); my $fullname; my $office; my $workphone; my $homephone; for (($fullname, $office, $workphone, $homephone) = split /\s*,\s*/, $pw->gecos) { s/&/ucfirst(lc($pw->name))/ge; } if($fullname ne "") { $author = $fullname . " <" . $email . ">"; } } } else { $detected_file_separator = /^$file_separator$/o; if ($detected_file_separator) { # No revisions for this file; can happen, e.g. "cvs log -d DATE" goto CLEAR; } } # If the date/time/author hasn't been found yet, we couldn't # possibly care about anything we see. So skip: next; } # A "branches: ..." line here indicates that one or more branches # are rooted at this revision. If we're showing branches, then we # want to show that fact as well, so we collect all the branches # that this is the latest ancestor of and store them in # @branch_roots. Just for reference, the format of the line we're # seeing at this point is: # # branches: 1.5.2; 1.5.4; ...; # # Okay, here goes: if (/^branches:\s+(.*);$/) { if ($Show_Branches) { my $lst = $1; $lst =~ s/(1\.)+1;|(1\.)+1$//; # ignore the trivial branch 1.1.1 if ($lst) { @branch_roots = split (/;\s+/, $lst); } else { undef @branch_roots; } next; } else { # Ugh. This really bothers me. Suppose we see a log entry # like this: # # ---------------------------- # revision 1.1 # date: 1999/10/17 03:07:38; author: jrandom; state: Exp; # branches: 1.1.2; # Intended first line of log message begins here. # ---------------------------- # # The question is, how we can tell the difference between that # log message and a *two*-line log message whose first line is # # "branches: 1.1.2;" # # See the problem? The output of "cvs log" is inherently # ambiguous. # # For now, we punt: we liberally assume that people don't # write log messages like that, and just toss a "branches:" # line if we see it but are not showing branches. I hope no # one ever loses real log data because of this. next; } } # If have file name, time, and author, then we're just grabbing # log message texts: $detected_file_separator = /^$file_separator$/o; if ($detected_file_separator && ! (defined $revision)) { # No revisions for this file; can happen, e.g. "cvs log -d DATE" goto CLEAR; } unless ($detected_file_separator || /^$logmsg_separator$/o) { $msg_txt .= $_; # Normally, just accumulate the message... next; } # ... until a msg separator is encountered: # Ensure the message contains something: if ((! $msg_txt) || ($msg_txt =~ /^\s*\.\s*$|^\s*$/) || ($msg_txt =~ /\*\*\* empty log message \*\*\*/)) { if ($Prune_Empty_Msgs) { goto CLEAR; } # else $msg_txt = "[no log message]\n"; } ### Store it all in the Grand Poobah: { my $dir_key; # key into %grand_poobah my %qunk; # complicated little jobbie, see below # Each revision of a file has a little data structure (a `qunk') # associated with it. That data structure holds not only the # file's name, but any additional information about the file # that might be needed in the output, such as the revision # number, tags, branches, etc. The reason to have these things # arranged in a data structure, instead of just appending them # textually to the file's name, is that we may want to do a # little rearranging later as we write the output. For example, # all the files on a given tag/branch will go together, followed # by the tag in parentheses (so trunk or otherwise non-tagged # files would go at the end of the file list for a given log # message). This rearrangement is a lot easier to do if we # don't have to reparse the text. # # A qunk looks like this: # # { # filename => "hello.c", # revision => "1.4.3.2", # time => a timegm() return value (moment of commit) # tags => [ "tag1", "tag2", ... ], # branch => "branchname" # There should be only one, right? # branchroots => [ "branchtag1", "branchtag2", ... ] # } if ($Distributed) { # Just the basename, don't include the path. ($qunk{'filename'}, $dir_key, undef) = fileparse ($file_full_path); } else { $dir_key = "./"; $qunk{'filename'} = $file_full_path; } # This may someday be used in a more sophisticated calculation # of what other files are involved in this commit. For now, we # don't use it much except for delta mode, because the # common-commit-detection algorithm is hypothesized to be # "good enough" as it stands. $qunk{'time'} = $time; # We might be including revision numbers and/or tags and/or # branch names in the output. Most of the code from here to # loop-end deals with organizing these in qunk. $qunk{'revision'} = $revision; $qunk{'state'} = $state; if ( defined( $lines )) { $qunk{'lines'} = $lines; } # Grab the branch, even though we may or may not need it: $qunk{'revision'} =~ /((?:\d+\.)+)\d+/; my $branch_prefix = $1; $branch_prefix =~ s/\.$//; # strip off final dot if ($branch_names{$branch_prefix}) { $qunk{'branch'} = $branch_names{$branch_prefix}; } # Keep a record of the file's cvs state. $qunk{'cvsstate'} = $state; # If there's anything in the @branch_roots array, then this # revision is the root of at least one branch. We'll display # them as branch names instead of revision numbers, the # substitution for which is done directly in the array: if (@branch_roots) { my @roots = map { $branch_names{$_} } @branch_roots; $qunk{'branchroots'} = \@roots; } # Save tags too. if (defined ($symbolic_names{$revision})) { $qunk{'tags'} = $symbolic_names{$revision}; delete $symbolic_names{$revision}; # If we're in 'delta' mode, update the latest observed # times for the beginning and ending tags, and # when we get around to printing output, we will simply restrict # ourselves to that timeframe... if ($Delta_Mode) { if (($time > $Delta_StartTime) && (grep { $_ eq $Delta_From } @{$qunk{'tags'}})) { $Delta_StartTime = $time; } if (($time > $Delta_EndTime) && (grep { $_ eq $Delta_To } @{$qunk{'tags'}})) { $Delta_EndTime = $time; } } } unless ($Hide_Branch_Additions and $msg_txt =~ /file \S+ was initially added on branch \S+./) { # Add this file to the list # (We use many spoonfuls of autovivication magic. Hashes and arrays # will spring into existence if they aren't there already.) &debug ("(pushing log msg for ${dir_key}$qunk{'filename'})\n"); # Store with the files in this commit. Later we'll loop through # again, making sure that revisions with the same log message # and nearby commit times are grouped together as one commit. push (@{$grand_poobah{$dir_key}{$author}{$time}{$msg_txt}}, \%qunk); } } CLEAR: # Make way for the next message undef $msg_txt; undef $time; undef $revision; undef $author; undef @branch_roots; # Maybe even make way for the next file: if ($detected_file_separator) { undef $file_full_path; undef %branch_names; undef %branch_numbers; undef %symbolic_names; } } close (LOG_SOURCE); ### Process each ChangeLog while (my ($dir,$authorhash) = each %grand_poobah) { &debug ("DOING DIR: $dir\n"); # Here we twist our hash around, from being # author => time => message => filelist # in %$authorhash to # time => author => message => filelist # in %changelog. # # This is also where we merge entries. The algorithm proceeds # through the timeline of the changelog with a sliding window of # $Max_Checkin_Duration seconds; within that window, entries that # have the same log message are merged. # # (To save space, we zap %$authorhash after we've copied # everything out of it.) my %changelog; while (my ($author,$timehash) = each %$authorhash) { my $lasttime; my %stamptime; foreach my $time (sort {$main::a <=> $main::b} (keys %$timehash)) { my $msghash = $timehash->{$time}; while (my ($msg,$qunklist) = each %$msghash) { my $stamptime = $stamptime{$msg}; if ((defined $stamptime) and (($time - $stamptime) < $Max_Checkin_Duration) and (defined $changelog{$stamptime}{$author}{$msg})) { push(@{$changelog{$stamptime}{$author}{$msg}}, @$qunklist); } else { $changelog{$time}{$author}{$msg} = $qunklist; $stamptime{$msg} = $time; } } } } undef (%$authorhash); ### Now we can write out the ChangeLog! my ($logfile_here, $logfile_bak, $tmpfile); if (! $Output_To_Stdout) { $logfile_here = $dir . $Log_File_Name; $logfile_here =~ s/^\.\/\//\//; # fix any leading ".//" problem $tmpfile = "${logfile_here}.cvs2cl$$.tmp"; $logfile_bak = "${logfile_here}.bak"; open (LOG_OUT, ">$tmpfile") or die "Unable to open \"$tmpfile\""; } else { open (LOG_OUT, ">-") or die "Unable to open stdout for writing"; } print LOG_OUT $ChangeLog_Header; if ($XML_Output) { my $encoding = length $XML_Encoding ? qq'encoding="$XML_Encoding"' : ''; my $version = 'version="1.0"'; my $declaration = sprintf '', join ' ', grep length, $version, $encoding; my $root = $No_XML_Namespace ? '' : ''; print LOG_OUT "$declaration\n\n$root\n\n"; } my @key_list = (); if($Chronological_Order) { @key_list = sort {$main::a <=> $main::b} (keys %changelog); } else { @key_list = sort {$main::b <=> $main::a} (keys %changelog); } my $last_header_line = "nothing really"; my $last_body = "nothing really"; foreach my $time (@key_list) { next if ($Delta_Mode && (($time <= $Delta_StartTime) || ($time > $Delta_EndTime && $Delta_EndTime))); # Set up the date/author line. # kff todo: do some more XML munging here, on the header # part of the entry: my ($ignore,$min,$hour,$mday,$mon,$year,$wday) = $UTC_Times ? gmtime($time) : localtime($time); # XML output includes everything else, we might as well make # it always include Day Of Week too, for consistency. if ($Show_Day_Of_Week or $XML_Output) { $wday = ("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday")[$wday]; $wday = ($XML_Output) ? "${wday}\n" : " $wday"; } else { $wday = ""; } my $authorhash = $changelog{$time}; if ($Show_Tag_Dates) { my %tags; while (my ($author,$mesghash) = each %$authorhash) { while (my ($msg,$qunk) = each %$mesghash) { foreach my $qunkref2 (@$qunk) { if (defined ($$qunkref2{'tags'})) { foreach my $tag (@{$$qunkref2{'tags'}}) { $tags{$tag} = 1; } } } } } # Sort here for determinism to ease testing foreach my $tag (sort keys %tags) { if (!defined $tag_date_printed{$tag}) { $tag_date_printed{$tag} = $time; if ($XML_Output) { # NOT YET DONE } else { if ($Show_Times) { printf LOG_OUT ("%4u-%02u-%02u${wday} %02u:%02u tag %s\n\n", $year+1900, $mon+1, $mday, $hour, $min, $tag); } else { printf LOG_OUT ("%4u-%02u-%02u${wday} tag %s\n\n", $year+1900, $mon+1, $mday, $tag); } } } } } while (my ($author,$mesghash) = each %$authorhash) { # If XML, escape in outer loop to avoid compound quoting: if ($XML_Output) { $author = &xml_escape ($author); } FOOBIE: # We sort here to enable predictable ordering for the testing porpoises for my $msg (sort keys %$mesghash) { my $qunklist = $mesghash->{$msg}; ## MJP: 19.xii.01 : Exclude @ignore_tags for my $ignore_tag (keys %ignore_tags) { next FOOBIE if grep($_ eq $ignore_tag, map(@{$_->{tags}}, grep(defined $_->{tags}, @$qunklist))); } ## MJP: 19.xii.01 : End exclude @ignore_tags # show only files with tag --show-tag $show_tag if ( keys %show_tags ) { next FOOBIE if !grep(exists $show_tags{$_}, map(@{$_->{tags}}, grep(defined $_->{tags}, @$qunklist))); } my $files = &pretty_file_list ($qunklist); my $header_line; # date and author my $body; # see below my $wholething; # $header_line + $body if( $author eq "sashav" ) { $author = "sasha"; } if ($XML_Output) { $header_line = sprintf ("%4u-%02u-%02u\n" . "${wday}" . "\n" . "%s\n", $year+1900, $mon+1, $mday, $hour, $min, $author); } else { if ($Show_Times) { $header_line = sprintf ("%4u-%02u-%02u${wday} %02u:%02u %s\n\n", $year+1900, $mon+1, $mday, $hour, $min, $author); } else { $header_line = sprintf ("%4u-%02u-%02u${wday} %s\n\n", $year+1900, $mon+1, $mday, $author); } } # print ("1>$header_line<" . "\n1>$last_header_line<") ; if( "$last_header_line" eq "$header_line" ) { $header_line = ""; }else { $last_header_line = $header_line; } # print ("2>$header_line<" . "\n2>$last_header_line<") ; $Text::Wrap::huge = 'overflow' if $Text::Wrap::VERSION >= 2001.0130; # Reshape the body according to user preferences. if ($XML_Output) { $msg = &preprocess_msg_text ($msg); $body = $files . $msg; } elsif ($No_Wrap && !$Summary) { $msg = &preprocess_msg_text ($msg); $files = mywrap ("\t", "\t ", "* $files"); $msg =~ s/\n(.+)/\n\t$1/g; unless ($After_Header eq " ") { $msg =~ s/^(.+)/\t$1/g; } $body = $files . $After_Header . $msg; } elsif ($Summary) { my( $filelist, $qunk ); my( @DeletedQunks, @AddedQunks, @ChangedQunks ); $msg = &preprocess_msg_text ($msg); # # Sort the files (qunks) according to the operation that was # performed. Files which were added have no line change # indicator, whereas deleted files have state dead. # foreach $qunk ( @$qunklist ) { if ( "dead" eq $qunk->{'state'}) { push( @DeletedQunks, $qunk ); } elsif ( !exists( $qunk->{'lines'})) { push( @AddedQunks, $qunk ); } else { push( @ChangedQunks, $qunk ); } } # # The qunks list was originally in tree search order. Let's # get that back. The lists, if they exist, will be reversed upon # processing. # # # Now write the three sections onto $filelist # if ( @DeletedQunks ) { $filelist .= "\tDeleted:\n"; foreach $qunk ( @DeletedQunks ) { $filelist .= "\t\t" . $qunk->{'filename'}; $filelist .= " (" . $qunk->{'revision'} . ")"; $filelist .= "\n"; } undef( @DeletedQunks ); } if ( @AddedQunks ) { $filelist .= "\tAdded:\n"; foreach $qunk ( @AddedQunks ) { $filelist .= "\t\t" . $qunk->{'filename'}; $filelist .= " (" . $qunk->{'revision'} . ")"; $filelist .= "\n"; } undef( @AddedQunks ); } if ( @ChangedQunks ) { $filelist .= "\tChanged:\n"; foreach $qunk ( @ChangedQunks ) { $filelist .= "\t\t" . $qunk->{'filename'}; $filelist .= " (" . $qunk->{'revision'} . ")"; $filelist .= ", \"" . $qunk->{'state'} . "\""; $filelist .= ", lines: " . $qunk->{'lines'}; $filelist .= "\n"; } undef( @ChangedQunks ); } chomp( $filelist ); $msg =~ s/\n(.*)/\n\t$1/g; unless ($After_Header eq " ") { $msg =~ s/^(.*)/\t$1/g; } $body = $filelist . $After_Header . $msg; } else # do wrapping, either FSF-style or regular { if ($FSF_Style) { $files = mywrap ("\t", "\t", "* $files"); my $files_last_line_len = 0; if ($After_Header eq " ") { $files_last_line_len = &last_line_len ($files); $files_last_line_len += 1; # for $After_Header } $msg = &wrap_log_entry ($msg, "\t", 69 - $files_last_line_len, 69); $body = $files . $After_Header . $msg; } else # not FSF-style { $msg = &preprocess_msg_text ($msg); $body = $files . $After_Header . $msg; $body = mywrap ("\t", "\t ", "* $body"); $body =~ s/[ \t]+\n/\n/g; } } $body =~ s/[ \t]+\n/\n/g; if( $last_body eq $body && $header_line eq "" ) { $body = "" ; }else { $last_body = $body ; } $wholething = $header_line . $body; if ($XML_Output) { $wholething = "\n${wholething}\n"; } # One last check: make sure it passes the regexp test, if the # user asked for that. We have to do it here, so that the # test can match against information in the header as well # as in the text of the log message. # How annoying to duplicate so much code just because I # can't figure out a way to evaluate scalars on the trailing # operator portion of a regular expression. Grrr. if( !($header_line eq "") ) { print LOG_OUT "\n"; } if ($Case_Insensitive) { unless ($Regexp_Gate && ($wholething !~ /$Regexp_Gate/oi)) { print LOG_OUT "${wholething}"; } } else { unless ($Regexp_Gate && ($wholething !~ /$Regexp_Gate/o)) { print LOG_OUT "${wholething}"; } } } } } if ($XML_Output) { print LOG_OUT "\n"; } close (LOG_OUT); if (! $Output_To_Stdout) { # If accumulating, append old data to new before renaming. But # don't append the most recent entry, since it's already in the # new log due to CVS's idiosyncratic interpretation of "log -d". if ($Cumulative && -f $logfile_here) { open (NEW_LOG, ">>$tmpfile") or die "trouble appending to $tmpfile ($!)"; open (OLD_LOG, "<$logfile_here") or die "trouble reading from $logfile_here ($!)"; my $started_first_entry = 0; my $passed_first_entry = 0; while () { if (! $passed_first_entry) { if ((! $started_first_entry) && /^(\d\d\d\d-\d\d-\d\d\s+\d\d:\d\d)/) { $started_first_entry = 1; } elsif (/^(\d\d\d\d-\d\d-\d\d\s+\d\d:\d\d)/) { $passed_first_entry = 1; print NEW_LOG $_; } } else { print NEW_LOG $_; } } close (NEW_LOG); close (OLD_LOG); } if (-f $logfile_here) { rename ($logfile_here, $logfile_bak); } rename ($tmpfile, $logfile_here); } } } sub parse_date_author_and_state () { # Parses the date/time and author out of a line like: # # date: 1999/02/19 23:29:05; author: apharris; state: Exp; # -- or -- # date: 2004-08-30 17:24:30 -0400; author: sasha; state: dead; lines: +0 -0 # my $line = shift; my ($year, $mon, $mday, $hours, $min, $secs, $timezone, $author, $state, $rest) = $line =~ m#(\d+)[/\-](\d+)[\-/](\d+)\s+(\d+):(\d+):(\d+)\s+([\-\+]\d+)?;\s+author:\s+([^;]+);\s+state:\s+([^;]+);(.*)# or die "Couldn't parse date ``$line''"; die "Bad date or Y2K issues" unless ($year > 1969 and $year < 2258); # Kinda arbitrary, but useful as a sanity check my $time = timegm($secs,$min,$hours,$mday,$mon-1,$year-1900); my $lines; if ( $rest =~ m#\s+lines:\s+(.*)# ) { $lines =$1; } return ($time, $author, $state, $lines); } # Here we take a bunch of qunks and convert them into printed # summary that will include all the information the user asked for. sub pretty_file_list () { if ($Hide_Filenames and (! $XML_Output)) { return ""; } my $qunksref = shift; my @qunkrefs = grep +((! exists $_->{'tags'} or ! grep exists $ignore_tags{$_}, @{$_->{'tags'}}) and (! keys %show_tags or (exists $_->{'tags'} and grep exists $show_tags{$_}, @{$_->{'tags'}})) ), @$qunksref; my @filenames; my $beauty = ""; # The accumulating header string for this entry. my %non_unanimous_tags; # Tags found in a proper subset of qunks my %unanimous_tags; # Tags found in all qunks my %all_branches; # Branches found in any qunk my $common_dir = undef; # Dir prefix common to all files ("" if none) my $fbegun = 0; # Did we begin printing filenames yet? # First, loop over the qunks gathering all the tag/branch names. # We'll put them all in non_unanimous_tags, and take out the # unanimous ones later. QUNKREF: foreach my $qunkref (@qunkrefs) { # Keep track of whether all the files in this commit were in the # same directory, and memorize it if so. We can make the output a # little more compact by mentioning the directory only once. if ($Common_Dir && (scalar (@qunkrefs)) > 1) { if (! (defined ($common_dir))) { my ($base, $dir); ($base, $dir, undef) = fileparse ($$qunkref{'filename'}); if ((! (defined ($dir))) # this first case is sheer paranoia or ($dir eq "") or ($dir eq "./") or ($dir eq ".\\")) { $common_dir = ""; } else { $common_dir = $dir; } } elsif ($common_dir ne "") { # Already have a common dir prefix, so how much of it can we preserve? $common_dir = &common_path_prefix ($$qunkref{'filename'}, $common_dir); } } else # only one file in this entry anyway, so common dir not an issue { $common_dir = ""; } if (defined ($$qunkref{'branch'})) { $all_branches{$$qunkref{'branch'}} = 1; } if (defined ($$qunkref{'tags'})) { foreach my $tag (@{$$qunkref{'tags'}}) { $non_unanimous_tags{$tag} = 1; } } } # Any tag held by all qunks will be printed specially... but only if # there are multiple qunks in the first place! if ((scalar (@qunkrefs)) > 1) { foreach my $tag (keys (%non_unanimous_tags)) { my $everyone_has_this_tag = 1; foreach my $qunkref (@qunkrefs) { if ((! (defined ($$qunkref{'tags'}))) or (! (grep ($_ eq $tag, @{$$qunkref{'tags'}})))) { $everyone_has_this_tag = 0; } } if ($everyone_has_this_tag) { $unanimous_tags{$tag} = 1; delete $non_unanimous_tags{$tag}; } } } if ($XML_Output) { # If outputting XML, then our task is pretty simple, because we # don't have to detect common dir, common tags, branch prefixing, # etc. We just output exactly what we have, and don't worry about # redundancy or readability. foreach my $qunkref (@qunkrefs) { my $filename = $$qunkref{'filename'}; my $cvsstate = $$qunkref{'cvsstate'}; my $revision = $$qunkref{'revision'}; my $tags = $$qunkref{'tags'}; my $branch = $$qunkref{'branch'}; my $branchroots = $$qunkref{'branchroots'}; $filename = &xml_escape ($filename); # probably paranoia $revision = &xml_escape ($revision); # definitely paranoia $beauty .= "\n"; $beauty .= "${filename}\n"; $beauty .= "${cvsstate}\n"; $beauty .= "${revision}\n"; if ($branch) { $branch = &xml_escape ($branch); # more paranoia $beauty .= "${branch}\n"; } foreach my $tag (@$tags) { $tag = &xml_escape ($tag); # by now you're used to the paranoia $beauty .= "${tag}\n"; } foreach my $root (@$branchroots) { $root = &xml_escape ($root); # which is good, because it will continue $beauty .= "${root}\n"; } $beauty .= "\n"; } # Theoretically, we could go home now. But as long as we're here, # let's print out the common_dir and utags, as a convenience to # the receiver (after all, earlier code calculated that stuff # anyway, so we might as well take advantage of it). if ((scalar (keys (%unanimous_tags))) > 1) { foreach my $utag ((keys (%unanimous_tags))) { $utag = &xml_escape ($utag); # the usual paranoia $beauty .= "${utag}\n"; } } if ($common_dir) { $common_dir = &xml_escape ($common_dir); $beauty .= "${common_dir}\n"; } # That's enough for XML, time to go home: return $beauty; } # Else not XML output, so complexly compactify for chordate # consumption. At this point we have enough global information # about all the qunks to organize them non-redundantly for output. if ($common_dir) { # Note that $common_dir still has its trailing slash $beauty .= "$common_dir: "; } if ($Show_Branches) { # For trailing revision numbers. my @brevisions; foreach my $branch (keys (%all_branches)) { foreach my $qunkref (@qunkrefs) { if ((defined ($$qunkref{'branch'})) and ($$qunkref{'branch'} eq $branch)) { if ($fbegun) { # kff todo: comma-delimited in XML too? Sure. $beauty .= ", "; } else { $fbegun = 1; } my $fname = substr ($$qunkref{'filename'}, length ($common_dir)); $beauty .= $fname; $$qunkref{'printed'} = 1; # Just setting a mark bit, basically if ($Show_Tags && (defined @{$$qunkref{'tags'}})) { my @tags = grep ($non_unanimous_tags{$_}, @{$$qunkref{'tags'}}); if (@tags) { $beauty .= " (tags: "; $beauty .= join (', ', @tags); $beauty .= ")"; } } if ($Show_Revisions) { # Collect the revision numbers' last components, but don't # print them -- they'll get printed with the branch name # later. $$qunkref{'revision'} =~ /.+\.([\d]+)$/; push (@brevisions, $1); # todo: we're still collecting branch roots, but we're not # showing them anywhere. If we do show them, it would be # nifty to just call them revision "0" on a the branch. # Yeah, that's the ticket. } } } $beauty .= " ($branch"; if (@brevisions) { if ((scalar (@brevisions)) > 1) { $beauty .= ".["; $beauty .= (join (',', @brevisions)); $beauty .= "]"; } else { # Square brackets are spurious here, since there's no range to # encapsulate $beauty .= ".$brevisions[0]"; } } $beauty .= ")"; } } # Okay; any qunks that were done according to branch are taken care # of, and marked as printed. Now print everyone else. my %fileinfo_printed; foreach my $qunkref (@qunkrefs) { next if (defined ($$qunkref{'printed'})); # skip if already printed my $b = substr ($$qunkref{'filename'}, length ($common_dir)); # todo: Shlomo's change was this: # $beauty .= substr ($$qunkref{'filename'}, # (($common_dir eq "./") ? "" : length ($common_dir))); $$qunkref{'printed'} = 1; # Set a mark bit. if ($Show_Revisions || $Show_Tags || $Show_Dead) { my $started_addendum = 0; if ($Show_Revisions) { $started_addendum = 1; $b .= " ("; $b .= "$$qunkref{'revision'}"; } if ($Show_Dead && $$qunkref{'cvsstate'} =~ /dead/) { # Deliberately not using $started_addendum. Keeping it simple. $b .= "[DEAD]"; } if ($Show_Tags && (defined $$qunkref{'tags'})) { my @tags = grep ($non_unanimous_tags{$_}, @{$$qunkref{'tags'}}); if ((scalar (@tags)) > 0) { if ($started_addendum) { $b .= ", "; } else { $b .= " (tags: "; } $b .= join (', ', @tags); $started_addendum = 1; } } if ($started_addendum) { $b .= ")"; } } unless ( exists $fileinfo_printed{$b} ) { if ($fbegun) { $beauty .= ", "; } else { $fbegun = 1; } $beauty .= $b, $fileinfo_printed{$b} = 1; } } # Unanimous tags always come last. if ($Show_Tags && %unanimous_tags) { $beauty .= " (utags: "; $beauty .= join (', ', sort keys (%unanimous_tags)); $beauty .= ")"; } # todo: still have to take care of branch_roots? $beauty = "$beauty:"; return $beauty; } sub min ($$) { $_[0] < $_[1] ? $_[0] : $_[1] } sub common_path_prefix ($$) { my ($path1, $path2) = @_; # For compatibility (with older versions of cvs2cl.pl), we think in UN*X # terms, and mould windoze filenames to match. Is this really appropriate? # If a file is checked in under UN*X, and cvs log run on windoze, which way # do the path separators slope? Can we use fileparse as per the local # conventions? If so, we should probably have a user option to specify an # OS to emulate to handle stdin-fed logs. If we did this, we could avoid # the nasty \-/ transmogrification below. my ($dir1, $dir2) = map +(fileparse($_))[1], $path1, $path2; # Transmogrify Windows filenames to look like Unix. # (It is far more likely that someone is running cvs2cl.pl under # Windows than that they would genuinely have backslashes in their # filenames.) tr!\\!/! for $dir1, $dir2; my ($accum1, $accum2, $last_common_prefix) = ('') x 3; my @path1 = grep length($_), split qr!/!, $dir1; my @path2 = grep length($_), split qr!/!, $dir2; my @common_path; for (0..min($#path1,$#path2)) { if ( $path1[$_] eq $path2[$_]) { push @common_path, $path1[$_]; } else { last; } } return join '', map "$_/", @common_path; } sub preprocess_msg_text () { my $text = shift; # Strip out carriage returns (as they probably result from DOSsy editors). $text =~ s/\r\n/\n/g; # If it *looks* like two newlines, make it *be* two newlines: $text =~ s/\n\s*\n/\n\n/g; if ($XML_Output) { $text = &xml_escape ($text); chomp $text; $text = "${text}\n"; } elsif (! $No_Wrap) { # Strip off lone newlines, but only for lines that don't begin with # whitespace or a mail-quoting character, since we want to preserve # that kind of formatting. Also don't strip newlines that follow a # period; we handle those specially next. And don't strip # newlines that precede an open paren. 1 while ($text =~ s/(^|\n)([^>\s].*[^.\n])\n([^>\n])/$1$2 $3/g); # If a newline follows a period, make sure that when we bring up the # bottom sentence, it begins with two spaces. 1 while ($text =~ s/(^|\n)([^>\s].*)\n([^>\n])/$1$2 $3/g); } return $text; } sub last_line_len () { my $files_list = shift; my @lines = split (/\n/, $files_list); my $last_line = pop (@lines); return length ($last_line); } # A custom wrap function, sensitive to some common constructs used in # log entries. sub wrap_log_entry () { my $text = shift; # The text to wrap. my $left_pad_str = shift; # String to pad with on the left. # These do NOT take left_pad_str into account: my $length_remaining = shift; # Amount left on current line. my $max_line_length = shift; # Amount left for a blank line. my $wrapped_text = ""; # The accumulating wrapped entry. my $user_indent = ""; # Inherited user_indent from prev line. my $first_time = 1; # First iteration of the loop? my $suppress_line_start_match = 0; # Set to disable line start checks. my @lines = split (/\n/, $text); while (@lines) # Don't use `foreach' here, it won't work. { my $this_line = shift (@lines); chomp $this_line; if ($this_line =~ /^(\s+)/) { $user_indent = $1; } else { $user_indent = ""; } # If it matches any of the line-start regexps, print a newline now... if ($suppress_line_start_match) { $suppress_line_start_match = 0; } elsif (($this_line =~ /^(\s*)\*\s+[a-zA-Z0-9]/) || ($this_line =~ /^(\s*)\* [a-zA-Z0-9_\.\/\+-]+/) || ($this_line =~ /^(\s*)\([a-zA-Z0-9_\.\/\+-]+(\)|,\s*)/) || ($this_line =~ /^(\s+)(\S+)/) || ($this_line =~ /^(\s*)- +/) || ($this_line =~ /^()\s*$/) || ($this_line =~ /^(\s*)\*\) +/) || ($this_line =~ /^(\s*)[a-zA-Z0-9](\)|\.|\:) +/)) { # Make a line break immediately, unless header separator is set # and this line is the first line in the entry, in which case # we're getting the blank line for free already and shouldn't # add an extra one. unless (($After_Header ne " ") and ($first_time)) { if ($this_line =~ /^()\s*$/) { $suppress_line_start_match = 1; $wrapped_text .= "\n${left_pad_str}"; } $wrapped_text .= "\n${left_pad_str}"; } $length_remaining = $max_line_length - (length ($user_indent)); } # Now that any user_indent has been preserved, strip off leading # whitespace, so up-folding has no ugly side-effects. $this_line =~ s/^\s*//; # Accumulate the line, and adjust parameters for next line. my $this_len = length ($this_line); if ($this_len == 0) { # Blank lines should cancel any user_indent level. $user_indent = ""; $length_remaining = $max_line_length; } elsif ($this_len >= $length_remaining) # Line too long, try breaking it. { # Walk backwards from the end. At first acceptable spot, break # a new line. my $idx = $length_remaining - 1; if ($idx < 0) { $idx = 0 }; while ($idx > 0) { if (substr ($this_line, $idx, 1) =~ /\s/) { my $line_now = substr ($this_line, 0, $idx); my $next_line = substr ($this_line, $idx); $this_line = $line_now; # Clean whitespace off the end. chomp $this_line; # The current line is ready to be printed. $this_line .= "\n${left_pad_str}"; # Make sure the next line is allowed full room. $length_remaining = $max_line_length - (length ($user_indent)); # Strip next_line, but then preserve any user_indent. $next_line =~ s/^\s*//; # Sneak a peek at the user_indent of the upcoming line, so # $next_line (which will now precede it) can inherit that # indent level. Otherwise, use whatever user_indent level # we currently have, which might be none. my $next_next_line = shift (@lines); if ((defined ($next_next_line)) && ($next_next_line =~ /^(\s+)/)) { $next_line = $1 . $next_line if (defined ($1)); # $length_remaining = $max_line_length - (length ($1)); $next_next_line =~ s/^\s*//; } else { $next_line = $user_indent . $next_line; } if (defined ($next_next_line)) { unshift (@lines, $next_next_line); } unshift (@lines, $next_line); # Our new next line might, coincidentally, begin with one of # the line-start regexps, so we temporarily turn off # sensitivity to that until we're past the line. $suppress_line_start_match = 1; last; } else { $idx--; } } if ($idx == 0) { # We bottomed out because the line is longer than the # available space. But that could be because the space is # small, or because the line is longer than even the maximum # possible space. Handle both cases below. if ($length_remaining == ($max_line_length - (length ($user_indent)))) { # The line is simply too long -- there is no hope of ever # breaking it nicely, so just insert it verbatim, with # appropriate padding. $this_line = "\n${left_pad_str}${this_line}"; } else { # Can't break it here, but may be able to on the next round... unshift (@lines, $this_line); $length_remaining = $max_line_length - (length ($user_indent)); $this_line = "\n${left_pad_str}"; } } } else # $this_len < $length_remaining, so tack on what we can. { # Leave a note for the next iteration. $length_remaining = $length_remaining - $this_len; if ($this_line =~ /\.$/) { $this_line .= " "; $length_remaining -= 2; } else # not a sentence end { $this_line .= " "; $length_remaining -= 1; } } # Unconditionally indicate that loop has run at least once. $first_time = 0; $wrapped_text .= "${user_indent}${this_line}"; } # One last bit of padding. $wrapped_text .= "\n"; return $wrapped_text; } sub xml_escape () { my $txt = shift; $txt =~ s/&/&/g; $txt =~ s//>/g; return $txt; } sub maybe_read_user_map_file () { my %expansions; my $User_Map_Input; if ($User_Map_File) { if ( $User_Map_File =~ m{^([-\w\@+=.,\/]+):([-\w\@+=.,\/:]+)} and !-f $User_Map_File ) { my $rsh = (exists $ENV{'CVS_RSH'} ? $ENV{'CVS_RSH'} : 'ssh'); $User_Map_Input = "$rsh $1 'cat $2' |"; &debug ("(run \"${User_Map_Input}\")\n"); } else { $User_Map_Input = "<$User_Map_File"; } open (MAPFILE, $User_Map_Input) or die ("Unable to open $User_Map_File ($!)"); while () { next if /^\s*#/; # Skip comment lines. next if not /:/; # Skip lines without colons. # It is now safe to split on ':'. my ($username, $expansion) = split ':'; chomp $expansion; $expansion =~ s/^'(.*)'$/$1/; $expansion =~ s/^"(.*)"$/$1/; # If it looks like the expansion has a real name already, then # we toss the username we got from CVS log. Otherwise, keep # it to use in combination with the email address. if ($expansion =~ /^\s*<{0,1}\S+@.*/) { # Also, add angle brackets if none present if (! ($expansion =~ /<\S+@\S+>/)) { $expansions{$username} = "$username <$expansion>"; } else { $expansions{$username} = "$username $expansion"; } } else { $expansions{$username} = $expansion; } } # fi ($User_Map_File) close (MAPFILE); } if (defined $User_Passwd_File) { if ( ! defined $Domain ) { if ( -e MAILNAME ) { chomp($Domain = slurp_file(MAILNAME)); } else { MAILDOMAIN_CMD: for ([qw(hostname -d)], 'dnsdomainname', 'domainname') { my ($text, $exit, $sig, $core) = run_ext($_); if ( $exit == 0 && $sig == 0 && $core == 0 ) { chomp $text; if ( length $text ) { $Domain = $text; last MAILDOMAIN_CMD; } } } } } die "No mail domain found\n" unless defined $Domain; open (MAPFILE, "<$User_Passwd_File") or die ("Unable to open $User_Passwd_File ($!)"); while () { # all lines are valid my ($username, $pw, $uid, $gid, $gecos, $homedir, $shell) = split ':'; my $expansion = ''; ($expansion) = split (',', $gecos) if defined $gecos && length $gecos; my $mailname = $Domain eq '' ? $username : "$username\@$Domain"; $expansions{$username} = "$expansion <$mailname>"; } close (MAPFILE); } return %expansions; } sub parse_options () { # Check this internally before setting the global variable. my $output_file; # If this gets set, we encountered unknown options and will exit at # the end of this subroutine. my $exit_with_admonishment = 0; my (@Global_Opts, @Local_Opts); while (my $arg = shift (@ARGV)) { if ($arg =~ /^-h$|^-help$|^--help$|^--usage$|^-?$/) { $Print_Usage = 1; } elsif ($arg =~ /^--delta$/) { my $narg = shift(@ARGV) || die "$arg needs argument.\n"; if ($narg =~ /^([A-Za-z][A-Za-z0-9_\-]*):([A-Za-z][A-Za-z0-9_\-]*)$/) { $Delta_From = $1; $Delta_To = $2; $Delta_Mode = 1; } else { die "--delta FROM_TAG:TO_TAG is what you meant to say.\n"; } } elsif ($arg =~ /^--debug$/) { # unadvertised option, heh $Debug = 1; } elsif ($arg =~ /^--version$/) { $Print_Version = 1; } elsif ($arg =~ /^-g$|^--global-opts$/) { my $narg = shift (@ARGV) || die "$arg needs argument.\n"; # Don't assume CVS is called "cvs" on the user's system: push @Global_Opts, $narg; $Log_Source_Command =~ s/(^\S*)/$1 $narg/; } elsif ($arg =~ /^-l$|^--log-opts$/) { my $narg = shift (@ARGV) || die "$arg needs argument.\n"; push @Local_Opts, $narg; $Log_Source_Command .= " $narg"; } elsif ($arg =~ /^-f$|^--file$/) { my $narg = shift (@ARGV) || die "$arg needs argument.\n"; $output_file = $narg; } elsif ($arg =~ /^--accum$/) { $Cumulative = 1; } elsif ($arg =~ /^--update$/) { $Update = 1; } elsif ($arg =~ /^--fsf$/) { $FSF_Style = 1; } elsif ($arg =~ /^--FSF$/) { $Show_Times = 0; $Common_Dir = 0; } elsif ($arg =~ /^--rcs/) { my $narg = shift (@ARGV) || die "$arg needs argument.\n"; $RCS_Root = $narg; $RCS_Mode = 1; } elsif ($arg =~ /^-U$|^--usermap$/) { my $narg = shift (@ARGV) || die "$arg needs argument.\n"; $User_Map_File = $narg; } elsif ($arg =~ /^--gecos$/) { $Gecos = 1; } elsif ($arg =~ /^--domain$/) { my $narg = shift (@ARGV) || die "$arg needs argument.\n"; $Domain = $narg; } elsif ($arg =~ /^--passwd$/) { my $narg = shift (@ARGV) || die "$arg needs argument.\n"; $User_Passwd_File = $narg; } elsif ($arg =~ /^--mailname$/) { my $narg = shift (@ARGV) || die "$arg needs argument.\n"; warn "--mailname is deprecated; please use --domain instead\n"; $Domain = $narg; } elsif ($arg =~ /^-W$|^--window$/) { defined(my $narg = shift (@ARGV)) || die "$arg needs argument.\n"; $Max_Checkin_Duration = $narg; } elsif ($arg =~ /^--chrono$/) { $Chronological_Order = 1; } elsif ($arg =~ /^-I$|^--ignore$/) { my $narg = shift (@ARGV) || die "$arg needs argument.\n"; push (@Ignore_Files, $narg); } elsif ($arg =~ /^-C$|^--case-insensitive$/) { $Case_Insensitive = 1; } elsif ($arg =~ /^-R$|^--regexp$/) { my $narg = shift (@ARGV) || die "$arg needs argument.\n"; $Regexp_Gate = $narg; } elsif ($arg =~ /^--stdout$/) { $Output_To_Stdout = 1; } elsif ($arg =~ /^--version$/) { $Print_Version = 1; } elsif ($arg =~ /^-d$|^--distributed$/) { $Distributed = 1; } elsif ($arg =~ /^-P$|^--prune$/) { $Prune_Empty_Msgs = 1; } elsif ($arg =~ /^-S$|^--separate-header$/) { $After_Header = "\n\n"; } elsif ($arg =~ /^--no-wrap$/) { $No_Wrap = 1; } elsif ($arg =~ /^--summary$/) { $Summary = 1; $After_Header = "\n\n"; # Summary implies --separate-header } elsif ($arg =~ /^--gmt$|^--utc$/) { $UTC_Times = 1; } elsif ($arg =~ /^-w$|^--day-of-week$/) { $Show_Day_Of_Week = 1; } elsif ($arg =~ /^--no-times$/) { $Show_Times = 0; } elsif ($arg =~ /^-r$|^--revisions$/) { $Show_Revisions = 1; } elsif ($arg =~ /^--show-dead$/) { $Show_Dead = 1; } elsif ($arg =~ /^--no-hide-branch-additions$/) { $Hide_Branch_Additions = 0; } elsif ($arg =~ /^-t$|^--tags$/) { $Show_Tags = 1; } elsif ($arg =~ /^-T$|^--tagdates$/) { $Show_Tag_Dates = 1; } elsif ($arg =~ /^-b$|^--branches$/) { $Show_Branches = 1; } elsif ($arg =~ /^-F$|^--follow$/) { my $narg = shift (@ARGV) || die "$arg needs argument.\n"; push (@Follow_Branches, $narg); } elsif ($arg =~ /^--stdin$/) { $Input_From_Stdin = 1; } elsif ($arg =~ /^--header$/) { my $narg = shift (@ARGV) || die "$arg needs argument.\n"; $ChangeLog_Header = &slurp_file ($narg); if (! defined ($ChangeLog_Header)) { $ChangeLog_Header = ""; } } elsif ($arg =~ /^--xml-encoding$/) { my $narg = shift (@ARGV) || die "$arg needs argument.\n"; $XML_Encoding = $narg ; } elsif ($arg =~ /^--xml$/) { $XML_Output = 1; } elsif ($arg =~ /^--noxmlns$/) { $No_XML_Namespace = 1; } elsif ($arg =~ /^--hide-filenames$/) { $Hide_Filenames = 1; $After_Header = ""; } elsif ($arg =~ /^--no-common-dir$/) { $Common_Dir = 0; } elsif ($arg =~ /^--ignore-tag$/ ) { die "$arg needs argument.\n" unless @ARGV; $ignore_tags{shift @ARGV} = 1; } elsif ($arg =~ /^--show-tag$/ ) { die "$arg needs argument.\n" unless @ARGV; $show_tags{shift @ARGV} = 1; } elsif ( lc ($arg) eq '--test-code' ) { # Deliberately undocumented. This is not a public interface, # and may change/disappear at any time. die "$arg needs argument.\n" unless @ARGV; $TestCode = shift @ARGV; } elsif ($arg =~ /^--no-ancestors$/) { $No_Ancestors = 1; } else { # Just add a filename as argument to the log command $Log_Source_Command .= " '$arg'"; } } ## Check for contradictions... if ($Output_To_Stdout && $Distributed) { print STDERR "cannot pass both --stdout and --distributed\n"; $exit_with_admonishment = 1; } if ($Output_To_Stdout && $output_file) { print STDERR "cannot pass both --stdout and --file\n"; $exit_with_admonishment = 1; } if ($Input_From_Stdin && @Global_Opts) { print STDERR "cannot pass both --stdin and -g\n"; $exit_with_admonishment = 1; } if ($Input_From_Stdin && @Local_Opts) { print STDERR "cannot pass both --stdin and -l\n"; $exit_with_admonishment = 1; } if ($XML_Output && $Cumulative) { print STDERR "cannot pass both --xml and --accum\n"; $exit_with_admonishment = 1; } # Or if any other error message has already been printed out, we # just leave now: if ($exit_with_admonishment) { &usage (); exit (1); } elsif ($Print_Usage) { &usage (); exit (0); } elsif ($Print_Version) { &version (); exit (0); } ## Else no problems, so proceed. if ($output_file) { $Log_File_Name = $output_file; } } sub slurp_file () { my $filename = shift || die ("no filename passed to slurp_file()"); my $retstr; open (SLURPEE, "<${filename}") or die ("unable to open $filename ($!)"); my $saved_sep = $/; undef $/; $retstr = ; $/ = $saved_sep; close (SLURPEE); return $retstr; } sub debug () { if ($Debug) { my $msg = shift; print STDERR $msg; } } sub version () { print "cvs2cl.pl version ${VERSION}; distributed under the GNU GPL.\n"; } sub usage () { &version (); print <<'END_OF_INFO'; Generate GNU-style ChangeLogs in CVS working copies. Notes about the output format(s): The default output of cvs2cl.pl is designed to be compact, formally unambiguous, but still easy for humans to read. It is largely self-explanatory, I hope; the one abbreviation that might not be obvious is "utags". That stands for "universal tags" -- a universal tag is one held by all the files in a given change entry. If you need output that's easy for a program to parse, use the --xml option. Note that with XML output, just about all available information is included with each change entry, whether you asked for it or not, on the theory that your parser can ignore anything it's not looking for. Notes about the options and arguments (the actual options are listed last in this usage message): * The -I and -F options may appear multiple times. * To follow trunk revisions, use "-F trunk" ("-F TRUNK" also works). This is okay because no would ever, ever be crazy enough to name a branch "trunk", right? Right. * For the -U option, the UFILE should be formatted like CVSROOT/users. That is, each line of UFILE looks like this jrandom:jrandom@red-bean.com or maybe even like this jrandom:'Jesse Q. Random ' Don't forget to quote the portion after the colon if necessary. * Many people want to filter by date. To do so, invoke cvs2cl.pl like this: cvs2cl.pl -l "-d'DATESPEC'" where DATESPEC is any date specification valid for "cvs log -d". (Note that CVS 1.10.7 and below requires there be no space between -d and its argument). Options/Arguments: -h, -help, --help, or -? Show this usage and exit --version Show version and exit -r, --revisions Show revision numbers in output -b, --branches Show branch names in revisions when possible -t, --tags Show tags (symbolic names) in output -T, --tagdates Show tags in output on their first occurance --show-dead Show dead files --stdin Read from stdin, don't run cvs log --stdout Output to stdout not to ChangeLog -d, --distributed Put ChangeLogs in subdirs -f FILE, --file FILE Write to FILE instead of "ChangeLog" --fsf Use this if log data is in FSF ChangeLog style --FSF Attempt strict FSF-standard compatible output -W SECS, --window SECS Window of time within which log entries unify -U UFILE, --usermap UFILE Expand usernames to email addresses from UFILE --passwd PASSWORDFILE Use system passwd file for user name expansion. If no mail domain is provided (via --domain), it tries to read one from /etc/mailname else output of hostname -d / dnsdomainname / domainname. Dies if none successful. Use a domain of '' to prevent the addition of a mail domain. --domain DOMAIN Domain to build email addresses from --gecos Get user information from GECOS data -R REGEXP, --regexp REGEXP Include only entries that match REGEXP -I REGEXP, --ignore REGEXP Ignore files whose names match REGEXP -C, --case-insensitive Any regexp matching is done case-insensitively -F BRANCH, --follow BRANCH Show only revisions on or ancestral to BRANCH --no-ancestors When using -F, only track changes since the BRANCH started --no-hide-branch-additions By default, entries generated by cvs for a file added on a branch (a dead 1.1 entry) are not shown. This flag reverses that action. -S, --separate-header Blank line between each header and log message --summary Add CVS change summary information --no-wrap Don't auto-wrap log message (recommend -S also) --gmt, --utc Show times in GMT/UTC instead of local time --accum Add to an existing ChangeLog (incompat w/ --xml) -w, --day-of-week Show day of week --no-times Don't show times in output --chrono Output log in chronological order (default is reverse chronological order) --header FILE Get ChangeLog header from FILE ("-" means stdin) --xml Output XML instead of ChangeLog format --xml-encoding ENCODING Insert encoding clause in XML header --noxmlns Don't include xmlns= attribute in root element --hide-filenames Don't show filenames (ignored for XML output) --no-common-dir Don't shorten directory names from filenames. --rcs CVSROOT Handle filenames from raw RCS, for instance those produced by "cvs rlog" output, stripping the prefix CVSROOT. -P, --prune Don't show empty log messages --ignore-tag TAG Ignore individual changes that are associated with a given tag. May be repeated, if so, changes that are associated with any of the given tags are ignored. --show-tag TAG Log only individual changes that are associated with a given tag. May be repeated, if so, changes that are associated with any of the given tags are logged. --delta FROM_TAG:TO_TAG Attempt a delta between two tags (since FROM_TAG up to & including TO_TAG). The algorithm is a simple date-based one (this is a *hard* problem) so results are imperfect -g OPTS, --global-opts OPTS Invoke like this "cvs OPTS log ..." -l OPTS, --log-opts OPTS Invoke like this "cvs ... log OPTS" FILE1 [FILE2 ...] Show only log information for the named FILE(s) See http://www.red-bean.com/cvs2cl for maintenance and bug info. END_OF_INFO } __END__ =head1 NAME cvs2cl.pl - produces GNU-style ChangeLogs in CVS working copies, by running "cvs log" and parsing the output. Shared log entries are unified in an intuitive way. =head1 DESCRIPTION This script generates GNU-style ChangeLog files from CVS log information. Basic usage: just run it inside a working copy and a ChangeLog will appear. It requires repository access (i.e., 'cvs log' must work). Run "cvs2cl.pl --help" to see more advanced options. See http://www.red-bean.com/cvs2cl for updates, and for instructions on getting anonymous CVS access to this script. Maintainer: Karl Fogel Please report bugs to . =head1 README This script generates GNU-style ChangeLog files from CVS log information. Basic usage: just run it inside a working copy and a ChangeLog will appear. It requires repository access (i.e., 'cvs log' must work). Run "cvs2cl.pl --help" to see more advanced options. See http://www.red-bean.com/cvs2cl for updates, and for instructions on getting anonymous CVS access to this script. Maintainer: Karl Fogel Please report bugs to . =head1 PREREQUISITES This script requires C, C, and C. It also seems to require C or higher. =pod OSNAMES any =pod SCRIPT CATEGORIES Version_Control/CVS =cut -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- Note about a bug-slash-opportunity: ----------------------------------- There's a bug in Text::Wrap, which affects cvs2cl. This script reveals it: #!/usr/bin/perl -w use Text::Wrap; my $test_text = "This script demonstrates a bug in Text::Wrap. The very long line following this paragraph will be relocated relative to the surrounding text: ==================================================================== See? When the bug happens, we'll get the line of equal signs below this paragraph, even though it should be above."; # Print out the test text with no wrapping: print "$test_text"; print "\n"; print "\n"; # Now print it out wrapped, and see the bug: print wrap ("\t", " ", "$test_text"); print "\n"; print "\n"; If the line of equal signs were one shorter, then the bug doesn't happen. Interesting. Anyway, rather than fix this in Text::Wrap, we might as well write a new wrap() which has the following much-needed features: * initial indentation, like current Text::Wrap() * subsequent line indentation, like current Text::Wrap() * user chooses among: force-break long words, leave them alone, or die()? * preserve existing indentation: chopped chunks from an indented line are indented by same (like this line, not counting the asterisk!) * optional list of things to preserve on line starts, default ">" Note that the last two are essentially the same concept, so unify in implementation and give a good interface to controlling them. And how about: Optionally, when encounter a line pre-indented by same as previous line, then strip the newline and refill, but indent by the same. Yeah... aterm-1.0.1/configure0000755000175000001440000116045410654143430013235 0ustar vaeusers#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61 for aterm 1.00.01. # # Report bugs to . # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi # PATH needs CR # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH if test "x$CONFIG_SHELL" = x; then if (eval ":") 2>/dev/null; then as_have_required=yes else as_have_required=no fi if test $as_have_required = yes && (eval ": (as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=\$LINENO as_lineno_2=\$LINENO test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } ") 2> /dev/null; then : else as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. case $as_dir in /*) for as_base in sh bash ksh sh5; do as_candidate_shells="$as_candidate_shells $as_dir/$as_base" done;; esac done IFS=$as_save_IFS for as_shell in $as_candidate_shells $SHELL; do # Try only shells that exist, to save several forks. if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { ("$as_shell") 2> /dev/null <<\_ASEOF if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi : _ASEOF }; then CONFIG_SHELL=$as_shell as_have_required=yes if { "$as_shell" 2> /dev/null <<\_ASEOF if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi : (as_func_return () { (exit $1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = "$1" ); then : else exitcode=1 echo positional parameters were not saved. fi test $exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } _ASEOF }; then break fi fi done if test "x$CONFIG_SHELL" != x; then for as_var in BASH_ENV ENV do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test $as_have_required = no; then echo This script requires a shell more modern than all the echo shells that I found on your system. Please install a echo modern shell, or manually run the script under such a echo shell if you do have one. { (exit 1); exit 1; } fi fi fi (eval "as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0") || { echo No shell found that supports shell functions. echo Please tell autoconf@gnu.org about your system, echo including any error possibly output before this echo message } as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. Blame Lee # E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='aterm' PACKAGE_TARNAME='aterm.tar' PACKAGE_VERSION='1.00.01' PACKAGE_STRING='aterm 1.00.01' PACKAGE_BUGREPORT='as-bugs@afterstep.org' # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir localstatedir includedir oldincludedir docdir infodir htmldir dvidir pdfdir psdir libdir localedir mandir DEFS ECHO_C ECHO_N ECHO_T LIBS build_alias host_alias target_alias VERSION DATE LSMDATE CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP GREP EGREP INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA build build_cpu build_vendor build_os host host_cpu host_vendor host_os RANLIB RM MV CP MKDIR PERL FIND XARGS LDCONFIG SED XMKMF X_CFLAGS X_PRE_LIBS X_LIBS X_EXTRA_LIBS LIBAFTERIMAGE_CFLAGS LIBAFTERSTEP_CFLAGS AFTERIMAGE_LIBS AFTERSTEP_LIBS DEBUG DLIB DINCLUDE XEXTENTIONS_LIBS LIBOBJS LTLIBOBJS' ac_subst_files='MCOMMON' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP XMKMF' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= 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=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -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_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$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 ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` 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 | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$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 ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) 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 | -n) 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 ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$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_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=\$ac_optarg ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } 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 "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute directory names. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; } done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || { echo "$as_me: error: Working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || { echo "$as_me: error: pwd does not report name of working directory" >&2 { (exit 1); exit 1; }; } # 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 the parent directory. ac_confdir=`$as_dirname -- "$0" || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X"$0" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` 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 test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # 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 <<_ACEOF \`configure' configures aterm 1.00.01 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/aterm.tar] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF X features: --x-includes=DIR X include files are in DIR --x-libraries=DIR X library files are in DIR System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of aterm 1.00.01:";; esac cat <<\_ACEOF Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-utmp enable utmp/utmpx support --enable-wtmp enable wtmp support if you have utmp/utmpx support --enable-kanji enable kanji support --enable-big5 enable big5 support --enable-greek enable greek keyboard support --enable-thai enable thai support --enable-ttygid enable tty setting to group \"tty\" - use only if your system uses this type of security --disable-backspace-key disable handling of the backspace key --disable-delete-key disable handling of the delete key --disable-resources disable all resource checking --enable-xgetdefault enable resources via X instead of our small version --disable-memset disable memset() function, use your system's instead --disable-swapscreen disable swap screen support --disable-keepscrolling disable continual scrolling on scrollbar arrow press --disable-mousewheel disable scrolling via mouse wheel or buttons 4 & 5 --enable-old-selection enable v2.20 (and prior) mouse selection - this implies old word selection --enable-old-wordselect enable v2.20 (and prior) mouse selection of words --enable-dmalloc enable Gray Watson's malloc - for debugging use --enable-dlmalloc enable Doug Lea's malloc - for production use - enable only one malloc package --enable-gdb add gdb symbols (-g) (for debugging) no --enable-sigsegv enable internal handler of Segmentation Fault (for self-diagnostics) yes --enable-transparency enable transparent background yes Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-term=NAME set the terminal to NAME (default \"xterm\") --with-terminfo=PATH set the path to the terminfo tree to PATH --with-libefence compile with libefence to debug buffer overruns no --with-afterimage-config=DIR use libAfterImage config script in DIR --with-afterstep-config=DIR use libAfterStep config script in DIR --with-x use the X Window System Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor XMKMF Path to xmkmf, Makefile generator for X Window System Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF aterm configure 1.00.01 generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by aterm $as_me 1.00.01, which was generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$ac_configure_args1 '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------------- ## ## File substitutions. ## ## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo cat confdefs.h echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -n "$CONFIG_SITE"; then set x "$CONFIG_SITE" elif test "x$prefix" != xNONE; then set x "$prefix/share/config.site" "$prefix/etc/config.site" else set x "$ac_default_prefix/share/config.site" \ "$ac_default_prefix/etc/config.site" fi shift for ac_site_file do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_aux_dir= for ac_dir in autoconf "$srcdir"/autoconf; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in autoconf \"$srcdir\"/autoconf" >&5 echo "$as_me: error: cannot find install-sh or install.sh in autoconf \"$srcdir\"/autoconf" >&2;} { (exit 1); exit 1; }; } fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. ac_config_headers="$ac_config_headers config.h:autoconf/config.h.in" VERSION=$PACKAGE_VERSION VERSION_MAJOR="1" DATE="01 August 2007" LSMDATE="01Aug07" echo "#define VERSION \"$VERSION\"" > ${srcdir}/src/version.h echo "#define DATE \"$DATE\"" >> ${srcdir}/src/version.h echo "configuring for aterm $VERSION" MALLOC_TYPE=S # Check whether --enable-utmp was given. if test "${enable_utmp+set}" = set; then enableval=$enable_utmp; if test x$enableval = xyes; then cat >>confdefs.h <<\_ACEOF #define UTMP_SUPPORT 1 _ACEOF utmp_support=yes fi fi # Check whether --enable-wtmp was given. if test "${enable_wtmp+set}" = set; then enableval=$enable_wtmp; if test x$enableval = xyes; then cat >>confdefs.h <<\_ACEOF #define WTMP_SUPPORT 1 _ACEOF wtmp_support=yes fi fi # Check whether --enable-kanji was given. if test "${enable_kanji+set}" = set; then enableval=$enable_kanji; if test x$enableval = xyes; then cat >>confdefs.h <<\_ACEOF #define KANJI 1 _ACEOF fi fi # Check whether --enable-big5 was given. if test "${enable_big5+set}" = set; then enableval=$enable_big5; if test x$enableval = xyes; then cat >>confdefs.h <<\_ACEOF #define ZH 1 _ACEOF fi fi # Check whether --enable-greek was given. if test "${enable_greek+set}" = set; then enableval=$enable_greek; if test x$enableval = xyes; then cat >>confdefs.h <<\_ACEOF #define GREEK_SUPPORT 1 _ACEOF fi fi # Check whether --enable-thai was given. if test "${enable_thai+set}" = set; then enableval=$enable_thai; if test x$enableval = xyes; then cat >>confdefs.h <<\_ACEOF #define THAI 1 _ACEOF fi fi # Check whether --enable-ttygid was given. if test "${enable_ttygid+set}" = set; then enableval=$enable_ttygid; if test x$enableval = xyes; then cat >>confdefs.h <<\_ACEOF #define TTY_GID_SUPPORT 1 _ACEOF fi fi # Check whether --enable-backspace-key was given. if test "${enable_backspace_key+set}" = set; then enableval=$enable_backspace_key; if test x$enableval = xno; then cat >>confdefs.h <<\_ACEOF #define NO_BACKSPACE_KEY 1 _ACEOF fi fi # Check whether --enable-delete-key was given. if test "${enable_delete_key+set}" = set; then enableval=$enable_delete_key; if test x$enableval = xno; then cat >>confdefs.h <<\_ACEOF #define NO_DELETE_KEY 1 _ACEOF fi fi # Check whether --enable-resources was given. if test "${enable_resources+set}" = set; then enableval=$enable_resources; if test x$enableval = xno; then cat >>confdefs.h <<\_ACEOF #define NO_RESOURCES 1 _ACEOF fi fi # Check whether --enable-xgetdefault was given. if test "${enable_xgetdefault+set}" = set; then enableval=$enable_xgetdefault; if test x$enableval = xyes; then cat >>confdefs.h <<\_ACEOF #define USE_XGETDEFAULT 1 _ACEOF fi fi # Check whether --enable-memset was given. if test "${enable_memset+set}" = set; then enableval=$enable_memset; if test x$enableval = xno; then cat >>confdefs.h <<\_ACEOF #define NO_RMEMSET 1 _ACEOF fi fi # Check whether --enable-swapscreen was given. if test "${enable_swapscreen+set}" = set; then enableval=$enable_swapscreen; if test x$enableval = xno; then cat >>confdefs.h <<\_ACEOF #define NO_SECONDARY_SCREEN 1 _ACEOF fi fi # Check whether --enable-keepscrolling was given. if test "${enable_keepscrolling+set}" = set; then enableval=$enable_keepscrolling; if test x$enableval = xno; then cat >>confdefs.h <<\_ACEOF #define NO_SCROLLBAR_BUTTON_CONTINUAL_SCROLLING 1 _ACEOF fi fi # Check whether --enable-mousewheel was given. if test "${enable_mousewheel+set}" = set; then enableval=$enable_mousewheel; if test x$enableval = xno; then cat >>confdefs.h <<\_ACEOF #define NO_MOUSE_WHEEL 1 _ACEOF fi fi # Check whether --enable-old-selection was given. if test "${enable_old_selection+set}" = set; then enableval=$enable_old_selection; if test x$enableval = xyes; then cat >>confdefs.h <<\_ACEOF #define OLD_SELECTION 1 _ACEOF fi fi # Check whether --enable-old-wordselect was given. if test "${enable_old_wordselect+set}" = set; then enableval=$enable_old_wordselect; if test x$enableval = xyes; then cat >>confdefs.h <<\_ACEOF #define OLD_WORD_SELECTION 1 _ACEOF fi fi # Check whether --enable-dmalloc was given. if test "${enable_dmalloc+set}" = set; then enableval=$enable_dmalloc; if test x$enableval = xyes; then MALLOC_TYPE=G DEBUG=-DDEBUG_MALLOC DLIB="-L/usr/local/lib -ldmalloc" DINCLUDE=-I/usr/local/include fi fi # Check whether --enable-dlmalloc was given. if test "${enable_dlmalloc+set}" = set; then enableval=$enable_dlmalloc; if test x$enableval = xyes; then MALLOC_TYPE=D DEBUG= DLIB="-L/usr/local/lib -ldlmalloc" DINCLUDE= fi fi # Check whether --with-term was given. if test "${with_term+set}" = set; then withval=$with_term; if test x$withval != x; then cat >>confdefs.h <<_ACEOF #define TERMENV "$withval" _ACEOF term="$withval" fi fi # Check whether --with-terminfo was given. if test "${with_terminfo+set}" = set; then withval=$with_terminfo; if test x$withval != x; then cat >>confdefs.h <<_ACEOF #define RXVT_TERMINFO "$withval" _ACEOF terminfo="$withval" fi fi # Check whether --with-libefence was given. if test "${with_libefence+set}" = set; then withval=$with_libefence; with_libefence=$withval else with_libefence="" fi # Check whether --enable-gdb was given. if test "${enable_gdb+set}" = set; then enableval=$enable_gdb; enable_gdb=$enableval else enable_gdb="no" fi # Check whether --enable-sigsegv was given. if test "${enable_sigsegv+set}" = set; then enableval=$enable_sigsegv; enable_sigsegv=$enableval else enable_sigsegv="yes" fi # Check whether --enable-transparency was given. if test "${enable_transparency+set}" = set; then enableval=$enable_transparency; enable_transparency=$enableval else enable_transparency="yes" fi if test "x$enable_transparency" = "xyes"; then cat >>confdefs.h <<\_ACEOF #define TRANSPARENT 1 _ACEOF transparent=yes; fi # Check whether --with-afterimage_config was given. if test "${with_afterimage_config+set}" = set; then withval=$with_afterimage_config; afterimage_config="$withval" else afterimage_config=NO fi # Check whether --with-afterstep_config was given. if test "${with_afterstep_config+set}" = set; then withval=$with_afterstep_config; afterstep_config="$withval" else afterstep_config=NO fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi 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 "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_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 $# != 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 ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO: checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # # List of possible output files, starting from the most likely. # The algorithm is not robust to junk in `.', hence go to wildcards (a.*) # only as a last resort. b.out is created by i960 compilers. ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' # # The IRIX 6 linker writes into existing files which may not be # executable, retaining their permissions. Remove them first so a # subsequent execution test works. ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { (ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link_default") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi { echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6; } if test -z "$ac_file"; then echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6; } { echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext { echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT { echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$ac_cv_prog_cc_g" >&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 "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6; } ;; xno) { echo "$as_me:$LINENO: result: unsupported" >&5 echo "${ECHO_T}unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; esac ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { echo "$as_me:$LINENO: result: $CPP" >&5 echo "${ECHO_T}$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } if test "${ac_cv_path_GREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Extract the first word of "grep ggrep" to use in msg output if test -z "$GREP"; then set dummy grep ggrep; ac_prog_name=$2 if test "${ac_cv_path_GREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS fi GREP="$ac_cv_path_GREP" if test -z "$GREP"; then { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_GREP=$GREP fi fi { echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 echo "${ECHO_T}$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { echo "$as_me:$LINENO: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } if test "${ac_cv_path_EGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else # Extract the first word of "egrep" to use in msg output if test -z "$EGREP"; then set dummy egrep; ac_prog_name=$2 if test "${ac_cv_path_EGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS fi EGREP="$ac_cv_path_EGREP" if test -z "$EGREP"; then { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_EGREP=$EGREP fi fi fi { echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { echo "$as_me:$LINENO: checking for AIX" >&5 echo $ECHO_N "checking for AIX... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef _AIX yes #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "yes" >/dev/null 2>&1; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } cat >>confdefs.h <<\_ACEOF #define _ALL_SOURCE 1 _ACEOF else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi rm -f conftest* cat >>confdefs.h <<\_ACEOF #define PROTOTYPES 1 _ACEOF if test -z "$CFLAGS"; then if test -z "$CCOPTS"; then CCOPTS='-O' fi CFLAGS="$CCOPTS" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi 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 "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_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 $# != 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 ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO: checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$ac_cv_prog_cc_g" >&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 "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6; } ;; xno) { echo "$as_me:$LINENO: result: unsupported" >&5 echo "${ECHO_T}unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; esac ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { echo "$as_me:$LINENO: result: $CPP" >&5 echo "${ECHO_T}$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu export CC export GCC export prefix export exec_prefix # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. { echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi done done ;; esac done IFS=$as_save_IFS fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { echo "$as_me:$LINENO: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' if test -n "`echo $CFLAGS' ' | grep '\-g ' 2> /dev/null`" ; then CFLAGS=`echo "$CFLAGS " | sed "s/-g / /"` fi if test "x$GCC" = "xyes"; then if test -z "`echo $CFLAGS | grep '\-Wall' 2> /dev/null`" ; then CFLAGS="$CFLAGS -Wall" fi fi # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} { (exit 1); exit 1; }; } { echo "$as_me:$LINENO: checking build system type" >&5 echo $ECHO_N "checking build system type... $ECHO_C" >&6; } if test "${ac_cv_build+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 echo "$as_me: error: cannot guess build type; you must specify one" >&2;} { (exit 1); exit 1; }; } ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} { (exit 1); exit 1; }; } fi { echo "$as_me:$LINENO: result: $ac_cv_build" >&5 echo "${ECHO_T}$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 echo "$as_me: error: invalid value of canonical build" >&2;} { (exit 1); exit 1; }; };; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { echo "$as_me:$LINENO: checking host system type" >&5 echo $ECHO_N "checking host system type... $ECHO_C" >&6; } if test "${ac_cv_host+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} { (exit 1); exit 1; }; } fi fi { echo "$as_me:$LINENO: result: $ac_cv_host" >&5 echo "${ECHO_T}$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 echo "$as_me: error: invalid value of canonical host" >&2;} { (exit 1); exit 1; }; };; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac case $host_os in *cygwin* ) CYGWIN=yes;; * ) CYGWIN=no;; esac if test "x$CYGWIN" = "x" -a "x$GCC" = "xyes" ; then if test -z "`echo $CFLAGS | grep '\-fPIC' 2> /dev/null`" ; then CFLAGS="$CFLAGS -fPIC" fi fi if test "x$enable_gdb" = "xyes"; then CFLAGS="$CFLAGS -g -DDEBUG_STRICT" LDFLAGS="$LDFLAGS -g" else CFLAGS="$CFLAGS -DNO_DEBUG_OUTPUT" fi if test "x$enable_gprof" = "xyes"; then CFLAGS="$CFLAGS -pg" LDFLAGS="$LDFLAGS -pg" fi if test "x$enable_warn" = "xyes"; then CFLAGS="$CFLAGS -Wuninitialized -Wwrite-strings -Wcast-qual -Wbad-function-cast -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Wconversion -Wcomment -Wcast-align -Winline -Wshadow -Wredundant-decls -Wid-clash-31" fi if test "x$GCC" = "xyes"; then LDFLAGS="$LDFLAGS -rdynamic" fi export CFLAGS export LDFLAGS # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. { echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi done done ;; esac done IFS=$as_save_IFS fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { echo "$as_me:$LINENO: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' currdir=`pwd` INSTALL=`echo $INSTALL|sed -e "s@\^\.\.@${currdir}@" -e "s@^autoconf@${currdir}/autoconf@"` INSTALL_PROGRAM=`echo $INSTALL_PROGRAM|sed -e "s@\^\.\.@${currdir}@" -e "s@^autoconf@${currdir}/autoconf@"` INSTALL_DATA=`echo $INSTALL_DATA|sed -e "s@\^\.\.@${currdir}@" -e "s@^autoconf@${currdir}/autoconf@"` INSTALL_LIB=`echo $INSTALL_LIB|sed -e "s@\^\.\.@${currdir}@" -e "s@^autoconf@${currdir}/autoconf@"` export INSTALL export INSTALL_PROGRAM export INSTALL_DATA export INSTALL_LIB if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { echo "$as_me:$LINENO: result: $RANLIB" >&5 echo "${ECHO_T}$RANLIB" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_RANLIB="ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 echo "${ECHO_T}$ac_ct_RANLIB" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi export RANLIB # Extract the first word of "rm", so it can be a program name with args. set dummy rm; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_RM+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $RM in [\\/]* | ?:[\\/]*) ac_cv_path_RM="$RM" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_RM="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_RM" && ac_cv_path_RM="rm" ;; esac fi RM=$ac_cv_path_RM if test -n "$RM"; then { echo "$as_me:$LINENO: result: $RM" >&5 echo "${ECHO_T}$RM" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi export RM # Extract the first word of "mv", so it can be a program name with args. set dummy mv; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_MV+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $MV in [\\/]* | ?:[\\/]*) ac_cv_path_MV="$MV" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_MV="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_MV" && ac_cv_path_MV="mv" ;; esac fi MV=$ac_cv_path_MV if test -n "$MV"; then { echo "$as_me:$LINENO: result: $MV" >&5 echo "${ECHO_T}$MV" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi export MV # Extract the first word of "cp", so it can be a program name with args. set dummy cp; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_CP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $CP in [\\/]* | ?:[\\/]*) ac_cv_path_CP="$CP" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_CP="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_CP" && ac_cv_path_CP="cp" ;; esac fi CP=$ac_cv_path_CP if test -n "$CP"; then { echo "$as_me:$LINENO: result: $CP" >&5 echo "${ECHO_T}$CP" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi export CP # Extract the first word of "mkdir", so it can be a program name with args. set dummy mkdir; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_MKDIR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $MKDIR in [\\/]* | ?:[\\/]*) ac_cv_path_MKDIR="$MKDIR" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_MKDIR="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_MKDIR" && ac_cv_path_MKDIR="mkdir" ;; esac fi MKDIR=$ac_cv_path_MKDIR if test -n "$MKDIR"; then { echo "$as_me:$LINENO: result: $MKDIR" >&5 echo "${ECHO_T}$MKDIR" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi export MKDIR # Extract the first word of "perl", so it can be a program name with args. set dummy perl; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_PERL+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $PERL in [\\/]* | ?:[\\/]*) ac_cv_path_PERL="$PERL" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PERL="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_PERL" && ac_cv_path_PERL="perl" ;; esac fi PERL=$ac_cv_path_PERL if test -n "$PERL"; then { echo "$as_me:$LINENO: result: $PERL" >&5 echo "${ECHO_T}$PERL" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi export PERL # Extract the first word of "find", so it can be a program name with args. set dummy find; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_FIND+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $FIND in [\\/]* | ?:[\\/]*) ac_cv_path_FIND="$FIND" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_FIND="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_FIND" && ac_cv_path_FIND="find" ;; esac fi FIND=$ac_cv_path_FIND if test -n "$FIND"; then { echo "$as_me:$LINENO: result: $FIND" >&5 echo "${ECHO_T}$FIND" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi export FIND # Extract the first word of "xargs", so it can be a program name with args. set dummy xargs; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_XARGS+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $XARGS in [\\/]* | ?:[\\/]*) ac_cv_path_XARGS="$XARGS" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_XARGS="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_XARGS" && ac_cv_path_XARGS="xargs" ;; esac fi XARGS=$ac_cv_path_XARGS if test -n "$XARGS"; then { echo "$as_me:$LINENO: result: $XARGS" >&5 echo "${ECHO_T}$XARGS" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi export XARGS # Extract the first word of "ldconfig", so it can be a program name with args. set dummy ldconfig; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_LDCONFIG+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $LDCONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_LDCONFIG="$LDCONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_dummy="$PATH:/sbin:/usr/local/sbin" for as_dir in $as_dummy do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_LDCONFIG="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_LDCONFIG" && ac_cv_path_LDCONFIG="ldconfig" ;; esac fi LDCONFIG=$ac_cv_path_LDCONFIG if test -n "$LDCONFIG"; then { echo "$as_me:$LINENO: result: $LDCONFIG" >&5 echo "${ECHO_T}$LDCONFIG" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi export LDCONFIG # Extract the first word of "sed", so it can be a program name with args. set dummy sed; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_SED+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $SED in [\\/]* | ?:[\\/]*) ac_cv_path_SED="$SED" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_SED="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_SED" && ac_cv_path_SED="sed" ;; esac fi SED=$ac_cv_path_SED if test -n "$SED"; then { echo "$as_me:$LINENO: result: $SED" >&5 echo "${ECHO_T}$SED" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi export SED { echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else 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 <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else 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 <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #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)) return 2; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi { echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done { echo "$as_me:$LINENO: checking for wait3 that fills in rusage" >&5 echo $ECHO_N "checking for wait3 that fills in rusage... $ECHO_C" >&6; } if test "${ac_cv_func_wait3_rusage+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then ac_cv_func_wait3_rusage=no else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include #include #include /* HP-UX has wait3 but does not fill in rusage at all. */ int main () { struct rusage r; int i; /* Use a field that we can force nonzero -- voluntary context switches. For systems like NeXT and OSF/1 that don't set it, also use the system CPU time. And page faults (I/O) for Linux. */ r.ru_nvcsw = 0; r.ru_stime.tv_sec = 0; r.ru_stime.tv_usec = 0; r.ru_majflt = r.ru_minflt = 0; switch (fork ()) { case 0: /* Child. */ sleep(1); /* Give up the CPU. */ _exit(0); break; case -1: /* What can we do? */ _exit(0); break; default: /* Parent. */ wait3(&i, 0, &r); /* Avoid "text file busy" from rm on fast HP-UX machines. */ sleep(2); return (r.ru_nvcsw == 0 && r.ru_majflt == 0 && r.ru_minflt == 0 && r.ru_stime.tv_sec == 0 && r.ru_stime.tv_usec == 0); } } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_wait3_rusage=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_func_wait3_rusage=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi { echo "$as_me:$LINENO: result: $ac_cv_func_wait3_rusage" >&5 echo "${ECHO_T}$ac_cv_func_wait3_rusage" >&6; } if test $ac_cv_func_wait3_rusage = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_WAIT3 1 _ACEOF fi if test "x$ac_cv_func_wait3_rusage" = "xyes"; then DO_HAVE_WAIT3=yes export DO_HAVE_WAIT3 fi { echo "$as_me:$LINENO: checking for X" >&5 echo $ECHO_N "checking for X... $ECHO_C" >&6; } # Check whether --with-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 case $x_includes,$x_libraries in #( *\'*) { { echo "$as_me:$LINENO: error: Cannot use X directory names containing '" >&5 echo "$as_me: error: Cannot use X directory names containing '" >&2;} { (exit 1); exit 1; }; };; #( *,NONE | NONE,*) if test "${ac_cv_have_x+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 -f -r conftest.dir if mkdir conftest.dir; then cd conftest.dir cat >Imakefile <<'_ACEOF' incroot: @echo incroot='${INCROOT}' usrlibdir: @echo usrlibdir='${USRLIBDIR}' libdir: @echo libdir='${LIBDIR}' _ACEOF if (export CC; ${XMKMF-xmkmf}) >/dev/null 2>/dev/null && test -f Makefile; then # GNU make sometimes prints "make[1]: Entering...", which would confuse us. for ac_var in incroot usrlibdir libdir; do eval "ac_im_$ac_var=\`\${MAKE-make} $ac_var 2>/dev/null | sed -n 's/^$ac_var=//p'\`" done # 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) ac_x_includes= ;; *) 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 -f -r conftest.dir fi # Standard set of common directories for X headers. # Check X11 before X11Rn because it is often a symlink to the current release. ac_x_header_dirs=' /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' if test "$ac_x_includes" = no; then # Guess where to find include files, by looking for Xlib.h. # First, try using that file with no special directory specified. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # We can compile using X headers with no special include directory. ac_x_includes= else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 for ac_dir in $ac_x_header_dirs; do if test -r "$ac_dir/X11/Xlib.h"; then ac_x_includes=$ac_dir break fi done fi rm -f conftest.err conftest.$ac_ext fi # $ac_x_includes = no if test "$ac_x_libraries" = no; then # Check for the libraries. # See if we find them without any special options. # Don't add to $LIBS permanently. ac_save_LIBS=$LIBS LIBS="-lX11 $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { XrmInitialize () ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then LIBS=$ac_save_LIBS # We can link X programs with no special library path. ac_x_libraries= else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 LIBS=$ac_save_LIBS for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g` do # Don't even attempt the hair of trying to link an X program! for ac_extension in a so sl; do if test -r "$ac_dir/libX11.$ac_extension"; then ac_x_libraries=$ac_dir break 2 fi done done fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi # $ac_x_libraries = no case $ac_x_includes,$ac_x_libraries in #( no,* | *,no | *\'*) # Didn't find X, or a directory has "'" in its name. ac_cv_have_x="have_x=no";; #( *) # 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'" esac fi ;; #( *) have_x=yes;; esac eval "$ac_cv_have_x" fi # $with_x != no if test "$have_x" != yes; then { echo "$as_me:$LINENO: result: $have_x" >&5 echo "${ECHO_T}$have_x" >&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 "$as_me:$LINENO: result: libraries $x_libraries, headers $x_includes" >&5 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&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 <<\_ACEOF #define X_DISPLAY_MISSING 1 _ACEOF 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 . . . . { echo "$as_me:$LINENO: checking whether -R must be followed by a space" >&5 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6; } ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries" ac_xsave_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } X_LIBS="$X_LIBS -R$x_libraries" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 LIBS="$ac_xsave_LIBS -R $x_libraries" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } X_LIBS="$X_LIBS -R $x_libraries" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { echo "$as_me:$LINENO: result: neither works" >&5 echo "${ECHO_T}neither works" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext ac_c_werror_flag=$ac_xsave_c_werror_flag LIBS=$ac_xsave_LIBS 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 says this is needed for Ultrix, if the X # libraries were built with DECnet support. And Karl Berry says # the Alpha needs dnet_stub (dnet does not exist). ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XOpenDisplay (); int main () { return XOpenDisplay (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { echo "$as_me:$LINENO: checking for dnet_ntoa in -ldnet" >&5 echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6; } if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldnet $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dnet_ntoa (); int main () { return dnet_ntoa (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_dnet_dnet_ntoa=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dnet_dnet_ntoa=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_dnet_dnet_ntoa" >&5 echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6; } if test $ac_cv_lib_dnet_dnet_ntoa = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet" fi if test $ac_cv_lib_dnet_dnet_ntoa = no; then { echo "$as_me:$LINENO: checking for dnet_ntoa in -ldnet_stub" >&5 echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6; } if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldnet_stub $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dnet_ntoa (); int main () { return dnet_ntoa (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_dnet_stub_dnet_ntoa=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dnet_stub_dnet_ntoa=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5 echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6; } if test $ac_cv_lib_dnet_stub_dnet_ntoa = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub" fi fi fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS="$ac_xsave_LIBS" # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT, # to get the SysV transport functions. # Chad R. Larson 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 T.E. Dickey. # The functions gethostbyname, getservbyname, and inet_addr are # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking. { echo "$as_me:$LINENO: checking for gethostbyname" >&5 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6; } if test "${ac_cv_func_gethostbyname+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define gethostbyname to an innocuous variant, in case declares gethostbyname. For example, HP-UX 11i declares gettimeofday. */ #define gethostbyname innocuous_gethostbyname /* System header to define __stub macros and hopefully few prototypes, which can conflict with char gethostbyname (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef gethostbyname /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char gethostbyname (); /* 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 #endif int main () { return gethostbyname (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_func_gethostbyname=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_gethostbyname=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyname" >&5 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6; } if test $ac_cv_func_gethostbyname = no; then { echo "$as_me:$LINENO: checking for gethostbyname in -lnsl" >&5 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6; } if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char gethostbyname (); int main () { return gethostbyname (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_nsl_gethostbyname=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_nsl_gethostbyname=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyname" >&5 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6; } if test $ac_cv_lib_nsl_gethostbyname = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl" fi if test $ac_cv_lib_nsl_gethostbyname = no; then { echo "$as_me:$LINENO: checking for gethostbyname in -lbsd" >&5 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6; } if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbsd $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char gethostbyname (); int main () { return gethostbyname (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_bsd_gethostbyname=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_bsd_gethostbyname=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_gethostbyname" >&5 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6; } if test $ac_cv_lib_bsd_gethostbyname = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd" fi 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 Leinen: it contains gethostby* # variants that don't use the name server (or something). -lsocket # must be given before -lnsl if both are needed. We assume that # if connect needs -lnsl, so does gethostbyname. { echo "$as_me:$LINENO: checking for connect" >&5 echo $ECHO_N "checking for connect... $ECHO_C" >&6; } if test "${ac_cv_func_connect+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define connect to an innocuous variant, in case declares connect. For example, HP-UX 11i declares gettimeofday. */ #define connect innocuous_connect /* System header to define __stub macros and hopefully few prototypes, which can conflict with char connect (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef connect /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char connect (); /* 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 #endif int main () { return connect (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_func_connect=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_connect=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_func_connect" >&5 echo "${ECHO_T}$ac_cv_func_connect" >&6; } if test $ac_cv_func_connect = no; then { echo "$as_me:$LINENO: checking for connect in -lsocket" >&5 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6; } if test "${ac_cv_lib_socket_connect+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $X_EXTRA_LIBS $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char connect (); int main () { return connect (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_socket_connect=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_socket_connect=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_socket_connect" >&5 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6; } if test $ac_cv_lib_socket_connect = yes; then X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS" fi fi # Guillermo Gomez says -lposix is necessary on A/UX. { echo "$as_me:$LINENO: checking for remove" >&5 echo $ECHO_N "checking for remove... $ECHO_C" >&6; } if test "${ac_cv_func_remove+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define remove to an innocuous variant, in case declares remove. For example, HP-UX 11i declares gettimeofday. */ #define remove innocuous_remove /* System header to define __stub macros and hopefully few prototypes, which can conflict with char remove (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef remove /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char remove (); /* 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 #endif int main () { return remove (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_func_remove=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_remove=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_func_remove" >&5 echo "${ECHO_T}$ac_cv_func_remove" >&6; } if test $ac_cv_func_remove = no; then { echo "$as_me:$LINENO: checking for remove in -lposix" >&5 echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6; } if test "${ac_cv_lib_posix_remove+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lposix $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char remove (); int main () { return remove (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_posix_remove=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_posix_remove=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_posix_remove" >&5 echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6; } if test $ac_cv_lib_posix_remove = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix" fi fi # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. { echo "$as_me:$LINENO: checking for shmat" >&5 echo $ECHO_N "checking for shmat... $ECHO_C" >&6; } if test "${ac_cv_func_shmat+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define shmat to an innocuous variant, in case declares shmat. For example, HP-UX 11i declares gettimeofday. */ #define shmat innocuous_shmat /* System header to define __stub macros and hopefully few prototypes, which can conflict with char shmat (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef shmat /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shmat (); /* 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 #endif int main () { return shmat (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_func_shmat=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_shmat=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_func_shmat" >&5 echo "${ECHO_T}$ac_cv_func_shmat" >&6; } if test $ac_cv_func_shmat = no; then { echo "$as_me:$LINENO: checking for shmat in -lipc" >&5 echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6; } if test "${ac_cv_lib_ipc_shmat+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lipc $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shmat (); int main () { return shmat (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_ipc_shmat=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_ipc_shmat=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_ipc_shmat" >&5 echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6; } if test $ac_cv_lib_ipc_shmat = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc" 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. # John Interrante, Karl Berry { echo "$as_me:$LINENO: checking for IceConnectionNumber in -lICE" >&5 echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6; } if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lICE $X_EXTRA_LIBS $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char IceConnectionNumber (); int main () { return IceConnectionNumber (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_ICE_IceConnectionNumber=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_ICE_IceConnectionNumber=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5 echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6; } if test $ac_cv_lib_ICE_IceConnectionNumber = yes; then X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE" fi LDFLAGS=$ac_save_LDFLAGS fi x_libs="$LDFLAGS $X_LIBS $X_EXTRA_LIBS $X_PRE_LIBS" XEXTENTIONS_LIBS= { echo "$as_me:$LINENO: checking for XOpenDisplay in -lX11" >&5 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6; } if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lX11 $x_libs $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XOpenDisplay (); int main () { return XOpenDisplay (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_X11_XOpenDisplay=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_X11_XOpenDisplay=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_X11_XOpenDisplay" >&5 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6; } if test $ac_cv_lib_X11_XOpenDisplay = yes; then x_libs="-lX11 $x_libs" fi { echo "$as_me:$LINENO: checking for XShapeCombineMask in -lXext" >&5 echo $ECHO_N "checking for XShapeCombineMask in -lXext... $ECHO_C" >&6; } if test "${ac_cv_lib_Xext_XShapeCombineMask+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXext $x_libs $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XShapeCombineMask (); int main () { return XShapeCombineMask (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_Xext_XShapeCombineMask=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_Xext_XShapeCombineMask=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_Xext_XShapeCombineMask" >&5 echo "${ECHO_T}$ac_cv_lib_Xext_XShapeCombineMask" >&6; } if test $ac_cv_lib_Xext_XShapeCombineMask = yes; then XEXTENTIONS_LIBS="-lXext"; cat >>confdefs.h <<\_ACEOF #define SHAPE 1 _ACEOF fi PATH_XTRA_CHECKED=yes export PATH_XTRA_CHECKED export x_includes export X_CFLAGS export X_LIBS export X_EXTRA_LIBS export X_PRE_LIBS export CPP export have_x have_afterbase=no have_afterimage=no have_afterstep=no LIBAFTERIMAGE_CFLAGS= LIBAFTERSTEP_CFLAGS= AFTERIMAGE_LIBS= AFTERSTEP_LIB= { echo "$as_me:$LINENO: checking if distributed as part of AfterStep" >&5 echo $ECHO_N "checking if distributed as part of AfterStep... $ECHO_C" >&6; } if test -d ../../libAfterBase && -d ../../libAfterImage && -d ../../libAfterStep ; then LIBAFTERIMAGE_CFLAGS= LIBAFTERSTEP_CFLAGS=-I../../.. AFTERIMAGE_LIBS=-L../../../libAfterImage -L../../../libAfterBase -lAfterImage -lAfterBase `../../libAfterImage/afterimage-config --libs --external-only` AFTERSTEP_LIB=-L../../../libAfterStep -lAfterStep have_afterbase=yes have_afterimage=yes have_afterstep=yes { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } { echo "$as_me:$LINENO: checking installed libAfterImage" >&5 echo $ECHO_N "checking installed libAfterImage... $ECHO_C" >&6; } if test "$afterimage_config" = "NO" ; then if afterimage-config --version > /dev/null 2>&1 ; then afterimage_config=afterimage-config else if test -x /usr/local/bin/afterimage-config; then afterimage_config=/usr/local/bin/afterimage-config fi fi else afterimage_config=$afterimage_config/afterimage-config fi if $afterimage_config --version > /dev/null 2>&1 ; then LIBAFTERIMAGE_CFLAGS=`$afterimage_config --cflags` AFTERIMAGE_LIBS=`$afterimage_config --libs` have_afterbase=`$afterimage_config --have-afterbase` if test "x$AFTERIMAGE_LIBS" != "x"; then have_afterimage=yes fi fi if test "x$have_afterimage" = "xyes"; then { echo "$as_me:$LINENO: result: $AFTERIMAGE_LIBS" >&5 echo "${ECHO_T}$AFTERIMAGE_LIBS" >&6; } { echo "$as_me:$LINENO: checking libAfterStep" >&5 echo $ECHO_N "checking libAfterStep... $ECHO_C" >&6; } if test "$afterstep_config" = "NO" ; then if afterstep-config --version > /dev/null 2>&1 ; then afterstep_config=afterstep-config else if test -x /usr/local/bin/afterstep-config; then afterstep_config=/usr/local/bin/afterstep-config fi fi else afterstep_config=$afterstep_config/afterstep-config fi if test "$afterstep_config" != "NO" ; then if $afterstep_config --version >/dev/null 2>&1 ; then LIBAFTERSTEP_CFLAGS=`$afterstep_config --cflags` AFTERSTEP_LIBS=`$afterstep_config --libs` have_afterbase=yes if test "x$AFTERSTEP_LIBS" != "x"; then have_afterstep=yes fi fi fi if test "x$have_afterstep" = "xyes"; then { echo "$as_me:$LINENO: result: $AFTERSTEP_LIBS" >&5 echo "${ECHO_T}$AFTERSTEP_LIBS" >&6; } else if test "$afterstep_config" != "NO" ; then { echo "$as_me:$LINENO: result: afterstep-config not found in $afterstep_config" >&5 echo "${ECHO_T}afterstep-config not found in $afterstep_config" >&6; } else { echo "$as_me:$LINENO: result: afterstep-config not found" >&5 echo "${ECHO_T}afterstep-config not found" >&6; } fi fi else if test "$afterstep_config" != "NO" ; then { echo "$as_me:$LINENO: result: afterimage-config not found in $afterimage_config - no AfterStep integration available." >&5 echo "${ECHO_T}afterimage-config not found in $afterimage_config - no AfterStep integration available." >&6; } else { echo "$as_me:$LINENO: result: afterimage-config not found - no AfterStep integration available." >&5 echo "${ECHO_T}afterimage-config not found - no AfterStep integration available." >&6; } fi { echo "$as_me:$LINENO: result: AfterStep integration" >&5 echo "${ECHO_T}AfterStep integration" >&6; } { echo "$as_me:$LINENO: result: To enable background image support you will need to download and install" >&5 echo "${ECHO_T}To enable background image support you will need to download and install" >&6; } { echo "$as_me:$LINENO: result: libAfterImage from ftp://ftp.afterstep.org/stable/libAfterImage/ and then re-run this script." >&5 echo "${ECHO_T}libAfterImage from ftp://ftp.afterstep.org/stable/libAfterImage/ and then re-run this script." >&6; } fi fi if test "x$have_afterbase" = "xyes"; then cat >>confdefs.h <<\_ACEOF #define HAVE_AFTERBASE 1 _ACEOF fi if test "x$have_afterimage" = "xyes"; then cat >>confdefs.h <<\_ACEOF #define HAVE_AFTERIMAGE 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define BACKGROUND_IMAGE 1 _ACEOF fi if test "x$have_afterstep" = "xyes"; then cat >>confdefs.h <<\_ACEOF #define HAVE_AFTERSTEP 1 _ACEOF fi if test "x$LIBAFTERIMAGE_CFLAGS" = "x$LIBAFTERSTEP_CFLAGS"; then LIBAFTERIMAGE_CFLAGS= fi { echo "$as_me:$LINENO: checking for library containing strerror" >&5 echo $ECHO_N "checking for library containing strerror... $ECHO_C" >&6; } if test "${ac_cv_search_strerror+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_func_search_save_LIBS=$LIBS cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char strerror (); int main () { return strerror (); ; return 0; } _ACEOF for ac_lib in '' cposix; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_search_strerror=$ac_res else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext if test "${ac_cv_search_strerror+set}" = set; then break fi done if test "${ac_cv_search_strerror+set}" = set; then : else ac_cv_search_strerror=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_search_strerror" >&5 echo "${ECHO_T}$ac_cv_search_strerror" >&6; } ac_res=$ac_cv_search_strerror if test "$ac_res" != no; then test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi { echo "$as_me:$LINENO: checking for sys/wait.h that is POSIX.1 compatible" >&5 echo $ECHO_N "checking for sys/wait.h that is POSIX.1 compatible... $ECHO_C" >&6; } if test "${ac_cv_header_sys_wait_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #ifndef WEXITSTATUS # define WEXITSTATUS(stat_val) ((unsigned int) (stat_val) >> 8) #endif #ifndef WIFEXITED # define WIFEXITED(stat_val) (((stat_val) & 255) == 0) #endif int main () { int s; wait (&s); s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_sys_wait_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_sys_wait_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5 echo "${ECHO_T}$ac_cv_header_sys_wait_h" >&6; } if test $ac_cv_header_sys_wait_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_SYS_WAIT_H 1 _ACEOF fi for ac_header in \ assert.h \ fcntl.h \ grp.h \ libc.h \ lastlog.h \ stdarg.h \ stdlib.h \ string.h \ termios.h \ unistd.h \ utmpx.h \ sys/byteorder.h \ sys/ioctl.h \ sys/select.h \ sys/sockio.h \ sys/time.h \ do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------ ## ## Report this to as-bugs@afterstep.org ## ## ------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done { echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6; } if test "${ac_cv_header_time+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include int main () { if ((struct tm *) 0) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_time=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_time=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5 echo "${ECHO_T}$ac_cv_header_time" >&6; } if test $ac_cv_header_time = yes; then cat >>confdefs.h <<\_ACEOF #define TIME_WITH_SYS_TIME 1 _ACEOF fi for ac_func in getpt do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* 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 #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done { echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6; } if test "${ac_cv_c_const+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { /* FIXME: Include the comments suggested by Paul. */ #ifndef __cplusplus /* Ultrix mips cc rejects this. */ typedef int charset[2]; const charset cs; /* SunOS 4.1.1 cc rejects this. */ char const *const *pcpcc; char **ppc; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; /* AIX XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; pcpcc = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++pcpcc; ppc = (char**) pcpcc; pcpcc = (char const *const *) ppc; { /* SCO 3.2v4 cc rejects this. */ char *t; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; if (s) return 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; const int *foo = &x[0]; ++foo; } { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ typedef const int *iptr; iptr p = 0; ++p; } { /* AIX XL C 1.02.0.0 rejects this saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; }; struct s *b; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; if (!foo) return 0; } return !cs[0] && !zero.x; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_c_const=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_const=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 echo "${ECHO_T}$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then cat >>confdefs.h <<\_ACEOF #define const _ACEOF fi { echo "$as_me:$LINENO: checking for inline" >&5 echo $ECHO_N "checking for inline... $ECHO_C" >&6; } if test "${ac_cv_c_inline+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifndef __cplusplus typedef int foo_t; static $ac_kw foo_t static_foo () {return 0; } $ac_kw foo_t foo () {return 0; } #endif _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_c_inline=$ac_kw else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext test "$ac_cv_c_inline" != no && break done fi { echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5 echo "${ECHO_T}$ac_cv_c_inline" >&6; } case $ac_cv_c_inline in inline | yes) ;; *) case $ac_cv_c_inline in no) ac_val=;; *) ac_val=$ac_cv_c_inline;; esac cat >>confdefs.h <<_ACEOF #ifndef __cplusplus #define inline $ac_val #endif _ACEOF ;; esac { echo "$as_me:$LINENO: checking for mode_t" >&5 echo $ECHO_N "checking for mode_t... $ECHO_C" >&6; } if test "${ac_cv_type_mode_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef mode_t ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_mode_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_mode_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_mode_t" >&5 echo "${ECHO_T}$ac_cv_type_mode_t" >&6; } if test $ac_cv_type_mode_t = yes; then : else cat >>confdefs.h <<_ACEOF #define mode_t int _ACEOF fi { echo "$as_me:$LINENO: checking for pid_t" >&5 echo $ECHO_N "checking for pid_t... $ECHO_C" >&6; } if test "${ac_cv_type_pid_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef pid_t ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_pid_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_pid_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5 echo "${ECHO_T}$ac_cv_type_pid_t" >&6; } if test $ac_cv_type_pid_t = yes; then : else cat >>confdefs.h <<_ACEOF #define pid_t int _ACEOF fi { echo "$as_me:$LINENO: checking for uid_t in sys/types.h" >&5 echo $ECHO_N "checking for uid_t in sys/types.h... $ECHO_C" >&6; } if test "${ac_cv_type_uid_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "uid_t" >/dev/null 2>&1; then ac_cv_type_uid_t=yes else ac_cv_type_uid_t=no fi rm -f conftest* fi { echo "$as_me:$LINENO: result: $ac_cv_type_uid_t" >&5 echo "${ECHO_T}$ac_cv_type_uid_t" >&6; } if test $ac_cv_type_uid_t = no; then cat >>confdefs.h <<\_ACEOF #define uid_t int _ACEOF cat >>confdefs.h <<\_ACEOF #define gid_t int _ACEOF fi { echo "$as_me:$LINENO: checking for char" >&5 echo $ECHO_N "checking for char... $ECHO_C" >&6; } if test "${ac_cv_type_char+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef char ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_char=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_char=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_char" >&5 echo "${ECHO_T}$ac_cv_type_char" >&6; } # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { echo "$as_me:$LINENO: checking size of char" >&5 echo $ECHO_N "checking size of char... $ECHO_C" >&6; } if test "${ac_cv_sizeof_char+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef char ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef char ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef char ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef char ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef char ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_char=$ac_lo;; '') if test "$ac_cv_type_char" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (char) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (char) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_char=0 fi ;; esac else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef char ac__type_sizeof_; static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (((long int) (sizeof (ac__type_sizeof_))) < 0) { long int i = longval (); if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%ld\n", i); } else { unsigned long int i = ulongval (); if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%lu\n", i); } return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_char=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_char" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (char) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (char) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_char=0 fi fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi { echo "$as_me:$LINENO: result: $ac_cv_sizeof_char" >&5 echo "${ECHO_T}$ac_cv_sizeof_char" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_CHAR $ac_cv_sizeof_char _ACEOF { echo "$as_me:$LINENO: checking for short" >&5 echo $ECHO_N "checking for short... $ECHO_C" >&6; } if test "${ac_cv_type_short+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef short ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_short=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_short=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_short" >&5 echo "${ECHO_T}$ac_cv_type_short" >&6; } # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { echo "$as_me:$LINENO: checking size of short" >&5 echo $ECHO_N "checking size of short... $ECHO_C" >&6; } if test "${ac_cv_sizeof_short+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef short ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef short ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef short ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef short ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef short ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_short=$ac_lo;; '') if test "$ac_cv_type_short" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (short) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (short) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_short=0 fi ;; esac else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef short ac__type_sizeof_; static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (((long int) (sizeof (ac__type_sizeof_))) < 0) { long int i = longval (); if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%ld\n", i); } else { unsigned long int i = ulongval (); if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%lu\n", i); } return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_short=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_short" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (short) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (short) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_short=0 fi fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi { echo "$as_me:$LINENO: result: $ac_cv_sizeof_short" >&5 echo "${ECHO_T}$ac_cv_sizeof_short" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_SHORT $ac_cv_sizeof_short _ACEOF { echo "$as_me:$LINENO: checking for int" >&5 echo $ECHO_N "checking for int... $ECHO_C" >&6; } if test "${ac_cv_type_int+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef int ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_int=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_int=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_int" >&5 echo "${ECHO_T}$ac_cv_type_int" >&6; } # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { echo "$as_me:$LINENO: checking size of int" >&5 echo $ECHO_N "checking size of int... $ECHO_C" >&6; } if test "${ac_cv_sizeof_int+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef int ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef int ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef int ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef int ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef int ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_int=$ac_lo;; '') if test "$ac_cv_type_int" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (int) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (int) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_int=0 fi ;; esac else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef int ac__type_sizeof_; static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (((long int) (sizeof (ac__type_sizeof_))) < 0) { long int i = longval (); if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%ld\n", i); } else { unsigned long int i = ulongval (); if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%lu\n", i); } return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_int=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_int" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (int) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (int) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_int=0 fi fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi { echo "$as_me:$LINENO: result: $ac_cv_sizeof_int" >&5 echo "${ECHO_T}$ac_cv_sizeof_int" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_INT $ac_cv_sizeof_int _ACEOF { echo "$as_me:$LINENO: checking for long" >&5 echo $ECHO_N "checking for long... $ECHO_C" >&6; } if test "${ac_cv_type_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef long ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_long=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_long=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5 echo "${ECHO_T}$ac_cv_type_long" >&6; } # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { echo "$as_me:$LINENO: checking size of long" >&5 echo $ECHO_N "checking size of long... $ECHO_C" >&6; } if test "${ac_cv_sizeof_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef long ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef long ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef long ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef long ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef long ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_long=$ac_lo;; '') if test "$ac_cv_type_long" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (long) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (long) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_long=0 fi ;; esac else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef long ac__type_sizeof_; static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (((long int) (sizeof (ac__type_sizeof_))) < 0) { long int i = longval (); if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%ld\n", i); } else { unsigned long int i = ulongval (); if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%lu\n", i); } return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_long=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_long" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (long) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (long) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_long=0 fi fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi { echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5 echo "${ECHO_T}$ac_cv_sizeof_long" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_LONG $ac_cv_sizeof_long _ACEOF { echo "$as_me:$LINENO: checking for int *" >&5 echo $ECHO_N "checking for int *... $ECHO_C" >&6; } if test "${ac_cv_type_int_p+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef int * ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_int_p=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_int_p=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_int_p" >&5 echo "${ECHO_T}$ac_cv_type_int_p" >&6; } # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { echo "$as_me:$LINENO: checking size of int *" >&5 echo $ECHO_N "checking size of int *... $ECHO_C" >&6; } if test "${ac_cv_sizeof_int_p+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef int * ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef int * ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef int * ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef int * ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef int * ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_int_p=$ac_lo;; '') if test "$ac_cv_type_int_p" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (int *) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (int *) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_int_p=0 fi ;; esac else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef int * ac__type_sizeof_; static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (((long int) (sizeof (ac__type_sizeof_))) < 0) { long int i = longval (); if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%ld\n", i); } else { unsigned long int i = ulongval (); if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%lu\n", i); } return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_int_p=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_int_p" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (int *) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (int *) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_int_p=0 fi fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi { echo "$as_me:$LINENO: result: $ac_cv_sizeof_int_p" >&5 echo "${ECHO_T}$ac_cv_sizeof_int_p" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_INT_P $ac_cv_sizeof_int_p _ACEOF if test "$cross_compiling" = yes; then echo "configure: warning: Define SIZEOF_* values in config.h manually" fi if test $ac_cv_sizeof_char -ge 2; then RINT16T=char cat >>confdefs.h <<\_ACEOF #define RINT16T char _ACEOF cat >>confdefs.h <<\_ACEOF #define RUINT16T unsigned char _ACEOF else if test $ac_cv_sizeof_short -ge 2; then RINT16T=short cat >>confdefs.h <<\_ACEOF #define RINT16T short _ACEOF cat >>confdefs.h <<\_ACEOF #define RUINT16T unsigned short _ACEOF else if test $ac_cv_sizeof_int -ge 2; then RINT16T=int cat >>confdefs.h <<\_ACEOF #define RINT16T int _ACEOF cat >>confdefs.h <<\_ACEOF #define RUINT16T unsigned int _ACEOF else RINT16T=long cat >>confdefs.h <<\_ACEOF #define RINT16T long _ACEOF cat >>confdefs.h <<\_ACEOF #define RUINT16T unsigned long _ACEOF fi fi fi if test $ac_cv_sizeof_char -ge 4; then RINT32T=char cat >>confdefs.h <<\_ACEOF #define RINT32T char _ACEOF cat >>confdefs.h <<\_ACEOF #define RUINT32T unsigned char _ACEOF else if test $ac_cv_sizeof_short -ge 4; then RINT32T=short cat >>confdefs.h <<\_ACEOF #define RINT32T short _ACEOF cat >>confdefs.h <<\_ACEOF #define RUINT32T unsigned short _ACEOF else if test $ac_cv_sizeof_int -ge 4; then RINT32T=int cat >>confdefs.h <<\_ACEOF #define RINT32T int _ACEOF cat >>confdefs.h <<\_ACEOF #define RUINT32T unsigned int _ACEOF else RINT32T=long cat >>confdefs.h <<\_ACEOF #define RINT32T long _ACEOF cat >>confdefs.h <<\_ACEOF #define RUINT32T unsigned long _ACEOF fi fi fi if test $ac_cv_sizeof_char -eq $ac_cv_sizeof_int_p; then RINTPT=char cat >>confdefs.h <<\_ACEOF #define RINTPT char _ACEOF cat >>confdefs.h <<\_ACEOF #define RUINTPT unsigned char _ACEOF else if test $ac_cv_sizeof_short -eq $ac_cv_sizeof_int_p; then RINTPT=short cat >>confdefs.h <<\_ACEOF #define RINTPT short _ACEOF cat >>confdefs.h <<\_ACEOF #define RUINTPT unsigned short _ACEOF else if test $ac_cv_sizeof_int -eq $ac_cv_sizeof_int_p; then RINTPT=int cat >>confdefs.h <<\_ACEOF #define RINTPT int _ACEOF cat >>confdefs.h <<\_ACEOF #define RUINTPT unsigned int _ACEOF else RINTPT=long cat >>confdefs.h <<\_ACEOF #define RINTPT long _ACEOF cat >>confdefs.h <<\_ACEOF #define RUINTPT unsigned long _ACEOF fi fi fi { echo "$as_me:$LINENO: checking return type of signal handlers" >&5 echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6; } if test "${ac_cv_type_signal+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { return *(signal (0, 0)) (0) == 1; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_signal=int else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_signal=void fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5 echo "${ECHO_T}$ac_cv_type_signal" >&6; } cat >>confdefs.h <<_ACEOF #define RETSIGTYPE $ac_cv_type_signal _ACEOF for ac_func in \ atexit \ unsetenv \ setutent \ seteuid \ do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* 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 #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done { echo "$as_me:$LINENO: checking for host in utmp struct" >&5 echo $ECHO_N "checking for host in utmp struct... $ECHO_C" >&6; } if test "${rxvt_cv_struct_utmp_host+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifdef HAVE_UTMPX_H #include #else #include #endif int main () { #ifdef HAVE_UTMPX_H struct utmpx ut; #else struct utmp ut; #endif ut.ut_host; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then rxvt_cv_struct_utmp_host=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 rxvt_cv_struct_utmp_host=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $rxvt_cv_struct_utmp_host" >&5 echo "${ECHO_T}$rxvt_cv_struct_utmp_host" >&6; } if test "$rxvt_cv_struct_utmp_host" = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_UTMP_HOST 1 _ACEOF fi if test "$ac_cv_header_utmpx_h" = yes; then { echo "$as_me:$LINENO: checking where utmp is located" >&5 echo $ECHO_N "checking where utmp is located... $ECHO_C" >&6; } if test "${rxvt_cv_path_utmp+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else for utmp_file in /var/run/utmp /var/adm/utmpx /etc/utmpx; do if test -f "$utmp_file" ; then rxvt_cv_path_utmp=$utmp_file break fi done fi { echo "$as_me:$LINENO: result: $rxvt_cv_path_utmp" >&5 echo "${ECHO_T}$rxvt_cv_path_utmp" >&6; } cat >>confdefs.h <<\_ACEOF #define _GNU_SOURCE 1 _ACEOF else { echo "$as_me:$LINENO: checking where utmp is located" >&5 echo $ECHO_N "checking where utmp is located... $ECHO_C" >&6; } if test "${rxvt_cv_path_utmp+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else for utmp_file in /var/run/utmp /var/adm/utmp /etc/utmp /usr/etc/utmp /usr/adm/utmp; do if test -f "$utmp_file" ; then rxvt_cv_path_utmp=$utmp_file break fi done fi { echo "$as_me:$LINENO: result: $rxvt_cv_path_utmp" >&5 echo "${ECHO_T}$rxvt_cv_path_utmp" >&6; } fi if test "${rxvt_cv_path_utmp+set}" = set; then cat >>confdefs.h <<_ACEOF #define RXVT_UTMP_FILE "$rxvt_cv_path_utmp" _ACEOF fi { echo "$as_me:$LINENO: checking where wtmp is located" >&5 echo $ECHO_N "checking where wtmp is located... $ECHO_C" >&6; } if test "${rxvt_cv_path_wtmp+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else for wtmp_file in /var/log/wtmp /var/adm/wtmp /etc/wtmp /usr/etc/wtmp /usr/adm/wtmp; do if test -f "$wtmp_file" ; then rxvt_cv_path_wtmp=$wtmp_file break fi done fi { echo "$as_me:$LINENO: result: $rxvt_cv_path_wtmp" >&5 echo "${ECHO_T}$rxvt_cv_path_wtmp" >&6; } if test "${rxvt_cv_path_wtmp+set}" = set; then cat >>confdefs.h <<_ACEOF #define RXVT_WTMP_FILE "$rxvt_cv_path_wtmp" _ACEOF fi { echo "$as_me:$LINENO: checking where ttys/ttytab is located" >&5 echo $ECHO_N "checking where ttys/ttytab is located... $ECHO_C" >&6; } if test "${rxvt_cv_path_ttytab+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else for ttys_file in /etc/ttys /etc/ttytab; do if test -f "$ttys_file" ; then rxvt_cv_path_ttytab=$ttys_file break fi done fi { echo "$as_me:$LINENO: result: $rxvt_cv_path_ttytab" >&5 echo "${ECHO_T}$rxvt_cv_path_ttytab" >&6; } if test "${rxvt_cv_path_ttytab+set}" = set; then cat >>confdefs.h <<_ACEOF #define TTYTAB_FILENAME "$rxvt_cv_path_ttytab" _ACEOF fi SAVETHELIBS=$LIBS LIBS="$LIBS $X_LIBS $X_PRE_LIBS $X_EXTRA_LIBS -lX11 -lXmu" CFLAGS="$CFLAGS $X_CFLAGS" { echo "$as_me:$LINENO: checking for working Xlocale" >&5 echo $ECHO_N "checking for working Xlocale... $ECHO_C" >&6; } if test "${rxvt_cv_func_xlocale+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then { echo "$as_me:$LINENO: WARNING: Define NO_XLOCALE in config.h manually" >&5 echo "$as_me: WARNING: Define NO_XLOCALE in config.h manually" >&2;} else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #define X_LOCALE 1 #include #include main() { char *p; if ((p = XSetLocaleModifiers("@im=none")) != NULL && *p) exit (XSupportsLocale() ? 0 : 1); else exit (1);} _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then rxvt_cv_func_xlocale=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) rxvt_cv_func_xlocale=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi { echo "$as_me:$LINENO: result: $rxvt_cv_func_xlocale" >&5 echo "${ECHO_T}$rxvt_cv_func_xlocale" >&6; } if test "${rxvt_cv_func_xlocale}" = no; then cat >>confdefs.h <<\_ACEOF #define NO_XLOCALE 1 _ACEOF fi LIBS=$SAVETHELIBS { echo "$as_me:$LINENO: checking for working setlocale" >&5 echo $ECHO_N "checking for working setlocale... $ECHO_C" >&6; } if test "${rxvt_cv_func_xsetlocale+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #define X_LOCALE 1 #include int main () { setlocale(LC_CTYPE, ""); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then rxvt_cv_func_xsetlocale=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 rxvt_cv_func_xsetlocale=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $rxvt_cv_func_xsetlocale" >&5 echo "${ECHO_T}$rxvt_cv_func_xsetlocale" >&6; } if test "${rxvt_cv_func_xsetlocale}" = no; then cat >>confdefs.h <<\_ACEOF #define NO_XSETLOCALE 1 _ACEOF fi { echo "$as_me:$LINENO: checking for working plain setlocale" >&5 echo $ECHO_N "checking for working plain setlocale... $ECHO_C" >&6; } if test "${rxvt_cv_func_setlocale+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { setlocale(LC_CTYPE, ""); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then rxvt_cv_func_setlocale=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 rxvt_cv_func_setlocale=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $rxvt_cv_func_setlocale" >&5 echo "${ECHO_T}$rxvt_cv_func_setlocale" >&6; } if test x${rxvt_cv_func_setlocale} = xno; then cat >>confdefs.h <<\_ACEOF #define NO_SETLOCALE 1 _ACEOF fi CFLAGS=${CFLAGS--O} LDFLAGS=${LDFLAGS--O} CPPFLAGS="$CPPFLAGS" MCOMMON=./autoconf/Make.common ac_config_files="$ac_config_files autoconf/Make.common Makefile doc/Makefile src/Makefile src/graphics/Makefile scripts/random_colors" cat >confcache <<\_ACEOF # 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, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # 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. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && { echo "$as_me:$LINENO: updating cache $cache_file" >&5 echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi # PATH needs CR # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. Blame Lee # E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 # Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by aterm $as_me 1.00.01, which was generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ aterm config.status 1.00.01 configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2006 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header { echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; };; --help | --hel | -h ) echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) { echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *) ac_config_targets="$ac_config_targets $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF if \$ac_cs_recheck; then echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 CONFIG_SHELL=$SHELL export CONFIG_SHELL exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h:autoconf/config.h.in" ;; "autoconf/Make.common") CONFIG_FILES="$CONFIG_FILES autoconf/Make.common" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "src/graphics/Makefile") CONFIG_FILES="$CONFIG_FILES src/graphics/Makefile" ;; "scripts/random_colors") CONFIG_FILES="$CONFIG_FILES scripts/random_colors" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } # # Set up the sed scripts for CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "$CONFIG_FILES"; then _ACEOF # Create sed commands to just substitute file output variables. # Remaining file output variables are in a fragment that also has non-file # output varibles. ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF SHELL!$SHELL$ac_delim PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim PACKAGE_NAME!$PACKAGE_NAME$ac_delim PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim PACKAGE_STRING!$PACKAGE_STRING$ac_delim PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim exec_prefix!$exec_prefix$ac_delim prefix!$prefix$ac_delim program_transform_name!$program_transform_name$ac_delim bindir!$bindir$ac_delim sbindir!$sbindir$ac_delim libexecdir!$libexecdir$ac_delim datarootdir!$datarootdir$ac_delim datadir!$datadir$ac_delim sysconfdir!$sysconfdir$ac_delim sharedstatedir!$sharedstatedir$ac_delim localstatedir!$localstatedir$ac_delim includedir!$includedir$ac_delim oldincludedir!$oldincludedir$ac_delim docdir!$docdir$ac_delim infodir!$infodir$ac_delim htmldir!$htmldir$ac_delim dvidir!$dvidir$ac_delim pdfdir!$pdfdir$ac_delim psdir!$psdir$ac_delim libdir!$libdir$ac_delim localedir!$localedir$ac_delim mandir!$mandir$ac_delim DEFS!$DEFS$ac_delim ECHO_C!$ECHO_C$ac_delim ECHO_N!$ECHO_N$ac_delim ECHO_T!$ECHO_T$ac_delim LIBS!$LIBS$ac_delim build_alias!$build_alias$ac_delim host_alias!$host_alias$ac_delim target_alias!$target_alias$ac_delim VERSION!$VERSION$ac_delim DATE!$DATE$ac_delim LSMDATE!$LSMDATE$ac_delim CC!$CC$ac_delim CFLAGS!$CFLAGS$ac_delim LDFLAGS!$LDFLAGS$ac_delim CPPFLAGS!$CPPFLAGS$ac_delim ac_ct_CC!$ac_ct_CC$ac_delim EXEEXT!$EXEEXT$ac_delim OBJEXT!$OBJEXT$ac_delim CPP!$CPP$ac_delim GREP!$GREP$ac_delim EGREP!$EGREP$ac_delim INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim INSTALL_DATA!$INSTALL_DATA$ac_delim build!$build$ac_delim build_cpu!$build_cpu$ac_delim build_vendor!$build_vendor$ac_delim build_os!$build_os$ac_delim host!$host$ac_delim host_cpu!$host_cpu$ac_delim host_vendor!$host_vendor$ac_delim host_os!$host_os$ac_delim RANLIB!$RANLIB$ac_delim RM!$RM$ac_delim MV!$MV$ac_delim CP!$CP$ac_delim MKDIR!$MKDIR$ac_delim PERL!$PERL$ac_delim FIND!$FIND$ac_delim XARGS!$XARGS$ac_delim LDCONFIG!$LDCONFIG$ac_delim SED!$SED$ac_delim XMKMF!$XMKMF$ac_delim X_CFLAGS!$X_CFLAGS$ac_delim X_PRE_LIBS!$X_PRE_LIBS$ac_delim X_LIBS!$X_LIBS$ac_delim X_EXTRA_LIBS!$X_EXTRA_LIBS$ac_delim LIBAFTERIMAGE_CFLAGS!$LIBAFTERIMAGE_CFLAGS$ac_delim LIBAFTERSTEP_CFLAGS!$LIBAFTERSTEP_CFLAGS$ac_delim AFTERIMAGE_LIBS!$AFTERIMAGE_LIBS$ac_delim AFTERSTEP_LIBS!$AFTERSTEP_LIBS$ac_delim DEBUG!$DEBUG$ac_delim DLIB!$DLIB$ac_delim DINCLUDE!$DINCLUDE$ac_delim XEXTENTIONS_LIBS!$XEXTENTIONS_LIBS$ac_delim LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 86; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` if test -n "$ac_eof"; then ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` ac_eof=`expr $ac_eof + 1` fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b end /^[ ]*@MCOMMON@[ ]*$/{ r $MCOMMON d } _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g s/^/s,@/; s/!/@,|#_!!_#|/ :n t n s/'"$ac_delim"'$/,g/; t s/$/\\/; p N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF :end s/|#_!!_#|//g CEOF$ac_eof _ACEOF # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/ s/:*\${srcdir}:*/:/ s/:*@srcdir@:*/:/ s/^\([^=]*=[ ]*\):*/\1/ s/:*$// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF fi # test -n "$CONFIG_FILES" for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 echo "$as_me: error: Invalid tag $ac_tag." >&2;} { (exit 1); exit 1; }; };; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac ac_file_inputs="$ac_file_inputs $ac_f" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input="Generated from "`IFS=: echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} fi case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin";; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` { as_dir="$ac_dir" case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= case `sed -n '/datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p ' $ac_file_inputs` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s&@configure_input@&$configure_input&;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t $ac_datarootdir_hack " $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} rm -f "$tmp/stdin" case $ac_file in -) cat "$tmp/out"; rm -f "$tmp/out";; *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; esac ;; :H) # # CONFIG_HEADER # _ACEOF # Transform confdefs.h into a sed script `conftest.defines', that # substitutes the proper values into config.h.in to produce config.h. rm -f conftest.defines conftest.tail # First, append a space to every undef/define line, to ease matching. echo 's/$/ /' >conftest.defines # Then, protect against being on the right side of a sed subst, or in # an unquoted here document, in config.status. If some macros were # called several times there might be several #defines for the same # symbol, which is useless. But do not sort them, since the last # AC_DEFINE must be honored. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* # These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where # NAME is the cpp macro being defined, VALUE is the value it is being given. # PARAMS is the parameter list in the macro definition--in most cases, it's # just an empty string. ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*' ac_dB='\\)[ (].*,\\1define\\2' ac_dC=' ' ac_dD=' ,' uniq confdefs.h | sed -n ' t rset :rset s/^[ ]*#[ ]*define[ ][ ]*// t ok d :ok s/[\\&,]/\\&/g s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p ' >>conftest.defines # Remove the space that was appended to ease matching. # Then replace #undef with comments. This is necessary, for # example, in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. # (The regexp can be short, since the line contains either #define or #undef.) echo 's/ $// s,^[ #]*u.*,/* & */,' >>conftest.defines # Break up conftest.defines: ac_max_sed_lines=50 # First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1" # Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2" # Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1" # et cetera. ac_in='$ac_file_inputs' ac_out='"$tmp/out1"' ac_nxt='"$tmp/out2"' while : do # Write a here document: cat >>$CONFIG_STATUS <<_ACEOF # First, check the format of the line: cat >"\$tmp/defines.sed" <<\\CEOF /^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def /^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def b :def _ACEOF sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS echo 'CEOF sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail grep . conftest.tail >/dev/null || break rm -f conftest.defines mv conftest.tail conftest.defines done rm -f conftest.defines conftest.tail echo "ac_result=$ac_in" >>$CONFIG_STATUS cat >>$CONFIG_STATUS <<\_ACEOF if test x"$ac_file" != x-; then echo "/* $configure_input */" >"$tmp/config.h" cat "$ac_result" >>"$tmp/config.h" if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else rm -f $ac_file mv "$tmp/config.h" $ac_file fi else echo "/* $configure_input */" cat "$ac_result" fi rm -f "$tmp/out12" ;; esac done # for ac_tag { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi chmod 755 scripts/random_colors echo "Configuration: Aterm version: ${VERSION} : ${DATE} Source code location: ${srcdir} Install path: ${prefix}/bin Compiler: ${CC} Compiler flags: ${CFLAGS}" echo " Background image support :" echo " AfterImage library: ${AFTERIMAGE_LIB}" echo " supporting image format libraries: ${AFTERIMAGE_LIBS}" if test "${have_afterstep}" = yes; then echo " with AfterStep MyStyles support available" else echo " without AfterStep MyStyles support" fi echo if test "${enable_transparency}" = yes; then echo " Transparency : enabled" else echo " Transparency : disabled" fi if test "$MALLOC_TYPE" = S; then echo " malloc support: system default" fi if test "$MALLOC_TYPE" = G; then echo " malloc support: Gray Watson's dmalloc" fi if test "$MALLOC_TYPE" = D; then echo " malloc support: Doug Lea's malloc" fi echo " The following are set in config.h " if test "${utmp_support}" != yes; then echo " utmp support: disabled " else echo " utmp support: enabled utmp file: ${rxvt_cv_path_utmp} wtmp file: ${rxvt_cv_path_wtmp} ttys/ttytab file: ${rxvt_cv_path_ttytab} " fi if test "x${term}" != x; then echo " set TERM to: ${term} " fi if test "x${terminfo}" != x; then echo " set TERMINFO to: ${terminfo} " fi echo " Type of 16bit: ${RINT16T} 32bit: ${RINT32T} pointer: (same as) ${RINTPT} " echo " *** Please check src/feature.h for further options *** " aterm-1.0.1/scripts/0000755000175000001440000000000010654145553013012 5ustar vaeusersaterm-1.0.1/scripts/random_colors.in0000755000175000001440000000137310144447043016203 0ustar vaeusers#!/bin/bash # This script will launch aterm with different tinting color # every time you start it # I don't really know how that can be of any use at all, but some # folks like it - so here it is CLRCODE=`expr $RANDOM % 6` ATRMPATH=$DESTDIR@prefix@/bin { [ "$CLRCODE" -eq "0" ] && CLRNAME="-tint blue -fg yellow -bg black"; } || { [ "$CLRCODE" -eq "1" ] && CLRNAME="-tint red -fg white -bg black"; } || { [ "$CLRCODE" -eq "2" ] && CLRNAME="-tint green -fg white -bg white"; } || { [ "$CLRCODE" -eq "3" ] && CLRNAME="-tint cyan -fg white -bg white"; } || { [ "$CLRCODE" -eq "4" ] && CLRNAME="-tint magenta -fg white -bg black"; } || { [ "$CLRCODE" -eq "5" ] && CLRNAME="-tint yellow -fg blue -bg white"; } exec $ATRMPATH/aterm -fg white -tr $CLRNAME $@ aterm-1.0.1/scripts/slidshow0000755000175000001440000000701710144447043014572 0ustar vaeusers#!/bin/sh # # Copyright (c) 1999 Ethan Fischer # # some useful variables nl=" " q='"' sednl="\\ " name=`echo "$0" | sed "s@/@$sednl@g" | tail -1` # set input field separator old_ifs="$IFS" IFS=$nl # set defaults option_delay="10" option_types='*.gif,*.jpg,*.xpm' find_args="" find_args2="" # parse options while test -n "$1"; do case "$1" in -d|--delay) shift option_delay="$1" ;; -e|--repeat) option_repeat=1 ;; -f|--file) shift option_file="$1" ;; -h|--help) option_help=1 ;; -n|--new-term) option_new_term=1 ;; -r|--recurse) option_recurse=1 ;; -R|--random) option_random=1 ;; -s|--shade) shift option_shade="$1" ;; -t|--term) option_term=1 ;; -v|--version) option_version=1 ;; -T|--types) shift option_types="$1" ;; --) shift break ;; -*) echo "Unknown option: $1" exit 1 ;; *) break ;; esac shift done # display version info if test -n "$option_version"; then echo "$name version 1.0" exit 0 fi # display help if test -n "$option_help"; then echo "Usage:" echo "$name [-d] [-e] [-f file] [-h] [-n term] [-r] [-R] [-s %] [-t]" printf "%*s [-T type1,[type2,[...]]] [-v] dirs\\n" ${#name} "" echo "-d (--delay) n set delay between frames to n seconds (default 10)" echo "-e (--repeat) repeatedly display list, re-randomizing if --random" echo "-f (--file) f read image names from file f" echo "-h (--help) this help" echo "-n (--new-term) open new aterm, then same as --term" echo "-r (--recurse) recursive search" echo "-R (--random) randomize image list" echo "-s (--shade) % shading option to be passed to aterm (only valid with -n)" echo "-t (--term) display image in xterm background" echo "-T (--types) types types of files to display; types is a comma-separated" echo ' list (default is "*.gif,*.jpg,*.xpm")' echo "-v (--version) display version information" echo "dirs directories (or files) to search" exit 0 fi # need at least one dir if test -z "$*" && test -z "$option_file"; then echo "$name: at least one file or directory is required" exit 1 fi # follow symlinks find_args="-follow" # set recursion if test -z $option_recurse; then find_args="$find_args${nl}-maxdepth${nl}1" fi # set input file if test -n "$option_file"; then opts=`cat $option_file` else tmp="-name${nl}"`echo $option_types | sed -e "s/,/ -o -name /g" -e "s/ /$sednl/g"` opts=`find "$@" $find_args $tmp | sort | uniq` fi # randomize the list if test -n "$option_random"; then opts=`echo "$opts" | randomize` fi if test -n "$option_new_term"; then echo "$opts" > /tmp/slideshow.txt command="slideshow -t -f /tmp/slideshow.txt" if test -n "$option_delay"; then command="$command -d $option_delay"; fi if test -n "$option_repeat"; then command="$command -e"; fi if test -n "$option_recurse"; then command="$command -r"; fi if test -n "$option_random"; then command="$command -R"; fi if test -n "$option_types"; then command="$command -T $option_types"; fi if test -n "$option_shade"; then aterm -sh "$option_shade" +sb -e sh -c "($command &);exec $SHELL" else aterm +sb -e sh -c "($command &);exec $SHELL" fi elif test -n "$option_term"; then cont=1 while test "$cont" = "1"; do for i in $opts; do echo -n "]20;$i" sleep $option_delay done cont=$option_repeat done else cont=1 while test "$cont" = "1"; do for i in $opts; do ascommand.pl "Background "'""'" $i" sleep $option_delay done cont=$option_repeat done fi aterm-1.0.1/autoconf/0000755000175000001440000000000010654145551013137 5ustar vaeusersaterm-1.0.1/autoconf/Make.common.in0000644000175000001440000000364410245376401015636 0ustar vaeusers# autoconf/Make.common.in -*- Makefile -*- # release date (man), LSM date, version number/name, current maintainer # $Id: Make.common.in,v 1.3 2005/05/26 16:44:49 sasha Exp $ DATE=@DATE@ LSMDATE=@LSMDATE@ VERSION=@VERSION@ VERNAME=aterm-$(VERSION)# MAINT=Sasha Vasko# MAINTEMAIL=# WEBMAINT=Sasha Vasko# WEBMAINTEMAIL=# WEBPAGE=# FTPSITENAME=ftp.afterstep.org# FTPSITEDIR=/apps/aterm# #------------------------------------------------------------------------- SHELL = /bin/sh # This variable makes it possible to move the installation root to another # directory. This is useful when you're creating a binary distribution # If empty, normal root will be used. # You can run eg. 'make install DESTDIR=/packages/rxvt-xx' to accomplish # that. # DESTDIR = /usr/local/X11/$(VERNAME) # Installation target directories & other installation stuff prefix = @prefix@ exec_prefix = @exec_prefix@ binprefix = manprefix = bindir = @bindir@ mandir = @mandir@/man1 manext = 1 # Tools & program stuff CC = @CC@ CPP = @CPP@ MV = @MV@ RM = @RM@ RMF = @RM@ -f CP = @CP@ SED = @SED@ INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL@ -s -m 755 INSTALL_DATA = @INSTALL@ -m 644 # Flags & libs # add -DBINDIR=\""$(bindir)/"\" to CPPFLAGS, if we need to spawn a program CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ LDFLAGS = @LDFLAGS@ DEFS = @DEFS@ LIBS = @LIBS@ DINCLUDE = @DINCLUDE@ DLIB = @DLIB@ # X Include directory CFLAGS_LIBAFTERIMAGE=@LIBAFTERIMAGE_CFLAGS@ CFLAGS_LIBAFTERSTEP=@LIBAFTERSTEP_CFLAGS@ XINC = @X_CFLAGS@ LIB_AFTERSTEP = @AFTERSTEP_LIBS@ LIBS_AFTERIMAGE = @AFTERIMAGE_LIBS@ # extra libraries needed by X on some systems, X library location XLIB = $(LIB_AFTERSTEP) $(LIBS_AFTERIMAGE) @LIBS@ @X_LIBS@ @X_PRE_LIBS@ @X_EXTRA_LIBS@ -lX11 @XEXTENTIONS_LIBS@ # End of common section of the Makefile #------------------------------------------------------------------------- aterm-1.0.1/autoconf/aclocal.m40000644000175000001440000004543610144447024015005 0ustar vaeusersdnl> test to find the hard-to-find libXpm dnl> mostly copied from AC_PATH_X & AC_PATH_DIRECT, but explictly set AC_DEFUN(VT_FIND_LIBXPM, [ AC_REQUIRE_CPP() # Initialize some more variables set by options. # The variables have the same names as the options, with # dashes changed to underlines. # If we find XPM, set shell vars xpm_includes and xpm_libraries to the # paths, otherwise set no_xpm=yes. # Uses ac_ vars as temps to allow command line to override cache and checks. AC_MSG_CHECKING(for libXpm) AC_ARG_WITH(xpm_includes, [ --with-xpm-includes=DIR use XPM includes in DIR], xpm_includes="$withval", xpm_includes=NO) AC_ARG_WITH(xpm_library, [ --with-xpm-library=DIR use XPM library in DIR], xpm_libraries="$withval", xpm_libraries=NO) # --without-xpm overrides everything else, but does not touch the cache. AC_ARG_WITH(xpm, [ --with-xpm use XPM]) if test "$with_xpm" = no; then have_xpm=disabled else AC_CACHE_VAL(ac_cv_have_xpm, [ vt_xpm_include_X11=no if test -n "$xpm_includes"; then vt_xpm_includes=$xpm_includes else vt_xpm_includes=NO fi if test -n "$xpm_libraries"; then vt_xpm_libraries=$xpm_libraries else vt_xpm_libraries=NO fi VT_XPM_DIRECT if test "$vt_xpm_includes" = NO -o "$vt_xpm_libraries" = NO; then ac_cv_have_xpm="have_xpm=no" else ac_cv_have_xpm="have_xpm=yes \ vt_xpm_includes=$vt_xpm_includes vt_xpm_libraries=$vt_xpm_libraries \ vt_xpm_include_X11=$vt_xpm_include_X11" fi])dnl eval "$ac_cv_have_xpm" fi if test "$have_xpm" != yes; then AC_MSG_RESULT($have_xpm) no_xpm=yes else if test "$xpm_includes" != NO; then if test "$xpm_includes" != "$vt_xpm_includes"; then vt_xpm_include_X11=no if test -z "$xpm_includes"; then AC_TRY_CPP([#include ], vt_xpm_include_X11=yes) else if test -r "$xpm_includes/X11/xpm.h"; then vt_xpm_include_X11=yes fi fi fi vt_xpm_includes=$xpm_includes fi if test "x$xpm_libraries" != xNO; then vt_xpm_libraries=$xpm_libraries fi dnl# make some output so the user actually sees where his libs were found if test -z "$vt_xpm_libraries"; then dnl# hmm - the library was found by default without special need to specify the path dnl# try to find out what dir the lib was found in for i in $LDFLAGS; do test_dir=`echo $i | sed s@\^-L@@` if test -r $test_dir/libXpm.so -o -r $test_dir/libXpm.a; then xpm_libs_write=$test_dir break fi done else xpm_libs_write=$vt_xpm_libraries fi # Update the cache value to reflect the command line values. ac_cv_have_xpm="have_xpm=yes \ vt_xpm_includes=$vt_xpm_includes vt_xpm_libraries=$vt_xpm_libraries \ vt_xpm_include_X11=$vt_xpm_include_X11" eval "$ac_cv_have_xpm" AC_MSG_RESULT([-I$vt_xpm_includes, -L$xpm_libs_write]) if test -n "$vt_xpm_includes"; then HAVEXPM="NOXPM" else HAVEXPM="XPM" fi if test -n "$vt_xpm_includes"; then XPM_CFLAGS="-I$vt_xpm_includes" fi XPM_LIBS="-lXpm" if test -n "$vt_xpm_libraries"; then XPM_LIBS="-L$vt_xpm_libraries $XPM_LIBS" fi fi AC_SUBST(HAVEXPM) AC_SUBST(XPM_CFLAGS) AC_SUBST(XPM_LIBS) ]) dnl Internal subroutine of VT_FIND_LIBXPM dnl Set vt_xpm_include and vt_xpm_libr # -------------- find xpm.h and Xpm.a/Xpm.so/Xpm.sl AC_DEFUN(VT_XPM_DIRECT, [if test "$vt_xpm_includes" = NO; then # Guess where to find xpm.h # First, try using that file with no special directory specified. AC_TRY_CPP([#include ], [# We can compile using X headers with no special include directory. vt_xpm_includes= vt_xpm_include_X11=yes], [# Look for the header file in a standard set of common directories. for ac_dir in \ /usr/include \ /usr/include/X11 \ /usr/include/X11R6 \ /usr/include/X11R5 \ /usr/include/X11R4 \ \ /usr/local/include \ /usr/local/include/X11 \ /usr/local/include/X11R6 \ /usr/local/include/X11R5 \ /usr/local/include/X11R4 \ \ /usr/X11/include \ /usr/X11R6/include \ /usr/X11R5/include \ /usr/X11R4/include \ \ /usr/local/X11/include \ /usr/local/X11R6/include \ /usr/local/X11R5/include \ /usr/local/X11R4/include \ \ /usr/XFree86/include/X11 \ /usr/X386/include \ /usr/x386/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/X11/xpm.h"; then vt_xpm_includes="$ac_dir" vt_xpm_include_X11=yes break else if test -r "$ac_dir/xpm.h"; then vt_xpm_includes=$ac_dir break fi fi done]) fi if test "$vt_xpm_libraries" = NO; then # Check for the libraries. # See if we find them without any special options. # Don't add to $LIBS permanently. ac_save_LIBS="$LIBS" LIBS="-lXpm $LIBS -lX11" AC_TRY_LINK([char XpmReadFileToPixmap();], [XpmReadFileToPixmap()], [LIBS="$ac_save_LIBS" # We can link libXpm with no special library path. vt_xpm_libraries=], [LIBS="$ac_save_LIBS" # First see if replacing the include by lib works. for ac_dir in \ `echo "$vt_xpm_includes" | sed 's,include/X11,lib,;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 \ \ /usr/openwin/lib \ /usr/openwin/share/lib \ ; \ do ac_save_LIBS=$LIBS LIBS="-L$ac_dir -lXpm $LIBS -lX11" AC_TRY_LINK([char XpmReadFileToPixmap();], [XpmReadFileToPixmap()], [vt_xpm_libraries=$ac_dir; break;], [LIBS=$ac_save_LIBS]) done]) fi ]) # routines to find the jpeg library, the standard AC_CHECK_LIB() didn't # work on freebsd (VT_FIND_LIBXPM's source used) AC_DEFUN(VT_FIND_LIBJPEG, [ AC_REQUIRE_CPP() AC_MSG_CHECKING(for libjpeg) AC_ARG_WITH(jpeg_includes, [ --with-jpeg-includes=DIR use JPEG includes in DIR], jpeg_includes="$withval", jpeg_includes=NO) AC_ARG_WITH(jpeg_library, [ --with-jpeg-library=DIR use JPEG library in DIR], jpeg_libraries="$withval", jpeg_libraries=NO) AC_ARG_WITH(jpeg, [ --with-jpeg support JPEG image format [yes]]) if test "$with_jpeg" = no; then have_jpeg=disabled else AC_CACHE_VAL(ac_cv_have_jpeg, [ vt_jpeg_include_X11=no if test -n "$jpeg_includes"; then vt_jpeg_includes=$jpeg_includes else vt_jpeg_includes=NO fi if test -n "$jpeg_libraries"; then vt_jpeg_libraries=$jpeg_libraries else vt_jpeg_libraries=NO fi VT_JPEG_DIRECT if test "$vt_jpeg_includes" = NO -o "$vt_jpeg_libraries" = NO; then ac_cv_have_jpeg="have_jpeg=no" else ac_cv_have_jpeg="have_jpeg=yes \ vt_jpeg_includes=$vt_jpeg_includes vt_jpeg_libraries=$vt_jpeg_libraries \ vt_jpeg_include_X11=$vt_jpeg_include_X11" fi])dnl eval "$ac_cv_have_jpeg" fi if test "$have_jpeg" != yes; then AC_MSG_RESULT($have_jpeg) no_jpeg=yes else if test "$jpeg_includes" != NO; then if test "$jpeg_includes" != "$vt_jpeg_includes"; then vt_jpeg_include_X11=no if test -z "$jpeg_includes"; then AC_TRY_CPP([#include ], vt_jpeg_include_X11=yes) else if test -r "$jpeg_includes/X11/jpeglib.h"; then vt_jpeg_include_X11=yes fi fi fi vt_jpeg_includes=$jpeg_includes fi if test ! -n $jpeg_libraries; then vt_jpeg_libraries=$jpeg_libraries fi dnl# make some output so the user actually sees where his libs were found if test -z "$vt_jpeg_libraries"; then dnl# hmm - the library was found by default without special need to specify the path dnl# try to find out what dir the lib was found in for i in $LDFLAGS; do test_dir=`echo $i | sed s@\^-L@@` if test -r $test_dir/libjpeg.so -o -r $test_dir/libjpeg.a; then jpeg_libs_write=$test_dir break fi done else jpeg_libs_write=$vt_jpeg_libraries fi # Update the cache value to reflect the command line values. ac_cv_have_jpeg="have_jpeg=yes \ vt_jpeg_includes=$vt_jpeg_includes vt_jpeg_libraries=$vt_jpeg_libraries \ vt_jpeg_include_X11=$vt_jpeg_include_X11" eval "$ac_cv_have_jpeg" AC_MSG_RESULT([-I$vt_jpeg_includes, -L$jpeg_libs_write]) if test -n "$vt_jpeg_includes"; then HAVEJPEG="NOJPEG" else HAVEJPEG="JPEG" fi if test -n "$vt_jpeg_includes"; then JPEG_CFLAGS="-I$vt_jpeg_includes" fi JPEG_LIBS="-ljpeg" if test -n "$vt_jpeg_libraries"; then JPEG_LIBS="-L$vt_jpeg_libraries $JPEG_LIBS" fi fi AC_SUBST(HAVEJPEG) AC_SUBST(JPEG_CFLAGS) AC_SUBST(JPEG_LIBS) ]) AC_DEFUN(VT_JPEG_DIRECT, [if test "$vt_jpeg_includes" = NO; then # Guess where to find jpeglib.h # First, try using that file with no special directory specified. AC_TRY_CPP([#include ], [# We can compile using X headers with no special include directory. vt_jpeg_includes= vt_jpeg_include_X11=yes], [# Look for the header file in a standard set of common directories. for ac_dir in \ /usr/include \ /usr/local/include \ /usr/include/X11 \ /usr/include/X11R6 \ /usr/include/X11R5 \ /usr/include/X11R4 \ \ /usr/local/include/X11 \ /usr/local/include/X11R6 \ /usr/local/include/X11R5 \ /usr/local/include/X11R4 \ \ /usr/X11/include \ /usr/X11R6/include \ /usr/X11R5/include \ /usr/X11R4/include \ \ /usr/local/X11/include \ /usr/local/X11R6/include \ /usr/local/X11R5/include \ /usr/local/X11R4/include \ \ /usr/XFree86/include/X11 \ /usr/X386/include \ /usr/x386/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/jpeglib.h"; then vt_jpeg_includes="$ac_dir" vt_jpeg_include_X11=yes break else if test -r "$ac_dir/jpeglib.h"; then vt_jpeg_includes=$ac_dir break fi fi done]) fi if test "$vt_jpeg_libraries" = NO; then # Check for the libraries. # See if we find them without any special options. # Don't add to $LIBS permanently. ac_save_LIBS="$LIBS" LIBS="-ljpeg $LIBS" AC_TRY_LINK([char jpeg_destroy_compress();], [jpeg_destroy_compress()], [LIBS="$ac_save_LIBS" # We can link libjpeg with no special library path. vt_jpeg_libraries=], [LIBS="$ac_save_LIBS" # First see if replacing the include by lib works. for ac_dir in \ `echo "$vt_jpeg_includes" | sed 's,include/X11,lib,;s,include,lib,'` \ /usr/lib \ /usr/local/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/unsupported/lib \ /usr/athena/lib \ /usr/local/x11r5/lib \ /usr/lpp/Xamples/lib \ \ /usr/openwin/lib \ /usr/openwin/share/lib \ ; \ do ac_save_LIBS=$LIBS LIBS="-L$ac_dir -ljpeg $LIBS" AC_TRY_LINK([char jpeg_destroy_compress();], [jpeg_destroy_compress()], [vt_jpeg_libraries=$ac_dir; break;], [LIBS=$ac_save_LIBS]) done]) fi ]) # routines to find the png library, the standard AC_CHECK_LIB() didn't # work on freebsd (VT_FIND_LIBXPM's source used) AC_DEFUN(VT_FIND_LIBPNG, [ AC_REQUIRE_CPP() AC_MSG_CHECKING(for libpng) AC_ARG_WITH(png_includes, [ --with-png-includes=DIR use PNG includes in DIR], png_includes="$withval", png_includes=NO) AC_ARG_WITH(png_library, [ --with-png-library=DIR use PNG library in DIR], png_libraries="$withval", png_libraries=NO) AC_ARG_WITH(png, [ --with-png support PNG image format [yes]]) if test "$with_png" = no; then have_png=disabled else AC_CACHE_VAL(ac_cv_have_png, [ vt_png_include_X11=no if test -n "$png_includes"; then vt_png_includes=$png_includes else vt_png_includes=NO fi if test -n "$png_libraries"; then vt_png_libraries=$png_libraries else vt_png_libraries=NO fi VT_PNG_DIRECT if test "$vt_png_includes" = NO -o "$vt_png_libraries" = NO; then ac_cv_have_png="have_png=no" else ac_cv_have_png="have_png=yes \ vt_png_includes=$vt_png_includes vt_png_libraries=$vt_png_libraries \ vt_png_include_X11=$vt_png_include_X11" fi])dnl eval "$ac_cv_have_png" fi if test "$have_png" != yes; then AC_MSG_RESULT($have_png) no_png=yes else if test "$png_includes" != NO; then if test "$png_includes" != "$vt_png_includes"; then vt_png_include_X11=no if test -z "$png_includes"; then AC_TRY_CPP([#include ], vt_png_include_X11=yes) else if test -r "$png_includes/png.h"; then vt_png_include_X11=yes fi fi fi vt_png_includes=$png_includes fi if test "x$png_libraries" != xNO; then vt_png_libraries=$png_libraries fi dnl# make some output so the user actually sees where his libs were found if test -z "$vt_png_libraries"; then dnl# hmm - the library was found by default without special need to specify the path dnl# try to find out what dir the lib was found in for i in $LDFLAGS; do test_dir=`echo $i | sed s@\^-L@@` if test -r $test_dir/libpng.so -o -r $test_dir/libpng.a; then png_libs_write=$test_dir break fi done else png_libs_write=$vt_png_libraries fi # Update the cache value to reflect the command line values. ac_cv_have_png="have_png=yes \ vt_png_includes=$vt_png_includes vt_png_libraries=$vt_png_libraries \ vt_png_include_X11=$vt_png_include_X11" eval "$ac_cv_have_png" AC_MSG_RESULT([-I$vt_png_includes, -L$png_libs_write]) if test -n "$vt_png_includes"; then HAVEPNG="NOPNG" else HAVEPNG="PNG" fi if test -n "$vt_png_includes"; then PNG_CFLAGS="-I$vt_png_includes" fi PNG_LIBS="-lpng -lz -lm" if test -n "$vt_png_libraries"; then PNG_LIBS="-L$vt_png_libraries $PNG_LIBS" fi fi AC_SUBST(HAVEPNG) AC_SUBST(PNG_CFLAGS) AC_SUBST(PNG_LIBS) ]) AC_DEFUN(VT_PNG_DIRECT, [if test "$vt_png_includes" = NO; then # Guess where to find png.h # First, try using that file with no special directory specified. AC_TRY_CPP([#include ], [# We can compile using X headers with no special include directory. vt_png_includes= vt_png_include_X11=yes], [# Look for the header file in a standard set of common directories. for ac_dir in \ /usr/include \ /usr/local/include \ /usr/include/X11 \ /usr/include/X11R6 \ /usr/include/X11R5 \ /usr/include/X11R4 \ \ /usr/local/include/X11 \ /usr/local/include/X11R6 \ /usr/local/include/X11R5 \ /usr/local/include/X11R4 \ \ /usr/X11/include \ /usr/X11R6/include \ /usr/X11R5/include \ /usr/X11R4/include \ \ /usr/local/X11/include \ /usr/local/X11R6/include \ /usr/local/X11R5/include \ /usr/local/X11R4/include \ \ /usr/XFree86/include/X11 \ /usr/X386/include \ /usr/x386/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/png.h"; then vt_png_includes="$ac_dir" vt_png_include_X11=yes break else if test -r "$ac_dir/png.h"; then vt_png_includes=$ac_dir break fi fi done]) fi if test "$vt_png_libraries" = NO; then # Check for the libraries. # See if we find them without any special options. # Don't add to $LIBS permanently. ac_save_LIBS="$LIBS" LIBS="-lz -lm -lpng $LIBS" AC_TRY_LINK([char png_get_sRGB();], [png_get_sRGB()], [LIBS="$ac_save_LIBS" # We can link libpng with no special library path. vt_png_libraries=], [LIBS="$ac_save_LIBS" # First see if replacing the include by lib works. for ac_dir in \ `echo "$vt_png_includes" | sed 's,include/X11,lib,;s,include,lib,'` \ /usr/lib \ /usr/local/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/unsupported/lib \ /usr/athena/lib \ /usr/local/x11r5/lib \ /usr/lpp/Xamples/lib \ \ /usr/openwin/lib \ /usr/openwin/share/lib \ ; \ do ac_save_LIBS=$LIBS LIBS="-L$ac_dir -lz -lm -lpng $LIBS" AC_TRY_LINK([char png_get_sRGB();], [png_get_sRGB()], [vt_png_libraries=$ac_dir; break;], [LIBS=$ac_save_LIBS]) done]) fi ]) aterm-1.0.1/autoconf/configure.in0000644000175000001440000005735410654143276015470 0ustar vaeusersdnl# -*- sh -*- dnl# dnl# $Id: configure.in,v 1.19 2007/08/01 17:45:34 vae Exp $ dnl# dnl# Process this file with autoconf to produce a configure script. dnl# AC_INIT(aterm,1.00.01,as-bugs@afterstep.org,aterm.tar) AC_CONFIG_AUX_DIR(autoconf) AC_CONFIG_HEADER(config.h:autoconf/config.h.in) VERSION=$PACKAGE_VERSION VERSION_MAJOR="1" DATE="01 August 2007" LSMDATE="01Aug07" dnl ATERM version echo "#define VERSION \"$VERSION\"" > ${srcdir}/src/version.h echo "#define DATE \"$DATE\"" >> ${srcdir}/src/version.h AC_SUBST(VERSION) AC_SUBST(DATE) AC_SUBST(LSMDATE) echo "configuring for aterm $VERSION" MALLOC_TYPE=S dnl# -------------------------------------------------------------------------- dnl# CHECKING COMMAND LINE OPTIONS dnl# -------------------------------------------------------------------------- AC_ARG_ENABLE(utmp, [ --enable-utmp enable utmp/utmpx support], [if test x$enableval = xyes; then AC_DEFINE(UTMP_SUPPORT,1,[Define if you want to have utmp/utmpx support]) utmp_support=yes fi]) AC_ARG_ENABLE(wtmp, [ --enable-wtmp enable wtmp support if you have utmp/utmpx support], [if test x$enableval = xyes; then AC_DEFINE(WTMP_SUPPORT,1,[Define if you want to have wtmp support when utmp/utmpx is enabled]) wtmp_support=yes fi]) AC_ARG_ENABLE(kanji, [ --enable-kanji enable kanji support], [if test x$enableval = xyes; then AC_DEFINE(KANJI,1,[Define if you want KANJI support]) fi]) AC_ARG_ENABLE(big5, [ --enable-big5 enable big5 support], [if test x$enableval = xyes; then AC_DEFINE(ZH,1,[Define if you want chinese support]) fi]) AC_ARG_ENABLE(greek, [ --enable-greek enable greek keyboard support], [if test x$enableval = xyes; then AC_DEFINE(GREEK_SUPPORT,1,[Define if you want support for Greek Elot-928 & IBM-437 keyboard]) fi]) AC_ARG_ENABLE(thai, [ --enable-thai enable thai support], [if test x$enableval = xyes; then AC_DEFINE(THAI,1,[Define if you need Thai language support]) fi]) AC_ARG_ENABLE(ttygid,[ --enable-ttygid enable tty setting to group \"tty\" - use only if your system uses this type of security], [if test x$enableval = xyes; then AC_DEFINE(TTY_GID_SUPPORT,1,[Define if you want tty's to be setgid() to the `tty' group]) fi]) AC_ARG_ENABLE(backspace-key,[ --disable-backspace-key disable handling of the backspace key], [if test x$enableval = xno; then AC_DEFINE(NO_BACKSPACE_KEY,1,[Define if you don't want support for the backspace key]) fi]) AC_ARG_ENABLE(delete-key, [ --disable-delete-key disable handling of the delete key], [if test x$enableval = xno; then AC_DEFINE(NO_DELETE_KEY,1,[Define if you don't want support for the (non-keypad) delete key]) fi]) AC_ARG_ENABLE(resources, [ --disable-resources disable all resource checking], [if test x$enableval = xno; then AC_DEFINE(NO_RESOURCES,1,[Define if you don't want any resources read]) fi]) AC_ARG_ENABLE(xgetdefault,[ --enable-xgetdefault enable resources via X instead of our small version], [if test x$enableval = xyes; then AC_DEFINE(USE_XGETDEFAULT,1,[Define if you want to use XGetDefault instead of our internal version which only reads ~/.Xdefaults]) fi]) AC_ARG_ENABLE(memset, [ --disable-memset disable memset() function, use your system's instead], [if test x$enableval = xno; then AC_DEFINE(NO_RMEMSET,1,[Define if you want to use your system's memset()]) fi]) AC_ARG_ENABLE(swapscreen, [ --disable-swapscreen disable swap screen support], [if test x$enableval = xno; then AC_DEFINE(NO_SECONDARY_SCREEN,1,[Disable the secondary screen (Esc(47h) / Esc(47l))]) fi]) AC_ARG_ENABLE(keepscrolling, [ --disable-keepscrolling disable continual scrolling on scrollbar arrow press], [if test x$enableval = xno; then AC_DEFINE(NO_SCROLLBAR_BUTTON_CONTINUAL_SCROLLING,1,[Define if you want continual scrolling on when you keep the scrollbar button pressed]) fi]) AC_ARG_ENABLE(mousewheel, [ --disable-mousewheel disable scrolling via mouse wheel or buttons 4 & 5], [if test x$enableval = xno; then AC_DEFINE(NO_MOUSE_WHEEL,1,[Use wheel events (button4 and button5) to scroll]) fi]) AC_ARG_ENABLE(old-selection, [ --enable-old-selection enable v2.20 (and prior) mouse selection - this implies old word selection], [if test x$enableval = xyes; then AC_DEFINE(OLD_SELECTION,1,[Define to use old rxvt (ver 2.20 and before) style selection, not xterm style.]) fi]) AC_ARG_ENABLE(old-wordselect, [ --enable-old-wordselect enable v2.20 (and prior) mouse selection of words], [if test x$enableval = xyes; then AC_DEFINE(OLD_WORD_SELECTION,1,[Define to use old word selection (double click) style for you older users]) fi]) AC_ARG_ENABLE(dmalloc, [ --enable-dmalloc enable Gray Watson's malloc - for debugging use], [if test x$enableval = xyes; then MALLOC_TYPE=G DEBUG=-DDEBUG_MALLOC DLIB="-L/usr/local/lib -ldmalloc" DINCLUDE=-I/usr/local/include fi]) AC_ARG_ENABLE(dlmalloc, [ --enable-dlmalloc enable Doug Lea's malloc - for production use - enable only one malloc package], [if test x$enableval = xyes; then MALLOC_TYPE=D DEBUG= DLIB="-L/usr/local/lib -ldlmalloc" DINCLUDE= fi]) AC_ARG_WITH(term,[ --with-term=NAME set the terminal to NAME (default \"xterm\")], [if test x$withval != x; then AC_DEFINE_UNQUOTED(TERMENV,"$withval",[Set TERM to the value given by configure]) term="$withval" fi]) AC_ARG_WITH(terminfo, [ --with-terminfo=PATH set the path to the terminfo tree to PATH], [if test x$withval != x; then AC_DEFINE_UNQUOTED(RXVT_TERMINFO,"$withval",[Set TERMINFO value to the value given by configure]) terminfo="$withval" fi]) AC_ARG_WITH(libefence, [ --with-libefence compile with libefence to debug buffer overruns [no] ],with_libefence=$withval,with_libefence="") AC_ARG_ENABLE(gdb, [ --enable-gdb add gdb symbols (-g) (for debugging) [no] ],enable_gdb=$enableval,enable_gdb="no") AC_ARG_ENABLE(sigsegv, [ --enable-sigsegv enable internal handler of Segmentation Fault (for self-diagnostics) [yes] ],enable_sigsegv=$enableval,enable_sigsegv="yes") AC_ARG_ENABLE(transparency, [ --enable-transparency enable transparent background [yes] ],enable_transparency=$enableval, enable_transparency="yes") if test "x$enable_transparency" = "xyes"; then AC_DEFINE(TRANSPARENT,1,[Define if you want to have a transparent background]) transparent=yes; fi dnl# The following is passed directly to libAfterImage configure : AC_ARG_WITH(afterimage_config, [ --with-afterimage-config=DIR use libAfterImage config script in DIR], afterimage_config="$withval",afterimage_config=NO) AC_ARG_WITH(afterstep_config, [ --with-afterstep-config=DIR use libAfterStep config script in DIR], afterstep_config="$withval",afterstep_config=NO) dnl# -------------------------------------------------------------------------- AC_AIX dnl# -------------------------------------------------------------------------- AC_DEFINE(PROTOTYPES,1,Define if you need function prototypes) dnl# -------------------------------------------------------------------------- dnl# Supply default CFLAGS, if not specified by `CFLAGS=flags ./configure' dnl# if test -z "$CFLAGS"; then if test -z "$CCOPTS"; then CCOPTS='-O' dnl> if test "x$GCC" = xyes; then dnl> if test x$system = xLinux; then dnl> CCOPTS="$CCOPTS "'-O2 -fno-strength-reduce' dnl> fi dnl> fi fi CFLAGS="$CCOPTS" fi dnl# Checks for programs. dnl# AC_MAKE_SET AC_PROG_CC AC_PROG_CPP export CC export GCC export prefix export exec_prefix AC_PROG_INSTALL dnl# now we need to play abot with CFLAGS : dnl# Remove -g if test -n "`echo $CFLAGS' ' | grep '\-g ' 2> /dev/null`" ; then CFLAGS=`echo "$CFLAGS " | sed "s/-g / /"` fi dnl# Add -Wall if test "x$GCC" = "xyes"; then if test -z "`echo $CFLAGS | grep '\-Wall' 2> /dev/null`" ; then CFLAGS="$CFLAGS -Wall" fi fi dnl# Add -fPIC for IA64 compilation AC_CYGWIN if test "x$CYGWIN" = "x" -a "x$GCC" = "xyes" ; then if test -z "`echo $CFLAGS | grep '\-fPIC' 2> /dev/null`" ; then CFLAGS="$CFLAGS -fPIC" fi fi dnl# Add -g if test "x$enable_gdb" = "xyes"; then CFLAGS="$CFLAGS -g -DDEBUG_STRICT" LDFLAGS="$LDFLAGS -g" else CFLAGS="$CFLAGS -DNO_DEBUG_OUTPUT" fi dnl# Add -pg if test "x$enable_gprof" = "xyes"; then CFLAGS="$CFLAGS -pg" LDFLAGS="$LDFLAGS -pg" fi dnl# Add lots more warnings if test "x$enable_warn" = "xyes"; then CFLAGS="$CFLAGS -Wuninitialized -Wwrite-strings -Wcast-qual -Wbad-function-cast -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Wconversion -Wcomment -Wcast-align -Winline -Wshadow -Wredundant-decls -Wid-clash-31" fi if test "x$GCC" = "xyes"; then LDFLAGS="$LDFLAGS -rdynamic" fi dnl# done with flags - lets export those for our children to use : export CFLAGS export LDFLAGS dnl# install checks : AC_PROG_INSTALL dnl# if the path to the install program is relative, make it absolute currdir=`pwd` INSTALL=`echo $INSTALL|sed -e "s@\^\.\.@${currdir}@" -e "s@^autoconf@${currdir}/autoconf@"` INSTALL_PROGRAM=`echo $INSTALL_PROGRAM|sed -e "s@\^\.\.@${currdir}@" -e "s@^autoconf@${currdir}/autoconf@"` INSTALL_DATA=`echo $INSTALL_DATA|sed -e "s@\^\.\.@${currdir}@" -e "s@^autoconf@${currdir}/autoconf@"` INSTALL_LIB=`echo $INSTALL_LIB|sed -e "s@\^\.\.@${currdir}@" -e "s@^autoconf@${currdir}/autoconf@"` export INSTALL export INSTALL_PROGRAM export INSTALL_DATA export INSTALL_LIB AC_PROG_RANLIB export RANLIB AC_PATH_PROG(RM, rm, rm) export RM AC_PATH_PROG(MV, mv, mv) export MV AC_PATH_PROG(CP, cp, cp) export CP AC_PATH_PROG(MKDIR, mkdir, mkdir) export MKDIR AC_PATH_PROG(PERL, perl, perl) export PERL AC_PATH_PROG(FIND, find, find) export FIND AC_PATH_PROG(XARGS, xargs, xargs) export XARGS AC_PATH_PROG(LDCONFIG, ldconfig, ldconfig, $PATH:/sbin:/usr/local/sbin) export LDCONFIG AC_PATH_PROG(SED, sed, sed) export SED dnl# check for wait is particularly nasty : AC_FUNC_WAIT3 if test "x$ac_cv_func_wait3_rusage" = "xyes"; then DO_HAVE_WAIT3=yes export DO_HAVE_WAIT3 fi dnl# Check for X : AC_PATH_XTRA x_libs="$LDFLAGS $X_LIBS $X_EXTRA_LIBS $X_PRE_LIBS" XEXTENTIONS_LIBS= AC_CHECK_LIB(X11, XOpenDisplay, [x_libs="-lX11 $x_libs"],,$x_libs) AC_CHECK_LIB(Xext, XShapeCombineMask, [XEXTENTIONS_LIBS="-lXext";AC_DEFINE(SHAPE,1,[Define if you want Shaped Extension support])],,$x_libs) PATH_XTRA_CHECKED=yes export PATH_XTRA_CHECKED export x_includes export X_CFLAGS export X_LIBS export X_EXTRA_LIBS export X_PRE_LIBS export CPP export have_x dnl# DONE WITH COMMON STUFF dnl# ############################################################# dnl# first configuringlibraries : have_afterbase=no have_afterimage=no have_afterstep=no LIBAFTERIMAGE_CFLAGS= LIBAFTERSTEP_CFLAGS= AFTERIMAGE_LIBS= AFTERSTEP_LIB= dnl# if needed - check for external libAfterImage and libAfterBase : AC_MSG_CHECKING(if distributed as part of AfterStep) if test -d ../../libAfterBase && -d ../../libAfterImage && -d ../../libAfterStep ; then LIBAFTERIMAGE_CFLAGS= LIBAFTERSTEP_CFLAGS=-I../../.. AFTERIMAGE_LIBS=-L../../../libAfterImage -L../../../libAfterBase -lAfterImage -lAfterBase `../../libAfterImage/afterimage-config --libs --external-only` AFTERSTEP_LIB=-L../../../libAfterStep -lAfterStep have_afterbase=yes have_afterimage=yes have_afterstep=yes AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) AC_MSG_CHECKING(installed libAfterImage) if test "$afterimage_config" = "NO" ; then if afterimage-config --version > /dev/null 2>&1 ; then afterimage_config=afterimage-config else if test -x /usr/local/bin/afterimage-config; then afterimage_config=/usr/local/bin/afterimage-config fi fi else afterimage_config=$afterimage_config/afterimage-config fi if $afterimage_config --version > /dev/null 2>&1 ; then LIBAFTERIMAGE_CFLAGS=`$afterimage_config --cflags` AFTERIMAGE_LIBS=`$afterimage_config --libs` have_afterbase=`$afterimage_config --have-afterbase` if test "x$AFTERIMAGE_LIBS" != "x"; then have_afterimage=yes fi fi if test "x$have_afterimage" = "xyes"; then AC_MSG_RESULT($AFTERIMAGE_LIBS) AC_MSG_CHECKING(libAfterStep) if test "$afterstep_config" = "NO" ; then if afterstep-config --version > /dev/null 2>&1 ; then afterstep_config=afterstep-config else if test -x /usr/local/bin/afterstep-config; then afterstep_config=/usr/local/bin/afterstep-config fi fi else afterstep_config=$afterstep_config/afterstep-config fi if test "$afterstep_config" != "NO" ; then if $afterstep_config --version >/dev/null 2>&1 ; then LIBAFTERSTEP_CFLAGS=`$afterstep_config --cflags` AFTERSTEP_LIBS=`$afterstep_config --libs` have_afterbase=yes if test "x$AFTERSTEP_LIBS" != "x"; then have_afterstep=yes fi fi fi if test "x$have_afterstep" = "xyes"; then AC_MSG_RESULT($AFTERSTEP_LIBS) else if test "$afterstep_config" != "NO" ; then AC_MSG_RESULT(afterstep-config not found in $afterstep_config) else AC_MSG_RESULT(afterstep-config not found) fi fi else if test "$afterstep_config" != "NO" ; then AC_MSG_RESULT(afterimage-config not found in $afterimage_config - no AfterStep integration available.) else AC_MSG_RESULT(afterimage-config not found - no AfterStep integration available.) fi AC_MSG_RESULT(AfterStep integration, and background image from file will not be available.) AC_MSG_RESULT(To enable background image support you will need to download and install) AC_MSG_RESULT(libAfterImage from ftp://ftp.afterstep.org/stable/libAfterImage/ and then re-run this script.) fi fi if test "x$have_afterbase" = "xyes"; then AC_DEFINE(HAVE_AFTERBASE,1,[Defined if AfterBase library is available]) fi if test "x$have_afterimage" = "xyes"; then AC_DEFINE(HAVE_AFTERIMAGE,1,[Defined if AfterImage library is available]) AC_DEFINE(BACKGROUND_IMAGE,1,[Defined if we can have background images]) fi if test "x$have_afterstep" = "xyes"; then AC_DEFINE(HAVE_AFTERSTEP,1,[Defined if AfterStep library is available, and MyStyles could be used to define background image]) fi if test "x$LIBAFTERIMAGE_CFLAGS" = "x$LIBAFTERSTEP_CFLAGS"; then LIBAFTERIMAGE_CFLAGS= fi AC_SUBST(LIBAFTERIMAGE_CFLAGS) AC_SUBST(LIBAFTERSTEP_CFLAGS) AC_SUBST(AFTERIMAGE_LIBS) AC_SUBST(AFTERSTEP_LIBS) dnl> end new Check for image libraries NNNNNNNNNNNNNNNNNNNNNNNNNN dnl# system hacks AC_ISC_POSIX dnl# -------------------------------------------------------------------------- dnl# CHECKING FOR HEADER FILES dnl# -------------------------------------------------------------------------- AC_HEADER_SYS_WAIT AC_CHECK_HEADERS( \ assert.h \ fcntl.h \ grp.h \ libc.h \ lastlog.h \ stdarg.h \ stdlib.h \ string.h \ termios.h \ unistd.h \ utmpx.h \ sys/byteorder.h \ sys/ioctl.h \ sys/select.h \ sys/sockio.h \ sys/time.h \ ) AC_HEADER_TIME AC_CHECK_FUNCS(getpt) AC_C_CONST AC_C_INLINE dnl> AC_HEADER_STDC dnl# skip this test, Sun always fails anyhow. dnl# -------------------------------------------------------------------------- dnl# CHECKING FOR MISSING TYPEDEFS dnl# -------------------------------------------------------------------------- dnl# Missing typedefs and replacements AC_TYPE_MODE_T dnl> AC_CHECK_TYPE(umode_t, int) dnl> AC_CHECK_TYPE(off_t, long) AC_TYPE_PID_T AC_TYPE_UID_T AC_CHECK_SIZEOF(char, 1) AC_CHECK_SIZEOF(short, 2) AC_CHECK_SIZEOF(int, 4) AC_CHECK_SIZEOF(long, 4) AC_CHECK_SIZEOF(int *, 4) dnl# ugly if test "$cross_compiling" = yes; then echo "configure: warning: Define SIZEOF_* values in config.h manually" fi dnl# we could probably pull this info from Xmd.h dnl# and these tests are ugly: depending on specials if test $ac_cv_sizeof_char -ge 2; then RINT16T=char AC_DEFINE(RINT16T, char,[Defines 16 bit wide type]) AC_DEFINE(RUINT16T, unsigned char,[Defines unsigned 16 bit wide type]) else if test $ac_cv_sizeof_short -ge 2; then RINT16T=short AC_DEFINE(RINT16T, short,[Defines 16 bit wide type]) AC_DEFINE(RUINT16T, unsigned short,[Defines unsigned 16 bit wide type]) else if test $ac_cv_sizeof_int -ge 2; then RINT16T=int AC_DEFINE(RINT16T, int,[Defines 16 bit wide type]) AC_DEFINE(RUINT16T, unsigned int,[Defines unsigned 16 bit wide type]) else dnl What a fantastic system ? RINT16T=long AC_DEFINE(RINT16T, long,[Defines 16 bit wide type]) AC_DEFINE(RUINT16T, unsigned long,[Defines unsigned 16 bit wide type]) fi fi fi if test $ac_cv_sizeof_char -ge 4; then RINT32T=char AC_DEFINE(RINT32T, char,[Defines 32 bit wide type]) AC_DEFINE(RUINT32T, unsigned char,[Defines unsigned 32 bit wide type]) else if test $ac_cv_sizeof_short -ge 4; then RINT32T=short AC_DEFINE(RINT32T, short,[Defines 32 bit wide type]) AC_DEFINE(RUINT32T, unsigned short,[Defines unsigned 32 bit wide type]) else if test $ac_cv_sizeof_int -ge 4; then RINT32T=int AC_DEFINE(RINT32T, int,[Defines 32 bit wide type]) AC_DEFINE(RUINT32T, unsigned int,[Defines unsigned 32 bit wide type]) else dnl What a fantastic system ? RINT32T=long AC_DEFINE(RINT32T, long,[Defines 32 bit wide type]) AC_DEFINE(RUINT32T, unsigned long,[Defines unsigned 32 bit wide type]) fi fi fi if test $ac_cv_sizeof_char -eq $ac_cv_sizeof_int_p; then RINTPT=char AC_DEFINE(RINTPT, char,[obscure data type]) AC_DEFINE(RUINTPT, unsigned char,[obscure data type]) else if test $ac_cv_sizeof_short -eq $ac_cv_sizeof_int_p; then RINTPT=short AC_DEFINE(RINTPT, short,[obscure data type]) AC_DEFINE(RUINTPT, unsigned short,[obscure data type]) else if test $ac_cv_sizeof_int -eq $ac_cv_sizeof_int_p; then RINTPT=int AC_DEFINE(RINTPT, int,[obscure data type]) AC_DEFINE(RUINTPT, unsigned int,[obscure data type]) else dnl what next? long long? quad? RINTPT=long AC_DEFINE(RINTPT, long,[obscure data type]) AC_DEFINE(RUINTPT, unsigned long,[obscure data type]) fi fi fi dnl# -------------------------------------------------------------------------- dnl# CHECKING FOR LIBRARY FUNCTIONS dnl# -------------------------------------------------------------------------- AC_TYPE_SIGNAL dnl> AC_FUNC_VPRINTF AC_CHECK_FUNCS( \ atexit \ unsetenv \ setutent \ seteuid \ ) dnl# check for host field in utmp structure AC_CACHE_CHECK(for host in utmp struct, rxvt_cv_struct_utmp_host, [AC_TRY_COMPILE([#include #ifdef HAVE_UTMPX_H #include #else #include #endif], [ #ifdef HAVE_UTMPX_H struct utmpx ut; #else struct utmp ut; #endif ut.ut_host;], rxvt_cv_struct_utmp_host=yes, rxvt_cv_struct_utmp_host=no)]) if test "$rxvt_cv_struct_utmp_host" = yes; then AC_DEFINE(HAVE_UTMP_HOST,1,[Define if struct utmp/utmpx contains ut_host]) fi dnl# find utmp if test "$ac_cv_header_utmpx_h" = yes; then AC_CACHE_CHECK(where utmp is located, rxvt_cv_path_utmp, [for utmp_file in dnl /var/run/utmp /var/adm/utmpx /etc/utmpx; do if test -f "$utmp_file" ; then rxvt_cv_path_utmp=$utmp_file break fi done ]) AC_DEFINE(_GNU_SOURCE,1,[GNU source]) else AC_CACHE_CHECK(where utmp is located, rxvt_cv_path_utmp, [for utmp_file in dnl /var/run/utmp /var/adm/utmp /etc/utmp /usr/etc/utmp /usr/adm/utmp; do if test -f "$utmp_file" ; then rxvt_cv_path_utmp=$utmp_file break fi done ]) fi if test "${rxvt_cv_path_utmp+set}" = set; then AC_DEFINE_UNQUOTED(RXVT_UTMP_FILE, "$rxvt_cv_path_utmp",[Define location of utmp/utmpx]) fi dnl# find wtmp AC_CACHE_CHECK(where wtmp is located, rxvt_cv_path_wtmp, [for wtmp_file in dnl /var/log/wtmp /var/adm/wtmp /etc/wtmp /usr/etc/wtmp /usr/adm/wtmp; do if test -f "$wtmp_file" ; then rxvt_cv_path_wtmp=$wtmp_file break fi done ]) if test "${rxvt_cv_path_wtmp+set}" = set; then AC_DEFINE_UNQUOTED(RXVT_WTMP_FILE, "$rxvt_cv_path_wtmp",[Define location of wtmp/wtmpx]) fi dnl# find ttys/ttytab AC_CACHE_CHECK(where ttys/ttytab is located, rxvt_cv_path_ttytab, [for ttys_file in dnl /etc/ttys /etc/ttytab; do if test -f "$ttys_file" ; then rxvt_cv_path_ttytab=$ttys_file break fi done ]) if test "${rxvt_cv_path_ttytab+set}" = set; then AC_DEFINE_UNQUOTED(TTYTAB_FILENAME, "$rxvt_cv_path_ttytab",[Define location of ttys/ttytab]) fi dnl# this is a really hack test for some basic Xlocale stuff SAVETHELIBS=$LIBS LIBS="$LIBS $X_LIBS $X_PRE_LIBS $X_EXTRA_LIBS -lX11 -lXmu" CFLAGS="$CFLAGS $X_CFLAGS" AC_CACHE_CHECK(for working Xlocale, rxvt_cv_func_xlocale, [AC_TRY_RUN( [#define X_LOCALE 1 #include #include main() { char *p; if ((p = XSetLocaleModifiers("@im=none")) != NULL && *p) exit (XSupportsLocale() ? 0 : 1); else exit (1);} ],rxvt_cv_func_xlocale=yes, rxvt_cv_func_xlocale=no, AC_MSG_WARN([Define NO_XLOCALE in config.h manually]))]) if test "${rxvt_cv_func_xlocale}" = no; then AC_DEFINE(NO_XLOCALE,1,[Define if Xlocale support doesn't work]) fi LIBS=$SAVETHELIBS AC_CACHE_CHECK(for working setlocale, rxvt_cv_func_xsetlocale, [AC_TRY_LINK([#define X_LOCALE 1 #include ], [setlocale(LC_CTYPE, "");], rxvt_cv_func_xsetlocale=yes, rxvt_cv_func_xsetlocale=no)]) if test "${rxvt_cv_func_xsetlocale}" = no; then AC_DEFINE(NO_XSETLOCALE) fi AC_CACHE_CHECK(for working plain setlocale, rxvt_cv_func_setlocale, [AC_TRY_LINK([#include ], [setlocale(LC_CTYPE, "");], rxvt_cv_func_setlocale=yes, rxvt_cv_func_setlocale=no)]) if test x${rxvt_cv_func_setlocale} = xno; then AC_DEFINE(NO_SETLOCALE,1,[Define is setlocale (defined to Xsetlocale) doesn't work]) fi dnl> AC_CHECK_FUNCS(gettimeofday putenv select socket) CFLAGS=${CFLAGS--O} LDFLAGS=${LDFLAGS--O} CPPFLAGS="$CPPFLAGS" AC_SUBST(DEBUG) AC_SUBST(DLIB) AC_SUBST(DINCLUDE) AC_SUBST(CFLAGS) AC_SUBST(CPPFLAGS) AC_SUBST(LDFLAGS) AC_SUBST(X_LIBS) AC_SUBST(XEXTENTIONS_LIBS) AC_SUBST(LIBS) dnl# common parts of the Makefile MCOMMON=./autoconf/Make.common AC_SUBST_FILE(MCOMMON) AC_OUTPUT(autoconf/Make.common \ Makefile \ doc/Makefile \ src/Makefile \ src/graphics/Makefile \ scripts/random_colors ) chmod 755 scripts/random_colors echo "Configuration: Aterm version: ${VERSION} : ${DATE} Source code location: ${srcdir} Install path: ${prefix}/bin Compiler: ${CC} Compiler flags: ${CFLAGS}" echo " Background image support :" echo " AfterImage library: ${AFTERIMAGE_LIB}" echo " supporting image format libraries: ${AFTERIMAGE_LIBS}" if test "${have_afterstep}" = yes; then echo " with AfterStep MyStyles support available" else echo " without AfterStep MyStyles support" fi echo if test "${enable_transparency}" = yes; then echo " Transparency : enabled" else echo " Transparency : disabled" fi if test "$MALLOC_TYPE" = S; then echo " malloc support: system default" fi if test "$MALLOC_TYPE" = G; then echo " malloc support: Gray Watson's dmalloc" fi if test "$MALLOC_TYPE" = D; then echo " malloc support: Doug Lea's malloc" fi echo " The following are set in config.h " if test "${utmp_support}" != yes; then echo " utmp support: disabled " else echo " utmp support: enabled utmp file: ${rxvt_cv_path_utmp} wtmp file: ${rxvt_cv_path_wtmp} ttys/ttytab file: ${rxvt_cv_path_ttytab} " fi if test "x${term}" != x; then echo " set TERM to: ${term} " fi if test "x${terminfo}" != x; then echo " set TERMINFO to: ${terminfo} " fi echo " Type of 16bit: ${RINT16T} 32bit: ${RINT32T} pointer: (same as) ${RINTPT} " echo " *** Please check src/feature.h for further options *** " aterm-1.0.1/autoconf/config.guess0000755000175000001440000012430710155104161015452 0ustar vaeusers#! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. timestamp='2004-08-13' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Per Bothner . # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # The plan is that this can be called by configure scripts if you # don't specify an explicit build system type. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit 0 ;; --version | -v ) echo "$version" ; exit 0 ;; --help | --h* | -h ) echo "$usage"; exit 0 ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep __ELF__ >/dev/null then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit 0 ;; amd64:OpenBSD:*:*) echo x86_64-unknown-openbsd${UNAME_RELEASE} exit 0 ;; amiga:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; cats:OpenBSD:*:*) echo arm-unknown-openbsd${UNAME_RELEASE} exit 0 ;; hp300:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; luna88k:OpenBSD:*:*) echo m88k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mac68k:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; macppc:OpenBSD:*:*) echo powerpc-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvme68k:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvme88k:OpenBSD:*:*) echo m88k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvmeppc:OpenBSD:*:*) echo powerpc-unknown-openbsd${UNAME_RELEASE} exit 0 ;; sgi:OpenBSD:*:*) echo mips64-unknown-openbsd${UNAME_RELEASE} exit 0 ;; sun3:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; *:OpenBSD:*:*) echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE} exit 0 ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit 0 ;; macppc:MirBSD:*:*) echo powerppc-unknown-mirbsd${UNAME_RELEASE} exit 0 ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit 0 ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` exit 0 ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit 0 ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit 0 ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit 0;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit 0 ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit 0 ;; *:OS/390:*:*) echo i370-ibm-openedition exit 0 ;; *:OS400:*:*) echo powerpc-ibm-os400 exit 0 ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit 0;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit 0;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit 0 ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit 0 ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit 0 ;; DRS?6000:UNIX_SV:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7 && exit 0 ;; esac ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; i86pc:SunOS:5.*:*) echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit 0 ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit 0 ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit 0 ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit 0 ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit 0 ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit 0 ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit 0 ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit 0 ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit 0 ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit 0 ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit 0 ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit 0 ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit 0 ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c \ && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ && exit 0 echo mips-mips-riscos${UNAME_RELEASE} exit 0 ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit 0 ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit 0 ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit 0 ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit 0 ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit 0 ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit 0 ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit 0 ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit 0 ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit 0 ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit 0 ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit 0 ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit 0 ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit 0 ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit 0 ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit 0 ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 echo rs6000-ibm-aix3.2.5 elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit 0 ;; *:AIX:*:[45]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit 0 ;; *:AIX:*:*) echo rs6000-ibm-aix exit 0 ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit 0 ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit 0 ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit 0 ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit 0 ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit 0 ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit 0 ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then # avoid double evaluation of $set_cc_for_build test -n "$CC_FOR_BUILD" || eval $set_cc_for_build if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit 0 ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit 0 ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 echo unknown-hitachi-hiuxwe2 exit 0 ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit 0 ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit 0 ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit 0 ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit 0 ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit 0 ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit 0 ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit 0 ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit 0 ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit 0 ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit 0 ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit 0 ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit 0 ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit 0 ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit 0 ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit 0 ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit 0 ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit 0 ;; *:FreeBSD:*:*) echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit 0 ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit 0 ;; i*:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit 0 ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit 0 ;; x86:Interix*:[34]*) echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//' exit 0 ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit 0 ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit 0 ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit 0 ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit 0 ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit 0 ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu exit 0 ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit 0 ;; arm*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; cris:Linux:*:*) echo cris-axis-linux-gnu exit 0 ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; mips:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips #undef mipsel #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mipsel #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 ;; mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips64 #undef mips64el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mips64el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips64 #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit 0 ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit 0 ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit 0 ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit 0 ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit 0 ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit 0 ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit 0 ;; i*86:Linux:*:*) # The BFD linker knows what the default object file format is, so # first see if it will tell us. cd to the root directory to prevent # problems with other programs or directories called `ld' in the path. # Set LC_ALL=C to ensure ld outputs messages in English. ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ | sed -ne '/supported targets:/!d s/[ ][ ]*/ /g s/.*supported targets: *// s/ .*// p'` case "$ld_supported_targets" in elf32-i386) TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" ;; a.out-i386-linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" exit 0 ;; coff-i386) echo "${UNAME_MACHINE}-pc-linux-gnucoff" exit 0 ;; "") # Either a pre-BFD a.out linker (linux-gnuoldld) or # one that does not give us useful --help. echo "${UNAME_MACHINE}-pc-linux-gnuoldld" exit 0 ;; esac # Determine whether the default compiler is a.out or elf eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include #ifdef __ELF__ # ifdef __GLIBC__ # if __GLIBC__ >= 2 LIBC=gnu # else LIBC=gnulibc1 # endif # else LIBC=gnulibc1 # endif #else #ifdef __INTEL_COMPILER LIBC=gnu #else LIBC=gnuaout #endif #endif #ifdef __dietlibc__ LIBC=dietlibc #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0 test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit 0 ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit 0 ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit 0 ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit 0 ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit 0 ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit 0 ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit 0 ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit 0 ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit 0 ;; i*86:*:5:[78]*) case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit 0 ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit 0 ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i386. echo i386-pc-msdosdjgpp exit 0 ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit 0 ;; paragon:*:*:*) echo i860-intel-osf1 exit 0 ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit 0 ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit 0 ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit 0 ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit 0 ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && echo i486-ncr-sysv4.3${OS_REL} && exit 0 /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && echo i486-ncr-sysv4 && exit 0 ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit 0 ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit 0 ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit 0 ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit 0 ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit 0 ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit 0 ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit 0 ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit 0 ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit 0 ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit 0 ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit 0 ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit 0 ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit 0 ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit 0 ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit 0 ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit 0 ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit 0 ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit 0 ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit 0 ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit 0 ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit 0 ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit 0 ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit 0 ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit 0 ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in *86) UNAME_PROCESSOR=i686 ;; unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit 0 ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit 0 ;; *:QNX:*:4*) echo i386-pc-qnx exit 0 ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit 0 ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit 0 ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit 0 ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit 0 ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit 0 ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit 0 ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit 0 ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit 0 ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit 0 ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit 0 ;; *:ITS:*:*) echo pdp10-unknown-its exit 0 ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit 0 ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit 0 ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms && exit 0 ;; I*) echo ia64-dec-vms && exit 0 ;; V*) echo vax-dec-vms && exit 0 ;; esac esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0 # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit 0 ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit 0 ;; c34*) echo c34-convex-bsd exit 0 ;; c38*) echo c38-convex-bsd exit 0 ;; c4*) echo c4-convex-bsd exit 0 ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: aterm-1.0.1/autoconf/install-sh0000755000175000001440000001273610144447027015151 0ustar vaeusers#!/bin/sh # # install - install a program, script, or datafile # This comes from X11R5 (mit/util/scripts/install.sh). # # Copyright 1991 by the Massachusetts Institute of Technology # # Permission to use, copy, modify, distribute, and sell this software and its # documentation for any purpose is hereby granted without fee, provided that # the above copyright notice appear in all copies and that both that # copyright notice and this permission notice appear in supporting # documentation, and that the name of M.I.T. not be used in advertising or # publicity pertaining to distribution of the software without specific, # written prior permission. M.I.T. makes no representations about the # suitability of this software for any purpose. It is provided "as is" # without express or implied warranty. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. It can only install one file at a time, a restriction # shared with many OS's install programs. # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" transformbasename="" transform_arg="" instcmd="$mvprog" chmodcmd="$chmodprog 0755" chowncmd="" chgrpcmd="" stripcmd="" rmcmd="$rmprog -f" mvcmd="$mvprog" src="" dst="" dir_arg="" while [ x"$1" != x ]; do case $1 in -c) instcmd="$cpprog" shift continue;; -d) dir_arg=true shift continue;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; -s) stripcmd="$stripprog" shift continue;; -t=*) transformarg=`echo $1 | sed 's/-t=//'` shift continue;; -b=*) transformbasename=`echo $1 | sed 's/-b=//'` shift continue;; *) if [ x"$src" = x ] then src=$1 else # this colon is to work around a 386BSD /bin/sh bug : dst=$1 fi shift continue;; esac done if [ x"$src" = x ] then echo "install: no input file specified" exit 1 else true fi if [ x"$dir_arg" != x ]; then dst=$src src="" if [ -d $dst ]; then instcmd=: chmodcmd="" else instcmd=mkdir fi else # Waiting for this to be detected by the "$instcmd $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if [ -f $src -o -d $src ] then true else echo "install: $src does not exist" exit 1 fi if [ x"$dst" = x ] then echo "install: no destination specified" exit 1 else true fi # If destination is a directory, append the input filename; if your system # does not like double slashes in filenames, you may need to add some logic if [ -d $dst ] then dst="$dst"/`basename $src` else true fi fi ## this sed command emulates the dirname command dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` # Make sure that the destination directory exists. # this part is taken from Noah Friedman's mkinstalldirs script # Skip lots of stat calls in the usual case. if [ ! -d "$dstdir" ]; then defaultIFS=' ' IFS="${IFS-${defaultIFS}}" oIFS="${IFS}" # Some sh's can't handle IFS=/ for some reason. IFS='%' set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` IFS="${oIFS}" pathcomp='' while [ $# -ne 0 ] ; do pathcomp="${pathcomp}${1}" shift if [ ! -d "${pathcomp}" ] ; then $mkdirprog "${pathcomp}" else true fi pathcomp="${pathcomp}/" done fi if [ x"$dir_arg" != x ] then $doit $instcmd $dst && if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi else # If we're going to rename the final executable, determine the name now. if [ x"$transformarg" = x ] then dstfile=`basename $dst` else dstfile=`basename $dst $transformbasename | sed $transformarg`$transformbasename fi # don't allow the sed command to completely eliminate the filename if [ x"$dstfile" = x ] then dstfile=`basename $dst` else true fi # Make a temp file name in the proper directory. dsttmp=$dstdir/#inst.$$# # Move or copy the file name to the temp name $doit $instcmd $src $dsttmp && trap "rm -f ${dsttmp}" 0 && # and set any options; do chmod last to preserve setuid bits # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $instcmd $src $dsttmp" command. if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && # Now rename the file to the real destination. $doit $rmcmd -f $dstdir/$dstfile && $doit $mvcmd $dsttmp $dstdir/$dstfile fi && exit 0 aterm-1.0.1/autoconf/config.sub0000755000175000001440000007501010155104161015111 0ustar vaeusers#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. timestamp='2004-06-24' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, # Boston, MA 02111-1307, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit 0 ;; --version | -v ) echo "$version" ; exit 0 ;; --help | --h* | -h ) echo "$usage"; exit 0 ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit 0;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \ kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray) os= basic_machine=$1 ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | m32r | m32rle | m68000 | m68k | m88k | mcore \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64vr | mips64vrel \ | mips64orion | mips64orionel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | msp430 \ | ns16k | ns32k \ | openrisc | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv8 | sparcv9 | sparcv9b \ | strongarm \ | tahoe | thumb | tic4x | tic80 | tron \ | v850 | v850e \ | we32k \ | x86 | xscale | xstormy16 | xtensa \ | z8k) basic_machine=$basic_machine-unknown ;; m6811 | m68hc11 | m6812 | m68hc12) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* \ | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | mcore-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64vr-* | mips64vrel-* \ | mips64orion-* | mips64orionel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | msp430-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tron-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \ | xtensa-* \ | ymp-* \ | z8k-*) ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; c90) basic_machine=c90-cray os=-unicos ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16c) basic_machine=cr16c-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; mvs) basic_machine=i370-ibm os=-mvs ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; or32 | or32-*) basic_machine=or32-unknown os=-coff ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc) basic_machine=powerpc-unknown ;; ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tic54x | c54x*) basic_machine=tic54x-unknown os=-coff ;; tic55x | c55x*) basic_machine=tic55x-unknown os=-coff ;; tic6x | c6x*) basic_machine=tic6x-unknown os=-coff ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xps | xps100) basic_machine=xps100-honeywell ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sh64) basic_machine=sh64-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* | -openbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -kaos*) os=-kaos ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 # This also exists in the configure program, but was not the # default. # os=-sunos4 ;; m68*-cisco) os=-aout ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: aterm-1.0.1/autoconf/mkinstalldirs0000755000175000001440000000121110144447027015735 0ustar vaeusers#!/bin/sh # mkinstalldirs --- make directory hierarchy # Author: Noah Friedman # Created: 1993-05-16 # Last modified: 1994-03-25 # Public domain errstatus=0 for file in ${1+"$@"} ; do set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` shift pathcomp= for d in ${1+"$@"} ; do pathcomp="$pathcomp$d" case "$pathcomp" in -* ) pathcomp=./$pathcomp ;; esac if test ! -d "$pathcomp"; then echo "mkdir $pathcomp" 1>&2 mkdir "$pathcomp" || errstatus=$? fi pathcomp="$pathcomp/" done done exit $errstatus # mkinstalldirs ends here aterm-1.0.1/autoconf/config.h.in0000644000175000001440000001615510345342634015170 0ustar vaeusers/* autoconf/config.h.in. Generated from configure.in by autoheader. */ /* Defined if we can have background images */ #undef BACKGROUND_IMAGE /* Define if you want support for Greek Elot-928 & IBM-437 keyboard */ #undef GREEK_SUPPORT /* Defined if AfterBase library is available */ #undef HAVE_AFTERBASE /* Defined if AfterImage library is available */ #undef HAVE_AFTERIMAGE /* Defined if AfterStep library is available, and MyStyles could be used to define background image */ #undef HAVE_AFTERSTEP /* Define to 1 if you have the header file. */ #undef HAVE_ASSERT_H /* Define to 1 if you have the `atexit' function. */ #undef HAVE_ATEXIT /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H /* Define to 1 if you have the `getpt' function. */ #undef HAVE_GETPT /* Define to 1 if you have the header file. */ #undef HAVE_GRP_H /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_LASTLOG_H /* Define to 1 if you have the header file. */ #undef HAVE_LIBC_H /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the `seteuid' function. */ #undef HAVE_SETEUID /* Define to 1 if you have the `setutent' function. */ #undef HAVE_SETUTENT /* Define to 1 if you have the header file. */ #undef HAVE_STDARG_H /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_BYTEORDER_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_IOCTL_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SELECT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SOCKIO_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TIME_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have that is POSIX.1 compatible. */ #undef HAVE_SYS_WAIT_H /* Define to 1 if you have the header file. */ #undef HAVE_TERMIOS_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if you have the `unsetenv' function. */ #undef HAVE_UNSETENV /* Define to 1 if you have the header file. */ #undef HAVE_UTMPX_H /* Define if struct utmp/utmpx contains ut_host */ #undef HAVE_UTMP_HOST /* Define to 1 if you have the `wait3' system call. Deprecated, you should no longer depend upon `wait3'. */ #undef HAVE_WAIT3 /* Define if you want KANJI support */ #undef KANJI /* Define if you don't want support for the backspace key */ #undef NO_BACKSPACE_KEY /* Define if you don't want support for the (non-keypad) delete key */ #undef NO_DELETE_KEY /* Use wheel events (button4 and button5) to scroll */ #undef NO_MOUSE_WHEEL /* Define if you don't want any resources read */ #undef NO_RESOURCES /* Define if you want to use your system's memset() */ #undef NO_RMEMSET /* Define if you want continual scrolling on when you keep the scrollbar button pressed */ #undef NO_SCROLLBAR_BUTTON_CONTINUAL_SCROLLING /* Disable the secondary screen (Esc(47h) / Esc(47l)) */ #undef NO_SECONDARY_SCREEN /* Define is setlocale (defined to Xsetlocale) doesn't work */ #undef NO_SETLOCALE #undef NO_XSETLOCALE /* Define if Xlocale support doesn't work */ #undef NO_XLOCALE #undef USE_XIM /* Define to use old rxvt (ver 2.20 and before) style selection, not xterm style. */ #undef OLD_SELECTION /* Define to use old word selection (double click) style for you older users */ #undef OLD_WORD_SELECTION /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define if you need function prototypes */ #undef PROTOTYPES /* Define as the return type of signal handlers (`int' or `void'). */ #undef RETSIGTYPE /* Defines 16 bit wide type */ #undef RINT16T /* Defines 32 bit wide type */ #undef RINT32T /* obscure data type */ #undef RINTPT /* Defines unsigned 16 bit wide type */ #undef RUINT16T /* Defines unsigned 32 bit wide type */ #undef RUINT32T /* obscure data type */ #undef RUINTPT /* Set TERMINFO value to the value given by configure */ #undef RXVT_TERMINFO /* Define location of utmp/utmpx */ #undef RXVT_UTMP_FILE /* Define location of wtmp/wtmpx */ #undef RXVT_WTMP_FILE /* Define if you want Shaped Extension support */ #undef SHAPE /* The size of a `char', as computed by sizeof. */ #undef SIZEOF_CHAR /* The size of a `int', as computed by sizeof. */ #undef SIZEOF_INT /* The size of a `int *', as computed by sizeof. */ #undef SIZEOF_INT_P /* The size of a `long', as computed by sizeof. */ #undef SIZEOF_LONG /* The size of a `short', as computed by sizeof. */ #undef SIZEOF_SHORT /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Set TERM to the value given by configure */ #undef TERMENV /* Define if you need Thai language support */ #undef THAI /* Define to 1 if you can safely include both and . */ #undef TIME_WITH_SYS_TIME /* Define if you want to have a transparent background */ #undef TRANSPARENT /* Define location of ttys/ttytab */ #undef TTYTAB_FILENAME /* Define if you want tty's to be setgid() to the `tty' group */ #undef TTY_GID_SUPPORT /* Define if you want to use XGetDefault instead of our internal version which only reads ~/.Xdefaults */ #undef USE_XGETDEFAULT /* Define if you want to have utmp/utmpx support */ #undef UTMP_SUPPORT /* Define if you want to have wtmp support when utmp/utmpx is enabled */ #undef WTMP_SUPPORT /* Define to 1 if the X Window System is missing or not being used. */ #undef X_DISPLAY_MISSING /* Define if you want chinese support */ #undef ZH /* Define to 1 if on AIX 3. System headers sometimes define this. We just want to avoid a redefinition error message. */ #ifndef _ALL_SOURCE # undef _ALL_SOURCE #endif /* GNU source */ #undef _GNU_SOURCE /* Define to empty if `const' does not conform to ANSI C. */ #undef const /* Define to `int' if doesn't define. */ #undef gid_t /* Define to `__inline__' or `__inline' if that's what the C compiler calls it, or to nothing if 'inline' is not supported under any name. */ #ifndef __cplusplus #undef inline #endif /* Define to `int' if does not define. */ #undef mode_t /* Define to `int' if does not define. */ #undef pid_t /* Define to `int' if doesn't define. */ #undef uid_t aterm-1.0.1/README.configure0000644000175000001440000000705010144447023014154 0ustar vaeusers--enable-fading add support for darkening colors when aterm is loosing focus. that is off by default as far as that would cause aterm to use more colors, which is not good for folks with 8bpp. --enable-background-image add support for XPM background pixmaps, and JPEG and PNG background pixmaps if AfterStep was compiled with --enable-static-libs=no, and libasimage and libafterstep were installed in LD_LIBRARY_PATH. --enable-next-scroll make the scrollbar look like a NeXT scrollbar (Default) --enable-xterm-scroll make the scrollbar look like an Xterm scrollbar --enable-utmp write user and tty to utmp file (used by programs like ``w'') on creation of rxvt and delete when rxvt exits. --enable-wtmp write user and tty to wtmp file (used by programs like ``last'') on creation of rxvt and write logout when rxvt exits. --enable-menubar add support for our menu bar system --enable-graphics add support for our graphics mode (see src/graphics) --enable-half-shadow make shadows on the scrollbar only half the normal width & height. only applicable to non-Xterm scrollbars --enable-kanji add support for Kanji characters (EUC-JP or SJIS) --enable-big5 add support for Chinese characters (BIG5) --enable-greek add support for greek keyboard --enable-ttygid change tty device setting to group "tty" - only use this if your system uses this type of security --disable-backspace-key disable any handling of the backspace key by us - let the X server do it --disable-delete-key disable any handling of the delete key by us - let the X server do it --disable-resources remove all resources checking --enable-xgetdefault make resources checking via XGetDefault() instead of our small version which only checks ~/.Xdefaults, or if that doesn't exist then ~/.Xresources --disable-memset remove support for our possibly faster memset() function and use your system's version instead - which may be have hand-crafted in assembly. --disable-swapscreen remove support for swap screen --disable-keepscrolling remove support for continual scrolling of the display when you hold the mouse button down on a scrollbar arrow --disable-mousewheel remove support for scrolling via mouse wheel or buttons 4 & 5 --enable-old-selection revert mouse selection to something similar to v2.20 (and prior) - this implies word selection of those versions (i.e. next option) --enable-old-wordselect revert mouse selection of words (double-clicking) to something similar to v2.20 (and prior) --enable-dmalloc use Gray Watson's malloc - which is good for debugging See http://www.letters.com/dmalloc/ for details If you use either this or the next option, you may need to edit src/Makefile after compiling to point DINCLUDE and DLIB to the right places. You can only use either this option and the following (should you use either) --enable-dlmalloc use Doug Lea's malloc - which is good for a production version See http://g.oswego.edu/dl/html/malloc.html for details --with-term=NAME change the environmental variable for the terminal to NAME (default "xterm") --with-terminfo=PATH change the environmental variable for the path to the terminfo tree to PATH --with-x use the X Window System (pretty much default, eh?) --with-xpm-includes=DIR look for the XPM includes in DIR --with-xpm-library=DIR look for the XPM library in DIR --with-jpeg-includes=DIR look for the XPM includes in DIR --with-jpeg-library=DIR look for the XPM library in DIR --with-png-includes=DIR look for the XPM includes in DIR --with-png-library=DIR look for the XPM library in DIR aterm-1.0.1/Makefile.in0000644000175000001440000000627210654145624013376 0ustar vaeusers# ./Makefile.in -*- Makefile -*- # $Id: Makefile.in,v 1.3 2007/08/01 18:06:12 vae Exp $ @MCOMMON@ srcdir = @srcdir@ VPATH = @srcdir@ first_rule: all dummy: subdirs = src doc src/graphics DIST = INSTALL README.configure configure Makefile Makefile.in README.thai DIST_CFG = autoconf/aclocal.m4 autoconf/configure.in \ autoconf/config.h.in autoconf/acconfig.h autoconf/Make.common.in \ autoconf/install-sh autoconf/mkinstalldirs MKDIR = $(srcdir)/autoconf/mkinstalldirs #------------------------------------------------------------------------- all allbin alldoc tags clean: @for I in ${subdirs}; do (cd $$I; ${MAKE} $@ || exit 1); done # # entry points for other programs # aterm: (cd src; ${MAKE}) graphics qplot: (cd src/graphics; ${MAKE} qplot) #------------------------------------------------------------------------- configure: autoconf/configure.in autoconf/aclocal.m4 autoconf/acconfig.h autoconf/config.h.in cd $(srcdir); autoconf --localdir=$(srcdir)/autoconf \ autoconf/configure.in > configure chmod 755 configure config.status: if test -x config.status; then config.status --recheck; \ else $(SHELL) configure; fi autoconf/config.h.in: autoconf/configure.in autoconf/acconfig.h cd $(srcdir); autoheader --localdir=$(srcdir)/autoconf \ autoconf/configure.in > autoconf/config.h.in chmod 644 autoconf/config.h.in installdirs: $(MKDIR) $(DESTDIR)$(bindir) $(MKDIR) $(DESTDIR)$(mandir) install: installdirs @for I in $(subdirs); do (cd $$I; $(MAKE) DESTDIR=$(DESTDIR) $@ || exit 1); done uninstall: @for I in $(subdirs); do (cd $$I; $(MAKE) DESTDIR=$(DESTDIR) $@ || exit 1); done Makefiles: $(SHELL) config.status realclean: $(RMF) *~ config.cache @for I in ${subdirs}; do (cd $$I; ${MAKE} $@ || exit 1); done # distclean goal is for making a clean source tree, but if you have run # configure from a different directory, then doesn't destroy all your # hardly compiled and linked stuff. That's why there is always $(srcdir)/ # In that case most of those commands do nothing, except cleaning *~ # and cleaning source links. distclean: (cd $(srcdir); $(RMF) *~ config.cache config.h config.log config.status) @for I in $(subdirs); do (cd $$I; $(MAKE) $@ || exit 1); done (cd $(srcdir); $(RMF) Makefile autoconf/Make.common) $(RMF) autoconf/configure distdirs: mkdir ../$(VERNAME); mkdir ../$(VERNAME)/autoconf; @for I in $(subdirs); do (cd $$I; $(MAKE) $@ || (echo "Failed to make distclean in $$I"; exit 0) ); done distcopy: $(CP) -p $(DIST) ../$(VERNAME); $(CP) -p $(DIST_CFG) ../$(VERNAME)/autoconf; @for I in $(subdirs); do (cd $$I; $(MAKE) $@ || exit 1); done distrib: configure autoconf/config.h.in distdirs distcopy tar.gz: ../$(VERNAME).tar.gz ../$(VERNAME).tar.gz: (cd ..; tar cvf - $(VERNAME) | gzip -f9 > $(VERNAME).tar.gz) tar.Z: ../$(VERNAME).tar.Z ../$(VERNAME).tar.Z: (cd ..; tar cvf - $(VERNAME) | compress > $(VERNAME).tar.Z) tar.bz2: ../$(VERNAME).tar.bz2 ../$(VERNAME).tar.bz2: (cd ..; tar cvf - $(VERNAME) | bzip2 -f9 > $(VERNAME).tar.bz2) uuencode: tar.gz uuencode ../$(VERNAME).tar.gz $(VERNAME).tar.gz > ../$(VERNAME).tgz.uu ChangeLog: tools/cvs2cl.as.pl --hide-filenames --no-times # ------------------------------------------------------------------------ aterm-1.0.1/INSTALL0000644000175000001440000000463110144447023012347 0ustar vaeusers-------------------------------------------------------------------------- Using GNU autoconfig -------------------------------------------------------------------------- 1. Run ./configure to generate config.h and the various Makefiles. ./configure --help gives a list of possible options with slightly longer descriptions in README.configure Some systems require unusual options for compilation or linking that the `configure' script does not know about. You can give `configure' initial values for variables by setting them in the environment. Using a Bourne-compatible shell, you can do that on the command line like this: CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure Or on systems that have the `env' program, you can do it like this: env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure Or if you're using a non Bourne-compatible shell, you can do: sh -c 'CFLAGS="-O2 -g" ./configure 2. set any other main preferences: Edit "src/feature.h" Edit "config.h" if you didn't use ./configure options If you're cross-compiling, edit the following in "config.h" NO_XLOCALE SIZEOF_* # sizeof some types R*INT*T # types which are the same size # as 16bit/32bit/pointer 3. Build it (repeat step 2 as desired): make 4. Install aterm : make install you may also want to install doc/etc/rxvt.terminfo and doc/etc/rxvt.termcap 6 a. If compiled with UTMP_SUPPORT, you may need to install aterm setuid root or setuid/setgid to match the file permissions on /etc/utmp 6 b. You may need to install setuid root anyway for some systems so that they can give you ownership of the tty devices. 7. On systems which dislike doc/aterm.1 (cd doc; rm aterm.1; make aterm.1) =================================== NB: SunOS (with/without gcc?) gets reported by configure as #undef STDC_HEADERS #define HAVE_SYS_IOCTL_H 1 but the ioctl() defines aren't protected against multiple inclusion, in this case by so use a hack in "feature.h" to avoid the problem. Gave up checking for `STDC_HEADERS', since they really should be there and I don't want to deal with the problems when they don't exist. SunOS users might complain to the right places and get their system headers fixed so that one day the rest of us won't have to keep compensating :( SVR4 users (that aren't using gcc) will have to add -DSVR4 to CPPFLAGS for configure. -- EOF aterm-1.0.1/ChangeLog0000644000175000001440000001163710654146170013101 0ustar vaeusers 2007-08-01 vae * adding CL generation to makefiles * fixing configure bug * preparing configure for 1.0.1 * changed MWM HINTS, re gentoo bug #139554. 2006-06-26 sasha * fixed compile errors when no XLocale is available 2006-03-29 sasha * converted main.c back to unix mode * converted screen.c back to unix mode 2006-02-17 sasha * fixed bug preventing from pasting more then 16Kb into aterm 2006-02-13 sasha * minor cleanups * fix for the high-ascii pasting in screen.c - need to use XA_STRING ??? 2006-01-08 sasha * added patch for background refresh on desktop changes in ion3 when pixmap has not changed 2005-12-21 sasha * added uninstall target to the top Makefile 2005-12-06 sasha * Added patch for XIM support gratiously provided by calkin@ieee.org 2005-09-19 sasha * updated mappings for F1-F4 to modern \033OP, etc. * possibly fixed pasting on 64bit systems 2005-09-06 sasha * updated contacts info in man page * applyed term size patch from daniel@roe.ch 2005-07-11 sasha * fixed geometry printing into stderr 2005-07-05 sasha * updated ChangeLog for aterm 1.0 release * aterm 1.0.0 release 2005-06-21 sasha * fixed root pixmap retrieval when tint type is set to true 2005-06-20 sasha * fixed floating point exception when root pixmap is changed and aterm uses shading or some other non-fast transparency options; Fixed detection of WM support for desktops when aterm is started before window manager 2005-06-19 sasha * debugging disappearing windows with shading enabled - root background pixmap has size of 0x0 for some reason which crashes aterm 2005-06-09 sasha * updated Changelog * aterm 1.0.beta4 release 2005-06-03 sasha * added explicit type casts to signed/unsigned comparisons * better configure output when libsAfter are not found. Fixed to compile without libAfterBase but with libAfterImage * reimplemented background pixmap scaling; Added beter autodetection of AfterStep libs 2005-06-02 sasha * updated ChangeLog for 1.0.beta3 release * aterm 1.0.beta3 release * fixed compilation and fast transparency handling with AfterStep available 2005-05-31 sasha * added support for NET_WM_STATE Extended WM hints to see if aterm is shaded or hidden, and don't redraw background in such cases 2005-05-27 sasha * implemented and debugged checks for current desktop to avoid excessive background rendering 2005-05-26 sasha * added ExtWM specs compatible WM detection * changed timeouts in delayed background rendering code 2005-05-25 sasha * implemented delayed background rendering. Fixed handling of root background changes with MyStyles 2005-05-23 sasha * Implemented fast transparency when MyStyle is BackPixmap 129 with appropriate colors; Removed extra RenderPixmap call that seems to capture wrong part of screen anyway 2005-03-29 weinholt * Put title and section is the correct order. * Restore pre-tbl'ed tables. 2005-03-04 sasha * improved handling of \r chars coming in rapifd succession 2005-01-26 sasha * aterm now publishes its PID in accordance with Extended WM specs 2005-01-20 sasha * fixed compilation bug preeventing aterm to build without AfterStep * fixed bugs in configure detection of afterstep-config and afterimage-config * Updated ChangeLog to beta2 release * aterm 1.0.beta2 release * changed version for beta2 release 2005-01-19 sasha * added patches for copy-pasting and savelines thingy from gentoo * imported gentoo patch for QT pasting * applyed gentoo patches for borderless aterm using motif hints and internal border width - cmdline options -bl and -ib * fixed compilation with AS libraries compiled as dlls 2005-01-11 sasha * changelog updated * aterm 1.0.beta1 release * fixed bug in Makefile ommiting AS libs includes * prepared for 1.0.beta1 release 2004-12-14 sasha * fixed handling of root background when XROOTPMAP is not set 2004-12-06 weinholt * Changed src/version.h to ${srcdir}/src/version.h. * Updated config.sub and config.guess to latest versions. 2004-12-03 weinholt * Fix an uninitialized variable that would cause mute keys to repeat the previous keypress. 2004-11-24 sasha * fixed compile without libAfterStep 2004-11-17 sasha * Fixed background and foreground fetching from MyStyle 2004-11-16 sasha * fixed fore/back color handling from MyStyle * Updated configure to new version 1.00.beta1 * enabled fading by default and fixed fading for MyStyles * implemented tinting and shading when libAfterImage is not available 2004-11-15 sasha * Fixed handling of MyStyle property; background is updated when window moves and MyStyle is used; other background pixmap fixes * Fixed segfault while initializing with libAfterStep present 2004-11-12 sasha * added afterstep and afterimage related code 2004-11-10 sasha * began integrating with libAfterImage and libAfterStep * Initial revision * [no log message] aterm-1.0.1/ChangeLog.0.40000644000175000001440000003640210171044233013365 0ustar vaeusersaterm-0.4.2: *pixmap.c: Removed BENCHMARK ing in pixmap code *ximage_utils.c: fixed wrong ifdef commented in ximage_utils.c code *command.c: Added ifdef for getpt, as it is not available everywhere. aterm-0.4.1: *src/command: applied patch from Eric Benoit , which adds the "CSI 21 t" control sequence, for title handling. *command.c: getpt() patch by Gergely Nagy that fixes Unix PTY handling on some GLIBC systems. *upgraded version to 0.4.1 *aterm.lsm: fixed .lsm file to not cary version in its name - needed for correct CVS handling. *autoconf/configure.in: compilation fixes to get libafterstep to link *libafterstep.h: fixed theme support under AS 1.8.9 *thai.c: Added missing thai.c/h files *README.thai: Added missing README.thai *command.c: fixed keypad Home and down keys being mixed up. Added code to allow scrolling up/down for just one line (shift+arrow) contributed by djerome) *command.c: Fixed possible buffer overflow when changing display name. *main.c: fixed bug preventing from actually using -display cmd line option *ximage_utils.c: Some more improvement in new shading code using fixed bitshifts. Thanks to Reene Scharfe *Applyed patch supposedly adding support for Thai locale *ximage_utils.c: updated shading code for better speed *screen.c: applyed reverse video cursor patch *ximage_utils.c: applyed René Scharfe 's patch for better shading approach. *pixmap.c: Fixed compilation of pixmap.c to check for USE_LIBASIMAGE instead of headers. *initiated elfhame repositiory from sourceforge 0.4.01 version to facilitate development. *autoconf/configure.in: added /var/run/utmp as another possible location for utmp logs. Added define for _GNU_SOURCE. Thanks to Jordi Mallach for bug report and patch. aterm-0.4.0: *rxvt.h: fixed compile errors in utmp.c with some wierd wtmpx systems. *pixmap.c: fixed bug in libasimage and pixmap.c causing no transparency updates when window is partially off the desk. *pixmap.c: fixed transparency code so that shading can work when asteroot is not available. It should also stop X errors when aterm is outside of the screen and asetroot is not available. *main.c: patched up from the patch sent by Ryan Lovett ( originally written by Geoff Wing ) for the X Error of failed request: BadMatch (invalid parameter attributes) Major opcode of failed request: 2 (X_ChangeWindowAttributes) problem on Solaris (7). *different:borderWidth (-bw) option and resource support by Tim Riker *main.c: fixed to allow command line font and color option to stay after look update. *main.c: fixed memory leaks when changing Look. *main.c: fixed resize_windows() to not re-render pixmap on window moves if we only have gradients. *command.c: if root background is changing don't redraw ourself if we have a non-transparent texture in MyStyle. *pixmap.c: added support for MyStyle drawing of any Texture type. *main.c: tweaks to make command line options override default MyStyle stuff. *rxvt.h: added BGT_MyStyle background type, to know when we should use MyStyle drawing functionality. *main.c: fixed proportional font width calculation code - should fix segfaults and wierd text when proportional font is used. *pixmap.c: added ifdef so to use local pixmap functions only if libafterstep is not available. *libafterstep.h: fixed to cleanly compile when there are no AfterStep libraries available. *configure: AfterStep libraries are being checked for by default now, even if background-image is disabled. *command.c: added handler for _AS_STYLE property change so to track MyStyle changes. aterm updates its look automagically whenever AfterStep Look is updated. *screen.c: added on_colors_changed to refresh ourselves in case some or all colors got changed. *main.c: added rudimentary MyStyle support in case AfterStep libs and headers are available. ForeColor, BackColor and Font supported so far. *configure: now checks if afterstep header files are available - so that MyStyle and such things from AfterStep can be used. *libafterstep.h: collected all the afterstep related stuff in here - just include it and off you go. *scrollbar2.c: fixed scrollbar garbadge when small root pixmap is used. *pixmap.c: updated with latest stuff from aftertsep. *pixmap.c: (CopyAreaAndShade()) added X Error handler to avoid aterm death on WM restart. *pixmap.c: (CutWinPixmap()) added XClearWindow to avoid garbadge in transparent background when Pager/Esetroot is not running. aterm v.0.3.6 *scrollbar2.c: added icon masking functionality for nicer transparent scrollbars; *scrollbar2.c: added transparent background caching to reduce load on CPU when scrolling is done; *pixmap.c: (CutWinPixmap()) fixed bug causing unmapped scrollbars when window manager is started after aterm. *command.c: optimized FocusIn/Out event handling so not to clear screen if we are transparent - smother color fading. *command.c: (tt_write()) replaced with latest rxvt code; *command.c: (get_ourmods()) replaced with latest rxvt code - should fix NumLock problems. aterm v.0.3.5 *ChangeLog: reversed versions order. *configure: added --enable-fading option. It adds funcvtionality to darken/ brighten colors, when aterm looses focus. Use aterm -fade 50 to darken it by 50%. *xdefaults.c: - added new options : -fade # - turns fading on lost focus on. -trsb - makes scrollbar transparent. WORKS ONLY WITH NeXT SCROLLBAR. *main.c: (CreateWindows()) - added color allocation handling for -fade option *main.c: (FNUM_RANGE()) - changed to better hadle font increase/decrease. Allows for rollover and should work better on Sun Ultra. *main.c: (set_colorfgbg()) - fixed FG/BG color reporting when used with transparency and background image. *scrollbar2.c: (init_stuff()) - fixed colors to avoid compile problems, when NO_BRIGHTCOLOR is used. *scrollbar2.c: (scrollbar_show()) - added support for transparency in scrollbar. scrollbar_fill_back() does transparency and regular scrollbar background painting. Shading/tinting will be set to be the same as for whole aterm. *pixmap.c: (LoadBGPixmap()) - fixed to shade/tint background images when background image geometry is not specifyed. *command.c: (process_x_event()) - added functionality to FocusIn/FocusOut event to handle -fade option. *screen.c: (scr_refresh()) - added functionality to set foreground/background when focus has changed and -fade option used. *scripts: added two scripts - one for launching aterm with random tinting color (???), another for slideshow ( contributed by Ethan Fisher(allanon__) ). aterm v.0.3.4 *main.c: (SetBackgroundType()) - now correctly checks for shading being 100% and allows for fast transparency/tinting in that case. That brings fast transparency back in bussiness. *main.c: (resize_windows()) - now checks if root background has changed, and updates window even if it was not moved in this case. *main.c: (resize_windows()) - removed strange event checking loop so to get rid of unresized window problem, when resizing very fast. *screen.c: (CLEAR_CHARS(),CLEAR_ROWS()) - hopefully fixed random occuring bug when parts of the window close to the border were not cleared sometimes. *main.c: (resize_windows()) - fixed bug when window contents gets flushed on window move, if compiled without transparency and background image. *command.c: (process_x_event()) ReparentNotify message handler fixed to set parent windows backgrounds to ParentRelative in any transparency mode - that should fix problems that KDE users were having with it. Also XErrorHandler is set here to prevent crashes on Window Manager restarts. *ximage_utils.c: (ShadeXImage()) moved here from pixmap.c *ximage_utils.c: added some ifdefs to enable easy porting to/from AfterStep *ximage_utils.c: (ShadeXImage()) - uses correct data types for pointers - as the result shading should work fine now on 64-bit CPUs *pixmap.c: (GetMyPosition()) split in two - GetWinPosition() - more generic function. *pixmap.c: (GetMyPosition()) now sets error handler to prevent crashes - when restarting window manager. *pixmap.c: (ValidateSrcPixmap()) split in two ValidatePixmap() - is more generic version. ValidateSrcPixmap() is resetting root background ID if it changed. *pixmap.c: (CutPixmap()) chaged to more generic CutWinPixmap(). *pixmap.c: changed to reflect all this changes above. *configure.in: minor changes to improve libasimage detection. *rxvt.h: SB_WIDTH and other scrollbar parameters has been moved to feature.h so ppl don't have to edit rxvt.h every time they upgrade. aterm v.0.3.3 *Added -sh %, -bgtype , -txttype , -tinttype options. *Changed -tint to -tint to make possible different background and tinting colors. *Changed -pixmap meaning of geom now is the area of original image, to be cut out, and used as the background. *src/pixmap.c: complete rewrite of everything that was in there, to enable all those cool transformations. Includes Shading functions, stretching/ scaling/etc function, capturing of the root background, if root pixmap ID is not available.X errors handling to prevent crashing. *Added ximage_utils.c from AfterStep's libasimage, to be used when libasimage cannot be found, or linked with. *rxvt.h: Added ShadingInfo and BackgroundInfo structures to hold all background image information. Respectively TermWin.background member was added *rxvt.h: added one more color definition : tintColor *rxvt.h: added variables to hold all those new options. *main.c: added Background information initialization functions, and textType, tintType, and bgType parsing functions. *main.c: (CreateWindows())tintGC only created if we do fast transparency. *main.c: (CreateWindows())text GC is created using txttype option's function. *main.c: (resize_window())completely reworked to accomodate all new capabilities. It now checks for visibility, changed absolute position and size of the window prior to do any tinting/shading/rendering. That sometimes causing aterm not to perform shading on startup - will fix later. *main.c: (resize_window1())does not do scr_clear() anymore - it's done outside of it if needed. *command.c: PropertyChanged event handler modifyed to check for visibility prior to do tinting/shading/rendering. *screen.c: fast tinting is performed only if tintGC is available, instead of checking for Opt_tint. *command.c: added Rafal Wierzbicki changes to support for Unix98 ptys with linux-2.2.x and glibc-2.1 *added tools dir, and tools/makeatermversion script to automate new aterm version creating/tar-balling. *man pages hopefully updated. aterm v.0.3.2 *src/rxvt.h ParentWin1, ParentWin2 changed to array, first elem of which should always be main window of aterm (TermWin.parent) *src/main.c (resize_window()) added check for event code, not only event type, when checking for queued resizing events. That allows filtering of events that has nothing to do with resizing, and fixes screen refresh problems when aterm is mapped/unmapped. *src/screen.c (scr_clear_tint()) removed ClearWindow for parent windows. That seems to be unneccessary and that was causing aterm death on window manager restart. *src/main.c (resize_window()) changed to not query size of toppest parent window as far as it can become invalid on window manager's restart. That was also causing aterm's death on Window Manager restarts. aterm v.0.3.1 *src/command.c (process_x_event()) added check for _XROOTPMAP_ID value - so not to refresh screen when it's None - that fixes problem with aterm dieing on AfterStep restart. aterm v.0.3.0 *started new development version. USE IT WITH CAUTION !!! *Changed --enable-background-xpm to --enable-background-image. Due to wider image format support it makes better sense. *Added optional integration with AfterStep libraries for wider image format support. JPEG and PNG images can now be used as background, if shared AfterStep libraries are installed on system. libJPEG v.6.0a and/or libPNG v.1.0.2 or greater required. Imaging library detection macros has been taken from AfterStep distribution. AfterStep libs will only be used if configured with --enable-background-image flag. *--enable-aftersteplibs configure flag added to enable/disable AfterStep integration. Enabled by default. *the following configure options added to enable/disable image library usage : --with-xpm-includes=DIR use XPM includes in DIR --with-xpm-library=DIR use XPM library in DIR --with-xpm use XPM --with-jpeg-includes=DIR use JPEG includes in DIR --with-jpeg-library=DIR use JPEG library in DIR --with-jpeg support JPEG image format [yes] --with-png-includes=DIR use PNG includes in DIR --with-png-library=DIR use PNG library in DIR --with-png support PNG image format [yes] *src/feature.h removed obsolete code for XPM_BUFFERING support. *src/main.c (resize_window()) fixed bug when transparent background gets garbled, when Shading/Unshading aterm in AfterStep. *src/screen.c scr_clear() changed into scr_clear_tint(int bWithTinting) to enable/disable tinting while clearing window. scr_clear() is now a macro calling scr_clear_tint(1). *src/screen.c (scr_clear_tint()) fixed minor bug in tinting code to use TermWin_internalBorder instead of BORDERWIDTH *src/screen.c (CLEAR_CHARS(),CLEAR_ROWS()) fixed bug when clearing screen will keep tine border around window untinted. ( based on contribution from Michael Bruun Petersen" ) *src/main.c added (SetBackgroundPixmap(char* PixmapSpec)) to parse pixmap specification load/scale pixmap. *src/main.c (change_font()) added sanity check for font width, that will hopefully prevent aterm from crashing, when using some fonts. ( thanks to for suggestion ). *src/xpm.c moved to src/pixmap.c due to wider image format support that makes better sense. *src/pixmap.c removed obsolete code for XPM_BUFFERING *src/pixmap.c (set_bgPixmap()) modifyed for optional utilization of AfterStep libraries. *src/pixmap.c (resize_pixmap()) added support to prevent pixmap from tiling vertical, horizontal or in both directions. See src/feature.h to enable/disable this. ( contributed by Eric Tremblay ) *src/rxvt.h added : #include to fix compilation problems on some Solaris boxes. ( suggested by Albert Dorofeev ) *src/scrollbar2.c rewrote NeXT scrollbar code for better portability and configurability. Now scrollbar width and look can be changed at compile time, using options in rxvt.h. *src/rxvt.h added bunch of defines to enable NeXT scrollbar tweaking at compile time: /* could be anything from 13 to 19 but the true NeXT is 17 */ # define SB_WIDTH 17 /* this will define somemore parameters for shaping NeXTish scrollbars */ /* NEXT_SCROLL_CLEAN if defined removes shades of gray from buttons */ # undef NEXT_SCROLL_CLEAN # define NEXT_SCROLL_SQUARE_ARROWS # define SB_BORDER_WIDTH 1 /* this makes buttons thinner then scrollbar's base ( if more then 0 ) */ # define SIDE_STEP_WIDTH 0 /* end NeXT scrollbar specific fetures */ aterm v.0.2.0 *Started this ChangeLog. Old rxvt ChangeLog moved to doc/ChangeLog.rxvt *Converted documentation to aterm vs. rxvt *src/features.h [ATERM_PATH_ENV]: Added ATERMPATH env. variable to define PATH where to search for files. Aterm is now looking in ATERMPATH, then RXVTPATH, and only then in PATH. * --enable-transparency and --enable-next-scroll are now set by default.