c-hey2.1/0000700007632300017660000000000010015230214013155 5ustar c-heyprojects00000000000000c-hey2.1/debian/0000700007632300017660000000000010015227717014415 5ustar c-heyprojects00000000000000c-hey2.1/debian/README.Debian0000600007632300017660000000036510015222516016454 0ustar c-heyprojects00000000000000c-hey for Debian ---------------- This version of c-hey has been built with Readline Support and is available from the command-line as "hey", e.g "hey username" -- Colm MacCárthaigh , Tue, 30 Jul 2002 14:37:23 +0100 c-hey2.1/debian/changelog0000600007632300017660000000044110015222673016264 0ustar c-heyprojects00000000000000c-hey (2.1-1) unstable; urgency=low * Updated to 2.1 -- Colm MacCarthaigh Thu, 19 Feb 2004 21:07:56 +0000 c-hey (2.0-1) unstable; urgency=low * Initial Release. -- Colm MacCarthaigh Tue, 30 Jul 2002 14:37:23 +0100 c-hey2.1/debian/control0000600007632300017660000000117610015222516016017 0ustar c-heyprojects00000000000000Source: c-hey Section: utils Priority: optional Maintainer: Colm MacCarthaigh Build-Depends: libncurses5 , libreadline4-dev, debhelper (>> 3.0.0) Standards-Version: 3.5.2 Package: c-hey Architecture: any Depends: libc6 (>= 2.2.4-4), libreadline4 (>= 4.2a-4) Description: Frontend to write(1) for inter-terminal messaging c-hey is an implementation of "hey", the popular frontend to write(1) for inter-terminal messaging. It supports customised titles, borders and success messages and uses a fully-featured readline driven input engine supporting multi-line editing. . http://c-hey.redbrick.dcu.ie/ c-hey2.1/debian/copyright0000600007632300017660000000360310015222516016344 0ustar c-heyprojects00000000000000This package was debianized by Colm MacCarthaigh on Tue, 30 Jul 2002 14:37:23 +0100. It was downloaded from http://redbrick.dcu.ie/~c-hey/src.gzipped/c-hey2.0.tar.gz Upstream Author(s): pooka@redbrick.dcu.ie,colmmacc@redbrick.dcu.ie, bobb@redbrick.dcu.ie, jbolger@redbrick.dcu.ie Copyright: As many packaging systems require a licence you may consider c-hey to be licenced in accordance with the BSD-like licence below: Copyright (c) Cian Synnott. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the author nor the names of the contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. c-hey2.1/debian/dirs0000600007632300017660000000001010015222516015262 0ustar c-heyprojects00000000000000usr/bin c-hey2.1/debian/docs0000600007632300017660000000003410015222516015257 0ustar c-heyprojects00000000000000Readme doc/ansi doc/history c-hey2.1/debian/rules0000700007632300017660000000440710015222516015472 0ustar c-heyprojects00000000000000#!/usr/bin/make -f # Sample debian/rules that uses debhelper. # GNU copyright 1997 to 1999 by Joey Hess. # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 # This is the debhelper compatibility version to use. export DH_COMPAT=3 # These are used for cross-compiling and for saving the configure script # from having to guess our platform (since we know it already) DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS))) CFLAGS += -g endif ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) INSTALL_PROGRAM += -s endif config.status: configure dh_testdir # Add here commands to configure the package. ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info build: build-stamp build-stamp: config.status dh_testdir # Add here commands to compile the package. $(MAKE) #/usr/bin/docbook-to-man debian/c-hey.sgml > c-hey.1 touch build-stamp clean: dh_testdir dh_testroot rm -f build-stamp # Add here commands to clean up after the build process. -$(MAKE) distclean -test -r /usr/share/misc/config.sub && \ cp -f /usr/share/misc/config.sub config.sub -test -r /usr/share/misc/config.guess && \ cp -f /usr/share/misc/config.guess config.guess dh_clean install: build dh_testdir dh_testroot dh_clean -k dh_installdirs # Add here commands to install the package into debian/c-hey. $(MAKE) install prefix=$(CURDIR)/debian/c-hey/usr # Build architecture-independent files here. binary-indep: build install # We have nothing to do by default. # Build architecture-dependent files here. binary-arch: build install dh_testdir dh_testroot # dh_installdebconf dh_installdocs # dh_installexamples # dh_installmenu # dh_installlogrotate # dh_installemacsen # dh_installpam # dh_installmime # dh_installinit # dh_installcron dh_installman # dh_installinfo # dh_undocumented dh_installchangelogs dh_link dh_strip dh_compress dh_fixperms # dh_makeshlibs dh_installdeb # dh_perl # dh_shlibdeps dh_gencontrol dh_md5sums dh_builddeb binary: binary-indep binary-arch .PHONY: build clean binary-indep binary-arch binary install c-hey2.1/doc/0000700007632300017660000000000010015227713013734 5ustar c-heyprojects00000000000000c-hey2.1/doc/ansi0000600007632300017660000002713607404274352014635 0ustar c-heyprojects00000000000000Parameters used in ANSI escape sequences Pn Numeric parameter. Specifies a decimal number. Ps Selective parameter. Specifies a decimal number that you use to select a function. You can specify more than one function by separating the parameters with semicolons. PL Line parameter. Specifies a decimal number that represents one of the lines on your display or on another device. Pc Column parameter. Specifies a decimal number that represents one of the columns on your screen or on another device. ANSI escape sequences for cursor movement, graphics, and keyboard settings In the following list of ANSI escape sequences, the abbreviation ESC represents the ASCII escape character 27 (1Bh), which appears at the beginning of each escape sequence. ESC[PL;PcH Cursor Position: Moves the cursor to the specified position (coordinates). If you do not specify a position, the cursor moves to the home positionÄÄthe upper-left corner of the screen (line 0, column 0). This escape sequence works the same way as the following Cursor Position escape sequence. ESC[PL;Pcf Cursor Position: Works the same way as the preceding Cursor Position escape sequence. ESC[PnA Cursor Up: Moves the cursor up by the specified number of lines without changing columns. If the cursor is already on the top line, ANSI.SYS ignores this sequence. ESC[PnB Cursor Down: Moves the cursor down by the specified number of lines without changing columns. If the cursor is already on the bottom line, ANSI.SYS ignores this sequence. ESC[PnC Cursor Forward: Moves the cursor forward by the specified number of columns without changing lines. If the cursor is already in the rightmost column, ANSI.SYS ignores this sequence. ESC[PnD Cursor Backward: Moves the cursor back by the specified number of columns without changing lines. If the cursor is already in the leftmost column, ANSI.SYS ignores this sequence. ESC[s Save Cursor Position: Saves the current cursor position. You can move the cursor to the saved cursor position by using the Restore Cursor Position sequence. ESC[u Restore Cursor Position: Returns the cursor to the position stored by the Save Cursor Position sequence. ESC[2J Erase Display: Clears the screen and moves the cursor to the home position (line 0, column 0). ESC[K Erase Line: Clears all characters from the cursor position to the end of the line (including the character at the cursor position). ESC[Ps;...;Psm Set Graphics Mode: Calls the graphics functions specified by the following values. These specified functions remain active until the next occurrence of this escape sequence. Graphics mode changes the colors and attributes of text (such as bold and underline) displayed on the screen. Text attributes 0 All attributes off 1 Bold on 4 Underscore (on monochrome display adapter only) 5 Blink on 7 Reverse video on 8 Concealed on Foreground colors 30 Black 31 Red 32 Green 33 Yellow 34 Blue 35 Magenta 36 Cyan 37 White Background colors 40 Black 41 Red 42 Green 43 Yellow 44 Blue 45 Magenta 46 Cyan 47 White Parameters 30 through 47 meet the ISO 6429 standard. ESC[=psh Set Mode: Changes the screen width or type to the mode specified by one of the following values: 0 40 x 148 x 25 monochrome (text) 1 40 x 148 x 25 color (text) 2 80 x 148 x 25 monochrome (text) 3 80 x 148 x 25 color (text) 4 320 x 148 x 200 4-color (graphics) 5 320 x 148 x 200 monochrome (graphics) 6 640 x 148 x 200 monochrome (graphics) 7 Enables line wrapping 13 320 x 148 x 200 color (graphics) 14 640 x 148 x 200 color (16-color graphics) 15 640 x 148 x 350 monochrome (2-color graphics) 16 640 x 148 x 350 color (16-color graphics) 17 640 x 148 x 480 monochrome (2-color graphics) 18 640 x 148 x 480 color (16-color graphics) 19 320 x 148 x 200 color (256-color graphics) ESC[=Psl Reset Mode: Resets the mode by using the same values that Set Mode uses, except for 7, which disables line wrapping. The last character in this escape sequence is a lowercase L. ESC[code;string;...p Set Keyboard Strings: Redefines a keyboard key to a specified string. The parameters for this escape sequence are defined as follows:  Code is one or more of the values listed in the following table. These values represent keyboard keys and key combinations. When using these values in a command, you must type the semicolons shown in this table in addition to the semicolons required by the escape sequence. The codes in parentheses are not available on some keyboards. ANSI.SYS will not interpret the codes in parentheses for those keyboards unless you specify the /X switch in the DEVICE command for ANSI.SYS.  String is either the ASCII code for a single character or a string contained in quotation marks. For example, both 65 and "A" can be used to represent an uppercase A. IMPORTANT: Some of the values in the following table are not valid for all computers. Check your computer's documentation for values that are different. Key Code SHIFT+code CTRL+code ALT+code ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ F1 0;59 0;84 0;94 0;104 F2 0;60 0;85 0;95 0;105 F3 0;61 0;86 0;96 0;106 F4 0;62 0;87 0;97 0;107 F5 0;63 0;88 0;98 0;108 F6 0;64 0;89 0;99 0;109 F7 0;65 0;90 0;100 0;110 F8 0;66 0;91 0;101 0;111 F9 0;67 0;92 0;102 0;112 F10 0;68 0;93 0;103 0;113 F11 0;133 0;135 0;137 0;139 F12 0;134 0;136 0;138 0;140 HOME (num keypad) 0;71 55 0;119 ÄÄ UP ARROW (num keypad) 0;72 56 (0;141) ÄÄ PAGE UP (num keypad) 0;73 57 0;132 ÄÄ LEFT ARROW (num keypad) 0;75 52 0;115 ÄÄ RIGHT ARROW (num 0;77 54 0;116 ÄÄ keypad) END (num keypad) 0;79 49 0;117 ÄÄ DOWN ARROW (num keypad) 0;80 50 (0;145) ÄÄ PAGE DOWN (num keypad) 0;81 51 0;118 ÄÄ INSERT (num keypad) 0;82 48 (0;146) ÄÄ DELETE (num keypad) 0;83 46 (0;147) ÄÄ HOME (224;71) (224;71) (224;119) (224;151) UP ARROW (224;72) (224;72) (224;141) (224;152) PAGE UP (224;73) (224;73) (224;132) (224;153) LEFT ARROW (224;75) (224;75) (224;115) (224;155) RIGHT ARROW (224;77) (224;77) (224;116) (224;157) END (224;79) (224;79) (224;117) (224;159) DOWN ARROW (224;80) (224;80) (224;145) (224;154) PAGE DOWN (224;81) (224;81) (224;118) (224;161) INSERT (224;82) (224;82) (224;146) (224;162) DELETE (224;83) (224;83) (224;147) (224;163) PRINT SCREEN ÄÄ ÄÄ 0;114 ÄÄ PAUSE/BREAK ÄÄ ÄÄ 0;0 ÄÄ BACKSPACE 8 8 127 (0) ENTER 13 ÄÄ 10 (0 TAB 9 0;15 (0;148) (0;165) NULL 0;3 ÄÄ ÄÄ ÄÄ A 97 65 1 0;30 B 98 66 2 0;48 C 99 66 3 0;46 D 100 68 4 0;32 E 101 69 5 0;18 F 102 70 6 0;33 G 103 71 7 0;34 H 104 72 8 0;35 I 105 73 9 0;23 J 106 74 10 0;36 K 107 75 11 0;37 L 108 76 12 0;38 M 109 77 13 0;50 N 110 78 14 0;49 O 111 79 15 0;24 P 112 80 16 0;25 Q 113 81 17 0;16 R 114 82 18 0;19 S 115 83 19 0;31 T 116 84 20 0;20 U 117 85 21 0;22 V 118 86 22 0;47 W 119 87 23 0;17 X 120 88 24 0;45 Y 121 89 25 0;21 Z 122 90 26 0;44 1 49 33 ÄÄ 0;120 2 50 64 0 0;121 3 51 35 ÄÄ 0;122 4 52 36 ÄÄ 0;123 5 53 37 ÄÄ 0;124 6 54 94 30 0;125 7 55 38 ÄÄ 0;126 8 56 42 ÄÄ 0;126 9 57 40 ÄÄ 0;127 0 48 41 ÄÄ 0;129 - 45 95 31 0;130 = 61 43 ÄÄ- 0;131 [ 91 123 27 0;26 ] 93 125 29 0;27 92 124 28 0;43 ; 59 58 ÄÄ 0;39 ' 39 34 ÄÄ 0;40 , 44 60 ÄÄ 0;51 . 46 62 ÄÄ 0;52 / 47 63 ÄÄ 0;53 ` 96 126 ÄÄ (0;41) ENTER (keypad) 13 ÄÄ 10 (0;166) / (keypad) 47 47 (0;142) (0;74) * (keypad) 42 (0;144) (0;78) ÄÄ - (keypad) 45 45 (0;149) (0;164) + (keypad) 43 43 (0;150) (0;55) 5 (keypad) (0;76) 53 (0;143) ÄÄ c-hey2.1/doc/c-hey.10000600007632300017660000001253107715567651015054 0ustar c-heyprojects00000000000000.TH Hey 1 "31 Dec 2001 "" "Documentation for c-hey" .SH NAME hey \- send a message to another user .SH SYNOPSIS .BR hey [ options ] user[.ttyname ] user ... .SH DESCRIPTION .B Hey allows you to communicate with other users, by copying messages from your terminal to theirs. .PP You type the command: .B hey username and press enter. The message should then be entered. When you are finished typing the message, press Ctrl-D. The message will appear as follows. .PP .RS Message from you@yourhost on yourtty at hh:mm ... .RS .PD 0 oooooooooooooooooooooo .PP O Message Text O .PP oooooooooooooooooooooo .PD 1 .RE .RE .PP If the message contains any long lines word wrapping will be applied. .PP If the other user wants to reply, they must run .B Hey as well. .PP You can prevent people (other than the super-user) from writing to you with the .BR mesg (1) command. Some commands, for example .BR nroff (1) and .BR pr (1), may disallow heying automatically, so that your output isn't overwritten. .PP If the user you want to hey to is logged in on to more than one terminal, you can specify which terminal to .B hey to by specifying the terminal name. .PP .RS hey username.ttyname .RE .PP Alternatively you can allow .B hey to select one of the terminals - it will pick the one with the shortest idle time. This is so that if the user is logged in at work and also dialed up from home, the message will go to the right place. .PP .SH OPTIONS .IP \-w\ "" Word wrap after characters. must be between 10 and 70, or .B hey will wrap after seventy. .IP \-t\ "" Centers the string <title> in title bar of the message, so long as <title> is not more than 70 characters. .IP \-o\ "<footer>" Centers the string <footer> in the last line of the message, so long as <footer> is not more than 70 characters. .IP \-m Ignore potentially annoying mesg n warnings. .IP \-h Display .B hey help .IP \-c Display .B hey credits. .IP \-b\ "<borderstring>" Used to define the border used for the message. <borderstring> is a nine character string. The first character defines the default border character. All spaces later in the string will be replaced by this character. .RS The next four characters contain the top, bottom, left and right of the box. These characters will be filled by the default character if the string is less than 5 characters long. .RE .RS The next four characters define the characters for the top-left, top-right, bottom-left and bottom-right of the box. If the string is five characters long these will be filled by the default character. If the string is six, seven or eight characters long the character for the top-left corner will be used to fill the remaining corners. (Spaces here still become the default character. .RE .IP \-s\ "<success_message>" If you are pedantic about the exit message you can change it from the default: "groovy" by setting this command line argument. .RE .IP \-e\ "<eofstring>" Used instead of the traditional unix EOF, to indicate end of file, ie. when you are finished entering a hey. e.g. if eofstring is "." if you enter a "." on its own line in hey, hey will consider that the end of the hey and send it accordingly. .IP \-f\ filename Used to specify a file, filename, populated with usernames to send the hey message. .IP \-n\ "<maxnames>" Used to set the maximum number of usernames displayed as part of the prompt. .IP \-p\ "<prompt_string>" Used to set the hey prompt. The prompt is useful to let you know who you are heying. Any occurance of the string %u is replaced with a list of the people you are heying. If you are heying more than <maxnames> people, the string "..." will be shown to denote more users. This is to stop the prompt becoming unwieldly if you are sending a hey to a large number of users. Any occurance of the string %n is replaced with the number of users you are heying. %% is replaced by a literal "%". .PP .SH "ENVIROMENT VARIABLES" These enviroment variables allow you to set default values for the above options. The effects of all these variables are overridden if the appropriate command line option is used. .IP HEY_TITLE Sets the default title. .IP HEY_FOOTER Sets the default footer. .IP HEY_BORDERS Sets default border string. .IP HEY_WRAP Sets default width at which to word wrap. .IP HEY_SUCCESS Sets the default success message. .IP HEY_EOF Sets a replacement string to use as EOF. .IP HEY_PROMPT Sets the hey prompt string .IP HEY_MAXNAMES Sets the maximum number of usernames to include as part of the prompt string .PP .SH READLINE FUNCTIONS if c-hey was compiled with readline it will define the following functions for you to bind to in your inputrc : .IP hey_line_up Move <arg> lines up, <arg> is the readline numberic argument (defaults to 1) .IP hey_line_down Move <arg> lines down, <arg> is the readline numberic argument (defaults to 1) .IP hey_carriage_return A replacement carriage return handler, bound to '\\r' by default .IP hey_refresh refresh the hey "canvas", bound to ctrl-l by default .IP hey_arrows handle the arrow keys, bount to "\e[" and "\eO" by default .PP .SH "SEE ALSO" .BR mesg (1), .BR talk (1), .BR who (1), .BR write (1), .BR readline (info) .PP .SH CREDITS The C version of hey is by .RS 4 Cian Synnott <pooka@redbrick.dcu.ie> .RE For a history of hey, check out the 'history' file that comes with the distribution of c-hey. The dist is available at .RS 4 http://c-hey.redbrick.dcu.ie/ �����������������������������������������������������������������������������������������������������������������������������������������������������������������������c-hey2.1/doc/g_list.doc�����������������������������������������������������������������������������0000600�0076323�0001766�00000006330�07404274352�015721� 0����������������������������������������������������������������������������������������������������ustar �c-hey���������������������������projects������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Hey there, This is a simple implementation of a doubly-linked list. There's still stuff to be done, but so far it does generic storage of objects & freeing of them reliably afterwards, along with a nice traversal method, and key/data searching. Questions on it's use directed to me, Cian, pooka@redbrick.dcu.ie The functions you should know about are - #include <g_list.h> g_list *g_listAlloc (int (*keyFunc) (void *key, void *data)) Allocates and returns a brand new list for you. You've got to pass it the name of the function (it's that easy!) that you want to key the data with. See later. int g_listInsert (g_list *list, void *data, void (*freefunc)(void *data)) Inserts the data passed at the beginning of the list. freefunc is the name of the function that should be used to free the data held in the node when the node is freed. Note that this whole thing should only use structs for it's data, not primitives, 'cos otherwise you might get odd segfaults & things. int g_listAppend (g_list *list, void *data, void (*freefunc)(void *data)) Same as above, only it appends rather than inserts (surprise surprise). void *g_listTraverse (g_list *list) This is a bit special. In the initial call to it, you pass it the list you want to traverse, and it returns the first (head) piece of data from the list. In subsequent calls to move along the list, you pass NULL to it, much like strtok() (the Incredible Broken Function) works. When it's finished on the list, it returns NULL. There's examples in the accompanying half-finished test program. void *g_listGet (g_list *list, void *key) This returns the data in the list that matches the passed key, or NULL if no match is found. It does this by using the function you've written to do the match. That function should cast the arguments (key, data) to their proper types, and then do the neccessary comparison, returning 1 if it matches or 0 if it fails. int g_listDel (g_list *list, void *key) Matches in the same way as above, and deletes the node containing that data from the list (along with the data itself, using the freeFunc() you passed when inserting the data). int g_listFree (g_list *list) Frees the entire list, relatively safely. Probably still full of bugs. And, for the sugar on top, this thing can be used as a stack/queue too! (well, obviously I guess :o) int g_listPush (g_list *list, void *data, void (*freeFunc)()) int g_listQPut (g_list *list, void *data, void (*freeFunc)()) Pushes the data onto the stack/queue (list?). The args are exactly the same as for the Insert/Delete thingies. void *g_listPop (g_list *list); void *g_listQGet (g_list *list); Pops the last/first item onto the stack/queue off. LIFO/FIFO. Get a LIFO/FIFO. Note that these remove the item from the stack/queue. There you are. Mail me back improvements, if you're bothered looking at it. :o) It was written in about 2 hours, and debugged in only another 1, so it's prolly full of crap. Note also, that it was written using Borland TC on a 286, so any indentation fuckups are due to that old monster. ;o) Well, apart from my indenting style that is. ;o) Cian ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������c-hey2.1/doc/history��������������������������������������������������������������������������������0000600�0076323�0001766�00000010640�10015222467�015364� 0����������������������������������������������������������������������������������������������������ustar �c-hey���������������������������projects������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������I don't like legalese, so here I'll give a history of hey & it's various authors (as far as I've traced it back, that is; if anyone can fill me in on anything I'm missing let me know). The original hey program was written in the Bourne shell, because unix1, the TCD server it was developed on didn't have PERL. This shell program was develped by Adrian Colley, from TCD. Paul McGaley, a friend of Adrian's, later translated the hey program into a PERL version. Much Later, in DCU, another PERL version was written be Adam Kelly, Colin Whittaker & David Madden. At this point, it was noticed that many PERL interpreters had to start for people to send hey's back and forth, and so I figured it was worth a rewrite in C. c-hey's options and environment variables are taken from the Adam & Co. version. Since then much of the development has been untaken by RedBrick members such as Robert Crosbie, John Bolger and Colm MacCárthaigh. Notes: unix1: TCD UNIX server, back in "the day". TCD: Trinity College Dublin, Ireland. DCU: Dublin City University, Ireland. Redbrick: DCU Networking Society, Ireland. ------------------------------------------------------------------------------- Small ChangeLog: 1.2: Readline support was added by Robert Crosbie <bobb@redbrick.dcu.ie>. 1.3: Support for heying from a mesg n terminal was added by Colm Mac Cárthaigh <colmmacc@redbrick.dcu.ie>. 1.4: hey now issues a warning if there are no valid recipients } hey now initialises readline properly so that rl_readline_name="hey"; allowing $if "hey": constructs in the .inputrc A va_arg macro portability problem was fixed. An install tab was added to the makefile. autoconf support was enhanced, the configure script now searches for the correct compiler (and settings), install utility and system libraries. c-hey is now pretty portable ;) <colmmacc@redbrick.dcu.ie>. 1.5: extra warning "feature" from 1.4 removed x@rb's prompt patch for c-hey was rolled in to the main source - ability to have customisable prompts now possible - added -n option, because ppl like different lengths added specific eof support, a string can now be used to determine EOF instead of the standard unix way of doing things, this makes it easier for mac users .. apparantly! added much better handling of being switched between background and foreground, c-hey now refreshes your screen so you can more easily take up where you left off :) make install depend on "stripped" fixed gcc3.0 warnings <colmmacc@redbrick.dcu.ie> 2.0: screen handling was added, to allow multi-line editing this is one BIG change :) - includes bindable readline functions, with sane defaults - refresh on ctrl-l , for interrupted heys dependencies in Makefile.in now come from gcc -MM cleaned up the configure script a little <colmmacc@redbrick.dcu.ie> 2.1: BUGS: Adrian Colley suggested a number of bug fix's which included: - Calling printf from sighandlers. - g_listGet and g_listDel bugs. - hey_user structure sizes. - extra checking added to hey_prompt. - realloc() error handling added to hey_user_input. - Iterators used in dyn_pageRead, the old function wasn't reentrant because of it's static state. - strprint bugs. - set_mesg bug. - Extra checking added to hey_main. - Updates to c-hey/doc/history. Most of this bug fixes have been implemented by Colm MacCárthaigh <colmmacc@redbrick.dcu.ie> New Features: -f filename allows you to specify a file, filename, with a list of usernames to hey. This feature was introduced to allow easy heying of groups i.e. $ c-hey -f ~/.friends -o "<string>" Allows you to specify a "hey footer", string, for you hey. The hey footer is essentially the same thing as the hey title except it appears on the last line of the hey, rather than the first. It can be specified on it's own or with a hey title. These hacks were added by Mark Campbell <mark@redbrick.dcu.ie> Dave O'Connor (DoC) fixed the niggling warning that comes with readline when you pipe input into c-hey. ------------------------------------------------------------------------------- So there you go. If you like hey, let me know where you're using it so that I can massage my ego. Thanks Cian <pooka@redbrick.dcu.ie> ------------------------------------------------------------------------------ future releases of c-hey and bugfixes can be found @ http://c-hey.redbrick.dcu.ie/ ������������������������������������������������������������������������������������������������c-hey2.1/Copyright����������������������������������������������������������������������������������0000600�0076323�0001766�00000003073�07404274352�015100� 0����������������������������������������������������������������������������������������������������ustar �c-hey���������������������������projects������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������As many packaging systems require a licence you may consider c-hey to be licenced in accordance with the BSD-like licence below: Copyright (c) Cian Synnott. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the author nor the names of the contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������c-hey2.1/Makefile.in��������������������������������������������������������������������������������0000600�0076323�0001766�00000004313�07413740143�015244� 0����������������������������������������������������������������������������������������������������ustar �c-hey���������������������������projects������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Makefile for the C version of 'hey' # Author: Cian Synnott <pooka@redbrick.dcu.ie> # Date: Sun Nov 15 22:36:01 GMT 1998 # # $Id: Makefile.in,v 1.5 2001/12/31 01:33:23 c-hey Exp $ prefix = @prefix@ exec_prefix = @exec_prefix@ PREFIX = @prefix@ MANDIR = @mandir@ INSTALL = @INSTALL@ BINDIR = @bindir@ INSTALL_DIR = ${INSTALL} -m 0755 -d INSTALL_PROG = ${INSTALL} -s -m 0755 INSTALL_DATA = ${INSTALL} -m 0644 CC = @CC@ @SET_MAKE@ DEBUG = #-g -D_DEBUG INCLUDE = -I. -I/usr/local/include CFLAGS = @CFLAGS@ ${DEBUG} ${INCLUDE} -DWRITE_PROG=\"@WRITE@\" OBJECTS = hey_main.o hey_arg.o hey_format.o hey_readline.o @EDIT_OBJ@ \ hey_signal.o hey_logins.o dyn_page.o g_list.o aux.o @UT_OBJ@ BINARY = c-hey all: ${BINARY} Makefile ${BINARY}: ${OBJECTS} ${CC} ${CFLAGS} -o ${BINARY} ${OBJECTS} @LIBS@ # generated by 'gcc -MM *.c' aux.o: aux.c aux.h config.h dyn_page.o: dyn_page.c dyn_page.h g_list.o: g_list.c g_list.h hey_arg.o: hey_arg.c hey_arg.h g_list.h utent.h config.h aux.h hey_edit.o: hey_edit.c hey_edit.h hey_readline.h config.h hey_format.h \ dyn_page.h hey_arg.h g_list.h utent.h aux.h hey_format.o: hey_format.c hey_format.h dyn_page.h hey_arg.h g_list.h \ utent.h config.h hey_readline.h aux.h hey_logins.o: hey_logins.c hey_logins.h hey_arg.h g_list.h utent.h \ config.h aux.h hey_main.o: hey_main.c hey_arg.h g_list.h utent.h config.h \ hey_format.h dyn_page.h hey_signal.h hey_logins.h hey_readline.h \ hey_edit.h aux.h hey_readline.o: hey_readline.c hey_readline.h config.h hey_edit.h \ hey_format.h dyn_page.h hey_arg.h g_list.h utent.h aux.h hey_signal.o: hey_signal.c hey_signal.h hey_readline.h config.h \ hey_edit.h aux.h utent.o: utent.c utent.h config.h install: mkcat $(INSTALL_DIR) ${BINDIR} $(INSTALL_PROG) ${BINARY} ${BINDIR} @LN_S@ -f ${BINDIR}/${BINARY} ${BINDIR}/hey mkcat: $(INSTALL_DIR) ${MANDIR}/man1 $(INSTALL_DATA) doc/${BINARY}.1 ${MANDIR}/man1/ @LN_S@ -f ${MANDIR}/man1/${BINARY}.1 ${MANDIR}/man1/hey.1 deinstall: rm -f ${MANDIR}/man1/${BINARY}.1 rm -f ${MANDIR}/man1/hey.1 rm -f ${BINDIR}/${BINARY} rm -f ${BINDIR}/hey clean: rm -f *.o ${BINARY} distclean: clean rm -f Makefile config.h config.log config.status config.cache tags ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������c-hey2.1/Readme�������������������������������������������������������������������������������������0000600�0076323�0001766�00000002414�07404274352�014323� 0����������������������������������������������������������������������������������������������������ustar �c-hey���������������������������projects������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Hi, This is a C version of the Perl 'hey' program used here and there. It's nice. To install it, the usual ./configure make make install This will install the c-hey binary and manpage into the default prefix (/usr/local/) and create symlinks to each as hey and hey.1 That should do the trick. Let me know if you have to change anything to get it working on any system. Quick tour: ----------- aux.c, .h - Some support functions dyn_page.c, .h - A general-use growable buffer g_list.c, .h - A general-use list object hey_arg.c, .h - Parse the cmdline arguments & environment variables hey_format.c, .h - Read in & format user input hey_logins.c, .h - Check if a user is logged in/exists etc. hey_main.c - The business end hey_signal.c, .h - Handle/ignore signals & terminal settings utent.c, .h - Replacement *ut* functions for systems lacking them hey_readline.c, .h - libreadline independent hooks for readling lines hey_edit.c, .h - libreadline dependent screen handling, for multi-line editing Mail c-hey@redbrick.dcu.ie any improvements you can make to the code, or any suggestions & questions (feel free to ask about parts that are unclear) ... Thanks, Cian <pooka@redbrick.dcu.ie> ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������c-hey2.1/aux.c��������������������������������������������������������������������������������������0000600�0076323�0001766�00000002422�07715567651�014157� 0����������������������������������������������������������������������������������������������������ustar �c-hey���������������������������projects������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* ** File: aux.c ** Desc: Some generally useful functions for c-hey ... ** Auth: Cian Synnott <pooka@redbrick.dcu.ie> ** Date: Mon Dec 14 16:28:43 GMT 1998 ** ** $Id: aux.c,v 1.3 2003/08/11 01:21:45 c-hey Exp $ */ #include <stdarg.h> #include <stdlib.h> #include <string.h> #include <stdio.h> #include "aux.h" /* Do 'perror(msg)' and then exit with error .. */ void perror_exit(char *msg) { perror(msg); exit(1); } /* Printf-formatted error to stderr, then exit .. */ void printerr_exit(char *fmt, ...) { va_list args; va_start(args, fmt); vfprintf(stderr, fmt, args); exit(1); } /* Printf-formatted error, but no exit ... */ void printerr(char *fmt, ...) { va_list args; va_start(args, fmt); vfprintf(stderr, fmt, args); return; } /* If there's no system strdup(), make one up */ #ifndef HAVE_STRDUP char *mystrdup(const char *str) { char *ptr; if ((ptr = (char *) malloc(strlen(str) + 1)) == NULL) return NULL; strncpy(ptr, str, strlen(str)); return ptr; } #endif /* strcat functions, which dynamically allocates extra space as needed */ char * m_strcat(char *string, char *cat) { if((string = realloc(string, strlen(string) + strlen(cat) + 1)) == NULL) { perror_exit("hey: out of memory\n"); } strcpy(&string[strlen(string)] , cat); return string; } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������c-hey2.1/aux.h��������������������������������������������������������������������������������������0000600�0076323�0001766�00000001417�07413721216�014147� 0����������������������������������������������������������������������������������������������������ustar �c-hey���������������������������projects������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#ifndef _aux_h_ #define _aux_h_ /* ** File: aux.h ** Desc: Some generally useful functions for c-hey ... ** Auth: Cian Synnott <pooka@redbrick.dcu.ie> ** Date: Mon Dec 14 16:28:43 GMT 1998 ** ** $Id: aux.h,v 1.2 2001/12/30 23:26:06 c-hey Exp $ */ #include "config.h" /* Do 'perror(msg)' and then exit with error .. */ extern void perror_exit(char *msg); /* Printf-formatted error to stderr, then exit .. */ extern void printerr_exit(char *fmt, ...); /* Printf-formatted error, but no exit ... */ extern void printerr(char *fmt, ...); /* If there's no strdup() available, use my own */ #ifndef HAVE_STRDUP extern char *mystrdup(const char *str); #define strdup mystrdup #endif /* Memory allocating strcat function */ extern char *m_strcat(char *string, char *cat); #endif �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������c-hey2.1/config.h.in��������������������������������������������������������������������������������0000600�0076323�0001766�00000001367�07461102376�015233� 0����������������������������������������������������������������������������������������������������ustar �c-hey���������������������������projects������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#ifndef _config_h_ #define _config_h_ /* ** File: config.h.in ** Desc: Input file for autoconf; if you're reading this in config.h, well, ** you can more or less ignore it. ;o) ** Auth: Cian Synnott <pooka@redbrick.dcu.ie> ** Date: Mon Mar 20 13:54:59 GMT 2000 ** ** $Id: config.h.in,v 1.9 2002/04/22 21:47:42 c-hey Exp $ */ /* what version of hey is this */ #define HEY_VERSION "2.0" /* Have we got utmpx.h? */ #undef HAVE_UTMPX_H /* The signal handler return type */ #define RETSIGTYPE int; /* Is strdup() around in this implementation? */ #undef HAVE_STRDUP /* Do we have the *utent() functions? */ #undef HAVE_GETUTENT /* Do we have the readline library? */ #undef HAVE_LIBREADLINE /* do we have rl_ding ? */ #undef HAVE_RL_DING #endif �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������c-hey2.1/configure����������������������������������������������������������������������������������0000700�0076323�0001766�00000322257�07415461224�015120� 0����������������������������������������������������������������������������������������������������ustar �c-hey���������������������������projects������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by Autoconf 2.52. # # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. # 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 # Sed expression to map a string onto a valid variable name. as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi # Name of the executable. as_me=`echo "$0" |sed 's,.*[\\/],,'` if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi 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$$.file as_executable_p="test -f" # Support unset when possible. if (FOO=FOO; unset FOO) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # NLS nuisances. $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; } $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; } $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; } $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; } $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; } $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; } $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; } $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; } # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; } # 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` exec 6>&1 # # Initializations. # ac_default_prefix=/usr/local cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Maximum number of lines to put in a shell here document. # This variable seems obsolete. It should probably be removed, and # only ac_max_sed_lines should be used. : ${ac_max_here_lines=38} ac_unique_file="hey_arg.h" # 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. bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datadir='${prefix}/share' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' infodir='${prefix}/info' mandir='${prefix}/man' # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= ac_prev= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval "$ac_prev=\$ac_option" ac_prev= continue fi ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_option in -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_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 | --data | --dat | --da) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ | --da=*) datadir=$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" ;; -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'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "enable_$ac_feature='$ac_optarg'" ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -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 ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst \ | --locals | --local | --loca | --loc | --lo) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* \ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_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'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac 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; }; } ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` 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 paths. for ac_var in exec_prefix prefix do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* | NONE | '' ) ;; *) { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # Be sure to have absolute paths. for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ localstatedir libdir includedir oldincludedir infodir mandir do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* ) ;; *) { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. build=$build_alias host=$host_alias target=$target_alias # FIXME: should be removed in autoconf 3.0. 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 # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then its parent. ac_prog=$0 ac_confdir=`echo "$ac_prog" | sed 's%[\\/][^\\/][^\\/]*$%%'` test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. srcdir=$ac_confdir if test ! -r $srcdir/$ac_unique_file; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r $srcdir/$ac_unique_file; then if test "$ac_srcdir_defaulted" = yes; then { echo "$as_me: error: cannot find sources in $ac_confdir or .." >&2 { (exit 1); exit 1; }; } else { echo "$as_me: error: cannot find sources in $srcdir" >&2 { (exit 1); exit 1; }; } fi fi srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` ac_env_build_alias_set=${build_alias+set} ac_env_build_alias_value=$build_alias ac_cv_env_build_alias_set=${build_alias+set} ac_cv_env_build_alias_value=$build_alias ac_env_host_alias_set=${host_alias+set} ac_env_host_alias_value=$host_alias ac_cv_env_host_alias_set=${host_alias+set} ac_cv_env_host_alias_value=$host_alias ac_env_target_alias_set=${target_alias+set} ac_env_target_alias_value=$target_alias ac_cv_env_target_alias_set=${target_alias+set} ac_cv_env_target_alias_value=$target_alias ac_env_WRITE_set=${WRITE+set} ac_env_WRITE_value=$WRITE ac_cv_env_WRITE_set=${WRITE+set} ac_cv_env_WRITE_value=$WRITE ac_env_CC_set=${CC+set} ac_env_CC_value=$CC ac_cv_env_CC_set=${CC+set} ac_cv_env_CC_value=$CC ac_env_CFLAGS_set=${CFLAGS+set} ac_env_CFLAGS_value=$CFLAGS ac_cv_env_CFLAGS_set=${CFLAGS+set} ac_cv_env_CFLAGS_value=$CFLAGS ac_env_LDFLAGS_set=${LDFLAGS+set} ac_env_LDFLAGS_value=$LDFLAGS ac_cv_env_LDFLAGS_set=${LDFLAGS+set} ac_cv_env_LDFLAGS_value=$LDFLAGS ac_env_CPPFLAGS_set=${CPPFLAGS+set} ac_env_CPPFLAGS_value=$CPPFLAGS ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} ac_cv_env_CPPFLAGS_value=$CPPFLAGS ac_env_CPP_set=${CPP+set} ac_env_CPP_value=$CPP ac_cv_env_CPP_set=${CPP+set} ac_cv_env_CPP_value=$CPP # # 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 <<EOF \`configure' configures this package 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 \`..'] EOF cat <<EOF 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] --datadir=DIR read-only architecture-independent data [PREFIX/share] --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] --infodir=DIR info documentation [PREFIX/info] --mandir=DIR man documentation [PREFIX/man] EOF cat <<\EOF EOF fi if test -n "$ac_init_help"; then cat <<\EOF Some influential environment variables: WRITE path to a write-like utility CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a nonstandard directory <lib dir> CPPFLAGS C/C++ preprocessor flags, e.g. -I<include dir> if you have headers in a nonstandard directory <include dir> CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. EOF fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. ac_popdir=`pwd` for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue cd $ac_subdir # A "../" for each directory in /$ac_subdir. ac_dots=`echo $ac_subdir | sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'` case $srcdir in .) # No --srcdir option. We are building in place. ac_sub_srcdir=$srcdir ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_sub_srcdir=$srcdir/$ac_subdir ;; *) # Relative path. ac_sub_srcdir=$ac_dots$srcdir/$ac_subdir ;; esac # Check for guested configure; otherwise get Cygnus style configure. if test -f $ac_sub_srcdir/configure.gnu; then echo $SHELL $ac_sub_srcdir/configure.gnu --help=recursive elif test -f $ac_sub_srcdir/configure; then echo $SHELL $ac_sub_srcdir/configure --help=recursive elif test -f $ac_sub_srcdir/configure.ac || test -f $ac_sub_srcdir/configure.in; then echo $ac_configure --help else echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2 fi cd $ac_popdir done fi test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\EOF Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. EOF exit 0 fi exec 5>config.log cat >&5 <<EOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.52. Invocation command line was $ $0 $@ EOF { 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` hostinfo = `(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` PATH = $PATH _ASUNAME } >&5 cat >&5 <<EOF ## ------------ ## ## Core tests. ## ## ------------ ## EOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Also quote any args containing shell meta-characters. ac_configure_args= ac_sep= for ac_arg do case $ac_arg in -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c) ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" ac_sep=" " ;; *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg" ac_sep=" " ;; esac # Get rid of the leading space. done # 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. trap 'exit_status=$? # Save into config.log some information that might help in debugging. echo >&5 echo "## ----------------- ##" >&5 echo "## Cache variables. ##" >&5 echo "## ----------------- ##" >&5 echo >&5 # The following way of writing the cache mishandles newlines in values, { (set) 2>&1 | case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in *ac_space=\ *) sed -n \ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" ;; *) sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } >&5 sed "/^$/d" confdefs.h >conftest.log if test -s conftest.log; then echo >&5 echo "## ------------ ##" >&5 echo "## confdefs.h. ##" >&5 echo "## ------------ ##" >&5 echo >&5 cat conftest.log >&5 fi (echo; echo) >&5 test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" >&5 echo "$as_me: exit $exit_status" >&5 rm -rf conftest* confdefs* core core.* *.core 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 -rf conftest* confdefs.h # AIX cpp loses on an empty file, so make sure it contains at least a newline. echo >confdefs.h # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -z "$CONFIG_SITE"; then if test "x$prefix" != xNONE; then CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" else CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then { echo "$as_me:824: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} cat "$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:835: 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:843: 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 `(set) 2>&1 | sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; 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:859: 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:863: 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:869: 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:871: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:873: 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. It doesn't matter if # we pass some twice (in addition to the command line arguments). if test "$ac_new_set" = set; then case $ac_new_val in *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ac_configure_args="$ac_configure_args '$ac_arg'" ;; *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:892: 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:894: 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 case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac echo "#! $SHELL" >conftest.sh echo "exit 0" >>conftest.sh chmod +x conftest.sh if { (echo "$as_me:914: PATH=\".;.\"; conftest.sh") >&5 (PATH=".;."; conftest.sh) 2>&5 ac_status=$? echo "$as_me:917: \$? = $ac_status" >&5 (exit $ac_status); }; then ac_path_separator=';' else ac_path_separator=: fi PATH_SEPARATOR="$ac_path_separator" rm -f conftest.sh ac_config_headers="$ac_config_headers config.h" 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:936: 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_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:951: found $ac_dir/$ac_word" >&5 break done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:959: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:962: 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:971: 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 ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:986: found $ac_dir/$ac_word" >&5 break done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:994: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:997: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC 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:1010: 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_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:1025: found $ac_dir/$ac_word" >&5 break done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:1033: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:1036: 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 "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:1045: 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 ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_ac_ct_CC="cc" echo "$as_me:1060: found $ac_dir/$ac_word" >&5 break done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:1068: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:1071: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" 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:1084: 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 ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:1104: found $ac_dir/$ac_word" >&5 break done 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 set dummy "$ac_dir/$ac_word" ${1+"$@"} shift ac_cv_prog_CC="$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:1126: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:1129: 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 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:1140: 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_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:1155: found $ac_dir/$ac_word" >&5 break done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:1163: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:1166: 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 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:1179: 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 ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:1194: found $ac_dir/$ac_word" >&5 break done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:1202: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:1205: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_CC" && break done CC=$ac_ct_CC fi fi test -z "$CC" && { { echo "$as_me:1217: error: no acceptable cc found in \$PATH" >&5 echo "$as_me: error: no acceptable cc found in \$PATH" >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:1222:" \ "checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:1225: \"$ac_compiler --version </dev/null >&5\"") >&5 (eval $ac_compiler --version </dev/null >&5) 2>&5 ac_status=$? echo "$as_me:1228: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:1230: \"$ac_compiler -v </dev/null >&5\"") >&5 (eval $ac_compiler -v </dev/null >&5) 2>&5 ac_status=$? echo "$as_me:1233: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:1235: \"$ac_compiler -V </dev/null >&5\"") >&5 (eval $ac_compiler -V </dev/null >&5) 2>&5 ac_status=$? echo "$as_me:1238: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF #line 1242 "configure" #include "confdefs.h" int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.exe" # 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:1258: checking for C compiler default output" >&5 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` if { (eval echo "$as_me:1261: \"$ac_link_default\"") >&5 (eval $ac_link_default) 2>&5 ac_status=$? echo "$as_me:1264: \$? = $ac_status" >&5 (exit $ac_status); }; then # Find the output, starting from the most likely. This scheme is # not robust to junk in `.', hence go to wildcards (a.*) only as a last # resort. for ac_file in `ls a.exe conftest.exe 2>/dev/null; ls a.out conftest 2>/dev/null; ls a.* conftest.* 2>/dev/null`; do case $ac_file in *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb ) ;; a.out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` # FIXME: I believe we export ac_cv_exeext for Libtool --akim. export ac_cv_exeext break;; * ) break;; esac done else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 { { echo "$as_me:1287: error: C compiler cannot create executables" >&5 echo "$as_me: error: C compiler cannot create executables" >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext echo "$as_me:1293: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6 # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:1298: 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' { (eval echo "$as_me:1304: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:1307: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:1314: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'." >&2;} { (exit 1); exit 1; }; } fi fi fi echo "$as_me:1322: result: yes" >&5 echo "${ECHO_T}yes" >&6 rm -f a.out a.exe conftest$ac_cv_exeext ac_clean_files=$ac_clean_files_save # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:1329: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 echo "$as_me:1331: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6 echo "$as_me:1334: checking for executable suffix" >&5 echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6 if { (eval echo "$as_me:1336: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:1339: \$? = $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 `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do case $ac_file in *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` export ac_cv_exeext break;; * ) break;; esac done else { { echo "$as_me:1355: error: cannot compute EXEEXT: cannot compile and link" >&5 echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext echo "$as_me:1361: 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:1367: checking for object suffix" >&5 echo $ECHO_N "checking for object suffix... $ECHO_C" >&6 if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 1373 "configure" #include "confdefs.h" int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { (eval echo "$as_me:1385: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:1388: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 { { echo "$as_me:1400: error: cannot compute OBJEXT: cannot compile" >&5 echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi echo "$as_me:1407: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6 OBJEXT=$ac_cv_objext ac_objext=$OBJEXT echo "$as_me:1411: 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 #line 1417 "configure" #include "confdefs.h" int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:1432: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:1435: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:1438: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:1441: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:1453: 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 CFLAGS="-g" echo "$as_me:1459: 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 cat >conftest.$ac_ext <<_ACEOF #line 1465 "configure" #include "confdefs.h" int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:1477: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:1480: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:1483: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:1486: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_prog_cc_g=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:1496: 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 # Some people use a C++ compiler to compile C. Since we use `exit', # in C++ we need to declare it. In case someone uses the same compiler # for both compiling C and C++ we need to have the C++ compiler decide # the declaration of exit, since it's the most demanding environment. cat >conftest.$ac_ext <<_ACEOF #ifndef __cplusplus choke me #endif _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:1523: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:1526: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:1529: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:1532: \$? = $ac_status" >&5 (exit $ac_status); }; }; then for ac_declaration in \ ''\ '#include <stdlib.h>' \ 'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \ 'extern "C" void exit (int) throw ();' \ 'extern "C" void exit (int);' \ 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF #line 1544 "configure" #include "confdefs.h" #include <stdlib.h> $ac_declaration int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:1557: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:1560: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:1563: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:1566: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 continue fi rm -f conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF #line 1576 "configure" #include "confdefs.h" $ac_declaration int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:1588: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:1591: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:1594: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:1597: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext done rm -f conftest* if test -n "$ac_declaration"; then echo '#ifdef __cplusplus' >>confdefs.h echo $ac_declaration >>confdefs.h echo '#endif' >>confdefs.h fi else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext 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 "$GCC"; then CFLAGS="-O2 -Wall -pedantic" else case "$host_os" in *hpux*) CFLAGS=" +O3" ;; *ultrix* | *osf*) CFLAGS=" -O -Olimit 2000" ;; *) CFLAGS=" -O" ;; esac fi ac_aux_dir= for ac_dir in $srcdir $srcdir/.. $srcdir/../..; 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:1651: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} { (exit 1); exit 1; }; } fi ac_config_guess="$SHELL $ac_aux_dir/config.guess" ac_config_sub="$SHELL $ac_aux_dir/config.sub" ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. # 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" # ./install, which can be erroneously created by make from ./install.sh. echo "$as_me:1671: 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 ac_save_IFS=$IFS; IFS=$ac_path_separator for ac_dir in $PATH; do IFS=$ac_save_IFS # Account for people who put trailing slashes in PATH elements. case $ac_dir/ in / | ./ | .// | /cC/* \ | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \ | /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 if $as_executable_p "$ac_dir/$ac_prog"; then if test $ac_prog = install && grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else ac_cv_path_install="$ac_dir/$ac_prog -c" break 2 fi fi done ;; esac done 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. We don't cache a # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the path is relative. INSTALL=$ac_install_sh fi fi echo "$as_me:1720: 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' echo "$as_me:1731: checking whether ln -s works" >&5 echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6 LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then echo "$as_me:1735: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me:1738: result: no, using $LN_S" >&5 echo "${ECHO_T}no, using $LN_S" >&6 fi # Extract the first word of "write ", so it can be a program name with args. set dummy write ; ac_word=$2 echo "$as_me:1744: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_WRITE+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $WRITE in [\\/]* | ?:[\\/]*) ac_cv_path_WRITE="$WRITE" # Let the user override the test with a path. ;; *) ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. if $as_executable_p "$ac_dir/$ac_word"; then ac_cv_path_WRITE="$ac_dir/$ac_word" echo "$as_me:1761: found $ac_dir/$ac_word" >&5 break fi done test -z "$ac_cv_path_WRITE" && ac_cv_path_WRITE=":" ;; esac fi WRITE=$ac_cv_path_WRITE if test -n "$WRITE"; then echo "$as_me:1773: result: $WRITE" >&5 echo "${ECHO_T}$WRITE" >&6 else echo "$as_me:1776: result: no" >&5 echo "${ECHO_T}no" >&6 fi if test "$WRITE" = ":" ; then echo "Sorry, but write is a requirement to build hey." echo "please run ./configure write=/path/to/binary to" echo "compile with a different write-like utility" exit fi echo "$as_me:1787: checking whether ${MAKE-make} sets \${MAKE}" >&5 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'` if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\EOF all: @echo 'ac_maketemp="${MAKE}"' EOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` if test -n "$ac_maketemp"; then eval ac_cv_prog_make_${ac_make}_set=yes else eval ac_cv_prog_make_${ac_make}_set=no fi rm -f conftest.make fi if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then echo "$as_me:1807: result: yes" >&5 echo "${ECHO_T}yes" >&6 SET_MAKE= else echo "$as_me:1811: result: no" >&5 echo "${ECHO_T}no" >&6 SET_MAKE="MAKE=${MAKE-make}" 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:1821: 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. # 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 #line 1842 "configure" #include "confdefs.h" #include <assert.h> Syntax error _ACEOF if { (eval echo "$as_me:1847: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:1853: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 cat 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 non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF #line 1876 "configure" #include "confdefs.h" #include <ac_nonexistent.h> _ACEOF if { (eval echo "$as_me:1880: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:1886: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 cat 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:1923: 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. # 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 #line 1933 "configure" #include "confdefs.h" #include <assert.h> Syntax error _ACEOF if { (eval echo "$as_me:1938: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:1944: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 cat 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 non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF #line 1967 "configure" #include "confdefs.h" #include <ac_nonexistent.h> _ACEOF if { (eval echo "$as_me:1971: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:1977: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 cat 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:2005: error: C preprocessor \"$CPP\" fails sanity check" >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&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:2016: 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 #line 2022 "configure" #include "confdefs.h" #include <stdlib.h> #include <stdarg.h> #include <string.h> #include <float.h> _ACEOF if { (eval echo "$as_me:2030: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:2036: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f conftest.err 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 #line 2058 "configure" #include "confdefs.h" #include <string.h> _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 #line 2076 "configure" #include "confdefs.h" #include <stdlib.h> _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 #line 2097 "configure" #include "confdefs.h" #include <ctype.h> #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)) exit(2); exit (0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:2123: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:2126: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:2128: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:2131: \$? = $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 cat conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi echo "$as_me:2144: 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 <<\EOF #define STDC_HEADERS 1 EOF fi for ac_header in utmpx.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` echo "$as_me:2157: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 2163 "configure" #include "confdefs.h" #include <$ac_header> _ACEOF if { (eval echo "$as_me:2167: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:2173: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f conftest.err conftest.$ac_ext fi echo "$as_me:2192: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<EOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 EOF fi done echo "$as_me:2202: 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 #line 2208 "configure" #include "confdefs.h" #include <sys/types.h> #include <signal.h> #ifdef signal # undef signal #endif #ifdef __cplusplus extern "C" void (*signal (int, void (*)(int)))(int); #else void (*signal ()) (); #endif int main () { int i; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:2230: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:2233: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:2236: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:2239: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_signal=void else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_type_signal=int fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:2249: result: $ac_cv_type_signal" >&5 echo "${ECHO_T}$ac_cv_type_signal" >&6 cat >>confdefs.h <<EOF #define RETSIGTYPE $ac_cv_type_signal EOF for ac_func in vprintf do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:2259: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 2265 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. */ #include <assert.h> /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); char (*f) (); int main () { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else f = $ac_func; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:2296: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:2299: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:2302: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:2305: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:2315: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<EOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 EOF echo "$as_me:2322: checking for _doprnt" >&5 echo $ECHO_N "checking for _doprnt... $ECHO_C" >&6 if test "${ac_cv_func__doprnt+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 2328 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char _doprnt (); below. */ #include <assert.h> /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char _doprnt (); char (*f) (); int main () { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub__doprnt) || defined (__stub____doprnt) choke me #else f = _doprnt; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:2359: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:2362: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:2365: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:2368: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func__doprnt=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_func__doprnt=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:2378: result: $ac_cv_func__doprnt" >&5 echo "${ECHO_T}$ac_cv_func__doprnt" >&6 if test $ac_cv_func__doprnt = yes; then cat >>confdefs.h <<\EOF #define HAVE_DOPRNT 1 EOF fi fi done for ac_func in strdup do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:2394: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 2400 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. */ #include <assert.h> /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); char (*f) (); int main () { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else f = $ac_func; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:2431: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:2434: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:2437: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:2440: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:2450: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<EOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 EOF else STRDUP_OBJ=mystrdup.o fi done for ac_func in getutent do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:2465: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 2471 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. */ #include <assert.h> /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); char (*f) (); int main () { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else f = $ac_func; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:2502: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:2505: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:2508: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:2511: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:2521: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<EOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 EOF else UT_OBJ=utent.o fi done EDIT_OBJ=hey_edit.o echo "$as_me:2535: checking for readline in -lreadline" >&5 echo $ECHO_N "checking for readline in -lreadline... $ECHO_C" >&6 if test "${ac_cv_lib_readline_readline+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lreadline $LIBS" cat >conftest.$ac_ext <<_ACEOF #line 2543 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char readline (); int main () { readline (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:2562: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:2565: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:2568: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:2571: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_readline_readline=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_lib_readline_readline=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:2582: result: $ac_cv_lib_readline_readline" >&5 echo "${ECHO_T}$ac_cv_lib_readline_readline" >&6 if test $ac_cv_lib_readline_readline = yes; then cat >>confdefs.h <<EOF #define HAVE_LIBREADLINE 1 EOF LIBS="-lreadline $LIBS" else NOREADLINE=1 fi if test -n "$NOREADLINE" ; then echo "$as_me:2596: checking for readline in -lreadline -lcurses " >&5 echo $ECHO_N "checking for readline in -lreadline -lcurses ... $ECHO_C" >&6 if test "${ac_cv_lib_readline__lcurses__readline+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lreadline -lcurses $LIBS" cat >conftest.$ac_ext <<_ACEOF #line 2604 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char readline (); int main () { readline (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:2623: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:2626: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:2629: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:2632: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_readline__lcurses__readline=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_lib_readline__lcurses__readline=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:2643: result: $ac_cv_lib_readline__lcurses__readline" >&5 echo "${ECHO_T}$ac_cv_lib_readline__lcurses__readline" >&6 if test $ac_cv_lib_readline__lcurses__readline = yes; then cat >>confdefs.h <<\EOF #define HAVE_LIBREADLINE 1 EOF LIBS="$LIBS -lreadline -lcurses" else echo echo "WARNING: you are compiling c-hey WITHOUT readline support" echo " we recommend you install the readline library and" echo " associated development materials to utilise the" echo " full functionality of c-hey" echo echo " get it at: " echo " http://cnswww.cns.cwru.edu/php/chet/readline/rltop.html" echo # dont want edit object now EDIT_OBJ="" fi fi for ac_func in rl_ding do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:2673: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 2679 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. */ #include <assert.h> /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); char (*f) (); int main () { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else f = $ac_func; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:2710: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:2713: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:2716: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:2719: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:2729: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<EOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 EOF fi done ac_config_files="$ac_config_files Makefile" 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 overriden 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, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. { (set) 2>&1 | case `(ac_space=' '; set | grep ac_space) 2>&1` in *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "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 \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } | sed ' t clear : clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ : end' >>confcache if cmp -s $cache_file confcache; then :; else if test -w $cache_file; then test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" cat confcache >$cache_file else echo "not updating unwritable cache $cache_file" 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}' # 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 DEFS=-DHAVE_CONFIG_H : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:2819: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $SHELL # Generated automatically by configure. # 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 SHELL=\${CONFIG_SHELL-$SHELL} ac_cs_invocation="\$0 \$@" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi # Name of the executable. as_me=`echo "$0" |sed 's,.*[\\/],,'` if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi 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$$.file as_executable_p="test -f" # Support unset when possible. if (FOO=FOO; unset FOO) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # NLS nuisances. $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; } $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; } $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; } $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; } $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; } $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; } $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; } $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; } # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; } exec 6>&1 _ACEOF # Files that config.status was made for. if test -n "$ac_config_files"; then echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS fi if test -n "$ac_config_headers"; then echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS fi if test -n "$ac_config_links"; then echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS fi if test -n "$ac_config_commands"; then echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS fi cat >>$CONFIG_STATUS <<\EOF 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, then exit -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 <bug-autoconf@gnu.org>." EOF cat >>$CONFIG_STATUS <<EOF ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.52, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." srcdir=$srcdir INSTALL="$INSTALL" EOF cat >>$CONFIG_STATUS <<\EOF # 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[^=]*=\(.*\)'` shift set dummy "$ac_option" "$ac_optarg" ${1+"$@"} shift ;; -*);; *) # This is not an option, so the user has probably given explicit # arguments. ac_need_defaults=false;; esac case $1 in # Handling of the options. EOF cat >>$CONFIG_STATUS <<EOF -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion" exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;; EOF cat >>$CONFIG_STATUS <<\EOF --version | --vers* | -V ) echo "$ac_cs_version"; exit 0 ;; --he | --h) # Conflict between --help and --header { { echo "$as_me:2992: error: ambiguous option: $1 Try \`$0 --help' for more information." >&5 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 0 ;; --debug | --d* | -d ) debug=: ;; --file | --fil | --fi | --f ) shift CONFIG_FILES="$CONFIG_FILES $1" ac_need_defaults=false;; --header | --heade | --head | --hea ) shift CONFIG_HEADERS="$CONFIG_HEADERS $1" ac_need_defaults=false;; # This is an error. -*) { { echo "$as_me:3011: error: unrecognized option: $1 Try \`$0 --help' for more information." >&5 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" ;; esac shift done exec 5>>config.log cat >&5 << _ACEOF ## ----------------------- ## ## Running config.status. ## ## ----------------------- ## This file was extended by $as_me 2.52, executed with CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS > $ac_cs_invocation on `(hostname || uname -n) 2>/dev/null | sed 1q` _ACEOF EOF cat >>$CONFIG_STATUS <<\EOF for ac_config_target in $ac_config_targets do case "$ac_config_target" in # Handling of arguments. "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; *) { { echo "$as_me:3048: 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 # Create a temporary directory, and hook for its removal unless debugging. $debug || { trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. : ${TMPDIR=/tmp} { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=$TMPDIR/cs$$-$RANDOM (umask 077 && mkdir $tmp) } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 { (exit 1); exit 1; } } EOF cat >>$CONFIG_STATUS <<EOF # # 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 # Protect against being on the right side of a sed subst in config.status. sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF s,@SHELL@,$SHELL,;t t s,@exec_prefix@,$exec_prefix,;t t s,@prefix@,$prefix,;t t s,@program_transform_name@,$program_transform_name,;t t s,@bindir@,$bindir,;t t s,@sbindir@,$sbindir,;t t s,@libexecdir@,$libexecdir,;t t s,@datadir@,$datadir,;t t s,@sysconfdir@,$sysconfdir,;t t s,@sharedstatedir@,$sharedstatedir,;t t s,@localstatedir@,$localstatedir,;t t s,@libdir@,$libdir,;t t s,@includedir@,$includedir,;t t s,@oldincludedir@,$oldincludedir,;t t s,@infodir@,$infodir,;t t s,@mandir@,$mandir,;t t s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t s,@build_alias@,$build_alias,;t t s,@host_alias@,$host_alias,;t t s,@target_alias@,$target_alias,;t t s,@ECHO_C@,$ECHO_C,;t t s,@ECHO_N@,$ECHO_N,;t t s,@ECHO_T@,$ECHO_T,;t t s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t s,@DEFS@,$DEFS,;t t s,@LIBS@,$LIBS,;t t s,@WRITE@,$WRITE,;t t s,@CC@,$CC,;t t s,@CFLAGS@,$CFLAGS,;t t s,@LDFLAGS@,$LDFLAGS,;t t s,@CPPFLAGS@,$CPPFLAGS,;t t s,@ac_ct_CC@,$ac_ct_CC,;t t s,@EXEEXT@,$EXEEXT,;t t s,@OBJEXT@,$OBJEXT,;t t s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t s,@INSTALL_DATA@,$INSTALL_DATA,;t t s,@LN_S@,$LN_S,;t t s,@SET_MAKE@,$SET_MAKE,;t t s,@CPP@,$CPP,;t t s,@UT_OBJ@,$UT_OBJ,;t t s,@EDIT_OBJ@,$EDIT_OBJ,;t t CEOF EOF cat >>$CONFIG_STATUS <<\EOF # Split the substitutions into bite-sized pieces for seds with # small command number limits, like on Digital OSF/1 and HP-UX. ac_max_sed_lines=48 ac_sed_frag=1 # Number of current file. ac_beg=1 # First line for current file. ac_end=$ac_max_sed_lines # Line after last line for current file. ac_more_lines=: ac_sed_cmds= while $ac_more_lines; do if test $ac_beg -gt 1; then sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag else sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag fi if test ! -s $tmp/subs.frag; then ac_more_lines=false else # The purpose of the label and of the branching condition is to # speed up the sed processing (if there are no `@' at all, there # is no need to browse any of the substitutions). # These are the two extra sed commands mentioned above. (echo ':t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed if test -z "$ac_sed_cmds"; then ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" else ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" fi ac_sed_frag=`expr $ac_sed_frag + 1` ac_beg=$ac_end ac_end=`expr $ac_end + $ac_max_sed_lines` fi done if test -z "$ac_sed_cmds"; then ac_sed_cmds=cat fi fi # test -n "$CONFIG_FILES" EOF cat >>$CONFIG_STATUS <<\EOF for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. ac_dir=`$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'` if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then { case "$ac_dir" in [\\/]* | ?:[\\/]* ) as_incr_dir=;; *) as_incr_dir=.;; esac as_dummy="$ac_dir" for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do case $as_mkdir_dir in # Skip DOS drivespec ?:) as_incr_dir=$as_mkdir_dir ;; *) as_incr_dir=$as_incr_dir/$as_mkdir_dir test -d "$as_incr_dir" || mkdir "$as_incr_dir" ;; esac done; } ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`" # A "../" for each directory in $ac_dir_suffix. ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'` else ac_dir_suffix= ac_dots= fi case $srcdir in .) ac_srcdir=. if test -z "$ac_dots"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_dots$srcdir$ac_dir_suffix ac_top_srcdir=$ac_dots$srcdir ;; esac case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_dots$INSTALL ;; esac if test x"$ac_file" != x-; then { echo "$as_me:3259: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} rm -f "$ac_file" fi # 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 automatically by config.status. */ configure_input="Generated automatically from `echo $ac_file_in | sed 's,.*/,,'` by configure." # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) test -f "$f" || { { echo "$as_me:3277: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo $f;; *) # Relative if test -f "$f"; then # Build tree echo $f elif test -f "$srcdir/$f"; then # Source tree echo $srcdir/$f else # /dev/null tree { { echo "$as_me:3290: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } EOF cat >>$CONFIG_STATUS <<EOF sed "$ac_vpsub $extrasub EOF cat >>$CONFIG_STATUS <<\EOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s,@configure_input@,$configure_input,;t t s,@srcdir@,$ac_srcdir,;t t s,@top_srcdir@,$ac_top_srcdir,;t t s,@INSTALL@,$ac_INSTALL,;t t " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out rm -f $tmp/stdin if test x"$ac_file" != x-; then mv $tmp/out $ac_file else cat $tmp/out rm -f $tmp/out fi done EOF cat >>$CONFIG_STATUS <<\EOF # # CONFIG_HEADER section. # # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where # NAME is the cpp macro being defined and VALUE is the value it is being given. # # ac_d sets the value in "#define NAME VALUE" lines. ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' ac_dB='[ ].*$,\1#\2' ac_dC=' ' ac_dD=',;t' # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' ac_uB='$,\1#\2define\3' ac_uC=' ' ac_uD=',;t' for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac test x"$ac_file" != x- && { echo "$as_me:3351: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) test -f "$f" || { { echo "$as_me:3362: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo $f;; *) # Relative if test -f "$f"; then # Build tree echo $f elif test -f "$srcdir/$f"; then # Source tree echo $srcdir/$f else # /dev/null tree { { echo "$as_me:3375: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } # Remove the trailing spaces. sed 's/[ ]*$//' $ac_file_inputs >$tmp/in EOF # Transform confdefs.h into two sed scripts, `conftest.defines' and # `conftest.undefs', that substitutes the proper values into # config.h.in to produce config.h. The first handles `#define' # templates, and the second `#undef' templates. # And first: Protect against being on the right side of a sed subst in # config.status. Protect against being in an unquoted here document # in config.status. rm -f conftest.defines conftest.undefs # Using a here document instead of a string reduces the quoting nightmare. # Putting comments in sed scripts is not portable. # # `end' is used to avoid that the second main sed command (meant for # 0-ary CPP macros) applies to n-ary macro definitions. # See the Autoconf documentation for `clear'. cat >confdef2sed.sed <<\EOF s/[\\&,]/\\&/g s,[\\$`],\\&,g t clear : clear s,^[ ]*#[ ]*define[ ][ ]*\(\([^ (][^ (]*\)([^)]*)\)[ ]*\(.*\)$,${ac_dA}\2${ac_dB}\1${ac_dC}\3${ac_dD},gp t end s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp : end EOF # If some macros were called several times there might be several times # the same #defines, which is useless. Nevertheless, we may not want to # sort them, since we want the *last* AC-DEFINE to be honored. uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs rm -f confdef2sed.sed # This sed command replaces #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. cat >>conftest.undefs <<\EOF s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, EOF # Break up conftest.defines because some shells have a limit on the size # of here documents, and old seds have small limits too (100 cmds). echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS echo ' if egrep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS echo ' :' >>$CONFIG_STATUS rm -f conftest.tail while grep . conftest.defines >/dev/null do # Write a limited-size here document to $tmp/defines.sed. echo ' cat >$tmp/defines.sed <<CEOF' >>$CONFIG_STATUS # Speed up: don't consider the non `#define' lines. echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS # Work around the forget-to-reset-the-flag bug. echo 't clr' >>$CONFIG_STATUS echo ': clr' >>$CONFIG_STATUS sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS echo 'CEOF sed -f $tmp/defines.sed $tmp/in >$tmp/out rm -f $tmp/in mv $tmp/out $tmp/in ' >>$CONFIG_STATUS sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail rm -f conftest.defines mv conftest.tail conftest.defines done rm -f conftest.defines echo ' fi # egrep' >>$CONFIG_STATUS echo >>$CONFIG_STATUS # Break up conftest.undefs because some shells have a limit on the size # of here documents, and old seds have small limits too (100 cmds). echo ' # Handle all the #undef templates' >>$CONFIG_STATUS rm -f conftest.tail while grep . conftest.undefs >/dev/null do # Write a limited-size here document to $tmp/undefs.sed. echo ' cat >$tmp/undefs.sed <<CEOF' >>$CONFIG_STATUS # Speed up: don't consider the non `#undef' echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS # Work around the forget-to-reset-the-flag bug. echo 't clr' >>$CONFIG_STATUS echo ': clr' >>$CONFIG_STATUS sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS echo 'CEOF sed -f $tmp/undefs.sed $tmp/in >$tmp/out rm -f $tmp/in mv $tmp/out $tmp/in ' >>$CONFIG_STATUS sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail rm -f conftest.undefs mv conftest.tail conftest.undefs done rm -f conftest.undefs cat >>$CONFIG_STATUS <<\EOF # 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 automatically by config.status. */ if test x"$ac_file" = x-; then echo "/* Generated automatically by configure. */" >$tmp/config.h else echo "/* $ac_file. Generated automatically by configure. */" >$tmp/config.h fi cat $tmp/in >>$tmp/config.h rm -f $tmp/in if test x"$ac_file" != x-; then if cmp -s $ac_file $tmp/config.h 2>/dev/null; then { echo "$as_me:3492: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else ac_dir=`$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'` if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then { case "$ac_dir" in [\\/]* | ?:[\\/]* ) as_incr_dir=;; *) as_incr_dir=.;; esac as_dummy="$ac_dir" for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do case $as_mkdir_dir in # Skip DOS drivespec ?:) as_incr_dir=$as_mkdir_dir ;; *) as_incr_dir=$as_incr_dir/$as_mkdir_dir test -d "$as_incr_dir" || mkdir "$as_incr_dir" ;; esac done; } fi rm -f $ac_file mv $tmp/config.h $ac_file fi else cat $tmp/config.h rm -f $tmp/config.h fi done EOF cat >>$CONFIG_STATUS <<\EOF { (exit 0); exit 0; } EOF 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=: exec 5>/dev/null $SHELL $CONFIG_STATUS || 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 �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������c-hey2.1/configure.in�������������������������������������������������������������������������������0000600�0076323�0001766�00000005037�07415461224�015516� 0����������������������������������������������������������������������������������������������������ustar �c-hey���������������������������projects������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ dnl $Id: configure.in,v 1.5 2002/01/05 02:19:00 c-hey Exp $ dnl Process this file with autoconf to produce a configure script. dnl Initialise. This can be passed any old file. AC_INIT(hey_arg.h) AC_CONFIG_HEADER(config.h) AC_ARG_VAR(WRITE, path to a write-like utility) dnl Checks for programs. AC_PROG_CC dnl dnl if the user hasn't specified CFLAGS, then dnl if compiler is gcc, then use -O2 and some warning flags dnl else use os-specific flags or -O dnl if test -n "$GCC"; then CFLAGS="-O2 -Wall -pedantic" else case "$host_os" in *hpux*) CFLAGS=" +O3" ;; *ultrix* | *osf*) CFLAGS=" -O -Olimit 2000" ;; *) CFLAGS=" -O" ;; esac fi AC_PROG_INSTALL AC_PROG_LN_S AC_PATH_PROG(WRITE, write , :) if test "$WRITE" = ":" ; then echo "Sorry, but write is a requirement to build hey." echo "please run ./configure write=/path/to/binary to" echo "compile with a different write-like utility" exit fi AC_PROG_MAKE_SET dnl Checks for libraries. dnl Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS(utmpx.h) dnl Checks for typedefs, structures, and compiler characteristics. dnl Checks for library functions. AC_TYPE_SIGNAL AC_FUNC_VPRINTF AC_CHECK_FUNCS(strdup,,STRDUP_OBJ=mystrdup.o) AC_CHECK_FUNCS(getutent,,UT_OBJ=utent.o) dnl we have to initalise this dnl using success arg of lib check skews config.h EDIT_OBJ=hey_edit.o dnl the following two checks are ugly but neccessary dnl autoconfs extra library feature for AC_CHECK_LIB dnl simply does not work, and fails to register readline dnl on systems where curses isnt needed for it dnl vanilla readline check, works on 90% of systems AC_CHECK_LIB(readline, readline, , NOREADLINE=1) dnl readline doesnt work, try it with curses dnl dnl this stuff is overly dependent on autoconf internals dnl better suggestions welcome dnl if test -n "$NOREADLINE" ; then AC_CHECK_LIB(readline -lcurses ,readline, AC_DEFINE(HAVE_LIBREADLINE) LIBS="$LIBS -lreadline -lcurses" , echo echo "WARNING: you are compiling c-hey WITHOUT readline support" echo " we recommend you install the readline library and" echo " associated development materials to utilise the" echo " full functionality of c-hey" echo echo " get it at: " echo " http://cnswww.cns.cwru.edu/php/chet/readline/rltop.html" echo # dont want edit object now EDIT_OBJ="" ) fi dnl check for rl_ding() AC_CHECK_FUNCS(rl_ding) dnl Make any macro substitutions that we ought to. AC_SUBST(UT_OBJ) AC_SUBST(EDIT_OBJ) AC_SUBST(WRITE) AC_OUTPUT(Makefile) �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������c-hey2.1/dyn_page.c���������������������������������������������������������������������������������0000600�0076323�0001766�00000011041�07715567651�015145� 0����������������������������������������������������������������������������������������������������ustar �c-hey���������������������������projects������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* ** File: dyn_page.c ** Desc: A dynamic buffer, and functions to manipulate it ... ** Auth: Cian Synnott <pooka@redbrick.dcu.ie> ** Date: Tue Nov 10 21:58:17 GMT 1998 ** ** $Id: dyn_page.c,v 1.3 2003/08/11 01:21:45 c-hey Exp $ */ #include <string.h> #include <stdlib.h> #include <stdio.h> #include "dyn_page.h" /* Allocate a page structure, giving it the width at which to wrap lines ** appended to it. */ dyn_page *dyn_pageAlloc(int width) { dyn_page *p; /* Allocate memory */ if (!(p = (dyn_page *) malloc(sizeof(dyn_page)))) { perror("Error allocating page"); exit(1); } /* Setup values */ p->buff = NULL; p->rows = 0; p->cols = width; return p; } /* Free an entire page structure. */ void dyn_pageFree(dyn_page *p) { int i; /* Free all the separate lines */ for (i = 0; i < p->rows; i++) { free(p->buff[i]); p->buff[i] = NULL; /* Ok, so I'm paranoid ... */ } /* Free the 'page pointer' */ free(p->buff); p->buff = NULL; /* Free the structure memory */ free(p); return; } /* How many lines, or what width, is the page ... ** Should be macros, but I like to keep my functions together :o) */ int dyn_pageLines(dyn_page *page) { return page->rows; } int dyn_pageWidth(dyn_page *page) { return page->cols; } /* Append a line to the page, wrapping as necessary */ int dyn_pageAppend(dyn_page *p, char *line) { char *line_ptr; int last_space = 0; int len = strlen(line); /* Firstly, if now is the time to allocate more pointers to lines, ** do it (remember to set all these pointers to NULL ... */ if (!(p->rows % 10)) { if (!(p->buff = (char **) realloc(p->buff, (p->rows + 10) * sizeof(char *)))) return 0; } /* We're adding a line, so increment p->rows. Would be nicer to do ** this later, but control leaves this function suddenly quite a lot */ p->rows++; /* If there's no word-wrapping specified (p->cols == 0), or if the line ** is less than p->cols anyhows, just add the line */ if (!p->cols || len < p->cols) { /* Allocate the space for the line ... */ if (!(p->buff[p->rows - 1] = (char *) calloc(len + 1, sizeof(char)))) return 0; /* Copy in the line ... */ strncpy(p->buff[p->rows - 1], line, len); /* Success ... */ return 1; } /* Otherwise, search for the last space before the end of the wrapping ** line (p->cols) and add the line up to that, then call ourselves for ** the rest of the line. Huzzah for recursion. */ for (line_ptr = line; *line_ptr; line_ptr++) { /* If we're at a column boundry (setting len == difference between ** line & line_ptr ... */ if ((len = line_ptr - line) + 1 == p->cols) { /* If there was a last space recorded, set len equal to it */ if (last_space) len = last_space; /* Allocate the space for the line ... */ if (!(p->buff[p->rows - 1] = (char *) calloc(len + 1, sizeof(char)))) return 0; /* Copy the stated length into it ... */ strncpy(p->buff[p->rows - 1], line, len); /* Set line equal to it's new value & skip any whitespace ** at the start of it ... */ line += len; while (*line && *line == ' ') line++; /* Now call dyn_pageAppend() to add the rest of it, ** propogating results back up the recursive calls ... */ return dyn_pageAppend(p, line); } /* Otherwise control reaches here ... */ if (*line_ptr == ' ') last_space = (line_ptr - line); } /* End while (*line_ptr) */ /* Control never reaches here ... */ return 0; } /* Extract a line by index */ char *dyn_pageLineAt(dyn_page *p, int line) { /* Invalid reference ... */ if (line >= p->rows || line < 0) return NULL; /* Otherwise return the line asked for */ return p->buff[line]; } /* Modify a line by index */ int dyn_pageLineMod(dyn_page *p, char *line, int lineno) { /* Invalid reference ... */ if (lineno >= p->rows || lineno < 0) return 0; /* free the existing line */ if((p->buff[lineno]=(char *)realloc(p->buff[lineno],strlen(line) + 1)) == NULL) return 0; /* modify the line */ strcpy(p->buff[lineno], line); return 1; } /* Step along the page, returning the next line on subsequent calls that are ** passed NULL. Standard iterator ... */ char *dyn_pageRead(dyn_page *p) { static dyn_page *on_page = NULL; static int line = 0; if (p) { on_page = p; line = 0; if (!on_page->rows) return NULL; return on_page->buff[line++]; } /* If we get this far, if there's no current page, error */ if (!on_page) return NULL; /* Otherwise return line asked for */ else { if (line >= on_page->rows) return NULL; return on_page->buff[line++]; } /* Control never reaches here */ return NULL; } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������c-hey2.1/dyn_page.h���������������������������������������������������������������������������������0000600�0076323�0001766�00000002313�07413721216�015134� 0����������������������������������������������������������������������������������������������������ustar �c-hey���������������������������projects������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#ifndef _dyn_page_h_ #define _dyn_page_h_ /* ** File: dyn_page.h ** Desc: A dynamic buffer, and functions to manipulate it ... ** Auth: Cian Synnott <pooka@redbrick.dcu.ie> ** Date: Tue Nov 10 21:59:10 GMT 1998 ** ** $Id: dyn_page.h,v 1.2 2001/12/30 23:26:06 c-hey Exp $ */ /* ** The actual buffer structure */ typedef struct _dyn_page_ { char **buff; int rows; int cols; } dyn_page; /* ** Functions to act on it */ /* Allocate a page structure, giving it the width at which to wrap lines ** appended to it. */ extern dyn_page *dyn_pageAlloc(int width); /* Free one */ extern void dyn_pageFree(dyn_page *page); /* How many lines, or what width, is the page ... */ extern int dyn_pageLines(dyn_page *page); extern int dyn_pageWidth(dyn_page *page); /* Append a line to the page, wrapping as necessary */ extern int dyn_pageAppend(dyn_page *page, char *line); /* Extract a line by index */ extern char *dyn_pageLineAt(dyn_page *page, int line); /* Modify a line by index */ extern int dyn_pageLineMod(dyn_page *page, char *line, int lineno); /* Step along the page, returning the next line on subsequent calls that are ** passed NULL. Standard iterator ... */ extern char *dyn_pageRead(dyn_page *page); #endif ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������c-hey2.1/g_list.c�����������������������������������������������������������������������������������0000600�0076323�0001766�00000013533�07715567651�014650� 0����������������������������������������������������������������������������������������������������ustar �c-hey���������������������������projects������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* ** File: g_list.c ** Desc: Implementation of a general-use list ** Auth: Cian Synnott <pooka@redbrick.dcu.ie> ** Date: Mon Nov 9 18:03:28 GMT 1998 ** ** $Id: g_list.c,v 1.3 2003/08/11 01:21:45 c-hey Exp $ */ #include <stdio.h> #include <stdlib.h> #include "g_list.h" /* ** Memory handling functions */ /* The allocation function is passed a pointer to a function that returns ** 1 when the key passed matches whatever there is to be matched in the ** the data passed, and 0 when it doesn't. For meaningful traversal */ g_list *g_listAlloc(int (*keyfunc)() ) { g_list *list; /* allocate memory in a careful manner */ if ( !(list = (g_list *) malloc(sizeof(g_list))) ) { return NULL; } /* Set the head node equals null, and setup the tail node so that ** it points to itself with next & prev (safest like that) */ list->head = NULL; list->tail = g_nodeAlloc(NULL, NULL); list->tail->next = list->tail; list->tail->prev = list->tail; /* Set the function pointer to the passed function */ list->keyfunc = keyfunc; return list; } /* Free an entire list */ int g_listFree(g_list *list) { g_node *head; /* If the head's already null, just free the tail */ if (list->head != NULL){ /* Otherwise do the whole node-freeing thing */ while (list->head != list->tail) { head = list->head->next; if (!g_nodeFree(list->head)) return 0; list->head = head; } } /* Finally free the tail */ g_nodeFree(list->tail); list->head = NULL; list->tail = NULL; list->keyfunc = NULL; /* Free the actual list memory */ free(list); return 1; } /* Allocate a node, passing it the data to be held and a pointer to ** the function to be used to free that data */ g_node *g_nodeAlloc(void *data, void (*freefunc)()) { g_node *node; /* Alloc */ if (!(node = (g_node *) malloc(sizeof(g_node))) ) { return NULL; } /* Just fill in the blanks */ node->next = NULL; node->prev = NULL; node->data = data; node->freefunc = freefunc; return node; } /* Free a node & it's data, being careful of nodes linked to themselves */ int g_nodeFree(g_node *node) { /* This is a bit complex. It has to do with freeing things, different ** ways of deleting the node depending on which links are pointing at ** itself. I have the algorithm somewhere, but I couldn't be bothered ** reproducing it */ if (node->next != node) { if (node->prev != node) { node->prev->next = node->next; node->next->prev = node->prev; } else node->next->prev = node->next; } else if (node->prev != node) node->prev->next = node->prev; node->next = NULL; node->prev = NULL; if (node->data) node->freefunc(node->data); node->data = NULL; node->freefunc = NULL; free(node); return 1; } /* ** List handling functions */ /* Put the passed piece of data at the beginning of the list */ int g_listInsert(g_list *list, void *data, void (*freefunc)()) { g_node *node; if (!(node = g_nodeAlloc(data, freefunc))) { return 0; } if (list->head == NULL) { list->head = node; node->next = list->tail; list->tail->prev = node; node->prev = node; } else { list->head->prev = node; node->prev = node; node->next = list->head; list->head = node; } return 1; } /* Put the passed piece of data at the end of the list */ int g_listAppend(g_list *list, void *data, void (*freefunc)()) { g_node *node; if (!(node = g_nodeAlloc(data, freefunc))) { return 0; } if (list->head == NULL) { list->head = node; node->next = list->tail; list->tail->prev = node; node->prev = node; } else { list->tail->prev->next = node; node->next = list->tail; node->prev = list->tail->prev; list->tail->prev = node; } return 1; } /* If NULL is passed, continue traversing current list. Else traverse the ** list passed. Returns the next item of data in the list, or NULL at end */ void *g_listTraverse(g_list *list) { static g_node *s_node; if (list == NULL) { if (s_node == s_node->next) return NULL; else s_node = s_node->next; return s_node->data; } else { if (list->head) { s_node = list->head; return s_node->data; } else return NULL; } } /* Traverses the list & gets the first piece of data for which keyfunc() ** returns 1 when passed key. */ void *g_listGet(g_list *list, void *key) { g_node *node = list->head; while ((node != NULL) && (node != node->next)) { if (list->keyfunc(key, node->data)) return node->data; node = node->next; } return NULL; } /* Traverses the list & deletes the first piece of data for which keyfunc() ** returns 1 when passed key. */ int g_listDel(g_list *list, void *key) { g_node *node = list->head; while ((node != NULL) && (node != node->next)) { if (list->keyfunc(key, node->data)) { node = node->next; if (!g_nodeFree(node)) return 0; return 1; } else node = node->next; } return 0; } /* ** LIFO implementation */ /* Should be a define, but I like it better like this */ int g_listPush(g_list *list, void *data, void (*freeFunc)()) { return g_listInsert(list, data, freeFunc); } /* Have to cheat with the node-freeing here to preserve the data ... */ void *g_listPop(g_list *list) { g_node *node; void *data; if (list->head == NULL) return NULL; node = list->head; data = node->data; if (node->next != list->tail) { node->next->prev = node->next; list->head = node->next; } else { list->head = NULL; list->tail->prev = list->tail; } node->next = NULL; node->prev = NULL; node->data = NULL; node->freefunc = NULL; free(node); return data; } /* ** FIFO implementation */ /* Same again, 'cept use append, and wrap the Pop function for the Q */ int g_listQPut(g_list *list, void *data, void (*freeFunc)()) { return g_listAppend(list, data, freeFunc); } /* Macros, macros, all of these should be macros... */ void *g_listQGet(g_list *list) { return g_listPop(list); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������c-hey2.1/g_list.h�����������������������������������������������������������������������������������0000600�0076323�0001766�00000004331�07413721216�014631� 0����������������������������������������������������������������������������������������������������ustar �c-hey���������������������������projects������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#ifndef _g_list_h_ #define _g_list_h_ /* ** File: g_list.h ** Desc: Implementation of a general-use list ** At the time I wrote this, I didn't know that g_* was the glib way of ** doing things. Woops. :o) ** Auth: Cian Synnott <pooka@redbrick.dcu.ie> ** Date: Mon Nov 9 18:03:53 GMT 1998 ** ** $Id: g_list.h,v 1.2 2001/12/30 23:26:06 c-hey Exp $ */ /* The node struct */ typedef struct _g_node_ { void *data; struct _g_node_ *next; struct _g_node_ *prev; void (*freefunc)(void *data); } g_node; /* The list struct */ typedef struct _g_list_ { g_node *head; g_node *tail; int (*keyfunc)(void *key, void *data); } g_list; /* ** Memory handling functions */ /* The allocation function is passed a pointer to a function that returns ** 1 when the key passed matches whatever there is to be matched in the ** the data passed, and 0 when it doesn't. For meaningful traversal */ g_list *g_listAlloc(int (*keyfunc)(void *key, void *data) ); int g_listFree(g_list *list); /* Allocate a node, passing it the data to be held and a pointer to the ** function to be used to free that data */ g_node *g_nodeAlloc(void *data, void (*freefunc)()); int g_nodeFree(g_node *node); /* ** List handling functions */ /* Put the passed piece of data at the beginning of the list */ int g_listInsert(g_list *list, void *data, void (*freefunc)()); /* Put the passed piece of data at the end of the list */ int g_listAppend(g_list *list, void *data, void (*freefunc)()); /* If NULL is passed, continue traversing current list. Else traverse the ** list passed. Returns the next item of data in the list, or NULL at end */ void *g_listTraverse(g_list *list); /* Traverses the list & gets the first piece of data for which keyfunc() ** returns 1 when passed key. */ void *g_listGet(g_list *list, void *key); /* Traverses the list & deletes the first piece of data for which keyfunc() ** returns 1 when passed key. */ int g_listDel(g_list *list, void *key); /* LIFO implementation */ int g_listPush(g_list *list, void *data, void (*freeFunc)()); void *g_listPop(g_list *list); /* FIFO implementation */ int g_listQPut(g_list *list, void *data, void (*freeFunc)()); void *g_listQGet(g_list *list); #endif �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������c-hey2.1/hey_arg.c����������������������������������������������������������������������������������0000600�0076323�0001766�00000022120�07715572634�014772� 0����������������������������������������������������������������������������������������������������ustar �c-hey���������������������������projects������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* ** File: hey_arg.c ** Desc: Parse the arguments to hey, including constructing the list ** of usernames etc. Also handles the environment variables ** supported ** Auth: Cian Synnott <pooka@redbrick.dcu.ie> ** Date: Mon Nov 9 19:35:21 GMT 1998 ** ** $Id: hey_arg.c,v 1.5 2003/08/11 01:47:08 c-hey Exp $ */ #include "hey_arg.h" #include "aux.h" /* If strdup() is not present, change references to strdup() to ** mystrdup() */ #ifndef HAVE_STRDUP #define strdup mystrdup #endif /* ** Those things which one can set via environment variables. ** I'll leave strings to be malloc()'d later, when we find out what ** length they are. */ int hey_wrap; /* word-wrapping limit */ int hey_nousers=0; /* number of users getting heyed */ char *hey_title; /* 'title' message for the hey */ char *hey_footer; /* 'footer' message for the hey */ char *hey_borders; /* string containing the border chars */ char *hey_success; /* string to output on success */ char *hey_eof; /* replacement EOF */ char *hey_prompt; /* string to use as hey prompt */ int hey_maxnames; /* maximum number of names in prompt */ char *filename = NULL; /* path of file which contains userlist to "hey" */ /* ** Suppress the potentialy annoying mesg status warning */ int mesg_warning_suppress = 0; /* List to hold all the users in */ g_list *hey_userlist = NULL; /* Create a new user, and parse the argument string into their name & tty */ hey_user *hey_userNew(char *argstring) { hey_user *u; int i; if (!(u = (hey_user *) malloc(sizeof(hey_user)))) perror_exit("Error while allocating a user"); for (i = 0; i < NAMELEN && *(argstring + i) && *(argstring + i) != '.'; i++) u->name[i] = *(argstring + i); u->name[i] = 0; if (*(argstring + i) == '.') { i++; strncpy(u->tty, argstring + i, TTYLEN); u->tty[sizeof(u->tty)-1] = '\0'; } else u->tty[0] = 0; hey_nousers++; u->exists = 0; u->login = 0; u->mesg = 0; return u; } /* Free the space taken by a user */ void hey_userFree(hey_user *u) { free(u); } /* Key a user on their name */ int hey_userKey(void *key, void *data) { char *name = (char *) key; hey_user *u = (hey_user *) data; if (!strncmp(name, u->name, NAMELEN)) { return 1; } else return 0; } /* Function to populate a g_list with usrname from a file */ g_list * hey_user_file(char *filename, g_list *hey_userlist) { FILE *fp; char name[NAMELEN]; hey_user *u; if((fp = fopen(filename, "r")) == NULL) { fprintf(stderr, "hey: Could not open %s", filename); exit(1); } while(fgets(name, NAMELEN, fp) != NULL) { /* Chomp the name */ if((name[strlen(name) - 1]) == '\n') { name[strlen(name) - 1] = '\0'; } u = hey_userNew(name); g_listAppend(hey_userlist, u, hey_userFree); } fclose(fp); return hey_userlist; } /* ** Usage & credit statements. :o) */ void hey_usage(void) { printf ("Usage: hey [-wtohmcfbsepn] user[.tty] [...]\n" " -w <wrap> Specifies what column to wrap words at.\n" " -t <title> Specifies the title string for the message.\n" " -o <title> Specifies the footer string for the message.\n" " -b <borderstr> Specifies the message's border.\n" " -s <successmsg> Specifies message to print on success.\n" " -e <eofstring> Specifies an alternative EOF string.\n" " -f <filename> Spceifies a file of users to hey.\n"); /* gcc 3.0 warning demands we split this string :) */ printf ( " -p <prompt> Specifies the prompt string.\n" " -n <maxnames> Specifies the maximum number of names prompted.\n" " -m Ignore potentially annoying mesg n warnings.\n" " -c Shows the credits.\n" " -h Shows this listing.\n" "Refer to the manpage for further information on the options.\n"); } void hey_credits(void) { printf ("c-hey v%s (c) 2001 Cian Synnott <pooka@redbrick.dcu.ie>\n" "A C implementation of the 'hey' command found here and there in Perl.\n" "See the copyright notice in the distribution for more info on hey's history.\n" "The distribution is available at http://c-hey.redbrick.dcu.ie/\n", HEY_VERSION); } /* Parse all the input options */ void hey_parse_options(int argc, char *argv[]) { hey_user *u; int option; /* Cycle through options */ opterr = 0; while ((option = getopt(argc, argv, "w:t:o:hmcvb:e:f:s:p:n:")) != EOF) { switch (option) { /* Word wrapping */ case 'w' : hey_wrap = atoi(optarg); if (hey_wrap < 10 || hey_wrap > 70) { hey_wrap = DEFAULT_HEY_WRAP; } break; /* Title string */ case 't': if (!(hey_title = strdup(optarg))) perror_exit("Error while allocating title"); if (strlen(hey_title) > 70) { free(hey_title); hey_title = DEFAULT_HEY_TITLE; } break; case 'o': if(!(hey_footer = strdup(optarg))) perror_exit("Error while allocating bottom footer"); if(strlen(hey_footer) > 70) { free(hey_footer); hey_footer = DEFAULT_HEY_FOOTER; } break; case 'f': if(!(filename = strdup(optarg))) perror_exit("Error while allocating filename"); if(strlen(filename) > FILENAME_MAX) { free(filename); perror_exit("Filename length limit exceeded"); } break; /* Help me!!! */ case 'h': case '?': hey_usage(); exit(0); break; /* Show credits */ case 'v': /* version alias */ case 'c': hey_credits(); exit(0); break; /* suppress the mesg status warning */ case 'm': mesg_warning_suppress = 1; break; /* Set the border string */ case 'b': if (!(hey_borders = strdup(optarg))) perror_exit("Error while allocating borders"); if (strlen(hey_borders) < 5 || strlen(hey_borders) > 9) { hey_borders = DEFAULT_HEY_BORDERS; } break; /* set the eof string */ case 'e': if (!(hey_eof = strdup(optarg))) perror_exit("Error while allocating eofstring"); break; /* Set the success message */ case 's': if (!(hey_success = strdup(optarg))) perror_exit("Error while allocating success message"); break; /* the prompt */ case 'p': if (!(hey_prompt = strdup(optarg))) perror_exit("Error while allocating prompt"); break; case 'n': hey_maxnames = atoi(optarg); break; } /* End switch */ } /* End while */ /* If there're no more arguments, no users have been specified */ if ((optind == argc) && (filename == NULL)) { hey_usage(); exit(1); } /* Allocate space for the userlist */ hey_userlist = g_listAlloc(hey_userKey); /* Take usernames from filename */ if(filename != NULL) { hey_userlist = hey_user_file(filename, hey_userlist); } /* Now we cycle through the remaining arguments and pop them into the ** userlist */ for (; optind < argc; optind++) { u = hey_userNew(argv[optind]); g_listAppend(hey_userlist, u, hey_userFree); } /* Rockin'. We're finished here */ return; } /* Checks for hey environment variables, and failing that sets them to their ** default values. No need to return a value as failure here will be of the ** memory variety, and we can therefore barf & exit */ void hey_get_env(void) { char *envar; /* Wrap first ... */ if (!(envar = getenv("HEY_WRAP"))) { hey_wrap = DEFAULT_HEY_WRAP; } else { hey_wrap = atoi(envar); if (hey_wrap < 10 || hey_wrap > 70) { hey_wrap = DEFAULT_HEY_WRAP; } } /* Now title */ if (!(envar = getenv("HEY_TITLE"))) { hey_title = DEFAULT_HEY_TITLE; } else { if (!(hey_title = strdup(envar))) printerr_exit("Woah, memory error while allocating the title.\n"); if (strlen(hey_title) > 70) { free(hey_title); hey_title = DEFAULT_HEY_TITLE; } } /* Now the hey footer */ if(!(envar = getenv("HEY_FOOTER"))) { hey_footer = DEFAULT_HEY_FOOTER; } else { if (!(hey_footer = strdup(envar))) printerr_exit("Woah, memory error while allocating the footer.\n"); if (strlen(hey_footer) > 70) { free(hey_footer); hey_footer = DEFAULT_HEY_FOOTER; } } /* Now borders */ if (!(envar = getenv("HEY_BORDERS"))) { hey_borders = DEFAULT_HEY_BORDERS; } else { if (!(hey_borders = strdup(envar))) printerr_exit("Woah, memory error while allocating the borders.\n"); if (strlen (hey_borders) > 9 || strlen (hey_borders) < 5) { hey_borders = DEFAULT_HEY_BORDERS; } } /* Now prompt */ if (!(envar = getenv("HEY_PROMPT"))) { hey_prompt = DEFAULT_HEY_PROMPT; } else { if (!(hey_prompt = strdup(envar))) printerr_exit("Woah, memory error while allocating prompt"); } /* Now maxnames */ if (!(envar = getenv("HEY_MAXNAMES"))) { hey_maxnames = DEFAULT_HEY_MAXNAMES; } else { hey_maxnames = atoi(getenv("HEY_MAXNAMES")); } /* replacement EOF */ if (!(envar = getenv("HEY_EOF"))) { hey_eof = NULL; } else { if (!(hey_eof = strdup(envar))) { printerr_exit("Woah, memory error while allocating the replacement EOF.\n"); } } /* Finally, success */ if (!(envar = getenv("HEY_SUCCESS"))) { hey_success = DEFAULT_HEY_SUCCESS; } else { if (!(hey_success = strdup(envar))) printerr_exit("Woah, memory error while allocating the borders.\n"); } return; } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������c-hey2.1/hey_arg.h����������������������������������������������������������������������������������0000600�0076323�0001766�00000005671�07715567651�015016� 0����������������������������������������������������������������������������������������������������ustar �c-hey���������������������������projects������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#ifndef _hey_arg_h_ #define _hey_arg_h_ /* ** File: hey_arg.h ** Desc: Parse the arguments to hey, including constructing the list ** of usernames etc. Also handle the environment variables ** supported. ** Auth: Cian Synnott <pooka@redbrick.dcu.ie> ** Date: Mon Nov 9 19:19:20 GMT 1998 ** ** $Id: hey_arg.h,v 1.4 2003/08/11 01:21:45 c-hey Exp $ */ #include <string.h> /* string handling functions for env */ #include <stdlib.h> /* getenv() & it's ilk */ #include <stdio.h> /* dunno.. testing or NULL probably */ #include <unistd.h> /* For getopt -- oh, may want to check that for ** portability*/ #include "g_list.h" /* For to construct a list of users with :o) */ #include "utent.h" #include "config.h" #ifdef UT_NAMESIZE #define NAMELEN UT_NAMESIZE #else #define NAMELEN 16 #endif #define TTYLEN 8 /* ** List to hold all of the users */ extern g_list *hey_userlist; /* ** Structure to hold one user from the command line, plus their optional ** bits */ typedef struct _hey_user_ { char name [NAMELEN + 1]; /* + 1 for adding \0 termination */ char tty [TTYLEN + 1]; /* Same */ char exists; char login; char mesg; } hey_user; /* ** Values settable via environment variables. */ extern int hey_wrap; /* word-wrapping limit */ extern int hey_nousers; /* number of users getting heyed */ extern char *hey_title; /* 'title' message for the hey */ extern char *hey_footer; /* 'footer' message for the hey */ extern char *hey_borders; /* string containing the border chars */ extern char *hey_success; /* string to output on success */ extern char *hey_eof; /* replacement EOF */ extern char *hey_prompt; /* string to use as hey prompt */ extern int hey_maxnames; /* maximum number of names in prompt */ /* ** Suppress the potentialy annoying mesg status warning */ extern int mesg_warning_suppress; /* defaults for those variables */ #define DEFAULT_HEY_WRAP 70 #define DEFAULT_HEY_TITLE "" #define DEFAULT_HEY_FOOTER "" #define DEFAULT_HEY_BORDERS "o OO" #define DEFAULT_HEY_SUCCESS "groovy" #define DEFAULT_HEY_PROMPT NULL #define DEFAULT_HEY_MAXNAMES 3 /* Macros to access different parts of the border ... */ #define B_DFLT(x) ( ((x) == ' ') ? hey_borders[0] : (x) ) #define B_TOP B_DFLT(hey_borders[1]) #define B_BOT B_DFLT(hey_borders[2]) #define B_RHT B_DFLT(hey_borders[3]) #define B_LFT B_DFLT(hey_borders[4]) #define B_TOPLFT (strlen (hey_borders) > 5) ? B_DFLT(hey_borders[5]) : hey_borders[0] #define B_TOPRHT (strlen (hey_borders) == 9) ? B_DFLT(hey_borders[6]) : B_TOPLFT #define B_BOTLFT (strlen (hey_borders) == 9) ? B_DFLT(hey_borders[7]) : B_TOPLFT #define B_BOTRHT (strlen (hey_borders) == 9) ? B_DFLT(hey_borders[8]) : B_TOPLFT /* parse all the input arguments */ extern void hey_parse_options(int argc, char *argv[]); /* Checks for hey environment variables, and failing that sets them to their ** default values. */ extern void hey_get_env(void); #endif �����������������������������������������������������������������������c-hey2.1/hey_edit.c���������������������������������������������������������������������������������0000600�0076323�0001766�00000026034�10015227341�015131� 0����������������������������������������������������������������������������������������������������ustar �c-hey���������������������������projects������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* ** File: hey_edit.c ** Desc: screen handling functions for live editing ** Auth: Colm MacCarthaigh (colmmacc@redbrick.dcu.ie) ** Date: 5/9/01 ** ** $Id: hey_edit.c,v 1.7 2003/08/11 01:47:08 c-hey Exp $ */ /* ** this is some pretty complicated shit - but well worth it :) ** ** ANSI escapes rock! ** ** see the ansi file in doc/ ** ** some things to note when changing stuff: ** ** lines != rows ** there may be rows above the cursor or below the cursor ** from the _current_ line ** */ #include <stdarg.h> #include <string.h> #include <strings.h> #include <stdio.h> #include <stdlib.h> #include <ctype.h> #include "hey_readline.h" #include "hey_edit.h" #include "hey_format.h" #include "dyn_page.h" #include "config.h" #include "aux.h" #include <readline/readline.h> #include <readline/history.h> #ifndef HAVE_RL_DING /* we are dealing with an old version of readline */ #define rl_ding ding #endif /* return printable string length */ static int pstrlen(const char * string) { int i, count; for(i=0, count=0; string[i]; i++) if(isprint((int)string[i])) count++; return count; } /* the current buffer */ static dyn_page * my_page; /* do we even try to do anything */ static int hey_noaction = 0; /* UTILITY FUNCTIONS */ /* save the state of the current line */ static void savestate(void) { if(hey_line == hey_linetotal && hey_lastdone == 0 ) { /* line is the last line, and hasnt been added */ /* add it */ dyn_pageAppend(my_page, rl_line_buffer); /* it's been done now */ hey_lastdone = 1; } else { /* commit any changes */ dyn_pageLineMod(my_page, rl_line_buffer, hey_line - 1); } } /* ** returns the number of terminal rows the line takes up ** ** if cursor is not -1 then it reports the number of rows: ** ** direction > 0 : above cursor line ** direction < 0 : below cursor line ** ** from the current line */ static int rl_numrows(char * line, int cursor, int direction) { int total_len; int ret; int term_width; char *envval; if(line == NULL) return pstrlen(hey_rlprompt); if((envval = getenv("COLUMNS")) == NULL) return 1; term_width = atoi(envval); total_len = pstrlen(line) + pstrlen(hey_rlprompt); if(cursor != -1 && direction < 0) { /* get rid of any lines up until the line cursor is on */ cursor += strlen(hey_rlprompt); for(; cursor > (term_width - 1); cursor -= term_width) total_len -= term_width; /* count the lines */ for(ret = 0; total_len > (term_width - 1); total_len -= term_width) ret++; return ret; } if(cursor != -1 && direction > 0) { /* pretend the line is only as long as the cursor pos */ cursor += pstrlen(hey_rlprompt); for(ret = 0; cursor > (term_width - 1); cursor -= term_width) ret++; return ret; } for(ret = 1; total_len > (term_width - 1); total_len -= term_width) ret++; return ret; } /* wrapper for the arrow keys */ int hey_arrows(int count, int key) { int ch; ch = rl_read_key(); switch(toupper(ch)) { case 'A': hey_lineup(count, ch); break; case 'B': hey_linedown(count, ch); break; case 'C': rl_forward(count, ch); break; case 'D': rl_backward(count, ch); break; default: rl_ding(); } return 0; } int hey_bindkeys(void) { /* macro for binding a function in all keymaps */ #define RLBINDFUNC( seq , func ) \ rl_generic_bind(ISFUNC , (seq) , (char *) (func), emacs_standard_keymap); \ rl_generic_bind(ISFUNC , (seq) , (char *) (func), emacs_meta_keymap); \ rl_generic_bind(ISFUNC , (seq) , (char *) (func), emacs_ctlx_keymap); \ rl_generic_bind(ISFUNC , (seq) , (char *) (func), vi_movement_keymap); \ rl_generic_bind(ISFUNC , (seq) , (char *) (func), vi_insertion_keymap); /* macro to get rid of a funcion in all keymaps */ #define RLPURGEFUNC( func ) \ rl_unbind_function_in_map( (func), emacs_standard_keymap); \ rl_unbind_function_in_map( (func), emacs_meta_keymap); \ rl_unbind_function_in_map( (func), emacs_ctlx_keymap); \ rl_unbind_function_in_map( (func), vi_movement_keymap); \ rl_unbind_function_in_map( (func), vi_insertion_keymap); /* first get rid of anything that messes up formatting */ rl_bind_key('\t', rl_insert); /* get rid of completion */ rl_bind_key( CTRL('l') , hey_refresh); /* we have our own refresh */ rl_bind_key( CTRL('d'), hey_return); /* ctrl - d = return in vi mode */ /* these can span lines */ RLPURGEFUNC(rl_insert_comment); RLPURGEFUNC(rl_insert_comment); RLPURGEFUNC(rl_complete); RLPURGEFUNC(rl_insert_completions); RLPURGEFUNC(rl_possible_completions); RLPURGEFUNC(rl_menu_complete); RLPURGEFUNC(rl_reverse_search_history); RLPURGEFUNC(rl_forward_search_history); RLPURGEFUNC(rl_history_search_forward); RLPURGEFUNC(rl_history_search_backward); RLPURGEFUNC(rl_noninc_forward_search); RLPURGEFUNC(rl_noninc_reverse_search); RLPURGEFUNC(rl_noninc_forward_search_again); RLPURGEFUNC(rl_noninc_reverse_search_again); /* we have our own arrow keys and carriage return */ rl_bind_key('\r', hey_return); rl_bind_key('\n', hey_return); RLBINDFUNC("\033[", hey_arrows); RLBINDFUNC("\033O", hey_arrows); RLBINDFUNC("\033k", hey_lineup); RLBINDFUNC("\033j", hey_linedown); #undef RLBINDFUNC #undef RLPURGEFUNC return 0; } /* is this TERM suitable */ static int is_term_ok(void) { /* blank for now, but may become usefull */ return 1; } /* END OF UTILITY FUNCTIONS */ /* move count lines up */ /* if key < 0 - dont savestate */ /* if key == -2 - rl_point = 0 */ int hey_lineup(int count, int key) { int cur_pos = 0; int cur_cache = 0; int cur_jump = 0; int i; if(hey_noaction) return 0; if((hey_line - count) <= 0) { rl_ding(); return 0; } /* save the state of the current line */ cur_pos = rl_point; if(key >= 0) savestate(); if(key == -2) { cur_cache = cur_pos; cur_pos = 0; } /* count how many rows <count> lines above us take up */ for(i = (hey_line - abs(count)); i < hey_line; i++) cur_jump += rl_numrows( dyn_pageLineAt(my_page, i - 1) , -1, 0); /* add any extra rows produced by the current line */ cur_jump += rl_numrows( dyn_pageLineAt(my_page, hey_line - 1), cur_pos, 1); /* ** move up count lines ** move backwards ** kill the current line */ if(cur_jump) printf("\033[%dA", cur_jump); printf("\033[%dD\033[K", (int)strlen(hey_rlprompt) + cur_pos); fflush(stdout); /* change hey_line */ hey_line -= count; /* insert the text */ rl_point = 0; rl_insert_text( dyn_pageLineAt(my_page, hey_line - 1)); rl_delete_text( strlen(dyn_pageLineAt(my_page, hey_line - 1)), rl_end); /* fix the cursors position */ if(rl_end < cur_pos) { rl_point = rl_end; } else { rl_point = cur_pos; } /* redisplay everything */ if(key == -2) rl_point = cur_cache; rl_forced_update_display(); return 1; } /* move count lines down */ int hey_linedown(int count, int key) { int cur_pos = 0; int cur_jump = 0; int i; if(hey_noaction) return 0; if( (hey_line + count) > hey_linetotal ) { rl_ding(); return 0; } /* save the state of the current line */ cur_pos = rl_point; savestate(); /* count how many rows <count> lines below us take up */ for(i = hey_line + 1; i < (hey_line + abs(count)); i++) cur_jump += rl_numrows( dyn_pageLineAt(my_page, i - 1) , -1, 0); cur_jump++; /* add any extra rows produced by the current line */ cur_jump += rl_numrows( dyn_pageLineAt(my_page, hey_line - 1), rl_point, -1); /* ** move down count lines ** move backwards ** kill the current line */ if(cur_jump) printf("\033[%dB\033[%dD\033[K", cur_jump , (int)strlen(hey_rlprompt) + cur_pos); fflush(stdout); /* change hey_line */ hey_line += count; /* insert the text */ rl_point = 0; rl_insert_text( dyn_pageLineAt(my_page, hey_line - 1) ); rl_delete_text( strlen(dyn_pageLineAt(my_page, hey_line - 1)), rl_end); /* fix the cursors position */ if(rl_end < cur_pos) { rl_point = rl_end; } else { rl_point = cur_pos; } /* redisplay everything */ rl_forced_update_display(); return 1; } /* for when we hit the return key */ int hey_return(int count, int key) { /* test for EOF */ if(hey_eof != NULL) { if(!strcmp(rl_line_buffer,hey_eof)) { rl_done = 1; return 1; } } /* are we on the last line ? */ if (hey_line != hey_linetotal) { /* no */ /* move down a line */ return hey_linedown(1,0); } else { /* yes */ savestate(); rl_done = 1; /* skip any rows below us from the current line */ if( rl_numrows( rl_line_buffer , rl_point , -1) ) { printf("\033[%dC", rl_numrows( rl_line_buffer , rl_point , -1) ); } /* print the newline */ printf("\n"); fflush(stdout); return 1; } } /* refrsh the screen */ int hey_refresh(int count, int key) { int i; if(hey_noaction) return 0; /* save the state of the current line */ savestate(); /* go to the start the current line */ printf("\033[%dD", rl_point + (int)strlen(hey_rlprompt) ); fflush(stdout); /* move up if desired */ if(count) { /* move up the right number of lines */ for(i=0; i < hey_line - 1; i++) { printf("\033[%dA", rl_numrows(dyn_pageLineAt(my_page, i), 0, 0)); fflush(stdout); } if( rl_numrows(rl_line_buffer , rl_point, 1) ){ printf("\033[%dA", rl_numrows(rl_line_buffer, rl_point, 1)); fflush(stdout); } } /* print all the lines */ for(i=0; i < hey_linetotal; i++) { printf("\033[K%s%s", hey_rlprompt, dyn_pageLineAt(my_page, i)); if( i < (hey_linetotal -1)) printf("\n"); fflush(stdout); } /* go to the start the current line */ printf("\033[%dD", (int)strlen( dyn_pageLineAt(my_page, i - 1 ) ) + (int)strlen(hey_rlprompt) ); fflush(stdout); i = hey_line; hey_line = hey_linetotal; if(hey_line != i ) { hey_lineup(hey_linetotal - i, -2); } else { hey_lineup(hey_linetotal - i, -1); } return 1; } /* Read user input into hey_page, also allocates it & suchlike */ void hey_rl_input(void) { char *line; char *ptr; int i; /* Allocate hey_page, passing hey_wrap as the word wrapping width */ if (!(my_page = dyn_pageAlloc(0))) printerr_exit ("Woah. Error allocating my_page.\n"); /* we are editing now */ hey_readline_init(); if(is_term_ok() == 0) hey_noaction = 1; /* dont grab the lines, savestate will do that */ while (hey_readline()); /* done */ hey_readline_fini(); /* Allocate hey_page, passing hey_wrap as the word wrapping width */ if (!(hey_page = dyn_pageAlloc(hey_wrap))) printerr_exit ("Woah. Error allocating hey_page.\n"); /* generate hey_page from my_page */ if(!(line = dyn_pageRead(my_page))) printerr_exit("hey: no input or input lost. (preformat page)\n" "\nIf you did input something " "and this happened, please make a\n" "copy of your data and send it to " "c-hey@redbrick.dcu.ie for debugging.\n" "Thanks.\n\n"); i = 0; do { i++; /* weed out empty last lines */ if( ! (i == hey_linetotal && !strcmp(line,"")) ) { /* Clean up whitespace */ for (ptr = line; *ptr; ptr++) { switch (*ptr) { case '\t': case '\f': case '\r': case '\n': *ptr = ' '; } } /* add the line */ dyn_pageAppend(hey_page, line); } } while ((line = dyn_pageRead(NULL))); dyn_pageFree(my_page); /* And that's that ... */ return; } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������c-hey2.1/hey_edit.h���������������������������������������������������������������������������������0000600�0076323�0001766�00000001617�07413721216�015146� 0����������������������������������������������������������������������������������������������������ustar �c-hey���������������������������projects������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#ifndef _hey_edit_h_ #define _hey_edit_h_ /* ** File: hey_readline.h ** Desc: Readiing functions for c-hey ** Auth: Colm Mac Carthaigh <colmmacc@redbrick.dcu.ie> ** Date: Sun Nov 15 19:49:44 GMT 1998 ** ** $Id: hey_edit.h,v 1.2 2001/12/30 23:26:06 c-hey Exp $ */ /* Read user input into hey_page, also allocates it & suchlike */ extern void hey_rl_input(void); /* bindable functions */ /* move count lines up */ extern int hey_lineup(int count, int key); /* move count lines down */ extern int hey_linedown(int count, int key); /* for when we hit return */ extern int hey_return(int count, int key); /* ** refreshes the screen ** ** if count is non-zero it reprint everything ** and go to old cursor position ** */ extern int hey_refresh(int count, int key); /* wrapper for the arrow keys */ extern int hey_arrows(int count, int key); /* wrapper to bind keys */ extern int hey_bindkeys(void); #endif �����������������������������������������������������������������������������������������������������������������c-hey2.1/hey_format.c�������������������������������������������������������������������������������0000600�0076323�0001766�00000012637�10015225401�015473� 0����������������������������������������������������������������������������������������������������ustar �c-hey���������������������������projects������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* ** File: hey_format.c ** Desc: Reading & formatting functions for 'hey' ** Auth: Cian Synnott <pooka@redbrick.dcu.ie> ** Date: Sun Nov 15 19:56:51 GMT 1998 ** ** $Id: hey_format.c,v 1.3 2003/08/11 01:21:45 c-hey Exp $ */ #include <stdarg.h> #include <string.h> #include <stdio.h> #include "hey_format.h" #include "hey_readline.h" #include "dyn_page.h" #include "config.h" #include "aux.h" #ifdef HAVE_LIBREADLINE /* <bobb> readline includes */ #include <readline/readline.h> #include <readline/history.h> #endif #define LINESIZE 128 /* Buffer to keep things in */ dyn_page *hey_page = NULL; /* Read user input into hey_page, also allocates it & suchlike */ void hey_user_input(void) { char *ptr; char *line; /* Allocate hey_page, passing hey_wrap as the word wrapping width */ if (!(hey_page = dyn_pageAlloc(hey_wrap))) printerr_exit ("Woah. Error allocating hey_page.\n"); /* we are editing now */ hey_readline_init(); while ((line = hey_readline())){ /* Clean up whitespace */ for (ptr = line; *ptr; ptr++) switch (*ptr) { case '\t': case '\f': case '\r': case '\n': *ptr = ' '; } /* Append line to page */ if(!(dyn_pageAppend(hey_page, line))){ printerr_exit("Realloc failure from dyn_pageAppend in hey_page.\n"); } } hey_readline_fini(); /* And that's that ... */ return; } /* Prototype for strprint(); see below ... */ char *strprint(char *, int, char *, ...); /* Formats the lines present in hey_page into the 'hey' to be sent. */ void hey_format_input(void) { dyn_page *new_format; char line[LINESIZE]; char *ptr; int offset, topwidth, btnwidth, width; if(strlen(hey_title) > strlen(hey_footer)) { width = strlen(hey_title) + 2; } else { width = strlen(hey_footer) + 2; } /* Calculate the width of the hey .. It's either the strlen (hey_title) ** + 2 (spaces on either side), or the longest string in hey_page ** Then add 4 for the space on either side of the message & ** the side border chars */ if(!(ptr = dyn_pageRead(hey_page))) return; do { if (strlen(ptr) > width) width = strlen(ptr); } while ((ptr = dyn_pageRead(NULL))); width += 4; /* Set up the offset to print before each line (thus centering it ...) */ offset = ((80 - width) / 2); /* Allocate the new page, with no wrapping width */ if (!(new_format = dyn_pageAlloc(0))) printerr_exit("Woah. Error allocating formatted page.\n"); /* Print top line into it */ if (!strlen(hey_title)) strprint(line, LINESIZE, "%xc%c%xc%c", ' ', offset, B_TOPLFT, B_TOP, width - 2, B_TOPRHT); else { /* The total number of 'top' border chars we'll have to print is the ** the width minus two chars for the corners, two chars for the spaces ** either side of the title, and the length of the title itself */ topwidth = width - 4 - strlen(hey_title); strprint(line, LINESIZE, "%xc%c%xc %s %xc%c", ' ', offset, B_TOPLFT, B_TOP, topwidth / 2, hey_title, B_TOP, topwidth - (topwidth / 2), B_TOPRHT); } dyn_pageAppend(new_format, line); /* Print all the other lines into it */ if(!(ptr = dyn_pageRead(hey_page))) return; do { /* Format the line & append to new page */ strprint(line, LINESIZE, "%xc%c %s%xc%c", ' ', offset, B_LFT, ptr, ' ', width - 3 - strlen(ptr), B_RHT); dyn_pageAppend(new_format, line); } while ((ptr = dyn_pageRead(NULL))); /* now for the footer */ if(!strlen(hey_footer)) strprint(line, LINESIZE, "%xc%c%xc%c", ' ', offset, B_BOTLFT, B_BOT, width - 2, B_BOTRHT); else { btnwidth = width - 4 - strlen(hey_footer); strprint(line, LINESIZE, "%xc%c%xc %s %xc%c", ' ', offset, B_BOTLFT, B_BOT, btnwidth / 2, hey_footer, B_BOT, btnwidth - (btnwidth / 2), B_BOTRHT); } dyn_pageAppend(new_format, line); /* Free the old hey_page, and point at the new formatted one */ dyn_pageFree(hey_page); hey_page = new_format; return; } /* A little like a stripped-down version of snprintf. Accepts only string and ** character arguments, and only one modifier - x, meaning that the argument ** after the string or char will be the number of times to repeat it. */ char *strprint(char *str, int size, char *fmt, ...) { char *str_p, *fmt_p, *str_arg, char_arg; va_list args; int multiple; /* Clear the string and setup the va_* macros */ memset(str, 0, size); va_start(args, fmt); str_p = str; fmt_p = fmt; /* Cycle through the format string */ while (*fmt_p && (str_p - str) < size) { if (*fmt_p == '%') { multiple = 1; char_arg = 0; str_arg = 0; fmt_p++; switch (*fmt_p) { case 'c': char_arg = (char)va_arg(args, int); break; case 's': str_arg = va_arg(args, char *); break; case 'x': fmt_p++; if (*fmt_p == 'c') char_arg = (char)va_arg(args, int); if (*fmt_p == 's') str_arg = va_arg(args, char *); multiple = va_arg(args, int); break; default: return NULL; } fmt_p++; /* Concat the char or string arg onto the end of str 'multiple' ** times */ while (multiple && (str_p - str) < size - 1) { if (str_arg) { strncat(str, str_arg, size - strlen(str) - 1); str_p += strlen(str_arg); } else if (char_arg) { *str_p = char_arg; str_p++; } multiple--; } } else { *str_p = *fmt_p; str_p++, fmt_p++; } } /* Set the last character to 0 if necessary */ if ((str_p - str) >= size) str[size - 1] = 0; /* Finish & return */ va_end(args); return str; } �������������������������������������������������������������������������������������������������c-hey2.1/hey_format.h�������������������������������������������������������������������������������0000600�0076323�0001766�00000001120�07413721216�015476� 0����������������������������������������������������������������������������������������������������ustar �c-hey���������������������������projects������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#ifndef _hey_format_h_ #define _hey_format_h_ /* ** File: hey_format.h ** Desc: Reading & formatting functions for 'hey' ** Auth: Cian Synnott <pooka@redbrick.dcu.ie> ** Date: Sun Nov 15 19:49:44 GMT 1998 ** ** $Id: hey_format.h,v 1.2 2001/12/30 23:26:06 c-hey Exp $ */ #include "dyn_page.h" #include "hey_arg.h" /* Buffer to keep things in */ extern dyn_page *hey_page; /* Read user input into hey_page, also allocates it & suchlike */ extern void hey_user_input(void); /* Formats the lines present in hey_page into the 'hey' to be sent */ extern void hey_format_input(void); #endif ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������c-hey2.1/hey_logins.c�������������������������������������������������������������������������������0000600�0076323�0001766�00000005702�07715567651�015526� 0����������������������������������������������������������������������������������������������������ustar �c-hey���������������������������projects������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* ** File: hey_logins.c ** Desc: Routines to check if a username exists/is logged in ** Auth: Cian Synnott <pooka@redbrick.dcu.ie> ** Date: Mon Nov 16 03:30:11 GMT 1998 ** ** $Id: hey_logins.c,v 1.3 2003/08/11 01:21:45 c-hey Exp $ */ #include <sys/stat.h> #include <unistd.h> #include "hey_logins.h" #include "utent.h" #include "aux.h" /* Does a user exist on the system ? */ int hey_user_exists(hey_user *u) { return u->exists = (getpwnam(u->name) ? 1 : 0); } /* Check permissions of a device file ... */ int hey_mesg_on(char *tty) { char filename[FILENAME_MAX]; struct stat s; snprintf(filename, FILENAME_MAX, "/dev/%s", tty); if(tty[0]==':') /* we need to ignore ":0" type tty's on X systems */ return 0; if (stat(filename, &s) == -1) printerr_exit("Woah. Error statting %s in hey_mesg_on.\n", filename); if (s.st_mode & S_IWGRP) return 1; else return 0; } /* Are they logged on (to tty specified) ? ** This is pretty full of conditional code, but it's just for the whole ** utmp/utmpx thing. Hopefully this won't happen many other places in the ** program */ int hey_user_login(hey_user *u) { #ifndef HAVE_UTMPX_H struct utmp *ent; #else struct utmpx *ent; #define ut_name ut_user #define getutent() getutxent() #define setutent() setutxent() #define endutent() endutxent() #endif setutent(); while ((ent = getutent()) != NULL) { /* Skip unless it's the name we're interested in */ if (strncmp (u->name, ent->ut_name, NAMELEN)) continue; #ifdef HAVE_UTMPX_H if(ent->ut_type != USER_PROCESS) continue; #endif /* It's one we want */ if (!u->login) { if (u->tty[0]) { if (!strncmp(u->tty, ent->ut_line, TTYLEN)) { u->login = 1; break; } } else u->login = 1; } /* Check if mesg is on on this tty, but only if we've not already ** found a mesg y one */ if (!u->mesg) u->mesg = hey_mesg_on(ent->ut_line); } endutent(); #ifndef HAVE_UTMPX_H #undef ut_name #undef getutent #undef setutent #undef endutent #endif if (!u->login) return NOT_LOGGED_ON; if (u->tty[0]) u->mesg = hey_mesg_on(u->tty); if (!u->mesg) { return NOT_MESG_Y; } return LOGGED_ON; } /* detects the users mesg status */ mesg_flag my_mesg() { struct stat tty_stat; char *tty; if ((tty = ttyname(STDERR_FILENO)) == NULL || stat(tty, &tty_stat) < 0) { printerr_exit("hey: error detecting mesg status\n"); } if (tty_stat.st_mode & S_IWGRP) { return MESG_Y; } return MESG_N; } /* sets the users mesg status */ int set_mesg(mesg_flag status) { struct stat tty_stat; char *tty; if ((tty = ttyname(STDERR_FILENO)) == NULL || stat(tty, &tty_stat) < 0) { printerr_exit("hey: error detecting mesg status\n"); } if(status == MESG_N) { if (!(chmod(tty, tty_stat.st_mode & 01777) < 0)) { return 1; } } else if(status == MESG_Y) { if (!(chmod(tty, tty_stat.st_mode | 01777) < 0)) { return 1; } } return 0; } ��������������������������������������������������������������c-hey2.1/hey_logins.h�������������������������������������������������������������������������������0000600�0076323�0001766�00000001416�07413721216�015511� 0����������������������������������������������������������������������������������������������������ustar �c-hey���������������������������projects������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#ifndef _hey_logins_h_ #define _hey_logins_h_ /* ** File: hey_logins.h ** Desc: Routines to check if a username exists/is logged in ** Auth: Cian Synnott <pooka@redbrick.dcu.ie> ** Date: Mon Nov 16 03:33:41 GMT 1998 ** ** $Id: hey_logins.h,v 1.2 2001/12/30 23:26:06 c-hey Exp $ */ #include <pwd.h> #include "hey_arg.h" /* Does a user exist on the system ? */ extern int hey_user_exists(hey_user *u); /* Are they logged on (and on the tty specified)? */ extern int hey_user_login(hey_user *u); /* Mesg flags */ typedef enum _mesg_flag {MESG_N,MESG_Y} mesg_flag; /* Am I mesg y? */ extern mesg_flag my_mesg(); /* set my mesg status */ extern int set_mesg(mesg_flag); /* Possible return values for hey_user_login */ enum { NOT_LOGGED_ON, NOT_MESG_Y, LOGGED_ON }; #endif ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������c-hey2.1/hey_main.c���������������������������������������������������������������������������������0000600�0076323�0001766�00000007404�10015227652�015135� 0����������������������������������������������������������������������������������������������������ustar �c-hey���������������������������projects������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* ** File: hey_main.c ** Desc: main() function for hey ** Auth: Cian Synnott <pooka@redbrick.dcu.ie> ** Date: Tue Nov 10 18:50:57 GMT 1998 ** ** $Id: hey_main.c,v 1.8 2004/02/19 21:50:34 c-hey Exp $ */ #include "hey_arg.h" #include "hey_format.h" #include "hey_signal.h" #include "hey_logins.h" #include "hey_readline.h" #include "hey_edit.h" #include "aux.h" #define COMMANDLEN 64 /* the initial mesg status */ mesg_flag init_mesg_status; /* Clean up, just to be nice */ void hey_cleanup(void) { /* set mesg status back */ if (init_mesg_status == MESG_N) { if (!set_mesg(MESG_N)) { printerr("hey: error going mesg n\n"); } if (!mesg_warning_suppress) { printerr("hey: warning - you are not accepting messages on this terminal\n"); } } dyn_pageFree(hey_page); g_listFree(hey_userlist); return; } int main(int argc, char *argv[]) { char command[COMMANDLEN]; hey_user *u; FILE *pipe; char *ptr; /* Setup signal handlers and parse environment & options */ hey_signal_setup(); hey_terminal_setup(); hey_get_env(); hey_parse_options(argc, argv); /* Warn if a user isn't logged on/doesn't exist */ u = (hey_user *) g_listTraverse(hey_userlist); do { /* Firstly, do they exist? */ if (!hey_user_exists(u)) { printerr("hey: warning - %s does not exist\n", u->name); continue; } /* Check if they're logged in on terminal specified (if any) */ switch (hey_user_login(u)) { case NOT_LOGGED_ON: printerr("hey: warning - %s is not logged in", u->name); if (u->tty[0]) printerr(" on %s", u->tty); printerr(".\n"); break; case NOT_MESG_Y: printerr("hey: warning - %s has messages disabled", u->name); if (u->tty[0]) printerr(" on %s", u->tty); printerr(".\n"); break; } } while ((u = (hey_user *) g_listTraverse(NULL)) != NULL); /* Read user input and then format it */ #ifndef HAVE_LIBREADLINE hey_user_input(); #endif #ifdef HAVE_LIBREADLINE if (isatty(STDIN_FILENO)) { hey_rl_input(); } else { hey_user_input(); } #endif hey_format_input(); /* deal with their mesg status */ init_mesg_status = my_mesg(); if (init_mesg_status == MESG_N) { if(!set_mesg(MESG_Y)) { printerr_exit("hey: error going mesg y\n"); } } /* call hey_cleanup when we exit */ atexit(hey_cleanup); /* Iterate through user list */ u = (hey_user *) g_listTraverse(hey_userlist); do { if (!u->exists) { printerr("hey: %s does not exist\n", u->name); continue; } else if (!u->login) { printerr("hey: %s is not logged in", u->name); if (u->tty[0]) printerr(" on %s", u->tty); printerr(".\n"); continue; } else if (!u->mesg) { printerr("hey: %s has messages disabled", u->name); if (u->tty[0]) printerr(" on %s", u->tty); printerr(".\n"); continue; } /* Prepare to cycle through the page & print it out */ if (!(ptr = dyn_pageRead(hey_page))) printerr_exit("hey: no input or input lost. (formatted page)\n" "\nIf you did input something " "and this happened, please make a\n" "copy of your data and send it to " "c-hey@redbrick.dcu.ie for debugging.\n" "Thanks.\n\n"); /* Open the pipe to write */ snprintf(command, COMMANDLEN, "%s %s ", WRITE_PROG, u->name); if (u->tty[0]) strncat(command, u->tty, COMMANDLEN - 1); if (!(pipe = popen(command, "w"))) printerr_exit("hey: couldn't open pipe to write.\n"); /* Print out the page to write */ do { fprintf(pipe, "%s\n", ptr); } while ((ptr = dyn_pageRead(NULL))); /* Close the pipe */ if(pclose(pipe) == -1) { perror("hey: failure"); exit(1); } /* Success message */ printf("hey: %s", u->name); if (u->tty[0]) printf(".%s", u->tty); printf(" - %s\n", hey_success); } while ((u = (hey_user *) g_listTraverse(NULL)) != NULL); return 0; } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������c-hey2.1/hey_readline.c�����������������������������������������������������������������������������0000600�0076323�0001766�00000013365�10015227652�015777� 0����������������������������������������������������������������������������������������������������ustar �c-hey���������������������������projects������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* ** File: hey_readline.c ** Desc: Contains the general hooks for reading a line ** Auth: Colm MacCarthaigh (colmmacc@redbrick.dcu.ie) ** Date: 5/9/01 ** ** $Id: hey_readline.c,v 1.4 2004/02/19 21:50:34 c-hey Exp $ */ /* ** this is some pretty complicated shit - but well worth it :) ** ** ANSI escapes rock! */ #include <stdarg.h> #include <string.h> #include <stdio.h> #include "hey_readline.h" #include "hey_edit.h" #include "hey_format.h" #include "hey_arg.h" #include "dyn_page.h" #include "config.h" #include "aux.h" #ifdef HAVE_LIBREADLINE /* <bobb> readline includes */ #include <readline/readline.h> #include <readline/history.h> #endif #define LINESIZE 128 /* Should be plenty */ /* are we currently editing ? */ static int hey_editing; #ifdef HAVE_LIBREADLINE /* the line we are currently on */ int hey_line = 0; /* the total number of lines */ int hey_linetotal = 0; /* has the last line been appended */ int hey_lastdone = 0; #endif /* the expanded prompt */ char *hey_rlprompt; /* initialise readline stuff */ void hey_readline_init() { #ifdef HAVE_LIBREADLINE if (isatty(STDIN_FILENO)) { /* every app should have this set */ rl_readline_name = "hey"; /* add our function names */ rl_add_defun("hey_carriage_return", hey_return, -1); rl_add_defun("hey_line_up", hey_lineup, -1); rl_add_defun("hey_line_down", hey_linedown, -1); rl_add_defun("hey_arrows", hey_arrows, -1); rl_add_defun("hey_return", hey_return, -1); /* tell readline where to find bindings */ rl_startup_hook = hey_bindkeys; } #endif /* make sure prompt is set */ if((hey_rlprompt = hey_generate_prompt()) == NULL) { hey_rlprompt = strdup(""); } /* we are now editing */ hey_editing = 1; } /* we are done reading lines */ void hey_readline_fini() { /* we are done editing */ hey_editing = 0; /* the prompt can upset error messages */ if(strcmp(hey_rlprompt,"") && isatty(STDIN_FILENO)) printf("\n"); /* leaks are bad */ free(hey_rlprompt); } /* actually read a line from standard input */ char *hey_readline(void) { char * line; static char buffer[LINESIZE]; hey_line++; hey_linetotal++; hey_lastdone = 0; #ifdef HAVE_LIBREADLINE if (isatty(STDIN_FILENO)) { if((line = readline(hey_rlprompt)) == NULL) { return NULL; } } else { /* get the line */ if(!fgets(buffer, LINESIZE, stdin)) { return NULL; } /* chomp the line */ if (strlen(buffer) > 1) if (buffer[strlen(buffer) - 1] == '\n') buffer[strlen(buffer) - 1] = '\0'; /* We'll need to return it */ line = buffer; } #else /* HAVE_LIBREADLINE */ if (isatty(STDIN_FILENO)) { /* print the prompt */ printf("%s", hey_rlprompt); } /* get the line */ if(!fgets(buffer,LINESIZE,stdin)) { return NULL; } /* chomp the line */ if (strlen(buffer) > 1) if (buffer[strlen(buffer) - 1] == '\n') buffer[strlen(buffer) -1] = '\0'; line = buffer; #endif /* test for EOF */ if(hey_eof != NULL) { if(!strcmp(line, hey_eof)) { return NULL; } } /* throw it back */ return line; } /* generate the hey prompt */ char *hey_generate_prompt(void) { char *username; hey_user *user; char *prompt_line; int count; char *ptr; #define MINIBUFSIZE 16 char mini_buffer[MINIBUFSIZE]; /* <x> This code is my fault. Blame me :) */ if (hey_prompt) { /* Allocate initial space for the prompt_line */ if ((prompt_line = malloc(1)) == NULL) { perror_exit("hey: Out of Memory while allocating prompt_line\n"); } *prompt_line = '\0'; /* Format the username string */ /* Add the first user name we are heying */ /* there will always be one .... */ user = (hey_user *)g_listTraverse(hey_userlist); if (user) { username = strdup(user->name); } else { if((username = malloc(1)) == NULL) { perror_exit("hey: Out of Memory while allocating username\n"); } *username = '\0'; } /* Add additional names * If we have more than 4, we put in ... to show multiple users */ for (count = 1; count < hey_nousers ; count++) { if (count < hey_maxnames) { user = (hey_user *)g_listTraverse(NULL); if(user != NULL) { username = m_strcat(username, " "); username = m_strcat(username, user->name); } } else { username = m_strcat(username," ..."); break; } } /* do some search and replace */ for (ptr = hey_prompt; *ptr; ptr++) { if (*ptr == '%') { switch(*(ptr + 1)) { case '%': prompt_line = m_strcat(prompt_line, "%"); ptr++; break; case 'u': case 'U': prompt_line = m_strcat(prompt_line, username); ptr++; break; case 'n': case 'N': snprintf(mini_buffer, MINIBUFSIZE, "%d", hey_nousers); prompt_line = m_strcat(prompt_line, mini_buffer); ptr++; break; default: snprintf(mini_buffer, MINIBUFSIZE, "%c", *ptr); prompt_line = m_strcat(prompt_line, mini_buffer); break; } } else { snprintf(mini_buffer, MINIBUFSIZE, "%c", *ptr); prompt_line = m_strcat(prompt_line, mini_buffer); } } free(username); } else { prompt_line = NULL; } return prompt_line; #undef MINIBUFSIZE } /* redisplays a hey's buffer after SIGCONT */ void hey_redisplay(void) { #ifndef HAVE_LIBREADLINE char * ptr; if(!hey_editing) return; if((ptr = dyn_pageRead(hey_page))) { do { /* We can't use printf, as it it not re-entrant */ write(STDOUT_FILENO, hey_rlprompt, strlen(heyrlprompt)); write(STDOUT_FILENO, ptr, strlen(ptr)); write(STDOUT_FILENO, "\n", sizeof("\n")); } while ((ptr = dyn_pageRead(NULL))); } write(STDOUT_FILENO, hey_rlprompt, strlen(heyrlprompt)); /* make sure it's all on screen */ fflush(stdout); #endif #ifdef HAVE_LIBREADLINE if(!hey_editing) return; hey_refresh(0, 0); #endif } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������c-hey2.1/hey_readline.h�����������������������������������������������������������������������������0000600�0076323�0001766�00000001635�07413721216�016004� 0����������������������������������������������������������������������������������������������������ustar �c-hey���������������������������projects������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#ifndef _hey_readline_h_ #define _hey_readline_h_ /* ** File: hey_readline.h ** Desc: Contains the general hooks for reading a line ** Auth: Colm MacCarthaigh (colmmacc@redbrick.dcu.ie) ** Date: 5/9/01 ** ** $Id: hey_readline.h,v 1.2 2001/12/30 23:26:06 c-hey Exp $ */ #include "config.h" /* the expanded prompt */ extern char * hey_rlprompt; #ifdef HAVE_LIBREADLINE /* line we are one */ extern int hey_line; /* total number of lines */ extern int hey_linetotal; /* has the last line been appended ? */ extern int hey_lastdone; #endif /* initialise readline stuff */ extern void hey_readline_init(void); /* we are done reading lines */ extern void hey_readline_fini(void); /* actually read a line from standard input */ extern char *hey_readline(void); /* generate the hey prompt */ extern char *hey_generate_prompt(void); /* redisplays a hey's buffer after SIGCONT */ extern void hey_redisplay(void); #endif ���������������������������������������������������������������������������������������������������c-hey2.1/hey_signal.c�������������������������������������������������������������������������������0000600�0076323�0001766�00000006666�07715567651�015522� 0����������������������������������������������������������������������������������������������������ustar �c-hey���������������������������projects������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* ** File: hey_signal.c ** Desc: Sets up signals for C version of hey ** Auth: Cian Synnott <pooka@redbrick.dcu.ie> ** Date: Mon Nov 16 01:27:24 GMT 1998 ** ** $Id: hey_signal.c,v 1.4 2003/08/11 01:21:45 c-hey Exp $ */ #include <termios.h> #include <stdlib.h> #include <unistd.h> #include <string.h> #include "hey_signal.h" #include "hey_readline.h" #include "hey_edit.h" #include "aux.h" #include "config.h" /* Print out some haikus on certain signals - why not? ;o) ** the TERM & INT ones are mine; the SEGV one comes from a haiku_errors.txt ** of some sort; I believe it's under http://www.gnu.org/fun/ somewhere? */ RETSIGTYPE hey_signal_handler(int sig) { switch (sig) { case SIGTERM: printerr_exit(" \"to all men comes death\n" " a termination signal -\n" " this process must die\"\n"); case SIGSEGV: printerr_exit("\n \"wind catches lily\n" " scatt'ring petals o'er water -\n" " segmentation fault\"\n\n" " If you could, I'd appreciate you copying down the input\n" " that produced this fault and mailing it to me at\n" " pooka@redbrick.dcu.ie\n" " Thanks, if you try a slight variation on that input is should work.\n\n"); case SIGINT: printerr_exit("\n \"continuation\n" " is for this process a dream -\n" " interruption caught\"\n\n"); case SIGCONT: hey_redisplay(); break; default: printerr_exit("Dodgy unwaited-for signal caught. Bailing out.\n"); } return; } /* Just setup all the signal handlers - ignore silly ones ... */ void hey_signal_setup(void) { sigset_t set; /* Start with a full set */ sigfillset(&set); /* Delete the ones we're interested in from it */ sigdelset(&set, SIGINT); sigdelset(&set, SIGSEGV); sigdelset(&set, SIGTERM); sigdelset(&set, SIGTSTP); sigdelset(&set, SIGCONT); /* Block all the signals remaining in the set */ sigprocmask(SIG_BLOCK, &set, NULL); /* Catch the others */ signal(SIGINT, hey_signal_handler); signal(SIGSEGV, hey_signal_handler); signal(SIGTERM, hey_signal_handler); signal(SIGCONT, hey_signal_handler); return; } /* ** Functions & global for fiddling about with terminal settings ** Put them here because I'm really doing it as a signals problem, ** namely that ^S from the keyboard (easy to type instead of EOF, ^D) ** would suspend the process & wait for ^Q, which many people are ** unaware of. */ struct termios saved_term; /* The atexit() cleanup to put the terminal back in it's normal state. */ void hey_terminal_cleanup(void) { tcsetattr(STDIN_FILENO, TCSANOW, &saved_term); return; } /* The terminal setup routine - removes the possibility of using CTRL-S as ** SIGSTOP */ void hey_terminal_setup(void) { struct termios change; tcgetattr(STDIN_FILENO, &saved_term); memcpy(&change, &saved_term, sizeof(struct termios)); /* Change the ^Q & ^S keys to do nothing special... */ change.c_cc[VSTART] = 0; change.c_cc[VSTOP] = 0; tcsetattr(STDIN_FILENO, TCSANOW, &change); /* Register the cleanup routine that puts the terminal back ** in it's initial state ... */ if (atexit(hey_terminal_cleanup)) printerr_exit("hey: failed to register terminal atexit()\n"); return; } ��������������������������������������������������������������������������c-hey2.1/hey_signal.h�������������������������������������������������������������������������������0000600�0076323�0001766�00000000607�07413721216�015474� 0����������������������������������������������������������������������������������������������������ustar �c-hey���������������������������projects������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#ifndef _hey_signal_h_ #define _hey_signal_h_ /* ** File: hey_signal.h ** Desc: Sets up signals for C version of hey ** Auth: Cian Synnott <pooka@redbrick.dcu.ie> ** Date: Mon Nov 16 01:25:27 GMT 1998 ** ** $Id: hey_signal.h,v 1.2 2001/12/30 23:26:06 c-hey Exp $ */ #include <signal.h> #include <stdio.h> extern void hey_signal_setup(void); extern void hey_terminal_setup(void); #endif �������������������������������������������������������������������������������������������������������������������������c-hey2.1/install-sh���������������������������������������������������������������������������������0000700�0076323�0001766�00000012736�07404274352�015215� 0����������������������������������������������������������������������������������������������������ustar �c-hey���������������������������projects������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/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 ����������������������������������c-hey2.1/utent.c������������������������������������������������������������������������������������0000600�0076323�0001766�00000001375�07715567651�014527� 0����������������������������������������������������������������������������������������������������ustar �c-hey���������������������������projects������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* ** File: utent.c ** Desc: A replacement for the *ut* functions not provided by some systems ** Auth: Cian Synnott <pooka@redbrick.dcu.ie> ** Date: Thu May 6 15:43:54 IST 1999 ** ** $Id: utent.c,v 1.3 2003/08/11 01:21:45 c-hey Exp $ */ #include "utent.h" static int utfile; void setutent(void) { if ((utfile = open(_PATH_UTMP, O_RDONLY)) < 0) { printf("Argh. Couldn't open %s, for some reason.\n", _PATH_UTMP); exit(1); } } struct utmp *getutent(void) { static struct utmp u; int ret; ret = read(utfile, (void *)&u, sizeof(struct utmp)); switch(ret) { case -1: printf("Argh. Error reading from %s, for some reason.\n", _PATH_UTMP); break; case 0: return NULL; break; } return &u; } void endutent(void) { close(utfile); } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������c-hey2.1/utent.h������������������������������������������������������������������������������������0000600�0076323�0001766�00000001335�07413721216�014510� 0����������������������������������������������������������������������������������������������������ustar �c-hey���������������������������projects������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#ifndef _utent_h_ #define _utent_h_ /* ** File: utent.h ** Desc: A replacement for the *ut* functions not provided in some ** benighted backwaters. ;o) Also sorts out the use of getuxent() ** Auth: Cian Synnott <pooka@redbrick.dcu.ie> ** Date: Thu May 6 15:43:54 IST 1999 ** ** $Id: utent.h,v 1.2 2001/12/30 23:26:06 c-hey Exp $ */ #include <sys/types.h> #include <unistd.h> #include <stdio.h> #include <fcntl.h> #include "config.h" /* Include the right flavour of utmp */ #ifndef HAVE_UTMPX_H #include <utmp.h> #else #include <utmpx.h> #endif /* If the system isn't providing getutent() and friends, we'll have to */ #ifndef HAVE_GETUTENT void setutent(); struct utmp *getutent(); void endutent(); #endif #endif �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������