├── .gitignore ├── AUTHORS ├── COPYING ├── ChangeLog ├── INSTALL ├── Makefile.am ├── Makefile.in ├── NEWS ├── README ├── README.md ├── aclocal.m4 ├── configure ├── configure.in ├── dokey.c ├── enter.c ├── enter.h ├── install-sh ├── missing ├── mkinstalldirs ├── quote.c ├── quote.h ├── sample.urlview ├── snprintf.c ├── text ├── url_handler.sh ├── url_handler.sh.suse ├── urlview.c ├── urlview.conf.suse ├── urlview.man └── urlview.sgml /.gitignore: -------------------------------------------------------------------------------- 1 | # Object files 2 | *.o 3 | 4 | # Libraries 5 | *.lib 6 | *.a 7 | 8 | # Shared objects (inc. Windows DLLs) 9 | *.dll 10 | *.so 11 | *.so.* 12 | *.dylib 13 | 14 | # Executables 15 | *.exe 16 | *.out 17 | *.app 18 | 19 | autom4te.cache 20 | confdefs.h 21 | config.cache 22 | config.log 23 | Makefile 24 | config.status 25 | depcomp 26 | urlview 27 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | Michael Elkins 2 | http://www.sigpipe.org/ 3 | -------------------------------------------------------------------------------- /COPYING: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc. 5 | 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your 12 | freedom to share and change it. By contrast, the GNU General Public 13 | License is intended to guarantee your freedom to share and change free 14 | software--to make sure the software is free for all its users. This 15 | General Public License applies to most of the Free Software 16 | Foundation's software and to any other program whose authors commit to 17 | using it. (Some other Free Software Foundation software is covered by 18 | the GNU Library General Public License instead.) You can apply it to 19 | your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Our General Public Licenses are designed to make sure that you 23 | have the freedom to distribute copies of free software (and charge for 24 | this service if you wish), that you receive source code or can get it 25 | if you want it, that you can change the software or use pieces of it 26 | in new free programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must show them these terms so they know their 37 | rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and 40 | (2) offer you this license which gives you legal permission to copy, 41 | distribute and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain 44 | that everyone understands that there is no warranty for this free 45 | software. If the software is modified by someone else and passed on, we 46 | want its recipients to know that what they have is not the original, so 47 | that any problems introduced by others will not reflect on the original 48 | authors' reputations. 49 | 50 | Finally, any free program is threatened constantly by software 51 | patents. We wish to avoid the danger that redistributors of a free 52 | program will individually obtain patent licenses, in effect making the 53 | program proprietary. To prevent this, we have made it clear that any 54 | patent must be licensed for everyone's free use or not licensed at all. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains 63 | a notice placed by the copyright holder saying it may be distributed 64 | under the terms of this General Public License. The "Program", below, 65 | refers to any such program or work, and a "work based on the Program" 66 | means either the Program or any derivative work under copyright law: 67 | that is to say, a work containing the Program or a portion of it, 68 | either verbatim or with modifications and/or translated into another 69 | language. (Hereinafter, translation is included without limitation in 70 | the term "modification".) Each licensee is addressed as "you". 71 | 72 | Activities other than copying, distribution and modification are not 73 | covered by this License; they are outside its scope. The act of 74 | running the Program is not restricted, and the output from the Program 75 | is covered only if its contents constitute a work based on the 76 | Program (independent of having been made by running the Program). 77 | Whether that is true depends on what the Program does. 78 | 79 | 1. You may copy and distribute verbatim copies of the Program's 80 | source code as you receive it, in any medium, provided that you 81 | conspicuously and appropriately publish on each copy an appropriate 82 | copyright notice and disclaimer of warranty; keep intact all the 83 | notices that refer to this License and to the absence of any warranty; 84 | and give any other recipients of the Program a copy of this License 85 | along with the Program. 86 | 87 | You may charge a fee for the physical act of transferring a copy, and 88 | you may at your option offer warranty protection in exchange for a fee. 89 | 90 | 2. You may modify your copy or copies of the Program or any portion 91 | of it, thus forming a work based on the Program, and copy and 92 | distribute such modifications or work under the terms of Section 1 93 | above, provided that you also meet all of these conditions: 94 | 95 | a) You must cause the modified files to carry prominent notices 96 | stating that you changed the files and the date of any change. 97 | 98 | b) You must cause any work that you distribute or publish, that in 99 | whole or in part contains or is derived from the Program or any 100 | part thereof, to be licensed as a whole at no charge to all third 101 | parties under the terms of this License. 102 | 103 | c) If the modified program normally reads commands interactively 104 | when run, you must cause it, when started running for such 105 | interactive use in the most ordinary way, to print or display an 106 | announcement including an appropriate copyright notice and a 107 | notice that there is no warranty (or else, saying that you provide 108 | a warranty) and that users may redistribute the program under 109 | these conditions, and telling the user how to view a copy of this 110 | License. (Exception: if the Program itself is interactive but 111 | does not normally print such an announcement, your work based on 112 | the Program is not required to print an announcement.) 113 | 114 | These requirements apply to the modified work as a whole. If 115 | identifiable sections of that work are not derived from the Program, 116 | and can be reasonably considered independent and separate works in 117 | themselves, then this License, and its terms, do not apply to those 118 | sections when you distribute them as separate works. But when you 119 | distribute the same sections as part of a whole which is a work based 120 | on the Program, the distribution of the whole must be on the terms of 121 | this License, whose permissions for other licensees extend to the 122 | entire whole, and thus to each and every part regardless of who wrote it. 123 | 124 | Thus, it is not the intent of this section to claim rights or contest 125 | your rights to work written entirely by you; rather, the intent is to 126 | exercise the right to control the distribution of derivative or 127 | collective works based on the Program. 128 | 129 | In addition, mere aggregation of another work not based on the Program 130 | with the Program (or with a work based on the Program) on a volume of 131 | a storage or distribution medium does not bring the other work under 132 | the scope of this License. 133 | 134 | 3. You may copy and distribute the Program (or a work based on it, 135 | under Section 2) in object code or executable form under the terms of 136 | Sections 1 and 2 above provided that you also do one of the following: 137 | 138 | a) Accompany it with the complete corresponding machine-readable 139 | source code, which must be distributed under the terms of Sections 140 | 1 and 2 above on a medium customarily used for software interchange; or, 141 | 142 | b) Accompany it with a written offer, valid for at least three 143 | years, to give any third party, for a charge no more than your 144 | cost of physically performing source distribution, a complete 145 | machine-readable copy of the corresponding source code, to be 146 | distributed under the terms of Sections 1 and 2 above on a medium 147 | customarily used for software interchange; or, 148 | 149 | c) Accompany it with the information you received as to the offer 150 | to distribute corresponding source code. (This alternative is 151 | allowed only for noncommercial distribution and only if you 152 | received the program in object code or executable form with such 153 | an offer, in accord with Subsection b above.) 154 | 155 | The source code for a work means the preferred form of the work for 156 | making modifications to it. For an executable work, complete source 157 | code means all the source code for all modules it contains, plus any 158 | associated interface definition files, plus the scripts used to 159 | control compilation and installation of the executable. However, as a 160 | special exception, the source code distributed need not include 161 | anything that is normally distributed (in either source or binary 162 | form) with the major components (compiler, kernel, and so on) of the 163 | operating system on which the executable runs, unless that component 164 | itself accompanies the executable. 165 | 166 | If distribution of executable or object code is made by offering 167 | access to copy from a designated place, then offering equivalent 168 | access to copy the source code from the same place counts as 169 | distribution of the source code, even though third parties are not 170 | compelled to copy the source along with the object code. 171 | 172 | 4. You may not copy, modify, sublicense, or distribute the Program 173 | except as expressly provided under this License. Any attempt 174 | otherwise to copy, modify, sublicense or distribute the Program is 175 | void, and will automatically terminate your rights under this License. 176 | However, parties who have received copies, or rights, from you under 177 | this License will not have their licenses terminated so long as such 178 | parties remain in full compliance. 179 | 180 | 5. You are not required to accept this License, since you have not 181 | signed it. However, nothing else grants you permission to modify or 182 | distribute the Program or its derivative works. These actions are 183 | prohibited by law if you do not accept this License. Therefore, by 184 | modifying or distributing the Program (or any work based on the 185 | Program), you indicate your acceptance of this License to do so, and 186 | all its terms and conditions for copying, distributing or modifying 187 | the Program or works based on it. 188 | 189 | 6. Each time you redistribute the Program (or any work based on the 190 | Program), the recipient automatically receives a license from the 191 | original licensor to copy, distribute or modify the Program subject to 192 | these terms and conditions. You may not impose any further 193 | restrictions on the recipients' exercise of the rights granted herein. 194 | You are not responsible for enforcing compliance by third parties to 195 | this License. 196 | 197 | 7. If, as a consequence of a court judgment or allegation of patent 198 | infringement or for any other reason (not limited to patent issues), 199 | conditions are imposed on you (whether by court order, agreement or 200 | otherwise) that contradict the conditions of this License, they do not 201 | excuse you from the conditions of this License. If you cannot 202 | distribute so as to satisfy simultaneously your obligations under this 203 | License and any other pertinent obligations, then as a consequence you 204 | may not distribute the Program at all. For example, if a patent 205 | license would not permit royalty-free redistribution of the Program by 206 | all those who receive copies directly or indirectly through you, then 207 | the only way you could satisfy both it and this License would be to 208 | refrain entirely from distribution of the Program. 209 | 210 | If any portion of this section is held invalid or unenforceable under 211 | any particular circumstance, the balance of the section is intended to 212 | apply and the section as a whole is intended to apply in other 213 | circumstances. 214 | 215 | It is not the purpose of this section to induce you to infringe any 216 | patents or other property right claims or to contest validity of any 217 | such claims; this section has the sole purpose of protecting the 218 | integrity of the free software distribution system, which is 219 | implemented by public license practices. Many people have made 220 | generous contributions to the wide range of software distributed 221 | through that system in reliance on consistent application of that 222 | system; it is up to the author/donor to decide if he or she is willing 223 | to distribute software through any other system and a licensee cannot 224 | impose that choice. 225 | 226 | This section is intended to make thoroughly clear what is believed to 227 | be a consequence of the rest of this License. 228 | 229 | 8. If the distribution and/or use of the Program is restricted in 230 | certain countries either by patents or by copyrighted interfaces, the 231 | original copyright holder who places the Program under this License 232 | may add an explicit geographical distribution limitation excluding 233 | those countries, so that distribution is permitted only in or among 234 | countries not thus excluded. In such case, this License incorporates 235 | the limitation as if written in the body of this License. 236 | 237 | 9. The Free Software Foundation may publish revised and/or new versions 238 | of the General Public License from time to time. Such new versions will 239 | be similar in spirit to the present version, but may differ in detail to 240 | address new problems or concerns. 241 | 242 | Each version is given a distinguishing version number. If the Program 243 | specifies a version number of this License which applies to it and "any 244 | later version", you have the option of following the terms and conditions 245 | either of that version or of any later version published by the Free 246 | Software Foundation. If the Program does not specify a version number of 247 | this License, you may choose any version ever published by the Free Software 248 | Foundation. 249 | 250 | 10. If you wish to incorporate parts of the Program into other free 251 | programs whose distribution conditions are different, write to the author 252 | to ask for permission. For software which is copyrighted by the Free 253 | Software Foundation, write to the Free Software Foundation; we sometimes 254 | make exceptions for this. Our decision will be guided by the two goals 255 | of preserving the free status of all derivatives of our free software and 256 | of promoting the sharing and reuse of software generally. 257 | 258 | NO WARRANTY 259 | 260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 268 | REPAIR OR CORRECTION. 269 | 270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 278 | POSSIBILITY OF SUCH DAMAGES. 279 | 280 | END OF TERMS AND CONDITIONS 281 | 282 | How to Apply These Terms to Your New Programs 283 | 284 | If you develop a new program, and you want it to be of the greatest 285 | possible use to the public, the best way to achieve this is to make it 286 | free software which everyone can redistribute and change under these terms. 287 | 288 | To do so, attach the following notices to the program. It is safest 289 | to attach them to the start of each source file to most effectively 290 | convey the exclusion of warranty; and each file should have at least 291 | the "copyright" line and a pointer to where the full notice is found. 292 | 293 | 294 | Copyright (C) 19yy 295 | 296 | This program is free software; you can redistribute it and/or modify 297 | it under the terms of the GNU General Public License as published by 298 | the Free Software Foundation; either version 2 of the License, or 299 | (at your option) any later version. 300 | 301 | This program is distributed in the hope that it will be useful, 302 | but WITHOUT ANY WARRANTY; without even the implied warranty of 303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 304 | GNU General Public License for more details. 305 | 306 | You should have received a copy of the GNU General Public License 307 | along with this program; if not, write to the Free Software 308 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 309 | 310 | 311 | Also add information on how to contact you by electronic and paper mail. 312 | 313 | If the program is interactive, make it output a short notice like this 314 | when it starts in an interactive mode: 315 | 316 | Gnomovision version 69, Copyright (C) 19yy name of author 317 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 318 | This is free software, and you are welcome to redistribute it 319 | under certain conditions; type `show c' for details. 320 | 321 | The hypothetical commands `show w' and `show c' should show the appropriate 322 | parts of the General Public License. Of course, the commands you use may 323 | be called something other than `show w' and `show c'; they could even be 324 | mouse-clicks or menu items--whatever suits your program. 325 | 326 | You should also get your employer (if you work as a programmer) or your 327 | school, if any, to sign a "copyright disclaimer" for the program, if 328 | necessary. Here is a sample; alter the names: 329 | 330 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 331 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 332 | 333 | , 1 April 1989 334 | Ty Coon, President of Vice 335 | 336 | This General Public License does not permit incorporating your program into 337 | proprietary programs. If your program is a subroutine library, you may 338 | consider it more useful to permit linking proprietary applications with the 339 | library. If this is what you want to do, use the GNU Library General 340 | Public License instead of this License. 341 | -------------------------------------------------------------------------------- /ChangeLog: -------------------------------------------------------------------------------- 1 | 0.2 => 0.3 2 | ========== 3 | 4 | - urls can now be edited before being launced 5 | 6 | - check for snprintf and use supplied if not present 7 | 8 | - slang support with `configure --with-slang' 9 | 10 | - check for regex.h did not define HAVE_REGEX_H 11 | 12 | - backslash (\) quoting did not work for things like \. 13 | 14 | 0.3 => 0.4 15 | ========== 16 | 17 | - add -Dunix to the CFLAGS so that building with slang under hp-ux will work 18 | 19 | - need to include in main.c 20 | 21 | - now accepts input from stdin even if stdin is a tty 22 | 23 | - `h' is now an alias for `q' (lynx compatibility) 24 | 25 | - automake is now used for this package 26 | 27 | 0.4 => 0.5 28 | ========== 29 | 30 | - ^L refreshes the screen 31 | 32 | From: Aaron Schrab 33 | - 0-9 can be used to jump to a specific url 34 | - fixed redraw bug when changing pages 35 | - pagelength was incorrectly calculated 36 | - dynamically increase array if more than 128 urls are found 37 | 38 | 0.5 => 0.6 39 | ========== 40 | 41 | - backspace char was not honored in line editor 42 | - delete now erases the char under the cursor in the line editor 43 | - man page was not installed by `install' target 44 | 45 | 0.6 => 0.7 46 | ========== 47 | 48 | - KEY_DC is not defined for S-Lang 49 | - include instead of 50 | 51 | 0.7 => 0.8 52 | ========== 53 | 54 | - Search forward and backward using / and ? (from Brian Salter-Duke 55 | ) 56 | - Eliminate duplicates (most likely from robotti@metconnect.com 57 | (Kent Robotti)) 58 | - Some changes for Debian (including a new url_handler.sh) from Luis 59 | Francisco Gonzalez and Martin Schulze 60 | . 61 | 62 | 0.8 => 0.9 63 | ========== 64 | 65 | - Include SuSE's changes. From Werner Fink and 66 | Stepan Kasal . 67 | - Do paranoid shell quoting on parameters passed to the script, so 68 | users don't shoot themselves by matching "'" in their regular 69 | expressions. From Thomas Roessler . 70 | - Fix quoting in the url_handler.sh script. 71 | 72 | -------------------------------------------------------------------------------- /INSTALL: -------------------------------------------------------------------------------- 1 | Installation Notes for `urlview' 2 | =============================== 3 | 4 | To configure: 5 | 6 | ./configure 7 | 8 | To use the S-LANG library: 9 | 10 | ./configure --with-slang 11 | 12 | Build: 13 | 14 | make 15 | 16 | Install: 17 | 18 | make install 19 | 20 | -------------------------------------------------------------------------------- /Makefile.am: -------------------------------------------------------------------------------- 1 | ## Process this file with automake to produce Makefile.in 2 | 3 | bin_PROGRAMS = urlview 4 | 5 | urlview_SOURCES = urlview.c enter.c dokey.c enter.h quote.c quote.h 6 | urlview_LDADD = @LIBOBJS@ 7 | 8 | EXTRA_DIST = text urlview.man urlview.sgml sample.urlview \ 9 | url_handler.sh url_handler.sh.suse urlview.conf.suse 10 | 11 | CLEANFILES = *~ *.orig *.rej 12 | 13 | install-data-local: 14 | $(INSTALL_DATA) urlview.man $(mandir)/man1/urlview.1 15 | 16 | # how to create a target for uninstall-data-local??? 17 | -------------------------------------------------------------------------------- /Makefile.in: -------------------------------------------------------------------------------- 1 | # Makefile.in generated by automake 1.11.6 from Makefile.am. 2 | # @configure_input@ 3 | 4 | # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 5 | # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software 6 | # Foundation, Inc. 7 | # This Makefile.in is free software; the Free Software Foundation 8 | # gives unlimited permission to copy and/or distribute it, 9 | # with or without modifications, as long as this notice is preserved. 10 | 11 | # This program is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY, to the extent permitted by law; without 13 | # even the implied warranty of MERCHANTABILITY or FITNESS FOR A 14 | # PARTICULAR PURPOSE. 15 | 16 | @SET_MAKE@ 17 | 18 | VPATH = @srcdir@ 19 | am__make_dryrun = \ 20 | { \ 21 | am__dry=no; \ 22 | case $$MAKEFLAGS in \ 23 | *\\[\ \ ]*) \ 24 | echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ 25 | | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ 26 | *) \ 27 | for am__flg in $$MAKEFLAGS; do \ 28 | case $$am__flg in \ 29 | *=*|--*) ;; \ 30 | *n*) am__dry=yes; break;; \ 31 | esac; \ 32 | done;; \ 33 | esac; \ 34 | test $$am__dry = yes; \ 35 | } 36 | pkgdatadir = $(datadir)/@PACKAGE@ 37 | pkgincludedir = $(includedir)/@PACKAGE@ 38 | pkglibdir = $(libdir)/@PACKAGE@ 39 | pkglibexecdir = $(libexecdir)/@PACKAGE@ 40 | am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 41 | install_sh_DATA = $(install_sh) -c -m 644 42 | install_sh_PROGRAM = $(install_sh) -c 43 | install_sh_SCRIPT = $(install_sh) -c 44 | INSTALL_HEADER = $(INSTALL_DATA) 45 | transform = $(program_transform_name) 46 | NORMAL_INSTALL = : 47 | PRE_INSTALL = : 48 | POST_INSTALL = : 49 | NORMAL_UNINSTALL = : 50 | PRE_UNINSTALL = : 51 | POST_UNINSTALL = : 52 | bin_PROGRAMS = urlview$(EXEEXT) 53 | subdir = . 54 | DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ 55 | $(srcdir)/Makefile.in $(top_srcdir)/configure AUTHORS COPYING \ 56 | ChangeLog INSTALL NEWS depcomp install-sh missing \ 57 | mkinstalldirs snprintf.c 58 | ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 59 | am__aclocal_m4_deps = $(top_srcdir)/configure.in 60 | am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ 61 | $(ACLOCAL_M4) 62 | am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ 63 | configure.lineno config.status.lineno 64 | mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs 65 | CONFIG_CLEAN_FILES = 66 | CONFIG_CLEAN_VPATH_FILES = 67 | am__installdirs = "$(DESTDIR)$(bindir)" 68 | PROGRAMS = $(bin_PROGRAMS) 69 | am_urlview_OBJECTS = urlview.$(OBJEXT) enter.$(OBJEXT) dokey.$(OBJEXT) \ 70 | quote.$(OBJEXT) 71 | urlview_OBJECTS = $(am_urlview_OBJECTS) 72 | urlview_DEPENDENCIES = @LIBOBJS@ 73 | DEFAULT_INCLUDES = -I.@am__isrc@ 74 | depcomp = $(SHELL) $(top_srcdir)/depcomp 75 | am__depfiles_maybe = depfiles 76 | am__mv = mv -f 77 | COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ 78 | $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) 79 | CCLD = $(CC) 80 | LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ 81 | SOURCES = $(urlview_SOURCES) 82 | DIST_SOURCES = $(urlview_SOURCES) 83 | am__can_run_installinfo = \ 84 | case $$AM_UPDATE_INFO_DIR in \ 85 | n|no|NO) false;; \ 86 | *) (install-info --version) >/dev/null 2>&1;; \ 87 | esac 88 | ETAGS = etags 89 | CTAGS = ctags 90 | DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 91 | distdir = $(PACKAGE)-$(VERSION) 92 | top_distdir = $(distdir) 93 | am__remove_distdir = \ 94 | if test -d "$(distdir)"; then \ 95 | find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ 96 | && rm -rf "$(distdir)" \ 97 | || { sleep 5 && rm -rf "$(distdir)"; }; \ 98 | else :; fi 99 | DIST_ARCHIVES = $(distdir).tar.gz 100 | GZIP_ENV = --best 101 | distuninstallcheck_listfiles = find . -type f -print 102 | am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ 103 | | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' 104 | distcleancheck_listfiles = find . -type f -print 105 | ACLOCAL = @ACLOCAL@ 106 | AMTAR = @AMTAR@ 107 | AUTOCONF = @AUTOCONF@ 108 | AUTOHEADER = @AUTOHEADER@ 109 | AUTOMAKE = @AUTOMAKE@ 110 | AWK = @AWK@ 111 | CC = @CC@ 112 | CCDEPMODE = @CCDEPMODE@ 113 | CFLAGS = @CFLAGS@ 114 | CPP = @CPP@ 115 | CPPFLAGS = @CPPFLAGS@ 116 | CYGPATH_W = @CYGPATH_W@ 117 | DEFS = @DEFS@ 118 | DEPDIR = @DEPDIR@ 119 | ECHO_C = @ECHO_C@ 120 | ECHO_N = @ECHO_N@ 121 | ECHO_T = @ECHO_T@ 122 | EGREP = @EGREP@ 123 | EXEEXT = @EXEEXT@ 124 | GREP = @GREP@ 125 | INSTALL = @INSTALL@ 126 | INSTALL_DATA = @INSTALL_DATA@ 127 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ 128 | INSTALL_SCRIPT = @INSTALL_SCRIPT@ 129 | INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ 130 | LDFLAGS = @LDFLAGS@ 131 | LIBOBJS = @LIBOBJS@ 132 | LIBS = @LIBS@ 133 | LTLIBOBJS = @LTLIBOBJS@ 134 | MAKEINFO = @MAKEINFO@ 135 | MKDIR_P = @MKDIR_P@ 136 | OBJEXT = @OBJEXT@ 137 | PACKAGE = @PACKAGE@ 138 | PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ 139 | PACKAGE_NAME = @PACKAGE_NAME@ 140 | PACKAGE_STRING = @PACKAGE_STRING@ 141 | PACKAGE_TARNAME = @PACKAGE_TARNAME@ 142 | PACKAGE_URL = @PACKAGE_URL@ 143 | PACKAGE_VERSION = @PACKAGE_VERSION@ 144 | PATH_SEPARATOR = @PATH_SEPARATOR@ 145 | SET_MAKE = @SET_MAKE@ 146 | SHELL = @SHELL@ 147 | STRIP = @STRIP@ 148 | VERSION = @VERSION@ 149 | abs_builddir = @abs_builddir@ 150 | abs_srcdir = @abs_srcdir@ 151 | abs_top_builddir = @abs_top_builddir@ 152 | abs_top_srcdir = @abs_top_srcdir@ 153 | ac_ct_CC = @ac_ct_CC@ 154 | am__include = @am__include@ 155 | am__leading_dot = @am__leading_dot@ 156 | am__quote = @am__quote@ 157 | am__tar = @am__tar@ 158 | am__untar = @am__untar@ 159 | bindir = @bindir@ 160 | build_alias = @build_alias@ 161 | builddir = @builddir@ 162 | datadir = @datadir@ 163 | datarootdir = @datarootdir@ 164 | docdir = @docdir@ 165 | dvidir = @dvidir@ 166 | exec_prefix = @exec_prefix@ 167 | host_alias = @host_alias@ 168 | htmldir = @htmldir@ 169 | includedir = @includedir@ 170 | infodir = @infodir@ 171 | install_sh = @install_sh@ 172 | libdir = @libdir@ 173 | libexecdir = @libexecdir@ 174 | localedir = @localedir@ 175 | localstatedir = @localstatedir@ 176 | mandir = @mandir@ 177 | mkdir_p = @mkdir_p@ 178 | oldincludedir = @oldincludedir@ 179 | pdfdir = @pdfdir@ 180 | prefix = @prefix@ 181 | program_transform_name = @program_transform_name@ 182 | psdir = @psdir@ 183 | sbindir = @sbindir@ 184 | sharedstatedir = @sharedstatedir@ 185 | srcdir = @srcdir@ 186 | sysconfdir = @sysconfdir@ 187 | target_alias = @target_alias@ 188 | top_build_prefix = @top_build_prefix@ 189 | top_builddir = @top_builddir@ 190 | top_srcdir = @top_srcdir@ 191 | urlview_SOURCES = urlview.c enter.c dokey.c enter.h quote.c quote.h 192 | urlview_LDADD = @LIBOBJS@ 193 | EXTRA_DIST = text urlview.man urlview.sgml sample.urlview \ 194 | url_handler.sh url_handler.sh.suse urlview.conf.suse 195 | 196 | CLEANFILES = *~ *.orig *.rej 197 | all: all-am 198 | 199 | .SUFFIXES: 200 | .SUFFIXES: .c .o .obj 201 | am--refresh: Makefile 202 | @: 203 | $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) 204 | @for dep in $?; do \ 205 | case '$(am__configure_deps)' in \ 206 | *$$dep*) \ 207 | echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \ 208 | $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ 209 | && exit 0; \ 210 | exit 1;; \ 211 | esac; \ 212 | done; \ 213 | echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ 214 | $(am__cd) $(top_srcdir) && \ 215 | $(AUTOMAKE) --gnu Makefile 216 | .PRECIOUS: Makefile 217 | Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status 218 | @case '$?' in \ 219 | *config.status*) \ 220 | echo ' $(SHELL) ./config.status'; \ 221 | $(SHELL) ./config.status;; \ 222 | *) \ 223 | echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ 224 | cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ 225 | esac; 226 | 227 | $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) 228 | $(SHELL) ./config.status --recheck 229 | 230 | $(top_srcdir)/configure: $(am__configure_deps) 231 | $(am__cd) $(srcdir) && $(AUTOCONF) 232 | $(ACLOCAL_M4): $(am__aclocal_m4_deps) 233 | $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) 234 | $(am__aclocal_m4_deps): 235 | install-binPROGRAMS: $(bin_PROGRAMS) 236 | @$(NORMAL_INSTALL) 237 | @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ 238 | if test -n "$$list"; then \ 239 | echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ 240 | $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ 241 | fi; \ 242 | for p in $$list; do echo "$$p $$p"; done | \ 243 | sed 's/$(EXEEXT)$$//' | \ 244 | while read p p1; do if test -f $$p; \ 245 | then echo "$$p"; echo "$$p"; else :; fi; \ 246 | done | \ 247 | sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ 248 | -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ 249 | sed 'N;N;N;s,\n, ,g' | \ 250 | $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ 251 | { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ 252 | if ($$2 == $$4) files[d] = files[d] " " $$1; \ 253 | else { print "f", $$3 "/" $$4, $$1; } } \ 254 | END { for (d in files) print "f", d, files[d] }' | \ 255 | while read type dir files; do \ 256 | if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ 257 | test -z "$$files" || { \ 258 | echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ 259 | $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ 260 | } \ 261 | ; done 262 | 263 | uninstall-binPROGRAMS: 264 | @$(NORMAL_UNINSTALL) 265 | @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ 266 | files=`for p in $$list; do echo "$$p"; done | \ 267 | sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ 268 | -e 's/$$/$(EXEEXT)/' `; \ 269 | test -n "$$list" || exit 0; \ 270 | echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ 271 | cd "$(DESTDIR)$(bindir)" && rm -f $$files 272 | 273 | clean-binPROGRAMS: 274 | -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) 275 | urlview$(EXEEXT): $(urlview_OBJECTS) $(urlview_DEPENDENCIES) $(EXTRA_urlview_DEPENDENCIES) 276 | @rm -f urlview$(EXEEXT) 277 | $(LINK) $(urlview_OBJECTS) $(urlview_LDADD) $(LIBS) 278 | 279 | mostlyclean-compile: 280 | -rm -f *.$(OBJEXT) 281 | 282 | distclean-compile: 283 | -rm -f *.tab.c 284 | 285 | @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/snprintf.Po@am__quote@ 286 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dokey.Po@am__quote@ 287 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/enter.Po@am__quote@ 288 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quote.Po@am__quote@ 289 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/urlview.Po@am__quote@ 290 | 291 | .c.o: 292 | @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< 293 | @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po 294 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ 295 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 296 | @am__fastdepCC_FALSE@ $(COMPILE) -c $< 297 | 298 | .c.obj: 299 | @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` 300 | @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po 301 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ 302 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 303 | @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` 304 | 305 | ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) 306 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ 307 | unique=`for i in $$list; do \ 308 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ 309 | done | \ 310 | $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ 311 | END { if (nonempty) { for (i in files) print i; }; }'`; \ 312 | mkid -fID $$unique 313 | tags: TAGS 314 | 315 | TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ 316 | $(TAGS_FILES) $(LISP) 317 | set x; \ 318 | here=`pwd`; \ 319 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ 320 | unique=`for i in $$list; do \ 321 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ 322 | done | \ 323 | $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ 324 | END { if (nonempty) { for (i in files) print i; }; }'`; \ 325 | shift; \ 326 | if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ 327 | test -n "$$unique" || unique=$$empty_fix; \ 328 | if test $$# -gt 0; then \ 329 | $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ 330 | "$$@" $$unique; \ 331 | else \ 332 | $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ 333 | $$unique; \ 334 | fi; \ 335 | fi 336 | ctags: CTAGS 337 | CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ 338 | $(TAGS_FILES) $(LISP) 339 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ 340 | unique=`for i in $$list; do \ 341 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ 342 | done | \ 343 | $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ 344 | END { if (nonempty) { for (i in files) print i; }; }'`; \ 345 | test -z "$(CTAGS_ARGS)$$unique" \ 346 | || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ 347 | $$unique 348 | 349 | GTAGS: 350 | here=`$(am__cd) $(top_builddir) && pwd` \ 351 | && $(am__cd) $(top_srcdir) \ 352 | && gtags -i $(GTAGS_ARGS) "$$here" 353 | 354 | distclean-tags: 355 | -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags 356 | 357 | distdir: $(DISTFILES) 358 | $(am__remove_distdir) 359 | test -d "$(distdir)" || mkdir "$(distdir)" 360 | @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ 361 | topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ 362 | list='$(DISTFILES)'; \ 363 | dist_files=`for file in $$list; do echo $$file; done | \ 364 | sed -e "s|^$$srcdirstrip/||;t" \ 365 | -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ 366 | case $$dist_files in \ 367 | */*) $(MKDIR_P) `echo "$$dist_files" | \ 368 | sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ 369 | sort -u` ;; \ 370 | esac; \ 371 | for file in $$dist_files; do \ 372 | if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ 373 | if test -d $$d/$$file; then \ 374 | dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ 375 | if test -d "$(distdir)/$$file"; then \ 376 | find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ 377 | fi; \ 378 | if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ 379 | cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ 380 | find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ 381 | fi; \ 382 | cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ 383 | else \ 384 | test -f "$(distdir)/$$file" \ 385 | || cp -p $$d/$$file "$(distdir)/$$file" \ 386 | || exit 1; \ 387 | fi; \ 388 | done 389 | -test -n "$(am__skip_mode_fix)" \ 390 | || find "$(distdir)" -type d ! -perm -755 \ 391 | -exec chmod u+rwx,go+rx {} \; -o \ 392 | ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ 393 | ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ 394 | ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ 395 | || chmod -R a+r "$(distdir)" 396 | dist-gzip: distdir 397 | tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz 398 | $(am__remove_distdir) 399 | 400 | dist-bzip2: distdir 401 | tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 402 | $(am__remove_distdir) 403 | 404 | dist-lzip: distdir 405 | tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz 406 | $(am__remove_distdir) 407 | 408 | dist-lzma: distdir 409 | tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma 410 | $(am__remove_distdir) 411 | 412 | dist-xz: distdir 413 | tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz 414 | $(am__remove_distdir) 415 | 416 | dist-tarZ: distdir 417 | tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z 418 | $(am__remove_distdir) 419 | 420 | dist-shar: distdir 421 | shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz 422 | $(am__remove_distdir) 423 | 424 | dist-zip: distdir 425 | -rm -f $(distdir).zip 426 | zip -rq $(distdir).zip $(distdir) 427 | $(am__remove_distdir) 428 | 429 | dist dist-all: distdir 430 | tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz 431 | $(am__remove_distdir) 432 | 433 | # This target untars the dist file and tries a VPATH configuration. Then 434 | # it guarantees that the distribution is self-contained by making another 435 | # tarfile. 436 | distcheck: dist 437 | case '$(DIST_ARCHIVES)' in \ 438 | *.tar.gz*) \ 439 | GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ 440 | *.tar.bz2*) \ 441 | bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ 442 | *.tar.lzma*) \ 443 | lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ 444 | *.tar.lz*) \ 445 | lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ 446 | *.tar.xz*) \ 447 | xz -dc $(distdir).tar.xz | $(am__untar) ;;\ 448 | *.tar.Z*) \ 449 | uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ 450 | *.shar.gz*) \ 451 | GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ 452 | *.zip*) \ 453 | unzip $(distdir).zip ;;\ 454 | esac 455 | chmod -R a-w $(distdir); chmod u+w $(distdir) 456 | mkdir $(distdir)/_build 457 | mkdir $(distdir)/_inst 458 | chmod a-w $(distdir) 459 | test -d $(distdir)/_build || exit 0; \ 460 | dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ 461 | && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ 462 | && am__cwd=`pwd` \ 463 | && $(am__cd) $(distdir)/_build \ 464 | && ../configure --srcdir=.. --prefix="$$dc_install_base" \ 465 | $(AM_DISTCHECK_CONFIGURE_FLAGS) \ 466 | $(DISTCHECK_CONFIGURE_FLAGS) \ 467 | && $(MAKE) $(AM_MAKEFLAGS) \ 468 | && $(MAKE) $(AM_MAKEFLAGS) dvi \ 469 | && $(MAKE) $(AM_MAKEFLAGS) check \ 470 | && $(MAKE) $(AM_MAKEFLAGS) install \ 471 | && $(MAKE) $(AM_MAKEFLAGS) installcheck \ 472 | && $(MAKE) $(AM_MAKEFLAGS) uninstall \ 473 | && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ 474 | distuninstallcheck \ 475 | && chmod -R a-w "$$dc_install_base" \ 476 | && ({ \ 477 | (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ 478 | && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ 479 | && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ 480 | && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ 481 | distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ 482 | } || { rm -rf "$$dc_destdir"; exit 1; }) \ 483 | && rm -rf "$$dc_destdir" \ 484 | && $(MAKE) $(AM_MAKEFLAGS) dist \ 485 | && rm -rf $(DIST_ARCHIVES) \ 486 | && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ 487 | && cd "$$am__cwd" \ 488 | || exit 1 489 | $(am__remove_distdir) 490 | @(echo "$(distdir) archives ready for distribution: "; \ 491 | list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ 492 | sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' 493 | distuninstallcheck: 494 | @test -n '$(distuninstallcheck_dir)' || { \ 495 | echo 'ERROR: trying to run $@ with an empty' \ 496 | '$$(distuninstallcheck_dir)' >&2; \ 497 | exit 1; \ 498 | }; \ 499 | $(am__cd) '$(distuninstallcheck_dir)' || { \ 500 | echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ 501 | exit 1; \ 502 | }; \ 503 | test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ 504 | || { echo "ERROR: files left after uninstall:" ; \ 505 | if test -n "$(DESTDIR)"; then \ 506 | echo " (check DESTDIR support)"; \ 507 | fi ; \ 508 | $(distuninstallcheck_listfiles) ; \ 509 | exit 1; } >&2 510 | distcleancheck: distclean 511 | @if test '$(srcdir)' = . ; then \ 512 | echo "ERROR: distcleancheck can only run from a VPATH build" ; \ 513 | exit 1 ; \ 514 | fi 515 | @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ 516 | || { echo "ERROR: files left in build directory after distclean:" ; \ 517 | $(distcleancheck_listfiles) ; \ 518 | exit 1; } >&2 519 | check-am: all-am 520 | check: check-am 521 | all-am: Makefile $(PROGRAMS) 522 | installdirs: 523 | for dir in "$(DESTDIR)$(bindir)"; do \ 524 | test -z "$$dir" || $(MKDIR_P) "$$dir"; \ 525 | done 526 | install: install-am 527 | install-exec: install-exec-am 528 | install-data: install-data-am 529 | uninstall: uninstall-am 530 | 531 | install-am: all-am 532 | @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am 533 | 534 | installcheck: installcheck-am 535 | install-strip: 536 | if test -z '$(STRIP)'; then \ 537 | $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ 538 | install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ 539 | install; \ 540 | else \ 541 | $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ 542 | install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ 543 | "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ 544 | fi 545 | mostlyclean-generic: 546 | 547 | clean-generic: 548 | -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) 549 | 550 | distclean-generic: 551 | -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) 552 | -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) 553 | 554 | maintainer-clean-generic: 555 | @echo "This command is intended for maintainers to use" 556 | @echo "it deletes files that may require special tools to rebuild." 557 | clean: clean-am 558 | 559 | clean-am: clean-binPROGRAMS clean-generic mostlyclean-am 560 | 561 | distclean: distclean-am 562 | -rm -f $(am__CONFIG_DISTCLEAN_FILES) 563 | -rm -rf $(DEPDIR) ./$(DEPDIR) 564 | -rm -f Makefile 565 | distclean-am: clean-am distclean-compile distclean-generic \ 566 | distclean-tags 567 | 568 | dvi: dvi-am 569 | 570 | dvi-am: 571 | 572 | html: html-am 573 | 574 | html-am: 575 | 576 | info: info-am 577 | 578 | info-am: 579 | 580 | install-data-am: install-data-local 581 | 582 | install-dvi: install-dvi-am 583 | 584 | install-dvi-am: 585 | 586 | install-exec-am: install-binPROGRAMS 587 | 588 | install-html: install-html-am 589 | 590 | install-html-am: 591 | 592 | install-info: install-info-am 593 | 594 | install-info-am: 595 | 596 | install-man: 597 | 598 | install-pdf: install-pdf-am 599 | 600 | install-pdf-am: 601 | 602 | install-ps: install-ps-am 603 | 604 | install-ps-am: 605 | 606 | installcheck-am: 607 | 608 | maintainer-clean: maintainer-clean-am 609 | -rm -f $(am__CONFIG_DISTCLEAN_FILES) 610 | -rm -rf $(top_srcdir)/autom4te.cache 611 | -rm -rf $(DEPDIR) ./$(DEPDIR) 612 | -rm -f Makefile 613 | maintainer-clean-am: distclean-am maintainer-clean-generic 614 | 615 | mostlyclean: mostlyclean-am 616 | 617 | mostlyclean-am: mostlyclean-compile mostlyclean-generic 618 | 619 | pdf: pdf-am 620 | 621 | pdf-am: 622 | 623 | ps: ps-am 624 | 625 | ps-am: 626 | 627 | uninstall-am: uninstall-binPROGRAMS 628 | 629 | .MAKE: install-am install-strip 630 | 631 | .PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \ 632 | clean-binPROGRAMS clean-generic ctags dist dist-all dist-bzip2 \ 633 | dist-gzip dist-lzip dist-lzma dist-shar dist-tarZ dist-xz \ 634 | dist-zip distcheck distclean distclean-compile \ 635 | distclean-generic distclean-tags distcleancheck distdir \ 636 | distuninstallcheck dvi dvi-am html html-am info info-am \ 637 | install install-am install-binPROGRAMS install-data \ 638 | install-data-am install-data-local install-dvi install-dvi-am \ 639 | install-exec install-exec-am install-html install-html-am \ 640 | install-info install-info-am install-man install-pdf \ 641 | install-pdf-am install-ps install-ps-am install-strip \ 642 | installcheck installcheck-am installdirs maintainer-clean \ 643 | maintainer-clean-generic mostlyclean mostlyclean-compile \ 644 | mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ 645 | uninstall-am uninstall-binPROGRAMS 646 | 647 | 648 | install-data-local: 649 | $(INSTALL_DATA) urlview.man $(mandir)/man1/urlview.1 650 | 651 | # how to create a target for uninstall-data-local??? 652 | 653 | # Tell versions [3.59,3.63) of GNU make to not export all variables. 654 | # Otherwise a system limit (for SysV at least) may be exceeded. 655 | .NOEXPORT: 656 | -------------------------------------------------------------------------------- /NEWS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sigpipe/urlview/08767aa863cd27d1755ba0aff65b8cc1a0c1446a/NEWS -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | urlview 0.9 2 | =========== 3 | 4 | ftp://ftp.mutt.org/pub/mutt/contrib/urlview-0.9.tar.gz 5 | https://github.com/sigpipe/urlview 6 | 7 | `urlview' is a curses program for extracting URLs from text files and 8 | displaying a menu from which you can select a specific URL to view using 9 | your favorite browser program. It respects the BROWSER convention 10 | (see ) 11 | 12 | Requires: working regcomp() or GNU rx. 13 | 14 | Michael Elkins 15 | February 4, 1997 16 | 17 | Thomas Roessler 18 | July 4, 2000 19 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | urlview 2 | ======= 3 | 4 | Extract URLs from a text file and allow the user to select via a menu -------------------------------------------------------------------------------- /aclocal.m4: -------------------------------------------------------------------------------- 1 | # generated automatically by aclocal 1.11.6 -*- Autoconf -*- 2 | 3 | # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 4 | # 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, 5 | # Inc. 6 | # This file is free software; the Free Software Foundation 7 | # gives unlimited permission to copy and/or distribute it, 8 | # with or without modifications, as long as this notice is preserved. 9 | 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY, to the extent permitted by law; without 12 | # even the implied warranty of MERCHANTABILITY or FITNESS FOR A 13 | # PARTICULAR PURPOSE. 14 | 15 | m4_ifndef([AC_AUTOCONF_VERSION], 16 | [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl 17 | m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, 18 | [m4_warning([this file was generated for autoconf 2.69. 19 | You have another version of autoconf. It may work, but is not guaranteed to. 20 | If you have problems, you may need to regenerate the build system entirely. 21 | To do so, use the procedure documented by the package, typically `autoreconf'.])]) 22 | 23 | # Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software 24 | # Foundation, Inc. 25 | # 26 | # This file is free software; the Free Software Foundation 27 | # gives unlimited permission to copy and/or distribute it, 28 | # with or without modifications, as long as this notice is preserved. 29 | 30 | # serial 1 31 | 32 | # AM_AUTOMAKE_VERSION(VERSION) 33 | # ---------------------------- 34 | # Automake X.Y traces this macro to ensure aclocal.m4 has been 35 | # generated from the m4 files accompanying Automake X.Y. 36 | # (This private macro should not be called outside this file.) 37 | AC_DEFUN([AM_AUTOMAKE_VERSION], 38 | [am__api_version='1.11' 39 | dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to 40 | dnl require some minimum version. Point them to the right macro. 41 | m4_if([$1], [1.11.6], [], 42 | [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl 43 | ]) 44 | 45 | # _AM_AUTOCONF_VERSION(VERSION) 46 | # ----------------------------- 47 | # aclocal traces this macro to find the Autoconf version. 48 | # This is a private macro too. Using m4_define simplifies 49 | # the logic in aclocal, which can simply ignore this definition. 50 | m4_define([_AM_AUTOCONF_VERSION], []) 51 | 52 | # AM_SET_CURRENT_AUTOMAKE_VERSION 53 | # ------------------------------- 54 | # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. 55 | # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. 56 | AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], 57 | [AM_AUTOMAKE_VERSION([1.11.6])dnl 58 | m4_ifndef([AC_AUTOCONF_VERSION], 59 | [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl 60 | _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) 61 | 62 | # AM_AUX_DIR_EXPAND -*- Autoconf -*- 63 | 64 | # Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. 65 | # 66 | # This file is free software; the Free Software Foundation 67 | # gives unlimited permission to copy and/or distribute it, 68 | # with or without modifications, as long as this notice is preserved. 69 | 70 | # serial 1 71 | 72 | # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets 73 | # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to 74 | # `$srcdir', `$srcdir/..', or `$srcdir/../..'. 75 | # 76 | # Of course, Automake must honor this variable whenever it calls a 77 | # tool from the auxiliary directory. The problem is that $srcdir (and 78 | # therefore $ac_aux_dir as well) can be either absolute or relative, 79 | # depending on how configure is run. This is pretty annoying, since 80 | # it makes $ac_aux_dir quite unusable in subdirectories: in the top 81 | # source directory, any form will work fine, but in subdirectories a 82 | # relative path needs to be adjusted first. 83 | # 84 | # $ac_aux_dir/missing 85 | # fails when called from a subdirectory if $ac_aux_dir is relative 86 | # $top_srcdir/$ac_aux_dir/missing 87 | # fails if $ac_aux_dir is absolute, 88 | # fails when called from a subdirectory in a VPATH build with 89 | # a relative $ac_aux_dir 90 | # 91 | # The reason of the latter failure is that $top_srcdir and $ac_aux_dir 92 | # are both prefixed by $srcdir. In an in-source build this is usually 93 | # harmless because $srcdir is `.', but things will broke when you 94 | # start a VPATH build or use an absolute $srcdir. 95 | # 96 | # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, 97 | # iff we strip the leading $srcdir from $ac_aux_dir. That would be: 98 | # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` 99 | # and then we would define $MISSING as 100 | # MISSING="\${SHELL} $am_aux_dir/missing" 101 | # This will work as long as MISSING is not called from configure, because 102 | # unfortunately $(top_srcdir) has no meaning in configure. 103 | # However there are other variables, like CC, which are often used in 104 | # configure, and could therefore not use this "fixed" $ac_aux_dir. 105 | # 106 | # Another solution, used here, is to always expand $ac_aux_dir to an 107 | # absolute PATH. The drawback is that using absolute paths prevent a 108 | # configured tree to be moved without reconfiguration. 109 | 110 | AC_DEFUN([AM_AUX_DIR_EXPAND], 111 | [dnl Rely on autoconf to set up CDPATH properly. 112 | AC_PREREQ([2.50])dnl 113 | # expand $ac_aux_dir to an absolute path 114 | am_aux_dir=`cd $ac_aux_dir && pwd` 115 | ]) 116 | 117 | # AM_CONDITIONAL -*- Autoconf -*- 118 | 119 | # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 120 | # Free Software Foundation, Inc. 121 | # 122 | # This file is free software; the Free Software Foundation 123 | # gives unlimited permission to copy and/or distribute it, 124 | # with or without modifications, as long as this notice is preserved. 125 | 126 | # serial 9 127 | 128 | # AM_CONDITIONAL(NAME, SHELL-CONDITION) 129 | # ------------------------------------- 130 | # Define a conditional. 131 | AC_DEFUN([AM_CONDITIONAL], 132 | [AC_PREREQ(2.52)dnl 133 | ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], 134 | [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl 135 | AC_SUBST([$1_TRUE])dnl 136 | AC_SUBST([$1_FALSE])dnl 137 | _AM_SUBST_NOTMAKE([$1_TRUE])dnl 138 | _AM_SUBST_NOTMAKE([$1_FALSE])dnl 139 | m4_define([_AM_COND_VALUE_$1], [$2])dnl 140 | if $2; then 141 | $1_TRUE= 142 | $1_FALSE='#' 143 | else 144 | $1_TRUE='#' 145 | $1_FALSE= 146 | fi 147 | AC_CONFIG_COMMANDS_PRE( 148 | [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then 149 | AC_MSG_ERROR([[conditional "$1" was never defined. 150 | Usually this means the macro was only invoked conditionally.]]) 151 | fi])]) 152 | 153 | # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009, 154 | # 2010, 2011 Free Software Foundation, Inc. 155 | # 156 | # This file is free software; the Free Software Foundation 157 | # gives unlimited permission to copy and/or distribute it, 158 | # with or without modifications, as long as this notice is preserved. 159 | 160 | # serial 12 161 | 162 | # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be 163 | # written in clear, in which case automake, when reading aclocal.m4, 164 | # will think it sees a *use*, and therefore will trigger all it's 165 | # C support machinery. Also note that it means that autoscan, seeing 166 | # CC etc. in the Makefile, will ask for an AC_PROG_CC use... 167 | 168 | 169 | # _AM_DEPENDENCIES(NAME) 170 | # ---------------------- 171 | # See how the compiler implements dependency checking. 172 | # NAME is "CC", "CXX", "GCJ", or "OBJC". 173 | # We try a few techniques and use that to set a single cache variable. 174 | # 175 | # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was 176 | # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular 177 | # dependency, and given that the user is not expected to run this macro, 178 | # just rely on AC_PROG_CC. 179 | AC_DEFUN([_AM_DEPENDENCIES], 180 | [AC_REQUIRE([AM_SET_DEPDIR])dnl 181 | AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl 182 | AC_REQUIRE([AM_MAKE_INCLUDE])dnl 183 | AC_REQUIRE([AM_DEP_TRACK])dnl 184 | 185 | ifelse([$1], CC, [depcc="$CC" am_compiler_list=], 186 | [$1], CXX, [depcc="$CXX" am_compiler_list=], 187 | [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], 188 | [$1], UPC, [depcc="$UPC" am_compiler_list=], 189 | [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], 190 | [depcc="$$1" am_compiler_list=]) 191 | 192 | AC_CACHE_CHECK([dependency style of $depcc], 193 | [am_cv_$1_dependencies_compiler_type], 194 | [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then 195 | # We make a subdir and do the tests there. Otherwise we can end up 196 | # making bogus files that we don't know about and never remove. For 197 | # instance it was reported that on HP-UX the gcc test will end up 198 | # making a dummy file named `D' -- because `-MD' means `put the output 199 | # in D'. 200 | rm -rf conftest.dir 201 | mkdir conftest.dir 202 | # Copy depcomp to subdir because otherwise we won't find it if we're 203 | # using a relative directory. 204 | cp "$am_depcomp" conftest.dir 205 | cd conftest.dir 206 | # We will build objects and dependencies in a subdirectory because 207 | # it helps to detect inapplicable dependency modes. For instance 208 | # both Tru64's cc and ICC support -MD to output dependencies as a 209 | # side effect of compilation, but ICC will put the dependencies in 210 | # the current directory while Tru64 will put them in the object 211 | # directory. 212 | mkdir sub 213 | 214 | am_cv_$1_dependencies_compiler_type=none 215 | if test "$am_compiler_list" = ""; then 216 | am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` 217 | fi 218 | am__universal=false 219 | m4_case([$1], [CC], 220 | [case " $depcc " in #( 221 | *\ -arch\ *\ -arch\ *) am__universal=true ;; 222 | esac], 223 | [CXX], 224 | [case " $depcc " in #( 225 | *\ -arch\ *\ -arch\ *) am__universal=true ;; 226 | esac]) 227 | 228 | for depmode in $am_compiler_list; do 229 | # Setup a source with many dependencies, because some compilers 230 | # like to wrap large dependency lists on column 80 (with \), and 231 | # we should not choose a depcomp mode which is confused by this. 232 | # 233 | # We need to recreate these files for each test, as the compiler may 234 | # overwrite some of them when testing with obscure command lines. 235 | # This happens at least with the AIX C compiler. 236 | : > sub/conftest.c 237 | for i in 1 2 3 4 5 6; do 238 | echo '#include "conftst'$i'.h"' >> sub/conftest.c 239 | # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with 240 | # Solaris 8's {/usr,}/bin/sh. 241 | touch sub/conftst$i.h 242 | done 243 | echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf 244 | 245 | # We check with `-c' and `-o' for the sake of the "dashmstdout" 246 | # mode. It turns out that the SunPro C++ compiler does not properly 247 | # handle `-M -o', and we need to detect this. Also, some Intel 248 | # versions had trouble with output in subdirs 249 | am__obj=sub/conftest.${OBJEXT-o} 250 | am__minus_obj="-o $am__obj" 251 | case $depmode in 252 | gcc) 253 | # This depmode causes a compiler race in universal mode. 254 | test "$am__universal" = false || continue 255 | ;; 256 | nosideeffect) 257 | # after this tag, mechanisms are not by side-effect, so they'll 258 | # only be used when explicitly requested 259 | if test "x$enable_dependency_tracking" = xyes; then 260 | continue 261 | else 262 | break 263 | fi 264 | ;; 265 | msvc7 | msvc7msys | msvisualcpp | msvcmsys) 266 | # This compiler won't grok `-c -o', but also, the minuso test has 267 | # not run yet. These depmodes are late enough in the game, and 268 | # so weak that their functioning should not be impacted. 269 | am__obj=conftest.${OBJEXT-o} 270 | am__minus_obj= 271 | ;; 272 | none) break ;; 273 | esac 274 | if depmode=$depmode \ 275 | source=sub/conftest.c object=$am__obj \ 276 | depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ 277 | $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ 278 | >/dev/null 2>conftest.err && 279 | grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && 280 | grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && 281 | grep $am__obj sub/conftest.Po > /dev/null 2>&1 && 282 | ${MAKE-make} -s -f confmf > /dev/null 2>&1; then 283 | # icc doesn't choke on unknown options, it will just issue warnings 284 | # or remarks (even with -Werror). So we grep stderr for any message 285 | # that says an option was ignored or not supported. 286 | # When given -MP, icc 7.0 and 7.1 complain thusly: 287 | # icc: Command line warning: ignoring option '-M'; no argument required 288 | # The diagnosis changed in icc 8.0: 289 | # icc: Command line remark: option '-MP' not supported 290 | if (grep 'ignoring option' conftest.err || 291 | grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else 292 | am_cv_$1_dependencies_compiler_type=$depmode 293 | break 294 | fi 295 | fi 296 | done 297 | 298 | cd .. 299 | rm -rf conftest.dir 300 | else 301 | am_cv_$1_dependencies_compiler_type=none 302 | fi 303 | ]) 304 | AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) 305 | AM_CONDITIONAL([am__fastdep$1], [ 306 | test "x$enable_dependency_tracking" != xno \ 307 | && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) 308 | ]) 309 | 310 | 311 | # AM_SET_DEPDIR 312 | # ------------- 313 | # Choose a directory name for dependency files. 314 | # This macro is AC_REQUIREd in _AM_DEPENDENCIES 315 | AC_DEFUN([AM_SET_DEPDIR], 316 | [AC_REQUIRE([AM_SET_LEADING_DOT])dnl 317 | AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl 318 | ]) 319 | 320 | 321 | # AM_DEP_TRACK 322 | # ------------ 323 | AC_DEFUN([AM_DEP_TRACK], 324 | [AC_ARG_ENABLE(dependency-tracking, 325 | [ --disable-dependency-tracking speeds up one-time build 326 | --enable-dependency-tracking do not reject slow dependency extractors]) 327 | if test "x$enable_dependency_tracking" != xno; then 328 | am_depcomp="$ac_aux_dir/depcomp" 329 | AMDEPBACKSLASH='\' 330 | am__nodep='_no' 331 | fi 332 | AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) 333 | AC_SUBST([AMDEPBACKSLASH])dnl 334 | _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl 335 | AC_SUBST([am__nodep])dnl 336 | _AM_SUBST_NOTMAKE([am__nodep])dnl 337 | ]) 338 | 339 | # Generate code to set up dependency tracking. -*- Autoconf -*- 340 | 341 | # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 342 | # Free Software Foundation, Inc. 343 | # 344 | # This file is free software; the Free Software Foundation 345 | # gives unlimited permission to copy and/or distribute it, 346 | # with or without modifications, as long as this notice is preserved. 347 | 348 | #serial 5 349 | 350 | # _AM_OUTPUT_DEPENDENCY_COMMANDS 351 | # ------------------------------ 352 | AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], 353 | [{ 354 | # Autoconf 2.62 quotes --file arguments for eval, but not when files 355 | # are listed without --file. Let's play safe and only enable the eval 356 | # if we detect the quoting. 357 | case $CONFIG_FILES in 358 | *\'*) eval set x "$CONFIG_FILES" ;; 359 | *) set x $CONFIG_FILES ;; 360 | esac 361 | shift 362 | for mf 363 | do 364 | # Strip MF so we end up with the name of the file. 365 | mf=`echo "$mf" | sed -e 's/:.*$//'` 366 | # Check whether this is an Automake generated Makefile or not. 367 | # We used to match only the files named `Makefile.in', but 368 | # some people rename them; so instead we look at the file content. 369 | # Grep'ing the first line is not enough: some people post-process 370 | # each Makefile.in and add a new line on top of each file to say so. 371 | # Grep'ing the whole file is not good either: AIX grep has a line 372 | # limit of 2048, but all sed's we know have understand at least 4000. 373 | if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then 374 | dirpart=`AS_DIRNAME("$mf")` 375 | else 376 | continue 377 | fi 378 | # Extract the definition of DEPDIR, am__include, and am__quote 379 | # from the Makefile without running `make'. 380 | DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` 381 | test -z "$DEPDIR" && continue 382 | am__include=`sed -n 's/^am__include = //p' < "$mf"` 383 | test -z "am__include" && continue 384 | am__quote=`sed -n 's/^am__quote = //p' < "$mf"` 385 | # When using ansi2knr, U may be empty or an underscore; expand it 386 | U=`sed -n 's/^U = //p' < "$mf"` 387 | # Find all dependency output files, they are included files with 388 | # $(DEPDIR) in their names. We invoke sed twice because it is the 389 | # simplest approach to changing $(DEPDIR) to its actual value in the 390 | # expansion. 391 | for file in `sed -n " 392 | s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ 393 | sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do 394 | # Make sure the directory exists. 395 | test -f "$dirpart/$file" && continue 396 | fdir=`AS_DIRNAME(["$file"])` 397 | AS_MKDIR_P([$dirpart/$fdir]) 398 | # echo "creating $dirpart/$file" 399 | echo '# dummy' > "$dirpart/$file" 400 | done 401 | done 402 | } 403 | ])# _AM_OUTPUT_DEPENDENCY_COMMANDS 404 | 405 | 406 | # AM_OUTPUT_DEPENDENCY_COMMANDS 407 | # ----------------------------- 408 | # This macro should only be invoked once -- use via AC_REQUIRE. 409 | # 410 | # This code is only required when automatic dependency tracking 411 | # is enabled. FIXME. This creates each `.P' file that we will 412 | # need in order to bootstrap the dependency handling code. 413 | AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], 414 | [AC_CONFIG_COMMANDS([depfiles], 415 | [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], 416 | [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) 417 | ]) 418 | 419 | # Do all the work for Automake. -*- Autoconf -*- 420 | 421 | # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 422 | # 2005, 2006, 2008, 2009 Free Software Foundation, Inc. 423 | # 424 | # This file is free software; the Free Software Foundation 425 | # gives unlimited permission to copy and/or distribute it, 426 | # with or without modifications, as long as this notice is preserved. 427 | 428 | # serial 16 429 | 430 | # This macro actually does too much. Some checks are only needed if 431 | # your package does certain things. But this isn't really a big deal. 432 | 433 | # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) 434 | # AM_INIT_AUTOMAKE([OPTIONS]) 435 | # ----------------------------------------------- 436 | # The call with PACKAGE and VERSION arguments is the old style 437 | # call (pre autoconf-2.50), which is being phased out. PACKAGE 438 | # and VERSION should now be passed to AC_INIT and removed from 439 | # the call to AM_INIT_AUTOMAKE. 440 | # We support both call styles for the transition. After 441 | # the next Automake release, Autoconf can make the AC_INIT 442 | # arguments mandatory, and then we can depend on a new Autoconf 443 | # release and drop the old call support. 444 | AC_DEFUN([AM_INIT_AUTOMAKE], 445 | [AC_PREREQ([2.62])dnl 446 | dnl Autoconf wants to disallow AM_ names. We explicitly allow 447 | dnl the ones we care about. 448 | m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl 449 | AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl 450 | AC_REQUIRE([AC_PROG_INSTALL])dnl 451 | if test "`cd $srcdir && pwd`" != "`pwd`"; then 452 | # Use -I$(srcdir) only when $(srcdir) != ., so that make's output 453 | # is not polluted with repeated "-I." 454 | AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl 455 | # test to see if srcdir already configured 456 | if test -f $srcdir/config.status; then 457 | AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) 458 | fi 459 | fi 460 | 461 | # test whether we have cygpath 462 | if test -z "$CYGPATH_W"; then 463 | if (cygpath --version) >/dev/null 2>/dev/null; then 464 | CYGPATH_W='cygpath -w' 465 | else 466 | CYGPATH_W=echo 467 | fi 468 | fi 469 | AC_SUBST([CYGPATH_W]) 470 | 471 | # Define the identity of the package. 472 | dnl Distinguish between old-style and new-style calls. 473 | m4_ifval([$2], 474 | [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl 475 | AC_SUBST([PACKAGE], [$1])dnl 476 | AC_SUBST([VERSION], [$2])], 477 | [_AM_SET_OPTIONS([$1])dnl 478 | dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. 479 | m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, 480 | [m4_fatal([AC_INIT should be called with package and version arguments])])dnl 481 | AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl 482 | AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl 483 | 484 | _AM_IF_OPTION([no-define],, 485 | [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) 486 | AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl 487 | 488 | # Some tools Automake needs. 489 | AC_REQUIRE([AM_SANITY_CHECK])dnl 490 | AC_REQUIRE([AC_ARG_PROGRAM])dnl 491 | AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) 492 | AM_MISSING_PROG(AUTOCONF, autoconf) 493 | AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) 494 | AM_MISSING_PROG(AUTOHEADER, autoheader) 495 | AM_MISSING_PROG(MAKEINFO, makeinfo) 496 | AC_REQUIRE([AM_PROG_INSTALL_SH])dnl 497 | AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl 498 | AC_REQUIRE([AM_PROG_MKDIR_P])dnl 499 | # We need awk for the "check" target. The system "awk" is bad on 500 | # some platforms. 501 | AC_REQUIRE([AC_PROG_AWK])dnl 502 | AC_REQUIRE([AC_PROG_MAKE_SET])dnl 503 | AC_REQUIRE([AM_SET_LEADING_DOT])dnl 504 | _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], 505 | [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], 506 | [_AM_PROG_TAR([v7])])]) 507 | _AM_IF_OPTION([no-dependencies],, 508 | [AC_PROVIDE_IFELSE([AC_PROG_CC], 509 | [_AM_DEPENDENCIES(CC)], 510 | [define([AC_PROG_CC], 511 | defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl 512 | AC_PROVIDE_IFELSE([AC_PROG_CXX], 513 | [_AM_DEPENDENCIES(CXX)], 514 | [define([AC_PROG_CXX], 515 | defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl 516 | AC_PROVIDE_IFELSE([AC_PROG_OBJC], 517 | [_AM_DEPENDENCIES(OBJC)], 518 | [define([AC_PROG_OBJC], 519 | defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl 520 | ]) 521 | _AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl 522 | dnl The `parallel-tests' driver may need to know about EXEEXT, so add the 523 | dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro 524 | dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. 525 | AC_CONFIG_COMMANDS_PRE(dnl 526 | [m4_provide_if([_AM_COMPILER_EXEEXT], 527 | [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl 528 | ]) 529 | 530 | dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not 531 | dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further 532 | dnl mangled by Autoconf and run in a shell conditional statement. 533 | m4_define([_AC_COMPILER_EXEEXT], 534 | m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) 535 | 536 | 537 | # When config.status generates a header, we must update the stamp-h file. 538 | # This file resides in the same directory as the config header 539 | # that is generated. The stamp files are numbered to have different names. 540 | 541 | # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the 542 | # loop where config.status creates the headers, so we can generate 543 | # our stamp files there. 544 | AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], 545 | [# Compute $1's index in $config_headers. 546 | _am_arg=$1 547 | _am_stamp_count=1 548 | for _am_header in $config_headers :; do 549 | case $_am_header in 550 | $_am_arg | $_am_arg:* ) 551 | break ;; 552 | * ) 553 | _am_stamp_count=`expr $_am_stamp_count + 1` ;; 554 | esac 555 | done 556 | echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) 557 | 558 | # Copyright (C) 2001, 2003, 2005, 2008, 2011 Free Software Foundation, 559 | # Inc. 560 | # 561 | # This file is free software; the Free Software Foundation 562 | # gives unlimited permission to copy and/or distribute it, 563 | # with or without modifications, as long as this notice is preserved. 564 | 565 | # serial 1 566 | 567 | # AM_PROG_INSTALL_SH 568 | # ------------------ 569 | # Define $install_sh. 570 | AC_DEFUN([AM_PROG_INSTALL_SH], 571 | [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl 572 | if test x"${install_sh}" != xset; then 573 | case $am_aux_dir in 574 | *\ * | *\ *) 575 | install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; 576 | *) 577 | install_sh="\${SHELL} $am_aux_dir/install-sh" 578 | esac 579 | fi 580 | AC_SUBST(install_sh)]) 581 | 582 | # Copyright (C) 2003, 2005 Free Software Foundation, Inc. 583 | # 584 | # This file is free software; the Free Software Foundation 585 | # gives unlimited permission to copy and/or distribute it, 586 | # with or without modifications, as long as this notice is preserved. 587 | 588 | # serial 2 589 | 590 | # Check whether the underlying file-system supports filenames 591 | # with a leading dot. For instance MS-DOS doesn't. 592 | AC_DEFUN([AM_SET_LEADING_DOT], 593 | [rm -rf .tst 2>/dev/null 594 | mkdir .tst 2>/dev/null 595 | if test -d .tst; then 596 | am__leading_dot=. 597 | else 598 | am__leading_dot=_ 599 | fi 600 | rmdir .tst 2>/dev/null 601 | AC_SUBST([am__leading_dot])]) 602 | 603 | # Check to see how 'make' treats includes. -*- Autoconf -*- 604 | 605 | # Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc. 606 | # 607 | # This file is free software; the Free Software Foundation 608 | # gives unlimited permission to copy and/or distribute it, 609 | # with or without modifications, as long as this notice is preserved. 610 | 611 | # serial 4 612 | 613 | # AM_MAKE_INCLUDE() 614 | # ----------------- 615 | # Check to see how make treats includes. 616 | AC_DEFUN([AM_MAKE_INCLUDE], 617 | [am_make=${MAKE-make} 618 | cat > confinc << 'END' 619 | am__doit: 620 | @echo this is the am__doit target 621 | .PHONY: am__doit 622 | END 623 | # If we don't find an include directive, just comment out the code. 624 | AC_MSG_CHECKING([for style of include used by $am_make]) 625 | am__include="#" 626 | am__quote= 627 | _am_result=none 628 | # First try GNU make style include. 629 | echo "include confinc" > confmf 630 | # Ignore all kinds of additional output from `make'. 631 | case `$am_make -s -f confmf 2> /dev/null` in #( 632 | *the\ am__doit\ target*) 633 | am__include=include 634 | am__quote= 635 | _am_result=GNU 636 | ;; 637 | esac 638 | # Now try BSD make style include. 639 | if test "$am__include" = "#"; then 640 | echo '.include "confinc"' > confmf 641 | case `$am_make -s -f confmf 2> /dev/null` in #( 642 | *the\ am__doit\ target*) 643 | am__include=.include 644 | am__quote="\"" 645 | _am_result=BSD 646 | ;; 647 | esac 648 | fi 649 | AC_SUBST([am__include]) 650 | AC_SUBST([am__quote]) 651 | AC_MSG_RESULT([$_am_result]) 652 | rm -f confinc confmf 653 | ]) 654 | 655 | # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- 656 | 657 | # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 658 | # Free Software Foundation, Inc. 659 | # 660 | # This file is free software; the Free Software Foundation 661 | # gives unlimited permission to copy and/or distribute it, 662 | # with or without modifications, as long as this notice is preserved. 663 | 664 | # serial 6 665 | 666 | # AM_MISSING_PROG(NAME, PROGRAM) 667 | # ------------------------------ 668 | AC_DEFUN([AM_MISSING_PROG], 669 | [AC_REQUIRE([AM_MISSING_HAS_RUN]) 670 | $1=${$1-"${am_missing_run}$2"} 671 | AC_SUBST($1)]) 672 | 673 | 674 | # AM_MISSING_HAS_RUN 675 | # ------------------ 676 | # Define MISSING if not defined so far and test if it supports --run. 677 | # If it does, set am_missing_run to use it, otherwise, to nothing. 678 | AC_DEFUN([AM_MISSING_HAS_RUN], 679 | [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl 680 | AC_REQUIRE_AUX_FILE([missing])dnl 681 | if test x"${MISSING+set}" != xset; then 682 | case $am_aux_dir in 683 | *\ * | *\ *) 684 | MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; 685 | *) 686 | MISSING="\${SHELL} $am_aux_dir/missing" ;; 687 | esac 688 | fi 689 | # Use eval to expand $SHELL 690 | if eval "$MISSING --run true"; then 691 | am_missing_run="$MISSING --run " 692 | else 693 | am_missing_run= 694 | AC_MSG_WARN([`missing' script is too old or missing]) 695 | fi 696 | ]) 697 | 698 | # Copyright (C) 2003, 2004, 2005, 2006, 2011 Free Software Foundation, 699 | # Inc. 700 | # 701 | # This file is free software; the Free Software Foundation 702 | # gives unlimited permission to copy and/or distribute it, 703 | # with or without modifications, as long as this notice is preserved. 704 | 705 | # serial 1 706 | 707 | # AM_PROG_MKDIR_P 708 | # --------------- 709 | # Check for `mkdir -p'. 710 | AC_DEFUN([AM_PROG_MKDIR_P], 711 | [AC_PREREQ([2.60])dnl 712 | AC_REQUIRE([AC_PROG_MKDIR_P])dnl 713 | dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, 714 | dnl while keeping a definition of mkdir_p for backward compatibility. 715 | dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. 716 | dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of 717 | dnl Makefile.ins that do not define MKDIR_P, so we do our own 718 | dnl adjustment using top_builddir (which is defined more often than 719 | dnl MKDIR_P). 720 | AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl 721 | case $mkdir_p in 722 | [[\\/$]]* | ?:[[\\/]]*) ;; 723 | */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; 724 | esac 725 | ]) 726 | 727 | # Helper functions for option handling. -*- Autoconf -*- 728 | 729 | # Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software 730 | # Foundation, Inc. 731 | # 732 | # This file is free software; the Free Software Foundation 733 | # gives unlimited permission to copy and/or distribute it, 734 | # with or without modifications, as long as this notice is preserved. 735 | 736 | # serial 5 737 | 738 | # _AM_MANGLE_OPTION(NAME) 739 | # ----------------------- 740 | AC_DEFUN([_AM_MANGLE_OPTION], 741 | [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) 742 | 743 | # _AM_SET_OPTION(NAME) 744 | # -------------------- 745 | # Set option NAME. Presently that only means defining a flag for this option. 746 | AC_DEFUN([_AM_SET_OPTION], 747 | [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) 748 | 749 | # _AM_SET_OPTIONS(OPTIONS) 750 | # ------------------------ 751 | # OPTIONS is a space-separated list of Automake options. 752 | AC_DEFUN([_AM_SET_OPTIONS], 753 | [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) 754 | 755 | # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) 756 | # ------------------------------------------- 757 | # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. 758 | AC_DEFUN([_AM_IF_OPTION], 759 | [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) 760 | 761 | # Check to make sure that the build environment is sane. -*- Autoconf -*- 762 | 763 | # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 764 | # Free Software Foundation, Inc. 765 | # 766 | # This file is free software; the Free Software Foundation 767 | # gives unlimited permission to copy and/or distribute it, 768 | # with or without modifications, as long as this notice is preserved. 769 | 770 | # serial 5 771 | 772 | # AM_SANITY_CHECK 773 | # --------------- 774 | AC_DEFUN([AM_SANITY_CHECK], 775 | [AC_MSG_CHECKING([whether build environment is sane]) 776 | # Just in case 777 | sleep 1 778 | echo timestamp > conftest.file 779 | # Reject unsafe characters in $srcdir or the absolute working directory 780 | # name. Accept space and tab only in the latter. 781 | am_lf=' 782 | ' 783 | case `pwd` in 784 | *[[\\\"\#\$\&\'\`$am_lf]]*) 785 | AC_MSG_ERROR([unsafe absolute working directory name]);; 786 | esac 787 | case $srcdir in 788 | *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) 789 | AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; 790 | esac 791 | 792 | # Do `set' in a subshell so we don't clobber the current shell's 793 | # arguments. Must try -L first in case configure is actually a 794 | # symlink; some systems play weird games with the mod time of symlinks 795 | # (eg FreeBSD returns the mod time of the symlink's containing 796 | # directory). 797 | if ( 798 | set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` 799 | if test "$[*]" = "X"; then 800 | # -L didn't work. 801 | set X `ls -t "$srcdir/configure" conftest.file` 802 | fi 803 | rm -f conftest.file 804 | if test "$[*]" != "X $srcdir/configure conftest.file" \ 805 | && test "$[*]" != "X conftest.file $srcdir/configure"; then 806 | 807 | # If neither matched, then we have a broken ls. This can happen 808 | # if, for instance, CONFIG_SHELL is bash and it inherits a 809 | # broken ls alias from the environment. This has actually 810 | # happened. Such a system could not be considered "sane". 811 | AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken 812 | alias in your environment]) 813 | fi 814 | 815 | test "$[2]" = conftest.file 816 | ) 817 | then 818 | # Ok. 819 | : 820 | else 821 | AC_MSG_ERROR([newly created file is older than distributed files! 822 | Check your system clock]) 823 | fi 824 | AC_MSG_RESULT(yes)]) 825 | 826 | # Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. 827 | # 828 | # This file is free software; the Free Software Foundation 829 | # gives unlimited permission to copy and/or distribute it, 830 | # with or without modifications, as long as this notice is preserved. 831 | 832 | # serial 1 833 | 834 | # AM_PROG_INSTALL_STRIP 835 | # --------------------- 836 | # One issue with vendor `install' (even GNU) is that you can't 837 | # specify the program used to strip binaries. This is especially 838 | # annoying in cross-compiling environments, where the build's strip 839 | # is unlikely to handle the host's binaries. 840 | # Fortunately install-sh will honor a STRIPPROG variable, so we 841 | # always use install-sh in `make install-strip', and initialize 842 | # STRIPPROG with the value of the STRIP variable (set by the user). 843 | AC_DEFUN([AM_PROG_INSTALL_STRIP], 844 | [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl 845 | # Installed binaries are usually stripped using `strip' when the user 846 | # run `make install-strip'. However `strip' might not be the right 847 | # tool to use in cross-compilation environments, therefore Automake 848 | # will honor the `STRIP' environment variable to overrule this program. 849 | dnl Don't test for $cross_compiling = yes, because it might be `maybe'. 850 | if test "$cross_compiling" != no; then 851 | AC_CHECK_TOOL([STRIP], [strip], :) 852 | fi 853 | INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" 854 | AC_SUBST([INSTALL_STRIP_PROGRAM])]) 855 | 856 | # Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc. 857 | # 858 | # This file is free software; the Free Software Foundation 859 | # gives unlimited permission to copy and/or distribute it, 860 | # with or without modifications, as long as this notice is preserved. 861 | 862 | # serial 3 863 | 864 | # _AM_SUBST_NOTMAKE(VARIABLE) 865 | # --------------------------- 866 | # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. 867 | # This macro is traced by Automake. 868 | AC_DEFUN([_AM_SUBST_NOTMAKE]) 869 | 870 | # AM_SUBST_NOTMAKE(VARIABLE) 871 | # -------------------------- 872 | # Public sister of _AM_SUBST_NOTMAKE. 873 | AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) 874 | 875 | # Check how to create a tarball. -*- Autoconf -*- 876 | 877 | # Copyright (C) 2004, 2005, 2012 Free Software Foundation, Inc. 878 | # 879 | # This file is free software; the Free Software Foundation 880 | # gives unlimited permission to copy and/or distribute it, 881 | # with or without modifications, as long as this notice is preserved. 882 | 883 | # serial 2 884 | 885 | # _AM_PROG_TAR(FORMAT) 886 | # -------------------- 887 | # Check how to create a tarball in format FORMAT. 888 | # FORMAT should be one of `v7', `ustar', or `pax'. 889 | # 890 | # Substitute a variable $(am__tar) that is a command 891 | # writing to stdout a FORMAT-tarball containing the directory 892 | # $tardir. 893 | # tardir=directory && $(am__tar) > result.tar 894 | # 895 | # Substitute a variable $(am__untar) that extract such 896 | # a tarball read from stdin. 897 | # $(am__untar) < result.tar 898 | AC_DEFUN([_AM_PROG_TAR], 899 | [# Always define AMTAR for backward compatibility. Yes, it's still used 900 | # in the wild :-( We should find a proper way to deprecate it ... 901 | AC_SUBST([AMTAR], ['$${TAR-tar}']) 902 | m4_if([$1], [v7], 903 | [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], 904 | [m4_case([$1], [ustar],, [pax],, 905 | [m4_fatal([Unknown tar format])]) 906 | AC_MSG_CHECKING([how to create a $1 tar archive]) 907 | # Loop over all known methods to create a tar archive until one works. 908 | _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' 909 | _am_tools=${am_cv_prog_tar_$1-$_am_tools} 910 | # Do not fold the above two line into one, because Tru64 sh and 911 | # Solaris sh will not grok spaces in the rhs of `-'. 912 | for _am_tool in $_am_tools 913 | do 914 | case $_am_tool in 915 | gnutar) 916 | for _am_tar in tar gnutar gtar; 917 | do 918 | AM_RUN_LOG([$_am_tar --version]) && break 919 | done 920 | am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' 921 | am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' 922 | am__untar="$_am_tar -xf -" 923 | ;; 924 | plaintar) 925 | # Must skip GNU tar: if it does not support --format= it doesn't create 926 | # ustar tarball either. 927 | (tar --version) >/dev/null 2>&1 && continue 928 | am__tar='tar chf - "$$tardir"' 929 | am__tar_='tar chf - "$tardir"' 930 | am__untar='tar xf -' 931 | ;; 932 | pax) 933 | am__tar='pax -L -x $1 -w "$$tardir"' 934 | am__tar_='pax -L -x $1 -w "$tardir"' 935 | am__untar='pax -r' 936 | ;; 937 | cpio) 938 | am__tar='find "$$tardir" -print | cpio -o -H $1 -L' 939 | am__tar_='find "$tardir" -print | cpio -o -H $1 -L' 940 | am__untar='cpio -i -H $1 -d' 941 | ;; 942 | none) 943 | am__tar=false 944 | am__tar_=false 945 | am__untar=false 946 | ;; 947 | esac 948 | 949 | # If the value was cached, stop now. We just wanted to have am__tar 950 | # and am__untar set. 951 | test -n "${am_cv_prog_tar_$1}" && break 952 | 953 | # tar/untar a dummy directory, and stop if the command works 954 | rm -rf conftest.dir 955 | mkdir conftest.dir 956 | echo GrepMe > conftest.dir/file 957 | AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) 958 | rm -rf conftest.dir 959 | if test -s conftest.tar; then 960 | AM_RUN_LOG([$am__untar /dev/null 2>&1 && break 962 | fi 963 | done 964 | rm -rf conftest.dir 965 | 966 | AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) 967 | AC_MSG_RESULT([$am_cv_prog_tar_$1])]) 968 | AC_SUBST([am__tar]) 969 | AC_SUBST([am__untar]) 970 | ]) # _AM_PROG_TAR 971 | 972 | -------------------------------------------------------------------------------- /configure.in: -------------------------------------------------------------------------------- 1 | AC_INIT(urlview.c) 2 | AM_INIT_AUTOMAKE(urlview, 0.9) 3 | dnl AM_CONFIG_HEADER(config.h) 4 | AC_PROG_CC_STDC 5 | AC_PROG_CC_C99 6 | CFLAGS="$CFLAGS -DURLVIEW -Dunix" 7 | AC_ARG_WITH(slang, [ --with-slang[=DIR] use S-Lang instead of curses], 8 | [AC_DEFINE(USE_SLANG) 9 | if test $withval = yes -a -d ../slang; then 10 | withval=../slang 11 | fi 12 | if test $withval != yes; then 13 | if test $withval/include; then 14 | CPPFLAGS="$CPPFLAGS -I$withval/include" 15 | LIBS="$LIBS -L$withval/lib -lslang -lm" 16 | else 17 | CPPFLAGS="$CPPFLAGS -I$withval/src" 18 | LIBS="$LIBS $withval/src/objs/libslang.a -lm" 19 | fi 20 | else 21 | if test -d /usr/include/slang; then 22 | CPPFLAGS="$CPPFLAGS -I/usr/include/slang" 23 | fi 24 | LIBS="$LIBS -lslang -lm" 25 | fi], 26 | 27 | [AC_CHECK_LIB(ncursesw, initscr, 28 | [LIBS="$LIBS -lncursesw"], 29 | [AC_CHECK_LIB(ncurses, initscr, [LIBS="$LIBS -lncurses"], [LIBS="$LIBS -lcurses"])]) 30 | AC_CHECK_FUNCS(curs_set) 31 | AC_CHECK_HEADERS(ncurses.h) 32 | AC_CHECK_HEADER(ncursesw/curses.h, [CPPFLAGS="$CPPFLAGS -I/usr/include/ncursesw"], 33 | [AC_CHECK_HEADER(ncurses/curses.h, [CPPFLAGS="$CPPFLAGS -I/usr/include/ncurses"])])]) 34 | 35 | AC_REPLACE_FUNCS(snprintf) 36 | 37 | AC_ARG_WITH(rx, [ --with-rx=DIR where to find librx], 38 | [if test $withval != yes; then 39 | CPPFLAGS="$CPPFLAGS -I$withval" 40 | if test -d $withval/include; then 41 | CPPFLAGS=$CPPFLAGS/include 42 | fi 43 | 44 | if test -d $withval/lib; then 45 | LIBS="$LIBS $withval/lib/librx.a" 46 | else 47 | LIBS="$LIBS $withval/librx.a" 48 | fi 49 | fi], 50 | [AC_CHECK_FUNC(regcomp, [], [AC_CHECK_LIB(rx, regcomp, [LIBS="$LIBS -lrx"], 51 | [AC_MSG_ERROR(you must install GNU librx)])]) 52 | AC_CHECK_HEADERS(regex.h) 53 | ]) 54 | 55 | AC_CHECK_HEADERS(stdarg.h) 56 | AC_CHECK_HEADERS(varargs.h) 57 | 58 | AC_ARG_ENABLE(warnings, [ --enable-warnings turn on compiler warnings], 59 | [if test $enableval = yes; then 60 | CFLAGS="$CFLAGS -pedantic -ansi -Wall" 61 | fi]) 62 | 63 | AC_OUTPUT(Makefile) 64 | -------------------------------------------------------------------------------- /dokey.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1997 Michael R. Elkins 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 17 | * 18 | */ 19 | 20 | #include "enter.h" 21 | 22 | int LastKey; 23 | 24 | int km_dokey (int n) 25 | { 26 | switch (LastKey = getch ()) 27 | { 28 | case KEY_LEFT: 29 | case '\002': 30 | return OP_EDITOR_BACKWARD_CHAR; 31 | case KEY_RIGHT: 32 | case '\006': 33 | return OP_EDITOR_FORWARD_CHAR; 34 | case '\010': 35 | case KEY_BACKSPACE: 36 | return OP_EDITOR_BACKSPACE; 37 | case '\004': 38 | case KEY_DC: 39 | case 127: 40 | return OP_EDITOR_DELETE_CHAR; 41 | case '\001': 42 | return OP_EDITOR_BOL; 43 | case '\005': 44 | return OP_EDITOR_EOL; 45 | case '\025': 46 | return OP_EDITOR_KILL_LINE; 47 | case '\013': 48 | return OP_EDITOR_KILL_EOL; 49 | case '\027': 50 | return OP_EDITOR_KILL_WORD; 51 | case '\007': 52 | case -1: 53 | return (-1); 54 | } 55 | return (0); 56 | } 57 | -------------------------------------------------------------------------------- /enter.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1996,1997 Michael R. Elkins 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 17 | */ 18 | 19 | #include "enter.h" 20 | 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | 30 | #ifndef URLVIEW 31 | 32 | /* global vars used for the string-history routines */ 33 | static char **Hist = NULL; 34 | static short HistCur = 0; 35 | static short HistLast = 0; 36 | 37 | void mutt_init_history (void) 38 | { 39 | int i; 40 | static int OldSize = 0; 41 | 42 | if (Hist) 43 | { 44 | for (i = 0 ; i < OldSize ; i ++) 45 | safe_free ((void **) &Hist[i]); 46 | safe_free ((void **) &Hist); 47 | } 48 | 49 | if (HistSize) 50 | Hist = safe_calloc (HistSize, sizeof (char *)); 51 | HistCur = 0; 52 | HistLast = 0; 53 | OldSize = HistSize; 54 | } 55 | 56 | static void sh_add (char *s) 57 | { 58 | int prev; 59 | 60 | if (!HistSize) 61 | return; /* disabled */ 62 | 63 | if (*s) 64 | { 65 | prev = HistLast - 1; 66 | if (prev < 0) prev = HistSize - 1; 67 | if (!Hist[prev] || strcmp (Hist[prev], s) != 0) 68 | { 69 | safe_free ((void **) &Hist[HistLast]); 70 | Hist[HistLast++] = safe_strdup (s); 71 | if (HistLast > HistSize - 1) 72 | HistLast = 0; 73 | } 74 | } 75 | HistCur = HistLast; /* reset to the last entry */ 76 | } 77 | 78 | static char *sh_next (void) 79 | { 80 | int next; 81 | 82 | if (!HistSize) 83 | return (""); /* disabled */ 84 | 85 | next = HistCur + 1; 86 | if (next > HistLast - 1) 87 | next = 0; 88 | if (Hist[next]) 89 | HistCur = next; 90 | return (Hist[HistCur] ? Hist[HistCur] : ""); 91 | } 92 | 93 | static char *sh_prev (void) 94 | { 95 | int prev; 96 | 97 | if (!HistSize) 98 | return (""); /* disabled */ 99 | 100 | prev = HistCur - 1; 101 | if (prev < 0) 102 | { 103 | prev = HistLast - 1; 104 | if (prev < 0) 105 | { 106 | prev = HistSize - 1; 107 | while (prev > 0 && Hist[prev] == NULL) 108 | prev--; 109 | } 110 | } 111 | if (Hist[prev]) 112 | HistCur = prev; 113 | return (Hist[HistCur] ? Hist[HistCur] : ""); 114 | } 115 | #endif /* ! URLVIEW */ 116 | 117 | /* redraw flags for mutt_enter_string() */ 118 | enum 119 | { 120 | M_REDRAW_INIT = 1, /* recalculate lengths */ 121 | M_REDRAW_LINE, /* redraw entire line */ 122 | M_REDRAW_EOL, /* redraw from current position to eol */ 123 | M_REDRAW_PREV_EOL /* redraw from curpos-1 to eol */ 124 | }; 125 | 126 | /* Returns: 127 | * 1 need to redraw the screen and call me again 128 | * 0 if input was given 129 | * -1 if abort. 130 | * 131 | */ 132 | int mutt_enter_string (unsigned char *buf, size_t buflen, int y, int x, 133 | int flags) 134 | { 135 | int curpos = 0; /* the location of the cursor */ 136 | int lastchar = 0; /* offset of the last char in the string */ 137 | int begin = 0; /* first character displayed on the line */ 138 | int ch; /* last typed character */ 139 | int width = COLS - x - 1; /* width of field */ 140 | int redraw = M_REDRAW_INIT; /* when/what to redraw */ 141 | int pass = (flags == M_PASS); 142 | int j; 143 | 144 | FOREVER 145 | { 146 | if (redraw) 147 | { 148 | if (redraw == M_REDRAW_INIT) 149 | { 150 | /* full redraw */ 151 | lastchar = curpos = strlen ((char *) buf); 152 | begin = lastchar - width; 153 | } 154 | if (begin < 0) 155 | begin = 0; 156 | switch (redraw) 157 | { 158 | case M_REDRAW_PREV_EOL: 159 | j = curpos - 1; 160 | break; 161 | case M_REDRAW_EOL: 162 | j = curpos; 163 | break; 164 | default: 165 | j = begin; 166 | } 167 | move (y, x + j - begin); 168 | for (; j < lastchar && j < begin + width; j++) 169 | addch (buf[j]); 170 | clrtoeol (); 171 | if (redraw != M_REDRAW_INIT) 172 | move (y, x + curpos - begin); 173 | redraw = 0; 174 | } 175 | refresh (); 176 | 177 | /* first look to see if a keypress is an editor operation. km_dokey() 178 | * returns 0 if there is no entry in the keymap, so restore the last 179 | * keypress and continue normally. 180 | */ 181 | if ((ch = km_dokey (MENU_EDITOR)) == -1) 182 | { 183 | buf[curpos] = 0; 184 | return (-1); 185 | } 186 | 187 | if (ch != 0) 188 | { 189 | switch (ch) 190 | { 191 | case OP_EDITOR_BACKSPACE: 192 | if (curpos == 0) 193 | { 194 | BEEP (); 195 | break; 196 | } 197 | for (j = curpos ; j < lastchar ; j++) 198 | buf[j - 1] = buf[j]; 199 | curpos--; 200 | lastchar--; 201 | if (!pass) 202 | { 203 | if (curpos > begin) 204 | { 205 | if (lastchar == curpos) 206 | { 207 | move (y, x + curpos - begin); 208 | delch (); 209 | } 210 | else 211 | redraw = M_REDRAW_EOL; 212 | } 213 | else 214 | { 215 | begin -= width / 2; 216 | redraw = M_REDRAW_LINE; 217 | } 218 | } 219 | break; 220 | case OP_EDITOR_BOL: 221 | /* reposition the cursor at the begininning of the line */ 222 | curpos = 0; 223 | if (!pass) 224 | { 225 | if (begin) 226 | { 227 | /* the first char is not displayed, so readjust */ 228 | begin = 0; 229 | redraw = M_REDRAW_LINE; 230 | } 231 | else 232 | move (y, x); 233 | } 234 | break; 235 | case OP_EDITOR_EOL: 236 | curpos = lastchar; 237 | if (!pass) 238 | { 239 | if (lastchar < begin + width) 240 | move (y, x + lastchar - begin); 241 | else 242 | { 243 | begin = lastchar - width / 2; 244 | redraw = M_REDRAW_LINE; 245 | } 246 | } 247 | break; 248 | case OP_EDITOR_KILL_LINE: 249 | lastchar = curpos = 0; 250 | if (!pass) 251 | { 252 | begin = 0; 253 | redraw = M_REDRAW_LINE; 254 | } 255 | break; 256 | case OP_EDITOR_KILL_EOL: 257 | lastchar = curpos; 258 | if (!pass) 259 | clrtoeol (); 260 | break; 261 | case OP_EDITOR_BACKWARD_CHAR: 262 | if (curpos == 0) 263 | { 264 | BEEP (); 265 | } 266 | else 267 | { 268 | curpos--; 269 | if (!pass) 270 | { 271 | if (curpos < begin) 272 | { 273 | begin -= width / 2; 274 | redraw = M_REDRAW_LINE; 275 | } 276 | else 277 | move (y, x + curpos - begin); 278 | } 279 | } 280 | break; 281 | case OP_EDITOR_FORWARD_CHAR: 282 | if (curpos == lastchar) 283 | { 284 | BEEP (); 285 | } 286 | else 287 | { 288 | curpos++; 289 | if (!pass) 290 | { 291 | if (curpos >= begin + width) 292 | { 293 | begin = curpos - width / 2; 294 | redraw = M_REDRAW_LINE; 295 | } 296 | else 297 | move (y, x + curpos - begin); 298 | } 299 | } 300 | break; 301 | case OP_EDITOR_DELETE_CHAR: 302 | if (curpos != lastchar) 303 | { 304 | for (j = curpos; j < lastchar; j++) 305 | buf[j] = buf[j + 1]; 306 | lastchar--; 307 | if (!pass) 308 | redraw = M_REDRAW_EOL; 309 | } 310 | else 311 | BEEP (); 312 | break; 313 | case OP_EDITOR_KILL_WORD: 314 | /* delete to begining of word */ 315 | if (curpos != 0) 316 | { 317 | j = curpos; 318 | while (j > 0 && ISSPACE (buf[j - 1])) 319 | j--; 320 | if (j > 0) 321 | { 322 | if (isalnum (buf[j - 1])) 323 | { 324 | for (j--; j > 0 && isalnum (buf[j - 1]); j--) 325 | ; 326 | } 327 | else 328 | j--; 329 | } 330 | ch = j; /* save current position */ 331 | while (curpos < lastchar) 332 | buf[j++] = buf[curpos++]; 333 | lastchar = j; 334 | curpos = ch; /* restore current position */ 335 | /* update screen */ 336 | if (!pass) 337 | { 338 | if (curpos < begin) 339 | { 340 | begin = curpos - width / 2; 341 | redraw = M_REDRAW_LINE; 342 | } 343 | else 344 | redraw = M_REDRAW_EOL; 345 | } 346 | } 347 | break; 348 | default: 349 | BEEP (); 350 | } 351 | } 352 | else 353 | { 354 | /* use the raw keypress */ 355 | ch = LastKey; 356 | 357 | if (CI_is_return (ch)) 358 | { 359 | buf[lastchar] = 0; 360 | return (0); 361 | } 362 | else if (IsPrint (ch) && ((size_t)(lastchar + 1) < buflen)) 363 | { 364 | for (j = lastchar; j > curpos; j--) 365 | buf[j] = buf[j - 1]; 366 | buf[curpos++] = ch; 367 | lastchar++; 368 | 369 | if (!pass) 370 | { 371 | if (curpos >= begin + width) 372 | { 373 | begin = curpos - width / 2; 374 | redraw = M_REDRAW_LINE; 375 | } 376 | else if (curpos == lastchar) 377 | addch (ch); 378 | else 379 | redraw = M_REDRAW_PREV_EOL; 380 | } 381 | } 382 | else 383 | { 384 | mutt_flushinp (); 385 | BEEP (); 386 | } 387 | } 388 | } 389 | /* not reached */ 390 | } 391 | -------------------------------------------------------------------------------- /enter.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1997 Michael R. Elkins 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 17 | * 18 | */ 19 | 20 | #ifdef USE_SLANG 21 | #include 22 | #define KEY_DC SL_KEY_DELETE 23 | #else 24 | #ifdef HAVE_NCURSES_H 25 | #include 26 | #else 27 | #include 28 | #endif 29 | #endif /* USE_SLANG */ 30 | 31 | #define mutt_flushinp flushinp 32 | #define BEEP beep 33 | #define M_PASS 1 34 | #define FOREVER for(;;) 35 | #define MENU_EDITOR 0 36 | #define ISSPACE isspace 37 | #define CI_is_return(x) (x == '\n' || x == '\r') 38 | #define IsPrint isprint 39 | 40 | enum 41 | { 42 | OP_EDITOR_BACKSPACE = 1, 43 | OP_EDITOR_BOL, 44 | OP_EDITOR_EOL, 45 | OP_EDITOR_KILL_LINE, 46 | OP_EDITOR_KILL_EOL, 47 | OP_EDITOR_BACKWARD_CHAR, 48 | OP_EDITOR_FORWARD_CHAR, 49 | OP_EDITOR_DELETE_CHAR, 50 | OP_EDITOR_KILL_WORD, 51 | }; 52 | 53 | extern int LastKey; 54 | extern int km_dokey (int); 55 | 56 | #include 57 | -------------------------------------------------------------------------------- /install-sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # 3 | # install - install a program, script, or datafile 4 | # This comes from X11R5 (mit/util/scripts/install.sh). 5 | # 6 | # Copyright 1991 by the Massachusetts Institute of Technology 7 | # 8 | # Permission to use, copy, modify, distribute, and sell this software and its 9 | # documentation for any purpose is hereby granted without fee, provided that 10 | # the above copyright notice appear in all copies and that both that 11 | # copyright notice and this permission notice appear in supporting 12 | # documentation, and that the name of M.I.T. not be used in advertising or 13 | # publicity pertaining to distribution of the software without specific, 14 | # written prior permission. M.I.T. makes no representations about the 15 | # suitability of this software for any purpose. It is provided "as is" 16 | # without express or implied warranty. 17 | # 18 | # Calling this script install-sh is preferred over install.sh, to prevent 19 | # `make' implicit rules from creating a file called install from it 20 | # when there is no Makefile. 21 | # 22 | # This script is compatible with the BSD install script, but was written 23 | # from scratch. It can only install one file at a time, a restriction 24 | # shared with many OS's install programs. 25 | 26 | 27 | # set DOITPROG to echo to test this script 28 | 29 | # Don't use :- since 4.3BSD and earlier shells don't like it. 30 | doit="${DOITPROG-}" 31 | 32 | 33 | # put in absolute paths if you don't have them in your path; or use env. vars. 34 | 35 | mvprog="${MVPROG-mv}" 36 | cpprog="${CPPROG-cp}" 37 | chmodprog="${CHMODPROG-chmod}" 38 | chownprog="${CHOWNPROG-chown}" 39 | chgrpprog="${CHGRPPROG-chgrp}" 40 | stripprog="${STRIPPROG-strip}" 41 | rmprog="${RMPROG-rm}" 42 | mkdirprog="${MKDIRPROG-mkdir}" 43 | 44 | transformbasename="" 45 | transform_arg="" 46 | instcmd="$mvprog" 47 | chmodcmd="$chmodprog 0755" 48 | chowncmd="" 49 | chgrpcmd="" 50 | stripcmd="" 51 | rmcmd="$rmprog -f" 52 | mvcmd="$mvprog" 53 | src="" 54 | dst="" 55 | dir_arg="" 56 | 57 | while [ x"$1" != x ]; do 58 | case $1 in 59 | -c) instcmd="$cpprog" 60 | shift 61 | continue;; 62 | 63 | -d) dir_arg=true 64 | shift 65 | continue;; 66 | 67 | -m) chmodcmd="$chmodprog $2" 68 | shift 69 | shift 70 | continue;; 71 | 72 | -o) chowncmd="$chownprog $2" 73 | shift 74 | shift 75 | continue;; 76 | 77 | -g) chgrpcmd="$chgrpprog $2" 78 | shift 79 | shift 80 | continue;; 81 | 82 | -s) stripcmd="$stripprog" 83 | shift 84 | continue;; 85 | 86 | -t=*) transformarg=`echo $1 | sed 's/-t=//'` 87 | shift 88 | continue;; 89 | 90 | -b=*) transformbasename=`echo $1 | sed 's/-b=//'` 91 | shift 92 | continue;; 93 | 94 | *) if [ x"$src" = x ] 95 | then 96 | src=$1 97 | else 98 | # this colon is to work around a 386BSD /bin/sh bug 99 | : 100 | dst=$1 101 | fi 102 | shift 103 | continue;; 104 | esac 105 | done 106 | 107 | if [ x"$src" = x ] 108 | then 109 | echo "install: no input file specified" 110 | exit 1 111 | else 112 | true 113 | fi 114 | 115 | if [ x"$dir_arg" != x ]; then 116 | dst=$src 117 | src="" 118 | 119 | if [ -d $dst ]; then 120 | instcmd=: 121 | else 122 | instcmd=mkdir 123 | fi 124 | else 125 | 126 | # Waiting for this to be detected by the "$instcmd $src $dsttmp" command 127 | # might cause directories to be created, which would be especially bad 128 | # if $src (and thus $dsttmp) contains '*'. 129 | 130 | if [ -f $src -o -d $src ] 131 | then 132 | true 133 | else 134 | echo "install: $src does not exist" 135 | exit 1 136 | fi 137 | 138 | if [ x"$dst" = x ] 139 | then 140 | echo "install: no destination specified" 141 | exit 1 142 | else 143 | true 144 | fi 145 | 146 | # If destination is a directory, append the input filename; if your system 147 | # does not like double slashes in filenames, you may need to add some logic 148 | 149 | if [ -d $dst ] 150 | then 151 | dst="$dst"/`basename $src` 152 | else 153 | true 154 | fi 155 | fi 156 | 157 | ## this sed command emulates the dirname command 158 | dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` 159 | 160 | # Make sure that the destination directory exists. 161 | # this part is taken from Noah Friedman's mkinstalldirs script 162 | 163 | # Skip lots of stat calls in the usual case. 164 | if [ ! -d "$dstdir" ]; then 165 | defaultIFS=' 166 | ' 167 | IFS="${IFS-${defaultIFS}}" 168 | 169 | oIFS="${IFS}" 170 | # Some sh's can't handle IFS=/ for some reason. 171 | IFS='%' 172 | set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` 173 | IFS="${oIFS}" 174 | 175 | pathcomp='' 176 | 177 | while [ $# -ne 0 ] ; do 178 | pathcomp="${pathcomp}${1}" 179 | shift 180 | 181 | if [ ! -d "${pathcomp}" ] ; 182 | then 183 | $mkdirprog "${pathcomp}" 184 | else 185 | true 186 | fi 187 | 188 | pathcomp="${pathcomp}/" 189 | done 190 | fi 191 | 192 | if [ x"$dir_arg" != x ] 193 | then 194 | $doit $instcmd $dst && 195 | 196 | if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && 197 | if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && 198 | if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && 199 | if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi 200 | else 201 | 202 | # If we're going to rename the final executable, determine the name now. 203 | 204 | if [ x"$transformarg" = x ] 205 | then 206 | dstfile=`basename $dst` 207 | else 208 | dstfile=`basename $dst $transformbasename | 209 | sed $transformarg`$transformbasename 210 | fi 211 | 212 | # don't allow the sed command to completely eliminate the filename 213 | 214 | if [ x"$dstfile" = x ] 215 | then 216 | dstfile=`basename $dst` 217 | else 218 | true 219 | fi 220 | 221 | # Make a temp file name in the proper directory. 222 | 223 | dsttmp=$dstdir/#inst.$$# 224 | 225 | # Move or copy the file name to the temp name 226 | 227 | $doit $instcmd $src $dsttmp && 228 | 229 | trap "rm -f ${dsttmp}" 0 && 230 | 231 | # and set any options; do chmod last to preserve setuid bits 232 | 233 | # If any of these fail, we abort the whole thing. If we want to 234 | # ignore errors from any of these, just make sure not to ignore 235 | # errors from the above "$doit $instcmd $src $dsttmp" command. 236 | 237 | if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && 238 | if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && 239 | if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && 240 | if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && 241 | 242 | # Now rename the file to the real destination. 243 | 244 | $doit $rmcmd -f $dstdir/$dstfile && 245 | $doit $mvcmd $dsttmp $dstdir/$dstfile 246 | 247 | fi && 248 | 249 | 250 | exit 0 251 | -------------------------------------------------------------------------------- /missing: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # Common stub for a few missing GNU programs while installing. 3 | 4 | scriptversion=2012-01-06.13; # UTC 5 | 6 | # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, 7 | # 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. 8 | # Originally by Fran,cois Pinard , 1996. 9 | 10 | # This program is free software; you can redistribute it and/or modify 11 | # it under the terms of the GNU General Public License as published by 12 | # the Free Software Foundation; either version 2, or (at your option) 13 | # any later version. 14 | 15 | # This program is distributed in the hope that it will be useful, 16 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | # GNU General Public License for more details. 19 | 20 | # You should have received a copy of the GNU General Public License 21 | # along with this program. If not, see . 22 | 23 | # As a special exception to the GNU General Public License, if you 24 | # distribute this file as part of a program that contains a 25 | # configuration script generated by Autoconf, you may include it under 26 | # the same distribution terms that you use for the rest of that program. 27 | 28 | if test $# -eq 0; then 29 | echo 1>&2 "Try \`$0 --help' for more information" 30 | exit 1 31 | fi 32 | 33 | run=: 34 | sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' 35 | sed_minuso='s/.* -o \([^ ]*\).*/\1/p' 36 | 37 | # In the cases where this matters, `missing' is being run in the 38 | # srcdir already. 39 | if test -f configure.ac; then 40 | configure_ac=configure.ac 41 | else 42 | configure_ac=configure.in 43 | fi 44 | 45 | msg="missing on your system" 46 | 47 | case $1 in 48 | --run) 49 | # Try to run requested program, and just exit if it succeeds. 50 | run= 51 | shift 52 | "$@" && exit 0 53 | # Exit code 63 means version mismatch. This often happens 54 | # when the user try to use an ancient version of a tool on 55 | # a file that requires a minimum version. In this case we 56 | # we should proceed has if the program had been absent, or 57 | # if --run hadn't been passed. 58 | if test $? = 63; then 59 | run=: 60 | msg="probably too old" 61 | fi 62 | ;; 63 | 64 | -h|--h|--he|--hel|--help) 65 | echo "\ 66 | $0 [OPTION]... PROGRAM [ARGUMENT]... 67 | 68 | Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an 69 | error status if there is no known handling for PROGRAM. 70 | 71 | Options: 72 | -h, --help display this help and exit 73 | -v, --version output version information and exit 74 | --run try to run the given command, and emulate it if it fails 75 | 76 | Supported PROGRAM values: 77 | aclocal touch file \`aclocal.m4' 78 | autoconf touch file \`configure' 79 | autoheader touch file \`config.h.in' 80 | autom4te touch the output file, or create a stub one 81 | automake touch all \`Makefile.in' files 82 | bison create \`y.tab.[ch]', if possible, from existing .[ch] 83 | flex create \`lex.yy.c', if possible, from existing .c 84 | help2man touch the output file 85 | lex create \`lex.yy.c', if possible, from existing .c 86 | makeinfo touch the output file 87 | yacc create \`y.tab.[ch]', if possible, from existing .[ch] 88 | 89 | Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and 90 | \`g' are ignored when checking the name. 91 | 92 | Send bug reports to ." 93 | exit $? 94 | ;; 95 | 96 | -v|--v|--ve|--ver|--vers|--versi|--versio|--version) 97 | echo "missing $scriptversion (GNU Automake)" 98 | exit $? 99 | ;; 100 | 101 | -*) 102 | echo 1>&2 "$0: Unknown \`$1' option" 103 | echo 1>&2 "Try \`$0 --help' for more information" 104 | exit 1 105 | ;; 106 | 107 | esac 108 | 109 | # normalize program name to check for. 110 | program=`echo "$1" | sed ' 111 | s/^gnu-//; t 112 | s/^gnu//; t 113 | s/^g//; t'` 114 | 115 | # Now exit if we have it, but it failed. Also exit now if we 116 | # don't have it and --version was passed (most likely to detect 117 | # the program). This is about non-GNU programs, so use $1 not 118 | # $program. 119 | case $1 in 120 | lex*|yacc*) 121 | # Not GNU programs, they don't have --version. 122 | ;; 123 | 124 | *) 125 | if test -z "$run" && ($1 --version) > /dev/null 2>&1; then 126 | # We have it, but it failed. 127 | exit 1 128 | elif test "x$2" = "x--version" || test "x$2" = "x--help"; then 129 | # Could not run --version or --help. This is probably someone 130 | # running `$TOOL --version' or `$TOOL --help' to check whether 131 | # $TOOL exists and not knowing $TOOL uses missing. 132 | exit 1 133 | fi 134 | ;; 135 | esac 136 | 137 | # If it does not exist, or fails to run (possibly an outdated version), 138 | # try to emulate it. 139 | case $program in 140 | aclocal*) 141 | echo 1>&2 "\ 142 | WARNING: \`$1' is $msg. You should only need it if 143 | you modified \`acinclude.m4' or \`${configure_ac}'. You might want 144 | to install the \`Automake' and \`Perl' packages. Grab them from 145 | any GNU archive site." 146 | touch aclocal.m4 147 | ;; 148 | 149 | autoconf*) 150 | echo 1>&2 "\ 151 | WARNING: \`$1' is $msg. You should only need it if 152 | you modified \`${configure_ac}'. You might want to install the 153 | \`Autoconf' and \`GNU m4' packages. Grab them from any GNU 154 | archive site." 155 | touch configure 156 | ;; 157 | 158 | autoheader*) 159 | echo 1>&2 "\ 160 | WARNING: \`$1' is $msg. You should only need it if 161 | you modified \`acconfig.h' or \`${configure_ac}'. You might want 162 | to install the \`Autoconf' and \`GNU m4' packages. Grab them 163 | from any GNU archive site." 164 | files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` 165 | test -z "$files" && files="config.h" 166 | touch_files= 167 | for f in $files; do 168 | case $f in 169 | *:*) touch_files="$touch_files "`echo "$f" | 170 | sed -e 's/^[^:]*://' -e 's/:.*//'`;; 171 | *) touch_files="$touch_files $f.in";; 172 | esac 173 | done 174 | touch $touch_files 175 | ;; 176 | 177 | automake*) 178 | echo 1>&2 "\ 179 | WARNING: \`$1' is $msg. You should only need it if 180 | you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. 181 | You might want to install the \`Automake' and \`Perl' packages. 182 | Grab them from any GNU archive site." 183 | find . -type f -name Makefile.am -print | 184 | sed 's/\.am$/.in/' | 185 | while read f; do touch "$f"; done 186 | ;; 187 | 188 | autom4te*) 189 | echo 1>&2 "\ 190 | WARNING: \`$1' is needed, but is $msg. 191 | You might have modified some files without having the 192 | proper tools for further handling them. 193 | You can get \`$1' as part of \`Autoconf' from any GNU 194 | archive site." 195 | 196 | file=`echo "$*" | sed -n "$sed_output"` 197 | test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` 198 | if test -f "$file"; then 199 | touch $file 200 | else 201 | test -z "$file" || exec >$file 202 | echo "#! /bin/sh" 203 | echo "# Created by GNU Automake missing as a replacement of" 204 | echo "# $ $@" 205 | echo "exit 0" 206 | chmod +x $file 207 | exit 1 208 | fi 209 | ;; 210 | 211 | bison*|yacc*) 212 | echo 1>&2 "\ 213 | WARNING: \`$1' $msg. You should only need it if 214 | you modified a \`.y' file. You may need the \`Bison' package 215 | in order for those modifications to take effect. You can get 216 | \`Bison' from any GNU archive site." 217 | rm -f y.tab.c y.tab.h 218 | if test $# -ne 1; then 219 | eval LASTARG=\${$#} 220 | case $LASTARG in 221 | *.y) 222 | SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` 223 | if test -f "$SRCFILE"; then 224 | cp "$SRCFILE" y.tab.c 225 | fi 226 | SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` 227 | if test -f "$SRCFILE"; then 228 | cp "$SRCFILE" y.tab.h 229 | fi 230 | ;; 231 | esac 232 | fi 233 | if test ! -f y.tab.h; then 234 | echo >y.tab.h 235 | fi 236 | if test ! -f y.tab.c; then 237 | echo 'main() { return 0; }' >y.tab.c 238 | fi 239 | ;; 240 | 241 | lex*|flex*) 242 | echo 1>&2 "\ 243 | WARNING: \`$1' is $msg. You should only need it if 244 | you modified a \`.l' file. You may need the \`Flex' package 245 | in order for those modifications to take effect. You can get 246 | \`Flex' from any GNU archive site." 247 | rm -f lex.yy.c 248 | if test $# -ne 1; then 249 | eval LASTARG=\${$#} 250 | case $LASTARG in 251 | *.l) 252 | SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` 253 | if test -f "$SRCFILE"; then 254 | cp "$SRCFILE" lex.yy.c 255 | fi 256 | ;; 257 | esac 258 | fi 259 | if test ! -f lex.yy.c; then 260 | echo 'main() { return 0; }' >lex.yy.c 261 | fi 262 | ;; 263 | 264 | help2man*) 265 | echo 1>&2 "\ 266 | WARNING: \`$1' is $msg. You should only need it if 267 | you modified a dependency of a manual page. You may need the 268 | \`Help2man' package in order for those modifications to take 269 | effect. You can get \`Help2man' from any GNU archive site." 270 | 271 | file=`echo "$*" | sed -n "$sed_output"` 272 | test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` 273 | if test -f "$file"; then 274 | touch $file 275 | else 276 | test -z "$file" || exec >$file 277 | echo ".ab help2man is required to generate this page" 278 | exit $? 279 | fi 280 | ;; 281 | 282 | makeinfo*) 283 | echo 1>&2 "\ 284 | WARNING: \`$1' is $msg. You should only need it if 285 | you modified a \`.texi' or \`.texinfo' file, or any other file 286 | indirectly affecting the aspect of the manual. The spurious 287 | call might also be the consequence of using a buggy \`make' (AIX, 288 | DU, IRIX). You might want to install the \`Texinfo' package or 289 | the \`GNU make' package. Grab either from any GNU archive site." 290 | # The file to touch is that specified with -o ... 291 | file=`echo "$*" | sed -n "$sed_output"` 292 | test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` 293 | if test -z "$file"; then 294 | # ... or it is the one specified with @setfilename ... 295 | infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` 296 | file=`sed -n ' 297 | /^@setfilename/{ 298 | s/.* \([^ ]*\) *$/\1/ 299 | p 300 | q 301 | }' $infile` 302 | # ... or it is derived from the source name (dir/f.texi becomes f.info) 303 | test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info 304 | fi 305 | # If the file does not exist, the user really needs makeinfo; 306 | # let's fail without touching anything. 307 | test -f $file || exit 1 308 | touch $file 309 | ;; 310 | 311 | *) 312 | echo 1>&2 "\ 313 | WARNING: \`$1' is needed, and is $msg. 314 | You might have modified some files without having the 315 | proper tools for further handling them. Check the \`README' file, 316 | it often tells you about the needed prerequisites for installing 317 | this package. You may also peek at any GNU archive site, in case 318 | some other package would contain this missing \`$1' program." 319 | exit 1 320 | ;; 321 | esac 322 | 323 | exit 0 324 | 325 | # Local variables: 326 | # eval: (add-hook 'write-file-hooks 'time-stamp) 327 | # time-stamp-start: "scriptversion=" 328 | # time-stamp-format: "%:y-%02m-%02d.%02H" 329 | # time-stamp-time-zone: "UTC" 330 | # time-stamp-end: "; # UTC" 331 | # End: 332 | -------------------------------------------------------------------------------- /mkinstalldirs: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # mkinstalldirs --- make directory hierarchy 3 | # Author: Noah Friedman 4 | # Created: 1993-05-16 5 | # Public domain 6 | 7 | # $Id: mkinstalldirs,v 1.1.1.1 2000/07/04 09:05:10 roessler Exp $ 8 | 9 | errstatus=0 10 | 11 | for file 12 | do 13 | set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` 14 | shift 15 | 16 | pathcomp= 17 | for d 18 | do 19 | pathcomp="$pathcomp$d" 20 | case "$pathcomp" in 21 | -* ) pathcomp=./$pathcomp ;; 22 | esac 23 | 24 | if test ! -d "$pathcomp"; then 25 | echo "mkdir $pathcomp" 1>&2 26 | 27 | mkdir "$pathcomp" || lasterr=$? 28 | 29 | if test ! -d "$pathcomp"; then 30 | errstatus=$lasterr 31 | fi 32 | fi 33 | 34 | pathcomp="$pathcomp/" 35 | done 36 | done 37 | 38 | exit $errstatus 39 | 40 | # mkinstalldirs ends here 41 | -------------------------------------------------------------------------------- /quote.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2000 Thomas Roessler 3 | * 4 | * This program is free software; you can redistribute it 5 | * and/or modify it under the terms of the GNU General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later 8 | * version. 9 | * 10 | * This program is distributed in the hope that it will be 11 | * useful, but WITHOUT ANY WARRANTY; without even the implied 12 | * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 13 | * PURPOSE. See the GNU General Public License for more 14 | * details. 15 | * 16 | * You should have received a copy of the GNU General Public 17 | * License along with this program; if not, write to the Free 18 | * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 19 | * 02139, USA. 20 | * 21 | */ 22 | 23 | 24 | #include 25 | 26 | #include "quote.h" 27 | 28 | 29 | /* 30 | * prepare a file name to survive the shell's quoting rules. 31 | * From the Unix programming FAQ by way of Liviu. 32 | */ 33 | 34 | char *quote (char *d, size_t l, const char *f) 35 | { 36 | size_t i, j = 0; 37 | 38 | if(!f) 39 | { 40 | *d = '\0'; 41 | return 0; 42 | } 43 | 44 | /* leave some space for the trailing characters. */ 45 | l -= 6; 46 | 47 | d[j++] = '\''; 48 | 49 | for(i = 0; j < l && f[i]; i++) 50 | { 51 | if(f[i] == '\'' || f[i] == '`') 52 | { 53 | d[j++] = '\''; 54 | d[j++] = '\\'; 55 | d[j++] = f[i]; 56 | d[j++] = '\''; 57 | } 58 | else 59 | d[j++] = f[i]; 60 | } 61 | 62 | d[j++] = '\''; 63 | d[j] = '\0'; 64 | 65 | return d; 66 | } 67 | -------------------------------------------------------------------------------- /quote.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2000 Thomas Roessler 3 | * 4 | * This program is free software; you can redistribute it 5 | * and/or modify it under the terms of the GNU General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later 8 | * version. 9 | * 10 | * This program is distributed in the hope that it will be 11 | * useful, but WITHOUT ANY WARRANTY; without even the implied 12 | * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 13 | * PURPOSE. See the GNU General Public License for more 14 | * details. 15 | * 16 | * You should have received a copy of the GNU General Public 17 | * License along with this program; if not, write to the Free 18 | * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 19 | * 02139, USA. 20 | * 21 | */ 22 | 23 | 24 | 25 | #ifndef _QUOTE_H 26 | # define _QUOTE_H 27 | 28 | char *quote (char *d, size_t l, const char *f); 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /sample.urlview: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Urlview configuration file. 3 | # man urlview 4 | # 5 | # Put this file in: $HOME/.urlview 6 | # Put url_handler.sh in: /usr/bin 7 | # 8 | # You can call 'urlview' while in 'mutt' by pressing the Ctrl b keys. 9 | # Put these macros in your $HOME/.muttrc file. 10 | # 11 | # macro index \cb |urlview\n 12 | # macro pager \cb |urlview\n 13 | # 14 | # You can call 'urlview' while in 'tin' by pressing | then a for article, 15 | # put urlview as the pipe command. 16 | # 17 | # Regular expression to use to match URLs. 18 | 19 | #REGEXP (((http|https|ftp|gopher)|mailto):(//)?[^ >"\t]*|www\.[-a-z0-9.]+)[^ .,;\t>">\):] 20 | REGEXP (((http|https|ftp|gopher)|mailto)[.:][^ >"\t]*|www\.[-a-z0-9.]+)[^ .,;\t>">\):] 21 | 22 | # Command to invoke for selected URL. Use lynx, netscape, or url_handler.sh 23 | # shell script. Alternatively, you can leave COMMAND unset and set the BROWSER 24 | # environment variable instead. 25 | 26 | #COMMAND lynx %s 27 | #COMMAND netscape -remote 'openURL(%s)' 28 | COMMAND url_handler.sh 29 | 30 | 31 | # Quit urlview after launch 32 | #QUITONLAUNCH 33 | -------------------------------------------------------------------------------- /snprintf.c: -------------------------------------------------------------------------------- 1 | #ifdef HAVE_CONFIG_H 2 | #include "config.h" 3 | #endif 4 | 5 | #ifndef HAVE_SNPRINTF 6 | 7 | #include 8 | #include 9 | 10 | /* Define this as a fall through, HAVE_STDARG_H is probably already set */ 11 | 12 | #ifndef HAVE_VARARGS_H 13 | # define HAVE_VARARGS_H 14 | #endif 15 | 16 | /************************************************************** 17 | * Original: 18 | * Patrick Powell Tue Apr 11 09:48:21 PDT 1995 19 | * A bombproof version of doprnt (dopr) included. 20 | * Sigh. This sort of thing is always nasty do deal with. Note that 21 | * the version here does not include floating point... 22 | * 23 | * snprintf() is used instead of sprintf() as it does limit checks 24 | * for string length. This covers a nasty loophole. 25 | * 26 | * The other functions are there to prevent NULL pointers from 27 | * causing nast effects. 28 | * 29 | * More Recently: 30 | * Brandon Long (blong@fiction.net) 9/15/96 for mutt 0.43 31 | * This was ugly. It is still ugly. I opted out of floating point 32 | * numbers, but the formatter understands just about everything 33 | * from the normal C string format, at least as far as I can tell from 34 | * the Solaris 2.5 printf(3S) man page. 35 | * 36 | * Brandon Long (blong@fiction.net) 10/22/97 for mutt 0.87.1 37 | * Ok, added some minimal floating point support, which means this 38 | * probably requires libm on most operating systems. Don't yet 39 | * support the exponent (e,E) and sigfig (g,G). Also, fmtint() 40 | * was pretty badly broken, it just wasn't being exercised in ways 41 | * which showed it, so that's been fixed. Also, formated the code 42 | * to mutt conventions, and removed dead code left over from the 43 | * original. Also, there is now a builtin-test, just compile with: 44 | * gcc -DTEST_SNPRINTF -o snprintf snprintf.c -lm 45 | * and run snprintf for results. 46 | * 47 | **************************************************************/ 48 | 49 | 50 | /* varargs declarations: */ 51 | 52 | #if defined(HAVE_STDARG_H) 53 | # include 54 | # define HAVE_STDARGS /* let's hope that works everywhere (mj) */ 55 | # define VA_LOCAL_DECL va_list ap 56 | # define VA_START(f) va_start(ap, f) 57 | # define VA_SHIFT(v,t) ; /* no-op for ANSI */ 58 | # define VA_END va_end(ap) 59 | #else 60 | # if defined(HAVE_VARARGS_H) 61 | # include 62 | # undef HAVE_STDARGS 63 | # define VA_LOCAL_DECL va_list ap 64 | # define VA_START(f) va_start(ap) /* f is ignored! */ 65 | # define VA_SHIFT(v,t) v = va_arg(ap,t) 66 | # define VA_END va_end(ap) 67 | # else 68 | /*XX ** NO VARARGS ** XX*/ 69 | # endif 70 | #endif 71 | 72 | int snprintf (char *str, size_t count, const char *fmt, ...); 73 | int vsnprintf (char *str, size_t count, const char *fmt, va_list arg); 74 | 75 | static void dopr (char *buffer, size_t maxlen, const char *format, 76 | va_list args); 77 | static void fmtstr (char *buffer, size_t *currlen, size_t maxlen, 78 | char *value, int flags, int min, int max); 79 | static void fmtint (char *buffer, size_t *currlen, size_t maxlen, 80 | long value, int base, int min, int max, int flags); 81 | static void fmtfp (char *buffer, size_t *currlen, size_t maxlen, 82 | long double fvalue, int min, int max, int flags); 83 | static void dopr_outch (char *buffer, size_t *currlen, size_t maxlen, char c ); 84 | 85 | int vsnprintf (char *str, size_t count, const char *fmt, va_list args) 86 | { 87 | str[0] = 0; 88 | dopr(str, count, fmt, args); 89 | return(strlen(str)); 90 | } 91 | 92 | /* VARARGS3 */ 93 | #ifdef HAVE_STDARGS 94 | int snprintf (char *str,size_t count,const char *fmt,...) 95 | #else 96 | int snprintf (va_alist) va_dcl 97 | #endif 98 | { 99 | #ifndef HAVE_STDARGS 100 | char *str; 101 | size_t count; 102 | char *fmt; 103 | #endif 104 | VA_LOCAL_DECL; 105 | 106 | VA_START (fmt); 107 | VA_SHIFT (str, char *); 108 | VA_SHIFT (count, size_t ); 109 | VA_SHIFT (fmt, char *); 110 | (void) vsnprintf(str, count, fmt, ap); 111 | VA_END; 112 | return(strlen(str)); 113 | } 114 | 115 | /* 116 | * dopr(): poor man's version of doprintf 117 | */ 118 | 119 | /* format read states */ 120 | #define DP_S_DEFAULT 0 121 | #define DP_S_FLAGS 1 122 | #define DP_S_MIN 2 123 | #define DP_S_DOT 3 124 | #define DP_S_MAX 4 125 | #define DP_S_MOD 5 126 | #define DP_S_CONV 6 127 | #define DP_S_DONE 7 128 | 129 | /* format flags - Bits */ 130 | #define DP_F_MINUS 1 131 | #define DP_F_PLUS 2 132 | #define DP_F_SPACE 4 133 | #define DP_F_NUM 8 134 | #define DP_F_ZERO 16 135 | #define DP_F_UP 32 136 | 137 | /* Conversion Flags */ 138 | #define DP_C_SHORT 1 139 | #define DP_C_LONG 2 140 | #define DP_C_LDOUBLE 3 141 | 142 | #define char_to_int(p) (p - '0') 143 | #define MAX(p,q) ((p >= q) ? p : q) 144 | 145 | static void dopr (char *buffer, size_t maxlen, const char *format, va_list args) 146 | { 147 | char ch; 148 | long value; 149 | long double fvalue; 150 | char *strvalue; 151 | int min; 152 | int max; 153 | int state; 154 | int flags; 155 | int cflags; 156 | size_t currlen; 157 | 158 | state = DP_S_DEFAULT; 159 | currlen = flags = cflags = min = 0; 160 | max = -1; 161 | ch = *format++; 162 | 163 | while (state != DP_S_DONE) 164 | { 165 | if ((ch == '\0') || (currlen >= maxlen)) 166 | state = DP_S_DONE; 167 | 168 | switch(state) 169 | { 170 | case DP_S_DEFAULT: 171 | if (ch == '%') 172 | state = DP_S_FLAGS; 173 | else 174 | dopr_outch (buffer, &currlen, maxlen, ch); 175 | ch = *format++; 176 | break; 177 | case DP_S_FLAGS: 178 | switch (ch) 179 | { 180 | case '-': 181 | flags |= DP_F_MINUS; 182 | ch = *format++; 183 | break; 184 | case '+': 185 | flags |= DP_F_PLUS; 186 | ch = *format++; 187 | break; 188 | case ' ': 189 | flags |= DP_F_SPACE; 190 | ch = *format++; 191 | break; 192 | case '#': 193 | flags |= DP_F_NUM; 194 | ch = *format++; 195 | break; 196 | case '0': 197 | flags |= DP_F_ZERO; 198 | ch = *format++; 199 | break; 200 | default: 201 | state = DP_S_MIN; 202 | break; 203 | } 204 | break; 205 | case DP_S_MIN: 206 | if (isdigit(ch)) 207 | { 208 | min = 10*min + char_to_int (ch); 209 | ch = *format++; 210 | } 211 | else if (ch == '*') 212 | { 213 | min = va_arg (args, int); 214 | ch = *format++; 215 | state = DP_S_DOT; 216 | } 217 | else 218 | state = DP_S_DOT; 219 | break; 220 | case DP_S_DOT: 221 | if (ch == '.') 222 | { 223 | state = DP_S_MAX; 224 | ch = *format++; 225 | } 226 | else 227 | state = DP_S_MOD; 228 | break; 229 | case DP_S_MAX: 230 | if (isdigit(ch)) 231 | { 232 | if (max < 0) 233 | max = 0; 234 | max = 10*max + char_to_int (ch); 235 | ch = *format++; 236 | } 237 | else if (ch == '*') 238 | { 239 | max = va_arg (args, int); 240 | ch = *format++; 241 | state = DP_S_MOD; 242 | } 243 | else 244 | state = DP_S_MOD; 245 | break; 246 | case DP_S_MOD: 247 | /* Currently, we don't support Long Long, bummer */ 248 | switch (ch) 249 | { 250 | case 'h': 251 | cflags = DP_C_SHORT; 252 | ch = *format++; 253 | break; 254 | case 'l': 255 | cflags = DP_C_LONG; 256 | ch = *format++; 257 | break; 258 | case 'L': 259 | cflags = DP_C_LDOUBLE; 260 | ch = *format++; 261 | break; 262 | default: 263 | break; 264 | } 265 | state = DP_S_CONV; 266 | break; 267 | case DP_S_CONV: 268 | switch (ch) 269 | { 270 | case 'd': 271 | case 'i': 272 | if (cflags == DP_C_SHORT) 273 | value = va_arg (args, short int); 274 | else if (cflags == DP_C_LONG) 275 | value = va_arg (args, long int); 276 | else 277 | value = va_arg (args, int); 278 | fmtint (buffer, &currlen, maxlen, value, 10, min, max, flags); 279 | break; 280 | case 'o': 281 | flags &= ~DP_F_PLUS; 282 | if (cflags == DP_C_SHORT) 283 | value = va_arg (args, unsigned short int); 284 | else if (cflags == DP_C_LONG) 285 | value = va_arg (args, unsigned long int); 286 | else 287 | value = va_arg (args, unsigned int); 288 | fmtint (buffer, &currlen, maxlen, value, 8, min, max, flags); 289 | break; 290 | case 'u': 291 | flags &= ~DP_F_PLUS; 292 | if (cflags == DP_C_SHORT) 293 | value = va_arg (args, unsigned short int); 294 | else if (cflags == DP_C_LONG) 295 | value = va_arg (args, unsigned long int); 296 | else 297 | value = va_arg (args, unsigned int); 298 | fmtint (buffer, &currlen, maxlen, value, 10, min, max, flags); 299 | break; 300 | case 'X': 301 | flags |= DP_F_UP; 302 | case 'x': 303 | flags &= ~DP_F_PLUS; 304 | if (cflags == DP_C_SHORT) 305 | value = va_arg (args, unsigned short int); 306 | else if (cflags == DP_C_LONG) 307 | value = va_arg (args, unsigned long int); 308 | else 309 | value = va_arg (args, unsigned int); 310 | fmtint (buffer, &currlen, maxlen, value, 16, min, max, flags); 311 | break; 312 | case 'f': 313 | if (cflags == DP_C_LDOUBLE) 314 | fvalue = va_arg (args, long double); 315 | else 316 | fvalue = va_arg (args, double); 317 | /* um, floating point? */ 318 | fmtfp (buffer, &currlen, maxlen, fvalue, min, max, flags); 319 | break; 320 | case 'E': 321 | flags |= DP_F_UP; 322 | case 'e': 323 | if (cflags == DP_C_LDOUBLE) 324 | fvalue = va_arg (args, long double); 325 | else 326 | fvalue = va_arg (args, double); 327 | break; 328 | case 'G': 329 | flags |= DP_F_UP; 330 | case 'g': 331 | if (cflags == DP_C_LDOUBLE) 332 | fvalue = va_arg (args, long double); 333 | else 334 | fvalue = va_arg (args, double); 335 | break; 336 | case 'c': 337 | dopr_outch (buffer, &currlen, maxlen, va_arg (args, int)); 338 | break; 339 | case 's': 340 | strvalue = va_arg (args, char *); 341 | if (max < 0) 342 | max = maxlen; /* ie, no max */ 343 | fmtstr (buffer, &currlen, maxlen, strvalue, flags, min, max); 344 | break; 345 | case 'p': 346 | strvalue = va_arg (args, void *); 347 | fmtint (buffer, &currlen, maxlen, (long) strvalue, 16, min, max, flags); 348 | break; 349 | case 'n': 350 | if (cflags == DP_C_SHORT) 351 | { 352 | short int *num; 353 | num = va_arg (args, short int *); 354 | *num = currlen; 355 | } 356 | else if (cflags == DP_C_LONG) 357 | { 358 | long int *num; 359 | num = va_arg (args, long int *); 360 | *num = currlen; 361 | } 362 | else 363 | { 364 | int *num; 365 | num = va_arg (args, int *); 366 | *num = currlen; 367 | } 368 | break; 369 | case '%': 370 | dopr_outch (buffer, &currlen, maxlen, ch); 371 | break; 372 | case 'w': 373 | /* not supported yet, treat as next char */ 374 | ch = *format++; 375 | break; 376 | default: 377 | /* Unknown, skip */ 378 | break; 379 | } 380 | ch = *format++; 381 | state = DP_S_DEFAULT; 382 | flags = cflags = min = 0; 383 | max = -1; 384 | break; 385 | case DP_S_DONE: 386 | break; 387 | default: 388 | /* hmm? */ 389 | break; /* some picky compilers need this */ 390 | } 391 | } 392 | if (currlen < maxlen - 1) 393 | buffer[currlen] = '\0'; 394 | else 395 | buffer[maxlen - 1] = '\0'; 396 | } 397 | 398 | static void fmtstr (char *buffer, size_t *currlen, size_t maxlen, 399 | char *value, int flags, int min, int max) 400 | { 401 | int padlen, strln; /* amount to pad */ 402 | int cnt = 0; 403 | 404 | if (value == 0) 405 | { 406 | value = ""; 407 | } 408 | 409 | for (strln = 0; value[strln]; ++strln); /* strlen */ 410 | padlen = min - strln; 411 | if (padlen < 0) 412 | padlen = 0; 413 | if (flags & DP_F_MINUS) 414 | padlen = -padlen; /* Left Justify */ 415 | 416 | while ((padlen > 0) && (cnt < max)) 417 | { 418 | dopr_outch (buffer, currlen, maxlen, ' '); 419 | --padlen; 420 | ++cnt; 421 | } 422 | while (*value && (cnt < max)) 423 | { 424 | dopr_outch (buffer, currlen, maxlen, *value++); 425 | ++cnt; 426 | } 427 | while ((padlen < 0) && (cnt < max)) 428 | { 429 | dopr_outch (buffer, currlen, maxlen, ' '); 430 | ++padlen; 431 | ++cnt; 432 | } 433 | } 434 | 435 | /* Have to handle DP_F_NUM (ie 0x and 0 alternates) */ 436 | 437 | static void fmtint (char *buffer, size_t *currlen, size_t maxlen, 438 | long value, int base, int min, int max, int flags) 439 | { 440 | int signvalue = 0; 441 | unsigned long uvalue; 442 | char convert[20]; 443 | int place = 0; 444 | int spadlen = 0; /* amount to space pad */ 445 | int zpadlen = 0; /* amount to zero pad */ 446 | int caps = 0; 447 | 448 | if (max < 0) 449 | max = 0; 450 | 451 | uvalue = value; 452 | if( value < 0 ) { 453 | signvalue = '-'; 454 | uvalue = -value; 455 | } 456 | else 457 | if (flags & DP_F_PLUS) /* Do a sign (+/i) */ 458 | signvalue = '+'; 459 | else 460 | if (flags & DP_F_SPACE) 461 | signvalue = ' '; 462 | 463 | if (flags & DP_F_UP) caps = 1; /* Should characters be upper case? */ 464 | 465 | do { 466 | convert[place++] = 467 | (caps? "0123456789ABCDEF":"0123456789abcdef") 468 | [uvalue % (unsigned)base ]; 469 | uvalue = (uvalue / (unsigned)base ); 470 | } while(uvalue && (place < 20)); 471 | if (place == 20) place--; 472 | convert[place] = 0; 473 | 474 | zpadlen = max - place; 475 | spadlen = min - MAX (max, place) - (signvalue ? 1 : 0); 476 | if (zpadlen < 0) zpadlen = 0; 477 | if (spadlen < 0) spadlen = 0; 478 | if (flags & DP_F_ZERO) 479 | { 480 | zpadlen = MAX(zpadlen, spadlen); 481 | spadlen = 0; 482 | } 483 | if (flags & DP_F_MINUS) 484 | spadlen = -spadlen; /* Left Justifty */ 485 | 486 | #ifdef DEBUG_SNPRINTF 487 | dprint (1, (debugfile, "zpad: %d, spad: %d, min: %d, max: %d, place: %d\n", 488 | zpadlen, spadlen, min, max, place)); 489 | #endif 490 | 491 | /* Spaces */ 492 | while (spadlen > 0) 493 | { 494 | dopr_outch (buffer, currlen, maxlen, ' '); 495 | --spadlen; 496 | } 497 | 498 | /* Sign */ 499 | if (signvalue) 500 | dopr_outch (buffer, currlen, maxlen, signvalue); 501 | 502 | /* Zeros */ 503 | if (zpadlen > 0) 504 | { 505 | while (zpadlen > 0) 506 | { 507 | dopr_outch (buffer, currlen, maxlen, '0'); 508 | --zpadlen; 509 | } 510 | } 511 | 512 | /* Digits */ 513 | while (place > 0) 514 | dopr_outch (buffer, currlen, maxlen, convert[--place]); 515 | 516 | /* Left Justified spaces */ 517 | while (spadlen < 0) { 518 | dopr_outch (buffer, currlen, maxlen, ' '); 519 | ++spadlen; 520 | } 521 | } 522 | 523 | static long double abs_val (long double value) 524 | { 525 | long double result = value; 526 | 527 | if (value < 0) 528 | result = -value; 529 | 530 | return result; 531 | } 532 | 533 | static long double pow10 (int exp) 534 | { 535 | long double result = 1; 536 | 537 | while (exp) 538 | { 539 | result *= 10; 540 | exp--; 541 | } 542 | 543 | return result; 544 | } 545 | 546 | static long round (long double value) 547 | { 548 | long intpart; 549 | 550 | intpart = value; 551 | value = value - intpart; 552 | if (value >= 0.5) 553 | intpart++; 554 | 555 | return intpart; 556 | } 557 | 558 | static void fmtfp (char *buffer, size_t *currlen, size_t maxlen, 559 | long double fvalue, int min, int max, int flags) 560 | { 561 | int signvalue = 0; 562 | long double ufvalue; 563 | char iconvert[20]; 564 | char fconvert[20]; 565 | int iplace = 0; 566 | int fplace = 0; 567 | int padlen = 0; /* amount to pad */ 568 | int zpadlen = 0; 569 | int caps = 0; 570 | long intpart; 571 | long fracpart; 572 | 573 | /* 574 | * AIX manpage says the default is 0, but Solaris says the default 575 | * is 6, and sprintf on AIX defaults to 6 576 | */ 577 | if (max < 0) 578 | max = 6; 579 | 580 | ufvalue = abs_val (fvalue); 581 | 582 | if (fvalue < 0) 583 | signvalue = '-'; 584 | else 585 | if (flags & DP_F_PLUS) /* Do a sign (+/i) */ 586 | signvalue = '+'; 587 | else 588 | if (flags & DP_F_SPACE) 589 | signvalue = ' '; 590 | 591 | #if 0 592 | if (flags & DP_F_UP) caps = 1; /* Should characters be upper case? */ 593 | #endif 594 | 595 | intpart = ufvalue; 596 | 597 | /* 598 | * Sorry, we only support 9 digits past the decimal because of our 599 | * conversion method 600 | */ 601 | if (max > 9) 602 | max = 9; 603 | 604 | /* We "cheat" by converting the fractional part to integer by 605 | * multiplying by a factor of 10 606 | */ 607 | fracpart = round ((pow10 (max)) * (ufvalue - intpart)); 608 | 609 | if (fracpart >= pow10 (max)) 610 | { 611 | intpart++; 612 | fracpart -= pow10 (max); 613 | } 614 | 615 | #ifdef DEBUG_SNPRINTF 616 | dprint (1, (debugfile, "fmtfp: %f =? %d.%d\n", fvalue, intpart, fracpart)); 617 | #endif 618 | 619 | /* Convert integer part */ 620 | do { 621 | iconvert[iplace++] = 622 | (caps? "0123456789ABCDEF":"0123456789abcdef")[intpart % 10]; 623 | intpart = (intpart / 10); 624 | } while(intpart && (iplace < 20)); 625 | if (iplace == 20) iplace--; 626 | iconvert[iplace] = 0; 627 | 628 | /* Convert fractional part */ 629 | do { 630 | fconvert[fplace++] = 631 | (caps? "0123456789ABCDEF":"0123456789abcdef")[fracpart % 10]; 632 | fracpart = (fracpart / 10); 633 | } while(fracpart && (fplace < 20)); 634 | if (fplace == 20) fplace--; 635 | fconvert[fplace] = 0; 636 | 637 | /* -1 for decimal point, another -1 if we are printing a sign */ 638 | padlen = min - iplace - max - 1 - ((signvalue) ? 1 : 0); 639 | zpadlen = max - fplace; 640 | if (zpadlen < 0) 641 | zpadlen = 0; 642 | if (padlen < 0) 643 | padlen = 0; 644 | if (flags & DP_F_MINUS) 645 | padlen = -padlen; /* Left Justifty */ 646 | 647 | if ((flags & DP_F_ZERO) && (padlen > 0)) 648 | { 649 | if (signvalue) 650 | { 651 | dopr_outch (buffer, currlen, maxlen, signvalue); 652 | --padlen; 653 | signvalue = 0; 654 | } 655 | while (padlen > 0) 656 | { 657 | dopr_outch (buffer, currlen, maxlen, '0'); 658 | --padlen; 659 | } 660 | } 661 | while (padlen > 0) 662 | { 663 | dopr_outch (buffer, currlen, maxlen, ' '); 664 | --padlen; 665 | } 666 | if (signvalue) 667 | dopr_outch (buffer, currlen, maxlen, signvalue); 668 | 669 | while (iplace > 0) 670 | dopr_outch (buffer, currlen, maxlen, iconvert[--iplace]); 671 | 672 | /* 673 | * Decimal point. This should probably use locale to find the correct 674 | * char to print out. 675 | */ 676 | dopr_outch (buffer, currlen, maxlen, '.'); 677 | 678 | while (fplace > 0) 679 | dopr_outch (buffer, currlen, maxlen, fconvert[--fplace]); 680 | 681 | while (zpadlen > 0) 682 | { 683 | dopr_outch (buffer, currlen, maxlen, '0'); 684 | --zpadlen; 685 | } 686 | 687 | while (padlen < 0) 688 | { 689 | dopr_outch (buffer, currlen, maxlen, ' '); 690 | ++padlen; 691 | } 692 | } 693 | 694 | static void dopr_outch (char *buffer, size_t *currlen, size_t maxlen, char c) 695 | { 696 | if (*currlen < maxlen) 697 | buffer[(*currlen)++] = c; 698 | } 699 | 700 | #ifdef TEST_SNPRINTF 701 | #ifndef LONG_STRING 702 | #define LONG_STRING 1024 703 | #endif 704 | int main (void) 705 | { 706 | char buf1[LONG_STRING]; 707 | char buf2[LONG_STRING]; 708 | char *fp_fmt[] = { 709 | "%-1.5f", 710 | "%1.5f", 711 | "%123.9f", 712 | "%10.5f", 713 | "% 10.5f", 714 | "%+22.9f", 715 | "%+4.9f", 716 | "%01.3f", 717 | "%4f", 718 | "%3.1f", 719 | "%3.2f", 720 | NULL 721 | }; 722 | double fp_nums[] = { -1.5, 134.21, 91340.2, 341.1234, 0203.9, 0.96, 0.996, 723 | 0.9996, 1.996, 4.136, 0}; 724 | char *int_fmt[] = { 725 | "%-1.5d", 726 | "%1.5d", 727 | "%123.9d", 728 | "%5.5d", 729 | "%10.5d", 730 | "% 10.5d", 731 | "%+22.33d", 732 | "%01.3d", 733 | "%4d", 734 | NULL 735 | }; 736 | long int_nums[] = { -1, 134, 91340, 341, 0203, 0}; 737 | int x, y; 738 | int fail = 0; 739 | int num = 0; 740 | 741 | printf ("Testing snprintf format codes against system sprintf...\n"); 742 | 743 | for (x = 0; fp_fmt[x] != NULL ; x++) 744 | for (y = 0; fp_nums[y] != 0 ; y++) 745 | { 746 | snprintf (buf1, sizeof (buf1), fp_fmt[x], fp_nums[y]); 747 | sprintf (buf2, fp_fmt[x], fp_nums[y]); 748 | if (strcmp (buf1, buf2)) 749 | { 750 | printf("snprintf doesn't match Format: %s\n\tsnprintf = %s\n\tsprintf = %s\n", 751 | fp_fmt[x], buf1, buf2); 752 | fail++; 753 | } 754 | num++; 755 | } 756 | 757 | for (x = 0; int_fmt[x] != NULL ; x++) 758 | for (y = 0; int_nums[y] != 0 ; y++) 759 | { 760 | snprintf (buf1, sizeof (buf1), int_fmt[x], int_nums[y]); 761 | sprintf (buf2, int_fmt[x], int_nums[y]); 762 | if (strcmp (buf1, buf2)) 763 | { 764 | printf("snprintf doesn't match Format: %s\n\tsnprintf = %s\n\tsprintf = %s\n", 765 | int_fmt[x], buf1, buf2); 766 | fail++; 767 | } 768 | num++; 769 | } 770 | printf ("%d tests failed out of %d.\n", fail, num); 771 | } 772 | #endif /* SNPRINTF_TEST */ 773 | 774 | #endif /* !HAVE_SNPRINTF */ 775 | -------------------------------------------------------------------------------- /text: -------------------------------------------------------------------------------- 1 | This is a test message which contains some examples of URLs commonly found 2 | in email messages. 3 | 4 | X-Url: http://www.cs.hmc.edu/~me 5 | 6 | Harvey Mudd College Home Page 7 | 8 | Harvey Mudd College Home Page 9 | 10 | mailto:me@cs.hmc.edu some other random text 11 | 12 | Please see the Mutt Home Page at http://www.cs.hmc.edu/~me/mutt, or 13 | its mirror site http://www.mutt.org. 14 | 15 | Sometimes we also see things like www.gnustep.org, or 16 | www.windowmaker.org/features.html all by itself with no http or ftp. 17 | 18 | www.m-w.com is a good internet dictionary. 19 | 20 | Also "strange" urls like www3.google.com are now supported. 21 | 22 | ftp://ftp.fooboo.com 23 | Ftp urls without protocol, like ftp.debian.org, are recognized. 24 | 25 | ftp.us.debian.org/debian/pool/main/u/urlview/urlview_0.9-6_i386.deb 26 | 27 | Since urlview-0.9-11 we are also able to manage correctly RFC 2368 urls 28 | (mailto URL scheme). For instance: 29 | 30 | -------------------------------------------------------------------------------- /url_handler.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | # Copyright (c) 1998 Martin Schulze 4 | # Slightly modified by Luis Francisco Gonzalez 5 | 6 | # This program is free software; you can redistribute it and/or modify 7 | # it under the terms of the GNU General Public License as published by 8 | # the Free Software Foundation; either version 2 of the License, or 9 | # (at your option) any later version. 10 | 11 | # This program is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | 16 | # You should have received a copy of the GNU General Public License 17 | # along with this program; if not, write to the Free Software 18 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 19 | 20 | ########################################################################### 21 | # Configurable section 22 | ########################################################################### 23 | # 24 | # Any entry in the lists of programs that urlview handler will try out will 25 | # be made of /path/to/program + ':' + TAG where TAG is one of 26 | # XW: XWindows program 27 | # XT: Launch with an xterm if possible or as VT if not 28 | # VT: Launch in the same terminal 29 | 30 | # The lists of programs to be executed are 31 | https_prgs="/usr/X11R6/bin/netscape:XW /usr/bin/lynx:XT" 32 | http_prgs="/usr/bin/lynx:XT /usr/X11R6/bin/netscape:XW" 33 | mailto_prgs="/usr/bin/mutt:VT /usr/bin/elm:VT /usr/bin/pine:VT /usr/bin/mail:VT" 34 | gopher_prgs="/usr/bin/lynx:XT /usr/bin/gopher:XT" 35 | ftp_prgs="/usr/bin/lynx:XT /usr/bin/ncftp:XT" 36 | 37 | # Program used as an xterm (if it doesn't support -T you'll need to change 38 | # the command line in getprg) 39 | XTERM=/usr/X11R6/bin/xterm 40 | 41 | 42 | ########################################################################### 43 | # Change bellow this at your own risk 44 | ########################################################################### 45 | function getprg() 46 | { 47 | local ele tag prog 48 | 49 | for ele in $* 50 | do 51 | tag=${ele##*:} 52 | prog=${ele%%:*} 53 | if [ -x $prog ]; then 54 | case $tag in 55 | XW) 56 | [ -n "$DISPLAY" ] && echo "X:$prog" && return 0 57 | ;; 58 | XT) 59 | [ -n "$DISPLAY" ] && [ -x "$XTERM" ] && \ 60 | echo "X:$XTERM -e $prog" && return 0 61 | echo "$prog" && return 0 62 | ;; 63 | VT) 64 | echo "$prog" && return 0 65 | ;; 66 | esac 67 | fi 68 | done 69 | } 70 | 71 | url="$1"; shift 72 | 73 | type="${url%%:*}" 74 | 75 | if [ "$url" = "$type" ]; then 76 | type="${url%%.*}" 77 | case "$type" in 78 | www|web) 79 | type=http 80 | ;; 81 | esac 82 | url="$type://$url" 83 | fi 84 | 85 | case $type in 86 | https) 87 | prg=`getprg $https_prgs` 88 | ;; 89 | http) 90 | prg=`getprg $http_prgs` 91 | ;; 92 | ftp) 93 | prg=`getprg $ftp_prgs` 94 | ;; 95 | mailto) 96 | prg=`getprg $mailto_prgs` 97 | url="${url#mailto:}" 98 | ;; 99 | gopher) 100 | prg=`getprg $gopher_prgs` 101 | ;; 102 | *) 103 | echo "Unknown URL type. Please report URL and viewer to:" 104 | echo "joey@debian.org." 105 | echo -n "Press enter to continue."; read x 106 | exit 107 | ;; 108 | esac 109 | 110 | if [ -n "$prg" ]; then 111 | if [ "${prg%:*}" = "X" ]; then 112 | ${prg#*:} "$url" 2>/dev/null & 113 | else 114 | $prg "$url" 115 | fi 116 | fi 117 | 118 | 119 | 120 | 121 | -------------------------------------------------------------------------------- /url_handler.sh.suse: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # url_handler.sh for SuSE Linux 4 | # 5 | # Copyright (c) 2000 SuSE GmbH Nuernberg, Germany. 6 | # 7 | # Author: Werner Fink 8 | # 9 | url="$1" 10 | method="${1%%:*}" 11 | 12 | if test "$url" = "$method" ; then 13 | case "${url%%.*}" in 14 | www|web|w3) method=http ;; 15 | mail|mailx) method=mailto ;; 16 | gopher) method=gopher ;; 17 | *) 18 | case "${url}" in 19 | */*.htm|*/*.html) method=http ;; 20 | */*.htmls) method=https ;; 21 | *@*) method=mailto ;; 22 | /*) if test -r "${url}" ; then 23 | method=file 24 | fi ;; 25 | *) ;; 26 | esac 27 | ;; 28 | esac 29 | case "$method" in 30 | mailto|file) url="${method}:$url" ;; 31 | *) url="${method}://$url" ;; 32 | esac 33 | fi 34 | 35 | ### an alternative method of handling "news:*" URL's 36 | # 37 | # if test "$method" = "news" ; then 38 | # url="http://www.deja.com/[ST_rn=if]/topics_if.xp?search=topic&group=${url#news:}" 39 | # method=http 40 | # fi 41 | 42 | shift 43 | 44 | case "$method" in 45 | ftp) 46 | ftp=ftp 47 | if type -p ncftp >& /dev/null ; then 48 | ftp=ncftp 49 | else 50 | url="${url#ftp://}" 51 | echo "=====> Paste this command by mouse:" 52 | echo cd "/${url#*/}" 53 | url="${url%%/*}" 54 | fi 55 | exec $ftp "$url" 56 | ;; 57 | file|http|https|gopher) 58 | http= 59 | type -p lynx >& /dev/null && http=lynx 60 | test -n "$DISPLAY" && type -p netscape >& /dev/null && http=netscape 61 | test -n "$DISPLAY" && type -p Netscape >& /dev/null && http=Netscape 62 | case "$http" in 63 | [nN]etscape) $http -remote "openURL($url)" || $netscape "$url" ;; 64 | lynx) exec $http "$url" ;; 65 | *) 66 | echo "No HTTP browser found." 67 | read -p "Press return to continue: " 68 | exit 0 # No error return 69 | ;; 70 | esac 71 | ;; 72 | mailto) 73 | : ${MAILER:=mutt} 74 | if type -p ${MAILER} >& /dev/null ; then 75 | exec ${MAILER} "${url#mailto:}" 76 | else 77 | echo "No mailer ${MAILER} found in path." 78 | echo "Please check your environment variable MAILER." 79 | read -p "Press return to continue: " 80 | exit 0 # No error return 81 | fi 82 | ;; 83 | *) 84 | echo "URL type \"$method\" not know" 85 | read -p "Press return to continue: " 86 | exit 0 # No error return 87 | ;; 88 | esac 89 | -------------------------------------------------------------------------------- /urlview.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1997 Michael R. Elkins 3 | * Copyright (C) 2012 Michael R. Elkins 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | * 19 | * 20 | * Created: Thu Dec 4 02:13:11 PST 1997 21 | * Last Modified: Tue Jul 4 11:23:49 CEST 2000 22 | */ 23 | 24 | #ifdef USE_SLANG 25 | #include 26 | #include 27 | #else 28 | #ifdef HAVE_NCURSES_H 29 | #include 30 | #else 31 | #include 32 | #endif 33 | #endif /* USE_SLANG */ 34 | 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | 44 | #ifdef HAVE_REGEX_H 45 | #include 46 | #else 47 | #include 48 | #endif 49 | 50 | #include "quote.h" 51 | 52 | #define DEFAULT_REGEXP "(((http|https|ftp|gopher)|mailto):(//)?[^ <>\"\t]*|(www|ftp)[0-9]?\\.[-a-z0-9.]+)[^ .,;\t\n\r<\">\\):]?[^, <>\"\t]*[^ .,;\t\n\r<\">\\):]" 53 | #define DEFAULT_COMMAND "/etc/urlview/url_handler.sh %s" 54 | #define SYSTEM_INITFILE "/etc/urlview/system.urlview" 55 | 56 | #define OFFSET 2 57 | #define PAGELEN (LINES - 1 - OFFSET) 58 | #define URLSIZE 128 59 | 60 | enum 61 | { 62 | FULL = 1, 63 | INDEX, 64 | MOTION 65 | }; 66 | 67 | extern int mutt_enter_string (unsigned char *buf, size_t buflen, int y, int x, 68 | int flags); 69 | 70 | void search_forward (char *search, int urlcount, char **url, int *redraw, int *current, int *top) 71 | { 72 | regex_t rx; 73 | int i, j; 74 | 75 | if (strlen(search) == 0 || *search == '\n') 76 | { 77 | move (LINES - 1, 0); 78 | clrtoeol (); 79 | *redraw = MOTION; 80 | } 81 | else 82 | { 83 | if ( (j = regcomp (&rx, search, REG_EXTENDED | REG_ICASE | REG_NEWLINE)) ) 84 | { 85 | regerror (j, &rx, search, sizeof (search)); 86 | regfree (&rx); 87 | puts (search); 88 | } 89 | for (i = *current + 1; i < urlcount; i++) 90 | { 91 | if (regexec (&rx, url[i], 0, NULL, 0) == 0) 92 | { 93 | *current = i; 94 | if (*current < *top || *current > *top + PAGELEN -1) 95 | { 96 | *top = *current - *current % PAGELEN - 1; 97 | } 98 | i = urlcount; 99 | } 100 | } 101 | move (LINES - 1, 0); 102 | clrtoeol (); 103 | *redraw = INDEX; 104 | regfree (&rx); 105 | } 106 | } 107 | 108 | void search_backward (char *search, int urlcount, char **url, int *redraw, int *current, int *top) 109 | { 110 | regex_t rx; 111 | int i, j; 112 | 113 | (void)urlcount; /*unused*/ 114 | if (strlen(search) == 0 || *search == '\n') 115 | { 116 | move (LINES - 1, 0); 117 | clrtoeol (); 118 | *redraw = MOTION; 119 | } 120 | else 121 | { 122 | if ((j = regcomp (&rx, search, REG_EXTENDED | REG_ICASE | REG_NEWLINE))) 123 | { 124 | regerror (j, &rx, search, sizeof (search)); 125 | regfree (&rx); 126 | puts (search); 127 | } 128 | for (i = *current - 1; i >= 0; i--) 129 | { 130 | if (regexec (&rx, url[i], 0, NULL, 0) == 0) 131 | { 132 | *current = i; 133 | if (*current < *top || *current > *top + PAGELEN -1) 134 | { 135 | *top = *current - *current % PAGELEN - 1; 136 | if (*top < 0) 137 | *top = 0; 138 | } 139 | i = 0; 140 | } 141 | } 142 | move (LINES - 1, 0); 143 | clrtoeol (); 144 | *redraw = INDEX; 145 | regfree (&rx); 146 | } 147 | } 148 | 149 | int main (int argc, char **argv) 150 | { 151 | struct passwd *pw; 152 | struct stat stat_buf; 153 | #ifndef USE_SLANG 154 | SCREEN *scr; 155 | #endif 156 | FILE *fp; 157 | regex_t rx; 158 | regmatch_t match; 159 | char buf[1024]; 160 | char command[1024]; 161 | char regexp[1024]; 162 | char search[1024]; 163 | char scratch[1024]; 164 | char wrapchoice[1024]; 165 | char **url; 166 | int urlsize = URLSIZE; 167 | char *pc; 168 | char *wc; 169 | size_t len; 170 | size_t offset; 171 | int i; 172 | int top = 0; 173 | int startline = 0; 174 | int oldcurrent = 0; 175 | int current = 0; 176 | int done = 0; 177 | int quitonlaunch = 0; 178 | int redraw = FULL; 179 | int urlcount = 0; 180 | int urlcheck = 0; 181 | int reopen_tty = 0; 182 | int is_filter = 0; 183 | 184 | int expert = 0; 185 | 186 | int skip_browser = 0; 187 | 188 | int menu_wrapping = 0; 189 | 190 | if (argc == 1) 191 | is_filter = 1; 192 | 193 | strncpy (regexp, DEFAULT_REGEXP, sizeof (regexp) - 1); 194 | strncpy (command, DEFAULT_COMMAND, sizeof (command) - 1); 195 | 196 | /*** read the initialization file ***/ 197 | 198 | pw = getpwuid (getuid ()); 199 | snprintf (buf, sizeof (buf), "%s/.urlview", pw->pw_dir); 200 | 201 | /*** Check for users rc-file ***/ 202 | if (stat (buf,&stat_buf) == -1) 203 | snprintf (buf, sizeof(buf), "%s", SYSTEM_INITFILE); 204 | 205 | if ((fp = fopen (buf, "r"))) 206 | { 207 | while (fgets (buf, sizeof (buf), fp) != NULL) 208 | { 209 | if (buf[0] == '#' || buf[0] == '\n') 210 | continue; 211 | if (strncmp ("REGEXP", buf, 6) == 0 && isspace (buf[6])) 212 | { 213 | pc = buf + 6; 214 | while (isspace (*pc)) 215 | pc++; 216 | wc = regexp; 217 | while (*pc && *pc != '\n') 218 | { 219 | if (*pc == '\\') 220 | { 221 | pc++; 222 | switch (*pc) 223 | { 224 | case 'n': 225 | *wc++ = '\n'; 226 | break; 227 | case 'r': 228 | *wc++ = '\r'; 229 | break; 230 | case 't': 231 | *wc++ = '\t'; 232 | break; 233 | case 'f': 234 | *wc++ = '\f'; 235 | break; 236 | default: 237 | *wc++ = '\\'; 238 | *wc++ = *pc; 239 | break; 240 | } 241 | } 242 | else 243 | *wc++ = *pc; 244 | pc++; 245 | } 246 | *wc = 0; 247 | } 248 | else if (strncmp ("COMMAND", buf, 7) == 0 && isspace (buf[7])) 249 | { 250 | pc = buf + 7; 251 | while (isspace (*pc)) 252 | pc++; 253 | pc[ strlen (pc) - 1 ] = 0; /* kill the trailing newline */ 254 | strncpy (command, pc, sizeof (command) - 1); 255 | command[sizeof (command) - 1] = 0; 256 | skip_browser = 1; 257 | } 258 | else if (strncmp ("WRAP", buf, 4) == 0 && isspace (buf[4])) 259 | { 260 | pc = buf + 4; 261 | while (isspace (*pc)) 262 | pc++; 263 | pc[ strlen (pc) - 1 ] = 0; /* kill the trailing newline */ 264 | strncpy (wrapchoice, pc, sizeof (wrapchoice) - 1); 265 | wrapchoice[sizeof (wrapchoice) - 1] = 0; 266 | /* checking the value, case insensitive */ 267 | if (strcasecmp("YES", wrapchoice) == 0) 268 | menu_wrapping = 1; 269 | else if (!strcasecmp("NO", wrapchoice) == 0) 270 | { 271 | printf ("Unknown value for WRAP: %s. Valid values are: YES, NO\n", wrapchoice); 272 | exit (1); 273 | } 274 | } 275 | else if (strncmp ("BROWSER", buf, 7) == 0 && isspace (buf[7])) 276 | { 277 | skip_browser = 0; 278 | } 279 | else if (strcmp ("EXPERT\n", buf) == 0) 280 | { 281 | expert = 1; 282 | } 283 | else if (strcmp ("QUITONLAUNCH\n", buf) == 0) 284 | { 285 | quitonlaunch = 1; 286 | } 287 | else 288 | { 289 | printf ("Unknown command: %s", buf); 290 | exit (1); 291 | } 292 | } 293 | fclose (fp); 294 | } 295 | 296 | /* Only use the $BROWSER environment variable if 297 | * (a) no COMMAND in rc file or 298 | * (b) BROWSER in rc file. 299 | * If both COMMAND and BROWSER are in the rc file, then the option used 300 | * last counts. 301 | */ 302 | if (!skip_browser) { 303 | pc = getenv("BROWSER"); 304 | if (pc) 305 | { 306 | if (strlen(pc) > 0) { 307 | strncpy (command, pc, sizeof (command) - 1); 308 | } else { 309 | printf("Your $BROWSER is zero-length. Falling back to COMMAND."); 310 | } 311 | } 312 | } 313 | 314 | if (!expert && strchr (command, '\'')) 315 | { 316 | puts ("\n\ 317 | ERROR: Your $BROWSER contains a single\n\ 318 | quote (') character. This is most likely\n\ 319 | in error; please read the manual page\n\ 320 | for details. If you really want to use\n\ 321 | this command, please put the word EXPERT\n\ 322 | into a line of its own in your \n\ 323 | ~/.urlview file.\n\ 324 | "); 325 | exit (1); 326 | } 327 | 328 | /*** compile the regexp ***/ 329 | 330 | if ((i = regcomp (&rx, regexp, REG_EXTENDED | REG_ICASE | REG_NEWLINE))) 331 | { 332 | regerror (i, &rx, buf, sizeof (buf)); 333 | regfree (&rx); 334 | puts (buf); 335 | exit (1); 336 | } 337 | 338 | /*** find matching patterns ***/ 339 | 340 | if ((url = (char **) malloc (urlsize * sizeof (char *))) == NULL) 341 | { 342 | printf ("Couldn't allocate memory for url list\n"); 343 | exit (1); 344 | } 345 | 346 | for (; is_filter || argv[optind]; optind++) 347 | { 348 | if (is_filter || strcmp ("-", argv[optind]) == 0) 349 | { 350 | fp = stdin; 351 | reopen_tty = 1; 352 | } 353 | else if (!is_filter && argv[optind][0] == '-') { 354 | startline = atoi(argv[optind]+1); 355 | current = -1; 356 | continue; 357 | } 358 | else if (!(fp = fopen (argv[optind], "r"))) 359 | { 360 | perror (argv[optind]); 361 | continue; 362 | } 363 | 364 | while (fgets (buf, sizeof (buf) - 1, fp) != NULL) 365 | { 366 | --startline; 367 | offset = 0; 368 | while (regexec (&rx, buf + offset, 1, &match, offset ? REG_NOTBOL : 0) == 0) 369 | { 370 | len = match.rm_eo - match.rm_so; 371 | if (urlcount >= urlsize) 372 | { 373 | void *urltmp; 374 | urltmp = realloc ((void *) url, (urlsize + URLSIZE) * sizeof (char *)); 375 | if (urltmp == NULL) 376 | { 377 | printf ("Couldn't allocate memory for additional urls, " 378 | "only first %d displayed\n", urlsize); 379 | goto got_urls; 380 | } 381 | else 382 | { 383 | urlsize += URLSIZE; 384 | url = (char **) urltmp; 385 | } 386 | } 387 | url[urlcount] = malloc (len + 1); 388 | memcpy (url[urlcount], buf + match.rm_so + offset, len); 389 | url[urlcount][len] = 0; 390 | for (urlcheck=0; urlcheck < urlcount; urlcheck++) 391 | { 392 | if(strcasecmp(url[urlcount],url[urlcheck])==0) 393 | { 394 | urlcount--; 395 | break; 396 | } 397 | } 398 | if (current < 0 && startline <= 0) 399 | current = urlcount; 400 | urlcount++; 401 | offset += match.rm_eo; 402 | } 403 | } 404 | got_urls: 405 | fclose (fp); 406 | if (is_filter) 407 | break; 408 | } 409 | 410 | regfree (&rx); 411 | 412 | if (!urlcount) 413 | { 414 | puts ("No URLs found."); 415 | exit (1); 416 | } 417 | 418 | if (current < 0) 419 | current = urlcount - 1; 420 | 421 | /*** present the URLs to the user ***/ 422 | 423 | #ifdef USE_SLANG 424 | if (reopen_tty) { 425 | SLang_TT_Read_FD = open ("/dev/tty", O_RDONLY); 426 | if(SLang_TT_Read_FD < 0) { 427 | perror("Can't open /dev/tty"); 428 | exit(1); 429 | } 430 | initscr (); 431 | #else 432 | /* if we piped a file we can't use initscr() because it assumes `stdin' */ 433 | fp = reopen_tty ? fopen ("/dev/tty", "r") : stdin; 434 | if(fp == NULL) { 435 | perror("Can't open /dev/tty"); 436 | exit(1); 437 | } 438 | scr = newterm (NULL, stdout, fp); 439 | set_term (scr); 440 | #endif 441 | 442 | cbreak (); 443 | noecho (); 444 | #ifdef HAVE_CURS_SET 445 | curs_set (1); 446 | #endif 447 | keypad (stdscr, TRUE); 448 | 449 | top = current - PAGELEN / 2; 450 | if (top < 0) 451 | top = 0; 452 | 453 | while (!done) 454 | { 455 | if (redraw == FULL) 456 | { 457 | move (0, 0); 458 | clrtobot (); 459 | standout (); 460 | printw ("UrlView %s: (%d matches) Press Q or Ctrl-C to Quit!", VERSION, urlcount); 461 | standend (); 462 | redraw = INDEX; 463 | } 464 | 465 | if (redraw == INDEX) 466 | { 467 | for (i = top; i < urlcount && i < top + PAGELEN; i++) 468 | { 469 | mvaddstr (i - top + OFFSET, 0, " "); 470 | snprintf (buf, sizeof (buf), "%4d ", i + 1); 471 | addstr (buf); 472 | addstr (url[i]); 473 | clrtoeol (); 474 | } 475 | clrtobot (); 476 | } 477 | else if (redraw == MOTION) 478 | mvaddstr (oldcurrent - top + OFFSET, 0, " "); 479 | 480 | standout (); 481 | mvaddstr (current - top + OFFSET, 0, "->"); 482 | standend (); 483 | 484 | oldcurrent = current; 485 | 486 | switch (i = getch ()) 487 | { 488 | case 'q': 489 | case 'x': 490 | case 'h': 491 | done = 1; 492 | break; 493 | case KEY_DOWN: 494 | case 'j': 495 | if (current < urlcount - 1) 496 | { 497 | current++; 498 | if (current >= top + PAGELEN) 499 | { 500 | top++; 501 | redraw = INDEX; 502 | } 503 | else 504 | redraw = MOTION; 505 | } 506 | else 507 | { 508 | if(menu_wrapping) 509 | current = 0; 510 | if (current < top) 511 | { 512 | top = current - current % PAGELEN; 513 | redraw = INDEX; 514 | } 515 | else 516 | redraw = MOTION; 517 | } 518 | break; 519 | case KEY_UP: 520 | case 'k': 521 | if (current) 522 | { 523 | current--; 524 | if (current < top) 525 | { 526 | top--; 527 | redraw = INDEX; 528 | } 529 | else 530 | redraw = MOTION; 531 | } 532 | else 533 | { 534 | if(menu_wrapping) 535 | current = urlcount - 1; 536 | if (current > top + PAGELEN - 1) 537 | { 538 | top = current - current % PAGELEN; 539 | redraw = INDEX; 540 | } 541 | else 542 | redraw = MOTION; 543 | } 544 | break; 545 | case KEY_HOME: 546 | case '=': 547 | if (top != 0) 548 | { 549 | top = 0; 550 | redraw = INDEX; 551 | } 552 | else 553 | redraw = MOTION; 554 | current = 0; 555 | break; 556 | case KEY_END: 557 | case '*': 558 | case 'G': 559 | current = urlcount - 1; 560 | if (current >= top + PAGELEN) 561 | { 562 | top = current - PAGELEN + 1; 563 | redraw = INDEX; 564 | } 565 | else 566 | redraw = MOTION; 567 | break; 568 | case KEY_NPAGE: 569 | case '\006': 570 | if (top + PAGELEN < urlcount) 571 | { 572 | current = top = top + PAGELEN; 573 | redraw = INDEX; 574 | } 575 | else 576 | { 577 | current = urlcount - 1; 578 | redraw = INDEX; 579 | } 580 | break; 581 | case KEY_PPAGE: 582 | case '\002': 583 | if (top) 584 | { 585 | top -= PAGELEN; 586 | if (top < 0) 587 | top = 0; 588 | if (current >= top + PAGELEN) 589 | { 590 | current = top + PAGELEN - 1; 591 | if (current < 0) 592 | current = 0; 593 | } 594 | redraw = INDEX; 595 | } 596 | else 597 | { 598 | current = 0; 599 | redraw = INDEX; 600 | } 601 | break; 602 | case '\n': 603 | case '\r': 604 | case KEY_ENTER: 605 | case ' ': 606 | strncpy (buf, url[current], sizeof (buf)); 607 | buf[sizeof (buf) - 1] = 0; 608 | mvaddstr (LINES - 1, 0, "URL: "); 609 | if (mutt_enter_string ((unsigned char *)buf, sizeof (buf), LINES - 1, 5, 0) == 0 && buf[0]) 610 | { 611 | char *part, *tmpbuf; 612 | 613 | free (url[current]); 614 | url[current] = strdup (buf); 615 | endwin (); 616 | 617 | tmpbuf = strdup(command); 618 | part = strtok(tmpbuf, ":"); 619 | do { 620 | quote (scratch, sizeof (scratch), url[current]); 621 | if (strstr (part, "%s")) 622 | snprintf (buf, sizeof (buf), part, scratch); 623 | else 624 | snprintf (buf, sizeof (buf), "%s %s", part, scratch); 625 | printf ("Executing: %s...\n", buf); 626 | fflush (stdout); 627 | if (system (buf) == 0) 628 | break; 629 | } while 630 | ((part = strtok(NULL, ":")) != NULL); 631 | free(tmpbuf); 632 | } 633 | done = quitonlaunch; 634 | move (LINES - 1, 0); 635 | clrtoeol (); 636 | break; 637 | case '0': 638 | case '1': 639 | case '2': 640 | case '3': 641 | case '4': 642 | case '5': 643 | case '6': 644 | case '7': 645 | case '8': 646 | case '9': 647 | buf[0] = i; buf[1] = 0; 648 | mvaddstr (LINES - 1, 0, "Jump to url: "); 649 | if (mutt_enter_string ((unsigned char *)buf, sizeof (buf), LINES - 1, 13, 0) == 0 && buf[0]) 650 | { 651 | i = atoi (buf); 652 | if (i < 1 || i > urlcount) 653 | { 654 | mvaddstr (LINES - 1, 0, "No such url number!"); 655 | clrtoeol (); 656 | } 657 | else 658 | { 659 | move (LINES - 1, 0); 660 | clrtoeol (); 661 | current = i - 1; 662 | redraw = MOTION; 663 | if (current < top || current > top + PAGELEN - 1) 664 | { 665 | top = current - current % PAGELEN; 666 | redraw = INDEX; 667 | } 668 | } 669 | } 670 | break; 671 | case '\f': 672 | clearok (stdscr, TRUE); 673 | redraw = FULL; 674 | break; 675 | case '/': 676 | mvaddstr (LINES - 1, 0, "Search forwards for string: "); 677 | if (mutt_enter_string ((unsigned char *)search, sizeof (search), LINES - 1, 28, 0) == 0) 678 | search_forward (search, urlcount, url, &redraw, ¤t, &top); 679 | break; 680 | case '?': 681 | mvaddstr (LINES - 1, 0, "Search backwards for string: "); 682 | if (mutt_enter_string ((unsigned char *)search, sizeof (search), LINES - 1, 29, 0) == 0) 683 | search_backward (search, urlcount, url, &redraw, ¤t, &top); 684 | break; 685 | case 'n': 686 | search_forward (search, urlcount, url, &redraw, ¤t, &top); 687 | break; 688 | case 'N': 689 | search_backward (search, urlcount, url, &redraw, ¤t, &top); 690 | break; 691 | default: 692 | break; 693 | } 694 | } 695 | 696 | endwin (); 697 | exit (0); 698 | } 699 | -------------------------------------------------------------------------------- /urlview.conf.suse: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Urlview configuration file. 3 | # man urlview 4 | # 5 | # The defaults are shown here: 6 | # 7 | # REGEXP (((https?|ftp|gopher)://|(mailto|file|news):)[^' \t<>"]+|(www|web|w3)\.[-a-z0-9.]+)[^' \t.,;<>"\):] 8 | # COMMAND url_handler.sh '%s' 9 | # 10 | -------------------------------------------------------------------------------- /urlview.man: -------------------------------------------------------------------------------- 1 | .\" -*-nroff-*- 2 | .\" 3 | .\" WARNING: THIS DOCUMENT USED TO BE GENERATED AUTOMATICALLY FROM 4 | .\" URLVIEW.SGML. THIS IS NO LONGER THE CASE. THIS IS THE MASTER 5 | .\" SOURCE OF THE MANUAL PAGE. 6 | .\" 7 | .\" Copyright (c) 1997 Michael Elkins 8 | .\" Copyright (c) 2000 Thomas Roessler 9 | .\" Copyright (c) 2012 Michael Elkins 10 | .\" 11 | .\" This document is free software; you can redistribute it and/or 12 | .\" modify it under the terms of the GNU General Public License as 13 | .\" published by the Free Software Foundation; either version 2 of the 14 | .\" License, or (at your option) any later version. 15 | .\" 16 | .TH "urlview" 1 17 | .SH NAME 18 | .PP 19 | urlview \- URL extractor/launcher 20 | .SH SYNOPSIS 21 | .PP 22 | .B urlview 23 | \fIfilename\fP [ \fIfilename\fP ... ] 24 | .SH DESCRIPTION 25 | .PP 26 | .B urlview 27 | is a screen oriented program for extracting URLs from text 28 | files and displaying a menu from which you may launch a command to view a 29 | specific item. 30 | .SH CONFIGURATION 31 | .PP 32 | .B urlview 33 | attempts to read 34 | .I ~/.urlview 35 | upon startup. If this file 36 | doesn't exist, it will try to read a system wide file 37 | in 38 | .IR /etc/urlview/system.urlview . 39 | There are two configuration commands (order does not matter): 40 | .TP 41 | REGEXP \fIregexp\fP 42 | .B urlview 43 | uses a regular expression to extract URLs from the specified 44 | text files. \\r, \\t, \\n and \\f are all converted to 45 | their normal 46 | .BR printf (3) 47 | meanings. The default REGEXP is: 48 | .PP 49 | .sp 50 | .ft RR 51 | .nf 52 | (((http|https|ftp|gopher)|mailto):(//)?[^ <>"\\t]*|(www|ftp)[0-9]?\\.[-a-z0-9.]+)[^ .,;\\t\\n\\r<">\\):]?[^, <>"\\t]*[^ .,;\\t\\n\\r<">\\):] 53 | .fi 54 | .ec 55 | .ft P 56 | .sp 57 | .TP 58 | COMMAND \fIcommand\fP 59 | If the specified command contains a 60 | .BR %s , 61 | it will be subsituted 62 | with the URL that was requested, otherwise the URL is appended to 63 | the COMMAND string. The default COMMAND is: 64 | .br 65 | .sp 66 | /etc/urlview/url_handler.sh 67 | .PP 68 | .B Note: 69 | You should 70 | .I never 71 | put single quotes around the 72 | .BR %s . 73 | .B urlview 74 | does this for you, and also makes sure that single quotes eventually 75 | showing up inside the URL are handled properly. (Note that this 76 | shouldn't happen with the default regular expression, which 77 | explicitly excludes single quotes.) 78 | .TP 79 | WRAP \fIchoice\fP 80 | Enable or disable URL wrapping. Valid values for \fIchoice\fP are: yes, no (case insensitive). 81 | If this option is not supplied, the default behaviour is to disable wrapping. 82 | .TP 83 | QUITONLAUNCH 84 | Will cause urlview to quit after you launch a URL. 85 | .SH FILES 86 | .PP 87 | .IP "/etc/urlview/system.urlview" 88 | system-wide urlview configuration file 89 | .IP "~/.urlview" 90 | urlview configuration file 91 | .SH ENVIRONMENT 92 | If the environment variable BROWSER is set to a browser command, or a 93 | colon-delimited list of commands to try, then the specified browser is 94 | used. %s is replaced with the quoted url to view. If %s is not part of a 95 | command, the url is appended to the command. 96 | .PP 97 | The BROWSER environment variable is honored only if the rc-file doesn't 98 | contain the COMMAND option. 99 | The rc-file provided by the Debian package contains a COMMAND option. 100 | .SH SEE ALSO 101 | .PP 102 | .BR printf (3), 103 | .BR regcomp (3), 104 | .BR regex (7), 105 | .BR environ (7) 106 | .SH AUTHOR 107 | .PP 108 | Michael Elkins 109 | .PP 110 | Modified for Debian by Luis Francisco Gonzalez and Emanuele Rocca . 111 | .PP 112 | Modified for SuSE by Dr. Werner Fink and Stepan Kasal . 113 | .PP 114 | Changes put together by Thomas Roessler . 115 | 116 | -------------------------------------------------------------------------------- /urlview.sgml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | NAME 6 |

7 | urlview - URL extractor/launcher 8 | 9 | SYNOPSIS 10 |

11 | urlview <filename> [ <filename> ... ] 12 | 13 | DESCRIPTION 14 |

15 | CONFIGURATION 20 |

21 | ˜/.urlview upon startup. 22 | If this file doesn't exist, it will try to read a system wide file 23 | in /etc/urlview/system.urlview. There are 24 | two configuration commands (order does not matter): 25 |

26 | REGEXP <regular expression to use for URL matching> 27 |

28 | 29 | 34 | (((http|https|ftp|gopher)|mailto):(//)?[^ <>"\t]*|(www|ftp)[0-9]?\.[-a-z0-9.]+)[^ .,;\t\n\r<">\):]?[^, <>"\t]*[^ .,;\t\n\r<">\):] 35 | 36 | 37 |

38 | COMMAND <command to launch with URL> 39 |

40 | If the specified command contains a ``%s'', it will be subsituted 41 | with the URL that was requested, otherwise the URL is appended to the 42 | COMMAND string. The default COMMAND is 43 | 44 | url_handler.sh '%s' 45 | 46 | another possibility would be 47 | 48 | Netscape -remote 'openURL(%s)' 49 | 50 | 57 | X-Nasty-Url: http://www.`program_to_execute_as_you`.com 58 | 59 | If you pass this URL to your shell, it could have nasty consequences. 60 | 61 |

62 | QUITONLAUNCH 63 |

64 | Will cause urlview to quit after you launch a URL. 65 | 66 | FILES 67 |

68 | 69 | 70 | /etc/urlview/system.urlview 71 |

72 | system-wide urlview configuration file 73 | 74 | ˜/.urlview 75 |

76 | urlview configuration file 77 | 78 | 79 | ENVIRONMENT 80 |

81 | If the environment variable BROWSER is set to a browser command, or a 82 | colon-delimited list of commands to try, then the specified browser is 83 | used. %s is replaced with the quoted url to view. If %s is not part of a 84 | command, the url is appended to the command. 85 |

86 | The BROWSER environment variable is honored only if the rc-file doesn't 87 | contain the COMMAND option. 88 | The rc-file provided by the Debian package contains a COMMAND option. 89 | 90 | SEE ALSO 91 |

92 | regcomp(3) 93 | 94 | AUTHOR 95 |

96 | Michael Elkins <me@sigpipe.org>. 97 | Modified for Debian by Luis Francisco Gonzalez <luisgh@debian.org> and Emanuele Rocca <ema@debian.org>. 98 | Modified for SuSE by Dr. Werner Fink <werner@suse.de> and Stepan Kasal <kasal@suse.cz>. 99 | 100 | --------------------------------------------------------------------------------