links

lynx-like text mode web browser
git clone anongit@rnpnr.xyz:links.git
Log | Files | Refs | Feed | README | LICENSE

Commit: beb35db16b287e286cf3f8731f75db6e412516de
Parent: e404d6b10a6e45c01b34f925c4bcd2ac3bd9c5ab
Author: opask
Date:   Sat,  7 Jul 2018 21:47:58 -0600

delete unused files

Diffstat:
DMakefile.am | 37-------------------------------------
DMakefile.in | 579-------------------------------------------------------------------------------
DPATCH-gpm-1.20.0-smooth-cursor | 84-------------------------------------------------------------------------------
DPATCH-libpng-1.2.18 | 14--------------
Datheos.cpp | 654-------------------------------------------------------------------------------
Dbeos.c | 265-------------------------------------------------------------------------------
Dbeos.h | 21---------------------
Dhpux.c | 124-------------------------------------------------------------------------------
Dhpux.h | 6------
Dlinks-48x48.xpm | 137-------------------------------------------------------------------------------
Dlinks.nsi | 248-------------------------------------------------------------------------------
Dlinks.wis | 43-------------------------------------------
Dlinks64.nsi | 248-------------------------------------------------------------------------------
Dlinks_16x16_1.xpm | 25-------------------------
Dlinks_16x16_2.xpm | 78------------------------------------------------------------------------------
Dlinks_32x32.xpm | 115-------------------------------------------------------------------------------
Dlinksos2.ico | 0
Dlinksos2.rc | 1-
Dlinkswin.ico | 0
Dlinkswin.rc | 1-
Dvms-gfx-32.opt | 4----
Dvms-gnu-text-32.opt | 1-
Dvms-ssl-32.opt | 2--
Dvms-ssl-64.opt | 2--
Dvms-ssl-external-alpha-32.opt | 2--
Dvms-ssl-external-alpha-64.opt | 2--
Dvms-ssl-external-i64-32.opt | 2--
Dvms-ssl-external-i64-64.opt | 2--
Dvms-ssl-external-vax-32.opt | 2--
Dvms.c | 1146-------------------------------------------------------------------------------
30 files changed, 0 insertions(+), 3845 deletions(-)

diff --git a/Makefile.am b/Makefile.am @@ -1,37 +0,0 @@ -# Makefile.am -# (c) 2002 Mikulas Patocka, Karel 'Clock' Kulhavy, Petr 'Brain' Kulhavy, -# Martin 'PerM' Pergel - -man_MANS=links.1 - -EXTRA_DIST=$(man_MANS) atheos.cpp BRAILLE_HOWTO KEYS SITES descrip.mms *.opt PATCH-gpm-1.20.0-smooth-cursor PATCH-libpng-1.2.18 mailcap.pl rebuild Links_logo.png Unicode/*.cp Unicode/[!C]* certs/[!C]* intl/[!C]* suffix/[!C]* graphics/*.c graphics/arrow.png graphics/gen graphics/system_font/*.png graphics/font/century_extensions-medium-roman-serif-vari/*.png graphics/font/century_school-bold-roman-serif-vari/*.png graphics/font/century_school-medium-roman-serif-vari/*.png graphics/font/courier-medium-roman-serif-mono/*.png graphics/font/japanese-medium-roman-sans-mono/*.png graphics/font/symbol-medium-roman-sans-vari/*.png graphics/font/century_school-bold-roman-serif-vari/aliases graphics/font/century_school-medium-roman-serif-vari/aliases graphics/font/japanese-medium-roman-sans-mono/aliases graphics/font/symbol-medium-roman-sans-vari/aliases doc/links_cal/*.png doc/links_cal/*.html graphics/Makefile graphics/Fontmap graphics/clip.c graphics/links.xpm graphics/makefont graphics/pdf2html graphics/spacer.png pkg-config.m4 *.xpm *.ico *.rc mk-release-os2 mk-release-win mk-dos mk-dos83.cmd links.wis *.nsi -# parser/gen parser/javascr.l parser/javascript.y - -bin_PROGRAMS=links - -if ATHEOS_GR -links_LDADD=atheos.o -endif -if JAVASCRIPT -links_LDADD=builtin.o context.o ipret.o javascr.o javascript.o md5.o md5hl.o ns.o pomocny.o regexp.o -endif - -links_SOURCES=af_unix.c auth.c beos.c bfu.c block.c bookmark.c cache.c charsets.c compress.c connect.c cookies.c data.c default.c dip.c directfb.c dither.c dns.c dos.c drivers.c error.c file.c finger.c fn_impl.c font_inc.c framebuf.c ftp.c gif.c grx.c hpux.c html.c html_gr.c html_r.c html_tbl.c http.c https.c img.c imgcache.c jpeg.c jsint.c kbd.c language.c listedit.c lru.c mailto.c main.c memory.c menu.c objreq.c os_dep.c pmshell.c png.c sched.c select.c session.c smb.c string.c suffix.c svg.c svgalib.c terminal.c tiff.c types.c url.c view.c view_gr.c vms.c x.c xbm.c beos.h bits.h cfg.h codepage.h com-defs.h config-vms.h dfb_cur.h hpux.h language.h links.h os_dep.h os_depx.h setup.h arrow.inc certs.inc codepage.inc entity.inc fbcommon.inc language.inc links_ic.inc locase.inc suffix.inc suffix_x.inc uni_7b.inc upcase.inc vpipe.inc -# builtin.c context.c ipret.c javascr.c javascript.c md5.c md5hl.c ns.c pomocny.c regexp.c md5.h ns.h struct.h tree.h typy.h ipret.h javascript.h builtin.h builtin_keys.h - -dist-hook: -#remove the symlinka: - rm $(distdir)/INSTALL - echo Links $(VERSION) -- How To Install > $(distdir)/INSTALL - echo Links $(VERSION) -- How To Install | tr -c '\n' '-' >> $(distdir)/INSTALL - echo >> $(distdir)/INSTALL - cat $(srcdir)/INSTALL >> $(distdir)/INSTALL - -CXXFLAGS=@CXXFLAGS@ - -atheos.o: $(srcdir)/atheos.cpp - $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c $(srcdir)/atheos.cpp - -datadir = $(prefix)/@DATADIRNAME@ -LIBS = @LIBS@ - diff --git a/Makefile.in b/Makefile.in @@ -1,579 +0,0 @@ -# Makefile.in generated automatically by automake 1.4-p6 from Makefile.am - -# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -# Makefile.am -# (c) 2002 Mikulas Patocka, Karel 'Clock' Kulhavy, Petr 'Brain' Kulhavy, -# Martin 'PerM' Pergel - - -SHELL = @SHELL@ - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -bindir = @bindir@ -sbindir = @sbindir@ -libexecdir = @libexecdir@ -sysconfdir = @sysconfdir@ -sharedstatedir = @sharedstatedir@ -localstatedir = @localstatedir@ -libdir = @libdir@ -infodir = @infodir@ -mandir = @mandir@ -includedir = @includedir@ -oldincludedir = /usr/include - -DESTDIR = - -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ - -top_builddir = . - -ACLOCAL = @ACLOCAL@ -AUTOCONF = @AUTOCONF@ -AUTOMAKE = @AUTOMAKE@ -AUTOHEADER = @AUTOHEADER@ - -INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -transform = @program_transform_name@ - -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -CC = @CC@ -CXX = @CXX@ -DIRECTFB_CONFIG = @DIRECTFB_CONFIG@ -MAKEINFO = @MAKEINFO@ -PACKAGE = @PACKAGE@ -PKG_CONFIG = @PKG_CONFIG@ -VERSION = @VERSION@ - -man_MANS = links.1 - -EXTRA_DIST = $(man_MANS) atheos.cpp BRAILLE_HOWTO KEYS SITES descrip.mms *.opt PATCH-gpm-1.20.0-smooth-cursor PATCH-libpng-1.2.18 mailcap.pl rebuild Links_logo.png Unicode/*.cp Unicode/[!C]* certs/[!C]* intl/[!C]* suffix/[!C]* graphics/*.c graphics/arrow.png graphics/gen graphics/system_font/*.png graphics/font/century_extensions-medium-roman-serif-vari/*.png graphics/font/century_school-bold-roman-serif-vari/*.png graphics/font/century_school-medium-roman-serif-vari/*.png graphics/font/courier-medium-roman-serif-mono/*.png graphics/font/japanese-medium-roman-sans-mono/*.png graphics/font/symbol-medium-roman-sans-vari/*.png graphics/font/century_school-bold-roman-serif-vari/aliases graphics/font/century_school-medium-roman-serif-vari/aliases graphics/font/japanese-medium-roman-sans-mono/aliases graphics/font/symbol-medium-roman-sans-vari/aliases doc/links_cal/*.png doc/links_cal/*.html graphics/Makefile graphics/Fontmap graphics/clip.c graphics/links.xpm graphics/makefont graphics/pdf2html graphics/spacer.png pkg-config.m4 *.xpm *.ico *.rc mk-release-os2 mk-release-win mk-dos mk-dos83.cmd links.wis *.nsi -# parser/gen parser/javascr.l parser/javascript.y - -bin_PROGRAMS = links -@ATHEOS_GR_TRUE@links_LDADD = atheos.o -@JAVASCRIPT_TRUE@links_LDADD = builtin.o context.o ipret.o javascr.o javascript.o md5.o md5hl.o ns.o pomocny.o regexp.o - -links_SOURCES = af_unix.c auth.c beos.c bfu.c block.c bookmark.c cache.c charsets.c compress.c connect.c cookies.c data.c default.c dip.c directfb.c dither.c dns.c dos.c drivers.c error.c file.c finger.c fn_impl.c font_inc.c framebuf.c ftp.c gif.c grx.c hpux.c html.c html_gr.c html_r.c html_tbl.c http.c https.c img.c imgcache.c jpeg.c jsint.c kbd.c language.c listedit.c lru.c mailto.c main.c memory.c menu.c objreq.c os_dep.c pmshell.c png.c sched.c select.c session.c smb.c string.c suffix.c svg.c svgalib.c terminal.c tiff.c types.c url.c view.c view_gr.c vms.c x.c xbm.c beos.h bits.h cfg.h codepage.h com-defs.h config-vms.h dfb_cur.h hpux.h language.h links.h os_dep.h os_depx.h setup.h arrow.inc certs.inc codepage.inc entity.inc fbcommon.inc language.inc links_ic.inc locase.inc suffix.inc suffix_x.inc uni_7b.inc upcase.inc vpipe.inc - -CXXFLAGS = @CXXFLAGS@ - -datadir = $(prefix)/@DATADIRNAME@ -LIBS = @LIBS@ -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_HEADER = config.h -CONFIG_CLEAN_FILES = -PROGRAMS = $(bin_PROGRAMS) - - -DEFS = @DEFS@ -I. -I$(srcdir) -I. -CPPFLAGS = @CPPFLAGS@ -LDFLAGS = @LDFLAGS@ -links_OBJECTS = af_unix.o auth.o beos.o bfu.o block.o bookmark.o \ -cache.o charsets.o compress.o connect.o cookies.o data.o default.o \ -dip.o directfb.o dither.o dns.o dos.o drivers.o error.o file.o finger.o \ -fn_impl.o font_inc.o framebuf.o ftp.o gif.o grx.o hpux.o html.o \ -html_gr.o html_r.o html_tbl.o http.o https.o img.o imgcache.o jpeg.o \ -jsint.o kbd.o language.o listedit.o lru.o mailto.o main.o memory.o \ -menu.o objreq.o os_dep.o pmshell.o png.o sched.o select.o session.o \ -smb.o string.o suffix.o svg.o svgalib.o terminal.o tiff.o types.o url.o \ -view.o view_gr.o vms.o x.o xbm.o -@ATHEOS_GR_TRUE@links_DEPENDENCIES = atheos.o -@JAVASCRIPT_TRUE@links_DEPENDENCIES = builtin.o context.o ipret.o \ -@JAVASCRIPT_TRUE@javascr.o javascript.o md5.o md5hl.o ns.o pomocny.o \ -@JAVASCRIPT_TRUE@regexp.o -links_LDFLAGS = -CFLAGS = @CFLAGS@ -COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ -man1dir = $(mandir)/man1 -MANS = $(man_MANS) - -NROFF = nroff -DIST_COMMON = README ./stamp-h.in AUTHORS COPYING ChangeLog INSTALL \ -Makefile.am Makefile.in NEWS acconfig.h aclocal.m4 config.guess \ -config.h.in config.sub configure configure.in install-sh missing \ -mkinstalldirs - - -DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) - -TAR = tar -GZIP_ENV = --best -SOURCES = $(links_SOURCES) -OBJECTS = $(links_OBJECTS) - -all: all-redirect -.SUFFIXES: -.SUFFIXES: .S .c .o .s -$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps Makefile - -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) \ - && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status - -$(ACLOCAL_M4): configure.in - cd $(srcdir) && $(ACLOCAL) - -config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - $(SHELL) ./config.status --recheck -$(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) - cd $(srcdir) && $(AUTOCONF) - -config.h: stamp-h - @if test ! -f $@; then \ - rm -f stamp-h; \ - $(MAKE) stamp-h; \ - else :; fi -stamp-h: $(srcdir)/config.h.in $(top_builddir)/config.status - cd $(top_builddir) \ - && CONFIG_FILES= CONFIG_HEADERS=config.h \ - $(SHELL) ./config.status - @echo timestamp > stamp-h 2> /dev/null -$(srcdir)/config.h.in: $(srcdir)/stamp-h.in - @if test ! -f $@; then \ - rm -f $(srcdir)/stamp-h.in; \ - $(MAKE) $(srcdir)/stamp-h.in; \ - else :; fi -$(srcdir)/stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) acconfig.h - cd $(top_srcdir) && $(AUTOHEADER) - @echo timestamp > $(srcdir)/stamp-h.in 2> /dev/null - -mostlyclean-hdr: - -clean-hdr: - -distclean-hdr: - -rm -f config.h - -maintainer-clean-hdr: - -mostlyclean-binPROGRAMS: - -clean-binPROGRAMS: - -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) - -distclean-binPROGRAMS: - -maintainer-clean-binPROGRAMS: - -install-binPROGRAMS: $(bin_PROGRAMS) - @$(NORMAL_INSTALL) - $(mkinstalldirs) $(DESTDIR)$(bindir) - @list='$(bin_PROGRAMS)'; for p in $$list; do \ - if test -f $$p; then \ - echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \ - $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \ - else :; fi; \ - done - -uninstall-binPROGRAMS: - @$(NORMAL_UNINSTALL) - list='$(bin_PROGRAMS)'; for p in $$list; do \ - rm -f $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \ - done - -.c.o: - $(COMPILE) -c $< - -.s.o: - $(COMPILE) -c $< - -.S.o: - $(COMPILE) -c $< - -mostlyclean-compile: - -rm -f *.o core *.core - -clean-compile: - -distclean-compile: - -rm -f *.tab.c - -maintainer-clean-compile: - -links: $(links_OBJECTS) $(links_DEPENDENCIES) - @rm -f links - $(LINK) $(links_LDFLAGS) $(links_OBJECTS) $(links_LDADD) $(LIBS) - -install-man1: - $(mkinstalldirs) $(DESTDIR)$(man1dir) - @list='$(man1_MANS)'; \ - l2='$(man_MANS)'; for i in $$l2; do \ - case "$$i" in \ - *.1*) list="$$list $$i" ;; \ - esac; \ - done; \ - for i in $$list; do \ - if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ - else file=$$i; fi; \ - ext=`echo $$i | sed -e 's/^.*\\.//'`; \ - inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ - inst=`echo $$inst | sed '$(transform)'`.$$ext; \ - echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst"; \ - $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst; \ - done - -uninstall-man1: - @list='$(man1_MANS)'; \ - l2='$(man_MANS)'; for i in $$l2; do \ - case "$$i" in \ - *.1*) list="$$list $$i" ;; \ - esac; \ - done; \ - for i in $$list; do \ - ext=`echo $$i | sed -e 's/^.*\\.//'`; \ - inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ - inst=`echo $$inst | sed '$(transform)'`.$$ext; \ - echo " rm -f $(DESTDIR)$(man1dir)/$$inst"; \ - rm -f $(DESTDIR)$(man1dir)/$$inst; \ - done -install-man: $(MANS) - @$(NORMAL_INSTALL) - $(MAKE) $(AM_MAKEFLAGS) install-man1 -uninstall-man: - @$(NORMAL_UNINSTALL) - $(MAKE) $(AM_MAKEFLAGS) uninstall-man1 - -tags: TAGS - -ID: $(HEADERS) $(SOURCES) $(LISP) - list='$(SOURCES) $(HEADERS)'; \ - unique=`for i in $$list; do echo $$i; done | \ - awk ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - here=`pwd` && cd $(srcdir) \ - && mkid -f$$here/ID $$unique $(LISP) - -TAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS)'; \ - unique=`for i in $$list; do echo $$i; done | \ - awk ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(ETAGS_ARGS)config.h.in$$unique$(LISP)$$tags" \ - || (cd $(srcdir) && etags -o $$here/TAGS $(ETAGS_ARGS) $$tags config.h.in $$unique $(LISP)) - -mostlyclean-tags: - -clean-tags: - -distclean-tags: - -rm -f TAGS ID - -maintainer-clean-tags: - -distdir = $(PACKAGE)-$(VERSION) -top_distdir = $(distdir) - -# This target untars the dist file and tries a VPATH configuration. Then -# it guarantees that the distribution is self-contained by making another -# tarfile. -distcheck: dist - -rm -rf $(distdir) - GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz - mkdir $(distdir)/=build - mkdir $(distdir)/=inst - dc_install_base=`cd $(distdir)/=inst && pwd`; \ - cd $(distdir)/=build \ - && ../configure --srcdir=.. --prefix=$$dc_install_base \ - && $(MAKE) $(AM_MAKEFLAGS) \ - && $(MAKE) $(AM_MAKEFLAGS) dvi \ - && $(MAKE) $(AM_MAKEFLAGS) check \ - && $(MAKE) $(AM_MAKEFLAGS) install \ - && $(MAKE) $(AM_MAKEFLAGS) installcheck \ - && $(MAKE) $(AM_MAKEFLAGS) dist - -rm -rf $(distdir) - @banner="$(distdir).tar.gz is ready for distribution"; \ - dashes=`echo "$$banner" | sed s/./=/g`; \ - echo "$$dashes"; \ - echo "$$banner"; \ - echo "$$dashes" -dist: distdir - -chmod -R a+r $(distdir) - GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) - -rm -rf $(distdir) -dist-all: distdir - -chmod -R a+r $(distdir) - GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) - -rm -rf $(distdir) -distdir: $(DISTFILES) - -rm -rf $(distdir) - mkdir $(distdir) - -chmod 755 $(distdir) - $(mkinstalldirs) $(distdir)/Unicode $(distdir)/certs \ - $(distdir)/doc/links_cal $(distdir)/graphics \ - $(distdir)/graphics/font/century_extensions-medium-roman-serif-vari \ - $(distdir)/graphics/font/century_school-bold-roman-serif-vari \ - $(distdir)/graphics/font/century_school-medium-roman-serif-vari \ - $(distdir)/graphics/font/courier-medium-roman-serif-mono \ - $(distdir)/graphics/font/japanese-medium-roman-sans-mono \ - $(distdir)/graphics/font/symbol-medium-roman-sans-vari \ - $(distdir)/graphics/system_font $(distdir)/intl \ - $(distdir)/suffix - @for file in $(DISTFILES); do \ - d=$(srcdir); \ - if test -d $$d/$$file; then \ - cp -pr $$d/$$file $(distdir)/$$file; \ - else \ - test -f $(distdir)/$$file \ - || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ - || cp -p $$d/$$file $(distdir)/$$file || :; \ - fi; \ - done - $(MAKE) $(AM_MAKEFLAGS) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-hook -af_unix.o: af_unix.c links.h cfg.h config.h com-defs.h os_dep.h \ - os_depx.h setup.h language.h codepage.h -auth.o: auth.c links.h cfg.h config.h com-defs.h os_dep.h os_depx.h \ - setup.h language.h codepage.h -beos.o: beos.c -bfu.o: bfu.c links.h cfg.h config.h com-defs.h os_dep.h os_depx.h \ - setup.h language.h codepage.h -block.o: block.c links.h cfg.h config.h com-defs.h os_dep.h os_depx.h \ - setup.h language.h codepage.h -bookmark.o: bookmark.c links.h cfg.h config.h com-defs.h os_dep.h \ - os_depx.h setup.h language.h codepage.h -cache.o: cache.c links.h cfg.h config.h com-defs.h os_dep.h os_depx.h \ - setup.h language.h codepage.h -charsets.o: charsets.c links.h cfg.h config.h com-defs.h os_dep.h \ - os_depx.h setup.h language.h codepage.h codepage.inc uni_7b.inc \ - entity.inc upcase.inc locase.inc -compress.o: compress.c links.h cfg.h config.h com-defs.h os_dep.h \ - os_depx.h setup.h language.h codepage.h -connect.o: connect.c links.h cfg.h config.h com-defs.h os_dep.h \ - os_depx.h setup.h language.h codepage.h -cookies.o: cookies.c links.h cfg.h config.h com-defs.h os_dep.h \ - os_depx.h setup.h language.h codepage.h -data.o: data.c links.h cfg.h config.h com-defs.h os_dep.h os_depx.h \ - setup.h language.h codepage.h -default.o: default.c links.h cfg.h config.h com-defs.h os_dep.h \ - os_depx.h setup.h language.h codepage.h -dip.o: dip.c cfg.h config.h links.h com-defs.h os_dep.h os_depx.h \ - setup.h language.h codepage.h links_ic.inc -directfb.o: directfb.c cfg.h config.h links.h com-defs.h os_dep.h \ - os_depx.h setup.h language.h codepage.h dfb_cur.h -dither.o: dither.c cfg.h config.h links.h com-defs.h os_dep.h os_depx.h \ - setup.h language.h codepage.h bits.h -dns.o: dns.c links.h cfg.h config.h com-defs.h os_dep.h os_depx.h \ - setup.h language.h codepage.h -dos.o: dos.c -drivers.o: drivers.c cfg.h config.h links.h com-defs.h os_dep.h \ - os_depx.h setup.h language.h codepage.h -error.o: error.c links.h cfg.h config.h com-defs.h os_dep.h os_depx.h \ - setup.h language.h codepage.h -file.o: file.c links.h cfg.h config.h com-defs.h os_dep.h os_depx.h \ - setup.h language.h codepage.h -finger.o: finger.c links.h cfg.h config.h com-defs.h os_dep.h os_depx.h \ - setup.h language.h codepage.h -fn_impl.o: fn_impl.c links.h cfg.h config.h com-defs.h os_dep.h \ - os_depx.h setup.h language.h codepage.h -font_inc.o: font_inc.c cfg.h config.h links.h com-defs.h os_dep.h \ - os_depx.h setup.h language.h codepage.h -framebuf.o: framebuf.c cfg.h config.h links.h com-defs.h os_dep.h \ - os_depx.h setup.h language.h codepage.h bits.h arrow.inc \ - fbcommon.inc -ftp.o: ftp.c links.h cfg.h config.h com-defs.h os_dep.h os_depx.h \ - setup.h language.h codepage.h -gif.o: gif.c cfg.h config.h links.h com-defs.h os_dep.h os_depx.h \ - setup.h language.h codepage.h -grx.o: grx.c cfg.h config.h -hpux.o: hpux.c -html.o: html.c links.h cfg.h config.h com-defs.h os_dep.h os_depx.h \ - setup.h language.h codepage.h -html_gr.o: html_gr.c cfg.h config.h links.h com-defs.h os_dep.h \ - os_depx.h setup.h language.h codepage.h -html_r.o: html_r.c links.h cfg.h config.h com-defs.h os_dep.h os_depx.h \ - setup.h language.h codepage.h -html_tbl.o: html_tbl.c links.h cfg.h config.h com-defs.h os_dep.h \ - os_depx.h setup.h language.h codepage.h -http.o: http.c links.h cfg.h config.h com-defs.h os_dep.h os_depx.h \ - setup.h language.h codepage.h -https.o: https.c links.h cfg.h config.h com-defs.h os_dep.h os_depx.h \ - setup.h language.h codepage.h certs.inc -img.o: img.c links.h cfg.h config.h com-defs.h os_dep.h os_depx.h \ - setup.h language.h codepage.h -imgcache.o: imgcache.c cfg.h config.h links.h com-defs.h os_dep.h \ - os_depx.h setup.h language.h codepage.h -jpeg.o: jpeg.c cfg.h config.h links.h com-defs.h os_dep.h os_depx.h \ - setup.h language.h codepage.h -jsint.o: jsint.c links.h cfg.h config.h com-defs.h os_dep.h os_depx.h \ - setup.h language.h codepage.h -kbd.o: kbd.c links.h cfg.h config.h com-defs.h os_dep.h os_depx.h \ - setup.h language.h codepage.h -language.o: language.c links.h cfg.h config.h com-defs.h os_dep.h \ - os_depx.h setup.h language.h codepage.h language.inc -listedit.o: listedit.c links.h cfg.h config.h com-defs.h os_dep.h \ - os_depx.h setup.h language.h codepage.h -lru.o: lru.c cfg.h config.h links.h com-defs.h os_dep.h os_depx.h \ - setup.h language.h codepage.h -mailto.o: mailto.c links.h cfg.h config.h com-defs.h os_dep.h os_depx.h \ - setup.h language.h codepage.h -main.o: main.c links.h cfg.h config.h com-defs.h os_dep.h os_depx.h \ - setup.h language.h codepage.h -memory.o: memory.c links.h cfg.h config.h com-defs.h os_dep.h os_depx.h \ - setup.h language.h codepage.h -menu.o: menu.c links.h cfg.h config.h com-defs.h os_dep.h os_depx.h \ - setup.h language.h codepage.h -objreq.o: objreq.c links.h cfg.h config.h com-defs.h os_dep.h os_depx.h \ - setup.h language.h codepage.h -os_dep.o: os_dep.c links.h cfg.h config.h com-defs.h os_dep.h os_depx.h \ - setup.h language.h codepage.h -pmshell.o: pmshell.c cfg.h config.h -png.o: png.c cfg.h config.h links.h com-defs.h os_dep.h os_depx.h \ - setup.h language.h codepage.h -sched.o: sched.c links.h cfg.h config.h com-defs.h os_dep.h os_depx.h \ - setup.h language.h codepage.h -select.o: select.c links.h cfg.h config.h com-defs.h os_dep.h os_depx.h \ - setup.h language.h codepage.h -session.o: session.c links.h cfg.h config.h com-defs.h os_dep.h \ - os_depx.h setup.h language.h codepage.h -smb.o: smb.c links.h cfg.h config.h com-defs.h os_dep.h os_depx.h \ - setup.h language.h codepage.h -string.o: string.c links.h cfg.h config.h com-defs.h os_dep.h os_depx.h \ - setup.h language.h codepage.h -suffix.o: suffix.c links.h cfg.h config.h com-defs.h os_dep.h os_depx.h \ - setup.h language.h codepage.h suffix.inc suffix_x.inc -svg.o: svg.c cfg.h config.h links.h com-defs.h os_dep.h os_depx.h \ - setup.h language.h codepage.h bits.h -svgalib.o: svgalib.c cfg.h config.h links.h com-defs.h os_dep.h \ - os_depx.h setup.h language.h codepage.h bits.h arrow.inc \ - fbcommon.inc -terminal.o: terminal.c links.h cfg.h config.h com-defs.h os_dep.h \ - os_depx.h setup.h language.h codepage.h -tiff.o: tiff.c cfg.h config.h links.h com-defs.h os_dep.h os_depx.h \ - setup.h language.h codepage.h bits.h -types.o: types.c links.h cfg.h config.h com-defs.h os_dep.h os_depx.h \ - setup.h language.h codepage.h -url.o: url.c links.h cfg.h config.h com-defs.h os_dep.h os_depx.h \ - setup.h language.h codepage.h -view.o: view.c links.h cfg.h config.h com-defs.h os_dep.h os_depx.h \ - setup.h language.h codepage.h -view_gr.o: view_gr.c cfg.h config.h links.h com-defs.h os_dep.h \ - os_depx.h setup.h language.h codepage.h -vms.o: vms.c -x.o: x.c cfg.h config.h links.h com-defs.h os_dep.h os_depx.h setup.h \ - language.h codepage.h -xbm.o: xbm.c cfg.h config.h links.h com-defs.h os_dep.h os_depx.h \ - setup.h language.h codepage.h - -info-am: -info: info-am -dvi-am: -dvi: dvi-am -check-am: all-am -check: check-am -installcheck-am: -installcheck: installcheck-am -all-recursive-am: config.h - $(MAKE) $(AM_MAKEFLAGS) all-recursive - -install-exec-am: install-binPROGRAMS -install-exec: install-exec-am - -install-data-am: install-man -install-data: install-data-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am -install: install-am -uninstall-am: uninstall-binPROGRAMS uninstall-man -uninstall: uninstall-am -all-am: Makefile $(PROGRAMS) $(MANS) config.h -all-redirect: all-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install -installdirs: - $(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(mandir)/man1 - - -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -rm -f Makefile $(CONFIG_CLEAN_FILES) - -rm -f config.cache config.log stamp-h stamp-h[0-9]* - -maintainer-clean-generic: -mostlyclean-am: mostlyclean-hdr mostlyclean-binPROGRAMS \ - mostlyclean-compile mostlyclean-tags \ - mostlyclean-generic - -mostlyclean: mostlyclean-am - -clean-am: clean-hdr clean-binPROGRAMS clean-compile clean-tags \ - clean-generic mostlyclean-am - -clean: clean-am - -distclean-am: distclean-hdr distclean-binPROGRAMS distclean-compile \ - distclean-tags distclean-generic clean-am - -distclean: distclean-am - -rm -f config.status - -maintainer-clean-am: maintainer-clean-hdr maintainer-clean-binPROGRAMS \ - maintainer-clean-compile maintainer-clean-tags \ - maintainer-clean-generic distclean-am - @echo "This command is intended for maintainers to use;" - @echo "it deletes files that may require special tools to rebuild." - -maintainer-clean: maintainer-clean-am - -rm -f config.status - -.PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \ -mostlyclean-binPROGRAMS distclean-binPROGRAMS clean-binPROGRAMS \ -maintainer-clean-binPROGRAMS uninstall-binPROGRAMS install-binPROGRAMS \ -mostlyclean-compile distclean-compile clean-compile \ -maintainer-clean-compile install-man1 uninstall-man1 install-man \ -uninstall-man tags mostlyclean-tags distclean-tags clean-tags \ -maintainer-clean-tags distdir info-am info dvi-am dvi check check-am \ -installcheck-am installcheck all-recursive-am install-exec-am \ -install-exec install-data-am install-data install-am install \ -uninstall-am uninstall all-redirect all-am all installdirs \ -mostlyclean-generic distclean-generic clean-generic \ -maintainer-clean-generic clean mostlyclean distclean maintainer-clean - -# builtin.c context.c ipret.c javascr.c javascript.c md5.c md5hl.c ns.c pomocny.c regexp.c md5.h ns.h struct.h tree.h typy.h ipret.h javascript.h builtin.h builtin_keys.h - -dist-hook: -#remove the symlinka: - rm $(distdir)/INSTALL - echo Links $(VERSION) -- How To Install > $(distdir)/INSTALL - echo Links $(VERSION) -- How To Install | tr -c '\n' '-' >> $(distdir)/INSTALL - echo >> $(distdir)/INSTALL - cat $(srcdir)/INSTALL >> $(distdir)/INSTALL - -atheos.o: $(srcdir)/atheos.cpp - $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c $(srcdir)/atheos.cpp - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/PATCH-gpm-1.20.0-smooth-cursor b/PATCH-gpm-1.20.0-smooth-cursor @@ -1,84 +0,0 @@ ---- src/gpm.c_ Sat Jun 8 14:14:19 2002 -+++ src/gpm.c Sat Jun 8 14:51:18 2002 -@@ -106,6 +106,11 @@ - static int mouse_argc[3]; /* 0 for default (unused) and two mice */ - static char **mouse_argv[3]; /* 0 for default (unused) and two mice */ - -+/* pixel-level mouse delta. Should be in event, but I don't want to break interface */ -+static int smooth_dx, smooth_dy; -+ -+static int number_of_smooth_clients = 0; -+ - /*===================================================================*/ - /* - * first, all the stuff that used to be in gpn.c (i.e., not main-loop) -@@ -317,7 +322,15 @@ - - /* WARNING */ /* This can generate a SIGPIPE... I'd better catch it */ - MAGIC_P((write(fd,&magic, sizeof(int)))); -- write(fd,event, sizeof(Gpm_Event)); -+ if (info.eventMask & info.defaultMask & GPM_SMOOTH && !m_type->absolute) { -+ Gpm_Event new = *event; -+ new.dx = smooth_dx; -+ new.dy = smooth_dy; -+ new.type |= GPM_SMOOTH; -+ write(fd,&new, sizeof(Gpm_Event)); -+ } else { -+ write(fd,event, sizeof(Gpm_Event)); -+ } - - return info.defaultMask & GPM_HARD ? res : 1; /* HARD forces pass-on */ - -@@ -503,6 +516,7 @@ - - /* use fine delta values now, if delta is the information */ - if (!(m_type)->absolute) { -+ smooth_dx=event->dx; smooth_dy=event->dy; - fine_dx+=event->dx; fine_dy+=event->dy; - event->dx=fine_dx/opt_scale; event->dy=fine_dy/opt_scaley; - fine_dx %= opt_scale; fine_dy %= opt_scaley; -@@ -511,7 +525,7 @@ - /* up and down, up and down, ... who does a do..while(0) loop ??? - and then makes a break into it... argh ! */ - -- if (!event->dx && !event->dy && (event->buttons==oldB)) -+ if (!event->dx && !event->dy && (event->buttons==oldB) && !number_of_smooth_clients) - do { /* so to break */ - static long awaketime; - /* -@@ -680,6 +694,7 @@ - FD_CLR(ci->fd,&readySet); - if (cinfo[vc]->fd == ci->fd) { /* it was on top of the stack */ - cinfoPtr = cinfo[vc]; -+ if (cinfoPtr->data.eventMask & cinfoPtr->data.defaultMask & GPM_SMOOTH) number_of_smooth_clients--; - cinfo[vc]=cinfo[vc]->next; /* pop the stack */ - free(cinfoPtr); - return -1; -@@ -850,6 +865,8 @@ - } - free(tty); /* at least here it's not needed anymore */ - } -+ -+ if (info->data.eventMask & info->data.defaultMask & GPM_SMOOTH) number_of_smooth_clients++; - - /* register the connection information in the right place */ - info->next=next=cinfo[vc]; ---- src/headers/gpm.h_ Sat Jun 8 13:20:25 2002 -+++ src/headers/gpm.h Sat Jun 8 14:52:35 2002 -@@ -102,8 +102,15 @@ - used event to pass over to another handler */ - - GPM_ENTER=512, /* enter event, user in Roi's */ -- GPM_LEAVE=1024 /* leave event, used in Roi's */ -+ GPM_LEAVE=1024, /* leave event, used in Roi's */ -+ -+ GPM_SMOOTH=2048, /* if application want to receive smooth movement, -+ it sets GPM_SMOOTH in both eventMask and defaultMask. -+ In returned event, type GPM_SMOOTH signals that dx and dy -+ are smooth */ - }; -+ -+#define GPM_HAVE_SMOOTH /* so that apps can #ifdef for old/new version */ - - #define Gpm_StrictSingle(type) (((type)&GPM_SINGLE) && !((type)&GPM_MFLAG)) - #define Gpm_AnySingle(type) ((type)&GPM_SINGLE) diff --git a/PATCH-libpng-1.2.18 b/PATCH-libpng-1.2.18 @@ -1,14 +0,0 @@ ---- pngrtran.c_ 2007-06-25 04:09:58.000000000 +0200 -+++ pngrtran.c 2007-06-25 04:09:53.000000000 +0200 -@@ -1293,9 +1293,9 @@ - if(rgb_error) - { - png_ptr->rgb_to_gray_status=1; -- if(png_ptr->transformations & PNG_RGB_TO_GRAY_WARN) -+ if((png_ptr->transformations & PNG_RGB_TO_GRAY) == PNG_RGB_TO_GRAY_WARN) - png_warning(png_ptr, "png_do_rgb_to_gray found nongray pixel"); -- if(png_ptr->transformations & PNG_RGB_TO_GRAY_ERR) -+ if((png_ptr->transformations & PNG_RGB_TO_GRAY) == PNG_RGB_TO_GRAY_ERR) - png_error(png_ptr, "png_do_rgb_to_gray found nongray pixel"); - } - } diff --git a/atheos.cpp b/atheos.cpp @@ -1,654 +0,0 @@ -#include "cfg.h" - -#ifdef GRDRV_ATHEOS - -#include <atheos/threads.h> -#include <gui/view.h> -#include <gui/window.h> -#include <gui/desktop.h> -#include <gui/bitmap.h> -#include <util/locker.h> -#include <util/application.h> -#include <string> - -using namespace std; - -extern "C" { -#include "links.h" -} - -#define WINDOW_TITLE_SIZE 16 -#define TOP_PANEL_SIZE 32 -#define NEW_WINDOW_X_ADD 16 -#define NEW_WINDOW_Y_ADD 16 -#define NEW_WINDOW_X_MIN 8 -#define NEW_WINDOW_Y_MIN 8 - -#ifdef debug -#undef debug -#endif -#ifdef debug2 -#undef debug2 -#endif -#define debug(x) -#define debug2(x) - -extern struct graphics_driver atheos_driver; - -using namespace os; - -class LinksApplication : public Application { - public: - LinksApplication():Application("application/x-vnd.links"){} - virtual bool OkToQuit(){return false;} -}; - -class LinksView; - -class LinksWindow : public Window { - public: - LinksWindow(Rect r); - ~LinksWindow(); - virtual void FrameSized(const Point &d); - virtual bool OkToQuit(); - int resized; - LinksView *view; -}; - -class LinksView : public View { - public: - LinksView(LinksWindow *w); - ~LinksView(); - virtual void Paint(const Rect &r); - virtual void MouseDown(const Point &p, uint32 b); - virtual void MouseUp(const Point &p, uint32 b, Message *m); - virtual void MouseMove(const Point &p, int c, uint32 b, Message *m); - virtual void KeyDown(const char *s, const char *rs, uint32 q); - virtual void WheelMoved(const Point &d); - LinksWindow *win; - struct graphics_device *dev; - void d_flush(); - int flushing; - int last_x, last_y; -}; - -#define lv(dev) ((LinksView *)(dev)->driver_data) - -#define lock_dev(dev) do { if (lv(dev)->win->Lock()) return; } while (0) -#define lock_dev0(dev) do { if (lv(dev)->win->Lock()) return 0; } while (0) -#define unlock_dev(dev) do { lv(dev)->win->Unlock(); } while (0) - -LinksApplication *ath_links_app; -Locker *ath_lock = NULL; - -int msg_pipe[2]; - -thread_id ath_app_thread_id; - -#define rpipe (msg_pipe[0]) -#define wpipe (msg_pipe[1]) - -#define small_color (sizeof(Color32_s) <= sizeof(long)) -#define get_color32(c, rgb) Color32_s c((rgb >> 16) & 255, (rgb >> 8) & 255, rgb & 255, 255) - -color_space ath_cs_desktop, ath_cs_bmp; - -int ath_x_size, ath_y_size; -int ath_y_panel; - -int ath_win_x_size, ath_win_y_size; -int ath_win_x_pos, ath_win_y_pos; - -LinksWindow::LinksWindow(Rect r):Window(r, "links_wnd", "Links") -{ - debug2("LINKSWINDOW\n"); - resized = 0; - view = NULL; -} - -LinksWindow::~LinksWindow() -{ - view = NULL; - debug2("~LINKSWINDOW\n"); -} - -void LinksWindow::FrameSized(const Point &d) -{ - resized = 1; -} - -bool LinksWindow::OkToQuit() -{ - ath_lock->Lock(); - Lock(); - if (view) if (view->dev) view->dev->keyboard_handler(view->dev, KBD_CTRL_C, 0); - Unlock(); - ath_lock->Unlock(); - write(wpipe, " ", 1); - /*debug2("key: :%s: :%s: %d %d\n", s, rs, q, c);*/ - return false; -} - -void do_flush(void *p_dev) -{ - struct graphics_device *dev = (struct graphics_device *)p_dev; - LinksView *v = lv(dev); - v->win->Lock(); - v->win->Flush(); - v->win->Unlock(); - v->flushing = 0; -} - -LinksView::LinksView(LinksWindow *w):View(w->GetBounds(), "Links", CF_FOLLOW_ALL, WID_WILL_DRAW | WID_FULL_UPDATE_ON_RESIZE) -{ - debug2("LINKSVIEW\n"); - (win = w)->AddChild(this); - w->SetFocusChild(this); - w->view = this; - flushing = 0; - last_x = last_y = 0; -} - -LinksView::~LinksView() -{ - win->view = NULL; - debug2("~LINKSVIEW\n"); -} - -void LinksView::d_flush() -{ - if (flushing) return; - register_bottom_half(do_flush, this->dev); - flushing = 1; -} - -#undef select - -int ath_select(int n, fd_set *r, fd_set *w, fd_set *e, struct timeval *t) -{ - int v; - if (ath_lock) ath_lock->Unlock(); - v = select(n, r, w, e, t); - if (ath_lock) { - ath_lock->Lock(); - check_bottom_halves(); - } - return v; -} - -void ath_get_event(void *dummy) -{ - char dummy_buffer[256]; - read(rpipe, dummy_buffer, 256); - debug2("GETE\n"); -} - -void ath_get_size(struct graphics_device *dev) -{ - Rect r = lv(dev)->GetBounds(); - dev->size.x1 = dev->size.y1 = 0; - dev->size.x2 = (int)r.Width() + 1; - dev->size.y2 = (int)r.Height() + 1; -} - -void LinksView::Paint(const Rect &r) -{ - struct rect rr; - win->Unlock(); - ath_lock->Lock(); - win->Lock(); - rr.x1 = (int)r.left; - rr.x2 = (int)r.right + 1; - rr.y1 = (int)r.top; - rr.y2 = (int)r.bottom + 1; - /*debug2("paint: %d %d %d %d\n", rr.x1, rr.x2, rr.y1, rr.y2);*/ - if (dev) { - if (!win->resized) dev->redraw_handler(dev, &rr); - else { - ath_get_size(dev); - win->resized = 0; - dev->resize_handler(dev); - } - } - check_bottom_halves(); - ath_lock->Unlock(); - write(wpipe, " ", 1); -} - - -void LinksView::MouseDown(const Point &p, uint32 b) -{ - win->Unlock(); - ath_lock->Lock(); - win->Lock(); - if (dev) dev->mouse_handler(dev, last_x = (int)p.x, last_y = (int)p.y, B_DOWN | (b == 2 ? B_RIGHT : b == 3 ? B_MIDDLE : B_LEFT)); - ath_lock->Unlock(); - write(wpipe, " ", 1); -} - -void LinksView::MouseUp(const Point &p, uint32 b, Message *m) -{ - win->Unlock(); - ath_lock->Lock(); - win->Lock(); - if (dev) dev->mouse_handler(dev, last_x = (int)p.x, last_y = (int)p.y, B_UP | (b == 2 ? B_RIGHT : b == 3 ? B_MIDDLE : B_LEFT)); - ath_lock->Unlock(); - write(wpipe, " ", 1); -} - -void LinksView::MouseMove(const Point &p, int c, uint32 b, Message *m) -{ - win->Unlock(); - ath_lock->Lock(); - win->Lock(); - if (dev) dev->mouse_handler(dev, last_x = (int)p.x, last_y = (int)p.y, !b ? B_MOVE : B_DRAG | (b & 1 ? B_LEFT : b & 2 ? B_RIGHT : b & 4 ? B_MIDDLE : B_LEFT)); - ath_lock->Unlock(); - write(wpipe, " ", 1); -} - -void LinksView::WheelMoved(const Point &d) -{ - win->Unlock(); - ath_lock->Lock(); - win->Lock(); - if (d.y) if (dev) dev->mouse_handler(dev, last_x, last_y, B_MOVE | (d.y > 0 ? B_WHEELDOWN : B_WHEELUP)); - if (d.x) if (dev) dev->mouse_handler(dev, last_x, last_y, B_MOVE | (d.x < 0 ? B_WHEELLEFT : B_WHEELRIGHT)); - ath_lock->Unlock(); - write(wpipe, " ", 1); -} - -void LinksView::KeyDown(const char *s, const char *rs, uint32 q) -{ - int c; - unsigned char *ss = q & (QUAL_CTRL | QUAL_ALT) ? (unsigned char *)rs : (unsigned char *)s; - win->Unlock(); - ath_lock->Lock(); - win->Lock(); - GET_UTF_8(ss, c); - switch (c) { - case VK_BACKSPACE: c = KBD_BS; break; - case VK_ENTER: c = KBD_ENTER; break; - case VK_SPACE: c = ' '; break; - case VK_TAB: c = KBD_TAB; break; - case VK_ESCAPE: c = KBD_ESC; break; - case VK_LEFT_ARROW: c = KBD_LEFT; break; - case VK_RIGHT_ARROW: c = KBD_RIGHT; break; - case VK_UP_ARROW: c = KBD_UP; break; - case VK_DOWN_ARROW: c = KBD_DOWN; break; - case VK_INSERT: c = KBD_INS; break; - case VK_DELETE: c = KBD_DEL; break; - case VK_HOME: c = KBD_HOME; break; - case VK_END: c = KBD_END; break; - case VK_PAGE_UP: c = KBD_PAGE_UP; break; - case VK_PAGE_DOWN: c = KBD_PAGE_DOWN; break; - default: if (c < 32) c = 0; - else q &= ~QUAL_SHIFT; - break; - } - if (c) if (dev) dev->keyboard_handler(dev, c, (q & QUAL_SHIFT ? KBD_SHIFT : 0) | (q & QUAL_CTRL ? KBD_CTRL : 0) | (q & QUAL_ALT ? KBD_ALT : 0)); - ath_lock->Unlock(); - write(wpipe, " ", 1); - /*debug2("key: :%s: :%s: %d %d\n", s, rs, q, c);*/ -} - -unsigned char *ath_get_driver_param(void) -{ - return NULL; -} - -uint32 ath_app_thread(void *p) -{ - ath_links_app->Run(); - delete ath_links_app; - return 0; -} - -unsigned char *ath_init_driver(unsigned char *param, unsigned char *display) -{ - Desktop *d; - ath_links_app = new LinksApplication(); - if (!ath_links_app) { - return stracpy((unsigned char *)"Unable to allocate Application object.\n"); - } - ath_lock = new Locker("links_sem", false, false); - if (!ath_lock || ath_lock->Lock()) { - delete ath_links_app; - return stracpy((unsigned char *)"Could not create lock.\n"); - } - if (c_pipe(msg_pipe)) { - delete ath_lock; ath_lock = NULL; - delete ath_links_app; - return stracpy((unsigned char *)"Could not create pipe.\n"); - } - fcntl(rpipe, F_SETFL, O_NONBLOCK); - fcntl(wpipe, F_SETFL, O_NONBLOCK); - set_handlers(rpipe, ath_get_event, NULL, NULL); - ath_app_thread_id = spawn_thread("links_app", (void *)ath_app_thread, 0, 0, NULL); - if (ath_app_thread_id == -1) { - close(rpipe); - close(wpipe); - delete ath_lock; ath_lock = NULL; - delete ath_links_app; - return stracpy((unsigned char *)"Could not spawn thread.\n"); - } - resume_thread(ath_app_thread_id); - if ((d = new Desktop)) { - ath_cs_desktop = d->GetColorSpace(); - ath_x_size = d->GetResolution().x; - ath_y_size = d->GetResolution().y; - delete d; - } else { - ath_cs_desktop = CS_NO_COLOR_SPACE; - ath_x_size = 640; - ath_y_size = 480; - } - ath_y_panel = WINDOW_TITLE_SIZE; -#ifdef __SYLLABLE__ - ath_y_panel += TOP_PANEL_SIZE; -#endif - if (ath_y_panel > ath_y_size) ath_y_panel = 0; - ath_win_y_size = (ath_y_size - ath_y_panel) * 9 / 10; - ath_win_x_size = ath_win_y_size; - /* - debug2("%d %d\n", ath_x_size, ath_y_size); - debug2("%d %d\n", ath_win_x_size, ath_win_y_size); - */ - ath_win_y_pos = (ath_y_size - ath_y_panel - ath_win_y_size) / 2 + ath_y_panel; - ath_win_x_pos = ath_x_size - ath_win_x_size - ath_win_y_pos; - if (/*ath_cs_desktop == CS_RGB32 ||*/ ath_cs_desktop == CS_RGB24 || ath_cs_desktop == CS_RGB16 || ath_cs_desktop == CS_RGB15) - ath_cs_bmp = ath_cs_desktop; - else if (ath_cs_desktop == CS_RGB32 || ath_cs_desktop == CS_RGBA32) ath_cs_bmp = CS_RGB24; - else ath_cs_bmp = CS_RGB15; - switch (ath_cs_bmp) { - case CS_RGB24: - atheos_driver.depth = 0xc3; - break; - case CS_RGB16: - atheos_driver.depth = 0x82; - break; - case CS_RGB15: - atheos_driver.depth = 0x7a; - break; - default: - internal("unknown depth"); - } - return NULL; -} - -void ath_shutdown_driver() -{ - debug((unsigned char *)"D"); - set_handlers(rpipe, NULL, NULL, NULL); - close(rpipe); - close(wpipe); - ath_lock->Unlock(); - debug((unsigned char *)"DD"); - ath_links_app->PostMessage(M_TERMINATE); - debug((unsigned char *)"E"); - /*delete ath_lock; ath_lock = NULL;*/ - debug((unsigned char *)"F"); -} - -void ath_after_fork() -{ - close(rpipe); - close(wpipe); -} - -struct graphics_device *ath_init_device() -{ - LinksView *view; - LinksWindow *win; - struct graphics_device *dev = (struct graphics_device *)mem_calloc(sizeof(struct graphics_device)); - if (!dev) return NULL; - debug((unsigned char *)"1"); - retry: - win = new LinksWindow(Rect(ath_win_x_pos, ath_win_y_pos, ath_win_x_pos + ath_win_x_size, ath_win_y_pos + ath_win_y_size)); - debug((unsigned char *)"2"); - if (!win) { - if (out_of_memory(0, NULL, 0)) - goto retry; - mem_free(dev); - return NULL; - } - debug((unsigned char *)"3"); - retry2: - view = new LinksView(win); - if (!view) { - if (out_of_memory(0, NULL, 0)) - goto retry2; - delete win; - mem_free(dev); - return NULL; - } - view->dev = dev; - dev->driver_data = view; - ath_get_size(dev); - memcpy(&dev->clip, &dev->size, sizeof(struct rect)); - debug((unsigned char *)"4"); - win->Show(); - win->MakeFocus(); - debug((unsigned char *)"5"); - - ath_win_x_pos += NEW_WINDOW_X_ADD; - ath_win_y_pos += NEW_WINDOW_Y_ADD; - if (ath_win_x_pos + ath_win_x_size > ath_x_size - NEW_WINDOW_X_MIN) - ath_win_x_pos = NEW_WINDOW_X_MIN; - if (ath_win_y_pos + ath_win_y_size > ath_y_size - NEW_WINDOW_Y_MIN) - ath_win_y_pos = ath_y_panel + NEW_WINDOW_Y_MIN; - - return dev; -} - -void ath_shutdown_device(struct graphics_device *dev) -{ - LinksWindow *win = lv(dev)->win; - unregister_bottom_half(do_flush, dev); - lv(dev)->dev = NULL; - win->PostMessage(M_TERMINATE); - mem_free(dev); -} - -void ath_set_title(struct graphics_device *dev, unsigned char *title) -{ - LinksWindow *win = lv(dev)->win; - lock_dev(dev); - win->SetTitle(string((char *)title)); - lv(dev)->d_flush(); - unlock_dev(dev); -} - -int ath_get_empty_bitmap(struct bitmap *bmp) -{ - debug2("bmp\n"); - Bitmap *b; - retry: - b = new Bitmap(bmp->x, bmp->y, ath_cs_bmp, Bitmap::SHARE_FRAMEBUFFER); - if (!b) { - if (out_of_memory(0, NULL, 0)) - goto retry; - bmp->data = NULL; - bmp->flags = NULL; - return -1; - } - bmp->data = b->LockRaster(); - bmp->skip = b->GetBytesPerRow(); - bmp->flags = b; - return 0; -} - -void ath_register_bitmap(struct bitmap *bmp) -{ - Bitmap *b = (Bitmap *)bmp->flags; - if (!b) return; - b->UnlockRaster(); -} - -void *ath_prepare_strip(struct bitmap *bmp, int top, int lines) -{ - debug2("preps\n"); - Bitmap *b = (Bitmap *)bmp->flags; - if (!b) return NULL; - bmp->data = b->LockRaster(); - bmp->skip = b->GetBytesPerRow(); - return ((char *)bmp->data) + bmp->skip * top; -} - -void ath_commit_strip(struct bitmap *bmp, int top, int lines) -{ - Bitmap *b = (Bitmap *)bmp->flags; - if (!b) return; - b->UnlockRaster(); -} - -void ath_unregister_bitmap(struct bitmap *bmp) -{ - debug2("unb\n"); - Bitmap *b = (Bitmap *)bmp->flags; - if (!b) return; - delete b; -} - -void ath_draw_bitmap(struct graphics_device *dev, struct bitmap *bmp, int x, int y) -{ - debug2("drawb\n"); - Bitmap *b = (Bitmap *)bmp->flags; - if (!b) return; - lock_dev(dev); - lv(dev)->DrawBitmap(b, b->GetBounds(), Rect(x, y, x + bmp->x - 1, y + bmp->y - 1)); - lv(dev)->d_flush(); - unlock_dev(dev); -} - -long ath_get_color(int rgb) -{ - if (small_color) { - get_color32(c, rgb); - return *(long *)(void *)&c; - } else return rgb & 0xffffff; -} - -void ath_fill_area(struct graphics_device *dev, int x1, int y1, int x2, int y2, long color) -{ - debug2("fill\n"); - if (x1 >= x2 || y1 >= y2) return; - lock_dev(dev); - if (small_color) - lv(dev)->FillRect(Rect(x1, y1, x2 - 1, y2 - 1), *(Color32_s *)(void *)&color); - else - lv(dev)->FillRect(Rect(x1, y1, x2 - 1, y2 - 1), get_color32(, color)); - lv(dev)->d_flush(); - unlock_dev(dev); -} - -void ath_draw_hline(struct graphics_device *dev, int x1, int y, int x2, long color) -{ - debug2("hline\n"); - if (x1 >= x2) return; - lock_dev(dev); - if (small_color) - lv(dev)->SetFgColor(*(Color32_s *)(void *)&color); - else - lv(dev)->SetFgColor(get_color32(, color)); - lv(dev)->DrawLine(Point(IPoint(x1, y)), Point(IPoint(x2 - 1, y))); - lv(dev)->d_flush(); - unlock_dev(dev); -} - -void ath_draw_vline(struct graphics_device *dev, int x, int y1, int y2, long color) -{ - debug2("vline\n"); - if (y1 >= y2) return; - lock_dev(dev); - if (small_color) - lv(dev)->SetFgColor(*(Color32_s *)(void *)&color); - else - lv(dev)->SetFgColor(get_color32(, color)); - lv(dev)->DrawLine(Point(IPoint(x, y1)), Point(IPoint(x, y2 - 1))); - lv(dev)->d_flush(); - unlock_dev(dev); -} - -int ath_hscroll(struct graphics_device *dev, struct rect_set **ignore, int sc) -{ - debug2("hscroll\n"); - if (dev->clip.x1 >= dev->clip.x2 || dev->clip.y1 >= dev->clip.y2) return 0; - if (sc <= dev->clip.x1 - dev->clip.x2) return 1; - if (sc >= dev->clip.x2 - dev->clip.x1) return 1; - lock_dev0(dev); - if (sc > 0) lv(dev)->ScrollRect(Rect(dev->clip.x1, dev->clip.y1, dev->clip.x2 - sc - 1, dev->clip.y2 - 1), Rect(dev->clip.x1 + sc, dev->clip.y1, dev->clip.x2 - 1, dev->clip.y2 - 1)); - else lv(dev)->ScrollRect(Rect(dev->clip.x1 - sc, dev->clip.y1, dev->clip.x2 - 1, dev->clip.y2 - 1), Rect(dev->clip.x1, dev->clip.y1, dev->clip.x2 + sc - 1, dev->clip.y2 - 1)); - lv(dev)->d_flush(); - unlock_dev(dev); - return 1; -} - -int ath_vscroll(struct graphics_device *dev, struct rect_set **ignore, int sc) -{ - debug2("vscroll\n"); - if (!sc || dev->clip.x1 >= dev->clip.x2 || dev->clip.y1 >= dev->clip.y2) return 0; - if (sc <= dev->clip.y1 - dev->clip.y2) return 1; - if (sc >= dev->clip.y2 - dev->clip.y1) return 1; - lock_dev0(dev); - if (sc > 0) lv(dev)->ScrollRect(Rect(dev->clip.x1, dev->clip.y1, dev->clip.x2 - 1, dev->clip.y2 - sc - 1), Rect(dev->clip.x1, dev->clip.y1 + sc, dev->clip.x2 - 1, dev->clip.y2 - 1)); - else lv(dev)->ScrollRect(Rect(dev->clip.x1, dev->clip.y1 - sc, dev->clip.x2 - 1, dev->clip.y2 - 1), Rect(dev->clip.x1, dev->clip.y1, dev->clip.x2 - 1, dev->clip.y2 + sc - 1)); - lv(dev)->d_flush(); - unlock_dev(dev); - return 1; -} - -void ath_set_clip_area(struct graphics_device *dev, struct rect *r) -{ - debug2("setc\n"); - generic_set_clip_area(dev, r); - lock_dev(dev); - lv(dev)->SetDrawingRegion(Region(IRect(dev->clip.x1, dev->clip.y1, dev->clip.x2 - 1, dev->clip.y2 - 1))); - unlock_dev(dev); -} - -void ath_flush(struct graphics_device *dev) -{ - unregister_bottom_half(do_flush, dev); - do_flush(dev); -} - -struct graphics_driver atheos_driver = { - (unsigned char *)"atheos", - ath_init_driver, - ath_init_device, - ath_shutdown_device, - ath_shutdown_driver, - NULL, - ath_after_fork, - ath_get_driver_param, - NULL, - NULL, - NULL, - ath_get_empty_bitmap, - ath_register_bitmap, - ath_prepare_strip, - ath_commit_strip, - ath_unregister_bitmap, - ath_draw_bitmap, - ath_get_color, - ath_fill_area, - ath_draw_hline, - ath_draw_vline, - ath_hscroll, - ath_vscroll, - ath_set_clip_area, - ath_flush, - dummy_block, - dummy_unblock, - ath_set_title, - NULL, /* exec */ - NULL, /* set_clipboard_text */ - NULL, /* get_clipboard_text */ - 0, /* depth */ - 0, 0, /* size */ - GD_UNICODE_KEYS | GD_NO_OS_SHELL | GD_NO_LIBEVENT,/* flags */ - 0, /* codepage */ - NULL, /* shell */ -}; - -#endif diff --git a/beos.c b/beos.c @@ -1,265 +0,0 @@ -/* beos.c - * (c) 2002 Mikulas Patocka - * This file is a part of the Links program, released under GPL - */ - -#if defined(__BEOS__) || defined(__HAIKU__) - -#include "com-defs.h" - -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> -#include <errno.h> -#include <fcntl.h> -#include <sys/types.h> -#include <sys/socket.h> -#include <sys/time.h> -#include <netinet/in.h> -#include <be/kernel/OS.h> - -#define SHS 128 - -#ifndef MAXINT -#define MAXINT 0x7fffffff -#endif - -#ifdef __HAIKU__ -int closesocket(int); -#endif - -#include "beos.h" - -int be_read(int s, void *ptr, int len) -{ - if (s >= SHS) return recv(s - SHS, ptr, len, 0); - return read(s, ptr, len); -} - -int be_write(int s, void *ptr, int len) -{ - if (s >= SHS) return send(s - SHS, ptr, len, 0); - return write(s, ptr, len); -} - -int be_close(int s) -{ - if (s >= SHS) return closesocket(s - SHS); - return close(s); -} - -int be_socket(int af, int sock, int prot) -{ - int h = socket(af, sock, prot); - if (h < 0) return h; - return h + SHS; -} - -int be_connect(int s, struct sockaddr *sa, int sal) -{ - return connect(s - SHS, sa, sal); -} - -int be_getpeername(int s, struct sockaddr *sa, int *sal) -{ - return getpeername(s - SHS, sa, sal); -} - -int be_getsockname(int s, struct sockaddr *sa, int *sal) -{ - return getsockname(s - SHS, sa, sal); -} - -int be_listen(int s, int c) -{ - return listen(s - SHS, c); -} - -int be_accept(int s, struct sockaddr *sa, int *sal) -{ - int a = accept(s - SHS, sa, sal); - if (a < 0) return -1; - return a + SHS; -} - -int be_bind(int s, struct sockaddr *sa, int sal) -{ - /*struct sockaddr_in *sin = (struct sockaddr_in *)sa; - if (!ntohs(sin->sin_port)) { - int i; - for (i = 16384; i < 49152; i++) { - sin->sin_port = htons(i); - if (!be_bind(s, sa, sal)) return 0; - } - return -1; - }*/ - if (bind(s - SHS, sa, sal)) return -1; - getsockname(s - SHS, sa, &sal); - return 0; -} - -#define PIPE_RETRIES 10 - -int be_pipe(int *fd) -{ - int s1, s2, s3, l; - struct sockaddr_in sa1, sa2; - int retry_count = 0; - again: - if ((s1 = be_socket(PF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0) { - /*perror("socket1");*/ - goto fatal_retry; - } - if ((s2 = be_socket(PF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0) { - /*perror("socket2");*/ - be_close(s1); - goto fatal_retry; - } - memset(&sa1, 0, sizeof(sa1)); - sa1.sin_family = AF_INET; - sa1.sin_port = htons(0); - sa1.sin_addr.s_addr = INADDR_ANY; - if (be_bind(s1, (struct sockaddr *)&sa1, sizeof(sa1))) { - /*perror("bind");*/ - clo: - be_close(s1); - be_close(s2); - goto fatal_retry; - } - if (be_listen(s1, 1)) { - /*perror("listen");*/ - goto clo; - } - if (be_connect(s2, (struct sockaddr *)&sa1, sizeof(sa1))) { - /*perror("connect");*/ - goto clo; - } - l = sizeof(sa2); - if ((s3 = be_accept(s1, (struct sockaddr *)&sa2, &l)) < 0) { - /*perror("accept");*/ - goto clo; - } - be_getsockname(s3, (struct sockaddr *)&sa1, &l); - if (sa1.sin_addr.s_addr != sa2.sin_addr.s_addr) { - be_close(s3); - goto clo; - } - be_close(s1); - fd[0] = s2; - fd[1] = s3; - return 0; - - fatal_retry: - if (++retry_count > PIPE_RETRIES) return -1; - sleep(1); - goto again; -} - -int be_select(int n, struct fd_set *rd, struct fd_set *wr, struct fd_set *exc, struct timeval *tm) -{ - int i, s; - struct fd_set d, rrd; -retry: - FD_ZERO(&d); - if (!rd) rd = &d; - if (!wr) wr = &d; - if (!exc) exc = &d; - if (n >= FD_SETSIZE) n = FD_SETSIZE; - FD_ZERO(exc); - for (i = 0; i < n; i++) if ((i < SHS && FD_ISSET(i, rd)) || FD_ISSET(i, wr)) { - for (i = SHS; i < n; i++) FD_CLR(i, rd); - return MAXINT; - } - FD_ZERO(&rrd); - for (i = SHS; i < n; i++) if (FD_ISSET(i, rd)) FD_SET(i - SHS, &rrd); - if ((s = select(FD_SETSIZE, &rrd, &d, &d, tm)) < 0) { - if (errno == EINTR) goto retry; - FD_ZERO(rd); - return 0; - } - FD_ZERO(rd); - for (i = SHS; i < n; i++) if (FD_ISSET(i - SHS, &rrd)) FD_SET(i, rd); - return s; -} - -#ifndef SO_ERROR -#define SO_ERROR 10001 -#endif - -int be_getsockopt(int s, int level, int optname, void *optval, int *optlen) -{ - if (optname == SO_ERROR && *optlen >= sizeof(int)) { - *(int *)optval = 0; - *optlen = sizeof(int); - return 0; - } - return -1; -} - -static int ihpipe[2]; - -static int inth; - -static void input_handle_th(void *p) -{ - char c; - int b = 0; - setsockopt(ihpipe[1], SOL_SOCKET, SO_NONBLOCK, &b, sizeof(b)); - while (1) if (read(0, &c, 1) == 1) be_write(ihpipe[1], &c, 1); -} - -int get_input_handle(void) -{ - static int h = -1; - if (h >= 0) return h; - if (be_pipe(ihpipe) < 0) return -1; - if ((inth = start_thr(input_handle_th, NULL, "input_thread")) < 0) { - closesocket(ihpipe[0]); - closesocket(ihpipe[1]); - fatal_exit("Can't spawn input thread"); - } - return h = ihpipe[0]; -} - -void block_stdin(void) -{ - suspend_thread(inth); -} - -void unblock_stdin(void) -{ - resume_thread(inth); -} - -/*int ohpipe[2]; - -#define O_BUF 16384 - -static void output_handle_th(void *p) -{ - char *c = malloc(O_BUF); - int r, b = 0; - if (!c) return; - setsockopt(ohpipe[1], SOL_SOCKET, SO_NONBLOCK, &b, sizeof(b)); - while ((r = be_read(ohpipe[0], c, O_BUF)) > 0) write(1, c, r); - free(c); -} - -int get_output_handle(void) -{ - static int h = -1; - if (h >= 0) return h; - if (be_pipe(ohpipe) < 0) return -1; - if (start_thr(output_handle_th, NULL, "output_thread") < 0) { - closesocket(ohpipe[0]); - closesocket(ohpipe[1]); - fatal_exit("Can't spawn output thread"); - } - return h = ohpipe[1]; -}*/ - -#else - -typedef int beos_c_no_empty_unit; - -#endif diff --git a/beos.h b/beos.h @@ -1,21 +0,0 @@ -int be_socket(int, int, int); -int be_connect(int, struct sockaddr *, int); -int be_getpeername(int, struct sockaddr *, int *); -int be_getsockname(int, struct sockaddr *, int *); -int be_listen(int, int); -int be_accept(int, struct sockaddr *, int *); -int be_bind(int, struct sockaddr *, int); -int be_pipe(int *); -int be_read(int, void *, int); -int be_write(int, void *, int); -int be_close(int); -int be_select(int, struct fd_set *, struct fd_set *, struct fd_set *, struct timeval *); -int be_getsockopt(int, int, int, void *, int *); - -int start_thr(void (*fn)(void *), void *data, unsigned char *name); - -int get_input_handle(void); -void block_stdin(void); -void unblock_stdin(void); - -void fatal_exit(char *, ...); diff --git a/hpux.c b/hpux.c @@ -1,124 +0,0 @@ -#if defined(__hpux) - -#include "cfg.h" - -#include "com-defs.h" - -#ifdef report -#include <stdio.h> -#include <unistd.h> -#endif -#include <string.h> -#include <errno.h> -#include <sys/types.h> -#include <sys/socket.h> - -#ifndef HAVE_SOCKLEN_T -#define socklen_t int -#endif - -#include "hpux.h" - -union len_t { - int intlen; - socklen_t socklen; -}; - -static int hp_detect_length(int s) -{ - static int mode_cache = -1; - union len_t u; - int val; - int r; - - if (sizeof(int) == sizeof(socklen_t)) return 0; - - if (mode_cache >= 0) return mode_cache; - - memset(&u, 1, sizeof u); - r = getsockopt(s, SOL_SOCKET, SO_ERROR, (void *)&val, (void *)&u); - if (r) return -1; - if (u.socklen == sizeof(int)) { -#ifdef report - fprintf(stderr, "detected socklen argument\n"); - sleep(1); -#endif - mode_cache = 1; - return 1; - } else if (u.intlen == sizeof(int)) { -#ifdef report - fprintf(stderr, "detected int argument\n"); - sleep(1); -#endif - mode_cache = 0; - return 0; - } else { - fatal_exit("Could not detect HP-UX socklen argument type: %lx,%x", (long)u.socklen, u.intlen); - errno = EINVAL; - return -1; - } -} - -int hp_accept(int s, struct sockaddr *addr, socklen_t *len) -{ - union len_t u; - int mode, r; - if (addr == NULL || len == NULL) return accept(s, NULL, NULL); - if ((mode = hp_detect_length(s)) == -1) return -1; - memset(&u, 0, sizeof u); - if (!mode) u.intlen = *len; - else u.socklen = *len; - r = accept(s, addr, (void *)&u); - if (!mode) *len = u.intlen; - else *len = u.socklen; - return r; -} - -int hp_getpeername(int s, struct sockaddr *addr, socklen_t *len) -{ - union len_t u; - int mode, r; - if ((mode = hp_detect_length(s)) == -1) return -1; - memset(&u, 0, sizeof u); - if (!mode) u.intlen = *len; - else u.socklen = *len; - r = getpeername(s, addr, (void *)&u); - if (!mode) *len = u.intlen; - else *len = u.socklen; - return r; -} - -int hp_getsockname(int s, struct sockaddr *addr, socklen_t *len) -{ - union len_t u; - int mode, r; - if ((mode = hp_detect_length(s)) == -1) return -1; - memset(&u, 0, sizeof u); - if (!mode) u.intlen = *len; - else u.socklen = *len; - r = getsockname(s, addr, (void *)&u); - if (!mode) *len = u.intlen; - else *len = u.socklen; - return r; -} - -int hp_getsockopt(int s, int level, int opt, void *val, socklen_t *len) -{ - union len_t u; - int mode, r; - if (val == NULL || len == NULL) return getsockopt(s, level, opt, NULL, NULL); - if ((mode = hp_detect_length(s)) == -1) return -1; - memset(&u, 0, sizeof u); - if (!mode) u.intlen = *len; - else u.socklen = *len; - r = getsockopt(s, level, opt, val, (void *)&u); - if (!mode) *len = u.intlen; - else *len = u.socklen; - return r; -} - -#else - -typedef int hpux_c_no_empty_unit; - -#endif diff --git a/hpux.h b/hpux.h @@ -1,6 +0,0 @@ -int hp_accept(int s, struct sockaddr *addr, socklen_t *len); -int hp_getpeername(int s, struct sockaddr *addr, socklen_t *len); -int hp_getsockname(int s, struct sockaddr *addr, socklen_t *len); -int hp_getsockopt(int s, int level, int opt, void *val, socklen_t *len); - -void fatal_exit(char *, ...); diff --git a/links-48x48.xpm b/links-48x48.xpm @@ -1,137 +0,0 @@ -/* XPM */ -static char * links_48x48_xpm[] = { -"48 48 86 1", -" c #000000", -". c #030000", -"+ c #000300", -"@ c #FF0000", -"# c #00FF00", -"$ c #00FC00", -"% c #E90000", -"& c #A10000", -"* c #910000", -"= c #B30000", -"- c #00EB00", -"; c #AF0000", -"> c #AB0000", -", c #870000", -"' c #550000", -") c #200000", -"! c #2F0000", -"~ c #640000", -"{ c #E70000", -"] c #260000", -"^ c #4D0000", -"/ c #7E0000", -"( c #00F700", -"_ c #810000", -": c #00F500", -"< c #830000", -"[ c #4F0000", -"} c #860000", -"| c #8A0000", -"1 c #530000", -"2 c #8F0000", -"3 c #8C0000", -"4 c #0000FF", -"5 c #00004D", -"6 c #000083", -"7 c #FFFFFF", -"8 c #00004F", -"9 c #000087", -"0 c #000053", -"a c #00008C", -"b c #00008F", -"c c #000055", -"d c #626262", -"e c #262626", -"f c #ADADAD", -"g c #292929", -"h c #00008A", -"i c #555555", -"j c #333333", -"k c #000086", -"l c #151515", -"m c #646464", -"n c #696969", -"o c #919191", -"p c #000081", -"q c #F5F5F5", -"r c #B9B9B9", -"s c #424242", -"t c #DBDBDB", -"u c #4F4F4F", -"v c #FCFCFC", -"w c #000042", -"x c #000071", -"y c #B5B5B5", -"z c #0000ED", -"A c #000096", -"B c #00000F", -"C c #00001C", -"D c #0000E7", -"E c #0000F1", -"F c #BBBBBB", -"G c #6C6C6C", -"H c #1C1C1C", -"I c #0000C1", -"J c #00003B", -"K c #000037", -"L c #000029", -"M c #000015", -"N c #373737", -"O c #0F0F0F", -"P c #0000C5", -"Q c #000045", -"R c #00003E", -"S c #3E3E3E", -"T c #676767", -"U c #0000FD", -" ", -" .................... ++++++++++++++++++++ ", -" @@@@@@@@@@@@@@@@@@@@@ ####################$ ", -" @@@@@@@@@@@@@@@@@@@@@ ##################### ", -" @@@@@@@@@@@@@@@@@@@@@ ##################### ", -" @@@@@@@@@@@@@@@@@@@@@ ##################### ", -" @@@@@@@@@@@@@@@@@@@@@ ##################### ", -" @@@%&&&&&&&&&&&&&&&&* ##################### ", -" @@@= -#################### ", -" @@@%;>&,') !~** ##################### ", -" @@@@@@@@@{] '@@@@ ####################$ ", -" @@@@@@@@@@^ /@@@@ ####################( ", -" @@@@@@@@@@^ _@@@@ ####################: ", -" @@@@@@@@@@^ <@@@@ ####################( ", -" @@@@@@@@@@[ }@@@@ ####################( ", -" @@@@@@@@@@[ |@@@@ ##################### ", -" @@@@@@@@@@1 2@@@@ ##################### ", -" @@@@@@@@@@' 2@@@@ ##################### ", -" @@@@@@@@@@' 2@@@@ ##################### ", -" @@@@@@@@@@1 2@@@@ ##################### ", -" @@@@@@@@@@1 3@@@@ ##################### ", -" @@@@@@@@@@[ ,@@@@ ##################### ", -" @@@@@@@@@@^ <@@@@ ##################### ", -" ", -" ", -" 44444444445 64444 777777777777777777777 ", -" 44444444448 94444 777777777777777777777 ", -" 44444444440 a4444 777777777777777777777 ", -" 44444444440 b4444 777777777777777777777 ", -" 4444444444c b4444 777777777777777dd7777 ", -" 4444444444c b4444 777777777777777 e7777 ", -" 44444444440 b4444 77777777777777f g7777 ", -" 44444444448 h4444 77777777777777i j7777 ", -" 44444444448 k4444 77777777777777l m7777 ", -" 44444444445 64444 7777777777777n o7777 ", -" 44444444445 p4444 777777777777ql r7777 ", -" 44444444445 64444 777777777777s t7777 ", -" 44444444445 64444 77777777777u v7777 ", -" 4444444444w x4444 777777777ye 77777 ", -" 44444444zAB CAD4E 777777FGH H77777 ", -" 444IJKLM CL NjgO j77777 ", -" 444PQQQQQQQQQQQQQQQQR SSSSSSSSSSSSSSST77777 ", -" 44444444444444444444U 777777777777777777777 ", -" 444444444444444444444 777777777777777777777 ", -" 444444444444444444444 777777777777777777777 ", -" 444444444444444444444 777777777777777777777 ", -" ", -" "}; diff --git a/links.nsi b/links.nsi @@ -1,248 +0,0 @@ -;NSIS Modern User Interface -;Basic Example Script -;Written by Joost Verburg - -SetCompressor /SOLID lzma - -;-------------------------------- -;Include Modern UI - - !include "MUI.nsh" - -;-------------------------------- -;General - - ;Name and file - Name "Links WWW Browser" - ;Icon "links.ico" - !define MUI_ICON "links.ico" - OutFile "Links-32bit-install.exe" - - ;Default installation folder - InstallDir "$PROGRAMFILES\Links" - - ;Get installation folder from registry if available - InstallDirRegKey HKCU "Software\Links" "" - - RequestExecutionLevel admin - - Var MUI_TEMP - Var STARTMENU_FOLDER - -;-------------------------------- -;Interface Settings - - !define MUI_ABORTWARNING - -;-------------------------------- -;Pages - - !insertmacro MUI_PAGE_LICENSE "COPYING" -; !insertmacro MUI_PAGE_COMPONENTS - !insertmacro MUI_PAGE_DIRECTORY - -!define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKCU" -!define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\Links" -!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Links" - -!insertmacro MUI_PAGE_STARTMENU Application $STARTMENU_FOLDER - - !insertmacro MUI_PAGE_INSTFILES - - !insertmacro MUI_UNPAGE_CONFIRM - !insertmacro MUI_UNPAGE_INSTFILES - -;-------------------------------- -;Languages - - !insertmacro MUI_LANGUAGE "English" - -;-------------------------------- -;Installer Sections - -Section "-Default Links browser files" DefaultSection - - SetOutPath "$INSTDIR" - - ;ADD YOUR OWN FILES HERE... - -File BRAILLE_HOWTO -File COPYING -File KEYS -File README -File links.crt -File links.exe -File links-g.exe -File dll\cygwin1.dll -File c:\cygwin\bin\cygEGL-1.dll -File c:\cygwin\bin\cygGL-1.dll -File c:\cygwin\bin\cygX11-6.dll -File c:\cygwin\bin\cygX11-xcb-1.dll -File c:\cygwin\bin\cygXau-6.dll -File c:\cygwin\bin\cygXdmcp-6.dll -File c:\cygwin\bin\cygXext-6.dll -File c:\cygwin\bin\cygXrender-1.dll -File c:\cygwin\bin\cygbz2-1.dll -File c:\cygwin\bin\cygcairo-2.dll -File c:\cygwin\bin\cygcroco-0.6-3.dll -File c:\cygwin\bin\cygcrypto-1.0.0.dll -File c:\cygwin\bin\cygdatrie-1.dll -File c:\cygwin\bin\cygevent-2-0-5.dll -File c:\cygwin\bin\cygexpat-1.dll -File c:\cygwin\bin\cygffi-6.dll -File c:\cygwin\bin\cygfontconfig-1.dll -File c:\cygwin\bin\cygfreetype-6.dll -File c:\cygwin\bin\cyggcc_s-1.dll -File c:\cygwin\bin\cyggdk_pixbuf-2.0-0.dll -File c:\cygwin\bin\cyggio-2.0-0.dll -File c:\cygwin\bin\cygglapi-0.dll -File c:\cygwin\bin\cygglib-2.0-0.dll -File c:\cygwin\bin\cyggmodule-2.0-0.dll -File c:\cygwin\bin\cyggobject-2.0-0.dll -File c:\cygwin\bin\cyggomp-1.dll -File c:\cygwin\bin\cyggraphite2-3.dll -File c:\cygwin\bin\cygharfbuzz-0.dll -File c:\cygwin\bin\cygiconv-2.dll -File c:\cygwin\bin\cygintl-8.dll -File c:\cygwin\bin\cygjbig-2.dll -File c:\cygwin\bin\cygjpeg-8.dll -File c:\cygwin\bin\cyglzma-5.dll -File c:\cygwin\bin\cygpango-1.0-0.dll -File c:\cygwin\bin\cygpangocairo-1.0-0.dll -File c:\cygwin\bin\cygpangoft2-1.0-0.dll -File c:\cygwin\bin\cygpcre-1.dll -File c:\cygwin\bin\cygpixman-1-0.dll -File c:\cygwin\bin\cygpng16-16.dll -File c:\cygwin\bin\cygrsvg-2-2.dll -File c:\cygwin\bin\cygssl-1.0.0.dll -File c:\cygwin\bin\cygstdc++-6.dll -File c:\cygwin\bin\cygthai-0.dll -File c:\cygwin\bin\cygtiff-6.dll -File c:\cygwin\bin\cygxcb-1.dll -File c:\cygwin\bin\cygxcb-glx-0.dll -File c:\cygwin\bin\cygxcb-render-0.dll -File c:\cygwin\bin\cygxcb-shm-0.dll -File c:\cygwin\bin\cygxml2-2.dll -File c:\cygwin\bin\cygz.dll - - ;Store installation folder - WriteRegStr HKCU "Software\Links" "" $INSTDIR - - ;Create uninstaller - WriteUninstaller "$INSTDIR\Uninstall.exe" - -WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Links32" \ - "DisplayName" "Links WWW Browser 32-bit" -WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Links32" \ - "DisplayIcon" "$INSTDIR\links.exe,0" -WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Links32" \ - "UninstallString" "$\"$INSTDIR\uninstall.exe$\"" -WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Links32" \ - "QuietUninstallString" "$\"$INSTDIR\uninstall.exe$\" /S" -WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Links32" \ - "NoModify" 0x00000001 -WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Links32" \ - "NoRepair" 0x00000001 - -!insertmacro MUI_STARTMENU_WRITE_BEGIN Application - -CreateDirectory "$SMPROGRAMS\$STARTMENU_FOLDER" -CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Links.lnk" "$INSTDIR\Links.exe" -CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Links Graphics.lnk" "$INSTDIR\Links-g.exe" "-g" -CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Uninstall.lnk" "$INSTDIR\Uninstall.exe" -!insertmacro MUI_STARTMENU_WRITE_END -SectionEnd - - -;-------------------------------- -;Uninstaller Section - -Section "Uninstall" - - ;ADD YOUR OWN FILES HERE... -Delete "$INSTDIR\BRAILLE_HOWTO" -Delete "$INSTDIR\COPYING" -Delete "$INSTDIR\KEYS" -Delete "$INSTDIR\README" -Delete "$INSTDIR\links.crt" -Delete "$INSTDIR\links.exe" -Delete "$INSTDIR\links-g.exe" -Delete "$INSTDIR\cygEGL-1.dll" -Delete "$INSTDIR\cygGL-1.dll" -Delete "$INSTDIR\cygX11-6.dll" -Delete "$INSTDIR\cygX11-xcb-1.dll" -Delete "$INSTDIR\cygXau-6.dll" -Delete "$INSTDIR\cygXdmcp-6.dll" -Delete "$INSTDIR\cygXext-6.dll" -Delete "$INSTDIR\cygXrender-1.dll" -Delete "$INSTDIR\cygbz2-1.dll" -Delete "$INSTDIR\cygcairo-2.dll" -Delete "$INSTDIR\cygcroco-0.6-3.dll" -Delete "$INSTDIR\cygcrypto-1.0.0.dll" -Delete "$INSTDIR\cygdatrie-1.dll" -Delete "$INSTDIR\cygevent-2-0-5.dll" -Delete "$INSTDIR\cygexpat-1.dll" -Delete "$INSTDIR\cygffi-6.dll" -Delete "$INSTDIR\cygfontconfig-1.dll" -Delete "$INSTDIR\cygfreetype-6.dll" -Delete "$INSTDIR\cyggcc_s-1.dll" -Delete "$INSTDIR\cyggdk_pixbuf-2.0-0.dll" -Delete "$INSTDIR\cyggio-2.0-0.dll" -Delete "$INSTDIR\cygglapi-0.dll" -Delete "$INSTDIR\cygglib-2.0-0.dll" -Delete "$INSTDIR\cyggmodule-2.0-0.dll" -Delete "$INSTDIR\cyggobject-2.0-0.dll" -Delete "$INSTDIR\cyggomp-1.dll" -Delete "$INSTDIR\cyggraphite2-3.dll" -Delete "$INSTDIR\cygharfbuzz-0.dll" -Delete "$INSTDIR\cygiconv-2.dll" -Delete "$INSTDIR\cygintl-8.dll" -Delete "$INSTDIR\cygjbig-2.dll" -Delete "$INSTDIR\cygjpeg-8.dll" -Delete "$INSTDIR\cyglzma-5.dll" -Delete "$INSTDIR\cygpango-1.0-0.dll" -Delete "$INSTDIR\cygpangocairo-1.0-0.dll" -Delete "$INSTDIR\cygpangoft2-1.0-0.dll" -Delete "$INSTDIR\cygpcre-1.dll" -Delete "$INSTDIR\cygpixman-1-0.dll" -Delete "$INSTDIR\cygpng16-16.dll" -Delete "$INSTDIR\cygrsvg-2-2.dll" -Delete "$INSTDIR\cygssl-1.0.0.dll" -Delete "$INSTDIR\cygstdc++-6.dll" -Delete "$INSTDIR\cygthai-0.dll" -Delete "$INSTDIR\cygtiff-6.dll" -Delete "$INSTDIR\cygwin1.dll" -Delete "$INSTDIR\cygxcb-1.dll" -Delete "$INSTDIR\cygxcb-glx-0.dll" -Delete "$INSTDIR\cygxcb-render-0.dll" -Delete "$INSTDIR\cygxcb-shm-0.dll" -Delete "$INSTDIR\cygxml2-2.dll" -Delete "$INSTDIR\cygz.dll" -Delete "$INSTDIR\.links\*" -RMDir "$INSTDIR\.links" - - Delete "$INSTDIR\Uninstall.exe" - - RMDir "$INSTDIR" - -!insertmacro MUI_STARTMENU_GETFOLDER Application $MUI_TEMP - -Delete "$SMPROGRAMS\$MUI_TEMP\Uninstall.lnk" -Delete "$SMPROGRAMS\$MUI_TEMP\Links.lnk" -Delete "$SMPROGRAMS\$MUI_TEMP\Links Graphics.lnk" -StrCpy $MUI_TEMP "$SMPROGRAMS\$MUI_TEMP" - -startMenuDeleteLoop: -ClearErrors -RMDir $MUI_TEMP -GetFullPathName $MUI_TEMP "$MUI_TEMP\.." - -IfErrors startMenuDeleteLoopDone - -StrCmp $MUI_TEMP $SMPROGRAMS startMenuDeleteLoopDone startMenuDeleteLoop -startMenuDeleteLoopDone: - -DeleteRegKey /ifempty HKCU "Software\Links" -DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Links32" - -SectionEnd diff --git a/links.wis b/links.wis @@ -1,43 +0,0 @@ -<WARPIN> -<HEAD> -<PCK INDEX="1" - PACKAGEID="Mikulas Patocka\Links\Base package\2\16" - TARGET="?:\Links" - SELECT - TITLE="Links" - CREATEOBJECT="WPFolder|Links|<WP_DESKTOP>|OBJECTID=<Links_Folder>;" - CREATEOBJECT="WPProgram|Links Window|<Links_Folder>|EXENAME=$(1)\links.exe;PROGTYPE=WINDOWABLEVIO;STARTUPDIR=$(1);OBJECTID=<Links_Window>;" - CREATEOBJECT="WPProgram|Links Full Screen|<Links_Folder>|EXENAME=$(1)\links.exe;PROGTYPE=FULLSCREEN;STARTUPDIR=$(1);OBJECTID=<Links_Full_Screen>;" - CREATEOBJECT="WPProgram|Links Graphics|<Links_Folder>|EXENAME=$(1)\links.exe;PARAMETERS=-g;PROGTYPE=PM;STARTUPDIR=$(1);ICONFILE=$(1)\linksos2.ico;OBJECTID=<Links_PMShell>;" - CONFIGSYS="SET PATH=$(1) | ADDRIGHT" - CONFIGSYS="LIBPATH=$(1) | ADDRIGHT" - >Links is a WWW browser</PCK> -</HEAD> -<BODY> -<PAGE INDEX="1" TYPE="TEXT"> -<NEXTBUTTON TARGET="2">~Next</NEXTBUTTON> -<TEXT> -This package contains Links browser for OS/2. - -You need to have EMX runtime 0.9c or 0.9d installed. -</TEXT> -</PAGE> -<PAGE INDEX="2" TYPE="CONTAINER"> -<NEXTBUTTON TARGET="3">~Next</NEXTBUTTON> -<TEXT> -On this page, you may change the package's target path. </TEXT> -</PAGE> -<PAGE INDEX="3" TYPE="CONFIGURE"> -<TEXT> -Here you can select if you want to modify config.sys or create Workplace Shell objects. - -You need to modify config.sys if you want to run Links from OS/2 command line. If you want to run Links from Workplace Shell and not from command line, you don't need to modify config.sys. -</TEXT> -</PAGE> -<PAGE INDEX="4" TYPE="TEXT"> -<NEXTBUTTON TARGET="0">I~nstall</NEXTBUTTON> -<TEXT> -Press "Install" to begin installing this archive.</TEXT> -</PAGE> -</BODY> -</WARPIN> diff --git a/links64.nsi b/links64.nsi @@ -1,248 +0,0 @@ -;NSIS Modern User Interface -;Basic Example Script -;Written by Joost Verburg - -SetCompressor /SOLID lzma - -;-------------------------------- -;Include Modern UI - - !include "MUI.nsh" - -;-------------------------------- -;General - - ;Name and file - Name "Links WWW Browser" - ;Icon "links.ico" - !define MUI_ICON "links.ico" - OutFile "Links-64bit-install.exe" - - ;Default installation folder - InstallDir "$PROGRAMFILES64\Links" - - ;Get installation folder from registry if available - InstallDirRegKey HKCU "Software\Links" "" - - RequestExecutionLevel admin - - Var MUI_TEMP - Var STARTMENU_FOLDER - -;-------------------------------- -;Interface Settings - - !define MUI_ABORTWARNING - -;-------------------------------- -;Pages - - !insertmacro MUI_PAGE_LICENSE "COPYING" -; !insertmacro MUI_PAGE_COMPONENTS - !insertmacro MUI_PAGE_DIRECTORY - -!define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKCU" -!define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\Links" -!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Links" - -!insertmacro MUI_PAGE_STARTMENU Application $STARTMENU_FOLDER - - !insertmacro MUI_PAGE_INSTFILES - - !insertmacro MUI_UNPAGE_CONFIRM - !insertmacro MUI_UNPAGE_INSTFILES - -;-------------------------------- -;Languages - - !insertmacro MUI_LANGUAGE "English" - -;-------------------------------- -;Installer Sections - -Section "-Default Links browser files" DefaultSection - - SetOutPath "$INSTDIR" - - ;ADD YOUR OWN FILES HERE... - -File BRAILLE_HOWTO -File COPYING -File KEYS -File README -File links.crt -File links.exe -File links-g.exe -File dll\cygwin1.dll -File c:\cygwin64\bin\cygEGL-1.dll -File c:\cygwin64\bin\cygGL-1.dll -File c:\cygwin64\bin\cygX11-6.dll -File c:\cygwin64\bin\cygX11-xcb-1.dll -File c:\cygwin64\bin\cygXau-6.dll -File c:\cygwin64\bin\cygXdmcp-6.dll -File c:\cygwin64\bin\cygXext-6.dll -File c:\cygwin64\bin\cygXrender-1.dll -File c:\cygwin64\bin\cygbz2-1.dll -File c:\cygwin64\bin\cygcairo-2.dll -File c:\cygwin64\bin\cygcroco-0.6-3.dll -File c:\cygwin64\bin\cygcrypto-1.0.0.dll -File c:\cygwin64\bin\cygdatrie-1.dll -File c:\cygwin64\bin\cygevent-2-0-5.dll -File c:\cygwin64\bin\cygexpat-1.dll -File c:\cygwin64\bin\cygffi-6.dll -File c:\cygwin64\bin\cygfontconfig-1.dll -File c:\cygwin64\bin\cygfreetype-6.dll -File c:\cygwin64\bin\cyggcc_s-seh-1.dll -File c:\cygwin64\bin\cyggdk_pixbuf-2.0-0.dll -File c:\cygwin64\bin\cyggio-2.0-0.dll -File c:\cygwin64\bin\cygglapi-0.dll -File c:\cygwin64\bin\cygglib-2.0-0.dll -File c:\cygwin64\bin\cyggmodule-2.0-0.dll -File c:\cygwin64\bin\cyggobject-2.0-0.dll -File c:\cygwin64\bin\cyggomp-1.dll -File c:\cygwin64\bin\cyggraphite2-3.dll -File c:\cygwin64\bin\cygharfbuzz-0.dll -File c:\cygwin64\bin\cygiconv-2.dll -File c:\cygwin64\bin\cygintl-8.dll -File c:\cygwin64\bin\cygjbig-2.dll -File c:\cygwin64\bin\cygjpeg-8.dll -File c:\cygwin64\bin\cyglzma-5.dll -File c:\cygwin64\bin\cygpango-1.0-0.dll -File c:\cygwin64\bin\cygpangocairo-1.0-0.dll -File c:\cygwin64\bin\cygpangoft2-1.0-0.dll -File c:\cygwin64\bin\cygpcre-1.dll -File c:\cygwin64\bin\cygpixman-1-0.dll -File c:\cygwin64\bin\cygpng16-16.dll -File c:\cygwin64\bin\cygrsvg-2-2.dll -File c:\cygwin64\bin\cygssl-1.0.0.dll -File c:\cygwin64\bin\cygstdc++-6.dll -File c:\cygwin64\bin\cygthai-0.dll -File c:\cygwin64\bin\cygtiff-6.dll -File c:\cygwin64\bin\cygxcb-1.dll -File c:\cygwin64\bin\cygxcb-glx-0.dll -File c:\cygwin64\bin\cygxcb-render-0.dll -File c:\cygwin64\bin\cygxcb-shm-0.dll -File c:\cygwin64\bin\cygxml2-2.dll -File c:\cygwin64\bin\cygz.dll - - ;Store installation folder - WriteRegStr HKCU "Software\Links" "" $INSTDIR - - ;Create uninstaller - WriteUninstaller "$INSTDIR\Uninstall.exe" - -WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Links64" \ - "DisplayName" "Links WWW Browser 64-bit" -WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Links64" \ - "DisplayIcon" "$INSTDIR\links.exe,0" -WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Links64" \ - "UninstallString" "$\"$INSTDIR\uninstall.exe$\"" -WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Links64" \ - "QuietUninstallString" "$\"$INSTDIR\uninstall.exe$\" /S" -WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Links64" \ - "NoModify" 0x00000001 -WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Links64" \ - "NoRepair" 0x00000001 - -!insertmacro MUI_STARTMENU_WRITE_BEGIN Application - -CreateDirectory "$SMPROGRAMS\$STARTMENU_FOLDER" -CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Links.lnk" "$INSTDIR\Links.exe" -CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Links Graphics.lnk" "$INSTDIR\Links-g.exe" "-g" -CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Uninstall.lnk" "$INSTDIR\Uninstall.exe" -!insertmacro MUI_STARTMENU_WRITE_END -SectionEnd - - -;-------------------------------- -;Uninstaller Section - -Section "Uninstall" - - ;ADD YOUR OWN FILES HERE... -Delete "$INSTDIR\BRAILLE_HOWTO" -Delete "$INSTDIR\COPYING" -Delete "$INSTDIR\KEYS" -Delete "$INSTDIR\README" -Delete "$INSTDIR\links.crt" -Delete "$INSTDIR\links.exe" -Delete "$INSTDIR\links-g.exe" -Delete "$INSTDIR\cygEGL-1.dll" -Delete "$INSTDIR\cygGL-1.dll" -Delete "$INSTDIR\cygX11-6.dll" -Delete "$INSTDIR\cygX11-xcb-1.dll" -Delete "$INSTDIR\cygXau-6.dll" -Delete "$INSTDIR\cygXdmcp-6.dll" -Delete "$INSTDIR\cygXext-6.dll" -Delete "$INSTDIR\cygXrender-1.dll" -Delete "$INSTDIR\cygbz2-1.dll" -Delete "$INSTDIR\cygcairo-2.dll" -Delete "$INSTDIR\cygcroco-0.6-3.dll" -Delete "$INSTDIR\cygcrypto-1.0.0.dll" -Delete "$INSTDIR\cygdatrie-1.dll" -Delete "$INSTDIR\cygevent-2-0-5.dll" -Delete "$INSTDIR\cygexpat-1.dll" -Delete "$INSTDIR\cygffi-6.dll" -Delete "$INSTDIR\cygfontconfig-1.dll" -Delete "$INSTDIR\cygfreetype-6.dll" -Delete "$INSTDIR\cyggcc_s-seh-1.dll" -Delete "$INSTDIR\cyggdk_pixbuf-2.0-0.dll" -Delete "$INSTDIR\cyggio-2.0-0.dll" -Delete "$INSTDIR\cygglapi-0.dll" -Delete "$INSTDIR\cygglib-2.0-0.dll" -Delete "$INSTDIR\cyggmodule-2.0-0.dll" -Delete "$INSTDIR\cyggobject-2.0-0.dll" -Delete "$INSTDIR\cyggomp-1.dll" -Delete "$INSTDIR\cyggraphite2-3.dll" -Delete "$INSTDIR\cygharfbuzz-0.dll" -Delete "$INSTDIR\cygiconv-2.dll" -Delete "$INSTDIR\cygintl-8.dll" -Delete "$INSTDIR\cygjbig-2.dll" -Delete "$INSTDIR\cygjpeg-8.dll" -Delete "$INSTDIR\cyglzma-5.dll" -Delete "$INSTDIR\cygpango-1.0-0.dll" -Delete "$INSTDIR\cygpangocairo-1.0-0.dll" -Delete "$INSTDIR\cygpangoft2-1.0-0.dll" -Delete "$INSTDIR\cygpcre-1.dll" -Delete "$INSTDIR\cygpixman-1-0.dll" -Delete "$INSTDIR\cygpng16-16.dll" -Delete "$INSTDIR\cygrsvg-2-2.dll" -Delete "$INSTDIR\cygssl-1.0.0.dll" -Delete "$INSTDIR\cygstdc++-6.dll" -Delete "$INSTDIR\cygthai-0.dll" -Delete "$INSTDIR\cygtiff-6.dll" -Delete "$INSTDIR\cygwin1.dll" -Delete "$INSTDIR\cygxcb-1.dll" -Delete "$INSTDIR\cygxcb-glx-0.dll" -Delete "$INSTDIR\cygxcb-render-0.dll" -Delete "$INSTDIR\cygxcb-shm-0.dll" -Delete "$INSTDIR\cygxml2-2.dll" -Delete "$INSTDIR\cygz.dll" -Delete "$INSTDIR\.links\*" -RMDir "$INSTDIR\.links" - - Delete "$INSTDIR\Uninstall.exe" - - RMDir "$INSTDIR" - -!insertmacro MUI_STARTMENU_GETFOLDER Application $MUI_TEMP - -Delete "$SMPROGRAMS\$MUI_TEMP\Uninstall.lnk" -Delete "$SMPROGRAMS\$MUI_TEMP\Links.lnk" -Delete "$SMPROGRAMS\$MUI_TEMP\Links Graphics.lnk" -StrCpy $MUI_TEMP "$SMPROGRAMS\$MUI_TEMP" - -startMenuDeleteLoop: -ClearErrors -RMDir $MUI_TEMP -GetFullPathName $MUI_TEMP "$MUI_TEMP\.." - -IfErrors startMenuDeleteLoopDone - -StrCmp $MUI_TEMP $SMPROGRAMS startMenuDeleteLoopDone startMenuDeleteLoop -startMenuDeleteLoopDone: - -DeleteRegKey /ifempty HKCU "Software\Links" -DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Links64" - -SectionEnd diff --git a/links_16x16_1.xpm b/links_16x16_1.xpm @@ -1,25 +0,0 @@ -/* XPM */ -static char * links_xpm[] = { -"16 16 6 1", -" c None", -". c #FF0000", -"+ c #000000", -"@ c #00FF00", -"# c #0800FF", -"$ c #FFFFFF", -".......++@@@@@@@", -".......++@@@@@@@", -"..+++++++@@@@@@@", -"....++.++@@@@@@@", -"....++.++@@@@@@@", -"....++.++@@@@@@@", -"....++.++@@@@@@@", -"++++++++++++++++", -"++++++++++++++++", -"####++#++$$$$$$$", -"####++#++$$$$$$$", -"####++#++$$$$+$$", -"####++#++$$$++$$", -"##++++++++++++$$", -"#######++$$$$$$$", -"#######++$$$$$$$"}; diff --git a/links_16x16_2.xpm b/links_16x16_2.xpm @@ -1,78 +0,0 @@ -/* XPM */ -static char * links_16x16_2_xpm[] = { -"16 16 59 1", -" c None", -". c #FF0000", -"+ c #680000", -"@ c #006800", -"# c #00FF00", -"$ c #CB0000", -"% c #760000", -"& c #300000", -"* c #E10000", -"= c #AE0000", -"- c #6A0000", -"; c #000000", -"> c #920000", -", c #470000", -"' c #C30000", -") c #020000", -"! c #FE0000", -"~ c #4F0000", -"{ c #010000", -"] c #670000", -"^ c #2A0000", -"/ c #002A00", -"( c #000068", -"_ c #00004F", -": c #000001", -"< c #000067", -"[ c #00002A", -"} c #2A2A2A", -"| c #686868", -"1 c #0000FF", -"2 c #0000C3", -"3 c #000002", -"4 c #0000FE", -"5 c #FFFFFF", -"6 c #EBEBEB", -"7 c #A5A5A5", -"8 c #A7A7A7", -"9 c #545454", -"0 c #4D4D4D", -"a c #6A6A6A", -"b c #B0B0B0", -"c c #010101", -"d c #7F7F7F", -"e c #0000D8", -"f c #000097", -"g c #000058", -"h c #000075", -"i c #00003E", -"j c #3D3D3D", -"k c #848484", -"l c #494949", -"m c #020202", -"n c #959595", -"o c #0000D4", -"p c #00008D", -"q c #000039", -"r c #393939", -"s c #8D8D8D", -"t c #D6D6D6", -".......+@#######", -".$%%%%%&@#######", -".*=-;;>,@#######", -"...';)!+@#######", -"...';)!+@#######", -"...';)!+@#######", -"...';)!+@#######", -"+++~;{]^/@@@@@@@", -"(((_;:<[}|||||||", -"1112;34(|5556755", -"1112;34(|5558955", -"1112;34(|5550a55", -"1112;34(|55bcd55", -"1efg;;hijklm;n55", -"1opppppqrsssst55", -"1111111(|5555555"}; diff --git a/links_32x32.xpm b/links_32x32.xpm @@ -1,115 +0,0 @@ -/* XPM */ -static char * links_32x32_xpm[] = { -"32 32 80 1", -" c None", -". c #FF0000", -"+ c #D00000", -"@ c #000000", -"# c #00D000", -"$ c #00FF00", -"% c #F10000", -"& c #EC0000", -"* c #C00000", -"= c #3E0000", -"- c #880000", -"; c #620000", -"> c #5A0000", -", c #3C0000", -"' c #020000", -") c #170000", -"! c #500000", -"~ c #4D0000", -"{ c #6C0000", -"] c #E40000", -"^ c #040000", -"/ c #FD0000", -"( c #6E0000", -"_ c #030000", -": c #CD0000", -"< c #A90000", -"[ c #00A900", -"} c #0000D0", -"| c #00006E", -"1 c #000003", -"2 c #0000CD", -"3 c #0000A9", -"4 c #A9A9A9", -"5 c #D0D0D0", -"6 c #0000FF", -"7 c #000088", -"8 c #000004", -"9 c #0000FD", -"0 c #FFFFFF", -"a c #AEAEAE", -"b c #0A0A0A", -"c c #8D8D8D", -"d c #747474", -"e c #9D9D9D", -"f c #2B2B2B", -"g c #B3B3B3", -"h c #D2D2D2", -"i c #C8C8C8", -"j c #636363", -"k c #DEDEDE", -"l c #CFCFCF", -"m c #040404", -"n c #F3F3F3", -"o c #D5D5D5", -"p c #1F1F1F", -"q c #FEFEFE", -"r c #0000FC", -"s c #000055", -"t c #0000BD", -"u c #0000FE", -"v c #F5F5F5", -"w c #BEBEBE", -"x c #666666", -"y c #070707", -"z c #202020", -"A c #000064", -"B c #000033", -"C c #00002C", -"D c #000010", -"E c #000018", -"F c #000027", -"G c #242424", -"H c #1B1B1B", -"I c #030303", -"J c #363636", -"K c #000052", -"L c #00001A", -"M c #000015", -"N c #161616", -"O c #5D5D5D", -"..............+@@#$$$$$$$$$$$$$$", -"..............+@@#$$$$$$$$$$$$$$", -"...%&&&&&&&&&&*@@#$$$$$$$$$$$$$$", -"...=@@@@@@@@@@@@@#$$$$$$$$$$$$$$", -"...-;>,'@@@@)!~@@#$$$$$$$$$$$$$$", -".......{@@@@].+@@#$$$$$$$$$$$$$$", -".......-@@@^/.+@@#$$$$$$$$$$$$$$", -".......-@@@^/.+@@#$$$$$$$$$$$$$$", -".......-@@@^/.+@@#$$$$$$$$$$$$$$", -".......-@@@^/.+@@#$$$$$$$$$$$$$$", -".......-@@@^/.+@@#$$$$$$$$$$$$$$", -".......-@@@^/.+@@#$$$$$$$$$$$$$$", -".......-@@@^/.+@@#$$$$$$$$$$$$$$", -".......-@@@^/.+@@#$$$$$$$$$$$$$$", -"+++++++(@@@_:+<@@[##############", -"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@", -"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@", -"}}}}}}}|@@@12}3@@455555555555555", -"66666667@@@896}@@500000000000000", -"66666667@@@896}@@50000000abc0000", -"66666667@@@896}@@50000000d@e0000", -"66666667@@@896}@@50000000f@g0000", -"66666667@@@896}@@5000000h@@i0000", -"66666667@@@896}@@5000000j@@k0000", -"66666667@@@896}@@500000lm@@n0000", -"66666667@@@896}@@50000op@@bq0000", -"666666rs@@@@tu}@@50vwxy@@@z00000", -"666ABCD@@@@@@EF@@GHI@@@@@@J00000", -"666KLLLLLLLLLLM@@NHHHHHHHHO00000", -"66666666666666}@@500000000000000", -"66666666666666}@@500000000000000", -"66666666666666}@@500000000000000"}; diff --git a/linksos2.ico b/linksos2.ico Binary files differ. diff --git a/linksos2.rc b/linksos2.rc @@ -1 +0,0 @@ -POINTER 1 LOADONCALL MOVEABLE DISCARDABLE linksos2.ico diff --git a/linkswin.ico b/linkswin.ico Binary files differ. diff --git a/linkswin.rc b/linkswin.rc @@ -1 +0,0 @@ -1 ICON DISCARDABLE "linkswin.ico" diff --git a/vms-gfx-32.opt b/vms-gfx-32.opt @@ -1,4 +0,0 @@ -SYS$LIBRARY:DECW$XLIBSHR.EXE/SHAREABLE -GNV$GNU:[USR.LIB]GNV$LIBJPEG.EXE/SHAREABLE -GNV$GNU:[USR.LIB]GNV$LIBPNG.EXE/SHAREABLE -GNV$GNU:[USR.LIB]GNV$LIBTIFF.EXE/SHAREABLE diff --git a/vms-gnu-text-32.opt b/vms-gnu-text-32.opt @@ -1 +0,0 @@ -GNV$GNU:[USR.LIB]GNV$LIBZSHR.EXE/SHAREABLE diff --git a/vms-ssl-32.opt b/vms-ssl-32.opt @@ -1,2 +0,0 @@ -SYS$LIBRARY:SSL$LIBCRYPTO_SHR32.EXE/SHAREABLE -SYS$LIBRARY:SSL$LIBSSL_SHR32.EXE/SHAREABLE diff --git a/vms-ssl-64.opt b/vms-ssl-64.opt @@ -1,2 +0,0 @@ -SYS$LIBRARY:SSL$LIBCRYPTO_SHR.EXE/SHAREABLE -SYS$LIBRARY:SSL$LIBSSL_SHR.EXE/SHAREABLE diff --git a/vms-ssl-external-alpha-32.opt b/vms-ssl-external-alpha-32.opt @@ -1,2 +0,0 @@ -SSLROOT:[ALPHA_LIB]SSL_LIBSSL32.OLB/LIBRARY -SSLROOT:[ALPHA_LIB]SSL_LIBCRYPTO32.OLB/LIBRARY diff --git a/vms-ssl-external-alpha-64.opt b/vms-ssl-external-alpha-64.opt @@ -1,2 +0,0 @@ -SSLROOT:[ALPHA_LIB]SSL_LIBSSL.OLB/LIBRARY -SSLROOT:[ALPHA_LIB]SSL_LIBCRYPTO.OLB/LIBRARY diff --git a/vms-ssl-external-i64-32.opt b/vms-ssl-external-i64-32.opt @@ -1,2 +0,0 @@ -SSLROOT:[IA64_LIB]SSL_LIBSSL32.OLB/LIBRARY -SSLROOT:[IA64_LIB]SSL_LIBCRYPTO32.OLB/LIBRARY diff --git a/vms-ssl-external-i64-64.opt b/vms-ssl-external-i64-64.opt @@ -1,2 +0,0 @@ -SSLROOT:[IA64_LIB]SSL_LIBSSL.OLB/LIBRARY -SSLROOT:[IA64_LIB]SSL_LIBCRYPTO.OLB/LIBRARY diff --git a/vms-ssl-external-vax-32.opt b/vms-ssl-external-vax-32.opt @@ -1,2 +0,0 @@ -SSLROOT:[VAX_LIB]SSL_LIBSSL32.OLB/LIBRARY -SSLROOT:[VAX_LIB]SSL_LIBCRYPTO32.OLB/LIBRARY diff --git a/vms.c b/vms.c @@ -1,1146 +0,0 @@ -#ifdef __VMS - -#include "links.h" - -#define __NEW_STARLET 1 -#include <starlet.h> -#include <iodef.h> -#include <ssdef.h> -#include <stsdef.h> -#include <descrip.h> -#include <dvidef.h> -#include <lib$routines.h> -#include <libclidef.h> - -#if defined(HAVE_OPENSSL) && !defined(OPENSSL_NO_SHA) && !defined(OPENSSL_NO_SHA1) -#include <openssl/sha.h> -#define USE_SHA -#endif - -#ifdef __VAX -struct _iosb { - unsigned short iosb$w_status; - unsigned short iosb$w_bcnt; - unsigned iosb$l_dev_depend; -}; -struct _generic_64 { - unsigned gen64$l_longword[2]; -}; -#else -#include <iosbdef.h> -#include <gen64def.h> -#endif - -#include <pthread.h> -#include <tis.h> -#ifdef HAVE_SYS_IOCTL_H -#include <sys/ioctl.h> -#endif - -/* reimplement pipes because sockets + select have too big latency */ -#define VMS_VIRTUAL_PIPE - -/* use a special thread for select processing (if not defined, sockets - are polled with a dynamic timer) */ -#define VMS_SELECT_THREAD - -#define VIRTUAL_PIPE_SIZE 512 - -#define GETTIMEOFDAY_POOL 256 - -/*#define TEST_WAKE_BUG*/ -/*#define TRACE_PIPES*/ - -#undef read -#undef write -#undef close -#undef select - -#if !defined(VMS_VIRTUAL_PIPE) && defined(VMS_SELECT_THREAD) -#undef VMS_SELECT_THREAD -#endif - -static void vms_fatal_exit(char *m, ...) -{ - va_list l; - va_start(l, m); - fprintf(stderr, "\n"); - vfprintf(stderr, cast_const_char m, l); - fprintf(stderr, "%c\n", (unsigned char)7); - fflush(stderr); - va_end(l); - exit(RET_FATAL); -} - -void portable_sleep(unsigned msec) -{ - struct timespec tv; - int rs; - tv.tv_sec = msec / 1000; - tv.tv_nsec = msec % 1000 * 1000000; - if (!msec) tv.tv_nsec = 1; - rs = pthread_delay_np(&tv); - if (rs && rs != EINTR) - vms_fatal_exit("pthread_delay_np failed: %d", rs); -} - -static $DESCRIPTOR (output_channel_desc, "SYS$OUTPUT:"); - -int get_terminal_size(int fd, int *x, int *y) -{ - int ret; - int x_code = DVI$_DEVBUFSIZ; - int y_code = DVI$_TT_PAGE; - unsigned long result; - *x = 80; - *y = 24; - ret = lib$getdvi(&x_code, 0, &output_channel_desc, &result, 0, 0); - if ($VMS_STATUS_SUCCESS(ret) && result) *x = result; - ret = lib$getdvi(&y_code, 0, &output_channel_desc, &result, 0, 0); - if ($VMS_STATUS_SUCCESS(ret) && result) *y = result; - return 0; -} - -static $DESCRIPTOR (display_desc, "DECW$DISPLAY"); - -int is_xterm(void) -{ - static int xt = -1; - if (xt == -1) { - xt = $VMS_STATUS_SUCCESS(lib$get_logical(&display_desc, NULL, NULL, NULL, NULL, NULL, NULL, NULL)); - } - return xt; -} - -void get_path_to_exe(void) -{ - path_to_exe = cast_uchar "links"; -} - -static volatile int io_raw = -1; - -static int input_handle = -1; - -static unsigned old_ctrl_mask = 0; - -static $DESCRIPTOR (input_channel_desc, "SYS$INPUT:"); -static unsigned short input_channel; - -static pthread_mutex_t io_mutex; -static pthread_mutex_t cancel_mutex; - -static volatile int must_redraw = 0; -static volatile int ctrl_c = 0; -static volatile int ctrl_y = 0; - -static volatile struct timeval gettimeofday_pool[GETTIMEOFDAY_POOL]; -static volatile unsigned gettimeofday_clock = 0; - -static void vms_key_handler(int mode, void (*ast)(void)) -{ - struct _iosb iosb; - int ret; - ret = sys$qiow(0, input_channel, IO$_SETMODE | mode, &iosb, 0, 0, ast, 0, 0, 0, 0, 0); - if (!$VMS_STATUS_SUCCESS(ret)) - vms_fatal_exit("sys$qiow failed: %d", ret); - if (!$VMS_STATUS_SUCCESS(iosb.iosb$w_status)) - vms_fatal_exit("IO$M_CTRLCAST failed: %d", iosb.iosb$w_status); -} - -static void ctrl_c_ast(void) -{ - if (io_raw <= 0) return; - must_redraw = 1; - ctrl_c = 1; - sys$cancel(input_channel); - vms_key_handler(IO$M_CTRLCAST, ctrl_c_ast); -} - -static void ctrl_y_ast(void) -{ - if (io_raw <= 0) return; - must_redraw = 1; - ctrl_y = 1; - sys$cancel(input_channel); - vms_key_handler(IO$M_CTRLYAST, ctrl_y_ast); - vms_key_handler(IO$M_CTRLCAST, ctrl_c_ast); -} - -static void handle_ast_keys(int h) -{ - if (ctrl_c) { - ctrl_c = 0; - hard_write(h, cast_uchar "\003", 1); - } - if (ctrl_y) { - ctrl_y = 0; - hard_write(h, cast_uchar "\031", 1); - } - if (must_redraw) { - must_redraw = 0; - hard_write(h, cast_uchar "\014", 1); - } -} - -#define INPUT_BUFFER_SIZE 16 - -static void vms_input_thread(void *n, int h) -{ - unsigned char buffer[INPUT_BUFFER_SIZE]; - int buffer_start = 0; - int buffer_end = 0; - unsigned ef; - int vms_ret; -#ifndef VMS_VIRTUAL_PIPE - /* VMS is buggy - if high priority thread blocks in write, - no low priority threads have a chance to run. - So, as a workaround, we set the socket nonblocking. */ - set_nonblock(h); -#endif - vms_ret = lib$get_ef(&ef); - if (!$VMS_STATUS_SUCCESS(vms_ret)) - vms_fatal_exit("lib$get_ef failed: %d", vms_ret); - while (1) { - int ret; - int count; - struct _iosb iosb; - ret = pthread_mutex_lock(&cancel_mutex); - if (ret) - vms_fatal_exit("pthread_mutex_lock failed: %d", ret); - ret = pthread_mutex_unlock(&cancel_mutex); - if (ret) - vms_fatal_exit("pthread_mutex_unlock failed: %d", ret); - handle_ast_keys(h); - ret = pthread_mutex_lock(&io_mutex); - if (ret) - vms_fatal_exit("pthread_mutex_lock failed: %d", ret); - vms_ret = sys$clref(ef); - if (!$VMS_STATUS_SUCCESS(vms_ret)) - vms_fatal_exit("sys$clref failed: %d", vms_ret); - vms_ret = sys$qio(ef, input_channel, IO$_READVBLK | IO$M_NOECHO | IO$M_NOFILTR, &iosb, tis_io_complete, 0, buffer + buffer_end, 1, 0, 0, 0, 0); - if ($VMS_STATUS_SUCCESS(vms_ret)) { - if (!iosb.iosb$w_status) { - if (buffer_start != buffer_end) { - hard_write(h, buffer + buffer_start, buffer_end - buffer_start); - buffer_start = buffer_end; - } - } - vms_ret = tis_synch(ef, &iosb); - } - ret = pthread_mutex_unlock(&io_mutex); - if (ret) - vms_fatal_exit("pthread_mutex_unlock failed: %d", ret); - handle_ast_keys(h); - if (vms_ret == SS$_CANCEL || - vms_ret == SS$_ABORT) - continue; - if (!$VMS_STATUS_SUCCESS(vms_ret)) - vms_fatal_exit("sys$qio failed: %d", vms_ret); - if (!$VMS_STATUS_SUCCESS(iosb.iosb$w_status) && - iosb.iosb$w_status != SS$_PARTESCAPE && - iosb.iosb$w_status != SS$_DATAOVERUN && - iosb.iosb$w_status != SS$_CANCEL && - iosb.iosb$w_status != SS$_ABORT) - vms_fatal_exit("IO$_READVBLK failed: %d, %d", (int)iosb.iosb$w_status, (int)iosb.iosb$w_bcnt); - count = iosb.iosb$w_bcnt + (iosb.iosb$l_dev_depend >> 16); - if (count == 1) { - buffer_end++; - if (buffer_start) { - memmove(buffer, buffer + buffer_start, buffer_end - buffer_start); - buffer_end -= buffer_start; - buffer_start = 0; - } - if (buffer_end == INPUT_BUFFER_SIZE) { - hard_write(h, buffer + buffer_start, buffer_end - buffer_start); - buffer_start = buffer_end = 0; - } - } - } -} - -int setraw(int ctl, int save) -{ - int ret; - if (io_raw > 0) - return 0; - ret = sys$assign(&input_channel_desc, &input_channel, 0, NULL); - if (!$VMS_STATUS_SUCCESS(ret)) - vms_fatal_exit("sys$assign failed: %d", ret); - io_raw = 1; - vms_key_handler(IO$M_CTRLCAST, ctrl_c_ast); - vms_key_handler(IO$M_CTRLYAST, ctrl_y_ast); - ret = pthread_mutex_unlock(&io_mutex); - if (ret) - vms_fatal_exit("pthread_mutex_unlock failed: %d", ret); - return 0; -} - -void setcooked(int ctl) -{ - int ret; - if (io_raw <= 0) - return; - ret = pthread_mutex_lock(&cancel_mutex); - if (ret) - vms_fatal_exit("pthread_mutex_lock failed: %d", ret); - clear_events(input_handle, 1); - while ((ret = pthread_mutex_trylock(&io_mutex))) { - if (ret != EBUSY) - vms_fatal_exit("pthread_mutex_trylock failed: %d", ret); - ret = sys$cancel(input_channel); - if (!$VMS_STATUS_SUCCESS(ret)) - vms_fatal_exit("sys$cancel failed: %d", ret); - clear_events(input_handle, 1); - portable_sleep(0); - } - ret = pthread_mutex_unlock(&cancel_mutex); - if (ret) - vms_fatal_exit("pthread_mutex_unlock failed: %d", ret); - io_raw = 0; - vms_key_handler(IO$M_CTRLCAST, NULL); - vms_key_handler(IO$M_CTRLYAST, NULL); - ret = sys$dassgn(input_channel); - if (!$VMS_STATUS_SUCCESS(ret)) - vms_fatal_exit("sys$dassgn failed: %d", ret); -} - -int get_input_handle(void) -{ - unsigned int disable_ctrl_mask = LIB$M_CLI_CTRLT | LIB$M_CLI_CTRLY; - int ret; - if (input_handle >= 0) - return input_handle; - ret = pthread_mutex_init(&io_mutex, NULL); - if (ret) - vms_fatal_exit("pthread_mutex_init failed: %d", ret); - ret = pthread_mutex_init(&cancel_mutex, NULL); - if (ret) - vms_fatal_exit("pthread_mutex_init failed: %d", ret); - ret = pthread_mutex_lock(&io_mutex); - if (ret) - vms_fatal_exit("pthread_mutex_lock failed: %d", ret); - lib$disable_ctrl(&disable_ctrl_mask, &old_ctrl_mask); - vms_thread_high_priority = 1; - input_handle = start_thread(vms_input_thread, NULL, 0, 0); - if (input_handle == -1) - vms_fatal_exit("unable to start keyboard thread"); - vms_thread_high_priority = 0; - return input_handle; -} - -#if defined(GRDRV_X) - -static int x11_ef = -1; -static int x11_pipe = -1; - -static void vms_x11_thread(void *n, int h) -{ - int ret; - set_nonblock(h); - while (1) { - ret = sys$clref(x11_ef); - if (!$VMS_STATUS_SUCCESS(ret)) - vms_fatal_exit("sys$clref failed: %d", ret); - EINTRLOOP(ret, (int)vms_write(h, "", 1)); - ret = sys$waitfr(x11_ef); - if (!$VMS_STATUS_SUCCESS(ret)) - vms_fatal_exit("sys$waitfr failed: %d", ret); - } -} - -int vms_x11_fd(int ef) -{ - if (x11_pipe >= 0) { - if (ef != x11_ef) vms_fatal_exit("requesting multiple event flags: %d, %d", x11_ef, ef); - return x11_pipe; - } - x11_ef = ef; - x11_pipe = start_thread(vms_x11_thread, NULL, 0, 0); - if (x11_pipe == -1) - vms_fatal_exit("unable to start Xwindow event thread"); - set_nonblock(x11_pipe); - return x11_pipe; -} - -#endif - -#if !defined(VMS_VIRTUAL_PIPE) || defined(VMS_SELECT_THREAD) - -static int vms_socketpair(int *fd) -{ -#if defined(HAVE_SOCKETPAIR) - int r; - EINTRLOOP(r, socketpair(AF_INET, SOCK_STREAM, 0, fd)); - return r; -#else -#define PIPE_RETRIES 10 - int rs; - int s1, s2, s3; - socklen_t l; - struct sockaddr_in sa1, sa2; - int retry_count = 0; - again: - s1 = c_socket(PF_INET, SOCK_STREAM, IPPROTO_TCP); - if (s1 < 0) - goto err0; - s2 = c_socket(PF_INET, SOCK_STREAM, IPPROTO_TCP); - if (s2 < 0) - goto err1; - memset(&sa1, 0, sizeof(sa1)); - sa1.sin_family = AF_INET; - sa1.sin_port = htons(0); - sa1.sin_addr.s_addr = htonl(INADDR_LOOPBACK); - EINTRLOOP(rs, bind(s1, (struct sockaddr *)&sa1, sizeof(sa1))); - if (rs) - goto err2; - l = sizeof(sa2); - EINTRLOOP(rs, getsockname(s1, (struct sockaddr *)&sa1, &l)); - if (rs) - goto err2; - EINTRLOOP(rs, listen(s1, 1)); - if (rs) - goto err2; - EINTRLOOP(rs, connect(s2, (struct sockaddr *)&sa1, sizeof(sa1))); - if (rs) - goto err2; - l = sizeof(sa1); - EINTRLOOP(rs, getsockname(s2, (struct sockaddr *)&sa1, &l)); - if (rs) - goto err2; - l = sizeof(sa2); - s3 = c_accept(s1, (struct sockaddr *)&sa2, &l); - if (s3 < 0) - goto err2; - if (sa1.sin_addr.s_addr != sa2.sin_addr.s_addr || - sa1.sin_port != sa2.sin_port) { - errno = EINVAL; - goto err2; - } - EINTRLOOP(rs, close(s1)); - fd[0] = s2; - fd[1] = s3; - return 0; - err2: - EINTRLOOP(rs, close(s2)); - err1: - EINTRLOOP(rs, close(s1)); - err0: - if (++retry_count > PIPE_RETRIES) return -1; - portable_sleep(100); - goto again; -#endif -} - -#endif - -#ifdef VMS_VIRTUAL_PIPE - -static pthread_mutex_t pipe_mutex; -static pthread_cond_t pipe_cond; - -static void pipe_lock(void) -{ - int ret; - ret = pthread_mutex_lock(&pipe_mutex); - if (ret) - vms_fatal_exit("pthread_mutex_lock failed: %d", ret); -} - -static void pipe_unlock(void) -{ - int ret; - ret = pthread_mutex_unlock(&pipe_mutex); - if (ret) - vms_fatal_exit("pthread_unmutex_lock failed: %d", ret); -} - -static void pipe_unlock_wait_cond(pthread_cond_t *cond) -{ - int ret; - ret = pthread_cond_wait(cond, &pipe_mutex); - if (ret && ret != EINTR) - vms_fatal_exit("pthread_cond_wait failed: %d", ret); -} - -static void pipe_unlock_wait(void) -{ - pipe_unlock_wait_cond(&pipe_cond); -} - -static int pipe_unlock_wait_time(struct timespec *ts) -{ - int ret; - ret = pthread_cond_timedwait(&pipe_cond, &pipe_mutex, ts); - if (ret && ret != EINTR && ret != ETIMEDOUT) - vms_fatal_exit("pthread_cond_timedwait failed: %d", ret); - return ret == ETIMEDOUT; -} - -static void pipe_wake_cond(pthread_cond_t *cond) -{ - int ret; - ret = pthread_cond_broadcast(cond); - if (ret) - vms_fatal_exit("pthread_cond_broadcast failed: %d", ret); -} - -static void pipe_wake(void) -{ - pipe_wake_cond(&pipe_cond); -} - -#include "vpipe.inc" - -static void get_abstime(time_t sec, unsigned usec, struct timespec *ts) -{ -#if 0 - int ret; - struct timespec exp; - exp.tv_sec = sec; - exp.tv_nsec = usec * 1000; - ret = pthread_get_expiration_np(&exp, ts); - if (ret) - vms_fatal_exit("pthread_get_expiration_np failed: %d", ret); -#else - int ret; - struct timeval tv; - ret = gettimeofday(&tv, NULL); - if (ret) - vms_fatal_exit("gettimeofday failed: %d", errno); - tv.tv_sec += sec; - tv.tv_usec += usec; - if (tv.tv_usec >= 1000000) { - tv.tv_usec -= 1000000; - tv.tv_sec++; - } - { - unsigned c = gettimeofday_clock; - if (c >= GETTIMEOFDAY_POOL) c = 0; - gettimeofday_clock = c; - gettimeofday_pool[c].tv_sec = (unsigned long)gettimeofday_pool[c].tv_sec * 11 + (unsigned long)tv.tv_sec; - gettimeofday_pool[c].tv_usec = (unsigned long)gettimeofday_pool[c].tv_usec * 11 + (unsigned long)tv.tv_usec; - } - ts->tv_sec = tv.tv_sec; - ts->tv_nsec = tv.tv_usec * 1000; -#endif -} - -static int check_fd(int fd, int what) -{ - fd_set fds; - struct timeval tv = {0, 0}; - int rs; - FD_ZERO(&fds); - FD_SET(fd, &fds); - EINTRLOOP(rs, select(fd + 1, - what == 0 ? &fds : NULL, - what == 1 ? &fds : NULL, - what == 2 ? &fds : NULL, - &tv)); - if (rs < 0) vms_fatal_exit("select for %d/%d write failed: %d", fd, what, errno); - return rs; -} - -#ifdef VMS_SELECT_THREAD - -static pthread_cond_t select_cond; - -static int select_thread_signal[2]; - -static int select_set_max; - -static fd_set select_set_read; -static fd_set select_set_write; -static fd_set select_set_exception; - -static fd_set add_set_read; -static fd_set add_set_write; -static fd_set add_set_exception; - -static fd_set remove_set; - -static fd_set rs, ws, es; - -static void add_to_thread_set(int fd, fd_set *s) -{ - FD_SET(fd, s); - if (fd >= select_set_max) - select_set_max = fd + 1; -} - -static void vms_select_thread(void *p, int n) -{ - int should_wake = 0; - pipe_lock(); - FD_ZERO(&rs); - FD_ZERO(&ws); - FD_ZERO(&es); - while (1) { - int i; - int r; - int need_select = 0; - int new_max = 0; - for (i = 0; i < select_set_max; i++) { - int set; - if (FD_ISSET(i, &add_set_read)) { - FD_CLR(i, &add_set_read); - FD_SET(i, &select_set_read); - } - if (FD_ISSET(i, &add_set_write)) { - FD_CLR(i, &add_set_write); - FD_SET(i, &select_set_write); - } - if (FD_ISSET(i, &add_set_exception)) { - FD_CLR(i, &add_set_exception); - FD_SET(i, &select_set_exception); - } - if (FD_ISSET(i, &remove_set)) { - FD_CLR(i, &remove_set); -#ifndef TEST_WAKE_BUG - FD_CLR(i, &select_set_read); - FD_CLR(i, &select_set_write); - FD_CLR(i, &select_set_exception); -#endif - should_wake = 1; - } - set = 0; - if (FD_ISSET(i, &select_set_read)) { - set = 1; - FD_SET(i, &rs); - } - if (FD_ISSET(i, &select_set_write)) { - set = 1; - FD_SET(i, &ws); - } - if (FD_ISSET(i, &select_set_exception)) { - set = 1; - FD_SET(i, &es); - } - if (set && i >= new_max) - new_max = i + 1; - if (set && i != select_thread_signal[0]) - need_select = 1; - } - select_set_max = new_max; - if (!need_select) { - if (should_wake) { - pipe_wake(); - should_wake = 0; - } - pipe_unlock_wait_cond(&select_cond); - clear_events(select_thread_signal[0], 0); - } else { - pipe_unlock(); - if (should_wake) { -#ifdef TEST_WAKE_BUG - fprintf(stderr, "wake 1. "); -#endif - pipe_wake(); -#ifdef TEST_WAKE_BUG - fprintf(stderr, "wake 2. "); -#endif - should_wake = 0; - } - /* It is needed to sleep here with pthread_yield_np() or - portable_sleep(0), otherwise some bug in decthreads - is triggered and the main thread isn't woken up. - tis_io_complete apparently seems to fix the bug too, - so we do a dummy syscall that calls tis_io_complete - as an AST */ - { - struct _generic_64 priv; - memset(&priv, 0, sizeof priv); - sys$check_privilegew(0, &priv, NULL, 0, NULL, NULL, tis_io_complete, 0); - } - /*tis_io_complete();*/ - /*fprintf(stderr, "time1 %d. ", get_time()); - pthread_yield_np(); - portable_sleep(0); - fprintf(stderr, "time2 %d. ", get_time());*/ -#ifdef TEST_WAKE_BUG - fprintf(stderr, "wake 3. "); -#endif - EINTRLOOP(r, select(select_set_max, &rs, &ws, &es, NULL)); -#ifdef TEST_WAKE_BUG - fprintf(stderr, "wake 4. "); -#endif - if (r < 0) - vms_fatal_exit("select in thread failed: %d", errno); - pipe_lock(); - for (i = 0; i < select_set_max; i++) { - if (i == select_thread_signal[0]) { - if (FD_ISSET(i, &rs)) - clear_events(i, 0); - continue; - } - if (FD_ISSET(i, &rs)) { - FD_CLR(i, &rs); - FD_CLR(i, &select_set_read); - should_wake = 1; - } - if (FD_ISSET(i, &ws)) { - FD_CLR(i, &ws); - FD_CLR(i, &select_set_write); - should_wake = 1; - } - if (FD_ISSET(i, &es)) { - FD_CLR(i, &es); - FD_CLR(i, &select_set_exception); - should_wake = 1; - } - } - } - } -} - -static void select_thread_wake(void) -{ - int r; - EINTRLOOP(r, (int)write(select_thread_signal[1], "", 1)); - pipe_wake_cond(&select_cond); -} - -#endif - -#ifndef VMS_SELECT_THREAD - -#ifdef __VAX -#define MIN_WAIT_TIME 10000 -#else -#define MIN_WAIT_TIME 900 -#endif -#define MAX_WAIT_TIME 999999 - -static unsigned wait_time = MIN_WAIT_TIME; - -static void increase_dynamic_time(void) -{ - wait_time += (wait_time / 2); - if (wait_time > MAX_WAIT_TIME) wait_time = MAX_WAIT_TIME; -} - -static void decrease_dynamic_time(void) -{ - wait_time /= 2; - if (wait_time > MIN_WAIT_TIME) wait_time = MIN_WAIT_TIME; -} - -#endif - -int vms_select(int n, fd_set *rs, fd_set *ws, fd_set *es, struct timeval *t) -{ - struct timespec ts; - int i; - int last_pass = 0; - int ret_cnt = 0; - int dynamic_wait; -#ifndef VMS_SELECT_THREAD - int dynamically_waited = 0; -#endif - /*if (!rs && !ws && !es) - return select(0, NULL, NULL, NULL, t);*/ - if (t) { - if (!t->tv_sec && !t->tv_usec) { - last_pass = 1; - } else { - get_abstime(t->tv_sec, t->tv_usec, &ts); - } - } - pipe_lock(); - test_again: - dynamic_wait = 0; - for (i = 0; i < n; i++) { - int ts = 0; - if (rs && FD_ISSET(i, rs)) { - int signaled = 0; - if (pipe_desc[i]) { - signaled |= vpipe_may_read(i); - } else { -#ifdef VMS_SELECT_THREAD - if (FD_ISSET(i, &select_set_read)) dynamic_wait |= 1; - else -#endif - if (check_fd(i, 0)) signaled = 1; - else { -#ifdef VMS_SELECT_THREAD - add_to_thread_set(i, &add_set_read); -#endif - dynamic_wait |= 3; - } - } - if (!last_pass) { - if (signaled) { - clear_inactive(rs, i); - clear_inactive(ws, i); - clear_inactive(es, i); - last_pass = 1; - } - } else { - if (!signaled) FD_CLR(i, rs); - } - ts |= signaled; - } - if (ws && FD_ISSET(i, ws)) { - int signaled = 0; - if (pipe_desc[i]) { - signaled |= vpipe_may_write(i); - } else { -#ifdef VMS_SELECT_THREAD - if (FD_ISSET(i, &select_set_write)) dynamic_wait |= 1; - else -#endif - if (check_fd(i, 1)) signaled = 1; - else { -#ifdef VMS_SELECT_THREAD - add_to_thread_set(i, &add_set_write); -#endif - dynamic_wait |= 3; - } - } - if (!last_pass) { - if (signaled) { - clear_inactive(rs, i + 1); - clear_inactive(ws, i); - clear_inactive(es, i); - last_pass = 1; - } - } else { - if (!signaled) FD_CLR(i, ws); - } - ts |= signaled; - } - if (es && FD_ISSET(i, es)) { - int signaled = 0; - if (pipe_desc[i]) { - } else { -#ifdef VMS_SELECT_THREAD - if (FD_ISSET(i, &select_set_exception)) dynamic_wait |= 1; - else -#endif - if (check_fd(i, 2)) signaled = 1; - else { -#ifdef VMS_SELECT_THREAD - add_to_thread_set(i, &add_set_exception); - dynamic_wait |= 3; -#endif - } - } - if (!last_pass) { - if (signaled) { - clear_inactive(rs, i + 1); - clear_inactive(ws, i + 1); - clear_inactive(es, i); - last_pass = 1; - } - } else { - if (!signaled) FD_CLR(i, es); - } - ts |= signaled; - } - if (last_pass) ret_cnt += ts; - } - if (!last_pass) { -#ifndef VMS_SELECT_THREAD - if (dynamic_wait) { - struct timespec ts2; - if (dynamically_waited) - increase_dynamic_time(); - /*fprintf(stderr, "wait time: %d\n", wait_time);*/ - get_abstime(0, wait_time, &ts2); - if (t && - (ts2.tv_sec > ts.tv_sec || - (ts2.tv_sec == ts.tv_sec && ts2.tv_nsec > ts.tv_nsec))) - goto full_wait; - dynamically_waited = pipe_unlock_wait_time(&ts2); - goto test_again; - } -#else - if (dynamic_wait & 2) - select_thread_wake(); -#endif -#ifndef VMS_SELECT_THREAD - dynamically_waited = 0; -#endif - if (!t) { - pipe_unlock_wait(); - goto test_again; - } else { -full_wait: - if (pipe_unlock_wait_time(&ts)) - last_pass = 1; - goto test_again; - } - } -#ifndef VMS_SELECT_THREAD - if (dynamically_waited) - decrease_dynamic_time(); -#endif - pipe_unlock(); - return ret_cnt; -} - -#else - -int vms_select(int n, fd_set *rs, fd_set *ws, fd_set *es, struct timeval *t) -{ - return select(n, rs, ws, es, t); -} - -#endif - -int vms_close(int fd) -{ -#ifdef VMS_VIRTUAL_PIPE - int r = vpipe_close(fd); - if (r != -2) return r; -#ifdef VMS_SELECT_THREAD - pipe_lock(); - while (1) { - FD_CLR(fd, &add_set_read); - FD_CLR(fd, &add_set_write); - FD_CLR(fd, &add_set_exception); - if (!(FD_ISSET(fd, &select_set_read) || - FD_ISSET(fd, &select_set_write) || - FD_ISSET(fd, &select_set_exception))) - break; - add_to_thread_set(fd, &remove_set); -#ifdef TEST_WAKE_BUG - fprintf(stderr, "close 1. "); -#endif - select_thread_wake(); -#ifdef TEST_WAKE_BUG - fprintf(stderr, "close 2. "); -#endif - pipe_unlock_wait(); -#ifdef TEST_WAKE_BUG - fprintf(stderr, "close 3. "); -#endif - } - pipe_unlock(); -#endif -#endif - return close(fd); -} - -int c_pipe(int *fd) -{ -#ifdef VMS_VIRTUAL_PIPE - return vpipe_create(fd); -#else - return vms_socketpair(fd); -#endif -} - -void set_nonblock(int fd) -{ -#ifdef VMS_VIRTUAL_PIPE - if (get_virtual_pipe(fd)) { - pipe_flags[fd] |= VIRTUAL_PIPE_FLAG_NONBLOCK; - pipe_unlock(); - pipe_wake(); - } else -#endif - { - int rs; - int on = 1; - EINTRLOOP(rs, ioctl(fd, FIONBIO, &on)); - } -} - -#define BOUNCE_BUFFER_SIZE 64 - -int vms_read(int fd, void *buf, size_t size) -{ -#ifdef VMS_VIRTUAL_PIPE - int r = vpipe_read(fd, buf, size); - if (r != -2) return r; -#endif -#ifndef OPENVMS_64BIT - return read(fd, buf, size); -#else - { - int r; - unsigned char static_buffer[BOUNCE_BUFFER_SIZE]; - unsigned char *bounce_buffer = NULL; - if (size > BOUNCE_BUFFER_SIZE) - bounce_buffer = _malloc32(size); - if (!bounce_buffer) { - bounce_buffer = static_buffer; - if (size > BOUNCE_BUFFER_SIZE) size = BOUNCE_BUFFER_SIZE; - } - r = read(fd, bounce_buffer, size); - if (r > 0) memcpy(buf, bounce_buffer, r); - if (bounce_buffer != static_buffer) - free(bounce_buffer); - return r; - } -#endif -} - -int vms_write(int fd, const void *buf, size_t size) -{ -#ifdef VMS_VIRTUAL_PIPE - int r = vpipe_write(fd, buf, size); - if (r != -2) return r; -#endif -#ifndef OPENVMS_64BIT - return write(fd, buf, size); -#else - { - int r; - unsigned char static_buffer[BOUNCE_BUFFER_SIZE]; - unsigned char *bounce_buffer = NULL; - if (size > BOUNCE_BUFFER_SIZE) - bounce_buffer = _malloc32(size); - if (!bounce_buffer) { - bounce_buffer = static_buffer; - if (size > BOUNCE_BUFFER_SIZE) size = BOUNCE_BUFFER_SIZE; - } - memcpy(bounce_buffer, buf, size); - r = write(fd, bounce_buffer, size); - if (bounce_buffer != static_buffer) - free(bounce_buffer); - return r; - } -#endif -} - -void init_os(void) -{ -#if !defined(__VAX) && defined(__FEATURE_MODE_INIT_STATE) && defined(__FEATURE_MODE_CURVAL) - if (decc$feature_get("DECC$EFS_CHARSET", __FEATURE_MODE_INIT_STATE) < 1) - decc$feature_set("DECC$EFS_CHARSET", __FEATURE_MODE_CURVAL, 1); -#endif -#if defined(OPENVMS_64BIT) - { - int i; - unsigned char **new_argv = malloc((g_argc + 1) * sizeof(unsigned char *)); - if (!new_argv) vms_fatal_exit("can't allocate argv"); - for (i = 0; i <= g_argc; i++) - new_argv[i] = (unsigned char *)(my_intptr_t)(((unsigned *)g_argv)[i]); - g_argv = new_argv; - } -#endif -#ifdef VMS_VIRTUAL_PIPE - { - int ret; - ret = pthread_mutex_init(&pipe_mutex, NULL); - if (ret) - vms_fatal_exit("pthread_mutex_init failed: %d", ret); - ret = pthread_cond_init(&pipe_cond, NULL); - if (ret) - vms_fatal_exit("pthread_cond_init failed: %d", ret); -#ifdef VMS_SELECT_THREAD - ret = pthread_cond_init(&select_cond, NULL); - if (ret) - vms_fatal_exit("pthread_cond_init failed: %d", ret); - ret = vms_socketpair(select_thread_signal); - if (ret) - vms_fatal_exit("can't create select thread socket"); - set_nonblock(select_thread_signal[0]); - set_nonblock(select_thread_signal[1]); - select_set_max = 0; - FD_ZERO(&select_set_read); - FD_ZERO(&select_set_write); - FD_ZERO(&select_set_exception); - FD_ZERO(&add_set_read); - FD_ZERO(&add_set_write); - FD_ZERO(&add_set_exception); - FD_ZERO(&remove_set); - add_to_thread_set(select_thread_signal[0], &select_set_read); - select_set_max = select_thread_signal[0] + 1; - vms_thread_high_priority = -1; - ret = start_thread(vms_select_thread, NULL, 0, 0); - if (ret == -1) - vms_fatal_exit("unable to start select thread"); - vms_thread_high_priority = 0; -#endif - } -#endif -} - -void os_seed_random(unsigned char **pool, int *pool_size) -{ - struct history_item *hi; - struct list_head *lhi; - DIR *dir; - int n, h; - - *pool = init_str(); - *pool_size = 0; - - /* - * This is not very secure, but I don't know a better way. - */ - add_bytes_to_str(pool, pool_size, (unsigned char *)(void *)&gettimeofday_pool, sizeof gettimeofday_pool); - -#ifdef USE_SHA - /* - * Make sure that even if the transformation is reversible (due to - * poor randomness on OpenVMS), the adversary won't be able to find - * any URLs in the history. - */ - n = 0; - foreach(struct history_item, hi, lhi, goto_url_history.items) { - SHA_CTX ctx; - unsigned char result[SHA_DIGEST_LENGTH]; - unsigned char sum; - int i; - - SHA1_Init(&ctx); - SHA1_Update(&ctx, hi->str, strlen(cast_const_char hi->str)); - SHA1_Final(result, &ctx); - - sum = 0; - for (i = 0; i < SHA_DIGEST_LENGTH; i++) { - sum += result[i] + (result[i] >> 4); - } - add_chr_to_str(pool, pool_size, sum & 0xf); - if (++n >= 64) - break; - } -#endif - - dir = c_opendir(cast_uchar "/SYS$LOGIN"); - if (dir) { - for (n = 0; n < 256; n++) { - struct dirent *de; - unsigned char *path; - struct stat st; - ENULLLOOP(de, (void *)readdir(dir)); - if (!de) - break; - path = stracpy(cast_uchar "/SYS$LOGIN/"); - add_to_strn(&path, cast_uchar de->d_name); - if (!stat(cast_const_char path, &st)) { - add_bytes_to_str(pool, pool_size, (unsigned char *)&st.st_ctime, (int)sizeof st.st_ctime); - } - mem_free(path); - } - closedir(dir); - } - - h = c_open(cast_uchar "/SYS$LOGIN/SSH2/RANDOM_SEED", O_RDONLY); - if (h == -1) - h = c_open(cast_uchar "/SYS$LOGIN/SSH/RANDOM_SEED", O_RDONLY); - if (h != -1) { - unsigned char buffer[512]; - int r; - r = hard_read(h, buffer, (int)sizeof buffer); - if (r >= 0) - add_bytes_to_str(pool, pool_size, buffer, r); - EINTRLOOP(r, close(h)); - } -} - -void terminate_osdep(void) -{ - if (old_ctrl_mask) - lib$enable_ctrl(&old_ctrl_mask, NULL); -} - -#else - -typedef int vms_c_no_empty_unit; - -#endif