diff -uNr gnome-libs-0.26/AUTHORS gnome-libs-0.27/AUTHORS --- gnome-libs-0.26/AUTHORS Thu Jul 23 14:08:19 1998 +++ gnome-libs-0.27/AUTHORS Wed Aug 12 08:07:56 1998 @@ -15,3 +15,4 @@ Owen Taylor Tuomas Kuosmanen Jaka Mocnik +Shawn Amundson diff -uNr gnome-libs-0.26/ChangeLog gnome-libs-0.27/ChangeLog --- gnome-libs-0.26/ChangeLog Thu Aug 6 12:55:46 1998 +++ gnome-libs-0.27/ChangeLog Thu Aug 13 19:36:11 1998 @@ -1,3 +1,35 @@ +1998-08-13 Federico Mena Quintero + + * configure.in: Bumped version number to 0.27. + +Sun Aug 09 13:46:12 1998 George Lebl + + * libgnome/gnome-config.c: store a dirty flag in the profile + structure. that way we don't dump to disk everything we have + in memory, even stuff we have just read. (or stuff which was + already synced) + +1998-08-08 Mandrake (Geoff Harrison) + + * changed version numbers of 0.0.0 stuff to 0.26.0 + (-version-info x:y:z, where x is the major rev+the minor rev, z is the + minor rev, y is the patchlevel. -- thus the library would come out as + libxxx.so.x-z.z.y) + +1998-08-07 Federico Mena Quintero + + * configure.in: Added devel-docs/ui-guide/Makefile to the list of + generated files. + +1998-08-06 Raja R Harinath + + * configure.in (GLIB_LIBS): Use the "sed from GTK_LIBS" approach + if AM_PATH_GLIB fails. + (AC_OUTPUT): Generate `libvfs/Makefile'. + * Makefile.am (libvfs): New variable, defined if FALSE. + (SUBDIRS): Add $(libvfs). + With this change, `libvfs' is not built, but it is distributed. + 1998-08-06 Federico Mena Quintero * configure.in: Bumped version number to 0.26. diff -uNr gnome-libs-0.26/Makefile.am gnome-libs-0.27/Makefile.am --- gnome-libs-0.26/Makefile.am Mon Aug 3 09:45:53 1998 +++ gnome-libs-0.27/Makefile.am Tue Aug 11 11:17:40 1998 @@ -6,13 +6,17 @@ bin_SCRIPTS = gnome-config +if FALSE +libvfs = libvfs +endif + SUBDIRS = po intl support macros \ libgnome libgnomeui gtk-xmhtml gnome-hello libgtktty zvt \ - test-gnome test-suite + test-gnome test-suite devel-docs $(libvfs) include_HEADERS = gnome.h -EXTRA_DIST = HACKING gnomeConf.sh.in gnome-config.in +EXTRA_DIST = HACKING gnomeConf.sh.in gnome-config.in gnome-libs.spec release: $(MAKE) dist distdir=$(PACKAGE)$(VERSION) diff -uNr gnome-libs-0.26/Makefile.in gnome-libs-0.27/Makefile.in --- gnome-libs-0.26/Makefile.in Thu Aug 6 13:12:56 1998 +++ gnome-libs-0.27/Makefile.in Thu Aug 13 19:56:24 1998 @@ -132,13 +132,15 @@ bin_SCRIPTS = gnome-config +@FALSE_TRUE@libvfs = libvfs + SUBDIRS = po intl support macros \ libgnome libgnomeui gtk-xmhtml gnome-hello libgtktty zvt \ - test-gnome test-suite + test-gnome test-suite devel-docs $(libvfs) include_HEADERS = gnome.h -EXTRA_DIST = HACKING gnomeConf.sh.in gnome-config.in +EXTRA_DIST = HACKING gnomeConf.sh.in gnome-config.in gnome-libs.spec confexecdir=$(libdir) confexec_DATA = gnomeConf.sh @@ -163,6 +165,8 @@ TAR = tar GZIP = --best +DIST_SUBDIRS = po intl support macros libgnome libgnomeui gtk-xmhtml \ +gnome-hello libgtktty zvt test-gnome test-suite devel-docs libvfs all: all-recursive-am all-am .SUFFIXES: @@ -364,7 +368,7 @@ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ || cp -p $$d/$$file $(distdir)/$$file; \ done - for subdir in $(SUBDIRS); do \ + for subdir in $(DIST_SUBDIRS); do \ test -d $(distdir)/$$subdir \ || mkdir $(distdir)/$$subdir \ || exit 1; \ diff -uNr gnome-libs-0.26/configure gnome-libs-0.27/configure --- gnome-libs-0.26/configure Thu Aug 6 13:01:30 1998 +++ gnome-libs-0.27/configure Thu Aug 13 19:36:30 1998 @@ -810,7 +810,7 @@ PACKAGE=gnome-libs -VERSION=0.26 +VERSION=0.27 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } @@ -3331,7 +3331,7 @@ GLIB_CFLAGS="" GLIB_LIBS="" - GLIB_LIBS= + GLIB_LIBS=`echo $GTK_LIBS | sed -e 's/.*-lglib/-lglib/' -e 's/ .*//'` echo "configure: warning: GLIB not installed" 1>&2 fi @@ -6359,9 +6359,6 @@ GTKXMHTML_LIBS="-lgtkxmhtml $LIBGTKXMHTML_LIBS" ZVT_LIBS="-lzvt $GTK_LIBS" - -GLIB_LIBS=`echo $GTK_LIBS | sed -e 's/.*-lglib/-lglib/' -e 's/ .*//'` - GNOME_LIBDIR='-L${libdir}' GNOME_INCLUDEDIR='-I${includedir}' if test "$need_gnome_support" = yes; then @@ -6495,11 +6492,13 @@ libgnome/Makefile libgnomeui/Makefile libgnomeui/pixmaps/Makefile +libvfs/Makefile zvt/Makefile test-suite/Makefile gnome-hello/Makefile test-gnome/Makefile devel-docs/Makefile +devel-docs/ui-guide/Makefile support/Makefile macros/Makefile config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 EOF @@ -6669,11 +6668,13 @@ libgnome/Makefile libgnomeui/Makefile libgnomeui/pixmaps/Makefile +libvfs/Makefile zvt/Makefile test-suite/Makefile gnome-hello/Makefile test-gnome/Makefile devel-docs/Makefile +devel-docs/ui-guide/Makefile support/Makefile macros/Makefile"} EOF diff -uNr gnome-libs-0.26/configure.in gnome-libs-0.27/configure.in --- gnome-libs-0.26/configure.in Thu Aug 6 12:55:39 1998 +++ gnome-libs-0.27/configure.in Thu Aug 13 19:36:01 1998 @@ -7,7 +7,7 @@ AC_CANONICAL_SYSTEM -AM_INIT_AUTOMAKE(gnome-libs, 0.26) +AM_INIT_AUTOMAKE(gnome-libs, 0.27) AM_ACLOCAL_INCLUDE(macros) @@ -38,7 +38,8 @@ GNOME_SUPPORT_CHECKS AM_PATH_GLIB(,,[ - GLIB_LIBS= + dnl As a last ditch, try this + GLIB_LIBS=`echo $GTK_LIBS | sed -e 's/.*-lglib/-lglib/' -e 's/ .*//'` AC_MSG_WARN(GLIB not installed, or glib-config not in path)]) dnl Utility conditional @@ -186,9 +187,6 @@ GTKXMHTML_LIBS="-lgtkxmhtml $LIBGTKXMHTML_LIBS" ZVT_LIBS="-lzvt $GTK_LIBS" -AC_SUBST(GLIB_LIBS) -GLIB_LIBS=`echo $GTK_LIBS | sed -e 's/.*-lglib/-lglib/' -e 's/ .*//'` - dnl These definitions are expanded in make and gnome-config GNOME_LIBDIR='-L${libdir}' GNOME_INCLUDEDIR='-I${includedir}' @@ -221,10 +219,12 @@ libgnome/Makefile libgnomeui/Makefile libgnomeui/pixmaps/Makefile +libvfs/Makefile zvt/Makefile test-suite/Makefile gnome-hello/Makefile test-gnome/Makefile devel-docs/Makefile +devel-docs/ui-guide/Makefile support/Makefile macros/Makefile],[sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile]) diff -uNr gnome-libs-0.26/devel-docs/ChangeLog gnome-libs-0.27/devel-docs/ChangeLog --- gnome-libs-0.26/devel-docs/ChangeLog Wed Dec 31 19:00:00 1969 +++ gnome-libs-0.27/devel-docs/ChangeLog Fri Aug 7 14:46:36 1998 @@ -0,0 +1,32 @@ +1998-08-07 Federico Mena Quintero + + * Makefile.am (SUBDIRS): Added ui-guide to the list of subdirectories. + +1998-07-05 Marius Vollmer + + * gnome-language-bindings.tex: Some stuff about tracing + references. + +1998-07-12 Carsten Schaar + + * gnome-dev-info.sgml: Started with the session management stuff + in the tutorial section. This is not yet finished, but possibly + a little bit useabl. + +1998-05-06 Federico Mena Quintero + + * x-concepts.sgml: New file. I wrote this a while ago to quickly + explain some X concepts that may be useful to people who have not + done X programming before. It is still incomplete. + +Sun Mar 1 01:08:42 1998 Tom Tromey + + * Makefile.am (libgnomeui.sgml): Don't use "test -x" or "which" to + see if gdoc exists. + (libgnome.sgml): Likewise. + + * Makefile.am (libgnomeui.sgml): Append trailer.sgml to generated + file. Find files in srcdir. Put output in srcdir. + (libgnome.sgml): Likewise. + * trailer.sgml: New file. + diff -uNr gnome-libs-0.26/devel-docs/Makefile.am gnome-libs-0.27/devel-docs/Makefile.am --- gnome-libs-0.26/devel-docs/Makefile.am Wed Dec 31 19:00:00 1969 +++ gnome-libs-0.27/devel-docs/Makefile.am Fri Aug 7 14:42:36 1998 @@ -0,0 +1,37 @@ +SUBDIRS = ui-guide + +htmldir = $(prefix)/html +html_DATA = gnome-dev-info.html + +gnome-dev-info.html: gnome-dev-info.sgml libgnomeui.sgml libgnome.sgml + -db2html gnome-dev-info.sgml + +libgnomeui.sgml: + if $(SHELL) -c 'gdoc -V > /dev/null 2>&1 < /dev/null'; then \ +## Inputs and generated files all are in srcdir. + cd $(srcdir); \ + : > libgnomeui.sgml; \ + for i in ../libgnomeui/*.h; do \ +## FIXME: should use explicit perl invocation here. + ./gdoc/gdoc.pl $$i >> libgnomeui.sgml; \ + done; \ + cat trailer.sgml >> libgnomeui.sgml; \ + fi + +libgnome.sgml: + if $(SHELL) -c 'gdoc -V > /dev/null 2>&1 < /dev/null'; then \ +## Inputs and generated files all are in srcdir. + cd $(srcdir); \ + : > libgnome.sgml; \ +## FIXME: should use explicit perl invocation here. + for i in ../libgnome/*.h; do \ + ./gdoc/gdoc.pl $$i >> libgnome.sgml; \ + done; \ + cat trailer.sgml >> libgnome.sgml; \ + fi + +# automake does not yet dig .sgml files, so for now the DocBook +# files must be extra_dist. Also, distribute the `.html' file +# so that people without DocBook can still use the docs. +EXTRA_DIST = gnome-dev-info.html gnome-dev-info.sgml \ + libgnomeui.sgml libgnome.sgml diff -uNr gnome-libs-0.26/devel-docs/Makefile.in gnome-libs-0.27/devel-docs/Makefile.in --- gnome-libs-0.26/devel-docs/Makefile.in Wed Dec 31 19:00:00 1969 +++ gnome-libs-0.27/devel-docs/Makefile.in Thu Aug 13 19:56:51 1998 @@ -0,0 +1,365 @@ +# Makefile.in generated automatically by automake 1.3 from Makefile.am + +# Copyright (C) 1994, 1995, 1996, 1997, 1998 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. + + +SHELL = /bin/sh + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DISTDIR = + +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@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_alias = @build_alias@ +build_triplet = @build@ +host_alias = @host_alias@ +host_triplet = @host@ +target_alias = @target_alias@ +target_triplet = @target@ +AWK = @AWK@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CFLAGS = @CFLAGS@ +CPPFLAGS = @CPPFLAGS@ +DATADIRNAME = @DATADIRNAME@ +DL_LIB = @DL_LIB@ +GENCAT = @GENCAT@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_CONFIG = @GLIB_CONFIG@ +GLIB_LIBS = @GLIB_LIBS@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ +GNOMEUI_LIBS = @GNOMEUI_LIBS@ +GNOME_CANVAS_HED = @GNOME_CANVAS_HED@ +GNOME_CANVAS_OBJS = @GNOME_CANVAS_OBJS@ +GNOME_CANVAS_SRC = @GNOME_CANVAS_SRC@ +GNOME_INCLUDEDIR = @GNOME_INCLUDEDIR@ +GNOME_LIBDIR = @GNOME_LIBDIR@ +GNOME_LIBS = @GNOME_LIBS@ +GTKXMHTML_LIBS = @GTKXMHTML_LIBS@ +GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CONFIG = @GTK_CONFIG@ +GTK_LIBS = @GTK_LIBS@ +GT_NO = @GT_NO@ +GT_YES = @GT_YES@ +INCLUDE_LOCALE_H = @INCLUDE_LOCALE_H@ +INSTOBJEXT = @INSTOBJEXT@ +INTLDEPS = @INTLDEPS@ +INTLLIBS = @INTLLIBS@ +INTLOBJS = @INTLOBJS@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBGNOMEUI_LIBS = @LIBGNOMEUI_LIBS@ +LIBGNOME_LIBS = @LIBGNOME_LIBS@ +LIBGTKXMHTML_LIBS = @LIBGTKXMHTML_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBSUPPORT = @LIBSUPPORT@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +NM = @NM@ +NSL_LIBS = @NSL_LIBS@ +PACKAGE = @PACKAGE@ +POFILES = @POFILES@ +POSUB = @POSUB@ +PTHREAD_LIB = @PTHREAD_LIB@ +RANLIB = @RANLIB@ +SUPPORTINCS = @SUPPORTINCS@ +USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +XPM_LIBS = @XPM_LIBS@ +ZVT_LIBS = @ZVT_LIBS@ +l = @l@ +need_gnome_support = @need_gnome_support@ + +SUBDIRS = ui-guide + +htmldir = $(prefix)/html +html_DATA = gnome-dev-info.html + +# automake does not yet dig .sgml files, so for now the DocBook +# files must be extra_dist. Also, distribute the `.html' file +# so that people without DocBook can still use the docs. +EXTRA_DIST = gnome-dev-info.html gnome-dev-info.sgml \ + libgnomeui.sgml libgnome.sgml +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = ../config.h +CONFIG_CLEAN_FILES = +DATA = $(html_DATA) + +DIST_COMMON = README ChangeLog Makefile.am Makefile.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = tar +GZIP = --best +all: all-recursive all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps devel-docs/Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status + + +install-htmlDATA: $(html_DATA) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(htmldir) + @list='$(html_DATA)'; for p in $$list; do \ + if test -f $(srcdir)/$$p; then \ + echo " $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(htmldir)/$$p"; \ + $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(htmldir)/$$p; \ + else if test -f $$p; then \ + echo " $(INSTALL_DATA) $$p $(DESTDIR)$(htmldir)/$$p"; \ + $(INSTALL_DATA) $$p $(DESTDIR)$(htmldir)/$$p; \ + fi; fi; \ + done + +uninstall-htmlDATA: + @$(NORMAL_UNINSTALL) + list='$(html_DATA)'; for p in $$list; do \ + rm -f $(DESTDIR)$(htmldir)/$$p; \ + done + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. + +@SET_MAKE@ + +all-recursive install-data-recursive install-exec-recursive \ +installdirs-recursive install-recursive uninstall-recursive \ +check-recursive installcheck-recursive info-recursive dvi-recursive: + @set fnord $(MAKEFLAGS); amf=$$2; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + target=`echo $@ | sed s/-recursive//`; \ + echo "Making $$target in $$subdir"; \ + (cd $$subdir && $(MAKE) $$target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done && test -z "$$fail" + +mostlyclean-recursive clean-recursive distclean-recursive \ +maintainer-clean-recursive: + @set fnord $(MAKEFLAGS); amf=$$2; \ + rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \ + rev="$$subdir $$rev"; \ + done; \ + for subdir in $$rev; do \ + target=`echo $@ | sed s/-recursive//`; \ + echo "Making $$target in $$subdir"; \ + (cd $$subdir && $(MAKE) $$target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + (cd $$subdir && $(MAKE) tags); \ + done + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) + here=`pwd` && cd $(srcdir) \ + && mkid -f$$here/ID $(SOURCES) $(HEADERS) $(LISP) + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ + done; \ + 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)$$unique$(LISP)$$tags" \ + || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) + +mostlyclean-tags: + +clean-tags: + +distclean-tags: + -rm -f TAGS ID + +maintainer-clean-tags: + +distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) + +subdir = devel-docs + +distdir: $(DISTFILES) + @for file in $(DISTFILES); do \ + d=$(srcdir); \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file; \ + done + for subdir in $(SUBDIRS); do \ + test -d $(distdir)/$$subdir \ + || mkdir $(distdir)/$$subdir \ + || exit 1; \ + chmod 777 $(distdir)/$$subdir; \ + (cd $$subdir && $(MAKE) top_distdir=../$(top_distdir) distdir=../$(distdir)/$$subdir distdir) \ + || exit 1; \ + done +info: info-recursive +dvi: dvi-recursive +check: all-am + $(MAKE) check-recursive +installcheck: installcheck-recursive +all-am: Makefile $(DATA) + +install-data-am: install-htmlDATA + +uninstall-am: uninstall-htmlDATA + +install-exec: install-exec-recursive + @$(NORMAL_INSTALL) + +install-data: install-data-recursive install-data-am + @$(NORMAL_INSTALL) + +install: install-recursive install-data-am + @: + +uninstall: uninstall-recursive uninstall-am + +install-strip: + $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install +installdirs: installdirs-recursive + $(mkinstalldirs) $(DATADIR)$(htmldir) + + +mostlyclean-generic: + -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -rm -f Makefile $(DISTCLEANFILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) +mostlyclean-am: mostlyclean-tags mostlyclean-generic + +clean-am: clean-tags clean-generic mostlyclean-am + +distclean-am: distclean-tags distclean-generic clean-am + +maintainer-clean-am: maintainer-clean-tags maintainer-clean-generic \ + distclean-am + +mostlyclean: mostlyclean-recursive mostlyclean-am + +clean: clean-recursive clean-am + +distclean: distclean-recursive distclean-am + -rm -f config.status + -rm -f libtool + +maintainer-clean: maintainer-clean-recursive maintainer-clean-am + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +.PHONY: uninstall-htmlDATA install-htmlDATA install-data-recursive \ +uninstall-data-recursive install-exec-recursive \ +uninstall-exec-recursive installdirs-recursive uninstalldirs-recursive \ +all-recursive check-recursive installcheck-recursive info-recursive \ +dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \ +maintainer-clean-recursive tags tags-recursive mostlyclean-tags \ +distclean-tags clean-tags maintainer-clean-tags distdir info dvi \ +installcheck all-am install-data-am uninstall-am install-exec \ +install-data install uninstall all installdirs mostlyclean-generic \ +distclean-generic clean-generic maintainer-clean-generic clean \ +mostlyclean distclean maintainer-clean + + +gnome-dev-info.html: gnome-dev-info.sgml libgnomeui.sgml libgnome.sgml + -db2html gnome-dev-info.sgml + +libgnomeui.sgml: + if $(SHELL) -c 'gdoc -V > /dev/null 2>&1 < /dev/null'; then \ + cd $(srcdir); \ + : > libgnomeui.sgml; \ + for i in ../libgnomeui/*.h; do \ + ./gdoc/gdoc.pl $$i >> libgnomeui.sgml; \ + done; \ + cat trailer.sgml >> libgnomeui.sgml; \ + fi + +libgnome.sgml: + if $(SHELL) -c 'gdoc -V > /dev/null 2>&1 < /dev/null'; then \ + cd $(srcdir); \ + : > libgnome.sgml; \ + for i in ../libgnome/*.h; do \ + ./gdoc/gdoc.pl $$i >> libgnome.sgml; \ + done; \ + cat trailer.sgml >> libgnome.sgml; \ + fi + +# 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 -uNr gnome-libs-0.26/devel-docs/README gnome-libs-0.27/devel-docs/README --- gnome-libs-0.26/devel-docs/README Wed Dec 31 19:00:00 1969 +++ gnome-libs-0.27/devel-docs/README Thu Jul 23 14:08:19 1998 @@ -0,0 +1,3 @@ +Info on programming GNOME apps. + +-HoraPe diff -uNr gnome-libs-0.26/devel-docs/gnome-dev-info.sgml gnome-libs-0.27/devel-docs/gnome-dev-info.sgml --- gnome-libs-0.26/devel-docs/gnome-dev-info.sgml Wed Dec 31 19:00:00 1969 +++ gnome-libs-0.27/devel-docs/gnome-dev-info.sgml Mon Aug 3 09:45:53 1998 @@ -0,0 +1,945 @@ + + +]> + + + Gnome Developers' Information + + + Horacio + Peña + +
+ horape@compendium.com.ar +
+
+
+
+ + 1998 + The GNOME Project - Horacio J. Peña (n.) + + + This documentation is free software; you can redistribute + it and/or modify it under the terms of the GNU General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later + version. + + This program is distributed in the hope that it will be + useful, but WITHOUT ANY WARRANTY; without even the implied + warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the GNU General Public License for more + details. + + You should have received a copy of the GNU General Public + License along with this program; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, + MA 02111-1307 USA + + For more details see the file COPYING in the source + distribution of GNOME. + +
+ + + + + Introduction.. + + Feedback.. + Well, my native language is Spanish, so you're probably going + to find a lot of grammatical and spelling errors. Please tell me + about them. + + + + What is GNOME.. + + GNOME stands for GNU Network Object Model Environment. The GNOME + project intends to build a complete, user-friendly desktop based + entirely on free software. GNOME is part of the GNU project. The + desktop will consist of small utilities and larger applications which + share a consistent look and feel. GNOME uses GTK as the GUI toolkit + for all GNOME-compliant applications. + + + + + This document. + + + this tutorial is in really early stages. So it's almost + empty and hasn't been checked. Uglier, GNOME is in early + stages too, so it's APIs are changing very frequently and + the info here is probably inaccurate. When this document and + the code disagree, the code wins. :-) + + + + As a new GNOME developer I've had some trouble finding info about + how to do some things (and the people on the list were being a bit + annoyed with my questions). So I'm trying to make it easy for you, + the developers that come after me. + + + This document is intended not only to be a tutorial, but also a reference. + I hope it'll grow to be the ultimate guide to the GNOME internals. + I would like to include here the architecture notes that are now in + the website and the style guide. + + + If you add or change some API please document it here. + + + + + + + Non (very) technical issues. + + This chapter will discuss issues ranging from how to obtain a CVS account + to indenting standards. + + + + Programming languages that can be used in GNOME. + + GNOME is intended to support any languages. But you need to have + GTK+ and GNOME bindings for your particular language. Our preferred + languages are C and scheme (using guile.) There are bindings too + for Objective C. There are GTK bindings for C++ (Gtk--) and for + Perl, but as far as I know, they aren't very good and still there aren't bindings + for GNOME stuff for these languages. + + + + + How to start hacking GNOME. + + Read the README and HACKING files to know how to download the latest + GNOME from CVS. + + + You will need know the Gtk+ toolkit. If you are not familiar with it, + you may consider reading the + Gtk+ Tutorial. + + + When you've made your changes you need to make a diff... The best + way to do it is: + + $ cvs diff -u > diffs + + [FIXME: Does it work with anonymous CVS?] + After it send the diffs file to gnome-list@gnome.org. + In a short time one of the core hackers will answer you and he + is going to be your "GNOME godfather". Then, and until you have a + CVS account send your patches to him. + [FIXME: What think, you GNOME core hackers, about the godfather idea?] + + + + + What to hack. + + If you want to dirt your hands with GNOME, I've some advice for you: + + + Start simple. Do little things and familiarize yourself + with GNOME. You'll have time to do great things after. + + Read the TODO. You'll find some interesting things to + work in. + + + + + + Obtaining a CVS account. + + When you was working in the GNOME during a while it's time for getting + a CVS account, so you can submit your patches directly. Just ask + your "godfather" for it. + + + + + Policy on hacking another people's code. + + If you're going to do a little fixes, go and do it. But if you + plan to do changes to some API or rewriting some code please tell + it to the author. (I've learned it by the hard way and the gnome-score + stuff is broken yet because my error :-( ) + + + + + When adding yourself to AUTHORS file. + + We know it. You're working in the GNOME to impress girls saying them: + "Hey, I'm a GNOME developer" :-), so you want to add yourself to + the AUTHORS file as quickly as you can... + + + To know when you can add yourself only think :-), if you've only + fixed some typos don't do it. If you've added a great bunch of + (good) code, then go ahead. + + + (Very personal opinion:) I suggest you don't + add yourself to the root AUTHORS file. I think you should + wait for some of the core hackers recognize your work and add you. + (i believe it would be very much more satisfying to know that the + "real" hackers value your work, probably this belief is why I am not + there yet... :-) ) + + + + + Coding Standards. + + + Code that goes into Gnome uses the Linux kernel coding + style (which is basically the GNU coding style but indentation is + 8 spaces, and braces are on the same line as the statements that + open the block). + Please, please, please, be in the 80 columns... + + When you change things, edit the ChangeLog, so the + other people can know what you've did. + When you're writing code that should be written better + add FIXME comments so it's easy to recognize. + Document your programs. + If you do changes to the APIs documented here or add + some new ones please update the documentation. + Add translations for your native language. We would like + have a full internationalized GNOME. (so if you know more than + one language do translations for all them) (we would like all + the idioms, from francais to old greek :-) ) + [FIXME: Add a list of currently supported languages, and a list of wanted languages ?] + + + + + + + + GNOME Developer's Tutorial. + + From the gnome-hello manual: + + + gnome-hello is a GNOME application which contains all the essential + and common features of GNOME programs, such as initialization, event + loops, configuration file parsing, internationalization and so forth. + + + gnome-hello is intended to be an example of the GNOME coding + standards, as well as a fun and useless little program. + + + In this chapter we're going to use it to explain the basics features + that an application must have to be considered gnome-compliant. + + + + Starting with GNOME + + A basic GNOME App: A window with only a button + + + + + We'll start with a very basic application. It's only a window + with a button which when clicked, close the window and prints + "Hello GNOME". The code source for it is in + programs/gnome-hello/gnome-hello-0-basic.c. [FIXME: + Should i include the full code here?] + + + #include <config.h> + #include <gnome.h> + + + All the programs have to include gnome.h which + gives all you need to use the Gtk+ and GNOME libraries. + + + int + main(int argc, char *argv[]) + { + + gnome_init is always called at the beginning + of a program. It takes care of initializing both Gtk and GNOME. + + + gnome_init (&argc, &argv); + + Then we call prepare_app that do the real + work and gtk_main to enter into the main + processing loop. + + + prepare_app (); + + gtk_main (); + + return 0; + } + + Let's now go to the prepare_app code... + + + void + prepare_app() + { + GtkWidget *button; + + We first make the main window calling + gnome_app_new and connect the signal + delete_event to the callback + quit_cb, so the user can close the app via the + window manager: + + + app = gnome_app_new ("hello", "Hello World Gnomified"); + gtk_widget_realize (app); + gtk_signal_connect (GTK_OBJECT (app), "delete_event", + GTK_SIGNAL_FUNC (quit_cb), NULL); + + Then, we create a button and set it to be the content of the main + window. + + + button = gtk_button_new_with_label ("Hello GNOME"); + gtk_signal_connect (GTK_OBJECT (button), "clicked", + GTK_SIGNAL_FUNC (hello_cb), NULL); + gtk_container_border_width (GTK_CONTAINER (button), 60); + gnome_app_set_contents ( GNOME_APP (app), button); + + Finally, we show the widgets. It could be done in any order, + but we display at last the main window so the whole window + will pop up at once rather than seeing the window pop up, and + then the button form inside of it. + + + gtk_widget_show (button); + gtk_widget_show (app); + } + + The callbacks (hello_cb for the button and + quit_cb for delete_event) + are very simple. They just call gtk_main_quit + to exit. + + + void + hello_cb (GtkWidget *widget, void *data) + { + g_print ("Hello GNOME\n"); + gtk_main_quit (); + return; + } + + void + quit_cb (GtkWidget *widget, void *data) + { + gtk_main_quit (); + return; + } + + + + + Adding menus + + + + + From the GNOME Style Guide + + + +Menus and MenuBars + Menubars should be present in every App. + All apps should have a "Help" entry in the Menubar. + All menus need at least one entry. + An About Menu should be available in under the Help Menu and + should open a small dialog telling at least app name, author, + version, and date. + A "File" menu should be in every application, and contain at least + Quit. + Menu items that open dialogs should indicate it with an "..." + Menu items that lead to submenus should indicate it with an + arrow. The Help Menu should be right justified in the + Menubar. + + + + At the time of the writing of this draft gnome-hello uses the + GtkMenuFactory way of creating menus. It's going to be replaced + by the gnome-app-helper in a little time. (when the gnome_app_* + have support for i18n, accelerators and right-justified menus). Until + then isn't going to be an explanation about "how" do the menus. + + + The menu options present in gnome-hello are only the mandatory: + File/Exit, that uses the same quit_cb + that we've seen in the previous section, and + Help/About... that uses the + gnome-about widget (see ) written + by Cesar miquel@df.uba.ar. + + +void +about_cb (GtkWidget *widget, void *data) +{ + GtkWidget *about; + gchar *authors[] = { +/* Here should be your names */ + "Mark Galassi", + "Horacio J. Peña", + NULL + }; + + about = gnome_about_new ( "The Hello World Gnomified", VERSION, + /* copyright notice */ + "(C) 1998 the Free Software Foundation", + authors, + /* another comments */ + "GNOME is a civilized software system " + "so we've a \"hello world\" program", + NULL); + gtk_widget_show (about); + + return; +} + + + + + Internationalization. + + + + + Internationalization (i18n for short) is very easy with GNOME. We + use GNU gettext. You need to initialize it with a call to + bindtextdomain and + textdomain in your main function. + After it a _() to all the strings that need translation. + + + You will need add your file to po/POTFILES.in. Then you can do + make gnome-modulename.pot;make update-po, edit the .po file + corresponding to your language and do make install. + Now try your program... Wow! It's speaking in Spanish/Finnish/Latin... + + + + _() is a macro for the function gettext. So it won't work + when initializing arrays of strings or structs. You'll need + use the N_() macro around the strings instead. If you want + know more about it read the info documentation of GNU + gettext. + + + + + + Parsing parameters. + + Well, Carsten and Tom are talking about standardizing it, so I'll + wait a bit their definitions. + + + + + Session Management + + + This chapter is definitely under construction, But hold your + breath, it will (hopefully) be finished soon. + + + Session Management in general + + The purpose of session management is to provide users a + possibility to save and restore their sessions. A session + is a collection of applications, all of them having an + internal state. This state may be the name of an open file, + a displayed image or the score of a game. + + + Every application that is session management aware connects + to one special server: the session + manager. A session manager sends commands to his + clients telling them to save their + state or to terminate. A client must provide the session + manager with all information, that is needed to restart the + client in the same state, as it is running now. The session + manager's task is to take care of this information and to + use it when restarting a session. In order to distinguish + all clients, the session manager assigns them a unique + identifier: the so called client id. + + + The session management additionally includes a protocol to + sync the - so called - interact requests of applications. + Suppose you have three applications running. Each of this + applications has one file opened, that you have just edited + without saving. If you now log out, every application may + ask you, whether you want to save your changes or if you + want to abandon them. It would be very annoying, if all + these three applications would pop up their dialog boxes at + the same time. If these three applications have implemented + session management in the right way, a new dialog box only + pops up, if the previous one has been closed. + + + + GNOME Session Management implementation + + The GNOME project uses a special object - the GnomeClient + object - to implement session management. This object + handles the connection to a session manager, the setting and + removing of properties and the handling of messages sent by + a session manager. + + + There are two functions in the GNOME libraries, that create + a new GnomeClient object: + + + GnomeClient + *gnome_client_new + + + + GnomeClient + *gnome_client_new_without_connection + + + + As one may guess from the functions names: The first + function tries to connect to a session manager + automatically, while the second one does not. You may + connect or disconnect a GnomeClient after his creation using + the following functions: + + + void gnome_client_connect + GnomeClient *client + + + void + gnome_client_disconnect + GnomeClient + *client + + + gchar *gnome_client_get_id + GnomeClient *client + + + void gnome_client_set_id + GnomeClient *client + const gchar *client_id + + to be continued... + + Properties + + + + + Signals + + Whenever the session manager wants a client to do + something, these wishes are emitted as signals. + + + + gint save_yourself_signal + GnomeClient *client + gint phase + GnomeSaveStyle save_style + gint shutdown + GnomeInteractStyle interact_style + gint fast + gpointer client_data + + + This signal is probably the most important one, because it + causes the clients to save the programs state. + + + save_style. + + + The shutdown parameter indicates, whether this + + + GNOME_INTERACT_NONE, GNOME_INTERACT_ERRORS, GNOME_INTERACT_ANY + + + If the fast parameter is + TRUE, the client is wanted to save it's state + as fast as possible. + + + + gint die_signal + GnomeClient *client + gpointer client_data + + + The above signal is emitted, if the session manager wants + the client to terminate. This will mostly happen, if the + user logs out from a running session. + + + gint save_complete_signal + GnomeClient *client + gpointer client_data + + + The session manager sends this message, if all client have + finished saving their state. + + + gint shutdown_cancelled_signal + GnomeClient *client + gpointer client_data + + + Whenever a shutdown, that has been announced in a + save_yourself signal, has been cancelled by the user, the + shutdown_cancelled message is sent. + + + gint connect_signal + GnomeClient *client + gint restarted + gpointer client_data + + + gint disconnect_signal + GnomeClient *client + gpointer client_data + + + This signal is emitted, if the connection to the session + manager gets lost. + + + + The master client + + To make life a little bit easier for GNOME developers, the + GNOME libraries feature a special client: the + master client. This client is + created automatically, when calling + gnome_init. He gets some default + properties set and is in general also connected to the + session manager automatically. the GNOME libraries also + notice, if a this client was restarted. In this case, the + libraries try to connect the master client to the session + manager with the same client id as last time. That means, + that an application calling + gnome_init will be recognized and be + restarted from a session manager without any extra lines + of code. A developer has only to take care, that the + applications state is saved or restored correctly and that + the application is terminated, if she is wanted to. + + + Your get the master client by calling + gnome_master_client. + + + GnomeClient + *gnome_master_client + + + + The master client has the following properties preset. + + + + + + property + value + + + + + current directory + current directory + + + process id + pid + + + user id + uid + + + + + + + + The cloned client + + + + + Continuing the tutorial + + We want to implement session management, so we have to use + the master client. To get access to this client, that was + created in gnome_init, you have to + call gnome_master_client. Our + application should at least listen to the die and the + save_yourself signal, so insert the following lines of code + right after the gnome_init call. + + + + client= gnome_master_client (); + + gtk_signal_connect (GTK_OBJECT (client), "save_yourself", + GTK_SIGNAL_FUNC (save_state_cb), NULL); + gtk_signal_connect (GTK_OBJECT (client), "die", + GTK_SIGNAL_FUNC (die_cb), NULL); + + + Now we have to implement our signal functions. The die + signal function is rather easy to implement. We just have + to terminate our application. Notice, that we must not + save the applications state in a die signal function. If + the session manager would have wanted us to save the state, + he would have sent us a save_yourself signal right before + the die signal. If you are writing a more complicated + application, you may want to close some files here or do + some other magic stuff. + + + +static gint +die (GnomeClient *client, gpointer client_data) +{ + gtk_exit (0); + + return FALSE; +} + + + Implementing the save_yourself signal is a little bit more + difficult, because we have to save the hole state of our + application. Our tutorial application has only one state: + the window's position on the screen. So we start our + save_yourself signal function like this: + + +gint +save_yourself (GnomeClient *client, + gint phase, + GnomeRestartStyle restart_style, + gint shutdown, + GnomeInteractStyle interact_style, + gint fast, + gpointer client_data) +{ + gchar *argv[3]; + gint x, y, w, h; + + gdk_window_get_geometry (app->window, &x, &y, &w, &h, NULL); + + + + Now that we have our application's state, we have to store + it. One way to do this is to store the application's state + in the command line that we use to restart our application. + That's a quite useful method for storing a little set of + values. In this tutorial we'll implement another way of + saving the applications state, that is even practical, if + you have a huge bunch of data to save. We use the gnome + config files. The + gnome_client_get_config_prefix gives us + a hint , where to store our information. + + + /* Save the state using gnome-config stuff. */ + gnome_config_push_prefix (gnome_client_get_config_prefix (client)); + + gnome_config_set_int ("Geometry/x", x); + gnome_config_set_int ("Geometry/y", y); + gnome_config_set_int ("Geometry/w", w); + gnome_config_set_int ("Geometry/h", h); + + gnome_config_pop_prefix (); + gnome_config_sync(); + + + + Additionally we have to give the session manager some hints, + how to restart our application. That means, we have to use + the gnome_client_set_clone_command and + gnome_client_set_restart_command + functions. Notice that we don't have to add the clients id + to these command; we don't even have to add the standard + GNOME command line options. Both is added by the GNOME + libraries. We also don't have to distinguish between the + restart command and the clone command. This is also handled + by the libraries. + + + gnome_client_set_clone_command (client, 1, argv); + gnome_client_set_restart_command (client, 1, argv); + + return TRUE; +} + + + + The attentive reader may have noticed, that we save the + applications state, but that we have no code to restore it. + This has to be changed! + + + The following code snippets should be inserted directly + after the gtk_signal_connect calls, + that we inserted at the beginning of the session management + chapter. + + + To restore the saved state, we use the cloned client. We + get access to this client, by calling + gnome_cloned_client. The creation of + the cloned client is handled by the GNOME libraries. Our + application was only restarted by a session manager, if + gnome_cloned_client returns a non NULL + value. That means, that, if + gnome_cloned_client returns NULL, we + don't have to restore any state, because there is no state + to restore. + + + if (GNOME_CLIENT_CONNECTED (client)) + { + GnomeClient *cloned= gnome_cloned_client (); + + if (cloned) + { + restarted= 1; + + + + We now again use + gnome_client_get_config_prefix to get a + hint, where to find our saved state. Notice, that we use + the cloned client when restoring and the master client when + saving the state. The reason for this is, that the cloned + client's id may be another then the master client's one, and + so the config prefixes differ. This may happen, if you clone + a client (something, that's not yet supported by the + gnome-session session management + server). + + + gnome_config_push_prefix (gnome_client_get_config_prefix + (cloned)); + + os_x = gnome_config_get_int ("Geometry/x"); + os_y = gnome_config_get_int ("Geometry/y"); + os_w = gnome_config_get_int ("Geometry/w"); + os_h = gnome_config_get_int ("Geometry/h"); + + gnome_config_pop_prefix (); + } + } + + + + Additionally the following lines should be included into the + prepare_app function, to really set the + values, we just red: + + + if (restarted) { + gtk_widget_set_uposition (app, os_x, os_y); + gtk_widget_set_usize (app, os_w, os_h); + } + + + + We have still not finished this tutorial's chapter, because + right now, saving the application's state would fill our + harddisc. So we have to remove our config files, if they + are not needed anymore. This is supported by the session + manager, using the discard command property. + + + We have to add a new command line option to our application, + that discards a save state (Hold you breath, I'll add the + code soon). Additionally, we have to inform the session + manager, to call us with this command line option to discard + our state. This is easily be done by using the + gnome_client_set_discard_command + function. The following lines, inserted somewhere in the + save_yourself function, do exactly what + we want. + + + argv[0] = program_invocation_name; + argv[1] = "--discard-session"; + argv[2] = gnome_client_get_config_prefix (client); + gnome_client_set_discard_command (client, 3, argv); + + + + still to be continued... + + + + + + Help and documentation. + + I think that Mark would like writing this section... [FIXME: Mark, + do you want do it?] + + + + + + + Architecture notes. + + [FIXME: I think that we could include here the notes that now are in + the website.] + + + + + GNOME library. + + This chapter is intended to be a reference to the libgnome. + + &libgnome; + + + + GNOME User Interface library. + + This chapter is intended to be a reference to the libgnomeui. + + &libgnomeui; + +
diff -uNr gnome-libs-0.26/devel-docs/libgnome.sgml gnome-libs-0.27/devel-docs/libgnome.sgml --- gnome-libs-0.26/devel-docs/libgnome.sgml Wed Dec 31 19:00:00 1969 +++ gnome-libs-0.27/devel-docs/libgnome.sgml Thu Jul 23 14:08:20 1998 @@ -0,0 +1,135 @@ + + gnome-config +Description + +Not descripted + + + + + gnome-defs +Description + +Not descripted + + + + + gnome-dentry +Description + +Not descripted + + + + + gnome-dl +Description + +Not descripted + + + + + gnome-fileconvert +Description + +Not descripted + + + + + gnome-help +Description + +Not descripted + + + + + gnome-history +Description + +Not descripted + + + + + gnome-hook +Description + +Not descripted + + + + + gnome-i18n +Description + +Not descripted + + + + + gnome-mime +Description + +Not descripted + + + + + gnome-score +Description + +Not descripted + + + + + gnome-string +Description + +Not descripted + + + + + gnome-triggers +Description + +Not descripted + + + + + gnome-util +Description + +Not descripted + + + + + libgnome +Description + +Not descripted + + + + diff -uNr gnome-libs-0.26/devel-docs/libgnomeui.sgml gnome-libs-0.27/devel-docs/libgnomeui.sgml --- gnome-libs-0.26/devel-docs/libgnomeui.sgml Wed Dec 31 19:00:00 1969 +++ gnome-libs-0.27/devel-docs/libgnomeui.sgml Mon Aug 3 09:45:53 1998 @@ -0,0 +1,1126 @@ + + gnome-about - "About..." Widget +Author(s) + +Cesar Miquel <miquel@df.uba.ar> + + + + +Description + +A very specialized widget to display "About this program"-like +boxes. + + + + + gnome_about_new - Main routine that creates the widget + GtkWidget *gnome_about_new + + +gchar *title + + +gchar *version + + +gchar *copyright + + +gchar **authors + + +gchar *comments + + +gchar *logo + + +Description + +Main routine that creates the widget + + +Usage + +gchar *authors[] = +{"author1", "author2",..., NULL}; + +GtkWidget *about = gnome_about_new (_ ("GnoApp"), "1.2b", + _ ("Copyright FSF (C) 1998"), + authors, + "Comment line 1\nLine 2", + "/usr/local/share/pixmaps/gnoapp-logo.xpm"); +gtk_widget_show (about); + + + +Parameters + + +gchar *title +Name of the application. + + +gchar *version +Version. + + +gchar *copyright +Copyright notice (one +line.) + + +gchar **authors +NULL terminated list of +authors. + + +gchar *comments +Other comments. + + +gchar *logo +A logo pixmap file. + + + + + + + gnome-actionarea +Description + +Not descripted + + + + + gnome-app-helper +Description + +Not descripted + + + + + gnome-app +Description + +Not descripted + + + + + gnome-client +Description + +Not descripted + + + + + gnome-color-selector +Description + +Not descripted + + + + + gnome-dns +Description + +Not descripted + + + + + gnome-font-selector +Description + +GnomeFontSelector widget, by Elliot Lee. +Derived from code in: +The GIMP -- an image manipulation program +Copyright (C) 1995 Spencer Kimball and Peter Mattis +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + + + + + FontInfo - struct is defined in gnome-fontsel.c +struct _FontInfo FontInfo +Description + +struct is defined in gnome-fontsel.c + + + + + gnome_font_selector_get_selected - You should free this retval up after you're done with it + gchar *gnome_font_selector_get_selected + + +GnomeFontSelector *text_tool + + +Description + +You should free this retval up after you're done with it + + +Parameters + + +GnomeFontSelector *text_tool +Not Descripted. + + + + + + gnome_font_select + gchar *gnome_font_select + + +void (null) + + +Description + +Basically runs a modal-dialog version of this, and returns +the string that id's the selected font. + + + +Parameters + + +void (null) +Not Descripted. + + + + + + + gnome-ice +Description + +gnome-ice.h - Interface between ICE and Gtk. +Written by Tom Tromey <tromey@cygnus.com>. + + + + + gnome_ice_init + void gnome_ice_init + + +void (null) + + +Description + +This function should be called before any ICE functions are used. +It will arrange for ICE connections to be read and dispatched via +the Gtk event loop. This function can be called any number of +times without harm. + + + +Parameters + + +void (null) +Not Descripted. + + + + + + + gnome-messagebox +Description + +Not descripted + + + + + gnome-net +Description + +Not descripted + + + + + gnome-pixmap +Description + +Not descripted + + + + + gnome-properties +Description + +Not descripted + + + + + gnome-scores - "High Scores" Widget +Author(s) + +Horacio J. Peña <horape@compendium.com.ar> +This is free software (under the terms of the GNU LGPL) + + + + +Description + +A specialized widget to display "High Scores" for games. It's +very integrated with the gnome-score stuff so you only need to +call one function to do all the work... + + + +Usage + +Use the gnome_scores_display.The other functions are going to be + discontinued...(ok, i should add pixmap support to * _display + before) + + + + + gnome_scores_display - Does all the work of displaying the best scores. + void gnome_scores_display + + +gchar *title + + +gchar *app_name + + +gchar *level + + +int pos + + +Description + +It calls gnome_score_get_notables to retrieve the info, +creates the window, and show it. + + + + +Returns + +Doesn't return nothing + + +Usage + +pos = gnome_score_log (score, level, TRUE); +gnome_scores_display (_ ("Mi game"), "migame", level, pos); + + + +Parameters + + +gchar *title +Title. + + +gchar *app_name +Name of the application, as in +gnome_score_init. + + +gchar *level +Level of the game or NULL. + + +int pos +Position in the top ten of the +current player, as returned by +gnome_score_log. + + + + + + gnome_scores_new - Creates the high-scores window. + GtkWidget *gnome_scores_new + + +guint n_scores + + +gchar **names + + +gfloat *scores + + +time_t *times + + +guint clear + + +Description + +Creates the high-scores window. + + +Parameters + + +guint n_scores +Number of positions. + + +gchar **names +Names of the players. + + +gfloat *scores +Scores + + +time_t *times +Time in which the scores were done + + +guint clear +Add a "Clear" Button? + + + + + + gnome_scores_set_logo_label - Creates a label to be the logo + void gnome_scores_set_logo_label + + +GnomeScores *gs + + +gchar *txt + + +gchar *font + + +GdkColor *color + + +Description + +Creates a label to be the logo + + +Parameters + + +GnomeScores *gs +GNOME Scores widget. + + +gchar *txt +Text in the label. + + +gchar *font +Font to use in the label. + + +GdkColor *color +Color to use in the label. + + + + + + gnome_scores_set_logo_pixmap - Creates a pixmap to be the logo + void gnome_scores_set_logo_pixmap + + +GnomeScores *gs + + +gchar *logo + + +Description + +Creates a pixmap to be the logo + + +Parameters + + +GnomeScores *gs +GNOME Scores widget. + + +gchar *logo +Name of the .xpm. + + + + + + gnome_scores_set_logo_widget - Set an arbitrary widget to be the logo. + void gnome_scores_set_logo_widget + + +GnomeScores *gs + + +GtkWidget *w + + +Description + +Set an arbitrary widget to be the logo. + + +Parameters + + +GnomeScores *gs +GNOME Scores widget. + + +GtkWidget *w +Widget to be used as logo. + + + + + + gnome_scores_set_color - Set the color of one entry. + void gnome_scores_set_color + + +GnomeScores *gs + + +guint pos + + +GdkColor *col + + +Description + +Set the color of one entry. + + +Parameters + + +GnomeScores *gs +GNOME Scores widget. + + +guint pos +Entry to be changed. + + +GdkColor *col +Color. + + + + + + gnome_scores_set_def_color - Set the default color of the entries. + void gnome_scores_set_def_color + + +GnomeScores *gs + + +GdkColor *col + + +Description + +Set the default color of the entries. + + +Parameters + + +GnomeScores *gs +GNOME Scores widget. + + +GdkColor *col +Color. + + + + + + gnome_scores_set_colors - Set the color of all the entries. + void gnome_scores_set_colors + + +GnomeScores *gs + + +GdkColor *col + + +Description + +Set the color of all the entries. + + +Parameters + + +GnomeScores *gs +Not Descripted. + + +GdkColor *col +Array of colors. + + + + + + gnome_scores_set_logo_label_title - Creates a label to be the logo + void gnome_scores_set_logo_label_title + + +GnomeScores *gs + + +gchar *txt + + +Description + +Creates a label to be the logo + + +Parameters + + +GnomeScores *gs +GNOME Scores widget. + + +gchar *txt +Name of the logo. + + + + + + gnome_scores_set_current_player - Set the index of the current player in top ten. + void gnome_scores_set_current_player + + +GnomeScores *gs + + +gint i + + +Description + +Set the index of the current player in top ten. + + +Parameters + + +GnomeScores *gs +GNOME Scores widget. + + +gint i +Index of the current(from 0 to 9). + + + + + + + gnome-session +Description + +Not descripted + + + + + gnome-startup +Description + +Not descripted + + + + + gnome-stock-imlib +Description + +This file holds the stock pixmaps in rgb_data format. It is only needed, +when USE_GDK_IMLIB is defined in gnome-stock.h + + + + + imlib_new - toolbar pixmaps +static char imlib_new[] +Description + +toolbar pixmaps + + + + + imlib_ok - button pixmaps +static char imlib_ok[] +Description + +button pixmaps + + + + + imlib_menu_new - menu pixmaps +static char imlib_menu_new[] +Description + +menu pixmaps + + + + + + gnome-stock-xpm - XPM +Description + +XPM + + + + gnome_stock_cancel_xpm - XPM +static char *gnome_stock_cancel_xpm[] +Description + +XPM + + + + + gnome_stock_menu_about_xpm - XPM +static char *gnome_stock_menu_about_xpm[] +Description + +XPM + + + + + gnome_stock_menu_exit_xpm - XPM +static char *gnome_stock_menu_exit_xpm[] +Description + +XPM + + + + + gnome_stock_menu_new_xpm - XPM +static char *gnome_stock_menu_new_xpm[] +Description + +XPM + + + + + menu_cut_xpm - XPM +static char *menu_cut_xpm[] +Description + +XPM + + + + + menu_copy_xpm - XPM +static char *menu_copy_xpm[] +Description + +XPM + + + + + menu_paste_xpm - XPM +static char *menu_paste_xpm[] +Description + +XPM + + + + + menu_prop_xpm - XPM +static char *menu_prop_xpm[] +Description + +XPM + + + + + menu_open_xpm - XPM +static char *menu_open_xpm[] +Description + +XPM + + + + + menu_save_xpm - XPM +static char *menu_save_xpm[] +Description + +XPM + + + + + menu_blank_xpm - XPM +static char *menu_blank_xpm[] +Description + +XPM + + + + + + gnome-stock +Description + +If defined, gdk_imlib is used for the pixmap stuff. That will help alot. +As well for colormaps, as for determining the size of a pixmap before a +GdkWindow is created. +TODO: I cannot define this here permanently because it will require, +that all apps link against gdk_imlib. We will require a check, if +gdk_imlib is installed on the particular system and include -lgdk_imlib +in LIBS for that. + + + + + GnomeStockPixmapEntryAny - some internal definitions +struct _GnomeStockPixmapEntryAny GnomeStockPixmapEntryAny +Description + +some internal definitions + + + + + GnomeStockPixmapWidget - the GnomeStockPixmapWidget +struct _GnomeStockPixmapWidget GnomeStockPixmapWidget +Description + +the GnomeStockPixmapWidget + + + + + gnome_stock_pixmap - just fetch a pixmap + GtkPixmap *gnome_stock_pixmap + + +GtkWidget *window + + +char *icon + + +char *subtype + + +Description + +just fetch a pixmap + + +Parameters + + +GtkWidget *window +Not Descripted. + + +char *icon +Not Descripted. + + +char *subtype +Not Descripted. + + + + + + gnome_stock_pixmap_widget - just fetch a GnomeStockPixmapWidget + GtkWidget *gnome_stock_pixmap_widget + + +GtkWidget *window + + +char *icon + + +Description + +just fetch a GnomeStockPixmapWidget + + +Parameters + + +GtkWidget *window +Not Descripted. + + +char *icon +Not Descripted. + + + + + + gnome_stock_pixmap_register - register a pixmap. returns non-zero, if successful + gint gnome_stock_pixmap_register + + +char *icon + + +char *subtype + + +GnomeStockPixmapEntry *entry + + +Description + +register a pixmap. returns non-zero, if successful + + +Parameters + + +char *icon +Not Descripted. + + +char *subtype +Not Descripted. + + +GnomeStockPixmapEntry *entry +Not Descripted. + + + + + + gnome_stock_pixmap_change - change an existing entry. returns non-zero on success + gint gnome_stock_pixmap_change + + +char *icon + + +char *subtype + + +GnomeStockPixmapEntry *entry + + +Description + +change an existing entry. returns non-zero on success + + +Parameters + + +char *icon +Not Descripted. + + +char *subtype +Not Descripted. + + +GnomeStockPixmapEntry *entry +Not Descripted. + + + + + + gnome_stock_pixmap_checkfor + GnomeStockPixmapEntry *gnome_stock_pixmap_checkfor + + +char *icon + + +char *subtype + + +Description + +check for the existence of an entry. returns the entry if it +exists, or NULL otherwise + + + +Parameters + + +char *icon +Not Descripted. + + +char *subtype +Not Descripted. + + + + + + gnome_stock_button - returns a default button widget for dialogs + GtkWidget *gnome_stock_button + + +char *type + + +Description + +returns a default button widget for dialogs + + +Parameters + + +char *type +Not Descripted. + + + + + + gnome_stock_menu_item - returns a GtkMenuItem with an stock icon and text + GtkWidget *gnome_stock_menu_item + + +char *type + + +char *text + + +Description + +returns a GtkMenuItem with an stock icon and text + + +Parameters + + +char *type +Not Descripted. + + +char *text +Not Descripted. + + + + + + + gtk-clock +Description + +Not descripted + + + + + gtk-ted +Description + +Not descripted + + + + + libgnomeui +Description + +Not descripted + + + + diff -uNr gnome-libs-0.26/devel-docs/ui-guide/ChangeLog gnome-libs-0.27/devel-docs/ui-guide/ChangeLog --- gnome-libs-0.26/devel-docs/ui-guide/ChangeLog Wed Dec 31 19:00:00 1969 +++ gnome-libs-0.27/devel-docs/ui-guide/ChangeLog Mon Aug 10 16:14:27 1998 @@ -0,0 +1,9 @@ +1998-08-10 Federico Mena Quintero + + * ui-guide.sgml: New sgml version of the GNOME UI Guidelines, + courtesy of Martin Wahlén (mwahlen@soundfound.com). + +1998-08-07 Federico Mena Quintero + + * ui-guide.txt: New file with the GNOME User Interface Guidelines. + This is a work in progress. diff -uNr gnome-libs-0.26/devel-docs/ui-guide/Makefile.am gnome-libs-0.27/devel-docs/ui-guide/Makefile.am --- gnome-libs-0.26/devel-docs/ui-guide/Makefile.am Wed Dec 31 19:00:00 1969 +++ gnome-libs-0.27/devel-docs/ui-guide/Makefile.am Mon Aug 10 10:48:23 1998 @@ -0,0 +1 @@ +EXTRA_DIST = ui-guide.txt ui-guide.sgml diff -uNr gnome-libs-0.26/devel-docs/ui-guide/Makefile.in gnome-libs-0.27/devel-docs/ui-guide/Makefile.in --- gnome-libs-0.26/devel-docs/ui-guide/Makefile.in Wed Dec 31 19:00:00 1969 +++ gnome-libs-0.27/devel-docs/ui-guide/Makefile.in Thu Aug 13 19:56:51 1998 @@ -0,0 +1,219 @@ +# Makefile.in generated automatically by automake 1.3 from Makefile.am + +# Copyright (C) 1994, 1995, 1996, 1997, 1998 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. + + +SHELL = /bin/sh + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DISTDIR = + +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@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_alias = @build_alias@ +build_triplet = @build@ +host_alias = @host_alias@ +host_triplet = @host@ +target_alias = @target_alias@ +target_triplet = @target@ +AWK = @AWK@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CFLAGS = @CFLAGS@ +CPPFLAGS = @CPPFLAGS@ +DATADIRNAME = @DATADIRNAME@ +DL_LIB = @DL_LIB@ +GENCAT = @GENCAT@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_CONFIG = @GLIB_CONFIG@ +GLIB_LIBS = @GLIB_LIBS@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ +GNOMEUI_LIBS = @GNOMEUI_LIBS@ +GNOME_CANVAS_HED = @GNOME_CANVAS_HED@ +GNOME_CANVAS_OBJS = @GNOME_CANVAS_OBJS@ +GNOME_CANVAS_SRC = @GNOME_CANVAS_SRC@ +GNOME_INCLUDEDIR = @GNOME_INCLUDEDIR@ +GNOME_LIBDIR = @GNOME_LIBDIR@ +GNOME_LIBS = @GNOME_LIBS@ +GTKXMHTML_LIBS = @GTKXMHTML_LIBS@ +GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CONFIG = @GTK_CONFIG@ +GTK_LIBS = @GTK_LIBS@ +GT_NO = @GT_NO@ +GT_YES = @GT_YES@ +INCLUDE_LOCALE_H = @INCLUDE_LOCALE_H@ +INSTOBJEXT = @INSTOBJEXT@ +INTLDEPS = @INTLDEPS@ +INTLLIBS = @INTLLIBS@ +INTLOBJS = @INTLOBJS@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBGNOMEUI_LIBS = @LIBGNOMEUI_LIBS@ +LIBGNOME_LIBS = @LIBGNOME_LIBS@ +LIBGTKXMHTML_LIBS = @LIBGTKXMHTML_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBSUPPORT = @LIBSUPPORT@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +NM = @NM@ +NSL_LIBS = @NSL_LIBS@ +PACKAGE = @PACKAGE@ +POFILES = @POFILES@ +POSUB = @POSUB@ +PTHREAD_LIB = @PTHREAD_LIB@ +RANLIB = @RANLIB@ +SUPPORTINCS = @SUPPORTINCS@ +USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +XPM_LIBS = @XPM_LIBS@ +ZVT_LIBS = @ZVT_LIBS@ +l = @l@ +need_gnome_support = @need_gnome_support@ + +EXTRA_DIST = ui-guide.txt ui-guide.sgml +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = ../../config.h +CONFIG_CLEAN_FILES = +DIST_COMMON = ChangeLog Makefile.am Makefile.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = tar +GZIP = --best +all: Makefile + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps devel-docs/ui-guide/Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status + +tags: TAGS +TAGS: + + +distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) + +subdir = devel-docs/ui-guide + +distdir: $(DISTFILES) + @for file in $(DISTFILES); do \ + d=$(srcdir); \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file; \ + done +info: +dvi: +check: all + $(MAKE) +installcheck: +install-exec: + @$(NORMAL_INSTALL) + +install-data: + @$(NORMAL_INSTALL) + +install: install-exec install-data all + @: + +uninstall: + +install-strip: + $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install +installdirs: + + +mostlyclean-generic: + -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -rm -f Makefile $(DISTCLEANFILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) +mostlyclean: mostlyclean-generic + +clean: clean-generic mostlyclean + +distclean: distclean-generic clean + -rm -f config.status + -rm -f libtool + +maintainer-clean: maintainer-clean-generic distclean + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +.PHONY: tags distdir info dvi installcheck install-exec install-data \ +install uninstall all installdirs mostlyclean-generic distclean-generic \ +clean-generic maintainer-clean-generic clean mostlyclean distclean \ +maintainer-clean + + +# 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 -uNr gnome-libs-0.26/devel-docs/ui-guide/ui-guide.sgml gnome-libs-0.27/devel-docs/ui-guide/ui-guide.sgml --- gnome-libs-0.26/devel-docs/ui-guide/ui-guide.sgml Wed Dec 31 19:00:00 1969 +++ gnome-libs-0.27/devel-docs/ui-guide/ui-guide.sgml Wed Aug 12 08:07:56 1998 @@ -0,0 +1,322 @@ + + + + + GNU Network Object Model Environment + User Interface Guidelines + + + Federico + Mena + Quintero + +
+ federico@nuclecu.unam.mx +
+
+
+
+ +
+ + + + + + About this document + + + This document contains the user interface guidelines that developers + should follow when writing applications for the GNU Network Object + Model Environment (GNOME). + + + One of the main goals of the GNOME project is to provide a consistent + graphical user interface for applications. Users can benefit greatly + from a uniform and consistent look-and-feel among applications. When + a group of programs share the same philosophy about the user + interface, users can just learn how to use the user interface for any + one of those programs and apply their knowledge on the rest of them, + without having to re-learn a different user interface. + + + This document describes the philosophy of the GNOME user interface and + contains ways in which developers may access the standard user + interface elements of GNOME. Wherever possible, it contains source + code examples that can be used to implement this functionality. It + also provides examples of how not to design user interfaces for GNOME + applications; these appear with an explanation regarding why these + examples are "bad design" and how to correct them. + + + + Fundamentals of the GNOME user interface + + [This is to be modeled after Part 1 "Fundamentals" of the Macintosh + User Interface Guidelines.] + + + Compliancy levels + + This document will often speak of "GNOME compliancy levels". Programs + can be assigned ratings of conformance to the GNOME User Interface + Guidelines based on these compliancy levels. + + + The purpose of having compliancy levels is to let developers + progressively implement features of the GNOME user interface into + their programs, by being able to know which of those features are more + important than others. + + + When this document describes a particular user interface feature, it + will be labeled with a specific compliancy level so that developers + can implement those features in an orderly fashion. + + + There are five compliancy levels for the GNOME user interface: + + GNOME compliancy level 1 (G1) - Mandatory + + All applications are expected to have G1 features. These + are meant to be the bare minimum user interface features + that applications should have. + + + + + GNOME compliancy level 2 (G2) - Highly recommended + + + Features in the G2 level are to be expected in the final version + of an application (i.e. one that is past the beta stage). All GNOME + applications of release-quality are expected to have G2 features. + + + + GNOME compliancy level 3 (G3) - Suggested + + + Features in the G3 level are not to be expected in applications. + These are features that may not be applicable in all situations, are + hard to implement, or are beyond the call of duty. It is suggested + that very polished applications try to implement G3 features. + + + + GNOME compliancy level 4 (G4) - Nice to have + + + Features in the C4 level are minor conveniences that developers may + not decide to implement. Users will experience C4 level features as + ocassionaly useful, but definitely not needed for a functional user + interface. + + + + GNOME compliancy level 5 (G5) - Experimental features + + + Features in the G5 level are experimental user interface conventions + that are in development. As such, they may have not been formalized + enough for developers to use consistently. It is recommended that no + release-quality application have G5 level features -- only development + and proof-of-concept programs should use these when appropriate. + + + When features in the G5 level are formalized enough to be included in + the G1-G4 levels, they will be moved there and cease to be + experimental features. It is recommended that the original developers + of G5 features help application developers integrate these new + features in their applications. + + + + + User interface principles + + + + Design considerations + + + + Developing the user interface + + + + +User interface components + + Windows + + Main application windows -- GnomeApp + + Many applications can use the standard application windows provided by + the GnomeApp widget in the libgnomeui library. A GnomeApp window + provides a toplevel window with a title, an optional menu bar, an + optional tool bar, a content area, and an optional status bar. + + [Screenshot/diagram of a skeleton GnomeApp window] + + + + Non-standard application windows + + [For example, the gtcd CD player uses a toplevel window with no menu + bar or tool bar; explain why and when can non-standard application + windows be used.] + + + + + Menus + + This chapter describes the kinds of menus you can implement in GNOME + applications: pull-down menus, hierarchical menus, pop-up menus, and + tear-off menus. This chapter defines the standard menu items that + should be present in menus used by GNOME applications. + + + It is highly recommended that applications create their menus using + the gnome-app-helper module. This allows the programmer to easily + specify a definition for a hierarchical menu which can then be plugged + into a GnomeApp application window. + + + Application menu bar + + Application windows based on GnomeApp are expected to have a menu bar + with at least the items described in this section. For GnomeApp + windows, this menu bar is defined to be in the G1 compliancy level. + + + All the submenu labels in the menu bar are flushed to the left of the + menu bar. They are specified in order from left to right, as follows: + + + 1. File menu. This should have at least one item called "Exit", using + the GNOME_STOCK_MENU_EXIT icon. If the application does not deal with + documents or files, it can use a different name for the File menu. + For example, it could be substituted with a Game menu. + + + 2. Help menu. This should have at least the following items in this + order: + + + + One item called "Help on GNOME", which should invoke the + GNOME Help Browser in its default main page. This can be + done using the gnome_help_xxx() function [FIXME]. + + + + + A separator line. + + + + + One item called "About ≶program name>", using the + GNOME_STOCK_MENU_ABOUT icon. This item should create and + display an about box using the gnome_about_new() function. + + + + + + [Add stuff about optional edit/view/whatever menus, with descriptions + of what items should be in each.] + + + It is highly recommended that the application have complete online + help; this should be considered as G2 level compliancy. If the + application provides online help, it should be accessible by a "Help + on ≶program name>" menu item at the top of the Help submenu described + above. If an application cannot provide full online + documentation, it is at least suggested that it provide a quick + overview or description of the program available via the same + menu item; this should be considered as G1 level compliancy. + + + [FIXME: add description of Help Index, Help Contents, etc. items] + + + + + Dialog boxes + + + + Controls (widgets) + + + + Icons + + + + Behaviors + + + + Language + + + + Help and documentation + + + + + General development information + + [This section is meant to provide useful information on tricky UI and + X programming issues. Relevant topics include how to write + flicker-free widgets and widgets that resize correctly, how to make + themable widgets by using the Gtk themes API, and how to extend the + existing GNOME widgets. It also has a checklist of things + applications should have to conform with the GNOME User Interface + Guidelines.] + + + Checklist + + + + + + +References + + + +Apple Computer, Macintosh Human Interface Guidelines. +Addison-Wesley, 1992. (Also available as +http://developer.apple.com/techpubs/mac/HIGuidelines/HIGuidelines-2.html). + + + +GNU Network Object Model Environment, http://www.gnome.org + + + +The GNOME Manifesto, http://www.gnome.org/about/manifesto.shtml + + + +Interface Hall of Fame, http://www.iarchitect.com/mfame.htm + + + +Interface Hall of Shame, http://www.iarchitect.com/mshame.htm + + + +Tom Vogt, Rogue GNOME Style Guide, http://home.onestop.net/arena/rsg.txt + + + +
diff -uNr gnome-libs-0.26/devel-docs/ui-guide/ui-guide.txt gnome-libs-0.27/devel-docs/ui-guide/ui-guide.txt --- gnome-libs-0.26/devel-docs/ui-guide/ui-guide.txt Wed Dec 31 19:00:00 1969 +++ gnome-libs-0.27/devel-docs/ui-guide/ui-guide.txt Fri Aug 7 14:40:22 1998 @@ -0,0 +1,208 @@ + GNU Network Object Model Environment + + User Interface Guidelines + + +* About this document + +This document contains the user interface guidelines that developers +should follow when writing applications for the GNU Network Object +Model Environment (GNOME). + +One of the main goals of the GNOME project is to provide a consistent +graphical user interface for applications. Users can benefit greatly +from a uniform and consistent look-and-feel among applications. When +a group of programs share the same philosophy about the user +interface, users can just learn how to use the user interface for any +one of those programs and apply their knowledge on the rest of them, +without having to re-learn a different user interface. + +This document describes the philosophy of the GNOME user interface and +contains ways in which developers may access the standard user +interface elements of GNOME. Wherever possible, it contains source +code examples that can be used to implement this functionality. It +also provides examples of how not to design user interfaces for GNOME +applications; these appear with an explanation regarding why these +examples are "bad design" and how to correct them. + + +* Fundamentals of the GNOME user interface + +[This is to be modeled after Part 1 "Fundamentals" of the Macintosh +User Interface Guidelines.] + +** Compliancy levels + +This document will often speak of "GNOME compliancy levels". Programs +can be assigned ratings of conformance to the GNOME User Interface +Guidelines based on these compliancy levels. + +The purpose of having compliancy levels is to let developers +progressively implement features of the GNOME user interface into +their programs, by being able to know which of those features are more +important than others. + +When this document describes a particular user interface feature, it +will be labeled with a specific compliancy level so that developers +can implement those features in an orderly fashion. + +There are five compliancy levels for the GNOME user interface: + +*** GNOME compliancy level 1 (G1) - Mandatory + +All applications are expected to have G1 features. These are meant to +be the bare minimum user interface features that applications should +have. + +*** GNOME compliancy level 2 (G2) - Highly recommended + +Features in the G2 level are to be expected in the final version +of an application (i.e. one that is past the beta stage). All GNOME +applications of release-quality are expected to have G2 features. + +*** GNOME compliancy level 3 (G3) - Suggested + +Features in the G3 level are not to be expected in applications. +These are features that may not be applicable in all situations, are +hard to implement, or are beyond the call of duty. It is suggested +that very polished applications try to implement G3 features. + +*** GNOME compliancy level 4 (G4) - Nice to have + +Features in the C4 level are minor conveniences that developers may +not decide to implement. Users will experience C4 level features as +ocassionaly useful, but definitely not needed for a functional user +interface. + +*** GNOME compliancy level 5 (G5) - Experimental features + +Features in the G5 level are experimental user interface conventions +that are in development. As such, they may have not been formalized +enough for developers to use consistently. It is recommended that no +release-quality application have G5 level features -- only development +and proof-of-concept programs should use these when appropriate. + +When features in the G5 level are formalized enough to be included in +the G1-G4 levels, they will be moved there and cease to be +experimental features. It is recommended that the original developers +of G5 features help application developers integrate these new +features in their applications. + + +** User interface principles + +** Design considerations + +** Developing the user interface + + +* User interface components + +** Windows + +*** Main application windows -- GnomeApp + +Many applications can use the standard application windows provided by +the GnomeApp widget in the libgnomeui library. A GnomeApp window +provides a toplevel window with a title, an optional menu bar, an +optional tool bar, a content area, and an optional status bar. + +[Screenshot/diagram of a skeleton GnomeApp window] + +*** Non-standard application windows + +[For example, the gtcd CD player uses a toplevel window with no menu +bar or tool bar; explain why and when can non-standard application +windows be used.] + + +** Menus + +This chapter describes the kinds of menus you can implement in GNOME +applications: pull-down menus, hierarchical menus, pop-up menus, and +tear-off menus. This chapter defines the standard menu items that +should be present in menus used by GNOME applications. + +It is highly recommended that applications create their menus using +the gnome-app-helper module. This allows the programmer to easily +specify a definition for a hierarchical menu which can then be plugged +into a GnomeApp application window. + +*** Application menu bar + +Application windows based on GnomeApp are expected to have a menu bar +with at least the items described in this section. For GnomeApp +windows, this menu bar is defined to be in the G1 compliancy level. + +All the submenu labels in the menu bar are flushed to the left of the +menu bar. They are specified in order from left to right, as follows: + +1. File menu. This should have at least one item called "Exit", using +the GNOME_STOCK_MENU_EXIT icon. If the application does not deal with +documents or files, it can use a different name for the File menu. +For example, it could be substituted with a Game menu. + +2. Help menu. This should have at least the following items in this +order: + + - One item called "Help on GNOME", which should invoke the + GNOME Help Browser in its default main page. This can be + done using the gnome_help_xxx() function [FIXME]. + + - A separator line. + + - One item called "About ", using the + GNOME_STOCK_MENU_ABOUT icon. This item should create and + display an about box using the gnome_about_new() function. + +[Add stuff about optional edit/view/whatever menus, with descriptions +of what items should be in each.] + +It is highly recommended that the application have complete online +help; this should be considered as G2 level compliancy. If the +application provides online help, it should be accessible by a "Help +on " menu item at the top of the Help submenu described +above. + +[FIXME: add description of Help Index, Help Contents, etc. items] + + +** Dialog boxes + +** Controls (widgets) + +** Icons + +** Behaviors + +** Language + + +* General development information + +[This section is meant to provide useful information on tricky UI and +X programming issues. Relevant topics include how to write +flicker-free widgets and widgets that resize correctly, how to make +themable widgets by using the Gtk themes API, and how to extend the +existing GNOME widgets. It also has a checklist of things +applications should have to conform with the GNOME User Interface +Guidelines.] + +** Checklist + + +* References + +[1] Apple Computer, Macintosh Human Interface Guidelines. +Addison-Wesley, 1992. (Also available as +http://developer.apple.com/techpubs/mac/HIGuidelines/HIGuidelines-2.html). + +[2] GNU Network Object Model Environment, http://www.gnome.org + +[3] The GNOME Manifesto, http://www.gnome.org/about/manifesto.shtml + +[4] Interface Hall of Fame, http://www.iarchitect.com/mfame.htm + +[5] Interface Hall of Shame, http://www.iarchitect.com/mshame.htm + +[6] Tom Vogt, Rogue GNOME Style Guide, http://home.onestop.net/arena/rsg.txt diff -uNr gnome-libs-0.26/gnome-libs.spec gnome-libs-0.27/gnome-libs.spec --- gnome-libs-0.26/gnome-libs.spec Wed Dec 31 19:00:00 1969 +++ gnome-libs-0.27/gnome-libs.spec Wed Aug 5 16:09:16 1998 @@ -0,0 +1,94 @@ +# Note that this is NOT a relocatable package +%define ver 0.25 +%define rel SNAP +%define prefix /usr + +Summary: GNOME basic libraries +Name: gnome-libs +Version: %ver +Release: %rel +Copyright: LGPL +Group: X11/gnome +Source: ftp://ftp.gnome.org/pub/gnome-libs-%{ver}.tar.gz +BuildRoot: /tmp/gnome-libs-root +Obsoletes: gnome +Packager: Marc Ewing +URL: http://www.gnome.org/ +Docdir: %{prefix}/doc + +%description +Basic libraries you must have installed to use GNOME. + +GNOME is the GNU Network Object Model Environment. That's a fancy +name but really GNOME is a nice GUI desktop environment. It makes +using your computer easy, powerful, and easy to configure. + +%package devel +Summary: Libraries, includes, etc to develop GNOME applications +Group: X11/gnome +Requires: gnome-libs +Obsoletes: gnome + +%description devel +Libraries, include files, etc you can use to develop GNOME applications. + +%changelog + +* Mon Apr 13 1998 Marc Ewing +- Added %{prefix}/lib/gnome-libs + +* Fri Mar 13 1998 Marc Ewing + +- Integrate into gnome-libs source tree + +%prep +%setup + +%build +# Needed for snapshot releases. +if [ ! -f configure ]; then + CFLAGS="$RPM_OPT_FLAGS" ./autogen.sh --prefix=%prefix +else + CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=%prefix +fi + +if [ "$SMP" != "" ]; then + (make "MAKE=make -k -j $SMP"; exit 0) + make +else + make +fi + +%install +rm -rf $RPM_BUILD_ROOT + +make prefix=$RPM_BUILD_ROOT%{prefix} install + +%clean +rm -rf $RPM_BUILD_ROOT + +%post +if ! grep %{prefix}/lib /etc/ld.so.conf > /dev/null ; then + echo "%{prefix}/lib" >> /etc/ld.so.conf +fi + +/sbin/ldconfig + +%postun -p /sbin/ldconfig + +%files +%defattr(-, root, root) + +%doc AUTHORS COPYING ChangeLog NEWS README +%{prefix}/lib/lib*.so.* +%{prefix}/bin/* + +%files devel +%defattr(-, root, root) + +%{prefix}/lib/lib*.so +%{prefix}/lib/*a +%{prefix}/lib/*.sh +%{prefix}/lib/gnome-libs +%{prefix}/include/* +%{prefix}/share/pixmaps/* diff -uNr gnome-libs-0.26/libgnome/Makefile.am gnome-libs-0.27/libgnome/Makefile.am --- gnome-libs-0.26/libgnome/Makefile.am Thu Jul 23 14:08:28 1998 +++ gnome-libs-0.27/libgnome/Makefile.am Mon Aug 10 10:48:23 1998 @@ -67,7 +67,7 @@ EXTRA_DIST = lib_date.README -libgnome_la_LDFLAGS = -version-info 0:0:0 -rpath $(libdir) +libgnome_la_LDFLAGS = -version-info 26:0:26 -rpath $(libdir) libgnome_la_LIBADD = $(GLIB_LIBS) -lm $(DL_LIB) bin_PROGRAMS = dns-helper diff -uNr gnome-libs-0.26/libgnome/Makefile.in gnome-libs-0.27/libgnome/Makefile.in --- gnome-libs-0.26/libgnome/Makefile.in Thu Aug 6 13:13:04 1998 +++ gnome-libs-0.27/libgnome/Makefile.in Thu Aug 13 19:56:31 1998 @@ -192,7 +192,7 @@ EXTRA_DIST = lib_date.README -libgnome_la_LDFLAGS = -version-info 0:0:0 -rpath $(libdir) +libgnome_la_LDFLAGS = -version-info 26:0:26 -rpath $(libdir) libgnome_la_LIBADD = $(GLIB_LIBS) -lm $(DL_LIB) bin_PROGRAMS = dns-helper diff -uNr gnome-libs-0.26/libgnome/gnome-config.c gnome-libs-0.27/libgnome/gnome-config.c --- gnome-libs-0.26/libgnome/gnome-config.c Thu Jul 23 14:08:28 1998 +++ gnome-libs-0.27/libgnome/gnome-config.c Wed Aug 12 08:07:56 1998 @@ -71,6 +71,7 @@ typedef struct TProfile { char *filename; time_t mtime; + int written_to; TSecHeader *section; struct TProfile *link; } TProfile; @@ -412,6 +413,7 @@ New->filename = g_strdup (filename); New->section = load (filename); New->mtime = st.st_mtime; + New->written_to = FALSE; Base = New; section = New->section; Current = New; @@ -430,6 +432,7 @@ if (mode == SET){ g_free (key->value); key->value = g_strdup (def); + Current->written_to = TRUE; } return key->value; } @@ -437,6 +440,7 @@ /* No key found */ if (mode == SET){ new_key (section, key_name, def); + Current->written_to = TRUE; return 0; } } @@ -449,6 +453,7 @@ new_key (section, key_name, def); section->link = Current->section; Current->section = section; + Current->written_to = TRUE; } if (def_used) *def_used = TRUE; @@ -571,6 +576,11 @@ if (!p) return; dump_profile (p->link); + + /*was this profile written to?, if not it's not necessary to dump + it to disk*/ + if(!p->written_to) + return; /* .ado: p->filename can be empty, it's better to jump over */ if (p->filename[0] != (char) 0) @@ -579,6 +589,9 @@ dump_sections (profile, p->section); fclose (profile); } + + /*mark this to not be dumped any more*/ + p->written_to = FALSE; } /* @@ -647,6 +660,7 @@ free_sections (p->section); p->section = 0; p->filename [0] = 0; + p->written_to = TRUE; release_path (pp); return; } @@ -676,6 +690,7 @@ New->filename = g_strdup (pp->file); New->section = load (pp->file); New->mtime = st.st_mtime; + New->written_to = FALSE; Base = New; section = New->section; Current = New; @@ -716,6 +731,7 @@ New->filename = g_strdup (pp->file); New->section = load (pp->file); New->mtime = st.st_mtime; + New->written_to = FALSE; Base = New; section = New->section; Current = New; @@ -782,6 +798,7 @@ New->filename = g_strdup (pp->file); New->section = load (pp->file); New->mtime = st.st_mtime; + New->written_to = FALSE; Base = New; section = New->section; Current = New; @@ -793,6 +810,7 @@ if (strcasecmp (section->section_name, pp->section)) continue; section->section_name [0] = 0; + Current->written_to = TRUE; } release_path (pp); } @@ -817,6 +835,7 @@ New->filename = g_strdup (pp->file); New->section = load (pp->file); New->mtime = st.st_mtime; + New->written_to = FALSE; Base = New; section = New->section; Current = New; @@ -828,6 +847,7 @@ if (strcasecmp (key->key_name, pp->key)) continue; key->key_name [0] = 0; + Current->written_to = TRUE; } } release_path (pp); @@ -855,6 +875,7 @@ New->filename = g_strdup (pp->file); New->section = load (pp->file); New->mtime = st.st_mtime; + New->written_to = FALSE; Base = New; section = New->section; Current = New; diff -uNr gnome-libs-0.26/libgnomeui/ChangeLog gnome-libs-0.27/libgnomeui/ChangeLog --- gnome-libs-0.26/libgnomeui/ChangeLog Thu Aug 6 12:57:54 1998 +++ gnome-libs-0.27/libgnomeui/ChangeLog Thu Aug 13 07:05:27 1998 @@ -1,3 +1,66 @@ +Wed Aug 12 18:33:15 EDT 1998 Gregory McLean + + * gnome-app-helper.c: Adjusted the GNOME_PIXMAP_FILENAME + stuff to do a gnome_pixmap_file() on the file name passed in + otherwise you wind up doing all sorts of silly stuff to maintain + good code.. Anyone have a better soultion? + +Wed Aug 12 14:48:24 1998 Owen Taylor + + * gnome-stock-imlib.h: Made all gnome stock pixmaps + const. (Makes >100k more memory shared between gnome apps) + +Wed Aug 12 18:01:30 CEST 1998 Eckehard Berns + + * gnome-stock.[ch]: 1st go at a rewrite of the gnome stock widget. + Because of a new widget (GnomeStock) some apps might get minor + problems. The majority of the apps should work though. + +Tue Aug 11 23:35:58 1998 Jonathan Blandford + * gnome-app.c: added GTK_SHRINK to the x/y options. + +1998-08-11 Federico Mena Quintero + + * gnome-canvas.c (gnome_canvas_item_grab): Set the + canvas->current_item to the grabbed item to force events to go to + it. + + * gnome-canvas-widget.h: + * gnome-canvas-line.h: + * gnome-canvas-image.h: + * gnome-canvas-text.h: + * gnome-canvas-rect-ellipse.h: + * gnome-canvas.h: Documentation fixes and additions. Added + descriptions of object arguments. + +>>>>>>> 1.378 +1998-08-10 Federico Mena Quintero + + * gnome-canvas-rect-ellipse.c (gnome_canvas_re_set_arg): Added + fill_color_gdk and outline_color_gdk arguments. The argument's + value is a pointer to an already-allocated GdkColor. + + * gnome-canvas-text.c (gnome_canvas_text_set_arg): Added font_gdk + and fill_color_gdk arguments. The argument values are a pointer + to a GdkFont and an already-allocated GdkColor, respectively. + + * gnome-canvas-line.c (gnome_canvas_line_set_arg): Added + fill_color_gdk argument. + +Sun Aug 09 14:37:58 1998 George Lebl + + * gnome-about.c: draw the pixmap with the correct clip mask + +1998-08-07 Federico Mena Quintero + + * gnome-canvas-rect-ellipse.c (gnome_canvas_re_reconfigure): + * gnome-canvas-text.c (gnome_canvas_text_reconfigure): + * gnome-canvas-image.c (gnome_canvas_image_reconfigure): + * gnome-canvas-line.c (gnome_canvas_line_reconfigure): + * gnome-canvas-widget.c (gnome_canvas_widget_reconfigure): Call + the parent class reconfigure method at the start of the overriden + method. + 1998-08-06 Jaka Mocnik * gnome-preferences.[ch]: added MDI preferences. diff -uNr gnome-libs-0.26/libgnomeui/Makefile.am gnome-libs-0.27/libgnomeui/Makefile.am --- gnome-libs-0.26/libgnomeui/Makefile.am Tue Aug 4 15:51:37 1998 +++ gnome-libs-0.27/libgnomeui/Makefile.am Mon Aug 10 10:48:23 1998 @@ -215,7 +215,7 @@ gnometypebuiltins_ids.c \ gnometypebuiltins_evals.c -libgnomeui_la_LDFLAGS = -version-info 0:0:0 -rpath $(libdir) +libgnomeui_la_LDFLAGS = -version-info 26:0:26 -rpath $(libdir) libgnomeui_la_LIBADD = $(LIBGNOMEUI_LIBS) @GNOME_CANVAS_OBJS@ gnome_segv_LDADD = \ diff -uNr gnome-libs-0.26/libgnomeui/Makefile.in gnome-libs-0.27/libgnomeui/Makefile.in --- gnome-libs-0.26/libgnomeui/Makefile.in Thu Aug 6 13:13:08 1998 +++ gnome-libs-0.27/libgnomeui/Makefile.in Thu Aug 13 19:56:36 1998 @@ -298,7 +298,7 @@ gnometypebuiltins_ids.c \ gnometypebuiltins_evals.c -libgnomeui_la_LDFLAGS = -version-info 0:0:0 -rpath $(libdir) +libgnomeui_la_LDFLAGS = -version-info 26:0:26 -rpath $(libdir) libgnomeui_la_LIBADD = $(LIBGNOMEUI_LIBS) @GNOME_CANVAS_OBJS@ gnome_segv_LDADD = \ diff -uNr gnome-libs-0.26/libgnomeui/gnome-about.c gnome-libs-0.27/libgnomeui/gnome-about.c --- gnome-libs-0.26/libgnomeui/gnome-about.c Thu Jul 23 14:08:29 1998 +++ gnome-libs-0.27/libgnomeui/gnome-about.c Mon Aug 10 10:48:23 1998 @@ -138,16 +138,24 @@ gc = gdk_gc_new (win); gdk_window_clear (win); - + /* Draw pixmap first */ y = 1; if (gai->logo) { y += 2; x = (gai->w - gai->logo_w) / 2; + if (gai->mask) { + gdk_gc_set_clip_mask (gc, gai->mask); + gdk_gc_set_clip_origin (gc, x, y); + } gdk_draw_pixmap (win, gc, gai->logo, 0, 0, x, y, gai->logo_w, gai->logo_h); + if (gai->mask) { + gdk_gc_set_clip_mask (gc, NULL); + gdk_gc_set_clip_origin (gc, 0, 0); + } y += 2 + gai->logo_h; } @@ -167,7 +175,7 @@ gai->title); y += 7 + gai->font_title->descent + 2; } - + if (gai->copyright || gai->names || gai->comments) { gdk_gc_set_foreground (gc, light_green); @@ -176,7 +184,7 @@ 2, y, gai->w-5, gai->h - y - 3); } - + gdk_gc_set_foreground (gc, black); if (gai->copyright) diff -uNr gnome-libs-0.26/libgnomeui/gnome-app-helper.c gnome-libs-0.27/libgnomeui/gnome-app-helper.c --- gnome-libs-0.26/libgnomeui/gnome-app-helper.c Wed Aug 5 11:38:48 1998 +++ gnome-libs-0.27/libgnomeui/gnome-app-helper.c Thu Aug 13 07:05:27 1998 @@ -131,7 +131,8 @@ pmap = gnome_pixmap_new_from_xpm_d(menuinfo[i].pixmap_info); break; case GNOME_APP_PIXMAP_FILENAME: - pmap = gnome_pixmap_new_from_file(menuinfo[i].pixmap_info); + + pmap = gnome_pixmap_new_from_file(gnome_pixmap_file(menuinfo[i].pixmap_info)); break; case GNOME_APP_PIXMAP_NONE: case GNOME_APP_PIXMAP_STOCK: @@ -449,7 +450,7 @@ pmap = gnome_pixmap_new_from_xpm_d(tbinfo[i].pixmap_info); break; case GNOME_APP_PIXMAP_FILENAME: - pmap = gnome_pixmap_new_from_file(tbinfo[i].pixmap_info); + pmap = gnome_pixmap_new_from_file(gnome_pixmap_file(tbinfo[i].pixmap_info)); break; case GNOME_APP_PIXMAP_STOCK: pmap = gnome_stock_pixmap_widget_new(GTK_WIDGET(app), tbinfo[i].pixmap_info); @@ -521,7 +522,7 @@ break; case GNOME_APP_PIXMAP_FILENAME: - pmap = gnome_pixmap_new_from_file((char *)tbinfo->pixmap_info); + pmap = gnome_pixmap_new_from_file((char *)gnome_pixmap_file(tbinfo->pixmap_info)); break; case GNOME_APP_PIXMAP_STOCK: diff -uNr gnome-libs-0.26/libgnomeui/gnome-app.c gnome-libs-0.27/libgnomeui/gnome-app.c --- gnome-libs-0.26/libgnomeui/gnome-app.c Wed Aug 5 11:38:48 1998 +++ gnome-libs-0.27/libgnomeui/gnome-app.c Wed Aug 12 08:07:56 1998 @@ -168,7 +168,7 @@ 0, 3, (app->pos_menubar == GNOME_APP_POS_TOP)?0:2, (app->pos_menubar == GNOME_APP_POS_TOP)?1:3, - GTK_EXPAND | GTK_FILL, + GTK_EXPAND | GTK_FILL | GTK_SHRINK, 0, 0, 0); gtk_widget_show (handlebox); @@ -198,7 +198,7 @@ (app->pos_toolbar==GNOME_APP_POS_LEFT)?1:3, offset, 3, 0, - GTK_EXPAND | GTK_FILL, + GTK_EXPAND | GTK_FILL | GTK_SHRINK, 0, 0); } else @@ -214,7 +214,7 @@ 0, 3, ((app->pos_toolbar==GNOME_APP_POS_TOP)?0:2) + moffset, ((app->pos_toolbar==GNOME_APP_POS_TOP)?1:3) + moffset, - GTK_EXPAND | GTK_FILL, + GTK_EXPAND | GTK_FILL | GTK_SHRINK, 0, 0, 0); } @@ -332,8 +332,8 @@ endxs[app->pos_menubar][app->pos_toolbar], startys[app->pos_menubar][app->pos_toolbar], endys[app->pos_menubar][app->pos_toolbar], - GTK_EXPAND | GTK_FILL, - GTK_EXPAND | GTK_FILL, + GTK_EXPAND | GTK_FILL | GTK_SHRINK, + GTK_EXPAND | GTK_FILL | GTK_SHRINK, 0, 0); app->contents = contents; gtk_widget_show (contents); @@ -625,7 +625,7 @@ app->statusbar, 0, 3, 3, 4, - GTK_EXPAND | GTK_FILL, + GTK_EXPAND | GTK_FILL | GTK_SHRINK, 0, 0, 0); } diff -uNr gnome-libs-0.26/libgnomeui/gnome-canvas-image.c gnome-libs-0.27/libgnomeui/gnome-canvas-image.c --- gnome-libs-0.26/libgnomeui/gnome-canvas-image.c Wed Aug 5 19:37:01 1998 +++ gnome-libs-0.27/libgnomeui/gnome-canvas-image.c Fri Aug 7 17:23:46 1998 @@ -307,6 +307,9 @@ image = GNOME_CANVAS_IMAGE (item); + if (parent_class->reconfigure) + (* parent_class->reconfigure) (item); + free_pixmap_and_mask (image); if (image->im) { diff -uNr gnome-libs-0.26/libgnomeui/gnome-canvas-image.h gnome-libs-0.27/libgnomeui/gnome-canvas-image.h --- gnome-libs-0.26/libgnomeui/gnome-canvas-image.h Thu Jul 23 14:08:30 1998 +++ gnome-libs-0.27/libgnomeui/gnome-canvas-image.h Tue Aug 11 12:15:09 1998 @@ -20,6 +20,20 @@ BEGIN_GNOME_DECLS +/* Image item for the canvas. Images are positioned by anchoring them to a point. + * The following arguments are available: + * + * name type read/write description + * ------------------------------------------------------------------------------------------ + * image GdkImlibImage* RW Pointer to a GdkImlibImage + * x double RW X coordinate of anchor point + * y double RW Y coordinate of anchor point + * width double RW Width to scale image to, in canvas units + * height double RW Height to scale image to, in canvas units + * anchor GtkAnchorType RW Anchor side for the image + */ + + #define GNOME_TYPE_CANVAS_IMAGE (gnome_canvas_image_get_type ()) #define GNOME_CANVAS_IMAGE(obj) (GTK_CHECK_CAST ((obj), GNOME_TYPE_CANVAS_IMAGE, GnomeCanvasImage)) #define GNOME_CANVAS_IMAGE_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GNOME_TYPE_CANVAS_IMAGE, GnomeCanvasImageClass)) diff -uNr gnome-libs-0.26/libgnomeui/gnome-canvas-line.c gnome-libs-0.27/libgnomeui/gnome-canvas-line.c --- gnome-libs-0.26/libgnomeui/gnome-canvas-line.c Wed Aug 5 19:37:30 1998 +++ gnome-libs-0.27/libgnomeui/gnome-canvas-line.c Mon Aug 10 18:56:46 1998 @@ -39,6 +39,7 @@ ARG_0, ARG_POINTS, ARG_FILL_COLOR, + ARG_FILL_COLOR_GDK, ARG_WIDTH_PIXELS, ARG_WIDTH_UNITS, ARG_CAP_STYLE, @@ -112,6 +113,7 @@ gtk_object_add_arg_type ("GnomeCanvasLine::points", GTK_TYPE_POINTER, GTK_ARG_READWRITE, ARG_POINTS); gtk_object_add_arg_type ("GnomeCanvasLine::fill_color", GTK_TYPE_STRING, GTK_ARG_WRITABLE, ARG_FILL_COLOR); + gtk_object_add_arg_type ("GnomeCanvasLine::fill_color_gdk", GTK_TYPE_GDK_COLOR, GTK_ARG_WRITABLE, ARG_FILL_COLOR_GDK); gtk_object_add_arg_type ("GnomeCanvasLine::width_pixels", GTK_TYPE_UINT, GTK_ARG_WRITABLE, ARG_WIDTH_PIXELS); gtk_object_add_arg_type ("GnomeCanvasLine::width_units", GTK_TYPE_DOUBLE, GTK_ARG_WRITABLE, ARG_WIDTH_UNITS); gtk_object_add_arg_type ("GnomeCanvasLine::cap_style", GTK_TYPE_GDK_CAP_STYLE, GTK_ARG_READWRITE, ARG_CAP_STYLE); @@ -309,6 +311,11 @@ recalc = TRUE; break; + case ARG_FILL_COLOR_GDK: + line->pixel = ((GdkColor *) GTK_VALUE_BOXED (*arg))->pixel; + recalc = TRUE; + break; + case ARG_WIDTH_PIXELS: line->width = GTK_VALUE_UINT (*arg); line->width_pixels = TRUE; @@ -604,6 +611,9 @@ int width; line = GNOME_CANVAS_LINE (item); + + if (parent_class->reconfigure) + (* parent_class->reconfigure) (item); if (line->gc) { color.pixel = line->pixel; diff -uNr gnome-libs-0.26/libgnomeui/gnome-canvas-line.h gnome-libs-0.27/libgnomeui/gnome-canvas-line.h --- gnome-libs-0.26/libgnomeui/gnome-canvas-line.h Thu Jul 23 14:08:30 1998 +++ gnome-libs-0.27/libgnomeui/gnome-canvas-line.h Tue Aug 11 12:26:59 1998 @@ -18,6 +18,44 @@ BEGIN_GNOME_DECLS +/* Line item for the canvas. This is a polyline with configurable width, cap/join styles, and arrowheads. + * If arrowheads are enabled, then three values are used to specify their shape: + * + * arrow_shape_a: Distance from tip of arrowhead to the center point. + * arrow_shape_b: Distance from tip of arrowhead to trailing point, measured along the shaft. + * arrow_shape_c: Distance of trailing point from outside edge of shaft. + * + * The following object arguments are available: + * + * name type read/write description + * ------------------------------------------------------------------------------------------ + * points GnomeCanvasPoints* RW Pointer to a GnomeCanvasPoints structure. + * This can be created by a call to + * gnome_canvas_points_new() (in gnome-canvas-util.h). + * X coordinates are in the even indices of the + * points->coords array, Y coordinates are in + * the odd indices. + * fill_color string W X color specification for line + * fill_color_gdk GdkColor* W Pointer to an allocated GdkColor + * width_pixels uint RW Width of the line in pixels. The line width + * will not be scaled when the canvas zoom factor changes. + * width_units double RW Width of the line in canvas units. The line width + * will be scaled when the canvas zoom factor changes. + * cap_style GdkCapStyle RW Cap ("endpoint") style for the line. + * join_style GdkJoinStyle RW Join ("vertex") style for the line. + * first_arrowhead boolean RW Specifies whether to draw an arrowhead on the + * first point of the line. + * last_arrowhead boolean RW Specifies whether to draw an arrowhead on the + * last point of the line. + * smooth boolean RW Specifies whether to smooth the line using + * parabolic splines. + * spline_steps uint RW Specifies the number of steps to use when rendering curves. + * arrow_shape_a double RW First arrow shape specifier. + * arrow_shape_b double RW Second arrow shape specifier. + * arrow_shape_c double RW Third arrow shape specifier. + */ + + #define GNOME_TYPE_CANVAS_LINE (gnome_canvas_line_get_type ()) #define GNOME_CANVAS_LINE(obj) (GTK_CHECK_CAST ((obj), GNOME_TYPE_CANVAS_LINE, GnomeCanvasLine)) #define GNOME_CANVAS_LINE_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GNOME_TYPE_CANVAS_LINE, GnomeCanvasLineClass)) diff -uNr gnome-libs-0.26/libgnomeui/gnome-canvas-rect-ellipse.c gnome-libs-0.27/libgnomeui/gnome-canvas-rect-ellipse.c --- gnome-libs-0.26/libgnomeui/gnome-canvas-rect-ellipse.c Wed Aug 5 19:35:11 1998 +++ gnome-libs-0.27/libgnomeui/gnome-canvas-rect-ellipse.c Mon Aug 10 18:52:56 1998 @@ -23,7 +23,9 @@ ARG_X2, ARG_Y2, ARG_FILL_COLOR, + ARG_FILL_COLOR_GDK, ARG_OUTLINE_COLOR, + ARG_OUTLINE_COLOR_GDK, ARG_WIDTH_PIXELS, ARG_WIDTH_UNITS }; @@ -86,7 +88,9 @@ gtk_object_add_arg_type ("GnomeCanvasRE::x2", GTK_TYPE_DOUBLE, GTK_ARG_READWRITE, ARG_X2); gtk_object_add_arg_type ("GnomeCanvasRE::y2", GTK_TYPE_DOUBLE, GTK_ARG_READWRITE, ARG_Y2); gtk_object_add_arg_type ("GnomeCanvasRE::fill_color", GTK_TYPE_STRING, GTK_ARG_WRITABLE, ARG_FILL_COLOR); + gtk_object_add_arg_type ("GnomeCanvasRE::fill_color_gdk", GTK_TYPE_GDK_COLOR, GTK_ARG_WRITABLE, ARG_FILL_COLOR_GDK); gtk_object_add_arg_type ("GnomeCanvasRE::outline_color", GTK_TYPE_STRING, GTK_ARG_WRITABLE, ARG_OUTLINE_COLOR); + gtk_object_add_arg_type ("GnomeCanvasRE::outline_color_gdk", GTK_TYPE_GDK_COLOR, GTK_ARG_WRITABLE, ARG_OUTLINE_COLOR_GDK); gtk_object_add_arg_type ("GnomeCanvasRE::width_pixels", GTK_TYPE_UINT, GTK_ARG_WRITABLE, ARG_WIDTH_PIXELS); gtk_object_add_arg_type ("GnomeCanvasRE::width_units", GTK_TYPE_DOUBLE, GTK_ARG_WRITABLE, ARG_WIDTH_UNITS); @@ -189,6 +193,12 @@ break; + case ARG_FILL_COLOR_GDK: + re->fill_set = TRUE; + re->fill_pixel = ((GdkColor *) GTK_VALUE_BOXED (*arg))->pixel; + calc_gcs = TRUE; + break; + case ARG_OUTLINE_COLOR: if (gnome_canvas_get_color (item->canvas, GTK_VALUE_STRING (*arg), &color)) { re->outline_set = TRUE; @@ -199,6 +209,12 @@ break; + case ARG_OUTLINE_COLOR_GDK: + re->outline_set = TRUE; + re->outline_pixel = ((GdkColor *) GTK_VALUE_BOXED (*arg))->pixel; + calc_gcs = TRUE; + break; + case ARG_WIDTH_PIXELS: re->width = GTK_VALUE_UINT (*arg); re->width_pixels = TRUE; @@ -260,6 +276,9 @@ int width; re = GNOME_CANVAS_RE (item); + + if (re_parent_class->reconfigure) + (* re_parent_class->reconfigure) (item); if (re->fill_gc) { color.pixel = re->fill_pixel; diff -uNr gnome-libs-0.26/libgnomeui/gnome-canvas-rect-ellipse.h gnome-libs-0.27/libgnomeui/gnome-canvas-rect-ellipse.h --- gnome-libs-0.26/libgnomeui/gnome-canvas-rect-ellipse.h Thu Jul 23 14:08:30 1998 +++ gnome-libs-0.27/libgnomeui/gnome-canvas-rect-ellipse.h Tue Aug 11 11:39:18 1998 @@ -18,7 +18,25 @@ BEGIN_GNOME_DECLS -/* Base class for rectangle and ellipse item types */ +/* Base class for rectangle and ellipse item types. These are defined by their top-left and + * bottom-right corners. Rectangles and ellipses share the following arguments: + * + * name type read/write description + * ------------------------------------------------------------------------------------------ + * x1 double RW Leftmost coordinate of rectangle or ellipse + * y1 double RW Topmost coordinate of rectangle or ellipse + * x2 double RW Rightmost coordinate of rectangle or ellipse + * y2 double RW Bottommost coordinate of rectangle or ellipse + * fill_color string W X color specification for fill color, + * or NULL pointer for no color (transparent) + * fill_color_gdk GdkColor* W Allocated GdkColor for fill + * outline_color string W X color specification for outline color, + * or NULL pointer for no color (transparent) + * outline_color_gdk GdkColor* W Allocated GdkColor for outline + * width_pixels uint RW Width of the outline in pixels. The outline will + * not be scaled when the canvas zoom factor is changed. + * width_units double RW Width of the outline in canvas units. The outline + * will be scaled when the canvas zoom factor is changed. */ #define GNOME_TYPE_CANVAS_RE (gnome_canvas_re_get_type ()) @@ -57,7 +75,9 @@ GtkType gnome_canvas_re_get_type (void); -/* Rectangle item */ +/* Rectangle item. No configurable or queryable arguments are available (use those in + * GnomeCanvasRE). + */ #define GNOME_TYPE_CANVAS_RECT (gnome_canvas_rect_get_type ()) @@ -83,7 +103,9 @@ GtkType gnome_canvas_rect_get_type (void); -/* Ellipse item */ +/* Ellipse item. No configurable or queryable arguments are available (use those in + * GnomeCanvasRE). + */ #define GNOME_TYPE_CANVAS_ELLIPSE (gnome_canvas_ellipse_get_type ()) diff -uNr gnome-libs-0.26/libgnomeui/gnome-canvas-text.c gnome-libs-0.27/libgnomeui/gnome-canvas-text.c --- gnome-libs-0.26/libgnomeui/gnome-canvas-text.c Wed Aug 5 19:36:01 1998 +++ gnome-libs-0.27/libgnomeui/gnome-canvas-text.c Mon Aug 10 18:53:29 1998 @@ -19,9 +19,11 @@ ARG_X, ARG_Y, ARG_FONT, + ARG_FONT_GDK, ARG_ANCHOR, ARG_JUSTIFICATION, - ARG_FILL_COLOR + ARG_FILL_COLOR, + ARG_FILL_COLOR_GDK }; @@ -86,9 +88,11 @@ gtk_object_add_arg_type ("GnomeCanvasText::x", GTK_TYPE_DOUBLE, GTK_ARG_WRITABLE, ARG_X); gtk_object_add_arg_type ("GnomeCanvasText::y", GTK_TYPE_DOUBLE, GTK_ARG_WRITABLE, ARG_Y); gtk_object_add_arg_type ("GnomeCanvasText::font", GTK_TYPE_STRING, GTK_ARG_WRITABLE, ARG_FONT); + gtk_object_add_arg_type ("GnomeCanvasText::font_gdk", GTK_TYPE_GDK_FONT_TYPE, GTK_ARG_WRITABLE, ARG_FONT_GDK); gtk_object_add_arg_type ("GnomeCanvasText::anchor", GTK_TYPE_ANCHOR_TYPE, GTK_ARG_WRITABLE, ARG_ANCHOR); gtk_object_add_arg_type ("GnomeCanvasText::justification", GTK_TYPE_JUSTIFICATION, GTK_ARG_WRITABLE, ARG_JUSTIFICATION); gtk_object_add_arg_type ("GnomeCanvasText::fill_color", GTK_TYPE_STRING, GTK_ARG_WRITABLE, ARG_FILL_COLOR); + gtk_object_add_arg_type ("GnomeCanvasText::fill_color_gdk", GTK_TYPE_GDK_COLOR, GTK_ARG_WRITABLE, ARG_FILL_COLOR_GDK); object_class->destroy = gnome_canvas_text_destroy; object_class->set_arg = gnome_canvas_text_set_arg; @@ -252,6 +256,15 @@ calc_bounds = TRUE; break; + case ARG_FONT_GDK: + if (text->font) + gdk_font_unref (text->font); + + text->font = GTK_VALUE_BOXED (*arg); + gdk_font_ref (text->font); + calc_bounds = TRUE; + break; + case ARG_ANCHOR: text->anchor = GTK_VALUE_ENUM (*arg); calc_bounds = TRUE; @@ -270,6 +283,11 @@ calc_gcs = TRUE; break; + case ARG_FILL_COLOR_GDK: + text->pixel = ((GdkColor *) GTK_VALUE_BOXED (*arg))->pixel; + calc_gcs = TRUE; + break; + default: break; } @@ -322,6 +340,9 @@ GdkColor color; text = GNOME_CANVAS_TEXT (item); + + if (parent_class->reconfigure) + (* parent_class->reconfigure) (item); if (text->gc) { color.pixel = text->pixel; diff -uNr gnome-libs-0.26/libgnomeui/gnome-canvas-text.h gnome-libs-0.27/libgnomeui/gnome-canvas-text.h --- gnome-libs-0.26/libgnomeui/gnome-canvas-text.h Thu Jul 23 14:08:30 1998 +++ gnome-libs-0.27/libgnomeui/gnome-canvas-text.h Tue Aug 11 12:10:49 1998 @@ -19,6 +19,23 @@ BEGIN_GNOME_DECLS +/* Text item for the canvas. Text items are positioned by an anchor point and an anchor direction. + * The following object arguments are available: + * + * name type read/write description + * ------------------------------------------------------------------------------------------ + * text string RW The string of the text label + * x double RW X coordinate of anchor point + * y double RW Y coordinate of anchor point + * font string W X logical font descriptor + * font_gdk GdkFont* W Pointer to a GdkFont + * anchor GtkAnchorType RW Anchor side for the text + * justification GtkJustification RW Justification for multiline text + * fill_color string W X color specification for text + * fill_color_gdk GdkColor* W Pointer to an allocated GdkColor + */ + + #define GNOME_TYPE_CANVAS_TEXT (gnome_canvas_text_get_type ()) #define GNOME_CANVAS_TEXT(obj) (GTK_CHECK_CAST ((obj), GNOME_TYPE_CANVAS_TEXT, GnomeCanvasText)) #define GNOME_CANVAS_TEXT_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GNOME_TYPE_CANVAS_TEXT, GnomeCanvasTextClass)) diff -uNr gnome-libs-0.26/libgnomeui/gnome-canvas-widget.c gnome-libs-0.27/libgnomeui/gnome-canvas-widget.c --- gnome-libs-0.26/libgnomeui/gnome-canvas-widget.c Tue Aug 4 13:02:05 1998 +++ gnome-libs-0.27/libgnomeui/gnome-canvas-widget.c Fri Aug 7 17:24:29 1998 @@ -337,6 +337,9 @@ witem = GNOME_CANVAS_WIDGET (item); + if (parent_class->reconfigure) + (* parent_class->reconfigure) (item); + if (witem->widget) { if (witem->size_pixels) { witem->cwidth = (int) (witem->width + 0.5); diff -uNr gnome-libs-0.26/libgnomeui/gnome-canvas-widget.h gnome-libs-0.27/libgnomeui/gnome-canvas-widget.h --- gnome-libs-0.26/libgnomeui/gnome-canvas-widget.h Tue Aug 4 12:25:30 1998 +++ gnome-libs-0.27/libgnomeui/gnome-canvas-widget.h Tue Aug 11 12:30:17 1998 @@ -19,6 +19,25 @@ BEGIN_GNOME_DECLS +/* Widget item for canvas. The widget is positioned with respect to an anchor point. + * The following object arguments are available: + * + * name type read/write description + * ------------------------------------------------------------------------------------------ + * widget GtkWidget* RW Pointer to the widget + * x double RW X coordinate of anchor point + * y double RW Y coordinate of anchor point + * width double RW Width of widget (see below) + * height double RW Height of widget (see below) + * anchor GtkAnchorType RW Anchor side for widget + * size_pixels boolean RW Specifies whether the widget size + * is specified in pixels or canvas units. + * If it is in pixels, then the widget will not + * be scaled when the canvas zoom factor changes. + * Otherwise, it will be scaled. + */ + + #define GNOME_TYPE_CANVAS_WIDGET (gnome_canvas_widget_get_type ()) #define GNOME_CANVAS_WIDGET(obj) (GTK_CHECK_CAST ((obj), GNOME_TYPE_CANVAS_WIDGET, GnomeCanvasWidget)) #define GNOME_CANVAS_WIDGET_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GNOME_TYPE_CANVAS_WIDGET, GnomeCanvasWidgetClass)) diff -uNr gnome-libs-0.26/libgnomeui/gnome-canvas.c gnome-libs-0.27/libgnomeui/gnome-canvas.c --- gnome-libs-0.26/libgnomeui/gnome-canvas.c Tue Aug 4 13:10:05 1998 +++ gnome-libs-0.27/libgnomeui/gnome-canvas.c Tue Aug 11 19:24:11 1998 @@ -575,6 +575,7 @@ item->canvas->grabbed_item = item; item->canvas->grabbed_event_mask = event_mask; + item->canvas->current_item = item; /* So that events go to the grabbed item */ return retval; } diff -uNr gnome-libs-0.26/libgnomeui/gnome-canvas.h gnome-libs-0.27/libgnomeui/gnome-canvas.h --- gnome-libs-0.26/libgnomeui/gnome-canvas.h Mon Aug 3 11:29:40 1998 +++ gnome-libs-0.27/libgnomeui/gnome-canvas.h Tue Aug 11 11:20:39 1998 @@ -31,7 +31,7 @@ /* GnomeCanvasItem - base item class for canvas items * - * All canvas items are derived from GnomeCanvasItems. The only information a GnomeCanvasItem + * All canvas items are derived from GnomeCanvasItem. The only information a GnomeCanvasItem * contains is its parent canvas, its parent canvas item group, and its bounding box in canvas pixel * coordinates. * @@ -39,6 +39,7 @@ * leaves. Each canvas has a single root group, which can be obtained with the * gnome_canvas_get_root() function. * + * The abstract GnomeCanvasItem class does not have any configurable or queryable attributes. */ @@ -63,7 +64,7 @@ GtkObject object; GnomeCanvas *canvas; /* The parent canvas for this item */ - GnomeCanvasItem *parent; /* The parent canvas item (of type GnomeCanvasGroup) */ + GnomeCanvasItem *parent; /* The parent canvas group (of type GnomeCanvasGroup) */ int x1, y1, x2, y2; /* Bounding box for this item, in canvas pixel coordinates. * The bounding box contains (x1, y1) but not (x2, y2). @@ -116,7 +117,7 @@ GtkType gnome_canvas_item_get_type (void); /* Create a canvas item using the standard Gtk argument mechanism. The item is automatically - * inserted at the top of the specified canvas group. + * inserted at the top of the specified canvas group. The last argument must be a NULL pointer. */ GnomeCanvasItem *gnome_canvas_item_new (GnomeCanvasGroup *parent, GtkType type, ...); @@ -129,7 +130,7 @@ void gnome_canvas_item_constructv (GnomeCanvasItem *item, GnomeCanvasGroup *parent, guint nargs, GtkArg *args); -/* Configure an item using the standard Gtk argument mechanism */ +/* Configure an item using the standard Gtk argument mechanism. The last argument must be a NULL pointer. */ void gnome_canvas_item_set (GnomeCanvasItem *item, ...); /* Same as above, with parsed args */ @@ -186,6 +187,13 @@ * move an adder, simply move the group that represents the adder. * * The (xpos, ypos) fields of a canvas group are the relative origin for the group's children. + * + * The following arguments are available: + * + * name type read/write description + * -------------------------------------------------------------------------------- + * x double RW X coordinate of group's origin + * y double RW Y coordinate of group's origin */ @@ -202,7 +210,7 @@ GList *item_list; GList *item_list_end; - double xpos, ypos; + double xpos, ypos; /* Point that defines the group's origin */ }; struct _GnomeCanvasGroupClass { diff -uNr gnome-libs-0.26/libgnomeui/gnome-init.c gnome-libs-0.27/libgnomeui/gnome-init.c --- gnome-libs-0.26/libgnomeui/gnome-init.c Thu Jul 30 14:37:39 1998 +++ gnome-libs-0.27/libgnomeui/gnome-init.c Thu Aug 13 17:26:39 1998 @@ -114,34 +114,39 @@ client= gnome_master_client (); } else if (key == ARGP_KEY_SUCCESS) - { - int i, copy_ac = our_argc; - char **copy = (char **) g_malloc (our_argc * sizeof (char *)); - - memcpy (copy, our_argv, our_argc * sizeof (char *)); - our_argv[our_argc] = NULL; - - gtk_init (&our_argc, &our_argv); - gdk_imlib_init (); - gnome_type_init(); - -#ifdef GTK_HAVE_FEATURES_1_1_0 - /* New feature in 1.1 tree */ - gtk_rc_set_image_loader(imlib_image_loader); -#endif - gnome_rc_parse (program_invocation_name); - - for (i = 0; i < copy_ac; ++i) - g_free (copy[i]); - g_free (copy); - g_free (our_argv); our_argv = NULL; - } + return 0; else return ARGP_ERR_UNKNOWN; return 0; } +/* Initialize gnome-related libraries, after argument parsing. */ +static void +gnome_libs_init (void) +{ + int i, copy_ac = our_argc; + char **copy = (char **) g_malloc (our_argc * sizeof (char *)); + + memcpy (copy, our_argv, our_argc * sizeof (char *)); + our_argv[our_argc] = NULL; + + gtk_init (&our_argc, &our_argv); + gdk_imlib_init (); + gnome_type_init(); + +#ifdef GTK_HAVE_FEATURES_1_1_0 + /* New feature in 1.1 tree */ + gtk_rc_set_image_loader(imlib_image_loader); +#endif + gnome_rc_parse (program_invocation_name); + + for (i = 0; i < copy_ac; ++i) + g_free (copy[i]); + g_free (copy); + g_free (our_argv); our_argv = NULL; +} + static struct argp our_gtk_parser = { our_gtk_options, /* Options. */ @@ -274,7 +279,10 @@ /* Now parse command-line arguments. */ retval = gnome_parse_arguments (app_args, argc, argv, flags, arg_index); - + + /* Initialize related libraries. */ + gnome_libs_init (); + /*now set up the handeling of automatic config syncing*/ gnome_config_set_set_handler(set_handler,NULL); gnome_config_set_sync_handler(sync_handler,NULL); diff -uNr gnome-libs-0.26/libgnomeui/gnome-mdi.c gnome-libs-0.27/libgnomeui/gnome-mdi.c --- gnome-libs-0.26/libgnomeui/gnome-mdi.c Thu Aug 6 12:57:54 1998 +++ gnome-libs-0.27/libgnomeui/gnome-mdi.c Fri Aug 7 14:46:08 1998 @@ -260,8 +260,6 @@ mdi->mode = GNOME_MDI_DEFAULT_MODE; mdi->tab_pos = gnome_preferences_get_mdi_tab_pos(); - printf("tp: %d\n", mdi->tab_pos); - mdi->children = NULL; mdi->windows = NULL; mdi->registered = NULL; @@ -1243,8 +1241,6 @@ mode = mdi->mode; else if(mdi->mode == mode) return; - - printf("mode: %d\n", mode); /* remove all views from their parents */ child_node = mdi->children; diff -uNr gnome-libs-0.26/libgnomeui/gnome-stock-imlib.h gnome-libs-0.27/libgnomeui/gnome-stock-imlib.h --- gnome-libs-0.26/libgnomeui/gnome-stock-imlib.h Wed Aug 5 19:22:42 1998 +++ gnome-libs-0.27/libgnomeui/gnome-stock-imlib.h Thu Aug 13 07:05:28 1998 @@ -13,7 +13,7 @@ */ -static char imlib_button_cancel[] = { +static const char imlib_button_cancel[] = { 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, @@ -110,7 +110,7 @@ }; -static char imlib_trash[] = { +static const char imlib_trash[] = { 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, @@ -247,7 +247,7 @@ }; -static char imlib_save_as[] = { +static const char imlib_save_as[] = { 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, @@ -384,7 +384,7 @@ }; -static char imlib_menu_scores[] = { +static const char imlib_menu_scores[] = { 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, @@ -481,7 +481,7 @@ }; -static char imlib_mail_receive[] = { +static const char imlib_mail_receive[] = { 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, @@ -618,7 +618,7 @@ }; -static char imlib_stop[] = { +static const char imlib_stop[] = { 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, @@ -755,7 +755,7 @@ }; -static char imlib_right_arrow[] = { +static const char imlib_right_arrow[] = { 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, @@ -892,7 +892,7 @@ }; -static char imlib_home[] = { +static const char imlib_home[] = { 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, @@ -1029,7 +1029,7 @@ }; -static char imlib_save[] = { +static const char imlib_save[] = { 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, @@ -1166,7 +1166,7 @@ }; -static char imlib_menu_about[] = { +static const char imlib_menu_about[] = { 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, @@ -1230,7 +1230,7 @@ }; -static char imlib_book_blue[] = { +static const char imlib_book_blue[] = { 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, @@ -1367,7 +1367,7 @@ }; -static char imlib_trash_full[] = { +static const char imlib_trash_full[] = { 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, @@ -1504,7 +1504,7 @@ }; -static char imlib_last[] = { +static const char imlib_last[] = { 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, @@ -1641,7 +1641,7 @@ }; -static char imlib_button_ok[] = { +static const char imlib_button_ok[] = { 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, @@ -1738,7 +1738,7 @@ }; -static char imlib_search[] = { +static const char imlib_search[] = { 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, @@ -1875,7 +1875,7 @@ }; -static char imlib_undo[] = { +static const char imlib_undo[] = { 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, @@ -2012,7 +2012,7 @@ }; -static char imlib_mail_forward[] = { +static const char imlib_mail_forward[] = { 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, @@ -2149,7 +2149,7 @@ }; -static char imlib_mail_compose[] = { +static const char imlib_mail_compose[] = { 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, @@ -2286,7 +2286,7 @@ }; -static char imlib_revert[] = { +static const char imlib_revert[] = { 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, @@ -2423,7 +2423,7 @@ }; -static char imlib_mic[] = { +static const char imlib_mic[] = { 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, @@ -2560,7 +2560,7 @@ }; -static char imlib_copy[] = { +static const char imlib_copy[] = { 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, @@ -2697,7 +2697,7 @@ }; -static char imlib_menu_blank[] = { +static const char imlib_menu_blank[] = { 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, @@ -2761,7 +2761,7 @@ }; -static char imlib_button_apply[] = { +static const char imlib_button_apply[] = { 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, @@ -2858,7 +2858,7 @@ }; -static char imlib_timer[] = { +static const char imlib_timer[] = { 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, @@ -2995,7 +2995,7 @@ }; -static char imlib_mail[] = { +static const char imlib_mail[] = { 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, @@ -3132,7 +3132,7 @@ }; -static char imlib_book_red[] = { +static const char imlib_book_red[] = { 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, @@ -3269,7 +3269,7 @@ }; -static char imlib_book_yellow[] = { +static const char imlib_book_yellow[] = { 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, @@ -3406,7 +3406,7 @@ }; -static char imlib_first[] = { +static const char imlib_first[] = { 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, @@ -3543,7 +3543,7 @@ }; -static char imlib_help[] = { +static const char imlib_help[] = { 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, @@ -3680,7 +3680,7 @@ }; -static char imlib_new[] = { +static const char imlib_new[] = { 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, @@ -3817,7 +3817,7 @@ }; -static char imlib_redo[] = { +static const char imlib_redo[] = { 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, @@ -3954,7 +3954,7 @@ }; -static char imlib_multiple_file[] = { +static const char imlib_multiple_file[] = { 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, @@ -4195,7 +4195,7 @@ }; -static char imlib_cut[] = { +static const char imlib_cut[] = { 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, @@ -4332,7 +4332,7 @@ }; -static char imlib_button_yes[] = { +static const char imlib_button_yes[] = { 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, @@ -4429,7 +4429,7 @@ }; -static char imlib_mail_send[] = { +static const char imlib_mail_send[] = { 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, @@ -4566,7 +4566,7 @@ }; -static char imlib_print[] = { +static const char imlib_print[] = { 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, @@ -4703,7 +4703,7 @@ }; -static char imlib_properties[] = { +static const char imlib_properties[] = { 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, @@ -4840,7 +4840,7 @@ }; -static char imlib_mail_reply[] = { +static const char imlib_mail_reply[] = { 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, @@ -4977,7 +4977,7 @@ }; -static char imlib_refresh[] = { +static const char imlib_refresh[] = { 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, @@ -5114,7 +5114,7 @@ }; -static char imlib_scores[] = { +static const char imlib_scores[] = { 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, @@ -5211,7 +5211,7 @@ }; -static char imlib_search_replace[] = { +static const char imlib_search_replace[] = { 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, @@ -5348,7 +5348,7 @@ }; -static char imlib_button_close[] = { +static const char imlib_button_close[] = { 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, @@ -5445,7 +5445,7 @@ }; -static char imlib_not[] = { +static const char imlib_not[] = { 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, @@ -5542,7 +5542,7 @@ }; -static char imlib_preferences[] = { +static const char imlib_preferences[] = { 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, @@ -5679,7 +5679,7 @@ }; -static char imlib_open[] = { +static const char imlib_open[] = { 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, @@ -5816,7 +5816,7 @@ }; -static char imlib_left_arrow[] = { +static const char imlib_left_arrow[] = { 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, @@ -5959,7 +5959,7 @@ }; -static char imlib_close[] = { +static const char imlib_close[] = { 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, @@ -6096,7 +6096,7 @@ }; -static char imlib_undelete[] = { +static const char imlib_undelete[] = { 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, @@ -6233,7 +6233,7 @@ }; -static char imlib_button_no[] = { +static const char imlib_button_no[] = { 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, @@ -6330,7 +6330,7 @@ }; -static char imlib_volume[] = { +static const char imlib_volume[] = { 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, @@ -6467,7 +6467,7 @@ }; -static char imlib_exit[] = { +static const char imlib_exit[] = { 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, @@ -6564,7 +6564,7 @@ }; -static char imlib_book_green[] = { +static const char imlib_book_green[] = { 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, @@ -6701,7 +6701,7 @@ }; -static char imlib_book_open[] = { +static const char imlib_book_open[] = { 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, @@ -6838,7 +6838,7 @@ }; -static char imlib_paste[] = { +static const char imlib_paste[] = { 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, @@ -6975,7 +6975,7 @@ }; -static char imlib_spellcheck[] = { +static const char imlib_spellcheck[] = { 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, @@ -7112,7 +7112,7 @@ }; -static char imlib_line_in[] = { +static const char imlib_line_in[] = { 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, @@ -7249,7 +7249,7 @@ }; -static char imlib_timer_stopped[] = { +static const char imlib_timer_stopped[] = { 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, diff -uNr gnome-libs-0.26/libgnomeui/gnome-stock.c gnome-libs-0.27/libgnomeui/gnome-stock.c --- gnome-libs-0.26/libgnomeui/gnome-stock.c Thu Aug 6 12:57:54 1998 +++ gnome-libs-0.27/libgnomeui/gnome-stock.c Wed Aug 12 08:07:56 1998 @@ -69,6 +69,7 @@ static GnomeStockPixmapEntry *lookup(const char *icon, const char *subtype, int fallback); +#if !USE_NEW_GNOME_STOCK /* * GnomeStockPixmapWidget */ @@ -255,8 +256,20 @@ return w; } +#endif /* !USE_NEW_GNOME_STOCK */ - +#if USE_NEW_GNOME_STOCK +void +gnome_stock_pixmap_widget_set_icon(GnomeStock *widget, + const char *icon) +{ + /* FIXME: this is a hack. This functions prototype will have to + * use the new GnomeStock widget */ + gnome_stock_set_icon(GNOME_STOCK(widget), icon); + g_warning("gnome_stock_pixmap_widget_set_icon is depreciated.\n\t\t" + "Please use gnome_stock_set_icon instead."); +} +#else /* !USE_NEW_GNOME_STOCK */ void gnome_stock_pixmap_widget_set_icon(GnomeStockPixmapWidget *widget, const char *icon) @@ -290,6 +303,239 @@ widget->icon = g_strdup(icon); gnome_stock_pixmap_widget_state_changed(GTK_WIDGET(widget), 0); } +#endif /* !USE_NBEW_GNOME_STOCK */ + + + +/***************************/ +/* new GnomeStock widget */ +/***************************/ + +static void +gnome_stock_destroy(GtkObject *object) +{ + GtkObjectClass *object_class; + GnomeStock *stock; + + g_return_if_fail(object != NULL); + g_return_if_fail(GNOME_IS_STOCK(object)); + + stock = GNOME_STOCK(object); + if (stock->regular) + gtk_widget_destroy(GTK_WIDGET(stock->regular)); + if (stock->disabled) + gtk_widget_destroy(GTK_WIDGET(stock->disabled)); + if (stock->focused) + gtk_widget_destroy(GTK_WIDGET(stock->focused)); + if (stock->icon) + g_free(stock->icon); + + object_class = gtk_type_class(gnome_pixmap_get_type()); + if (object_class->destroy) + (* object_class->destroy)(object); + +} + +static void +gnome_stock_paint(GnomeStock *stock, GnomePixmap *pixmap) +{ + GnomePixmap *gpixmap; + GtkRequisition req; + GdkVisual *visual; + GdkGC *gc; + + g_return_if_fail(stock != NULL); + g_return_if_fail(pixmap != NULL); + g_return_if_fail(GNOME_IS_STOCK(stock)); + g_return_if_fail(GNOME_IS_PIXMAP(pixmap)); + + gpixmap = GNOME_PIXMAP(stock); + gtk_widget_size_request(GTK_WIDGET(pixmap), &req); + if (GTK_WIDGET(pixmap)->window) + visual = gdk_window_get_visual(GTK_WIDGET(pixmap)->window); + else + visual = gdk_imlib_get_visual(); + if (gpixmap->pixmap) { + gint width, height; + gdk_window_get_size(gpixmap->pixmap, &width, &height); + if ((width != req.width) || (height != req.height)) { + gdk_window_destroy(gpixmap->pixmap); + gpixmap->pixmap = NULL; + gdk_window_destroy(gpixmap->mask); + gpixmap->mask = NULL; + } + } + if (!gpixmap->pixmap) { + gpixmap->pixmap = gdk_pixmap_new(pixmap->pixmap, + req.width, req.height, + visual->depth); + gpixmap->mask = gdk_pixmap_new(pixmap->mask, + req.width, req.height, 1); + } + gc = gdk_gc_new(gpixmap->pixmap); + gdk_draw_pixmap(gpixmap->pixmap, gc, pixmap->pixmap, 0, 0, 0, 0, + req.width, req.height); + gdk_gc_destroy(gc); + gc = gdk_gc_new(gpixmap->mask); + gdk_draw_pixmap(gpixmap->mask, gc, pixmap->mask, 0, 0, 0, 0, + req.width, req.height); + gdk_gc_destroy(gc); + if (GTK_WIDGET(gpixmap)->window) + gdk_window_shape_combine_mask(GTK_WIDGET(gpixmap)->window, + gpixmap->mask, 0, 0); +} + +/* + * This function has turned out to be the load_pixmap_function and is not + * used as signal catcher alone. That means, that you cannot trust the + * value in prev_state. + */ +static void +gnome_stock_state_changed(GtkWidget *widget, guint prev_state) +{ + GnomeStock *w = GNOME_STOCK(widget); + GnomePixmap *pixmap; + GtkWidget *tmp; + + if (widget->parent) { + tmp = widget->parent; + if (tmp->parent) + tmp = tmp->parent; + } else { + tmp = widget; + } + pixmap = NULL; + if (GTK_WIDGET_HAS_FOCUS(widget)) { + if (!w->focused) { + w->focused = gnome_stock_pixmap(tmp, w->icon, GNOME_STOCK_PIXMAP_FOCUSED); + /* gtk_widget_ref(GTK_WIDGET(w->focused)); */ + /* gtk_widget_show(GTK_WIDGET(w->focused)); */ + } + pixmap = w->focused; + } else if (!GTK_WIDGET_IS_SENSITIVE(widget)) { + if (!w->disabled) { + w->disabled = gnome_stock_pixmap(tmp, w->icon, GNOME_STOCK_PIXMAP_DISABLED); + /* gtk_widget_ref(GTK_WIDGET(w->disabled)); */ + /* gtk_widget_show(GTK_WIDGET(w->disabled)); */ + } + pixmap = w->disabled; + } else { + if (!w->regular) { + w->regular = gnome_stock_pixmap(tmp, w->icon, GNOME_STOCK_PIXMAP_REGULAR); + /* gtk_widget_ref(GTK_WIDGET(w->regular)); */ + /* gtk_widget_show(GTK_WIDGET(w->regular)); */ + } + pixmap = w->regular; + } + if (pixmap == w->current) return; + /* FIXME: this should check for sizes first */ + w->current = pixmap; + gnome_stock_paint(w, pixmap); +} + +static void +gnome_stock_class_init(GtkObjectClass *klass) +{ + klass->destroy = gnome_stock_destroy; + ((GtkWidgetClass *)klass)->state_changed = + gnome_stock_state_changed; +} + +static void +gnome_stock_init(GnomeStock *stock) +{ + stock->regular = NULL; + stock->disabled = NULL; + stock->focused = NULL; + stock->current = NULL; + stock->icon = NULL; +} + +guint +gnome_stock_get_type(void) +{ + static guint new_type = 0; + if (!new_type) { + GtkTypeInfo type_info = { + "GnomeStock", + sizeof(GnomeStock), + sizeof(GnomeStockClass), + (GtkClassInitFunc)gnome_stock_class_init, + (GtkObjectInitFunc)gnome_stock_init, + (GtkArgSetFunc) NULL, + (GtkArgGetFunc) NULL + }; + new_type = gtk_type_unique(gnome_pixmap_get_type(), &type_info); + } + return new_type; +} + +GtkWidget * +gnome_stock_new(void) +{ + return gtk_type_new(gnome_stock_get_type()); +} + +#if USE_NEW_GNOME_STOCK +GtkWidget * +gnome_stock_pixmap_widget_new(GtkWidget *window, const char *icon) +{ +#ifdef DEBUG + g_message("gnome_stock_pixmap_widget_new is depriciated\n\t\t" + "Use gnome_stock_new_with_icon instead."); +#endif + return gnome_stock_new_with_icon(icon); +} +#endif /* USE_NEW_GNOME_STOCK */ + +gboolean +gnome_stock_set_icon(GnomeStock *stock, const char *icon) +{ + GnomeStockPixmapEntry *entry; + + g_return_val_if_fail(stock != NULL, 0); + g_return_val_if_fail(GNOME_IS_STOCK(stock), 0); + g_return_val_if_fail(icon != NULL, 0); + + entry = lookup(icon, GNOME_STOCK_PIXMAP_REGULAR, 0); + g_return_val_if_fail(entry != NULL, 0); + + if (stock->icon) { + if (0 == strcmp(icon, stock->icon)) + return 1; + g_free(stock->icon); + } + stock->icon = g_strdup(icon); + stock->current = NULL; + if (stock->regular) { + gtk_widget_unref(GTK_WIDGET(stock->regular)); + stock->regular = NULL; + } + if (stock->disabled) { + gtk_widget_unref(GTK_WIDGET(stock->disabled)); + stock->disabled = NULL; + } + if (stock->focused) { + gtk_widget_unref(GTK_WIDGET(stock->focused)); + stock->focused = NULL; + } + gnome_stock_state_changed(GTK_WIDGET(stock), 0); + return 1; +} + +GtkWidget * +gnome_stock_new_with_icon(const char *icon) +{ + GtkWidget *w; + + g_return_val_if_fail(icon != NULL, NULL); + w = gtk_type_new(gnome_stock_get_type()); + if (!gnome_stock_set_icon(GNOME_STOCK(w), icon)) { + gtk_widget_destroy(w); + return NULL; + } + return w; +} @@ -797,10 +1043,14 @@ GtkWidget * gnome_stock_pixmap_widget(GtkWidget *window, const char *icon) { +#if USE_NEW_GNOME_STOCK + return gnome_stock_new_with_icon(icon); +#else GtkWidget *w; w = gnome_stock_pixmap_widget_new(window, icon); return w; +#endif } @@ -907,9 +1157,11 @@ /* assign the created button as the container widget to the * GnomeStockPixmap (see comment in stock_button_from_entry) */ +#if !USE_NEW_GNOME_STOCK if ((GNOME_IS_STOCK_PIXMAP_WIDGET(pixmap)) && (pixmap->window == NULL)) GNOME_STOCK_PIXMAP_WIDGET(pixmap)->window = button; +#endif /* !USE_NEW_GNOME_STOCK */ if (GNOME_IS_PIXMAP(pixmap)) { GnomeStockPixmapEntry *entry; char s[32]; diff -uNr gnome-libs-0.26/libgnomeui/gnome-stock.h gnome-libs-0.27/libgnomeui/gnome-stock.h --- gnome-libs-0.26/libgnomeui/gnome-stock.h Wed Aug 5 19:22:42 1998 +++ gnome-libs-0.27/libgnomeui/gnome-stock.h Wed Aug 12 08:07:56 1998 @@ -21,8 +21,6 @@ #ifndef __GNOME_STOCK_H__ #define __GNOME_STOCK_H__ - - #include #include #include @@ -32,6 +30,10 @@ /* #include */ +/* Wether or not the new GnomeStock widget should be used */ +#define USE_NEW_GNOME_STOCK 1 + + /* A short description: * * These functions provide an applications programmer with default @@ -255,6 +257,7 @@ +#if !USE_NEW_GNOME_STOCK /* the GnomeStockPixmapWidget */ #define GNOME_STOCK_PIXMAP_WIDGET(obj) GTK_CHECK_CAST(obj, gnome_stock_pixmap_widget_get_type(), GnomeStockPixmapWidget) @@ -282,6 +285,41 @@ guint gnome_stock_pixmap_widget_get_type(void); GtkWidget *gnome_stock_pixmap_widget_new(GtkWidget *window, const char *icon); +#else /* USE_NEW_GNOME_STOCK */ + +#define GNOME_STOCK_PIXMAP_WIDGET GNOME_STOCK +#define GNOME_IS_STOCK_PIXMAP_WIDGET GNOME_IS_STOCK + +GtkWidget *gnome_stock_pixmap_widget_new(GtkWidget *window, const char *icon); + +#endif /* USE_NEW_GNOME_STOCK */ + + +/* The new GnomeStock widget */ + + +#define GNOME_STOCK(obj) GTK_CHECK_CAST(obj, gnome_stock_get_type(), GnomeStock) +#define GNOME_STOCK_CLASS(klass) GTK_CHECK_CAST_CLASS(obj, gnome_stock_get_type(), GnomeStock) +#define GNOME_IS_STOCK(obj) GTK_CHECK_TYPE(obj, gnome_stock_get_type()) + +typedef struct _GnomeStock GnomeStock; +typedef struct _GnomeStockClass GnomeStockClass; + +struct _GnomeStock { + GnomePixmap pixmap; + GnomePixmap *regular, *disabled, *focused; /* pixmap cache */ + GnomePixmap *current; + char *icon; +}; + +struct _GnomeStockClass { + GnomePixmapClass pixmap_class; +}; + +guint gnome_stock_get_type(void); +GtkWidget *gnome_stock_new(void); +GtkWidget *gnome_stock_new_with_icon(const char *icon); +gboolean gnome_stock_set_icon(GnomeStock *stock, const char *icon); /* the utility functions */ @@ -298,13 +336,18 @@ const char *subtype); #endif -/* just fetch a GnomeStockPixmapWidget */ +/* just fetch a GnomeStock(PixmapWidget) */ GtkWidget *gnome_stock_pixmap_widget (GtkWidget *window, const char *icon); /* change the icon/look of a GnomeStockPixmapWidget */ +#if USE_NEW_GNOME_STOCK +void gnome_stock_pixmap_widget_set_icon(GnomeStock *widget, + const char *icon); +#else void gnome_stock_pixmap_widget_set_icon(GnomeStockPixmapWidget *widget, const char *icon); +#endif /* register a pixmap. returns non-zero, if successful */ gint gnome_stock_pixmap_register (const char *icon, diff -uNr gnome-libs-0.26/libgnomeui/stock_demo.c gnome-libs-0.27/libgnomeui/stock_demo.c --- gnome-libs-0.26/libgnomeui/stock_demo.c Thu Aug 6 12:57:54 1998 +++ gnome-libs-0.27/libgnomeui/stock_demo.c Wed Aug 12 08:07:57 1998 @@ -435,6 +435,18 @@ +#if USE_NEW_GNOME_STOCK +static void +toggle_button(GtkWidget *button, GnomeStock *w) +{ + if (!w) return; + if (!w->icon) return; + if (0 == strcmp(w->icon, GNOME_STOCK_PIXMAP_TIMER)) + gnome_stock_set_icon(w, GNOME_STOCK_PIXMAP_TIMER_STOP); + else + gnome_stock_set_icon(w, GNOME_STOCK_PIXMAP_TIMER); +} +#else /* °USE_NEW_GNOME_STOCK */ static void toggle_button(GtkWidget *button, GnomeStockPixmapWidget *w) { @@ -445,6 +457,7 @@ else gnome_stock_pixmap_widget_set_icon(w, GNOME_STOCK_PIXMAP_TIMER); } +#endif /* !USE_NEW_GNOME_STOCK */ diff -uNr gnome-libs-0.26/libgtktty/ChangeLog gnome-libs-0.27/libgtktty/ChangeLog --- gnome-libs-0.26/libgtktty/ChangeLog Thu Jul 23 14:08:42 1998 +++ gnome-libs-0.27/libgtktty/ChangeLog Fri Aug 7 14:46:08 1998 @@ -1,3 +1,8 @@ +1998-08-06 Raja R Harinath + + * configure.in (AC_INIT): + Use `libgtktty.h' instead of `acconfig.h'. + Fri Apr 17 04:32:42 1998 Tim Janik * minor cleanups. diff -uNr gnome-libs-0.26/libgtktty/configure gnome-libs-0.27/libgtktty/configure --- gnome-libs-0.26/libgtktty/configure Thu Aug 6 13:01:33 1998 +++ gnome-libs-0.27/libgtktty/configure Thu Aug 13 19:36:33 1998 @@ -469,7 +469,7 @@ # A filename unique to this package, relative to the directory that # configure is in, which we can look for to find out if srcdir is correct. -ac_unique_file=acconfig.h +ac_unique_file=libgtktty.h # Find the source files, if location was not specified. if test -z "$srcdir"; then diff -uNr gnome-libs-0.26/libgtktty/configure.in gnome-libs-0.27/libgtktty/configure.in --- gnome-libs-0.26/libgtktty/configure.in Thu Jul 23 14:08:42 1998 +++ gnome-libs-0.27/libgtktty/configure.in Fri Aug 7 14:46:08 1998 @@ -1,7 +1,7 @@ dnl dnl Configure script for the GtkTty library dnl -AC_INIT(acconfig.h) +AC_INIT(libgtktty.h) AM_CONFIG_HEADER(config.h) LIBGTKTTY_MAJOR=0 LIBGTKTTY_REVISION=4 diff -uNr gnome-libs-0.26/libvfs/ChangeLog gnome-libs-0.27/libvfs/ChangeLog --- gnome-libs-0.26/libvfs/ChangeLog Wed Dec 31 19:00:00 1969 +++ gnome-libs-0.27/libvfs/ChangeLog Thu Aug 13 07:05:28 1998 @@ -0,0 +1,255 @@ +Wed Aug 12 19:04:48 1998 Pavel Roskin + + * extfs/patchfs: %k replaced with more portable %H in the format + for "date" command + + * extfs/extfs.ini: Added patchfs and mailfs. Some comments + changed + +Tue Aug 11 15:25:52 1998 Pavel Roskin + + * extfs/rpm: Fix for buggy "cut" on HP-UX 10.20 which ignores + lines without enf-of-line. + +1998-08-07 Timur Bakeyev (timur@comtat.ru) + + * tar.c (read_header): Support for linkflag on BSDI tar (pax), it + is always 0. + +1998-06-22 Miguel de Icaza + + * ftpfs.c (ftpfs_open_socket): Potential security break fix. + +1998-08-06 Raja R Harinath + + * Makefile.am (BUILT_SOURCES): Make it `make dist' friendly. + Don't try building this, yet. + +1998-07-31 Nuno Ferreira + + * Make-mc.in (install.extfs): Splitted install of $(EXTFS_CONST) + and $(EXTFS_OUT) because the first must be installed from + $(srcdir) and the second from $(builddir). + +Fri Jul 24 00:22:30 1998 Tom Tromey + + * Make-mc.in (DISTVFS): Changed Makefile.in to Make-mc.in. + + * Makefile.am: New file. + * Make-mc.in: Renamed from Makefile.in. + * Makefile.in: Removed. + +Mon Jun 29 15:12:55 1998 Pavel Roskin + + * Makefile.in: Rewritten stuff concerning extfs files. + +Mon Jun 22 22:30:00 1998 Manish Vachharajani + + * Makefile.in: Remove arfs, since it doesn't seem to exist + +Wed Jun 17 Pavel Machek + * Rename helper scripts (extfs/{rar|lha|...}.in), so their names + are more logical (and so that things actually work, because new + names are currently in extfs.ini). + +Wed Jun 17 Pavel Machek + * Modified code to use tempnam() instead of tmpnam(), fixed + tempnam() to use NULL instead of 0. + +Wed Jun 3 Pavel Machek + + * libvfs.c: adding libvfs.c which should contain things specific + to stand-alone libvfs.so. (This file was missing from previous + merge.) + +Mon Jun 1 16:00:19 1998 Norbert Warmuth + + * ftpfs.c (ftpfs_fill_names): use right character to seperate + prefix and username + +Mon Jun 1 14:19:20 1998 Bakeyev I. Timur + * vfs.c (parse_ls_lga): allow a bit wider range of listings. + + * vfs.c (is_time, is_year): new functions + +Mon Jun 1 12:47:50 1998 Norbert Warmuth + + * ftpfs.c (ftpfs_forget): Use the new ftpfs prefix. + +Thu May 28 16:42:31 1998 Pavel Machek + + * extfs.c, shared.c, tar.c: I changed semantics in my previous + patch - _get_path() now modifies strings passed to it. I thought + that I were carefull enough not to introduce bugs. You guessed it - + I was not. [Many tar_ and extfs_ functions modify strings passed + to them, but as they are only called from vfs layer, it does not + matter much.] + So I renamed function to alert everyone that semantics changed. + + Fixed bugs in timestamping (and segfaults) when you entered tar + inside zip file or similar. + + * vfs.c (mc_open): Die if the filesystem doesn't support open + +??? Pavel Machek + + * shared.c: Shared parts of extfs.c and tar.c are now in shared.c + + * util-alone.*: VFS should be able to compile stand-alone into + libvfs.so usable by anyone. This is first step. + + * vfs.c & others: syntax change. We no longer use + tar:/path.tar/file. Now, syntax is /path.tar#utar/file, which has + better defined meaning. Similar changes are done to all other + protocols. This change touched really _many_ places of code. + + +1998-05-26 Miguel de Icaza + + * vfs.c (MC_DIROP): Macro now returns the proper value. + +1998-maj-18 Tamasi Gyorgy (gt_cosy@usa.net) + + * Makefile.in ('install' target): 'mcserv' not installed, if + net-code is not enabled by 'configure'. + +Thu May 14 02:05:52 1998 Norbert Warmuth + + * Makefile.in (LIBS): add @LINTL@ + +Sun May 10 14:51:03 1998 Norbert Warmuth + + * ftpfs.c (__ftpfs_chdir): CWD command wasn't sent at all. This + optimation is wrong because for directories containing spaces we + have to "CWD " and "LIST -la" instead of + "LIST -la ". + I implemented a different optimation. Now ftpfs_chdir only stores + the new working directory and sets a flag. __ftpfs_chdir is called + when we really want to change the directory on the ftp server. + + (resolve_symlink): Log the directory listing to the logfile. + + * ftpfs.h (struct ftpfs_connection): Added a (per connection) + cwd_defered flag. + +Mon May 4 10:27:49 1998 Norbert Warmuth + + * Makefile.in: Links to mad.c and mad.h were created wrong when + srcdir != builddir and directory depth to srcdir and builddir were + different (e.g. srcdir=/src/mc and builddir=/src/compile/mc) + + * ftpfs.c (retrieve_file_start2): Don't create target file O_EXCL, + in copy_file_file we check existance of the target file and know + that we want to truncate it. + +1998-04-29 Miguel de Icaza + + * tar.c (read_header): Mark regular files with S_IFREG. + +Tue Apr 28 06:06:03 1998 Norbert Warmuth + + * extfs.c (extfs_open, extfs_close): Changed my_system(1,...) to + my_system(EXECUTE_AS_SHELL,...), this fixes the broken copyin and + copyout of 4.1.32. + +1998-04-23 Miguel de Icaza + + * ftpfs.c (retrieve_file_start2): Open file exclusively. + (retrieve_file): likewise. + +1998-03-31 Philippe De Muyter + + * vfs.h: compilation fix for m68k-motorola-sysv + +Wed Mar 25 19:01:48 1998 Norbert Warmuth + + * extfs/hp48: Added a usage summary + +Mon Mar 23 00:42:21 1998 Christofer Edvardsen + + * Makefile.in, extfs/extfs.ini, extfs/hp48: New external + filesystem to view and copy files to/from the HP48. + +Wed Feb 11 14:09:02 1998 Oleg + + * extfs.c: Add support for writtable external file systems. + Required for the httpfs. + +Fri Jan 23 07:27:37 1998 Peter Daum + + * extfs.c (open_extfs_archive): Pass the quoted argument to the + list command. + + * mailfs: new file system. + +1997-12-21 Yuri Kuzmenko + + * tar.c: fix the bug which core dumps when trying to view tar file + with many files (over 60000). + +Mon Jul 21 18:47:37 1997 Miguel de Icaza + + * vfs.c (mc_opendir): Do not make conversions between int/void * + to make the code compile and work on the Alpha correctly. + Allocate a pointer to an int and use that instead. + +Thu Jul 3 19:08:43 1997 Michele Marziani + + * extfs/rpm: Small fix for older RPM files. + +Mon Jun 9 19:00:30 1997 Norbert Warmuth + + * vfs/vfs.c (vfs_canon): Fix for the 'cd a:/somedir/..' problem + + * vfs/vfs.c (vfs_add_non_current_stamps): when leaving a mtools fs + free the extfs buffers immediatly instead of waiting for the vfs- + timeout + +Thu May 29 14:50:41 1997 Miguel de Icaza + + * vfs.c (vfs_canon): the "local:" case was consuming one extra + character. This fixes the bug reported by Andrej. Also, handle + the non-canonical case of arguments to local: + +Tue May 27 20:38:28 1997 Miguel de Icaza + + * mcserv.c (get_client): The parent now waits for the first forked + process, getting rid of the zombies. + + * utilvfs.c (open_tcp_link): If we can not contact the remote + portmapper, set the protocol version to 1. + +Fri May 16 16:42:18 1997 Tomasz K³oczko, + + * mc.spec: New spec file, this packages mc, mcserv and tkmc. + + * lib/mcserv.init, lib/mc.sh, lib/mcserv.pamd: added + + * vfs/ext/rpm: instead using sed and rpm -qpi use rpm queries, + more info currently displayed (changeslogs, Os, URL, packager + +Tue May 13 18:14:49 1997 Wojtek Pilorz + + * vfs/Makefile.in (INSTALL_PROGRAM): Use -m flag for install to + force vfs scripts to be executable on those systems that use + install.sh + + * src/utilunix.c: Implement socketpair for SCO flavored systems. + +Mon Mar 17 12:03:50 1997 Norbert Warmuth + + * configure.in (--with-hsc): fix. + + * vfs/ftpfs.c (ftpfs_get_proxy_host_and_port): Fixed wrong parameter + passing (HSC_DEFAULT_PORT was passed as pointer to char instead of + passing it as integer) + +Tue Feb 25 20:21:00 1997 Joseph M. Hinkle + + * extfs/lha: Updated the lha filesystem and included a command + for running an executable from within an lha archive suggested + by Zdenek Kabelac + + * extfs/: Renamed cpio, deb, rar, rpm as *.in files and altered + config.in to create these VFS's for cleaner compilation + diff -uNr gnome-libs-0.26/libvfs/Makefile.am gnome-libs-0.27/libvfs/Makefile.am --- gnome-libs-0.26/libvfs/Makefile.am Wed Dec 31 19:00:00 1969 +++ gnome-libs-0.27/libvfs/Makefile.am Mon Aug 10 10:48:24 1998 @@ -0,0 +1,24 @@ +## Process this file with automake to produce Makefile.in. + +## FIXME: this is not nearly finished. It is pointless to try to use +## it without fixing it, and libvfs, first. Feel free! + + +## This file is used only by the Gnome libvfs build. If you make +## changes here, they must be synchronized with Make-mc.in. + +lib_LTLIBRARIES = libvfs.la + +if FALSE +# FIXME: to fool make dist. +# In `mc' mad.c and mad.h are symlinks to topdir/src/mad.[ch] +BUILT_SOURCES = mad.c mad.h +mad_ch = mad.c mad.h +endif + +libvfs_la_SOURCES = callback.h container.c container.h extfs.c extfs.h \ +ftpfs.c ftpfs.h libvfs.c local.c $(mad_ch) mcfs.c mcfs.h mcserv.c \ +names.c names.h shared.c tar.c tar.h tcputil.c tcputil.h undelfs.c \ +undelfs.h util-alone.c util-alone.h utilvfs.c vfs.c vfs.h + +libvfs_la_LDFLAGS = -version-info 26:0:26 diff -uNr gnome-libs-0.26/libvfs/Makefile.in gnome-libs-0.27/libvfs/Makefile.in --- gnome-libs-0.26/libvfs/Makefile.in Wed Dec 31 19:00:00 1969 +++ gnome-libs-0.27/libvfs/Makefile.in Thu Aug 13 19:56:52 1998 @@ -0,0 +1,356 @@ +# Makefile.in generated automatically by automake 1.3 from Makefile.am + +# Copyright (C) 1994, 1995, 1996, 1997, 1998 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. + + +SHELL = /bin/sh + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DISTDIR = + +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@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_alias = @build_alias@ +build_triplet = @build@ +host_alias = @host_alias@ +host_triplet = @host@ +target_alias = @target_alias@ +target_triplet = @target@ +AWK = @AWK@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CFLAGS = @CFLAGS@ +CPPFLAGS = @CPPFLAGS@ +DATADIRNAME = @DATADIRNAME@ +DL_LIB = @DL_LIB@ +GENCAT = @GENCAT@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_CONFIG = @GLIB_CONFIG@ +GLIB_LIBS = @GLIB_LIBS@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ +GNOMEUI_LIBS = @GNOMEUI_LIBS@ +GNOME_CANVAS_HED = @GNOME_CANVAS_HED@ +GNOME_CANVAS_OBJS = @GNOME_CANVAS_OBJS@ +GNOME_CANVAS_SRC = @GNOME_CANVAS_SRC@ +GNOME_INCLUDEDIR = @GNOME_INCLUDEDIR@ +GNOME_LIBDIR = @GNOME_LIBDIR@ +GNOME_LIBS = @GNOME_LIBS@ +GTKXMHTML_LIBS = @GTKXMHTML_LIBS@ +GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CONFIG = @GTK_CONFIG@ +GTK_LIBS = @GTK_LIBS@ +GT_NO = @GT_NO@ +GT_YES = @GT_YES@ +INCLUDE_LOCALE_H = @INCLUDE_LOCALE_H@ +INSTOBJEXT = @INSTOBJEXT@ +INTLDEPS = @INTLDEPS@ +INTLLIBS = @INTLLIBS@ +INTLOBJS = @INTLOBJS@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBGNOMEUI_LIBS = @LIBGNOMEUI_LIBS@ +LIBGNOME_LIBS = @LIBGNOME_LIBS@ +LIBGTKXMHTML_LIBS = @LIBGTKXMHTML_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBSUPPORT = @LIBSUPPORT@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +NM = @NM@ +NSL_LIBS = @NSL_LIBS@ +PACKAGE = @PACKAGE@ +POFILES = @POFILES@ +POSUB = @POSUB@ +PTHREAD_LIB = @PTHREAD_LIB@ +RANLIB = @RANLIB@ +SUPPORTINCS = @SUPPORTINCS@ +USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +XPM_LIBS = @XPM_LIBS@ +ZVT_LIBS = @ZVT_LIBS@ +l = @l@ +need_gnome_support = @need_gnome_support@ + +lib_LTLIBRARIES = libvfs.la + +# FIXME: to fool make dist. +# In `mc' mad.c and mad.h are symlinks to topdir/src/mad.[ch] +@FALSE_TRUE@BUILT_SOURCES = mad.c mad.h +@FALSE_TRUE@mad_ch = mad.c mad.h + +libvfs_la_SOURCES = callback.h container.c container.h extfs.c extfs.h \ +ftpfs.c ftpfs.h libvfs.c local.c $(mad_ch) mcfs.c mcfs.h mcserv.c \ +names.c names.h shared.c tar.c tar.h tcputil.c tcputil.h undelfs.c \ +undelfs.h util-alone.c util-alone.h utilvfs.c vfs.c vfs.h + +libvfs_la_LDFLAGS = -version-info 26:0:26 +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = ../config.h +CONFIG_CLEAN_FILES = +LTLIBRARIES = $(lib_LTLIBRARIES) + + +DEFS = @DEFS@ -I. -I$(srcdir) -I.. +LIBS = @LIBS@ +libvfs_la_LIBADD = +@FALSE_TRUE@cond0libvfs_la_OBJECTS = container.lo extfs.lo ftpfs.lo \ +@FALSE_TRUE@libvfs.lo local.lo mad.lo mcfs.lo mcserv.lo names.lo \ +@FALSE_TRUE@shared.lo tar.lo tcputil.lo undelfs.lo util-alone.lo \ +@FALSE_TRUE@utilvfs.lo vfs.lo +@FALSE_FALSE@cond1libvfs_la_OBJECTS = container.lo extfs.lo ftpfs.lo \ +@FALSE_FALSE@libvfs.lo local.lo mcfs.lo mcserv.lo names.lo shared.lo \ +@FALSE_FALSE@tar.lo tcputil.lo undelfs.lo util-alone.lo utilvfs.lo \ +@FALSE_FALSE@vfs.lo +libvfs_la_OBJECTS = $(cond0libvfs_la_OBJECTS) $(cond1libvfs_la_OBJECTS) +COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) +LINK = $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) -o $@ +DIST_COMMON = ChangeLog Makefile.am Makefile.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = tar +GZIP = --best +SOURCES = $(libvfs_la_SOURCES) +OBJECTS = $(libvfs_la_OBJECTS) + +all: Makefile $(LTLIBRARIES) + +.SUFFIXES: +.SUFFIXES: .S .c .lo .o .s +$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps libvfs/Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status + + +mostlyclean-libLTLIBRARIES: + +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + +distclean-libLTLIBRARIES: + +maintainer-clean-libLTLIBRARIES: + +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(libdir) + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + echo "$(LIBTOOL) --mode=install $(INSTALL_DATA) $$p $(DESTDIR)$(libdir)/$$p"; \ + $(LIBTOOL) --mode=install $(INSTALL_DATA) $$p $(DESTDIR)$(libdir)/$$p; \ + else :; fi; \ + done + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p; \ + 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: + +.c.lo: + $(LIBTOOL) --mode=compile $(COMPILE) -c $< + +.s.lo: + $(LIBTOOL) --mode=compile $(COMPILE) -c $< + +.S.lo: + $(LIBTOOL) --mode=compile $(COMPILE) -c $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + +maintainer-clean-libtool: + +libvfs.la: $(libvfs_la_OBJECTS) $(libvfs_la_DEPENDENCIES) + $(LINK) -rpath $(libdir) $(libvfs_la_LDFLAGS) $(libvfs_la_OBJECTS) $(libvfs_la_LIBADD) $(LIBS) + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) + here=`pwd` && cd $(srcdir) \ + && mkid -f$$here/ID $(SOURCES) $(HEADERS) $(LISP) + +TAGS: $(HEADERS) $(SOURCES) $(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)$$unique$(LISP)$$tags" \ + || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) + +mostlyclean-tags: + +clean-tags: + +distclean-tags: + -rm -f TAGS ID + +maintainer-clean-tags: + +distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) + +subdir = libvfs + +distdir: $(DISTFILES) + @for file in $(DISTFILES); do \ + d=$(srcdir); \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file; \ + done + +info: +dvi: +check: all + $(MAKE) +installcheck: +install-exec: install-libLTLIBRARIES + @$(NORMAL_INSTALL) + +install-data: + @$(NORMAL_INSTALL) + +install: install-exec install-data all + @: + +uninstall: uninstall-libLTLIBRARIES + +install-strip: + $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install +installdirs: + $(mkinstalldirs) $(DATADIR)$(libdir) + + +mostlyclean-generic: + -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -rm -f Makefile $(DISTCLEANFILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) +mostlyclean: mostlyclean-libLTLIBRARIES mostlyclean-compile \ + mostlyclean-libtool mostlyclean-tags \ + mostlyclean-generic + +clean: clean-libLTLIBRARIES clean-compile clean-libtool clean-tags \ + clean-generic mostlyclean + +distclean: distclean-libLTLIBRARIES distclean-compile distclean-libtool \ + distclean-tags distclean-generic clean + -rm -f config.status + -rm -f libtool + +maintainer-clean: maintainer-clean-libLTLIBRARIES \ + maintainer-clean-compile maintainer-clean-libtool \ + maintainer-clean-tags maintainer-clean-generic \ + distclean + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +.PHONY: mostlyclean-libLTLIBRARIES distclean-libLTLIBRARIES \ +clean-libLTLIBRARIES maintainer-clean-libLTLIBRARIES \ +uninstall-libLTLIBRARIES install-libLTLIBRARIES mostlyclean-compile \ +distclean-compile clean-compile maintainer-clean-compile \ +mostlyclean-libtool distclean-libtool clean-libtool \ +maintainer-clean-libtool tags mostlyclean-tags distclean-tags \ +clean-tags maintainer-clean-tags distdir info dvi installcheck \ +install-exec install-data install uninstall all installdirs \ +mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + +# 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 -uNr gnome-libs-0.26/libvfs/callback.h gnome-libs-0.27/libvfs/callback.h --- gnome-libs-0.26/libvfs/callback.h Wed Dec 31 19:00:00 1969 +++ gnome-libs-0.27/libvfs/callback.h Thu Jul 23 14:08:50 1998 @@ -0,0 +1,17 @@ +#ifndef CALLBACK_H +#define CALLBACK_H + +/* + * All callbacks are char *func( char *msg ); + * INFO/BOX should always return NULL; + */ + +#define CALL_INFO 0 +#define CALL_BOX 1 +#define CALL_PASSWD 2 + +#define NUM_CALLBACKS 3 + +extern void vfs_set_callback( int num, void *func ); + +#endif diff -uNr gnome-libs-0.26/libvfs/container.c gnome-libs-0.27/libvfs/container.c --- gnome-libs-0.26/libvfs/container.c Wed Dec 31 19:00:00 1969 +++ gnome-libs-0.27/libvfs/container.c Thu Jul 23 14:08:50 1998 @@ -0,0 +1,103 @@ +/* Virtual File System + Copyright (C) 1995 The Free Software Foundation + + Written by: 1995 Ching Hui (mr854307@cs.nthu.edu.tw) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ + +#include +#include +#include +#include +#include "../src/mad.h" +#include "../src/util.h" +#include "container.h" + + +struct linklist * +linklist_init(void) +{ + struct linklist *head; + + head = xmalloc(sizeof(struct linklist), "struct linklist"); + if (head) { + head->prev = head->next = head; + head->data = NULL; + } + return head; +} + +void +linklist_destroy(struct linklist *head, void (*destructor) (void *)) +{ + struct linklist *p, *q; + + for (p = head->next; p != head; p = q) { + if (p->data && destructor) + (*destructor) (p->data); + q = p->next; + free(p); + } + free(head); +} + +int +linklist_insert(struct linklist *head, void *data) +{ + struct linklist *p; + + p = xmalloc(sizeof(struct linklist), "struct linklist"); + if (p == NULL) + return 0; + p->data = data; + p->prev = head->prev; + p->next = head; + head->prev->next = p; + head->prev = p; + return 1; +} + +void +linklist_delete_all(struct linklist *head, void (*destructor) (void *)) +{ + struct linklist *p, *q; + + for (p = head->next; p != head; p = q) { + destructor(p->data); + q = p->next; + free(p); + } + head->next = head->prev = head; + head->data = NULL; +} + +int +linklist_delete(struct linklist *head, void *data) +{ + struct linklist *h = head->next; + + while (h != head) { + if (h->data == data) { + h->prev->next = h->next; + h->next->prev = h->prev; + free(h); + return 1; + } + h = h->next; + } + return 0; +} + + diff -uNr gnome-libs-0.26/libvfs/container.h gnome-libs-0.27/libvfs/container.h --- gnome-libs-0.26/libvfs/container.h Wed Dec 31 19:00:00 1969 +++ gnome-libs-0.27/libvfs/container.h Thu Jul 23 14:08:50 1998 @@ -0,0 +1,32 @@ +/* linklist.h */ +#if !defined(__LINKLIST_H) +#define __LINKLIST_H + +struct linklist { + void *data; + struct linklist *next; + struct linklist *prev; +}; + +struct LRU_list { + struct LRU_list *prev; + struct LRU_list *next; + void *data; +}; + +struct list_iterator { + struct linklist *linklist; + struct linklist *current_pos; +}; + +struct linklist *linklist_init(void); +void linklist_destroy(struct linklist *, void (*destructor) (void *)); +int linklist_insert(struct linklist *, void *); +int linklist_delete(struct linklist *, void *); +void linklist_delete_all(struct linklist *, void (*) (void *)); + +#endif + + + + diff -uNr gnome-libs-0.26/libvfs/extfs.c gnome-libs-0.27/libvfs/extfs.c --- gnome-libs-0.26/libvfs/extfs.c Wed Dec 31 19:00:00 1969 +++ gnome-libs-0.27/libvfs/extfs.c Thu Jul 23 14:08:51 1998 @@ -0,0 +1,1057 @@ +/* Virtual File System: External file system. + Copyright (C) 1995 The Free Software Foundation + + Written by: 1995 Jakub Jelinek + Rewritten by: 1998 Pavel Machek + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#ifdef HAVE_SYS_WAIT_H +#include +#endif +#include +#ifdef SCO_FLAVOR +#include /* alex: for struct timeb definition */ +#endif /* SCO_FLAVOR */ +#include +#include "../src/fs.h" +#include "../src/util.h" +#include "../src/dialog.h" +#include "../src/mem.h" +#include "../src/mad.h" +#include "../src/main.h" /* For shell_execute */ +#define WANT_PARSE_LS_LGA +#include "vfs.h" +#include "extfs.h" + +static struct extfs_entry * +extfs_find_entry (struct extfs_entry *dir, char *name, int make_dirs, int make_file); + +static struct extfs_archive *first_archive = NULL; +static int extfserrno = 0; +static struct stat hstat; /* Stat struct corresponding */ +static char *current_file_name, *current_link_name; +static char *extfs_current_dir; + +#define MAXEXTFS 32 +static char *extfs_prefixes [MAXEXTFS]; +static char extfs_need_archive [MAXEXTFS]; +static int extfs_no = 0; + +void extfs_fill_names (void (*func)(char *)) +{ + struct extfs_archive *a = first_archive; + char *name; + + while (a){ + name = copy_strings (extfs_prefixes [a->fstype], "#", + (a->name ? a->name : ""), "/", + a->current_dir->name, 0); + (*func)(name); + free (name); + a = a->next; + } +} + +static void make_dot_doubledot (struct extfs_entry *ent) +{ + struct extfs_entry *entry = (struct extfs_entry *) + xmalloc (sizeof (struct extfs_entry), "Extfs: extfs_entry"); + struct extfs_entry *parentry = ent->dir; + struct extfs_inode *inode = ent->inode, *parent; + + parent = (parentry != NULL) ? parentry->inode : NULL; + entry->name = strdup ("."); + entry->has_changed = 0; + entry->inode = inode; + entry->dir = ent; + inode->local_filename = NULL; + inode->first_in_subdir = entry; + inode->last_in_subdir = entry; + inode->nlink++; + entry->next_in_dir = (struct extfs_entry *) + xmalloc (sizeof (struct extfs_entry), "Extfs: extfs_entry"); + entry=entry->next_in_dir; + entry->name = strdup (".."); + entry->has_changed = 0; + inode->last_in_subdir = entry; + entry->next_in_dir = NULL; + if (parent != NULL) { + entry->inode = parent; + entry->dir = parentry; + parent->nlink++; + } else { + entry->inode = inode; + entry->dir = ent; + inode->nlink++; + } +} + +static struct extfs_entry *generate_entry (struct extfs_archive *archive, + char *name, struct extfs_entry *parentry, mode_t mode) +{ + mode_t myumask; + struct extfs_inode *inode, *parent; + struct extfs_entry *entry; + + parent = (parentry != NULL) ? parentry->inode : NULL; + entry = (struct extfs_entry *) + xmalloc (sizeof (struct extfs_entry), "Extfs: extfs_entry"); + + entry->name = strdup (name); + entry->has_changed = 0; + entry->next_in_dir = NULL; + entry->dir = parentry; + if (parent != NULL) { + parent->last_in_subdir->next_in_dir = entry; + parent->last_in_subdir = entry; + } + inode = (struct extfs_inode *) + xmalloc (sizeof (struct extfs_inode), "Extfs: extfs_inode"); + entry->inode = inode; + inode->has_changed = 0; + inode->local_filename = NULL; + inode->linkname = 0; + inode->inode = (archive->__inode_counter)++; + inode->dev = archive->rdev; + inode->archive = archive; + myumask = umask (022); + umask (myumask); + inode->mode = mode & ~myumask; + mode = inode->mode; + inode->rdev = 0; + inode->uid = getuid (); + inode->gid = getgid (); + inode->size = 0; + inode->mtime = time (NULL); + inode->atime = inode->mtime; + inode->ctime = inode->mtime; + inode->nlink = 1; + if (S_ISDIR (mode)) + make_dot_doubledot (entry); + return entry; +} + +static void free_entries (struct extfs_entry *entry) +{ + return; +} + +static void free_archive (struct extfs_archive *archive) +{ + free_entries (archive->root_entry); + if (archive->local_name != NULL) { + struct stat my; + + mc_stat (archive->local_name, &my); + mc_ungetlocalcopy (archive->name, archive->local_name, + archive->local_stat.st_mtime != my.st_mtime); + /* ungetlocalcopy frees local_name for us */ + } + if (archive->name) + free (archive->name); + free (archive); +} + +static FILE *open_extfs_archive (int fstype, char *name, struct extfs_archive **pparc) +{ + static dev_t __extfs_no = 0; + FILE *result; + mode_t mode; + char *cmd; + struct stat mystat; + struct extfs_archive *current_archive; + struct extfs_entry *root_entry; + char *local_name = NULL, *tmp = 0; + int uses_archive = extfs_need_archive [fstype]; + char *tmpfile; + + if (uses_archive){ + if (mc_stat (name, &mystat) == -1) + return NULL; + if (!vfs_file_is_local (name)) { + local_name = mc_getlocalcopy (name); + if (local_name == NULL) + return NULL; + } + tmp = name_quote (name, 0); + } + +#if 0 + /* Sorry, what is this good for? */ + if (uses_archive == EFS_NEED_ARG){ + tmp = name_quote (name, 0); + } +#endif + + cmd = copy_strings (LIBDIR "extfs/", extfs_prefixes [fstype], + " list ", local_name ? local_name : tmp, 0); + if (tmp) + free (tmp); + result = popen (cmd, "r"); + free (cmd); + if (result == NULL) { + if (local_name != NULL && uses_archive) + mc_ungetlocalcopy (name, local_name, 0); + return NULL; + } + + current_archive = (struct extfs_archive *) + xmalloc (sizeof (struct extfs_archive), "Extfs archive"); + current_archive->fstype = fstype; + current_archive->name = name ? strdup (name): name; + current_archive->local_name = local_name; + + if (local_name != NULL) + mc_stat (local_name, ¤t_archive->local_stat); + current_archive->__inode_counter = 0; + current_archive->fd_usage = 0; + current_archive->extfsstat = mystat; + current_archive->rdev = __extfs_no++; + current_archive->next = first_archive; + first_archive = current_archive; + mode = current_archive->extfsstat.st_mode & 07777; + if (mode & 0400) + mode |= 0100; + if (mode & 0040) + mode |= 0010; + if (mode & 0004) + mode |= 0001; + mode |= S_IFDIR; + root_entry = generate_entry (current_archive, "/", NULL, mode); + root_entry->inode->uid = current_archive->extfsstat.st_uid; + root_entry->inode->gid = current_archive->extfsstat.st_gid; + root_entry->inode->atime = current_archive->extfsstat.st_atime; + root_entry->inode->ctime = current_archive->extfsstat.st_ctime; + root_entry->inode->mtime = current_archive->extfsstat.st_mtime; + current_archive->root_entry = root_entry; + current_archive->current_dir = root_entry; + + *pparc = current_archive; + + return result; +} + +/* + * Main loop for reading an archive. + * Returns 0 on success, -1 on error. + */ +int read_extfs_archive (int fstype, char *name, struct extfs_archive **pparc) +{ + FILE *extfsd; + char *buffer; + struct extfs_archive *current_archive; + + if ((extfsd = open_extfs_archive (fstype, name, ¤t_archive)) == NULL) { + message_3s (1, MSG_ERROR, _("Couldn't open %s archive\n%s"), + extfs_prefixes [fstype], name); + return -1; + } + + buffer = xmalloc (4096, "Extfs: buffer"); + while (fgets (buffer, 4096, extfsd) != NULL) { + current_link_name = NULL; + if (parse_ls_lga (buffer, &hstat, ¤t_file_name, ¤t_link_name)) { + struct extfs_entry *entry, *pent; + struct extfs_inode *inode; + char *p, *q, *cfn = current_file_name; + + if (*cfn) { + if (*cfn == '/') + cfn++; + p = strchr (cfn, 0); + if (p != NULL && p != cfn && *(p - 1) == '/') + *(p - 1) = 0; + p = strrchr (cfn, '/'); + if (p == NULL) { + p = cfn; + q = strchr (cfn, 0); + } else { + *(p++) = 0; + q = cfn; + } + if (S_ISDIR (hstat.st_mode) && + (!strcmp (p, ".") || !strcmp (p, ".."))) + goto read_extfs_continue; + pent = extfs_find_entry (current_archive->root_entry, q, 1, 0) ; + if (pent == NULL) { + message_1s (1, MSG_ERROR, _("Inconsistent extfs archive")); + /* FIXME: Should clean everything one day */ + free (buffer); + pclose (extfsd); + return -1; + } + entry = (struct extfs_entry *) xmalloc (sizeof (struct extfs_entry), "Extfs: extfs_entry"); + entry->name = strdup (p); + entry->has_changed = 0; + entry->next_in_dir = NULL; + entry->dir = pent; + if (pent != NULL) { + if (pent->inode->last_in_subdir){ + pent->inode->last_in_subdir->next_in_dir = entry; + pent->inode->last_in_subdir = entry; + } + } + if (!S_ISLNK (hstat.st_mode) && current_link_name != NULL) { + pent = extfs_find_entry (current_archive->root_entry, current_link_name, 0, 0); + if (pent == NULL) { + message_1s (1, MSG_ERROR, _("Inconsistent extfs archive")); + /* FIXME: Should clean everything one day */ + free (buffer); + pclose (extfsd); + return -1; + } else { + entry->inode = pent->inode; + pent->inode->nlink++; + } + } else { + inode = (struct extfs_inode *) xmalloc (sizeof (struct extfs_inode), "Extfs: extfs_inode"); + entry->inode = inode; + inode->local_filename = NULL; + inode->has_changed = 0; + inode->inode = (current_archive->__inode_counter)++; + inode->nlink = 1; + inode->dev = current_archive->rdev; + inode->archive = current_archive; + inode->mode = hstat.st_mode; +#ifdef HAVE_ST_RDEV + inode->rdev = hstat.st_rdev; +#else + inode->rdev = 0; +#endif + inode->uid = hstat.st_uid; + inode->gid = hstat.st_gid; + inode->size = hstat.st_size; + inode->mtime = hstat.st_mtime; + inode->atime = hstat.st_atime; + inode->ctime = hstat.st_ctime; + if (current_link_name != NULL && S_ISLNK (hstat.st_mode)) { + inode->linkname = current_link_name; + current_link_name = NULL; + } else { + if (S_ISLNK( hstat.st_mode)) + inode->mode &= ~S_IFLNK; /* You *DON'T* want to do this always */ + inode->linkname = NULL; + } + if (S_ISDIR (hstat.st_mode)) + make_dot_doubledot (entry); + } + } + read_extfs_continue: + free (current_file_name); + if (current_link_name != NULL) + free (current_link_name); + } + } + pclose (extfsd); +#ifdef SCO_FLAVOR + waitpid(-1,NULL,WNOHANG); +#endif /* SCO_FLAVOR */ + *pparc = current_archive; + free (buffer); + return 0; +} + +static char *extfs_get_path (char *inname, struct extfs_archive **archive, int is_dir, + int do_not_open); + +/* Returns path inside argument. Returned char* is inside inname, which is mangled + * by this operation (so you must not free it's return value) + */ +static char *extfs_get_path_mangle (char *inname, struct extfs_archive **archive, int is_dir, + int do_not_open) +{ + char *local, *archive_name, *op; + int result = -1; + struct extfs_archive *parc; + struct vfs_stamping *parent; + vfs *v; + int fstype; + + archive_name = inname; + vfs_split( inname, &local, &op ); + fstype = extfs_which( op ); + if (!local) + local = ""; + if (fstype == -1) + return NULL; + + /* All filesystems should have some local archive, at least + * it can be '/'. + * + * Actually, we should implement an alias mechanism that would + * translate: "a:" to "dos:a. + * + */ + for (parc = first_archive; parc != NULL; parc = parc->next) + if (parc->name) { + if (!strcmp (parc->name, archive_name)) { + vfs_stamp (&extfs_vfs_ops, (vfsid) parc); + goto return_success; + } + } + + result = do_not_open ? -1 : read_extfs_archive (fstype, archive_name, &parc); + if (result == -1) { + extfserrno = EIO; + return NULL; + } + + if (archive_name){ + v = vfs_type (archive_name); + if (v == &local_vfs_ops) { + parent = NULL; + } else { + parent = xmalloc (sizeof (struct vfs_stamping), "vfs stamping"); + parent->v = v; + parent->next = 0; + parent->id = (*v->getid) (archive_name, &(parent->parent)); + } + vfs_add_noncurrent_stamps (&extfs_vfs_ops, (vfsid) parc, parent); + vfs_rm_parents (parent); + } + return_success: + *archive = parc; + return local; +} + +/* Returns allocated path (without leading slash) inside the archive */ +static char *extfs_get_path_from_entry (struct extfs_entry *entry) +{ + struct list { + struct list *next; + char *name; + } *head, *p; + char *localpath; + size_t len; + + for (len = 0, head = 0; entry->dir; entry = entry->dir) { + p = xmalloc (sizeof (struct list), "Extfs: list"); + p->next = head; + p->name = entry->name; + head = p; + len += strlen (entry->name) + 1; + } + + localpath = xmalloc (len, "Extfs: localpath"); + *localpath = '\0'; + for ( ; head; ) { + strcat (localpath, head->name); + if (head->next) + strcat (localpath, "/"); + p = head; + head = head->next; + free (p); + } + return (localpath); +} + + +struct extfs_loop_protect { + struct extfs_entry *entry; + struct extfs_loop_protect *next; +}; +static int errloop; +static int notadir; + +static struct extfs_entry * +__extfs_find_entry (struct extfs_entry *dir, char *name, + struct extfs_loop_protect *list, int make_dirs, int make_file); + +static struct extfs_entry * +__extfs_resolve_symlinks (struct extfs_entry *entry, + struct extfs_loop_protect *list) +{ + struct extfs_entry *pent; + struct extfs_loop_protect *looping; + + if (!S_ISLNK (entry->inode->mode)) + return entry; + for (looping = list; looping != NULL; looping = looping->next) + if (entry == looping->entry) { /* Here we protect us against symlink looping */ + errloop = 1; + return NULL; + } + looping = (struct extfs_loop_protect *) + xmalloc (sizeof (struct extfs_loop_protect), + "Extfs: symlink looping protection"); + looping->entry = entry; + looping->next = list; + pent = __extfs_find_entry (entry->dir, entry->inode->linkname, looping, 0, 0); + free (looping); + if (pent == NULL) + extfserrno = ENOENT; + return pent; +} + +static struct extfs_entry *extfs_resolve_symlinks (struct extfs_entry *entry) +{ + struct extfs_entry *res; + + errloop = 0; + notadir = 0; + res = __extfs_resolve_symlinks (entry, NULL); + if (res == NULL) { + if (errloop) + extfserrno = ELOOP; + else if (notadir) + extfserrno = ENOTDIR; + } + return res; +} + +struct extfs_pseudofile { + struct extfs_archive *archive; + unsigned int has_changed:1; + int local_handle; + struct extfs_entry *entry; +}; + +static char *get_archive_name (struct extfs_archive *archive) +{ + char *archive_name; + + if (archive->local_name) + archive_name = archive->local_name; + else + archive_name = archive->name; + + if (!archive_name || !*archive_name) + return "no_archive_name"; + else + return archive_name; +} + +void extfs_run (char *file) +{ + struct extfs_archive *archive; + char *p, *q, *cmd, *archive_name; + + if ((p = extfs_get_path (file, &archive, 0, 0)) == NULL) + return; + q = name_quote (p, 0); + + archive_name = name_quote (get_archive_name(archive), 0); + cmd = copy_strings (LIBDIR "extfs/", extfs_prefixes [archive->fstype], + " run ", archive_name, " ", q, 0); + free (archive_name); + free (q); +#ifndef VFS_STANDALONE + shell_execute(cmd, 0); +#else + vfs_die( "shell_execute: implement me!" ); +#endif + free(cmd); + free(p); +} + +static void *extfs_open (char *file, int flags, int mode) +{ + struct extfs_pseudofile *extfs_info; + struct extfs_archive *archive; + char *q; + struct extfs_entry *entry; + int local_handle; + const int do_create = (flags & O_ACCMODE) != O_RDONLY; + + if ((q = extfs_get_path_mangle (file, &archive, 0, 0)) == NULL) + return NULL; + entry = extfs_find_entry (archive->root_entry, q, 0, do_create); + if (entry == NULL) + return NULL; + if ((entry = extfs_resolve_symlinks (entry)) == NULL) + return NULL; + if (S_ISDIR (entry->inode->mode)) { + extfserrno = EISDIR; + return NULL; + } + if (entry->inode->local_filename == NULL) { + char *cmd, *archive_name, *p; + + entry->inode->local_filename = strdup (tempnam (NULL, "extfs")); + p = extfs_get_path_from_entry (entry); + q = name_quote (p, 0); + free (p); + archive_name = name_quote (get_archive_name (archive), 0); + cmd = copy_strings (LIBDIR "extfs/", extfs_prefixes [archive->fstype], + " copyout ", + archive_name, + " ", q, " ", entry->inode->local_filename, 0); + free (q); + free (archive_name); + if (my_system (EXECUTE_AS_SHELL, shell, cmd) && !do_create){ + free (entry->inode->local_filename); + entry->inode->local_filename = NULL; + free (cmd); + extfserrno = EIO; + return NULL; + } + free (cmd); + } + + local_handle = open (entry->inode->local_filename, flags, mode); + if (local_handle == -1) { + extfserrno = EIO; + return NULL; + } + + extfs_info = (struct extfs_pseudofile *) xmalloc (sizeof (struct extfs_pseudofile), "Extfs: extfs_open"); + extfs_info->archive = archive; + extfs_info->entry = entry; + extfs_info->has_changed = 0; + extfs_info->local_handle = local_handle; + + /* i.e. we had no open files and now we have one */ + vfs_rmstamp (&extfs_vfs_ops, (vfsid) archive, 1); + archive->fd_usage++; + return extfs_info; +} + +static int extfs_read (void *data, char *buffer, int count) +{ + struct extfs_pseudofile *file = (struct extfs_pseudofile *)data; + + return read (file->local_handle, buffer, count); +} + +static int extfs_close (void *data) +{ + struct extfs_pseudofile *file; + int errno_code = 0; + file = (struct extfs_pseudofile *)data; + + close (file->local_handle); + + /* Commit the file if it has changed */ + if (file->has_changed){ + struct extfs_archive *archive; + char *archive_name, *file_name; + char *cmd; + char *p; + + archive = file->archive; + archive_name = name_quote (get_archive_name (archive), 0); + p = extfs_get_path_from_entry (file->entry); + file_name = name_quote (p, 0); + free (p); + + cmd = copy_strings (LIBDIR "extfs/", + extfs_prefixes [archive->fstype], + " copyin ", archive_name, " ", + file_name, " ", + file->entry->inode->local_filename, 0); + free (archive_name); + free (file_name); + if (my_system (EXECUTE_AS_SHELL, shell, cmd)) + errno_code = EIO; + free (cmd); + { + struct stat file_status; + if( stat(file->entry->inode->local_filename,&file_status) != 0 ) + errno_code = EIO; + else file->entry->inode->size = file_status.st_size; + } + + file->entry->inode->mtime = time (NULL); + } + + file->archive->fd_usage--; + if (!file->archive->fd_usage) { + struct vfs_stamping *parent; + vfs *v; + + if (!file->archive->name || !*file->archive->name || (v = vfs_type (file->archive->name)) == &local_vfs_ops) { + parent = NULL; + } else { + parent = xmalloc (sizeof (struct vfs_stamping), "vfs stamping"); + parent->v = v; + parent->next = 0; + parent->id = (*v->getid) (file->archive->name, &(parent->parent)); + } + vfs_add_noncurrent_stamps (&extfs_vfs_ops, (vfsid) (file->archive), parent); + vfs_rm_parents (parent); + } + + free (data); + if (errno_code){ + extfserrno = EIO; /* Non standard, but who cares? */ + return -1; + } else + return 0; +} + +#define RECORDSIZE 512 +#define X_pseudofile extfs_pseudofile +#define Xerrno extfserrno + +#define X_entry extfs_entry +#define X_archive extfs_archive +#define X_get_path extfs_get_path +#define X_get_path_mangle extfs_get_path_mangle +#define X_find_entry extfs_find_entry +#define X_resolve_symlinks extfs_resolve_symlinks +#define X_inode extfs_inode +#define __X_find_entry __extfs_find_entry +#define __X_resolve_symlinks __extfs_resolve_symlinks +#define X_loop_protect extfs_loop_protect + +#include "shared.c" + +static int extfs_chmod (char *path, int mode) +{ + return 0; +} + +static int extfs_chown (char *path, int owner, int group) +{ + return -1; +} + +static int extfs_unlink (char *path) +{ + return -1; +} + +static int extfs_symlink (char *n1, char *n2) +{ + return -1; +} + +static int extfs_write (void *data, char *buf, int nbyte) +{ + struct extfs_pseudofile *file = (struct extfs_pseudofile *)data; + + file->has_changed = 1; + return write (file->local_handle, buf, nbyte); +} + +static int extfs_rename (char *a, char *b) +{ + return -1; +} + +static int extfs_chdir (char *path) +{ + struct extfs_archive *archive; + char *q, *res; + struct extfs_entry *entry; + + extfserrno = ENOTDIR; + if ((q = extfs_get_path_mangle (path, &archive, 1, 0)) == NULL) + return -1; + entry = extfs_find_entry (archive->root_entry, q, 0, 0); + if (!entry) + return -1; + entry = extfs_resolve_symlinks (entry); + if ((!entry) || (!S_ISDIR (entry->inode->mode))) + return -1; + entry->inode->archive->current_dir = entry; + res = copy_strings ( + entry->inode->archive->name, "#", extfs_prefixes [entry->inode->archive->fstype], + "/", q, NULL); + extfserrno = 0; + if (extfs_current_dir) + free (extfs_current_dir); + extfs_current_dir = res; + return 0; +} + +static int extfs_lseek (void *data, off_t offset, int whence) +{ + struct extfs_pseudofile *file = (struct extfs_pseudofile *) data; + + return lseek (file->local_handle, offset, whence); +} + +static int extfs_mknod (char *path, int mode, int dev) +{ + return -1; +} + +static int extfs_link (char *p1, char *p2) +{ + return -1; +} + +static int extfs_mkdir (char *path, mode_t mode) +{ + return -1; +} + +static int extfs_rmdir (char *path) +{ + return -1; +} + +static vfsid extfs_getid (char *path, struct vfs_stamping **parent) +{ + struct extfs_archive *archive; + vfs *v; + vfsid id; + struct vfs_stamping *par; + char *p; + + *parent = NULL; + if (!(p = extfs_get_path (path, &archive, 1, 1))) + return (vfsid) -1; + free(p); + if (archive->name){ + v = vfs_type (archive->name); + id = (*v->getid) (archive->name, &par); + if (id != (vfsid)-1) { + *parent = xmalloc (sizeof (struct vfs_stamping), "vfs stamping"); + (*parent)->v = v; + (*parent)->id = id; + (*parent)->parent = par; + (*parent)->next = NULL; + } + } + return (vfsid) archive; +} + +static int extfs_nothingisopen (vfsid id) +{ + if (((struct extfs_archive *)id)->fd_usage <= 0) + return 1; + else + return 0; +} + +static void free_entry (struct extfs_entry *e) +{ + int i = --(e->inode->nlink); + if (S_ISDIR (e->inode->mode) && e->inode->first_in_subdir != NULL) { + struct extfs_entry *f = e->inode->first_in_subdir; + + e->inode->first_in_subdir = NULL; + free_entry (f); + } + if (i <= 0) { + if (e->inode->local_filename != NULL) { + unlink (e->inode->local_filename); + free (e->inode->local_filename); + } + if (e->inode->linkname != NULL) + free (e->inode->linkname); + free (e->inode); + } + if (e->next_in_dir != NULL) + free_entry (e->next_in_dir); + free (e->name); + free (e); +} + +static void extfs_free (vfsid id) +{ + struct extfs_archive *parc; + struct extfs_archive *archive = (struct extfs_archive *)id; + + free_entry (archive->root_entry); + if (archive == first_archive) { + first_archive = archive->next; + } else { + for (parc = first_archive; parc != NULL; parc = parc->next) + if (parc->next == archive) + break; + if (parc != NULL) + parc->next = archive->next; + } + free_archive (archive); +} + +static char *extfs_getlocalcopy (char *path) +{ + struct extfs_pseudofile *fp = + (struct extfs_pseudofile *) extfs_open (path, O_RDONLY, 0); + char *p; + + if (fp == NULL) + return NULL; + if (fp->entry->inode->local_filename == NULL) { + extfs_close ((void *) fp); + return NULL; + } + p = strdup (fp->entry->inode->local_filename); + fp->archive->fd_usage++; + extfs_close ((void *) fp); + return p; +} + +static void extfs_ungetlocalcopy (char *path, char *local, int has_changed) +{ + struct extfs_pseudofile *fp = + (struct extfs_pseudofile *) extfs_open (path, O_WRONLY, 0); + + if (fp == NULL) + return; + if (!strcmp (fp->entry->inode->local_filename, local)) { + fp->entry->inode->has_changed = has_changed; + fp->archive->fd_usage--; + extfs_close ((void *) fp); + return; + } else { + /* Should not happen */ + extfs_close ((void *) fp); + mc_def_ungetlocalcopy (path, local, has_changed); + } +} + +#ifdef HAVE_MMAP +caddr_t extfs_mmap (caddr_t addr, size_t len, int prot, int flags, void *data, off_t offset) +{ + return (caddr_t)-1; +} + +int extfs_munmap (caddr_t addr, size_t len, void *data) +{ + return -1; +} +#endif + +vfs extfs_vfs_ops = +{ + extfs_open, + extfs_close, + extfs_read, + extfs_write, + + s_opendir, + s_readdir, + s_closedir, + s_telldir, + s_seekdir, + + s_stat, + s_lstat, + s_fstat, + + extfs_chmod, /* unimplemented */ + extfs_chown, /* unimplemented */ + NULL, + + s_readlink, + + extfs_symlink, /* unimplemented */ + extfs_link, /* unimplemented */ + extfs_unlink, /* unimplemented */ + + extfs_rename, /* unimplemented */ + extfs_chdir, + s_errno, + extfs_lseek, + extfs_mknod, /* unimplemented */ + + extfs_getid, + extfs_nothingisopen, + extfs_free, + + extfs_getlocalcopy, + extfs_ungetlocalcopy, + + extfs_mkdir, /* unimplemented */ + extfs_rmdir, /* unimplemented */ + NULL, + NULL, + NULL + +#ifdef HAVE_MMAP + , extfs_mmap, + extfs_munmap +#endif +}; + +#include "../src/profile.h" +void extfs_init (void) +{ + FILE *cfg = fopen( LIBDIR "extfs/extfs.ini", "r" ); + if (!cfg) { + fprintf( stderr, "Warning: " LIBDIR "extfs/extfs.ini not found\n" ); + return; + } + + extfs_no = 0; + while ( extfs_no < MAXEXTFS ) { + char key[256]; + char *c; + + if (!fgets( key, 250, cfg )) + break; + + /* Handle those with a trailing ':', those flag that the + * file system does not require an archive to work + */ + + if (*key == '[') { + /* We may not use vfs_die() message or message_1s or similar, + * UI is not initialized at this time and message would not + * appear on screen. */ + fprintf( stderr, "Warning: You need to update your " LIBDIR "extfs/extfs.ini file.\n" ); + fclose(cfg); + return; + } + if (*key == '#') + continue; + + if ((c = strchr( key, '\n'))) + *c = 0; + c = &key [strlen (key)-1]; + extfs_need_archive [extfs_no] = !(*c==':'); + if (*c==':') *c = 0; + if (!(*key)) + continue; + + extfs_prefixes [extfs_no] = strdup (key); + extfs_no++; + } + fclose(cfg); +} + +int extfs_which (char *path) +{ + int i; + + for (i = 0; i < extfs_no; i++) + if (!strcmp (path, extfs_prefixes [i])) + return i; + return -1; +} + +char *extfs_get_prefix (int idx) +{ + return extfs_prefixes [idx]; +} + +void extfs_done (void) +{ + int i; + + for (i = 0; i < extfs_no; i++ ) + free (extfs_prefixes [i]); + extfs_no = 0; + if (extfs_current_dir) + free (extfs_current_dir); + extfs_current_dir = 0; +} + diff -uNr gnome-libs-0.26/libvfs/extfs.h gnome-libs-0.27/libvfs/extfs.h --- gnome-libs-0.26/libvfs/extfs.h Wed Dec 31 19:00:00 1969 +++ gnome-libs-0.27/libvfs/extfs.h Thu Jul 23 14:08:51 1998 @@ -0,0 +1,76 @@ +/* Declarations for the extfs. + + Copyright (C) 1995 The Free Software Foundation + + Written by: 1995 Jakub Jelinek + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; see the file COPYING. If not, write to +the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ + +#include + +struct extfs_inode; + +struct extfs_entry { + int has_changed; + struct extfs_entry *next_in_dir; + struct extfs_entry *dir; + char *name; + struct extfs_inode *inode; +}; + +struct extfs_archive; + +struct extfs_inode { + int has_changed; + nlink_t nlink; + struct extfs_entry *first_in_subdir; /* only used if this is a directory */ + struct extfs_entry *last_in_subdir; + ino_t inode; /* This is inode # */ + dev_t dev; /* This is an internal identification of the extfs archive */ + struct extfs_archive *archive; /* And this is an archive structure */ + dev_t rdev; + umode_t mode; + uid_t uid; + gid_t gid; + int size; + time_t mtime; + char linkflag; + char *linkname; + time_t atime; + time_t ctime; + char *local_filename; +}; + +struct extfs_archive { + int fstype; + char *name; + char *local_name; + struct stat extfsstat; + struct stat local_stat; + dev_t rdev; + int fd_usage; + ino_t __inode_counter; + struct extfs_entry *root_entry; + struct extfs_entry *current_dir; + struct extfs_archive *next; +}; + +void extfs_init (void); +void extfs_fill_names (void (*func)(char *)); +int extfs_prefix_to_type (char *path); +char *extfs_get_prefix (int fstype); +char *extfs_analysis (char *path, char **arc_name, int *fstype, int is_dir); +void extfs_run (char *path); +void extfs_done (void); diff -uNr gnome-libs-0.26/libvfs/ftpfs.c gnome-libs-0.27/libvfs/ftpfs.c --- gnome-libs-0.26/libvfs/ftpfs.c Wed Dec 31 19:00:00 1969 +++ gnome-libs-0.27/libvfs/ftpfs.c Fri Aug 7 14:46:09 1998 @@ -0,0 +1,2858 @@ +/* Virtual File System: FTP file system. + Copyright (C) 1995 The Free Software Foundation + + Written by: 1995 Ching Hui + 1995 Jakub Jelinek + 1995, 1996, 1997 Miguel de Icaza + 1997 Norbert Warmuth + 1998 Pavel Machek + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ + +/* FTPfs TODO: + +- make it more robust - all the connects etc. should handle EADDRINUSE and + ERETRY (have I spelled these names correctly?) +- make the user able to flush a connection - all the caches will get empty + etc., (tarfs as well), we should give there a user selectable timeout + and assign a key sequence. +- use hash table instead of linklist to cache ftpfs directory. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include /* For isdigit */ +#ifdef SCO_FLAVOR +# include /* alex: for struct timeb definition */ +#endif /* SCO_FLAVOR */ +#include +#include +#if defined(HAVE_UNISTD_H) +#include +#endif +#if HAVE_SYS_SELECT_H +# include +#endif +#include "../src/fs.h" +#include "../src/mad.h" +#include "../src/setup.h" +#include "../src/tty.h" /* enable/disable interrupt key */ +#include /* struct hostent */ +#include /* AF_INET */ +#include /* struct in_addr */ +#ifdef HAVE_SETSOCKOPT +# include /* IP options */ +#endif +#include +#include +#include +#ifndef SCO_FLAVOR +# include /* alex: this redefines struct timeval */ +#endif /* SCO_FLAVOR */ +#include + +#ifdef USE_TERMNET +#include +#endif + +#include "../src/mem.h" +#define WANT_PARSE_LS_LGA +#include "vfs.h" +#include "tcputil.h" +#include "../src/util.h" +#include "../src/dialog.h" +#include "container.h" +#include "ftpfs.h" +#ifndef MAXHOSTNAMELEN +# define MAXHOSTNAMELEN 64 +#endif + +#define UPLOAD_ZERO_LENGTH_FILE + +static int ftpfserrno; +static int code; + +/* Delay to retry a connection */ +int ftpfs_retry_seconds = 30; + +/* Method to use to connect to ftp sites */ +int ftpfs_use_passive_connections = 1; + +/* Use the ~/.netrc */ +int use_netrc = 1; + +extern char *home_dir; + +/* Anonymous setup */ +char *ftpfs_anonymous_passwd = 0; +int ftpfs_directory_timeout; + +/* Proxy host */ +char *ftpfs_proxy_host = 0; + +/* Reget flag */ +int do_reget = 0; + +/* wether we have to use proxy by default? */ +int ftpfs_always_use_proxy; + +/* source routing host */ +extern int source_route; + +/* If set, then log dialog between server and client */ +static int ftpfs_debug_server_dialog = 0; + +/* Where we store the transactions */ +static FILE *ftpfs_logfile; + +/* If true, the directory cache is forced to reload */ +static int force_expiration = 0; + +struct linklist *ftpfs_connections_list; + +/* command wait_flag: */ +#define NONE 0x00 +#define WAIT_REPLY 0x01 +#define WANT_STRING 0x02 +char reply_str [80]; + +static char *ftpfs_get_current_directory(struct ftpfs_connection *bucket); +static int __ftpfs_chdir (struct ftpfs_connection *bucket ,char *remote_path); + +/* Extract the hostname and username from the path */ +/* path is in the form: [user@]hostname:port/remote-dir, e.g.: + * ftp://sunsite.unc.edu/pub/linux + * ftp://miguel@sphinx.nuclecu.unam.mx/c/nc + * ftp://tsx-11.mit.edu:8192/ + * ftp://joe@foo.edu:11321/private + * If the user is empty, e.g. ftp://@roxanne/private, then your login name + * is supplied. + * */ + +char *ftpfs_get_host_and_username (char *path, char **host, char **user, int *port, char **pass) +{ + return get_host_and_username (path, host, user, port, 21, 1, pass); +} + +static int +select_on_two (int fd1, int fd2) +{ + fd_set set; + struct timeval timeout; + int v; + int maxfd = (fd1 > fd2 ? fd1 : fd2) + 1; + + timeout.tv_sec = 1; + timeout.tv_usec = 0; + FD_ZERO(&set); + FD_SET(fd1, &set); + FD_SET(fd2, &set); + v = select (maxfd, &set, 0, 0, &timeout); + if (v <= 0) + return v; + if (FD_ISSET (fd1, &set)) + return 1; + if (FD_ISSET (fd2, &set)) + return 2; + return -1; +} + +static int +get_line (int sock, char *buf, int buf_len) +{ + int i, status; + char c; + + for (i = 0; i < buf_len; i++, buf++) { + if (read(sock, buf, sizeof(char)) <= 0) + return 0; + if (ftpfs_debug_server_dialog){ + fwrite (buf, 1, 1, ftpfs_logfile); + fflush (ftpfs_logfile); + } + if (*buf == '\n') { + *buf = 0; + return 1; + } + } + *buf = 0; + while ((status = read(sock, &c, sizeof(c))) > 0){ + if (ftpfs_debug_server_dialog){ + fwrite (&c, 1, 1, ftpfs_logfile); + fflush (ftpfs_logfile); + } + if (c == '\n') + return 1; + } + return 0; +} + +/* Returns a reply code, check /usr/include/arpa/ftp.h for possible values */ +int getreply (int sock, char *string_buf, int string_len) +{ + char answer[1024]; + int i; + + for (;;) { + if (!get_line(sock, answer, sizeof(answer))) { + if (string_buf) + *string_buf = 0; + code = 421; + return 4; + } + switch(sscanf(answer, "%d", &code)) { + case 0: + if (string_buf) { + strncpy(string_buf, answer, string_len - 1); + *(string_buf + string_len - 1) = 0; + } + code = 500; + return 5; + case 1: + if (answer[3] == '-') { + while (1) { + if (!get_line(sock, answer, sizeof(answer))) { + if (string_buf) + *string_buf = 0; + code = 421; + return 4; + } + if ((sscanf(answer, "%d", &i) > 0) && + (code == i) && (answer[3] == ' ')) + break; + } + } + if (string_buf) { + strncpy(string_buf, answer, string_len - 1); + *(string_buf + string_len - 1) = 0; + } + return code / 100; + } + } +} + +static void +ftpentry_destructor (void *data) +{ + struct ftpentry *fe = data; + + fe->count--; + if ((fe->tmp_reget == 1 && fe->local_filename)){ + unlink (fe->local_filename); + fe->tmp_reget = 0; + } + + if (fe->count > 0) + return; + free(fe->name); + if (fe->linkname) + free(fe->linkname); + if (fe->local_filename) { + if (fe->local_is_temp) { + if (!fe->local_stat.st_mtime) + unlink(fe->local_filename); + else { + struct stat sb; + + if (stat (fe->local_filename, &sb) >=0 && + fe->local_stat.st_mtime == sb.st_mtime) + unlink (fe->local_filename); /* Delete only if it hasn't changed */ + } + } + free(fe->local_filename); + fe->local_filename = 0; + } + if (fe->remote_filename) + free(fe->remote_filename); + if (fe->l_stat) + free(fe->l_stat); + free(fe); +} + +static void +ftpfs_dir_destructor(void *data) +{ + struct ftpfs_dir *fd = data; + + fd->count--; + if (fd->count > 0) + return; + free(fd->remote_path); + linklist_destroy(fd->file_list, ftpentry_destructor); + free(fd); +} + +static int command (struct ftpfs_connection *bucket, int wait_reply, + char *fmt, ...) +{ + va_list ap; + char buf[2048]; /* FIXME: buffer exceed ?? */ + int n, status; + int sock = qsock (bucket); + + va_start (ap, fmt); + vsprintf (buf, fmt, ap); + va_end (ap); + n = strlen(buf); + buf[n++] = '\r'; + buf[n++] = '\n'; + buf[n] = 0; + + if (ftpfs_debug_server_dialog){ + if (strncmp (buf, "PASS ", 5) == 0) { + char *tmp = "PASS \r\n"; + fwrite (tmp, strlen (tmp), 1, ftpfs_logfile); + } else + fwrite (buf, strlen (buf), 1, ftpfs_logfile); + fflush (ftpfs_logfile); + } + got_sigpipe = 0; + enable_interrupt_key(); + status = write(sock, buf, strlen(buf)); + if (status < 0){ + code = 421; + if (errno == EPIPE){ + got_sigpipe = 1; + } + disable_interrupt_key(); + return TRANSIENT; + } + disable_interrupt_key(); + + if (wait_reply) + return getreply (sock, (wait_reply & WANT_STRING) ? reply_str : NULL, sizeof (reply_str)-1); + return COMPLETE; +} + +static void +ftpfs_connection_close (void *data) +{ + struct ftpfs_connection *bucket = data; + + if (qsock (bucket) != -1){ + print_vfs_message ("ftpfs: Disconnecting from %s", qhost(bucket)); + command(bucket, NONE, "QUIT"); + close(qsock(bucket)); + } +} + +static void +ftpfs_free_bucket (void *data) +{ + struct ftpfs_connection *bucket = data; + + free(qhost(bucket)); + free(quser(bucket)); + if (qcdir(bucket)) + free(qcdir(bucket)); + if (qhome(bucket)) + free(qhome(bucket)); + if (qupdir(bucket)) + free(qupdir(bucket)); + if (bucket->password) + wipe_password (bucket->password); + linklist_destroy(qdcache(bucket), ftpfs_dir_destructor); + free(bucket); +} + +static void +ftpfs_connection_destructor(void *data) +{ + ftpfs_connection_close (data); + ftpfs_free_bucket (data); +} + +/* some defines only used by changetype */ +/* These two are valid values for the second parameter */ +#define TYPE_ASCII 0 +#define TYPE_BINARY 1 + +/* This one is only used to initialize bucket->isbinary, don't use it as + second parameter to changetype. */ +#define TYPE_UNKNOWN -1 + +static int +changetype (struct ftpfs_connection *bucket, int binary) +{ + if (binary != bucket->isbinary) { + if (command (bucket, WAIT_REPLY, "TYPE %c", binary ? 'I' : 'A') != COMPLETE) { + ftpfserrno = EIO; + return -1; + } + bucket->isbinary = binary; + } + return binary; +} + +inline void +flush_all_directory(struct ftpfs_connection *bucket) +{ + linklist_delete_all(qdcache(bucket), ftpfs_dir_destructor); + +} + +/* This routine logs the user in */ +static int +login_server (struct ftpfs_connection *bucket, char *netrcpass) +{ +#if defined(HSC_PROXY) + char *proxypass, *proxyname; +#endif + char *pass; + char *op; + char *name; /* login user name */ + int anon = 0; + + bucket->isbinary = TYPE_UNKNOWN; + if (netrcpass) + op = strdup (netrcpass); + else { + if (!strcmp (quser(bucket), "anonymous") || + !strcmp (quser(bucket), "ftp")) { + op = strdup(ftpfs_anonymous_passwd); + anon = 1; + } else { + char *p; + + if (!bucket->password){ + p = copy_strings (" FTP: Password required for ", quser(bucket), + " ", NULL); + op = vfs_get_password (p); + free (p); + if (op == NULL) { + ftpfserrno = EPERM; + return 0; + } + bucket->password = strdup (op); + } else + op = strdup (bucket->password); + } + } + + if (!anon || ftpfs_debug_server_dialog) + pass = strdup (op); + else + pass = copy_strings ("-", op, 0); + wipe_password (op); + + + /* Proxy server accepts: username@host-we-want-to-connect*/ + if (qproxy (bucket)){ +#if defined(HSC_PROXY) + char *p, *host; + int port; + p = ftpfs_get_host_and_username(ftpfs_proxy_host, &host, &proxyname, + &port, &proxypass); + if (p) + free (p); + + free(host); + if (proxypass) + wipe_password (proxypass); + p = copy_strings(" Proxy: Password required for ", proxyname, " ", + NULL); + proxypass = vfs_get_password (p); + free(p); + if (proxypass == NULL) { + ftpfserrno = EPERM; + wipe_password (pass); + free (proxyname); + return 0; + } + name = strdup(quser (bucket)); +#else + name = copy_strings (quser(bucket), "@", + qhost(bucket)[0] == '!' ? qhost(bucket)+1 : qhost(bucket), 0); +#endif + } else + name = strdup (quser (bucket)); + + if (getreply (qsock(bucket), NULL, 0) == COMPLETE) { +#if defined(HSC_PROXY) + if (qproxy(bucket)) { + print_vfs_message("ftpfs: sending proxy login name"); + if (command (bucket, 1, "USER %s", proxyname) == CONTINUE) { + print_vfs_message("ftpfs: sending proxy user password"); + if (command (bucket, 1, "PASS %s", proxypass) == COMPLETE) + { + print_vfs_message("ftpfs: proxy authentication succeeded"); + if (command (bucket, 1, "SITE %s", qhost(bucket)+1) == + COMPLETE) { + print_vfs_message("ftpfs: connected to %s", qhost(bucket)+1); + } + else { + bucket->failed_on_login = 1; + /* ftpfserrno = E; */ + if (proxypass) + wipe_password (proxypass); + wipe_password (pass); + free (proxyname); + free (name); + return 0; + } + } + else { + bucket->failed_on_login = 1; + /* ftpfserrno = E; */ + if (proxypass) + wipe_password (proxypass); + wipe_password (pass); + free (proxyname); + free (name); + return 0; + } + } + else { + bucket->failed_on_login = 1; + /* ftpfserrno = E; */ + if (proxypass) + wipe_password (proxypass); + wipe_password (pass); + free (proxyname); + free (name); + return 0; + } + if (proxypass) + wipe_password (proxypass); + free (proxyname); + } +#endif + print_vfs_message("ftpfs: sending login name"); + code = command (bucket, WAIT_REPLY, "USER %s", name); + + switch (code){ + case CONTINUE: + print_vfs_message("ftpfs: sending user password"); + if (command (bucket, WAIT_REPLY, "PASS %s", pass) != COMPLETE) + break; + + case COMPLETE: + print_vfs_message("ftpfs: logged in"); + wipe_password (pass); + free (name); + return 1; + + default: + bucket->failed_on_login = 1; + /* ftpfserrno = E; */ + if (bucket->password) + wipe_password (bucket->password); + bucket->password = 0; + + /* This matches the end of the code below, just to make it + * obvious to the optimizer + */ + wipe_password (pass); + free (name); + return 0; + } + } + print_vfs_message ("ftpfs: Login incorrect for user %s ", quser(bucket)); + ftpfserrno = EPERM; + wipe_password (pass); + free (name); + return 0; +} + +#ifdef HAVE_SETSOCKOPT +static void +setup_source_route (int socket, int dest) +{ + char buffer [20]; + char *ptr = buffer; + + if (!source_route) + return; + bzero (buffer, sizeof (buffer)); + *ptr++ = IPOPT_LSRR; + *ptr++ = 3 + 8; + *ptr++ = 4; /* pointer */ + + /* First hop */ + bcopy ((char *) &source_route, ptr, sizeof (int)); + ptr += 4; + + /* Second hop (ie, final destination) */ + bcopy ((char *) &dest, ptr, sizeof (int)); + ptr += 4; + while ((ptr - buffer) & 3) + ptr++; + if (setsockopt (socket, IPPROTO_IP, IP_OPTIONS, + buffer, ptr - buffer) < 0) + message_2s (1, MSG_ERROR, _(" Could not set source routing (%s)"), unix_error_string (errno)); +} +#else +#define setup_source_route(x,y) +#endif + +static struct no_proxy_entry { + char *domain; + void *next; +} *no_proxy; + +static void +load_no_proxy_list () +{ + /* FixMe: shouldn't be hardcoded!!! */ + char s[258]; /* provide for 256 characters and nl */ + struct no_proxy_entry *np, *current = 0; + FILE *npf; + int c; + char *p; + static int loaded; + + if (loaded) + return; + + if (exist_file (LIBDIR "mc.no_proxy") && + (npf = fopen (LIBDIR "mc.no_proxy", "r"))) { + while (fgets (s, 258, npf) || !(feof (npf) || ferror (npf))) { + if (!(p = strchr (s, '\n'))) { /* skip bogus entries */ + while ((c = getc (npf)) != EOF && c != '\n') + ; + continue; + } + + if (p == s) + continue; + + *p = '\0'; + p = xmalloc (strlen (s), "load_no_proxy_list:1"); + np = xmalloc (sizeof (*np), "load_no_proxy_list:2"); + strcpy (p, s); + np->domain = p; + np->next = 0; + if (no_proxy) + current->next = np; + else + no_proxy = np; + current = np; + } + + fclose (npf); + loaded = 1; + } +} + +static int +ftpfs_check_proxy (char *host) +{ + struct no_proxy_entry *npe; + + if (!ftpfs_proxy_host || !*ftpfs_proxy_host || !host || !*host) + return 0; /* sanity check */ + + if (*host == '!') + return 1; + + if (!ftpfs_always_use_proxy) + return 0; + + if (!strchr (host, '.')) + return 0; + + load_no_proxy_list (); + for (npe = no_proxy; npe; npe=npe->next) { + char *domain = npe->domain; + + if (domain[0] == '.') { + int ld = strlen (domain); + int lh = strlen (host); + + while (ld && lh && host[lh - 1] == domain[ld - 1]) { + ld--; + lh--; + } + + if (!ld) + return 0; + } else + if (!strcasecmp (host, domain)) + return 0; + } + + return 1; +} + +static void +ftpfs_get_proxy_host_and_port (char *proxy, char **host, int *port) +{ + char *user, *pass, *dir; + +#if defined(HSC_PROXY) +#define HSC_DEFAULT_PORT 9875 + dir = get_host_and_username(proxy, host, &user, port, HSC_DEFAULT_PORT, 1, + &pass); +#else + dir = get_host_and_username(proxy, host, &user, port, 21, 1, + &pass); +#endif + free(user); + if (pass) + wipe_password (pass); + if (dir) + free(dir); +} + +static int +ftpfs_open_socket(struct ftpfs_connection *bucket) +{ + struct sockaddr_in server_address; + struct hostent *hp; + int my_socket; + char *host; + int port; + int free_host = 0; + + /* Use a proxy host? */ + host = qhost(bucket); + + if (!host || !*host){ + print_vfs_message ("ftpfs: Invalid host name."); + ftpfserrno = EINVAL; + return -1; + } + + /* Hosts to connect to that start with a ! should use proxy */ + if (qproxy(bucket)) { + ftpfs_get_proxy_host_and_port (ftpfs_proxy_host, &host, &port); + free_host = 1; + } + + /* Get host address */ + bzero ((char *) &server_address, sizeof (server_address)); + server_address.sin_family = AF_INET; + server_address.sin_addr.s_addr = inet_addr (host); + if (server_address.sin_addr.s_addr != -1) + server_address.sin_family = AF_INET; + else { + hp = gethostbyname(host); + if (hp == NULL){ + print_vfs_message("ftpfs: Invalid host address."); + ftpfserrno = EINVAL; + if (free_host) + free (host); + return -1; + } + server_address.sin_family = hp->h_addrtype; + + /* We copy only 4 bytes, we can not trust hp->h_length, as it comes from the DNS */ + bcopy ((char *) hp->h_addr, (char *) &server_address.sin_addr, 4); + } + +#define THE_PORT qproxy(bucket) ? port : qport (bucket) + + server_address.sin_port = htons (THE_PORT); + + /* Connect */ + if ((my_socket = socket (AF_INET, SOCK_STREAM, 0)) < 0) { + ftpfserrno = errno; + if (free_host) + free (host); + return -1; + } + setup_source_route (my_socket, server_address.sin_addr.s_addr); + + print_vfs_message("ftpfs: making connection to %s", host); + if (free_host) + free (host); + + enable_interrupt_key(); /* clear the interrupt flag */ + + if (connect (my_socket, (struct sockaddr *) &server_address, + sizeof (server_address)) < 0){ + ftpfserrno = errno; + if (errno == EINTR && got_interrupt()) + print_vfs_message("ftpfs: connection interrupted by user"); + else + print_vfs_message("ftpfs: connection to server failed: %s", + unix_error_string(errno)); + disable_interrupt_key(); + close (my_socket); + return -1; + } + disable_interrupt_key(); + return my_socket; +} + +static struct ftpfs_connection * +open_command_connection (char *host, char *user, int port, char *netrcpass) +{ + struct ftpfs_connection *bucket; + int retry_seconds, count_down; + + bucket = xmalloc(sizeof(struct ftpfs_connection), + "struct ftpfs_connection"); + + if (bucket == NULL) { + ftpfserrno = ENOMEM; + return NULL; + } +#ifdef HAVE_MAD + { + extern void *watch_free_pointer; + + if (!watch_free_pointer) + watch_free_pointer = host; + } +#endif + qhost(bucket) = strdup (host); + quser(bucket) = strdup (user); + qcdir(bucket) = NULL; + qport(bucket) = port; + qlock(bucket) = 0; + qhome(bucket) = NULL; + qproxy(bucket)= 0; + qupdir(bucket)= 0; + qdcache(bucket)=0; + bucket->__inode_counter = 0; + bucket->lock = 0; + bucket->use_proxy = ftpfs_check_proxy (host); + bucket->password = 0; + bucket->use_passive_connection = ftpfs_use_passive_connections | source_route; + bucket->use_source_route = source_route; + bucket->isbinary = TYPE_UNKNOWN; + + /* We do not want to use the passive if we are using proxies */ + if (bucket->use_proxy) + bucket->use_passive_connection = 0; + + if ((qdcache(bucket) = linklist_init()) == NULL) { + ftpfserrno = ENOMEM; + free (qhost(bucket)); + free (quser(bucket)); + free (bucket); + return NULL; + } + + retry_seconds = 0; + do { + bucket->failed_on_login = 0; + + qsock(bucket) = ftpfs_open_socket(bucket); + if (qsock(bucket) == -1) { + ftpfs_free_bucket (bucket); + return NULL; + } + + if (login_server(bucket, netrcpass)) { + /* Logged in, no need to retry the connection */ + break; + } else { + if (bucket->failed_on_login){ + /* Close only the socket descriptor */ + close (qsock (bucket)); + } else { + ftpfs_connection_destructor (bucket); + return NULL; + } + if (ftpfs_retry_seconds){ + retry_seconds = ftpfs_retry_seconds; + enable_interrupt_key (); + for (count_down = retry_seconds; count_down; count_down--){ + print_vfs_message ("Waiting to retry... %d (Control-C to cancel)\n", count_down); + sleep (1); + if (got_interrupt ()){ + /* ftpfserrno = E; */ + disable_interrupt_key (); + ftpfs_free_bucket (bucket); + return NULL; + } + } + disable_interrupt_key (); + } + } + } while (retry_seconds); + + qhome(bucket) = ftpfs_get_current_directory (bucket); + if (!qhome(bucket)) + qhome(bucket) = strdup ("/"); + qupdir(bucket) = strdup ("/"); /* FIXME: I changed behavior to ignore last_current_dir */ + return bucket; +} + +static int +is_connection_closed(struct ftpfs_connection *bucket) +{ + fd_set rset; + struct timeval t; + + if (got_sigpipe){ + return 1; + } + t.tv_sec = 0; + t.tv_usec = 0; + FD_ZERO(&rset); + FD_SET(qsock(bucket), &rset); + while (1) { + if (select(qsock(bucket) + 1, &rset, NULL, NULL, &t) < 0) + if (errno != EINTR) + return 1; + return 0; +#if 0 + if (FD_ISSET(qsock(bucket), &rset)) { + n = read(qsock(bucket), &read_ahead, sizeof(read_ahead)); + if (n <= 0) + return 1; + } else +#endif + } +} + +/* This routine keeps track of open connections */ +/* Returns a connected socket to host */ +static struct ftpfs_connection * +ftpfs_open_link (char *host, char *user, int port, char *netrcpass) +{ + int sock; + struct ftpfs_connection *bucket; + struct linklist *lptr; + + for (lptr = ftpfs_connections_list->next; + lptr != ftpfs_connections_list; lptr = lptr->next) { + bucket = lptr->data; + if ((strcmp (host, qhost(bucket)) == 0) && + (strcmp (user, quser(bucket)) == 0) && + (port == qport(bucket))) { + + /* check the connection is closed or not, just hack */ + if (is_connection_closed(bucket)) { + flush_all_directory(bucket); + sock = ftpfs_open_socket(bucket); + if (sock != -1) { + close(qsock(bucket)); + qsock(bucket) = sock; + if (login_server(bucket, netrcpass)) + return bucket; + } + + /* connection refused */ + lptr->prev->next = lptr->next; + lptr->next->prev = lptr->prev; + ftpfs_connection_destructor(bucket); + return NULL; + } + return bucket; + } + } + bucket = open_command_connection(host, user, port, netrcpass); + if (bucket == NULL) + return NULL; + if (!linklist_insert(ftpfs_connections_list, bucket)) { + ftpfserrno = ENOMEM; + ftpfs_connection_destructor(bucket); + return NULL; + } + return bucket; +} + +/* The returned directory should always contain a trailing slash */ +static char *ftpfs_get_current_directory(struct ftpfs_connection *bucket) +{ + char buf[4096], *bufp, *bufq; + + if (command(bucket, NONE, "PWD") == COMPLETE && + getreply(qsock(bucket), buf, sizeof(buf)) == COMPLETE) { + bufp = NULL; + for (bufq = buf; *bufq; bufq++) + if (*bufq == '"') { + if (!bufp) { + bufp = bufq + 1; + } else { + *bufq = 0; + if (*bufp) { + if (*(bufq - 1) != '/') { + *bufq++ = '/'; + *bufq = 0; + } + return strdup (bufp); + } else { + ftpfserrno = EIO; + return NULL; + } + } + } + } + ftpfserrno = EIO; + return NULL; +} + +void ftpfs_fill_names (void (*func)(char *)) +{ + struct linklist *lptr; + char *path_name; + struct ftpfs_connection *bucket; + + if (!ftpfs_connections_list) + return; + lptr = ftpfs_connections_list; + do { + if ((bucket = lptr->data) != 0){ + + path_name = copy_strings ("/#ftp:", quser (bucket), + "@", qhost (bucket), + qcdir(bucket), 0); + (*func)(path_name); + free (path_name); + } + lptr = lptr->next; + } while (lptr != ftpfs_connections_list); +} + + +/* Setup Passive ftp connection, we use it for source routed connections */ +static int +setup_passive (int my_socket, struct ftpfs_connection *bucket, struct sockaddr_in *sa) +{ + int xa, xb, xc, xd, xe, xf; + char n [6]; + char *c = reply_str; + + if (command (bucket, WAIT_REPLY | WANT_STRING, "PASV") != COMPLETE) + return 0; + + /* Parse remote parameters */ + for (c = reply_str + 4; (*c) && (!isdigit (*c)); c++) + ; + if (!*c) + return 0; + if (!isdigit (*c)) + return 0; + if (sscanf (c, "%d,%d,%d,%d,%d,%d", &xa, &xb, &xc, &xd, &xe, &xf) != 6) + return 0; + n [0] = (unsigned char) xa; + n [1] = (unsigned char) xb; + n [2] = (unsigned char) xc; + n [3] = (unsigned char) xd; + n [4] = (unsigned char) xe; + n [5] = (unsigned char) xf; + + bcopy ((void *)n, &(sa->sin_addr.s_addr), 4); + bcopy ((void *)&n[4], &(sa->sin_port), 2); + setup_source_route (my_socket, sa->sin_addr.s_addr); + if (connect (my_socket, (struct sockaddr *) sa, sizeof (struct sockaddr_in)) < 0) + return 0; + return 1; +} + +static int +initconn (struct ftpfs_connection *bucket) +{ + struct sockaddr_in data_addr; + int data, len = sizeof(data_addr); + struct protoent *pe; + + getsockname(qsock(bucket), (struct sockaddr *) &data_addr, &len); + data_addr.sin_port = 0; + + pe = getprotobyname("tcp"); + if (pe == NULL) { + ftpfserrno = EIO; + return -1; + } + data = socket (AF_INET, SOCK_STREAM, pe->p_proto); + if (data < 0) { + ftpfserrno = EIO; + return -1; + } + +#ifdef ORIGINAL_CONNECT_CODE + if (bucket->use_source_route){ + int c; + + if ((c = setup_passive (data, bucket, &data_addr))) + return data; + print_vfs_message("ftpfs: could not setup passive mode for source routing"); + bucket->use_source_route = 0; + } +#else + if (bucket->use_passive_connection){ + if ((bucket->use_passive_connection = setup_passive (data, bucket, &data_addr))) + return data; + + bucket->use_source_route = 0; + bucket->use_passive_connection = 0; + print_vfs_message ("ftpfs: could not setup passive mode"); + } +#endif + /* If passive setup fails, fallback to active connections */ + /* Active FTP connection */ + if (bind (data, (struct sockaddr *)&data_addr, len) < 0) + goto error_return; + getsockname(data, (struct sockaddr *) &data_addr, &len); + if (listen (data, 1) < 0) + goto error_return; + { + unsigned char *a = (unsigned char *)&data_addr.sin_addr; + unsigned char *p = (unsigned char *)&data_addr.sin_port; + + if (command (bucket, WAIT_REPLY, "PORT %d,%d,%d,%d,%d,%d", a[0], a[1], + a[2], a[3], p[0], p[1]) != COMPLETE) + goto error_return; + } + return data; +error_return: + close(data); + ftpfserrno = EIO; + return -1; +} + +static int +open_data_connection (struct ftpfs_connection *bucket, char *cmd, char *remote, + int isbinary) +{ + struct sockaddr_in from; + int s, j, data, fromlen = sizeof(from); + + if ((s = initconn (bucket)) == -1) + return -1; + if (changetype (bucket, isbinary) == -1) + return -1; + if (do_reget > 0){ + j = command (bucket, WAIT_REPLY, "REST %d", do_reget); + do_reget = 0; + if (j != CONTINUE) + return -1; + } + if (remote) + j = command (bucket, WAIT_REPLY, "%s %s", cmd, remote); + else + j = command (bucket, WAIT_REPLY, "%s", cmd); + if (j != PRELIM) { + ftpfserrno = EPERM; + return -1; + } + enable_interrupt_key(); + if (bucket->use_passive_connection) + data = s; + else { + data = accept (s, (struct sockaddr *)&from, &fromlen); + if (data < 0) { + ftpfserrno = errno; + close(s); + return -1; + } + close(s); + } + disable_interrupt_key(); + return data; +} + +/* ftpfs_get_path: + * makes BUCKET point to the connection bucket descriptor for PATH + * returns a malloced string with the pathname relative to BUCKET. + */ +static char* +ftpfs_get_path (struct ftpfs_connection **bucket, char *path) +{ + char *user, *host, *remote_path, *pass; + int port; + +#ifndef BROKEN_PATHS + if (strncmp (path, "/#ftp:", 6)) + return NULL; /* Normal: consider cd /bla/#ftp */ +#else + if (!(path = strstr (path, "/#ftp:"))) + return NULL; +#endif + path += 6; + + if (!(remote_path = ftpfs_get_host_and_username (path, &host, &user, &port, &pass))) + ftpfserrno = ENOENT; + else { + if ((*bucket = ftpfs_open_link (host, user, port, pass)) == NULL) { + free (remote_path); + remote_path = NULL; + } + } + free (host); + free (user); + if (pass) + wipe_password (pass); + + if (!remote_path) + return NULL; + + /* NOTE: Usage of tildes is deprecated, consider: + * cd /#ftp:pavel@hobit + * cd ~ + * And now: what do I want to do? Do I want to go to /home/pavel or to + * /#ftp:hobit/home/pavel? I think first has better sense... + */ + { + int f = !strcmp( remote_path, "/~" ); + if (f || !strncmp( remote_path, "/~/", 3 )) { + char *s; + s = concat_dir_and_file( qhome (*bucket), remote_path +3-f ); + free (remote_path); + remote_path = s; + } + } + return remote_path; +} + +static void +ftpfs_abort (struct ftpfs_connection *bucket, int dsock) +{ + static unsigned char ipbuf[3] = { IAC, IP, IAC }; + fd_set mask; + char buf[1024]; + + print_vfs_message("ftpfs: aborting transfer."); + if (send(qsock(bucket), ipbuf, sizeof(ipbuf), MSG_OOB) != sizeof(ipbuf)) { + print_vfs_message("ftpfs: abort error: %s", unix_error_string(errno)); + return; + } + + if (command(bucket, NONE, "%cABOR", DM) != COMPLETE){ + print_vfs_message ("ftpfs: abort failed"); + return; + } + if (dsock != -1) { + FD_ZERO(&mask); + FD_SET(dsock, &mask); + if (select(dsock + 1, &mask, NULL, NULL, NULL) > 0) + while (read(dsock, buf, sizeof(buf)) > 0); + } + if ((getreply(qsock(bucket), NULL, 0) == TRANSIENT) && (code == 426)) + getreply(qsock(bucket), NULL, 0); +} + +static void +resolve_symlink(struct ftpfs_connection *bucket, struct ftpfs_dir *dir) +{ + char buffer[2048] = "", *filename; + int sock; + FILE *fp; + struct stat s; + struct linklist *flist; + struct ftpentry *fe; + + print_vfs_message("Resolving symlink..."); + + if (strchr (dir->remote_path, ' ')) { + if (__ftpfs_chdir(bucket, dir->remote_path) != COMPLETE) { + print_vfs_message("ftpfs: CWD failed."); + return; + } + sock = open_data_connection (bucket, "LIST -lLa", ".", TYPE_ASCII); + } + else + sock = open_data_connection (bucket, "LIST -lLa", + dir->remote_path, TYPE_ASCII); + + if (sock == -1) { + print_vfs_message("ftpfs: couldn't resolve symlink"); + return; + } + + fp = fdopen(sock, "r"); + if (fp == NULL) { + close(sock); + print_vfs_message("ftpfs: couldn't resolve symlink"); + return; + } + enable_interrupt_key(); + flist = dir->file_list->next; + while (1) { + do { + if (flist == dir->file_list) + goto done; + fe = flist->data; + flist = flist->next; + } while (!S_ISLNK(fe->s.st_mode)); + while (1) { + if (fgets (buffer, sizeof (buffer), fp) == NULL) + goto done; + if (ftpfs_debug_server_dialog){ + fputs (buffer, ftpfs_logfile); + fflush (ftpfs_logfile); + } + if (parse_ls_lga (buffer, &s, &filename, NULL)) { + int r = strcmp(fe->name, filename); + free(filename); + if (r == 0) { + fe->l_stat = xmalloc(sizeof(struct stat), + "resolve_symlink: struct stat"); + if (fe->l_stat == NULL) + goto done; + *fe->l_stat = s; + (*fe->l_stat).st_ino = bucket->__inode_counter++; + break; + } + if (r < 0) + break; + } + } + } +done: + while (fgets(buffer, sizeof(buffer), fp) != NULL); + disable_interrupt_key(); + fclose(fp); + getreply(qsock(bucket), NULL, 0); +} + +static int +get_line_interruptible (char *buffer, int size, int fd) +{ + int n; + int i = 0; + + for (i = 0; i < size-1; i++) { + n = read (fd, buffer+i, 1); + if (n == -1 && errno == EINTR){ + buffer [i] = 0; + return EINTR; + } + if (n == 0){ + buffer [i] = 0; + return 0; + } + if (buffer [i] == '\n'){ + buffer [i] = 0; + return 1; + } + } + buffer [size-1] = 0; + return 0; +} + +/* Return true if path is the same directoy as the one we are on now */ +static int +ftpfs_same_dir (char *path, struct ftpfs_connection *bucket) +{ + if (!qcdir (bucket)) + return 0; + if (strcmp (path, qcdir (bucket)) == 0) + return 1; + return 0; +} + +static struct ftpfs_dir * +retrieve_dir(struct ftpfs_connection *bucket, char *remote_path) +{ +#ifdef OLD_READ + FILE *fp; +#endif + int sock, has_symlinks; + struct linklist *file_list, *p; + struct ftpentry *fe; + char buffer[8192]; + struct ftpfs_dir *dcache; + int got_intr = 0; + int has_spaces = (strchr (remote_path, ' ') != NULL); + + for (p = qdcache(bucket)->next;p != qdcache(bucket); + p = p->next) { + dcache = p->data; + if (strcmp(dcache->remote_path, remote_path) == 0) { + struct timeval tim; + + gettimeofday(&tim, NULL); + if ((tim.tv_sec < dcache->timestamp.tv_sec) && !force_expiration) + return dcache; + else { + force_expiration = 0; + p->next->prev = p->prev; + p->prev->next = p->next; + ftpfs_dir_destructor(dcache); + free (p); + break; + } + } + } + + has_symlinks = 0; + print_vfs_message("ftpfs: Reading FTP directory..."); + if (has_spaces) + if (__ftpfs_chdir(bucket, remote_path) != COMPLETE) { + ftpfserrno = ENOENT; + print_vfs_message("ftpfs: CWD failed."); + return NULL; + } + + file_list = linklist_init(); + if (file_list == NULL) { + ftpfserrno = ENOMEM; + print_vfs_message("ftpfs: couldn't get a file listing"); + return NULL; + } + dcache = xmalloc(sizeof(struct ftpfs_dir), + "struct ftpfs_dir"); + if (dcache == NULL) { + ftpfserrno = ENOMEM; + linklist_destroy(file_list, NULL); + print_vfs_message("ftpfs: FAIL"); + return NULL; + } + gettimeofday(&dcache->timestamp, NULL); + dcache->timestamp.tv_sec += ftpfs_directory_timeout; + dcache->file_list = file_list; + dcache->remote_path = strdup(remote_path); + dcache->count = 1; + + if (has_spaces) + sock = open_data_connection (bucket, "LIST -la", ".", TYPE_ASCII); + else { + char *path = copy_strings (remote_path, PATH_SEP_STR, ".", (char *) 0); + sock = open_data_connection (bucket, "LIST -la", path, TYPE_ASCII); + free (path); + } + + if (sock == -1) + goto error_3; + +#ifdef OLD_READ +#define close_this_sock(x,y) fclose (x) + fp = fdopen(sock, "r"); + if (fp == NULL) { + ftpfserrno = errno; + close(sock); + goto error_2; + } +#else +#define close_this_sock(x,y) close (y) +#endif + + /* Clear the interrupt flag */ + enable_interrupt_key (); + + errno = 0; +#ifdef OLD_READ + while (fgets (buffer, sizeof (buffer), fp) != NULL) { + if (got_intr = got_interrupt ()) + break; +#else + while ((got_intr = get_line_interruptible (buffer, sizeof (buffer), sock)) != EINTR){ +#endif + int eof = got_intr == 0; + + if (ftpfs_debug_server_dialog){ + fputs (buffer, ftpfs_logfile); + fputs ("\n", ftpfs_logfile); + fflush (ftpfs_logfile); + } + if (buffer [0] == 0 && eof) + break; + fe = xmalloc(sizeof(struct ftpentry), "struct ftpentry"); + fe->freshly_created = 0; + fe->tmp_reget = 0; + if (fe == NULL) { + ftpfserrno = ENOMEM; + goto error_1; + } + if (parse_ls_lga (buffer, &fe->s, &fe->name, &fe->linkname)) { + fe->count = 1; + fe->local_filename = fe->remote_filename = NULL; + fe->l_stat = NULL; + fe->bucket = bucket; + (fe->s).st_ino = bucket->__inode_counter++; + if (S_ISLNK(fe->s.st_mode)) + has_symlinks = 1; + + if (!linklist_insert(file_list, fe)) { + free(fe); + ftpfserrno = ENOMEM; + goto error_1; + } + } + else + free(fe); + if (eof) + break; + } + if (got_intr){ + disable_interrupt_key(); + print_vfs_message("ftpfs: reading FTP directory interrupt by user"); +#ifdef OLD_READ + ftpfs_abort(bucket, fileno(fp)); +#else + ftpfs_abort(bucket, sock); +#endif + close_this_sock(fp, sock); + ftpfserrno = EINTR; + goto error_3; + } + close_this_sock(fp, sock); + disable_interrupt_key(); + if (getreply (qsock (bucket), NULL, 0) != COMPLETE) { + ftpfserrno = EIO; + goto error_3; + } + if (file_list->next == file_list) { + ftpfserrno = EACCES; + goto error_3; + } + if (!linklist_insert(qdcache(bucket), dcache)) { + ftpfserrno = ENOMEM; + goto error_3; + } + if (has_symlinks) + resolve_symlink(bucket, dcache); + print_vfs_message("ftpfs: got listing"); + return dcache; +error_1: + disable_interrupt_key(); + close_this_sock(fp, sock); +#ifdef OLD_READ +error_2: +#endif + getreply(qsock(bucket), NULL, 0); +error_3: + free(dcache->remote_path); + free(dcache); + linklist_destroy(file_list, ftpentry_destructor); + print_vfs_message("ftpfs: failed"); + return NULL; +} + +static int +store_file(struct ftpentry *fe) +{ + int local_handle, sock, n, total; +#ifdef HAVE_STRUCT_LINGER + struct linger li; +#else + int flag_one = 1; +#endif + char buffer[8192]; + struct stat s; + + local_handle = open(fe->local_filename, O_RDONLY); + unlink (fe->local_filename); + if (local_handle == -1) { + ftpfserrno = EIO; + return 0; + } + fstat(local_handle, &s); + sock = open_data_connection(fe->bucket, "STOR", fe->remote_filename, TYPE_BINARY); + if (sock < 0) { + close(local_handle); + return 0; + } +#ifdef HAVE_STRUCT_LINGER + li.l_onoff = 1; + li.l_linger = 120; + setsockopt(sock, SOL_SOCKET, SO_LINGER, (char *) &li, sizeof(li)); +#else + setsockopt(sock, SOL_SOCKET, SO_LINGER, &flag_one, sizeof (flag_one)); +#endif + total = 0; + + enable_interrupt_key(); + while (1) { + while ((n = read(local_handle, buffer, sizeof(buffer))) < 0) { + if (errno == EINTR) { + if (got_interrupt()) { + ftpfserrno = EINTR; + goto error_return; + } + else + continue; + } + ftpfserrno = errno; + goto error_return; + } + if (n == 0) + break; + while (write(sock, buffer, n) < 0) { + if (errno == EINTR) { + if (got_interrupt()) { + ftpfserrno = EINTR; + goto error_return; + } + else + continue; + } + ftpfserrno = errno; + goto error_return; + } + total += n; + print_vfs_message("ftpfs: storing file %d (%d)", + total, s.st_size); + } + disable_interrupt_key(); + close(sock); + close(local_handle); + if (getreply (qsock (fe->bucket), NULL, 0) != COMPLETE) { + ftpfserrno = EIO; + return 0; + } + return 1; +error_return: + disable_interrupt_key(); + close(sock); + close(local_handle); + getreply(qsock(fe->bucket), NULL, 0); + return 0; +} + +/* These variables are for the _ctl routine */ +static char *localname = NULL; +static struct ftpentry *remoteent; +static int remotetotal = 0; +static int transfer_started = 0; +static char *remotebuffer; +static int isremotecopy = 0; +static int remotelocal_handle, remotesock, remoten, remotestat_size; + +int retrieve_file_start(struct ftpentry *fe) +{ + if (fe->local_filename == NULL) { + ftpfserrno = ENOMEM; + return 0; + } + remotesock = open_data_connection(fe->bucket, "RETR", fe->remote_filename, TYPE_BINARY); + if (remotesock == -1) { + ftpfserrno = EACCES; + free (fe->local_filename); + fe->local_filename = NULL; + return 0; + } + remotetotal = 0; + remoteent = fe; + return 1; +} + +int retrieve_file_start2(struct ftpentry *fe) +{ + remotelocal_handle = open(fe->local_filename, O_RDWR | O_CREAT | O_TRUNC | O_EXCL, 0600); + if (remotelocal_handle == -1) { + ftpfserrno = EIO; + free(fe->local_filename); + fe->local_filename = NULL; + fe->local_is_temp = 1; + close(remotesock); + return 0; + } + remotestat_size = fe->s.st_size; + remotebuffer = xmalloc (8192, ""); + return 1; +} + +void ftpfs_flushdir (void) +{ + force_expiration = 1; +} + +static int remove_temp_file (char *file_name); + +int ftpfs_ctl (void *data, int ctlop, int arg) +{ + int n = 0; + + switch (ctlop) { + case MCCTL_ISREMOTECOPY: + return isremotecopy; + + case MCCTL_REMOTECOPYCHUNK: + if (!transfer_started) + if (!retrieve_file_start2 (remoteent)){ + return MCERR_TARGETOPEN; + } else + transfer_started = 1; + + enable_interrupt_key (); + if (!remoten) { + int v = select_on_two (remotesock, 0); + + if (((v < 0) && (errno == EINTR)) || v == 0){ + disable_interrupt_key (); + return MCERR_DATA_ON_STDIN; + } + + if ((n = read(remotesock, remotebuffer, 8192)) < 0){ + disable_interrupt_key (); + if (errno == EINTR) + return MCERR_DATA_ON_STDIN; + else + return MCERR_READ; + } + if (n == 0) { + if (getreply (qsock (remoteent->bucket), NULL, 0) != COMPLETE) { + ftpfserrno = EIO; + } + close(remotelocal_handle); + close(remotesock); + if (localname){ + free (localname); + localname = NULL; + } + disable_interrupt_key (); + transfer_started = 0; + return MCERR_FINISH; + } + disable_interrupt_key (); + remotetotal += n; + remoten = n; + } else + n = remoten; + if (write(remotelocal_handle, remotebuffer, remoten) < 0) + return MCERR_WRITE; + remoten = 0; + return n; + + /* We get this message if the transfer was aborted */ + case MCCTL_FINISHREMOTE: + if (localname) { + free (localname); + localname = NULL; + } + if (!arg) { /* OK */ + if (stat (remoteent->local_filename, &remoteent->local_stat) < 0) + remoteent->local_stat.st_mtime = 0; + } else + remoteent->local_stat.st_mtime = 0; + transfer_started = 0; + ftpfs_abort (remoteent->bucket, remotesock); + ftpfserrno = EINTR; + return 0; + } + return 0; +} + +int ftpfs_setctl (char *path, int ctlop, char *arg) +{ + switch (ctlop) { + case MCCTL_REMOVELOCALCOPY: + return remove_temp_file (path); + + case MCCTL_SETREMOTECOPY: if (localname) free (localname); + localname = strdup (vfs_canon (arg)); + return 1; + default: + return 0; + } +} + +int retrieve_file(struct ftpentry *fe) +{ + int total, tmp_reget = do_reget; + char buffer[8192]; + int local_handle, sock, n; + + if (fe->local_filename) + return 1; + fe->local_stat.st_mtime = 0; + fe->local_filename = tempnam (NULL, "ftpfs"); + fe->local_is_temp = 1; + if (fe->local_filename == NULL) { + ftpfserrno = ENOMEM; + return 0; + } + local_handle = open(fe->local_filename, O_RDWR | O_CREAT | O_TRUNC | O_EXCL, 0600); + if (local_handle == -1) { + ftpfserrno = EIO; + free(fe->local_filename); + fe->local_filename = NULL; + return 0; + } + sock = open_data_connection(fe->bucket, "RETR", fe->remote_filename, TYPE_BINARY); + if (sock == -1) { + ftpfserrno = EACCES; + goto error_3; + } + + /* Clear the interrupt status */ + enable_interrupt_key (); + total = 0; + if (tmp_reget > 0) + total = tmp_reget; + else + total = 0; + + while (1) { + int stat_size = fe->s.st_size; + while ((n = read(sock, buffer, sizeof(buffer))) < 0) { + if (errno == EINTR) { + if (got_interrupt ()) { + disable_interrupt_key(); + ftpfs_abort(fe->bucket, sock); + ftpfserrno = EINTR; + goto error_2; + } + else + continue; + } + ftpfserrno = errno; + disable_interrupt_key(); + goto error_1; + } + if (n == 0) + break; + total += n; + if (stat_size == 0) + print_vfs_message ("ftpfs: Getting file: %ld bytes transfered", + total); + else + print_vfs_message ("ftpfs: Getting file: %3d%% (%ld bytes transfered)", + total*100/stat_size, total); + while (write(local_handle, buffer, n) < 0) { + if (errno == EINTR) { + if (got_interrupt()) { + ftpfs_abort(fe->bucket, sock); + ftpfserrno = EINTR; + goto error_2; + } + else + continue; + } + ftpfserrno = errno; + goto error_1; + } + } + close(local_handle); + close(sock); + if (getreply (qsock (fe->bucket), NULL, 0) != COMPLETE) { + ftpfserrno = EIO; + goto error_2; + } + + if (stat (fe->local_filename, &fe->local_stat) < 0) + fe->local_stat.st_mtime = 0; + + if (tmp_reget > 0) + fe->tmp_reget = 1; + + return 1; +error_1: + getreply(qsock(fe->bucket), NULL, 0); +error_2: + close(sock); +error_3: + disable_interrupt_key (); + close(local_handle); + unlink(fe->local_filename); + free(fe->local_filename); + fe->local_filename = NULL; + return 0; +} + +static struct ftpentry * +_get_file_entry(struct ftpfs_connection *bucket, char *file_name, + int op, int flags) +{ + char *p, q; + struct ftpentry *ent; + struct linklist *file_list, *lptr; + struct ftpfs_dir *dcache; + struct stat sb; + + p = strrchr(file_name, '/'); + q = *p; + *p = '\0'; + dcache = retrieve_dir(bucket, *file_name ? file_name : "/"); + if (dcache == NULL) + return NULL; + file_list = dcache->file_list; + *p++ = q; + if (!*p) + p = "."; + for (lptr = file_list->next; lptr != file_list; lptr = lptr->next) { + ent = lptr->data; + if (strcmp(p, ent->name) == 0) { + if (S_ISLNK(ent->s.st_mode) && (op & FTPFS_RESOLVE_SYMLINK)) { + if (ent->l_stat == NULL) { + ftpfserrno = ENOENT; + return NULL; + } + if (S_ISLNK(ent->l_stat->st_mode)) { + ftpfserrno = ELOOP; + return NULL; + } + } + if (ent && (op & FTPFS_OPEN)) { + mode_t fmode; + + fmode = S_ISLNK(ent->s.st_mode) + ? ent->l_stat->st_mode + : ent->s.st_mode; + if (S_ISDIR(fmode)) { + ftpfserrno = EISDIR; + return NULL; + } + if (!S_ISREG(fmode)) { + ftpfserrno = EPERM; + return NULL; + } + if ((flags & O_EXCL) && (flags & O_CREAT)) { + ftpfserrno = EEXIST; + return NULL; + } + if (ent->remote_filename == NULL) { + ent->remote_filename = strdup(file_name); + if (ent->remote_filename == NULL) { + ftpfserrno = ENOMEM; + return NULL; + } + } + if (ent->local_filename == NULL || + !ent->local_stat.st_mtime || + stat (ent->local_filename, &sb) < 0 || + sb.st_mtime != ent->local_stat.st_mtime) { + int handle; + + if (ent->local_filename){ + free (ent->local_filename); + ent->local_filename = 0; + } + if (flags & O_TRUNC) { + ent->local_filename = tempnam (NULL, "ftpfs"); + if (ent->local_filename == NULL) { + ftpfserrno = ENOMEM; + return NULL; + } + handle = open(ent->local_filename, O_CREAT | O_TRUNC | O_RDWR | O_EXCL, 0600); + if (handle < 0) { + ftpfserrno = EIO; + return NULL; + } + close(handle); + if (stat (ent->local_filename, &ent->local_stat) < 0) + ent->local_stat.st_mtime = 0; + } + else { + if (localname != NULL) { + isremotecopy = 1; + ent->local_is_temp = 0; + ent->local_stat.st_mtime = 0; + ent->local_filename = strdup (localname); + if (!retrieve_file_start (ent)) { + isremotecopy = 0; + return NULL; + } + return ent; + } + if (!retrieve_file(ent)) + return NULL; + } + } + else if (flags & O_TRUNC) { + truncate(ent->local_filename, 0); + } + } + return ent; + } + } + if ((op & FTPFS_OPEN) && (flags & O_CREAT)) { + int handle; + + ent = xmalloc(sizeof(struct ftpentry), "struct ftpentry"); + ent->freshly_created = 0; + ent->tmp_reget = 0; + if (ent == NULL) { + ftpfserrno = ENOMEM; + return NULL; + } + ent->count = 1; + ent->linkname = NULL; + ent->l_stat = NULL; + ent->bucket = bucket; + ent->name = strdup(p); + ent->remote_filename = strdup(file_name); + ent->local_filename = tempnam (NULL, "ftpfs"); + if (!ent->name && !ent->remote_filename && !ent->local_filename) { + ftpentry_destructor(ent); + ftpfserrno = ENOMEM; + return NULL; + } + handle = creat(ent->local_filename, 0700); + if (handle == -1) { + ftpfserrno = EIO; + ftpentry_destructor(ent); + return NULL; + } + fstat(handle, &ent->s); + close(handle); +#if 0 +/* This is very wrong - like this a zero length file will be always created + and usually preclude uploading anything more desirable */ +#if defined(UPLOAD_ZERO_LENGTH_FILE) + if (!store_file(ent)) { + ftpentry_destructor(ent); + return NULL; + } +#endif +#endif + if (!linklist_insert(file_list, ent)) { + ftpfserrno = ENOMEM; + ftpentry_destructor(ent); + return NULL; + } + ent->freshly_created = 1; + return ent; + } + else { + ftpfserrno = ENOENT; + return NULL; + } +} + +/* this just free's the local temp file. I don't know if the + remote file can be used after this without crashing - paul + psheer@obsidian.co.za psheer@icon.co.za */ +static int remove_temp_file (char *file_name) +{ + char *p, q; + struct ftpfs_connection *bucket; + struct ftpentry *ent; + struct linklist *file_list, *lptr; + struct ftpfs_dir *dcache; + + if (!(file_name = ftpfs_get_path (&bucket, file_name))) + return -1; + p = strrchr (file_name, '/'); + q = *p; + *p = '\0'; + dcache = retrieve_dir (bucket, *file_name ? file_name : "/"); + if (dcache == NULL) + return -1; + file_list = dcache->file_list; + *p++ = q; + if (!*p) + p = "."; + for (lptr = file_list->next; lptr != file_list; lptr = lptr->next) { + ent = lptr->data; + if (strcmp (p, ent->name) == 0) { + if (ent->local_filename) { + unlink (ent->local_filename); + free (ent->local_filename); + ent->local_filename = 0; + return 0; + } + } + } + return -1; +} + +static struct ftpentry * +get_file_entry(char *path, int op, int flags) +{ + struct ftpfs_connection *bucket; + struct ftpentry *fe; + char *remote_path; + + if (!(remote_path = ftpfs_get_path (&bucket, path))) + return NULL; + isremotecopy = 0; + fe = _get_file_entry(bucket, remote_path, op, + flags); + free(remote_path); +#if 0 + if (op & FTPFS_FREE_RESOURCE) + vfs_add_noncurrent_stamps (&ftpfs_vfs_ops, (vfsid) bucket, NULL); +#endif + return fe; +} + +#define OPT_FLUSH 1 +#define OPT_IGNORE_ERROR 2 + +static int ftpfs_normal_flush = 1; + +void ftpfs_hint_reread(int reread) +{ + if (reread) + ftpfs_normal_flush++; + else + ftpfs_normal_flush--; +} + +static int +send_ftp_command(char *filename, char *cmd, int flags) +{ + char *remote_path; + struct ftpfs_connection *bucket; + int r; + int flush_directory_cache = (flags & OPT_FLUSH) && (ftpfs_normal_flush > 0); + + if (!(remote_path = ftpfs_get_path(&bucket, filename))) + return -1; + r = command (bucket, WAIT_REPLY, cmd, remote_path); + free(remote_path); + vfs_add_noncurrent_stamps (&ftpfs_vfs_ops, (vfsid) bucket, NULL); + if (flags & OPT_IGNORE_ERROR) + r = COMPLETE; + if (r != COMPLETE) { + ftpfserrno = EPERM; + return -1; + } + if (flush_directory_cache) + flush_all_directory(bucket); + return 0; +} + +/* This routine is called as the last step in load_setup */ +void +ftpfs_init_passwd(void) +{ + struct passwd *passwd_info; + char *p, hostname[MAXHOSTNAMELEN]; + struct hostent *hp; + + ftpfs_anonymous_passwd = load_anon_passwd (); + if (ftpfs_anonymous_passwd) + return; + + if ((passwd_info = getpwuid (geteuid ())) == NULL) + p = "guest"; + else + p = passwd_info->pw_name; + gethostname(hostname, sizeof(hostname)); + hp = gethostbyname(hostname); + if (hp != NULL) + ftpfs_anonymous_passwd = copy_strings (p, "@", hp->h_name, NULL); + else + ftpfs_anonymous_passwd = copy_strings (p, "@", hostname, NULL); + endpwent (); +} + +void +ftpfs_init () +{ + ftpfs_connections_list = linklist_init(); + ftpfs_directory_timeout = FTPFS_DIRECTORY_TIMEOUT; +} + +void +ftpfs_done(void) +{ + linklist_destroy(ftpfs_connections_list, ftpfs_connection_destructor); + if (ftpfs_debug_server_dialog) + fclose (ftpfs_logfile); +} + +/* The callbacks */ + +struct ftpfs_filp { + unsigned int has_changed:1; + struct ftpentry *fe; + int local_handle; +}; + +static void *ftpfs_open (char *file, int flags, int mode) +{ + struct ftpfs_filp *fp; + struct ftpentry *fe; + + fp = xmalloc(sizeof(struct ftpfs_filp), "struct ftpfs_filp"); + if (fp == NULL) { + ftpfserrno = ENOMEM; + return NULL; + } + fe = get_file_entry(file, FTPFS_OPEN | FTPFS_RESOLVE_SYMLINK, flags); + if (fe == NULL) { + free(fp); + return NULL; + } + if (!isremotecopy) { + fp->local_handle = open(fe->local_filename, flags, mode); + if (fp->local_handle < 0) { + ftpfserrno = errno; + free(fp); + return NULL; + } + } else + fp->local_handle = -1; +#ifdef UPLOAD_ZERO_LENGTH_FILE + fp->has_changed = fe->freshly_created; +#else + fp->has_changed = 0; +#endif + fp->fe = fe; + qlock(fe->bucket)++; + fe->count++; + return fp; +} + +static int ftpfs_read (void *data, char *buffer, int count) +{ + struct ftpfs_filp *fp; + int n; + + fp = data; + n = read(fp->local_handle, buffer, count); + if (n < 0) + ftpfserrno = errno; + return n; +} + +int ftpfs_write (void *data, char *buf, int nbyte) +{ + struct ftpfs_filp *fp; + int n; + + fp = data; + n = write(fp->local_handle, buf, nbyte); + if (n < 0) + ftpfserrno = errno; + fp->has_changed = 1; + return n; +} + +static int ftpfs_close (void *data) +{ + struct ftpfs_filp *fp = data; + int result = 0; + + if (fp->has_changed) { + if (!store_file(fp->fe)) + result = -1; + if (ftpfs_normal_flush) + flush_all_directory(fp->fe->bucket); + } + if (fp->local_handle >= 0) + close(fp->local_handle); + qlock(fp->fe->bucket)--; + ftpentry_destructor(fp->fe); + free(fp); + return result; +} + +static int ftpfs_errno (void) +{ + return ftpfserrno; +} + + +/* Explanation: + * On some operating systems (Slowaris 2 for example) + * the d_name member is just a char long (nice trick that break everything), + * so we need to set up some space for the filename. + */ +struct ftpfs_dirent { + struct dirent dent; +#ifdef NEED_EXTRA_DIRENT_BUFFER + char extra_buffer [MC_MAXPATHLEN]; +#endif + struct linklist *pos; + struct ftpfs_dir *dcache; +}; + +/* Possible FIXME: what happens if one directory is opened twice ? */ + +static void *ftpfs_opendir (char *dirname) +{ + struct ftpfs_connection *bucket; + char *remote_path; + struct ftpfs_dirent *dirp; + + if (!(remote_path = ftpfs_get_path (&bucket, dirname))) + return NULL; + dirp = xmalloc(sizeof(struct ftpfs_dirent), "struct ftpfs_dirent"); + if (dirp == NULL) { + ftpfserrno = ENOMEM; + goto error_return; + } + dirp->dcache = retrieve_dir(bucket, remote_path); + if (dirp->dcache == NULL) + goto error_return; + dirp->pos = dirp->dcache->file_list->next; + free(remote_path); + dirp->dcache->count++; + return (void *)dirp; +error_return: + vfs_add_noncurrent_stamps (&ftpfs_vfs_ops, (vfsid) bucket, NULL); + free(remote_path); + free(dirp); + return NULL; +} + +static void *ftpfs_readdir (void *data) +{ + struct ftpentry *fe; + struct ftpfs_dirent *dirp = data; + + if (dirp->pos == dirp->dcache->file_list) + return NULL; + fe = dirp->pos->data; + strcpy (&(dirp->dent.d_name [0]), fe->name); +#ifndef DIRENT_LENGTH_COMPUTED + dirp->d_namlen = strlen (dirp->d_name); +#endif + dirp->pos = dirp->pos->next; + return (void *) &dirp->dent; +} + +static int ftpfs_telldir (void *data) +{ + struct ftpfs_dirent *dirp = data; + struct linklist *pos; + int i = 0; + + pos = dirp->dcache->file_list->next; + while( pos!=dirp->dcache->file_list) { + if (pos == dirp->pos) + return i; + pos = pos->next; + i++; + } + return -1; +} + +static void ftpfs_seekdir (void *data, int pos) +{ + struct ftpfs_dirent *dirp = data; + int i; + + dirp->pos = dirp->dcache->file_list->next; + for (i=0; idcache); + free(dirp); + return 0; +} + +static int ftpfs_lstat (char *path, struct stat *buf) +{ + struct ftpentry *fe; + + fe = get_file_entry(path, FTPFS_FREE_RESOURCE, 0); + if (fe) { + *buf = fe->s; + return 0; + } + else + return -1; +} + +static int ftpfs_stat (char *path, struct stat *buf) +{ + struct ftpentry *fe; + + fe = get_file_entry(path, FTPFS_RESOLVE_SYMLINK | FTPFS_FREE_RESOURCE, 0); + if (fe) { + if (!S_ISLNK(fe->s.st_mode)) + *buf = fe->s; + else + *buf = *fe->l_stat; + return 0; + } + else + return -1; +} + +int ftpfs_fstat (void *data, struct stat *buf) +{ + struct ftpfs_filp *fp = data; + + if (!S_ISLNK(fp->fe->s.st_mode)) + *buf = fp->fe->s; + else + *buf = *fp->fe->l_stat; + return 0; +} + +int ftpfs_chmod (char *path, int mode) +{ + char buf[40]; + + sprintf(buf, "SITE CHMOD %4.4o %%s", mode & 07777); + return send_ftp_command(path, buf, OPT_IGNORE_ERROR | OPT_FLUSH); +} + +int ftpfs_chown (char *path, int owner, int group) +{ +#if 0 + ftpfserrno = EPERM; + return -1; +#else +/* Everyone knows it is not possible to chown remotely, so why bother them. + If someone's root, then copy/move will always try to chown it... */ + return 0; +#endif +} + +static int ftpfs_readlink (char *path, char *buf, int size) +{ + struct ftpentry *fe; + + fe = get_file_entry(path, FTPFS_FREE_RESOURCE, 0); + if (!fe) + return -1; + if (!S_ISLNK(fe->s.st_mode)) { + ftpfserrno = EINVAL; + return -1; + } + if (fe->linkname == NULL) { + ftpfserrno = EACCES; + return -1; + } + if (strlen(fe->linkname) >= size) { + ftpfserrno = ERANGE; + return -1; + } + strncpy(buf, fe->linkname, size); + return strlen(fe->linkname); +} + +static int ftpfs_unlink (char *path) +{ + return send_ftp_command(path, "DELE %s", 1); +} + +static int ftpfs_symlink (char *n1, char *n2) +{ + ftpfserrno = EPERM; + return -1; +} + +static int ftpfs_rename (char *path1, char *path2) +{ + ftpfserrno = EPERM; + return -1; +} + +static int +__ftpfs_chdir (struct ftpfs_connection *bucket ,char *remote_path) +{ + int r; + + if (!bucket->cwd_defered && ftpfs_same_dir (remote_path, bucket)) + return COMPLETE; + + r = command (bucket, WAIT_REPLY, "CWD %s", remote_path); + if (r != COMPLETE) { + ftpfserrno = EIO; + } else { + if (qcdir(bucket)) + free(qcdir(bucket)); + qcdir(bucket) = strdup (remote_path); + bucket->cwd_defered = 0; + } + return r; +} + +static int ftpfs_chdir (char *path) +{ + char *remote_path; + struct ftpfs_connection *bucket; + + if (!(remote_path = ftpfs_get_path(&bucket, path))) + return -1; + if (qcdir(bucket)) + free(qcdir(bucket)); + qcdir(bucket) = remote_path; + bucket->cwd_defered = 1; + + vfs_add_noncurrent_stamps (&ftpfs_vfs_ops, (vfsid) bucket, NULL); + return 0; +} + +static int ftpfs_lseek (void *data, off_t offset, int whence) +{ + struct ftpfs_filp *fp = data; + + return lseek(fp->local_handle, offset, whence); +} + +static int ftpfs_mknod (char *path, int mode, int dev) +{ + ftpfserrno = EPERM; + return -1; +} + +static int ftpfs_mkdir (char *path, mode_t mode) +{ + return send_ftp_command(path, "MKD %s", 1); +} + +static int ftpfs_rmdir (char *path) +{ + return send_ftp_command(path, "RMD %s", 1); +} + +static int ftpfs_link (char *p1, char *p2) +{ + ftpfserrno = EPERM; + return -1; +} + +static vfsid ftpfs_getid (char *p, struct vfs_stamping **parent) +{ + struct ftpfs_connection *bucket; + char *remote_path; + + *parent = NULL; /* We are not enclosed in any other fs */ + + if (!(remote_path = ftpfs_get_path (&bucket, p))) + return (vfsid) -1; + else { + free(remote_path); + return (vfsid) bucket; + } +} + +static int ftpfs_nothingisopen (vfsid id) +{ + return qlock((struct ftpfs_connection *)id) == 0; +} + +static void ftpfs_free (vfsid id) +{ + struct ftpfs_connection *bucket = (struct ftpfs_connection *) id; + + ftpfs_connection_destructor(bucket); + linklist_delete(ftpfs_connections_list, bucket); +} + +static char *ftpfs_getlocalcopy (char *path) +{ + struct ftpfs_filp *fp = (struct ftpfs_filp *) ftpfs_open (path, O_RDONLY, 0); + char *p; + + if (fp == NULL) + return NULL; + if (fp->fe->local_filename == NULL) { + ftpfs_close ((void *) fp); + return NULL; + } + p = strdup (fp->fe->local_filename); + qlock(fp->fe->bucket)++; + fp->fe->count++; + ftpfs_close ((void *) fp); + return p; +} + +static void ftpfs_ungetlocalcopy (char *path, char *local, int has_changed) +{ + struct ftpfs_filp *fp = (struct ftpfs_filp *) ftpfs_open (path, O_WRONLY, 0); + + if (fp == NULL) + return; + if (!strcmp (fp->fe->local_filename, local)) { + fp->has_changed = has_changed; + qlock(fp->fe->bucket)--; + ftpentry_destructor(fp->fe); + ftpfs_close ((void *) fp); + } else { + /* Should not happen */ + ftpfs_close ((void *) fp); + mc_def_ungetlocalcopy (path, local, has_changed); + } +} + +void ftpfs_set_debug (char *file) +{ + if ((ftpfs_logfile = fopen (file, "w+")) != NULL) + ftpfs_debug_server_dialog = 1; +} + +void ftpfs_forget (char *file) +{ + struct linklist *l; + char *host, *user, *pass, *rp; + int port; + +#ifndef BROKEN_PATHS + if (strncmp (file, "/#ftp:", 6)) + return; /* Normal: consider cd /bla/#ftp */ +#else + if (!(file = strstr (file, "/#ftp:"))) + return; +#endif + + file += 6; + if (!(rp = ftpfs_get_host_and_username (file, &host, &user, &port, &pass))) { + free (host); + free (user); + if (pass) + wipe_password (pass); + return; + } + + /* we do not care about the path actually */ + free (rp); + + for (l = ftpfs_connections_list->next; l != ftpfs_connections_list; l = l->next){ + struct ftpfs_connection *bucket = l->data; + + if ((strcmp (host, qhost (bucket)) == 0) && + (strcmp (user, quser (bucket)) == 0) && + (port == qport (bucket))){ + + /* close socket: the child owns it now */ + close (bucket->sock); + bucket->sock = -1; + + /* reopen the connection */ + bucket->sock = ftpfs_open_socket (bucket); + if (bucket->sock != -1) + login_server (bucket, pass); + break; + } + } + free (host); + free (user); + if (pass) + wipe_password (pass); +} + +#ifdef HAVE_MMAP +caddr_t ftpfs_mmap (caddr_t addr, size_t len, int prot, int flags, void *data, off_t offset) +{ + return (caddr_t)-1; /* We do not mmap to far away */ +} + +int ftpfs_munmap (caddr_t addr, size_t len, void *data) +{ + return -1; +} +#endif + +vfs ftpfs_vfs_ops = { + ftpfs_open, + ftpfs_close, + ftpfs_read, + ftpfs_write, + + ftpfs_opendir, + ftpfs_readdir, + ftpfs_closedir, + ftpfs_telldir, + ftpfs_seekdir, + + ftpfs_stat, + ftpfs_lstat, + ftpfs_fstat, + + ftpfs_chmod, + ftpfs_chown, + NULL, + + ftpfs_readlink, + ftpfs_symlink, + ftpfs_link, + ftpfs_unlink, + + ftpfs_rename, + ftpfs_chdir, + ftpfs_errno, + ftpfs_lseek, + ftpfs_mknod, + + ftpfs_getid, + ftpfs_nothingisopen, + ftpfs_free, + + ftpfs_getlocalcopy, + ftpfs_ungetlocalcopy, + + ftpfs_mkdir, + ftpfs_rmdir, + ftpfs_ctl, + ftpfs_setctl, + ftpfs_forget +#ifdef HAVE_MMAP + , ftpfs_mmap, + ftpfs_munmap +#endif +}; + +#ifdef USE_NETRC +static char buffer[100]; +static char *netrc, *netrcp; + +static int netrc_next (void) +{ + char *p; + int i; + static char *keywords [] = { "default", "machine", + "login", "password", "passwd", + "account", "macdef" }; + + while (1) { + netrcp = skip_separators (netrcp); + if (*netrcp != '\n') + break; + netrcp++; + } + if (!*netrcp) + return 0; + p = buffer; + if (*netrcp == '"') { + for (;*netrcp != '"' && *netrcp; netrcp++) { + if (*netrcp == '\\') + netrcp++; + *p++ = *netrcp; + } + } else { + for (;*netrcp != '\n' && *netrcp != '\t' && *netrcp != ' ' && + *netrcp != ',' && *netrcp; netrcp++) { + if (*netrcp == '\\') + netrcp++; + *p++ = *netrcp; + } + } + *p = 0; + if (!*buffer) + return 0; + for (i = 0; i < sizeof (keywords) / sizeof (keywords [0]); i++) + if (!strcmp (keywords [i], buffer)) + break; + return i + 1; +} + +int lookup_netrc (char *host, char **login, char **pass) +{ + char *netrcname, *tmp; + char hostname[MAXHOSTNAMELEN], *domain; + int keyword; + struct stat mystat; + static int be_angry = 1; + static struct rupcache { + struct rupcache *next; + char *host; + char *login; + char *pass; + } *rup_cache = NULL, *rupp; + + for (rupp = rup_cache; rupp != NULL; rupp = rupp->next) + if (!strcmp (host, rupp->host)) { + if (rupp->login != NULL) + *login = strdup (rupp->login); + if (rupp->pass != NULL) + *pass = strdup (rupp->pass); + return 0; + } + netrcname = xmalloc (strlen (home_dir) + strlen ("/.netrc") + 1, "netrc"); + strcpy (netrcname, home_dir); + strcat (netrcname, "/.netrc"); + netrcp = netrc = load_file (netrcname); + if (netrc == NULL) { + free (netrcname); + return 0; + } + if (gethostname (hostname, sizeof (hostname)) < 0) + *hostname = 0; + if (!(domain = strchr (hostname, '.'))) + domain = ""; + + while ((keyword = netrc_next ())) { + if (keyword == 2) { + if (netrc_next () != 8) + continue; + if (strcasecmp (host, buffer) && + ((tmp = strchr (host, '.')) == NULL || + strcasecmp (tmp, domain) || + strncasecmp (host, buffer, tmp - host) || + buffer [tmp - host])) + continue; + } else if (keyword != 1) + continue; + while ((keyword = netrc_next ()) > 2) { + switch (keyword) { + case 3: + if (netrc_next ()) + if (*login == NULL) + *login = strdup (buffer); + else if (strcmp (*login, buffer)) + keyword = 20; + break; + case 4: + case 5: + if (strcmp (*login, "anonymous") && strcmp (*login, "ftp") && + stat (netrcname, &mystat) >= 0 && + (mystat.st_mode & 077)) { + if (be_angry) { + message_1s (1, MSG_ERROR, _("~/.netrc file has not correct mode.\n" + "Remove password or correct mode.")); + be_angry = 0; + } + free (netrc); + free (netrcname); + return -1; + } + if (netrc_next () && *pass == NULL) + *pass = strdup (buffer); + break; + case 6: + if (stat (netrcname, &mystat) >= 0 && + (mystat.st_mode & 077)) { + if (be_angry) { + message_1s (1, MSG_ERROR, _("~/.netrc file has not correct mode.\n" + "Remove password or correct mode.")); + be_angry = 0; + } + free (netrc); + free (netrcname); + return -1; + } + netrc_next (); + break; + case 7: + for (;;) { + while (*netrcp != '\n' && *netrcp); + if (*netrcp != '\n') + break; + netrcp++; + if (*netrcp == '\n' || !*netrcp) + break; + } + break; + } + if (keyword == 20) + break; + } + if (keyword == 20) + continue; + else + break; + } + rupp = (struct rupcache *) xmalloc (sizeof (struct rupcache), ""); + rupp->host = strdup (host); + rupp->login = rupp->pass = 0; + + if (*login != NULL) + rupp->login = strdup (*login); + if (*pass != NULL) + rupp->pass = strdup (*pass); + rupp->next = rup_cache; + rup_cache = rupp; + + free (netrc); + free (netrcname); + return 0; +} + +#ifndef HAVE_STRNCASECMP +int strncasecmp (char *s, char *d, int l) +{ + int result; + + while (l--){ + if (result = (0x20 | *s) - (0x20 | *d)) + break; + if (!*s) + return 0; + s++; + d++; + } +} +#endif +#endif /* USE_NETRC */ diff -uNr gnome-libs-0.26/libvfs/ftpfs.h gnome-libs-0.27/libvfs/ftpfs.h --- gnome-libs-0.26/libvfs/ftpfs.h Wed Dec 31 19:00:00 1969 +++ gnome-libs-0.27/libvfs/ftpfs.h Thu Jul 23 14:08:51 1998 @@ -0,0 +1,76 @@ +/* ftpfs.h */ + +#if !defined(__FTPFS_H) +#define __FTPFS_H + +struct ftpentry +{ + char *name; + int count; + char *linkname; + char *local_filename; + int local_is_temp:1; + int freshly_created:1; + int tmp_reget; + struct stat local_stat; + char *remote_filename; + struct stat s; + struct stat *l_stat; + struct ftpfs_connection *bucket; +}; + +struct ftpfs_dir +{ + int count; + struct timeval timestamp; + char *remote_path; + struct linklist *file_list; +}; + +struct ftpfs_connection { + char *host; + char *user; + char *current_directory; + char *home; + char *updir; + char *password; + int port; + int sock; + struct linklist *dcache; + ino_t __inode_counter; + int lock; + int failed_on_login; /* used to pass the failure reason to upper levels */ + int use_proxy; /* use a proxy server */ + int result_pending; + int use_source_route; + int use_passive_connection; + int isbinary; + int cwd_defered; /* current_directory was changed but CWD command hasn't + been sent yet */ +}; + +#define qhost(b) (b)->host +#define quser(b) (b)->user +#define qcdir(b) (b)->current_directory +#define qport(b) (b)->port +#define qsock(b) (b)->sock +#define qlock(b) (b)->lock +#define qdcache(b) (b)->dcache +#define qhome(b) (b)->home +#define qupdir(b) (b)->updir +#define qproxy(b) (b)->use_proxy + +/* Increased since now we may use C-r to reread the contents */ +#define FTPFS_DIRECTORY_TIMEOUT 30 * 60 + +#define FTPFS_RESOLVE_SYMLINK 1 +#define FTPFS_OPEN 2 +#define FTPFS_FREE_RESOURCE 4 + +extern char *ftpfs_anonymous_passwd; +extern char *ftpfs_proxy_host; +extern int ftpfs_directory_timeout; +extern int ftpfs_always_use_proxy; + +void ftpfs_init_passwd (); +#endif diff -uNr gnome-libs-0.26/libvfs/libvfs.c gnome-libs-0.27/libvfs/libvfs.c --- gnome-libs-0.26/libvfs/libvfs.c Wed Dec 31 19:00:00 1969 +++ gnome-libs-0.27/libvfs/libvfs.c Thu Jul 23 14:08:51 1998 @@ -0,0 +1,24 @@ +/* + * These are functions that miss from vfs.c to make it complete library + */ + +#include +#include +#include +#include + +void vfs_init( void ); +void ftpfs_init_passwd( void ); + +void +mc_vfs_init( void ) +{ +vfs_init(); +ftpfs_init_passwd(); +} + +void +mc_vfs_done( void ) +{ +vfs_shut(); +} diff -uNr gnome-libs-0.26/libvfs/local.c gnome-libs-0.27/libvfs/local.c --- gnome-libs-0.26/libvfs/local.c Wed Dec 31 19:00:00 1969 +++ gnome-libs-0.27/libvfs/local.c Thu Jul 23 14:08:51 1998 @@ -0,0 +1,301 @@ +#include +#include +#include +#include +#include +#include +#include +#include "../src/mad.h" +#include "../src/fs.h" + +#include +#include "../src/util.h" + +#include "vfs.h" + + +static void *local_open (char *file, int flags, int mode) +{ + int *local_info; + int fd; + + fd = open (file, flags, mode); + if (fd == -1) + return 0; + + local_info = (int *) xmalloc (sizeof (int), "Local fs"); + *local_info = fd; + + return local_info; +} + +static int local_read (void *data, char *buffer, int count) +{ + int n; + + if (!data) + return -1; + + while ((n = read (*((int *) data), buffer, count)) == -1){ +#ifdef EAGAIN + if (errno == EAGAIN) continue; +#endif +#ifdef EINTR + if (errno == EINTR) continue; +#endif + return -1; + } + return n; +} + +static int local_close (void *data) +{ + int fd; + + if (!data) + return -1; + + fd = *(int *) data; + free (data); + return close (fd); +} + +static int local_errno (void) +{ + return errno; +} + +static void *local_opendir (char *dirname) +{ + DIR **local_info; + DIR *dir; + + dir = opendir (dirname); + if (!dir) + return 0; + + local_info = (DIR **) xmalloc (sizeof (DIR *), "Local fs"); + *local_info = dir; + + return local_info; +} + +static int local_telldir (void *data) +{ + return telldir( *(DIR **) data ); +} + +static void local_seekdir (void *data, int offset) +{ + seekdir( *(DIR **) data, offset ); +} + +static void *local_readdir (void *data) +{ + return readdir (*(DIR **) data); +} + +static int local_closedir (void *data) +{ + int i; + + i = closedir (* (DIR **) data); + if (data) + free (data); + return i; +} + +static int local_stat (char *path, struct stat *buf) +{ + return stat (path, buf); +} + +static int local_lstat (char *path, struct stat *buf) +{ +#ifndef HAVE_STATLSTAT + return lstat (path,buf); +#else + return statlstat (path, buf); +#endif +} + +static int local_fstat (void *data, struct stat *buf) +{ + return fstat (*((int *) data), buf); +} + +static int local_chmod (char *path, int mode) +{ + return chmod (path, mode); +} + +static int local_chown (char *path, int owner, int group) +{ + return chown (path, owner, group); +} + +static int local_utime (char *path, struct utimbuf *times) +{ + return utime (path, times); +} + +static int local_readlink (char *path, char *buf, int size) +{ + return readlink (path, buf, size); +} + +static int local_unlink (char *path) +{ + return unlink (path); +} + +static int local_symlink (char *n1, char *n2) +{ + return symlink (n1, n2); +} + +static int local_write (void *data, char *buf, int nbyte) +{ + int fd; + int n; + + if (!data) + return -1; + + fd = * (int *) data; + while ((n = write (fd, buf, nbyte)) == -1){ +#ifdef EAGAIN + if (errno == EAGAIN) continue; +#endif +#ifdef EINTR + if (errno == EINTR) continue; +#endif + break; + } + return n; +} + +static int local_rename (char *a, char *b) +{ + return rename (a, b); +} + +static int local_chdir (char *path) +{ + return chdir (path); +} + +static int local_lseek (void *data, off_t offset, int whence) +{ + int fd = * (int *) data; + + return lseek (fd, offset, whence); +} + +static int local_mknod (char *path, int mode, int dev) +{ + return mknod (path, mode, dev); +} + +static int local_link (char *p1, char *p2) +{ + return link (p1, p2); +} + +static int local_mkdir (char *path, mode_t mode) +{ + return mkdir (path, mode); +} + +static int local_rmdir (char *path) +{ + return rmdir (path); +} + +static vfsid local_getid (char *path, struct vfs_stamping **parent) +{ + *parent = NULL; + return (vfsid) -1; /* We do not free local fs stuff at all */ +} + +static int local_nothingisopen (vfsid id) +{ + return 0; +} + +static void local_free (vfsid id) +{ +} + +static char *local_getlocalcopy (char *path) +{ + return strdup (path); +} + +static void local_ungetlocalcopy (char *path, char *local, int has_changed) +{ +} + +#ifdef HAVE_MMAP +static caddr_t local_mmap (caddr_t addr, size_t len, int prot, int flags, void *data, off_t offset) +{ + int fd = * (int *)data; + + return mmap (addr, len, prot, flags, fd, offset); +} + +static int local_munmap (caddr_t addr, size_t len, void *data) +{ + return munmap (addr, len); +} +#endif + +vfs local_vfs_ops = { + local_open, + local_close, + local_read, + local_write, + + local_opendir, + local_readdir, + local_closedir, + local_telldir, + local_seekdir, + + local_stat, + local_lstat, + local_fstat, + + local_chmod, + local_chown, + local_utime, + + local_readlink, + local_symlink, + local_link, + local_unlink, + + local_rename, + local_chdir, + local_errno, + local_lseek, + local_mknod, + + local_getid, + local_nothingisopen, + local_free, + + local_getlocalcopy, + local_ungetlocalcopy, + + local_mkdir, + local_rmdir, + + NULL, + NULL, + NULL +#ifdef HAVE_MMAP + ,local_mmap, + local_munmap +#endif +}; diff -uNr gnome-libs-0.26/libvfs/mcfs.c gnome-libs-0.27/libvfs/mcfs.c --- gnome-libs-0.26/libvfs/mcfs.c Wed Dec 31 19:00:00 1969 +++ gnome-libs-0.27/libvfs/mcfs.c Thu Jul 23 14:08:51 1998 @@ -0,0 +1,1138 @@ +/* Virtual File System: Midnight Commander file system. + + Copyright (C) 1995, 1996, 1997 The Free Software Foundation + + Written by Miguel de Icaza + Andrej Borsenkow + Norbert Warmuth + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "../src/fs.h" +#include "../src/mad.h" +#include /* struct hostent */ +#include /* AF_INET */ +#include /* struct in_addr */ +#include +#ifdef SCO_FLAVOR +#include /* alex: for struct timeb definition */ +#endif /* SCO_FLAVOR */ +#include + +#ifdef USE_TERMNET +#include +#endif + +#include "../src/mem.h" +#include "vfs.h" +#include "mcfs.h" +#include "tcputil.h" +#include "../src/util.h" +#include "../src/dialog.h" + +#define MCFS_MAX_CONNECTIONS 32 +#define mcserver_port 9876 + +static mcfs_open_connections = 0; +struct _mcfs_connection { + char *host; + char *user; + char *home; + int sock; + int port; + int version; +} mcfs_connections [MCFS_MAX_CONNECTIONS]; + +typedef struct _mcfs_connection mcfs_connection; + +typedef struct { int handle; mcfs_connection *conn; } mcfs_handle; + +static int mcfs_errno_var; +static mcfs_connection *current_dir_connection; + +char *mcfs_current_dir = 0; + +static char *mcfs_gethome (mcfs_connection *mc); + +/* Extract the hostname and username from the path */ +/* path is in the form: hostname:user/remote-dir */ +char *mcfs_get_host_and_username (char *path, char **host, char **user, + int *port, char **pass) +{ + return get_host_and_username (path, host, user, port, 0, 0, pass); +} + +void mcfs_fill_names (void (*func)(char *)) +{ + int i; + char *name; + + for (i = 0; i < MCFS_MAX_CONNECTIONS; i++){ + if (mcfs_connections [i].host == 0) + continue; + name = copy_strings ("/#mc:", mcfs_connections [i].user, + "@", mcfs_connections [i].host, 0); + (*func) (name); + free (name); + } +} + +void mcfs_free_bucket (int bucket) +{ + free (mcfs_connections [bucket].host); + free (mcfs_connections [bucket].user); + free (mcfs_connections [bucket].home); + + /* Set all the fields to zero */ + mcfs_connections [bucket].host = + mcfs_connections [bucket].user = + mcfs_connections [bucket].home = 0; + mcfs_connections [bucket].sock = + mcfs_connections [bucket].version = 0; +} + +/* FIXME: This part should go to another c module, perhaps tcp.c */ +int mcfs_invalidate_socket (int); + +void tcp_invalidate_socket (int sock) +{ + mcfs_invalidate_socket (sock); +} +/* FIXME end: 'cause it is used not only by mcfs */ + +int mcfs_invalidate_socket (int sock) +{ + int i, j = -1; + extern int mc_chdir (char *); + + for (i = 0; i < MCFS_MAX_CONNECTIONS; i++) + if (mcfs_connections [i].sock == sock) { + mcfs_free_bucket (i); + j = 0; + } + + if (j == -1) + return -1; /* It was not our sock */ + /* Break from any possible loop */ + mc_chdir ("/"); + return 0; +} + +/* This routine checks the server RPC version and logs the user in */ +static int mcfs_login_server (int my_socket, char *user, int port, + int port_autodetected, char *netrcpass, + int *version) +{ + int result; + char *pass; + + /* Send the version number */ + rpc_send (my_socket, RPC_INT, *version, RPC_END); + if (0 == rpc_get (my_socket, RPC_INT, &result, RPC_END)) + return 0; + + if (result != MC_VERSION_OK){ + message_1s (1, _(" MCFS "), _(" The server does not support this version ")); + close (my_socket); + return 0; + } + + /* FIXME: figure out why last_current_dir used to be passed here */ + rpc_send (my_socket, RPC_INT, MC_LOGIN, RPC_STRING, "/", + RPC_STRING, user, RPC_END); + + if (0 == rpc_get (my_socket, RPC_INT, &result, RPC_END)) + return 0; + + if (result == MC_NEED_PASSWORD){ + if (port > 1024 && port_autodetected){ + int v; +#ifndef VFS_STANDALONE + v = query_dialog (_(" Warning "), + _(" The remote server is not running on a system port \n" + " you need a password to log in, but the information may \n" + " not be safe on the remote side. Continue? \n"), 3, 2, + _(" Yes "), _(" No ")); +#else + message_1s( 1, " MCFS ", _(" The remote server is running on strange port. Giving up.\n")); + v = 1; +#endif + + if (v == 1){ + close (my_socket); + return 0; + } + } + if (netrcpass != NULL) + pass = strdup (netrcpass); + else + pass = vfs_get_password (_(" MCFS Password required ")); + if (!pass){ + rpc_send (my_socket, RPC_INT, MC_QUIT, RPC_END); + close (my_socket); + return 0; + } + rpc_send (my_socket, RPC_INT, MC_PASS, RPC_STRING, pass, RPC_END); + + wipe_password (pass); + + if (0 == rpc_get (my_socket, RPC_INT, &result, RPC_END)) + return 0; + + if (result != MC_LOGINOK){ + message_1s (1, " MCFS ", _(" Invalid password ")); + rpc_send (my_socket, RPC_INT, MC_QUIT, RPC_END); + close (my_socket); + return 0; + } + } + return my_socket; +} + +static int mcfs_open_tcp_link (char *host, char *user, + int *port, char *netrcpass, int *version) +{ + int my_socket; + int old_port = *port; + + my_socket = open_tcp_link (host, port, version, " MCfs "); + if (my_socket <= 0) + return 0; + + /* We got the connection to the server, verify if the server + implements our version of the RPC mechanism and then login + the user. + */ + return mcfs_login_server (my_socket, user, *port, old_port == 0, + netrcpass, version); +} + +static int mcfs_get_free_bucket_init = 1; +static mcfs_connection *mcfs_get_free_bucket () +{ + int i; + + if (mcfs_get_free_bucket_init) { + mcfs_get_free_bucket_init = 0; + for (i = 0; i < MCFS_MAX_CONNECTIONS; i++) + mcfs_connections [i].host = 0; + } + for (i = 0; i < MCFS_MAX_CONNECTIONS; i++){ + if (!mcfs_connections [i].host) + return &mcfs_connections [i]; + } + /* This can't happend, since we have checked for max connections before */ + vfs_die("Internal error: mcfs_get_free_bucket"); + return 0; /* shut up, stupid gcc */ +} + +/* This routine keeps track of open connections */ +/* Returns a connected socket to host */ +static mcfs_connection *mcfs_open_link (char *host, char *user, int *port, char *netrcpass) +{ + int i, sock, version; + mcfs_connection *bucket; + + /* Is the link actually open? */ + if (mcfs_get_free_bucket_init) { + mcfs_get_free_bucket_init = 0; + for (i = 0; i < MCFS_MAX_CONNECTIONS; i++) + mcfs_connections [i].host = 0; + } else for (i = 0; i < MCFS_MAX_CONNECTIONS; i++){ + if (!mcfs_connections [i].host) + continue; + if ((strcmp (host, mcfs_connections [i].host) == 0) && + (strcmp (user, mcfs_connections [i].user) == 0)) + return &mcfs_connections [i]; + } + if (mcfs_open_connections == MCFS_MAX_CONNECTIONS){ + message_1s (1, MSG_ERROR, _(" Too many open connections ")); + return 0; + } + + if (!(sock = mcfs_open_tcp_link (host, user, port, netrcpass, &version))) + return 0; + + bucket = mcfs_get_free_bucket (); + mcfs_open_connections++; + bucket->host = strdup (host); + bucket->user = strdup (user); + bucket->home = 0; + bucket->port = *port; + bucket->sock = sock; + bucket->version = version; + + return bucket; +} + +static int is_error (int result, int errno_num) +{ + if (!(result == -1)) + return mcfs_errno_var = 0; + else + mcfs_errno_var = errno_num; + return 1; +} + +static int the_error (int result, int errno_num) +{ + if (result == -1) + mcfs_errno_var = errno_num; + else + mcfs_errno_var = 0; + return result; +} + +static char *mcfs_get_path (mcfs_connection **mc, char *path) +{ + char *user, *host, *remote_path; + char *pass; + int port; + + /* An absolute path name, try to determine connection socket */ + if (strncmp (path, "/#mc:", 5)) { + vfs_die( "Mcfs: this should not happen.\n" ); + /* We used to *mc = current_dir_connection; return strdup (path); */ + } + path += 5; + + /* Port = 0 means that open_tcp_link will try to contact the + * remote portmapper to get the port number + */ + port = 0; + if ((remote_path = mcfs_get_host_and_username(path, &host, &user, &port, &pass))) + if (!(*mc = mcfs_open_link (host, user, &port, pass))){ + free (remote_path); + remote_path = NULL; + } + free (host); + free (user); + if (pass) + wipe_password (pass); + + if (!remote_path) + return NULL; + + /* NOTE: tildes are deprecated. See ftpfs.c */ + { + int f = !strcmp( remote_path, "/~" ); + if (f || !strncmp( remote_path, "/~/", 3 )) { + char *s; + s = concat_dir_and_file( mcfs_gethome (*mc), remote_path +3-f ); + free (remote_path); + remote_path = s; + } + } + return remote_path; +} + +/* Simple function for routines returning only an integer from the server */ +static int mcfs_handle_simple_error (int sock, int return_status) +{ + int status, error; + + if (0 == rpc_get (sock, RPC_INT, &status, RPC_INT, &error, RPC_END)) + return the_error (-1, EIO); + + if (is_error (status, error)) + return -1; + if (return_status) + return status; + return 0; +} + +/* Nice wrappers */ +static int mcfs_rpc_two_paths (int command, char *s1, char *s2) +{ + mcfs_connection *mc; + char *r1, *r2; + + if ((r1 = mcfs_get_path (&mc, s1)) == 0) + return -1; + + if ((r2 = mcfs_get_path (&mc, s2)) == 0){ + free (r1); + return -1; + } + + rpc_send (mc->sock, + RPC_INT, command, + RPC_STRING, r1, + RPC_STRING, r2, + RPC_END); + free (r1); + free (r2); + return mcfs_handle_simple_error (mc->sock, 0); +} + +static int mcfs_rpc_path (int command, char *path) +{ + mcfs_connection *mc; + char *remote_file; + + if ((remote_file = mcfs_get_path (&mc, path)) == 0) + return -1; + + rpc_send (mc->sock, + RPC_INT, command, + RPC_STRING, remote_file, + RPC_END); + + free (remote_file); + return mcfs_handle_simple_error (mc->sock, 0); +} + +static int mcfs_rpc_path_int (int command, char *path, int data) +{ + mcfs_connection *mc; + char *remote_file; + + if ((remote_file = mcfs_get_path (&mc, path)) == 0) + return -1; + + rpc_send (mc->sock, + RPC_INT, command, + RPC_STRING, remote_file, + RPC_INT, data, RPC_END); + + free (remote_file); + return mcfs_handle_simple_error (mc->sock, 0); +} + +static int mcfs_rpc_path_int_int (int command, char *path, int n1, int n2) +{ + mcfs_connection *mc; + char *remote_file; + + if ((remote_file = mcfs_get_path (&mc, path)) == 0) + return -1; + + rpc_send (mc->sock, + RPC_INT, command, + RPC_STRING, remote_file, + RPC_INT, n1, + RPC_INT, n2, + RPC_END); + + free (remote_file); + return mcfs_handle_simple_error (mc->sock, 0); +} + +static char *mcfs_gethome (mcfs_connection *mc) +{ + char *buffer; + + if (mc->home) + return strdup (mc->home); + else { + rpc_send (mc->sock, RPC_INT, MC_GETHOME, RPC_END); + if (0 == rpc_get (mc->sock, RPC_STRING, &buffer, RPC_END)) + return strdup ("/"); + mc->home = buffer; + return strdup (buffer); + } +} + +/* The callbacks */ +static void *mcfs_open (char *file, int flags, int mode) +{ + char *remote_file; + mcfs_connection *mc; + int result, error_num; + mcfs_handle *remote_handle; + + if (!(remote_file = mcfs_get_path (&mc, file))) + return 0; + + rpc_send (mc->sock, RPC_INT, MC_OPEN, RPC_STRING, remote_file, + RPC_INT, flags, RPC_INT, mode, RPC_END); + free (remote_file); + + if (0 == rpc_get (mc->sock, RPC_INT, &result, RPC_INT, &error_num, RPC_END)) + return 0; + + if (is_error (result, error_num)) + return 0; + + remote_handle = (mcfs_handle *) xmalloc (2 * sizeof (mcfs_handle), "mcfs_handle"); + remote_handle->handle = result; + remote_handle->conn = mc; + + return remote_handle; +} + +static int mcfs_read (void *data, char *buffer, int count) +{ + mcfs_handle *info = (mcfs_handle *) data; + int result, error; + int handle; + mcfs_connection *mc; + + mc = info->conn; + handle = info->handle; + + rpc_send (mc->sock, RPC_INT, MC_READ, RPC_INT, handle, + RPC_INT, count, RPC_END); + + if (0 == rpc_get (mc->sock, RPC_INT, &result, RPC_INT, &error, RPC_END)) + return the_error (-1, EIO); + + if (is_error (result, error)) + return 0; + + if (0 == rpc_get (mc->sock, RPC_BLOCK, result, buffer, RPC_END)) + return the_error (-1, EIO); + + return result; +} + +int mcfs_write (void *data, char *buf, int nbyte) +{ + mcfs_handle *info = (mcfs_handle *) data; + mcfs_connection *mc; + int handle; + + mc = info->conn; + handle = info->handle; + + rpc_send (mc->sock, + RPC_INT, MC_WRITE, + RPC_INT, handle, + RPC_INT, nbyte, + RPC_BLOCK, nbyte, buf, + RPC_END); + + return mcfs_handle_simple_error (mc->sock, 1); +} + +static int mcfs_close (void *data) +{ + mcfs_handle *info = (mcfs_handle *) data; + mcfs_connection *mc; + int handle, result, error; + + if (!data) + return -1; + + handle = info->handle; + mc = info->conn; + + rpc_send (mc->sock, RPC_INT, MC_CLOSE, RPC_INT, handle, RPC_END); + + if (0 == rpc_get (mc->sock, RPC_INT, &result, RPC_INT, &error, RPC_END)) + return the_error (-1, EIO); + + is_error (result, error); + + free (data); + return result; +} + +static int mcfs_errno (void) +{ + return mcfs_errno_var; +} + +typedef struct dir_entry { + char *text; + struct dir_entry *next; + struct stat my_stat; + int merrno; +} dir_entry; + +typedef struct { + mcfs_connection *conn; + int handle; + dir_entry *entries; + dir_entry *current; +} opendir_info; + +static void *mcfs_opendir (char *dirname) +{ + opendir_info *mcfs_info; + mcfs_connection *mc; + int handle, error_num; + char *remote_dir; + int result; + + if (!(remote_dir = mcfs_get_path (&mc, dirname))) + return 0; + + rpc_send (mc->sock, RPC_INT, MC_OPENDIR, RPC_STRING, remote_dir, RPC_END); + free (remote_dir); + + if (0 == rpc_get (mc->sock, RPC_INT, &result, RPC_INT, &error_num, RPC_END)) + return 0; + + if (is_error (result, error_num)) + return 0; + + handle = result; + + mcfs_info = (opendir_info *) xmalloc (sizeof(opendir_info),"mcfs_opendir"); + mcfs_info->conn = mc; + mcfs_info->handle = handle; + mcfs_info->entries = 0; + mcfs_info->current = 0; + + return mcfs_info; +} + +static int get_stat_info (mcfs_connection *mc, struct stat *buf); + +static int mcfs_loaddir (opendir_info *mcfs_info) +{ + int status, error; + mcfs_connection *mc = mcfs_info->conn; + int link = mc->sock; + int first = 1; + + rpc_send (link, RPC_INT, MC_READDIR, RPC_INT, mcfs_info->handle, RPC_END); + + for (;;){ + int entry_len; + dir_entry *new_entry; + + if (!rpc_get (link, RPC_INT, &entry_len, RPC_END)) + return 0; + + if (entry_len == 0) + break; + + new_entry = xmalloc (sizeof (dir_entry), "mcfs_loaddir"); + new_entry->text = xmalloc (entry_len + 1, "mcfs_loaddir"); + new_entry->text [entry_len] = 0; + + new_entry->next = 0; + if (first){ + mcfs_info->entries = new_entry; + mcfs_info->current = new_entry; + first = 0; + } else { + mcfs_info->current->next = new_entry; + mcfs_info->current = new_entry; + } + + if (!rpc_get (link, RPC_BLOCK, entry_len, new_entry->text, RPC_END)) + return 0; + + /* Then we get the status from the lstat */ + if (!rpc_get (link, RPC_INT, &status, RPC_INT, &error, RPC_END)) + return 0; + + if (is_error (status, error)) + new_entry->merrno = error; + else { + new_entry->merrno = 0; + if (!get_stat_info (mc, &(new_entry->my_stat))) + return 0; + } + } + mcfs_info->current = mcfs_info->entries; + + return 1; +} + +void mcfs_free_dir (dir_entry *de) +{ + if (!de) + return; + mcfs_free_dir (de->next); + free (de->text); + free (de); +} + +/* Explanation: + * On some operating systems (Slowaris 2 for example) + * the d_name member is just a char long (Nice trick that break everything, + * so we need to set up some space for the filename. + */ +static struct { + struct dirent dent; +#ifdef NEED_EXTRA_DIRENT_BUFFER + char extra_buffer [MC_MAXPATHLEN]; +#endif +} mcfs_readdir_data; + +/* The readdir routine loads the complete directory */ +/* It's too slow to ask the server each time */ +/* It now also sends the complete lstat information for each file */ +static struct stat *cached_lstat_info; +static void *mcfs_readdir (void *info) +{ + opendir_info *mcfs_info; + char *dirent_dest; + + mcfs_info = (opendir_info *) info; + + if (!mcfs_info->entries) + if (!mcfs_loaddir (mcfs_info)) + return NULL; + + if (mcfs_info->current == 0){ + cached_lstat_info = 0; + mcfs_free_dir (mcfs_info->entries); + mcfs_info->entries = 0; + return NULL; + } + dirent_dest = &(mcfs_readdir_data.dent.d_name [0]); + strcpy (dirent_dest, mcfs_info->current->text); + cached_lstat_info = &mcfs_info->current->my_stat; + mcfs_info->current = mcfs_info->current->next; + +#ifndef DIRENT_LENGTH_COMPUTED + mcfs_readdir_data.dent.d_namlen = strlen (mcfs_readdir_data.dent.d_name); +#endif + + return &mcfs_readdir_data; +} + +static int mcfs_closedir (void *info) +{ + opendir_info *mcfs_info = (opendir_info *) info; + dir_entry *p, *q; + + rpc_send (mcfs_info->conn->sock, RPC_INT, MC_CLOSEDIR, + RPC_INT, mcfs_info->handle, RPC_END); + + for (p = mcfs_info->entries; p;){ + q = p; + p = p->next; + free (q->text); + free (q); + } + free (info); + return 0; +} + +static time_t mcfs_get_time (mcfs_connection *mc) +{ + int sock = mc->sock; + + if (mc->version == 1) { + struct tm tt; + + rpc_get (sock, + RPC_INT, &tt.tm_sec, + RPC_INT, &tt.tm_min, + RPC_INT, &tt.tm_hour, + RPC_INT, &tt.tm_mday, + RPC_INT, &tt.tm_year, + RPC_INT, &tt.tm_mon, + RPC_END); + tt.tm_year -= 1900; + tt.tm_isdst = 0; + + return mktime (&tt); + } else { + char *buf; + long tm; + + rpc_get (sock, + RPC_STRING, &buf, + RPC_END); + sscanf (buf, "%lx", &tm); + free (buf); + + return (time_t) tm; + } +} + +static int get_stat_info (mcfs_connection *mc, struct stat *buf) +{ + long mylong; + int sock = mc->sock; + +#ifdef HAVE_ST_RDEV + buf->st_rdev = 0; +#endif + + rpc_get (sock, RPC_INT, &mylong, RPC_END); + buf->st_dev = mylong; + rpc_get (sock, RPC_INT, &mylong, RPC_END); + buf->st_ino = mylong; + rpc_get (sock, RPC_INT, &mylong, RPC_END); + buf->st_mode = mylong; + rpc_get (sock, RPC_INT, &mylong, RPC_END); + buf->st_nlink = mylong; + rpc_get (sock, RPC_INT, &mylong, RPC_END); + buf->st_uid = mylong; + rpc_get (sock, RPC_INT, &mylong, RPC_END); + buf->st_gid = mylong; + rpc_get (sock, RPC_INT, &mylong, RPC_END); + buf->st_size = mylong; + + if (!rpc_get (sock, RPC_INT, &mylong, RPC_END)) + return 0; +#ifdef HAVE_ST_BLOCKS + buf->st_blocks = mylong; +#endif + buf->st_atime = mcfs_get_time (mc); + buf->st_mtime = mcfs_get_time (mc); + buf->st_ctime = mcfs_get_time (mc); + return 1; +} + +static int mcfs_stat_cmd (int cmd, char *path, struct stat *buf) +{ + char *remote_file; + mcfs_connection *mc; + int status, error; + + if ((remote_file = mcfs_get_path (&mc, path)) == 0) + return -1; + + rpc_send (mc->sock, RPC_INT, cmd, RPC_STRING, remote_file, RPC_END); + free (remote_file); + if (!rpc_get (mc->sock, RPC_INT, &status, RPC_INT, &error, RPC_END)) + return the_error (-1, errno); + + if (is_error (status, error)) + return -1; + + if (get_stat_info (mc, buf)) + return 0; + else + return the_error (-1, EIO); +} + +static int mcfs_stat (char *path, struct stat *buf) +{ + return mcfs_stat_cmd (MC_STAT, path, buf); +} + +static int mcfs_lstat (char *path, struct stat *buf) +{ + int path_len = strlen (path); + int entry_len = strlen (mcfs_readdir_data.dent.d_name); + + /* Hack ... */ + if (strcmp (path + path_len - entry_len, + mcfs_readdir_data.dent.d_name) == 0 && + cached_lstat_info){ + *buf = *cached_lstat_info; + return 0; + } + return mcfs_stat_cmd (MC_LSTAT, path, buf); +} + +int mcfs_fstat (void *data, struct stat *buf) +{ + mcfs_handle *info = (mcfs_handle *) data; + int result, error; + int handle, sock; + + sock = info->conn->sock; + handle = info->handle; + + rpc_send (sock, RPC_INT, MC_FSTAT, RPC_INT, handle, RPC_END); + if (!rpc_get (sock, RPC_INT, &result, RPC_INT, &error, RPC_END)) + return the_error (-1, EIO); + + if (is_error (result, error)) + return -1; + + if (get_stat_info (info->conn, buf)) + return 0; + else + return the_error (-1, EIO); +} + +int mcfs_chmod (char *path, int mode) +{ + return mcfs_rpc_path_int (MC_CHMOD, path, mode); +} + +int mcfs_chown (char *path, int owner, int group) +{ + return mcfs_rpc_path_int_int (MC_CHOWN, path, owner, group); +} + +int mcfs_utime (char *path, struct utimbuf *times) +{ + mcfs_connection *mc; + int status; + char *file; + + if (!(file = mcfs_get_path (&mc, path))) + return -1; + + status = 0; + if (mc->version >= 2) { + char abuf[2*sizeof(long) + 1]; + char mbuf[2*sizeof(long) + 1]; + long atime, mtime; + + atime = (long) times->actime; + mtime = (long) times->modtime; + + sprintf (abuf, "%lx", atime); + sprintf (mbuf, "%lx", mtime); + + rpc_send (mc->sock, RPC_INT, MC_UTIME, + RPC_STRING, file, + RPC_STRING, abuf, + RPC_STRING, mbuf, + RPC_END); + status = mcfs_handle_simple_error (mc->sock, 0); + + } + free (file); + return (status); +} + +static int mcfs_readlink (char *path, char *buf, int size) +{ + char *remote_file, *stat_str; + int status, error; + mcfs_connection *mc; + + if (!(remote_file = mcfs_get_path (&mc, path))) + return -1; + + rpc_send (mc->sock, RPC_INT, MC_READLINK, RPC_STRING, remote_file, RPC_END); + free (remote_file); + if (!rpc_get (mc->sock, RPC_INT, &status, RPC_INT, &error, RPC_END)) + return the_error (-1, EIO); + + if (is_error (status, errno)) + return -1; + + if (!rpc_get (mc->sock, RPC_STRING, &stat_str, RPC_END)) + return the_error (-1, EIO); + + strncpy (buf, stat_str, size); + free (stat_str); + return strlen (buf); +} + +int mcfs_unlink (char *path) +{ + return mcfs_rpc_path (MC_UNLINK, path); +} + +int mcfs_symlink (char *n1, char *n2) +{ + return mcfs_rpc_two_paths (MC_SYMLINK, n1, n2); +} + +int mcfs_rename (char *a, char *b) +{ + return mcfs_rpc_two_paths (MC_RENAME, a, b); +} + +static int mcfs_chdir (char *path) +{ + char *remote_dir; + mcfs_connection *mc; + int status, error; + + if (!(remote_dir = mcfs_get_path (&mc, path))) + return -1; + + if (mcfs_current_dir) + free (mcfs_current_dir); + + mcfs_current_dir = strdup (path); + + current_dir_connection = mc; + rpc_send (mc->sock, RPC_INT, MC_CHDIR, RPC_STRING, remote_dir, RPC_END); + free (remote_dir); + if (!rpc_get (mc->sock, RPC_INT, &status, RPC_INT, &error, RPC_END)) + return the_error (-1, EIO); + + if (is_error (status, error)) + return -1; + return 0; +} + +int mcfs_lseek (void *data, off_t offset, int whence) +{ + mcfs_handle *info = (mcfs_handle *) data; + int handle, sock; + + sock = info->conn->sock; + handle = info->handle; + + rpc_send (sock, + RPC_INT, MC_LSEEK, + RPC_INT, handle, + RPC_INT, offset, + RPC_INT, whence, + RPC_END); + return mcfs_handle_simple_error (sock, 1); +} + +int mcfs_mknod (char *path, int mode, int dev) +{ + return mcfs_rpc_path_int_int (MC_MKNOD, path, mode, dev); +} + +int mcfs_mkdir (char *path, mode_t mode) +{ + return mcfs_rpc_path_int (MC_MKDIR, path, mode); +} + +int mcfs_rmdir (char *path) +{ + return mcfs_rpc_path (MC_RMDIR, path); +} + +int mcfs_link (char *p1, char *p2) +{ + return mcfs_rpc_two_paths (MC_LINK, p1, p2); +} + +/* We do not free anything right now: we free resources when we run + * out of them + */ +static vfsid mcfs_getid (char *p, struct vfs_stamping **parent) +{ + *parent = NULL; + + return (vfsid) -1; +} + +static int mcfs_nothingisopen (vfsid id) +{ + return 0; +} + +static void mcfs_free (vfsid id) +{ + /* FIXME: Should not be empty */ +} + +static char *mcfs_getlocalcopy (char *path) +{ + return mc_def_getlocalcopy (path); +} + +static void mcfs_ungetlocalcopy (char *path, char *local, int has_changed) +{ + mc_def_ungetlocalcopy (path, local, has_changed); +} + +/* Gives up on a socket and reopnes the connection, the child own the socket + * now + */ +void +mcfs_forget (char *path) +{ + char *host, *user, *pass, *p; + int port, i, vers; + + if (strncmp (path, "mc:", 3) != 0) + return; + path += 3; + if (path[0] == '/' && path[1] == '/') + path += 2; + + if ((p = mcfs_get_host_and_username (path, &host, &user, &port, &pass)) == 0) { + free (host); + free (user); + if (pass) + wipe_password (pass); + return; + } + for (i = 0; i < MCFS_MAX_CONNECTIONS; i++){ + if ((strcmp (host, mcfs_connections [i].host) == 0) && + (strcmp (user, mcfs_connections [i].user) == 0) && + (port == mcfs_connections [i].port)){ + + /* close socket: the child owns it now */ + close (mcfs_connections [i].sock); + + /* reopen the connection */ + mcfs_connections [i].sock = mcfs_open_tcp_link (host, user, &port, pass, &vers); + } + } + free (p); + free (host); + free (user); + if (pass) + wipe_password (pass); +} + +#ifdef HAVE_MMAP +caddr_t mcfs_mmap (caddr_t addr, size_t len, int prot, int flags, void *data, off_t offset) +{ + return (caddr_t)-1; /* We do not mmap to far away */ +} + +int mcfs_munmap (caddr_t addr, size_t len, void *data) +{ + return -1; +} +#endif + +vfs mcfs_vfs_ops = { + mcfs_open, + mcfs_close, + mcfs_read, + mcfs_write, + + mcfs_opendir, + mcfs_readdir, + mcfs_closedir, + NULL, + NULL, + + mcfs_stat, + mcfs_lstat, + mcfs_fstat, + + mcfs_chmod, + mcfs_chown, + mcfs_utime, + + mcfs_readlink, + mcfs_symlink, + mcfs_link, + mcfs_unlink, + + mcfs_rename, + mcfs_chdir, + mcfs_errno, + mcfs_lseek, + mcfs_mknod, + + mcfs_getid, + mcfs_nothingisopen, + mcfs_free, + + mcfs_getlocalcopy, + mcfs_ungetlocalcopy, + + mcfs_mkdir, + mcfs_rmdir, + NULL, + NULL, + mcfs_forget +#ifdef HAVE_MMAP + , mcfs_mmap, + mcfs_munmap +#endif +}; + diff -uNr gnome-libs-0.26/libvfs/mcfs.h gnome-libs-0.27/libvfs/mcfs.h --- gnome-libs-0.26/libvfs/mcfs.h Wed Dec 31 19:00:00 1969 +++ gnome-libs-0.27/libvfs/mcfs.h Thu Jul 23 14:08:51 1998 @@ -0,0 +1,51 @@ +#define mcserver_port 9876 + +/* This number was registered for program "mcfs" with rpc@Sun.COM */ +#define RPC_PROGNUM 300516 +#define RPC_PROGVER 2 + +/* this constants must be kept in sync with mcserv.c commands */ +/* They are the messages sent on the link connection */ +enum { + MC_OPEN, + MC_CLOSE, + MC_READ, + MC_WRITE, + MC_OPENDIR, + MC_READDIR, + MC_CLOSEDIR, + MC_STAT, + MC_LSTAT, + MC_FSTAT, + MC_CHMOD, + MC_CHOWN, + MC_READLINK, + MC_UNLINK, + MC_RENAME, + MC_CHDIR, + MC_LSEEK, + MC_RMDIR, + MC_SYMLINK, + MC_MKNOD, + MC_MKDIR, + MC_LINK, + MC_GETHOME, + MC_GETUPDIR, + + /* Control commands */ + MC_LOGIN, + MC_QUIT, + + MC_UTIME, /* it has to go here for compatibility with old + servers/clients. sigh ... */ + + MC_INVALID_PASS = 0x1000, + MC_NEED_PASSWORD, + MC_LOGINOK, + MC_VERSION_OK, + MC_VERSION_MISMATCH, + MC_PASS + +}; + +extern char *mcfs_current_dir; diff -uNr gnome-libs-0.26/libvfs/mcserv.c gnome-libs-0.27/libvfs/mcserv.c --- gnome-libs-0.26/libvfs/mcserv.c Wed Dec 31 19:00:00 1969 +++ gnome-libs-0.27/libvfs/mcserv.c Thu Jul 23 14:08:52 1998 @@ -0,0 +1,1313 @@ +/* Server for the Midnight Commander Virtual File System. + + Copyright (C) 1995, 1996, 1997 The Free Software Foundation + + Written by: + Miguel de Icaza, 1995, 1997, + Andrej Borsenkow 1996. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + + TODO: + opendir instead of keeping its table of file handles could return + the pointer and expect the client to send a proper value back each + time :-) + + We should use syslog to register login/logout. + + */ + +/* {{{ Includes and global variables */ + +#include +#include +#include +#ifdef HAVE_UNISTD_H +# include +#endif +#include +#include +#ifdef HAVE_LIMITS_H +# include +#endif +#ifndef NGROUPS_MAX +# include +# ifdef NGROUPS +# define NGROUPS_MAX NGROUPS +# endif +#endif +#ifdef HAVE_GRP_H +# include +#endif +#ifdef HAVE_SHADOW_H +# include +#else +# ifdef HAVE_SHADOW_SHADOW_H +# include +# endif +#endif +#ifdef HAVE_CRYPT_H +# include +#endif +#include +#include +#include +#include +#ifdef SCO_FLAVOR +# include /* alex: for struct timeb definition */ +#endif /* SCO_FLAVOR */ +#include +#include + +/* Network include files */ +#include +#include +#include +#include +#ifdef HAVE_PMAP_SET +# include +# include +# ifdef HAVE_RPC_PMAP_CLNT_H +# include +# endif +#endif + +/* Authentication include files */ +#include +#ifdef HAVE_PAM +# include +# ifndef PAM_ESTABLISH_CRED +# define PAM_ESTABLISH_CRED PAM_CRED_ESTABLISH +# endif +#endif + +#include "../src/fs.h" +#include "../src/mem.h" +#include "mcfs.h" +#include "tcputil.h" + +/* The socket from which we accept commands */ +int msock; + +/* Requested version number from client */ +static int clnt_version; + +/* If non zero, we accept further commands */ +int logged_in = 0; + +/* Home directory */ +char *home_dir = NULL; + +char *up_dir = NULL; + +/* Were we started from inetd? */ +int inetd_started = 0; + +/* Are we running as a daemon? */ +int isDaemon = 0; + +/* guess */ +int verbose = 0; + +/* ftp auth */ +int ftp = 0; + +/* port number in which we listen to connections, + * if zero, we try to contact the portmapper to get a port, and + * if it's not possible, then we use a hardcoded value + */ +int portnum = 0; + +/* if the server will use rcmd based authentication (hosts.equiv .rhosts) */ +int r_auth = 0; + +#define OPENDIR_HANDLES 8 + +#define DO_QUIT_VOID() \ +do { \ + quit_server = 1; \ + return_code = 1; \ + return; \ +} while (0) + +/* Only used by get_port_number */ +#define DO_QUIT_NONVOID(a) \ +do { \ + quit_server = 1; \ + return_code = 1; \ + return (a); \ +} while (0) + +char buffer [4096]; +int debug = 1; +static int quit_server; +static int return_code; + +/* }}} */ + +/* {{{ Misc routines */ + +void send_status (int status, int errno_number) +{ + rpc_send (msock, RPC_INT, status, RPC_INT, errno_number, RPC_END); + errno = 0; +} + +/* }}} */ + +/* {{{ File with handle operations */ + +void do_open (void) +{ + int handle, flags, mode; + char *arg; + + rpc_get (msock, RPC_STRING, &arg, RPC_INT, &flags, RPC_INT, &mode,RPC_END); + + handle = open (arg, flags, mode); + send_status (handle, errno); + free (arg); +} + +void do_read (void) +{ + int handle, count, n; + void *data; + + rpc_get (msock, RPC_INT, &handle, RPC_INT, &count, RPC_END); + data = malloc (count); + if (!data){ + send_status (-1, ENOMEM); + return; + } + if (verbose) printf ("count=%d\n", count); + n = read (handle, data, count); + if (verbose) printf ("result=%d\n", n); + if (n < 0){ + send_status (-1, errno); + return; + } + send_status (n, 0); + rpc_send (msock, RPC_BLOCK, n, data, RPC_END); + + free (data); +} + +void do_write (void) +{ + int handle, count, status; + char buffer [8192]; + + rpc_get (msock, RPC_INT, &handle, RPC_INT, &count, RPC_END); + status = 0; + while (count){ + int nbytes = count > 8192 ? 8192 : count; + + rpc_get (msock, RPC_BLOCK, nbytes, buffer, RPC_END); + status = write (handle, buffer, nbytes); + count -= nbytes; + } + send_status (status, errno); +} + +void do_lseek (void) +{ + int handle, offset, whence, status; + + rpc_get (msock, + RPC_INT, &handle, + RPC_INT, &offset, + RPC_INT, &whence, RPC_END); + status = lseek (handle, offset, whence); + send_status (status, errno); +} + +void do_close (void) +{ + int handle, status; + + rpc_get (msock, RPC_INT, &handle, RPC_END); + status = close (handle); + send_status (status, errno); +} + +/* }}} */ + +/* {{{ Stat family routines */ + +void send_time (int sock, time_t time) +{ + if (clnt_version == 1) { + char *ct; + int month; + + ct = ctime (&time); + ct [3] = ct [10] = ct [13] = ct [16] = ct [19] = 0; + + /* Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec */ + if (ct [4] == 'J'){ + if (ct [5] == 'a'){ + month = 0; + } else + month = (ct [6] == 'n') ? 5 : 6; + } else if (ct [4] == 'F'){ + month = 1; + } else if (ct [4] == 'M'){ + month = (ct [6] == 'r') ? 2 : 5; + } else if (ct [4] == 'A'){ + month = (ct [5] == 'p') ? 3 : 7; + } else if (ct [4] == 'S'){ + month = 8; + } else if (ct [4] == 'O'){ + month = 9; + } else if (ct [4] == 'N'){ + month = 10; + } else + month = 11; + rpc_send (msock, + RPC_INT, atoi (&ct [17]), /* sec */ + RPC_INT, atoi (&ct [14]), /* min */ + RPC_INT, atoi (&ct [11]), /* hour */ + RPC_INT, atoi (&ct [8]), /* mday */ + RPC_INT, atoi (&ct [20]), /* year */ + RPC_INT, month, /* month */ + RPC_END); + } else { + long ltime = (long) time; + char buf[2*sizeof(long) + 1]; + + sprintf (buf, "%lx", ltime); + rpc_send (msock, + RPC_STRING, buf, + RPC_END); + } +} + +void send_stat_info (struct stat *st) +{ + int mylong; + int blocks = +#ifdef HAVE_ST_BLOCKS + st->st_blocks; +#else + st->st_size / 1024; +#endif + + mylong = st->st_dev; + rpc_send (msock, RPC_INT, (long) st->st_dev, + RPC_INT, (long) st->st_ino, + RPC_INT, (long) st->st_mode, + RPC_INT, (long) st->st_nlink, + RPC_INT, (long) st->st_uid, + RPC_INT, (long) st->st_gid, + RPC_INT, (long) st->st_size, + RPC_INT, (long) blocks, RPC_END); + send_time (msock, st->st_atime); + send_time (msock, st->st_mtime); + send_time (msock, st->st_ctime); +} + +void do_lstat () +{ + struct stat st; + char *file; + int n; + + rpc_get (msock, RPC_STRING, &file, RPC_END); + n = lstat (file, &st); + send_status (n, errno); + if (n >= 0) + send_stat_info (&st); + free (file); +} + +void do_fstat (void) +{ + int handle; + int n; + struct stat st; + + rpc_get (msock, RPC_INT, &handle, RPC_END); + n = fstat (handle, &st); + send_status (n, errno); + if (n < 0) + return; + + send_stat_info (&st); +} + +void do_stat () +{ + struct stat st; + int n; + char *file; + + rpc_get (msock, RPC_STRING, &file, RPC_END); + + n = stat (file, &st); + send_status (n, errno); + if (n >= 0) + send_stat_info (&st); + free (file); +} + +/* }}} */ + +/* {{{ Directory lookup operations */ + +static struct { + int used; + DIR *dirs [OPENDIR_HANDLES]; + char *names [OPENDIR_HANDLES]; +} mcfs_DIR; + +void close_handle (int handle) +{ + if (mcfs_DIR.used > 0) mcfs_DIR.used--; + if (mcfs_DIR.dirs [handle]) + closedir (mcfs_DIR.dirs [handle]); + if (mcfs_DIR.names [handle]) + free (mcfs_DIR.names [handle]); + mcfs_DIR.dirs [handle] = 0; + mcfs_DIR.names [handle] = 0; +} + +void do_opendir (void) +{ + int handle, i; + char *arg; + DIR *p; + + rpc_get (msock, RPC_STRING, &arg, RPC_END); + + if (mcfs_DIR.used == OPENDIR_HANDLES){ + send_status (-1, ENFILE); /* Error */ + free (arg); + return; + } + + handle = -1; + for (i = 0; i < OPENDIR_HANDLES; i++){ + if (mcfs_DIR.dirs [i] == 0){ + handle = i; + break; + } + } + + if (handle == -1){ + send_status (-1, EMFILE); + free (arg); + if (!inetd_started) + fprintf (stderr, "OOPS! you have found a bug in mc - do_opendir()!\n"); + return; + } + + if (verbose) printf ("handle=%d\n", handle); + p = opendir (arg); + if (p){ + mcfs_DIR.dirs [handle] = p; + mcfs_DIR.names [handle] = arg; + mcfs_DIR.used ++; + + /* Because 0 is an error value */ + rpc_send (msock, RPC_INT, handle+1, RPC_INT, 0, RPC_END); + + } else { + send_status (-1, errno); + free (arg); + } +} + +/* Sends the complete directory listing, as well as the stat information */ +void do_readdir (void) +{ + struct dirent *dirent; + struct stat st; + int handle, n, dnamelen; + char *fname = 0; + + rpc_get (msock, RPC_INT, &handle, RPC_END); + + if (!handle){ + rpc_send (msock, RPC_INT, 0, RPC_END); + return; + } + + /* We incremented it in opendir */ + handle --; + dnamelen = strlen (mcfs_DIR.names [handle]); + + while ((dirent = readdir (mcfs_DIR.dirs [handle]))){ + int length = NLENGTH (dirent); + + rpc_send (msock, RPC_INT, length, RPC_END); + rpc_send (msock, RPC_BLOCK, length, dirent->d_name, RPC_END); + fname = malloc (dnamelen + length + 2); + strcat (strcat (strcpy (fname, mcfs_DIR.names [handle]), "/"), dirent->d_name); + n = lstat (fname, &st); + send_status (n, errno); + free (fname); + if (n >= 0) + send_stat_info (&st); + } + rpc_send (msock, RPC_INT, 0, RPC_END); +} + +void do_closedir (void) +{ + int handle; + + rpc_get (msock, RPC_INT, &handle, RPC_END); + close_handle (handle-1); +} + +/* }}} */ + +/* {{{ Operations with one and two file name argument */ + +void do_chdir (void) +{ + char *file; + int status; + + rpc_get (msock, RPC_STRING, &file, RPC_END); + + status = chdir (file); + send_status (status, errno); + free (file); +} + +void do_rmdir (void) +{ + char *file; + int status; + + rpc_get (msock, RPC_STRING, &file, RPC_END); + + status = rmdir (file); + send_status (status, errno); + free (file); +} + +void do_mkdir (void) +{ + char *file; + int mode, status; + + rpc_get (msock, RPC_STRING, &file, RPC_INT, &mode, RPC_END); + + status = mkdir (file, mode); + send_status (status, errno); + free (file); +} + +void do_mknod (void) +{ + char *file; + int mode, dev, status; + + rpc_get (msock, RPC_STRING, &file, RPC_INT, &mode, RPC_INT, &dev, RPC_END); + + status = mknod (file, mode, dev); + send_status (status, errno); + free (file); +} + +void do_readlink (void) +{ + char buffer [2048]; + char *file; + int n; + + rpc_get (msock, RPC_STRING, &file, RPC_END); + n = readlink (file, buffer, 2048); + send_status (n, errno); + if (n >= 0) { + buffer [n] = 0; + rpc_send (msock, RPC_STRING, buffer, RPC_END); + } + free (file); +} + +void do_unlink (void) +{ + char *file; + int status; + + rpc_get (msock, RPC_STRING, &file, RPC_END); + status = unlink (file); + send_status (status, errno); + free (file); +} + +void do_rename (void) +{ + char *f1, *f2; + int status; + + rpc_get (msock, RPC_STRING, &f1, RPC_STRING, &f2, RPC_END); + status = rename (f1, f2); + send_status (status, errno); + free (f1); free (f2); +} + +void do_symlink (void) +{ + char *f1, *f2; + int status; + + rpc_get (msock, RPC_STRING, &f1, RPC_STRING, &f2, RPC_END); + status = symlink (f1, f2); + send_status (status, errno); + free (f1); free (f2); +} + +void do_link (void) +{ + char *f1, *f2; + int status; + + rpc_get (msock, RPC_STRING, &f1, RPC_STRING, &f2, RPC_END); + status = link (f1, f2); + send_status (link (f1, f2), errno); + free (f1); free (f2); +} + + +/* }}} */ + +/* {{{ Misc commands */ + +void do_gethome (void) +{ + rpc_send (msock, RPC_STRING, (home_dir) ? home_dir : "/", RPC_END); +} + +void do_getupdir (void) +{ + rpc_send (msock, RPC_STRING, (up_dir) ? up_dir : "/", RPC_END); +} + +void do_chmod (void) +{ + char *file; + int mode, status; + + rpc_get (msock, RPC_STRING, &file, RPC_INT, &mode, RPC_END); + status = chmod (file, mode); + send_status (status, errno); + free (file); +} + +void do_chown (void) +{ + char *file; + int owner, group, status; + + rpc_get (msock, RPC_STRING, &file,RPC_INT, &owner, RPC_INT,&group,RPC_END); + status = chown (file, owner, group); + send_status (status, errno); + free (file); +} + +void do_utime (void) +{ + char *file; + int status; + long atime; + long mtime; + char *as; + char *ms; + struct utimbuf times; + + rpc_get (msock, RPC_STRING, &file, + RPC_STRING, &as, + RPC_STRING, &ms, + RPC_END); + sscanf (as, "%lx", &atime); + sscanf (ms, "%lx", &mtime); + if (verbose) printf ("Got a = %s, m = %s, comp a = %ld, m = %ld\n", + as, ms, atime, mtime); + free (as); + free (ms); + times.actime = (time_t) atime; + times.modtime = (time_t) mtime; + status = utime (file, ×); + send_status (status, errno); + free (file); +} + +void do_quit () +{ + quit_server = 1; +} + +#ifdef HAVE_PAM + +struct user_pass { + char *username; + char *password; +}; + +int +mc_pam_conversation (int messages, const struct pam_message **msg, + struct pam_response **resp, void *appdata_ptr) +{ + struct pam_response *r; + struct user_pass *up = appdata_ptr; + int status; + + r = (struct pam_response *) malloc (sizeof (struct pam_response) * messages); + if (!r) + return PAM_CONV_ERR; + *resp = r; + + for (status = PAM_SUCCESS; messages--; msg++, r++){ + switch ((*msg)->msg_style){ + + case PAM_PROMPT_ECHO_ON: + r->resp = strdup (up->username); + r->resp_retcode = PAM_SUCCESS; + break; + + case PAM_PROMPT_ECHO_OFF: + r->resp = strdup (up->password); + r->resp_retcode = PAM_SUCCESS; + break; + + case PAM_ERROR_MSG: + r->resp = NULL; + r->resp_retcode = PAM_SUCCESS; + break; + + case PAM_TEXT_INFO: + r->resp = NULL; + r->resp_retcode = PAM_SUCCESS; + break; + } + } + return status; +} + +static struct pam_conv conv = { &mc_pam_conversation, NULL }; + + +/* Return 0 if authentication failed, 1 otherwise */ +int +mc_pam_auth (char *username, char *password) +{ + pam_handle_t *pamh; + struct user_pass up; + int status; + + up.username = username; + up.password = password; + conv.appdata_ptr = &up; + + if ((status = pam_start("mcserv", username, &conv, &pamh)) != PAM_SUCCESS) + goto failed_pam; + if ((status = pam_authenticate (pamh, 0)) != PAM_SUCCESS) + goto failed_pam; + if ((status = pam_acct_mgmt (pamh, 0)) != PAM_SUCCESS) + goto failed_pam; + if ((status = pam_setcred (pamh, PAM_ESTABLISH_CRED)) != PAM_SUCCESS) + goto failed_pam; + pam_end (pamh, status); + return 0; + +failed_pam: + pam_end (pamh, status); + return 1; +} + +#else /* Code for non-PAM authentication */ + +/* Keep reading until we find a \n */ +static int next_line (int socket) +{ + char c; + + while (1){ + if (read (socket, &c, 1) <= 0) + return 0; + if (c == '\n') + return 1; + } +} + +static int ftp_answer (int sock, char *text) +{ + char answer [4]; + + next_line (sock); + socket_read_block (sock, answer, 3); + answer [3] = 0; + if (strcmp (answer, text) == 0) + return 1; + return 0; +} + +int do_ftp_auth (char *username, char *password) +{ + struct sockaddr_in local_address; + unsigned long inaddr; + int my_socket; + char answer [4]; + + bzero ((char *) &local_address, sizeof (local_address)); + + local_address.sin_family = AF_INET; + /* FIXME: extract the ftp port with the proper function */ + local_address.sin_port = htons (21); + + /* Convert localhost to usable format */ + if ((inaddr = inet_addr ("127.0.0.1")) != -1) + bcopy ((char *) &inaddr, (char *) &local_address.sin_addr, + sizeof (inaddr)); + + if ((my_socket = socket (AF_INET, SOCK_STREAM, 0)) < 0){ + if (!isDaemon) fprintf (stderr, "do_auth: can't create socket\n"); + return 0; + } + if (connect (my_socket, (struct sockaddr *) &local_address, + sizeof (local_address)) < 0){ + fprintf (stderr, + "do_auth: can't connect to ftp daemon for authentication\n"); + close (my_socket); + return 0; + } + send_string (my_socket, "user "); + send_string (my_socket, username); + send_string (my_socket, "\r\n"); + if (!ftp_answer (my_socket, "331")){ + send_string (my_socket, "quit\r\n"); + close (my_socket); + return 0; + } + next_line (my_socket); /* Eat all the line */ + send_string (my_socket, "pass "); + send_string (my_socket, password); + send_string (my_socket, "\r\n"); + socket_read_block (my_socket, answer, 3); + answer [3] = 0; + send_string (my_socket, "\r\n"); + send_string (my_socket, "quit\r\n"); + close (my_socket); + if (strcmp (answer, "230") == 0) + return 1; + return 0; +} + +int do_classic_auth (char *username, char *password) +{ + struct passwd *this; + int ret; +#ifdef LINUX_SHADOW + struct spwd *spw; + extern char *pw_encrypt (char *, char *); +#else +#ifdef NEED_CRYPT_PROTOTYPE + extern char *crypt (const char *, const char *); +#endif +#endif + + if ((this = getpwnam (username)) == 0) + return 0; + +#ifdef LINUX_SHADOW + if ((spw = getspnam (username)) == NULL) + this->pw_passwd = "*"; + else + this->pw_passwd = spw->sp_pwdp; + if (strcmp (pw_encrypt (password, this->pw_passwd), this->pw_passwd) == 0) + ret = 1; + else + ret = 0; +#else +#ifdef HAVE_CRYPT + if (strcmp (crypt (password, this->pw_passwd), this->pw_passwd) == 0){ + ret = 1; + } else +#endif + { + ret = 0; + } +#endif + endpwent (); + return ret; +} +#endif /* non-PAM authentication */ + +/* Try to authenticate the user based on: + - PAM if the system has it, else it checks: + - pwdauth if the system supports it. + - conventional auth (check salt on /etc/passwd, crypt, and compare + - try to contact the local ftp server and login (if -f flag used) +*/ +int +do_auth (char *username, char *password) +{ + int auth = 0; + struct passwd *this; + + if (strcmp (username, "anonymous") == 0) + username = "ftp"; + +#ifdef HAVE_PAM + if (mc_pam_auth (username, password) == 0) + auth = 1; +#else /* if there is no pam */ +#ifdef HAVE_PWDAUTH + if (pwdauth (username, password) == 0) + auth = 1; + else +#endif + if (do_classic_auth (username, password)) + auth = 1; + else if (ftp) + auth = do_ftp_auth (username, password); +#endif /* not pam */ + + if (!auth) + return 0; + + this = getpwnam (username); + if (this == 0) + return 0; + + if (chdir (this->pw_dir) == -1) + return 0; + + if (this->pw_dir [strlen (this->pw_dir) - 1] == '/') + home_dir = strdup (this->pw_dir); + else { + home_dir = malloc (strlen (this->pw_dir) + 2); + if (home_dir) { + strcpy (home_dir, this->pw_dir); + strcat (home_dir, "/"); + } else + home_dir = "/"; + } + + + if (setgid (this->pw_gid) == -1) + return 0; + +#ifdef HAVE_INITGROUPS +#ifdef NGROUPS_MAX + if (NGROUPS_MAX > 1 && initgroups (this->pw_name, this->pw_gid)) + return 0; +#endif +#endif + +#ifndef BSD + if (setuid (this->pw_uid)) +#else + if (setreuid (this->pw_uid, this->pw_uid)) +#endif + return 0; + + /* If the setuid call failed, then deny access */ + /* This should fix the problem on those machines with strange setups */ + if (getuid () != this->pw_uid) + return 0; + + if (strcmp (username, "ftp") == 0) + chroot (this->pw_dir); + + endpwent (); + return auth; +} + +#if 0 +int do_rauth (int socket) +{ + struct sockaddr_in from; + struct hostent *hp; + + if (getpeername(0, (struct sockaddr *)&from, &fromlen) < 0) + return 0; + from.sin_port = ntohs ((unsigned short) from.sin_port); + + /* Strange, this should not happend */ + if (from.sin_family != AF_INET) + return 0; + + hp = gethostbyaddr((char *)&fromp.sin_addr, sizeof (struct in_addr), + fromp.sin_family); + +} +#endif + +int do_rauth (int msock) +{ + return 0; +} + +void login_reply (int logged_in) +{ + rpc_send (msock, RPC_INT, + logged_in ? MC_LOGINOK : MC_INVALID_PASS, + RPC_END); +} + +/* FIXME: Implement the anonymous login */ +void do_login () +{ + char *username; + char *password; + int result; + + rpc_get (msock, RPC_LIMITED_STRING, &up_dir, RPC_LIMITED_STRING, &username, RPC_END); + if (verbose) printf ("username: %s\n", username); + + if (r_auth){ + logged_in = do_rauth (msock); + if (logged_in){ + login_reply (logged_in); + return; + } + } + rpc_send (msock, RPC_INT, MC_NEED_PASSWORD, RPC_END); + rpc_get (msock, RPC_INT, &result, RPC_END); + if (result == MC_QUIT) + DO_QUIT_VOID (); + if (result != MC_PASS){ + if (verbose) printf ("do_login: Unknown response: %d\n", result); + DO_QUIT_VOID (); + } + rpc_get (msock, RPC_LIMITED_STRING, &password, RPC_END); + logged_in = do_auth (username, password); + endpwent (); + login_reply (logged_in); +} + +/* }}} */ + +/* {{{ Server and dispatching functions */ + +/* This structure must be kept in synch with mcfs.h enums */ + +struct _command { + char *command; + void (*callback)(void); +} commands [] = { + { "open", do_open }, + { "close", do_close }, + { "read", do_read }, + { "write", do_write }, + { "opendir", do_opendir }, + { "readdir", do_readdir }, + { "closedir", do_closedir }, + { "stat ", do_stat }, + { "lstat ", do_lstat }, + { "fstat", do_fstat }, + { "chmod", do_chmod }, + { "chown", do_chown }, + { "readlink ", do_readlink }, + { "unlink", do_unlink }, + { "rename", do_rename }, + { "chdir ", do_chdir }, + { "lseek", do_lseek }, + { "rmdir", do_rmdir }, + { "symlink", do_symlink }, + { "mknod", do_mknod }, + { "mkdir", do_mkdir }, + { "link", do_link }, + { "gethome", do_gethome }, + { "getupdir", do_getupdir }, + { "login", do_login }, + { "quit", do_quit }, + { "utime", do_utime }, +}; + +static int ncommands = sizeof(commands)/sizeof(struct _command); + +void exec_command (int command) +{ + if (command < 0 || + command >= ncommands || + commands [command].command == 0){ + fprintf (stderr, "Got unknown command: %d\n", command); + DO_QUIT_VOID (); + } + if (verbose) printf ("Command: %s\n", commands [command].command); + (*commands [command].callback)(); +} + +void check_version () +{ + int version; + + rpc_get (msock, RPC_INT, &version, RPC_END); + if (version >= 1 && + version <= RPC_PROGVER) + rpc_send (msock, RPC_INT, MC_VERSION_OK, RPC_END); + else + rpc_send (msock, RPC_INT, MC_VERSION_MISMATCH, RPC_END); + + clnt_version = version; +} + +/* This routine is called by rpc_get/rpc_send when the connection is closed */ +void tcp_invalidate_socket (int sock) +{ + if (verbose) printf ("Connection closed\n"); + DO_QUIT_VOID(); +} + +void server (int sock) +{ + int command; + + msock = sock; + quit_server = 0; + + check_version (); + do { + if (rpc_get (sock, RPC_INT, &command, RPC_END) && + (logged_in || command == MC_LOGIN)) + exec_command (command); + } while (!quit_server); +} + +/* }}} */ + +/* {{{ Net support code */ + +char *get_client (int portnum) +{ + int sock, clilen, newsocket; + struct sockaddr_in client_address, server_address; + struct hostent *hp; + char hostname [255]; + int yes = 1; + + if ((sock = socket (AF_INET, SOCK_STREAM, 0)) < 0) + return "Can't create socket"; + + /* Use this to debug: */ + if (setsockopt (sock, SOL_SOCKET, SO_REUSEADDR, (char *) &yes, sizeof (yes)) < 0) + return "setsockopt failed"; + + gethostname (hostname, 255); + if (verbose) printf ("hostname=%s\n", hostname); + hp = gethostbyname (hostname); + if (hp == 0) + return "hp = 0!"; + + bzero ((char *) &server_address, sizeof (server_address)); + server_address.sin_family = hp->h_addrtype; + server_address.sin_addr.s_addr = htonl (INADDR_ANY); + server_address.sin_port = htons (portnum); + + if (bind (sock, (struct sockaddr *) &server_address, + sizeof (server_address)) < 0) + return "Can't bind"; + + listen (sock, 5); + + for (;;){ + int child; + + clilen = sizeof (client_address); + newsocket = accept (sock, (struct sockaddr *) &client_address, + &clilen); + + if (isDaemon && (child = fork())) { + int status; + + close (newsocket); + waitpid (child, &status, 0); + continue; + } + + if (isDaemon && fork()) exit (0); + + server (newsocket); + close (newsocket); + return 0; + } +} + +#ifdef HAVE_PMAP_SET +void signal_int_handler (int sig) +{ + pmap_unset (RPC_PROGNUM, RPC_PROGVER); +} +#endif + +#ifndef IPPORT_RESERVED +#define IPPORT_RESERVED 1024; +#endif + +int get_port_number () +{ + int port = 0; + +#ifdef HAVE_RRESVPORT + int start_port = IPPORT_RESERVED; + + port = rresvport (&start_port); + if (port == -1){ + if (geteuid () == 0){ + fprintf (stderr, "Could not bind the server on a reserved port\n"); + DO_QUIT_NONVOID (-1); + } + port = 0; + } +#endif + if (port) + return port; + + port = mcserver_port; + + return port; +} + +void register_port (int portnum, int abort_if_fail) +{ +#ifdef HAVE_PMAP_SET + /* Register our service with the portmapper */ + /* protocol: pmap_set (prognum, versnum, protocol, portp) */ + + if (pmap_set (RPC_PROGNUM, RPC_PROGVER, IPPROTO_TCP, portnum)) + signal (SIGINT, signal_int_handler); + else { + fprintf (stderr, "Could not register service with portmapper\n"); + if (abort_if_fail) + exit (1); + } +#else + if (abort_if_fail){ + fprintf (stderr, + "This system lacks port registration, try using the -p\n" + "flag to force installation at a given port"); + } +#endif +} + +/* }}} */ + +int main (int argc, char *argv []) +{ + char *result; + extern char *optarg; + int c; + + while ((c = getopt (argc, argv, "fdiqp:v")) != -1){ + switch (c){ + case 'd': + isDaemon = 1; + verbose = 0; + break; + + case 'v': + verbose = 1; + break; + + case 'f': + ftp = 1; + break; + + case 'q': + verbose = 0; + break; + + case 'p': + portnum = atoi (optarg); + break; + + case 'i': + inetd_started = 1; + break; + + case 'r': + r_auth = 1; + break; + + default: + fprintf (stderr, "Usage is: mcserv [options] [-p portnum]\n\n" + "options are:\n" + "-d become a daemon (sets -q)\n" + "-q quiet mode\n" + /* "-r use rhost based authentication\n" */ +#ifndef HAVE_PAM + "-f force ftp authentication\n" +#endif + "-v verbose mode\n" + "-p to specify a port number to listen\n"); + exit (0); + + } + } + + if (isDaemon && fork()) exit (0); + + if (portnum == 0) + portnum = get_port_number (); + + if (portnum != -1) { + register_port (portnum, 0); + if (verbose) + printf ("Using port %d\n", portnum); + if ((result = get_client (portnum))) + perror (result); +#ifdef HAVE_PMAP_SET + if (!isDaemon) + pmap_unset (RPC_PROGNUM, RPC_PROGVER); +#endif + } + exit (return_code); +} + +/* This functions are not used */ +void message (int is_error, char *text, char *msg) +{ + printf ("%s %s\n", text, msg); +} + +char *unix_error_string (int a) +{ + return "none"; +} + +#ifndef HAVE_MAD +void *do_xmalloc (int size) +{ + void *m = malloc (size); + + if (!m){ + fprintf (stderr, "memory exhausted\n"); + exit (1); + } + return m; +} +#endif + +#ifndef HAVE_STRDUP +char *strdup (char *s) +{ + char *t = malloc (strlen (s)+1); + strcpy (t, s); + return t; +} +#endif + +void vfs_die( char *m ) +{ + fprintf (stderr,m); + exit (1); +} diff -uNr gnome-libs-0.26/libvfs/names.c gnome-libs-0.27/libvfs/names.c --- gnome-libs-0.26/libvfs/names.c Wed Dec 31 19:00:00 1969 +++ gnome-libs-0.27/libvfs/names.c Thu Jul 23 14:08:52 1998 @@ -0,0 +1,136 @@ +/* Look up user and/or group names. + Copyright (C) 1988, 1992 Free Software Foundation + + From GNU Tar. + +GNU Tar is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Tar is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Tar; see the file COPYING. If not, write to +the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ + +/* + * Look up user and/or group names. + * + * This file should be modified for non-unix systems to do something + * reasonable. + */ + +#include +#include +#include +#include +#define TAR_NAMES +#include "tar.h" +#include "names.h" + +#include +#include +#include + +#ifndef TUNMLEN +#define TUNMLEN 256 +#endif +#ifndef TGNMLEN +#define TGNMLEN 256 +#endif + +static int saveuid = -993; +static char saveuname[TUNMLEN]; +static int my_uid = -993; + +static int savegid = -993; +static char savegname[TGNMLEN]; +static int my_gid = -993; + +#define myuid ( my_uid < 0? (my_uid = getuid()): my_uid ) +#define mygid ( my_gid < 0? (my_gid = getgid()): my_gid ) + +/* + * Look up a user or group name from a uid/gid, maintaining a cache. + * FIXME, for now it's a one-entry cache. + * FIXME2, the "-993" is to reduce the chance of a hit on the first lookup. + * + * This is ifdef'd because on Suns, it drags in about 38K of "yellow + * pages" code, roughly doubling the program size. Thanks guys. + */ +void finduname (char *uname, int uid) +{ + struct passwd *pw; +#ifndef HAVE_GETPWUID + extern struct passwd *getpwuid (); +#endif + + if (uid != saveuid) { + saveuid = uid; + saveuname[0] = '\0'; + pw = getpwuid (uid); + if (pw) + strncpy (saveuname, pw->pw_name, TUNMLEN); + } + strncpy (uname, saveuname, TUNMLEN); +} + +int finduid (char *uname) +{ + struct passwd *pw; + extern struct passwd *getpwnam (); + + if (uname[0] != saveuname[0]/* Quick test w/o proc call */ + ||0 != strncmp (uname, saveuname, TUNMLEN)) { + strncpy (saveuname, uname, TUNMLEN); + pw = getpwnam (uname); + if (pw) { + saveuid = pw->pw_uid; + } else { + saveuid = myuid; + } + } + return saveuid; +} + + +void findgname (char *gname, int gid) +{ + struct group *gr; +#ifndef HAVE_GETGRGID + extern struct group *getgrgid (); +#endif + + if (gid != savegid) { + savegid = gid; + savegname[0] = '\0'; + (void) setgrent (); + gr = getgrgid (gid); + if (gr) + strncpy (savegname, gr->gr_name, TGNMLEN); + } + (void) strncpy (gname, savegname, TGNMLEN); +} + + +int findgid (char *gname) +{ + struct group *gr; + extern struct group *getgrnam (); + + if (gname[0] != savegname[0]/* Quick test w/o proc call */ + ||0 != strncmp (gname, savegname, TUNMLEN)) { + strncpy (savegname, gname, TUNMLEN); + gr = getgrnam (gname); + if (gr) { + savegid = gr->gr_gid; + } else { + savegid = mygid; + } + } + return savegid; +} diff -uNr gnome-libs-0.26/libvfs/names.h gnome-libs-0.27/libvfs/names.h --- gnome-libs-0.26/libvfs/names.h Wed Dec 31 19:00:00 1969 +++ gnome-libs-0.27/libvfs/names.h Thu Jul 23 14:08:52 1998 @@ -0,0 +1,4 @@ +int finduid (char *name); +void finduname (char *name, int uid); +int findgid (char *name); +void findgname (char *name, int gid); diff -uNr gnome-libs-0.26/libvfs/shared.c gnome-libs-0.27/libvfs/shared.c --- gnome-libs-0.26/libvfs/shared.c Wed Dec 31 19:00:00 1969 +++ gnome-libs-0.27/libvfs/shared.c Thu Jul 23 14:08:52 1998 @@ -0,0 +1,282 @@ +/* + * Large portions of tar.c & extfs.c were nearly same. I killed this + * redundancy, so code is maintainable, again. + * + * 1998 Pavel Machek + */ + +static char *X_get_path (char *inname, struct X_archive **archive, int is_dir, + int do_not_open) +{ + char *buf = strdup( inname ); + char *res = X_get_path_mangle( buf, archive, is_dir, do_not_open ); + char *res2 = NULL; + if (res) + res2 = strdup(res); + free(buf); + return res2; +} + +static struct X_entry* +__X_find_entry (struct X_entry *dir, char *name, + struct X_loop_protect *list, int make_dirs, int make_file) +{ + struct X_entry *pent, *pdir; + char *p, *q, *name_end; + char c; + + if (*name == '/') { /* Handle absolute paths */ + name++; + dir = dir->inode->archive->root_entry; + } + + pent = dir; + p = name; + name_end = name + strlen (name); + q = strchr (p, '/'); + c = '/'; + if (!q) + q = strchr (p, 0); + + for (; pent != NULL && c && *p; ){ + c = *q; + *q = 0; + + if (strcmp (p, ".")){ + if (!strcmp (p, "..")) + pent = pent->dir; + else { + if ((pent = __X_resolve_symlinks (pent, list))==NULL){ + *q = c; + return NULL; + } + if (c == '/' && !S_ISDIR (pent->inode->mode)){ + *q = c; + notadir = 1; + return NULL; + } + pdir = pent; + for (pent = pent->inode->first_in_subdir; pent; pent = pent->next_in_dir) + /* Hack: I keep the original semanthic unless + q+1 would break in the strchr */ + if (!strcmp (pent->name, p)){ + if (q + 1 > name_end){ + *q = c; + notadir = !S_ISDIR (pent->inode->mode); + return pent; + } + break; + } + + /* When we load archive, we create automagically + * non-existant directories + */ + if (pent == NULL && make_dirs) { + pent = generate_entry (dir->inode->archive, p, pdir, S_IFDIR | 0777); + } + if (pent == NULL && make_file) { + pent = generate_entry (dir->inode->archive, p, pdir, 0777); + } + } + } + /* Next iteration */ + *q = c; + p = q + 1; + q = strchr (p, '/'); + if (!q) + q = strchr (p, 0); + } + if (pent == NULL) + Xerrno = ENOENT; + return pent; +} + +static struct X_entry *X_find_entry (struct X_entry *dir, char *name, int make_dirs, int make_file) +{ + struct X_entry *res; + + errloop = 0; + notadir = 0; + res = __X_find_entry (dir, name, NULL, make_dirs, make_file); + if (res == NULL) { + if (errloop) + Xerrno = ELOOP; + else if (notadir) + Xerrno = ENOTDIR; + } + return res; +} + + +static int s_errno (void) +{ + return Xerrno; +} + +static void * s_opendir (char *dirname) +{ + struct X_archive *archive; + char *q; + struct X_entry *entry; + struct X_entry **info; + + if ((q = X_get_path_mangle (dirname, &archive, 1, 0)) == NULL) + return NULL; + entry = X_find_entry (archive->root_entry, q, 0, 0); + if (entry == NULL) + return NULL; + if ((entry = X_resolve_symlinks (entry)) == NULL) + return NULL; + if (!S_ISDIR (entry->inode->mode)) { + Xerrno = ENOTDIR; + return NULL; + } + + info = (struct X_entry **) xmalloc (2*sizeof (struct X_entry *), "shared opendir"); + info[0] = entry->inode->first_in_subdir; + info[1] = entry->inode->first_in_subdir; + + return info; +} + +static void * s_readdir (void *data) +{ + static struct { + struct dirent dir; +#ifdef NEED_EXTRA_DIRENT_BUFFER + char extra_buffer [MC_MAXPATHLEN]; +#endif + } dir; + + struct X_entry **info = (struct X_entry **) data; + + if (!*info) + return NULL; + + strcpy (&(dir.dir.d_name [0]), (*info)->name); + +#ifndef DIRENT_LENGTH_COMPUTED + dir.d_namlen = strlen (dir.dir.d_name); +#endif + *info = (*info)->next_in_dir; + + return (void *)&dir; +} + +static int s_telldir (void *data) +{ + struct X_entry **info = (struct X_entry **) data; + struct X_entry *cur; + int num = 0; + + cur = info[1]; + while (cur!=NULL) { + if (cur == info[0]) return num; + num++; + cur = cur->next_in_dir; + } + return -1; +} + +static void s_seekdir (void *data, int offset) +{ + struct X_entry **info = (struct X_entry **) data; + int i; + info[0] = info[1]; + for (i=0; ist_dev = inode->dev; + buf->st_ino = inode->inode; + buf->st_mode = inode->mode; + buf->st_nlink = inode->nlink; + buf->st_uid = inode->uid; + buf->st_gid = inode->gid; +#ifdef HAVE_ST_RDEV + buf->st_rdev = inode->rdev; +#endif + buf->st_size = inode->size; +#ifdef HAVE_ST_BLKSIZE + buf->st_blksize = RECORDSIZE; +#endif +#ifdef HAVE_ST_BLOCKS + buf->st_blocks = (inode->size + RECORDSIZE - 1) / RECORDSIZE; +#endif + buf->st_atime = inode->atime; + buf->st_mtime = inode->mtime; + buf->st_ctime = inode->ctime; +} + +static int s_internal_stat (char *path, struct stat *buf, int resolve) +{ + struct X_archive *archive; + char *q; + struct X_entry *entry; + struct X_inode *inode; +char debugbuf[10240]; +strcpy( debugbuf, path ); + + + if ((q = X_get_path_mangle (path, &archive, 0, 0)) == NULL) + return -1; + entry = X_find_entry (archive->root_entry, q, 0, 0); + if (entry == NULL) + return -1; + if (resolve && (entry = X_resolve_symlinks (entry)) == NULL) + return -1; + inode = entry->inode; + stat_move( buf, inode ); + return 0; +} + +static int s_stat (char *path, struct stat *buf) +{ + return s_internal_stat (path, buf, 1); +} + +static int s_lstat (char *path, struct stat *buf) +{ + return s_internal_stat (path, buf, 0); +} + +static int s_fstat (void *data, struct stat *buf) +{ + struct X_pseudofile *file = (struct X_pseudofile *)data; + struct X_inode *inode; + + inode = file->entry->inode; + stat_move( buf, inode ); + return 0; +} + +static int s_readlink (char *path, char *buf, int size) +{ + struct X_archive *archive; + char *q; + int i; + struct X_entry *entry; + + if ((q = X_get_path_mangle (path, &archive, 0, 0)) == NULL) + return -1; + entry = X_find_entry (archive->root_entry, q, 0, 0); + if (entry == NULL) + return -1; + if (!S_ISLNK (entry->inode->mode)) { + Xerrno = EINVAL; + return -1; + } + if (size > (i = strlen (entry->inode->linkname))) { + size = i; + } + strncpy (buf, entry->inode->linkname, i); + return i; +} diff -uNr gnome-libs-0.26/libvfs/tar.c gnome-libs-0.27/libvfs/tar.c --- gnome-libs-0.26/libvfs/tar.c Wed Dec 31 19:00:00 1969 +++ gnome-libs-0.27/libvfs/tar.c Fri Aug 7 14:46:09 1998 @@ -0,0 +1,1310 @@ +/* Virtual File System: GNU Tar file system. + Copyright (C) 1995 The Free Software Foundation + + Written by: 1995 Jakub Jelinek + Rewritten by: 1998 Pavel Machek + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#ifdef HAVE_SYS_WAIT_H +#include +#endif +#include +#ifdef SCO_FLAVOR +#include /* alex: for struct timeb definition */ +#endif /* SCO_FLAVOR */ +#include +#include "../src/fs.h" +#include "../src/util.h" +#include "../src/dialog.h" /* For MSG_ERROR */ +#include "../src/mem.h" +#include "../src/mad.h" +#include "vfs.h" +#include "tar.h" +#include "names.h" + +/* The limit for a compressed tar file to be loaded in core */ +int tar_gzipped_memlimit = 1*1024*1024; + +/* used to rotate the dash */ +int dash_number = 0; + +#define isodigit(c) ( ((c) >= '0') && ((c) <= '7') ) +/* + * Quick and dirty octal conversion. + * + * Result is -1 if the field is invalid (all blank, or nonoctal). + */ +long from_oct (int digs, char *where) +{ + register long value; + + while (isspace (*where)) { /* Skip spaces */ + where++; + if (--digs <= 0) + return -1; /* All blank field */ + } + value = 0; + while (digs > 0 && isodigit (*where)) { /* Scan till nonoctal */ + value = (value << 3) | (*where++ - '0'); + --digs; + } + + if (digs > 0 && *where && !isspace (*where)) + return -1; /* Ended on non-space/nul */ + + return value; +} + +static struct tarfs_archive *first_archive = NULL; +static int tarerrno = 0; +static struct stat hstat; /* Stat struct corresponding */ +static char *current_file_name, *current_link_name; +static struct tarfs_entry *tarfs_find_entry (struct tarfs_entry *dir, char *name, int make_dirs, int make_file); + +void tarfs_fill_names (void (*func)(char *)) +{ + struct tarfs_archive *a = first_archive; + char *name; + + while (a){ + name = copy_strings ( a->name, "#tar/", + a->current_dir->name, 0); + (*func)(name); + free (name); + a = a->next; + } +} + +static void make_dot_doubledot (struct tarfs_entry *ent) +{ + struct tarfs_entry *entry = (struct tarfs_entry *) + xmalloc (sizeof (struct tarfs_entry), "Tar: tarfs_entry"); + struct tarfs_entry *parentry = ent->dir; + struct tarfs_inode *inode = ent->inode, *parent; + + parent = (parentry != NULL) ? parentry->inode : NULL; + entry->name = strdup ("."); + entry->has_changed = 0; + entry->header_offset = -1; + entry->header_size = 0; + entry->extended_offset = -1; + entry->extended_size = 0; + entry->inode = inode; + entry->dir = ent; + inode->first_in_subdir = entry; + inode->last_in_subdir = entry; + inode->nlink++; + entry->next_in_dir = (struct tarfs_entry *) + xmalloc (sizeof (struct tarfs_entry), "Tar: tarfs_entry"); + entry=entry->next_in_dir; + entry->name = strdup (".."); + entry->has_changed = 0; + entry->header_offset = -1; + entry->header_size = 0; + entry->extended_offset = -1; + entry->extended_size = 0; + inode->last_in_subdir = entry; + entry->next_in_dir = NULL; + if (parent != NULL) { + entry->inode = parent; + entry->dir = parentry; + parent->nlink++; + } else { + entry->inode = inode; + entry->dir = ent; + inode->nlink++; + } +} + +static struct tarfs_entry *generate_entry (struct tarfs_archive *archive, + char *name, struct tarfs_entry *parentry, mode_t mode) +{ + mode_t myumask; + struct tarfs_inode *inode, *parent; + struct tarfs_entry *entry; + + parent = (parentry != NULL) ? parentry->inode : NULL; + entry = (struct tarfs_entry *) + xmalloc (sizeof (struct tarfs_entry), "Tar: tarfs_entry"); + + entry->name = strdup (name); + entry->has_changed = 0; + entry->header_offset = -1; + entry->header_size = 0; + entry->extended_offset = -1; + entry->extended_size = 0; + entry->next_in_dir = NULL; + entry->dir = parentry; + if (parent != NULL) { + parent->last_in_subdir->next_in_dir = entry; + parent->last_in_subdir = entry; + } + inode = (struct tarfs_inode *) + xmalloc (sizeof (struct tarfs_inode), "Tar: tarfs_inode"); + entry->inode = inode; + inode->local_filename = NULL; + inode->has_changed = 0; + inode->is_open = 0; + inode->linkname = 0; + inode->inode = (archive->__inode_counter)++; + inode->dev = archive->rdev; + inode->archive = archive; + inode->data_offset = -1; + myumask = umask (022); + umask (myumask); + inode->mode = mode & ~myumask; + mode = inode->mode; + inode->rdev = 0; + inode->uid = getuid (); + inode->gid = getgid (); + inode->std = 1; + inode->size = 0; + inode->mtime = time (NULL); + inode->atime = inode->mtime; + inode->ctime = inode->mtime; + inode->nlink = 1; + if (S_ISDIR (mode)) { + inode->linkflag = LF_DIR; + make_dot_doubledot (entry); + } else if (S_ISLNK (mode)) { + inode->linkflag = LF_SYMLINK; + } else if (S_ISCHR (mode)) { + inode->linkflag = LF_CHR; + } else if (S_ISBLK (mode)) { + inode->linkflag = LF_BLK; + } else if (S_ISFIFO (mode) || S_ISSOCK (mode)) { + inode->linkflag = LF_FIFO; + } else { + inode->linkflag = LF_NORMAL; + } + return entry; +} + +static void free_entries (struct tarfs_entry *entry) +{ + return; +} + +static void free_archive (struct tarfs_archive *archive) +{ + long l; + + if (archive->is_gzipped == targz_growing) { + free (archive->block_first); + if (archive->block_ptr != NULL) { + for (l = 0; l < archive->count_blocks; l++) + free (archive->block_ptr [l]); + free (archive->block_ptr); + } + } else { + if (archive->is_gzipped == tar_uncompressed_local) { + mc_unlink (archive->tmpname); + free (archive->tmpname); + } + if (archive->fd != -1) + mc_close(archive->fd); + } + free_entries (archive->root_entry); + + free (archive->name); + free (archive); +} + +static INLINE int gzip_limit_ok (int size) +{ + return (size <= tar_gzipped_memlimit || tar_gzipped_memlimit < 0); +} + +/* So we have to decompress it... + * It is not that easy, because we would like to handle all the files + * from all the vfs's. So, we do this like this: + * we run a pipe: + * for (;;) mc_read | gzip -cdf | store into growing buffer + * + * Returns: 0 on failure + */ +static INLINE int load_compressed_tar (struct tarfs_archive *current_archive, + int size, int fd, int type) +{ + int pipehandle, i; + long l, l2; + union record *ur; + pid_t p; + char *cmd, *cmd_flags; + void *tmp; + + l2 = 0; + current_archive->is_gzipped = targz_growing; + size = (size + RECORDSIZE - 1) / RECORDSIZE * RECORDSIZE; + current_archive->count_first = size / RECORDSIZE; + current_archive->count_blocks = 0; + current_archive->block_ptr = NULL; + current_archive->root_entry = NULL; + + decompress_command_and_arg (type, &cmd, &cmd_flags); + pipehandle = mc_doublepopen (fd, -1, &p, cmd, cmd, cmd_flags, NULL); + if (pipehandle == -1) + { + free (current_archive); + mc_close (fd); + return 0; + } + + /* On some systems it's better to allocate the memory for the tar-file + this way: + - allocate some memory we don't need (size 100k). + - allocate the memory for the uncompressed tar-file (the size of + this memory block can be really big - five times the size of the + compressed tar-file). + - free the 100k from the first step + + Without the extra steps a few malloc/free implementations can't give + back memory to the operating system when the memory for the tar-file is + freed after the vfs-timeout. + */ + tmp = malloc (100*1024); + current_archive->block_first = (union record *) malloc (size); + if (tmp) + free (tmp); /* make a hole in size of 100k */ + if (0 == current_archive->block_first) { + mc_doublepclose (pipehandle, p); + free (current_archive); + mc_close (fd); + return 0; + } + + ur = current_archive->block_first; + l = 0; + while ((i = read (pipehandle, (char *) ur, RECORDSIZE)) == RECORDSIZE) { + l++; + if (l >= current_archive->count_first) { + l2 = l - current_archive->count_first; + if (l2 % TAR_GROWING_CHUNK_SIZE) + ur++; + else { + union record **tmp = (union record **) + xmalloc ((++current_archive->count_blocks) * + sizeof (union record **), "Tar: Growing buffers"); + + if (current_archive->block_ptr != NULL) { + bcopy (current_archive->block_ptr, tmp, + (current_archive->count_blocks - 1) * + sizeof (union record **)); + free (current_archive->block_ptr); + } + current_archive->block_ptr = tmp; + ur = (union record *) + xmalloc (TAR_GROWING_CHUNK_SIZE * RECORDSIZE, + "Tar: Growing buffers"); + current_archive->block_ptr [current_archive->count_blocks - 1] = ur; + } + } else + ur++; + if ((dash_number++ % 64) == 0) + rotate_dash (); + } + i = mc_doublepclose (pipehandle, p); + mc_close (fd); + if (i == -1) { + free_archive (current_archive); + return 0; + } + current_archive->current_record = current_archive->block_first; + return 1; +} + +/* Returns a file handle of the opened local tar file or -1 on error */ +static INLINE int uncompress_tar_file (struct tarfs_archive *current_archive, + int size, int fd, int type) +{ + FILE *f; + char *command; + int i, result; + int dash_number = 0; + char buffer [8192]; /* Changed to 8K: better transfer size */ + + current_archive->is_gzipped = tar_uncompressed_local; + current_archive->tmpname = strdup (tempnam (NULL, "tarfs")); + + /* Some security is sometimes neccessary :) */ + command = copy_strings ("touch ", current_archive->tmpname, + " ; chmod 0600 ", current_archive->tmpname, " ; ", + decompress_command (type), + "2>/dev/null >", current_archive->tmpname, NULL); + + if ((f = popen (command, "w")) == NULL) { + mc_close (fd); + free_archive (current_archive); + free (command); + return -1; + } + free (command); + + while ((i = mc_read (fd, buffer, sizeof (buffer))) > 0){ + if ((dash_number++ % 64) == 0) + rotate_dash (); + fwrite (buffer, 1, i, f); + if (ferror (f)) { + pclose (f); +#ifdef SCO_FLAVOR + waitpid(-1,NULL,WNOHANG); +#endif /* SCO_FLAVOR */ + mc_close (fd); + free_archive (current_archive); + return -1; + } + } + + pclose (f); +#ifdef SCO_FLAVOR + waitpid(-1,NULL,WNOHANG); +#endif /* SCO_FLAVOR */ + mc_close (fd); + result = mc_open (current_archive->tmpname, O_RDONLY); + if (result == -1){ + free_archive (current_archive); + return -1; + } + return result; +} + +/* Returns fd of the open tar file */ +static int open_tar_archive (char *name, struct tarfs_archive **pparc) +{ + static dev_t __tar_no = 0; + int result, type; + long size; + mode_t mode; + struct tarfs_archive *current_archive; + static struct tarfs_entry *root_entry; + + result = mc_open (name, O_RDONLY); + if (result == -1) + return -1; + + current_archive = (struct tarfs_archive *) + xmalloc (sizeof (struct tarfs_archive), "Tar archive"); + current_archive->current_tar_position = 0; + current_archive->name = strdup (name); + current_archive->__inode_counter = 0; + mc_stat (name, &(current_archive->tarstat)); + current_archive->rdev = __tar_no++; + current_archive->next = first_archive; + current_archive->fd_usage = 0; + current_archive->fd = -1; + size = is_gunzipable (result, &type); + mc_lseek (result, 0, SEEK_SET); + + /* Find out the method to handle this tar file */ + if (size > 0 && gzip_limit_ok (size)) { + if (load_compressed_tar (current_archive, size, result, type) == 0) + return -1; + result = 0; + } else if (size > 0) { + result = uncompress_tar_file (current_archive, size, result, type); + if (result == -1) + return -1; + } else { + current_archive->is_gzipped = tar_normal; + } + + current_archive->fd = result; + first_archive = current_archive; + mode = current_archive->tarstat.st_mode & 07777; + if (mode & 0400) + mode |= 0100; + if (mode & 0040) + mode |= 0010; + if (mode & 0004) + mode |= 0001; + mode |= S_IFDIR; + root_entry = generate_entry (current_archive, "/", NULL, mode); + root_entry->inode->uid = current_archive->tarstat.st_uid; + root_entry->inode->gid = current_archive->tarstat.st_gid; + root_entry->inode->atime = current_archive->tarstat.st_atime; + root_entry->inode->ctime = current_archive->tarstat.st_ctime; + root_entry->inode->mtime = current_archive->tarstat.st_mtime; + current_archive->root_entry = root_entry; + current_archive->current_dir = root_entry; + + *pparc = current_archive; + + return result; +} + +static int get_current_position (struct tarfs_archive *archive, int tard) +{ + return archive->current_tar_position; +} + +static union record *find_current_record (struct tarfs_archive *archive, long pos) +{ + long l, l2; + static union record *ur; + + l = pos / RECORDSIZE; + if (l >= archive->count_first) { + l2 = l - archive->count_first; + ur = archive->block_ptr [l2 / TAR_GROWING_CHUNK_SIZE] + + (l2 % TAR_GROWING_CHUNK_SIZE); + } else + ur = archive->block_first + l; + return ur; +} + +static union record rec_buf; + +static union record *get_next_record (struct tarfs_archive *archive, int tard) +{ + if (archive->is_gzipped == targz_growing) { + bcopy (archive->current_record, rec_buf.charptr, RECORDSIZE); + archive->current_record = find_current_record (archive, archive->current_tar_position + RECORDSIZE); + } else if (mc_read (tard, rec_buf.charptr, RECORDSIZE) != RECORDSIZE) + return NULL; /* An error has occurred */ + archive->current_tar_position += RECORDSIZE; + return &rec_buf; +} + +static void skip_n_records (struct tarfs_archive *archive, int tard, int n) +{ + if (archive->is_gzipped == targz_growing) + archive->current_record = find_current_record (archive, archive->current_tar_position + n * RECORDSIZE); + else + mc_lseek (tard, n * RECORDSIZE, SEEK_CUR); + archive->current_tar_position += n * RECORDSIZE; +} + +/* + * Return 1 for success, 0 if the checksum is bad, EOF on eof, + * 2 for a record full of zeros (EOF marker). + * + */ +static int read_header (struct tarfs_archive *archive, int tard) +{ + register int i; + register long sum, signed_sum, recsum; + register char *p; + register union record *header; + char **longp; + char *bp, *data; + int size, written; + static char *next_long_name = NULL, *next_long_link = NULL; + long header_position = get_current_position (archive, tard); + + recurse: + + header = get_next_record (archive, tard); + if (NULL == header) + return EOF; + + recsum = from_oct (8, header->header.chksum); + + sum = 0; signed_sum = 0; + p = header->charptr; + for (i = sizeof (*header); --i >= 0;) { + /* + * We can't use unsigned char here because of old compilers, + * e.g. V7. + */ + signed_sum += *p; + sum += 0xFF & *p++; + } + + /* Adjust checksum to count the "chksum" field as blanks. */ + for (i = sizeof (header->header.chksum); --i >= 0;) { + sum -= 0xFF & header->header.chksum[i]; + signed_sum -= (char) header->header.chksum[i]; + } + sum += ' ' * sizeof header->header.chksum; + signed_sum += ' ' * sizeof header->header.chksum; + + if (sum == 8 * ' ') { + /* + * This is a zeroed record...whole record is 0's except + * for the 8 blanks we faked for the checksum field. + */ + return 2; + } + if (sum != recsum && signed_sum != recsum) + return 0; + + /* + * linkflag on BSDI tar (pax) always '\000' + */ + if(header->header.linkflag == '\000' && + strlen(header->header.arch_name) && + header->header.arch_name[strlen(header->header.arch_name) - 1] == '/') + header->header.linkflag = LF_DIR; + + /* + * Good record. Decode file size and return. + */ + if (header->header.linkflag == LF_LINK || header->header.linkflag == LF_DIR) + hstat.st_size = 0; /* Links 0 size on tape */ + else + hstat.st_size = from_oct (1 + 12, header->header.size); + + header->header.arch_name[NAMSIZ - 1] = '\0'; + if (header->header.linkflag == LF_LONGNAME + || header->header.linkflag == LF_LONGLINK) { + longp = ((header->header.linkflag == LF_LONGNAME) + ? &next_long_name + : &next_long_link); + + if (*longp) + free (*longp); + bp = *longp = (char *) xmalloc (hstat.st_size, "Tar: Long name"); + + for (size = hstat.st_size; + size > 0; + size -= written) { + data = get_next_record (archive, tard)->charptr; + if (data == NULL) { + message_1s (1, MSG_ERROR, _("Unexpected EOF on archive file")); + return 0; + } + written = RECORDSIZE; + if (written > size) + written = size; + + bcopy (data, bp, written); + bp += written; + } +#if 0 + if (hstat.st_size > 1) + bp [hstat.st_size - 1] = 0; /* just to make sure */ +#endif + goto recurse; + } else { + struct tarfs_entry *entry, *pent; + struct tarfs_inode *inode; + long data_position; + char *p, *q; + int len; + int isdir = 0; + + current_file_name = (next_long_name + ? next_long_name + : strdup (header->header.arch_name)); + len = strlen (current_file_name); + if (current_file_name[len - 1] == '/') { + current_file_name[len - 1] = 0; + isdir = 1; + } + + current_link_name = (next_long_link + ? next_long_link + : strdup (header->header.arch_linkname)); + len = strlen (current_link_name); + if (len && current_link_name [len - 1] == '/') + current_link_name[len - 1] = 0; + + next_long_link = next_long_name = NULL; + + data_position = get_current_position (archive, tard); + + p = strrchr (current_file_name, '/'); + if (p == NULL) { + p = current_file_name; + q = current_file_name + strlen (current_file_name); /* "" */ + } else { + *(p++) = 0; + q = current_file_name; + } + + pent = tarfs_find_entry (archive->root_entry, q, 1, 0); + if (pent == NULL) { + message_1s (1, MSG_ERROR, _("Inconsistent tar archive")); + } + + entry = (struct tarfs_entry *) xmalloc (sizeof (struct tarfs_entry), "Tar: tarfs_entry"); + entry->name = strdup (p); + entry->has_changed = 0; + entry->header_offset = header_position; + entry->header_size = data_position - header_position; + entry->extended_offset = -1; + entry->extended_size = 0; + entry->next_in_dir = NULL; + entry->dir = pent; + if (pent != NULL) { + pent->inode->last_in_subdir->next_in_dir = entry; + pent->inode->last_in_subdir = entry; + } + free (current_file_name); + + if (header->header.linkflag == LF_LINK) { + pent = tarfs_find_entry (archive->root_entry, current_link_name, 0, 0); + if (pent == NULL) { + message_1s (1, MSG_ERROR, _("Inconsistent tar archive")); + } else { + entry->inode = pent->inode; + pent->inode->nlink++; + free (current_link_name); + if (header->header.isextended) { + entry->extended_offset = data_position; + while (get_next_record (archive, tard)->ext_hdr.isextended); + data_position = get_current_position (archive, tard); + entry->extended_size = data_position - entry->extended_offset; + } + return 1; + } + } + inode = (struct tarfs_inode *) xmalloc (sizeof (struct tarfs_inode), "Tar: tarfs_inode"); + entry->inode = inode; + inode->local_filename = NULL; + inode->has_changed = 0; + inode->is_open = 0; + inode->inode = (archive->__inode_counter)++; + inode->nlink = 1; + inode->dev = archive->rdev; + inode->archive = archive; + inode->data_offset = data_position; + inode->mode = from_oct (8, header->header.mode); + + /* Adjust inode->mode because there are tar-files with + * linkflag==LF_SYMLINK and S_ISLNK(mod)==0. I don't + * know about the other modes but I think I cause no new + * problem when I adjust them, too. -- Norbert. + */ + if (header->header.linkflag == LF_DIR) { + inode->mode |= S_IFDIR; + } else if (header->header.linkflag == LF_SYMLINK) { + inode->mode |= S_IFLNK; + } else if (header->header.linkflag == LF_CHR) { + inode->mode |= S_IFCHR; + } else if (header->header.linkflag == LF_BLK) { + inode->mode |= S_IFBLK; + } else if (header->header.linkflag == LF_FIFO) { + inode->mode |= S_IFIFO; + } else + inode->mode |= S_IFREG; + + inode->rdev = 0; + if (!strcmp (header->header.magic, TMAGIC)) { + inode->uid = *header->header.uname ? finduid (header->header.uname) : + from_oct (8, header->header.uid); + inode->gid = *header->header.gname ? findgid (header->header.gname) : + from_oct (8, header->header.gid); + switch (header->header.linkflag) { + case LF_BLK: + case LF_CHR: + inode->rdev = (from_oct (8, header->header.devmajor) << 8) | + from_oct (8, header->header.devminor); + } + inode->std = 1; + } else { /* Old Unix tar */ + inode->uid = from_oct (8, header->header.uid); + inode->gid = from_oct (8, header->header.gid); + inode->std = 0; + } + inode->size = hstat.st_size; + inode->mtime = from_oct (1 + 12, header->header.mtime); + inode->atime = from_oct (1 + 12, header->header.atime); + inode->ctime = from_oct (1 + 12, header->header.ctime); + inode->linkflag = header->header.linkflag; + if (*current_link_name) { + inode->linkname = current_link_name; + } else { + free (current_link_name); + inode->linkname = NULL; + } + if (inode->linkflag == LF_DIR || isdir) { + inode->mode |= S_IFDIR; + make_dot_doubledot (entry); + } + + if (header->header.isextended) { + entry->extended_offset = data_position; + while (get_next_record (archive, tard)->ext_hdr.isextended); + inode->data_offset = get_current_position (archive, tard); + entry->extended_size = inode->data_offset - entry->extended_offset; + } + return 1; + } +} + +/* + * Main loop for reading an archive. + * Returns 0 on success, -1 on error. + */ +int read_tar_archive (char *name, struct tarfs_archive **pparc) +{ + int status = 3; /* Initial status at start of archive */ + int prev_status; + int tard; + struct tarfs_archive *archive; + + if ((tard = open_tar_archive (name, &archive)) == -1) { /* Open for reading */ + message_2s (1, MSG_ERROR, _("Couldn't open tar archive\n%s"), name); + return -1; + } + + for (;;) { + prev_status = status; + status = read_header (archive, tard); + switch (status) { + + case 1: /* Valid header */ + skip_n_records (archive, tard, (hstat.st_size + RECORDSIZE - 1) / RECORDSIZE); + continue; + /* + * If the previous header was good, tell them + * that we are skipping bad ones. + */ + case 0: /* Invalid header */ + switch (prev_status) { + case 3: /* Error on first record */ + message_2s (1, MSG_ERROR, _("Hmm,...\n%s\ndoesn't look like a tar archive."), name); + /* FALL THRU */ + case 2: /* Error after record of zeroes */ + case 1: /* Error after header rec */ +#if 0 + message_1s (0, " Warning ", "Skipping to next file header..."); +#endif + case 0: /* Error after error */ + return -1; + } + + case 2: /* Record of zeroes */ + status = prev_status; /* If error after 0's */ + /* FALL THRU */ + case EOF: /* End of archive */ + break; + } + break; + }; + + *pparc = archive; + return 0; +} + +static char *tarfs_get_path (char *inname, struct tarfs_archive **archive, int is_dir, + int do_not_open); + +/* Returns path inside argument. Returned char* is inside inname, which is mangled + * by this operation (so you must not free it's return value) + */ +static char *tarfs_get_path_mangle (char *inname, struct tarfs_archive **archive, int is_dir, + int do_not_open) +{ + char *local, *archive_name; + int result = -1; + struct tarfs_archive *parc; + struct vfs_stamping *parent; + vfs *v; + struct stat stat_buf; + + archive_name = inname; + vfs_split( inname, &local, NULL ); + if (!local) + local = ""; + + mc_stat (archive_name, &stat_buf); + + for (parc = first_archive; parc != NULL; parc = parc->next) + if (!strcmp (parc->name, archive_name)) { +/* Has the cached archive been changed on the disk? */ + if (parc->tarstat.st_mtime < stat_buf.st_mtime) { /* Yes, reload! */ + (*tarfs_vfs_ops.free) ((vfsid) parc); + vfs_rmstamp (&tarfs_vfs_ops, (vfsid) parc, 0); + break; + } + /* Hasn't been modified, give it a new timeout */ + vfs_stamp (&tarfs_vfs_ops, (vfsid) parc); + goto return_success; + } + if (do_not_open) + result = -1; + else + result = read_tar_archive (archive_name, &parc); + if (result == -1) { + tarerrno = EIO; + return NULL; + } + v = vfs_type (archive_name); + if (v == &local_vfs_ops) { + parent = NULL; + } else { + parent = xmalloc (sizeof (struct vfs_stamping), "vfs stamping"); + parent->v = v; + parent->next = 0; + parent->id = (*v->getid) (archive_name, &(parent->parent)); + } + vfs_add_noncurrent_stamps (&tarfs_vfs_ops, (vfsid) parc, parent); + vfs_rm_parents (parent); +return_success: + *archive = parc; + return local; +} + +struct tarfs_loop_protect { + struct tarfs_entry *entry; + struct tarfs_loop_protect *next; +}; +static int errloop; +static int notadir; + +static struct tarfs_entry * +__tarfs_find_entry (struct tarfs_entry *dir, char *name, + struct tarfs_loop_protect *list, int make_dirs, int make_file); + +static struct tarfs_entry * +__tarfs_resolve_symlinks (struct tarfs_entry *entry, + struct tarfs_loop_protect *list) +{ + struct tarfs_entry *pent; + struct tarfs_loop_protect *looping; + + if (!S_ISLNK (entry->inode->mode)) + return entry; + for (looping = list; looping != NULL; looping = looping->next) + if (entry == looping->entry) { /* Here we protect us against symlink looping */ + errloop = 1; + return NULL; + } + looping = (struct tarfs_loop_protect *) + xmalloc (sizeof (struct tarfs_loop_protect), + "Tar: symlink looping protection"); + looping->entry = entry; + looping->next = list; + pent = __tarfs_find_entry (entry->dir, entry->inode->linkname, looping, 0, 0); + free (looping); + if (pent == NULL) + tarerrno = ENOENT; + return pent; +} + +static struct tarfs_entry *tarfs_resolve_symlinks (struct tarfs_entry *entry) +{ + struct tarfs_entry *res; + + errloop = 0; + notadir = 0; + res = __tarfs_resolve_symlinks (entry, NULL); + if (res == NULL) { + if (errloop) + tarerrno = ELOOP; + else if (notadir) + tarerrno = ENOTDIR; + } + return res; +} + +struct tar_pseudofile { + struct tarfs_archive *archive; + long pos; + long begin; + long end; + struct tarfs_entry *entry; +}; + +static struct tarfs_entry *tarfs_find_entry (struct tarfs_entry *dir, char *name, int make_dirs, int make_file); + +static void *tar_open (char *file, int flags, int mode) +{ + struct tar_pseudofile *tar_info; + struct tarfs_archive *archive; + char *q; + struct tarfs_entry *entry; + + if ((q = tarfs_get_path_mangle (file, &archive, 0, 0)) == NULL) + return NULL; + entry = tarfs_find_entry (archive->root_entry, q, 0, 0); + if (entry == NULL) + return NULL; + if ((entry = tarfs_resolve_symlinks (entry)) == NULL) + return NULL; + if (S_ISDIR (entry->inode->mode)) { + tarerrno = EISDIR; + return NULL; + } + if ((flags & O_ACCMODE) != O_RDONLY) { + tarerrno = EROFS; /* At the moment we are RO */ + return NULL; + } + + tar_info = (struct tar_pseudofile *) xmalloc (sizeof (struct tar_pseudofile), "Tar: tar_open"); + tar_info->archive = archive; + tar_info->pos = 0; + tar_info->begin = entry->inode->data_offset; + tar_info->end = tar_info->begin + entry->inode->size; + tar_info->entry = entry; + entry->inode->is_open++; + + /* i.e. we had no open files and now we have one */ + vfs_rmstamp (&tarfs_vfs_ops, (vfsid) archive, 1); + archive->fd_usage++; + return tar_info; +} + +static int tar_read (void *data, char *buffer, int count) +{ + struct tar_pseudofile *file = (struct tar_pseudofile *)data; + + if (file->archive->is_gzipped != targz_growing && + mc_lseek (file->archive->fd, file->begin + file->pos, SEEK_SET) != + file->begin + file->pos) { + tarerrno = EIO; + return -1; + } + + if (count > file->end - file->begin - file->pos) + count = file->end - file->begin - file->pos; + if (file->archive->is_gzipped == targz_growing) { + char *p = buffer; + int cnt = count; + int i = file->begin + file->pos, j; + + if (i % RECORDSIZE) { + j = RECORDSIZE - (i % RECORDSIZE); + if (cnt < j) + j = cnt; + bcopy (((char *) find_current_record (file->archive, i / RECORDSIZE * RECORDSIZE)) + (i % RECORDSIZE), + p, j); + cnt -= j; + p += j; + i += j; + } + while (cnt) { + if (cnt > RECORDSIZE) + j = RECORDSIZE; + else + j = cnt; + bcopy ((char *) find_current_record (file->archive, i), + p, j); + i += j; + p += j; + cnt -= j; + } + } + else if ((count = mc_read (file->archive->fd, buffer, count)) == -1) { + tarerrno = errno; + return -1; + } + file->pos += count; + return count; +} + +static int tar_close (void *data) +{ + struct tar_pseudofile *file; + + file = (struct tar_pseudofile *)data; + + file->archive->fd_usage--; + if (!file->archive->fd_usage) { + struct vfs_stamping *parent; + vfs *v; + + v = vfs_type (file->archive->name); + if (v == &local_vfs_ops) { + parent = NULL; + } else { + parent = xmalloc (sizeof (struct vfs_stamping), "vfs stamping"); + parent->v = v; + parent->next = 0; + parent->id = (*v->getid) (file->archive->name, &(parent->parent)); + } + vfs_add_noncurrent_stamps (&tarfs_vfs_ops, (vfsid) (file->archive), parent); + vfs_rm_parents (parent); + } + (file->entry->inode->is_open)--; + + free (data); + return 0; +} + +#define X_pseudofile tar_pseudofile +#define Xerrno tarerrno + +#define X_entry tarfs_entry +#define X_archive tarfs_archive +#define X_get_path tarfs_get_path +#define X_get_path_mangle tarfs_get_path_mangle +#define X_find_entry tarfs_find_entry +#define X_resolve_symlinks tarfs_resolve_symlinks +#define X_inode tarfs_inode +#define __X_find_entry __tarfs_find_entry +#define __X_resolve_symlinks __tarfs_resolve_symlinks +#define X_loop_protect tarfs_loop_protect + +#include "shared.c" + +static int tar_chmod (char *path, int mode) +{ /* Fixme: are you sure? IMO this is guaranteed to fail */ + return chmod (path, mode); +} + +static int tar_chown (char *path, int owner, int group) +{ /* Fixme: are you sure? IMO this is guaranteed to fail */ + return chown (path, owner, group); +} + +static int tar_unlink (char *path) +{ + return -1; +} + +static int tar_symlink (char *n1, char *n2) +{ + return -1; +} + +static int tar_write (void *data, char *buf, int nbyte) +{ + return -1; +} + +static int tar_rename (char *a, char *b) +{ + return -1; +} + +static int tar_chdir (char *path) +{ + struct tarfs_archive *archive; + char *q; + struct tarfs_entry *entry; + + tarerrno = ENOTDIR; + if ((q = tarfs_get_path_mangle (path, &archive, 1, 0)) == NULL) + return -1; + entry = tarfs_find_entry (archive->root_entry, q, 0, 0); + if (!entry) + return -1; + entry = tarfs_resolve_symlinks (entry); + if ((!entry) || (!S_ISDIR (entry->inode->mode))) + return -1; + entry->inode->archive->current_dir = entry; + tarerrno = 0; + return 0; +} + +static int tar_lseek (void *data, off_t offset, int whence) +{ + struct tar_pseudofile *file = (struct tar_pseudofile *) data; + + switch (whence) { + case SEEK_CUR: + offset += file->pos; break; + case SEEK_END: + offset += file->end - file->begin; break; + } + if (offset < 0) + file->pos = 0; + else if (offset < file->end - file->begin) + file->pos = offset; + else + file->pos = file->end; + return file->pos; +} + +static int tar_mknod (char *path, int mode, int dev) +{ + return -1; +} + +static int tar_link (char *p1, char *p2) +{ + return -1; +} + +static int tar_mkdir (char *path, mode_t mode) +{ + return -1; +} + +static int tar_rmdir (char *path) +{ + return -1; +} + +static vfsid tar_getid (char *path, struct vfs_stamping **parent) +{ + struct tarfs_archive *archive; + vfs *v; + vfsid id; + char *p; + struct vfs_stamping *par; + + *parent = NULL; + if (!(p = tarfs_get_path (path, &archive, 0, 1))) + return (vfsid) -1; + free(p); + v = vfs_type (archive->name); + id = (*v->getid) (archive->name, &par); + if (id != (vfsid)-1) { + *parent = xmalloc (sizeof (struct vfs_stamping), "vfs stamping"); + (*parent)->v = v; + (*parent)->id = id; + (*parent)->parent = par; + (*parent)->next = NULL; + } + return (vfsid) archive; +} + +static int tar_nothingisopen (vfsid id) +{ + if (((struct tarfs_archive *)id)->fd_usage <= 0) + return 1; + else + return 0; +} + +static void free_entry (struct tarfs_entry *e) +{ + int i = --(e->inode->nlink); + if (S_ISDIR (e->inode->mode) && e->inode->first_in_subdir != NULL) { + struct tarfs_entry *f = e->inode->first_in_subdir; + + e->inode->first_in_subdir = NULL; + free_entry (f); + } + if (i <= 0) { + if (e->inode->linkname != NULL) + free (e->inode->linkname); + if (e->inode->local_filename != NULL) { + unlink (e->inode->local_filename); + free (e->inode->local_filename); + } + free (e->inode); + } + if (e->next_in_dir != NULL) + free_entry (e->next_in_dir); + free (e->name); + free (e); +} + +static void tar_free (vfsid id) +{ + struct tarfs_archive *parc; + struct tarfs_archive *archive = (struct tarfs_archive *)id; + + free_entry (archive->root_entry); + if (archive == first_archive) { + first_archive = archive->next; + } else { + for (parc = first_archive; parc != NULL; parc = parc->next) + if (parc->next == archive) + break; + if (parc != NULL) + parc->next = archive->next; + } + free_archive (archive); +} + +static char *tar_getlocalcopy (char *path) +{ + struct tarfs_archive *archive; + char *p, *q; + struct tarfs_entry *entry; + char buf[MC_MAXPATHLEN]; + + strcpy( buf, path ); + if ((q = tarfs_get_path_mangle (path, &archive, 1, 0)) == NULL) + return NULL; + entry = tarfs_find_entry (archive->root_entry, q, 0, 0); + if (entry == NULL) + return NULL; + if ((entry = tarfs_resolve_symlinks (entry)) == NULL) + return NULL; + + if (entry->inode->local_filename != NULL) + return entry->inode->local_filename; + p = mc_def_getlocalcopy (buf); + if (p != NULL) { + entry->inode->local_filename = p; + } + return p; +} + +static void tar_ungetlocalcopy (char *path, char *local, int has_changed) +{ +/* We do just nothing. (We are read only and do not need to free local, + since it will be freed when tar archive will be freed */ +} + +#ifdef HAVE_MMAP +caddr_t tar_mmap (caddr_t addr, size_t len, int prot, int flags, void *data, off_t offset) +{ + return (caddr_t)-1; +} + +int tar_munmap (caddr_t addr, size_t len, void *data) +{ + return -1; +} +#endif + +vfs tarfs_vfs_ops = +{ + tar_open, + tar_close, + tar_read, + tar_write, /* unimplemented */ + + s_opendir, + s_readdir, + s_closedir, + s_telldir, + s_seekdir, + + s_stat, + s_lstat, + s_fstat, + + tar_chmod, + tar_chown, + NULL, + + s_readlink, + tar_symlink, /* unimplemented */ + tar_link, /* unimplemented */ + tar_unlink, /* unimplemented */ + + tar_rename, /* unimplemented */ + tar_chdir, + s_errno, + tar_lseek, + tar_mknod, /* unipmelemented */ + + tar_getid, + tar_nothingisopen, + tar_free, + + tar_getlocalcopy, + tar_ungetlocalcopy, + + tar_mkdir, /* unimplemented */ + tar_rmdir, /* unimplemented */ + NULL, + NULL, + NULL +#ifdef HAVE_MMAP + , tar_mmap, /* unimplemented */ + tar_munmap /* unimplemented */ +#endif +}; diff -uNr gnome-libs-0.26/libvfs/tar.h gnome-libs-0.27/libvfs/tar.h --- gnome-libs-0.26/libvfs/tar.h Wed Dec 31 19:00:00 1969 +++ gnome-libs-0.27/libvfs/tar.h Thu Jul 23 14:08:52 1998 @@ -0,0 +1,235 @@ +/* Declarations for the tarfs. + Copyright (C) 1995 The Free Software Foundation + + Written by: 1995 Jakub Jelinek + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to + the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ + +#if 0 +#include "testpad.h" +#else +#define NEEDPAD +#endif + +#include + +/* major() and minor() macros (among other things) defined here for hpux */ +#ifdef hpux +#include +#endif + +/* + * Header block on tape. + * + * I'm going to use traditional DP naming conventions here. + * A "block" is a big chunk of stuff that we do I/O on. + * A "record" is a piece of info that we care about. + * Typically many "record"s fit into a "block". + */ +#define RECORDSIZE 512 +#define NAMSIZ 100 +#define TUNMLEN 32 +#define TGNMLEN 32 +#define SPARSE_EXT_HDR 21 +#define SPARSE_IN_HDR 4 + +struct sparse { + char offset[12]; + char numbytes[12]; +}; + +struct sp_array { + int offset; + int numbytes; +}; + +union record { + char charptr[RECORDSIZE]; + struct header { + char arch_name[NAMSIZ]; + char mode[8]; + char uid[8]; + char gid[8]; + char size[12]; + char mtime[12]; + char chksum[8]; + char linkflag; + char arch_linkname[NAMSIZ]; + char magic[8]; + char uname[TUNMLEN]; + char gname[TGNMLEN]; + char devmajor[8]; + char devminor[8]; + /* these following fields were added by JF for gnu */ + /* and are NOT standard */ + char atime[12]; + char ctime[12]; + char offset[12]; + char longnames[4]; +#ifdef NEEDPAD + char pad; +#endif + struct sparse sp[SPARSE_IN_HDR]; + char isextended; + char realsize[12]; /* true size of the sparse file */ + /* char ending_blanks[12];*//* number of nulls at the + end of the file, if any */ + } header; + struct extended_header { + struct sparse sp[21]; + char isextended; + } ext_hdr; +}; + +/* The checksum field is filled with this while the checksum is computed. */ +#define CHKBLANKS " " /* 8 blanks, no null */ + +/* The magic field is filled with this if uname and gname are valid. */ +#define TMAGIC "ustar " /* 7 chars and a null */ + +/* The linkflag defines the type of file */ +#define LF_OLDNORMAL '\0' /* Normal disk file, Unix compat */ +#define LF_NORMAL '0' /* Normal disk file */ +#define LF_LINK '1' /* Link to previously dumped file */ +#define LF_SYMLINK '2' /* Symbolic link */ +#define LF_CHR '3' /* Character special file */ +#define LF_BLK '4' /* Block special file */ +#define LF_DIR '5' /* Directory */ +#define LF_FIFO '6' /* FIFO special file */ +#define LF_CONTIG '7' /* Contiguous file */ +/* Further link types may be defined later. */ + +/* Note that the standards committee allows only capital A through + capital Z for user-defined expansion. This means that defining something + as, say '8' is a *bad* idea. */ +#define LF_DUMPDIR 'D' /* This is a dir entry that contains + the names of files that were in + the dir at the time the dump + was made */ +#define LF_LONGLINK 'K' /* Identifies the NEXT file on the tape + as having a long linkname */ +#define LF_LONGNAME 'L' /* Identifies the NEXT file on the tape + as having a long name. */ +#define LF_MULTIVOL 'M' /* This is the continuation + of a file that began on another + volume */ +#define LF_NAMES 'N' /* For storing filenames that didn't + fit in 100 characters */ +#define LF_SPARSE 'S' /* This is for sparse files */ +#define LF_VOLHDR 'V' /* This file is a tape/volume header */ +/* Ignore it on extraction */ + +/* + * Exit codes from the "tar" program + */ +#define EX_SUCCESS 0 /* success! */ +#define EX_ARGSBAD 1 /* invalid args */ +#define EX_BADFILE 2 /* invalid filename */ +#define EX_BADARCH 3 /* bad archive */ +#define EX_SYSTEM 4 /* system gave unexpected error */ +#define EX_BADVOL 5 /* Special error code means + Tape volume doesn't match the one + specified on the command line */ + +/* + * We default to Unix Standard format rather than 4.2BSD tar format. + * The code can actually produce all three: + * f_standard ANSI standard + * f_oldarch V7 + * neither 4.2BSD + * but we don't bother, since 4.2BSD can read ANSI standard format anyway. + * The only advantage to the "neither" option is that we can cmp our + * output to the output of 4.2BSD tar, for debugging. + */ +#define f_standard (!f_oldarch) + +#ifndef TAR_NAMES + +struct tarfs_inode; + +struct tarfs_entry { + int has_changed; + long header_offset; /* -1 if not in stored in archive */ + int header_size; + struct tarfs_entry *next_in_dir; + struct tarfs_entry *dir; + long extended_offset; /* -1 if not present */ + int extended_size; + + char *name; + struct tarfs_inode *inode; +}; + +struct tarfs_archive; + +struct tarfs_inode { + int has_changed; + int is_open; + nlink_t nlink; + struct tarfs_entry *first_in_subdir; /* only used if linkflag == L_DIR */ + struct tarfs_entry *last_in_subdir; + long data_offset; + char *local_filename; + ino_t inode; /* This is inode # */ + dev_t dev; /* This is an internal identification of the tar archive */ + struct tarfs_archive *archive; /* And this is an archive structure */ + dev_t rdev; + int std; /* 0 if old Unix inode */ + + umode_t mode; + uid_t uid; + gid_t gid; + int size; + time_t mtime; + char linkflag; + char *linkname; + time_t atime; + time_t ctime; +}; + +struct tarfs_archive { + char *name; + struct stat tarstat; + int is_gzipped; + dev_t rdev; + ino_t __inode_counter; + struct tarfs_entry *root_entry; + struct tarfs_entry *current_dir; + struct tarfs_archive *next; + long current_tar_position; + int fd; + int fd_usage; /* Zero means fd is invalid, otherwise is number of + pseudofiles that have the archive open */ + char *tmpname; /* For case of is_gzipped == 2 */ +/* This part is only for gzipped archives: (growable buffers) */ + union record *block_first; + int count_first; /* In records */ + union record **block_ptr; + int count_blocks; /* In blocks */ + union record *current_record; /* position when reading */ +}; + +/* This constant determines how many RECORDSIZE blocks are in one growing + chunk */ +#define TAR_GROWING_CHUNK_SIZE 64 + +enum { + tar_normal, + targz_growing, + tar_uncompressed_local +}; + +#endif /* ! TAR_NAMES */ + diff -uNr gnome-libs-0.26/libvfs/tcputil.c gnome-libs-0.27/libvfs/tcputil.c --- gnome-libs-0.26/libvfs/tcputil.c Wed Dec 31 19:00:00 1969 +++ gnome-libs-0.27/libvfs/tcputil.c Thu Jul 23 14:08:53 1998 @@ -0,0 +1,290 @@ +/* Server for the Midnight Commander Virtual File System. + Routines for the tcp connection, includes the primitive rpc routines. + + Copyright (C) 1995, 1996 Miguel de Icaza + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef HAVE_PMAP_SET +#include +#include +#ifdef HAVE_RPC_PMAP_CLNT_H +#include +#endif +#endif + +#ifdef USE_TERMNET +#include +#endif + +#include +#include "tcputil.h" +#include "../src/dialog.h" /* for message () */ +#include "../src/mem.h" /* for bcopy */ +#include "../src/util.h" /* for unix_error_string */ +#include "../src/mad.h" +#include "mcfs.h" /* for mcserver_port definition */ + +#define CHECK_SIG_PIPE(sock) if (got_sigpipe) \ + { tcp_invalidate_socket (sock); return got_sigpipe = 0; } + +extern void tcp_invalidate_socket (int); +extern void vfs_die (char *); + +int got_sigpipe; + +/* Reads a block on dest for len bytes from sock */ +/* Returns a boolean indicating the success status */ +int socket_read_block (int sock, char *dest, int len) +{ + int nread, n; + + for (nread = 0; nread < len;){ + n = read (sock, dest+nread, len-nread); + if (n <= 0){ + tcp_invalidate_socket (sock); + return 0; + } + nread += n; + } + return 1; +} + +int socket_write_block (int sock, char *buffer, int len) +{ + int left, status; + + for (left = len; left > 0;){ + status = write (sock, buffer, left); + CHECK_SIG_PIPE (sock); + if (status < 0) + return 0; + left -= status; + buffer += status; + } + return 1; +} + +int send_string (int sock, char *string) +{ + return socket_write_block (sock, string, strlen (string)); +} + +int rpc_send (int sock, ...) +{ + long int tmp, len, cmd; + char *text; + va_list ap; + + va_start (ap, sock); + + for (;;){ + cmd = va_arg (ap, int); + switch (cmd){ + case RPC_END: + va_end (ap); + return 1; + + case RPC_INT: + tmp = htonl (va_arg (ap, int)); + write (sock, &tmp, sizeof (tmp)); + CHECK_SIG_PIPE (sock); + break; + + case RPC_STRING: + text = va_arg (ap, char *); + len = strlen (text); + tmp = htonl (len); + write (sock, &tmp, sizeof (tmp)); + CHECK_SIG_PIPE (sock); + write (sock, text, len); + CHECK_SIG_PIPE (sock); + break; + + case RPC_BLOCK: + len = va_arg (ap, int); + text = va_arg (ap, char *); + tmp = htonl (len); + write (sock, text, len); + CHECK_SIG_PIPE (sock); + break; + + default: + vfs_die ("Unknown rpc message\n"); + } + } +} + +typedef struct sock_callback_t { + int sock; + void (*cback)(int); + struct sock_callback_t *link; +} sock_callback_t; + +sock_callback_t *sock_callbacks = 0; + +static void check_hooks (int sock) +{ + sock_callback_t *callback, *prev; + + for (prev=callback = sock_callbacks; callback; callback = callback->link){ + if (callback->sock != sock){ + prev = callback; + continue; + } + callback->sock = -1; + (callback->cback)(sock); + if (callback == sock_callbacks){ + sock_callbacks = callback->link; + } else { + prev->link = callback->link; + } + free (callback); + return; + } +} + +int rpc_get (int sock, ...) +{ + long int tmp, len; + char *text, **str_dest; + int *dest, cmd; + va_list ap; + + va_start (ap, sock); + + check_hooks (sock); + + for (;;){ + cmd = va_arg (ap, int); + switch (cmd){ + case RPC_END: + va_end (ap); + return 1; + + case RPC_INT: + if (socket_read_block (sock, (char *) &tmp, sizeof (tmp)) == 0) + return 0; + dest = va_arg (ap, int *); + *dest = ntohl (tmp); + break; + + /* returns an allocated string */ + case RPC_LIMITED_STRING: + case RPC_STRING: + if (socket_read_block (sock, (char *)&tmp, sizeof (tmp)) == 0) + return 0; + len = ntohl (tmp); + if (cmd == RPC_LIMITED_STRING) + if (len > 16*1024){ + /* silently die */ + abort (); + } + if (len > 128*1024) + abort (); + text = malloc (len+1); + if (socket_read_block (sock, text, len) == 0) + return 0; + str_dest = va_arg (ap, char **); + *str_dest = text; + text [len] = 0; + break; + + case RPC_BLOCK: + len = va_arg (ap, int); + text = va_arg (ap, char *); + if (socket_read_block (sock, text, len) == 0) + return 0; + break; + + default: + vfs_die ("Unknown rpc message\n"); + } + } +} + +void rpc_add_get_callback (int sock, void (*cback)(int)) +{ + sock_callback_t *new; + + new = malloc (sizeof (sock_callback_t)); + new->cback = cback; + new->sock = sock; + new->link = sock_callbacks; + sock_callbacks = new; +} + +#if defined(IS_AIX) || defined(linux) || defined(SCO_FLAVOR) || defined(__QNX__) +static void sig_pipe (int unused) +#else +static void sig_pipe (void) +#endif +{ + got_sigpipe = 1; +} + +void tcp_init (void) +{ + struct sigaction sa; + + got_sigpipe = 0; + sa.sa_handler = sig_pipe; + sa.sa_flags = 0; + sigemptyset (&sa.sa_mask); + sigaction (SIGPIPE, &sa, NULL); +} + +int get_remote_port (struct sockaddr_in *sin, int *version) +{ +#ifdef HAVE_PMAP_GETMAPS + int port; + struct pmaplist *pl; + + *version = 1; + port = mcserver_port; + for (pl = pmap_getmaps (sin); pl; pl = pl->pml_next) + if (pl->pml_map.pm_prog == RPC_PROGNUM && + pl->pml_map.pm_prot == IPPROTO_TCP && + pl->pml_map.pm_vers >= *version) { + *version = pl->pml_map.pm_vers; + port = pl->pml_map.pm_port; + } + return port; +#else +#ifdef HAVE_PMAP_GETPORT + int port; + for (*version = RPC_PROGVER; *version >= 1; (*version)--) + if (port = pmap_getport (sin, RPC_PROGNUM, *version, IPPROTO_TCP)) + return port; +#endif /* HAVE_PMAP_GETPORT */ +#endif /* HAVE_PMAP_GETMAPS */ + *version = 1; + return mcserver_port; +} + + diff -uNr gnome-libs-0.26/libvfs/tcputil.h gnome-libs-0.27/libvfs/tcputil.h --- gnome-libs-0.26/libvfs/tcputil.h Wed Dec 31 19:00:00 1969 +++ gnome-libs-0.27/libvfs/tcputil.h Thu Jul 23 14:08:53 1998 @@ -0,0 +1,29 @@ +/* Operations of the rpc manager */ + +#include /* For sockaddr_in needed by get_remote_port */ + +/* Please note that the RPC manager does not use integers, it only uses */ +/* 4-byte integers for the comunication */ +enum { + RPC_END, /* End of RPC commands */ + RPC_INT, /* Next argument is integer */ + RPC_STRING, /* Next argument is a string */ + RPC_BLOCK, /* Next argument is a len/block */ + RPC_LIMITED_STRING /* same as STRING, but has a limit on the size it accepts */ +}; + +int rpc_get (int sock, ...); +int rpc_send (int sock, ...); +void rpc_add_get_callback (int sock, void (*cback)(int)); +int socket_read_block (int sock, char *dest, int len); +int socket_write_block (int sock, char *buffer, int len); +int send_string (int sock, char *string); +void tcp_init (void); +int get_remote_port (struct sockaddr_in *sin, int *version); +int open_tcp_link (char *host, int *port, int *version, char *caller); +char *get_host_and_username (char *path, char **host, char **user, int *port, + int default_port, int default_to_anon, char **pass); + +extern int tcp_inited; +extern int use_netrc; +extern int got_sigpipe; diff -uNr gnome-libs-0.26/libvfs/undelfs.c gnome-libs-0.27/libvfs/undelfs.c --- gnome-libs-0.26/libvfs/undelfs.c Wed Dec 31 19:00:00 1969 +++ gnome-libs-0.27/libvfs/undelfs.c Thu Jul 23 14:08:53 1998 @@ -0,0 +1,810 @@ +/* UnDel File System: Midnight Commander file system. + + This file system is intended to be used together with the + ext2fs library to recover files from ext2fs file systems. + + Parts of this program were taken from the lsdel.c and dump.c files + written by Ted Ts'o (tytso@mit.edu) for the ext2fs package. + + Copyright (C) 1995, 1997 the Free Software Foundation + Written by: 1995 Miguel de Icaza. + 1997 Norbert Warmuth. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ + +/* Assumptions: + * + * 1. We don't handle directories (thus undelfs_getpath is easy to write). + * 2. Files are on the local file system (we do not support vfs files + * because we would have to provide an io_manager for the ext2fs tools, + * and I don't think it would be too useful to undelete files + */ + +#include +#include +#include "../src/fs.h" +#include "../src/mad.h" +#include "../src/util.h" + +#include "../src/mem.h" +#include "vfs.h" + +#include +#include +#include +#include +/* asm/types.h defines its own umode_t :-( */ +#undef umode_t +#include +#include +#include + +void print_vfs_message(char *, ...); + +struct deleted_info { + ino_t ino; + unsigned short mode; + unsigned short uid; + unsigned short gid; + unsigned long size; + time_t dtime; + int num_blocks; + int free_blocks; +}; + +struct lsdel_struct { + ino_t inode; + int num_blocks; + int free_blocks; + int bad_blocks; +}; + +/* We only allow one opened ext2fs */ +static char *ext2_fname; +static ext2_filsys fs = NULL; +static struct lsdel_struct lsd; +static struct deleted_info *delarray; +static int num_delarray, max_delarray; +static char *block_buf; +static char *undelfserr = " undelfs: error "; +static int readdir_ptr; +static int undelfs_usage; + +/* To generate the . and .. entries use -2 */ +#define READDIR_PTR_INIT 0 + +static void +undelfs_shutdown () +{ + if (fs) + ext2fs_close (fs); + fs = 0; + if (ext2_fname) + free (ext2_fname); + ext2_fname = 0; + if (delarray) + free (delarray); + delarray = 0; + if (block_buf) + free (block_buf); + block_buf = 0; +} + +static void +undelfs_get_path (char *dirname, char **ext2_fname, char **file) +{ + char *p; + + *ext2_fname = 0; + + if (strncmp (dirname, "undel:", 6)) + return; + else + dirname += 6; + + /* Since we don't allow subdirectories, it's easy to get a filename, + * just scan backwards for a slash + */ + if (*dirname == 0) + return; + + p = dirname + strlen (dirname); + if (p - dirname > 2 && *(p-1) == '/' && *(p-2) == '.') + *(p = p-2) = 0; + + while (p > dirname){ + if (*p == '/'){ + *file = strdup (p+1); + *p = 0; + *ext2_fname = strdup (dirname); + *p = '/'; + return; + } + p--; + } +} + +static int +lsdel_proc(ext2_filsys fs, blk_t *block_nr, int blockcnt, void *private) +{ + struct lsdel_struct *lsd = (struct lsdel_struct *) private; + + lsd->num_blocks++; + + if (*block_nr < fs->super->s_first_data_block || + *block_nr >= fs->super->s_blocks_count) { + lsd->bad_blocks++; + return BLOCK_ABORT; + } + + if (!ext2fs_test_block_bitmap(fs->block_map,*block_nr)) + lsd->free_blocks++; + + return 0; +} + +/* We don't use xmalloc, since we want to recover and not abort the program + * if we don't have enough memory + */ +static int +undelfs_loaddel () +{ + int retval, count; + ino_t ino; + struct ext2_inode inode; + ext2_inode_scan scan; + + max_delarray = 100; + num_delarray = 0; + delarray = malloc(max_delarray * sizeof(struct deleted_info)); + if (!delarray) { + message_1s (1, undelfserr, " not enough memory "); + return 0; + } + block_buf = malloc(fs->blocksize * 3); + if (!block_buf) { + message_1s (1, undelfserr, " while allocating block buffer "); + goto free_delarray; + } + if ((retval = ext2fs_open_inode_scan(fs, 0, &scan))){ + message_1s1d (1, undelfserr, " open_inode_scan: %d ", retval); + goto free_block_buf; + } + if ((retval = ext2fs_get_next_inode(scan, &ino, &inode))){ + message_1s1d (1, undelfserr, " while starting inode scan %d ", retval); + goto error_out; + } + + count = 0; + while (ino) { + if ((count++ % 1024) == 0) + print_vfs_message ("undelfs: loading deleted files information %d inodes", count); + if (inode.i_dtime == 0) + goto next; + + if (S_ISDIR(inode.i_mode)) + goto next; + + lsd.inode = ino; + lsd.num_blocks = 0; + lsd.free_blocks = 0; + lsd.bad_blocks = 0; + + retval = ext2fs_block_iterate(fs, ino, 0, block_buf, + lsdel_proc, &lsd); + if (retval) { + message_1s1d (1, undelfserr, " while calling ext2_block_iterate %d ", retval); + goto next; + } + if (lsd.free_blocks && !lsd.bad_blocks) { + if (num_delarray >= max_delarray) { + max_delarray += 50; + delarray = realloc(delarray, + max_delarray * sizeof(struct deleted_info)); + if (!delarray) { + message_1s (1, undelfserr, " no more memory while reallocating array "); + goto error_out; + } + } + + delarray[num_delarray].ino = ino; + delarray[num_delarray].mode = inode.i_mode; + delarray[num_delarray].uid = inode.i_uid; + delarray[num_delarray].gid = inode.i_gid; + delarray[num_delarray].size = inode.i_size; + delarray[num_delarray].dtime = inode.i_dtime; + delarray[num_delarray].num_blocks = lsd.num_blocks; + delarray[num_delarray].free_blocks = lsd.free_blocks; + num_delarray++; + } + + next: + retval = ext2fs_get_next_inode(scan, &ino, &inode); + if (retval) { + message_1s1d(1, undelfserr, " while doing inode scan %d ", retval); + goto error_out; + } + } + readdir_ptr = READDIR_PTR_INIT; + ext2fs_close_inode_scan (scan); + return 1; + +error_out: + ext2fs_close_inode_scan (scan); +free_block_buf: + free (block_buf); + block_buf = 0; +free_delarray: + free (delarray); + delarray = 0; + return 0; +} + +void com_err (const char *str, long err_code, const char *s2, ...) +{ + char *cptr; + + cptr = xmalloc (strlen (s2) + strlen (str) + 60, "com_err"); + sprintf (cptr, " %s (%s: %ld) ", s2, str, err_code); + message_1s (1, " Ext2lib error ", cptr); + free (cptr); +} + +static void * +undelfs_opendir (char *dirname) +{ + char *file, *f; + + undelfs_get_path (dirname, &file, &f); + if (!file) + return 0; + + /* We don't use the file name */ + free (f); + + if (!ext2_fname || strcmp (ext2_fname, file)){ + undelfs_shutdown (); + ext2_fname = file; + } else { + /* To avoid expensive re-scannings */ + readdir_ptr = READDIR_PTR_INIT; + free (file); + return fs; + } + + if (ext2fs_open (ext2_fname, 0, 0, 0, unix_io_manager, &fs)){ + message_2s (1, undelfserr, " Could not open file %s ", ext2_fname); + return 0; + } + print_vfs_message ("undelfs: reading inode bitmap..."); + if (ext2fs_read_inode_bitmap (fs)){ + message_2s (1, undelfserr, + " Could not load inode bitmap from: \n %s \n", ext2_fname); + goto quit_opendir; + } + print_vfs_message ("undelfs: reading block bitmap..."); + if (ext2fs_read_block_bitmap (fs)){ + message_2s (1, undelfserr, + " Could not load block bitmap from: \n %s \n", ext2_fname); + goto quit_opendir; + } + /* Now load the deleted information */ + if (!undelfs_loaddel ()) + goto quit_opendir; + print_vfs_message ("undelfs: done."); + return fs; +quit_opendir: + print_vfs_message ("undelfs: failure"); + ext2fs_close (fs); + fs = NULL; + return 0; +} + +/* Explanation: + * On some operating systems (Slowaris 2 for example) + * the d_name member is just a char long (Nice trick that break everything, + * so we need to set up some space for the filename. + */ +static struct { + struct dirent dent; +#ifdef NEED_EXTRA_DIRENT_BUFFER + char extra_buffer [MC_MAXPATHLEN]; +#endif +} undelfs_readdir_data; + +static void * +undelfs_readdir (void *vfs_info) +{ + char *dirent_dest; + + if (vfs_info != fs){ + message_1s (1, " delfs: internal error ", + " vfs_info is not fs! "); + return NULL; + } + if (readdir_ptr == num_delarray) + return NULL; + dirent_dest = &(undelfs_readdir_data.dent.d_name [0]); + if (readdir_ptr < 0) + sprintf (dirent_dest, "%s", readdir_ptr == -2 ? "." : ".."); + else + sprintf (dirent_dest, "%ld:%d", + (long)delarray [readdir_ptr].ino, + delarray [readdir_ptr].num_blocks); + readdir_ptr++; + +#ifndef DIRENT_LENGTH_COMPUTED + undelfs_readdir_data.dent.d_namlen = strlen (undelfs_readdir_data.dent.d_name); +#endif + return &undelfs_readdir_data; +} + +static int +undelfs_closedir (void *vfs_info) +{ + return 0; +} + +typedef struct { + int f_index; /* file index into delarray */ + char *buf; + int error_code; /* */ + int pos; /* file position */ + int current; /* used to determine current position in itereate */ + int finished; + ino_t inode; + int bytes_read; + long size; + + /* Used by undelfs_read: */ + char *dest_buffer; /* destination buffer */ + int count; /* bytes to read */ +} undelfs_file; + +/* We do not support lseek */ +static void * +undelfs_open (char *fname, int flags, int mode) +{ + char *file, *f; + ino_t inode, i; + undelfs_file *p; + + /* Only allow reads on this file system */ + undelfs_get_path (fname, &file, &f); + if (!file) + return 0; + + if (!ext2_fname || strcmp (ext2_fname, file)){ + message_1s (1, undelfserr, " You have to chdir to extract files first "); + free (file); + free (f); + return 0; + } + inode = atol (f); + + /* Search the file into delarray */ + for (i = 0; i < num_delarray; i++){ + if (inode != delarray [i].ino) + continue; + + /* Found: setup all the structures needed by read */ + p = (void *) malloc (sizeof (undelfs_file)); + if (!p){ + free (file); + free (f); + return 0; + } + p->buf = malloc(fs->blocksize); + if (!p->buf){ + free (p); + free (file); + free (f); + return 0; + } + p->inode = inode; + p->finished = 0; + p->f_index = i; + p->error_code = 0; + p->pos = 0; + p->size = delarray [i].size; + } + free (file); + free (f); + undelfs_usage++; + return p; +} + +static int +undelfs_close (void *vfs_info) +{ + undelfs_file *p = vfs_info; + free (p->buf); + free (p); + undelfs_usage--; + return 0; +} + +static int +dump_read(ext2_filsys fs, blk_t *blocknr, int blockcnt, void *private) +{ + int copy_count; + undelfs_file *p = (undelfs_file *) private; + + if (blockcnt < 0) + return 0; + + if (*blocknr) { + p->error_code = io_channel_read_blk(fs->io, *blocknr, + 1, p->buf); + if (p->error_code) + return BLOCK_ABORT; + } else + memset(p->buf, 0, fs->blocksize); + + if (p->pos + p->count < p->current){ + p->finished = 1; + return BLOCK_ABORT; + } + if (p->pos > p->current + fs->blocksize){ + p->current += fs->blocksize; + return 0; /* we have not arrived yet */ + } + + /* Now, we know we have to extract some data */ + if (p->pos >= p->current){ + + /* First case: starting pointer inside this block */ + if (p->pos + p->count <= p->current + fs->blocksize){ + /* Fully contained */ + copy_count = p->count; + p->finished = p->count; + } else { + /* Still some more data */ + copy_count = fs->blocksize-(p->pos-p->current); + } + memcpy (p->dest_buffer, p->buf + (p->pos-p->current), copy_count); + } else { + /* Second case: we already have passed p->pos */ + if (p->pos+p->count < p->current+fs->blocksize){ + copy_count = (p->pos + p->count) - p->current; + p->finished = p->count; + } else { + copy_count = fs->blocksize; + } + memcpy (p->dest_buffer, p->buf, copy_count); + } + p->dest_buffer += copy_count; + p->current += fs->blocksize; + if (p->finished){ + return BLOCK_ABORT; + } + return 0; +} + +static int +undelfs_read (void *vfs_info, char *buffer, int count) +{ + undelfs_file *p = vfs_info; + int retval; + + p->dest_buffer = buffer; + p->current = 0; + p->finished = 0; + p->count = count; + + if (p->pos + p->count > p->size){ + p->count = p->size - p->pos; + } + retval = ext2fs_block_iterate(fs, p->inode, 0, NULL, + dump_read, p); + if (retval){ + message_1s (1, undelfserr, " while iterating over blocks "); + return -1; + } + if (p->error_code && !p->finished) + return 0; + p->pos = p->pos + (p->dest_buffer - buffer); + return p->dest_buffer - buffer; +} + +static int +undelfs_write (void *vfs_info, char *buf, int count) +{ + /* No writes allowed */ + return -1; +} + +static long +undelfs_getindex (char *path) +{ + ino_t inode = atol (path); + int i; + + for (i = 0; i < num_delarray; i++){ + if (delarray [i].ino == inode) + return i; + } + return -1; +} + +static int +do_stat (int inode_index, struct stat *buf) +{ + buf->st_dev = 0; + buf->st_ino = delarray [inode_index].ino; + buf->st_mode = delarray [inode_index].mode; + buf->st_nlink = 1; + buf->st_uid = delarray [inode_index].uid; + buf->st_gid = delarray [inode_index].gid; + buf->st_size = delarray [inode_index].size; + buf->st_atime = delarray [inode_index].dtime; + buf->st_ctime = delarray [inode_index].dtime; + buf->st_mtime = delarray [inode_index].dtime; + return 0; +} + +static int +undelfs_lstat(char *path, struct stat *buf) +{ + int inode_index; + char *file, *f; + + undelfs_get_path (path, &file, &f); + if (!file) + return 0; + + /* When called from save_cwd_stats we get an incorrect file and f here: + e.g. incorrect correct + path = "undel:/dev/sda1" path="undel:/dev/sda1/401:1" + file = "/dev" file="/dev/sda1" + f = "sda1" f ="401:1" + If the first char in f is no digit -> return error */ + if (!isdigit (*f)) { + free (file); + free (f); + return -1; + } + + if (!ext2_fname || strcmp (ext2_fname, file)){ + message_1s (1, undelfserr, " You have to chdir to extract files first "); + free (file); + free (f); + return 0; + } + inode_index = undelfs_getindex (f); + free (file); + free (f); + + if (inode_index == -1) + return -1; + + return do_stat (inode_index, buf); +} + +static int +undelfs_stat(char *path, struct stat *buf) +{ + return undelfs_lstat (path, buf); +} + + +static int +undelfs_fstat (void *vfs_info, struct stat *buf) +{ + undelfs_file *p = vfs_info; + + return do_stat (p->f_index, buf); +} + +static int +undelfs_chmod(char *path, int mode) +{ + return -1; +} + +static int +undelfs_chown(char *path, int owner, int group) +{ + return -1; +} + +static int +undelfs_readlink(char *path, char *buf, int size) +{ + return -1; +} + +static int +undelfs_symlink(char *n1, char *n2) +{ + return -1; +} + +static int +undelfs_link(char *p1, char *p2) +{ + return -1; +} + +static int +undelfs_unlink(char *path) +{ + return -1; +} + +static int +undelfs_rename(char *p1, char *p2) +{ + return -1; +} + +static int +undelfs_chdir(char *path) +{ + char *file, *f; + int fd; + + undelfs_get_path (path, &file, &f); + if (!file) + return -1; + + /* We may use access because ext2 file systems are local */ + /* this could be fixed by making an ext2fs io manager to use */ + /* our vfs, but that is left as an excercise for the reader */ + if ((fd = open (file, O_RDONLY)) == -1){ + message_2s (1, undelfserr, " Could not open file: %s ", file); + free (f); + free (file); + return -1; + } + close (fd); + free (f); + free (file); + return 0; +} + +static int +undelfs_ferrno(void) +{ + return -1; +} + +static int +undelfs_lseek(void *vfs_info, off_t offset, int whence) +{ + return -1; +} + +static int +undelfs_mknod(char *path, int mode, int dev) +{ + return -1; +} + +static vfsid +undelfs_getid(char *path, struct vfs_stamping **parent) +{ + char *ext2_fname, *file; + + /* We run only on the local fs */ + *parent = NULL; + undelfs_get_path (path, &ext2_fname, &file); + + if (!ext2_fname) + return (vfsid) -1; + free (ext2_fname); + free (file); + return (vfsid)0; +} + +static int +undelfs_nothingisopen(vfsid id) +{ + return !undelfs_usage; +} + +static void +undelfs_free(vfsid id) +{ + undelfs_shutdown (); +} + +static char * +undelfs_getlocalcopy(char *filename) +{ + return 0; +} + +static void +undelfs_ungetlocalcopy(char *filename, char *local, int has_changed) +{ +} + +static int +undelfs_mkdir(char *path, mode_t mode) +{ + return -1; +} + +static int +undelfs_rmdir(char *path) +{ + return -1; +} + + +#ifdef HAVE_MMAP +static caddr_t +undelfs_mmap(caddr_t addr, size_t len, int prot, int flags, void *vfs_info, off_t offset) +{ + return (caddr_t) -1; +} + +static int +undelfs_munmap(caddr_t addr, size_t len, void *vfs_info) +{ + return -1; +} +#endif + + +vfs undelfs_vfs_ops = { + undelfs_open, + undelfs_close, + undelfs_read, + undelfs_write, + + undelfs_opendir, + undelfs_readdir, + undelfs_closedir, + NULL, + NULL, + + undelfs_stat, + undelfs_lstat, + undelfs_fstat, + + undelfs_chmod, + undelfs_chown, + NULL, + + undelfs_readlink, + undelfs_symlink, + undelfs_link, + undelfs_unlink, + + undelfs_rename, + undelfs_chdir, + undelfs_ferrno, + undelfs_lseek, + undelfs_mknod, + + undelfs_getid, + undelfs_nothingisopen, + undelfs_free, + + undelfs_getlocalcopy, + undelfs_ungetlocalcopy, + + undelfs_mkdir, + undelfs_rmdir, + NULL, + NULL, + NULL +#ifdef HAVE_MMAP + , undelfs_mmap, + undelfs_munmap +#endif +}; diff -uNr gnome-libs-0.26/libvfs/util-alone.c gnome-libs-0.27/libvfs/util-alone.c --- gnome-libs-0.26/libvfs/util-alone.c Wed Dec 31 19:00:00 1969 +++ gnome-libs-0.27/libvfs/util-alone.c Thu Jul 23 14:08:53 1998 @@ -0,0 +1,189 @@ +/* + * This is for making midnight commander's vfs stuff compile stand-alone + */ + +#include +#include +#if defined(__os2__) /* OS/2 need io.h! .ado */ +# include +#endif +#include +#include +#ifdef HAVE_UNISTD_H +#include +#endif +#include +#include /* my_system */ +#include /* INT_MAX */ +#ifndef SCO_FLAVOR +# include /* alex: sys/select.h defines struct timeval */ +#endif /* SCO_FLAVOR */ +#include +#include +#include +#include +#include /* my_system */ +#ifdef SCO_FLAVOR +# include /* alex: for struct timeb, used in time.h */ +#endif /* SCO_FLAVOR */ +#include +#ifndef OS2_NT +# include +# include +#endif +#include +#include +#ifdef HAVE_SYS_SELECT_H +# include +#endif + +#ifdef __linux__ +# if defined(__GLIBC__) && (__GLIBC__ < 2) +# include /* This is needed for TIOCLINUX */ +# else +# include +# endif +# include +#endif + +#include "../src/util.h" +#include "vfs.h" +#include "callback.h" + +int source_route = 0; +int cd_symlinks = 0; + +/* + * Required functions to make mc's vfs layer compile stand-alone + */ + +void *do_xmalloc (int size) +{ + void *m = malloc (size); + + if (!m) + vfs_die ("Memory exhausted\n"); + return m; +} + +/* + * We do not want/need many of midnight's functions, stub routines. + */ + +void +enable_interrupt_key (void) +{ +} + +void +disable_interrupt_key (void) +{ +} + +int got_interrupt (void) +{ + return 0; +} + +void +rotate_dash (void) +{ +} + +char * +load_anon_passwd (void) +{ + return NULL; +} + +static char (*callbacks[NUM_CALLBACKS])(char *msg); + +void +vfs_set_callback (int num, void *func) +{ + if (num >= NUM_CALLBACKS) + vfs_die ("Attempt to set invalid callback.\n"); + callbacks [num] = func; +} + +static void +info_puts( char *s ) +{ + if (!callbacks [CALL_INFO]) + fprintf (stderr, "%s\n", s); + else + callbacks [CALL_INFO](s); +} + +static void +box_puts( char *s ) +{ + if (!callbacks [CALL_BOX]) + fprintf (stderr, "%s\n", s); + else + callbacks [CALL_BOX](s); +} + +char * +vfs_get_password (char *msg) +{ + if (!callbacks [CALL_PASSWD]) + return NULL; + else + callbacks [CALL_PASSWD](msg); +} + +void +print_vfs_message (char *msg, ...) +{ + char buf [4096]; + + va_list args; + + va_start (args,msg); + vsnprintf (buf, sizeof (buf), msg, args); + info_puts (buf); + va_end (args); +} + +void +wipe_password (char *passwd) +{ + char *p = passwd; + + for (;*p; p++) + *p = 0; + free (passwd); +} + +int +exist_file (char *name) +{ + return access (name, R_OK) == 0; +} + +void +message_1s (int i, char *c1, char *c2) +{ + char buf [4096]; + + snprintf (buf, sizeof (buf), c1, c2); + box_puts (buf); +} + +void +message_2s (int i, char *c1, char *c2, char *c3) +{ + char buf [4096]; + + snprintf (buf, sizeof (buf), c1, c2, c3 ); + box_puts (buf ); +} + +void message_3s( int i, char *c1, char *c2, char *c3, const char *c4 ) +{ + char buf [4096]; + + snprintf (buf, sizeof (buf), c1, c2, c3, c4); + box_puts (buf); +} diff -uNr gnome-libs-0.26/libvfs/utilvfs.c gnome-libs-0.27/libvfs/utilvfs.c --- gnome-libs-0.26/libvfs/utilvfs.c Wed Dec 31 19:00:00 1969 +++ gnome-libs-0.27/libvfs/utilvfs.c Thu Jul 23 14:08:53 1998 @@ -0,0 +1,435 @@ +/* Utilities for VFS modules. + + Currently includes login and tcp open socket routines. + + Copyright (C) 1995, 1996 Miguel de Icaza + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#ifndef test_get_host_and_username +#include +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#ifdef USE_TERMNET +#include +#endif + +#include + +#ifndef test_get_host_and_username +#include "tcputil.h" +#include "../src/dialog.h" /* for message () */ +#include "../src/mem.h" /* for bcopy */ +#include "../src/util.h" /* for unix_error_string */ +#include "../src/mad.h" + +int open_tcp_link (char *host, int *port, int *version, char *caller) +{ + struct sockaddr_in server_address; + unsigned long inaddr; + struct hostent *hp; + int my_socket; + + if (!*host) + return 0; + + bzero ((char *) &server_address, sizeof (server_address)); + server_address.sin_family = AF_INET; + + /* Try to use the dotted decimal number */ + if ((inaddr = inet_addr (host)) != -1) + bcopy ((char *) &inaddr, (char *) &server_address.sin_addr, + sizeof (inaddr)); + else { + if ((hp = gethostbyname (host)) == NULL){ + message_2s (1, caller, " Can't locate hostname: %s ", host); + return 0; + } + bcopy ((char *) hp->h_addr, (char *) &server_address.sin_addr, + hp->h_length); + } + + /* Try to contact a remote portmapper to obtain the listening port */ + if (*port == 0){ + *port = get_remote_port (&server_address, version); + if (*port < 1) + return 0; + } else + *version = 1; + + server_address.sin_port = htons (*port); + + if ((my_socket = socket (AF_INET, SOCK_STREAM, 0)) < 0){ + message_2s (1, caller, " Can't create socket: %s ", + unix_error_string(errno)); + return 0; + } + if (connect (my_socket, (struct sockaddr *) &server_address, + sizeof (server_address)) < 0){ + message_2s (1, caller, " Can't connect to server: %s ", + unix_error_string (errno)); + close (my_socket); + return 0; + } + return my_socket; +} +#endif + +/* Extract the hostname and username from the path */ +/* path is in the form: [user@]hostname:port/remote-dir, e.g.: + * + * ftp://sunsite.unc.edu/pub/linux + * ftp://miguel@sphinx.nuclecu.unam.mx/c/nc + * ftp://tsx-11.mit.edu:8192/ + * ftp://joe@foo.edu:11321/private + * ftp://joe:password@foo.se + * + * If the user is empty, e.g. ftp://@roxanne/private, then your login name + * is supplied. + * + * returns malloced host, user. + * returns a malloced strings with the pathname relative to the host. + * */ + +char *get_host_and_username (char *path, char **host, char **user, int *port, + int default_port, int default_is_anon, char **pass) +{ + struct passwd *passwd_info; + char *dir, *colon, *inner_colon, *at, *rest; + char *retval; + char *pcopy = strdup (path); + char *pend = pcopy + strlen (pcopy); + + *pass = NULL; + *port = default_port; + *user = NULL; + + /* locate path component */ + for (dir = pcopy; *dir != '/' && *dir; dir++) + ; + if (*dir){ + retval = strdup (dir); + *dir = 0; + } else + retval = strdup ("/"); + + /* search for any possible user */ + at = strchr (pcopy, '@'); + + /* We have a username */ + if (at){ + *at = 0; + inner_colon = strchr (pcopy, ':'); + if (inner_colon){ + *inner_colon = 0; + inner_colon++; + if (*inner_colon == '@') + *pass = NULL; + else + *pass = strdup (inner_colon); + } + if (*pcopy != 0) + *user = strdup (pcopy); + else + default_is_anon = 0; + + if (pend == at+1) + rest = at; + else + rest = at + 1; + } else + rest = pcopy; + + if (!*user){ + if (default_is_anon) + *user = strdup ("anonymous"); + else { + if ((passwd_info = getpwuid (geteuid ())) == NULL) + *user = strdup ("anonymous"); + else { + *user = strdup (passwd_info->pw_name); + } + endpwent (); + } + } + /* Check if the host comes with a port spec, if so, chop it */ + colon = strchr (rest, ':'); + if (colon){ + *port = atoi (colon+1); + + if (*port <= 0 || *port >= 65536) + *port = 21; + *colon = 0; + } + *host = strdup (rest); + + free (pcopy); + return retval; +} + +#ifdef old_manual_get_host_and_username +char *get_host_and_username (char *path, char **host, char **user, int *port, + int default_port, int default_is_anon, + char **pass) +{ + struct passwd *passwd_info; + char *p, *q; + + *pass = NULL; + *port = default_port; + for (p = path; ((*p != '/') && (*p != ':')) && *p; p++) + ; + + q = strchr (path, '@'); + + if (q != NULL) { + if (q > p) { + *user = (char *) xmalloc (p - path + 1, "get_host_and_username"); + strncpy (*user, path, p - path); + (*user) [p - path] = 0; + p++; + *pass = (char *) xmalloc (q - p + 1,"get_host_and_username"); + strncpy (*pass, p, q - p); + (*pass) [q - p] = 0; + for (p++; ((*p != '/') && (*p != ':')) && *p; p++); + q++; + *host = (char *) xmalloc (p - q + 1, "get_host_and_username"); + strncpy (*host, q, p - q); + (*host) [p-q] = 0; + } else { + if (q == path) + *user = NULL; + else { + *user = (char *) xmalloc (q - path + 1, "get_host_and_username"); + strncpy (*user, path, q - path); + (*user) [q - path] = 0; + } + q++; + *host = (char *) xmalloc (p - q + 1, "get_host_and_username"); + strncpy (*host, q, p - q); + (*host) [p-q] = 0; + } + } else { + *host = (char *) xmalloc (p - path + 1, "get_host_and_username"); + strncpy (*host, path, p - path); + (*host) [p-path] = 0; + *user = NULL; +#ifdef USE_NETRC + if (use_netrc) + if (lookup_netrc (*host, user, pass) < 0) { + if (*user) { free (*user); *user = NULL; } + if (*pass) { free (*pass); *pass = NULL; } + } +#endif + if (*user == NULL && default_is_anon) + *user = strdup ("anonymous"); + } + + /* If we got a port spec ... */ + if (*p == ':'){ + + q = ++p; + + for (;*q != '/' && *q; q++) + ; + + if (!*q && q == p){ + if (!(*user)) + *user = strdup (""); + /* on return: *host and *user always malloced, *pass malloced + * or NULL */ + return 0; + } + + *port = atoi (p); + + if (*port <= 0 || *port >= 65536) + *port = 21; + p = q; + } + + if (!*user){ + if ((passwd_info = getpwuid (geteuid ())) == NULL) + *user = strdup ("anonymous"); + else { + *user = strdup (passwd_info->pw_name); + } + endpwent (); + } + if (p && *p) + return strdup (p); + else + return strdup ("/"); +} +#endif + +#ifdef test_get_host_and_username +struct tt { + char *url; + char *r_host; + char *r_user; + char *r_pass; + char *r_dir; + int r_port; +}; + +struct tt tests [] = { + { "host", "host", "anonymous", NULL, "/", 21 }, + { "host/dir", "host", "anonymous", NULL, "/dir", 21 }, + { "host:40/", "host", "anonymous", NULL, "/", 40 }, + { "host:40/dir", "host", "anonymous", NULL, "/dir", 40 }, + { "user@host", "host", "user", NULL, "/", 21 }, + { "user@host/dir", "host", "user", NULL, "/dir", 21 }, + { "user@host:40/", "host", "user", NULL, "/", 40 }, + { "user@host:40/dir", "host", "user", NULL, "/dir", 40 }, + { "user:pass@host", "host", "user", "pass", "/", 21 }, + { "user:pass@host/dir", "host", "user", "pass", "/dir", 21 }, + { "user:pass@host:40", "host", "user", "pass", "/", 40 }, + { "user:pass@host:40/dir", "host", "user", "pass", "/dir", 40 }, + { "host/a@b", "host", "anonymous", NULL, "/a@b", 21 }, + { "host:40/a@b", "host", "anonymous", NULL, "/a@b", 40 }, + { "user@host/a@b", "host", "user", NULL, "/a@b", 21 }, + { "user@host:40/a@b", "host", "user", NULL, "/a@b", 40 }, + { "user:pass@host/a@b", "host", "user", "pass", "/a@b", 21 }, + { "user:pass@host:40/a@b", "host", "user", "pass", "/a@b", 40 }, + { "host/a:b", "host", "anonymous", NULL, "/a:b", 21 }, + { "host:40/a:b", "host", "anonymous", NULL, "/a:b", 40 }, + { "user@host/a:b", "host", "user", NULL, "/a:b", 21 }, + { "user@host:40/a:b", "host", "user", NULL, "/a:b", 40 }, + { "user:pass@host/a:b", "host", "user", "pass", "/a:b", 21 }, + { "user:pass@host:40/a:b", "host", "user", "pass", "/a:b", 40 }, + { "host/a/b", "host", "anonymous", NULL, "/a/b", 21 }, + { "host:40/a/b", "host", "anonymous", NULL, "/a/b", 40 }, + { "user@host/a/b", "host", "user", NULL, "/a/b", 21 }, + { "user@host:40/a/b", "host", "user", NULL, "/a/b", 40 }, + { "user:pass@host/a/b", "host", "user", "pass", "/a/b", 21 }, + { "user:pass@host:40/a/b", "host", "user", "pass", "/a/b", 40 }, + { NULL } +}; + +/* tests with implicit login name */ +struct tt tests2 [] = { + { "@host", "host", "user", NULL, "/", 21 }, + { "@host/dir", "host", "user", NULL, "/dir", 21 }, + { "@host:40/", "host", "user", NULL, "/", 40 }, + { "@host:40/dir", "host", "user", NULL, "/dir", 40 }, + { ":pass@host", "host", "user", "pass", "/", 21 }, + { ":pass@host/dir", "host", "user", "pass", "/dir", 21 }, + { ":pass@host:40", "host", "user", "pass", "/", 40 }, + { ":pass@host:40/dir", "host", "user", "pass", "/dir", 40 }, + { "@host/a@b", "host", "user", NULL, "/a@b", 21 }, + { "@host:40/a@b", "host", "user", NULL, "/a@b", 40 }, + { ":pass@host/a@b", "host", "user", "pass", "/a@b", 21 }, + { ":pass@host:40/a@b", "host", "user", "pass", "/a@b", 40 }, + { "@host/a:b", "host", "user", NULL, "/a:b", 21 }, + { "@host:40/a:b", "host", "user", NULL, "/a:b", 40 }, + { ":pass@host/a:b", "host", "user", "pass", "/a:b", 21 }, + { ":pass@host:40/a:b", "host", "user", "pass", "/a:b", 40 }, + { "@host/a/b", "host", "user", NULL, "/a/b", 21 }, + { "@host:40/a/b", "host", "user", NULL, "/a/b", 40 }, + { ":pass@host/a/b", "host", "user", "pass", "/a/b", 21 }, + { ":pass@host:40/a/b", "host", "user", "pass", "/a/b", 40 }, + { NULL } +}; + +main () +{ + int i, port, err; + char *dir, *host, *user, *pass; + struct passwd *passwd_info; + char *current; + + if ((passwd_info = getpwuid (geteuid ())) == NULL) + current = strdup ("anonymous"); + else { + current= strdup (passwd_info->pw_name); + } + endpwent (); + + for (i = 0; tests [i].url; i++){ + err = 0; + dir = get_host_and_username (tests [i].url, &host, &user, &port, 21, 1, &pass); + + if (strcmp (dir, tests [i].r_dir)) + err++, printf ("dir: test %d flunked\n", i); + + if (!err && strcmp (host, tests [i].r_host)) + err++, printf ("host: test %d flunked\n", i); + + if (!err && strcmp (user, tests [i].r_user)) + err++, printf ("user: test %d flunked\n", i); + + if (!err && tests [i].r_pass) + if (strcmp (dir, tests [i].r_dir)) + err++, printf ("pass: test %d flunked\n", i); + + if (!err & tests [i].r_port != port) + err++, printf ("port: test %d flunked\n", i); + + if (err){ + printf ("host=[%s] user=[%s] pass=[%s] port=[%d]\n", + host, user, pass, port); + } + } + + printf ("%d tests ok\nExtra tests:", i); + + for (i = 0; i < 4; i++){ + dir = get_host_and_username (tests [i].url, &host, &user, &port, 21, 0, &pass); + if (strcmp (user, current)) + printf ("ntest: flunked %d\n", i); + } + + printf ("%d tests ok\nTests with implicit login name\n", i); + + for (i = 0; tests2 [i].url; i++){ + err = 0; + dir = get_host_and_username (tests2 [i].url, &host, &user, &port, 21, 1, &pass); + + if (strcmp (dir, tests2 [i].r_dir)) + err++, printf ("dir: test %d flunked\n", i); + + if (!err && strcmp (host, tests2 [i].r_host)) + err++, printf ("host: test %d flunked\n", i); + + if (!err && strcmp (user, current)) + err++, printf ("user: test %d flunked\n", i); + + if (!err && tests2 [i].r_pass) + if (strcmp (dir, tests2 [i].r_dir)) + err++, printf ("pass: test %d flunked\n", i); + + if (!err & tests2 [i].r_port != port) + err++, printf ("port: test %d flunked\n", i); + + if (err){ + printf ("host=[%s] user=[%s] pass=[%s] port=[%d]\n", + host, user, pass, port); + } + } + printf ("%d tests ok\n", i); +} +#endif diff -uNr gnome-libs-0.26/libvfs/vfs.c gnome-libs-0.27/libvfs/vfs.c --- gnome-libs-0.26/libvfs/vfs.c Wed Dec 31 19:00:00 1969 +++ gnome-libs-0.27/libvfs/vfs.c Thu Jul 23 14:08:53 1998 @@ -0,0 +1,1540 @@ +/* Virtual File System switch code + Copyright (C) 1995 The Free Software Foundation + + Written by: 1995 Miguel de Icaza + 1995 Jakub Jelinek + 1998 Pavel Machek + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ + +#define _VFS_VFS_C 1 + +#include +#include +#include /* For atol() */ +#include +#include +#include +#include +#include +#include +#include +#ifdef SCO_FLAVOR +#include /* alex: for struct timeb definition */ +#endif /* SCO_FLAVOR */ +#include +#include +#include "../src/fs.h" +#include "../src/mad.h" +#include "../src/dir.h" +#include "../src/util.h" +#include "../src/main.h" +#ifndef VFS_STANDALONE +#include "../src/panel.h" +#include "../src/key.h" /* Required for the async alarm handler */ +#include "../src/layout.h" /* For get_panel_widget and get_other_index */ +#endif +#include "vfs.h" +#include "mcfs.h" +#include "names.h" +#include "extfs.h" +#ifdef USE_NETCODE +# include "tcputil.h" +#endif + +extern int get_other_type (void); +extern int extfs_which (char *path); + +int vfs_timeout = 60; /* VFS timeout in seconds */ + +extern int cd_symlinks; /* Defined in main.c */ + +/* They keep track of the current directory */ +static vfs *current_vfs = &local_vfs_ops; +char *current_dir = NULL; + +static int current_mday; +static int current_mon; +static int current_year; + +/* Open files managed by the vfs layer */ +#define MAX_VFS_FILES 100 +static struct { + void *fs_info; + vfs *operations; +} vfs_file_table [MAX_VFS_FILES]; + +static int get_bucket () +{ + int i; + + /* 0, 1, 2 are reserved file descriptors, while (DIR *) 0 means error */ + for (i = 3; i < MAX_VFS_FILES; i++){ + if (!vfs_file_table [i].fs_info) + return i; + } + fprintf (stderr, "No more virtual file handles\n"); + exit (1); +} + +vfs *vfs_type_from_op (char *path) +{ +#ifdef USE_NETCODE + if (!strncmp (path, "mc:", 3)) + return &mcfs_vfs_ops; + if (!strncmp (path, "ftp:", 4)) + return &ftpfs_vfs_ops; +#endif +#ifdef USE_EXT2FSLIB + if (!strcmp (path, "undel")) + return &undelfs_vfs_ops; +#endif + if (!strcmp (path, "utar")) + return &tarfs_vfs_ops; + if (extfs_which (path) != -1) + return &extfs_vfs_ops; + return NULL; +} + +/* + * Splits path '/p1:op/inpath' into inpath,op; returns which vfs it is. + * What is left in path is p1. You still want to free(path), you DON'T + * want to free neither *inpath nor *op + */ +vfs *vfs_split (char *path, char **inpath, char **op) +{ + char *semi = strrchr (path, '#'); + char *slash; + vfs *ret; + + if (!semi) + return NULL; + slash = strchr (semi, '/'); + *semi = 0; + if (op) + *op = NULL; + if (inpath) + *inpath = NULL; + if (slash) + *slash = 0; + if ((ret = vfs_type_from_op (semi+1))){ + if (op) + *op = semi+1; + if (inpath) + *inpath = slash?slash+1:NULL; + return ret; + } + if (slash) + *slash = '/'; + ret = vfs_split (path, inpath, op); + *semi = '#'; + return ret; +} + +vfs* +vfs_rosplit (char *path) +{ + char *semi = strrchr (path, '#'); + char *slash; + vfs *ret; + + if (!semi) + return NULL; + slash = strchr (semi, '/'); + *semi = 0; + if (slash) + *slash = 0; + + ret = vfs_type_from_op (semi+1); + if (slash) + *slash = '/'; + if (!ret) + ret = vfs_rosplit (path); + *semi = '#'; + return ret; +} + +vfs *vfs_type (char *path) +{ + vfs *vfs = vfs_rosplit(path); + if (!vfs) + vfs = &local_vfs_ops; + return vfs; +} + +static struct vfs_stamping *stamps; + +/* Returns the number of seconds remaining to the vfs timeout + * + * FIXME: currently this is set to 10 seconds. We should compute this. + */ +int vfs_timeouts () +{ + return stamps ? 10 : 0; +} + +void vfs_addstamp (vfs *v, vfsid id, struct vfs_stamping *parent) +{ + if (v != &local_vfs_ops && id != (vfsid)-1){ + struct vfs_stamping *stamp, *st1; + + for (stamp = stamps; stamp != NULL; st1 = stamp, stamp = stamp->next) + if (stamp->v == v && stamp->id == id){ + gettimeofday(&(stamp->time), NULL); + return; + } + stamp = xmalloc (sizeof (struct vfs_stamping), "vfs stamping"); + stamp->v = v; + stamp->id = id; + if (parent){ + struct vfs_stamping *st = stamp; + for (; parent;){ + st->parent = xmalloc (sizeof (struct vfs_stamping), "vfs stamping"); + *st->parent = *parent; + parent = parent->parent; + st = st->parent; + } + st->parent = 0; + } + else + stamp->parent = 0; + gettimeofday (&(stamp->time), NULL); + stamp->next = 0; + if (stamps) + st1->next = stamp; + else + stamps = stamp; + } +} + +void vfs_stamp (vfs *v, vfsid id) +{ + struct vfs_stamping *stamp; + + for (stamp = stamps; stamp != NULL; stamp = stamp->next) + if (stamp->v == v && stamp->id == id){ + gettimeofday (&(stamp->time), NULL); + if (stamp->parent != NULL) + vfs_stamp (stamp->parent->v, stamp->parent->id); + return; + } +} + +void vfs_rm_parents (struct vfs_stamping *stamp) +{ + struct vfs_stamping *st2, *st3; + if (stamp){ + for (st2 = stamp, st3 = st2->parent; st3 != NULL; st2 = st3, st3 = st3->parent) + free (st2); + free (st2); + } +} + +void vfs_rmstamp (vfs *v, vfsid id, int removeparents) +{ + struct vfs_stamping *stamp, *st1; + + for (stamp = stamps, st1 = NULL; stamp != NULL; st1 = stamp, stamp = stamp->next) + if (stamp->v == v && stamp->id == id){ + if (stamp->parent != NULL){ + if (removeparents) + vfs_rmstamp (stamp->parent->v, stamp->parent->id, 1); + vfs_rm_parents (stamp->parent); + } + if (st1 == NULL){ + stamps = stamp->next; + } else { + st1->next = stamp->next; + } + free (stamp); + return; + } +} + +static int +ferrno (vfs *vfs) +{ + return vfs->ferrno ? (*vfs->ferrno)() : EOPNOTSUPP; + /* Hope that error message is obscure enough ;-) */ +} + +int mc_open (char *file, int flags, ...) +{ + int handle; + int mode; + void *info; + vfs *vfs; + va_list ap; + + file = vfs_canon (file); + vfs = vfs_type (file); + + /* Get the mode flag */ /* FIXME: should look if O_CREAT is present */ + va_start (ap, flags); + mode = va_arg (ap, int); + va_end (ap); + + if (!vfs->open) + vfs_die( "VFS must support open\n" ); + info = (*vfs->open) (file, flags, mode); /* open must be supported */ + free (file); + if (!info){ + errno = ferrno (vfs); + return -1; + } + handle = get_bucket (); + vfs_file_table [handle].fs_info = info; + vfs_file_table [handle].operations = vfs; + + return handle; +} + +#define vfs_op(handle) vfs_file_table [handle].operations +#define vfs_info(handle) vfs_file_table [handle].fs_info +#define vfs_free_bucket(handle) vfs_info(handle) = 0; + +#define MC_OP(name, inarg, callarg, pre, post) \ + int mc_##name inarg \ + { \ + vfs *vfs; \ + int result; \ + \ + pre \ + result = vfs->name ? (*vfs->name)callarg : -1; \ + post \ + if (result == -1) \ + errno = ferrno (vfs); \ + return result; \ + } + +#define MC_NAMEOP(name, inarg, callarg) MC_OP (name, inarg, callarg, path = vfs_canon (path); vfs = vfs_type (path);, free (path); ) +#define MC_HANDLEOP(name, inarg, callarg) MC_OP (name, inarg, callarg, if (handle == -1) return -1; vfs = vfs_op (handle);, ) + +MC_HANDLEOP(read, (int handle, char *buffer, int count), (vfs_info (handle), buffer, count) ); + +int mc_ctl (int handle, int ctlop, int arg) +{ + vfs *vfs; + int result; + + vfs = vfs_op (handle); + result = vfs->ctl ? (*vfs->ctl)(vfs_info (handle), ctlop, arg) : 0; + return result; +} + +int mc_setctl (char *path, int ctlop, char *arg) +{ + vfs *vfs; + int result; + + path = vfs_canon (path); + vfs = vfs_type (path); + result = vfs->setctl ? (*vfs->setctl)(path, ctlop, arg) : 0; + free (path); + return result; +} + +int mc_close (int handle) +{ + vfs *vfs; + int result; + + if (handle == -1 || !vfs_info (handle)) + return -1; + + vfs = vfs_op (handle); + if (handle < 3) + return close (handle); + + result = (*vfs->close)(vfs_info (handle)); /* close must be supported */ + vfs_free_bucket (handle); + if (result == -1) + errno = ferrno (vfs); + + return result; +} + +DIR *mc_opendir (char *dirname) +{ + int handle, *handlep; + void *info; + vfs *vfs; + char *p = NULL; + int i = strlen (dirname); + + if (dirname [i - 1] != '/'){ + /* We should make possible reading of the root directory in a tar file */ + p = xmalloc (i + 2, "slash"); + strcpy (p, dirname); + strcpy (p + i, "/"); + dirname = p; + } + dirname = vfs_canon (dirname); + vfs = vfs_type (dirname); + + info = vfs->opendir ? (*vfs->opendir)(dirname) : NULL; + free (dirname); + if (!info){ + errno = ferrno (vfs); + if (p) + free (p); + return NULL; + } + handle = get_bucket (); + vfs_file_table [handle].fs_info = info; + vfs_file_table [handle].operations = vfs; + + if (p) + free (p); + + handlep = (int *) xmalloc (sizeof (int), "opendir handle"); + *handlep = handle; + return (DIR *) handlep; +} + +/* This should strip the non needed part of a path name */ +#define vfs_name(x) x + +#define MC_DIROP(name, type, inarg, callarg, onerr ) \ +type mc_##name inarg \ +{ \ + int handle; \ + vfs *vfs; \ +\ + if (!dirp){ \ + errno = EFAULT; \ + return onerr; \ + } \ + handle = *(int *) dirp; \ + vfs = vfs_op (handle); \ + return vfs->name ? (*vfs->name) callarg : onerr; \ +} + +#define MC_DIROP_VOID(name, inarg, callarg ) \ +void mc_##name inarg \ +{ \ + int handle; \ + vfs *vfs; \ +\ + if (!dirp){ \ + errno = EFAULT; \ + return; \ + } \ + handle = *(int *) dirp; \ + vfs = vfs_op (handle); \ + if (vfs->name) \ + (*vfs->name) callarg; \ +} + +MC_DIROP (readdir, struct dirent *, (DIR *dirp), (vfs_info (handle)), NULL) +MC_DIROP_VOID (seekdir, (DIR *dirp, int offset), (vfs_info (handle), offset)) +MC_DIROP (telldir, int, (DIR *dirp), (vfs_info (handle)), -1) + +int mc_closedir (DIR *dirp) +{ + int handle = *(int *) dirp; + vfs *vfs = vfs_op (handle); + int result; + + result = vfs->closedir ? (*vfs->closedir)(vfs_info (handle)) : -1; + vfs_free_bucket (handle); + free (dirp); + return result; +} + +MC_NAMEOP (stat, (char *path, struct stat *buf), (vfs_name (path), buf)) +MC_NAMEOP (lstat, (char *path, struct stat *buf), (vfs_name (path), buf)) +MC_HANDLEOP (fstat, (int handle, struct stat *buf), (vfs_info (handle), buf)) + +/* + * You must strdup whatever this function returns, static buffers are in use + */ + +char *mc_return_cwd (void) +{ + char *p; + struct stat my_stat, my_stat2; + + if (!vfs_rosplit (current_dir)){ + static char buffer[MC_MAXPATHLEN]; + + p = get_current_wd (buffer, MC_MAXPATHLEN); + if (!p) /* One of the directories in the path is not readable */ + return current_dir; + + /* Otherwise check if it is O.K. to use the current_dir */ + mc_stat (p, &my_stat); + mc_stat (current_dir, &my_stat2); + if (my_stat.st_ino != my_stat2.st_ino || + my_stat.st_dev != my_stat2.st_dev || + !cd_symlinks){ + free (current_dir); + current_dir = strdup (p); + return p; + } /* Otherwise we return current_dir below */ + } + return current_dir; +} + +char *mc_get_current_wd (char *buffer, int size) +{ + char *cwd = mc_return_cwd(); + if (strlen (cwd) > size){ + vfs_die ("Current_dir size overflow\n"); + } + strcpy (buffer, cwd); + return buffer; +} + +MC_NAMEOP (chmod, (char *path, int mode), (vfs_name (path), mode)) +MC_NAMEOP (chown, (char *path, int owner, int group), (vfs_name (path), owner, group)) +MC_NAMEOP (utime, (char *path, struct utimbuf *times), (vfs_name (path), times)) +MC_NAMEOP (readlink, (char *path, char *buf, int bufsiz), (vfs_name (path), buf, bufsiz)) +MC_NAMEOP (unlink, (char *path), (vfs_name (path))) +MC_NAMEOP (symlink, (char *name1, char *path), (vfs_name (name1), vfs_name (path))) + +int mc_link (char *name1, char *name2) +{ + vfs *vfs1; + vfs *vfs2; + int result; + + name1 = vfs_canon (name1); + vfs1 = vfs_type (name1); + name2 = vfs_canon (name2); + vfs2 = vfs_type (name2); + + if (vfs1 != vfs2){ + errno = EXDEV; + free (name1); + free (name2); + return -1; + } + + result = (*vfs1->link)(vfs_name (name1), vfs_name (name2)); + free (name1); + free (name2); + if (result == -1){ + errno = (*vfs1->ferrno)(); + return -1; + } + return result; +} + +MC_HANDLEOP (write, (int handle, char *buf, int nbyte), (vfs_info (handle), buf, nbyte)); + +int mc_rename (char *path1, char *path2) +{ + vfs *vfs1; + vfs *vfs2; + int result; + + path1 = vfs_canon (path1); + vfs1 = vfs_type (path1); + path2 = vfs_canon (path2); + vfs2 = vfs_type (path2); + + if (vfs1 != vfs2){ + errno = EXDEV; + free (path1); + free (path2); + return -1; + } + + result = (*vfs1->rename)(vfs_name (path1), vfs_name (path2)); + free (path1); + free (path2); + if (result == -1){ + errno = (*vfs1->ferrno)(); + return -1; + } + return result; +} + +off_t mc_lseek (int fd, off_t offset, int whence) +{ + vfs *vfs; + + if (fd == -1) + return -1; + + vfs = vfs_op (fd); + return (*vfs->lseek)(vfs_info (fd), offset, whence); +} + +/* + * remove //, /./ and /../, local should point to big enough buffer + */ + +#define ISSLASH(a) (!a || (a == '/')) + +void +vfs_kill_dots (char *path, char *local) +{ + char *s = path, *t = local; + char *last_slash = path; + + *t++ = *s++; + while (1){ + if (ISSLASH (*s)){ + if (*last_slash != '/') + vfs_die ("/ not there\n"); + + if (ISSLASH (last_slash [1])) + t--; + + if (last_slash [1] == '.'){ + if (ISSLASH(last_slash [2])) + t -= 2; + if ((last_slash [2] == '.') && (ISSLASH (last_slash [3]))){ + t -= 4; + while ((t >= local) && (*t != '/')) + t--; + } + } + last_slash = s; + } + + if (t <= local){ + *local = '/'; + t = local; + } + if (!*s) + break; + *t++ = *s++; + *t = 0; + } + *t = 0; + if (!(*local)){ + local [0] = '/'; + local [1] = 0; + } +} + + +char *vfs_canon (char *path) +{ + if (*path == '~'){ /* Tilde expansion */ + char *local, *result; + + local = tilde_expand (path); + if (local){ + result = vfs_canon (local); + free (local); + return result; + } else + return strdup (path); + } + + if (*path != '/'){ /* Relative to current directory */ + char *local, *result; + + if (current_dir [strlen (current_dir) - 1] == '/') + local = copy_strings (current_dir, path, NULL); + else + local = copy_strings (current_dir, "/", path, NULL); + + result = vfs_canon (local); + free (local); + return result; + } + /* So we have path of following form: + * /p1/p2:op/.././././p3:op/p4. Good luck. + */ + canonicalize_pathname (path); + + return strdup (path); +} + +vfsid vfs_ncs_getid (vfs *nvfs, char *dir, struct vfs_stamping **par) +{ + vfsid nvfsid; + int freeit = 0; + + if (dir [strlen (dir) - 1] != '/'){ + dir = copy_strings (dir, "/", NULL); + freeit = 1; + } + nvfsid = (*nvfs->getid)(dir, par); + if (freeit) + free (dir); + return nvfsid; +} + +#ifndef VFS_STANDALONE +static int is_parent (vfs * nvfs, vfsid nvfsid, struct vfs_stamping *parent) +{ + struct vfs_stamping *stamp; + for (stamp = parent; stamp; stamp = stamp->parent) + if (stamp->v == nvfs && stamp->id == nvfsid) + break; + return (stamp ? 1 : 0); +} +#endif + +void vfs_add_noncurrent_stamps (vfs * oldvfs, vfsid oldvfsid, struct vfs_stamping *parent) +{ +#ifndef VFS_STANDALONE + vfs *nvfs, *n2vfs, *n3vfs; + vfsid nvfsid, n2vfsid, n3vfsid; + struct vfs_stamping *par, *stamp; + int f; + + /* FIXME: As soon as we convert to multiple panels, this stuff + has to change. It works like this: We do not time out the + vfs's which are current in any panel and on the other + side we add the old directory with all its parents which + are not in any panel (if we find such one, we stop adding + parents to the time-outing structure. */ + + /* There are three directories we have to take care of: current_dir, + cpanel->cwd and opanel->cwd. Athough most of the time either + current_dir and cpanel->cwd or current_dir and opanel->cwd are the + same, it's possible that all three are different -- Norbert */ + + if (!cpanel) + return; + + nvfs = vfs_type (current_dir); + nvfsid = vfs_ncs_getid (nvfs, current_dir, &par); + vfs_rmstamp (nvfs, nvfsid, 1); + + f = is_parent (oldvfs, oldvfsid, par); + vfs_rm_parents (par); + if ((nvfs == oldvfs && nvfs == oldvfsid) || oldvfsid == (vfsid *)-1 || f){ + return; + } + + if (get_current_type () == view_listing){ + n2vfs = vfs_type (cpanel->cwd); + n2vfsid = vfs_ncs_getid (n2vfs, cpanel->cwd, &par); + f = is_parent (oldvfs, oldvfsid, par); + vfs_rm_parents (par); + if ((n2vfs == oldvfs && n2vfsid == oldvfsid) || f) + return; + } else { + n2vfs = (vfs *) -1; + n2vfsid = (vfs *) -1; + } + + if (get_other_type () == view_listing){ + n3vfs = vfs_type (opanel->cwd); + n3vfsid = vfs_ncs_getid (n3vfs, opanel->cwd, &par); + f = is_parent (oldvfs, oldvfsid, par); + vfs_rm_parents (par); + if ((n3vfs == oldvfs && n3vfsid == oldvfsid) || f) + return; + } else { + n3vfs = (vfs *)-1; + n3vfsid = (vfs *)-1; + } + + if ((*oldvfs->nothingisopen) (oldvfsid)){ + if (oldvfs == &extfs_vfs_ops && ((struct extfs_archive *) oldvfsid)->name == 0){ + /* Free the resources immediatly when we leave a mtools fs + ('cd a:') instead of waiting for the vfs-timeout */ + (oldvfs->free) (oldvfsid); + } else + vfs_addstamp (oldvfs, oldvfsid, parent); + for (stamp = parent; stamp != NULL; stamp = stamp->parent){ + if ((stamp->v == nvfs && stamp->id == nvfsid) || + (stamp->v == n2vfs && stamp->id == n2vfsid) || + (stamp->v == n3vfs && stamp->id == n3vfsid) || + stamp->id == (vfsid) - 1 || + !(*stamp->v->nothingisopen) (stamp->id)) + break; + if (stamp->v == &extfs_vfs_ops && ((struct extfs_archive *) stamp->id)->name == 0){ + (stamp->v->free) (stamp->id); + vfs_rmstamp (stamp->v, stamp->id, 0); + } else + vfs_addstamp (stamp->v, stamp->id, stamp->parent); + } + } +#endif +} + +#ifndef VFS_STANDALONE +static void vfs_stamp_path (char *path) +{ + vfs *vfs; + vfsid id; + struct vfs_stamping *par, *stamp; + + vfs = vfs_type (path); + id = vfs_ncs_getid (vfs, path, &par); + vfs_addstamp (vfs, id, par); + + for (stamp = par; stamp != NULL; stamp = stamp->parent) + vfs_addstamp (stamp->v, stamp->id, stamp->parent); + vfs_rm_parents (par); +} +#endif + +#ifndef VFS_STANDALONE +void vfs_add_current_stamps (void) +{ + vfs_stamp_path (current_dir); + if (get_current_type () == view_listing) + vfs_stamp_path (cpanel->cwd); + if (get_other_type () == view_listing) + vfs_stamp_path (opanel->cwd); +} +#endif + +/* This function is really broken */ +int mc_chdir (char *path) +{ + char *a, *b; + int result; + char *p = NULL; + int i = strlen (path); + vfs *oldvfs; + vfsid oldvfsid; + struct vfs_stamping *parent; + + if (path [i - 1] != '/'){ + /* We should make possible reading of the root directory in a tar archive */ + p = xmalloc (i + 2, "slash"); + strcpy (p, path); + strcpy (p + i, "/"); + path = p; + } + + a = current_dir; /* Save a copy for case of failure */ + current_dir = vfs_canon (path); + current_vfs = vfs_type (current_dir); + b = strdup (current_dir); + result = (*current_vfs->chdir)(vfs_name (b)); + free (b); + if (result == -1){ + errno = (*current_vfs->ferrno)(); + free (current_dir); + current_vfs = vfs_type (a); + current_dir = a; + } else { + oldvfs = vfs_type (a); + oldvfsid = vfs_ncs_getid (oldvfs, a, &parent); + free (a); + vfs_add_noncurrent_stamps (oldvfs, oldvfsid, parent); + vfs_rm_parents (parent); + } + if (p) + free (p); + + if (*current_dir){ + p = strchr (current_dir, 0) - 1; + if (*p == '/' && p > current_dir) + *p = 0; /* Sometimes we assume no trailing slash on cwd */ + } + return result; +} + +int vfs_current_is_local (void) +{ + return current_vfs == &local_vfs_ops; +} + +int vfs_current_is_extfs (void) +{ + return current_vfs == &extfs_vfs_ops; +} + +int vfs_current_is_tarfs (void) +{ + return current_vfs == &tarfs_vfs_ops; +} + +int vfs_file_is_local (char *filename) +{ + vfs *vfs; + + filename = vfs_canon (filename); + vfs = vfs_type (filename); + free (filename); + return vfs == &local_vfs_ops; +} + +int vfs_file_is_ftp (char *filename) +{ +#ifdef USE_NETCODE + vfs *vfs; + + filename = vfs_canon (filename); + vfs = vfs_type (filename); + free (filename); + return vfs == &ftpfs_vfs_ops; +#else + return 0; +#endif +} + +char *vfs_get_current_dir (void) +{ + return current_dir; +} + +void vfs_setup_wd (void) +{ + current_dir = strdup ("/"); + mc_return_cwd(); /* mc_return_cwd will fixup current_dir for us */ + + if (strlen(current_dir)>MC_MAXPATHLEN-2) + vfs_die ("Current dir too long\n"); + + return; +} + +MC_NAMEOP (mkdir, (char *path, mode_t mode), (vfs_name (path), mode)) +MC_NAMEOP (rmdir, (char *path), (vfs_name (path))) +MC_NAMEOP (mknod, (char *path, int mode, int dev), (vfs_name (path), mode, dev)) + +#ifdef HAVE_MMAP +struct mc_mmapping { + caddr_t addr; + void *vfs_info; + vfs *vfs; + struct mc_mmapping *next; +} *mc_mmaparray = NULL; + +caddr_t +mc_mmap (caddr_t addr, size_t len, int prot, int flags, int fd, off_t offset) +{ + vfs *vfs; + caddr_t result; + struct mc_mmapping *mcm; + + if (fd == -1) + return (caddr_t) -1; + + vfs = vfs_op (fd); + result = (*vfs->mmap)(addr, len, prot, flags, vfs_info (fd), offset); + if (result == (caddr_t)-1){ + errno = (*vfs->ferrno)(); + return (caddr_t)-1; + } + mcm = (struct mc_mmapping *) xmalloc (sizeof (struct mc_mmapping), "vfs: mmap handling"); + mcm->addr = result; + mcm->vfs_info = vfs_info (fd); + mcm->vfs = vfs; + mcm->next = mc_mmaparray; + mc_mmaparray = mcm; + return result; +} + +int mc_munmap (caddr_t addr, size_t len) +{ + struct mc_mmapping *mcm, *mcm2 = NULL; + + for (mcm = mc_mmaparray; mcm != NULL; mcm2 = mcm, mcm = mcm->next){ + if (mcm->addr == addr){ + if (mcm2 == NULL) + mc_mmaparray = mcm->next; + else + mcm2->next = mcm->next; + (*mcm->vfs->munmap)(addr, len, mcm->vfs_info); + free (mcm); + return 0; + } + } + return -1; +} + +#endif + +char *mc_def_getlocalcopy (char *filename) +{ + char *tmp; + int fdin, fdout, i; + char buffer[8192]; + struct stat mystat; + + fdin = mc_open (filename, O_RDONLY); + if (fdin == -1) + return NULL; + tmp = tmpnam(NULL); + fdout = creat (tmp, 0600); /* FIXME: What about symlink attack ? */ + if (fdout == -1){ + mc_close (fdin); + return NULL; + } + tmp = strdup (tmp); + while ((i = mc_read (fdin, buffer, sizeof (buffer))) == sizeof (buffer)){ + write (fdout, buffer, i); + } + if (i != -1) + write (fdout, buffer, i); + mc_close (fdin); + close (fdout); + if (mc_stat (filename, &mystat) != -1){ + chmod (tmp, mystat.st_mode); + } + return tmp; +} + +char *mc_getlocalcopy (char *path) +{ + vfs *vfs; + char *result; + + path = vfs_canon (path); + vfs = vfs_type (path); + result = vfs->getlocalcopy ? (*vfs->getlocalcopy)(vfs_name (path)) : + mc_def_getlocalcopy (vfs_name (path)); + free (path); + if (result == NULL){ + errno = ferrno (vfs); + } + return result; +} + +void mc_def_ungetlocalcopy (char *filename, char *local, int has_changed) +{ + if (has_changed){ + int fdin, fdout, i; + char buffer [8192]; + + fdin = open (local, O_RDONLY); + if (fdin == -1){ + unlink (local); + free (local); + return; + } + fdout = mc_open (filename, O_WRONLY | O_TRUNC); + if (fdout == -1){ + close (fdin); + unlink (local); + free (local); + return; + } + while ((i = read (fdin, buffer, sizeof (buffer))) == sizeof (buffer)){ + mc_write (fdout, buffer, i); + } + if (i != -1) + mc_write (fdout, buffer, i); + close (fdin); + mc_close (fdout); + } + unlink (local); + free (local); +} + +void mc_ungetlocalcopy (char *path, char *local, int has_changed) +{ + vfs *vfs; + + path = vfs_canon (path); + vfs = vfs_type (path); + vfs->ungetlocalcopy ? (*vfs->ungetlocalcopy)(vfs_name (path), local, has_changed) : + mc_def_ungetlocalcopy (vfs_name (path), local, has_changed); + free (path); +} + +inline int timeoutcmp (struct timeval *t1, struct timeval *t2) +{ + return ((t1->tv_sec < t2->tv_sec) + || ((t1->tv_sec == t2->tv_sec) && (t1->tv_usec <= t2->tv_usec))); +} + +void vfs_timeout_handler (void) +{ + struct timeval time; + struct vfs_stamping *stamp, *st; + + gettimeofday (&time, NULL); + time.tv_sec -= vfs_timeout; + for (stamp = stamps; stamp != NULL;){ + if (timeoutcmp (&stamp->time, &time)){ + st = stamp->next; + (*stamp->v->free) (stamp->id); + vfs_rmstamp (stamp->v, stamp->id, 0); + stamp = st; + } else + stamp = stamp->next; + } +} + +void vfs_init (void) +{ + time_t current_time; + struct tm *t; + + memset (vfs_file_table, 0, sizeof (vfs_file_table)); + current_time = time (NULL); + t = localtime (¤t_time); + current_mday = t->tm_mday; + current_mon = t->tm_mon; + current_year = t->tm_year; + +#ifdef USE_NETCODE + tcp_init(); + ftpfs_init(); +#endif + extfs_init (); + vfs_setup_wd (); +} + +void vfs_free_resources (char *path) +{ + vfs *vfs; + vfsid vid; + struct vfs_stamping *parent; + + vfs = vfs_type (path); + vid = vfs_ncs_getid (vfs, path, &parent); + if (vid != (vfsid) -1) + (*vfs->free)(vid); + vfs_rm_parents (parent); +} + +#if 0 +/* Shutdown a vfs given a path name */ +void vfs_shut_path (char *p) +{ + vfs *the_vfs; + struct vfs_stamping *par; + + the_vfs = vfs_type (p); + vfs_ncs_getid (the_vfs, p, &par); + (*par->v->free)(par->id); + vfs_rm_parents (par); +} +#endif + +void vfs_shut (void) +{ + struct vfs_stamping *stamp, *st; + + for (stamp = stamps, stamps = 0; stamp != NULL;){ + (*stamp->v->free)(stamp->id); + st = stamp->next; + free (stamp); + stamp = st; + } + + if (stamps) + vfs_rmstamp (stamps->v, stamps->id, 1); + + if (current_dir) + free (current_dir); + + extfs_done (); + +#ifdef USE_NETCODE + ftpfs_done(); +#endif + +} + +/* These ones grab information from the VFS + * and handles them to an upper layer + */ +void vfs_fill_names (void (*func)(char *)) +{ +#ifdef USE_NETCODE + mcfs_fill_names (func); + ftpfs_fill_names (func); +#endif + tarfs_fill_names (func); + extfs_fill_names (func); +} + +/* Following stuff (parse_ls_lga) is used by ftpfs and extfs */ +#define MAXCOLS 30 + +static char *columns [MAXCOLS]; /* Points to the string in column n */ +static int column_ptr [MAXCOLS]; /* Index from 0 to the starting positions of the columns */ + +static int split_text (char *p) +{ + char *original = p; + int numcols; + + + for (numcols = 0; *p && numcols < MAXCOLS; numcols++){ + while (*p == ' ' || *p == '\r' || *p == '\n'){ + *p = 0; + p++; + } + columns [numcols] = p; + column_ptr [numcols] = p - original; + while (*p && *p != ' ' && *p != '\r' && *p != '\n') + p++; + } + return numcols; +} + +static int is_num (int idx) +{ + if (columns [idx][0] < '0' || columns [idx][0] > '9') + return 0; + return 1; +} + +static int is_time (char *str, struct tm *tim) +{ + char *p, *p2; + + if ((p=strchr(str, ':')) && (p2=strrchr(str, ':'))) { + if (p != p2) { + if (sscanf (str, "%2d:%2d:%2d", &tim->tm_hour, &tim->tm_min, &tim->tm_sec) != 3) + return (0); + } + else { + if (sscanf (str, "%2d:%2d", &tim->tm_hour, &tim->tm_min) != 2) + return (0); + } + } + else + return (0); + + return (1); +} + +static int is_year(char *str, struct tm *tim) +{ + long year; + + if (!strchr(str, ':')) { + year = atol (str); + if (year < 1900 || year > 3000) + return (0); + tim->tm_year = (int) (year - 1900); + return (1); + } + else + return (0); +} + +#define free_and_return(x) { free (p_copy); return (x); } +int parse_ls_lga (char *p, struct stat *s, char **filename, char **linkname) +{ + static char *month = "JanFebMarAprMayJunJulAugSepOctNovDec"; + static char *week = "SunMonTueWedThuFriSat"; + char *pos; + int idx, idx2, num_cols, isconc = 0; + int i; + struct tm tim; + int extfs_format_date = 0; + char *p_copy; + + s->st_mode = 0; + if (strncmp (p, "total", 5) == 0){ + return 0; + } + switch (*(p++)){ + case 'd': s->st_mode |= S_IFDIR; break; + case 'b': s->st_mode |= S_IFBLK; break; + case 'c': s->st_mode |= S_IFCHR; break; + case 'm': s->st_mode |= S_IFREG; break; /* Don't know what it is :-) */ + case 'n': s->st_mode |= S_IFREG; break; /* and this as well */ + case 'l': s->st_mode |= S_IFLNK; break; +#ifdef IS_IFSOCK + case 's': s->st_mode |= S_IFSOCK; break; +#endif + case 'p': s->st_mode |= S_IFIFO; break; + case '-': s->st_mode |= S_IFREG; break; + case '?': s->st_mode |= S_IFREG; break; + default: return 0; + } + if (*p == '['){ + if (strlen (p) <= 8 || p [8] != ']') + return 0; + /* Should parse here the Notwell permissions :) */ + if (S_ISDIR (s->st_mode)) + s->st_mode |= (S_IRUSR | S_IRGRP | S_IROTH | S_IWUSR | S_IXUSR | S_IXGRP | S_IXOTH); + else + s->st_mode |= (S_IRUSR | S_IRGRP | S_IROTH | S_IWUSR); + p += 9; + } else { + switch (*(p++)){ + case 'r': s->st_mode |= 0400; break; + case '-': break; + default: return 0; + } + switch (*(p++)){ + case 'w': s->st_mode |= 0200; break; + case '-': break; + default: return 0; + } + switch (*(p++)){ + case 'x': s->st_mode |= 0100; break; + case 's': s->st_mode |= 0100 | S_ISUID; break; + case 'S': s->st_mode |= S_ISUID; break; + case '-': break; + default: return 0; + } + switch (*(p++)){ + case 'r': s->st_mode |= 0040; break; + case '-': break; + default: return 0; + } + switch (*(p++)){ + case 'w': s->st_mode |= 0020; break; + case '-': break; + default: return 0; + } + switch (*(p++)){ + case 'x': s->st_mode |= 0010; break; + case 's': s->st_mode |= 0010 | S_ISGID; break; + case 'S': s->st_mode |= S_ISGID; break; + case '-': break; + default: return 0; + } + switch (*(p++)){ + case 'r': s->st_mode |= 0004; break; + case '-': break; + default: return 0; + } + switch (*(p++)){ + case 'w': s->st_mode |= 0002; break; + case '-': break; + default: return 0; + } + switch (*(p++)){ + case 'x': s->st_mode |= 0001; break; + case 't': s->st_mode |= 0001 | S_ISVTX; break; + case 'T': s->st_mode |= S_ISVTX; break; + case '-': break; + default: return 0; + } + } + + p_copy = strdup (p); + num_cols = split_text (p); + + s->st_nlink = atol (columns [0]); + if (s->st_nlink <= 0) + free_and_return (0); + + if (!is_num (1)) + s->st_uid = finduid (columns [1]); + else + s->st_uid = (uid_t) atol (columns [1]); + + /* Mhm, the ls -lg did not produce a group field */ + for (idx = 3; idx <= 5; idx++) + if ((*columns [idx] >= 'A' && *columns [idx] <= 'S' && + strlen (columns[idx]) == 3) || (strlen (columns[idx])==8 && + columns [idx][2] == '-' && columns [idx][5] == '-')) + break; + if (idx == 6 || (idx == 5 && !S_ISCHR (s->st_mode) && !S_ISBLK (s->st_mode))) + free_and_return (0); + if (idx < 5){ + char *p = strchr(columns [idx - 1], ','); + if (p && p[1] >= '0' && p[1] <= '9') + isconc = 1; + } + if (idx == 3 || (idx == 4 && !isconc && (S_ISCHR(s->st_mode) || S_ISBLK (s->st_mode)))) + idx2 = 2; + else { + if (is_num (2)) + s->st_gid = (gid_t) atol (columns [2]); + else + s->st_gid = findgid (columns [2]); + idx2 = 3; + } + + if (S_ISCHR (s->st_mode) || S_ISBLK (s->st_mode)){ + char *p; + if (!is_num (idx2)) + free_and_return (0); +#ifdef HAVE_ST_RDEV + s->st_rdev = (atol (columns [idx2]) & 0xff) << 8; +#endif + if (isconc){ + p = strchr (columns [idx2], ','); + if (!p || p [1] < '0' || p [1] > '9') + free_and_return (0); + p++; + } else { + p = columns [idx2 + 1]; + if (!is_num (idx2+1)) + free_and_return (0); + } + +#ifdef HAVE_ST_RDEV + s->st_rdev |= (atol (p) & 0xff); +#endif + s->st_size = 0; + } else { + if (!is_num (idx2)) + free_and_return (0); + + s->st_size = (size_t) atol (columns [idx2]); +#ifdef HAVE_ST_RDEV + s->st_rdev = 0; +#endif + } + + /* Let's setup default time values */ + tim.tm_year = current_year; + tim.tm_mon = current_mon; + tim.tm_mday = current_mday; + tim.tm_hour = 0; + tim.tm_min = 0; + tim.tm_sec = 0; + tim.tm_isdst = 0; + + p = columns [idx++]; + + if((pos=strstr(week, p)) != NULL){ + tim.tm_wday = (pos - week)/3; + p = columns [idx++]; + } + + if((pos=strstr(month, p)) != NULL) + tim.tm_mon = (pos - month)/3; + else { + /* This case should not normaly happen, but in extfs we allow these + date formats: + Mon DD hh:mm + Mon DD YYYY + Mon DD YYYY hh:mm + Wek Mon DD hh:mm:ss YYYY + MM-DD-YY hh:mm + where Mon is Jan-Dec, DD, MM, YY two digit day, month, year, + YYYY four digit year, hh, mm two digit hour and minute. */ + + if (strlen (p) == 8 && p [2] == '-' && p [5] == '-'){ + p [2] = 0; + p [5] = 0; + tim.tm_mon = (int) atol (p); + if (!tim.tm_mon) + free_and_return (0) + else + tim.tm_mon--; + tim.tm_mday = (int) atol (p + 3); + tim.tm_year = (int) atol (p + 6); + if (tim.tm_year < 70) + tim.tm_year += 70; + extfs_format_date = 1; + } else + free_and_return (0); + } + + if (!extfs_format_date){ + if (!is_num (idx)) + free_and_return (0); + tim.tm_mday = (int)atol (columns [idx++]); + } + + if (is_num (idx)) { + if(is_time(columns[idx], &tim) || is_year(columns[idx], &tim)) { + idx++; + + if(is_num (idx) && + (is_year(columns[idx], &tim) || is_time(columns[idx], &tim))) + idx++; /* time & year or reverse */ + } /* only time or date */ + } + else + free_and_return (0); /* Nor time or date */ + + /* Use resultimg time value */ + s->st_mtime = mktime (&tim); + if (s->st_mtime == -1) + s->st_mtime = 0; + s->st_atime = s->st_mtime; + s->st_ctime = s->st_mtime; + s->st_dev = 0; + s->st_ino = 0; +#ifdef HAVE_ST_BLKSIZE + s->st_blksize = 512; +#endif +#ifdef HAVE_ST_BLOCKS + s->st_blocks = (s->st_size + 511) / 512; +#endif + + for (i = idx + 1, idx2 = 0; i < num_cols; i++ ) + if (strcmp (columns [i], "->") == 0){ + idx2 = i; + break; + } + + if (((S_ISLNK (s->st_mode) || + (num_cols == idx + 3 && s->st_nlink > 1))) /* Maybe a hardlink? (in extfs) */ + && idx2){ + int p; + char *s; + + if (filename){ + p = column_ptr [idx2] - column_ptr [idx]; + s = xmalloc (p, "filename"); + strncpy (s, p_copy + column_ptr [idx], p - 1); + s[p - 1] = '\0'; + *filename = s; + } + if (linkname){ + s = strdup (p_copy + column_ptr [idx2+1]); + p = strlen (s); + if (s [p-1] == '\r' || s [p-1] == '\n') + s [p-1] = 0; + if (s [p-2] == '\r' || s [p-2] == '\n') + s [p-2] = 0; + + *linkname = s; + } + } else { + /* Extract the filename from the string copy, not from the columns + * this way we have a chance of entering hidden directories like ". ." + */ + if (filename){ + /* + *filename = strdup (columns [idx++]); + */ + int p; + char *s; + + s = strdup (p_copy + column_ptr [idx++]); + p = strlen (s); + if (s [p-1] == '\r' || s [p-1] == '\n') + s [p-1] = 0; + if (s [p-2] == '\r' || s [p-2] == '\n') + s [p-2] = 0; + + *filename = s; + } + if (linkname) + *linkname = NULL; + } + free_and_return (1); +} + +void +vfs_force_expire (char *pathname) +{ + vfs *vfs; + + pathname = vfs_canon (pathname); + vfs = vfs_type (pathname); + if (vfs->forget_about) + (*vfs->forget_about) (pathname); + free (pathname); +} + +void +vfs_die (char *m) +{ + message_1s (1, "Internal error:", m); + exit (1); +} + +#ifndef VFS_STANDALONE +char * +vfs_get_password (char *msg) +{ + return (char *) input_dialog (msg, _("Password:"), ""); +} +#endif diff -uNr gnome-libs-0.26/libvfs/vfs.h gnome-libs-0.27/libvfs/vfs.h --- gnome-libs-0.26/libvfs/vfs.h Wed Dec 31 19:00:00 1969 +++ gnome-libs-0.27/libvfs/vfs.h Thu Jul 23 14:08:54 1998 @@ -0,0 +1,317 @@ +#ifndef __VFS_H +#define __VFS_H + +#ifdef VFS_STANDALONE +#include "util-alone.h" +#undef USE_EXT2FSLIB +#else +#define BROKEN_PATHS +/* + * We should really only allow /:ftp/ tree to export ftp, but midnight's users may + * like to be able to cd .. to get back where there were before ftp. How to solve? + * Ok, we'll allow /any/path/:ftp/ to access ftp tree. Broken, yes. + */ +#endif + +#if !defined(SCO_FLAVOR) || !defined(_SYS_SELECT_H) +# include /* alex: this redefines struct timeval */ +#endif /* SCO_FLAVOR */ + +#ifdef HAVE_UTIME_H +# include +#else +struct utimbuf { + time_t actime; + time_t modtime; +}; +#endif + +#ifdef USE_VFS + +#ifdef HAVE_MMAP +#include +#endif + + /* Our virtual file system layer */ + + typedef void * vfsid; + + struct vfs_stamping; + + typedef struct { + void *(*open)(char *fname, int flags, int mode); + int (*close)(void *vfs_info); + int (*read)(void *vfs_info, char *buffer, int count); + int (*write)(void *vfs_info, char *buf, int count); + + void *(*opendir)(char *dirname); + void *(*readdir)(void *vfs_info); + int (*closedir)(void *vfs_info); + int (*telldir)(void *dir); + void (*seekdir)(void *dir, int offset); + + int (*stat)(char *path, struct stat *buf); + int (*lstat)(char *path, struct stat *buf); + int (*fstat)(void *vfs_info, struct stat *buf); + + int (*chmod)(char *path, int mode); + int (*chown)(char *path, int owner, int group); + int (*utime)(char *path, struct utimbuf *times); + + int (*readlink)(char *path, char *buf, int size); + int (*symlink)(char *n1, char *n2); + int (*link)(char *p1, char *p2); + int (*unlink)(char *path); + int (*rename)(char *p1, char *p2); + int (*chdir)(char *path); + int (*ferrno)(void); + int (*lseek)(void *vfs_info, off_t offset, int whence); + int (*mknod)(char *path, int mode, int dev); + + vfsid (*getid)(char *path, struct vfs_stamping **parent); + int (*nothingisopen)(vfsid id); + void (*free)(vfsid id); + + char *(*getlocalcopy)(char *filename); + void (*ungetlocalcopy)(char *filename, char *local, int has_changed); + + int (*mkdir)(char *path, mode_t mode); + int (*rmdir)(char *path); + + int (*ctl)(void *vfs_info, int ctlop, int arg); + int (*setctl)(char *path, int ctlop, char *arg); + void (*forget_about)(char *path); +#ifdef HAVE_MMAP + caddr_t (*mmap)(caddr_t addr, size_t len, int prot, int flags, void *vfs_info, off_t offset); + int (*munmap)(caddr_t addr, size_t len, void *vfs_info); +#endif + } vfs; + + /* Other file systems */ + extern vfs local_vfs_ops; + extern vfs tarfs_vfs_ops; + + extern vfs ftpfs_vfs_ops; + extern vfs mcfs_vfs_ops; + + extern vfs extfs_vfs_ops; + + extern vfs undelfs_vfs_ops; + + struct vfs_stamping { + vfs *v; + vfsid id; + struct vfs_stamping *parent; /* At the moment applies to tarfs only */ + struct vfs_stamping *next; + struct timeval time; + }; + + void vfs_init (void); + void vfs_shut (void); + + extern int vfs_type_absolute; + vfs *vfs_type (char *path); + vfsid vfs_ncs_getid (vfs *nvfs, char *dir, struct vfs_stamping **par); + void vfs_rm_parents (struct vfs_stamping *stamp); + char *vfs_path (char *path); + char *vfs_canon (char *path); + char *mc_get_current_wd (char *buffer, int bufsize); + int vfs_current_is_local (void); + int vfs_current_is_extfs (void); + int vfs_current_is_tarfs (void); + int vfs_file_is_local (char *name); + int vfs_file_is_ftp (char *filename); + char *vfs_get_current_dir (void); + + void vfs_stamp (vfs *, vfsid); + void vfs_rmstamp (vfs *, vfsid, int); + void vfs_addstamp (vfs *, vfsid, struct vfs_stamping *); + void vfs_add_noncurrent_stamps (vfs *, vfsid, struct vfs_stamping *); + void vfs_add_current_stamps (void); + void vfs_free_resources(char *path); + void vfs_timeout_handler (); + int vfs_timeouts (); + void vfs_force_expire (char *pathname); + + void vfs_fill_names (void (*)(char *)); + + /* Required for the vfs_canon routine */ + char *tarfs_analysis (char *inname, char **archive, int is_dir); + + void ftpfs_init(void); + void ftpfs_done(void); + void ftpfs_set_debug (char *file); +#ifdef USE_NETCODE + void ftpfs_hint_reread(int reread); + void ftpfs_flushdir(void); +#else +# define ftpfs_flushdir() +# define ftpfs_hint_reread(x) +#endif + /* They fill the file system names */ + void mcfs_fill_names (void (*)(char *)); + void ftpfs_fill_names (void (*)(char *)); + void tarfs_fill_names (void (*)(char *)); + + /* Only the routines outside of the VFS module need the emulation macros */ + + int mc_open (char *file, int flags, ...); + int mc_close (int handle); + int mc_read (int handle, char *buffer, int count); + int mc_write (int hanlde, char *buffer, int count); + off_t mc_lseek (int fd, off_t offset, int whence); + int mc_chdir (char *); + + DIR *mc_opendir (char *dirname); + struct dirent *mc_readdir(DIR *dirp); + int mc_closedir (DIR *dir); + int mc_telldir (DIR *dir); + void mc_seekdir (DIR *dir, int offset); + + int mc_stat (char *path, struct stat *buf); + int mc_lstat (char *path, struct stat *buf); + int mc_fstat (int fd, struct stat *buf); + + int mc_chmod (char *path, int mode); + int mc_chown (char *path, int owner, int group); + int mc_utime (char *path, struct utimbuf *times); + int mc_readlink(char *path, char *buf, int bufsiz); + int mc_unlink (char *path); + int mc_symlink (char *name1, char *name2); + int mc_link (char *name1, char *name2); + int mc_mknod (char *, int, int); + int mc_rename (char *original, char *target); + int mc_write (int fd, char *buf, int nbyte); + int mc_rmdir (char *path); + int mc_mkdir (char *path, mode_t mode); + char *mc_getlocalcopy (char *filename); + void mc_ungetlocalcopy (char *filename, char *local, int has_changed); + char *mc_def_getlocalcopy (char *filename); + void mc_def_ungetlocalcopy (char *filename, char *local, int has_changed); + int mc_ctl (int fd, int ctlop, int arg); + int mc_setctl (char *path, int ctlop, char *arg); +#ifdef HAVE_MMAP + caddr_t mc_mmap (caddr_t, size_t, int, int, int, off_t); + int mc_unmap (caddr_t, size_t); + int mc_munmap (caddr_t addr, size_t len); +#endif /* HAVE_MMAP */ + +#else + +#ifdef USE_NETCODE +# undef USE_NETCODE +#endif + +# undef USE_NETCODE + +# define vfs_fill_names(x) +# define vfs_add_current_stamps() +# define vfs_current_is_local() 1 +# define vfs_file_is_local(x) 1 +# define vfs_file_is_ftp(x) 0 +# define vfs_current_is_tarfs() 0 +# define vfs_current_is_extfs() 0 +# define vfs_path(x) x +# define mc_close close +# define mc_read read +# define mc_write write +# define mc_lseek lseek +# define mc_opendir opendir +# define mc_readdir readdir +# define mc_closedir closedir +# define mc_telldir telldir +# define mc_seekdir seekdir + +# define mc_get_current_wd(x,size) get_current_wd (x, size) +# define mc_fstat fstat +# define mc_lstat lstat + +# define mc_readlink readlink +# define mc_symlink symlink +# define mc_rename rename + +#ifndef __os2__ +# define mc_open open +# define mc_utime utime +# define mc_chmod chmod +# define mc_chown chown +# define mc_chdir chdir +# define mc_unlink unlink +#endif + +# define mc_mmap mmap +# define mc_munmap munmap + +# define mc_ctl(a,b,c) 0 +# define mc_setctl(a,b,c) + +# define mc_stat stat +# define mc_mknod mknod +# define mc_link link +# define mc_mkdir mkdir +# define mc_rmdir rmdir +# define is_special_prefix(x) 0 +# define vfs_type(x) (vfs *)(NULL) +# define vfs_setup_wd() +# define vfs_init() +# define vfs_shut() +# define vfs_canon(p) strdup (canonicalize_pathname(p)) +# define vfs_free_resources() +# define vfs_timeout_handler() +# define vfs_timeouts() 0 +# define vfs_force_expire () + + typedef int vfs; + +# define mc_getlocalcopy(x) NULL +# define mc_ungetlocalcopy(x,y,z) + +# define ftpfs_hint_reread(x) +# define ftpfs_flushdir() + +#ifdef _OS_NT +# undef mc_rmdir +#endif + +#ifdef OS2_NT +# undef mc_ctl +# undef mc_unlink +# define mc_ctl(a,b,c) 0 +# ifndef __EMX__ +# undef mc_mkdir +# define mc_mkdir(a,b) mkdir(a) +# endif +#endif + +#endif /* USE_VFS */ + +#define mc_errno errno + +#ifdef WANT_PARSE_LS_LGA +int parse_ls_lga (char *p, struct stat *s, char **filename, char **linkname); +#endif +extern void vfs_die (char *msg); +extern char *vfs_get_password (char *msg); + +#define MCCTL_SETREMOTECOPY 0 +#define MCCTL_ISREMOTECOPY 1 +#define MCCTL_REMOTECOPYCHUNK 2 +#define MCCTL_FINISHREMOTE 3 +#define MCCTL_FLUSHDIR 4 +#define MCCTL_REMOVELOCALCOPY 5 + +/* Return codes from the ${fs}_ctl routine */ + +#define MCERR_TARGETOPEN -1 + /* Can't open target file */ +#define MCERR_READ -2 + /* Read error on source file */ +#define MCERR_WRITE -3 + /* Write error on target file */ +#define MCERR_FINISH -4 + /* Finished transfer */ +#define MCERR_DATA_ON_STDIN -5 + /* Data waiting on stdin to be processed */ + +#endif /* __VFS_H */ + diff -uNr gnome-libs-0.26/macros/ChangeLog gnome-libs-0.27/macros/ChangeLog --- gnome-libs-0.26/macros/ChangeLog Wed Aug 5 11:38:48 1998 +++ gnome-libs-0.27/macros/ChangeLog Fri Aug 7 14:46:09 1998 @@ -1,3 +1,7 @@ +1998-08-06 Martin Baulig + + * gnome-libgtop-sysdeps.m4: Added `freebsd' directory. + 1998-08-04 Raja R Harinath * gnome-x-checks.m4: Define USE_DEVGTK unconditionally to `true'. diff -uNr gnome-libs-0.26/macros/gnome-libgtop-sysdeps.m4 gnome-libs-0.27/macros/gnome-libgtop-sysdeps.m4 --- gnome-libs-0.26/macros/gnome-libgtop-sysdeps.m4 Thu Jul 30 07:45:58 1998 +++ gnome-libs-0.27/macros/gnome-libgtop-sysdeps.m4 Fri Aug 7 14:46:09 1998 @@ -83,6 +83,11 @@ libgtop_use_machine_h=yes libgtop_need_server=yes ;; + freebsd*) + libgtop_sysdeps_dir=freebsd + libgtop_use_machine_h=yes + libgtop_need_server=yes + ;; *) libgtop_sysdeps_dir=stub libgtop_use_machine_h=no diff -uNr gnome-libs-0.26/po/ChangeLog gnome-libs-0.27/po/ChangeLog --- gnome-libs-0.26/po/ChangeLog Thu Aug 6 12:53:03 1998 +++ gnome-libs-0.27/po/ChangeLog Fri Aug 7 14:46:09 1998 @@ -1,3 +1,13 @@ +1998-08-07 Nuno Ferreira + + * pt.po: Updated. + +1998-08-06 Raja R Harinath + + * POTFILES.in: Add `libvfs/*'. + * cs.po, de.po, es.po, fi.po, fr.po, ga.po, it.po, ja.po, + ko.po, no.po, pt.po: `make update-po' fun. + 1998-08-06 Federico Mena Quintero * POTFILES.in: Removed spurious files that are not in diff -uNr gnome-libs-0.26/po/POTFILES.in gnome-libs-0.27/po/POTFILES.in --- gnome-libs-0.26/po/POTFILES.in Thu Aug 6 12:52:20 1998 +++ gnome-libs-0.27/po/POTFILES.in Fri Aug 7 14:46:09 1998 @@ -26,8 +26,8 @@ gtk-xmhtml/readJPEGplc.c gtk-xmhtml/readPNG.c gtk-xmhtml/readXPM.c -libgnome/gnome-i18n.h -libgnome/gnome-i18nP.h +#libgnome/gnome-i18n.h +#libgnome/gnome-i18nP.h libgnome/gnome-parse.c libgnomeui/gnome-about.c libgnomeui/gnome-about.h @@ -49,10 +49,14 @@ libgnomeui/gnome-stock.c libgnomeui/gnome_segv.c libgnomeui/stock_demo.c +libvfs/extfs.c +libvfs/ftpfs.c +libvfs/mcfs.c +libvfs/tar.c +libvfs/vfs.c support/argp-fmtstream.h support/argp-parse.c support/argp.h -support/easy-vsnprintf.c support/error.c support/error.h support/getopt.c diff -uNr gnome-libs-0.26/po/cat-id-tbl.c gnome-libs-0.27/po/cat-id-tbl.c --- gnome-libs-0.26/po/cat-id-tbl.c Thu Aug 6 13:02:20 1998 +++ gnome-libs-0.27/po/cat-id-tbl.c Fri Aug 7 17:28:00 1998 @@ -185,29 +185,60 @@ {"Preferences...", 160}, {"Scores...", 161}, {"Edit", 162}, - {"Give this help list", 163}, - {"Give a short usage message", 164}, - {"Set the program name", 165}, - {"Hang for SECS seconds (default 3600)", 166}, - {"Print program version", 167}, - {"(PROGRAM ERROR) No version known!?", 168}, - {"%s: Too many arguments\n", 169}, - {"(PROGRAM ERROR) Option should have been recognized!?", 170}, - {"Unknown system error", 171}, - {"%s: option `%s' is ambiguous\n", 172}, - {"%s: option `--%s' doesn't allow an argument\n", 173}, - {"%s: option `%c%s' doesn't allow an argument\n", 174}, - {"%s: option `%s' requires an argument\n", 175}, - {"%s: unrecognized option `--%s'\n", 176}, - {"%s: unrecognized option `%c%s'\n", 177}, - {"%s: illegal option -- %c\n", 178}, - {"%s: invalid option -- %c\n", 179}, - {"%s: option requires an argument -- %c\n", 180}, - {"%s: option `-W %s' is ambiguous\n", 181}, - {"%s: option `-W %s' doesn't allow an argument\n", 182}, - {"The user chose Yes/OK with data:\n", 183}, - {"The user chose No/Cancel with data:\n", 184}, - {"Weird number in reply callback", 185}, + {"\ +Couldn't open %s archive\n\ +%s", 163}, + {"Inconsistent extfs archive", 164}, + {" Could not set source routing (%s)", 165}, + {"\ +~/.netrc file has not correct mode.\n\ +Remove password or correct mode.", 166}, + {" MCFS ", 167}, + {" The server does not support this version ", 168}, + {" Warning ", 169}, + {"\ + The remote server is not running on a system port \n\ + you need a password to log in, but the information may \n\ + not be safe on the remote side. Continue? \n", 170}, + {" Yes ", 171}, + {" No ", 172}, + {" The remote server is running on strange port. Giving up.\n", 173}, + {" MCFS Password required ", 174}, + {" Invalid password ", 175}, + {" Too many open connections ", 176}, + {"Unexpected EOF on archive file", 177}, + {"Inconsistent tar archive", 178}, + {"\ +Couldn't open tar archive\n\ +%s", 179}, + {"\ +Hmm,...\n\ +%s\n\ +doesn't look like a tar archive.", 180}, + {"Password:", 181}, + {"Give this help list", 182}, + {"Give a short usage message", 183}, + {"Set the program name", 184}, + {"Hang for SECS seconds (default 3600)", 185}, + {"Print program version", 186}, + {"(PROGRAM ERROR) No version known!?", 187}, + {"%s: Too many arguments\n", 188}, + {"(PROGRAM ERROR) Option should have been recognized!?", 189}, + {"Unknown system error", 190}, + {"%s: option `%s' is ambiguous\n", 191}, + {"%s: option `--%s' doesn't allow an argument\n", 192}, + {"%s: option `%c%s' doesn't allow an argument\n", 193}, + {"%s: option `%s' requires an argument\n", 194}, + {"%s: unrecognized option `--%s'\n", 195}, + {"%s: unrecognized option `%c%s'\n", 196}, + {"%s: illegal option -- %c\n", 197}, + {"%s: invalid option -- %c\n", 198}, + {"%s: option requires an argument -- %c\n", 199}, + {"%s: option `-W %s' is ambiguous\n", 200}, + {"%s: option `-W %s' doesn't allow an argument\n", 201}, + {"The user chose Yes/OK with data:\n", 202}, + {"The user chose No/Cancel with data:\n", 203}, + {"Weird number in reply callback", 204}, }; -int _msg_tbl_length = 185; +int _msg_tbl_length = 204; Binary files gnome-libs-0.26/po/cs.gmo and gnome-libs-0.27/po/cs.gmo differ diff -uNr gnome-libs-0.26/po/cs.po gnome-libs-0.27/po/cs.po --- gnome-libs-0.26/po/cs.po Wed Aug 5 19:58:50 1998 +++ gnome-libs-0.27/po/cs.po Thu Aug 13 19:56:25 1998 @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 1998-08-01 16:36-0500\n" +"POT-Creation-Date: 1998-08-06 13:45-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -14,20 +14,20 @@ "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: ENCODING\n" -#: gnome-hello/gnome-hello-2-i18n.c:31 gnome-hello/gnome-hello-3-parse-args.c:33 gnome-hello/gnome-hello.c:40 +#: gnome-hello/gnome-hello-2-i18n.c:31 gnome-hello/gnome-hello-3-parse-args.c:33 msgid "File/Exit" msgstr "Konec" -#: gnome-hello/gnome-hello-2-i18n.c:31 gnome-hello/gnome-hello-3-parse-args.c:33 gnome-hello/gnome-hello.c:40 +#: gnome-hello/gnome-hello-2-i18n.c:31 gnome-hello/gnome-hello-3-parse-args.c:33 msgid "E" msgstr "" #. The '...' end indicate that the options open a dialog -#: gnome-hello/gnome-hello-2-i18n.c:33 gnome-hello/gnome-hello-3-parse-args.c:35 gnome-hello/gnome-hello.c:42 +#: gnome-hello/gnome-hello-2-i18n.c:33 gnome-hello/gnome-hello-3-parse-args.c:35 msgid "Help/About..." msgstr "N\341pov\354da/O programu ..." -#: gnome-hello/gnome-hello-2-i18n.c:33 gnome-hello/gnome-hello-3-parse-args.c:35 gnome-hello/gnome-hello.c:42 +#: gnome-hello/gnome-hello-2-i18n.c:33 gnome-hello/gnome-hello-3-parse-args.c:35 msgid "A" msgstr "" @@ -39,20 +39,20 @@ #. We make a button, bind the 'clicked' signal to hello and setting it #. to be the content of the main window -#: gnome-hello/gnome-hello-2-i18n.c:83 gnome-hello/gnome-hello-3-parse-args.c:113 gnome-hello/gnome-hello-4-SM.c:213 gnome-hello/gnome-hello.c:103 +#: gnome-hello/gnome-hello-2-i18n.c:83 gnome-hello/gnome-hello-3-parse-args.c:113 gnome-hello/gnome-hello-4-SM.c:213 msgid "Hello GNOME" msgstr "" -#: gnome-hello/gnome-hello-2-i18n.c:102 gnome-hello/gnome-hello-3-parse-args.c:132 gnome-hello/gnome-hello-4-SM.c:232 gnome-hello/gnome-hello.c:122 +#: gnome-hello/gnome-hello-2-i18n.c:102 gnome-hello/gnome-hello-3-parse-args.c:132 gnome-hello/gnome-hello-4-SM.c:232 msgid "Hello GNOME\n" msgstr "" -#: gnome-hello/gnome-hello-2-i18n.c:125 gnome-hello/gnome-hello-3-parse-args.c:155 gnome-hello/gnome-hello-4-SM.c:255 gnome-hello/gnome-hello.c:145 +#: gnome-hello/gnome-hello-2-i18n.c:125 gnome-hello/gnome-hello-3-parse-args.c:155 gnome-hello/gnome-hello-4-SM.c:255 msgid "The Hello World Gnomified" msgstr "" #. another comments -#: gnome-hello/gnome-hello-2-i18n.c:130 gnome-hello/gnome-hello-3-parse-args.c:160 gnome-hello/gnome-hello-4-SM.c:260 gnome-hello/gnome-hello.c:150 +#: gnome-hello/gnome-hello-2-i18n.c:130 gnome-hello/gnome-hello-3-parse-args.c:160 gnome-hello/gnome-hello-4-SM.c:260 msgid "GNOME is a civilized software system so we've a \"hello world\" program" msgstr "GNOME je civilizovan\375 softv\351rov\375 syst\351m, tak\276e m\341me \"hello world\" program" @@ -85,7 +85,7 @@ msgid "File" msgstr "Konec" -#: gnome-hello/gnome-hello-4-SM.c:79 gnome-hello/gnome-hello-7-mdi.c:404 libgnomeui/gnome-stock.c:474 libgnomeui/gnome-stock.c:475 libgnomeui/gnome-stock.c:476 libgnomeui/stock_demo.c:342 +#: gnome-hello/gnome-hello-4-SM.c:79 gnome-hello/gnome-hello-7-mdi.c:404 libgnomeui/gnome-stock.c:720 libgnomeui/stock_demo.c:342 msgid "Help" msgstr "" @@ -137,46 +137,25 @@ msgid "Children/" msgstr "" -# , c-format -#: gnome-hello/gnome-hello.c:208 -msgid "" -"%s: A gnomified 'Hello World' program\n" -"\n" -"Usage: %s [--help] [--version]\n" -"\n" -"Options:\n" -" --help display this help and exit\n" -" --version output version information and exit\n" -msgstr "" - -# , c-format -#: gnome-hello/gnome-hello.c:217 -msgid "Gnome Hello %s.\n" -msgstr "" - -#: gnome-hello/gnome-hello.c:231 -msgid "Options error\n" -msgstr "" - #: libgnome/gnome-parse.c:44 msgid "" "\n" "Generic options" msgstr "" -#: libgnomeui/gnome-about.c:193 +#: libgnomeui/gnome-about.c:201 msgid "Author:" msgstr "Autor" -#: libgnomeui/gnome-about.c:195 libgnomeui/gnome-about.c:197 +#: libgnomeui/gnome-about.c:203 libgnomeui/gnome-about.c:205 msgid "Authors:" msgstr "Auto\370i" -#: libgnomeui/gnome-about.c:357 +#: libgnomeui/gnome-about.c:365 msgid "Authors: " msgstr "Auto\370i" -#: libgnomeui/gnome-about.c:567 libgnomeui/stock_demo.c:331 +#: libgnomeui/gnome-about.c:575 libgnomeui/stock_demo.c:331 msgid "About" msgstr "O programu" @@ -575,43 +554,51 @@ msgid "Date" msgstr "" -#: libgnomeui/gnome-stock.c:468 +#: libgnomeui/gnome-stock.c:714 msgid "OK" msgstr "" -#: libgnomeui/gnome-stock.c:469 +#: libgnomeui/gnome-stock.c:715 msgid "Apply" msgstr "" -#: libgnomeui/gnome-stock.c:470 +#: libgnomeui/gnome-stock.c:716 msgid "Cancel" msgstr "" -#: libgnomeui/gnome-stock.c:471 libgnomeui/stock_demo.c:163 +#: libgnomeui/gnome-stock.c:717 libgnomeui/stock_demo.c:163 msgid "Close" msgstr "" -#: libgnomeui/gnome-stock.c:472 +#: libgnomeui/gnome-stock.c:718 msgid "Yes" msgstr "" -#: libgnomeui/gnome-stock.c:473 +#: libgnomeui/gnome-stock.c:719 msgid "No" msgstr "" -#: libgnomeui/gnome-stock.c:1394 +#: libgnomeui/gnome-stock.c:721 +msgid "Next" +msgstr "" + +#: libgnomeui/gnome-stock.c:722 +msgid "Prev" +msgstr "" + +#: libgnomeui/gnome-stock.c:1646 msgid "Menu Accelerator Keys" msgstr "" -#: libgnomeui/gnome-stock.c:1396 +#: libgnomeui/gnome-stock.c:1648 msgid "Global" msgstr "" -#: libgnomeui/gnome-stock.c:1398 +#: libgnomeui/gnome-stock.c:1650 msgid "Menu Item" msgstr "" -#: libgnomeui/gnome-stock.c:1399 +#: libgnomeui/gnome-stock.c:1651 msgid "Accelerator" msgstr "" @@ -622,6 +609,7 @@ msgstr "" # , c-format +# , c-format #: libgnomeui/gnome_segv.c:68 msgid "" "Application \"%s\" has a bug.\n" @@ -699,6 +687,99 @@ msgid "Edit" msgstr "" +# , c-format +#: libvfs/extfs.c:268 +msgid "" +"Couldn't open %s archive\n" +"%s" +msgstr "" + +#: libvfs/extfs.c:300 libvfs/extfs.c:320 +msgid "Inconsistent extfs archive" +msgstr "" + +# , c-format +#: libvfs/ftpfs.c:602 +msgid " Could not set source routing (%s)" +msgstr "" + +#: libvfs/ftpfs.c:2783 libvfs/ftpfs.c:2798 +msgid "" +"~/.netrc file has not correct mode.\n" +"Remove password or correct mode." +msgstr "" + +#: libvfs/mcfs.c:156 +msgid " MCFS " +msgstr "" + +#: libvfs/mcfs.c:156 +msgid " The server does not support this version " +msgstr "" + +#: libvfs/mcfs.c:172 +msgid " Warning " +msgstr "" + +#: libvfs/mcfs.c:173 +msgid "" +" The remote server is not running on a system port \n" +" you need a password to log in, but the information may \n" +" not be safe on the remote side. Continue? \n" +msgstr "" + +#: libvfs/mcfs.c:176 +msgid " Yes " +msgstr "" + +#: libvfs/mcfs.c:176 +msgid " No " +msgstr "" + +#: libvfs/mcfs.c:178 +msgid " The remote server is running on strange port. Giving up.\n" +msgstr "" + +#: libvfs/mcfs.c:190 +msgid " MCFS Password required " +msgstr "" + +#: libvfs/mcfs.c:204 +msgid " Invalid password " +msgstr "" + +#: libvfs/mcfs.c:270 +msgid " Too many open connections " +msgstr "" + +#: libvfs/tar.c:586 +msgid "Unexpected EOF on archive file" +msgstr "" + +#: libvfs/tar.c:640 libvfs/tar.c:661 +msgid "Inconsistent tar archive" +msgstr "" + +# , c-format +#: libvfs/tar.c:761 +msgid "" +"Couldn't open tar archive\n" +"%s" +msgstr "" + +# , c-format +#. Error on first record +#: libvfs/tar.c:780 +msgid "" +"Hmm,...\n" +"%s\n" +"doesn't look like a tar archive." +msgstr "" + +#: libvfs/vfs.c:1538 +msgid "Password:" +msgstr "" + #: support/argp-parse.c:90 msgid "Give this help list" msgstr "" @@ -724,6 +805,7 @@ msgstr "" # , c-format +# , c-format #: support/argp-parse.c:641 msgid "%s: Too many arguments\n" msgstr "" @@ -737,59 +819,70 @@ msgstr "" # , c-format +# , c-format #: support/getopt.c:669 msgid "%s: option `%s' is ambiguous\n" msgstr "" # , c-format +# , c-format #. --option #: support/getopt.c:693 msgid "%s: option `--%s' doesn't allow an argument\n" msgstr "" # , c-format +# , c-format #: support/getopt.c:698 msgid "%s: option `%c%s' doesn't allow an argument\n" msgstr "" # , c-format +# , c-format #: support/getopt.c:715 support/getopt.c:888 msgid "%s: option `%s' requires an argument\n" msgstr "" # , c-format +# , c-format #. --option #: support/getopt.c:744 msgid "%s: unrecognized option `--%s'\n" msgstr "" # , c-format +# , c-format #: support/getopt.c:748 msgid "%s: unrecognized option `%c%s'\n" msgstr "" # , c-format +# , c-format #. 1003.2 specifies the format of this message. #: support/getopt.c:774 msgid "%s: illegal option -- %c\n" msgstr "" # , c-format +# , c-format #: support/getopt.c:777 msgid "%s: invalid option -- %c\n" msgstr "" # , c-format +# , c-format #. 1003.2 specifies the format of this message. #: support/getopt.c:807 support/getopt.c:937 msgid "%s: option requires an argument -- %c\n" msgstr "" # , c-format +# , c-format #: support/getopt.c:854 msgid "%s: option `-W %s' is ambiguous\n" msgstr "" +# , c-format # , c-format #: support/getopt.c:872 msgid "%s: option `-W %s' doesn't allow an argument\n" Binary files gnome-libs-0.26/po/de.gmo and gnome-libs-0.27/po/de.gmo differ diff -uNr gnome-libs-0.26/po/de.po gnome-libs-0.27/po/de.po --- gnome-libs-0.26/po/de.po Wed Aug 5 19:58:49 1998 +++ gnome-libs-0.27/po/de.po Thu Aug 13 19:56:25 1998 @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: gnome-libs VERSION\n" -"POT-Creation-Date: 1998-08-01 16:36-0500\n" +"POT-Creation-Date: 1998-08-06 13:45-0500\n" "PO-Revision-Date: 1998-02-20 17:05+0100\n" "Last-Translator: Carsten Schaar@fs-maphy.uni-hannover.de>\n" "Language-Team: Carsten Schaar@fs-maphy.uni-hannover.de>\n" @@ -14,20 +14,20 @@ "Content-Type: text/plain; charset=iso-8859-1\n" "Content-Transfer-Encoding: 8bit\n" -#: gnome-hello/gnome-hello-2-i18n.c:31 gnome-hello/gnome-hello-3-parse-args.c:33 gnome-hello/gnome-hello.c:40 +#: gnome-hello/gnome-hello-2-i18n.c:31 gnome-hello/gnome-hello-3-parse-args.c:33 msgid "File/Exit" msgstr "Datei/Beenden" -#: gnome-hello/gnome-hello-2-i18n.c:31 gnome-hello/gnome-hello-3-parse-args.c:33 gnome-hello/gnome-hello.c:40 +#: gnome-hello/gnome-hello-2-i18n.c:31 gnome-hello/gnome-hello-3-parse-args.c:33 msgid "E" msgstr "E" #. The '...' end indicate that the options open a dialog -#: gnome-hello/gnome-hello-2-i18n.c:33 gnome-hello/gnome-hello-3-parse-args.c:35 gnome-hello/gnome-hello.c:42 +#: gnome-hello/gnome-hello-2-i18n.c:33 gnome-hello/gnome-hello-3-parse-args.c:35 msgid "Help/About..." msgstr "Hilfe/\334ber..." -#: gnome-hello/gnome-hello-2-i18n.c:33 gnome-hello/gnome-hello-3-parse-args.c:35 gnome-hello/gnome-hello.c:42 +#: gnome-hello/gnome-hello-2-i18n.c:33 gnome-hello/gnome-hello-3-parse-args.c:35 msgid "A" msgstr "A" @@ -39,20 +39,20 @@ #. We make a button, bind the 'clicked' signal to hello and setting it #. to be the content of the main window -#: gnome-hello/gnome-hello-2-i18n.c:83 gnome-hello/gnome-hello-3-parse-args.c:113 gnome-hello/gnome-hello-4-SM.c:213 gnome-hello/gnome-hello.c:103 +#: gnome-hello/gnome-hello-2-i18n.c:83 gnome-hello/gnome-hello-3-parse-args.c:113 gnome-hello/gnome-hello-4-SM.c:213 msgid "Hello GNOME" msgstr "Hallo GNOME" -#: gnome-hello/gnome-hello-2-i18n.c:102 gnome-hello/gnome-hello-3-parse-args.c:132 gnome-hello/gnome-hello-4-SM.c:232 gnome-hello/gnome-hello.c:122 +#: gnome-hello/gnome-hello-2-i18n.c:102 gnome-hello/gnome-hello-3-parse-args.c:132 gnome-hello/gnome-hello-4-SM.c:232 msgid "Hello GNOME\n" msgstr "Hallo GNOME\n" -#: gnome-hello/gnome-hello-2-i18n.c:125 gnome-hello/gnome-hello-3-parse-args.c:155 gnome-hello/gnome-hello-4-SM.c:255 gnome-hello/gnome-hello.c:145 +#: gnome-hello/gnome-hello-2-i18n.c:125 gnome-hello/gnome-hello-3-parse-args.c:155 gnome-hello/gnome-hello-4-SM.c:255 msgid "The Hello World Gnomified" msgstr "\"Hallo Welt\" gnomifiziert" #. another comments -#: gnome-hello/gnome-hello-2-i18n.c:130 gnome-hello/gnome-hello-3-parse-args.c:160 gnome-hello/gnome-hello-4-SM.c:260 gnome-hello/gnome-hello.c:150 +#: gnome-hello/gnome-hello-2-i18n.c:130 gnome-hello/gnome-hello-3-parse-args.c:160 gnome-hello/gnome-hello-4-SM.c:260 msgid "GNOME is a civilized software system so we've a \"hello world\" program" msgstr "GNOME ist ein modernes Softwaresystem, deshalb gibt es ein \"Hallo Welt\" Programm" @@ -85,7 +85,7 @@ msgid "File" msgstr "Datei/Beenden" -#: gnome-hello/gnome-hello-4-SM.c:79 gnome-hello/gnome-hello-7-mdi.c:404 libgnomeui/gnome-stock.c:474 libgnomeui/gnome-stock.c:475 libgnomeui/gnome-stock.c:476 libgnomeui/stock_demo.c:342 +#: gnome-hello/gnome-hello-4-SM.c:79 gnome-hello/gnome-hello-7-mdi.c:404 libgnomeui/gnome-stock.c:720 libgnomeui/stock_demo.c:342 msgid "Help" msgstr "Hilfe" @@ -137,46 +137,25 @@ msgid "Children/" msgstr "" -# , c-format -#: gnome-hello/gnome-hello.c:208 -msgid "" -"%s: A gnomified 'Hello World' program\n" -"\n" -"Usage: %s [--help] [--version]\n" -"\n" -"Options:\n" -" --help display this help and exit\n" -" --version output version information and exit\n" -msgstr "" - -# , c-format -#: gnome-hello/gnome-hello.c:217 -msgid "Gnome Hello %s.\n" -msgstr "" - -#: gnome-hello/gnome-hello.c:231 -msgid "Options error\n" -msgstr "" - #: libgnome/gnome-parse.c:44 msgid "" "\n" "Generic options" msgstr "" -#: libgnomeui/gnome-about.c:193 +#: libgnomeui/gnome-about.c:201 msgid "Author:" msgstr "Autor:" -#: libgnomeui/gnome-about.c:195 libgnomeui/gnome-about.c:197 +#: libgnomeui/gnome-about.c:203 libgnomeui/gnome-about.c:205 msgid "Authors:" msgstr "Autoren:" -#: libgnomeui/gnome-about.c:357 +#: libgnomeui/gnome-about.c:365 msgid "Authors: " msgstr "Autoren: " -#: libgnomeui/gnome-about.c:567 libgnomeui/stock_demo.c:331 +#: libgnomeui/gnome-about.c:575 libgnomeui/stock_demo.c:331 msgid "About" msgstr "\334ber" @@ -578,43 +557,51 @@ msgid "Date" msgstr "Datum" -#: libgnomeui/gnome-stock.c:468 +#: libgnomeui/gnome-stock.c:714 msgid "OK" msgstr "OK" -#: libgnomeui/gnome-stock.c:469 +#: libgnomeui/gnome-stock.c:715 msgid "Apply" msgstr "\334bernehmen" -#: libgnomeui/gnome-stock.c:470 +#: libgnomeui/gnome-stock.c:716 msgid "Cancel" msgstr "Abbruch" -#: libgnomeui/gnome-stock.c:471 libgnomeui/stock_demo.c:163 +#: libgnomeui/gnome-stock.c:717 libgnomeui/stock_demo.c:163 msgid "Close" msgstr "Schlie\337en" -#: libgnomeui/gnome-stock.c:472 +#: libgnomeui/gnome-stock.c:718 msgid "Yes" msgstr "Ja" -#: libgnomeui/gnome-stock.c:473 +#: libgnomeui/gnome-stock.c:719 msgid "No" msgstr "Nein" -#: libgnomeui/gnome-stock.c:1394 +#: libgnomeui/gnome-stock.c:721 +msgid "Next" +msgstr "" + +#: libgnomeui/gnome-stock.c:722 +msgid "Prev" +msgstr "" + +#: libgnomeui/gnome-stock.c:1646 msgid "Menu Accelerator Keys" msgstr "Tastaturk\374rzel f\374r Men\374s" -#: libgnomeui/gnome-stock.c:1396 +#: libgnomeui/gnome-stock.c:1648 msgid "Global" msgstr "Global" -#: libgnomeui/gnome-stock.c:1398 +#: libgnomeui/gnome-stock.c:1650 msgid "Menu Item" msgstr "Men\374eintrag" -#: libgnomeui/gnome-stock.c:1399 +#: libgnomeui/gnome-stock.c:1651 msgid "Accelerator" msgstr "Tastaturk\374rzel" @@ -627,6 +614,7 @@ "weitere SIGSEGVs" # , c-format +# , c-format #: libgnomeui/gnome_segv.c:68 msgid "" "Application \"%s\" has a bug.\n" @@ -711,6 +699,103 @@ msgid "Edit" msgstr "" +# , c-format +#: libvfs/extfs.c:268 +msgid "" +"Couldn't open %s archive\n" +"%s" +msgstr "" + +#: libvfs/extfs.c:300 libvfs/extfs.c:320 +msgid "Inconsistent extfs archive" +msgstr "" + +# , c-format +#: libvfs/ftpfs.c:602 +msgid " Could not set source routing (%s)" +msgstr "" + +#: libvfs/ftpfs.c:2783 libvfs/ftpfs.c:2798 +msgid "" +"~/.netrc file has not correct mode.\n" +"Remove password or correct mode." +msgstr "" + +#: libvfs/mcfs.c:156 +msgid " MCFS " +msgstr "" + +#: libvfs/mcfs.c:156 +msgid " The server does not support this version " +msgstr "" + +# , fuzzy +# , fuzzy +#: libvfs/mcfs.c:172 +msgid " Warning " +msgstr "Warnung" + +#: libvfs/mcfs.c:173 +msgid "" +" The remote server is not running on a system port \n" +" you need a password to log in, but the information may \n" +" not be safe on the remote side. Continue? \n" +msgstr "" + +# , fuzzy +#: libvfs/mcfs.c:176 +msgid " Yes " +msgstr "Ja" + +# , fuzzy +#: libvfs/mcfs.c:176 +msgid " No " +msgstr "Nein" + +#: libvfs/mcfs.c:178 +msgid " The remote server is running on strange port. Giving up.\n" +msgstr "" + +#: libvfs/mcfs.c:190 +msgid " MCFS Password required " +msgstr "" + +#: libvfs/mcfs.c:204 +msgid " Invalid password " +msgstr "" + +#: libvfs/mcfs.c:270 +msgid " Too many open connections " +msgstr "" + +#: libvfs/tar.c:586 +msgid "Unexpected EOF on archive file" +msgstr "" + +#: libvfs/tar.c:640 libvfs/tar.c:661 +msgid "Inconsistent tar archive" +msgstr "" + +# , c-format +#: libvfs/tar.c:761 +msgid "" +"Couldn't open tar archive\n" +"%s" +msgstr "" + +# , c-format +#. Error on first record +#: libvfs/tar.c:780 +msgid "" +"Hmm,...\n" +"%s\n" +"doesn't look like a tar archive." +msgstr "" + +#: libvfs/vfs.c:1538 +msgid "Password:" +msgstr "" + #: support/argp-parse.c:90 msgid "Give this help list" msgstr "Zeigt diese Hilfe" @@ -736,6 +821,7 @@ msgstr "(PROGRAMM FEHLER) Version unbekannt!?" # , c-format +# , c-format #: support/argp-parse.c:641 msgid "%s: Too many arguments\n" msgstr "%s: Zu viele Argumente\n" @@ -749,59 +835,70 @@ msgstr "" # , c-format +# , c-format #: support/getopt.c:669 msgid "%s: option `%s' is ambiguous\n" msgstr "" # , c-format +# , c-format #. --option #: support/getopt.c:693 msgid "%s: option `--%s' doesn't allow an argument\n" msgstr "" # , c-format +# , c-format #: support/getopt.c:698 msgid "%s: option `%c%s' doesn't allow an argument\n" msgstr "" # , fuzzy, c-format +# , c-format #: support/getopt.c:715 support/getopt.c:888 msgid "%s: option `%s' requires an argument\n" msgstr "%s: Zu viele Argumente\n" # , c-format +# , c-format #. --option #: support/getopt.c:744 msgid "%s: unrecognized option `--%s'\n" msgstr "" # , c-format +# , c-format #: support/getopt.c:748 msgid "%s: unrecognized option `%c%s'\n" msgstr "" # , c-format +# , c-format #. 1003.2 specifies the format of this message. #: support/getopt.c:774 msgid "%s: illegal option -- %c\n" msgstr "" # , c-format +# , c-format #: support/getopt.c:777 msgid "%s: invalid option -- %c\n" msgstr "" # , fuzzy, c-format +# , c-format #. 1003.2 specifies the format of this message. #: support/getopt.c:807 support/getopt.c:937 msgid "%s: option requires an argument -- %c\n" msgstr "%s: Zu viele Argumente\n" # , c-format +# , c-format #: support/getopt.c:854 msgid "%s: option `-W %s' is ambiguous\n" msgstr "" +# , c-format # , c-format #: support/getopt.c:872 msgid "%s: option `-W %s' doesn't allow an argument\n" Binary files gnome-libs-0.26/po/es.gmo and gnome-libs-0.27/po/es.gmo differ diff -uNr gnome-libs-0.26/po/es.po gnome-libs-0.27/po/es.po --- gnome-libs-0.26/po/es.po Wed Aug 5 19:58:50 1998 +++ gnome-libs-0.27/po/es.po Thu Aug 13 19:56:25 1998 @@ -1,26 +1,32 @@ msgid "" msgstr "" -"POT-Creation-Date: 1998-08-01 16:36-0500\n" -"Content-Type: text/plain; charset=\n" -"Date: 1998-04-20 20:15:47-0500\n" +"Date: 1998-08-08 13:01:00+0200\n" +"Project-Id-Version: gnome-libs 0.20\n" +"POT-Creation-Date: 1998-04-20 20:15:47-0500\n" +"PO-Revision-Date: 1998-08-08 13:01:00+0200\n" "From: Miguel de Icaza,computo,622-4680 \n" +"Last-Translator: Pablo Saratxaga \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=iso-8859-1\n" +"Content-Transfer-Encoding: 8bit\n" "Xgettext-Options: --default-domain=gnome-libs --directory=.. --add-comments --keyword=_ --keyword=N_ --files-from=./POTFILES.in\n" "Files: libgnomeui/gnome-about.c libgnomeui/gnome-file-entry.c libgnomeui/gnome-messagebox.c libgnomeui/gnome-init.c libgnomeui/gnome-client.c libgnomeui/gnome_segv.c libgnomeui/gnome-calculator.c support/argp-parse.c support/argp-help.c libgnomeui/gnome-scores.c libgnomeui/gnome-stock.c gnome-hello/gnome-hello-2-i18n.c gnome-hello/gnome-hello-3-parse-args.c gnome-hello/gnome-hello-4-SM.c\n" -#: gnome-hello/gnome-hello-2-i18n.c:31 gnome-hello/gnome-hello-3-parse-args.c:33 gnome-hello/gnome-hello.c:40 +#: gnome-hello/gnome-hello-2-i18n.c:31 gnome-hello/gnome-hello-3-parse-args.c:33 msgid "File/Exit" msgstr "Archivo/Salir" -#: gnome-hello/gnome-hello-2-i18n.c:31 gnome-hello/gnome-hello-3-parse-args.c:33 gnome-hello/gnome-hello.c:40 +#: gnome-hello/gnome-hello-2-i18n.c:31 gnome-hello/gnome-hello-3-parse-args.c:33 msgid "E" msgstr "E" #. The '...' end indicate that the options open a dialog -#: gnome-hello/gnome-hello-2-i18n.c:33 gnome-hello/gnome-hello-3-parse-args.c:35 gnome-hello/gnome-hello.c:42 +#: gnome-hello/gnome-hello-2-i18n.c:33 gnome-hello/gnome-hello-3-parse-args.c:35 msgid "Help/About..." msgstr "Ayuda/Acerca..." -#: gnome-hello/gnome-hello-2-i18n.c:33 gnome-hello/gnome-hello-3-parse-args.c:35 gnome-hello/gnome-hello.c:42 +#: gnome-hello/gnome-hello-2-i18n.c:33 gnome-hello/gnome-hello-3-parse-args.c:35 msgid "A" msgstr "A" @@ -32,53 +38,50 @@ #. We make a button, bind the 'clicked' signal to hello and setting it #. to be the content of the main window -#: gnome-hello/gnome-hello-2-i18n.c:83 gnome-hello/gnome-hello-3-parse-args.c:113 gnome-hello/gnome-hello-4-SM.c:213 gnome-hello/gnome-hello.c:103 +#: gnome-hello/gnome-hello-2-i18n.c:83 gnome-hello/gnome-hello-3-parse-args.c:113 gnome-hello/gnome-hello-4-SM.c:213 msgid "Hello GNOME" msgstr "Hola GNOME" -#: gnome-hello/gnome-hello-2-i18n.c:102 gnome-hello/gnome-hello-3-parse-args.c:132 gnome-hello/gnome-hello-4-SM.c:232 gnome-hello/gnome-hello.c:122 +#: gnome-hello/gnome-hello-2-i18n.c:102 gnome-hello/gnome-hello-3-parse-args.c:132 gnome-hello/gnome-hello-4-SM.c:232 msgid "Hello GNOME\n" msgstr "Hola GNOME\n" -#: gnome-hello/gnome-hello-2-i18n.c:125 gnome-hello/gnome-hello-3-parse-args.c:155 gnome-hello/gnome-hello-4-SM.c:255 gnome-hello/gnome-hello.c:145 +#: gnome-hello/gnome-hello-2-i18n.c:125 gnome-hello/gnome-hello-3-parse-args.c:155 gnome-hello/gnome-hello-4-SM.c:255 msgid "The Hello World Gnomified" msgstr "Hola Mundo Gnomificado" #. another comments -#: gnome-hello/gnome-hello-2-i18n.c:130 gnome-hello/gnome-hello-3-parse-args.c:160 gnome-hello/gnome-hello-4-SM.c:260 gnome-hello/gnome-hello.c:150 +#: gnome-hello/gnome-hello-2-i18n.c:130 gnome-hello/gnome-hello-3-parse-args.c:160 gnome-hello/gnome-hello-4-SM.c:260 msgid "GNOME is a civilized software system so we've a \"hello world\" program" -msgstr "" +msgstr "GNOME es un sistema de programas civilizado, as\355 que tenemos un programa \"hola mundo\"" #: gnome-hello/gnome-hello-3-parse-args.c:43 msgid "Run silently" -msgstr "Corre silenciosamente" +msgstr "Correr silenciosamente" -# , fuzzy #: gnome-hello/gnome-hello-4-SM.c:54 gnome-hello/gnome-hello-7-mdi.c:356 msgid "Exit" -msgstr "Archivo/Salir" +msgstr "Salir" #: gnome-hello/gnome-hello-4-SM.c:54 msgid "Exit GNOME hello" -msgstr "" +msgstr "Salir de Hola GNOME" -# , fuzzy #: gnome-hello/gnome-hello-4-SM.c:66 gnome-hello/gnome-hello-7-mdi.c:398 msgid "About..." -msgstr "Acerca" +msgstr "Acerca..." #: gnome-hello/gnome-hello-4-SM.c:66 msgid "Info about GNOME hello" -msgstr "" +msgstr "Informaci\363n acerca de Hola GNOME" -# , fuzzy #. and document menu and document list paths (see gnome-app-helper menu #. insertion routines for details) #: gnome-hello/gnome-hello-4-SM.c:78 gnome-hello/gnome-hello-7-mdi.c:362 gnome-hello/gnome-hello-7-mdi.c:437 libgnomeui/stock_demo.c:212 msgid "File" -msgstr "Archivo/Salir" +msgstr "Archivo" -#: gnome-hello/gnome-hello-4-SM.c:79 gnome-hello/gnome-hello-7-mdi.c:404 libgnomeui/gnome-stock.c:474 libgnomeui/gnome-stock.c:475 libgnomeui/gnome-stock.c:476 libgnomeui/stock_demo.c:342 +#: gnome-hello/gnome-hello-4-SM.c:79 gnome-hello/gnome-hello-7-mdi.c:404 libgnomeui/gnome-stock.c:720 libgnomeui/stock_demo.c:342 msgid "Help" msgstr "Ayuda" @@ -88,7 +91,7 @@ #: gnome-hello/gnome-hello-4-SM.c:91 msgid "Discard session" -msgstr "Descarta sesi\363n" +msgstr "Descartar sesi\363n" #: gnome-hello/gnome-hello-7-mdi.c:180 msgid "Add View" @@ -130,130 +133,109 @@ msgid "Children/" msgstr "" -# , c-format -#: gnome-hello/gnome-hello.c:208 -msgid "" -"%s: A gnomified 'Hello World' program\n" -"\n" -"Usage: %s [--help] [--version]\n" -"\n" -"Options:\n" -" --help display this help and exit\n" -" --version output version information and exit\n" -msgstr "" - -# , c-format -#: gnome-hello/gnome-hello.c:217 -msgid "Gnome Hello %s.\n" -msgstr "" - -#: gnome-hello/gnome-hello.c:231 -msgid "Options error\n" -msgstr "" - #: libgnome/gnome-parse.c:44 msgid "" "\n" "Generic options" msgstr "" +"\n" +"Opciones gen\351ricas" -#: libgnomeui/gnome-about.c:193 +#: libgnomeui/gnome-about.c:201 msgid "Author:" -msgstr "Author:" +msgstr "Autor:" -#: libgnomeui/gnome-about.c:195 libgnomeui/gnome-about.c:197 +#: libgnomeui/gnome-about.c:203 libgnomeui/gnome-about.c:205 msgid "Authors:" msgstr "Autores:" -#: libgnomeui/gnome-about.c:357 +#: libgnomeui/gnome-about.c:365 msgid "Authors: " msgstr "Autores: " -#: libgnomeui/gnome-about.c:567 libgnomeui/stock_demo.c:331 +#: libgnomeui/gnome-about.c:575 libgnomeui/stock_demo.c:331 msgid "About" msgstr "Acerca" #: libgnomeui/gnome-app-util.c:86 msgid " (press return)" -msgstr "" +msgstr " (presione return)" #: libgnomeui/gnome-app-util.c:114 msgid "ERROR: " -msgstr "" +msgstr "ERROR: " -# , fuzzy #: libgnomeui/gnome-app-util.c:136 msgid "Warning: " -msgstr "Cuidado" +msgstr "Cuidado: " #: libgnomeui/gnome-app-util.c:242 msgid "y" -msgstr "" +msgstr "s" -# , fuzzy #: libgnomeui/gnome-app-util.c:243 msgid "yes" -msgstr "Si" +msgstr "s\355" #: libgnomeui/gnome-app-util.c:246 msgid "n" -msgstr "" +msgstr "n" #: libgnomeui/gnome-app-util.c:247 msgid "no" -msgstr "" +msgstr "no" #: libgnomeui/gnome-app-util.c:286 msgid " (yes or no)" -msgstr "" +msgstr " (s\355 o no)" #: libgnomeui/gnome-app-util.c:287 msgid " - OK? (yes or no)" -msgstr "" +msgstr " - \277OK? (s\355 o no)" #: libgnomeui/gnome-app-util.c:520 msgid "Progress" -msgstr "" +msgstr "Progresi\363n" #: libgnomeui/gnome-app.c:355 libgnomeui/gnome-app.c:380 msgid "Top" -msgstr "" +msgstr "Arriba" #: libgnomeui/gnome-app.c:356 libgnomeui/gnome-app.c:381 msgid "Bottom" -msgstr "" +msgstr "Abajo" #: libgnomeui/gnome-app.c:382 msgid "Left" -msgstr "" +msgstr "Izquierda" #: libgnomeui/gnome-app.c:383 msgid "Right" -msgstr "" +msgstr "Derecha" #: libgnomeui/gnome-app.c:384 msgid "Configure toolbar" -msgstr "" +msgstr "Configurar barra de \355conos" #: libgnomeui/gnome-calculator.c:908 libgnomeui/gnome-calculator.c:1068 msgid "DEG" -msgstr "" +msgstr "DEG" #: libgnomeui/gnome-calculator.c:910 msgid "RAD" -msgstr "" +msgstr "RAD" #: libgnomeui/gnome-calculator.c:912 msgid "GRAD" -msgstr "" +msgstr "GRAD" #: libgnomeui/gnome-calculator.c:1058 msgid "1/x" -msgstr "" +msgstr "1/x" #: libgnomeui/gnome-calculator.c:1059 msgid "x^2" -msgstr "" +msgstr "x\262" #: libgnomeui/gnome-calculator.c:1060 msgid "SQRT" @@ -265,7 +247,7 @@ #: libgnomeui/gnome-calculator.c:1062 msgid "AC" -msgstr "" +msgstr "AC" #: libgnomeui/gnome-calculator.c:1065 msgid "sin" @@ -273,135 +255,135 @@ #: libgnomeui/gnome-calculator.c:1066 msgid "cos" -msgstr "" +msgstr "cos" #: libgnomeui/gnome-calculator.c:1067 msgid "tan" -msgstr "" +msgstr "tan" #: libgnomeui/gnome-calculator.c:1070 msgid "e" -msgstr "" +msgstr "e" #: libgnomeui/gnome-calculator.c:1071 msgid "EE" -msgstr "" +msgstr "EE" #: libgnomeui/gnome-calculator.c:1072 msgid "log" -msgstr "" +msgstr "log" #: libgnomeui/gnome-calculator.c:1073 msgid "ln" -msgstr "" +msgstr "ln" #: libgnomeui/gnome-calculator.c:1074 msgid "x^y" -msgstr "" +msgstr "x^y" #: libgnomeui/gnome-calculator.c:1076 msgid "PI" -msgstr "" +msgstr "PI" #: libgnomeui/gnome-calculator.c:1077 msgid "x!" -msgstr "" +msgstr "x!" #: libgnomeui/gnome-calculator.c:1078 msgid "(" -msgstr "" +msgstr "(" #: libgnomeui/gnome-calculator.c:1079 msgid ")" -msgstr "" +msgstr ")" #: libgnomeui/gnome-calculator.c:1080 msgid "/" -msgstr "" +msgstr "/" #: libgnomeui/gnome-calculator.c:1082 msgid "STO" -msgstr "" +msgstr "STO" #: libgnomeui/gnome-calculator.c:1083 msgid "7" -msgstr "" +msgstr "7" #: libgnomeui/gnome-calculator.c:1084 msgid "8" -msgstr "" +msgstr "8" #: libgnomeui/gnome-calculator.c:1085 msgid "9" -msgstr "" +msgstr "9" #: libgnomeui/gnome-calculator.c:1086 msgid "*" -msgstr "" +msgstr "*" #: libgnomeui/gnome-calculator.c:1088 msgid "RCL" -msgstr "" +msgstr "RCL" #: libgnomeui/gnome-calculator.c:1089 msgid "4" -msgstr "" +msgstr "4" #: libgnomeui/gnome-calculator.c:1090 msgid "5" -msgstr "" +msgstr "5" #: libgnomeui/gnome-calculator.c:1091 msgid "6" -msgstr "" +msgstr "6" #: libgnomeui/gnome-calculator.c:1092 msgid "-" -msgstr "" +msgstr "-" #: libgnomeui/gnome-calculator.c:1094 msgid "SUM" -msgstr "" +msgstr "SUM" #: libgnomeui/gnome-calculator.c:1095 msgid "1" -msgstr "" +msgstr "1" #: libgnomeui/gnome-calculator.c:1096 msgid "2" -msgstr "" +msgstr "2" #: libgnomeui/gnome-calculator.c:1097 msgid "3" -msgstr "" +msgstr "3" #: libgnomeui/gnome-calculator.c:1098 msgid "+" -msgstr "" +msgstr "+" #: libgnomeui/gnome-calculator.c:1100 msgid "EXC" -msgstr "" +msgstr "EXC" #: libgnomeui/gnome-calculator.c:1101 msgid "0" -msgstr "" +msgstr "0" #: libgnomeui/gnome-calculator.c:1102 msgid "." -msgstr "" +msgstr "." #: libgnomeui/gnome-calculator.c:1103 msgid "+/-" -msgstr "" +msgstr "+/-" #: libgnomeui/gnome-calculator.c:1104 msgid "=" -msgstr "" +msgstr "=" #: libgnomeui/gnome-calculator.c:1194 msgid "INV" -msgstr "" +msgstr "INV" #: libgnomeui/gnome-client.c:172 msgid "Specify session management id" @@ -409,58 +391,59 @@ #: libgnomeui/gnome-client.c:174 msgid "Specify id of cloned client" -msgstr "" +msgstr "Especificar id del cliente clonado" #: libgnomeui/gnome-client.c:176 msgid "Disable connection to session manager" -msgstr "" +msgstr "Desactivar connexi\363n al gestor de sesiones" -# , fuzzy #: libgnomeui/gnome-dateedit.c:393 msgid "Calendar" -msgstr "Borrar" +msgstr "Calendario" #: libgnomeui/gnome-dentry-edit.c:164 msgid "Name:" -msgstr "" +msgstr "Nombre:" #: libgnomeui/gnome-dentry-edit.c:177 msgid "Comment:" -msgstr "" +msgstr "Comentario:" #: libgnomeui/gnome-dentry-edit.c:187 msgid "Command:" -msgstr "" +msgstr "Comando:" #: libgnomeui/gnome-dentry-edit.c:197 msgid "Type:" -msgstr "" +msgstr "Tipo:" #: libgnomeui/gnome-dentry-edit.c:231 msgid "Run in Terminal" -msgstr "" +msgstr "Lanzar desde un Terminal" #: libgnomeui/gnome-dentry-edit.c:245 msgid "Try this before using:" -msgstr "" +msgstr "Probar esto antes de usar:" #: libgnomeui/gnome-dentry-edit.c:255 msgid "Documentation:" -msgstr "" +msgstr "Documentaci\363n:" #: libgnomeui/gnome-dentry-edit.c:305 msgid "Easy" -msgstr "" +msgstr "F\341cil" #: libgnomeui/gnome-dentry-edit.c:309 msgid "Advanced" -msgstr "" +msgstr "Avanzado" #: libgnomeui/gnome-dentry-edit.c:542 msgid "" "No\n" "icon" msgstr "" +"Sin\n" +"\355cono" #: libgnomeui/gnome-dentry-edit.c:557 msgid "" @@ -468,10 +451,13 @@ "load\n" "icon" msgstr "" +"No pude\n" +"cargar\n" +"el \355cono" #: libgnomeui/gnome-dentry-edit.c:603 msgid "Choose an icon" -msgstr "" +msgstr "Elegir un \355cono" #: libgnomeui/gnome-file-entry.c:90 msgid "Select file" @@ -483,13 +469,15 @@ #: libgnomeui/gnome-icon-sel.c:245 msgid "Loading Icons..." -msgstr "" +msgstr "Cargando \355conos..." #: libgnomeui/gnome-init.c:48 msgid "" "\n" "Gtk toolkit options" msgstr "" +"\n" +"Opciones del toolkit Gtk" #: libgnomeui/gnome-init.c:51 msgid "DISPLAY" @@ -549,11 +537,11 @@ #: libgnomeui/gnome-number-entry.c:124 msgid "Calculator" -msgstr "" +msgstr "Calculadora" #: libgnomeui/gnome-number-entry.c:171 msgid "Calculator..." -msgstr "" +msgstr "Calculadora..." #: libgnomeui/gnome-scores.c:72 msgid "Top Ten" @@ -571,43 +559,51 @@ msgid "Date" msgstr "Fecha" -#: libgnomeui/gnome-stock.c:468 +#: libgnomeui/gnome-stock.c:714 msgid "OK" msgstr "Aceptar" -#: libgnomeui/gnome-stock.c:469 +#: libgnomeui/gnome-stock.c:715 msgid "Apply" msgstr "Aplicar" -#: libgnomeui/gnome-stock.c:470 +#: libgnomeui/gnome-stock.c:716 msgid "Cancel" msgstr "Cancelar" -#: libgnomeui/gnome-stock.c:471 libgnomeui/stock_demo.c:163 +#: libgnomeui/gnome-stock.c:717 libgnomeui/stock_demo.c:163 msgid "Close" msgstr "Cerrar" -#: libgnomeui/gnome-stock.c:472 +#: libgnomeui/gnome-stock.c:718 msgid "Yes" msgstr "Si" -#: libgnomeui/gnome-stock.c:473 +#: libgnomeui/gnome-stock.c:719 msgid "No" msgstr "No" -#: libgnomeui/gnome-stock.c:1394 +#: libgnomeui/gnome-stock.c:721 +msgid "Next" +msgstr "Pr\363ximo" + +#: libgnomeui/gnome-stock.c:722 +msgid "Prev" +msgstr "Anterior" + +#: libgnomeui/gnome-stock.c:1646 msgid "Menu Accelerator Keys" msgstr "Aceleradores del men\372" -#: libgnomeui/gnome-stock.c:1396 +#: libgnomeui/gnome-stock.c:1648 msgid "Global" msgstr "Global" -#: libgnomeui/gnome-stock.c:1398 +#: libgnomeui/gnome-stock.c:1650 msgid "Menu Item" msgstr "Entrada del men\372" -#: libgnomeui/gnome-stock.c:1399 +#: libgnomeui/gnome-stock.c:1651 msgid "Accelerator" msgstr "Acelerador" @@ -619,7 +615,6 @@ "No, e ignorar\n" "fallas futuras" -# , c-format #: libgnomeui/gnome_segv.c:68 msgid "" "Application \"%s\" has a bug.\n" @@ -636,73 +631,172 @@ #: libgnomeui/stock_demo.c:119 msgid "New..." -msgstr "" +msgstr "Nuevo..." #: libgnomeui/stock_demo.c:130 msgid "Open..." -msgstr "" +msgstr "Abrir..." #: libgnomeui/stock_demo.c:141 msgid "Save" -msgstr "" +msgstr "Guardar" #: libgnomeui/stock_demo.c:152 msgid "Save as..." -msgstr "" +msgstr "Guardar como..." #: libgnomeui/stock_demo.c:178 msgid "Print..." -msgstr "" +msgstr "Imprimir..." #: libgnomeui/stock_demo.c:189 msgid "Setup Page..." -msgstr "" +msgstr "C\363nfigurar P\341gina..." #: libgnomeui/stock_demo.c:198 msgid "Quit" -msgstr "" +msgstr "Salir" #: libgnomeui/stock_demo.c:219 msgid "Undo" -msgstr "" +msgstr "Anular" #: libgnomeui/stock_demo.c:230 msgid "Redo" -msgstr "" +msgstr "Recomenzar" #: libgnomeui/stock_demo.c:239 msgid "Delete" -msgstr "" +msgstr "Borrar" #: libgnomeui/stock_demo.c:244 msgid "Cut" -msgstr "" +msgstr "Cortar" #: libgnomeui/stock_demo.c:255 msgid "Copy" -msgstr "" +msgstr "Copiar" -# , fuzzy #: libgnomeui/stock_demo.c:266 msgid "Paste" -msgstr "Fecha" +msgstr "Pegar" #: libgnomeui/stock_demo.c:281 msgid "Properties..." -msgstr "" +msgstr "Propiedades..." #: libgnomeui/stock_demo.c:294 msgid "Preferences..." -msgstr "" +msgstr "Preferencias..." -# , fuzzy #: libgnomeui/stock_demo.c:312 msgid "Scores..." -msgstr "Puntuaci\363n" +msgstr "Puntuaci\363n..." #: libgnomeui/stock_demo.c:323 msgid "Edit" +msgstr "Editar" + +#: libvfs/extfs.c:268 +msgid "" +"Couldn't open %s archive\n" +"%s" msgstr "" +"No pude abrir el archivo %s\n" +"%s" + +#: libvfs/extfs.c:300 libvfs/extfs.c:320 +msgid "Inconsistent extfs archive" +msgstr "Archivo extfs inconsistente" + +#: libvfs/ftpfs.c:602 +msgid " Could not set source routing (%s)" +msgstr " No puedo iniciar ruteo fuente (%s)" + +#: libvfs/ftpfs.c:2783 libvfs/ftpfs.c:2798 +msgid "" +"~/.netrc file has not correct mode.\n" +"Remove password or correct mode." +msgstr "" +"el modo del archivo ~/.netrc no es correcto.\n" +"Borre la clave de acceso o corrija el modo." + +#: libvfs/mcfs.c:156 +msgid " MCFS " +msgstr " MCFS " + +#: libvfs/mcfs.c:156 +msgid " The server does not support this version " +msgstr " El servidor no soporta esta versi\363n " + +#: libvfs/mcfs.c:172 +msgid " Warning " +msgstr " Cuidado " + +#: libvfs/mcfs.c:173 +msgid "" +" The remote server is not running on a system port \n" +" you need a password to log in, but the information may \n" +" not be safe on the remote side. Continue? \n" +msgstr "" +" El servidor remoto no est\341 corriendo en un puerto del sistema \n" +" que necesite una clave de acceso, pero la informaci\363n puede \n" +" no ser segura en el lado remoto. \277 Desea continuar ? \n" + +#: libvfs/mcfs.c:176 +msgid " Yes " +msgstr " S\355 " + +#: libvfs/mcfs.c:176 +msgid " No " +msgstr " No " + +#: libvfs/mcfs.c:178 +msgid " The remote server is running on strange port. Giving up.\n" +msgstr " El servidor remoto est\341 corriendo en un puerto extra\361o. Abandonando.\n" + +#: libvfs/mcfs.c:190 +msgid " MCFS Password required " +msgstr " Clave de acceso MCFS requerida " + +#: libvfs/mcfs.c:204 +msgid " Invalid password " +msgstr " Clave de acceso inv\341lida " + +#: libvfs/mcfs.c:270 +msgid " Too many open connections " +msgstr " Demasiadas conexiones abiertas " + +#: libvfs/tar.c:586 +msgid "Unexpected EOF on archive file" +msgstr "Fin de archivo (EOF) inesperado" + +#: libvfs/tar.c:640 libvfs/tar.c:661 +msgid "Inconsistent tar archive" +msgstr "Archivo tar inconsistente" + +#: libvfs/tar.c:761 +msgid "" +"Couldn't open tar archive\n" +"%s" +msgstr "" +"No pude abrir el archivo tar\n" +"%s" + +#. Error on first record +#: libvfs/tar.c:780 +msgid "" +"Hmm,...\n" +"%s\n" +"doesn't look like a tar archive." +msgstr "" +"Mmmh,...\n" +"%s\n" +"no parece ser un archivo tar." + +#: libvfs/vfs.c:1538 +msgid "Password:" +msgstr "Clave de acceso:" #: support/argp-parse.c:90 msgid "Give this help list" @@ -728,86 +822,74 @@ msgid "(PROGRAM ERROR) No version known!?" msgstr "Error del programa (no se conoce la versi\363n)" -# , c-format #: support/argp-parse.c:641 msgid "%s: Too many arguments\n" msgstr "%s: Demasiados argumentos\n" #: support/argp-parse.c:780 msgid "(PROGRAM ERROR) Option should have been recognized!?" -msgstr "" +msgstr "(ERROR DEL PROGRAMA) \277\241La opci\363n deber\341 haber sido reconocida?!" #: support/error.c:109 msgid "Unknown system error" -msgstr "" +msgstr "Error sistema desconocido" -# , c-format #: support/getopt.c:669 msgid "%s: option `%s' is ambiguous\n" -msgstr "" +msgstr "%s: la opci\363n `%s' es ambigua\n" -# , c-format #. --option #: support/getopt.c:693 msgid "%s: option `--%s' doesn't allow an argument\n" -msgstr "" +msgstr "%s: la opci\363n `--%s' no accepta un argumento\n" -# , c-format #: support/getopt.c:698 msgid "%s: option `%c%s' doesn't allow an argument\n" -msgstr "" +msgstr "%s: la opci\363n `%c%s' no accepta un argumento\n" -# , fuzzy, c-format #: support/getopt.c:715 support/getopt.c:888 msgid "%s: option `%s' requires an argument\n" -msgstr "%s: Demasiados argumentos\n" +msgstr "%s: la opci\363n `%s' requiere un argumento\n" -# , c-format #. --option #: support/getopt.c:744 msgid "%s: unrecognized option `--%s'\n" -msgstr "" +msgstr "%s: opci\363n `--%s' desconocida\n" -# , c-format #: support/getopt.c:748 msgid "%s: unrecognized option `%c%s'\n" -msgstr "" +msgstr "%s: opci\363n `%c%s' desconocida\n" -# , c-format #. 1003.2 specifies the format of this message. #: support/getopt.c:774 msgid "%s: illegal option -- %c\n" -msgstr "" +msgstr "%s: opci\363n ilegal -- %c\n" -# , c-format #: support/getopt.c:777 msgid "%s: invalid option -- %c\n" -msgstr "" +msgstr "%s: opci\363n, inv\341lida -- %c\n" -# , fuzzy, c-format #. 1003.2 specifies the format of this message. #: support/getopt.c:807 support/getopt.c:937 msgid "%s: option requires an argument -- %c\n" -msgstr "%s: Demasiados argumentos\n" +msgstr "%s: la opci\363n requiere un argumento -- %c\n" -# , c-format #: support/getopt.c:854 msgid "%s: option `-W %s' is ambiguous\n" -msgstr "" +msgstr "%s: la opci\363n `-W %s' es ambigua\n" -# , c-format #: support/getopt.c:872 msgid "%s: option `-W %s' doesn't allow an argument\n" -msgstr "" +msgstr "%s: la opci\363n `-W %s' no accepta un argumento\n" #: test-gnome/testgnome.c:551 msgid "The user chose Yes/OK with data:\n" -msgstr "" +msgstr "El usuario eligi\363 S\355/OK con los datos:\n" #: test-gnome/testgnome.c:555 msgid "The user chose No/Cancel with data:\n" -msgstr "" +msgstr "El usuario eligi\363 No/Anular con los datos:\n" #: test-gnome/testgnome.c:566 msgid "Weird number in reply callback" -msgstr "" +msgstr "N\372mero raro en la respuesta" Binary files gnome-libs-0.26/po/fi.gmo and gnome-libs-0.27/po/fi.gmo differ diff -uNr gnome-libs-0.26/po/fi.po gnome-libs-0.27/po/fi.po --- gnome-libs-0.26/po/fi.po Wed Aug 5 19:58:50 1998 +++ gnome-libs-0.27/po/fi.po Thu Aug 13 19:56:26 1998 @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 1998-08-01 16:36-0500\n" +"POT-Creation-Date: 1998-08-06 13:45-0500\n" "PO-Revision-Date: 1998-04-23 14:20+0300\n" "Last-Translator: Ville Hautam\344ki \n" "Language-Team: Finnish \n" @@ -14,20 +14,20 @@ "Content-Type: text/plain; charset=iso-8859-1\n" "Content-Transfer-Encoding: 8bit\n" -#: gnome-hello/gnome-hello-2-i18n.c:31 gnome-hello/gnome-hello-3-parse-args.c:33 gnome-hello/gnome-hello.c:40 +#: gnome-hello/gnome-hello-2-i18n.c:31 gnome-hello/gnome-hello-3-parse-args.c:33 msgid "File/Exit" msgstr "Tiedosto/Poistu" -#: gnome-hello/gnome-hello-2-i18n.c:31 gnome-hello/gnome-hello-3-parse-args.c:33 gnome-hello/gnome-hello.c:40 +#: gnome-hello/gnome-hello-2-i18n.c:31 gnome-hello/gnome-hello-3-parse-args.c:33 msgid "E" msgstr "E" #. The '...' end indicate that the options open a dialog -#: gnome-hello/gnome-hello-2-i18n.c:33 gnome-hello/gnome-hello-3-parse-args.c:35 gnome-hello/gnome-hello.c:42 +#: gnome-hello/gnome-hello-2-i18n.c:33 gnome-hello/gnome-hello-3-parse-args.c:35 msgid "Help/About..." msgstr "Apua/Versiotiedot" -#: gnome-hello/gnome-hello-2-i18n.c:33 gnome-hello/gnome-hello-3-parse-args.c:35 gnome-hello/gnome-hello.c:42 +#: gnome-hello/gnome-hello-2-i18n.c:33 gnome-hello/gnome-hello-3-parse-args.c:35 msgid "A" msgstr "A" @@ -39,20 +39,20 @@ #. We make a button, bind the 'clicked' signal to hello and setting it #. to be the content of the main window -#: gnome-hello/gnome-hello-2-i18n.c:83 gnome-hello/gnome-hello-3-parse-args.c:113 gnome-hello/gnome-hello-4-SM.c:213 gnome-hello/gnome-hello.c:103 +#: gnome-hello/gnome-hello-2-i18n.c:83 gnome-hello/gnome-hello-3-parse-args.c:113 gnome-hello/gnome-hello-4-SM.c:213 msgid "Hello GNOME" msgstr "Moro GNOME" -#: gnome-hello/gnome-hello-2-i18n.c:102 gnome-hello/gnome-hello-3-parse-args.c:132 gnome-hello/gnome-hello-4-SM.c:232 gnome-hello/gnome-hello.c:122 +#: gnome-hello/gnome-hello-2-i18n.c:102 gnome-hello/gnome-hello-3-parse-args.c:132 gnome-hello/gnome-hello-4-SM.c:232 msgid "Hello GNOME\n" msgstr "Moro GNOME\n" -#: gnome-hello/gnome-hello-2-i18n.c:125 gnome-hello/gnome-hello-3-parse-args.c:155 gnome-hello/gnome-hello-4-SM.c:255 gnome-hello/gnome-hello.c:145 +#: gnome-hello/gnome-hello-2-i18n.c:125 gnome-hello/gnome-hello-3-parse-args.c:155 gnome-hello/gnome-hello-4-SM.c:255 msgid "The Hello World Gnomified" msgstr "Moro Maailma Gnomena" #. another comments -#: gnome-hello/gnome-hello-2-i18n.c:130 gnome-hello/gnome-hello-3-parse-args.c:160 gnome-hello/gnome-hello-4-SM.c:260 gnome-hello/gnome-hello.c:150 +#: gnome-hello/gnome-hello-2-i18n.c:130 gnome-hello/gnome-hello-3-parse-args.c:160 gnome-hello/gnome-hello-4-SM.c:260 msgid "GNOME is a civilized software system so we've a \"hello world\" program" msgstr "GNOME on sivistynyt ohjelma, jonka vuoksi meill\344 on \"hello world\" ohjelma" @@ -85,7 +85,7 @@ msgid "File" msgstr "Tiedosto/Poistu" -#: gnome-hello/gnome-hello-4-SM.c:79 gnome-hello/gnome-hello-7-mdi.c:404 libgnomeui/gnome-stock.c:474 libgnomeui/gnome-stock.c:475 libgnomeui/gnome-stock.c:476 libgnomeui/stock_demo.c:342 +#: gnome-hello/gnome-hello-4-SM.c:79 gnome-hello/gnome-hello-7-mdi.c:404 libgnomeui/gnome-stock.c:720 libgnomeui/stock_demo.c:342 msgid "Help" msgstr "Apua" @@ -137,46 +137,25 @@ msgid "Children/" msgstr "" -# , c-format -#: gnome-hello/gnome-hello.c:208 -msgid "" -"%s: A gnomified 'Hello World' program\n" -"\n" -"Usage: %s [--help] [--version]\n" -"\n" -"Options:\n" -" --help display this help and exit\n" -" --version output version information and exit\n" -msgstr "" - -# , c-format -#: gnome-hello/gnome-hello.c:217 -msgid "Gnome Hello %s.\n" -msgstr "" - -#: gnome-hello/gnome-hello.c:231 -msgid "Options error\n" -msgstr "" - #: libgnome/gnome-parse.c:44 msgid "" "\n" "Generic options" msgstr "" -#: libgnomeui/gnome-about.c:193 +#: libgnomeui/gnome-about.c:201 msgid "Author:" msgstr "Tekij\344:" -#: libgnomeui/gnome-about.c:195 libgnomeui/gnome-about.c:197 +#: libgnomeui/gnome-about.c:203 libgnomeui/gnome-about.c:205 msgid "Authors:" msgstr "Tekij\344t:" -#: libgnomeui/gnome-about.c:357 +#: libgnomeui/gnome-about.c:365 msgid "Authors: " msgstr "Tekij\344t: " -#: libgnomeui/gnome-about.c:567 libgnomeui/stock_demo.c:331 +#: libgnomeui/gnome-about.c:575 libgnomeui/stock_demo.c:331 msgid "About" msgstr "Versiotiedot" @@ -579,43 +558,51 @@ msgid "Date" msgstr "P\344iv\344m\344\344r\344" -#: libgnomeui/gnome-stock.c:468 +#: libgnomeui/gnome-stock.c:714 msgid "OK" msgstr "OK" -#: libgnomeui/gnome-stock.c:469 +#: libgnomeui/gnome-stock.c:715 msgid "Apply" msgstr "Toteuta" -#: libgnomeui/gnome-stock.c:470 +#: libgnomeui/gnome-stock.c:716 msgid "Cancel" msgstr "Palauta" -#: libgnomeui/gnome-stock.c:471 libgnomeui/stock_demo.c:163 +#: libgnomeui/gnome-stock.c:717 libgnomeui/stock_demo.c:163 msgid "Close" msgstr "Sulje" -#: libgnomeui/gnome-stock.c:472 +#: libgnomeui/gnome-stock.c:718 msgid "Yes" msgstr "Kyll\344" -#: libgnomeui/gnome-stock.c:473 +#: libgnomeui/gnome-stock.c:719 msgid "No" msgstr "Ei" -#: libgnomeui/gnome-stock.c:1394 +#: libgnomeui/gnome-stock.c:721 +msgid "Next" +msgstr "" + +#: libgnomeui/gnome-stock.c:722 +msgid "Prev" +msgstr "" + +#: libgnomeui/gnome-stock.c:1646 msgid "Menu Accelerator Keys" msgstr "Menun pikavalinta n\344pp\344imet" -#: libgnomeui/gnome-stock.c:1396 +#: libgnomeui/gnome-stock.c:1648 msgid "Global" msgstr "Koko koneen" -#: libgnomeui/gnome-stock.c:1398 +#: libgnomeui/gnome-stock.c:1650 msgid "Menu Item" msgstr "Menun kohta" -#: libgnomeui/gnome-stock.c:1399 +#: libgnomeui/gnome-stock.c:1651 msgid "Accelerator" msgstr "Pikavalinta" @@ -628,6 +615,7 @@ "tulevat SIGSEGV:t" # , c-format +# , c-format #: libgnomeui/gnome_segv.c:68 msgid "" "Application \"%s\" has a bug.\n" @@ -712,6 +700,103 @@ msgid "Edit" msgstr "" +# , c-format +#: libvfs/extfs.c:268 +msgid "" +"Couldn't open %s archive\n" +"%s" +msgstr "" + +#: libvfs/extfs.c:300 libvfs/extfs.c:320 +msgid "Inconsistent extfs archive" +msgstr "" + +# , c-format +#: libvfs/ftpfs.c:602 +msgid " Could not set source routing (%s)" +msgstr "" + +#: libvfs/ftpfs.c:2783 libvfs/ftpfs.c:2798 +msgid "" +"~/.netrc file has not correct mode.\n" +"Remove password or correct mode." +msgstr "" + +#: libvfs/mcfs.c:156 +msgid " MCFS " +msgstr "" + +#: libvfs/mcfs.c:156 +msgid " The server does not support this version " +msgstr "" + +# , fuzzy +# , fuzzy +#: libvfs/mcfs.c:172 +msgid " Warning " +msgstr "Varoitus" + +#: libvfs/mcfs.c:173 +msgid "" +" The remote server is not running on a system port \n" +" you need a password to log in, but the information may \n" +" not be safe on the remote side. Continue? \n" +msgstr "" + +# , fuzzy +#: libvfs/mcfs.c:176 +msgid " Yes " +msgstr "Kyll\344" + +# , fuzzy +#: libvfs/mcfs.c:176 +msgid " No " +msgstr "Ei" + +#: libvfs/mcfs.c:178 +msgid " The remote server is running on strange port. Giving up.\n" +msgstr "" + +#: libvfs/mcfs.c:190 +msgid " MCFS Password required " +msgstr "" + +#: libvfs/mcfs.c:204 +msgid " Invalid password " +msgstr "" + +#: libvfs/mcfs.c:270 +msgid " Too many open connections " +msgstr "" + +#: libvfs/tar.c:586 +msgid "Unexpected EOF on archive file" +msgstr "" + +#: libvfs/tar.c:640 libvfs/tar.c:661 +msgid "Inconsistent tar archive" +msgstr "" + +# , c-format +#: libvfs/tar.c:761 +msgid "" +"Couldn't open tar archive\n" +"%s" +msgstr "" + +# , c-format +#. Error on first record +#: libvfs/tar.c:780 +msgid "" +"Hmm,...\n" +"%s\n" +"doesn't look like a tar archive." +msgstr "" + +#: libvfs/vfs.c:1538 +msgid "Password:" +msgstr "" + #: support/argp-parse.c:90 msgid "Give this help list" msgstr "N\344yt\344 t\344m\344 apu viesti" @@ -737,6 +822,7 @@ msgstr "Ohjelman virhe (ei tunnettua versiota!?)" # , c-format +# , c-format #: support/argp-parse.c:641 msgid "%s: Too many arguments\n" msgstr "%s: Liian monta parametri\344\n" @@ -750,59 +836,70 @@ msgstr "" # , c-format +# , c-format #: support/getopt.c:669 msgid "%s: option `%s' is ambiguous\n" msgstr "" # , c-format +# , c-format #. --option #: support/getopt.c:693 msgid "%s: option `--%s' doesn't allow an argument\n" msgstr "" # , c-format +# , c-format #: support/getopt.c:698 msgid "%s: option `%c%s' doesn't allow an argument\n" msgstr "" # , fuzzy, c-format +# , c-format #: support/getopt.c:715 support/getopt.c:888 msgid "%s: option `%s' requires an argument\n" msgstr "%s: Liian monta parametri\344\n" # , c-format +# , c-format #. --option #: support/getopt.c:744 msgid "%s: unrecognized option `--%s'\n" msgstr "" # , c-format +# , c-format #: support/getopt.c:748 msgid "%s: unrecognized option `%c%s'\n" msgstr "" # , c-format +# , c-format #. 1003.2 specifies the format of this message. #: support/getopt.c:774 msgid "%s: illegal option -- %c\n" msgstr "" # , c-format +# , c-format #: support/getopt.c:777 msgid "%s: invalid option -- %c\n" msgstr "" # , fuzzy, c-format +# , c-format #. 1003.2 specifies the format of this message. #: support/getopt.c:807 support/getopt.c:937 msgid "%s: option requires an argument -- %c\n" msgstr "%s: Liian monta parametri\344\n" # , c-format +# , c-format #: support/getopt.c:854 msgid "%s: option `-W %s' is ambiguous\n" msgstr "" +# , c-format # , c-format #: support/getopt.c:872 msgid "%s: option `-W %s' doesn't allow an argument\n" Binary files gnome-libs-0.26/po/fr.gmo and gnome-libs-0.27/po/fr.gmo differ diff -uNr gnome-libs-0.26/po/fr.po gnome-libs-0.27/po/fr.po --- gnome-libs-0.26/po/fr.po Wed Aug 5 19:58:49 1998 +++ gnome-libs-0.27/po/fr.po Thu Aug 13 19:56:25 1998 @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: gnome-libs VERSION\n" -"POT-Creation-Date: 1998-08-01 16:36-0500\n" +"POT-Creation-Date: 1998-08-06 13:45-0500\n" "Last-Translator: Vincent Renardias \n" "Language-Team: Vincent Renardias \n" "MIME-Version: 1.0\n" @@ -14,20 +14,20 @@ "Content-Transfer-Encoding: 8bit\n" "POT-Revision-Date: 1998-03-28 20:08+0100\n" -#: gnome-hello/gnome-hello-2-i18n.c:31 gnome-hello/gnome-hello-3-parse-args.c:33 gnome-hello/gnome-hello.c:40 +#: gnome-hello/gnome-hello-2-i18n.c:31 gnome-hello/gnome-hello-3-parse-args.c:33 msgid "File/Exit" msgstr "Fichier/Quitter" -#: gnome-hello/gnome-hello-2-i18n.c:31 gnome-hello/gnome-hello-3-parse-args.c:33 gnome-hello/gnome-hello.c:40 +#: gnome-hello/gnome-hello-2-i18n.c:31 gnome-hello/gnome-hello-3-parse-args.c:33 msgid "E" msgstr "E" #. The '...' end indicate that the options open a dialog -#: gnome-hello/gnome-hello-2-i18n.c:33 gnome-hello/gnome-hello-3-parse-args.c:35 gnome-hello/gnome-hello.c:42 +#: gnome-hello/gnome-hello-2-i18n.c:33 gnome-hello/gnome-hello-3-parse-args.c:35 msgid "Help/About..." msgstr "Aide/A Propos..." -#: gnome-hello/gnome-hello-2-i18n.c:33 gnome-hello/gnome-hello-3-parse-args.c:35 gnome-hello/gnome-hello.c:42 +#: gnome-hello/gnome-hello-2-i18n.c:33 gnome-hello/gnome-hello-3-parse-args.c:35 msgid "A" msgstr "A" @@ -39,20 +39,20 @@ #. We make a button, bind the 'clicked' signal to hello and setting it #. to be the content of the main window -#: gnome-hello/gnome-hello-2-i18n.c:83 gnome-hello/gnome-hello-3-parse-args.c:113 gnome-hello/gnome-hello-4-SM.c:213 gnome-hello/gnome-hello.c:103 +#: gnome-hello/gnome-hello-2-i18n.c:83 gnome-hello/gnome-hello-3-parse-args.c:113 gnome-hello/gnome-hello-4-SM.c:213 msgid "Hello GNOME" msgstr "Hello GNOME" -#: gnome-hello/gnome-hello-2-i18n.c:102 gnome-hello/gnome-hello-3-parse-args.c:132 gnome-hello/gnome-hello-4-SM.c:232 gnome-hello/gnome-hello.c:122 +#: gnome-hello/gnome-hello-2-i18n.c:102 gnome-hello/gnome-hello-3-parse-args.c:132 gnome-hello/gnome-hello-4-SM.c:232 msgid "Hello GNOME\n" msgstr "Hello GNOME\n" -#: gnome-hello/gnome-hello-2-i18n.c:125 gnome-hello/gnome-hello-3-parse-args.c:155 gnome-hello/gnome-hello-4-SM.c:255 gnome-hello/gnome-hello.c:145 +#: gnome-hello/gnome-hello-2-i18n.c:125 gnome-hello/gnome-hello-3-parse-args.c:155 gnome-hello/gnome-hello-4-SM.c:255 msgid "The Hello World Gnomified" msgstr "Hello World Gnomifi\351" #. another comments -#: gnome-hello/gnome-hello-2-i18n.c:130 gnome-hello/gnome-hello-3-parse-args.c:160 gnome-hello/gnome-hello-4-SM.c:260 gnome-hello/gnome-hello.c:150 +#: gnome-hello/gnome-hello-2-i18n.c:130 gnome-hello/gnome-hello-3-parse-args.c:160 gnome-hello/gnome-hello-4-SM.c:260 msgid "GNOME is a civilized software system so we've a \"hello world\" program" msgstr "GNOME est un locigiel civilis\351 qui comporte un programme \"hello world\"" @@ -82,7 +82,7 @@ msgid "File" msgstr "Fichier" -#: gnome-hello/gnome-hello-4-SM.c:79 gnome-hello/gnome-hello-7-mdi.c:404 libgnomeui/gnome-stock.c:474 libgnomeui/gnome-stock.c:475 libgnomeui/gnome-stock.c:476 libgnomeui/stock_demo.c:342 +#: gnome-hello/gnome-hello-4-SM.c:79 gnome-hello/gnome-hello-7-mdi.c:404 libgnomeui/gnome-stock.c:720 libgnomeui/stock_demo.c:342 msgid "Help" msgstr "Aide" @@ -134,27 +134,6 @@ msgid "Children/" msgstr "" -# , c-format -#: gnome-hello/gnome-hello.c:208 -msgid "" -"%s: A gnomified 'Hello World' program\n" -"\n" -"Usage: %s [--help] [--version]\n" -"\n" -"Options:\n" -" --help display this help and exit\n" -" --version output version information and exit\n" -msgstr "" - -# , c-format -#: gnome-hello/gnome-hello.c:217 -msgid "Gnome Hello %s.\n" -msgstr "" - -#: gnome-hello/gnome-hello.c:231 -msgid "Options error\n" -msgstr "" - #: libgnome/gnome-parse.c:44 msgid "" "\n" @@ -163,19 +142,19 @@ "\n" "Options G\351n\351riques" -#: libgnomeui/gnome-about.c:193 +#: libgnomeui/gnome-about.c:201 msgid "Author:" msgstr "Auteur:" -#: libgnomeui/gnome-about.c:195 libgnomeui/gnome-about.c:197 +#: libgnomeui/gnome-about.c:203 libgnomeui/gnome-about.c:205 msgid "Authors:" msgstr "Auteurs:" -#: libgnomeui/gnome-about.c:357 +#: libgnomeui/gnome-about.c:365 msgid "Authors: " msgstr "Auteurs: " -#: libgnomeui/gnome-about.c:567 libgnomeui/stock_demo.c:331 +#: libgnomeui/gnome-about.c:575 libgnomeui/stock_demo.c:331 msgid "About" msgstr "A Propos" @@ -581,43 +560,51 @@ msgid "Date" msgstr "Date" -#: libgnomeui/gnome-stock.c:468 +#: libgnomeui/gnome-stock.c:714 msgid "OK" msgstr "OK" -#: libgnomeui/gnome-stock.c:469 +#: libgnomeui/gnome-stock.c:715 msgid "Apply" msgstr "Appliquer" -#: libgnomeui/gnome-stock.c:470 +#: libgnomeui/gnome-stock.c:716 msgid "Cancel" msgstr "Annuler" -#: libgnomeui/gnome-stock.c:471 libgnomeui/stock_demo.c:163 +#: libgnomeui/gnome-stock.c:717 libgnomeui/stock_demo.c:163 msgid "Close" msgstr "Fermer" -#: libgnomeui/gnome-stock.c:472 +#: libgnomeui/gnome-stock.c:718 msgid "Yes" msgstr "Oui" -#: libgnomeui/gnome-stock.c:473 +#: libgnomeui/gnome-stock.c:719 msgid "No" msgstr "Non" -#: libgnomeui/gnome-stock.c:1394 +#: libgnomeui/gnome-stock.c:721 +msgid "Next" +msgstr "" + +#: libgnomeui/gnome-stock.c:722 +msgid "Prev" +msgstr "" + +#: libgnomeui/gnome-stock.c:1646 msgid "Menu Accelerator Keys" msgstr "Touches Acc\351l\351ratrices du Menu" -#: libgnomeui/gnome-stock.c:1396 +#: libgnomeui/gnome-stock.c:1648 msgid "Global" msgstr "Global" -#: libgnomeui/gnome-stock.c:1398 +#: libgnomeui/gnome-stock.c:1650 msgid "Menu Item" msgstr "El\351ment de Menu" -#: libgnomeui/gnome-stock.c:1399 +#: libgnomeui/gnome-stock.c:1651 msgid "Accelerator" msgstr "Acc\351l\351rateur" @@ -630,6 +617,7 @@ "les signaux SIGSEGV ult\351rieurs" # , c-format +# , c-format #: libgnomeui/gnome_segv.c:68 msgid "" "Application \"%s\" has a bug.\n" @@ -712,6 +700,102 @@ msgid "Edit" msgstr "Quitter" +# , c-format +#: libvfs/extfs.c:268 +msgid "" +"Couldn't open %s archive\n" +"%s" +msgstr "" + +#: libvfs/extfs.c:300 libvfs/extfs.c:320 +msgid "Inconsistent extfs archive" +msgstr "" + +# , c-format +#: libvfs/ftpfs.c:602 +msgid " Could not set source routing (%s)" +msgstr "" + +#: libvfs/ftpfs.c:2783 libvfs/ftpfs.c:2798 +msgid "" +"~/.netrc file has not correct mode.\n" +"Remove password or correct mode." +msgstr "" + +#: libvfs/mcfs.c:156 +msgid " MCFS " +msgstr "" + +#: libvfs/mcfs.c:156 +msgid " The server does not support this version " +msgstr "" + +# , fuzzy +#: libvfs/mcfs.c:172 +msgid " Warning " +msgstr "Avertissement: " + +#: libvfs/mcfs.c:173 +msgid "" +" The remote server is not running on a system port \n" +" you need a password to log in, but the information may \n" +" not be safe on the remote side. Continue? \n" +msgstr "" + +# , fuzzy +#: libvfs/mcfs.c:176 +msgid " Yes " +msgstr "Oui" + +# , fuzzy +#: libvfs/mcfs.c:176 +msgid " No " +msgstr "Non" + +#: libvfs/mcfs.c:178 +msgid " The remote server is running on strange port. Giving up.\n" +msgstr "" + +#: libvfs/mcfs.c:190 +msgid " MCFS Password required " +msgstr "" + +#: libvfs/mcfs.c:204 +msgid " Invalid password " +msgstr "" + +#: libvfs/mcfs.c:270 +msgid " Too many open connections " +msgstr "" + +#: libvfs/tar.c:586 +msgid "Unexpected EOF on archive file" +msgstr "" + +#: libvfs/tar.c:640 libvfs/tar.c:661 +msgid "Inconsistent tar archive" +msgstr "" + +# , c-format +#: libvfs/tar.c:761 +msgid "" +"Couldn't open tar archive\n" +"%s" +msgstr "" + +# , c-format +#. Error on first record +#: libvfs/tar.c:780 +msgid "" +"Hmm,...\n" +"%s\n" +"doesn't look like a tar archive." +msgstr "" + +#: libvfs/vfs.c:1538 +msgid "Password:" +msgstr "" + #: support/argp-parse.c:90 msgid "Give this help list" msgstr "Affiche ce message d'aide" @@ -737,6 +821,7 @@ msgstr "(ERREUR PROGRAMME) Version Inconnue!?" # , c-format +# , c-format #: support/argp-parse.c:641 msgid "%s: Too many arguments\n" msgstr "%s: Trop d'arguments\n" @@ -750,59 +835,70 @@ msgstr "Erreur syst\350me inconnue" # , c-format +# , c-format #: support/getopt.c:669 msgid "%s: option `%s' is ambiguous\n" msgstr "" # , c-format +# , c-format #. --option #: support/getopt.c:693 msgid "%s: option `--%s' doesn't allow an argument\n" msgstr "" # , c-format +# , c-format #: support/getopt.c:698 msgid "%s: option `%c%s' doesn't allow an argument\n" msgstr "" # , fuzzy, c-format +# , c-format #: support/getopt.c:715 support/getopt.c:888 msgid "%s: option `%s' requires an argument\n" msgstr "%s: Trop d'arguments\n" # , c-format +# , c-format #. --option #: support/getopt.c:744 msgid "%s: unrecognized option `--%s'\n" msgstr "" # , c-format +# , c-format #: support/getopt.c:748 msgid "%s: unrecognized option `%c%s'\n" msgstr "" # , c-format +# , c-format #. 1003.2 specifies the format of this message. #: support/getopt.c:774 msgid "%s: illegal option -- %c\n" msgstr "" # , c-format +# , c-format #: support/getopt.c:777 msgid "%s: invalid option -- %c\n" msgstr "" # , fuzzy, c-format +# , c-format #. 1003.2 specifies the format of this message. #: support/getopt.c:807 support/getopt.c:937 msgid "%s: option requires an argument -- %c\n" msgstr "%s: Trop d'arguments\n" # , c-format +# , c-format #: support/getopt.c:854 msgid "%s: option `-W %s' is ambiguous\n" msgstr "" +# , c-format # , c-format #: support/getopt.c:872 msgid "%s: option `-W %s' doesn't allow an argument\n" Binary files gnome-libs-0.26/po/ga.gmo and gnome-libs-0.27/po/ga.gmo differ diff -uNr gnome-libs-0.26/po/ga.po gnome-libs-0.27/po/ga.po --- gnome-libs-0.26/po/ga.po Wed Aug 5 19:58:51 1998 +++ gnome-libs-0.27/po/ga.po Thu Aug 13 19:56:26 1998 @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: gnome-libs VERSION\n" -"POT-Creation-Date: 1998-08-01 16:36-0500\n" +"POT-Creation-Date: 1998-08-06 13:45-0500\n" "PO-Revision-Date: 1998-05-07 18:00+0000\n" "Last-Translator: Alastair McKinstry \n" "Language-Team: Irish \n" @@ -14,20 +14,20 @@ "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: ENCODING\n" -#: gnome-hello/gnome-hello-2-i18n.c:31 gnome-hello/gnome-hello-3-parse-args.c:33 gnome-hello/gnome-hello.c:40 +#: gnome-hello/gnome-hello-2-i18n.c:31 gnome-hello/gnome-hello-3-parse-args.c:33 msgid "File/Exit" msgstr "Comhad/Ealu as" -#: gnome-hello/gnome-hello-2-i18n.c:31 gnome-hello/gnome-hello-3-parse-args.c:33 gnome-hello/gnome-hello.c:40 +#: gnome-hello/gnome-hello-2-i18n.c:31 gnome-hello/gnome-hello-3-parse-args.c:33 msgid "E" msgstr "E" #. The '...' end indicate that the options open a dialog -#: gnome-hello/gnome-hello-2-i18n.c:33 gnome-hello/gnome-hello-3-parse-args.c:35 gnome-hello/gnome-hello.c:42 +#: gnome-hello/gnome-hello-2-i18n.c:33 gnome-hello/gnome-hello-3-parse-args.c:35 msgid "Help/About..." msgstr "Cznamh/Faoi..." -#: gnome-hello/gnome-hello-2-i18n.c:33 gnome-hello/gnome-hello-3-parse-args.c:35 gnome-hello/gnome-hello.c:42 +#: gnome-hello/gnome-hello-2-i18n.c:33 gnome-hello/gnome-hello-3-parse-args.c:35 msgid "A" msgstr "A" @@ -39,20 +39,20 @@ #. We make a button, bind the 'clicked' signal to hello and setting it #. to be the content of the main window -#: gnome-hello/gnome-hello-2-i18n.c:83 gnome-hello/gnome-hello-3-parse-args.c:113 gnome-hello/gnome-hello-4-SM.c:213 gnome-hello/gnome-hello.c:103 +#: gnome-hello/gnome-hello-2-i18n.c:83 gnome-hello/gnome-hello-3-parse-args.c:113 gnome-hello/gnome-hello-4-SM.c:213 msgid "Hello GNOME" msgstr "Dia dhuit GNOME" -#: gnome-hello/gnome-hello-2-i18n.c:102 gnome-hello/gnome-hello-3-parse-args.c:132 gnome-hello/gnome-hello-4-SM.c:232 gnome-hello/gnome-hello.c:122 +#: gnome-hello/gnome-hello-2-i18n.c:102 gnome-hello/gnome-hello-3-parse-args.c:132 gnome-hello/gnome-hello-4-SM.c:232 msgid "Hello GNOME\n" msgstr "Dia dhuit GNOME\n" -#: gnome-hello/gnome-hello-2-i18n.c:125 gnome-hello/gnome-hello-3-parse-args.c:155 gnome-hello/gnome-hello-4-SM.c:255 gnome-hello/gnome-hello.c:145 +#: gnome-hello/gnome-hello-2-i18n.c:125 gnome-hello/gnome-hello-3-parse-args.c:155 gnome-hello/gnome-hello-4-SM.c:255 msgid "The Hello World Gnomified" msgstr "An 'Dia dhaoibh a dhomhain' gnomaithe" #. another comments -#: gnome-hello/gnome-hello-2-i18n.c:130 gnome-hello/gnome-hello-3-parse-args.c:160 gnome-hello/gnome-hello-4-SM.c:260 gnome-hello/gnome-hello.c:150 +#: gnome-hello/gnome-hello-2-i18n.c:130 gnome-hello/gnome-hello-3-parse-args.c:160 gnome-hello/gnome-hello-4-SM.c:260 msgid "GNOME is a civilized software system so we've a \"hello world\" program" msgstr "Is uirlis sibhialta e GNOME agus mar sin, ta riomhchlar \"Dia dhaoibh a dhomhain\" againn." @@ -85,7 +85,7 @@ msgid "File" msgstr "Comhad/Ealu as" -#: gnome-hello/gnome-hello-4-SM.c:79 gnome-hello/gnome-hello-7-mdi.c:404 libgnomeui/gnome-stock.c:474 libgnomeui/gnome-stock.c:475 libgnomeui/gnome-stock.c:476 libgnomeui/stock_demo.c:342 +#: gnome-hello/gnome-hello-4-SM.c:79 gnome-hello/gnome-hello-7-mdi.c:404 libgnomeui/gnome-stock.c:720 libgnomeui/stock_demo.c:342 msgid "Help" msgstr "" @@ -137,46 +137,25 @@ msgid "Children/" msgstr "" -# , c-format -#: gnome-hello/gnome-hello.c:208 -msgid "" -"%s: A gnomified 'Hello World' program\n" -"\n" -"Usage: %s [--help] [--version]\n" -"\n" -"Options:\n" -" --help display this help and exit\n" -" --version output version information and exit\n" -msgstr "" - -# , c-format -#: gnome-hello/gnome-hello.c:217 -msgid "Gnome Hello %s.\n" -msgstr "" - -#: gnome-hello/gnome-hello.c:231 -msgid "Options error\n" -msgstr "" - #: libgnome/gnome-parse.c:44 msgid "" "\n" "Generic options" msgstr "" -#: libgnomeui/gnome-about.c:193 +#: libgnomeui/gnome-about.c:201 msgid "Author:" msgstr "Zdar:" -#: libgnomeui/gnome-about.c:195 libgnomeui/gnome-about.c:197 +#: libgnomeui/gnome-about.c:203 libgnomeui/gnome-about.c:205 msgid "Authors:" msgstr "Zdair:" -#: libgnomeui/gnome-about.c:357 +#: libgnomeui/gnome-about.c:365 msgid "Authors: " msgstr "Zdair: " -#: libgnomeui/gnome-about.c:567 libgnomeui/stock_demo.c:331 +#: libgnomeui/gnome-about.c:575 libgnomeui/stock_demo.c:331 msgid "About" msgstr "Faoi" @@ -577,43 +556,51 @@ msgid "Date" msgstr "Data" -#: libgnomeui/gnome-stock.c:468 +#: libgnomeui/gnome-stock.c:714 msgid "OK" msgstr "" -#: libgnomeui/gnome-stock.c:469 +#: libgnomeui/gnome-stock.c:715 msgid "Apply" msgstr "" -#: libgnomeui/gnome-stock.c:470 +#: libgnomeui/gnome-stock.c:716 msgid "Cancel" msgstr "" -#: libgnomeui/gnome-stock.c:471 libgnomeui/stock_demo.c:163 +#: libgnomeui/gnome-stock.c:717 libgnomeui/stock_demo.c:163 msgid "Close" msgstr "" -#: libgnomeui/gnome-stock.c:472 +#: libgnomeui/gnome-stock.c:718 msgid "Yes" msgstr "" -#: libgnomeui/gnome-stock.c:473 +#: libgnomeui/gnome-stock.c:719 msgid "No" msgstr "" -#: libgnomeui/gnome-stock.c:1394 +#: libgnomeui/gnome-stock.c:721 +msgid "Next" +msgstr "" + +#: libgnomeui/gnome-stock.c:722 +msgid "Prev" +msgstr "" + +#: libgnomeui/gnome-stock.c:1646 msgid "Menu Accelerator Keys" msgstr "" -#: libgnomeui/gnome-stock.c:1396 +#: libgnomeui/gnome-stock.c:1648 msgid "Global" msgstr "" -#: libgnomeui/gnome-stock.c:1398 +#: libgnomeui/gnome-stock.c:1650 msgid "Menu Item" msgstr "" -#: libgnomeui/gnome-stock.c:1399 +#: libgnomeui/gnome-stock.c:1651 msgid "Accelerator" msgstr "" @@ -624,6 +611,7 @@ msgstr "" # , c-format +# , c-format #: libgnomeui/gnome_segv.c:68 msgid "" "Application \"%s\" has a bug.\n" @@ -703,6 +691,101 @@ msgid "Edit" msgstr "" +# , c-format +#: libvfs/extfs.c:268 +msgid "" +"Couldn't open %s archive\n" +"%s" +msgstr "" + +#: libvfs/extfs.c:300 libvfs/extfs.c:320 +msgid "Inconsistent extfs archive" +msgstr "" + +# , c-format +#: libvfs/ftpfs.c:602 +msgid " Could not set source routing (%s)" +msgstr "" + +#: libvfs/ftpfs.c:2783 libvfs/ftpfs.c:2798 +msgid "" +"~/.netrc file has not correct mode.\n" +"Remove password or correct mode." +msgstr "" + +#: libvfs/mcfs.c:156 +msgid " MCFS " +msgstr "" + +#: libvfs/mcfs.c:156 +msgid " The server does not support this version " +msgstr "" + +# , fuzzy +# , fuzzy +#: libvfs/mcfs.c:172 +msgid " Warning " +msgstr "Cogar" + +#: libvfs/mcfs.c:173 +msgid "" +" The remote server is not running on a system port \n" +" you need a password to log in, but the information may \n" +" not be safe on the remote side. Continue? \n" +msgstr "" + +#: libvfs/mcfs.c:176 +msgid " Yes " +msgstr "" + +#: libvfs/mcfs.c:176 +msgid " No " +msgstr "" + +#: libvfs/mcfs.c:178 +msgid " The remote server is running on strange port. Giving up.\n" +msgstr "" + +#: libvfs/mcfs.c:190 +msgid " MCFS Password required " +msgstr "" + +#: libvfs/mcfs.c:204 +msgid " Invalid password " +msgstr "" + +#: libvfs/mcfs.c:270 +msgid " Too many open connections " +msgstr "" + +#: libvfs/tar.c:586 +msgid "Unexpected EOF on archive file" +msgstr "" + +#: libvfs/tar.c:640 libvfs/tar.c:661 +msgid "Inconsistent tar archive" +msgstr "" + +# , c-format +#: libvfs/tar.c:761 +msgid "" +"Couldn't open tar archive\n" +"%s" +msgstr "" + +# , c-format +#. Error on first record +#: libvfs/tar.c:780 +msgid "" +"Hmm,...\n" +"%s\n" +"doesn't look like a tar archive." +msgstr "" + +#: libvfs/vfs.c:1538 +msgid "Password:" +msgstr "" + #: support/argp-parse.c:90 msgid "Give this help list" msgstr "" @@ -728,6 +811,7 @@ msgstr "" # , c-format +# , c-format #: support/argp-parse.c:641 msgid "%s: Too many arguments\n" msgstr "" @@ -741,59 +825,70 @@ msgstr "" # , c-format +# , c-format #: support/getopt.c:669 msgid "%s: option `%s' is ambiguous\n" msgstr "" # , c-format +# , c-format #. --option #: support/getopt.c:693 msgid "%s: option `--%s' doesn't allow an argument\n" msgstr "" # , c-format +# , c-format #: support/getopt.c:698 msgid "%s: option `%c%s' doesn't allow an argument\n" msgstr "" # , c-format +# , c-format #: support/getopt.c:715 support/getopt.c:888 msgid "%s: option `%s' requires an argument\n" msgstr "" # , c-format +# , c-format #. --option #: support/getopt.c:744 msgid "%s: unrecognized option `--%s'\n" msgstr "" # , c-format +# , c-format #: support/getopt.c:748 msgid "%s: unrecognized option `%c%s'\n" msgstr "" # , c-format +# , c-format #. 1003.2 specifies the format of this message. #: support/getopt.c:774 msgid "%s: illegal option -- %c\n" msgstr "" # , c-format +# , c-format #: support/getopt.c:777 msgid "%s: invalid option -- %c\n" msgstr "" # , c-format +# , c-format #. 1003.2 specifies the format of this message. #: support/getopt.c:807 support/getopt.c:937 msgid "%s: option requires an argument -- %c\n" msgstr "" # , c-format +# , c-format #: support/getopt.c:854 msgid "%s: option `-W %s' is ambiguous\n" msgstr "" +# , c-format # , c-format #: support/getopt.c:872 msgid "%s: option `-W %s' doesn't allow an argument\n" diff -uNr gnome-libs-0.26/po/gnome-libs.pot gnome-libs-0.27/po/gnome-libs.pot --- gnome-libs-0.26/po/gnome-libs.pot Thu Aug 6 13:02:20 1998 +++ gnome-libs-0.27/po/gnome-libs.pot Thu Aug 13 17:28:12 1998 @@ -1,11 +1,11 @@ msgid "" msgstr "" -"Date: 1998-08-06 13:02:18-0400\n" +"Date: 1998-08-13 17:28:11-0400\n" "From: \n" "Content-Type: text/plain; charset=\n" "Xgettext-Options: --default-domain=gnome-libs --directory=.. --add-comments --keyword=_ --keyword=N_ --files-from=./POTFILES.in\n" -"Files: gnome-hello/gnome-hello-2-i18n.c gnome-hello/gnome-hello-3-parse-args.c gnome-hello/gnome-hello-4-SM.c gnome-hello/gnome-hello-7-mdi.c gtk-xmhtml/StringUtil.c gtk-xmhtml/XmHTML-motif.c gtk-xmhtml/XmHTML.c gtk-xmhtml/XmHTMLI.h gtk-xmhtml/callbacks.c gtk-xmhtml/colors.c gtk-xmhtml/fonts.c gtk-xmhtml/format.c gtk-xmhtml/frames.c gtk-xmhtml/gtk-forms.c gtk-xmhtml/gtk-xmhtml.c gtk-xmhtml/images.c gtk-xmhtml/layout.c gtk-xmhtml/map.c gtk-xmhtml/miniparse.h gtk-xmhtml/paint.c gtk-xmhtml/parse.c gtk-xmhtml/plc.c gtk-xmhtml/readFLG.c gtk-xmhtml/readGIF.c gtk-xmhtml/readGIFplc.c gtk-xmhtml/readJPEGplc.c gtk-xmhtml/readPNG.c gtk-xmhtml/readXPM.c libgnome/gnome-i18n.h libgnome/gnome-i18nP.h libgnome/gnome-parse.c libgnomeui/gnome-about.c libgnomeui/gnome-about.h libgnomeui/gnome-app-helper.c libgnomeui/gnome-app-util.c libgnomeui/gnome-app.c libgnomeui/gnome-calculator.c libgnomeui/gnome-client.c libgnomeui/gnome-dateedit.c libgnomeui/gnome-dentry-edit.c libgnomeui/gnome-file-entry.c " -"libgnomeui/gnome-icon-sel.c libgnomeui/gnome-init.c libgnomeui/gnome-mdi.h libgnomeui/gnome-messagebox.c libgnomeui/gnome-number-entry.c libgnomeui/gnome-scores.c libgnomeui/gnome-scores.h libgnomeui/gnome-stock.c libgnomeui/gnome_segv.c libgnomeui/stock_demo.c support/argp-fmtstream.h support/argp-parse.c support/argp.h support/easy-vsnprintf.c support/error.c support/error.h support/getopt.c test-gnome/testgnome.c\n" +"Files: gnome-hello/gnome-hello-2-i18n.c gnome-hello/gnome-hello-3-parse-args.c gnome-hello/gnome-hello-4-SM.c gnome-hello/gnome-hello-7-mdi.c gtk-xmhtml/StringUtil.c gtk-xmhtml/XmHTML-motif.c gtk-xmhtml/XmHTML.c gtk-xmhtml/XmHTMLI.h gtk-xmhtml/callbacks.c gtk-xmhtml/colors.c gtk-xmhtml/fonts.c gtk-xmhtml/format.c gtk-xmhtml/frames.c gtk-xmhtml/gtk-forms.c gtk-xmhtml/gtk-xmhtml.c gtk-xmhtml/images.c gtk-xmhtml/layout.c gtk-xmhtml/map.c gtk-xmhtml/miniparse.h gtk-xmhtml/paint.c gtk-xmhtml/parse.c gtk-xmhtml/plc.c gtk-xmhtml/readFLG.c gtk-xmhtml/readGIF.c gtk-xmhtml/readGIFplc.c gtk-xmhtml/readJPEGplc.c gtk-xmhtml/readPNG.c gtk-xmhtml/readXPM.c libgnome/gnome-parse.c libgnomeui/gnome-about.c libgnomeui/gnome-about.h libgnomeui/gnome-app-helper.c libgnomeui/gnome-app-util.c libgnomeui/gnome-app.c libgnomeui/gnome-calculator.c libgnomeui/gnome-client.c libgnomeui/gnome-dateedit.c libgnomeui/gnome-dentry-edit.c libgnomeui/gnome-file-entry.c libgnomeui/gnome-icon-sel.c " +"libgnomeui/gnome-init.c libgnomeui/gnome-mdi.h libgnomeui/gnome-messagebox.c libgnomeui/gnome-number-entry.c libgnomeui/gnome-scores.c libgnomeui/gnome-scores.h libgnomeui/gnome-stock.c libgnomeui/gnome_segv.c libgnomeui/stock_demo.c libvfs/extfs.c libvfs/ftpfs.c libvfs/mcfs.c libvfs/tar.c libvfs/vfs.c support/argp-fmtstream.h support/argp-parse.c support/argp.h support/error.c support/error.h support/getopt.c test-gnome/testgnome.c\n" #: gnome-hello/gnome-hello-2-i18n.c:31 gnome-hello/gnome-hello-3-parse-args.c:33 msgid "File/Exit" @@ -75,7 +75,7 @@ msgid "File" msgstr "" -#: gnome-hello/gnome-hello-4-SM.c:79 gnome-hello/gnome-hello-7-mdi.c:404 libgnomeui/gnome-stock.c:474 libgnomeui/stock_demo.c:342 +#: gnome-hello/gnome-hello-4-SM.c:79 gnome-hello/gnome-hello-7-mdi.c:404 libgnomeui/gnome-stock.c:720 libgnomeui/stock_demo.c:342 msgid "Help" msgstr "" @@ -133,19 +133,19 @@ "Generic options" msgstr "" -#: libgnomeui/gnome-about.c:193 +#: libgnomeui/gnome-about.c:201 msgid "Author:" msgstr "" -#: libgnomeui/gnome-about.c:195 libgnomeui/gnome-about.c:197 +#: libgnomeui/gnome-about.c:203 libgnomeui/gnome-about.c:205 msgid "Authors:" msgstr "" -#: libgnomeui/gnome-about.c:357 +#: libgnomeui/gnome-about.c:365 msgid "Authors: " msgstr "" -#: libgnomeui/gnome-about.c:567 libgnomeui/stock_demo.c:331 +#: libgnomeui/gnome-about.c:575 libgnomeui/stock_demo.c:331 msgid "About" msgstr "" @@ -544,51 +544,51 @@ msgid "Date" msgstr "" -#: libgnomeui/gnome-stock.c:468 +#: libgnomeui/gnome-stock.c:714 msgid "OK" msgstr "" -#: libgnomeui/gnome-stock.c:469 +#: libgnomeui/gnome-stock.c:715 msgid "Apply" msgstr "" -#: libgnomeui/gnome-stock.c:470 +#: libgnomeui/gnome-stock.c:716 msgid "Cancel" msgstr "" -#: libgnomeui/gnome-stock.c:471 libgnomeui/stock_demo.c:163 +#: libgnomeui/gnome-stock.c:717 libgnomeui/stock_demo.c:163 msgid "Close" msgstr "" -#: libgnomeui/gnome-stock.c:472 +#: libgnomeui/gnome-stock.c:718 msgid "Yes" msgstr "" -#: libgnomeui/gnome-stock.c:473 +#: libgnomeui/gnome-stock.c:719 msgid "No" msgstr "" -#: libgnomeui/gnome-stock.c:475 +#: libgnomeui/gnome-stock.c:721 msgid "Next" msgstr "" -#: libgnomeui/gnome-stock.c:476 +#: libgnomeui/gnome-stock.c:722 msgid "Prev" msgstr "" -#: libgnomeui/gnome-stock.c:1394 +#: libgnomeui/gnome-stock.c:1646 msgid "Menu Accelerator Keys" msgstr "" -#: libgnomeui/gnome-stock.c:1396 +#: libgnomeui/gnome-stock.c:1648 msgid "Global" msgstr "" -#: libgnomeui/gnome-stock.c:1398 +#: libgnomeui/gnome-stock.c:1650 msgid "Menu Item" msgstr "" -#: libgnomeui/gnome-stock.c:1399 +#: libgnomeui/gnome-stock.c:1651 msgid "Accelerator" msgstr "" @@ -673,6 +673,95 @@ #: libgnomeui/stock_demo.c:323 msgid "Edit" +msgstr "" + +#: libvfs/extfs.c:268 +msgid "" +"Couldn't open %s archive\n" +"%s" +msgstr "" + +#: libvfs/extfs.c:300 libvfs/extfs.c:320 +msgid "Inconsistent extfs archive" +msgstr "" + +#: libvfs/ftpfs.c:602 +msgid " Could not set source routing (%s)" +msgstr "" + +#: libvfs/ftpfs.c:2783 libvfs/ftpfs.c:2798 +msgid "" +"~/.netrc file has not correct mode.\n" +"Remove password or correct mode." +msgstr "" + +#: libvfs/mcfs.c:156 +msgid " MCFS " +msgstr "" + +#: libvfs/mcfs.c:156 +msgid " The server does not support this version " +msgstr "" + +#: libvfs/mcfs.c:172 +msgid " Warning " +msgstr "" + +#: libvfs/mcfs.c:173 +msgid "" +" The remote server is not running on a system port \n" +" you need a password to log in, but the information may \n" +" not be safe on the remote side. Continue? \n" +msgstr "" + +#: libvfs/mcfs.c:176 +msgid " Yes " +msgstr "" + +#: libvfs/mcfs.c:176 +msgid " No " +msgstr "" + +#: libvfs/mcfs.c:178 +msgid " The remote server is running on strange port. Giving up.\n" +msgstr "" + +#: libvfs/mcfs.c:190 +msgid " MCFS Password required " +msgstr "" + +#: libvfs/mcfs.c:204 +msgid " Invalid password " +msgstr "" + +#: libvfs/mcfs.c:270 +msgid " Too many open connections " +msgstr "" + +#: libvfs/tar.c:586 +msgid "Unexpected EOF on archive file" +msgstr "" + +#: libvfs/tar.c:640 libvfs/tar.c:661 +msgid "Inconsistent tar archive" +msgstr "" + +#: libvfs/tar.c:761 +msgid "" +"Couldn't open tar archive\n" +"%s" +msgstr "" + +#. Error on first record +#: libvfs/tar.c:780 +msgid "" +"Hmm,...\n" +"%s\n" +"doesn't look like a tar archive." +msgstr "" + +#: libvfs/vfs.c:1538 +msgid "Password:" msgstr "" #: support/argp-parse.c:90 Binary files gnome-libs-0.26/po/it.gmo and gnome-libs-0.27/po/it.gmo differ diff -uNr gnome-libs-0.26/po/it.po gnome-libs-0.27/po/it.po --- gnome-libs-0.26/po/it.po Wed Aug 5 19:58:49 1998 +++ gnome-libs-0.27/po/it.po Thu Aug 13 19:56:25 1998 @@ -1,26 +1,26 @@ msgid "" msgstr "" -"POT-Creation-Date: 1998-08-01 16:36-0500\n" +"POT-Creation-Date: 1998-08-06 13:45-0500\n" "Content-Type: text/plain; charset=\n" "Date: 1998-02-20 14:44:56+0100\n" "From: Tristan Tarrant \n" "Xgettext-Options: --default-domain=gnome-libs --directory=.. --add-comments --keyword=_ --keyword=N_ --files-from=./POTFILES.in\n" "Files: libgnomeui/gnome-about.c libgnomeui/gnome-scores.c libgnomeui/gnome-messagebox.c gnome-hello/gnome-hello-2-i18n.c gnome-hello/gnome-hello-3-parse-args.c gnome-hello/gnome-hello-4-SM.c\n" -#: gnome-hello/gnome-hello-2-i18n.c:31 gnome-hello/gnome-hello-3-parse-args.c:33 gnome-hello/gnome-hello.c:40 +#: gnome-hello/gnome-hello-2-i18n.c:31 gnome-hello/gnome-hello-3-parse-args.c:33 msgid "File/Exit" msgstr "Archivio/Esci" -#: gnome-hello/gnome-hello-2-i18n.c:31 gnome-hello/gnome-hello-3-parse-args.c:33 gnome-hello/gnome-hello.c:40 +#: gnome-hello/gnome-hello-2-i18n.c:31 gnome-hello/gnome-hello-3-parse-args.c:33 msgid "E" msgstr "E" #. The '...' end indicate that the options open a dialog -#: gnome-hello/gnome-hello-2-i18n.c:33 gnome-hello/gnome-hello-3-parse-args.c:35 gnome-hello/gnome-hello.c:42 +#: gnome-hello/gnome-hello-2-i18n.c:33 gnome-hello/gnome-hello-3-parse-args.c:35 msgid "Help/About..." msgstr "Aiuto/Informazioni su..." -#: gnome-hello/gnome-hello-2-i18n.c:33 gnome-hello/gnome-hello-3-parse-args.c:35 gnome-hello/gnome-hello.c:42 +#: gnome-hello/gnome-hello-2-i18n.c:33 gnome-hello/gnome-hello-3-parse-args.c:35 msgid "A" msgstr "A" @@ -32,20 +32,20 @@ #. We make a button, bind the 'clicked' signal to hello and setting it #. to be the content of the main window -#: gnome-hello/gnome-hello-2-i18n.c:83 gnome-hello/gnome-hello-3-parse-args.c:113 gnome-hello/gnome-hello-4-SM.c:213 gnome-hello/gnome-hello.c:103 +#: gnome-hello/gnome-hello-2-i18n.c:83 gnome-hello/gnome-hello-3-parse-args.c:113 gnome-hello/gnome-hello-4-SM.c:213 msgid "Hello GNOME" msgstr "Ciao GNOME" -#: gnome-hello/gnome-hello-2-i18n.c:102 gnome-hello/gnome-hello-3-parse-args.c:132 gnome-hello/gnome-hello-4-SM.c:232 gnome-hello/gnome-hello.c:122 +#: gnome-hello/gnome-hello-2-i18n.c:102 gnome-hello/gnome-hello-3-parse-args.c:132 gnome-hello/gnome-hello-4-SM.c:232 msgid "Hello GNOME\n" msgstr "Ciao GNOME\n" -#: gnome-hello/gnome-hello-2-i18n.c:125 gnome-hello/gnome-hello-3-parse-args.c:155 gnome-hello/gnome-hello-4-SM.c:255 gnome-hello/gnome-hello.c:145 +#: gnome-hello/gnome-hello-2-i18n.c:125 gnome-hello/gnome-hello-3-parse-args.c:155 gnome-hello/gnome-hello-4-SM.c:255 msgid "The Hello World Gnomified" msgstr "Ciao Mondo Gnomificato" #. another comments -#: gnome-hello/gnome-hello-2-i18n.c:130 gnome-hello/gnome-hello-3-parse-args.c:160 gnome-hello/gnome-hello-4-SM.c:260 gnome-hello/gnome-hello.c:150 +#: gnome-hello/gnome-hello-2-i18n.c:130 gnome-hello/gnome-hello-3-parse-args.c:160 gnome-hello/gnome-hello-4-SM.c:260 msgid "GNOME is a civilized software system so we've a \"hello world\" program" msgstr "GNOME \350 un sistema software civilizzato e cos\354 abbiamo un programma \"ciao mondo\"" @@ -78,7 +78,7 @@ msgid "File" msgstr "Archivio/Esci" -#: gnome-hello/gnome-hello-4-SM.c:79 gnome-hello/gnome-hello-7-mdi.c:404 libgnomeui/gnome-stock.c:474 libgnomeui/gnome-stock.c:475 libgnomeui/gnome-stock.c:476 libgnomeui/stock_demo.c:342 +#: gnome-hello/gnome-hello-4-SM.c:79 gnome-hello/gnome-hello-7-mdi.c:404 libgnomeui/gnome-stock.c:720 libgnomeui/stock_demo.c:342 msgid "Help" msgstr "Aiuto" @@ -130,27 +130,6 @@ msgid "Children/" msgstr "" -# , c-format -#: gnome-hello/gnome-hello.c:208 -msgid "" -"%s: A gnomified 'Hello World' program\n" -"\n" -"Usage: %s [--help] [--version]\n" -"\n" -"Options:\n" -" --help display this help and exit\n" -" --version output version information and exit\n" -msgstr "" - -# , c-format -#: gnome-hello/gnome-hello.c:217 -msgid "Gnome Hello %s.\n" -msgstr "" - -#: gnome-hello/gnome-hello.c:231 -msgid "Options error\n" -msgstr "" - # , fuzzy #: libgnome/gnome-parse.c:44 msgid "" @@ -160,19 +139,19 @@ "\n" "Opzioni per Gtk" -#: libgnomeui/gnome-about.c:193 +#: libgnomeui/gnome-about.c:201 msgid "Author:" msgstr "Autore:" -#: libgnomeui/gnome-about.c:195 libgnomeui/gnome-about.c:197 +#: libgnomeui/gnome-about.c:203 libgnomeui/gnome-about.c:205 msgid "Authors:" msgstr "Autori:" -#: libgnomeui/gnome-about.c:357 +#: libgnomeui/gnome-about.c:365 msgid "Authors: " msgstr "Autori: " -#: libgnomeui/gnome-about.c:567 libgnomeui/stock_demo.c:331 +#: libgnomeui/gnome-about.c:575 libgnomeui/stock_demo.c:331 msgid "About" msgstr "Informazioni" @@ -578,43 +557,51 @@ msgid "Date" msgstr "Data" -#: libgnomeui/gnome-stock.c:468 +#: libgnomeui/gnome-stock.c:714 msgid "OK" msgstr "OK" -#: libgnomeui/gnome-stock.c:469 +#: libgnomeui/gnome-stock.c:715 msgid "Apply" msgstr "Applica" -#: libgnomeui/gnome-stock.c:470 +#: libgnomeui/gnome-stock.c:716 msgid "Cancel" msgstr "Annulla" -#: libgnomeui/gnome-stock.c:471 libgnomeui/stock_demo.c:163 +#: libgnomeui/gnome-stock.c:717 libgnomeui/stock_demo.c:163 msgid "Close" msgstr "Chiudi" -#: libgnomeui/gnome-stock.c:472 +#: libgnomeui/gnome-stock.c:718 msgid "Yes" msgstr "S\354" -#: libgnomeui/gnome-stock.c:473 +#: libgnomeui/gnome-stock.c:719 msgid "No" msgstr "No" -#: libgnomeui/gnome-stock.c:1394 +#: libgnomeui/gnome-stock.c:721 +msgid "Next" +msgstr "" + +#: libgnomeui/gnome-stock.c:722 +msgid "Prev" +msgstr "" + +#: libgnomeui/gnome-stock.c:1646 msgid "Menu Accelerator Keys" msgstr "Tasti di Scelta Rapida da Menu" -#: libgnomeui/gnome-stock.c:1396 +#: libgnomeui/gnome-stock.c:1648 msgid "Global" msgstr "Globale" -#: libgnomeui/gnome-stock.c:1398 +#: libgnomeui/gnome-stock.c:1650 msgid "Menu Item" msgstr "Elemento di Menu" -#: libgnomeui/gnome-stock.c:1399 +#: libgnomeui/gnome-stock.c:1651 msgid "Accelerator" msgstr "Tasti rapidi" @@ -627,6 +614,7 @@ "SIGSEGV futuri" # , c-format +# , c-format #: libgnomeui/gnome_segv.c:68 msgid "" "Application \"%s\" has a bug.\n" @@ -711,6 +699,103 @@ msgid "Edit" msgstr "" +# , c-format +#: libvfs/extfs.c:268 +msgid "" +"Couldn't open %s archive\n" +"%s" +msgstr "" + +#: libvfs/extfs.c:300 libvfs/extfs.c:320 +msgid "Inconsistent extfs archive" +msgstr "" + +# , c-format +#: libvfs/ftpfs.c:602 +msgid " Could not set source routing (%s)" +msgstr "" + +#: libvfs/ftpfs.c:2783 libvfs/ftpfs.c:2798 +msgid "" +"~/.netrc file has not correct mode.\n" +"Remove password or correct mode." +msgstr "" + +#: libvfs/mcfs.c:156 +msgid " MCFS " +msgstr "" + +#: libvfs/mcfs.c:156 +msgid " The server does not support this version " +msgstr "" + +# , fuzzy +# , fuzzy +#: libvfs/mcfs.c:172 +msgid " Warning " +msgstr "Avviso" + +#: libvfs/mcfs.c:173 +msgid "" +" The remote server is not running on a system port \n" +" you need a password to log in, but the information may \n" +" not be safe on the remote side. Continue? \n" +msgstr "" + +# , fuzzy +#: libvfs/mcfs.c:176 +msgid " Yes " +msgstr "S\354" + +# , fuzzy +#: libvfs/mcfs.c:176 +msgid " No " +msgstr "No" + +#: libvfs/mcfs.c:178 +msgid " The remote server is running on strange port. Giving up.\n" +msgstr "" + +#: libvfs/mcfs.c:190 +msgid " MCFS Password required " +msgstr "" + +#: libvfs/mcfs.c:204 +msgid " Invalid password " +msgstr "" + +#: libvfs/mcfs.c:270 +msgid " Too many open connections " +msgstr "" + +#: libvfs/tar.c:586 +msgid "Unexpected EOF on archive file" +msgstr "" + +#: libvfs/tar.c:640 libvfs/tar.c:661 +msgid "Inconsistent tar archive" +msgstr "" + +# , c-format +#: libvfs/tar.c:761 +msgid "" +"Couldn't open tar archive\n" +"%s" +msgstr "" + +# , c-format +#. Error on first record +#: libvfs/tar.c:780 +msgid "" +"Hmm,...\n" +"%s\n" +"doesn't look like a tar archive." +msgstr "" + +#: libvfs/vfs.c:1538 +msgid "Password:" +msgstr "" + #: support/argp-parse.c:90 msgid "Give this help list" msgstr "Mostra questa pagina d'aiuto" @@ -736,6 +821,7 @@ msgstr "(ERRORE PROGRAMMA) Versione sconosciuta!?" # , c-format +# , c-format #: support/argp-parse.c:641 msgid "%s: Too many arguments\n" msgstr "%s: Troppi parametri\n" @@ -749,59 +835,70 @@ msgstr "" # , c-format +# , c-format #: support/getopt.c:669 msgid "%s: option `%s' is ambiguous\n" msgstr "" # , c-format +# , c-format #. --option #: support/getopt.c:693 msgid "%s: option `--%s' doesn't allow an argument\n" msgstr "" # , c-format +# , c-format #: support/getopt.c:698 msgid "%s: option `%c%s' doesn't allow an argument\n" msgstr "" # , fuzzy, c-format +# , c-format #: support/getopt.c:715 support/getopt.c:888 msgid "%s: option `%s' requires an argument\n" msgstr "%s: Troppi parametri\n" # , c-format +# , c-format #. --option #: support/getopt.c:744 msgid "%s: unrecognized option `--%s'\n" msgstr "" # , c-format +# , c-format #: support/getopt.c:748 msgid "%s: unrecognized option `%c%s'\n" msgstr "" # , c-format +# , c-format #. 1003.2 specifies the format of this message. #: support/getopt.c:774 msgid "%s: illegal option -- %c\n" msgstr "" # , c-format +# , c-format #: support/getopt.c:777 msgid "%s: invalid option -- %c\n" msgstr "" # , fuzzy, c-format +# , c-format #. 1003.2 specifies the format of this message. #: support/getopt.c:807 support/getopt.c:937 msgid "%s: option requires an argument -- %c\n" msgstr "%s: Troppi parametri\n" # , c-format +# , c-format #: support/getopt.c:854 msgid "%s: option `-W %s' is ambiguous\n" msgstr "" +# , c-format # , c-format #: support/getopt.c:872 msgid "%s: option `-W %s' doesn't allow an argument\n" Binary files gnome-libs-0.26/po/ja.gmo and gnome-libs-0.27/po/ja.gmo differ diff -uNr gnome-libs-0.26/po/ja.po gnome-libs-0.27/po/ja.po --- gnome-libs-0.26/po/ja.po Wed Aug 5 19:58:51 1998 +++ gnome-libs-0.27/po/ja.po Thu Aug 13 19:56:26 1998 @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: gnome-libs VERSION\n" -"POT-Creation-Date: 1998-08-01 16:36-0500\n" +"POT-Creation-Date: 1998-08-06 13:45-0500\n" "PO-Revision-Date: 1998-02-20 19:52+0900\n" "Last-Translator: Yukihiro Nakai@abricot.co.jp>\n" "Language-Team: Yukihiro Nakai@abricot.co.jp>\n" @@ -14,20 +14,20 @@ "Content-Type: text/plain; charset=euc-japan\n" "Content-Transfer-Encoding: 8bit\n" -#: gnome-hello/gnome-hello-2-i18n.c:31 gnome-hello/gnome-hello-3-parse-args.c:33 gnome-hello/gnome-hello.c:40 +#: gnome-hello/gnome-hello-2-i18n.c:31 gnome-hello/gnome-hello-3-parse-args.c:33 msgid "File/Exit" msgstr "\245\325\245\241\245\244\245\353/\275\252\316\273" -#: gnome-hello/gnome-hello-2-i18n.c:31 gnome-hello/gnome-hello-3-parse-args.c:33 gnome-hello/gnome-hello.c:40 +#: gnome-hello/gnome-hello-2-i18n.c:31 gnome-hello/gnome-hello-3-parse-args.c:33 msgid "E" msgstr "" #. The '...' end indicate that the options open a dialog -#: gnome-hello/gnome-hello-2-i18n.c:33 gnome-hello/gnome-hello-3-parse-args.c:35 gnome-hello/gnome-hello.c:42 +#: gnome-hello/gnome-hello-2-i18n.c:33 gnome-hello/gnome-hello-3-parse-args.c:35 msgid "Help/About..." msgstr "\245\330\245\353\245\327/\276\360\312\363" -#: gnome-hello/gnome-hello-2-i18n.c:33 gnome-hello/gnome-hello-3-parse-args.c:35 gnome-hello/gnome-hello.c:42 +#: gnome-hello/gnome-hello-2-i18n.c:33 gnome-hello/gnome-hello-3-parse-args.c:35 msgid "A" msgstr "" @@ -39,20 +39,20 @@ #. We make a button, bind the 'clicked' signal to hello and setting it #. to be the content of the main window -#: gnome-hello/gnome-hello-2-i18n.c:83 gnome-hello/gnome-hello-3-parse-args.c:113 gnome-hello/gnome-hello-4-SM.c:213 gnome-hello/gnome-hello.c:103 +#: gnome-hello/gnome-hello-2-i18n.c:83 gnome-hello/gnome-hello-3-parse-args.c:113 gnome-hello/gnome-hello-4-SM.c:213 msgid "Hello GNOME" msgstr "\244\263\244\363\244\313\244\301\244\317 GNOME" -#: gnome-hello/gnome-hello-2-i18n.c:102 gnome-hello/gnome-hello-3-parse-args.c:132 gnome-hello/gnome-hello-4-SM.c:232 gnome-hello/gnome-hello.c:122 +#: gnome-hello/gnome-hello-2-i18n.c:102 gnome-hello/gnome-hello-3-parse-args.c:132 gnome-hello/gnome-hello-4-SM.c:232 msgid "Hello GNOME\n" msgstr "\244\263\244\363\244\313\244\301\244\317 GNOME\n" -#: gnome-hello/gnome-hello-2-i18n.c:125 gnome-hello/gnome-hello-3-parse-args.c:155 gnome-hello/gnome-hello-4-SM.c:255 gnome-hello/gnome-hello.c:145 +#: gnome-hello/gnome-hello-2-i18n.c:125 gnome-hello/gnome-hello-3-parse-args.c:155 gnome-hello/gnome-hello-4-SM.c:255 msgid "The Hello World Gnomified" msgstr "Gnome\310\307Hello World" #. another comments -#: gnome-hello/gnome-hello-2-i18n.c:130 gnome-hello/gnome-hello-3-parse-args.c:160 gnome-hello/gnome-hello-4-SM.c:260 gnome-hello/gnome-hello.c:150 +#: gnome-hello/gnome-hello-2-i18n.c:130 gnome-hello/gnome-hello-3-parse-args.c:160 gnome-hello/gnome-hello-4-SM.c:260 msgid "GNOME is a civilized software system so we've a \"hello world\" program" msgstr "GNOME\244\317\300\366\316\375\244\265\244\354\244\277\245\275\245\325\245\310\245\246\245\247\245\242\245\267\245\271\245\306\245\340\244\312\244\316\244\307\"hello world\"\245\327\245\355\245\260\245\351\245\340\244\254\244\242\244\353\244\316\244\307\244\271\241\243" @@ -85,7 +85,7 @@ msgid "File" msgstr "\245\325\245\241\245\244\245\353/\275\252\316\273" -#: gnome-hello/gnome-hello-4-SM.c:79 gnome-hello/gnome-hello-7-mdi.c:404 libgnomeui/gnome-stock.c:474 libgnomeui/gnome-stock.c:475 libgnomeui/gnome-stock.c:476 libgnomeui/stock_demo.c:342 +#: gnome-hello/gnome-hello-4-SM.c:79 gnome-hello/gnome-hello-7-mdi.c:404 libgnomeui/gnome-stock.c:720 libgnomeui/stock_demo.c:342 msgid "Help" msgstr "\245\330\245\353\245\327" @@ -137,46 +137,25 @@ msgid "Children/" msgstr "" -# , c-format -#: gnome-hello/gnome-hello.c:208 -msgid "" -"%s: A gnomified 'Hello World' program\n" -"\n" -"Usage: %s [--help] [--version]\n" -"\n" -"Options:\n" -" --help display this help and exit\n" -" --version output version information and exit\n" -msgstr "" - -# , c-format -#: gnome-hello/gnome-hello.c:217 -msgid "Gnome Hello %s.\n" -msgstr "" - -#: gnome-hello/gnome-hello.c:231 -msgid "Options error\n" -msgstr "" - #: libgnome/gnome-parse.c:44 msgid "" "\n" "Generic options" msgstr "" -#: libgnomeui/gnome-about.c:193 +#: libgnomeui/gnome-about.c:201 msgid "Author:" msgstr "\272\356\274\324:" -#: libgnomeui/gnome-about.c:195 libgnomeui/gnome-about.c:197 +#: libgnomeui/gnome-about.c:203 libgnomeui/gnome-about.c:205 msgid "Authors:" msgstr "\272\356\274\324\260\354\315\367:" -#: libgnomeui/gnome-about.c:357 +#: libgnomeui/gnome-about.c:365 msgid "Authors: " msgstr "\272\356\274\324\260\354\315\367:" -#: libgnomeui/gnome-about.c:567 libgnomeui/stock_demo.c:331 +#: libgnomeui/gnome-about.c:575 libgnomeui/stock_demo.c:331 msgid "About" msgstr "\276\360\312\363" @@ -578,43 +557,51 @@ msgid "Date" msgstr "\306\374\311\325" -#: libgnomeui/gnome-stock.c:468 +#: libgnomeui/gnome-stock.c:714 msgid "OK" msgstr "" -#: libgnomeui/gnome-stock.c:469 +#: libgnomeui/gnome-stock.c:715 msgid "Apply" msgstr "\305\254\315\321" -#: libgnomeui/gnome-stock.c:470 +#: libgnomeui/gnome-stock.c:716 msgid "Cancel" msgstr "\245\255\245\343\245\363\245\273\245\353" -#: libgnomeui/gnome-stock.c:471 libgnomeui/stock_demo.c:163 +#: libgnomeui/gnome-stock.c:717 libgnomeui/stock_demo.c:163 msgid "Close" msgstr "\312\304\244\270\244\353" -#: libgnomeui/gnome-stock.c:472 +#: libgnomeui/gnome-stock.c:718 msgid "Yes" msgstr "\244\317\244\244" -#: libgnomeui/gnome-stock.c:473 +#: libgnomeui/gnome-stock.c:719 msgid "No" msgstr "\244\244\244\244\244\250" -#: libgnomeui/gnome-stock.c:1394 +#: libgnomeui/gnome-stock.c:721 +msgid "Next" +msgstr "" + +#: libgnomeui/gnome-stock.c:722 +msgid "Prev" +msgstr "" + +#: libgnomeui/gnome-stock.c:1646 msgid "Menu Accelerator Keys" msgstr "\245\341\245\313\245\345\241\274\245\242\245\257\245\273\245\351\245\354\241\274\245\277\245\255\241\274" -#: libgnomeui/gnome-stock.c:1396 +#: libgnomeui/gnome-stock.c:1648 msgid "Global" msgstr "\245\260\245\355\241\274\245\320\245\353" -#: libgnomeui/gnome-stock.c:1398 +#: libgnomeui/gnome-stock.c:1650 msgid "Menu Item" msgstr "\245\341\245\313\245\345\241\274\245\242\245\244\245\306\245\340" -#: libgnomeui/gnome-stock.c:1399 +#: libgnomeui/gnome-stock.c:1651 msgid "Accelerator" msgstr "\245\242\245\257\245\273\245\351\245\354\241\274\245\277" @@ -627,6 +614,7 @@ "\276\255\315\350\305\252\244\312SIGSEGV" # , c-format +# , c-format #: libgnomeui/gnome_segv.c:68 msgid "" "Application \"%s\" has a bug.\n" @@ -711,6 +699,103 @@ msgid "Edit" msgstr "" +# , c-format +#: libvfs/extfs.c:268 +msgid "" +"Couldn't open %s archive\n" +"%s" +msgstr "" + +#: libvfs/extfs.c:300 libvfs/extfs.c:320 +msgid "Inconsistent extfs archive" +msgstr "" + +# , c-format +#: libvfs/ftpfs.c:602 +msgid " Could not set source routing (%s)" +msgstr "" + +#: libvfs/ftpfs.c:2783 libvfs/ftpfs.c:2798 +msgid "" +"~/.netrc file has not correct mode.\n" +"Remove password or correct mode." +msgstr "" + +#: libvfs/mcfs.c:156 +msgid " MCFS " +msgstr "" + +#: libvfs/mcfs.c:156 +msgid " The server does not support this version " +msgstr "" + +# , fuzzy +# , fuzzy +#: libvfs/mcfs.c:172 +msgid " Warning " +msgstr "\303\355\260\325" + +#: libvfs/mcfs.c:173 +msgid "" +" The remote server is not running on a system port \n" +" you need a password to log in, but the information may \n" +" not be safe on the remote side. Continue? \n" +msgstr "" + +# , fuzzy +#: libvfs/mcfs.c:176 +msgid " Yes " +msgstr "\244\317\244\244" + +# , fuzzy +#: libvfs/mcfs.c:176 +msgid " No " +msgstr "\244\244\244\244\244\250" + +#: libvfs/mcfs.c:178 +msgid " The remote server is running on strange port. Giving up.\n" +msgstr "" + +#: libvfs/mcfs.c:190 +msgid " MCFS Password required " +msgstr "" + +#: libvfs/mcfs.c:204 +msgid " Invalid password " +msgstr "" + +#: libvfs/mcfs.c:270 +msgid " Too many open connections " +msgstr "" + +#: libvfs/tar.c:586 +msgid "Unexpected EOF on archive file" +msgstr "" + +#: libvfs/tar.c:640 libvfs/tar.c:661 +msgid "Inconsistent tar archive" +msgstr "" + +# , c-format +#: libvfs/tar.c:761 +msgid "" +"Couldn't open tar archive\n" +"%s" +msgstr "" + +# , c-format +#. Error on first record +#: libvfs/tar.c:780 +msgid "" +"Hmm,...\n" +"%s\n" +"doesn't look like a tar archive." +msgstr "" + +#: libvfs/vfs.c:1538 +msgid "Password:" +msgstr "" + #: support/argp-parse.c:90 msgid "Give this help list" msgstr "" @@ -736,6 +821,7 @@ msgstr "" # , c-format +# , c-format #: support/argp-parse.c:641 msgid "%s: Too many arguments\n" msgstr "" @@ -749,59 +835,70 @@ msgstr "" # , c-format +# , c-format #: support/getopt.c:669 msgid "%s: option `%s' is ambiguous\n" msgstr "" # , c-format +# , c-format #. --option #: support/getopt.c:693 msgid "%s: option `--%s' doesn't allow an argument\n" msgstr "" # , c-format +# , c-format #: support/getopt.c:698 msgid "%s: option `%c%s' doesn't allow an argument\n" msgstr "" # , c-format +# , c-format #: support/getopt.c:715 support/getopt.c:888 msgid "%s: option `%s' requires an argument\n" msgstr "" # , c-format +# , c-format #. --option #: support/getopt.c:744 msgid "%s: unrecognized option `--%s'\n" msgstr "" # , c-format +# , c-format #: support/getopt.c:748 msgid "%s: unrecognized option `%c%s'\n" msgstr "" # , c-format +# , c-format #. 1003.2 specifies the format of this message. #: support/getopt.c:774 msgid "%s: illegal option -- %c\n" msgstr "" # , c-format +# , c-format #: support/getopt.c:777 msgid "%s: invalid option -- %c\n" msgstr "" # , c-format +# , c-format #. 1003.2 specifies the format of this message. #: support/getopt.c:807 support/getopt.c:937 msgid "%s: option requires an argument -- %c\n" msgstr "" # , c-format +# , c-format #: support/getopt.c:854 msgid "%s: option `-W %s' is ambiguous\n" msgstr "" +# , c-format # , c-format #: support/getopt.c:872 msgid "%s: option `-W %s' doesn't allow an argument\n" Binary files gnome-libs-0.26/po/ko.gmo and gnome-libs-0.27/po/ko.gmo differ diff -uNr gnome-libs-0.26/po/ko.po gnome-libs-0.27/po/ko.po --- gnome-libs-0.26/po/ko.po Wed Aug 5 19:58:49 1998 +++ gnome-libs-0.27/po/ko.po Thu Aug 13 19:56:25 1998 @@ -5,28 +5,28 @@ msgid "" msgstr "" "Project-Id-Version: GNOME-libraries 0.13\n" -"POT-Creation-Date: 1998-08-01 16:36-0500\n" -"PO-Revision-Date: 1998-05-28 08:53+0900\n" -"Last-Translator: Changwoo Ryu \n" +"POT-Creation-Date: 1998-08-06 13:45-0500\n" +"PO-Revision-Date: 1998-08-09 00:56:33+0900\n" +"Last-Translator: Sung-Hyun Nam \n" "Language-Team: Korean \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=euc-kr\n" "Content-Transfer-Encoding: 8bit\n" -#: gnome-hello/gnome-hello-2-i18n.c:31 gnome-hello/gnome-hello-3-parse-args.c:33 gnome-hello/gnome-hello.c:40 +#: gnome-hello/gnome-hello-2-i18n.c:31 gnome-hello/gnome-hello-3-parse-args.c:33 msgid "File/Exit" msgstr "\306\304\300\317/\263\241\263\273\261\342" -#: gnome-hello/gnome-hello-2-i18n.c:31 gnome-hello/gnome-hello-3-parse-args.c:33 gnome-hello/gnome-hello.c:40 +#: gnome-hello/gnome-hello-2-i18n.c:31 gnome-hello/gnome-hello-3-parse-args.c:33 msgid "E" msgstr "E" #. The '...' end indicate that the options open a dialog -#: gnome-hello/gnome-hello-2-i18n.c:33 gnome-hello/gnome-hello-3-parse-args.c:35 gnome-hello/gnome-hello.c:42 +#: gnome-hello/gnome-hello-2-i18n.c:33 gnome-hello/gnome-hello-3-parse-args.c:35 msgid "Help/About..." msgstr "\265\265\277\362\270\273/\300\314 \307\301\267\316\261\327\267\245\300\272..." -#: gnome-hello/gnome-hello-2-i18n.c:33 gnome-hello/gnome-hello-3-parse-args.c:35 gnome-hello/gnome-hello.c:42 +#: gnome-hello/gnome-hello-2-i18n.c:33 gnome-hello/gnome-hello-3-parse-args.c:35 msgid "A" msgstr "A" @@ -38,20 +38,20 @@ #. We make a button, bind the 'clicked' signal to hello and setting it #. to be the content of the main window -#: gnome-hello/gnome-hello-2-i18n.c:83 gnome-hello/gnome-hello-3-parse-args.c:113 gnome-hello/gnome-hello-4-SM.c:213 gnome-hello/gnome-hello.c:103 +#: gnome-hello/gnome-hello-2-i18n.c:83 gnome-hello/gnome-hello-3-parse-args.c:113 gnome-hello/gnome-hello-4-SM.c:213 msgid "Hello GNOME" msgstr "\276\310\263\347\307\317\274\274\277\344 \261\327\263\360\300\324\264\317\264\331" -#: gnome-hello/gnome-hello-2-i18n.c:102 gnome-hello/gnome-hello-3-parse-args.c:132 gnome-hello/gnome-hello-4-SM.c:232 gnome-hello/gnome-hello.c:122 +#: gnome-hello/gnome-hello-2-i18n.c:102 gnome-hello/gnome-hello-3-parse-args.c:132 gnome-hello/gnome-hello-4-SM.c:232 msgid "Hello GNOME\n" msgstr "\276\310\263\347\307\317\274\274\277\344 \261\327\263\360\300\324\264\317\264\331\n" -#: gnome-hello/gnome-hello-2-i18n.c:125 gnome-hello/gnome-hello-3-parse-args.c:155 gnome-hello/gnome-hello-4-SM.c:255 gnome-hello/gnome-hello.c:145 +#: gnome-hello/gnome-hello-2-i18n.c:125 gnome-hello/gnome-hello-3-parse-args.c:155 gnome-hello/gnome-hello-4-SM.c:255 msgid "The Hello World Gnomified" msgstr "\261\327\263\360 Hello World" #. another comments -#: gnome-hello/gnome-hello-2-i18n.c:130 gnome-hello/gnome-hello-3-parse-args.c:160 gnome-hello/gnome-hello-4-SM.c:260 gnome-hello/gnome-hello.c:150 +#: gnome-hello/gnome-hello-2-i18n.c:130 gnome-hello/gnome-hello-3-parse-args.c:160 gnome-hello/gnome-hello-4-SM.c:260 msgid "GNOME is a civilized software system so we've a \"hello world\" program" msgstr "\261\327\263\360\300\272 \274\366\301\330\263\364\300\272 \274\322\307\301\306\256\277\376\276\356 \275\303\275\272\305\333\300\314\271\307\267\316 \"hello world\" \307\301\267\316\261\327\267\245\300\314 \300\326\275\300\264\317\264\331" @@ -84,7 +84,7 @@ msgid "File" msgstr "\306\304\300\317/\263\241\263\273\261\342" -#: gnome-hello/gnome-hello-4-SM.c:79 gnome-hello/gnome-hello-7-mdi.c:404 libgnomeui/gnome-stock.c:474 libgnomeui/gnome-stock.c:475 libgnomeui/gnome-stock.c:476 libgnomeui/stock_demo.c:342 +#: gnome-hello/gnome-hello-4-SM.c:79 gnome-hello/gnome-hello-7-mdi.c:404 libgnomeui/gnome-stock.c:720 libgnomeui/stock_demo.c:342 msgid "Help" msgstr "\265\265\277\362\270\273" @@ -136,46 +136,25 @@ msgid "Children/" msgstr "" -# , c-format -#: gnome-hello/gnome-hello.c:208 -msgid "" -"%s: A gnomified 'Hello World' program\n" -"\n" -"Usage: %s [--help] [--version]\n" -"\n" -"Options:\n" -" --help display this help and exit\n" -" --version output version information and exit\n" -msgstr "" - -# , c-format -#: gnome-hello/gnome-hello.c:217 -msgid "Gnome Hello %s.\n" -msgstr "" - -#: gnome-hello/gnome-hello.c:231 -msgid "Options error\n" -msgstr "" - #: libgnome/gnome-parse.c:44 msgid "" "\n" "Generic options" msgstr "" -#: libgnomeui/gnome-about.c:193 +#: libgnomeui/gnome-about.c:201 msgid "Author:" msgstr "\270\270\265\347\300\314:" -#: libgnomeui/gnome-about.c:195 libgnomeui/gnome-about.c:197 +#: libgnomeui/gnome-about.c:203 libgnomeui/gnome-about.c:205 msgid "Authors:" msgstr "\270\270\265\347\300\314:" -#: libgnomeui/gnome-about.c:357 +#: libgnomeui/gnome-about.c:365 msgid "Authors: " msgstr "\270\270\265\347\300\314: " -#: libgnomeui/gnome-about.c:567 libgnomeui/stock_demo.c:331 +#: libgnomeui/gnome-about.c:575 libgnomeui/stock_demo.c:331 msgid "About" msgstr "\300\314 \307\301\267\316\261\327\267\245\300\272" @@ -425,7 +404,7 @@ # , fuzzy #: libgnomeui/gnome-dateedit.c:393 msgid "Calendar" -msgstr "\301\366\277\354\261\342" +msgstr "\264\336\267\302" #: libgnomeui/gnome-dentry-edit.c:164 msgid "Name:" @@ -578,43 +557,51 @@ msgid "Date" msgstr "\263\257\302\245" -#: libgnomeui/gnome-stock.c:468 +#: libgnomeui/gnome-stock.c:714 msgid "OK" msgstr "\310\256\300\316" -#: libgnomeui/gnome-stock.c:469 +#: libgnomeui/gnome-stock.c:715 msgid "Apply" msgstr "\300\373\277\353" -#: libgnomeui/gnome-stock.c:470 +#: libgnomeui/gnome-stock.c:716 msgid "Cancel" msgstr "\303\353\274\322" -#: libgnomeui/gnome-stock.c:471 libgnomeui/stock_demo.c:163 +#: libgnomeui/gnome-stock.c:717 libgnomeui/stock_demo.c:163 msgid "Close" msgstr "\264\335\261\342" -#: libgnomeui/gnome-stock.c:472 +#: libgnomeui/gnome-stock.c:718 msgid "Yes" msgstr "\277\271" -#: libgnomeui/gnome-stock.c:473 +#: libgnomeui/gnome-stock.c:719 msgid "No" msgstr "\276\306\264\317\277\300" -#: libgnomeui/gnome-stock.c:1394 +#: libgnomeui/gnome-stock.c:721 +msgid "Next" +msgstr "" + +#: libgnomeui/gnome-stock.c:722 +msgid "Prev" +msgstr "" + +#: libgnomeui/gnome-stock.c:1646 msgid "Menu Accelerator Keys" msgstr "\270\336\264\272 \264\334\303\340\305\260" -#: libgnomeui/gnome-stock.c:1396 +#: libgnomeui/gnome-stock.c:1648 msgid "Global" msgstr "\300\374\303\274 \274\263\301\244" -#: libgnomeui/gnome-stock.c:1398 +#: libgnomeui/gnome-stock.c:1650 msgid "Menu Item" msgstr "\270\336\264\272 \307\327\270\361" -#: libgnomeui/gnome-stock.c:1399 +#: libgnomeui/gnome-stock.c:1651 msgid "Accelerator" msgstr "\264\334\303\340\305\260" @@ -627,6 +614,7 @@ "SIGSEGV\260\241 \271\337\273\375\307\330\265\265 \271\253\275\303" # , c-format +# , c-format #: libgnomeui/gnome_segv.c:68 msgid "" "Application \"%s\" has a bug.\n" @@ -711,6 +699,103 @@ msgid "Edit" msgstr "" +# , c-format +#: libvfs/extfs.c:268 +msgid "" +"Couldn't open %s archive\n" +"%s" +msgstr "" + +#: libvfs/extfs.c:300 libvfs/extfs.c:320 +msgid "Inconsistent extfs archive" +msgstr "" + +# , c-format +#: libvfs/ftpfs.c:602 +msgid " Could not set source routing (%s)" +msgstr "" + +#: libvfs/ftpfs.c:2783 libvfs/ftpfs.c:2798 +msgid "" +"~/.netrc file has not correct mode.\n" +"Remove password or correct mode." +msgstr "" + +#: libvfs/mcfs.c:156 +msgid " MCFS " +msgstr "" + +#: libvfs/mcfs.c:156 +msgid " The server does not support this version " +msgstr "" + +# , fuzzy +# , fuzzy +#: libvfs/mcfs.c:172 +msgid " Warning " +msgstr "\260\346\260\355" + +#: libvfs/mcfs.c:173 +msgid "" +" The remote server is not running on a system port \n" +" you need a password to log in, but the information may \n" +" not be safe on the remote side. Continue? \n" +msgstr "" + +# , fuzzy +#: libvfs/mcfs.c:176 +msgid " Yes " +msgstr "\277\271" + +# , fuzzy +#: libvfs/mcfs.c:176 +msgid " No " +msgstr "\276\306\264\317\277\300" + +#: libvfs/mcfs.c:178 +msgid " The remote server is running on strange port. Giving up.\n" +msgstr "" + +#: libvfs/mcfs.c:190 +msgid " MCFS Password required " +msgstr "" + +#: libvfs/mcfs.c:204 +msgid " Invalid password " +msgstr "" + +#: libvfs/mcfs.c:270 +msgid " Too many open connections " +msgstr "" + +#: libvfs/tar.c:586 +msgid "Unexpected EOF on archive file" +msgstr "" + +#: libvfs/tar.c:640 libvfs/tar.c:661 +msgid "Inconsistent tar archive" +msgstr "" + +# , c-format +#: libvfs/tar.c:761 +msgid "" +"Couldn't open tar archive\n" +"%s" +msgstr "" + +# , c-format +#. Error on first record +#: libvfs/tar.c:780 +msgid "" +"Hmm,...\n" +"%s\n" +"doesn't look like a tar archive." +msgstr "" + +#: libvfs/vfs.c:1538 +msgid "Password:" +msgstr "" + #: support/argp-parse.c:90 msgid "Give this help list" msgstr "\300\314 \265\265\277\362\270\273 \270\256\275\272\306\256\270\246 \272\270\277\251\301\334" @@ -736,6 +821,7 @@ msgstr "(\307\301\267\316\261\327\267\245 \276\326\267\257) \271\366\300\374\300\273 \276\313\274\366 \276\370\275\300\264\317\264\331!?" # , c-format +# , c-format #: support/argp-parse.c:641 msgid "%s: Too many arguments\n" msgstr "%s: \263\312\271\253 \300\316\300\332\260\241 \270\271\300\275\n" @@ -749,59 +835,70 @@ msgstr "" # , c-format +# , c-format #: support/getopt.c:669 msgid "%s: option `%s' is ambiguous\n" msgstr "" # , c-format +# , c-format #. --option #: support/getopt.c:693 msgid "%s: option `--%s' doesn't allow an argument\n" msgstr "" # , c-format +# , c-format #: support/getopt.c:698 msgid "%s: option `%c%s' doesn't allow an argument\n" msgstr "" # , fuzzy, c-format +# , c-format #: support/getopt.c:715 support/getopt.c:888 msgid "%s: option `%s' requires an argument\n" msgstr "%s: \263\312\271\253 \300\316\300\332\260\241 \270\271\300\275\n" # , c-format +# , c-format #. --option #: support/getopt.c:744 msgid "%s: unrecognized option `--%s'\n" msgstr "" # , c-format +# , c-format #: support/getopt.c:748 msgid "%s: unrecognized option `%c%s'\n" msgstr "" # , c-format +# , c-format #. 1003.2 specifies the format of this message. #: support/getopt.c:774 msgid "%s: illegal option -- %c\n" msgstr "" # , c-format +# , c-format #: support/getopt.c:777 msgid "%s: invalid option -- %c\n" msgstr "" # , fuzzy, c-format +# , c-format #. 1003.2 specifies the format of this message. #: support/getopt.c:807 support/getopt.c:937 msgid "%s: option requires an argument -- %c\n" msgstr "%s: \263\312\271\253 \300\316\300\332\260\241 \270\271\300\275\n" # , c-format +# , c-format #: support/getopt.c:854 msgid "%s: option `-W %s' is ambiguous\n" msgstr "" +# , c-format # , c-format #: support/getopt.c:872 msgid "%s: option `-W %s' doesn't allow an argument\n" Binary files gnome-libs-0.26/po/no.gmo and gnome-libs-0.27/po/no.gmo differ diff -uNr gnome-libs-0.26/po/no.po gnome-libs-0.27/po/no.po --- gnome-libs-0.26/po/no.po Wed Aug 5 19:58:50 1998 +++ gnome-libs-0.27/po/no.po Thu Aug 13 19:56:26 1998 @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: gnome-libs-0.13\n" -"POT-Creation-Date: 1998-08-01 16:36-0500\n" +"POT-Creation-Date: 1998-08-06 13:45-0500\n" "PO-Revision-Date: 1998-05-04 12:00+0100\n" "Last-Translator: Kjartan Maraas \n" "Language-Team: Norwegian \n" @@ -14,20 +14,20 @@ "Content-Type: text/plain; charset=iso-8859-1\n" "Content-Transfer-Encoding: 8-bit\n" -#: gnome-hello/gnome-hello-2-i18n.c:31 gnome-hello/gnome-hello-3-parse-args.c:33 gnome-hello/gnome-hello.c:40 +#: gnome-hello/gnome-hello-2-i18n.c:31 gnome-hello/gnome-hello-3-parse-args.c:33 msgid "File/Exit" msgstr "Fil/Avslutt" -#: gnome-hello/gnome-hello-2-i18n.c:31 gnome-hello/gnome-hello-3-parse-args.c:33 gnome-hello/gnome-hello.c:40 +#: gnome-hello/gnome-hello-2-i18n.c:31 gnome-hello/gnome-hello-3-parse-args.c:33 msgid "E" msgstr "" #. The '...' end indicate that the options open a dialog -#: gnome-hello/gnome-hello-2-i18n.c:33 gnome-hello/gnome-hello-3-parse-args.c:35 gnome-hello/gnome-hello.c:42 +#: gnome-hello/gnome-hello-2-i18n.c:33 gnome-hello/gnome-hello-3-parse-args.c:35 msgid "Help/About..." msgstr "Hjelp/Om..." -#: gnome-hello/gnome-hello-2-i18n.c:33 gnome-hello/gnome-hello-3-parse-args.c:35 gnome-hello/gnome-hello.c:42 +#: gnome-hello/gnome-hello-2-i18n.c:33 gnome-hello/gnome-hello-3-parse-args.c:35 msgid "A" msgstr "" @@ -39,20 +39,20 @@ #. We make a button, bind the 'clicked' signal to hello and setting it #. to be the content of the main window -#: gnome-hello/gnome-hello-2-i18n.c:83 gnome-hello/gnome-hello-3-parse-args.c:113 gnome-hello/gnome-hello-4-SM.c:213 gnome-hello/gnome-hello.c:103 +#: gnome-hello/gnome-hello-2-i18n.c:83 gnome-hello/gnome-hello-3-parse-args.c:113 gnome-hello/gnome-hello-4-SM.c:213 msgid "Hello GNOME" msgstr "" -#: gnome-hello/gnome-hello-2-i18n.c:102 gnome-hello/gnome-hello-3-parse-args.c:132 gnome-hello/gnome-hello-4-SM.c:232 gnome-hello/gnome-hello.c:122 +#: gnome-hello/gnome-hello-2-i18n.c:102 gnome-hello/gnome-hello-3-parse-args.c:132 gnome-hello/gnome-hello-4-SM.c:232 msgid "Hello GNOME\n" msgstr "" -#: gnome-hello/gnome-hello-2-i18n.c:125 gnome-hello/gnome-hello-3-parse-args.c:155 gnome-hello/gnome-hello-4-SM.c:255 gnome-hello/gnome-hello.c:145 +#: gnome-hello/gnome-hello-2-i18n.c:125 gnome-hello/gnome-hello-3-parse-args.c:155 gnome-hello/gnome-hello-4-SM.c:255 msgid "The Hello World Gnomified" msgstr "" #. another comments -#: gnome-hello/gnome-hello-2-i18n.c:130 gnome-hello/gnome-hello-3-parse-args.c:160 gnome-hello/gnome-hello-4-SM.c:260 gnome-hello/gnome-hello.c:150 +#: gnome-hello/gnome-hello-2-i18n.c:130 gnome-hello/gnome-hello-3-parse-args.c:160 gnome-hello/gnome-hello-4-SM.c:260 msgid "GNOME is a civilized software system so we've a \"hello world\" program" msgstr "GNOME er et sivilisert programvaresystem s\345 vi har et \"hello world\" program" @@ -85,7 +85,7 @@ msgid "File" msgstr "Fil/Avslutt" -#: gnome-hello/gnome-hello-4-SM.c:79 gnome-hello/gnome-hello-7-mdi.c:404 libgnomeui/gnome-stock.c:474 libgnomeui/gnome-stock.c:475 libgnomeui/gnome-stock.c:476 libgnomeui/stock_demo.c:342 +#: gnome-hello/gnome-hello-4-SM.c:79 gnome-hello/gnome-hello-7-mdi.c:404 libgnomeui/gnome-stock.c:720 libgnomeui/stock_demo.c:342 msgid "Help" msgstr "Hjelp" @@ -137,46 +137,25 @@ msgid "Children/" msgstr "" -# , c-format -#: gnome-hello/gnome-hello.c:208 -msgid "" -"%s: A gnomified 'Hello World' program\n" -"\n" -"Usage: %s [--help] [--version]\n" -"\n" -"Options:\n" -" --help display this help and exit\n" -" --version output version information and exit\n" -msgstr "" - -# , c-format -#: gnome-hello/gnome-hello.c:217 -msgid "Gnome Hello %s.\n" -msgstr "" - -#: gnome-hello/gnome-hello.c:231 -msgid "Options error\n" -msgstr "" - #: libgnome/gnome-parse.c:44 msgid "" "\n" "Generic options" msgstr "" -#: libgnomeui/gnome-about.c:193 +#: libgnomeui/gnome-about.c:201 msgid "Author:" msgstr "Forfatter:" -#: libgnomeui/gnome-about.c:195 libgnomeui/gnome-about.c:197 +#: libgnomeui/gnome-about.c:203 libgnomeui/gnome-about.c:205 msgid "Authors:" msgstr "Forfattere:" -#: libgnomeui/gnome-about.c:357 +#: libgnomeui/gnome-about.c:365 msgid "Authors: " msgstr "Forfattere:" -#: libgnomeui/gnome-about.c:567 libgnomeui/stock_demo.c:331 +#: libgnomeui/gnome-about.c:575 libgnomeui/stock_demo.c:331 msgid "About" msgstr "Om" @@ -578,43 +557,51 @@ msgid "Date" msgstr "Dato" -#: libgnomeui/gnome-stock.c:468 +#: libgnomeui/gnome-stock.c:714 msgid "OK" msgstr "" -#: libgnomeui/gnome-stock.c:469 +#: libgnomeui/gnome-stock.c:715 msgid "Apply" msgstr "Bruk" -#: libgnomeui/gnome-stock.c:470 +#: libgnomeui/gnome-stock.c:716 msgid "Cancel" msgstr "Avbryt" -#: libgnomeui/gnome-stock.c:471 libgnomeui/stock_demo.c:163 +#: libgnomeui/gnome-stock.c:717 libgnomeui/stock_demo.c:163 msgid "Close" msgstr "Lukk" -#: libgnomeui/gnome-stock.c:472 +#: libgnomeui/gnome-stock.c:718 msgid "Yes" msgstr "Ja" -#: libgnomeui/gnome-stock.c:473 +#: libgnomeui/gnome-stock.c:719 msgid "No" msgstr "Nei" -#: libgnomeui/gnome-stock.c:1394 +#: libgnomeui/gnome-stock.c:721 +msgid "Next" +msgstr "" + +#: libgnomeui/gnome-stock.c:722 +msgid "Prev" +msgstr "" + +#: libgnomeui/gnome-stock.c:1646 msgid "Menu Accelerator Keys" msgstr "Meny-aksellerator taster" -#: libgnomeui/gnome-stock.c:1396 +#: libgnomeui/gnome-stock.c:1648 msgid "Global" msgstr "" -#: libgnomeui/gnome-stock.c:1398 +#: libgnomeui/gnome-stock.c:1650 msgid "Menu Item" msgstr "Menyvalg" -#: libgnomeui/gnome-stock.c:1399 +#: libgnomeui/gnome-stock.c:1651 msgid "Accelerator" msgstr "Aksellerator" @@ -627,6 +614,7 @@ "fremtidige SIGSEGVer" # , c-format +# , c-format #: libgnomeui/gnome_segv.c:68 msgid "" "Application \"%s\" has a bug.\n" @@ -711,6 +699,103 @@ msgid "Edit" msgstr "" +# , c-format +#: libvfs/extfs.c:268 +msgid "" +"Couldn't open %s archive\n" +"%s" +msgstr "" + +#: libvfs/extfs.c:300 libvfs/extfs.c:320 +msgid "Inconsistent extfs archive" +msgstr "" + +# , c-format +#: libvfs/ftpfs.c:602 +msgid " Could not set source routing (%s)" +msgstr "" + +#: libvfs/ftpfs.c:2783 libvfs/ftpfs.c:2798 +msgid "" +"~/.netrc file has not correct mode.\n" +"Remove password or correct mode." +msgstr "" + +#: libvfs/mcfs.c:156 +msgid " MCFS " +msgstr "" + +#: libvfs/mcfs.c:156 +msgid " The server does not support this version " +msgstr "" + +# , fuzzy +# , fuzzy +#: libvfs/mcfs.c:172 +msgid " Warning " +msgstr "Advarsel" + +#: libvfs/mcfs.c:173 +msgid "" +" The remote server is not running on a system port \n" +" you need a password to log in, but the information may \n" +" not be safe on the remote side. Continue? \n" +msgstr "" + +# , fuzzy +#: libvfs/mcfs.c:176 +msgid " Yes " +msgstr "Ja" + +# , fuzzy +#: libvfs/mcfs.c:176 +msgid " No " +msgstr "Nei" + +#: libvfs/mcfs.c:178 +msgid " The remote server is running on strange port. Giving up.\n" +msgstr "" + +#: libvfs/mcfs.c:190 +msgid " MCFS Password required " +msgstr "" + +#: libvfs/mcfs.c:204 +msgid " Invalid password " +msgstr "" + +#: libvfs/mcfs.c:270 +msgid " Too many open connections " +msgstr "" + +#: libvfs/tar.c:586 +msgid "Unexpected EOF on archive file" +msgstr "" + +#: libvfs/tar.c:640 libvfs/tar.c:661 +msgid "Inconsistent tar archive" +msgstr "" + +# , c-format +#: libvfs/tar.c:761 +msgid "" +"Couldn't open tar archive\n" +"%s" +msgstr "" + +# , c-format +#. Error on first record +#: libvfs/tar.c:780 +msgid "" +"Hmm,...\n" +"%s\n" +"doesn't look like a tar archive." +msgstr "" + +#: libvfs/vfs.c:1538 +msgid "Password:" +msgstr "" + #: support/argp-parse.c:90 msgid "Give this help list" msgstr "Gi denne hjelpelisten" @@ -736,6 +821,7 @@ msgstr "(PROGRAM-FEIL) Versjon ikke kjent!?" # , c-format +# , c-format #: support/argp-parse.c:641 msgid "%s: Too many arguments\n" msgstr "%s: For mange argumenter\n" @@ -749,59 +835,70 @@ msgstr "" # , c-format +# , c-format #: support/getopt.c:669 msgid "%s: option `%s' is ambiguous\n" msgstr "" # , c-format +# , c-format #. --option #: support/getopt.c:693 msgid "%s: option `--%s' doesn't allow an argument\n" msgstr "" # , c-format +# , c-format #: support/getopt.c:698 msgid "%s: option `%c%s' doesn't allow an argument\n" msgstr "" # , fuzzy, c-format +# , c-format #: support/getopt.c:715 support/getopt.c:888 msgid "%s: option `%s' requires an argument\n" msgstr "%s: For mange argumenter\n" # , c-format +# , c-format #. --option #: support/getopt.c:744 msgid "%s: unrecognized option `--%s'\n" msgstr "" # , c-format +# , c-format #: support/getopt.c:748 msgid "%s: unrecognized option `%c%s'\n" msgstr "" # , c-format +# , c-format #. 1003.2 specifies the format of this message. #: support/getopt.c:774 msgid "%s: illegal option -- %c\n" msgstr "" # , c-format +# , c-format #: support/getopt.c:777 msgid "%s: invalid option -- %c\n" msgstr "" # , fuzzy, c-format +# , c-format #. 1003.2 specifies the format of this message. #: support/getopt.c:807 support/getopt.c:937 msgid "%s: option requires an argument -- %c\n" msgstr "%s: For mange argumenter\n" # , c-format +# , c-format #: support/getopt.c:854 msgid "%s: option `-W %s' is ambiguous\n" msgstr "" +# , c-format # , c-format #: support/getopt.c:872 msgid "%s: option `-W %s' doesn't allow an argument\n" Binary files gnome-libs-0.26/po/pt.gmo and gnome-libs-0.27/po/pt.gmo differ diff -uNr gnome-libs-0.26/po/pt.po gnome-libs-0.27/po/pt.po --- gnome-libs-0.26/po/pt.po Wed Aug 5 19:58:51 1998 +++ gnome-libs-0.27/po/pt.po Thu Aug 13 19:56:26 1998 @@ -1,28 +1,28 @@ msgid "" msgstr "" "Project-Id-Version: gnome-libs 0.20\n" -"POT-Creation-Date: 1998-08-03 22:58+0100\n" -"PO-Revision-Date: 1998-08-03 22:56+01:00\n" +"POT-Creation-Date: 1998-08-07 04:03+0100\n" +"PO-Revision-Date: 1998-08-07 04:02+01:00\n" "Last-Translator: Nuno Ferreira \n" "Language-Team: Portuguese \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=iso-8859-1\n" "Content-Transfer-Encoding: 8bit\n" -#: gnome-hello/gnome-hello-2-i18n.c:31 gnome-hello/gnome-hello-3-parse-args.c:33 gnome-hello/gnome-hello.c:40 +#: gnome-hello/gnome-hello-2-i18n.c:31 gnome-hello/gnome-hello-3-parse-args.c:33 msgid "File/Exit" msgstr "Ficheiro/Sair" -#: gnome-hello/gnome-hello-2-i18n.c:31 gnome-hello/gnome-hello-3-parse-args.c:33 gnome-hello/gnome-hello.c:40 +#: gnome-hello/gnome-hello-2-i18n.c:31 gnome-hello/gnome-hello-3-parse-args.c:33 msgid "E" msgstr "E" #. The '...' end indicate that the options open a dialog -#: gnome-hello/gnome-hello-2-i18n.c:33 gnome-hello/gnome-hello-3-parse-args.c:35 gnome-hello/gnome-hello.c:42 +#: gnome-hello/gnome-hello-2-i18n.c:33 gnome-hello/gnome-hello-3-parse-args.c:35 msgid "Help/About..." msgstr "Ajuda/Acerca de..." -#: gnome-hello/gnome-hello-2-i18n.c:33 gnome-hello/gnome-hello-3-parse-args.c:35 gnome-hello/gnome-hello.c:42 +#: gnome-hello/gnome-hello-2-i18n.c:33 gnome-hello/gnome-hello-3-parse-args.c:35 msgid "A" msgstr "A" @@ -34,20 +34,20 @@ #. We make a button, bind the 'clicked' signal to hello and setting it #. to be the content of the main window -#: gnome-hello/gnome-hello-2-i18n.c:83 gnome-hello/gnome-hello-3-parse-args.c:113 gnome-hello/gnome-hello-4-SM.c:213 gnome-hello/gnome-hello.c:103 +#: gnome-hello/gnome-hello-2-i18n.c:83 gnome-hello/gnome-hello-3-parse-args.c:113 gnome-hello/gnome-hello-4-SM.c:213 msgid "Hello GNOME" msgstr "Ol\341 GNOME" -#: gnome-hello/gnome-hello-2-i18n.c:102 gnome-hello/gnome-hello-3-parse-args.c:132 gnome-hello/gnome-hello-4-SM.c:232 gnome-hello/gnome-hello.c:122 +#: gnome-hello/gnome-hello-2-i18n.c:102 gnome-hello/gnome-hello-3-parse-args.c:132 gnome-hello/gnome-hello-4-SM.c:232 msgid "Hello GNOME\n" msgstr "Ol\341 GNOME\n" -#: gnome-hello/gnome-hello-2-i18n.c:125 gnome-hello/gnome-hello-3-parse-args.c:155 gnome-hello/gnome-hello-4-SM.c:255 gnome-hello/gnome-hello.c:145 +#: gnome-hello/gnome-hello-2-i18n.c:125 gnome-hello/gnome-hello-3-parse-args.c:155 gnome-hello/gnome-hello-4-SM.c:255 msgid "The Hello World Gnomified" msgstr "O Hello World Gnomificado" #. another comments -#: gnome-hello/gnome-hello-2-i18n.c:130 gnome-hello/gnome-hello-3-parse-args.c:160 gnome-hello/gnome-hello-4-SM.c:260 gnome-hello/gnome-hello.c:150 +#: gnome-hello/gnome-hello-2-i18n.c:130 gnome-hello/gnome-hello-3-parse-args.c:160 gnome-hello/gnome-hello-4-SM.c:260 msgid "GNOME is a civilized software system so we've a \"hello world\" program" msgstr "GNOME \351 um conjunto de programas civilizado por isso temos um programa \"hello world\"" @@ -77,7 +77,7 @@ msgid "File" msgstr "Ficheiro" -#: gnome-hello/gnome-hello-4-SM.c:79 gnome-hello/gnome-hello-7-mdi.c:404 libgnomeui/gnome-stock.c:474 libgnomeui/gnome-stock.c:475 libgnomeui/gnome-stock.c:476 libgnomeui/stock_demo.c:342 +#: gnome-hello/gnome-hello-4-SM.c:79 gnome-hello/gnome-hello-7-mdi.c:404 libgnomeui/gnome-stock.c:720 libgnomeui/stock_demo.c:342 msgid "Help" msgstr "Ajuda" @@ -129,34 +129,6 @@ msgid "Children/" msgstr "Filhos/" -# , c-format -#: gnome-hello/gnome-hello.c:208 -msgid "" -"%s: A gnomified 'Hello World' program\n" -"\n" -"Usage: %s [--help] [--version]\n" -"\n" -"Options:\n" -" --help display this help and exit\n" -" --version output version information and exit\n" -msgstr "" -"%s: Um programa `Hello World' gnomificado\n" -"\n" -"Utiliza\347\343o: %s [--help] [--version]\n" -"\n" -"Op\347\365es:\n" -" --help mostra esta ajuda e sai\n" -" --version mostra informa\347\343o sobre a vers\343o e sai\n" - -# , c-format -#: gnome-hello/gnome-hello.c:217 -msgid "Gnome Hello %s.\n" -msgstr "Ol\341 Gnome %s.\n" - -#: gnome-hello/gnome-hello.c:231 -msgid "Options error\n" -msgstr "Erro nas op\347\365es\n" - #: libgnome/gnome-parse.c:44 msgid "" "\n" @@ -165,19 +137,19 @@ "\n" "Op\347\365es gen\351ricas" -#: libgnomeui/gnome-about.c:193 +#: libgnomeui/gnome-about.c:201 msgid "Author:" msgstr "Autor:" -#: libgnomeui/gnome-about.c:195 libgnomeui/gnome-about.c:197 +#: libgnomeui/gnome-about.c:203 libgnomeui/gnome-about.c:205 msgid "Authors:" msgstr "Autores:" -#: libgnomeui/gnome-about.c:357 +#: libgnomeui/gnome-about.c:365 msgid "Authors: " msgstr "Autores: " -#: libgnomeui/gnome-about.c:567 libgnomeui/stock_demo.c:331 +#: libgnomeui/gnome-about.c:575 libgnomeui/stock_demo.c:331 msgid "About" msgstr "Acerca de" @@ -584,43 +556,51 @@ msgid "Date" msgstr "Data" -#: libgnomeui/gnome-stock.c:468 +#: libgnomeui/gnome-stock.c:714 msgid "OK" msgstr "OK" -#: libgnomeui/gnome-stock.c:469 +#: libgnomeui/gnome-stock.c:715 msgid "Apply" msgstr "Aplicar" -#: libgnomeui/gnome-stock.c:470 +#: libgnomeui/gnome-stock.c:716 msgid "Cancel" msgstr "Cancelar" -#: libgnomeui/gnome-stock.c:471 libgnomeui/stock_demo.c:163 +#: libgnomeui/gnome-stock.c:717 libgnomeui/stock_demo.c:163 msgid "Close" msgstr "Fechar" -#: libgnomeui/gnome-stock.c:472 +#: libgnomeui/gnome-stock.c:718 msgid "Yes" msgstr "Sim" -#: libgnomeui/gnome-stock.c:473 +#: libgnomeui/gnome-stock.c:719 msgid "No" msgstr "N\343o" -#: libgnomeui/gnome-stock.c:1394 +#: libgnomeui/gnome-stock.c:721 +msgid "Next" +msgstr "Pr\363ximo" + +#: libgnomeui/gnome-stock.c:722 +msgid "Prev" +msgstr "Anterior" + +#: libgnomeui/gnome-stock.c:1646 msgid "Menu Accelerator Keys" msgstr "Atalhos de Menu" -#: libgnomeui/gnome-stock.c:1396 +#: libgnomeui/gnome-stock.c:1648 msgid "Global" msgstr "Global" -#: libgnomeui/gnome-stock.c:1398 +#: libgnomeui/gnome-stock.c:1650 msgid "Menu Item" msgstr "Item de Menu" -#: libgnomeui/gnome-stock.c:1399 +#: libgnomeui/gnome-stock.c:1651 msgid "Accelerator" msgstr "Atalho" @@ -633,6 +613,7 @@ "futuros sinais SIGSEGV" # , c-format +# , c-format #: libgnomeui/gnome_segv.c:68 msgid "" "Application \"%s\" has a bug.\n" @@ -715,6 +696,111 @@ msgid "Edit" msgstr "Editar" +# , c-format +#: libvfs/extfs.c:268 +msgid "" +"Couldn't open %s archive\n" +"%s" +msgstr "" +"N\343o consegui abrir arquivo %s\n" +"%s" + +#: libvfs/extfs.c:300 libvfs/extfs.c:320 +msgid "Inconsistent extfs archive" +msgstr "Arquivo extfs inconsistente" + +# , c-format +#: libvfs/ftpfs.c:602 +msgid " Could not set source routing (%s)" +msgstr "" + +#: libvfs/ftpfs.c:2783 libvfs/ftpfs.c:2798 +msgid "" +"~/.netrc file has not correct mode.\n" +"Remove password or correct mode." +msgstr "" +"Ficheiro ~/.netrc n\343o tem as permiss\365es correctas.\n" +"Apague a palavra-passe ou corrija as permiss\365es." + +#: libvfs/mcfs.c:156 +msgid " MCFS " +msgstr " MCFS " + +#: libvfs/mcfs.c:156 +msgid " The server does not support this version " +msgstr " O servidor n\343o suporta esta vers\343o " + +#: libvfs/mcfs.c:172 +msgid " Warning " +msgstr " Aviso " + +#: libvfs/mcfs.c:173 +msgid "" +" The remote server is not running on a system port \n" +" you need a password to log in, but the information may \n" +" not be safe on the remote side. Continue? \n" +msgstr "" +" O servidor remoto n\343o est\341 a correr num porto de sistema \n" +" Voc\352 necessita duma palavra-passe para se identificar, mas\n" +" essa informa\347\343o pode n\343o estar segura remotamente. Continuar? \n" + +#: libvfs/mcfs.c:176 +msgid " Yes " +msgstr " Sim " + +#: libvfs/mcfs.c:176 +msgid " No " +msgstr " N\343o " + +#: libvfs/mcfs.c:178 +msgid " The remote server is running on strange port. Giving up.\n" +msgstr " O servidor remoto est\341 a correr num porto estranho. Desistindo.\n" + +#: libvfs/mcfs.c:190 +msgid " MCFS Password required " +msgstr " Palavra-passe MCFS necess\341ria " + +#: libvfs/mcfs.c:204 +msgid " Invalid password " +msgstr " Palavra-passe inv\341lida " + +#: libvfs/mcfs.c:270 +msgid " Too many open connections " +msgstr "Demasiadas liga\347\365es abertas " + +#: libvfs/tar.c:586 +msgid "Unexpected EOF on archive file" +msgstr "EOF inesperado no ficheiro de arquivo" + +#: libvfs/tar.c:640 libvfs/tar.c:661 +msgid "Inconsistent tar archive" +msgstr "Arquivo tar inconsistente" + +# , c-format +#: libvfs/tar.c:761 +msgid "" +"Couldn't open tar archive\n" +"%s" +msgstr "" +"N\343o consegui abrir arquivo tar\n" +"%s" + +# , c-format +#. Error on first record +#: libvfs/tar.c:780 +msgid "" +"Hmm,...\n" +"%s\n" +"doesn't look like a tar archive." +msgstr "" +"Hmm,...\n" +"%s\n" +"n\343o parece ser um arquivo tar." + +#: libvfs/vfs.c:1538 +msgid "Password:" +msgstr "Palavra-passe:" + #: support/argp-parse.c:90 msgid "Give this help list" msgstr "Mostrar esta lista de ajuda" @@ -740,6 +826,7 @@ msgstr "(ERRO PROGRAMA) Nenhuma vers\343o conhecida!?" # , c-format +# , c-format #: support/argp-parse.c:641 msgid "%s: Too many arguments\n" msgstr "%s: Demasiados argumentos\n" @@ -753,59 +840,70 @@ msgstr "Erro de sistema desconhecido" # , c-format +# , c-format #: support/getopt.c:669 msgid "%s: option `%s' is ambiguous\n" msgstr "%s: op\347\343o `--%s' \351 amb\355gua\n" # , c-format +# , c-format #. --option #: support/getopt.c:693 msgid "%s: option `--%s' doesn't allow an argument\n" msgstr "%s: op\347\343o `--%s' n\343o recebe nenhum argumento\n" # , c-format +# , c-format #: support/getopt.c:698 msgid "%s: option `%c%s' doesn't allow an argument\n" msgstr "%s: op\347\343o `%c%s' n\343o recebe nenhum argumento\n" # , c-format +# , c-format #: support/getopt.c:715 support/getopt.c:888 msgid "%s: option `%s' requires an argument\n" msgstr "%s: op\347\343o `%s' requer um argumento\n" # , c-format +# , c-format #. --option #: support/getopt.c:744 msgid "%s: unrecognized option `--%s'\n" msgstr "%s: op\347\343o `--%s' n\343o \351 reconhecida\n" # , c-format +# , c-format #: support/getopt.c:748 msgid "%s: unrecognized option `%c%s'\n" msgstr "%s: op\347\343o `%c%s' n\343o \351 reconhecida\n" # , c-format +# , c-format #. 1003.2 specifies the format of this message. #: support/getopt.c:774 msgid "%s: illegal option -- %c\n" msgstr "%s: op\347\343o ilegal -- %c\n" # , c-format +# , c-format #: support/getopt.c:777 msgid "%s: invalid option -- %c\n" msgstr "%s: op\347\343o inv\341lida -- %c\n" # , c-format +# , c-format #. 1003.2 specifies the format of this message. #: support/getopt.c:807 support/getopt.c:937 msgid "%s: option requires an argument -- %c\n" msgstr "%s: op\347\343o requer um argumento -- %c\n" # , c-format +# , c-format #: support/getopt.c:854 msgid "%s: option `-W %s' is ambiguous\n" msgstr "%s: op\347\343o `-W %s' \351 amb\355gua\n" +# , c-format # , c-format #: support/getopt.c:872 msgid "%s: option `-W %s' doesn't allow an argument\n" Binary files gnome-libs-0.26/po/sv.gmo and gnome-libs-0.27/po/sv.gmo differ diff -uNr gnome-libs-0.26/po/sv.po gnome-libs-0.27/po/sv.po --- gnome-libs-0.26/po/sv.po Tue Aug 4 08:05:58 1998 +++ gnome-libs-0.27/po/sv.po Thu Aug 13 19:56:26 1998 @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: gnome-libs-0.20\n" -"POT-Creation-Date: 1998-04-29 15:16+0200\n" +"POT-Creation-Date: 1998-08-06 13:45-0500\n" "PO-Revision-Date: 1998-05-04 12:00+0100\n" "Last-Translator: Martin Wahlen \n" "Language-Team: Swedish \n" @@ -14,132 +14,212 @@ "Content-Type: text/plain; charset=iso-8859-1\n" "Content-Transfer-Encoding: 8-bit\n" -#: libgnomeui/gnome-about.c:193 -msgid "Author:" -msgstr "Författare:" +#: gnome-hello/gnome-hello-2-i18n.c:31 gnome-hello/gnome-hello-3-parse-args.c:33 +msgid "File/Exit" +msgstr "Fil/Avsluta" -#: libgnomeui/gnome-about.c:195 libgnomeui/gnome-about.c:197 -msgid "Authors:" -msgstr "Författare:" +#: gnome-hello/gnome-hello-2-i18n.c:31 gnome-hello/gnome-hello-3-parse-args.c:33 +msgid "E" +msgstr "E" -#: libgnomeui/gnome-about.c:357 -msgid "Authors: " -msgstr "Författare:" +#. The '...' end indicate that the options open a dialog +#: gnome-hello/gnome-hello-2-i18n.c:33 gnome-hello/gnome-hello-3-parse-args.c:35 +msgid "Help/About..." +msgstr "Hj\344lp/Om..." -#: libgnomeui/gnome-about.c:550 -msgid "About" -msgstr "Om" +#: gnome-hello/gnome-hello-2-i18n.c:33 gnome-hello/gnome-hello-3-parse-args.c:35 +msgid "A" +msgstr "A" -#: libgnomeui/gnome-file-entry.c:90 -msgid "Select file" -msgstr "Välj fil" +#. Make the main window and binds the delete event so you can close +#. the program from your WM +#: gnome-hello/gnome-hello-2-i18n.c:69 gnome-hello/gnome-hello-3-parse-args.c:99 gnome-hello/gnome-hello-4-SM.c:197 +msgid "Hello World Gnomified" +msgstr "GNOMEifierad Hej V\344rld" -#: libgnomeui/gnome-file-entry.c:147 -msgid "Browse..." -msgstr "Bläddra..." +#. We make a button, bind the 'clicked' signal to hello and setting it +#. to be the content of the main window +#: gnome-hello/gnome-hello-2-i18n.c:83 gnome-hello/gnome-hello-3-parse-args.c:113 gnome-hello/gnome-hello-4-SM.c:213 +msgid "Hello GNOME" +msgstr "Hej GNOME" -#: libgnomeui/gnome-messagebox.c:95 -msgid "Information" -msgstr "Information" +#: gnome-hello/gnome-hello-2-i18n.c:102 gnome-hello/gnome-hello-3-parse-args.c:132 gnome-hello/gnome-hello-4-SM.c:232 +msgid "Hello GNOME\n" +msgstr "Hej GNOME\n" -#: libgnomeui/gnome-messagebox.c:101 -msgid "Warning" -msgstr "Varning" +#: gnome-hello/gnome-hello-2-i18n.c:125 gnome-hello/gnome-hello-3-parse-args.c:155 gnome-hello/gnome-hello-4-SM.c:255 +msgid "The Hello World Gnomified" +msgstr "GNOMEifierad Hej V\344rld" -#: libgnomeui/gnome-messagebox.c:107 -msgid "Error" -msgstr "Fel" +#. another comments +#: gnome-hello/gnome-hello-2-i18n.c:130 gnome-hello/gnome-hello-3-parse-args.c:160 gnome-hello/gnome-hello-4-SM.c:260 +msgid "GNOME is a civilized software system so we've a \"hello world\" program" +msgstr "GNOME \344r ett civiliserat programvarusystem s\345 vi har ett \"Hej v\344rld\" program" -#: libgnomeui/gnome-messagebox.c:113 -msgid "Question" -msgstr "Fråga" +#: gnome-hello/gnome-hello-3-parse-args.c:43 +msgid "Run silently" +msgstr "K\366r tyst" -#: libgnomeui/gnome-messagebox.c:119 -msgid "Message" -msgstr "Meddelande" +#: gnome-hello/gnome-hello-4-SM.c:54 gnome-hello/gnome-hello-7-mdi.c:356 +msgid "Exit" +msgstr "Avsluta" + +#: gnome-hello/gnome-hello-4-SM.c:54 +msgid "Exit GNOME hello" +msgstr "Avsluta hej GNOME" -#: libgnomeui/gnome-init.c:42 +#: gnome-hello/gnome-hello-4-SM.c:66 gnome-hello/gnome-hello-7-mdi.c:398 +msgid "About..." +msgstr "Om..." + +#: gnome-hello/gnome-hello-4-SM.c:66 +msgid "Info about GNOME hello" +msgstr "Information om hej GNOME" + +#. and document menu and document list paths (see gnome-app-helper menu +#. insertion routines for details) +#: gnome-hello/gnome-hello-4-SM.c:78 gnome-hello/gnome-hello-7-mdi.c:362 gnome-hello/gnome-hello-7-mdi.c:437 libgnomeui/stock_demo.c:212 +msgid "File" +msgstr "Arkiv" + +#: gnome-hello/gnome-hello-4-SM.c:79 gnome-hello/gnome-hello-7-mdi.c:404 libgnomeui/gnome-stock.c:720 libgnomeui/stock_demo.c:342 +msgid "Help" +msgstr "Hj\344lp" + +#: gnome-hello/gnome-hello-4-SM.c:91 libgnomeui/gnome-client.c:171 libgnomeui/gnome-client.c:173 +msgid "ID" +msgstr "ID" + +#: gnome-hello/gnome-hello-4-SM.c:91 +msgid "Discard session" +msgstr "Avbryt sessionen" + +#: gnome-hello/gnome-hello-7-mdi.c:180 +msgid "Add View" +msgstr "" + +#: gnome-hello/gnome-hello-7-mdi.c:185 +msgid "Remove View" +msgstr "" + +#: gnome-hello/gnome-hello-7-mdi.c:191 +msgid "Child" +msgstr "" + +#: gnome-hello/gnome-hello-7-mdi.c:340 +msgid "Add Child" +msgstr "" + +#: gnome-hello/gnome-hello-7-mdi.c:346 +msgid "Remove Child" +msgstr "" + +#: gnome-hello/gnome-hello-7-mdi.c:371 +msgid "Notebook" +msgstr "" + +#: gnome-hello/gnome-hello-7-mdi.c:377 +msgid "Toplevel" +msgstr "" + +#: gnome-hello/gnome-hello-7-mdi.c:383 +msgid "Modal" +msgstr "" + +#: gnome-hello/gnome-hello-7-mdi.c:389 +msgid "MDI Mode" +msgstr "" + +#: gnome-hello/gnome-hello-7-mdi.c:438 +msgid "Children/" +msgstr "" + +# , fuzzy +#: libgnome/gnome-parse.c:44 msgid "" "\n" -"Gtk toolkit options" +"Generic options" msgstr "" "\n" -"Gtk inställningar" +"Gtk inst\344llningar" -#: libgnomeui/gnome-init.c:45 -msgid "DISPLAY" -msgstr "DISPLAY" +#: libgnomeui/gnome-about.c:201 +msgid "Author:" +msgstr "F\366rfattare:" -#: libgnomeui/gnome-init.c:45 -msgid "X display to use" -msgstr "X-display som skall användas" +#: libgnomeui/gnome-about.c:203 libgnomeui/gnome-about.c:205 +msgid "Authors:" +msgstr "F\366rfattare:" -#: libgnomeui/gnome-init.c:47 -msgid "Don't use X shared memory extension" -msgstr "Använd inte X-utbyggnad till minnesdelning" +#: libgnomeui/gnome-about.c:365 +msgid "Authors: " +msgstr "F\366rfattare:" -#: libgnomeui/gnome-init.c:48 -msgid "NAME" -msgstr "NAMN" +#: libgnomeui/gnome-about.c:575 libgnomeui/stock_demo.c:331 +msgid "About" +msgstr "Om" -#: libgnomeui/gnome-init.c:48 libgnomeui/gnome-init.c:49 libgnomeui/gnome-init.c:50 libgnomeui/gnome-init.c:51 libgnomeui/gnome-init.c:52 libgnomeui/gnome-init.c:53 -msgid "FIXME" -msgstr "FIXAMIG" +#: libgnomeui/gnome-app-util.c:86 +msgid " (press return)" +msgstr "" -#: libgnomeui/gnome-init.c:49 -msgid "CLASS" -msgstr "KLASS" +#: libgnomeui/gnome-app-util.c:114 +msgid "ERROR: " +msgstr "" -#: libgnomeui/gnome-init.c:50 -msgid "HOST" -msgstr "VÄRD" +# , fuzzy +#: libgnomeui/gnome-app-util.c:136 +msgid "Warning: " +msgstr "Varning" -#: libgnomeui/gnome-init.c:51 -msgid "PORT" -msgstr "PORT" +#: libgnomeui/gnome-app-util.c:242 +msgid "y" +msgstr "" -#: libgnomeui/gnome-init.c:52 libgnomeui/gnome-init.c:53 -msgid "STYLE" -msgstr "STIL" +# , fuzzy +#: libgnomeui/gnome-app-util.c:243 +msgid "yes" +msgstr "Ja" -#: gnome-hello/gnome-hello-4-SM.c:91 libgnomeui/gnome-client.c:170 libgnomeui/gnome-client.c:172 -msgid "ID" -msgstr "ID" +#: libgnomeui/gnome-app-util.c:246 +msgid "n" +msgstr "" -#: libgnomeui/gnome-client.c:171 -msgid "Specify session management id" -msgstr "Specificera id för sessionskontroll" +#: libgnomeui/gnome-app-util.c:247 +msgid "no" +msgstr "" -#: libgnomeui/gnome-client.c:173 -msgid "Specify id of cloned client" -msgstr "Specificera id för klonad klient" +#: libgnomeui/gnome-app-util.c:286 +msgid " (yes or no)" +msgstr "" -#: libgnomeui/gnome-client.c:175 -msgid "Disable connection to session manager" -msgstr "Stäng av koppling till sessionskontrolleraren" +#: libgnomeui/gnome-app-util.c:287 +msgid " - OK? (yes or no)" +msgstr "" -#: libgnomeui/gnome_segv.c:58 -msgid "" -"No, and ignore\n" -"future SIGSEGV's" +#: libgnomeui/gnome-app-util.c:520 +msgid "Progress" msgstr "" -"Nej, og ignorera\n" -"segmenteringsfel(SIGSEGV) i framtiden" -#: libgnomeui/gnome_segv.c:68 -# , c-format -msgid "" -"Application \"%s\" has a bug.\n" -"SIGSEGV received at PC %#lx in PID %d.\n" -"\n" -"\n" -"Do you want to exit this program?" +#: libgnomeui/gnome-app.c:355 libgnomeui/gnome-app.c:380 +msgid "Top" +msgstr "" + +#: libgnomeui/gnome-app.c:356 libgnomeui/gnome-app.c:381 +msgid "Bottom" +msgstr "" + +#: libgnomeui/gnome-app.c:382 +msgid "Left" +msgstr "" + +#: libgnomeui/gnome-app.c:383 +msgid "Right" +msgstr "" + +#: libgnomeui/gnome-app.c:384 +msgid "Configure toolbar" msgstr "" -"Applikationen \"%s\" har ett fel.\n" -"Segmenteringsfel(SIGSEGV) har mottagits på PC %#lx i PID %d.\n" -"\n" -"\n" -"Vill du avsluta det programmet?" #: libgnomeui/gnome-calculator.c:908 libgnomeui/gnome-calculator.c:1068 msgid "DEG" @@ -305,214 +385,526 @@ msgid "=" msgstr "" -#: libgnomeui/gnome-calculator.c:1191 +#: libgnomeui/gnome-calculator.c:1194 msgid "INV" msgstr "" -#: support/argp-parse.c:90 -msgid "Give this help list" -msgstr "Ge denna hjälplistan" +#: libgnomeui/gnome-client.c:172 +msgid "Specify session management id" +msgstr "Specificera id f\366r sessionskontroll" -#: support/argp-parse.c:91 -msgid "Give a short usage message" -msgstr "Ge en kort användningsbeskrivning" +#: libgnomeui/gnome-client.c:174 +msgid "Specify id of cloned client" +msgstr "Specificera id f\366r klonad klient" -#: support/argp-parse.c:92 -msgid "Set the program name" -msgstr "Sätt programnamnet" +#: libgnomeui/gnome-client.c:176 +msgid "Disable connection to session manager" +msgstr "St\344ng av koppling till sessionskontrolleraren" -#: support/argp-parse.c:94 -msgid "Hang for SECS seconds (default 3600)" -msgstr "Vänta i SEK sekunder (standard 3600)" +# , fuzzy +#: libgnomeui/gnome-dateedit.c:393 +msgid "Calendar" +msgstr "Radera" -#: support/argp-parse.c:151 -msgid "Print program version" -msgstr "Skriv ut programversionen" +#: libgnomeui/gnome-dentry-edit.c:164 +msgid "Name:" +msgstr "" -#: support/argp-parse.c:167 -msgid "(PROGRAM ERROR) No version known!?" -msgstr "(PROGRAM-FEL) Okänd version!?" +#: libgnomeui/gnome-dentry-edit.c:177 +msgid "Comment:" +msgstr "" -#: support/argp-parse.c:641 -# , c-format -msgid "%s: Too many arguments\n" -msgstr "%s: För månge argument\n" +#: libgnomeui/gnome-dentry-edit.c:187 +msgid "Command:" +msgstr "" -#: support/argp-parse.c:780 -msgid "(PROGRAM ERROR) Option should have been recognized!?" -msgstr "(PROGRAM-FEL) Flaggan borde bli igenkänd!?" +#: libgnomeui/gnome-dentry-edit.c:197 +msgid "Type:" +msgstr "" -#: support/argp-help.c:186 -# , c-format -msgid "%.*s: ARGP_HELP_FMT parameter requires a value" -msgstr "%.*s: ARGP_HELP_FMT parameteren måste ha ett värde" +#: libgnomeui/gnome-dentry-edit.c:231 +msgid "Run in Terminal" +msgstr "" -#: support/argp-help.c:195 -# , c-format -msgid "%.*s: Unknown ARGP_HELP_FMT parameter" -msgstr "%.*s: Okänd ARGP_HELP_FMT parameter" +#: libgnomeui/gnome-dentry-edit.c:245 +msgid "Try this before using:" +msgstr "" -#: support/argp-help.c:207 -# , c-format -msgid "Garbage in ARGP_HELP_FMT: %s" -msgstr "Skräp i ARGP_HELP_FMT: %s" +#: libgnomeui/gnome-dentry-edit.c:255 +msgid "Documentation:" +msgstr "" + +#: libgnomeui/gnome-dentry-edit.c:305 +msgid "Easy" +msgstr "" -#: support/argp-help.c:1147 -msgid "Mandatory or optional arguments to long options are also mandatory or optional for any corresponding short options." -msgstr "Obligatoriska eller valfria argument till långa flaggor är också obligatoriska eller valgfria for motsvarande korta flaggor." +#: libgnomeui/gnome-dentry-edit.c:309 +msgid "Advanced" +msgstr "" -#: support/argp-help.c:1523 -msgid "Usage:" -msgstr "Användning:" +#: libgnomeui/gnome-dentry-edit.c:542 +msgid "" +"No\n" +"icon" +msgstr "" -#: support/argp-help.c:1527 -msgid " or: " -msgstr " eller: " +#: libgnomeui/gnome-dentry-edit.c:557 +msgid "" +"Couldn't\n" +"load\n" +"icon" +msgstr "" -#: support/argp-help.c:1539 -msgid " [OPTION...]" -msgstr " [FLAGGA...]" +#: libgnomeui/gnome-dentry-edit.c:603 +msgid "Choose an icon" +msgstr "" -#: support/argp-help.c:1566 -# , c-format -msgid "Try `%s --help' or `%s --usage' for more information.\n" -msgstr "Pröva `%s --help' eller `%s --usage' for mer information.\n" +#: libgnomeui/gnome-file-entry.c:90 +msgid "Select file" +msgstr "V\344lj fil" -#: support/argp-help.c:1594 -# , c-format -msgid "Report bugs to %s.\n" -msgstr "Rapportera fel till %s.\n" +#: libgnomeui/gnome-file-entry.c:147 +msgid "Browse..." +msgstr "Bl\344ddra..." + +#: libgnomeui/gnome-icon-sel.c:245 +msgid "Loading Icons..." +msgstr "" + +#: libgnomeui/gnome-init.c:48 +msgid "" +"\n" +"Gtk toolkit options" +msgstr "" +"\n" +"Gtk inst\344llningar" + +#: libgnomeui/gnome-init.c:51 +msgid "DISPLAY" +msgstr "DISPLAY" + +#: libgnomeui/gnome-init.c:51 +msgid "X display to use" +msgstr "X-display som skall anv\344ndas" + +#: libgnomeui/gnome-init.c:53 +msgid "Don't use X shared memory extension" +msgstr "Anv\344nd inte X-utbyggnad till minnesdelning" + +#: libgnomeui/gnome-init.c:54 +msgid "NAME" +msgstr "NAMN" + +#: libgnomeui/gnome-init.c:54 libgnomeui/gnome-init.c:55 libgnomeui/gnome-init.c:56 libgnomeui/gnome-init.c:57 libgnomeui/gnome-init.c:58 libgnomeui/gnome-init.c:59 +msgid "FIXME" +msgstr "FIXAMIG" + +#: libgnomeui/gnome-init.c:55 +msgid "CLASS" +msgstr "KLASS" + +#: libgnomeui/gnome-init.c:56 +msgid "HOST" +msgstr "V\304RD" + +#: libgnomeui/gnome-init.c:57 +msgid "PORT" +msgstr "PORT" + +#: libgnomeui/gnome-init.c:58 libgnomeui/gnome-init.c:59 +msgid "STYLE" +msgstr "STIL" + +#: libgnomeui/gnome-messagebox.c:95 +msgid "Information" +msgstr "Information" + +#: libgnomeui/gnome-messagebox.c:101 +msgid "Warning" +msgstr "Varning" + +#: libgnomeui/gnome-messagebox.c:107 +msgid "Error" +msgstr "Fel" + +#: libgnomeui/gnome-messagebox.c:113 +msgid "Question" +msgstr "Fr\345ga" + +#: libgnomeui/gnome-messagebox.c:119 +msgid "Message" +msgstr "Meddelande" + +#: libgnomeui/gnome-number-entry.c:124 +msgid "Calculator" +msgstr "" + +#: libgnomeui/gnome-number-entry.c:171 +msgid "Calculator..." +msgstr "" + +#: libgnomeui/gnome-scores.c:72 +msgid "Top Ten" +msgstr "Tio i topp" -#: libgnomeui/gnome-scores.c:82 +#: libgnomeui/gnome-scores.c:83 msgid "User" -msgstr "Användare" +msgstr "Anv\344ndare" -#: libgnomeui/gnome-scores.c:85 +#: libgnomeui/gnome-scores.c:86 msgid "Score" msgstr "Resultat" -#: libgnomeui/gnome-scores.c:88 +#: libgnomeui/gnome-scores.c:89 msgid "Date" msgstr "Datum" -#: libgnomeui/gnome-scores.c:124 -msgid "Clear" -msgstr "Radera" - -#: libgnomeui/gnome-scores.c:141 -msgid "Top Ten" -msgstr "Tio i topp" - -#: libgnomeui/gnome-stock.c:485 +#: libgnomeui/gnome-stock.c:714 msgid "OK" msgstr "OK" -#: libgnomeui/gnome-stock.c:486 +#: libgnomeui/gnome-stock.c:715 msgid "Apply" -msgstr "Använd" +msgstr "Anv\344nd" -#: libgnomeui/gnome-stock.c:487 +#: libgnomeui/gnome-stock.c:716 msgid "Cancel" msgstr "Avbryt" -#: libgnomeui/gnome-stock.c:488 +#: libgnomeui/gnome-stock.c:717 libgnomeui/stock_demo.c:163 msgid "Close" -msgstr "Stäng" +msgstr "St\344ng" -#: libgnomeui/gnome-stock.c:489 +#: libgnomeui/gnome-stock.c:718 msgid "Yes" msgstr "Ja" -#: libgnomeui/gnome-stock.c:490 +#: libgnomeui/gnome-stock.c:719 msgid "No" msgstr "Nej" -#: gnome-hello/gnome-hello-4-SM.c:79 libgnomeui/gnome-stock.c:491 -msgid "Help" -msgstr "Hjälp" +#: libgnomeui/gnome-stock.c:721 +msgid "Next" +msgstr "" -#: libgnomeui/gnome-stock.c:1401 +#: libgnomeui/gnome-stock.c:722 +msgid "Prev" +msgstr "" + +#: libgnomeui/gnome-stock.c:1646 msgid "Menu Accelerator Keys" msgstr "Meny-accelerator tangenter" -#: libgnomeui/gnome-stock.c:1403 +#: libgnomeui/gnome-stock.c:1648 msgid "Global" msgstr "Global" -#: libgnomeui/gnome-stock.c:1405 +#: libgnomeui/gnome-stock.c:1650 msgid "Menu Item" msgstr "Menyval" -#: libgnomeui/gnome-stock.c:1406 +#: libgnomeui/gnome-stock.c:1651 msgid "Accelerator" msgstr "Accelerator" -#: gnome-hello/gnome-hello-2-i18n.c:31 gnome-hello/gnome-hello-3-parse-args.c:33 -msgid "File/Exit" -msgstr "Fil/Avsluta" +#: libgnomeui/gnome_segv.c:58 +msgid "" +"No, and ignore\n" +"future SIGSEGV's" +msgstr "" +"Nej, og ignorera\n" +"segmenteringsfel(SIGSEGV) i framtiden" -#: gnome-hello/gnome-hello-2-i18n.c:31 gnome-hello/gnome-hello-3-parse-args.c:33 -msgid "E" -msgstr "E" +# , c-format +# , c-format +#: libgnomeui/gnome_segv.c:68 +msgid "" +"Application \"%s\" has a bug.\n" +"SIGSEGV received at PC %#lx in PID %d.\n" +"\n" +"\n" +"Do you want to exit this program?" +msgstr "" +"Applikationen \"%s\" har ett fel.\n" +"Segmenteringsfel(SIGSEGV) har mottagits p\345 PC %#lx i PID %d.\n" +"\n" +"\n" +"Vill du avsluta det programmet?" -#. The '...' end indicate that the options open a dialog -#: gnome-hello/gnome-hello-2-i18n.c:33 gnome-hello/gnome-hello-3-parse-args.c:35 -msgid "Help/About..." -msgstr "Hjälp/Om..." +#: libgnomeui/stock_demo.c:119 +msgid "New..." +msgstr "" -#: gnome-hello/gnome-hello-2-i18n.c:33 gnome-hello/gnome-hello-3-parse-args.c:35 -msgid "A" -msgstr "A" +#: libgnomeui/stock_demo.c:130 +msgid "Open..." +msgstr "" -#. Make the main window and binds the delete event so you can close -#. the program from your WM -#: gnome-hello/gnome-hello-2-i18n.c:69 gnome-hello/gnome-hello-3-parse-args.c:99 gnome-hello/gnome-hello-4-SM.c:197 -msgid "Hello World Gnomified" -msgstr "GNOMEifierad Hej Värld" +#: libgnomeui/stock_demo.c:141 +msgid "Save" +msgstr "" -#. We make a button, bind the 'clicked' signal to hello and setting it -#. to be the content of the main window -#: gnome-hello/gnome-hello-2-i18n.c:83 gnome-hello/gnome-hello-3-parse-args.c:113 gnome-hello/gnome-hello-4-SM.c:213 -msgid "Hello GNOME" -msgstr "Hej GNOME" +#: libgnomeui/stock_demo.c:152 +msgid "Save as..." +msgstr "" -#: gnome-hello/gnome-hello-2-i18n.c:102 gnome-hello/gnome-hello-3-parse-args.c:132 gnome-hello/gnome-hello-4-SM.c:232 -msgid "Hello GNOME\n" -msgstr "Hej GNOME\n" +#: libgnomeui/stock_demo.c:178 +msgid "Print..." +msgstr "" -#: gnome-hello/gnome-hello-2-i18n.c:125 gnome-hello/gnome-hello-3-parse-args.c:155 gnome-hello/gnome-hello-4-SM.c:255 -msgid "The Hello World Gnomified" -msgstr "GNOMEifierad Hej Värld" +#: libgnomeui/stock_demo.c:189 +msgid "Setup Page..." +msgstr "" -#. another comments -#: gnome-hello/gnome-hello-2-i18n.c:130 gnome-hello/gnome-hello-3-parse-args.c:160 gnome-hello/gnome-hello-4-SM.c:260 -msgid "GNOME is a civilized software system so we've a \"hello world\" program" -msgstr "GNOME är ett civiliserat programvarusystem så vi har ett \"Hej värld\" program" +#: libgnomeui/stock_demo.c:198 +msgid "Quit" +msgstr "" -#: gnome-hello/gnome-hello-3-parse-args.c:43 -msgid "Run silently" -msgstr "Kör tyst" +#: libgnomeui/stock_demo.c:219 +msgid "Undo" +msgstr "" -#: gnome-hello/gnome-hello-4-SM.c:54 -msgid "Exit" +#: libgnomeui/stock_demo.c:230 +msgid "Redo" +msgstr "" + +#: libgnomeui/stock_demo.c:239 +msgid "Delete" +msgstr "" + +#: libgnomeui/stock_demo.c:244 +msgid "Cut" +msgstr "" + +#: libgnomeui/stock_demo.c:255 +msgid "Copy" +msgstr "" + +# , fuzzy +#: libgnomeui/stock_demo.c:266 +msgid "Paste" +msgstr "Datum" + +#: libgnomeui/stock_demo.c:281 +msgid "Properties..." +msgstr "" + +#: libgnomeui/stock_demo.c:294 +msgid "Preferences..." +msgstr "" + +# , fuzzy +#: libgnomeui/stock_demo.c:312 +msgid "Scores..." +msgstr "Resultat" + +# , fuzzy +#: libgnomeui/stock_demo.c:323 +msgid "Edit" msgstr "Avsluta" -#: gnome-hello/gnome-hello-4-SM.c:54 -msgid "Exit GNOME hello" -msgstr "Avsluta hej GNOME" +# , c-format +#: libvfs/extfs.c:268 +msgid "" +"Couldn't open %s archive\n" +"%s" +msgstr "" -#: gnome-hello/gnome-hello-4-SM.c:66 -msgid "About..." -msgstr "Om..." +#: libvfs/extfs.c:300 libvfs/extfs.c:320 +msgid "Inconsistent extfs archive" +msgstr "" -#: gnome-hello/gnome-hello-4-SM.c:66 -msgid "Info about GNOME hello" -msgstr "Information om hej GNOME" +# , c-format +#: libvfs/ftpfs.c:602 +msgid " Could not set source routing (%s)" +msgstr "" -#: gnome-hello/gnome-hello-4-SM.c:78 -msgid "File" -msgstr "Arkiv" +#: libvfs/ftpfs.c:2783 libvfs/ftpfs.c:2798 +msgid "" +"~/.netrc file has not correct mode.\n" +"Remove password or correct mode." +msgstr "" -#: gnome-hello/gnome-hello-4-SM.c:91 -msgid "Discard session" -msgstr "Avbryt sessionen" +#: libvfs/mcfs.c:156 +msgid " MCFS " +msgstr "" + +#: libvfs/mcfs.c:156 +msgid " The server does not support this version " +msgstr "" + +# , fuzzy +#: libvfs/mcfs.c:172 +msgid " Warning " +msgstr "Varning" + +#: libvfs/mcfs.c:173 +msgid "" +" The remote server is not running on a system port \n" +" you need a password to log in, but the information may \n" +" not be safe on the remote side. Continue? \n" +msgstr "" + +# , fuzzy +#: libvfs/mcfs.c:176 +msgid " Yes " +msgstr "Ja" + +# , fuzzy +#: libvfs/mcfs.c:176 +msgid " No " +msgstr "Nej" + +#: libvfs/mcfs.c:178 +msgid " The remote server is running on strange port. Giving up.\n" +msgstr "" + +#: libvfs/mcfs.c:190 +msgid " MCFS Password required " +msgstr "" + +#: libvfs/mcfs.c:204 +msgid " Invalid password " +msgstr "" + +#: libvfs/mcfs.c:270 +msgid " Too many open connections " +msgstr "" + +#: libvfs/tar.c:586 +msgid "Unexpected EOF on archive file" +msgstr "" + +#: libvfs/tar.c:640 libvfs/tar.c:661 +msgid "Inconsistent tar archive" +msgstr "" + +# , c-format +#: libvfs/tar.c:761 +msgid "" +"Couldn't open tar archive\n" +"%s" +msgstr "" + +# , c-format +#. Error on first record +#: libvfs/tar.c:780 +msgid "" +"Hmm,...\n" +"%s\n" +"doesn't look like a tar archive." +msgstr "" + +#: libvfs/vfs.c:1538 +msgid "Password:" +msgstr "" + +#: support/argp-parse.c:90 +msgid "Give this help list" +msgstr "Ge denna hj\344lplistan" + +#: support/argp-parse.c:91 +msgid "Give a short usage message" +msgstr "Ge en kort anv\344ndningsbeskrivning" + +#: support/argp-parse.c:92 +msgid "Set the program name" +msgstr "S\344tt programnamnet" + +#: support/argp-parse.c:94 +msgid "Hang for SECS seconds (default 3600)" +msgstr "V\344nta i SEK sekunder (standard 3600)" + +#: support/argp-parse.c:151 +msgid "Print program version" +msgstr "Skriv ut programversionen" + +#: support/argp-parse.c:167 +msgid "(PROGRAM ERROR) No version known!?" +msgstr "(PROGRAM-FEL) Ok\344nd version!?" + +# , c-format +# , c-format +#: support/argp-parse.c:641 +msgid "%s: Too many arguments\n" +msgstr "%s: F\366r m\345nge argument\n" + +#: support/argp-parse.c:780 +msgid "(PROGRAM ERROR) Option should have been recognized!?" +msgstr "(PROGRAM-FEL) Flaggan borde bli igenk\344nd!?" + +#: support/error.c:109 +msgid "Unknown system error" +msgstr "" + +# , c-format +#: support/getopt.c:669 +msgid "%s: option `%s' is ambiguous\n" +msgstr "" + +# , c-format +#. --option +#: support/getopt.c:693 +msgid "%s: option `--%s' doesn't allow an argument\n" +msgstr "" + +# , c-format +#: support/getopt.c:698 +msgid "%s: option `%c%s' doesn't allow an argument\n" +msgstr "" + +# , c-format +# , fuzzy, c-format +#: support/getopt.c:715 support/getopt.c:888 +msgid "%s: option `%s' requires an argument\n" +msgstr "%s: F\366r m\345nge argument\n" + +# , c-format +#. --option +#: support/getopt.c:744 +msgid "%s: unrecognized option `--%s'\n" +msgstr "" + +# , c-format +#: support/getopt.c:748 +msgid "%s: unrecognized option `%c%s'\n" +msgstr "" + +# , c-format +#. 1003.2 specifies the format of this message. +#: support/getopt.c:774 +msgid "%s: illegal option -- %c\n" +msgstr "" + +# , c-format +#: support/getopt.c:777 +msgid "%s: invalid option -- %c\n" +msgstr "" + +# , c-format +# , fuzzy, c-format +#. 1003.2 specifies the format of this message. +#: support/getopt.c:807 support/getopt.c:937 +msgid "%s: option requires an argument -- %c\n" +msgstr "%s: F\366r m\345nge argument\n" + +# , c-format +#: support/getopt.c:854 +msgid "%s: option `-W %s' is ambiguous\n" +msgstr "" + +# , c-format +#: support/getopt.c:872 +msgid "%s: option `-W %s' doesn't allow an argument\n" +msgstr "" + +#: test-gnome/testgnome.c:551 +msgid "The user chose Yes/OK with data:\n" +msgstr "" + +#: test-gnome/testgnome.c:555 +msgid "The user chose No/Cancel with data:\n" +msgstr "" + +#: test-gnome/testgnome.c:566 +msgid "Weird number in reply callback" +msgstr "" diff -uNr gnome-libs-0.26/test-gnome/canvas-primitives.c gnome-libs-0.27/test-gnome/canvas-primitives.c --- gnome-libs-0.26/test-gnome/canvas-primitives.c Tue Aug 4 13:15:13 1998 +++ gnome-libs-0.27/test-gnome/canvas-primitives.c Tue Aug 11 11:28:19 1998 @@ -74,6 +74,7 @@ case GDK_BUTTON_RELEASE: gnome_canvas_item_ungrab (item, event->button.time); dragging = FALSE; + break; default: break; diff -uNr gnome-libs-0.26/test-suite/ChangeLog gnome-libs-0.27/test-suite/ChangeLog --- gnome-libs-0.26/test-suite/ChangeLog Thu Jul 30 07:45:59 1998 +++ gnome-libs-0.27/test-suite/ChangeLog Fri Aug 7 14:46:13 1998 @@ -1,3 +1,7 @@ +1998-08-06 Raja R Harinath + + * Makefile.am (EXTRA_DIST): List tests/* and expected/*. + 1998-07-30 Christopher Blizzard * .cvsignore: Add .deps dir diff -uNr gnome-libs-0.26/test-suite/Makefile.am gnome-libs-0.27/test-suite/Makefile.am --- gnome-libs-0.26/test-suite/Makefile.am Mon Aug 3 09:46:23 1998 +++ gnome-libs-0.27/test-suite/Makefile.am Fri Aug 7 14:46:13 1998 @@ -26,4 +26,9 @@ LDADD="$(LDADD)" \ $(SHELL) -EXTRA_DIST = $(TESTS) +EXTRA_DIST = $(TESTS) \ + tests/fileconvert.c tests/fileconvert.in tests/lynxdump.sh \ + tests/types.cvt expected/fileconvert.out \ + tests/skel.c expected/skel.out \ + tests/split.c expected/split.out \ + tests/trigs.c tests/trigs.in expected/trigs.out diff -uNr gnome-libs-0.26/test-suite/Makefile.in gnome-libs-0.27/test-suite/Makefile.in --- gnome-libs-0.26/test-suite/Makefile.in Thu Aug 6 13:13:21 1998 +++ gnome-libs-0.27/test-suite/Makefile.in Thu Aug 13 19:56:48 1998 @@ -149,7 +149,12 @@ LDADD="$(LDADD)" \ $(SHELL) -EXTRA_DIST = $(TESTS) +EXTRA_DIST = $(TESTS) \ + tests/fileconvert.c tests/fileconvert.in tests/lynxdump.sh \ + tests/types.cvt expected/fileconvert.out \ + tests/skel.c expected/skel.out \ + tests/split.c expected/split.out \ + tests/trigs.c tests/trigs.in expected/trigs.out mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = ../config.h CONFIG_CLEAN_FILES = @@ -270,6 +275,7 @@ subdir = test-suite distdir: $(DISTFILES) + $(mkinstalldirs) $(distdir)/expected $(distdir)/tests @for file in $(DISTFILES); do \ d=$(srcdir); \ test -f $(distdir)/$$file \ diff -uNr gnome-libs-0.26/test-suite/expected/fileconvert.out gnome-libs-0.27/test-suite/expected/fileconvert.out --- gnome-libs-0.26/test-suite/expected/fileconvert.out Wed Dec 31 19:00:00 1969 +++ gnome-libs-0.27/test-suite/expected/fileconvert.out Thu Jul 23 14:08:44 1998 @@ -0,0 +1,9 @@ + + This is a [1]test of the file conversion routines. + + +References + + 1. file://localhost/THISFILE.html#foo + +Exit code 0 diff -uNr gnome-libs-0.26/test-suite/expected/skel.out gnome-libs-0.27/test-suite/expected/skel.out --- gnome-libs-0.26/test-suite/expected/skel.out Wed Dec 31 19:00:00 1969 +++ gnome-libs-0.27/test-suite/expected/skel.out Thu Jul 23 14:08:44 1998 @@ -0,0 +1 @@ +Exit code 0 diff -uNr gnome-libs-0.26/test-suite/expected/split.out gnome-libs-0.27/test-suite/expected/split.out --- gnome-libs-0.26/test-suite/expected/split.out Wed Dec 31 19:00:00 1969 +++ gnome-libs-0.27/test-suite/expected/split.out Thu Jul 23 14:08:44 1998 @@ -0,0 +1,3 @@ +foo bar baz +foo bar:baz +Exit code 0 diff -uNr gnome-libs-0.26/test-suite/expected/trigs.out gnome-libs-0.27/test-suite/expected/trigs.out --- gnome-libs-0.26/test-suite/expected/trigs.out Wed Dec 31 19:00:00 1969 +++ gnome-libs-0.27/test-suite/expected/trigs.out Thu Jul 23 14:08:44 1998 @@ -0,0 +1,6 @@ +test one [warning] Test of direct hit +Global counter is now 1 +test one two three [warning] Test of indirect hit +Test of indirect hit warning test one two three +Global counter is now 2 +Exit code 0 diff -uNr gnome-libs-0.26/test-suite/tests/fileconvert.c gnome-libs-0.27/test-suite/tests/fileconvert.c --- gnome-libs-0.26/test-suite/tests/fileconvert.c Wed Dec 31 19:00:00 1969 +++ gnome-libs-0.27/test-suite/tests/fileconvert.c Thu Jul 23 14:08:44 1998 @@ -0,0 +1,42 @@ +#include +#include +#include +#include +#include +#include + +/* Do whatever you need to do... You should put the "expected" output of + the program in ../expected/testname.out, which will be compared against + the actual output of the test when it is run. + + A non-zero exit code also indicates failure. +*/ + +int main(int argc, char *argv[]) +{ + gint outfd, readlen = 0; + gchar abuf[128]; + gchar *fn; + + gnomelib_init("fileconvert"); + fn = g_copy_strings(getenv("srcdir"), "/tests", NULL); + chdir(fn); + chmod("lynxdump.sh", S_IXGRP|S_IXOTH|S_IXUSR|S_IRGRP|S_IROTH|S_IRUSR|S_IWUSR); + outfd = gnome_file_convert("fileconvert.in", + "text/html", + "text/ascii"); + if(outfd >= 0) return 1; + outfd = gnome_file_convert("fileconvert.in", + "text/html", + "text/plain"); + if(outfd < 0) return 1; + while((readlen = read(outfd, abuf, sizeof(abuf) - 1))) { + printf("%.*s", readlen, abuf); fflush(stdout); + } + + printf("\n"); + fflush(stdout); /* Make sure to fflush things after you do + any output, so what you see on your terminal + is the same as what goes into the output file */ + return 0; +} diff -uNr gnome-libs-0.26/test-suite/tests/fileconvert.in gnome-libs-0.27/test-suite/tests/fileconvert.in --- gnome-libs-0.26/test-suite/tests/fileconvert.in Wed Dec 31 19:00:00 1969 +++ gnome-libs-0.27/test-suite/tests/fileconvert.in Thu Jul 23 14:08:44 1998 @@ -0,0 +1,9 @@ + + + Test Page + + +This is a test of the file conversion routines. + + diff -uNr gnome-libs-0.26/test-suite/tests/lynxdump.sh gnome-libs-0.27/test-suite/tests/lynxdump.sh --- gnome-libs-0.26/test-suite/tests/lynxdump.sh Wed Dec 31 19:00:00 1969 +++ gnome-libs-0.27/test-suite/tests/lynxdump.sh Thu Jul 23 14:08:44 1998 @@ -0,0 +1,4 @@ +#!/bin/sh +cat > /tmp/.$$.html +lynx -dump /tmp/.$$.html | sed -e "s,tmp/.$$,THISFILE,g" +rm -f /tmp/.$$.html diff -uNr gnome-libs-0.26/test-suite/tests/skel.c gnome-libs-0.27/test-suite/tests/skel.c --- gnome-libs-0.26/test-suite/tests/skel.c Wed Dec 31 19:00:00 1969 +++ gnome-libs-0.27/test-suite/tests/skel.c Thu Jul 23 14:08:44 1998 @@ -0,0 +1,19 @@ +#include +#include +#include + +/* Do whatever you need to do... You should put the "expected" output of + the program in ../expected/testname.out, which will be compared against + the actual output of the test when it is run. + + A non-zero exit code also indicates failure. +*/ + +int main(int argc, char *argv[]) +{ + gnomelib_init("skel"); + fflush(stdout); /* Make sure to fflush things after you do + any output, so what you see on your terminal + is the same as what goes into the output file */ + return 0; +} diff -uNr gnome-libs-0.26/test-suite/tests/split.c gnome-libs-0.27/test-suite/tests/split.c --- gnome-libs-0.26/test-suite/tests/split.c Wed Dec 31 19:00:00 1969 +++ gnome-libs-0.27/test-suite/tests/split.c Thu Jul 23 14:08:44 1998 @@ -0,0 +1,30 @@ +#include +#include +#include + +/* Do whatever you need to do... You should put the "expected" output of + the program in ../expected/testname.out, which will be compared against + the actual output of the test when it is run. + + A non-zero exit code also indicates failure. +*/ + +int main(int argc, char *argv[]) +{ + char **output; + int i; + gnomelib_init("split"); + output = gnome_string_split("foo:bar:baz", ":", -1); + for(i = 0; output[i]; i++) { + g_print("%s ", output[i]); + g_free(output[i]); + } + g_print("\n"); g_free(output); + output = gnome_string_split("foo:bar:baz", ":", 2); + for(i = 0; output[i]; i++) { + g_print("%s ", output[i]); + g_free(output[i]); + } + g_print("\n"); g_free(output); + return 0; +} diff -uNr gnome-libs-0.26/test-suite/tests/trigs.c gnome-libs-0.27/test-suite/tests/trigs.c --- gnome-libs-0.26/test-suite/tests/trigs.c Wed Dec 31 19:00:00 1969 +++ gnome-libs-0.27/test-suite/tests/trigs.c Thu Jul 23 14:08:44 1998 @@ -0,0 +1,41 @@ +#include +#include +#include + +int global_cntr = 0; + +void sample_trigger_function(char *msg, char *level, char *supinfo[]) +{ + int i; + for(i = 0; supinfo[i]; i++) + g_print("%s ", supinfo[i]); + g_print("[%s] %s\n", level, msg); + fflush(stdout); + + global_cntr++; +} + +int main(int argc, char *argv[]) +{ + struct _GnomeTrigger trig; + gchar *fn; + + trig.type = GTRIG_FUNCTION; + trig.u.function = sample_trigger_function; + trig.level = NULL; + + gnomelib_init("trigs"); + fn = g_copy_strings(getenv("srcdir"), "/tests/trigs.in", NULL); + gnome_triggers_init(); + gnome_triggers_readfile(fn); + gnome_triggers_add_trigger(&trig, "test", "one", NULL); + gnome_triggers_do("Test of direct hit", "warning", "test", "one", NULL); + fflush(stdout); + g_print("Global counter is now %d\n", global_cntr); + fflush(stdout); + gnome_triggers_do("Test of indirect hit", "warning", "test", "one", "two", "three", NULL); + fflush(stdout); + g_print("Global counter is now %d\n", global_cntr); + fflush(stdout); + return 0; +} diff -uNr gnome-libs-0.26/test-suite/tests/trigs.in gnome-libs-0.27/test-suite/tests/trigs.in --- gnome-libs-0.26/test-suite/tests/trigs.in Wed Dec 31 19:00:00 1969 +++ gnome-libs-0.27/test-suite/tests/trigs.in Thu Jul 23 14:08:44 1998 @@ -0,0 +1 @@ +warning test:one:two command /bin/echo diff -uNr gnome-libs-0.26/test-suite/tests/types.cvt gnome-libs-0.27/test-suite/tests/types.cvt --- gnome-libs-0.26/test-suite/tests/types.cvt Wed Dec 31 19:00:00 1969 +++ gnome-libs-0.27/test-suite/tests/types.cvt Thu Jul 23 14:08:44 1998 @@ -0,0 +1,4 @@ +text/html text/plain ./lynxdump.sh +image/gif image/pnm giftopnm +image/pnm image/ppm +image/ppm image/xpm ppmtoxpm