Gnome2-VFS-1.082/0000755000175000017500000000000012222514155011714 5ustar lacklackGnome2-VFS-1.082/MANIFEST0000644000175000017500000000216312222514155013047 0ustar lacklackChangeLog.pre-git copyright.pod doctypes examples/downloader.pl examples/monitor.pl LICENSE Makefile.PL MANIFEST This list of files MANIFEST.SKIP maps-2.0 maps-2.6 maps-2.8 NEWS perl-Gnome2-VFS.doap perl-Gnome2-VFS.spec.in README t/GnomeVFS.t t/GnomeVFSAddress.t t/GnomeVFSApplicationRegistry t/GnomeVFSAsync t/GnomeVFSDirectory.t t/GnomeVFSDNSSD t/GnomeVFSDrive t/GnomeVFSFileInfo.t t/GnomeVFSMime t/GnomeVFSOps.t t/GnomeVFSResolve.t t/GnomeVFSURI.t t/GnomeVFSUtils.t t/GnomeVFSVolume t/GnomeVFSVolumeMonitor t/GnomeVFSXfer.t VFS.pm vfs.typemap vfs2perl.c vfs2perl.h xs/GnomeVFS.xs xs/GnomeVFSAddress.xs xs/GnomeVFSApplicationRegistry.xs xs/GnomeVFSAsync.xs xs/GnomeVFSDirectory.xs xs/GnomeVFSDNSSD.xs xs/GnomeVFSDrive.xs xs/GnomeVFSFileInfo.xs xs/GnomeVFSInit.xs xs/GnomeVFSMime.xs xs/GnomeVFSOps.xs xs/GnomeVFSResolve.xs xs/GnomeVFSURI.xs xs/GnomeVFSUtils.xs xs/GnomeVFSVolume.xs xs/GnomeVFSVolumeMonitor.xs xs/GnomeVFSXfer.xs xs_files-2.0 xs_files-2.6 xs_files-2.8 META.yml Module YAML meta-data (added by MakeMaker) META.json Module JSON meta-data (added by MakeMaker) Gnome2-VFS-1.082/xs_files-2.60000644000175000017500000000010512222506645013757 0ustar lacklackxs/GnomeVFSDrive.xs xs/GnomeVFSVolume.xs xs/GnomeVFSVolumeMonitor.xs Gnome2-VFS-1.082/vfs2perl.h0000644000175000017500000001061512222506645013640 0ustar lacklack/* * Copyright (C) 2003 by the gtk2-perl team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * $Id$ */ #ifndef _VFS2PERL_H_ #define _VFS2PERL_H_ #include #include "vfs2perl-version.h" #include #include #include #include #include #include #if VFS_CHECK_VERSION (2, 8, 0) #include #include #include #endif /* 2.8 */ /* ------------------------------------------------------------------------- */ #define GNOME_VFS_TYPE_VFS_URI (vfs2perl_gnome_vfs_uri_get_type ()) GType vfs2perl_gnome_vfs_uri_get_type (void) G_GNUC_CONST; /* ------------------------------------------------------------------------- */ #include "vfs2perl-gtypes.h" /* i'm just guessing here. if you get a message about failed assertions * that something is a GFlags type in GnomeVFSDirectory.t, then you probably * need to set this to include your version. */ #if !VFS_CHECK_VERSION (2, 1, 0) # define VFS2PERL_BROKEN_FILE_PERMISSIONS # undef GNOME_VFS_TYPE_VFS_FILE_PERMISSIONS # define GNOME_VFS_TYPE_VFS_FILE_PERMISSIONS (_vfs2perl_gnome_vfs_file_permissions_get_type ()) GType _vfs2perl_gnome_vfs_file_permissions_get_type (void) G_GNUC_CONST; #endif #include "vfs2perl-autogen.h" /* ------------------------------------------------------------------------- */ SV * newSVGnomeVFSFileSize (GnomeVFSFileSize size); GnomeVFSFileSize SvGnomeVFSFileSize (SV *size); SV * newSVGnomeVFSFileOffset (GnomeVFSFileOffset offset); GnomeVFSFileOffset SvGnomeVFSFileOffset (SV *offset); SV * newSVGnomeVFSHandle (GnomeVFSHandle *handle); GnomeVFSHandle * SvGnomeVFSHandle (SV *handle); SV * newSVGnomeVFSMonitorHandle (GnomeVFSMonitorHandle *handle); GnomeVFSMonitorHandle * SvGnomeVFSMonitorHandle (SV *handle); SV * newSVGnomeVFSDirectoryHandle (GnomeVFSDirectoryHandle *handle); GnomeVFSDirectoryHandle * SvGnomeVFSDirectoryHandle (SV *handle); SV * newSVGnomeVFSAsyncHandle (GnomeVFSAsyncHandle *handle); GnomeVFSAsyncHandle * SvGnomeVFSAsyncHandle (SV *handle); #if VFS_CHECK_VERSION (2, 8, 0) SV * newSVGnomeVFSDNSSDBrowseHandle (GnomeVFSDNSSDBrowseHandle *handle); GnomeVFSDNSSDBrowseHandle * SvGnomeVFSDNSSDBrowseHandle (SV *handle); SV * newSVGnomeVFSDNSSDResolveHandle (GnomeVFSDNSSDResolveHandle *handle); GnomeVFSDNSSDResolveHandle * SvGnomeVFSDNSSDResolveHandle (SV *handle); SV * newSVGnomeVFSResolveHandle (GnomeVFSResolveHandle *handle); GnomeVFSResolveHandle * SvGnomeVFSResolveHandle (SV *handle); #endif /* 2.8 */ typedef const char GnomeVFSApplication; const char * SvGnomeVFSApplication (SV *object); SV * newSVGnomeVFSApplication (const char *app_id); typedef const char GnomeVFSMimeType; const char * SvGnomeVFSMimeType (SV *object); SV * newSVGnomeVFSMimeType (const char *mime_type); SV * newSVGnomeVFSMimeApplication (GnomeVFSMimeApplication *application); GnomeVFSMimeApplication * SvGnomeVFSMimeApplication (SV *object); GnomeVFSFileInfo * SvGnomeVFSFileInfo (SV *object); SV * newSVGnomeVFSFileInfo (GnomeVFSFileInfo *info); SV * newSVGnomeVFSXferProgressInfo (GnomeVFSXferProgressInfo *info); /* ------------------------------------------------------------------------- */ GList * SvPVGList (SV *ref); GList * SvGnomeVFSURIGList (SV *ref); char ** SvEnvArray (SV *ref); SV * newSVGnomeVFSFileInfoGList (GList *list); SV * newSVGnomeVFSGetFileInfoResultGList (GList *list); SV * newSVGnomeVFSFindDirectoryResultGList (GList *list); /* ------------------------------------------------------------------------- */ #endif /* _VFS2PERL_H_ */ Gnome2-VFS-1.082/xs_files-2.00000644000175000017500000000034512222506645013757 0ustar lacklackxs/GnomeVFS.xs xs/GnomeVFSApplicationRegistry.xs xs/GnomeVFSAsync.xs xs/GnomeVFSDirectory.xs xs/GnomeVFSFileInfo.xs xs/GnomeVFSInit.xs xs/GnomeVFSMime.xs xs/GnomeVFSOps.xs xs/GnomeVFSURI.xs xs/GnomeVFSUtils.xs xs/GnomeVFSXfer.xs Gnome2-VFS-1.082/META.json0000644000175000017500000000170412222514155013337 0ustar lacklack{ "abstract" : "Perl interface to the 2.x series of the GNOME VFS library", "author" : [ "unknown" ], "dynamic_config" : 1, "generated_by" : "ExtUtils::MakeMaker version 6.78, CPAN::Meta::Converter version 2.132661", "license" : [ "unknown" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : "2" }, "name" : "Gnome2-VFS", "no_index" : { "directory" : [ "t", "inc" ] }, "prereqs" : { "build" : { "requires" : { "ExtUtils::MakeMaker" : "0" } }, "configure" : { "requires" : { "ExtUtils::MakeMaker" : "0" } }, "runtime" : { "requires" : { "ExtUtils::Depends" : "0.20", "ExtUtils::PkgConfig" : "1.03", "Glib" : "1.120" } } }, "release_status" : "stable", "version" : "1.082" } Gnome2-VFS-1.082/copyright.pod0000644000175000017500000000020712222506645014434 0ustar lacklackCopyright (C) 2003-2007, 2013 by the gtk2-perl team. This software is licensed under the LGPL. See L for a full notice. Gnome2-VFS-1.082/README0000644000175000017500000000126412222506645012604 0ustar lacklack Gnome2::VFS ------------- This module allows you to use the GNOME Virtual File System library (libgnomevfs for short) from Perl. The canonical API documentation can be found at http://developer.gnome.org/doc/API/2.0/gnome-vfs-2.0/index.html Gnome2::VFS also comes with automatically generated API documentation. To access its index, use: perldoc Gnome2::VFS::index Installation -------------- To install Gnome2::VFS, run the following commands: perl Makefile.PL make make test make install Dependencies -------------- Gnome2::VFS depends on: ExtUtils::Depends >= 0.20 ExtUtils::PkgConfig >= 1.03 Glib >= 1.120 libgnomevfs >= 2.0.0 Gnome2-VFS-1.082/examples/0000755000175000017500000000000012222514155013532 5ustar lacklackGnome2-VFS-1.082/examples/monitor.pl0000644000175000017500000000061412222506645015564 0ustar lacklack use strict; use warnings; use Gnome2::VFS -init; push @ARGV, "file:///tmp" unless @ARGV; foreach my $dir (@ARGV) { print STDERR "creating monitor $dir... "; my($res,$handle)= Gnome2::VFS::Monitor->add ($dir, 'directory', \&dir_cb ); print STDERR "$res\n"; } Glib::MainLoop->new->run; sub dir_cb { my $self= shift; my($dir, $file, $event)= @_; print STDERR "$event: $file in $dir\n"; } Gnome2-VFS-1.082/examples/downloader.pl0000644000175000017500000001446112222506645016240 0ustar lacklack#!/usr/bin/perl -w use Switch; use Gtk2 -init; use Gnome2::VFS -init; ############################################################################### package Gtk2::CellRendererProgress; use Glib::Object::Subclass Gtk2::CellRenderer::, properties => [ Glib::ParamSpec -> double("progress", "Progress", "Are we there, yet?", 0.0, 1.0, 0.0, [qw(readable writable)]) ] ; use constant x_padding => 2; use constant y_padding => 3; sub INIT_INSTANCE { my ($self) = @_; $self -> { progress } = 0.0; } sub GET_SIZE { my ($cell, $widget, $cell_area) = @_; my ($width, $height) = (100, 10); if (defined($cell_area)) { $width = $cell_area -> width() - x_padding * 2; $height = $cell_area -> height() - y_padding * 2; } return (0, 0, $width + x_padding * 2, $height + y_padding * 2); } sub RENDER { my ($cell, $window, $widget, $background_area, $cell_area, $expose_area, $flags) = @_; my ($x_offset, $y_offset, $width, $height) = $cell -> GET_SIZE($widget, $cell_area); if ($cell -> { progress } > 0) { $widget -> get_style -> paint_box($window, $flags & "selected" ? "normal" : "prelight", "out", $cell_area, $widget, undef, $cell_area -> x() + $x_offset, $cell_area -> y() + $y_offset, $width * $cell -> { progress }, $height - 1); } } ############################################################################### package main; use Cwd qw(cwd); use constant { COLUMN_ADDRESS => 0, COLUMN_STATUS => 1, COLUMN_PROGRESS => 2 }; my $window = Gtk2::Window -> new("toplevel"); $window -> set_title("Async Downloader"); $window -> set_border_width(5); $window -> set_default_size(100, 200); $window -> signal_connect(delete_event => sub { quit(); }); my $vbox = Gtk2::VBox -> new(0, 5); my $hbox = Gtk2::HBox -> new(0, 5); my $entry = Gtk2::Entry -> new(); my $button = Gtk2::Button -> new("_Download"); $button -> signal_connect(clicked => sub { start_new_download($entry -> get_text()); }); $entry -> signal_connect(activate => sub { $button->clicked; }); $hbox -> pack_start($entry, 1, 1, 0); $hbox -> pack_start($button, 0, 0, 0); $vbox -> pack_start($hbox, 0, 0, 0); my $model = Gtk2::ListStore -> new(qw(Glib::String Glib::String Glib::Double)); my $view = Gtk2::TreeView -> new($model); my $column_address = Gtk2::TreeViewColumn -> new_with_attributes("Address", Gtk2::CellRendererText -> new(), text => COLUMN_ADDRESS); my $column_status = Gtk2::TreeViewColumn -> new_with_attributes("Status", Gtk2::CellRendererText -> new(), text => COLUMN_STATUS); my $column_progress = Gtk2::TreeViewColumn -> new_with_attributes("Progress", Gtk2::CellRendererProgress -> new(), progress => COLUMN_PROGRESS); $column_address -> set_sizing("autosize"); $column_status -> set_sizing("autosize"); $view -> append_column($column_address); $view -> append_column($column_status); $view -> append_column($column_progress); $vbox -> pack_start($view, 1, 1, 0); $window -> add($vbox); $window -> show_all(); Gtk2 -> main(); ############################################################################### my %iters; sub start_new_download { my ($address) = @_; return unless ($address ne ""); my $source = Gnome2::VFS::URI -> new($address); my $target = Gnome2::VFS::URI -> new(cwd() . "/" . $source -> extract_short_path_name()); my $source_string = $source -> to_string(); my ($result, $handle) = Gnome2::VFS::Async -> xfer([$source], [$target], qw(default), qw(query), qw(query), 0, \&progress_update, $source_string, \&progress_sync, $source_string); if ($result eq "ok") { my $iter = $model -> append(); $entry -> set_text(""); $model -> set($iter, COLUMN_ADDRESS, $source_string); $iters{ $source_string } = $iter; # -> copy(); } else { $handle -> cancel(); } } sub progress_update { my ($handle, $info, $source_string) = @_; my $status; switch ($info -> { phase }) { case "phase-completed" { $status = "Completed"; } case "phase-initial" { $status = "Initializing"; } case "checking-destination" { $status = "Checking destination"; } case "phase-collecting" { $status = "Collecting"; } case "phase-readytogo" { $status = "Ready to go"; } case "phase-opentarget" { $status = "Opening target"; } case "phase-copying" { $status = "Copying"; } else { warn $info -> { phase }; $status = ""; } } $model -> set($iters{ $source_string }, COLUMN_STATUS, $status); if (defined($info -> { file_size }) && defined($info -> { bytes_copied }) && $info -> { file_size } != 0) { $model -> set($iters{ $source_string }, COLUMN_PROGRESS, $info -> { bytes_copied } / $info -> { file_size }); } } sub progress_sync { my ($info) = @_; if ($info -> { status } eq "ok") { return 1; } elsif ($info -> { status } eq "vfserror") { warn $info -> { vfs_status }; return "abort"; } elsif ($info -> { status } eq "overwrite") { return "abort"; } return 0; } ############################################################################### sub quit { Gtk2 -> main_quit(); Gnome2::VFS -> shutdown(); } Gnome2-VFS-1.082/META.yml0000644000175000017500000000104012222514155013160 0ustar lacklack--- abstract: 'Perl interface to the 2.x series of the GNOME VFS library' author: - unknown build_requires: ExtUtils::MakeMaker: 0 configure_requires: ExtUtils::MakeMaker: 0 dynamic_config: 1 generated_by: 'ExtUtils::MakeMaker version 6.78, CPAN::Meta::Converter version 2.132661' license: unknown meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: 1.4 name: Gnome2-VFS no_index: directory: - t - inc requires: ExtUtils::Depends: 0.20 ExtUtils::PkgConfig: 1.03 Glib: 1.120 version: 1.082 Gnome2-VFS-1.082/perl-Gnome2-VFS.spec.in0000644000175000017500000000343712222506645015734 0ustar lacklackSummary: Gnome2-VFS Perl module Name: perl-Gnome2-VFS Version: @VERSION@ Release: 1 Packager: gtk-perl-list@gnome.org License: LGPL Group: Development/Libraries URL: http://search.cpan.org/dist/Gnome2-VFS/ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRequires: perl >= 2:5.8.0 BuildRequires: gnome-vfs2-devel >= @GNOME_VFS@ BuildRequires: perl-ExtUtils-Depends >= @PERL_EXTUTILS_DEPENDS@ BuildRequires: perl-ExtUtils-PkgConfig >= @PERL_EXTUTILS_DEPENDS@ BuildRequires: perl-Glib >= @PERL_GLIB@ Requires: gnome-vfs2 >= %(pkg-config --modversion gnome-vfs-2.0) Requires: perl-Glib >= @PERL_GLIB@ Requires: %(perl -MConfig -le 'if (defined $Config{useithreads}) { print "perl(:WITH_ITHREADS)" } else { print "perl(:WITHOUT_ITHREADS)" }') Requires: %(perl -MConfig -le 'if (defined $Config{usethreads}) { print "perl(:WITH_THREADS)" } else { print "perl(:WITHOUT_THREADS)" }') Requires: %(perl -MConfig -le 'if (defined $Config{uselargefiles}) { print "perl(:WITH_LARGEFILES)" } else { print "perl(:WITHOUT_LARGEFILES)" }') Source0: @SOURCE@ %description %{summary}. %prep %setup -q -n Gnome2-VFS-%{version} %build CFLAGS="$RPM_OPT_FLAGS" perl Makefile.PL PREFIX=$RPM_BUILD_ROOT%{_prefix} make OPTIMIZE="$RPM_OPT_FLAGS" make test %install %makeinstall [ -x /usr/lib/rpm/brp-compress ] && /usr/lib/rpm/brp-compress find $RPM_BUILD_ROOT \( -name perllocal.pod -o -name .packlist \) -exec rm -v {} \; find $RPM_BUILD_ROOT/usr -type f -print | \ sed "s@^$RPM_BUILD_ROOT@@g" | \ grep -v perllocal.pod | \ grep -v "\.packlist" > %{name}-%{version}-filelist if [ "$(cat %{name}-%{version}-filelist)X" = "X" ] ; then exit -1 fi %clean rm -rf $RPM_BUILD_ROOT %files -f %{name}-%{version}-filelist %defattr(-,root,root) %changelog * @DATE@ gtk-perl-list@gnome.org - @VERSION@ - Specfile autogenerated. Gnome2-VFS-1.082/xs_files-2.80000644000175000017500000000010012222506645013754 0ustar lacklackxs/GnomeVFSAddress.xs xs/GnomeVFSDNSSD.xs xs/GnomeVFSResolve.xs Gnome2-VFS-1.082/maps-2.60000644000175000017500000000057312222506645013114 0ustar lacklackGNOME_VFS_TYPE_DRIVE GnomeVFSDrive GObject Gnome2::VFS::Drive GNOME_VFS_TYPE_VOLUME GnomeVFSVolume GObject Gnome2::VFS::Volume GNOME_VFS_TYPE_VOLUME_MONITOR GnomeVFSVolumeMonitor GObject Gnome2::VFS::VolumeMonitor GNOME_VFS_TYPE_VFS_DEVICE_TYPE GnomeVFSDeviceType GEnum Gnome2::VFS::DeviceType GNOME_VFS_TYPE_VFS_VOLUME_TYPE GnomeVFSVolumeType GEnum Gnome2::VFS::VolumeType Gnome2-VFS-1.082/vfs2perl.c0000644000175000017500000004240012222506645013630 0ustar lacklack/* * Copyright (C) 2003, 2013 by the gtk2-perl team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * $Id$ */ #include "vfs2perl.h" /* ------------------------------------------------------------------------- */ GType vfs2perl_gnome_vfs_uri_get_type (void) { static GType t = 0; if (!t) t = g_boxed_type_register_static ("GnomeVFSURI", (GBoxedCopyFunc) gnome_vfs_uri_ref, (GBoxedFreeFunc) gnome_vfs_uri_unref); return t; } /* ------------------------------------------------------------------------- */ SV * newSVGnomeVFSFileSize (GnomeVFSFileSize size) { return newSVuv (size); } GnomeVFSFileSize SvGnomeVFSFileSize (SV *size) { return SvUV (size); } /* ------------------------------------------------------------------------- */ SV * newSVGnomeVFSFileOffset (GnomeVFSFileOffset offset) { return newSViv (offset); } GnomeVFSFileOffset SvGnomeVFSFileOffset (SV *offset) { return SvIV (offset); } /* ------------------------------------------------------------------------- */ SV * newSVGnomeVFSHandle (GnomeVFSHandle *handle) { SV *sv = newSV (0); return sv_setref_pv (sv, "Gnome2::VFS::Handle", handle); } GnomeVFSHandle * SvGnomeVFSHandle (SV *handle) { return INT2PTR (GnomeVFSHandle *, SvIV (SvRV (handle))); } /* ------------------------------------------------------------------------- */ SV * newSVGnomeVFSMonitorHandle (GnomeVFSMonitorHandle *handle) { SV *sv = newSV (0); return sv_setref_pv (sv, "Gnome2::VFS::Monitor::Handle", handle); } GnomeVFSMonitorHandle * SvGnomeVFSMonitorHandle (SV *handle) { return INT2PTR (GnomeVFSMonitorHandle *, SvIV (SvRV (handle))); } /* ------------------------------------------------------------------------- */ SV * newSVGnomeVFSDirectoryHandle (GnomeVFSDirectoryHandle *handle) { SV *sv = newSV (0); return sv_setref_pv (sv, "Gnome2::VFS::Directory::Handle", handle); } GnomeVFSDirectoryHandle * SvGnomeVFSDirectoryHandle (SV *handle) { return INT2PTR (GnomeVFSDirectoryHandle *, SvIV (SvRV (handle))); } /* ------------------------------------------------------------------------- */ SV * newSVGnomeVFSAsyncHandle (GnomeVFSAsyncHandle *handle) { SV *sv = newSV (0); return sv_setref_pv (sv, "Gnome2::VFS::Async::Handle", handle); } GnomeVFSAsyncHandle * SvGnomeVFSAsyncHandle (SV *handle) { return INT2PTR (GnomeVFSAsyncHandle *, SvIV (SvRV (handle))); } /* ------------------------------------------------------------------------- */ #if VFS_CHECK_VERSION (2, 8, 0) SV * newSVGnomeVFSDNSSDBrowseHandle (GnomeVFSDNSSDBrowseHandle *handle) { SV *sv = newSV (0); return sv_setref_pv (sv, "Gnome2::VFS::DNSSD::Browse::Handle", handle); } GnomeVFSDNSSDBrowseHandle * SvGnomeVFSDNSSDBrowseHandle (SV *handle) { return INT2PTR (GnomeVFSDNSSDBrowseHandle *, SvIV (SvRV (handle))); } #endif /* 2.8 */ /* ------------------------------------------------------------------------- */ #if VFS_CHECK_VERSION (2, 8, 0) SV * newSVGnomeVFSDNSSDResolveHandle (GnomeVFSDNSSDResolveHandle *handle) { SV *sv = newSV (0); return sv_setref_pv (sv, "Gnome2::VFS::DNSSD::Resolve::Handle", handle); } GnomeVFSDNSSDResolveHandle * SvGnomeVFSDNSSDResolveHandle (SV *handle) { return INT2PTR (GnomeVFSDNSSDResolveHandle *, SvIV (SvRV (handle))); } #endif /* 2.8 */ /* ------------------------------------------------------------------------- */ #if VFS_CHECK_VERSION (2, 8, 0) SV * newSVGnomeVFSResolveHandle (GnomeVFSResolveHandle *handle) { SV *sv = newSV (0); return sv_setref_pv (sv, "Gnome2::VFS::Resolve::Handle", handle); } GnomeVFSResolveHandle * SvGnomeVFSResolveHandle (SV *handle) { return INT2PTR (GnomeVFSResolveHandle *, SvIV (SvRV (handle))); } #endif /* 2.8 */ /* ------------------------------------------------------------------------- */ GnomeVFSApplication * SvGnomeVFSApplication (SV *object) { MAGIC *mg; if (!object || !SvOK (object) || !SvROK (object) || !(mg = mg_find (SvRV (object), PERL_MAGIC_ext))) return NULL; return (GnomeVFSApplication *) mg->mg_ptr; } SV * newSVGnomeVFSApplication (GnomeVFSApplication *app_id) { SV *rv; HV *stash; SV *object = (SV *) newHV (); sv_magic (object, 0, PERL_MAGIC_ext, app_id, 0); rv = newRV_noinc (object); stash = gv_stashpv ("Gnome2::VFS::Application", 1); return sv_bless (rv, stash); } /* ------------------------------------------------------------------------- */ #define VFS2PERL_CHECK_AND_STORE(_type, _key, _sv) \ if (info->valid_fields & _type) \ hv_store (object, _key, strlen (_key), _sv, 0); SV * newSVGnomeVFSFileInfo (GnomeVFSFileInfo *info) { HV *object = newHV (); if (info && info->name && info->valid_fields) { hv_store (object, "name", 4, newSVpv (info->name, 0), 0); hv_store (object, "valid_fields", 12, newSVGnomeVFSFileInfoFields (info->valid_fields), 0); VFS2PERL_CHECK_AND_STORE (GNOME_VFS_FILE_INFO_FIELDS_TYPE, "type", newSVGnomeVFSFileType (info->type)); VFS2PERL_CHECK_AND_STORE (GNOME_VFS_FILE_INFO_FIELDS_PERMISSIONS, "permissions", newSVGnomeVFSFilePermissions (info->permissions)); VFS2PERL_CHECK_AND_STORE (GNOME_VFS_FILE_INFO_FIELDS_FLAGS, "flags", newSVGnomeVFSFileFlags (info->flags)); VFS2PERL_CHECK_AND_STORE (GNOME_VFS_FILE_INFO_FIELDS_DEVICE, "device", newSViv (info->device)); VFS2PERL_CHECK_AND_STORE (GNOME_VFS_FILE_INFO_FIELDS_INODE, "inode", newSVuv (info->inode)); VFS2PERL_CHECK_AND_STORE (GNOME_VFS_FILE_INFO_FIELDS_LINK_COUNT, "link_count", newSVuv (info->link_count)); VFS2PERL_CHECK_AND_STORE (GNOME_VFS_FILE_INFO_FIELDS_SIZE, "size", newSVGnomeVFSFileSize (info->size)); VFS2PERL_CHECK_AND_STORE (GNOME_VFS_FILE_INFO_FIELDS_BLOCK_COUNT, "block_count", newSVGnomeVFSFileSize (info->block_count)); VFS2PERL_CHECK_AND_STORE (GNOME_VFS_FILE_INFO_FIELDS_IO_BLOCK_SIZE, "io_block_size", newSVuv (info->io_block_size)); VFS2PERL_CHECK_AND_STORE (GNOME_VFS_FILE_INFO_FIELDS_ATIME, "atime", newSViv (info->atime)); VFS2PERL_CHECK_AND_STORE (GNOME_VFS_FILE_INFO_FIELDS_MTIME, "mtime", newSViv (info->mtime)); VFS2PERL_CHECK_AND_STORE (GNOME_VFS_FILE_INFO_FIELDS_CTIME, "ctime", newSViv (info->ctime)); VFS2PERL_CHECK_AND_STORE (GNOME_VFS_FILE_INFO_FIELDS_SYMLINK_NAME, "symlink_name", newSVpv (info->symlink_name, 0)); VFS2PERL_CHECK_AND_STORE (GNOME_VFS_FILE_INFO_FIELDS_MIME_TYPE, "mime_type", newSVpv (info->mime_type, 0)); /* FIXME: what about GNOME_VFS_FILE_INFO_FIELDS_ACCESS? */ } return sv_bless (newRV_noinc ((SV *) object), gv_stashpv ("Gnome2::VFS::FileInfo", 1)); } #define VFS2PERL_FETCH_AND_CHECK(_type, _key, _member, _sv) \ if (hv_exists (hv, _key, strlen (_key))) { \ value = hv_fetch (hv, _key, strlen (_key), FALSE); \ if (value) _member = _sv; \ info->valid_fields |= _type; \ } GnomeVFSFileInfo * SvGnomeVFSFileInfo (SV *object) { HV *hv = (HV *) SvRV (object); SV **value; GnomeVFSFileInfo *info = gperl_alloc_temp (sizeof (GnomeVFSFileInfo)); if (object && SvOK (object) && SvROK (object) && SvTYPE (SvRV (object)) == SVt_PVHV) { value = hv_fetch (hv, "name", 4, FALSE); if (value) info->name = SvPV_nolen (*value); info->valid_fields = GNOME_VFS_FILE_INFO_FIELDS_NONE; VFS2PERL_FETCH_AND_CHECK (GNOME_VFS_FILE_INFO_FIELDS_TYPE, "type", info->type, SvGnomeVFSFileType (*value)); VFS2PERL_FETCH_AND_CHECK (GNOME_VFS_FILE_INFO_FIELDS_PERMISSIONS, "permissions", info->permissions, SvGnomeVFSFilePermissions (*value)); VFS2PERL_FETCH_AND_CHECK (GNOME_VFS_FILE_INFO_FIELDS_FLAGS, "flags", info->flags, SvGnomeVFSFileFlags (*value)); VFS2PERL_FETCH_AND_CHECK (GNOME_VFS_FILE_INFO_FIELDS_DEVICE, "device", info->device, SvIV (*value)); VFS2PERL_FETCH_AND_CHECK (GNOME_VFS_FILE_INFO_FIELDS_INODE, "inode", info->inode, SvUV (*value)); VFS2PERL_FETCH_AND_CHECK (GNOME_VFS_FILE_INFO_FIELDS_LINK_COUNT, "link_count", info->link_count, SvUV (*value)); VFS2PERL_FETCH_AND_CHECK (GNOME_VFS_FILE_INFO_FIELDS_SIZE, "size", info->size, SvGnomeVFSFileSize (*value)); VFS2PERL_FETCH_AND_CHECK (GNOME_VFS_FILE_INFO_FIELDS_BLOCK_COUNT, "block_count", info->block_count, SvGnomeVFSFileSize (*value)); VFS2PERL_FETCH_AND_CHECK (GNOME_VFS_FILE_INFO_FIELDS_IO_BLOCK_SIZE, "io_block_size", info->io_block_size, SvUV (*value)); VFS2PERL_FETCH_AND_CHECK (GNOME_VFS_FILE_INFO_FIELDS_ATIME, "atime", info->atime, SvIV (*value)); VFS2PERL_FETCH_AND_CHECK (GNOME_VFS_FILE_INFO_FIELDS_MTIME, "mtime", info->mtime, SvIV (*value)); VFS2PERL_FETCH_AND_CHECK (GNOME_VFS_FILE_INFO_FIELDS_CTIME, "ctime", info->ctime, SvIV (*value)); VFS2PERL_FETCH_AND_CHECK (GNOME_VFS_FILE_INFO_FIELDS_SYMLINK_NAME, "symlink_name", info->symlink_name, SvPV_nolen (*value)); VFS2PERL_FETCH_AND_CHECK (GNOME_VFS_FILE_INFO_FIELDS_MIME_TYPE, "mime_type", info->mime_type, SvPV_nolen (*value)); /* FIXME: what about GNOME_VFS_FILE_INFO_FIELDS_ACCESS? */ } return info; } /* ------------------------------------------------------------------------- */ SV * newSVGnomeVFSXferProgressInfo (GnomeVFSXferProgressInfo *info) { HV * hv = newHV (); if (info) { hv_store (hv, "status", 6, newSVGnomeVFSXferProgressStatus (info->status), 0); hv_store (hv, "vfs_status", 10, newSVGnomeVFSResult (info->vfs_status), 0); hv_store (hv, "phase", 5, newSVGnomeVFSXferPhase (info->phase), 0); hv_store (hv, "file_index", 10, newSVuv (info->file_index), 0); hv_store (hv, "files_total", 11, newSVuv (info->files_total), 0); hv_store (hv, "bytes_total", 11, newSVuv (info->bytes_total), 0); hv_store (hv, "file_size", 9, newSVuv (info->file_size), 0); hv_store (hv, "bytes_copied", 12, newSVuv (info->bytes_copied), 0); hv_store (hv, "total_bytes_copied", 18, newSVuv (info->total_bytes_copied), 0); hv_store (hv, "top_level_item", 14, newSVuv (info->top_level_item), 0); if (info->source_name) hv_store (hv, "source_name", 11, newSVGChar (info->source_name), 0); if (info->target_name) hv_store (hv, "target_name", 11, newSVGChar (info->target_name), 0); if (info->duplicate_count) hv_store (hv, "duplicate_count", 15, newSViv (info->duplicate_count), 0); /* FIXME: add a version check once the fix from teuf makes it into an official release. */ if (info->duplicate_name && info->phase != GNOME_VFS_XFER_PHASE_COMPLETED) hv_store (hv, "duplicate_name", 14, newSVGChar (info->duplicate_name), 0); } return newRV_noinc ((SV*) hv); } /* ------------------------------------------------------------------------- */ SV * newSVGnomeVFSMimeApplication (GnomeVFSMimeApplication *application) { HV *hash = newHV (); if (application == NULL) return &PL_sv_undef; #if VFS_CHECK_VERSION (2, 10, 0) sv_magic ((SV *) hash, 0, PERL_MAGIC_ext, (const char *) application, 0); #endif hv_store (hash, "id", 2, newSVpv (application->id, 0), 0); hv_store (hash, "name", 4, newSVpv (application->name, 0), 0); hv_store (hash, "command", 7, newSVpv (application->command, 0), 0); hv_store (hash, "can_open_multiple_files", 23, newSVuv (application->can_open_multiple_files), 0); hv_store (hash, "expects_uris", 12, newSVGnomeVFSMimeApplicationArgumentType (application->expects_uris), 0); hv_store (hash, "requires_terminal", 17, newSVuv (application->requires_terminal), 0); if (application->supported_uri_schemes != NULL) { AV *array = newAV (); GList *i; for (i = application->supported_uri_schemes; i != NULL; i = i->next) av_push (array, newSVpv (i->data, 0)); hv_store (hash, "supported_uri_schemes", 21, newRV_noinc ((SV *) array), 0); } return sv_bless (newRV_noinc ((SV *) hash), gv_stashpv ("Gnome2::VFS::Mime::Application", 1)); } GnomeVFSMimeApplication * SvGnomeVFSMimeApplication (SV *object) { #if VFS_CHECK_VERSION (2, 10, 0) GnomeVFSMimeApplication *application; MAGIC *mg; if (!object || !SvOK (object) || !SvROK (object) || !(mg = mg_find (SvRV (object), PERL_MAGIC_ext))) return NULL; application = (GnomeVFSMimeApplication *) mg->mg_ptr; #else GnomeVFSMimeApplication *application = gperl_alloc_temp (sizeof (GnomeVFSMimeApplication)); if (object && SvOK (object) && SvROK (object) && SvTYPE (SvRV (object)) == SVt_PVHV) { HV *hv = (HV *) SvRV (object); SV **value; value = hv_fetch (hv, "id", 2, FALSE); if (value) application->id = SvPV_nolen (*value); value = hv_fetch (hv, "name", 4, FALSE); if (value) application->name = SvPV_nolen (*value); value = hv_fetch (hv, "command", 7, FALSE); if (value) application->command = SvPV_nolen (*value); value = hv_fetch (hv, "can_open_multiple_files", 23, FALSE); if (value) application->can_open_multiple_files = SvUV (*value); value = hv_fetch (hv, "expects_uris", 12, FALSE); if (value) application->expects_uris = SvGnomeVFSMimeApplicationArgumentType (*value); value = hv_fetch (hv, "requires_terminal", 17, FALSE); if (value) application->requires_terminal = SvUV (*value); value = hv_fetch (hv, "supported_uri_schemes", 21, FALSE); if (value && *value && SvOK (*value) && SvROK (*value) && SvTYPE (SvRV (*value)) == SVt_PVAV) { AV *array = (AV *) SvRV (*value); int i; application->supported_uri_schemes = NULL; for (i = 0; i <= av_len (array); i++) { value = av_fetch (array, i, 0); if (value) application->supported_uri_schemes = g_list_append (application->supported_uri_schemes, SvPV_nolen (*value)); } } } #endif return application; } /* ------------------------------------------------------------------------- */ GnomeVFSMimeType * SvGnomeVFSMimeType (SV *object) { MAGIC *mg; if (!object || !SvOK (object) || !SvROK (object) || !(mg = mg_find (SvRV (object), PERL_MAGIC_ext))) return NULL; return (GnomeVFSMimeType *) mg->mg_ptr; } SV * newSVGnomeVFSMimeType (GnomeVFSMimeType *mime_type) { SV *rv; HV *stash; SV *object = (SV *) newHV (); sv_magic (object, 0, PERL_MAGIC_ext, mime_type, 0); rv = newRV_noinc (object); stash = gv_stashpv ("Gnome2::VFS::Mime::Type", 1); return sv_bless (rv, stash); } /* ------------------------------------------------------------------------- */ GList * SvPVGList (SV *ref) { int i; AV *array; SV **value; GList *list = NULL; if (! (SvRV (ref) && SvTYPE (SvRV (ref)) == SVt_PVAV)) croak ("URI list has to be a reference to an array"); array = (AV *) SvRV (ref); for (i = 0; i <= av_len (array); i++) if ((value = av_fetch (array, i, 0)) && SvOK (*value)) list = g_list_append(list, SvPV_nolen (*value)); return list; } /* ------------------------------------------------------------------------- */ GList * SvGnomeVFSURIGList (SV *ref) { int i; AV *array; SV **value; GList *list = NULL; if (! (SvRV (ref) && SvTYPE (SvRV (ref)) == SVt_PVAV)) croak ("URI list has to be a reference to an array"); array = (AV *) SvRV (ref); for (i = 0; i <= av_len (array); i++) if ((value = av_fetch (array, i, 0)) && SvOK (*value)) list = g_list_append(list, SvGnomeVFSURI (*value)); return list; } /* ------------------------------------------------------------------------- */ char ** SvEnvArray (SV *ref) { char **result = NULL; if (SvOK (ref)) { if (SvRV (ref) && SvTYPE (SvRV (ref)) == SVt_PVAV) { AV *array = (AV *) SvRV (ref); SV **string; int i, length = av_len (array); result = g_new0 (char *, length + 2); for (i = 0; i <= length; i++) if ((string = av_fetch (array, i, 0)) && SvOK (*string)) result[i] = SvPV_nolen (*string); result[length + 1] = NULL; } else croak ("the environment parameter must be an array reference"); } return result; } /* ------------------------------------------------------------------------- */ SV * newSVGnomeVFSFileInfoGList (GList *list) { AV *array = newAV (); for (; list != NULL; list = list->next) av_push (array, newSVGnomeVFSFileInfo (list->data)); return newRV_noinc ((SV *) array); } /* ------------------------------------------------------------------------- */ SV * newSVGnomeVFSGetFileInfoResultGList (GList *list) { AV *array = newAV (); for (; list != NULL; list = list->next) { HV *hash = newHV (); GnomeVFSGetFileInfoResult* result = list->data; gnome_vfs_uri_ref (result->uri); hv_store (hash, "uri", 3, newSVGnomeVFSURI (result->uri), 0); hv_store (hash, "result", 6, newSVGnomeVFSResult (result->result), 0); hv_store (hash, "file_info", 9, newSVGnomeVFSFileInfo (result->file_info), 0); av_push (array, newRV_noinc ((SV *) hash)); } return newRV_noinc ((SV *) array); } /* ------------------------------------------------------------------------- */ SV * newSVGnomeVFSFindDirectoryResultGList (GList *list) { AV *array = newAV (); for (; list != NULL; list = list->next) { HV *hash = newHV (); GnomeVFSFindDirectoryResult* result = list->data; hv_store (hash, "result", 6, newSVGnomeVFSResult (result->result), 0); if (result->uri) { gnome_vfs_uri_ref (result->uri); hv_store (hash, "uri", 3, newSVGnomeVFSURI (result->uri), 0); } av_push (array, newRV_noinc ((SV *) hash)); } return newRV_noinc ((SV *) array); } Gnome2-VFS-1.082/t/0000755000175000017500000000000012222514155012157 5ustar lacklackGnome2-VFS-1.082/t/GnomeVFSURI.t0000644000175000017500000000637612222506645014371 0ustar lacklack#!/usr/bin/perl -w use strict; use Gnome2::VFS; use Config; use Test::More; # $Id$ plan -d "$ENV{ HOME }/.gnome" ? (tests => 30) : (skip_all => "You have no ~/.gnome"); Gnome2::VFS -> init(); ############################################################################### my $uri = Gnome2::VFS::URI -> new("http://www.freenet.de"); isa_ok($uri, "Gnome2::VFS::URI"); ok($uri -> equal(Gnome2::VFS::URI -> new("http://www.freenet.de"))); ok($uri -> is_parent(Gnome2::VFS::URI -> new("http://www.freenet.de/tmp/argh.html"), 1)); ok(not $uri -> has_parent()); is($uri -> to_string(qw(toplevel_method)), "www.freenet.de"); is($uri -> append_string("ble.html") -> to_string(), "http://www.freenet.de/ble.html"); is($uri -> append_path("bli.html") -> to_string(), "http://www.freenet.de/bli.html"); is($uri -> append_file_name("blo.html") -> to_string(), "http://www.freenet.de/blo.html"); ok(not $uri -> is_local()); SKIP: { skip("resolve_relative, it changed in 2.4.0", 1) unless (Gnome2::VFS -> CHECK_VERSION(2, 4, 0)); skip("resolve_relative was broken on 64bit platforms", 1) if ($Config{ archname } =~ m/^(ia64|x86_64|alpha)/ && not Gnome2::VFS -> CHECK_VERSION(2, 8, 0)); is($uri -> resolve_relative("bla.html") -> to_string(), "http://www.freenet.de/bla.html"); } ############################################################################### $uri = Gnome2::VFS::URI -> new("http://www.freenet.de/tmp/argh.html"); ok($uri -> has_parent()); is($uri -> get_parent() -> to_string(), "http://www.freenet.de/tmp"); ############################################################################### $uri = Gnome2::VFS::URI -> new('ftp://bla:bla@ftp.freenet.de:21/pub'); is($uri -> get_host_name(), "ftp.freenet.de"); is($uri -> get_scheme(), "ftp"); is($uri -> get_host_port(), 21); is($uri -> get_user_name(), "bla"); is($uri -> get_password(), "bla"); ############################################################################### $uri = Gnome2::VFS::URI -> new("ftp://ftp.gna.org"); $uri -> set_host_name("ftp.gnu.org"); $uri -> set_host_port(21); $uri -> set_user_name("blub"); $uri -> set_password("blub"); is($uri -> get_host_name(), "ftp.gnu.org"); is($uri -> get_scheme(), "ftp"); is($uri -> get_host_port(), 21); is($uri -> get_user_name(), "blub"); is($uri -> get_password(), "blub"); ############################################################################### $uri = Gnome2::VFS::URI -> new("/usr/bin/perl"); is($uri -> get_path(), "/usr/bin/perl"); # FIXME: $uri -> get_fragment_identifier(); is($uri -> extract_dirname(), "/usr/bin"); is($uri -> extract_short_name(), "perl"); is($uri -> extract_short_path_name(), "perl"); ############################################################################### foreach (Gnome2::VFS::URI -> list_parse("file:///usr/bin/python\nfile:///usr/bin/curl")) { isa_ok($_, "Gnome2::VFS::URI"); } ############################################################################### is(Gnome2::VFS::URI -> make_full_from_relative("/usr/bin/", "perl"), "/usr/bin/perl"); SKIP: { skip '2.16 stuff', 1 unless Gnome2::VFS -> CHECK_VERSION(2, 16, 0); isa_ok($uri -> resolve_symbolic_link('tmp'), 'Gnome2::VFS::URI'); } ############################################################################### Gnome2::VFS -> shutdown(); Gnome2-VFS-1.082/t/GnomeVFSAsync0000644000175000017500000002374512222506645014544 0ustar lacklack#!/usr/bin/perl -w use strict; use Gnome2::VFS; use Cwd qw(cwd); use Test::More; # $Id$ plan -d "$ENV{ HOME }/.gnome" ? (tests => 135) : (skip_all => "You have no ~/.gnome"); Gnome2::VFS -> init(); ############################################################################### my $loop = Glib::MainLoop -> new(); ############################################################################### my $callback_close = sub { my ($handle, $result) = @_; isa_ok($handle, "Gnome2::VFS::Async::Handle"); is($result, "ok"); $loop -> quit(); }; my $callback_read = sub { my ($handle, $result, $buffer, $bytes_requested, $bytes_read) = @_; isa_ok($handle, "Gnome2::VFS::Async::Handle"); is($result, "ok"); is($buffer, "#!"); is($bytes_requested, 2); is($bytes_read, 2); $handle -> close($callback_close); }; my $callback_seek = sub { my ($handle, $result) = @_; isa_ok($handle, "Gnome2::VFS::Async::Handle"); is($result, "ok"); $handle -> read(2, $callback_read); }; my $callback_open = sub { my ($handle, $result) = @_; isa_ok($handle, "Gnome2::VFS::Async::Handle"); is($result, "ok"); if (Gnome2::VFS -> CHECK_VERSION(2, 6, 0)) { $handle -> seek("start", 0, $callback_seek); } else { $handle -> read(2, $callback_read); ok(1); ok(1); } }; my $callback_write = sub { my ($handle, $result, $buffer, $bytes_requested, $bytes_written) = @_; isa_ok($handle, "Gnome2::VFS::Async::Handle"); is($result, "ok"); is($buffer, "urgs\n"); is($bytes_requested, 5); is($bytes_written, 5); $handle -> close($callback_close); }; my $callback_create = sub { my ($handle, $result) = @_; isa_ok($handle, "Gnome2::VFS::Async::Handle"); is($result, "ok"); $handle -> write("urgs\n", 5, $callback_write); }; my $callback_directory_open = sub { my ($handle, $result, $infos, $entries_read) = @_; isa_ok($handle, "Gnome2::VFS::Async::Handle"); is($result, "ok"); is($entries_read, 2); isa_ok($infos -> [0], "Gnome2::VFS::FileInfo"); isa_ok($infos -> [1], "Gnome2::VFS::FileInfo"); $handle -> cancel(); $loop -> quit(); }; my $callback_get_file_info = sub { my ($handle, $infos) = @_; foreach (@{$infos}) { is($_ -> { result }, "ok"); isa_ok($_ -> { file_info }, "Gnome2::VFS::FileInfo"); isa_ok($_ -> { uri }, "Gnome2::VFS::URI"); } $loop -> quit(); }; my $callback_set_file_info = sub { my ($handle, $result, $info) = @_; isa_ok($handle, "Gnome2::VFS::Async::Handle"); is($result, "ok"); is($info -> { name }, "bla"); is_deeply($info -> { permissions }, [qw(user-read user-write)]); $loop -> quit(); }; my $callback_find_directory = sub { my ($handle, $results) = @_; foreach (@{$results}) { is($_ -> { result }, "ok"); isa_ok($_ -> { uri }, "Gnome2::VFS::URI"); } $loop -> quit(); }; my $callback_progress_sync = sub { my ($info) = @_; isa_ok($info, "HASH"); if ($info -> { status } eq "ok") { return 1; } elsif ($info -> { status } eq "vfserror") { return "abort"; } elsif ($info -> { status } eq "overwrite") { return "replace"; } return 0; }; my $callback_progress_update = sub { my ($handle, $info) = @_; isa_ok($handle, "Gnome2::VFS::Async::Handle"); isa_ok($info, "HASH"); if ($info -> { phase } eq "phase-completed") { $loop -> quit(); } }; ############################################################################### my ($handle, $result); ############################################################################### $handle = Gnome2::VFS::Async -> open(cwd() . "/$0", qw(read), 0, $callback_open); isa_ok($handle, "Gnome2::VFS::Async::Handle"); $loop -> run(); ############################################################################### $handle = Gnome2::VFS::Async -> open_uri(Gnome2::VFS::URI -> new(cwd() . "/$0"), qw(read), 0, $callback_open); isa_ok($handle, "Gnome2::VFS::Async::Handle"); $loop -> run(); ############################################################################### $handle = Gnome2::VFS::Async -> create("/tmp/bla", [qw(read write)], 1, 0666, 0, $callback_create); isa_ok($handle, "Gnome2::VFS::Async::Handle"); $loop -> run(); ############################################################################### $handle = Gnome2::VFS::Async -> create_uri(Gnome2::VFS::URI -> new("/tmp/ble"), [qw(read write)], 1, 0666, 0, $callback_create); isa_ok($handle, "Gnome2::VFS::Async::Handle"); $loop -> run(); ############################################################################### # FIXME: this seems to block. should we cancel the handle somewhere? # $handle = Gnome2::VFS::Async -> create_symbolic_link(Gnome2::VFS::URI -> new("/tmp/bli"), # "/usr/bin/perl", # 0, # $callback_close); # isa_ok($handle, "Gnome2::VFS::Async::Handle"); # $loop -> run(); $handle = Gnome2::VFS::Async -> create("/tmp/bli", [qw(read write)], 1, 0666, 0, $callback_create); isa_ok($handle, "Gnome2::VFS::Async::Handle"); $loop -> run(); ############################################################################### $handle = Gnome2::VFS::Async -> load_directory("/tmp", qw(default), 2, 0, $callback_directory_open); isa_ok($handle, "Gnome2::VFS::Async::Handle"); $loop -> run(); ############################################################################### $handle = Gnome2::VFS::Async -> load_directory_uri(Gnome2::VFS::URI -> new("/tmp"), qw(default), 2, 0, $callback_directory_open); isa_ok($handle, "Gnome2::VFS::Async::Handle"); $loop -> run(); ############################################################################### my $files = [Gnome2::VFS::URI -> new("/tmp/bla"), Gnome2::VFS::URI -> new("/tmp/ble"), Gnome2::VFS::URI -> new("/tmp/bli")]; $handle = Gnome2::VFS::Async -> get_file_info($files, qw(default), 0, $callback_get_file_info); isa_ok($handle, "Gnome2::VFS::Async::Handle"); $loop -> run(); ############################################################################### $handle = Gnome2::VFS::Async -> set_file_info(Gnome2::VFS::URI -> new("/tmp/bla"), { permissions => [qw(user-read user-write)] }, [qw(permissions)], qw(default), 0, $callback_set_file_info); isa_ok($handle, "Gnome2::VFS::Async::Handle"); $loop -> run(); ############################################################################### $handle = Gnome2::VFS::Async -> find_directory($files, "desktop", 0, 1, 0777, 0, $callback_find_directory); isa_ok($handle, "Gnome2::VFS::Async::Handle"); $loop -> run(); ############################################################################### my @source = (Gnome2::VFS::URI -> new("/tmp/bla"), Gnome2::VFS::URI -> new("/tmp/ble"), Gnome2::VFS::URI -> new("/tmp/bli")); my @destination = (Gnome2::VFS::URI -> new("/tmp/blaa"), Gnome2::VFS::URI -> new("/tmp/blee"), Gnome2::VFS::URI -> new("/tmp/blii")); ($result, $handle) = Gnome2::VFS::Async -> xfer(\@source, \@destination, qw(default), qw(query), qw(query), 0, $callback_progress_update, undef, $callback_progress_sync, undef); is($result, "ok"); isa_ok($handle, "Gnome2::VFS::Async::Handle"); $loop -> run(); ############################################################################### Gnome2::VFS -> unlink("/tmp/bla"); Gnome2::VFS -> unlink("/tmp/ble"); Gnome2::VFS -> unlink("/tmp/bli"); Gnome2::VFS -> unlink("/tmp/blaa"); Gnome2::VFS -> unlink("/tmp/blee"); Gnome2::VFS -> unlink("/tmp/blii"); ############################################################################### Gnome2::VFS::Async -> set_job_limit(2); is(Gnome2::VFS::Async -> get_job_limit(), 2); ############################################################################### Gnome2::VFS -> shutdown(); Gnome2-VFS-1.082/t/GnomeVFSUtils.t0000644000175000017500000000647712222506645015034 0ustar lacklack#!/usr/bin/perl -w use strict; use utf8; use Gnome2::VFS; use Cwd qw(cwd); use Test::More; # $Id$ plan -d "$ENV{ HOME }/.gnome" ? (tests => 31) : (skip_all => "You have no ~/.gnome"); Gnome2::VFS -> init(); ############################################################################### # Gnome2::VFS -> escape_set(...); # Gnome2::VFS -> icon_path_from_filename(...); # Gnome2::VFS -> url_show("http://www.bla.de"); # Gnome2::VFS -> url_show_with_env("http://www.bla.de", [map { "$_=" . $ENV{ $_ } } (keys(%ENV))]); is(Gnome2::VFS -> format_file_size_for_display(1200000000), "1.1 GB"); SKIP: { skip("escape_string, format_uri_for_display, gnome_vfs_make_uri_from_input, make_uri_canonical_strip_fragment, uris_match, get_uri_scheme and make_uri_from_shell_arg are new in 2.2.0", 13) unless (Gnome2::VFS -> CHECK_VERSION(2, 2, 0)); is(Gnome2::VFS -> escape_string('%$§äöü'), '%25%24%C2%A7%C3%A4%C3%B6%C3%BC'); is(Gnome2::VFS -> format_uri_for_display("/usr/bin/äöü"), "/usr/bin/äöü"); is(Gnome2::VFS -> make_uri_from_input("gtk2-perl.sf.net"), "http://gtk2-perl.sf.net"); is(Gnome2::VFS -> make_uri_canonical_strip_fragment("http://gtk2-perl.sf.net#bla"), "http://gtk2-perl.sf.net"); ok(Gnome2::VFS -> uris_match("http://gtk2-perl.sf.net", "http://gtk2-perl.sf.net")); is(Gnome2::VFS -> get_uri_scheme("http://gtk2-perl.sf.net"), "http"); is(Gnome2::VFS -> make_uri_from_shell_arg("/~/bla"), "file:///~/bla"); my ($result, $size, $content) = Gnome2::VFS -> read_entire_file(cwd() . "/" . $0); is($result, "ok"); like($size, qr/^\d+$/); like($content, qr(^#!/usr/bin/perl)); ($result, $size, $content) = Gnome2::VFS -> read_entire_file(cwd()); is($result, "error-is-directory"); is($size, 0); is($content, undef); } SKIP: { skip("make_uri_from_input_with_dirs is new in 2.4.0", 1) unless (Gnome2::VFS -> CHECK_VERSION(2, 4, 0)); ok(defined(Gnome2::VFS -> make_uri_from_input_with_dirs("~/tmp", qw(homedir)))); } SKIP: { skip("make_uri_from_input_with_trailing_ws is new in 2.12.0", 1) unless (Gnome2::VFS -> CHECK_VERSION(2, 12, 0)); ok(defined(Gnome2::VFS -> make_uri_from_input_with_trailing_ws("file:///tmp"))); } foreach (Gnome2::VFS -> escape_path_string('%$§äöü'), Gnome2::VFS -> escape_host_and_path_string('%$§äöü')) { is($_, '%25%24%C2%A7%C3%A4%C3%B6%C3%BC'); is(Gnome2::VFS -> unescape_string($_), '%$§äöü'); } is(Gnome2::VFS -> escape_slashes("/%/"), "%2F%25%2F"); SKIP: { skip ("make_uri_canonical is borken in versions prior to 2.2.0", 1) unless (Gnome2::VFS -> CHECK_VERSION(2, 2, 0)); is(Gnome2::VFS -> make_uri_canonical("bla/bla.txt"), "file:///bla/bla.txt"); } is(Gnome2::VFS -> make_path_name_canonical("/bla"), "/bla"); ok(defined(Gnome2::VFS -> expand_initial_tilde("~/bla"))); is(Gnome2::VFS -> unescape_string_for_display("%2F%25%2F"), "/%/"); is(Gnome2::VFS -> get_local_path_from_uri("file:///bla"), "/bla"); is(Gnome2::VFS -> get_uri_from_local_path("/bla"), "file:///bla"); ok(Gnome2::VFS -> is_executable_command_string("perl -wle 'print 23'")); my ($result, $size) = Gnome2::VFS -> get_volume_free_space(Gnome2::VFS::URI -> new("file://" . cwd())); is($result, "ok"); like($size, qr/^\d+$/); ok(Gnome2::VFS -> is_primary_thread()); ############################################################################### Gnome2::VFS -> shutdown(); Gnome2-VFS-1.082/t/GnomeVFSDirectory.t0000644000175000017500000000610512222506645015664 0ustar lacklack#!/usr/bin/perl -w use strict; use Glib qw(TRUE FALSE); use Gnome2::VFS; use Test::More; # $Id$ plan -d "$ENV{ HOME }/.gnome" ? (tests => 38) : (skip_all => "You have no ~/.gnome"); Gnome2::VFS -> init(); ############################################################################### use Cwd qw(cwd); use constant TMP => cwd() . "/tmp"; unless (-e TMP) { mkdir(TMP) or die ("Urgh, couldn't create the scratch directory: $!"); } ############################################################################### my ($result, $handle); foreach ([Gnome2::VFS::Directory -> open(TMP, qw(default))], [Gnome2::VFS::Directory -> open_from_uri(Gnome2::VFS::URI -> new(TMP), qw(default))]) { ($result, $handle) = @{$_}; is($result, "ok"); isa_ok($handle, "Gnome2::VFS::Directory::Handle"); is($handle -> close(), "ok"); } ############################################################################### my $info; $handle = Gnome2::VFS::Directory -> open(TMP, qw(default)); ($result, $info) = $handle -> read_next(); is($result, "ok"); ok($info -> { name } eq "." || $info -> { name } eq ".."); is($info -> { type }, "directory"); $handle -> close(); ############################################################################### my $callback = sub { my ($node, $info, $will_loop) = @_; ok(-e TMP . "/" . $node); is($info -> { name }, $node); ok($will_loop == 0 || $will_loop == 1); return (TRUE, FALSE); }; Gnome2::VFS -> create(TMP . "/bla", "write", TRUE, 0644); Gnome2::VFS -> create(TMP . "/blu", "write", TRUE, 0644); is(Gnome2::VFS::Directory -> visit(TMP, qw(default), qw(default), $callback), "ok"); is(Gnome2::VFS::Directory -> visit_uri(Gnome2::VFS::URI -> new(TMP), qw(default), qw(default), $callback), "ok"); is(Gnome2::VFS::Directory -> visit_files(TMP, [qw(bla blu)], qw(default), qw(default), $callback), "ok"); is(Gnome2::VFS::Directory -> visit_files_at_uri(Gnome2::VFS::URI -> new(TMP), [qw(bla blu)], qw(default), qw(default), $callback), "ok"); Gnome2::VFS -> unlink(TMP . "/blu"); Gnome2::VFS -> unlink(TMP . "/bla"); ############################################################################### my @infos; ($result, @infos) = Gnome2::VFS::Directory -> list_load(TMP, qw(default)); ok(-e TMP . "/" . $infos[0] -> { name }); ############################################################################### Gnome2::VFS -> shutdown(); ############################################################################### rmdir(TMP) or die("Urgh, couldn't delete the scratch directory: $!\n"); Gnome2-VFS-1.082/t/GnomeVFSDNSSD0000644000175000017500000000473312222506645014336 0ustar lacklack#!/usr/bin/perl -w use strict; use Gnome2::VFS; use Test::More; use Data::Dumper; # $Id$ unless (-d "$ENV{ HOME }/.gnome") { plan(skip_all => "You have no ~/.gnome"); } unless (Gnome2::VFS -> CHECK_VERSION(2, 8, 0)) { plan(skip_all => "This is new in 2.8"); } plan(tests => 16); Gnome2::VFS -> init(); ############################################################################### my $browse_callback = sub { print Dumper \@_; }; my $resolve_callback = sub { print Dumper \@_; }; ############################################################################### my ($result, $handle, @services, @domains, $host, $port, $text, $text_raw); ($result, $handle) = Gnome2::VFS::DNSSD -> browse("dns-sd.org", "_http._tcp", $browse_callback); is($result, "ok"); isa_ok($handle, "Gnome2::VFS::DNSSD::Browse::Handle"); is($handle -> stop(), "ok"); ($result, $handle) = Gnome2::VFS::DNSSD -> resolve("http", "_http._tcp", "dns-sd.org", 1000, $resolve_callback); is($result, "ok"); isa_ok($handle, "Gnome2::VFS::DNSSD::Resolve::Handle"); is($handle -> cancel(), "ok"); ($result, @services) = Gnome2::VFS::DNSSD -> browse_sync("dns-sd.org", "_http._tcp", 1000); is($result, "error-generic"); is(@services, 0); ($result, $host, $port, $text, $text_raw) = Gnome2::VFS::DNSSD -> resolve_sync("http", "_http._tcp", "dns-sd.org", 1000); is($result, "error-generic"); ok(not defined $host); is($port, 0); isa_ok($text, "HASH"); ok(not defined $text_raw); ($result, @domains) = Gnome2::VFS::DNSSD -> list_browse_domains_sync("dns-sd.org", 1000); is($result, "error-generic"); is(@domains, 0); is_deeply([Gnome2::VFS -> get_default_browse_domains()], ["dns-sd.org"]); ############################################################################### # use Gtk2 -init; # Glib::Timeout -> add(1000, sub { Gtk2 -> main_quit(); 0; }); # Gtk2 -> main(); Gnome2::VFS -> shutdown(); Gnome2-VFS-1.082/t/GnomeVFSMime0000644000175000017500000000635112222506645014350 0ustar lacklack#!/usr/bin/perl -w use strict; use Gnome2::VFS; use Test::More; # $Id$ plan -d "$ENV{ HOME }/.gnome" ? (tests => 20) : (skip_all => "You have no ~/.gnome"); Gnome2::VFS -> init(); ############################################################################### my $monitor = Gnome2::VFS::Mime::Monitor -> get(); isa_ok($monitor, "Gnome2::VFS::Mime::Monitor"); my $type = Gnome2::VFS::Mime::Type -> new("text/html"); my $application = $type -> get_default_application_for_uri("http://www.google.com"); $application = $type -> get_default_application(); SKIP: { skip("you don't seem to have a default application associated with text/html", 8) unless (defined($application)); isa_ok($application, "Gnome2::VFS::Mime::Application"); ok(defined($application -> { id })); isa_ok($application -> { supported_uri_schemes }, "ARRAY"); ok(Gnome2::VFS::Mime -> id_in_application_list("firefox.desktop", $application, $application)); is(Gnome2::VFS::Mime -> id_list_from_application_list($application), "firefox.desktop"); # is($application -> launch("http://gtk2-perl.sf.net"), "ok"); # is($application -> launch_with_env(["http://gtk2-perl.sf.net"], [map { "$_=" . $ENV{ $_ } } (keys(%ENV))]), "ok"); isa_ok(($type -> get_short_list_applications())[0], "Gnome2::VFS::Mime::Application"); isa_ok(($type -> get_all_applications())[0], "Gnome2::VFS::Mime::Application"); isa_ok(($type -> get_all_applications_for_uri("http://www.google.com"))[0], "Gnome2::VFS::Mime::Application"); } isa_ok(Gnome2::VFS::Mime::Application -> new_from_id("firefox.desktop"), "Gnome2::VFS::Mime::Application"); isa_ok(Gnome2::VFS::Mime::Application -> new_from_desktop_id("firefox.desktop"), "Gnome2::VFS::Mime::Application"); # $type -> get_icon(); # $type -> set_icon(...); # is($type -> set_description("HTML Foo"), "ok"); # is($type -> get_description(), "HTML Foo"); # is($type -> set_can_be_executable(0), "ok"); # ok(not $type -> can_be_executable()); # is($type -> add_application_to_short_list("galeon"), "ok"); # is($type -> remove_application_from_short_list("galeon"), "ok"); # is($type -> add_extension("htm"), "ok"); # is($type -> remove_extension("htm"), "ok"); # is($type -> set_short_list_applications(qw(galeon epiphany)), "ok"); # is($type -> extend_all_applications(qw(xmms)), "ok"); # is($type -> remove_from_all_applications(qw(xmms)), "ok"); # is($type -> set_default_application("galeon"), "ok"); # is($type -> get_default_action_type(), "application"); # is($type -> set_default_action_type("none"), "ok"); # is($type -> get_default_action_type(), "none"); ok(defined Gnome2::VFS -> get_mime_type("/usr/bin/perl")); ok(defined Gnome2::VFS -> get_slow_mime_type("/usr/bin/perl"), "slow mime type"); is(Gnome2::VFS -> get_mime_type_for_data(""), "text/html"); is(Gnome2::VFS -> get_mime_type_for_name("foo.html"), "text/html"); is(Gnome2::VFS -> get_mime_type_for_name_and_data("foo.html", ""), "text/html"); ok(defined $type -> get_all_desktop_entries()); ok(defined $type -> get_default_desktop_entry()); TODO: { local $TODO = "hmm"; is($type -> get_equivalence($type), "identical"); ok($type -> is_equal($type)); } ############################################################################### Gnome2::VFS -> shutdown(); Gnome2-VFS-1.082/t/GnomeVFSApplicationRegistry0000644000175000017500000000316012222506645017450 0ustar lacklack#!/usr/bin/perl -w use strict; use Gnome2::VFS; use Test::More; # $Id$ plan -d "$ENV{ HOME }/.gnome" ? (tests => 12) : (skip_all => "You have no ~/.gnome"); Gnome2::VFS -> init(); Gnome2::VFS::ApplicationRegistry -> reload(); ############################################################################### ok(Gnome2::VFS::ApplicationRegistry -> get_applications()); my $application = Gnome2::VFS::ApplicationRegistry -> new("gnome-terminal"); isa_ok($application, "Gnome2::VFS::Application"); ok($application -> exists()); ok($application -> get_keys()); is($application -> peek_value("name"), "Terminal"); is_deeply([$application -> get_bool_value("can_open_multiple_files")], [0, 1]); $application -> set_value("name", "Terminal Bla"); $application -> set_bool_value("can_open_multiple_files", 0); $application -> unset_key("name"); ok($application -> get_mime_types()); ok($application -> supports_mime_type(($application -> get_mime_types())[0])); $application -> add_mime_type("text/plain"); $application -> remove_mime_type("text/plain"); $application -> clear_mime_types(); ok(not $application -> supports_uri_scheme("http")); my $mime_application = $application -> get_mime_application(); isa_ok($mime_application, "Gnome2::VFS::Mime::Application"); ok(not $mime_application -> is_user_owned()); $mime_application -> save(); $application -> remove_application(); ############################################################################### Gnome2::VFS::ApplicationRegistry -> reload(); is(Gnome2::VFS::ApplicationRegistry -> sync(), "ok"); Gnome2::VFS::ApplicationRegistry -> shutdown(); Gnome2::VFS -> shutdown(); Gnome2-VFS-1.082/t/GnomeVFSOps.t0000644000175000017500000001164612222506645014467 0ustar lacklack#!/usr/bin/perl -w use strict; use Gnome2::VFS; use Test::More; # $Id$ plan -d "$ENV{ HOME }/.gnome" ? (tests => 48) : (skip_all => "You have no ~/.gnome"); Gnome2::VFS -> init(); ############################################################################### use Cwd qw(cwd); use constant TMP => cwd() . "/tmp"; unless (-e TMP) { mkdir(TMP) or die ("Urgh, couldn't create the scratch directory: $!"); } ############################################################################### my ($result, $handle); foreach ([Gnome2::VFS -> open(cwd() . "/" . $0, "read")], [Gnome2::VFS::URI -> new(cwd() . "/" . $0) -> open("read")], [Gnome2::VFS -> create(TMP . "/blaaaaaaaaa", "write", 1, 0777)], [Gnome2::VFS::URI -> new(TMP . "/bleeeeeeeee") -> create("write", 1, 0666)]) { ($result, $handle) = @{$_}; is($result, "ok"); isa_ok($handle, "Gnome2::VFS::Handle"); is($handle -> close(), "ok"); } ############################################################################### is(Gnome2::VFS -> move(TMP . "/blaaaaaaaaa", TMP . "/bla", 0), "ok"); is(Gnome2::VFS::URI -> new(TMP . "/bleeeeeeeee") -> move(Gnome2::VFS::URI -> new(TMP . "/ble"), 0), "ok"); is_deeply([Gnome2::VFS -> check_same_fs(TMP . "/bla", TMP . "/ble")], ["ok", 1]); is_deeply([Gnome2::VFS::URI -> new(TMP . "/bla") -> check_same_fs(Gnome2::VFS::URI -> new(TMP . "/ble"))], ["ok", 1]); is(Gnome2::VFS -> create_symbolic_link(Gnome2::VFS::URI -> new(TMP . "/bli"), "/usr/bin/perl"), "ok"); is(Gnome2::VFS -> set_file_info(TMP . "/bla", { permissions => [qw/user-read user-write/] }, qw/permissions/), "ok"); is(Gnome2::VFS -> unlink(TMP . "/bla"), "ok"); is(Gnome2::VFS -> unlink(TMP . "/bli"), "ok"); my $uri = Gnome2::VFS::URI -> new(TMP . "/ble"); is($uri -> set_file_info({ permissions => [qw/user-read user-write/] }, qw/permissions/), "ok"); ok($uri -> exists()); is($uri -> unlink(), "ok"); ############################################################################### ($result, $handle) = Gnome2::VFS -> create(TMP . "/blu", "write", 1, 0644); is($result, "ok"); is_deeply([$handle -> write("blaaa!", 6)], ["ok", 6]); ($result, $handle) = Gnome2::VFS -> open(TMP . "/blu", "read"); is($result, "ok"); is_deeply([$handle -> read(6)], ["ok", 6, "blaaa!"]); is_deeply([$handle -> tell()], ["ok", 6]); is($handle -> seek("start", 2), "ok"); is_deeply([$handle -> read(4)], ["ok", 4, "aaa!"]); is($handle -> truncate(0), "error-not-supported"); SKIP: { skip "forget_cache is new in 2.12", 1 unless Gnome2::VFS -> CHECK_VERSION(2, 12, 0); is($handle -> forget_cache(0, 0), "ok"); } is($handle -> close(), "ok"); ############################################################################### is(Gnome2::VFS -> truncate(TMP . "/blu", 5), "ok"); is(Gnome2::VFS::URI -> new(TMP . "/blu") -> truncate(4), "ok"); ($result, $handle) = Gnome2::VFS -> open(TMP . "/blu", [qw(read write random)]); is($result, "ok"); my $info; ($result, $info) = Gnome2::VFS -> get_file_info(TMP . "/blu", qw(default)); is($result, "ok"); is($info -> { size }, 4); ($result, $info) = Gnome2::VFS::URI -> new(TMP . "/blu") -> get_file_info(qw(get-mime-type)); is($result, "ok"); ok(defined($info -> { mime_type })); ($result, $info) = $handle -> get_file_info(qw(default)); is($result, "ok"); isa_ok($info -> { permissions }, "Gnome2::VFS::FilePermissions"); is($handle -> close(), "ok"); is(Gnome2::VFS -> unlink(TMP . "/blu"), "ok"); ############################################################################### # FIXME: any way to reliably test this? (currently needs FAM and some luck.) # my $monitor; # ($result, $monitor) = Gnome2::VFS::Monitor -> add(TMP, qw(directory), sub { # my ($handle, $monitor_uri, $info_uri, $event_type) = @_; # isa_ok($handle, "Gnome2::VFS::Monitor::Handle"); # is($monitor_uri, "file://" . TMP); # is($info_uri, "file://" . TMP . "/ulb"); # ok($event_type eq "created" or $event_type eq "deleted"); # }); # is($result, "ok"); # isa_ok($monitor, "Gnome2::VFS::Monitor::Handle"); ############################################################################### is(Gnome2::VFS -> make_directory(TMP . "/ulb", 0755), "ok"); is(Gnome2::VFS -> remove_directory(TMP . "/ulb"), "ok"); $uri = Gnome2::VFS::URI -> new(TMP . "/ulb"); is($uri -> make_directory(0755), "ok"); is($uri -> remove_directory(), "ok"); ############################################################################### # shortly enter the main loop so that the monitor receives the events. # Glib::Idle -> add(sub { # Gtk2 -> main_quit(); # return 0; # }); # use Gtk2 -init; # Gtk2 -> main(); # is($monitor -> cancel(), "ok"); ############################################################################### Gnome2::VFS -> shutdown(); ############################################################################### rmdir(TMP) or die("Urgh, couldn't delete the scratch directory: $!\n"); Gnome2-VFS-1.082/t/GnomeVFSFileInfo.t0000644000175000017500000000231512222506645015412 0ustar lacklack#!/usr/bin/perl -w use strict; use Gnome2::VFS; use Cwd qw(cwd); use Test::More; # $Id$ plan -d "$ENV{ HOME }/.gnome" ? (tests => 12) : (skip_all => "You have no ~/.gnome"); Gnome2::VFS -> init(); ############################################################################### my $info = Gnome2::VFS -> get_file_info(cwd() . "/" . $0, qw(get-mime-type)); isa_ok($info, "Gnome2::VFS::FileInfo"); ok($info -> matches($info)); is($info -> get_mime_type(), $info -> { mime_type }); ############################################################################### $info = Gnome2::VFS::FileInfo -> new({ name => $0, type => "regular", permissions => [qw(user-read user-write)], flags => "local", size => 23, mime_type => "text/plain" }); isa_ok($info, "Gnome2::VFS::FileInfo"); ok($info -> matches($info)); is($info -> get_mime_type(), $info -> { mime_type }); is($info -> { name }, $0); is($info -> { type }, "regular"); is_deeply(\@{ $info -> { permissions } }, [qw(user-read user-write)]); ok($info -> { flags } >= ["local"]); is($info -> { size }, 23); is($info -> { mime_type }, "text/plain"); ############################################################################### Gnome2::VFS -> shutdown(); Gnome2-VFS-1.082/t/GnomeVFSVolume0000644000175000017500000000325212222506645014725 0ustar lacklack#!/usr/bin/perl -w use strict; use Gnome2::VFS; use Test::More; # $Id$ unless (-d "$ENV{ HOME }/.gnome") { plan(skip_all => "You have no ~/.gnome"); } unless (Gnome2::VFS -> CHECK_VERSION(2, 6, 0)) { plan(skip_all => "This is new in 2.6"); } plan(tests => 14); Gnome2::VFS -> init(); ############################################################################### my $monitor = Gnome2::VFS -> get_volume_monitor(); my $volume = ($monitor -> get_mounted_volumes())[0]; ok(defined($volume -> get_volume_type())); ok(defined($volume -> get_device_type())); my $drive = $volume -> get_drive(); ok(not defined $drive or ref $drive eq "Gnome2::VFS::Drive"); ok(defined $volume -> get_device_path()); ok(defined $volume -> get_activation_uri()); ok(defined $volume -> get_filesystem_type()); ok(defined $volume -> get_display_name()); ok(defined $volume -> get_icon()); my $boolean = qr/^(?:1|)$/; like($volume -> is_user_visible(), $boolean); like($volume -> is_read_only(), $boolean); like($volume -> is_mounted(), $boolean); like($volume -> handles_trash(), $boolean); is($volume -> compare($volume), 0); SKIP: { skip("get_hal_udi is new in 2.8", 1) unless (Gnome2::VFS -> CHECK_VERSION(2, 8, 0)); ok(defined $volume -> get_hal_udi()); } # Gnome2::VFS -> connect_to_server("/mnt/win", "Windows", "windows.png"); ############################################################################### # $volume -> unmount(sub { warn @_; }); # $volume -> eject(sub { warn @_; }); # use Gtk2 -init; # Glib::Timeout -> add(1000, sub { Gtk2 -> main_quit(); 0; }); # Gtk2 -> main(); ############################################################################### Gnome2::VFS -> shutdown(); Gnome2-VFS-1.082/t/GnomeVFS.t0000644000175000017500000000174012222506645013777 0ustar lacklack#!/usr/bin/perl -w use strict; use Test::More; # $Id$ plan -d "$ENV{ HOME }/.gnome" ? (tests => 3) : (skip_all => "You have no ~/.gnome"); ############################################################################### use_ok("Gnome2::VFS", qw( GNOME_VFS_PRIORITY_MIN GNOME_VFS_PRIORITY_MAX GNOME_VFS_PRIORITY_DEFAULT GNOME_VFS_SIZE_FORMAT_STR GNOME_VFS_OFFSET_FORMAT_STR GNOME_VFS_MIME_TYPE_UNKNOWN GNOME_VFS_URI_MAGIC_STR GNOME_VFS_URI_PATH_STR )); Gnome2::VFS -> init(); ok(Gnome2::VFS -> initialized()); ############################################################################### # FIXME: how to reliably test this? seems to require a running nautilus. # my ($result, $uri) = Gnome2::VFS -> find_directory("/home", "desktop", 0, 1, 0755); # is($result, "ok"); # isa_ok($uri, "Gnome2::VFS::URI"); ok(defined Gnome2::VFS -> result_to_string("ok")); ############################################################################### Gnome2::VFS -> shutdown(); Gnome2-VFS-1.082/t/GnomeVFSAddress.t0000644000175000017500000000153312222506645015305 0ustar lacklack#!/usr/bin/perl -w use strict; use Gnome2::VFS; use Test::More; # $Id$ unless (-d "$ENV{ HOME }/.gnome") { plan(skip_all => "You have no ~/.gnome"); } unless (Gnome2::VFS -> CHECK_VERSION(2, 8, 0)) { plan(skip_all => "This is new in 2.8"); } plan(tests => 5); Gnome2::VFS -> init(); ############################################################################### my $address = Gnome2::VFS::Address -> new_from_string("127.0.0.1"); isa_ok($address, "Gnome2::VFS::Address"); like($address -> get_family_type(), qr/^\d+$/); is($address -> to_string(), "127.0.0.1"); SKIP: { skip "forget_cache is new in 2.12", 2 unless Gnome2::VFS -> CHECK_VERSION(2, 13, 1); ok($address -> equal($address)); ok($address -> match($address, 4)); } ############################################################################### Gnome2::VFS -> shutdown(); Gnome2-VFS-1.082/t/GnomeVFSResolve.t0000644000175000017500000000124412222506645015336 0ustar lacklack#!/usr/bin/perl -w use strict; use Gnome2::VFS; use Test::More; # $Id$ unless (-d "$ENV{ HOME }/.gnome") { plan(skip_all => "You have no ~/.gnome"); } unless (Gnome2::VFS -> CHECK_VERSION(2, 8, 0)) { plan(skip_all => "This is new in 2.8"); } plan(tests => 2); Gnome2::VFS -> init(); ############################################################################### my $handle = Gnome2::VFS -> resolve("localhost"); isa_ok($handle, "Gnome2::VFS::Resolve::Handle"); isa_ok($handle -> next_address(), "Gnome2::VFS::Address"); $handle -> reset_to_beginning(); ############################################################################### Gnome2::VFS -> shutdown(); Gnome2-VFS-1.082/t/GnomeVFSVolumeMonitor0000644000175000017500000000173612222506645016302 0ustar lacklack#!/usr/bin/perl -w use strict; use Gnome2::VFS; use Test::More; # $Id$ unless (-d "$ENV{ HOME }/.gnome") { plan(skip_all => "You have no ~/.gnome"); } unless (Gnome2::VFS -> CHECK_VERSION(2, 6, 0)) { plan(skip_all => "This is new in 2.6"); } plan(tests => 6); Gnome2::VFS -> init(); ############################################################################### my $monitor = Gnome2::VFS -> get_volume_monitor(); isa_ok($monitor, "Gnome2::VFS::VolumeMonitor"); my @volumes = $monitor -> get_mounted_volumes(); isa_ok($volumes[0], "Gnome2::VFS::Volume"); my @drives = $monitor -> get_connected_drives(); isa_ok($drives[0], "Gnome2::VFS::Drive"); isa_ok($monitor -> get_volume_for_path("/dev/cdrom"), "Gnome2::VFS::Volume"); is($monitor -> get_volume_by_id($volumes[0] -> get_id()), $volumes[0]); is($monitor -> get_drive_by_id($drives[0] -> get_id()), $drives[0]); ############################################################################### Gnome2::VFS -> shutdown(); Gnome2-VFS-1.082/t/GnomeVFSDrive0000644000175000017500000000306112222506645014525 0ustar lacklack#!/usr/bin/perl -w use strict; use Gnome2::VFS; use Test::More; # $Id$ unless (-d "$ENV{ HOME }/.gnome") { plan(skip_all => "You have no ~/.gnome"); } unless (Gnome2::VFS -> CHECK_VERSION(2, 6, 0)) { plan(skip_all => "This is new in 2.6"); } plan(tests => 13); Gnome2::VFS -> init(); ############################################################################### my $monitor = Gnome2::VFS -> get_volume_monitor(); my $drive = ($monitor -> get_connected_drives())[0]; like($drive -> get_id(), qr/^\d+$/); ok(defined $drive -> get_device_type()); ok(defined $drive -> get_device_path()); ok(defined $drive -> get_activation_uri()); ok(defined $drive -> get_display_name()); ok(defined $drive -> get_icon()); my $boolean = qr/^(?:1|)$/; like($drive -> is_user_visible(), $boolean); like($drive -> is_connected(), $boolean); like($drive -> is_mounted(), $boolean); is($drive -> compare($drive), 0); SKIP: { skip("get_mounted_volumes and get_hal_udi are new in 2.8", 2) unless (Gnome2::VFS -> CHECK_VERSION(2, 8, 0)); isa_ok(($drive -> get_mounted_volumes())[0], "Gnome2::VFS::Volume"); ok(defined $drive -> get_hal_udi()); } ############################################################################### # $drive -> mount(sub { warn @_; }); # $drive -> unmount(sub { warn @_; }); # $drive -> eject(sub { warn @_; }); # use Gtk2 -init; # Glib::Timeout -> add(1000, sub { Gtk2 -> main_quit(); 0; }); # Gtk2 -> main(); ok(!$drive -> needs_eject()); ############################################################################### Gnome2::VFS -> shutdown(); Gnome2-VFS-1.082/t/GnomeVFSXfer.t0000644000175000017500000000612712222506645014630 0ustar lacklack#!/usr/bin/perl -w use strict; use Gnome2::VFS; use Test::More; # $Id$ plan -d "$ENV{ HOME }/.gnome" ? (tests => 11) : (skip_all => "You have no ~/.gnome"); Gnome2::VFS -> init(); ############################################################################### use Cwd qw(cwd); use constant TMP => cwd() . "/tmp"; unless (-e TMP) { mkdir(TMP) or die ("Urgh, couldn't create the scratch directory: $!"); } ############################################################################### my $progress = sub { my ($info) = @_; my $done_that = 0 if 0; isa_ok($info, "HASH") unless $done_that++; if ($info -> { status } eq "ok") { return 1; } elsif ($info -> { status } eq "vfserror") { return "abort"; } elsif ($info -> { status } eq "overwrite") { return "replace"; } return 0; }; ############################################################################### foreach (qw(a e i o)) { my $handle = Gnome2::VFS -> create(TMP . "/bl" . $_, "write", 1, 0644); $handle -> write("blaaa!", 6); $handle -> close(); } ############################################################################### my $source = Gnome2::VFS::URI -> new("file://" . TMP . "/bla"); my $destination = Gnome2::VFS::URI -> new("file://" . TMP . "/blaa"); is(Gnome2::VFS::Xfer -> uri($source, $destination, qw(default), qw(query), qw(query), $progress), "ok"); ok(-e $destination -> to_string(qw(toplevel-method))); is($source -> unlink(), "ok"); is($destination -> unlink(), "ok"); ############################################################################### my @source = (Gnome2::VFS::URI -> new("file://" . TMP . "/ble"), Gnome2::VFS::URI -> new("file://" . TMP . "/bli"), Gnome2::VFS::URI -> new("file://" . TMP . "/blo")); my @destination = (Gnome2::VFS::URI -> new("file://" . TMP . "/blee"), Gnome2::VFS::URI -> new("file://" . TMP . "/blii"), Gnome2::VFS::URI -> new("file://" . TMP . "/bloo")); is(Gnome2::VFS::Xfer -> uri_list(\@source, \@destination, qw(default), qw(query), qw(query), $progress), "ok"); foreach (@destination) { ok(-e $_ -> to_string(qw(toplevel-method))); } is(Gnome2::VFS::Xfer -> delete_list(\@source, qw(query), qw(default), $progress), "ok"); is(Gnome2::VFS::Xfer -> delete_list(\@destination, qw(query), qw(default), $progress), "ok"); ############################################################################### Gnome2::VFS -> shutdown(); ############################################################################### rmdir(TMP) or die("Urgh, couldn't delete the scratch directory: $!\n"); Gnome2-VFS-1.082/xs/0000755000175000017500000000000012222514155012346 5ustar lacklackGnome2-VFS-1.082/xs/GnomeVFSOps.xs0000644000175000017500000003645212222506645015047 0ustar lacklack/* * Copyright (C) 2003-2005 by the gtk2-perl team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * $Id$ */ #include "vfs2perl.h" #include /* ------------------------------------------------------------------------- */ static GPerlCallback * vfs2perl_monitor_callback_create (SV *func, SV *data) { return gperl_callback_new (func, data, 0, NULL, 0); } static void vfs2perl_monitor_callback (GnomeVFSMonitorHandle *handle, const gchar *monitor_uri, const gchar *info_uri, GnomeVFSMonitorEventType event_type, GPerlCallback *callback) { dGPERL_CALLBACK_MARSHAL_SP; GPERL_CALLBACK_MARSHAL_INIT (callback); ENTER; SAVETMPS; PUSHMARK (SP); EXTEND (SP, 4); PUSHs (sv_2mortal (newSVGnomeVFSMonitorHandle (handle))); PUSHs (sv_2mortal (newSVGChar (monitor_uri))); PUSHs (sv_2mortal (newSVGChar (info_uri))); PUSHs (sv_2mortal (newSVGnomeVFSMonitorEventType (event_type))); if (callback->data) XPUSHs (sv_2mortal (newSVsv (callback->data))); PUTBACK; call_sv (callback->func, G_DISCARD); SPAGAIN; FREETMPS; LEAVE; } /* ------------------------------------------------------------------------- */ MODULE = Gnome2::VFS::Ops PACKAGE = Gnome2::VFS PREFIX = gnome_vfs_ =for object Gnome2::VFS::main =cut =for apidoc Returns a GnomeVFSResult and a GnomeVFSHandle. =cut ## GnomeVFSResult gnome_vfs_open (GnomeVFSHandle **handle, const gchar *text_uri, GnomeVFSOpenMode open_mode) void gnome_vfs_open (class, text_uri, open_mode) const gchar *text_uri GnomeVFSOpenMode open_mode PREINIT: GnomeVFSResult result; GnomeVFSHandle *handle; PPCODE: result = gnome_vfs_open (&handle, text_uri, open_mode); EXTEND (sp, 2); PUSHs (sv_2mortal (newSVGnomeVFSResult (result))); PUSHs (sv_2mortal (newSVGnomeVFSHandle (handle))); =for apidoc Returns a GnomeVFSResult and a GnomeVFSHandle. =cut ## GnomeVFSResult gnome_vfs_create (GnomeVFSHandle **handle, const gchar *text_uri, GnomeVFSOpenMode open_mode, gboolean exclusive, guint perm) void gnome_vfs_create (class, text_uri, open_mode, exclusive, perm) const gchar *text_uri GnomeVFSOpenMode open_mode gboolean exclusive guint perm PREINIT: GnomeVFSResult result; GnomeVFSHandle *handle; PPCODE: result = gnome_vfs_create (&handle, text_uri, open_mode, exclusive, perm); EXTEND (sp, 2); PUSHs (sv_2mortal (newSVGnomeVFSResult (result))); PUSHs (sv_2mortal (newSVGnomeVFSHandle (handle))); ## GnomeVFSResult gnome_vfs_unlink (const gchar *text_uri) GnomeVFSResult gnome_vfs_unlink (class, text_uri) const gchar *text_uri C_ARGS: text_uri ## GnomeVFSResult gnome_vfs_move (const gchar *old_text_uri, const gchar *new_text_uri, gboolean force_replace) GnomeVFSResult gnome_vfs_move (class, old_text_uri, new_text_uri, force_replace) const gchar *old_text_uri const gchar *new_text_uri gboolean force_replace C_ARGS: old_text_uri, new_text_uri, force_replace =for apidoc Returns a GnomeVFSResult and a boolean. =cut ## GnomeVFSResult gnome_vfs_check_same_fs (const gchar *source, const gchar *target, gboolean *same_fs_return) void gnome_vfs_check_same_fs (class, source, target) const gchar *source const gchar *target PREINIT: GnomeVFSResult result; gboolean same_fs_return; PPCODE: result = gnome_vfs_check_same_fs (source, target, &same_fs_return); EXTEND (sp, 2); PUSHs (sv_2mortal (newSVGnomeVFSResult (result))); PUSHs (sv_2mortal (newSVuv (same_fs_return))); ## GnomeVFSResult gnome_vfs_create_symbolic_link (GnomeVFSURI *uri, const gchar *target_reference) GnomeVFSResult gnome_vfs_create_symbolic_link (class, uri, target_reference) GnomeVFSURI *uri const gchar *target_reference C_ARGS: uri, target_reference =for apidoc Returns a GnomeVFSResult and a GnomeVFSFileInfo. =cut ## GnomeVFSResult gnome_vfs_get_file_info (const gchar *text_uri, GnomeVFSFileInfo *info, GnomeVFSFileInfoOptions options) void gnome_vfs_get_file_info (class, text_uri, options) const gchar *text_uri GnomeVFSFileInfoOptions options PREINIT: GnomeVFSResult result; GnomeVFSFileInfo *info; PPCODE: info = gnome_vfs_file_info_new (); result = gnome_vfs_get_file_info (text_uri, info, options); EXTEND (sp, 2); PUSHs (sv_2mortal (newSVGnomeVFSResult (result))); PUSHs (sv_2mortal (newSVGnomeVFSFileInfo (info))); gnome_vfs_file_info_unref (info); ## GnomeVFSResult gnome_vfs_truncate (const gchar *text_uri, GnomeVFSFileSize length) GnomeVFSResult gnome_vfs_truncate (class, text_uri, length) const gchar *text_uri GnomeVFSFileSize length C_ARGS: text_uri, length ## GnomeVFSResult gnome_vfs_make_directory (const gchar *text_uri, guint perm) GnomeVFSResult gnome_vfs_make_directory (class, text_uri, perm) const gchar *text_uri guint perm C_ARGS: text_uri, perm ## GnomeVFSResult gnome_vfs_remove_directory (const gchar *text_uri) GnomeVFSResult gnome_vfs_remove_directory (class, text_uri) const gchar *text_uri C_ARGS: text_uri ## GnomeVFSResult gnome_vfs_set_file_info (const gchar *text_uri, GnomeVFSFileInfo *info, GnomeVFSSetFileInfoMask mask) GnomeVFSResult gnome_vfs_set_file_info (class, text_uri, info, mask) const gchar *text_uri GnomeVFSFileInfo *info GnomeVFSSetFileInfoMask mask C_ARGS: text_uri, info, mask # --------------------------------------------------------------------------- # MODULE = Gnome2::VFS::Ops PACKAGE = Gnome2::VFS::Handle PREFIX = gnome_vfs_ ## GnomeVFSResult gnome_vfs_close (GnomeVFSHandle *handle) GnomeVFSResult gnome_vfs_close (handle) GnomeVFSHandle *handle =for apidoc Returns a GnomeVFSResult, the number of bytes read and the buffer containing the read content. =cut ## GnomeVFSResult gnome_vfs_read (GnomeVFSHandle *handle, gpointer buffer, GnomeVFSFileSize bytes, GnomeVFSFileSize *bytes_read) void gnome_vfs_read (handle, bytes) GnomeVFSHandle *handle GnomeVFSFileSize bytes PREINIT: char *buffer; GnomeVFSResult result; GnomeVFSFileSize bytes_read = bytes; PPCODE: if (! bytes > 0) croak ("The number of bytes to read must be greater than 0"); buffer = g_new0 (char, bytes); result = gnome_vfs_read (handle, buffer, bytes, &bytes_read); EXTEND (sp, 3); PUSHs (sv_2mortal (newSVGnomeVFSResult (result))); PUSHs (sv_2mortal (newSVuv (bytes_read))); PUSHs (sv_2mortal (newSVpv (buffer, bytes_read))); g_free (buffer); =for apidoc Returns a GnomeVFSResult and the number of bytes written. =cut ## GnomeVFSResult gnome_vfs_write (GnomeVFSHandle *handle, gconstpointer buffer, GnomeVFSFileSize bytes, GnomeVFSFileSize *bytes_written) void gnome_vfs_write (handle, buffer, bytes) GnomeVFSHandle *handle char *buffer; GnomeVFSFileSize bytes PREINIT: GnomeVFSResult result; GnomeVFSFileSize bytes_written = bytes; PPCODE: result = gnome_vfs_write (handle, buffer, bytes, &bytes_written); EXTEND (sp, 3); PUSHs (sv_2mortal (newSVGnomeVFSResult (result))); PUSHs (sv_2mortal (newSVuv (bytes_written))); ## GnomeVFSResult gnome_vfs_seek (GnomeVFSHandle *handle, GnomeVFSSeekPosition whence, GnomeVFSFileOffset offset) GnomeVFSResult gnome_vfs_seek (handle, whence, offset) GnomeVFSHandle *handle GnomeVFSSeekPosition whence GnomeVFSFileOffset offset =for apidoc Returns a GnomeVFSResult and the offset. =cut ## GnomeVFSResult gnome_vfs_tell (GnomeVFSHandle *handle, GnomeVFSFileSize *offset_return) void gnome_vfs_tell (handle) GnomeVFSHandle *handle PREINIT: GnomeVFSResult result; GnomeVFSFileSize offset_return; PPCODE: result = gnome_vfs_tell (handle, &offset_return); EXTEND (sp, 2); PUSHs (sv_2mortal (newSVGnomeVFSResult (result))); PUSHs (sv_2mortal (newSViv (offset_return))); =for apidoc Returns a GnomeVFSResult and a GnomeVFSFileInfo. =cut ## GnomeVFSResult gnome_vfs_get_file_info_from_handle (GnomeVFSHandle *handle, GnomeVFSFileInfo *info, GnomeVFSFileInfoOptions options) void gnome_vfs_get_file_info (handle, options) GnomeVFSHandle *handle GnomeVFSFileInfoOptions options PREINIT: GnomeVFSResult result; GnomeVFSFileInfo *info; PPCODE: info = gnome_vfs_file_info_new (); result = gnome_vfs_get_file_info_from_handle (handle, info, options); EXTEND (sp, 2); PUSHs (sv_2mortal (newSVGnomeVFSResult (result))); PUSHs (sv_2mortal (newSVGnomeVFSFileInfo (info))); g_free (info); ## GnomeVFSResult gnome_vfs_truncate_handle (GnomeVFSHandle *handle, GnomeVFSFileSize length) GnomeVFSResult gnome_vfs_truncate (handle, length) GnomeVFSHandle *handle GnomeVFSFileSize length CODE: RETVAL = gnome_vfs_truncate_handle (handle, length); OUTPUT: RETVAL #if VFS_CHECK_VERSION (2, 12, 0) GnomeVFSResult gnome_vfs_forget_cache (GnomeVFSHandle *handle, GnomeVFSFileOffset offset, GnomeVFSFileSize size); #endif # --------------------------------------------------------------------------- # MODULE = Gnome2::VFS::Ops PACKAGE = Gnome2::VFS::URI PREFIX = gnome_vfs_uri_ =for apidoc Returns a GnomeVFSResult and a GnomeVFSHandle. =cut ## GnomeVFSResult gnome_vfs_open_uri (GnomeVFSHandle **handle, GnomeVFSURI *uri, GnomeVFSOpenMode open_mode) void gnome_vfs_uri_open (uri, open_mode) GnomeVFSURI *uri GnomeVFSOpenMode open_mode PREINIT: GnomeVFSResult result; GnomeVFSHandle *handle; PPCODE: result = gnome_vfs_open_uri (&handle, uri, open_mode); EXTEND (sp, 2); PUSHs (sv_2mortal (newSVGnomeVFSResult (result))); PUSHs (sv_2mortal (newSVGnomeVFSHandle (handle))); =for apidoc Returns a GnomeVFSResult and a GnomeVFSHandle. =cut ## GnomeVFSResult gnome_vfs_create_uri (GnomeVFSHandle **handle, GnomeVFSURI *uri, GnomeVFSOpenMode open_mode, gboolean exclusive, guint perm) void gnome_vfs_uri_create (uri, open_mode, exclusive, perm) GnomeVFSURI *uri GnomeVFSOpenMode open_mode gboolean exclusive guint perm PREINIT: GnomeVFSResult result; GnomeVFSHandle *handle; PPCODE: result = gnome_vfs_create_uri (&handle, uri, open_mode, exclusive, perm); EXTEND (sp, 2); PUSHs (sv_2mortal (newSVGnomeVFSResult (result))); PUSHs (sv_2mortal (newSVGnomeVFSHandle (handle))); ## GnomeVFSResult gnome_vfs_move_uri (GnomeVFSURI *old_uri, GnomeVFSURI *new_uri, gboolean force_replace) GnomeVFSResult gnome_vfs_uri_move (old_uri, new_uri, force_replace) GnomeVFSURI *old_uri GnomeVFSURI *new_uri gboolean force_replace CODE: RETVAL = gnome_vfs_move_uri (old_uri, new_uri, force_replace); OUTPUT: RETVAL =for apidoc Returns a GnomeVFSResult and a boolean. =cut ## GnomeVFSResult gnome_vfs_check_same_fs_uris (GnomeVFSURI *source_uri, GnomeVFSURI *target_uri, gboolean *same_fs_return) void gnome_vfs_uri_check_same_fs (source_uri, target_uri) GnomeVFSURI *source_uri GnomeVFSURI *target_uri PREINIT: GnomeVFSResult result; gboolean same_fs_return; PPCODE: result = gnome_vfs_check_same_fs_uris (source_uri, target_uri, &same_fs_return); EXTEND (sp, 2); PUSHs (sv_2mortal (newSVGnomeVFSResult (result))); PUSHs (sv_2mortal (newSVuv (same_fs_return))); ## gboolean gnome_vfs_uri_exists (GnomeVFSURI *uri) gboolean gnome_vfs_uri_exists (uri) GnomeVFSURI *uri ## GnomeVFSResult gnome_vfs_unlink_from_uri (GnomeVFSURI *uri) GnomeVFSResult gnome_vfs_uri_unlink (uri) GnomeVFSURI *uri CODE: RETVAL = gnome_vfs_unlink_from_uri (uri); OUTPUT: RETVAL =for apidoc Returns a GnomeVFSResult and a GnomeVFSFileInfo. =cut ## GnomeVFSResult gnome_vfs_get_file_info_uri (GnomeVFSURI *uri, GnomeVFSFileInfo *info, GnomeVFSFileInfoOptions options) void gnome_vfs_uri_get_file_info (uri, options) GnomeVFSURI *uri GnomeVFSFileInfoOptions options PREINIT: GnomeVFSResult result; GnomeVFSFileInfo *info; PPCODE: info = gnome_vfs_file_info_new (); result = gnome_vfs_get_file_info_uri (uri, info, options); EXTEND (sp, 2); PUSHs (sv_2mortal (newSVGnomeVFSResult (result))); PUSHs (sv_2mortal (newSVGnomeVFSFileInfo (info))); g_free (info); ## GnomeVFSResult gnome_vfs_truncate_uri (GnomeVFSURI *uri, GnomeVFSFileSize length) GnomeVFSResult gnome_vfs_uri_truncate (uri, length) GnomeVFSURI *uri GnomeVFSFileSize length CODE: RETVAL = gnome_vfs_truncate_uri (uri, length); OUTPUT: RETVAL ## GnomeVFSResult gnome_vfs_make_directory_for_uri (GnomeVFSURI *uri, guint perm) GnomeVFSResult gnome_vfs_uri_make_directory (uri, perm) GnomeVFSURI *uri guint perm CODE: RETVAL = gnome_vfs_make_directory_for_uri (uri, perm); OUTPUT: RETVAL ## GnomeVFSResult gnome_vfs_remove_directory_from_uri (GnomeVFSURI *uri) GnomeVFSResult gnome_vfs_uri_remove_directory (uri) GnomeVFSURI *uri CODE: RETVAL = gnome_vfs_remove_directory_from_uri (uri); OUTPUT: RETVAL ## GnomeVFSResult gnome_vfs_set_file_info_uri (GnomeVFSURI *uri, GnomeVFSFileInfo *info, GnomeVFSSetFileInfoMask mask) GnomeVFSResult gnome_vfs_uri_set_file_info (uri, info, mask) GnomeVFSURI *uri GnomeVFSFileInfo *info GnomeVFSSetFileInfoMask mask CODE: RETVAL = gnome_vfs_set_file_info_uri (uri, info, mask); OUTPUT: RETVAL # --------------------------------------------------------------------------- # MODULE = Gnome2::VFS::Ops PACKAGE = Gnome2::VFS::Monitor PREFIX = gnome_vfs_monitor_ =for apidoc Returns a GnomeVFSResult and a GnomeVFSMonitorHandle. =cut ## GnomeVFSResult gnome_vfs_monitor_add (GnomeVFSMonitorHandle **handle, const gchar *text_uri, GnomeVFSMonitorType monitor_type, GnomeVFSMonitorCallback callback, gpointer user_data) void gnome_vfs_monitor_add (class, text_uri, monitor_type, func, data=NULL) const gchar *text_uri GnomeVFSMonitorType monitor_type SV *func SV *data PREINIT: GnomeVFSResult result; GnomeVFSMonitorHandle *handle; GPerlCallback *callback; PPCODE: callback = vfs2perl_monitor_callback_create (func, data); /* FIXME: destroy that callback somehow. */ result = gnome_vfs_monitor_add (&handle, text_uri, monitor_type, (GnomeVFSMonitorCallback) vfs2perl_monitor_callback, callback); EXTEND (sp, 2); PUSHs (sv_2mortal (newSVGnomeVFSResult (result))); PUSHs (sv_2mortal (newSVGnomeVFSMonitorHandle (handle))); # --------------------------------------------------------------------------- # MODULE = Gnome2::VFS::Ops PACKAGE = Gnome2::VFS::Monitor::Handle PREFIX = gnome_vfs_monitor_ ## GnomeVFSResult gnome_vfs_monitor_cancel (GnomeVFSMonitorHandle *handle) GnomeVFSResult gnome_vfs_monitor_cancel (handle) GnomeVFSMonitorHandle *handle # --------------------------------------------------------------------------- # # according to the docs, not intended to be used directly. ### GnomeVFSResult gnome_vfs_file_control (GnomeVFSHandle *handle, const char *operation, gpointer operation_data) #GnomeVFSResult #gnome_vfs_file_control (handle, operation, operation_data) # GnomeVFSHandle *handle # const char *operation # gpointer operation_data Gnome2-VFS-1.082/xs/GnomeVFSURI.xs0000644000175000017500000001534512222506645014743 0ustar lacklack/* * Copyright (C) 2003 by the gtk2-perl team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * $Id$ */ #include "vfs2perl.h" MODULE = Gnome2::VFS::URI PACKAGE = Gnome2::VFS::URI PREFIX = gnome_vfs_uri_ ## GnomeVFSURI *gnome_vfs_uri_new (const gchar *text_uri) GnomeVFSURI_own * gnome_vfs_uri_new (class, text_uri) const gchar *text_uri C_ARGS: text_uri ## GnomeVFSURI *gnome_vfs_uri_resolve_relative (const GnomeVFSURI *base, const gchar *relative_reference) GnomeVFSURI_own * gnome_vfs_uri_resolve_relative (base, relative_reference) const GnomeVFSURI *base const gchar *relative_reference ### GnomeVFSURI *gnome_vfs_uri_ref (GnomeVFSURI *uri) #GnomeVFSURI * #gnome_vfs_uri_ref (uri) # GnomeVFSURI *uri ### void gnome_vfs_uri_unref (GnomeVFSURI *uri) #void #gnome_vfs_uri_unref (uri) # GnomeVFSURI *uri ## GnomeVFSURI *gnome_vfs_uri_append_string (const GnomeVFSURI *uri, const char *uri_fragment) GnomeVFSURI_own * gnome_vfs_uri_append_string (base, uri_fragment) const GnomeVFSURI *base const char *uri_fragment ## GnomeVFSURI *gnome_vfs_uri_append_path (const GnomeVFSURI *uri, const char *path) GnomeVFSURI_own * gnome_vfs_uri_append_path (base, path) const GnomeVFSURI *base const char *path ## GnomeVFSURI *gnome_vfs_uri_append_file_name (const GnomeVFSURI *uri, const gchar *filename) GnomeVFSURI_own * gnome_vfs_uri_append_file_name (base, filename) const GnomeVFSURI *base const gchar *filename ## gchar *gnome_vfs_uri_to_string (const GnomeVFSURI *uri, GnomeVFSURIHideOptions hide_options) gchar_own * gnome_vfs_uri_to_string (uri, hide_options=GNOME_VFS_URI_HIDE_NONE) const GnomeVFSURI *uri GnomeVFSURIHideOptions hide_options ### GnomeVFSURI *gnome_vfs_uri_dup (const GnomeVFSURI *uri) #GnomeVFSURI * #gnome_vfs_uri_dup (uri) # const GnomeVFSURI *uri ## gboolean gnome_vfs_uri_is_local (const GnomeVFSURI *uri) gboolean gnome_vfs_uri_is_local (uri) const GnomeVFSURI *uri ## gboolean gnome_vfs_uri_has_parent (const GnomeVFSURI *uri) gboolean gnome_vfs_uri_has_parent (uri) const GnomeVFSURI *uri ## GnomeVFSURI *gnome_vfs_uri_get_parent (const GnomeVFSURI *uri) GnomeVFSURI_own * gnome_vfs_uri_get_parent (uri) const GnomeVFSURI *uri # FIXME: unless someone begs for this, I won't touch it. ### GnomeVFSToplevelURI *gnome_vfs_uri_get_toplevel (const GnomeVFSURI *uri) #GnomeVFSToplevelURI * #gnome_vfs_uri_get_toplevel (uri) # const GnomeVFSURI *uri ## guint gnome_vfs_uri_get_host_name (const GnomeVFSURI *uri) const gchar * gnome_vfs_uri_get_host_name (uri) const GnomeVFSURI *uri ## guint gnome_vfs_uri_get_scheme (const GnomeVFSURI *uri) const gchar * gnome_vfs_uri_get_scheme (uri) const GnomeVFSURI *uri ## guint gnome_vfs_uri_get_host_port (const GnomeVFSURI *uri) guint gnome_vfs_uri_get_host_port (uri) const GnomeVFSURI *uri ## guint gnome_vfs_uri_get_user_name (const GnomeVFSURI *uri) const gchar * gnome_vfs_uri_get_user_name (uri) const GnomeVFSURI *uri ## guint gnome_vfs_uri_get_password (const GnomeVFSURI *uri) const gchar * gnome_vfs_uri_get_password (uri) const GnomeVFSURI *uri ## void gnome_vfs_uri_set_host_name (GnomeVFSURI *uri, const gchar *host_name) void gnome_vfs_uri_set_host_name (uri, host_name) GnomeVFSURI *uri const gchar *host_name ## void gnome_vfs_uri_set_host_port (GnomeVFSURI *uri, guint host_port) void gnome_vfs_uri_set_host_port (uri, host_port) GnomeVFSURI *uri guint host_port ## void gnome_vfs_uri_set_user_name (GnomeVFSURI *uri, const gchar *user_name) void gnome_vfs_uri_set_user_name (uri, user_name) GnomeVFSURI *uri const gchar *user_name ## void gnome_vfs_uri_set_password (GnomeVFSURI *uri, const gchar *password) void gnome_vfs_uri_set_password (uri, password) GnomeVFSURI *uri const gchar *password ## gboolean gnome_vfs_uri_equal (const GnomeVFSURI *a, const GnomeVFSURI *b) gboolean gnome_vfs_uri_equal (a, b) const GnomeVFSURI *a const GnomeVFSURI *b ## gboolean gnome_vfs_uri_is_parent (const GnomeVFSURI *possible_parent, const GnomeVFSURI *possible_child, gboolean recursive) gboolean gnome_vfs_uri_is_parent (possible_parent, possible_child, recursive) const GnomeVFSURI *possible_parent const GnomeVFSURI *possible_child gboolean recursive ### const gchar *gnome_vfs_uri_get_path (const GnomeVFSURI *uri) const gchar * gnome_vfs_uri_get_path (uri) const GnomeVFSURI *uri ### const gchar *gnome_vfs_uri_get_fragment_identifier (const GnomeVFSURI *uri) const gchar * gnome_vfs_uri_get_fragment_identifier (uri) const GnomeVFSURI *uri ## gchar *gnome_vfs_uri_extract_dirname (const GnomeVFSURI *uri) gchar_own * gnome_vfs_uri_extract_dirname (uri) const GnomeVFSURI *uri ## gchar *gnome_vfs_uri_extract_short_name (const GnomeVFSURI *uri) gchar_own * gnome_vfs_uri_extract_short_name (uri) const GnomeVFSURI *uri ## gchar *gnome_vfs_uri_extract_short_path_name (const GnomeVFSURI *uri) gchar_own * gnome_vfs_uri_extract_short_path_name (uri) const GnomeVFSURI *uri ### gint gnome_vfs_uri_hequal (gconstpointer a, gconstpointer b) #gint #gnome_vfs_uri_hequal (a, b) # gconstpointer a # gconstpointer b ### guint gnome_vfs_uri_hash (gconstpointer p) #guint #gnome_vfs_uri_hash (p) # gconstpointer p =for apidoc Returns a list of GnomeVFSURI's. =cut ## GList *gnome_vfs_uri_list_parse (const gchar* uri_list) ## GList *gnome_vfs_uri_list_ref (GList *list) ## GList *gnome_vfs_uri_list_unref (GList *list) ## GList *gnome_vfs_uri_list_copy (GList *list) ## void gnome_vfs_uri_list_free (GList *list) void gnome_vfs_uri_list_parse (class, uri_list) const gchar *uri_list PREINIT: GList *i, *list = NULL; PPCODE: list = gnome_vfs_uri_list_parse (uri_list); for (i = list; i != NULL; i = i->next) XPUSHs (sv_2mortal (newSVGnomeVFSURI (i->data))); gnome_vfs_uri_list_free (list); ## char *gnome_vfs_uri_make_full_from_relative (const char *base_uri, const char *relative_uri) char * gnome_vfs_uri_make_full_from_relative (class, base_uri, relative_uri) const char *base_uri const char *relative_uri C_ARGS: base_uri, relative_uri #if VFS_CHECK_VERSION (2, 16, 0) GnomeVFSURI_own * gnome_vfs_uri_resolve_symbolic_link (const GnomeVFSURI *base, const gchar *symbolic_link); #endif Gnome2-VFS-1.082/xs/GnomeVFSDNSSD.xs0000644000175000017500000002454312222506645015157 0ustar lacklack/* * Copyright (C) 2004, 2013 by the gtk2-perl team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * $Id$ */ #include "vfs2perl.h" #include /* ------------------------------------------------------------------------- */ static SV * newSVGnomeVFSDNSSDService (GnomeVFSDNSSDService *service) { HV *hv = newHV (); if (service->name) hv_store (hv, "name", 4, newSVpv (service->name, 0), 0); if (service->type) hv_store (hv, "type", 4, newSVpv (service->type, 0), 0); if (service->domain) hv_store (hv, "domain", 6, newSVpv (service->domain, 0), 0); return newRV_noinc ((SV *) hv); } /* ------------------------------------------------------------------------- */ static void hash_table_foreach (char *key, char *value, HV *hv) { if (key) hv_store (hv, key, strlen (key), value ? newSVpv (value, 0) : &PL_sv_undef, 0); } static SV * newSVGnomeVFSDNSSDResolveHashTable (GHashTable *table) { HV *hv = newHV (); if (table) g_hash_table_foreach (table, (GHFunc) hash_table_foreach, hv); return newRV_noinc ((SV *) hv); } /* ------------------------------------------------------------------------- */ static GPerlCallback * vfs2perl_dns_sd_resolve_callback_create (SV *func, SV *data) { return gperl_callback_new (func, data, 0, NULL, 0); } static void vfs2perl_dns_sd_resolve_callback (GnomeVFSDNSSDResolveHandle *handle, GnomeVFSResult result, const GnomeVFSDNSSDService *service, const char *host, int port, const GHashTable *text, int text_raw_len, const char *text_raw, GPerlCallback* callback) { dGPERL_CALLBACK_MARSHAL_SP; GPERL_CALLBACK_MARSHAL_INIT (callback); ENTER; SAVETMPS; PUSHMARK (SP); EXTEND (SP, 7); PUSHs (sv_2mortal (newSVGnomeVFSDNSSDResolveHandle (handle))); PUSHs (sv_2mortal (newSVGnomeVFSResult (result))); PUSHs (sv_2mortal (newSVGnomeVFSDNSSDService ((GnomeVFSDNSSDService *) service))); PUSHs (host ? sv_2mortal (newSVpv (host, 0)) : &PL_sv_undef); PUSHs (sv_2mortal (newSViv (port))); PUSHs (sv_2mortal (newSVGnomeVFSDNSSDResolveHashTable ((GHashTable *) text))); PUSHs (text_raw ? sv_2mortal (newSVpv (text_raw, text_raw_len)) : &PL_sv_undef); if (callback->data) XPUSHs (sv_2mortal (newSVsv (callback->data))); PUTBACK; call_sv (callback->func, G_DISCARD); FREETMPS; LEAVE; } /* ------------------------------------------------------------------------- */ static GPerlCallback * vfs2perl_dns_sd_browse_callback_create (SV *func, SV *data) { return gperl_callback_new (func, data, 0, NULL, 0); } static void vfs2perl_dns_sd_browse_callback (GnomeVFSDNSSDBrowseHandle *handle, GnomeVFSDNSSDServiceStatus status, const GnomeVFSDNSSDService *service, GPerlCallback* callback) { dGPERL_CALLBACK_MARSHAL_SP; GPERL_CALLBACK_MARSHAL_INIT (callback); ENTER; SAVETMPS; PUSHMARK (SP); EXTEND (SP, 3); PUSHs (sv_2mortal (newSVGnomeVFSDNSSDBrowseHandle (handle))); PUSHs (sv_2mortal (newSVGnomeVFSDNSSDServiceStatus (status))); PUSHs (sv_2mortal (newSVGnomeVFSDNSSDService ((GnomeVFSDNSSDService *) service))); if (callback->data) XPUSHs (sv_2mortal (newSVsv (callback->data))); PUTBACK; call_sv (callback->func, G_DISCARD); FREETMPS; LEAVE; } /* ------------------------------------------------------------------------- */ MODULE = Gnome2::VFS::DNSSD PACKAGE = Gnome2::VFS::DNSSD PREFIX = gnome_vfs_dns_sd_ ## GnomeVFSResult gnome_vfs_dns_sd_browse (GnomeVFSDNSSDBrowseHandle **handle, const char *domain, const char *type, GnomeVFSDNSSDBrowseCallback callback, gpointer callback_data, GDestroyNotify callback_data_destroy_func) void gnome_vfs_dns_sd_browse (class, domain, type, func, data = NULL) const char *domain const char *type SV *func SV *data PREINIT: GnomeVFSDNSSDBrowseHandle *handle; GnomeVFSResult result; GPerlCallback *callback; PPCODE: callback = vfs2perl_dns_sd_browse_callback_create (func, data); result = gnome_vfs_dns_sd_browse (&handle, domain, type, (GnomeVFSDNSSDBrowseCallback) vfs2perl_dns_sd_browse_callback, callback, (GDestroyNotify) gperl_callback_destroy); EXTEND (sp, 2); PUSHs (sv_2mortal (newSVGnomeVFSResult (result))); PUSHs (sv_2mortal (newSVGnomeVFSDNSSDBrowseHandle (handle))); ## GnomeVFSResult gnome_vfs_dns_sd_resolve (GnomeVFSDNSSDResolveHandle **handle, const char *name, const char *type, const char *domain, int timeout, GnomeVFSDNSSDResolveCallback callback, gpointer callback_data, GDestroyNotify callback_data_destroy_func) void gnome_vfs_dns_sd_resolve (class, name, type, domain, timeout, func, data=NULL) const char *name const char *type const char *domain int timeout SV *func SV *data PREINIT: GnomeVFSDNSSDResolveHandle *handle; GnomeVFSResult result; GPerlCallback *callback; PPCODE: callback = vfs2perl_dns_sd_resolve_callback_create (func, data); result = gnome_vfs_dns_sd_resolve (&handle, name, type, domain, timeout, (GnomeVFSDNSSDResolveCallback) vfs2perl_dns_sd_resolve_callback, callback, (GDestroyNotify) gperl_callback_destroy); EXTEND (sp, 2); PUSHs (sv_2mortal (newSVGnomeVFSResult (result))); PUSHs (sv_2mortal (newSVGnomeVFSDNSSDResolveHandle (handle))); ## GnomeVFSResult gnome_vfs_dns_sd_browse_sync (const char *domain, const char *type, int timeout_msec, int *n_services, GnomeVFSDNSSDService **services) void gnome_vfs_dns_sd_browse_sync (class, domain, type, timeout_msec) const char *domain const char *type int timeout_msec PREINIT: GnomeVFSResult result; int n_services, i; GnomeVFSDNSSDService *services = NULL; PPCODE: result = gnome_vfs_dns_sd_browse_sync (domain, type, timeout_msec, &n_services, &services); PUSHs (sv_2mortal (newSVGnomeVFSResult (result))); if (result == GNOME_VFS_OK && services) { for (i = 0; i < n_services; i++) { XPUSHs (sv_2mortal (newSVGnomeVFSDNSSDService (&services[i]))); } gnome_vfs_dns_sd_service_list_free (services, n_services); } ## GnomeVFSResult gnome_vfs_dns_sd_resolve_sync (const char *name, const char *type, const char *domain, int timeout_msec, char **host, int *port, GHashTable **text, int *text_raw_len, char **text_raw) void gnome_vfs_dns_sd_resolve_sync (class, name, type, domain, timeout_msec) const char *name const char *type const char *domain int timeout_msec PREINIT: GnomeVFSResult result; char *host = NULL; int port; GHashTable *text = NULL; int text_raw_len; char *text_raw = NULL; PPCODE: result = gnome_vfs_dns_sd_resolve_sync (name, type, domain, timeout_msec, &host, &port, &text, &text_raw_len, &text_raw); EXTEND (sp, 5); PUSHs (sv_2mortal (newSVGnomeVFSResult (result))); PUSHs (host ? sv_2mortal (newSVpv (host, 0)) : &PL_sv_undef); PUSHs (sv_2mortal (newSViv (port))); PUSHs (sv_2mortal (newSVGnomeVFSDNSSDResolveHashTable (text))); PUSHs (text_raw ? sv_2mortal (newSVpv (text_raw, text_raw_len)) : &PL_sv_undef); if (host) g_free (host); if (text_raw) g_free (text_raw); if (text) g_hash_table_destroy (text); ## GnomeVFSResult gnome_vfs_dns_sd_list_browse_domains_sync (const char *domain, int timeout_msec, GList **domains) void gnome_vfs_dns_sd_list_browse_domains_sync (class, domain, timeout_msec) const char *domain int timeout_msec PREINIT: GnomeVFSResult result; GList *domains = NULL, *i; PPCODE: result = gnome_vfs_dns_sd_list_browse_domains_sync (domain, timeout_msec, &domains); PUSHs (sv_2mortal (newSVGnomeVFSResult (result))); if (result == GNOME_VFS_OK) { for (i = domains; i; i = i->next) { if (i->data) { XPUSHs (sv_2mortal (newSVpv (i->data, 0))); g_free (i->data); } } } g_list_free (domains); # --------------------------------------------------------------------------- # MODULE = Gnome2::VFS::DNSSD PACKAGE = Gnome2::VFS PREFIX = gnome_vfs_ =for object Gnome2::VFS::DNSSD =cut ## GList * gnome_vfs_get_default_browse_domains (void) void gnome_vfs_get_default_browse_domains (class) PREINIT: GList *domains = NULL, *i; PPCODE: PERL_UNUSED_VAR (ax); domains = gnome_vfs_get_default_browse_domains (); for (i = domains; i; i = i->next) { if (i->data) { XPUSHs (sv_2mortal (newSVpv (i->data, 0))); g_free (i->data); } } g_list_free (domains); # --------------------------------------------------------------------------- # MODULE = Gnome2::VFS::DNSSD PACKAGE = Gnome2::VFS::DNSSD::Browse::Handle PREFIX = gnome_vfs_dns_sd_browse_ ## GnomeVFSResult gnome_vfs_dns_sd_stop_browse (GnomeVFSDNSSDBrowseHandle *handle) GnomeVFSResult gnome_vfs_dns_sd_browse_stop (handle) GnomeVFSDNSSDBrowseHandle *handle CODE: RETVAL = gnome_vfs_dns_sd_stop_browse (handle); OUTPUT: RETVAL MODULE = Gnome2::VFS::DNSSD PACKAGE = Gnome2::VFS::DNSSD::Resolve::Handle PREFIX = gnome_vfs_dns_sd_resolve_ ## GnomeVFSResult gnome_vfs_dns_sd_cancel_resolve (GnomeVFSDNSSDResolveHandle *handle) GnomeVFSResult gnome_vfs_dns_sd_resolve_cancel (handle) GnomeVFSDNSSDResolveHandle *handle CODE: RETVAL = gnome_vfs_dns_sd_cancel_resolve (handle); OUTPUT: RETVAL Gnome2-VFS-1.082/xs/GnomeVFSInit.xs0000644000175000017500000000231312222506645015176 0ustar lacklack/* * Copyright (C) 2003 by the gtk2-perl team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * $Id$ */ #include "vfs2perl.h" MODULE = Gnome2::VFS::Init PACKAGE = Gnome2::VFS PREFIX = gnome_vfs_ =for object Gnome2::VFS::main =cut ## gboolean gnome_vfs_init (void) gboolean gnome_vfs_init (class) C_ARGS: /* void */ ## gboolean gnome_vfs_initialized (void) gboolean gnome_vfs_initialized (class) C_ARGS: /* void */ ## void gnome_vfs_shutdown (void) void gnome_vfs_shutdown (class) C_ARGS: /* void */ Gnome2-VFS-1.082/xs/GnomeVFS.xs0000644000175000017500000000463612222506645014364 0ustar lacklack/* * Copyright (C) 2003 by the gtk2-perl team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * $Id$ */ #include "vfs2perl.h" MODULE = Gnome2::VFS PACKAGE = Gnome2::VFS PREFIX = gnome_vfs_ =for object Gnome2::VFS::main =cut BOOT: #include "register.xsh" #include "boot.xsh" gperl_handle_logs_for ("libgnomevfs"); =for apidoc Returns the major, minor and micro version numbers of GnomeVFS. =cut void GET_VERSION_INFO (class) PPCODE: PERL_UNUSED_VAR (ax); EXTEND (SP, 3); PUSHs (sv_2mortal (newSViv (VFS_MAJOR_VERSION))); PUSHs (sv_2mortal (newSViv (VFS_MINOR_VERSION))); PUSHs (sv_2mortal (newSViv (VFS_MICRO_VERSION))); bool CHECK_VERSION (class, major, minor, micro) int major int minor int micro CODE: RETVAL = VFS_CHECK_VERSION (major, minor, micro); OUTPUT: RETVAL =for apidoc Returns a GnomeVFSResult and a GnomeVFSURI. =cut ## GnomeVFSResult gnome_vfs_find_directory (GnomeVFSURI *near_uri, GnomeVFSFindDirectoryKind kind, GnomeVFSURI **result, gboolean create_if_needed, gboolean find_if_needed, guint permissions) void gnome_vfs_find_directory (class, near_uri, kind, create_if_needed, find_if_needed, permissions) GnomeVFSURI *near_uri GnomeVFSFindDirectoryKind kind gboolean create_if_needed gboolean find_if_needed guint permissions PREINIT: GnomeVFSResult result; GnomeVFSURI *result_uri; PPCODE: result = gnome_vfs_find_directory (near_uri, kind, &result_uri, create_if_needed, find_if_needed, permissions); EXTEND (sp, 2); PUSHs (sv_2mortal (newSVGnomeVFSResult (result))); PUSHs (sv_2mortal (newSVGnomeVFSURI (result_uri))); ## const char *gnome_vfs_result_to_string (GnomeVFSResult result) const char * gnome_vfs_result_to_string (class, result) GnomeVFSResult result C_ARGS: result Gnome2-VFS-1.082/xs/GnomeVFSResolve.xs0000644000175000017500000000410512222506645015713 0ustar lacklack/* * Copyright (C) 2004 by the gtk2-perl team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * $Id$ */ #include "vfs2perl.h" MODULE = Gnome2::VFS::Resolve PACKAGE = Gnome2::VFS PREFIX = gnome_vfs_ =for object Gnome2::VFS::Resolve =cut ## GnomeVFSResult gnome_vfs_resolve (const char *hostname, GnomeVFSResolveHandle **handle) void gnome_vfs_resolve (class, hostname) const char *hostname PREINIT: GnomeVFSResult result; GnomeVFSResolveHandle *handle = NULL; PPCODE: result = gnome_vfs_resolve (hostname, &handle); PUSHs (sv_2mortal (newSVGnomeVFSResult (result))); if (result == GNOME_VFS_OK) { XPUSHs (sv_2mortal (newSVGnomeVFSResolveHandle (handle))); } MODULE = Gnome2::VFS::Resolve PACKAGE = Gnome2::VFS::Resolve::Handle PREFIX = gnome_vfs_resolve_ void DESTROY (handle) GnomeVFSResolveHandle *handle CODE: gnome_vfs_resolve_free (handle); ## gboolean gnome_vfs_resolve_next_address (GnomeVFSResolveHandle *handle, GnomeVFSAddress **address) GnomeVFSAddress_ornull * gnome_vfs_resolve_next_address (handle) GnomeVFSResolveHandle *handle PREINIT: GnomeVFSAddress *address = NULL; CODE: RETVAL = gnome_vfs_resolve_next_address (handle, &address) ? address : NULL; OUTPUT: RETVAL ## void gnome_vfs_resolve_reset_to_beginning (GnomeVFSResolveHandle *handle) void gnome_vfs_resolve_reset_to_beginning (handle) GnomeVFSResolveHandle *handle Gnome2-VFS-1.082/xs/GnomeVFSDrive.xs0000644000175000017500000001116212222506645015346 0ustar lacklack/* * Copyright (C) 2004 by the gtk2-perl team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * $Id$ */ #include "vfs2perl.h" /* ------------------------------------------------------------------------- */ /* From GnomeVFSVolume.xs. */ extern GPerlCallback * vfs2perl_volume_op_callback_create (SV *func, SV *data); extern void vfs2perl_volume_op_callback (gboolean succeeded, char *error, char *detailed_error, GPerlCallback *callback); /* ------------------------------------------------------------------------- */ MODULE = Gnome2::VFS::Drive PACKAGE = Gnome2::VFS::Drive PREFIX = gnome_vfs_drive_ ## gulong gnome_vfs_drive_get_id (GnomeVFSDrive *drive) gulong gnome_vfs_drive_get_id (drive) GnomeVFSDrive *drive ## GnomeVFSDeviceType gnome_vfs_drive_get_device_type (GnomeVFSDrive *drive) GnomeVFSDeviceType gnome_vfs_drive_get_device_type (drive) GnomeVFSDrive *drive ## char * gnome_vfs_drive_get_device_path (drive) char * gnome_vfs_drive_get_device_path (drive) GnomeVFSDrive *drive ## char * gnome_vfs_drive_get_activation_uri (drive) char * gnome_vfs_drive_get_activation_uri (drive) GnomeVFSDrive *drive ## char * gnome_vfs_drive_get_display_name (drive) char * gnome_vfs_drive_get_display_name (drive) GnomeVFSDrive *drive ## char * gnome_vfs_drive_get_icon (drive) char * gnome_vfs_drive_get_icon (drive) GnomeVFSDrive *drive ## gboolean gnome_vfs_drive_is_user_visible (drive) gboolean gnome_vfs_drive_is_user_visible (drive) GnomeVFSDrive *drive ## gboolean gnome_vfs_drive_is_connected (drive) gboolean gnome_vfs_drive_is_connected (drive) GnomeVFSDrive *drive ## gboolean gnome_vfs_drive_is_mounted (drive) gboolean gnome_vfs_drive_is_mounted (drive) GnomeVFSDrive *drive ## gint gnome_vfs_drive_compare (a, b) gint gnome_vfs_drive_compare (a, b) GnomeVFSDrive *a GnomeVFSDrive *b ## void gnome_vfs_drive_mount (GnomeVFSDrive *drive, GnomeVFSVolumeOpCallback callback, gpointer user_data) ## void gnome_vfs_drive_unmount (GnomeVFSDrive *drive, GnomeVFSVolumeOpCallback callback, gpointer user_data) ## void gnome_vfs_drive_eject (GnomeVFSDrive *drive, GnomeVFSVolumeOpCallback callback, gpointer user_data) void gnome_vfs_drive_mount (drive, func, data=NULL) GnomeVFSDrive *drive SV *func SV *data ALIAS: Gnome2::VFS::Drive::unmount = 1 Gnome2::VFS::Drive::eject = 2 PREINIT: GPerlCallback *callback; CODE: callback = vfs2perl_volume_op_callback_create (func, data); switch (ix) { case 0: gnome_vfs_drive_mount (drive, (GnomeVFSVolumeOpCallback) vfs2perl_volume_op_callback, callback); break; case 1: gnome_vfs_drive_unmount (drive, (GnomeVFSVolumeOpCallback) vfs2perl_volume_op_callback, callback); break; case 2: gnome_vfs_drive_eject (drive, (GnomeVFSVolumeOpCallback) vfs2perl_volume_op_callback, callback); break; default: g_assert_not_reached (); } #if VFS_CHECK_VERSION (2, 8, 0) ## GList * gnome_vfs_drive_get_mounted_volumes (GnomeVFSDrive *drive) void gnome_vfs_drive_get_mounted_volumes (drive) GnomeVFSDrive *drive PREINIT: GList *list = NULL, *i; PPCODE: list = gnome_vfs_drive_get_mounted_volumes (drive); for (i = list; i; i = i->next) { XPUSHs (sv_2mortal (newSVGnomeVFSVolume (i->data))); } gnome_vfs_drive_volume_list_free (list); ## char * gnome_vfs_drive_get_hal_udi (drive) char * gnome_vfs_drive_get_hal_udi (drive) GnomeVFSDrive *drive #endif /* 2.8 */ #if VFS_CHECK_VERSION (2, 16, 0) gboolean gnome_vfs_drive_needs_eject (GnomeVFSDrive *drive); #endif Gnome2-VFS-1.082/xs/GnomeVFSDirectory.xs0000644000175000017500000002217612222506645016250 0ustar lacklack/* * Copyright (C) 2003 by the gtk2-perl team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * $Id$ */ #include "vfs2perl.h" #include /* ------------------------------------------------------------------------- */ static GPerlCallback * vfs2perl_directory_visit_func_create (SV *func, SV *data) { return gperl_callback_new (func, data, 0, NULL, G_TYPE_BOOLEAN); } static gboolean vfs2perl_directory_visit_func (const gchar *rel_path, GnomeVFSFileInfo *info, gboolean recursing_will_loop, GPerlCallback * callback, gboolean *recurse) { int n; gboolean stop; dGPERL_CALLBACK_MARSHAL_SP; GPERL_CALLBACK_MARSHAL_INIT (callback); ENTER; SAVETMPS; PUSHMARK (SP); EXTEND (SP, 3); PUSHs (sv_2mortal (newSVGChar (rel_path))); PUSHs (sv_2mortal (newSVGnomeVFSFileInfo (info))); PUSHs (sv_2mortal (newSVuv (recursing_will_loop))); if (callback->data) XPUSHs (sv_2mortal (newSVsv (callback->data))); PUTBACK; n = call_sv (callback->func, G_ARRAY); SPAGAIN; if (n != 2) croak ("directory visit callback must return two booleans (stop and recurse)"); /* POPi takes things off the *end* of the stack! */ *recurse = POPi; stop = POPi; PUTBACK; FREETMPS; LEAVE; return stop; } /* ------------------------------------------------------------------------- */ MODULE = Gnome2::VFS::Directory PACKAGE = Gnome2::VFS::Directory PREFIX = gnome_vfs_directory_ =for apidoc Returns a GnomeVFSResult and a GnomeVFSDirectoryHandle. =cut ## GnomeVFSResult gnome_vfs_directory_open (GnomeVFSDirectoryHandle **handle, const gchar *text_uri, GnomeVFSFileInfoOptions options) void gnome_vfs_directory_open (class, text_uri, options) const gchar *text_uri GnomeVFSFileInfoOptions options PREINIT: GnomeVFSResult result; GnomeVFSDirectoryHandle *handle; PPCODE: result = gnome_vfs_directory_open (&handle, text_uri, options); EXTEND (sp, 2); PUSHs (sv_2mortal (newSVGnomeVFSResult (result))); PUSHs (sv_2mortal (newSVGnomeVFSDirectoryHandle (handle))); =for apidoc Returns a GnomeVFSResult and a GnomeVFSDirectoryHandle. =cut ## GnomeVFSResult gnome_vfs_directory_open_from_uri (GnomeVFSDirectoryHandle **handle, GnomeVFSURI *uri, GnomeVFSFileInfoOptions options) void gnome_vfs_directory_open_from_uri (class, uri, options) GnomeVFSURI *uri GnomeVFSFileInfoOptions options PREINIT: GnomeVFSResult result; GnomeVFSDirectoryHandle *handle; PPCODE: result = gnome_vfs_directory_open_from_uri (&handle, uri, options); EXTEND (sp, 2); PUSHs (sv_2mortal (newSVGnomeVFSResult (result))); PUSHs (sv_2mortal (newSVGnomeVFSDirectoryHandle (handle))); ## GnomeVFSResult gnome_vfs_directory_visit (const gchar *uri, GnomeVFSFileInfoOptions info_options, GnomeVFSDirectoryVisitOptions visit_options, GnomeVFSDirectoryVisitFunc callback, gpointer data) GnomeVFSResult gnome_vfs_directory_visit (class, uri, info_options, visit_options, func, data=NULL) const gchar *uri GnomeVFSFileInfoOptions info_options GnomeVFSDirectoryVisitOptions visit_options SV *func SV *data PREINIT: GPerlCallback *callback; CODE: callback = vfs2perl_directory_visit_func_create (func, data); RETVAL = gnome_vfs_directory_visit (uri, info_options, visit_options, (GnomeVFSDirectoryVisitFunc) vfs2perl_directory_visit_func, callback); gperl_callback_destroy (callback); OUTPUT: RETVAL ## GnomeVFSResult gnome_vfs_directory_visit_uri (GnomeVFSURI *uri, GnomeVFSFileInfoOptions info_options, GnomeVFSDirectoryVisitOptions visit_options, GnomeVFSDirectoryVisitFunc callback, gpointer data) GnomeVFSResult gnome_vfs_directory_visit_uri (class, uri, info_options, visit_options, func, data=NULL) GnomeVFSURI *uri GnomeVFSFileInfoOptions info_options GnomeVFSDirectoryVisitOptions visit_options SV *func SV *data PREINIT: GPerlCallback *callback; CODE: callback = vfs2perl_directory_visit_func_create (func, data); RETVAL = gnome_vfs_directory_visit_uri (uri, info_options, visit_options, (GnomeVFSDirectoryVisitFunc) vfs2perl_directory_visit_func, callback); gperl_callback_destroy (callback); OUTPUT: RETVAL ## GnomeVFSResult gnome_vfs_directory_visit_files (const gchar *text_uri, GList *file_list, GnomeVFSFileInfoOptions info_options, GnomeVFSDirectoryVisitOptions visit_options, GnomeVFSDirectoryVisitFunc callback, gpointer data) GnomeVFSResult gnome_vfs_directory_visit_files (class, text_uri, file_ref, info_options, visit_options, func, data=NULL) const gchar *text_uri SV *file_ref GnomeVFSFileInfoOptions info_options GnomeVFSDirectoryVisitOptions visit_options SV *func SV *data PREINIT: GPerlCallback *callback; GList *file_list; CODE: callback = vfs2perl_directory_visit_func_create (func, data); file_list = SvPVGList (file_ref); RETVAL = gnome_vfs_directory_visit_files (text_uri, file_list, info_options, visit_options, (GnomeVFSDirectoryVisitFunc) vfs2perl_directory_visit_func, callback); g_list_free (file_list); gperl_callback_destroy (callback); OUTPUT: RETVAL ## GnomeVFSResult gnome_vfs_directory_visit_files_at_uri (GnomeVFSURI *uri, GList *file_list, GnomeVFSFileInfoOptions info_options, GnomeVFSDirectoryVisitOptions visit_options, GnomeVFSDirectoryVisitFunc callback, gpointer data) GnomeVFSResult gnome_vfs_directory_visit_files_at_uri (class, uri, file_ref, info_options, visit_options, func, data=NULL) GnomeVFSURI *uri SV *file_ref GnomeVFSFileInfoOptions info_options GnomeVFSDirectoryVisitOptions visit_options SV *func SV *data PREINIT: GPerlCallback *callback; GList *file_list; CODE: callback = vfs2perl_directory_visit_func_create (func, data); file_list = SvPVGList (file_ref); RETVAL = gnome_vfs_directory_visit_files_at_uri (uri, file_list, info_options, visit_options, (GnomeVFSDirectoryVisitFunc) vfs2perl_directory_visit_func, callback); g_list_free (file_list); gperl_callback_destroy (callback); OUTPUT: RETVAL =for apidoc Returns a GnomeVFSResult and the GnomeVFSFileInfo's corresponding to the directory's content. =cut ## GnomeVFSResult gnome_vfs_directory_list_load (GList **list, const gchar *text_uri, GnomeVFSFileInfoOptions options) void gnome_vfs_directory_list_load (class, text_uri, options) const gchar *text_uri GnomeVFSFileInfoOptions options PREINIT: GnomeVFSResult result; GList *i, *list = NULL; PPCODE: result = gnome_vfs_directory_list_load (&list, text_uri, options); EXTEND (sp, 1); PUSHs (sv_2mortal (newSVGnomeVFSResult (result))); for (i = list; i != NULL; i = i->next) XPUSHs (sv_2mortal (newSVGnomeVFSFileInfo (i->data))); gnome_vfs_file_info_list_free (list); # --------------------------------------------------------------------------- # MODULE = Gnome2::VFS::Directory PACKAGE = Gnome2::VFS::Directory::Handle PREFIX = gnome_vfs_directory_ =for apidoc Returns a GnomeVFSResult and a GnomeVFSFileInfo. =cut ## GnomeVFSResult gnome_vfs_directory_read_next (GnomeVFSDirectoryHandle *handle, GnomeVFSFileInfo *file_info) void gnome_vfs_directory_read_next (handle) GnomeVFSDirectoryHandle *handle PREINIT: GnomeVFSResult result; GnomeVFSFileInfo *file_info; PPCODE: file_info = gnome_vfs_file_info_new (); result = gnome_vfs_directory_read_next (handle, file_info); EXTEND (sp, 2); PUSHs (sv_2mortal (newSVGnomeVFSResult (result))); PUSHs (sv_2mortal (newSVGnomeVFSFileInfo (file_info))); gnome_vfs_file_info_unref (file_info); ## GnomeVFSResult gnome_vfs_directory_close (GnomeVFSDirectoryHandle *handle) GnomeVFSResult gnome_vfs_directory_close (handle) GnomeVFSDirectoryHandle *handle Gnome2-VFS-1.082/xs/GnomeVFSAddress.xs0000644000175000017500000000402712222506645015664 0ustar lacklack/* * Copyright (C) 2004 by the gtk2-perl team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * $Id$ */ #include "vfs2perl.h" MODULE = Gnome2::VFS::Address PACKAGE = Gnome2::VFS::Address PREFIX = gnome_vfs_address_ ## GnomeVFSAddress *gnome_vfs_address_new_from_string (const char *address) GnomeVFSAddress_own * gnome_vfs_address_new_from_string (class, address) const char *address C_ARGS: address ## int gnome_vfs_address_get_family_type (GnomeVFSAddress *address) int gnome_vfs_address_get_family_type (address) GnomeVFSAddress *address ## char * gnome_vfs_address_to_string (GnomeVFSAddress *address) char_own * gnome_vfs_address_to_string (address) GnomeVFSAddress *address ## Should not be used, according to the docs. ## GnomeVFSAddress *gnome_vfs_address_new_from_ipv4 (guint32 ipv4_address) ## guint32 gnome_vfs_address_get_ipv4 (GnomeVFSAddress *address) ## Not really usable from Perl, are they? ## GnomeVFSAddress *gnome_vfs_address_new_from_sockaddr (struct sockaddr *sa, int len) ## struct sockaddr *gnome_vfs_address_get_sockaddr (GnomeVFSAddress *address, guint16 port, int *len) #if VFS_CHECK_VERSION (2, 13, 1) /* FIXME: 2.14 */ gboolean gnome_vfs_address_equal (const GnomeVFSAddress *a, const GnomeVFSAddress *b); gboolean gnome_vfs_address_match (const GnomeVFSAddress *a, const GnomeVFSAddress *b, guint prefix); #endif Gnome2-VFS-1.082/xs/GnomeVFSUtils.xs0000644000175000017500000002013712222506645015377 0ustar lacklack/* * Copyright (C) 2003-2005 by the gtk2-perl team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * $Id$ */ #include "vfs2perl.h" /* ------------------------------------------------------------------------- */ static char ** SvGnomeVFSCharArray (SV *ref) { char **result = NULL; if (SvOK (ref)) { if (SvRV (ref) && SvTYPE (SvRV (ref)) == SVt_PVAV) { AV *array = (AV *) SvRV (ref); SV **string; int i, length = av_len (array); result = g_new0 (char *, length + 2); for (i = 0; i <= length; i++) if ((string = av_fetch (array, i, 0)) && SvOK (*string)) result[i] = SvPV_nolen (*string); result[length + 1] = NULL; } else croak ("the environment parameter must be an array reference"); } return result; } /* ------------------------------------------------------------------------- */ MODULE = Gnome2::VFS::Utils PACKAGE = Gnome2::VFS PREFIX = gnome_vfs_ =for object Gnome2::VFS::main =cut ## char *gnome_vfs_format_file_size_for_display (GnomeVFSFileSize size) char_own * gnome_vfs_format_file_size_for_display (class, size) GnomeVFSFileSize size C_ARGS: size #if VFS_CHECK_VERSION (2, 2, 0) ## char *gnome_vfs_escape_string (const char *string) char_own * gnome_vfs_escape_string (class, string) const char *string C_ARGS: string #endif ## char *gnome_vfs_escape_path_string (const char *path) char_own * gnome_vfs_escape_path_string (class, path) const char *path C_ARGS: path ## char *gnome_vfs_escape_host_and_path_string (const char *path) char_own * gnome_vfs_escape_host_and_path_string (class, path) const char *path C_ARGS: path ## char *gnome_vfs_escape_slashes (const char *string) char_own * gnome_vfs_escape_slashes (class, string) const char *string C_ARGS: string ## char *gnome_vfs_escape_set (const char *string, const char *match_set) char_own * gnome_vfs_escape_set (class, string, match_set) const char *string const char *match_set C_ARGS: string, match_set ## char *gnome_vfs_unescape_string (const char *escaped_string, const char *illegal_characters) gchar_own * gnome_vfs_unescape_string (class, escaped_string, illegal_characters=NULL) const char *escaped_string const char *illegal_characters C_ARGS: escaped_string, illegal_characters ## char *gnome_vfs_make_uri_canonical (const char *uri) char_own * gnome_vfs_make_uri_canonical (class, uri) const char *uri C_ARGS: uri ## char *gnome_vfs_make_path_name_canonical (const char *path) char_own * gnome_vfs_make_path_name_canonical (class, path) const char *path C_ARGS: path ## char *gnome_vfs_expand_initial_tilde (const char *path) char_own * gnome_vfs_expand_initial_tilde (class, path) const char *path C_ARGS: path ## char *gnome_vfs_unescape_string_for_display (const char *escaped) gchar_own * gnome_vfs_unescape_string_for_display (class, escaped) const char *escaped C_ARGS: escaped ## char *gnome_vfs_get_local_path_from_uri (const char *uri) char_own * gnome_vfs_get_local_path_from_uri (class, uri) const char *uri C_ARGS: uri ## char *gnome_vfs_get_uri_from_local_path (const char *local_full_path) char_own * gnome_vfs_get_uri_from_local_path (class, local_full_path) const char *local_full_path C_ARGS: local_full_path ## gboolean gnome_vfs_is_executable_command_string (const char *command_string) gboolean gnome_vfs_is_executable_command_string (class, command_string) const char *command_string C_ARGS: command_string ### void gnome_vfs_list_deep_free (GList *list) #void #gnome_vfs_list_deep_free (list) # GList *list =for apidoc Returns a GnomeVFSResult and a GnomeVFSFileSize. =cut ## GnomeVFSResult gnome_vfs_get_volume_free_space (const GnomeVFSURI *vfs_uri, GnomeVFSFileSize *size) void gnome_vfs_get_volume_free_space (class, vfs_uri) const GnomeVFSURI *vfs_uri PREINIT: GnomeVFSResult result; GnomeVFSFileSize size; PPCODE: result = gnome_vfs_get_volume_free_space (vfs_uri, &size); EXTEND (sp, 2); PUSHs (sv_2mortal (newSVGnomeVFSResult (result))); PUSHs (sv_2mortal (newSVGnomeVFSFileSize (size))); ## char *gnome_vfs_icon_path_from_filename (const char *filename) char_own * gnome_vfs_icon_path_from_filename (class, filename) const char *filename C_ARGS: filename ### GnomeVFSResult gnome_vfs_open_fd (GnomeVFSHandle **handle, int filedes) #GnomeVFSResult #gnome_vfs_open_fd (handle, filedes) # GnomeVFSHandle **handle # int filedes ## gboolean gnome_vfs_is_primary_thread (void) gboolean gnome_vfs_is_primary_thread (class) C_ARGS: /* void */ #if VFS_CHECK_VERSION (2, 2, 0) =for apidoc Returns a GnomeVFSResult, the file size and the file content. =cut ## GnomeVFSResult gnome_vfs_read_entire_file (const char *uri, int *file_size, char **file_contents) void gnome_vfs_read_entire_file (class, uri) const char *uri PREINIT: GnomeVFSResult result; int file_size = 0; char *file_contents = NULL; PPCODE: result = gnome_vfs_read_entire_file (uri, &file_size, &file_contents); EXTEND (sp, 3); PUSHs (sv_2mortal (newSVGnomeVFSResult (result))); PUSHs (sv_2mortal (newSViv (file_size))); PUSHs (sv_2mortal (file_size ? newSVpv (file_contents, file_size) : newSVsv (&PL_sv_undef))); ## char * gnome_vfs_format_uri_for_display (const char *uri) gchar_own * gnome_vfs_format_uri_for_display (class, uri) const char *uri C_ARGS: uri ## char * gnome_vfs_make_uri_from_input (const char *uri) char_own * gnome_vfs_make_uri_from_input (class, uri) const char *uri C_ARGS: uri #endif #if VFS_CHECK_VERSION (2, 4, 0) ## char * gnome_vfs_make_uri_from_input_with_dirs (const char *uri, GnomeVFSMakeURIDirs dirs) char_own * gnome_vfs_make_uri_from_input_with_dirs (class, uri, dirs) const char *uri GnomeVFSMakeURIDirs dirs C_ARGS: uri, dirs #endif #if VFS_CHECK_VERSION (2, 12, 0) ## char * gnome_vfs_make_uri_from_input_with_trailing_ws (const char *location); char_own * gnome_vfs_make_uri_from_input_with_trailing_ws (class, location) const char *location C_ARGS: location #endif #if VFS_CHECK_VERSION (2, 2, 0) ## char * gnome_vfs_make_uri_canonical_strip_fragment (const char *uri) char_own * gnome_vfs_make_uri_canonical_strip_fragment (class, uri) const char *uri C_ARGS: uri ## gboolean gnome_vfs_uris_match (const char *uri_1, const char *uri_2) gboolean gnome_vfs_uris_match (class, uri_1, uri_2) const char *uri_1 const char *uri_2 C_ARGS: uri_1, uri_2 ## char * gnome_vfs_get_uri_scheme (const char *uri) char_own * gnome_vfs_get_uri_scheme (class, uri) const char *uri C_ARGS: uri ## char * gnome_vfs_make_uri_from_shell_arg (const char *uri) char_own * gnome_vfs_make_uri_from_shell_arg (class, uri) const char *uri C_ARGS: uri # deprecated. ### char * gnome_vfs_make_uri_full_from_relative (const char *base_uri, const char *relative_uri) #char_own * #gnome_vfs_make_uri_full_from_relative (class, base_uri, relative_uri) # const char *base_uri # const char *relative_uri # C_ARGS: # base_uri, relative_uri #endif #if VFS_CHECK_VERSION (2, 4, 0) ## GnomeVFSResult gnome_vfs_url_show (const char *url) GnomeVFSResult gnome_vfs_url_show (class, url) const char *url C_ARGS: url ## GnomeVFSResult gnome_vfs_url_show_with_env (const char *url, char **envp) GnomeVFSResult gnome_vfs_url_show_with_env (class, url, env_ref) const char *url SV *env_ref PREINIT: char **envp; CODE: envp = SvGnomeVFSCharArray (env_ref); RETVAL = gnome_vfs_url_show_with_env (url, envp); g_free (envp); OUTPUT: RETVAL #endif Gnome2-VFS-1.082/xs/GnomeVFSVolume.xs0000644000175000017500000001234112222506645015544 0ustar lacklack/* * Copyright (C) 2004 by the gtk2-perl team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * $Id$ */ #include "vfs2perl.h" /* ------------------------------------------------------------------------- */ /* Also used in GnomeVFSDrive.xs. */ GPerlCallback * vfs2perl_volume_op_callback_create (SV *func, SV *data) { GType param_types[3] = { G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_STRING }; return gperl_callback_new (func, data, G_N_ELEMENTS (param_types), param_types, 0); } void vfs2perl_volume_op_callback (gboolean succeeded, char *error, char *detailed_error, GPerlCallback *callback) { gperl_callback_invoke (callback, NULL, succeeded, error, detailed_error); gperl_callback_destroy (callback); } /* ------------------------------------------------------------------------- */ MODULE = Gnome2::VFS::Volume PACKAGE = Gnome2::VFS::Volume PREFIX = gnome_vfs_volume_ ## gulong gnome_vfs_volume_get_id (GnomeVFSVolume *volume) gulong gnome_vfs_volume_get_id (volume) GnomeVFSVolume *volume ## GnomeVFSVolumeType gnome_vfs_volume_get_volume_type (GnomeVFSVolume *volume) GnomeVFSVolumeType gnome_vfs_volume_get_volume_type (volume) GnomeVFSVolume *volume ## GnomeVFSDeviceType gnome_vfs_volume_get_device_type (GnomeVFSVolume *volume) GnomeVFSDeviceType gnome_vfs_volume_get_device_type (volume) GnomeVFSVolume *volume ## GnomeVFSDrive * gnome_vfs_volume_get_drive (GnomeVFSVolume *volume) GnomeVFSDrive * gnome_vfs_volume_get_drive (volume) GnomeVFSVolume *volume ## char * gnome_vfs_volume_get_device_path (GnomeVFSVolume *volume) char_own * gnome_vfs_volume_get_device_path (volume) GnomeVFSVolume *volume ## char * gnome_vfs_volume_get_activation_uri (GnomeVFSVolume *volume) char_own * gnome_vfs_volume_get_activation_uri (volume) GnomeVFSVolume *volume ## char * gnome_vfs_volume_get_filesystem_type (GnomeVFSVolume *volume) char_own * gnome_vfs_volume_get_filesystem_type (volume) GnomeVFSVolume *volume ## char * gnome_vfs_volume_get_display_name (GnomeVFSVolume *volume) char_own * gnome_vfs_volume_get_display_name (volume) GnomeVFSVolume *volume ## char * gnome_vfs_volume_get_icon (GnomeVFSVolume *volume) char_own * gnome_vfs_volume_get_icon (volume) GnomeVFSVolume *volume ## gboolean gnome_vfs_volume_is_user_visible (GnomeVFSVolume *volume) gboolean gnome_vfs_volume_is_user_visible (volume) GnomeVFSVolume *volume ## gboolean gnome_vfs_volume_is_read_only (GnomeVFSVolume *volume) gboolean gnome_vfs_volume_is_read_only (volume) GnomeVFSVolume *volume ## gboolean gnome_vfs_volume_is_mounted (GnomeVFSVolume *volume) gboolean gnome_vfs_volume_is_mounted (volume) GnomeVFSVolume *volume ## gboolean gnome_vfs_volume_handles_trash (GnomeVFSVolume *volume) gboolean gnome_vfs_volume_handles_trash (volume) GnomeVFSVolume *volume ## gint gnome_vfs_volume_compare (GnomeVFSVolume *a, GnomeVFSVolume *b) gint gnome_vfs_volume_compare (a, b) GnomeVFSVolume *a GnomeVFSVolume *b ## void gnome_vfs_volume_unmount (GnomeVFSVolume *volume, GnomeVFSVolumeOpCallback callback, gpointer user_data) ## void gnome_vfs_volume_eject (GnomeVFSVolume *volume, GnomeVFSVolumeOpCallback callback, gpointer user_data) void gnome_vfs_volume_unmount (volume, func, data=NULL) GnomeVFSVolume *volume SV *func SV *data ALIAS: Gnome2::VFS::Volume::eject = 1 PREINIT: GPerlCallback *callback; CODE: callback = vfs2perl_volume_op_callback_create (func, data); switch (ix) { case 0: gnome_vfs_volume_unmount (volume, (GnomeVFSVolumeOpCallback) vfs2perl_volume_op_callback, callback); break; case 1: gnome_vfs_volume_eject (volume, (GnomeVFSVolumeOpCallback) vfs2perl_volume_op_callback, callback); break; default: g_assert_not_reached (); } #if VFS_CHECK_VERSION (2, 8, 0) ## char * gnome_vfs_volume_get_hal_udi (GnomeVFSVolume *volume) char * gnome_vfs_volume_get_hal_udi (volume) GnomeVFSVolume *volume #endif MODULE = Gnome2::VFS::Volume PACKAGE = Gnome2::VFS PREFIX = gnome_vfs_ =for object Gnome2::VFS::Volume =cut ## void gnome_vfs_connect_to_server (char *uri, char *display_name, char *icon) void gnome_vfs_connect_to_server (class, uri, display_name, icon) char *uri char *display_name char *icon C_ARGS: uri, display_name, icon Gnome2-VFS-1.082/xs/GnomeVFSApplicationRegistry.xs0000644000175000017500000001543612222506645020301 0ustar lacklack/* * Copyright (C) 2003, 2013 by the gtk2-perl team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * $Id$ */ #include "vfs2perl.h" MODULE = Gnome2::VFS::ApplicationRegistry PACKAGE = Gnome2::VFS::ApplicationRegistry PREFIX = gnome_vfs_application_registry_ SV * gnome_vfs_application_registry_new (class, app_id) const char *app_id CODE: RETVAL = newSVGnomeVFSApplication (app_id); OUTPUT: RETVAL ## GnomeVFSResult gnome_vfs_application_registry_sync (void) GnomeVFSResult gnome_vfs_application_registry_sync (class) C_ARGS: /* void */ ## void gnome_vfs_application_registry_shutdown (void) void gnome_vfs_application_registry_shutdown (class) C_ARGS: /* void */ ## void gnome_vfs_application_registry_reload (void) void gnome_vfs_application_registry_reload (class) C_ARGS: /* void */ =for apidoc Returns a list of valid application id's that can handle this MIME type. =cut ## GList *gnome_vfs_application_registry_get_applications(const char *mime_type) void gnome_vfs_application_registry_get_applications (class, mime_type=NULL) const char *mime_type PREINIT: GList *i, *results = NULL; PPCODE: results = gnome_vfs_application_registry_get_applications (mime_type); for (i = results; i != NULL; i = i->next) XPUSHs (sv_2mortal (newSVpv (i->data, 0))); g_list_free (results); MODULE = Gnome2::VFS::ApplicationRegistry PACKAGE = Gnome2::VFS::Application PREFIX = gnome_vfs_application_registry_ ## gboolean gnome_vfs_application_registry_exists (const char *app_id) gboolean gnome_vfs_application_registry_exists (app_id) GnomeVFSApplication *app_id =for apidoc Returns a list of valid keys for that application. =cut ## GList *gnome_vfs_application_registry_get_keys (const char *app_id) void gnome_vfs_application_registry_get_keys (app_id) GnomeVFSApplication *app_id PREINIT: GList *i, *results = NULL; PPCODE: results = gnome_vfs_application_registry_get_keys (app_id); for (i = results; i != NULL; i = i->next) XPUSHs (sv_2mortal (newSVpv (i->data, 0))); g_list_free (results); ## const char *gnome_vfs_application_registry_peek_value (const char *app_id, const char *key) const char * gnome_vfs_application_registry_peek_value (app_id, key) GnomeVFSApplication *app_id const char *key =for apidoc Returns the actual value and a boolean indicating whether the requested key was found. =cut ## gboolean gnome_vfs_application_registry_get_bool_value (const char *app_id, const char *key, gboolean *got_key) void gnome_vfs_application_registry_get_bool_value (app_id, key) GnomeVFSApplication *app_id const char *key PREINIT: gboolean result; gboolean got_key; PPCODE: result = gnome_vfs_application_registry_get_bool_value (app_id, key, &got_key); EXTEND (sp, 2); PUSHs (sv_2mortal (newSVuv (result))); PUSHs (sv_2mortal (newSVuv (got_key))); ## void gnome_vfs_application_registry_remove_application(const char *app_id) void gnome_vfs_application_registry_remove_application (app_id) GnomeVFSApplication *app_id ## void gnome_vfs_application_registry_set_value (const char *app_id, const char *key, const char *value) void gnome_vfs_application_registry_set_value (app_id, key, value) GnomeVFSApplication *app_id const char *key const char *value ## void gnome_vfs_application_registry_set_bool_value (const char *app_id, const char *key, gboolean value) void gnome_vfs_application_registry_set_bool_value (app_id, key, value) GnomeVFSApplication *app_id const char *key gboolean value ## void gnome_vfs_application_registry_unset_key (const char *app_id, const char *key) void gnome_vfs_application_registry_unset_key (app_id, key) GnomeVFSApplication *app_id const char *key =for apidoc Returns a list of MIME types this application can handle. =cut ## GList *gnome_vfs_application_registry_get_mime_types (const char *app_id) void gnome_vfs_application_registry_get_mime_types (app_id) GnomeVFSApplication *app_id PREINIT: GList *i, *results = NULL; PPCODE: results = gnome_vfs_application_registry_get_mime_types (app_id); for (i = results; i != NULL; i = i->next) XPUSHs (sv_2mortal (newSVpv (i->data, 0))); g_list_free (results); ## gboolean gnome_vfs_application_registry_supports_mime_type (const char *app_id, const char *mime_type) gboolean gnome_vfs_application_registry_supports_mime_type (app_id, mime_type) GnomeVFSApplication *app_id const char *mime_type ## gboolean gnome_vfs_application_registry_supports_uri_scheme (const char *app_id, const char *uri_scheme) gboolean gnome_vfs_application_registry_supports_uri_scheme (app_id, uri_scheme) GnomeVFSApplication *app_id const char *uri_scheme ## void gnome_vfs_application_registry_clear_mime_types (const char *app_id) void gnome_vfs_application_registry_clear_mime_types (app_id) GnomeVFSApplication *app_id ## void gnome_vfs_application_registry_add_mime_type (const char *app_id, const char *mime_type) void gnome_vfs_application_registry_add_mime_type (app_id, mime_type) GnomeVFSApplication *app_id const char *mime_type ## void gnome_vfs_application_registry_remove_mime_type (const char *app_id, const char *mime_type) void gnome_vfs_application_registry_remove_mime_type (app_id, mime_type) GnomeVFSApplication *app_id const char *mime_type ## GnomeVFSMimeApplication * gnome_vfs_application_registry_get_mime_application(const char *app_id) GnomeVFSMimeApplication * gnome_vfs_application_registry_get_mime_application (app_id) GnomeVFSApplication *app_id MODULE = Gnome2::VFS::ApplicationRegistry PACKAGE = Gnome2::VFS::Mime::Application PREFIX = gnome_vfs_mime_application_ ## gboolean gnome_vfs_application_is_user_owned_application (const GnomeVFSMimeApplication *application) gboolean gnome_vfs_mime_application_is_user_owned (application) const GnomeVFSMimeApplication *application CODE: RETVAL = gnome_vfs_application_is_user_owned_application (application); OUTPUT: RETVAL ## void gnome_vfs_application_registry_save_mime_application(const GnomeVFSMimeApplication *application) void gnome_vfs_mime_application_save (application) const GnomeVFSMimeApplication *application CODE: gnome_vfs_application_registry_save_mime_application (application); Gnome2-VFS-1.082/xs/GnomeVFSXfer.xs0000644000175000017500000001344712222506645015211 0ustar lacklack/* * Copyright (C) 2003-2005 by the gtk2-perl team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * $Id$ */ #include "vfs2perl.h" #include /* ------------------------------------------------------------------------- */ static gint sv_to_int (GType type, SV *sv) { int n; if (! gperl_try_convert_enum (type, sv, &n)) croak ("erroneous return value"); return n; } GPerlCallback * vfs2perl_xfer_progress_callback_create (SV *func, SV *data) { return gperl_callback_new (func, data, 0, NULL, G_TYPE_INT); } gint vfs2perl_xfer_progress_callback (GnomeVFSXferProgressInfo *info, GPerlCallback *callback) { gint retval; dGPERL_CALLBACK_MARSHAL_SP; GPERL_CALLBACK_MARSHAL_INIT (callback); ENTER; SAVETMPS; PUSHMARK (SP); EXTEND (SP, 1); PUSHs (sv_2mortal (newSVGnomeVFSXferProgressInfo (info))); if (callback->data) XPUSHs (sv_2mortal (newSVsv (callback->data))); PUTBACK; call_sv (callback->func, G_SCALAR); /* FIXME: Strange segfaults/aborts here. */ SPAGAIN; if (info->status == GNOME_VFS_XFER_PROGRESS_STATUS_VFSERROR) retval = sv_to_int (GNOME_VFS_TYPE_VFS_XFER_ERROR_ACTION, POPs); else if (info->status == GNOME_VFS_XFER_PROGRESS_STATUS_OVERWRITE) retval = sv_to_int (GNOME_VFS_TYPE_VFS_XFER_OVERWRITE_ACTION, POPs); else retval = POPi; PUTBACK; FREETMPS; LEAVE; return retval; } /* ------------------------------------------------------------------------- */ MODULE = Gnome2::VFS::Xfer PACKAGE = Gnome2::VFS::Xfer PREFIX = gnome_vfs_xfer_ # FIXME: these function names are UGLY. ## GnomeVFSResult gnome_vfs_xfer_uri (const GnomeVFSURI *source_uri, const GnomeVFSURI *target_uri, GnomeVFSXferOptions xfer_options, GnomeVFSXferErrorMode error_mode, GnomeVFSXferOverwriteMode overwrite_mode, GnomeVFSXferProgressCallback progress_callback, gpointer data) GnomeVFSResult gnome_vfs_xfer_uri (class, source_uri, target_uri, xfer_options, error_mode, overwrite_mode, func, data=NULL) const GnomeVFSURI *source_uri const GnomeVFSURI *target_uri GnomeVFSXferOptions xfer_options GnomeVFSXferErrorMode error_mode GnomeVFSXferOverwriteMode overwrite_mode SV *func SV *data PREINIT: GPerlCallback *callback; CODE: callback = vfs2perl_xfer_progress_callback_create (func, data); RETVAL = gnome_vfs_xfer_uri (source_uri, target_uri, xfer_options, error_mode, overwrite_mode, (GnomeVFSXferProgressCallback) vfs2perl_xfer_progress_callback, callback); gperl_callback_destroy (callback); OUTPUT: RETVAL ## GnomeVFSResult gnome_vfs_xfer_uri_list (const GList *source_uri_list, const GList *target_uri_list, GnomeVFSXferOptions xfer_options, GnomeVFSXferErrorMode error_mode, GnomeVFSXferOverwriteMode overwrite_mode, GnomeVFSXferProgressCallback progress_callback, gpointer data) GnomeVFSResult gnome_vfs_xfer_uri_list (class, source_ref, target_ref, xfer_options, error_mode, overwrite_mode, func, data=NULL) SV *source_ref SV *target_ref GnomeVFSXferOptions xfer_options GnomeVFSXferErrorMode error_mode GnomeVFSXferOverwriteMode overwrite_mode SV *func SV *data PREINIT: GList *source_uri_list; GList *target_uri_list; GPerlCallback *callback; CODE: source_uri_list = SvGnomeVFSURIGList (source_ref); target_uri_list = SvGnomeVFSURIGList (target_ref); callback = vfs2perl_xfer_progress_callback_create (func, data); RETVAL = gnome_vfs_xfer_uri_list ((const GList *) source_uri_list, (const GList *) target_uri_list, xfer_options, error_mode, overwrite_mode, (GnomeVFSXferProgressCallback) vfs2perl_xfer_progress_callback, callback); gperl_callback_destroy (callback); g_list_free (source_uri_list); g_list_free (target_uri_list); OUTPUT: RETVAL ## GnomeVFSResult gnome_vfs_xfer_delete_list (const GList *source_uri_list, GnomeVFSXferErrorMode error_mode, GnomeVFSXferOptions xfer_options, GnomeVFSXferProgressCallback progress_callback, gpointer data) GnomeVFSResult gnome_vfs_xfer_delete_list (class, source_ref, error_mode, xfer_options, func, data=NULL) SV *source_ref GnomeVFSXferErrorMode error_mode GnomeVFSXferOptions xfer_options SV *func SV *data PREINIT: GList *source_uri_list; GPerlCallback *callback; CODE: source_uri_list = SvGnomeVFSURIGList (source_ref); callback = vfs2perl_xfer_progress_callback_create (func, data); RETVAL = gnome_vfs_xfer_delete_list ((const GList *) source_uri_list, error_mode, xfer_options, (GnomeVFSXferProgressCallback) vfs2perl_xfer_progress_callback, callback); gperl_callback_destroy (callback); g_list_free (source_uri_list); OUTPUT: RETVAL Gnome2-VFS-1.082/xs/GnomeVFSVolumeMonitor.xs0000644000175000017500000000647612222506645017130 0ustar lacklack/* * Copyright (C) 2004 by the gtk2-perl team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * $Id$ */ #include "vfs2perl.h" MODULE = Gnome2::VFS::VolumeMonitor PACKAGE = Gnome2::VFS::VolumeMonitor::Client BOOT: gperl_object_set_no_warn_unreg_subclass (GNOME_VFS_TYPE_VOLUME_MONITOR, TRUE); # --------------------------------------------------------------------------- # MODULE = Gnome2::VFS::VolumeMonitor PACKAGE = Gnome2::VFS PREFIX = gnome_vfs_ =for object Gnome2::VFS::VolumeMonitor =cut ## GnomeVFSVolumeMonitor *gnome_vfs_get_volume_monitor (void) GnomeVFSVolumeMonitor * gnome_vfs_get_volume_monitor (class) C_ARGS: /* void */ # --------------------------------------------------------------------------- # MODULE = Gnome2::VFS::VolumeMonitor PACKAGE = Gnome2::VFS::VolumeMonitor PREFIX = gnome_vfs_volume_monitor_ #if !VFS_CHECK_VERSION (2, 8, 1) void DESTROY (monitor) CODE: /* do nada to avoid finalizing the monitor. */ #endif ## GList * gnome_vfs_volume_monitor_get_mounted_volumes (GnomeVFSVolumeMonitor *volume_monitor) void gnome_vfs_volume_monitor_get_mounted_volumes (volume_monitor) GnomeVFSVolumeMonitor *volume_monitor PREINIT: GList *volumes = NULL, *i; PPCODE: volumes = gnome_vfs_volume_monitor_get_mounted_volumes (volume_monitor); for (i = volumes; i; i = i->next) { XPUSHs (sv_2mortal (newSVGnomeVFSVolume (i->data))); gnome_vfs_volume_unref (i->data); } g_list_free (volumes); ## GList * gnome_vfs_volume_monitor_get_connected_drives (GnomeVFSVolumeMonitor *volume_monitor) void gnome_vfs_volume_monitor_get_connected_drives (volume_monitor) GnomeVFSVolumeMonitor *volume_monitor PREINIT: GList *drives = NULL, *i; PPCODE: drives = gnome_vfs_volume_monitor_get_connected_drives (volume_monitor); for (i = drives; i; i = i->next) { XPUSHs (sv_2mortal (newSVGnomeVFSDrive (i->data))); gnome_vfs_drive_unref (i->data); } g_list_free (drives); ## GnomeVFSVolume * gnome_vfs_volume_monitor_get_volume_for_path (GnomeVFSVolumeMonitor *volume_monitor, const char *path) GnomeVFSVolume * gnome_vfs_volume_monitor_get_volume_for_path (volume_monitor, path) GnomeVFSVolumeMonitor *volume_monitor const char *path ## GnomeVFSVolume * gnome_vfs_volume_monitor_get_volume_by_id (GnomeVFSVolumeMonitor *volume_monitor, gulong id) GnomeVFSVolume * gnome_vfs_volume_monitor_get_volume_by_id (volume_monitor, id) GnomeVFSVolumeMonitor *volume_monitor gulong id ## GnomeVFSDrive * gnome_vfs_volume_monitor_get_drive_by_id (GnomeVFSVolumeMonitor *volume_monitor, gulong id) GnomeVFSDrive * gnome_vfs_volume_monitor_get_drive_by_id (volume_monitor, id) GnomeVFSVolumeMonitor *volume_monitor gulong id Gnome2-VFS-1.082/xs/GnomeVFSFileInfo.xs0000644000175000017500000001041212222506645015765 0ustar lacklack/* * Copyright (C) 2003 by the gtk2-perl team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * $Id$ */ #include "vfs2perl.h" /* ------------------------------------------------------------------------- */ #ifdef VFS2PERL_BROKEN_FILE_PERMISSIONS /* * GnomeVFSFilePermissions is supposed to be a GFlags type, but on some * early releases, it appears that glib-mkenums misread the definition and * registered it as a GEnum type, instead. This causes some big problems * for using the type in the bindings; if we do nothing, we get incessant * assertions that the type is not a GFlags type, but if we register it as * an enum instead, we get errors because bit-combination values aren't * part of the enum set. The only real solution is to hijack the type * macro to point to our own special get_type and registration which does * it properly. * * these are the values that are actually defined in my header for 2.0.2 * on redhat 8.0. some of the values present in later versions are missing. * * - muppet, 18 nov 03 */ static const GFlagsValue file_perms_values[] = { { GNOME_VFS_PERM_SUID, "GNOME_VFS_PERM_SUID", "suid" }, { GNOME_VFS_PERM_SGID, "GNOME_VFS_PERM_SGID", "sgid" }, { GNOME_VFS_PERM_STICKY, "GNOME_VFS_PERM_STICKY", "sticky" }, { GNOME_VFS_PERM_USER_READ, "GNOME_VFS_PERM_USER_READ", "user-read" }, { GNOME_VFS_PERM_USER_WRITE, "GNOME_VFS_PERM_USER_WRITE", "user-write" }, { GNOME_VFS_PERM_USER_EXEC, "GNOME_VFS_PERM_USER_EXEC", "user-exec" }, { GNOME_VFS_PERM_USER_ALL, "GNOME_VFS_PERM_USER_ALL", "user-all" }, { GNOME_VFS_PERM_GROUP_READ, "GNOME_VFS_PERM_GROUP_READ", "group-read" }, { GNOME_VFS_PERM_GROUP_WRITE, "GNOME_VFS_PERM_GROUP_WRITE", "group-write" }, { GNOME_VFS_PERM_GROUP_EXEC, "GNOME_VFS_PERM_GROUP_EXEC", "group-exec" }, { GNOME_VFS_PERM_GROUP_ALL, "GNOME_VFS_PERM_GROUP_ALL", "group-all" }, { GNOME_VFS_PERM_OTHER_READ, "GNOME_VFS_PERM_OTHER_READ", "other-read" }, { GNOME_VFS_PERM_OTHER_WRITE, "GNOME_VFS_PERM_OTHER_WRITE", "other-write" }, { GNOME_VFS_PERM_OTHER_EXEC, "GNOME_VFS_PERM_OTHER_EXEC", "other-exec" }, { GNOME_VFS_PERM_OTHER_ALL, "GNOME_VFS_PERM_OTHER_ALL", "other-all" }, }; GType _vfs2perl_gnome_vfs_file_permissions_get_type (void) { static GType type = 0; if (!type) type = g_flags_register_static ("VFS2PerlFilePermissions", file_perms_values); return type; } #endif /* VFS2PERL_BROKEN_FILE_PERMISSIONS */ /* ------------------------------------------------------------------------- */ MODULE = Gnome2::VFS::FileInfo PACKAGE = Gnome2::VFS::FileInfo PREFIX = gnome_vfs_file_info_ =for apidocs Creates a new GnomeVFSFileInfo object from I for use with Gnome2::VFS::FileInfo::matches, for example. Normally, you can always directly use a hash reference if you're asked for a GnomeVFSFileInfo. =cut GnomeVFSFileInfo * gnome_vfs_file_info_new (class, hash_ref) SV *hash_ref CODE: /* All this really doesn't do much more than just bless the reference, because on the way out, the struct will be converted to a hash reference again. Not really efficient, but future-safe. */ RETVAL = SvGnomeVFSFileInfo (hash_ref); OUTPUT: RETVAL ## gboolean gnome_vfs_file_info_matches (const GnomeVFSFileInfo *a, const GnomeVFSFileInfo *b) gboolean gnome_vfs_file_info_matches (a, b) const GnomeVFSFileInfo *a const GnomeVFSFileInfo *b ## const char * gnome_vfs_file_info_get_mime_type (GnomeVFSFileInfo *info) const char * gnome_vfs_file_info_get_mime_type (info) GnomeVFSFileInfo *info Gnome2-VFS-1.082/xs/GnomeVFSMime.xs0000644000175000017500000004747412222506645015203 0ustar lacklack/* * Copyright (C) 2003-2005, 2013 by the gtk2-perl team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * $Id$ */ #include "vfs2perl.h" /* So we get those functions that were deprecated after we bound them. */ #undef GNOME_VFS_DISABLE_DEPRECATED /* ------------------------------------------------------------------------- */ #if 0 struct Bonobo_ServerInfo_type { Bonobo_ImplementationID iid; CORBA_string server_type; CORBA_string location_info; CORBA_string username; CORBA_string hostname; CORBA_string domain; CORBA_sequence_Bonobo_ActivationProperty props; }; typedef struct { GnomeVFSMimeActionType action_type; union { Bonobo_ServerInfo *component; void *dummy_component; GnomeVFSMimeApplication *application; } action; } GnomeVFSMimeAction; SV * newSVGnomeVFSMimeAction (GnomeVFSMimeAction *action) { ... } #endif /* ------------------------------------------------------------------------- */ MODULE = Gnome2::VFS::Mime PACKAGE = Gnome2::VFS::Mime PREFIX = gnome_vfs_mime_ =for apidoc =for arg ... of GnomeVFSMimeApplication's =cut # FIXME: leak. ## gboolean gnome_vfs_mime_id_in_application_list (const char *id, GList *applications) gboolean gnome_vfs_mime_id_in_application_list (class, id, ...) const char *id PREINIT: int i; GList *applications = NULL; CODE: for (i = 2; i < items; i++) applications = g_list_append (applications, SvGnomeVFSMimeApplication (ST (i))); RETVAL = gnome_vfs_mime_id_in_application_list (id, applications); /* gnome_vfs_mime_application_list_free (applications); */ g_list_free (applications); OUTPUT: RETVAL =for apidoc =for arg ... of GnomeVFSMimeApplication's Returns a boolean indicating whether anything was removed and the resulting list of GnomeVFSMimeApplication's. =cut # FIXME: leak. ## GList * gnome_vfs_mime_remove_application_from_list (GList *applications, const char *application_id, gboolean *did_remove) void gnome_vfs_mime_remove_application_from_list (class, application_id, ...) const char *application_id PREINIT: int i; GList *applications = NULL, *result, *j; gboolean did_remove; PPCODE: for (i = 2; i < items; i++) applications = g_list_append (applications, SvGnomeVFSMimeApplication (ST (i))); result = gnome_vfs_mime_remove_application_from_list (applications, application_id, &did_remove); EXTEND (sp, 1); PUSHs (sv_2mortal (newSVuv (did_remove))); for (j = result; j != NULL; j = j->next) { XPUSHs (sv_2mortal (newSVGnomeVFSMimeApplication (j->data))); /* gnome_vfs_mime_application_free (j->data); */ } g_list_free (result); =for apidoc =for arg ... of GnomeVFSMimeApplication's Returns a list of application id's. =cut # FIXME: leak. ## GList * gnome_vfs_mime_id_list_from_application_list (GList *applications) void gnome_vfs_mime_id_list_from_application_list (class, ...) PREINIT: int i; GList *applications = NULL, *ids, *j; PPCODE: for (i = 1; i < items; i++) applications = g_list_append (applications, SvGnomeVFSMimeApplication (ST (i))); ids = gnome_vfs_mime_id_list_from_application_list (applications); for (j = ids; j != NULL; j = j->next) { XPUSHs (sv_2mortal (newSVpv (j->data, 0))); /* g_free (j->data); */ } g_list_free (applications); g_list_free (ids); # FIXME: Needs bonobo typemaps. ### gboolean gnome_vfs_mime_id_in_component_list (const char *iid, GList *components) #gboolean #gnome_vfs_mime_id_in_component_list (iid, components) # const char *iid # GList *components # FIXME: Needs bonobo typemaps. ### GList * gnome_vfs_mime_remove_component_from_list (GList *components, const char *iid, gboolean *did_remove) #GList * #gnome_vfs_mime_remove_component_from_list (components, iid, did_remove) # GList *components # const char *iid # gboolean *did_remove # FIXME: Needs bonobo typemaps. ### GList * gnome_vfs_mime_id_list_from_component_list (GList *components) #GList * #gnome_vfs_mime_id_list_from_component_list (components) # GList *components # --------------------------------------------------------------------------- # MODULE = Gnome2::VFS::Mime PACKAGE = Gnome2::VFS::Mime::Type PREFIX = gnome_vfs_mime_ SV * gnome_vfs_mime_new (class, mime_type) const char *mime_type CODE: RETVAL = newSVGnomeVFSMimeType (mime_type); OUTPUT: RETVAL ## GnomeVFSMimeActionType gnome_vfs_mime_get_default_action_type (const char *mime_type) GnomeVFSMimeActionType gnome_vfs_mime_get_default_action_type (mime_type) GnomeVFSMimeType *mime_type # FIXME: Needs bonobo typemaps. ### GnomeVFSMimeAction * gnome_vfs_mime_get_default_action (const char *mime_type) #GnomeVFSMimeAction * #gnome_vfs_mime_get_default_action (mime_type) # const char *mime_type ## GnomeVFSMimeApplication *gnome_vfs_mime_get_default_application (const char *mime_type) GnomeVFSMimeApplication * gnome_vfs_mime_get_default_application (mime_type) GnomeVFSMimeType *mime_type #if VFS_CHECK_VERSION (2, 10, 0) ## GnomeVFSMimeApplication *gnome_vfs_mime_get_default_application_for_uri (const char *uri, const char *mime_type); GnomeVFSMimeApplication * gnome_vfs_mime_get_default_application_for_uri (mime_type, uri) GnomeVFSMimeType *mime_type const char *uri C_ARGS: uri, mime_type #endif # FIXME: Needs bonobo typemaps. ### Bonobo_ServerInfo * gnome_vfs_mime_get_default_component (const char *mime_type) #Bonobo_ServerInfo * #gnome_vfs_mime_get_default_component (mime_type) # const char *mime_type =for apidoc Returns a list of GnomeVFSMimeApplication's. =cut ## GList * gnome_vfs_mime_get_short_list_applications (const char *mime_type) void gnome_vfs_mime_get_short_list_applications (mime_type) GnomeVFSMimeType *mime_type PREINIT: GList *i, *applications; PPCODE: applications = gnome_vfs_mime_get_short_list_applications (mime_type); for (i = applications; i != NULL; i = i->next) XPUSHs (sv_2mortal (newSVGnomeVFSMimeApplication (i->data))); /* gnome_vfs_mime_application_list_free (applications); */ g_list_free (applications); # FIXME: Needs bonobo typemaps. ### GList * gnome_vfs_mime_get_short_list_components (const char *mime_type) #GList * #gnome_vfs_mime_get_short_list_components (mime_type) # const char *mime_type =for apidoc Returns a list of GnomeVFSMimeApplication's. =cut ## GList * gnome_vfs_mime_get_all_applications (const char *mime_type) void gnome_vfs_mime_get_all_applications (mime_type) GnomeVFSMimeType *mime_type PREINIT: GList *i, *applications; PPCODE: applications = gnome_vfs_mime_get_all_applications (mime_type); for (i = applications; i != NULL; i = i->next) XPUSHs (sv_2mortal (newSVGnomeVFSMimeApplication (i->data))); /* gnome_vfs_mime_application_list_free (applications); */ g_list_free (applications); #if VFS_CHECK_VERSION (2, 10, 0) ## GList * gnome_vfs_mime_get_all_applications_for_uri (const char *uri, const char *mime_type); void gnome_vfs_mime_get_all_applications_for_uri (mime_type, uri) GnomeVFSMimeType *mime_type const char *uri PREINIT: GList *i, *applications; PPCODE: applications = gnome_vfs_mime_get_all_applications_for_uri (uri, mime_type); for (i = applications; i != NULL; i = i->next) XPUSHs (sv_2mortal (newSVGnomeVFSMimeApplication (i->data))); /* gnome_vfs_mime_application_list_free (applications); */ g_list_free (applications); #endif # FIXME: Needs bonobo typemaps. ### GList * gnome_vfs_mime_get_all_components (const char *mime_type) #GList * #gnome_vfs_mime_get_all_components (mime_type) # const char *mime_type ## GnomeVFSResult gnome_vfs_mime_set_default_action_type (const char *mime_type, GnomeVFSMimeActionType action_type) GnomeVFSResult gnome_vfs_mime_set_default_action_type (mime_type, action_type) GnomeVFSMimeType *mime_type GnomeVFSMimeActionType action_type ## GnomeVFSResult gnome_vfs_mime_set_default_application (const char *mime_type, const char *application_id) GnomeVFSResult gnome_vfs_mime_set_default_application (mime_type, application_id) GnomeVFSMimeType *mime_type const char *application_id # FIXME: Needs bonobo typemaps. ### GnomeVFSResult gnome_vfs_mime_set_default_component (const char *mime_type, const char *component_iid) #GnomeVFSResult #gnome_vfs_mime_set_default_component (mime_type, component_iid) # const char *mime_type # const char *component_iid ## const char *gnome_vfs_mime_get_icon (const char *mime_type) const char * gnome_vfs_mime_get_icon (mime_type) GnomeVFSMimeType *mime_type ## GnomeVFSResult gnome_vfs_mime_set_icon (const char *mime_type, const char *filename) GnomeVFSResult gnome_vfs_mime_set_icon (mime_type, filename) GnomeVFSMimeType *mime_type const char *filename ## const char * gnome_vfs_mime_get_description (const char *mime_type) const char * gnome_vfs_mime_get_description (mime_type) GnomeVFSMimeType *mime_type ## GnomeVFSResult gnome_vfs_mime_set_description (const char *mime_type, const char *description) GnomeVFSResult gnome_vfs_mime_set_description (mime_type, description) GnomeVFSMimeType *mime_type const char *description ## gboolean gnome_vfs_mime_can_be_executable (const char *mime_type) gboolean gnome_vfs_mime_can_be_executable (mime_type) GnomeVFSMimeType *mime_type ## GnomeVFSResult gnome_vfs_mime_set_can_be_executable (const char *mime_type, gboolean new_value) GnomeVFSResult gnome_vfs_mime_set_can_be_executable (mime_type, new_value) GnomeVFSMimeType *mime_type gboolean new_value =for apidoc =for arg ... of application id's =cut # FIXME: leak ... ## GnomeVFSResult gnome_vfs_mime_set_short_list_applications (const char *mime_type, GList *application_ids) GnomeVFSResult gnome_vfs_mime_set_short_list_applications (mime_type, ...) GnomeVFSMimeType *mime_type PREINIT: GList *application_ids = NULL; int i; CODE: for (i = 1; i < items; i++) application_ids = g_list_append (application_ids, SvPV_nolen (ST (i))); RETVAL = gnome_vfs_mime_set_short_list_applications (mime_type, application_ids); g_list_free (application_ids); OUTPUT: RETVAL # FIXME: Needs bonobo typemaps. ### GnomeVFSResult gnome_vfs_mime_set_short_list_components (const char *mime_type, GList *component_iids) #GnomeVFSResult #gnome_vfs_mime_set_short_list_components (mime_type, component_iids) # const char *mime_type # GList *component_iids ## GnomeVFSResult gnome_vfs_mime_add_application_to_short_list (const char *mime_type, const char *application_id) GnomeVFSResult gnome_vfs_mime_add_application_to_short_list (mime_type, application_id) GnomeVFSMimeType *mime_type const char *application_id ## GnomeVFSResult gnome_vfs_mime_remove_application_from_short_list (const char *mime_type, const char *application_id) GnomeVFSResult gnome_vfs_mime_remove_application_from_short_list (mime_type, application_id) GnomeVFSMimeType *mime_type const char *application_id # FIXME: Needs bonobo typemaps. ### GnomeVFSResult gnome_vfs_mime_add_component_to_short_list (const char *mime_type, const char *iid) #GnomeVFSResult #gnome_vfs_mime_add_component_to_short_list (mime_type, iid) # const char *mime_type # const char *iid # FIXME: Needs bonobo typemaps. ### GnomeVFSResult gnome_vfs_mime_remove_component_from_short_list (const char *mime_type, const char *iid) #GnomeVFSResult #gnome_vfs_mime_remove_component_from_short_list (mime_type, iid) # const char *mime_type # const char *iid ## GnomeVFSResult gnome_vfs_mime_add_extension (const char *mime_type, const char *extension) GnomeVFSResult gnome_vfs_mime_add_extension (mime_type, extension) GnomeVFSMimeType *mime_type const char *extension ## GnomeVFSResult gnome_vfs_mime_remove_extension (const char *mime_type, const char *extension) GnomeVFSResult gnome_vfs_mime_remove_extension (mime_type, extension) GnomeVFSMimeType *mime_type const char *extension =for apidoc =for arg ... of application id's =cut # FIXME: leak ... ## GnomeVFSResult gnome_vfs_mime_extend_all_applications (const char *mime_type, GList *application_ids) GnomeVFSResult gnome_vfs_mime_extend_all_applications (mime_type, ...) GnomeVFSMimeType *mime_type PREINIT: GList *application_ids = NULL; int i; CODE: for (i = 1; i < items; i++) application_ids = g_list_append (application_ids, SvPV_nolen (ST (i))); RETVAL = gnome_vfs_mime_extend_all_applications (mime_type, application_ids); g_list_free (application_ids); OUTPUT: RETVAL =for apidoc =for arg ... of application id's =cut # FIXME: leak ... ## GnomeVFSResult gnome_vfs_mime_remove_from_all_applications (const char *mime_type, GList *application_ids) GnomeVFSResult gnome_vfs_mime_remove_from_all_applications (mime_type, ...) GnomeVFSMimeType *mime_type PREINIT: GList *application_ids = NULL; int i; CODE: for (i = 1; i < items; i++) application_ids = g_list_append (application_ids, SvPV_nolen (ST (i))); RETVAL = gnome_vfs_mime_remove_from_all_applications (mime_type, application_ids); g_list_free (application_ids); OUTPUT: RETVAL #if VFS_CHECK_VERSION (2, 8, 0) ## GList *gnome_vfs_mime_get_all_desktop_entries (const char *mime_type) void gnome_vfs_mime_get_all_desktop_entries (mime_type) GnomeVFSMimeType *mime_type PREINIT: GList *result = NULL, *i; PPCODE: result = gnome_vfs_mime_get_all_desktop_entries (mime_type); for (i = result; i; i = i->next) { if (i->data) { XPUSHs (sv_2mortal (newSVpv (i->data, 0))); g_free (i->data); } } g_list_free (result); ## gchar *gnome_vfs_mime_get_default_desktop_entry (const char *mime_type) gchar_own * gnome_vfs_mime_get_default_desktop_entry (mime_type) GnomeVFSMimeType *mime_type ## GnomeVFSMimeEquivalence gnome_vfs_mime_type_get_equivalence (const char *mime_type, const char *base_mime_type) GnomeVFSMimeEquivalence gnome_vfs_mime_get_equivalence (mime_type, base_mime_type) GnomeVFSMimeType *mime_type GnomeVFSMimeType *base_mime_type CODE: RETVAL = gnome_vfs_mime_type_get_equivalence (mime_type, base_mime_type); OUTPUT: RETVAL ## gboolean gnome_vfs_mime_type_is_equal (const char *a, const char *b) gboolean gnome_vfs_mime_is_equal (a, b) GnomeVFSMimeType *a GnomeVFSMimeType *b CODE: RETVAL = gnome_vfs_mime_type_is_equal (a, b); OUTPUT: RETVAL #endif # --------------------------------------------------------------------------- # MODULE = Gnome2::VFS::Mime PACKAGE = Gnome2::VFS::Mime::Application PREFIX = gnome_vfs_mime_application_ void DESTROY (GnomeVFSMimeApplication *application) CODE: gnome_vfs_mime_application_free (application); ## GnomeVFSMimeApplication *gnome_vfs_mime_application_new_from_id (const char *id) GnomeVFSMimeApplication * gnome_vfs_mime_application_new_from_id (class, id) const char *id C_ARGS: id #if VFS_CHECK_VERSION (2, 10, 0) ## GnomeVFSMimeApplication *gnome_vfs_mime_application_new_from_desktop_id (const char *id); GnomeVFSMimeApplication * gnome_vfs_mime_application_new_from_desktop_id (class, id) const char *id C_ARGS: id #endif #if VFS_CHECK_VERSION (2, 4, 0) =for apidoc =for arg ... of URI strings =cut ## GnomeVFSResult gnome_vfs_mime_application_launch (GnomeVFSMimeApplication *app, GList *uris) GnomeVFSResult gnome_vfs_mime_application_launch (app, ...) GnomeVFSMimeApplication *app PREINIT: GList *uris = NULL; int i; CODE: for (i = 1; i < items; i++) uris = g_list_append (uris, SvPV_nolen (ST (i))); RETVAL = gnome_vfs_mime_application_launch (app, uris); g_list_free (uris); OUTPUT: RETVAL # FIXME: leak? ## GnomeVFSResult gnome_vfs_mime_application_launch_with_env (GnomeVFSMimeApplication *app, GList *uris, char **envp) GnomeVFSResult gnome_vfs_mime_application_launch_with_env (app, uri_ref, env_ref) GnomeVFSMimeApplication *app SV *uri_ref SV *env_ref PREINIT: char **envp; GList *uris; CODE: envp = SvEnvArray (env_ref); uris = SvPVGList (uri_ref); RETVAL = gnome_vfs_mime_application_launch_with_env (app, uris, envp); g_free (envp); g_list_free (uris); OUTPUT: RETVAL #endif #if VFS_CHECK_VERSION (2, 10, 0) const char *gnome_vfs_mime_application_get_desktop_id (GnomeVFSMimeApplication *app); const char *gnome_vfs_mime_application_get_desktop_file_path (GnomeVFSMimeApplication *app); const char *gnome_vfs_mime_application_get_name (GnomeVFSMimeApplication *app); const char *gnome_vfs_mime_application_get_generic_name (GnomeVFSMimeApplication *app); const char *gnome_vfs_mime_application_get_icon (GnomeVFSMimeApplication *app); const char *gnome_vfs_mime_application_get_exec (GnomeVFSMimeApplication *app); const char *gnome_vfs_mime_application_get_binary_name (GnomeVFSMimeApplication *app); gboolean gnome_vfs_mime_application_supports_uris (GnomeVFSMimeApplication *app); gboolean gnome_vfs_mime_application_requires_terminal (GnomeVFSMimeApplication *app); gboolean gnome_vfs_mime_application_supports_startup_notification (GnomeVFSMimeApplication *app); const char *gnome_vfs_mime_application_get_startup_wm_class (GnomeVFSMimeApplication *app); #endif # --------------------------------------------------------------------------- # MODULE = Gnome2::VFS::Mime PACKAGE = Gnome2::VFS::Mime::Action PREFIX = gnome_vfs_mime_action_ ## void gnome_vfs_mime_action_free (GnomeVFSMimeAction *action) # FIXME: Needs bonobo typemaps. ### GnomeVFSResult gnome_vfs_mime_action_launch (GnomeVFSMimeAction *action, GList *uris) #GnomeVFSResult #gnome_vfs_mime_action_launch (action, uris) # GnomeVFSMimeAction *action # GList *uris ### GnomeVFSResult gnome_vfs_mime_action_launch_with_env (GnomeVFSMimeAction *action, GList *uris, char **envp) #GnomeVFSResult #gnome_vfs_mime_action_launch_with_env (action, uris, envp) # GnomeVFSMimeAction *action # GList *uris # char **envp # --------------------------------------------------------------------------- # MODULE = Gnome2::VFS::Mime PACKAGE = Gnome2::VFS::Mime::Monitor PREFIX = gnome_vfs_mime_monitor_ ## GnomeVFSMIMEMonitor *gnome_vfs_mime_monitor_get (void) GnomeVFSMIMEMonitor * gnome_vfs_mime_monitor_get (class) C_ARGS: /* void */ # --------------------------------------------------------------------------- # MODULE = Gnome2::VFS::Mime PACKAGE = Gnome2::VFS PREFIX = gnome_vfs_ =for object Gnome2::VFS::Mime =cut ## char *gnome_vfs_get_mime_type (const char *text_uri) char_own * gnome_vfs_get_mime_type (class, text_uri) const char *text_uri C_ARGS: text_uri ## const char *gnome_vfs_get_mime_type_for_data (gconstpointer data, int data_size) const char * gnome_vfs_get_mime_type_for_data (class, data) SV *data PREINIT: STRLEN data_size; gconstpointer real_data; CODE: real_data = SvPV (data, data_size); RETVAL = gnome_vfs_get_mime_type_for_data (real_data, data_size); OUTPUT: RETVAL #if VFS_CHECK_VERSION (2, 14, 0) # char * gnome_vfs_get_slow_mime_type (const char *text_uri); char_own * gnome_vfs_get_slow_mime_type (class, const char *text_uri) C_ARGS: text_uri # const char * gnome_vfs_get_mime_type_for_name (const char *filename); const char * gnome_vfs_get_mime_type_for_name (class, const char *filename) C_ARGS: filename # const char * gnome_vfs_get_mime_type_for_name_and_data (const char *filename, gconstpointer data, gssize data_size); const char * gnome_vfs_get_mime_type_for_name_and_data (class, filename, data) const char *filename SV *data PREINIT: STRLEN data_size; gconstpointer real_data; CODE: real_data = SvPV (data, data_size); RETVAL = gnome_vfs_get_mime_type_for_name_and_data (filename, real_data, data_size); OUTPUT: RETVAL #endif Gnome2-VFS-1.082/xs/GnomeVFSAsync.xs0000644000175000017500000007440212222506645015360 0ustar lacklack/* * Copyright (C) 2003 by the gtk2-perl team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * $Id$ */ #include "vfs2perl.h" #include #include /* ------------------------------------------------------------------------- */ #if 0 GHashTable *vfs2perl_async_callbacks = NULL; G_LOCK_DEFINE_STATIC (vfs2perl_async_callbacks); void vfs2perl_async_callbacks_add (GnomeVFSAsyncHandle *handle, GPerlCallback *callback) { G_LOCK (vfs2perl_async_callbacks); { GList *list; if (vfs2perl_async_callbacks == NULL) vfs2perl_async_callbacks = g_hash_table_new_full (NULL, NULL, NULL, (GDestroyNotify) g_list_free); list = g_hash_table_lookup (vfs2perl_async_callbacks, handle); list = g_list_append (list, callback); g_hash_table_insert (vfs2perl_async_callbacks, handle, list); } G_UNLOCK (vfs2perl_async_callbacks); } void vfs2perl_async_callbacks_destroy (GnomeVFSAsyncHandle *handle) { G_LOCK (vfs2perl_async_callbacks); { if (vfs2perl_async_callbacks != NULL) { GList *list = g_hash_table_lookup (vfs2perl_async_callbacks, handle); if (list != NULL) { /* GPerlCallback *callback = g_list_last (list)->data; if (callback != NULL) gperl_callback_destroy (callback); */ GList *i; for (i = list; i != NULL; i = i->next) if (i->data != NULL) gperl_callback_destroy ((GPerlCallback *) i->data); if (g_list_length (list) == 0) g_hash_table_remove (vfs2perl_async_callbacks, handle); } if (g_hash_table_size (vfs2perl_async_callbacks) == 0) { g_hash_table_destroy (vfs2perl_async_callbacks); vfs2perl_async_callbacks = NULL; } } } G_UNLOCK (vfs2perl_async_callbacks); } #endif /* ------------------------------------------------------------------------- */ static GPerlCallback * vfs2perl_async_callback_create (SV *func, SV *data) { return gperl_callback_new (func, data, 0, NULL, 0); } static void vfs2perl_async_callback (GnomeVFSAsyncHandle *handle, GnomeVFSResult result, GPerlCallback *callback) { dGPERL_CALLBACK_MARSHAL_SP; GPERL_CALLBACK_MARSHAL_INIT (callback); ENTER; SAVETMPS; PUSHMARK (SP); EXTEND (SP, 3); PUSHs (sv_2mortal (newSVGnomeVFSAsyncHandle (handle))); PUSHs (sv_2mortal (newSVGnomeVFSResult (result))); if (callback->data) XPUSHs (sv_2mortal (newSVsv (callback->data))); PUTBACK; call_sv (callback->func, G_DISCARD); FREETMPS; LEAVE; } /* ------------------------------------------------------------------------- */ static GPerlCallback * vfs2perl_async_read_callback_create (SV *func, SV *data) { return gperl_callback_new (func, data, 0, NULL, 0); } static void vfs2perl_async_read_callback (GnomeVFSAsyncHandle *handle, GnomeVFSResult result, char* buffer, GnomeVFSFileSize bytes_requested, GnomeVFSFileSize bytes_read, GPerlCallback *callback) { dGPERL_CALLBACK_MARSHAL_SP; GPERL_CALLBACK_MARSHAL_INIT (callback); ENTER; SAVETMPS; PUSHMARK (SP); EXTEND (SP, 5); PUSHs (sv_2mortal (newSVGnomeVFSAsyncHandle (handle))); PUSHs (sv_2mortal (newSVGnomeVFSResult (result))); PUSHs (sv_2mortal (newSVpv (buffer, bytes_read))); PUSHs (sv_2mortal (newSVGnomeVFSFileSize (bytes_requested))); PUSHs (sv_2mortal (newSVGnomeVFSFileSize (bytes_read))); if (callback->data) XPUSHs (sv_2mortal (newSVsv (callback->data))); PUTBACK; call_sv (callback->func, G_DISCARD); FREETMPS; LEAVE; } /* ------------------------------------------------------------------------- */ static GPerlCallback * vfs2perl_async_write_callback_create (SV *func, SV *data) { return gperl_callback_new (func, data, 0, NULL, 0); } static void vfs2perl_async_write_callback (GnomeVFSAsyncHandle *handle, GnomeVFSResult result, char* buffer, GnomeVFSFileSize bytes_requested, GnomeVFSFileSize bytes_written, GPerlCallback *callback) { dGPERL_CALLBACK_MARSHAL_SP; GPERL_CALLBACK_MARSHAL_INIT (callback); ENTER; SAVETMPS; PUSHMARK (SP); EXTEND (SP, 5); PUSHs (sv_2mortal (newSVGnomeVFSAsyncHandle (handle))); PUSHs (sv_2mortal (newSVGnomeVFSResult (result))); PUSHs (sv_2mortal (newSVpv (buffer, bytes_written))); PUSHs (sv_2mortal (newSVGnomeVFSFileSize (bytes_requested))); PUSHs (sv_2mortal (newSVGnomeVFSFileSize (bytes_written))); if (callback->data) XPUSHs (sv_2mortal (newSVsv (callback->data))); PUTBACK; call_sv (callback->func, G_DISCARD); FREETMPS; LEAVE; } /* ------------------------------------------------------------------------- */ static GPerlCallback * vfs2perl_async_directory_load_callback_create (SV *func, SV *data) { return gperl_callback_new (func, data, 0, NULL, 0); } static void vfs2perl_async_directory_load_callback (GnomeVFSAsyncHandle *handle, GnomeVFSResult result, GList *list, guint entries_read, GPerlCallback *callback) { dGPERL_CALLBACK_MARSHAL_SP; GPERL_CALLBACK_MARSHAL_INIT (callback); ENTER; SAVETMPS; PUSHMARK (SP); EXTEND (SP, 4); PUSHs (sv_2mortal (newSVGnomeVFSAsyncHandle (handle))); PUSHs (sv_2mortal (newSVGnomeVFSResult (result))); PUSHs (sv_2mortal (newSVGnomeVFSFileInfoGList (list))); PUSHs (sv_2mortal (newSVuv (entries_read))); if (callback->data) XPUSHs (sv_2mortal (newSVsv (callback->data))); PUTBACK; call_sv (callback->func, G_DISCARD); FREETMPS; LEAVE; } /* ------------------------------------------------------------------------- */ static GPerlCallback * vfs2perl_async_get_file_info_callback_create (SV *func, SV *data) { return gperl_callback_new (func, data, 0, NULL, 0); } static void vfs2perl_async_get_file_info_callback (GnomeVFSAsyncHandle *handle, GList *results, GPerlCallback *callback) { dGPERL_CALLBACK_MARSHAL_SP; GPERL_CALLBACK_MARSHAL_INIT (callback); ENTER; SAVETMPS; PUSHMARK (SP); EXTEND (SP, 2); PUSHs (sv_2mortal (newSVGnomeVFSAsyncHandle (handle))); PUSHs (sv_2mortal (newSVGnomeVFSGetFileInfoResultGList (results))); if (callback->data) XPUSHs (sv_2mortal (newSVsv (callback->data))); PUTBACK; call_sv (callback->func, G_DISCARD); FREETMPS; LEAVE; } /* ------------------------------------------------------------------------- */ static GPerlCallback * vfs2perl_async_xfer_progress_callback_create (SV *func, SV *data) { return gperl_callback_new (func, data, 0, NULL, 0); } /* G_LOCK_DEFINE_STATIC (vfs2perl_async_xfer_progress_callback); */ static void vfs2perl_async_xfer_progress_callback (GnomeVFSAsyncHandle *handle, GnomeVFSXferProgressInfo *info, GPerlCallback *callback) { /* G_LOCK (vfs2perl_async_xfer_progress_callback); { */ dGPERL_CALLBACK_MARSHAL_SP; GPERL_CALLBACK_MARSHAL_INIT (callback); ENTER; SAVETMPS; PUSHMARK (SP); EXTEND (SP, 2); PUSHs (sv_2mortal (newSVGnomeVFSAsyncHandle (handle))); PUSHs (sv_2mortal (newSVGnomeVFSXferProgressInfo (info))); if (callback->data) XPUSHs (sv_2mortal (newSVsv (callback->data))); PUTBACK; call_sv (callback->func, G_DISCARD); FREETMPS; LEAVE; /* } G_UNLOCK (vfs2perl_async_xfer_progress_callback); */ } extern GPerlCallback * vfs2perl_xfer_progress_callback_create (SV *func, SV *data); extern gint vfs2perl_xfer_progress_callback (GnomeVFSXferProgressInfo *info, GPerlCallback *callback); /* ------------------------------------------------------------------------- */ static GPerlCallback * vfs2perl_async_find_directory_callback_create (SV *func, SV *data) { return gperl_callback_new (func, data, 0, NULL, 0); } static void vfs2perl_async_find_directory_callback (GnomeVFSAsyncHandle *handle, GList *results, GPerlCallback *callback) { dGPERL_CALLBACK_MARSHAL_SP; GPERL_CALLBACK_MARSHAL_INIT (callback); ENTER; SAVETMPS; PUSHMARK (SP); EXTEND (SP, 2); PUSHs (sv_2mortal (newSVGnomeVFSAsyncHandle (handle))); PUSHs (sv_2mortal (newSVGnomeVFSFindDirectoryResultGList (results))); if (callback->data) XPUSHs (sv_2mortal (newSVsv (callback->data))); PUTBACK; call_sv (callback->func, G_DISCARD); FREETMPS; LEAVE; } /* ------------------------------------------------------------------------- */ static GPerlCallback * vfs2perl_async_set_file_info_callback_create (SV *func, SV *data) { return gperl_callback_new (func, data, 0, NULL, 0); } static void vfs2perl_async_set_file_info_callback (GnomeVFSAsyncHandle *handle, GnomeVFSResult result, GnomeVFSFileInfo *file_info, GPerlCallback* callback) { dGPERL_CALLBACK_MARSHAL_SP; GPERL_CALLBACK_MARSHAL_INIT (callback); ENTER; SAVETMPS; PUSHMARK (SP); EXTEND (SP, 3); PUSHs (sv_2mortal (newSVGnomeVFSAsyncHandle (handle))); PUSHs (sv_2mortal (newSVGnomeVFSResult (result))); PUSHs (sv_2mortal (newSVGnomeVFSFileInfo (file_info))); if (callback->data) XPUSHs (sv_2mortal (newSVsv (callback->data))); PUTBACK; call_sv (callback->func, G_DISCARD); FREETMPS; LEAVE; } /* ------------------------------------------------------------------------- */ MODULE = Gnome2::VFS::Async PACKAGE = Gnome2::VFS::Async PREFIX = gnome_vfs_async_ ## void gnome_vfs_async_set_job_limit (int limit) void gnome_vfs_async_set_job_limit (class, limit) int limit C_ARGS: limit ## int gnome_vfs_async_get_job_limit (void) int gnome_vfs_async_get_job_limit (class) C_ARGS: /* void */ ## void gnome_vfs_async_open (GnomeVFSAsyncHandle **handle_return, const gchar *text_uri, GnomeVFSOpenMode open_mode, int priority, GnomeVFSAsyncOpenCallback callback, gpointer callback_data) GnomeVFSAsyncHandle * gnome_vfs_async_open (class, text_uri, open_mode, priority, func, data=NULL) const gchar *text_uri GnomeVFSOpenMode open_mode int priority SV *func SV *data PREINIT: GPerlCallback *callback; CODE: callback = vfs2perl_async_callback_create (func, data); gnome_vfs_async_open (&RETVAL, text_uri, open_mode, priority, (GnomeVFSAsyncOpenCallback) vfs2perl_async_callback, callback); /* vfs2perl_async_callbacks_add (RETVAL, callback); */ /* FIXME, FIXME, FIXME: what about callback destruction? */ OUTPUT: RETVAL ### void gnome_vfs_async_open_uri (GnomeVFSAsyncHandle **handle_return, GnomeVFSURI *uri, GnomeVFSOpenMode open_mode, int priority, GnomeVFSAsyncOpenCallback callback, gpointer callback_data) GnomeVFSAsyncHandle * gnome_vfs_async_open_uri (class, uri, open_mode, priority, func, data=NULL) GnomeVFSURI *uri GnomeVFSOpenMode open_mode int priority SV *func SV *data PREINIT: GPerlCallback *callback; CODE: callback = vfs2perl_async_callback_create (func, data); gnome_vfs_async_open_uri (&RETVAL, uri, open_mode, priority, (GnomeVFSAsyncOpenCallback) vfs2perl_async_callback, callback); /* vfs2perl_async_callbacks_add (RETVAL, callback); */ /* FIXME, FIXME, FIXME: what about callback destruction? */ OUTPUT: RETVAL ### void gnome_vfs_async_open_as_channel (GnomeVFSAsyncHandle **handle_return, const gchar *text_uri, GnomeVFSOpenMode open_mode, guint advised_block_size, int priority, GnomeVFSAsyncOpenAsChannelCallback callback, gpointer callback_data) #void #gnome_vfs_async_open_as_channel (handle_return, text_uri, open_mode, advised_block_size, priority, callback, callback_data) # GnomeVFSAsyncHandle **handle_return # const gchar *text_uri # GnomeVFSOpenMode open_mode # guint advised_block_size # int priority # GnomeVFSAsyncOpenAsChannelCallback callback # gpointer callback_data ### void gnome_vfs_async_open_uri_as_channel (GnomeVFSAsyncHandle **handle_return, GnomeVFSURI *uri, GnomeVFSOpenMode open_mode, guint advised_block_size, int priority, GnomeVFSAsyncOpenAsChannelCallback callback, gpointer callback_data) #void #gnome_vfs_async_open_uri_as_channel (handle_return, uri, open_mode, advised_block_size, priority, callback, callback_data) # GnomeVFSAsyncHandle **handle_return # GnomeVFSURI *uri # GnomeVFSOpenMode open_mode # guint advised_block_size # int priority # GnomeVFSAsyncOpenAsChannelCallback callback # gpointer callback_data ## void gnome_vfs_async_create (GnomeVFSAsyncHandle **handle_return, const gchar *text_uri, GnomeVFSOpenMode open_mode, gboolean exclusive, guint perm, int priority, GnomeVFSAsyncOpenCallback callback, gpointer callback_data) GnomeVFSAsyncHandle * gnome_vfs_async_create (class, text_uri, open_mode, exclusive, perm, priority, func, data=NULL) const gchar *text_uri GnomeVFSOpenMode open_mode gboolean exclusive guint perm int priority SV *func SV *data PREINIT: GPerlCallback *callback; CODE: callback = vfs2perl_async_callback_create (func, data); gnome_vfs_async_create (&RETVAL, text_uri, open_mode, exclusive, perm, priority, (GnomeVFSAsyncCreateCallback) vfs2perl_async_callback, callback); /* vfs2perl_async_callbacks_add (RETVAL, callback); */ /* FIXME, FIXME, FIXME: what about callback destruction? */ OUTPUT: RETVAL ## void gnome_vfs_async_create_uri (GnomeVFSAsyncHandle **handle_return, GnomeVFSURI *uri, GnomeVFSOpenMode open_mode, gboolean exclusive, guint perm, int priority, GnomeVFSAsyncOpenCallback callback, gpointer callback_data) GnomeVFSAsyncHandle * gnome_vfs_async_create_uri (class, uri, open_mode, exclusive, perm, priority, func, data=NULL) GnomeVFSURI *uri GnomeVFSOpenMode open_mode gboolean exclusive guint perm int priority SV *func SV *data PREINIT: GPerlCallback *callback; CODE: callback = vfs2perl_async_callback_create (func, data); gnome_vfs_async_create_uri (&RETVAL, uri, open_mode, exclusive, perm, priority, (GnomeVFSAsyncOpenCallback) vfs2perl_async_callback, callback); /* vfs2perl_async_callbacks_add (RETVAL, callback); */ /* FIXME, FIXME, FIXME: what about callback destruction? */ OUTPUT: RETVAL ## void gnome_vfs_async_create_symbolic_link (GnomeVFSAsyncHandle **handle_return, GnomeVFSURI *uri, const gchar *uri_reference, int priority, GnomeVFSAsyncOpenCallback callback, gpointer callback_data) GnomeVFSAsyncHandle * gnome_vfs_async_create_symbolic_link (class, uri, uri_reference, priority, func, data=NULL) GnomeVFSURI *uri const gchar *uri_reference int priority SV *func SV *data PREINIT: GPerlCallback *callback; CODE: callback = vfs2perl_async_callback_create (func, data); gnome_vfs_async_create_symbolic_link (&RETVAL, uri, uri_reference, priority, (GnomeVFSAsyncOpenCallback) vfs2perl_async_callback, callback); /* vfs2perl_async_callbacks_add (RETVAL, callback); */ /* FIXME, FIXME, FIXME: what about callback destruction? */ OUTPUT: RETVAL ## void gnome_vfs_async_get_file_info (GnomeVFSAsyncHandle **handle_return, GList *uri_list, GnomeVFSFileInfoOptions options, int priority, GnomeVFSAsyncGetFileInfoCallback callback, gpointer callback_data) GnomeVFSAsyncHandle * gnome_vfs_async_get_file_info (class, uri_ref, options, priority, func, data=NULL) SV *uri_ref GnomeVFSFileInfoOptions options int priority SV *func SV *data PREINIT: GPerlCallback *callback; GList *uri_list; CODE: callback = vfs2perl_async_get_file_info_callback_create (func, data); uri_list = SvGnomeVFSURIGList (uri_ref); gnome_vfs_async_get_file_info (&RETVAL, uri_list, options, priority, (GnomeVFSAsyncGetFileInfoCallback) vfs2perl_async_get_file_info_callback, callback); /* vfs2perl_async_callbacks_add (RETVAL, callback); */ g_list_free (uri_list); /* FIXME, FIXME, FIXME: what about callback destruction? */ OUTPUT: RETVAL ## void gnome_vfs_async_set_file_info (GnomeVFSAsyncHandle **handle_return, GnomeVFSURI *uri, GnomeVFSFileInfo *info, GnomeVFSSetFileInfoMask mask, GnomeVFSFileInfoOptions options, int priority, GnomeVFSAsyncSetFileInfoCallback callback, gpointer callback_data) GnomeVFSAsyncHandle * gnome_vfs_async_set_file_info (class, uri, info, mask, options, priority, func, data=NULL) GnomeVFSURI *uri GnomeVFSFileInfo *info GnomeVFSSetFileInfoMask mask GnomeVFSFileInfoOptions options int priority SV *func SV *data PREINIT: GPerlCallback *callback; CODE: callback = vfs2perl_async_set_file_info_callback_create (func, data); gnome_vfs_async_set_file_info (&RETVAL, uri, info, mask, options, priority, (GnomeVFSAsyncSetFileInfoCallback) vfs2perl_async_set_file_info_callback, callback); /* vfs2perl_async_callbacks_add (RETVAL, callback); */ /* FIXME, FIXME, FIXME: what about callback destruction? */ OUTPUT: RETVAL ## void gnome_vfs_async_load_directory (GnomeVFSAsyncHandle **handle_return, const gchar *text_uri, GnomeVFSFileInfoOptions options, guint items_per_notification, int priority, GnomeVFSAsyncDirectoryLoadCallback callback, gpointer callback_data) GnomeVFSAsyncHandle * gnome_vfs_async_load_directory (class, text_uri, options, items_per_notification, priority, func, data=NULL) const gchar *text_uri GnomeVFSFileInfoOptions options guint items_per_notification int priority SV *func SV *data PREINIT: GPerlCallback *callback; CODE: callback = vfs2perl_async_directory_load_callback_create (func, data); gnome_vfs_async_load_directory (&RETVAL, text_uri, options, items_per_notification, priority, (GnomeVFSAsyncDirectoryLoadCallback) vfs2perl_async_directory_load_callback, callback); /* vfs2perl_async_callbacks_add (RETVAL, callback); */ /* FIXME, FIXME, FIXME: what about callback destruction? */ OUTPUT: RETVAL ## void gnome_vfs_async_load_directory_uri (GnomeVFSAsyncHandle **handle_return, GnomeVFSURI *uri, GnomeVFSFileInfoOptions options, guint items_per_notification, int priority, GnomeVFSAsyncDirectoryLoadCallback callback, gpointer callback_data) GnomeVFSAsyncHandle * gnome_vfs_async_load_directory_uri (class, uri, options, items_per_notification, priority, func, data=NULL) GnomeVFSURI *uri GnomeVFSFileInfoOptions options guint items_per_notification int priority SV *func SV *data PREINIT: GPerlCallback *callback; CODE: callback = vfs2perl_async_directory_load_callback_create (func, data); gnome_vfs_async_load_directory_uri (&RETVAL, uri, options, items_per_notification, priority, (GnomeVFSAsyncDirectoryLoadCallback) vfs2perl_async_directory_load_callback, callback); /* vfs2perl_async_callbacks_add (RETVAL, callback); */ /* FIXME, FIXME, FIXME: what about callback destruction? */ OUTPUT: RETVAL =for apidoc Returns a GnomeVFSResult and a GnomeVFSAsyncHandle. =cut ## GnomeVFSResult gnome_vfs_async_xfer (GnomeVFSAsyncHandle **handle_return, GList *source_uri_list, GList *target_uri_list, GnomeVFSXferOptions xfer_options, GnomeVFSXferErrorMode error_mode, GnomeVFSXferOverwriteMode overwrite_mode, int priority, GnomeVFSAsyncXferProgressCallback progress_update_callback, gpointer update_callback_data, GnomeVFSXferProgressCallback progress_sync_callback, gpointer sync_callback_data) void gnome_vfs_async_xfer (class, source_ref, target_ref, xfer_options, error_mode, overwrite_mode, priority, func_update, data_update, func_sync, data_sync=NULL) SV *source_ref SV *target_ref GnomeVFSXferOptions xfer_options GnomeVFSXferErrorMode error_mode GnomeVFSXferOverwriteMode overwrite_mode int priority SV *func_update SV *data_update SV *func_sync SV *data_sync PREINIT: GnomeVFSResult result; GnomeVFSAsyncHandle *handle_return; GList *source_uri_list; GList *target_uri_list; GPerlCallback *callback_update; GPerlCallback *callback_sync; PPCODE: source_uri_list = SvGnomeVFSURIGList (source_ref); target_uri_list = SvGnomeVFSURIGList (target_ref); callback_update = vfs2perl_async_xfer_progress_callback_create (func_update, data_update); callback_sync = vfs2perl_xfer_progress_callback_create (func_sync, data_sync); result = gnome_vfs_async_xfer (&handle_return, source_uri_list, target_uri_list, xfer_options, error_mode, overwrite_mode, priority, (GnomeVFSAsyncXferProgressCallback) vfs2perl_async_xfer_progress_callback, callback_update, (GnomeVFSXferProgressCallback) vfs2perl_xfer_progress_callback, callback_sync); /* vfs2perl_async_callbacks_add (handle_return, callback_update); vfs2perl_async_callbacks_add (handle_return, callback_sync); */ g_list_free (source_uri_list); g_list_free (target_uri_list); EXTEND (sp, 2); PUSHs (sv_2mortal (newSVGnomeVFSResult (result))); PUSHs (sv_2mortal (newSVGnomeVFSAsyncHandle (handle_return))); /* FIXME, FIXME, FIXME: what about callback destruction? */ ## void gnome_vfs_async_find_directory (GnomeVFSAsyncHandle **handle_return, GList *near_uri_list, GnomeVFSFindDirectoryKind kind, gboolean create_if_needed, gboolean find_if_needed, guint permissions, int priority, GnomeVFSAsyncFindDirectoryCallback callback, gpointer user_data) GnomeVFSAsyncHandle * gnome_vfs_async_find_directory (class, near_ref, kind, create_if_needed, find_if_needed, permissions, priority, func, data=NULL) SV *near_ref GnomeVFSFindDirectoryKind kind gboolean create_if_needed gboolean find_if_needed guint permissions int priority SV *func SV *data PREINIT: GPerlCallback *callback; GList *near_uri_list; CODE: near_uri_list = SvGnomeVFSURIGList (near_ref); callback = vfs2perl_async_find_directory_callback_create (func, data); gnome_vfs_async_find_directory (&RETVAL, near_uri_list, kind, create_if_needed, find_if_needed, permissions, priority, (GnomeVFSAsyncFindDirectoryCallback) vfs2perl_async_find_directory_callback, callback); /* vfs2perl_async_callbacks_add (RETVAL, callback); */ g_list_free (near_uri_list); /* FIXME, FIXME, FIXME: what about callback destruction? */ OUTPUT: RETVAL ### void gnome_vfs_async_create_as_channel (GnomeVFSAsyncHandle **handle_return, const gchar *text_uri, GnomeVFSOpenMode open_mode, gboolean exclusive, guint perm, int priority, GnomeVFSAsyncCreateAsChannelCallback callback, gpointer callback_data) #void #gnome_vfs_async_create_as_channel (handle_return, text_uri, open_mode, exclusive, perm, priority, callback, callback_data) # GnomeVFSAsyncHandle **handle_return # const gchar *text_uri # GnomeVFSOpenMode open_mode # gboolean exclusive # guint perm # int priority # GnomeVFSAsyncCreateAsChannelCallback callback # gpointer callback_data ### void gnome_vfs_async_create_uri_as_channel (GnomeVFSAsyncHandle **handle_return, GnomeVFSURI *uri, GnomeVFSOpenMode open_mode, gboolean exclusive, guint perm, int priority, GnomeVFSAsyncCreateAsChannelCallback callback, gpointer callback_data) #void #gnome_vfs_async_create_uri_as_channel (handle_return, uri, open_mode, exclusive, perm, priority, callback, callback_data) # GnomeVFSAsyncHandle **handle_return # GnomeVFSURI *uri # GnomeVFSOpenMode open_mode # gboolean exclusive # guint perm # int priority # GnomeVFSAsyncCreateAsChannelCallback callback # gpointer callback_data ### void gnome_vfs_async_file_control (GnomeVFSAsyncHandle *handle, const char *operation, gpointer operation_data, GDestroyNotify operation_data_destroy_func, GnomeVFSAsyncFileControlCallback callback, gpointer callback_data) #void #gnome_vfs_async_file_control (handle, operation, operation_data, operation_data_destroy_func, callback, callback_data) # GnomeVFSAsyncHandle *handle # const char *operation # gpointer operation_data # GDestroyNotify operation_data_destroy_func # GnomeVFSAsyncFileControlCallback callback # gpointer callback_data # --------------------------------------------------------------------------- # MODULE = Gnome2::VFS::Async PACKAGE = Gnome2::VFS::Async::Handle PREFIX = gnome_vfs_async_ # void # DESTROY (handle) # GnomeVFSAsyncHandle *handle # CODE: # vfs2perl_async_callbacks_destroy (handle); ## void gnome_vfs_async_close (GnomeVFSAsyncHandle *handle, GnomeVFSAsyncCloseCallback callback, gpointer callback_data) void gnome_vfs_async_close (handle, func, data=NULL) GnomeVFSAsyncHandle *handle SV *func SV *data PREINIT: GPerlCallback *callback; CODE: callback = vfs2perl_async_callback_create (func, data); gnome_vfs_async_close (handle, (GnomeVFSAsyncCloseCallback) vfs2perl_async_callback, callback); /* vfs2perl_async_callbacks_add (handle, callback); */ /* FIXME, FIXME, FIXME: what about callback destruction? */ # FIXME: destroy callback here? docs say: # «Its possible to still receive another call or two on the callback.» ## void gnome_vfs_async_cancel (GnomeVFSAsyncHandle *handle) void gnome_vfs_async_cancel (handle) GnomeVFSAsyncHandle *handle ## void gnome_vfs_async_read (GnomeVFSAsyncHandle *handle, gpointer buffer, guint bytes, GnomeVFSAsyncReadCallback callback, gpointer callback_data) void gnome_vfs_async_read (handle, bytes, func, data=NULL) GnomeVFSAsyncHandle *handle guint bytes SV *func SV *data PREINIT: GPerlCallback *callback; char *buffer; CODE: callback = vfs2perl_async_read_callback_create (func, data); buffer = g_new0 (char, bytes); gnome_vfs_async_read (handle, buffer, bytes, (GnomeVFSAsyncReadCallback) vfs2perl_async_read_callback, callback); /* vfs2perl_async_callbacks_add (handle, callback); */ /* FIXME, FIXME, FIXME: what about callback destruction? and the buffer? */ ## void gnome_vfs_async_write (GnomeVFSAsyncHandle *handle, gconstpointer buffer, guint bytes, GnomeVFSAsyncWriteCallback callback, gpointer callback_data) void gnome_vfs_async_write (handle, buffer, bytes, func, data=NULL) GnomeVFSAsyncHandle *handle char* buffer guint bytes SV *func SV *data PREINIT: GPerlCallback *callback; CODE: callback = vfs2perl_async_write_callback_create (func, data); gnome_vfs_async_write (handle, buffer, bytes, (GnomeVFSAsyncWriteCallback) vfs2perl_async_write_callback, callback); /* vfs2perl_async_callbacks_add (handle, callback); */ /* FIXME, FIXME, FIXME: what about callback destruction? */ #if VFS_CHECK_VERSION (2, 6, 0) ## void gnome_vfs_async_seek (GnomeVFSAsyncHandle *handle, GnomeVFSSeekPosition whence, GnomeVFSFileOffset offset, GnomeVFSAsyncSeekCallback callback, gpointer callback_data) void gnome_vfs_async_seek (handle, whence, offset, func, data=NULL) GnomeVFSAsyncHandle *handle GnomeVFSSeekPosition whence GnomeVFSFileOffset offset SV *func SV *data PREINIT: GPerlCallback *callback; CODE: callback = vfs2perl_async_callback_create (func, data); gnome_vfs_async_seek (handle, whence, offset, (GnomeVFSAsyncSeekCallback) vfs2perl_async_callback, callback); /* vfs2perl_async_callbacks_add (handle, callback); */ /* FIXME, FIXME, FIXME: what about callback destruction? */ #endif /* 2.6 */ Gnome2-VFS-1.082/maps-2.80000644000175000017500000000042612222506645013113 0ustar lacklackGNOME_VFS_TYPE_VFS_DNS_SD_SERVICE_STATUS GnomeVFSDNSSDServiceStatus GEnum Gnome2::VFS::DNSSD::ServiceStatus GNOME_VFS_TYPE_VFS_MIME_EQUIVALENCE GnomeVFSMimeEquivalence GEnum Gnome2::VFS::MimeEquivalence GNOME_VFS_TYPE_ADDRESS GnomeVFSAddress GBoxed Gnome2::VFS::Address Gnome2-VFS-1.082/vfs.typemap0000644000175000017500000000133412222506645014121 0ustar lacklackTYPEMAP GnomeVFSFileSize T_GPERL_GENERIC_WRAPPER GnomeVFSFileOffset T_GPERL_GENERIC_WRAPPER GnomeVFSHandle * T_GPERL_GENERIC_WRAPPER GnomeVFSMonitorHandle * T_GPERL_GENERIC_WRAPPER GnomeVFSDirectoryHandle * T_GPERL_GENERIC_WRAPPER GnomeVFSAsyncHandle * T_GPERL_GENERIC_WRAPPER GnomeVFSDNSSDBrowseHandle * T_GPERL_GENERIC_WRAPPER GnomeVFSDNSSDResolveHandle * T_GPERL_GENERIC_WRAPPER GnomeVFSResolveHandle * T_GPERL_GENERIC_WRAPPER GnomeVFSFileInfo * T_GPERL_GENERIC_WRAPPER const GnomeVFSFileInfo * T_GPERL_GENERIC_WRAPPER GnomeVFSApplication * T_GPERL_GENERIC_WRAPPER GnomeVFSMimeType * T_GPERL_GENERIC_WRAPPER GnomeVFSMimeApplication * T_GPERL_GENERIC_WRAPPER const GnomeVFSMimeApplication * T_GPERL_GENERIC_WRAPPER Gnome2-VFS-1.082/VFS.pm0000644000175000017500000001216412222506645012721 0ustar lacklack# $Id$ package Gnome2::VFS; use 5.008; use strict; use warnings; use Glib; require Exporter; require DynaLoader; our @ISA = qw(Exporter DynaLoader); our @EXPORT_OK = qw( GNOME_VFS_PRIORITY_MIN GNOME_VFS_PRIORITY_MAX GNOME_VFS_PRIORITY_DEFAULT GNOME_VFS_SIZE_FORMAT_STR GNOME_VFS_OFFSET_FORMAT_STR GNOME_VFS_MIME_TYPE_UNKNOWN GNOME_VFS_URI_MAGIC_STR GNOME_VFS_URI_PATH_STR ); # --------------------------------------------------------------------------- # our $VERSION = '1.082'; sub import { my ($self) = @_; my @symbols = (); foreach (@_) { if (/^-?init$/) { $self -> init(); } else { push @symbols, $_; } } Gnome2::VFS -> export_to_level(1, @symbols); } sub dl_load_flags { $^O eq 'darwin' ? 0x00 : 0x01 } Gnome2::VFS -> bootstrap($VERSION); # --------------------------------------------------------------------------- # use constant GNOME_VFS_PRIORITY_MIN => -10; use constant GNOME_VFS_PRIORITY_MAX => 10; use constant GNOME_VFS_PRIORITY_DEFAULT => 0; use constant GNOME_VFS_SIZE_FORMAT_STR => "Lu"; use constant GNOME_VFS_OFFSET_FORMAT_STR => "Ld"; use constant GNOME_VFS_MIME_TYPE_UNKNOWN => "application/octet-stream"; use constant GNOME_VFS_URI_MAGIC_STR => "#"; use constant GNOME_VFS_URI_PATH_STR => "/"; 1; # --------------------------------------------------------------------------- # __END__ =head1 NAME Gnome2::VFS - Perl interface to the 2.x series of the GNOME VFS library =head1 SYNOPSIS use Gnome2::VFS; sub die_already { my ($action) = @_; die("An error occured while $action.\n"); } die_already("initializing GNOME VFS") unless (Gnome2::VFS -> init()); my $source = "http://www.perldoc.com/about.html"; my ($result, $handle, $info); # Open a connection to Perldoc. ($result, $handle) = Gnome2::VFS -> open($source, "read"); die_already("opening connection to '$source'") unless ($result eq "ok"); # Get the file information. ($result, $info) = $handle -> get_file_info("default"); die_already("retrieving information about '$source'") unless ($result eq "ok"); # Read the content. my $bytes = $info -> { size }; my $bytes_read = 0; my $buffer = ""; do { my ($tmp_buffer, $tmp_bytes_read); ($result, $tmp_bytes_read, $tmp_buffer) = $handle -> read($bytes - $bytes_read); $buffer .= $tmp_buffer; $bytes_read += $tmp_bytes_read; } while ($result eq "ok" and $bytes_read < $bytes); die_already("reading $bytes bytes from '$source'") unless ($result eq "ok" && $bytes_read == $bytes); # Close the connection. $result = $handle -> close(); die_already("closing connection to '$source'") unless ($result eq "ok"); # Create and open the target. my $target = "/tmp/" . $info -> { name }; my $uri = Gnome2::VFS::URI -> new($target); ($result, $handle) = $uri -> create("write", 1, 0644); die_already("creating '$target'") unless ($result eq "ok"); # Write to it. my $bytes_written; ($result, $bytes_written) = $handle -> write($buffer, $bytes); die_already("writing $bytes bytes to '$target'") unless ($result eq "ok" && $bytes_written == $bytes); # Close the target. $result = $handle -> close(); die_already("closing '$target'") unless ($result eq "ok"); Gnome2::VFS -> shutdown(); =head1 ABSTRACT This module allows you to interface with the GNOME Virtual File System library. It provides the means to transparently access files on all kinds of filesystems. =head1 DESCRIPTION Since this module tries to stick very closely to the C API, the documentation found at L is the canonical reference. In addition to that, there's also the automatically generated API documentation: L. The mapping described in L also applies to this module. To discuss this module, ask questions and flame/praise the authors, join gtk-perl-list@gnome.org at lists.gnome.org. =head1 KNOWN BUGS There are some memory leaks especially with respect to callbacks. This mainly affects GnomeVFSAsync as well as some parts of GnomeVFSXfer and GnomeVFSOps. GnomeVFSMime leaks some list data. GnomeVFSAsync is also known to crash under certain conditions when there are many concurrent transfers. =head1 SEE ALSO L, L, L, L. =head1 AUTHOR Torsten Schoenfeld Ekaffeetisch@web.deE. =head1 COPYRIGHT AND LICENSE Copyright (C) 2003-2007 by the gtk2-perl team (see the file AUTHORS) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA =cut Gnome2-VFS-1.082/NEWS0000644000175000017500000001421612222506645012424 0ustar lacklackOverview of changes in Gnome2-VFS 1.082 ======================================= * Avoid misusing the macro PL_na, thus preventing issues when Gnome2::VFS is used in conjunction with certain XS modules, among them XML::Parser and String::Approx. Overview of changes in Gnome2-VFS 1.081 ======================================= * Fix the GnomeVFSMimeApplication handling on libgnomevfs >= 2.10. Overview of changes in Gnome2-VFS 1.080 ======================================= Since 1.06x (the previous stable series) ---------------------------------------- * Add Gnome2::VFS::URI::resolve_symbolic_link and Gnome2::VFS::Drive::needs_eject. Since 1.070 ----------- * Nothing. Overview of changes in Gnome2-VFS 1.070 ======================================= * Add Gnome2::VFS::URI::resolve_symbolic_link. * Add Gnome2::VFS::Drive::needs_eject. Overview of changes in Gnome2-VFS 1.061 ======================================= * Fix a test failure. * Fix a POD error that caused the main documentation in the Gnome2::VFS POD page to be shadowed. Overview of changes in Gnome2-VFS 1.060 ======================================= Since 1.04x (the previous stable series) ---------------------------------------- * Add Gnome2::VFS::Address::equal, Gnome2::VFS::Address::match and Gnome2::VFS::get_slow_mime_type. * Add Gnome2::VFS::get_mime_type_for_name and Gnome2::VFS::get_mime_type_for_name_and_data. Since 1.031 ----------- * Make the Gnome2::VFS::Xfer test more robust. Overview of changes in Gnome2-VFS 1.051 ======================================= * Add Gnome2::VFS::get_mime_type_for_name and Gnome2::VFS::get_mime_type_for_name_and_data. Overview of changes in Gnome2-VFS 1.050 ======================================= * Fix a test suite issue. * Add Gnome2::VFS::Address::equal, Gnome2::VFS::Address::match and Gnome2::VFS::get_slow_mime_type. Overview of changes in Gnome2-VFS 1.041 ======================================= * Get rid of the Gtk2 dependency. Overview of changes in Gnome2-VFS 1.040 ======================================= Since 1.02x (the previous stable series) ---------------------------------------- * Export some constants on demand. * Add new API in Gnome2::VFS::Mime::Type, Gnome2::VFS::Mime::Application, Gnome2::VFS::Handle and Gnome2::VFS. * Fix Gnome2::VFS::make_uri_from_input_with_trailing_ws by adding the missing class parameter. Since 1.031 ----------- * Fix a test suite issue. Overview of changes in Gnome2-VFS 1.031 ======================================= * Add an example demonstrating Gnome2::VFS::Monitor. * Fix minor test suite issues. * Fix Gnome2::VFS::make_uri_from_input_with_trailing_ws by adding the missing class parameter. Overview of changes in Gnome2-VFS 1.030 ======================================= * Export the following constants on demand GNOME_VFS_PRIORITY_MIN, GNOME_VFS_PRIORITY_MAX, GNOME_VFS_PRIORITY_DEFAULT, GNOME_VFS_SIZE_FORMAT_STR, GNOME_VFS_OFFSET_FORMAT_STR, GNOME_VFS_MIME_TYPE_UNKNOWN, GNOME_VFS_URI_MAGIC_STR, and GNOME_VFS_URI_PATH_STR. * Add Gnome2::VFS::Mime::Type::get_default_application_for_uri, Gnome2::VFS::Mime::Type::get_all_applications_for_uri, Gnome2::VFS::Mime::Application::new_from_desktop_id, Gnome2::VFS::Mime::Application::get_desktop_id, Gnome2::VFS::Mime::Application::get_desktop_file_path, Gnome2::VFS::Mime::Application::get_name, Gnome2::VFS::Mime::Application::get_generic_name, Gnome2::VFS::Mime::Application::get_icon, Gnome2::VFS::Mime::Application::get_exec, Gnome2::VFS::Mime::Application::get_binary_name, Gnome2::VFS::Mime::Application::supports_uris, Gnome2::VFS::Mime::Application::requires_terminal, Gnome2::VFS::Mime::Application::supports_startup_notification and Gnome2::VFS::Mime::Application::get_startup_wm_class, Gnome2::VFS::Handle::forget_cache and Gnome2::VFS::make_uri_from_input_with_trailing_ws. Overview of changes in Gnome2-VFS 1.022 ======================================= * Add a monitor example. [Christian Borup] * Fix a testsuite issue. Overview of changes in Gnome2-VFS 1.021 ======================================= * Use simple opaque scalars instead of boxed types for several objects. * Some internal reorganization. * Documentation fixes. Overview of changes in Gnome2-VFS 1.020 ======================================= Since 1.00x (the previous stable series) ---------------------------------------- * New objects: Gnome2::VFS::Address, Gnome2::VFS::DNSSD, Gnome2::VFS::Drive, Gnome2::VFS::Resolve, Gnome2::VFS::Volume, and Gnome2::VFS::VolumeMonitor. * New API in: Gnome2::VFS::Mime, Gnome2::VFS::Async, and Gnome2::VFS::FileInfo. * Plug a few leaks. Since 1.011 ----------- * "Fix" a test failure. Overview of changes in Gnome2-VFS 1.011 ======================================= * Don't leak the GnomeVFSDrive and GnomeVFSVolume callbacks. Overview of changes in Gnome2-VFS 1.010 ======================================= * Depend on Glib 1.053. * Wrapped GnomeVFSAddress, GnomeVFSDNSSD, GnomeVFSDrive, GnomeVFSResolve, GnomeVFSVolume, and GnomeVFSVolumeMonitor. * Wrapped new stuff in GnomeVFSMime and GnomeVFSAsync. * Implemented a constructor for GnomeVFSFileInfo. Overview of changes in Gnome2-VFS 1.003 ======================================= * Make Gnome2::VFS::read_entire_file not crash on invalid input. * Fix a small test bug. * Don't depend on Gtk2 at runtime. Overview of changes in Gnome2-VFS 1.002 ======================================= * Hushed compiler warnings that might occur under certain circumstances. Overview of changes in Gnome2-VFS 1.001 ======================================= * Made all version checks refer to stable releases. * Made the test suite more robust. Overview of changes in Gnome2-VFS 1.00 ====================================== * Depend on Glib 1.040. Overview of changes in Gnome2-VFS 0.99 ====================================== * Made some tests a bit more tolerant. Overview of changes in Gnome2-VFS 0.98 ====================================== * Fixed version information implementation to stick to the new policy. * Fixed a bug in Gnome2::VFS::read that would result in a segfault when called with a bytes argument that is not greater than 0. Gnome2-VFS-1.082/ChangeLog.pre-git0000644000175000017500000007125512222506645015053 0ustar lacklack=== ChangeLog discontinued === With the move to git, we stop maintaining a separate ChangeLog and rely on proper commit messages instead. Web view of changes: . 2008-02-24 Torsten Schoenfeld * NEWS * VFS.pm: Stable release 1.081. 2008-02-24 Torsten Schoenfeld * vfs2perl.c * xs/GnomeVFSMime.xs: Changes in libgnomevfs 2.10 broke our GnomeVFSMimeApplication handling. Fix it. 2007-09-16 kaffeetisch * VFS.pm * NEWS: Stable release 1.080. 2007-07-08 kaffeetisch * MANIFEST.SKIP * NEWS * VFS.pm * copyright.pod: Unstable release 1.070. 2007-07-08 kaffeetisch * t/GnomeVFSURI.t * xs/GnomeVFSURI.xs: Wrap gnome_vfs_uri_resolve_symbolic_link. * t/GnomeVFSDrive * xs/GnomeVFSDrive.xs: Wrap gnome_vfs_drive_needs_eject. * xs/GnomeVFSMime.xs: Correct a comment and a version check. 2006-11-25 kaffeetisch * NEWS, VFS.pm: Stable release 1.061. 2006-10-03 kaffeetisch * xs/GnomeVFSMime.xs, xs/GnomeVFSResolve.xs, xs/GnomeVFSVolume.xs: Don't overwrite the Gnome2::VFS man page with spurious POD. 2006-09-01 kaffeetisch * t/GnomeVFSDirectory.t: Fix a test failure. (#351698) 2006/03/12 kaffeetisch * Makefile.PL, NEWS, README, VFS.pm: Stable release 1.060. 2006/03/12 kaffeetisch * t/GnomeVFSXfer.t: Make this test not depend on the exact number of times the progress callback is invoked. 2006/01/30 kaffeetisch * Makefile.PL, NEWS, VFS.pm: Unstable release 1.051. 2006/01/30 kaffeetisch * t/GnomeVFSMime, xs/GnomeVFSMime.xs: Wrap gnome_vfs_get_mime_type_for_name and gnome_vfs_get_mime_type_for_name_and_data. 2005/12/13 rwmcfa1 * t/GoneVFSAddress.t: skip equal and match tests unless version is > 2.13.1 2005/12/12 kaffeetisch * NEWS, VFS.pm: Unstable release 1.050. 2005/12/12 kaffeetisch * t/GnomeVFSAddress.t, xs/GnomeVFSAddress.xs: Wrap gnome_vfs_address_equal and gnome_vfs_address_match. * t/GnomeVFSMime, xs/GnomeVFSMime.xs: Wrap gnome_vfs_get_slow_mime_type. 2005/10/08 kaffeetisch * t/GnomeVFSFileInfo.t: Use is_deeply() or the >= operator on flags values. 2005/09/28 kaffeetisch * t/GnomeVFSOps.t, t/GnomeVFSUtils.t, xs/GnomeVFSOps.xs, xs/GnomeVFSUtils.xs: Make all version checks refer to stable releases. 2005/09/17 rwmcfa1 * perl-Gnome2-VFS.spec.in: remove Gtk2 build and run-time deps. 2005/09/17 kaffeetisch * Makefile.PL: Get rid of the Gtk2 dependency by using Glib::CodeGen instead of Gtk2::CodeGen. * NEWS, README, VFS.pm: Stable release 1.041. 2005/09/05 kaffeetisch * MANIFEST, META.yml: Remove META.yml. * NEWS, VFS.pm: Stable release 1.040. 2005/06/22 kaffeetisch * t/GnomeVFSFileInfo.t: Use is() instead of is_deeply() to test flags values since the latter was changed to always use the string version of overloaded objects in recent versions of Test::More, whereas the former seems to work correctly. Tested with Test::More 0.45 and 0.60. 2005/06/06 kaffeetisch * MANIFEST, genmaps.pl: Retire genmaps.pl. * MANIFEST, META.yml, NEWS, VFS.pm: Unstable release 1.031. 2005/05/29 kaffeetisch * Makefile.PL: Specify PREREQ_PM in the WriteMakefile call so META.yml gets generated correctly. * t/GnomeVFSOps.t: Fix the forget_cache test. Add a truncate test. * t/GnomeVFSXfer.t: This seems to work again, so get rid of the skip_all. * xs/GnomeVFSUtils.xs: Fix gnome_vfs_make_uri_from_input_with_trailing_ws by adding the class argument. 2005/05/08 borup * Added examples/monitor.pl: simple example of a monitor. 2005/04/25 kaffeetisch * META.yml, NEWS, VFS.pm: Unstable release 1.030. 2005/04/25 kaffeetisch * t/GnomeVFSFileInfo.t: The Test::More bug has been fixed, remove the TODO block. * t/GnomeVFSXfer.t: Completely skip this test for now since it's failing. * t/GnomeVFSOps.t, xs/GnomeVFSOps.xs: Bind and test gnome_vfs_forget_cache. * t/GnomeVFSUtils.t, xs/GnomeVFSUtils.xs: Bind and test gnome_vfs_make_uri_from_input_with_trailing_ws. 2005/04/17 kaffeetisch * META.yml, NEWS, VFS.pm: Merge from stable-1-02. 2005/03/21 kaffeetisch * VFS.pm, t/GnomeVFS.t: Export the following constants on demand (@EXPORT_OK): GNOME_VFS_PRIORITY_MIN, GNOME_VFS_PRIORITY_MAX, GNOME_VFS_PRIORITY_DEFAULT, GNOME_VFS_SIZE_FORMAT_STR, GNOME_VFS_OFFSET_FORMAT_STR, GNOME_VFS_MIME_TYPE_UNKNOWN, GNOME_VFS_URI_MAGIC_STR, and GNOME_VFS_URI_PATH_STR. * xs/GnomeVFSMime.xs, t/GnomeVFSMime: Bind gnome_vfs_mime_get_default_application_for_uri, gnome_vfs_mime_get_all_applications_for_uri, gnome_vfs_mime_application_new_from_desktop_id, gnome_vfs_mime_application_get_desktop_id, gnome_vfs_mime_application_get_desktop_file_path, gnome_vfs_mime_application_get_name, gnome_vfs_mime_application_get_generic_name, gnome_vfs_mime_application_get_icon, gnome_vfs_mime_application_get_exec, gnome_vfs_mime_application_get_binary_name, gnome_vfs_mime_application_supports_uris, gnome_vfs_mime_application_requires_terminal, gnome_vfs_mime_application_supports_startup_notification, and gnome_vfs_mime_application_get_startup_wm_class. 2005/03/16 kaffeetisch * xs/GnomeVFSResolve.xs: Add a DESTROY xsub that frees the handle. 2005/03/08 kaffeetisch * doctypes, maps-2.0, maps-2.6, maps-2.8, vfs.typemap, vfs2perl.c, vfs2perl.h, xs/GnomeVFSAsync.xs: Get rid of the custom boxed types for the various handles and use simple opaque scalars instead. * vfs2perl.c, xs/GnomeVFS.xs, xs/GnomeVFSApplicationRegistry.xs, xs/GnomeVFSFileInfo.xs, xs/GnomeVFSMime.xs, xs/GnomeVFSXfer.xs: Move type converters to a central place. * xs/GnomeVFSUtils.xs, xs/GnomeVFSXfer.xs: Make internal functions static. 2005/03/07 kaffeetisch * Makefile.PL, META.yml, NEWS, README, VFS.pm: Stable release 1.020. 2005/03/07 kaffeetisch * vfs2perl.c, vfs2per.h, t/GnomeVFSAddress.t, t/GnomeVFSDNSSD, t/GnomeVFSDrive, t/GnomeVFSMime, t/GnomeVFSResolve.t, t/GnomeVFSURI.t, t/GnomeVFSVolume, xs/GnomeVFSDrive.xs, xs/GnomeVFSMime.xs, xs/GnomeVFSVolume.xs: Use stable releases in all version checks. * t/GnomeVFSFileInfo.t: Mark failing test as TODO. 2005/02/10 22:18 (+0100) kaffeetisch * VFS.pm: Do it like all the other cool kids and alter dl_load_flags() to avoid warnings on Darwin. * xs/GnomeVFSAsync.xs, xs/GnomeVFSFileInfo.xs: Whitespace fixes. * xs/GnomeVFSVolumeMonitor.xs: Add version guards around the custom DESTROY so it's only included if gnome-vfs is older than 2.8.1. 2004/10/24 11:55 (-0400) rwmcfa1 * MANIFEST.SKIP: updates * perl-Gnome2-VFS.spec.in: new scheme that addresses x86_64 problems found by Carl Nygard 2004/09/25 21:14 (+0200) kaffeetisch * doctypes: Add types for GnomeVFSApplication and GnomeVFSMimeType. 2004/09/15 12:31 (+0200) kaffeetisch * xs/GnomeVFSVolumeMonitor.xs: Add a FIXME comment with a reference to the relevant bug to the DESTROY workaround. 2004/08/16 00:03 (+0200) kaffeetisch * Makefile.PL, NEWS, README, VFS.pm: Version 1.011. 2004/08/15 23:01 (+0200) kaffeetisch * t/GnomeVFSAsync: Don't use seek if it's not available. 2004/08/15 03:01 (+0200) kaffeetisch * t/GnomeVFSAsync: Completely rewrite this to actually work and make sense. * xs/GnomeVFSDrive.xs, xs/GnomeVFSVolume.xs: Free callback directly after it was invoked. * xs/GnomeVFSVolumeMonitor.xs: Keep a ref on the monitor and never release it to avoid segfaults that occur when a monitor is freed after gnome-vfs has already been shut down. 2004/08/08 15:38 (+0200) kaffeetisch * NEWS, README, VFS.pm: Version 1.010. 2004/08/08 15:15 (+0200) kaffeetisch * Makefile.PL: Depend on Glib 1.053. * maps-2.8, t/GnomeVFSMime, xs/GnomeVFS.xs, xs/GnomeVFSMime.xs: Bind and test Gnome2::VFS::Mime::Type::get_all_desktop_entries, ::get_default_desktop_entry, ::is_equal, and Gnome2::VFS::get_mime_type_for_data. 2004/07/29 19:12 (+0200) kaffeetisch * MANIFEST, vfs2perl.c, vfs2perl.h, t/GnomeVFSAddress.t, t/GnomeVFSDNSSD, t/GnomeVFSDrive, t/GnomeVFSResolve.t, t/GnomeVFSVolume, t/GnomeVFSVolumeMonitor, xs/GnomeVFSAddress.xs, xs/GnomeVFSDNSSD.xs, xs/GnomeVFSDrive.xs, xs/GnomeVFSResolve.xs, xs/GnomeVFSVolume.xs, xs/GnomeVFSVolumeMonitor.xs: Bind and test GnomeVFSAddress, GnomeVFSDNSSD, GnomeVFSDrive, GnomeVFSResolve, GnomeVFSVolume, and GnomeVFSVolumeMonitor. Nifty stuff! * maps, maps-2.0, maps-2.6, maps-2.8, xs_files-2.0, xs_files-2.6, xs_files-2.8, Makefile.PL: Implement loading of xs_files and maps files based on the version of gnome-vfs. Require Glib 1.052. (1.053 actually, but it has not been released yet.) * NEWS, VFS.pm: Merge changes from the stable-1-00 branch. * t/GnomeVFS.t: Test Gnome2::VFS::result_to_string. * t/GnomeVFSApplicationRegistry: Test a bit more stuff, and then just reload the database to avoid permanent changes. * t/GnomeVFSURI.t: Enable the resolve_relative test on 64 bit platforms if gnome-vfs is recent enough. * vfs.typemap, xs/GnomeVFS.xs: Use IVs to represent GnomeVFSFileOffset instead of UVs -- offsets are signed. Also switch to T_UV and T_IV instead of the generic typemap for GnomeVFSFileSize and GnomeVFSFileOffset respectively for performance reasons. * t/GnomeVFSAsync.t, xs/GnomeVFSAsync.xs: Use the same helpers for the open and for set_file_info callback. Bind and test gnome_vfs_async_set_file_info and gnome_vfs_async_seek. * t/GnomeVFSFileInfo.t, xs/GnomeVFSFileInfo.xs: Provide and test a constructor for GnomeVFSFileInfo structures. * t/GnomeVFSOps.t, xs/GnomeVFSOps.xs: Bind and test gnome_vfs_set_file_info and gnome_vfs_set_file_info_uri. * xs/GnomeVFSUtils.xs: Use the new char_own typemap to get rid of all those CLEANUP sections. 2004/06/28 19:55 (+0200) kaffeetisch Merge from the stable-1-00 branch. * Makefile.PL: Add guards around our custom GType definitions to avoid compiler warnings that occur when Gnome2::VFS is not recompiled after libgnomevfs was updated. * t/GnomeVFSDirectory.t: Fix a test bug found by david d zuhn. * t/GnomeVFSUtils.t * xs/GnomeVFSUtils.xs: Patch by muppet fixes a crash found by Gavin. * vfs2perl.h * Makefile.PL: Don't depend on Gtk2, since we actually don't need to. Instead, just include Glib's header, and add "-I build" to the cflags. 2004/03/29 17:15 (+0100) kaffeetisch Merge from the stable-1-00 branch. * NEWS * VFS.pm: Version 1.001. 2004/03/27 18:44 (+0100) kaffeetisch Merge from the stable-1-00 branch. * t/GnomeVFSURI.t: Skip the resolve_relative test on 64bit platforms since it causes segfaults. (Found by Marc Brockschmidt) * t/GnomeVFSURI.t * t/GnomeVFSUtils.t: Check for stable versions only. * GnomeVFSURI.xs (gnome_vfs_uri_resolve_relative): Remove needless CODE and OUTPUT sections. 2004/03/27 17:24 (+0100) kaffeetisch Merge from the stable-1-00 branch. * t/GnomeVFSAsync * t/GnomeVFSDirectory.t * t/GnomeVFSFileInfo.t * t/GnomeVFSMime * t/GnomeVFSOps.t * t/GnomeVFSURI.t * t/GnomeVFSUtils.t * t/GnomeVFSXfer.t Skip all tests if there is no ~/.gnome directory. (Reported by Marc Brockschmidt) * xs/GnomeVFSMime.xs * xs/GnomeVFSUtils.xs: Make all version checks refer to stable versions. 2004/03/24 17:04 (+0100) kaffeetisch * Makefile.PL * README: Depend on Glib 1.040. * NEWS * VFS.pm: Version 1.00. 2004/03/19 00:12 (+0100) kaffeetisch * NEWS * VFS.pm: Version 0.99. 2004/03/14 21:25 (+0100) kaffeetisch * t/GnomeVFSUtils.t: Don't be so strict with make_uri_from_input_with_dirs and expand_initial_tilde: test only if they return something defined. 2004/03/11 15:49 (+0100) kaffeetisch A NEWS * MANIFEST * VFS.pm: Version 0.98. 2004/03/09 22:49 (+0100) kaffeetisch * xs/GnomeVFSOps.xs (gnome_vfs_read): Croak if `bytes' is not greater than 0 in order to prevent segfaults. (Reported by James Curbo) 2004/03/03 20:28 (+0100) kaffeetisch * t/GnomeVFSURI.t * t/GnomeVFSUtils.t * xs/GnomeVFS.xs: Adapt to the new version information implementation policy. 2004/03/01 01:08 (+0100) kaffeetisch * VFS.pm: Version 0.96. 2004/02/14 15:41 (+0100) kaffeetisch * Makefile.PL: Actually specify which versions of EU::Depends and PkgConfig we need in the eval test. 2004/02/12 20:11 (+0100) kaffeetisch * Makefile.PL * README * VFS.pm: Use correct version numbers for the dependencies. Version 0.94. 2004/02/11 20:43 (+0100) kaffeetisch * Makefile.PL * README * VFS.pm: Version 0.92. 2004/02/10 17:06 (+0100) kaffeetisch Applying a patch from muppet. A copyright.pod A doctypes * MANIFEST * Makefile.PL * gnome2perl.h: Use the new features of ExtUtils::Depends and ExtUtils::PkgConfig. * VFS.pm: Add the whole license statement to the documentation. * downloader.pl: Use new Gtk2::CellRenderer derivation API. 2004/01/30 00:53 (+0100) kaffeetisch * README * VFS.pm: Documentation updates. Version 0.90. 2004/01/29 17:00 (+0100) kaffeetisch * t/GnomeVFSOps.t: Only check if the mime type is defined. * xs/GnomeVFS.xs: Add a FIXME comment. 2004/01/24 21:44 (-0500) rwmcfa1 * Makefile.PL: removed runtime_reqs stuff, replaced by the pkg-config trick * perl-Gnome2-VFS.spec.in: use pkg-config for Requires version 2004/01/02 15:09 (-0500) rwmcfa1 * Makefile.PL: rpm stuff added * perl-Gnome2-VFS.spec.in: initial import 2003/12/31 02:21 (-0500) muppetman * GnomeVFSAsync.xs: include gnome-vfs-job-limit.h to quell undeclared function warnings. 2003/12/29 16:32 (-0500) rwmcfa1 * Makefile.PL: added a build dep version for Gtk2 2003/12/22 23:55 (-0500) muppetman * xs/GnomeVFS.xs: use braces to disambiguate the ifelse, and thereby shut up the compiler about it. * xs/GnomeVFSMime.xs: remove unused variable. * xs/GnomeVFSUtils.xs: not sure why that "warn;" was there. 2003/12/23 01:30 (+0100) kaffeetisch * Makefile.PL: Don't call do_pod_files twice. 2003/12/22 01:19 (+0100) kaffeetisch * META.yml * VFS.pm: Version 0.10. 2003/12/21 15:17 (+0100) kaffeetisch * VFS.pm: Add a KNOWN BUGS section. 2003/12/20 14:34 (+0100) kaffeetisch * xs/GnomeVFSAsync.xs: Add a commented out attempt to handle callback destruction. Comment out the thread locks as they caused the async stuff to not work anymore. 2003/12/19 18:20 (+0100) kaffeetisch * Makefile.PL: Make the GType version check more robust. * vfs2perl.h * xs/GnomeVFS.xs: Move SvEnvArray from Gnome2 here. * t/GnomeVFSMime * xs/GnomeVFSMime.xs: Many leakage related minor changes and some commentary. API doc. 2003/12/18 20:42 (-0500) muppetman * xs/GnomeVFS.xs: hush unused var warning in get_version_info. * xs/GnomeVFSAsync.xs: looks like a couple of s/VFS2PERL_GNOME_TYPE/GNOME_VFS_TYPE/ slipped through the cracks. * xs/GnomeVFSDirectory.xs, xs/GnomeVFSOps.xs: if using PPCODE, the return type should be void. this hushes some 'unused var RETVAL' warnings. * xs/GnomeVFSUtils.xs: disambiguating braces hush compiler warnings. 2003/12/18 22:23 (+0100) kaffeetisch * VFS.pm: Mention Gnome2::VFS::index. * Makefile.PL * maps * vfs2perl.h * xs/GnomeVFSXfer.xs: Since gnome-vfs 2.5.3 now ships with own GTypes, we use those instead of the home-grown ones if they are available. For that to work, GNOME_VFS_TYPE_VFS_ is now used as the prefix for all GTypes so that we can easily switch between our and gnome-vfs' implementation. 2003/12/12 23:29 (+0100) kaffeetisch A README * MANIFEST: Add a README. * VFS.pm: Remove license boilerplate. * vfs2perl.h: Add a SvGnomeVFSMimeApplication prototype to silence compiler warnings. * t/GnomeVFSApplicationRegistry * t/GnomeVFSAsync * t/GnomeVFSDirectory.t * t/GnomeVFSFileInfo.t * t/GnomeVFSOps.t * t/GnomeVFSURI.t * t/GnomeVFSUtils.t * t/GnomeVFSXfer.t: Use the -init parameter instead of calling the init method manually. * xs/GnomeVFSApplicationRegistry.xs * xs/GnomeVFSOps.xs: Add API doc. 2003/12/04 19:31 (+0100) kaffeetisch * t/GnomeVFSUtils.t * xs/GnomeVFSUtils.xs: Implement Gnome2::VFS::url_show_with_env. 2003/12/02 22:14 (-0500) muppetman * t/GnomeVFSUtils.t: updated the skip count 2003/12/01 23:42 (+0100) kaffeetisch * t/GnomeVFSMime: Remove a blank. * xs/GnomeVFSMime.xs: Enable some currently leaking methods. * xs/GnomeVFSOps.xs: Update comments. * t/GnomeVFSUtils.t * xs/GnomeVFSUtils.xs: Implement and test Gnome2::VFS::read_entire_file. 2003/11/30 16:41 (+0100) kaffeetisch * xs/GnomeVFSMime.xs: In SvGnomeVFSMimeApplication, check if a pointer is non-NULL before dereferencing it. * vfs.typemap * xs/GnomeVFSApplicationRegistry.xs * t/GnomeVFSApplicationRegistry: Implement and test Gnome2::VFS::Application::get_mime_application, Gnome2::VFS::Mime::Application::is_user_owned and Gnome2::VFS::Mime::Application::save. 2003/11/30 15:22 (+0100) kaffeetisch A MANIFEST.SKIP * MANIFEST: Imported a skip file. 2003/11/29 18:03 (+0100) kaffeetisch * t/GnomeVFSUtils.t * xs/GnomeVFSUtils.xs: Alter the version checks: gnome_vfs_make_uri_from_input_with_dirs was introduced in 2.3.1. 2003/11/29 17:03 (+0100) kaffeetisch * vfs2perl.h: Include libgnomevfs/gnome-vfs-application-registry.h. 2003/11/29 14:15 (+0100) kaffeetisch R t/GnomeVFSMime.t A t/GnomeVFSMime * MANIFEST: Don't include the GnomeVFSMime test in the 'make test' run. I didn't know that the altered information actually gets stored. Sigh. * META.yml * VFS.pm: Bump version yet again, to 0.05 this time. 2003/11/29 04:29 (+0100) kaffeetisch * t/GnomeVFSMime.t: Skip certain tests if the MIME database doesn't work as expected. * xs/GnomeVFSMime.xs: Protect gnome_vfs_mime_application_launch with a version check. * META.yml * VFS.pm: Bump version to 0.03. 2003/11/28 21:59 (-0500) muppetman * xs/GnomeVFSOps.xs: a couple of callback marshaller bugfixes 2003/11/28 22:31 (+0100) kaffeetisch * MANIFEST * META.yml: Prepare the release of 0.01. 2003/11/28 21:39 (+0100) kaffeetisch * maps * genmaps.pl: Map GnomeVFSURIHideOptions to Gnome2::VFS::URI::HideOptions instead of Gnome2::VFS::URIHideOptions. R xs/GnomeVFSMimeHandlers.xs A xs/GnomeVFSMime.xs R t/GnomeVFSMimeHandlers.t A t/GnomeVFSMime.t * vfs2perl.h * maps * genmaps.pl: GnomeVFSMimeHandlers.(xs|t) => GnomeVFSMime.$1. Implement and test support for GnomeVFSMIMEMonitor. * xs/GnomeVFS.xs: Implement Gnome2::VFS::get_mime_type. * xs/GnomeVFSDirectory.xs * xs/GnomeVFSOps.xs * xs/GnomeVFSXfer.xs: Follow muppet's advise: Don't use ALIAS sections to "rename" functions but do it the manly way instead. We now don't have two xsubs for those functions anymore but we also lose a bit of C API compatability. Considering the very high stinkage factor of that API, that's not necessarily a bad thing though. 2003/11/27 22:55 (+0100) kaffeetisch A t/GnomeVFSMimeHandlers.t A xs/GnomeVFSMimeHandlers.xs * vfs.typemap * vfs2perl.h: Initial implementation of GnomeVFSMimeHandlers. It still has a few unbound functions, most of which need Bonobo typemaps. 2003/11/26 12:33 (-0500) muppetman * vfs2perl.h * xs/GnomeVFSFileInfo.xs: repair bits of the patch that got out of sync. works properly on gnome 2.0 now. 2003/11/25 23:04 (+0100) kaffeetisch * vfs2perl.h * xs/GnomeVFSFileInfo.xs: Apply muppet's patch to work around the fact that some older versions of gnome-vfs shipped with a definition of GnomeVFSFilePermissions that glib-mkenums doesn't recognize as a GFlags aspirant. 2003/11/25 00:15 (+0100) kaffeetisch R vfs2perl.typemap A vfs.typemap * MANIFEST * Makefile.PL: Rename vfs2perl.typemap to vfs.typemap to avoid that it gets overwritten by the one generated by Gtk2::CodeGen. * xs/GnomeVFSAsync.xs * xs/GnomeVFSDirectory.xs * xs/GnomeVFSOps.xs * xs/GnomeVFSXfer.xs: Don't declare variables in CODE or PPCODE sections, use PREINIT instead. 2003/11/23 21:52 (+0100) kaffeetisch * Makefile.PL: Use custom prefixes for all GEnums and GFlags so that there are no conflicts if/when gnome-vfs starts creating its own ones. (muppet) * examples/downloader.pl: Use mnemonics and provide better status messages. * t/GnomeVFSFileInfo.t: Don't test matches by fetching the info from the same file twice but by comparing one info to itself. The reason it was only working on my machine but not on others was that I had access time storage disabled. (Ross McFarland) * t/GnomeVFSUtils.t: Skip the make_uri_canonical test on versions older than 2.1.0. (muppet) * xs/GnomeVFS.xs: Remove FIXME comments. * xs/GnomeVFSFileInfo.xs: Use macros to avoid code duplication. * Makefile.PL * maps A vfs2perl.c * vfs2perl.h * vfs2perl.typemap * xs/GnomeVFSAsync.xs * xs/GnomeVFSDirectory.xs * xs/GnomeVFSOps.xs * xs/GnomeVFSURI.xs: Use standard GBoxed wrappers instead of the homebrew HV + magic thingies. There's less code duplication and better documentation now. A potentially negative side effect is that you can't store additional data inside the Perl objects anymore. The change necessitated the creation and registration of GTypes for those structs, too. (muppet, for suggesting this step) * xs/GnomeVFSAsync.xs * xs/GnomeVFSDirectory.xs * xs/GnomeVFSOps.xs * xs/GnomeVFSXfer.xs: Stick to the standard GPerlCallback marshalling wherever possible. 2003/11/18 23:36 (+0100) kaffeetisch * examples/downloader.pl: Handle a click on Download with nothing in the text entry gracefully. * Makefile.PL: Don't #define the GTypes in the .c, they're already in the .h. 2003/11/16 20:32 (-0500) muppetman * xs/GnomeVFSAsync.xs, xs/GnomeVFSDirectory.xs, xs/GnomeVFSOps.xs, xs/GnomeVFSXfer.xs: use the new GPerlCallback helper macros in gperl_marshal.h * examples/downloader.pl: start downloading when the user hits enter in the url entry 2003/11/16 02:44 (-0500) muppetman * xs/GnomeVFSDirectory.xs, xs/GnomeVFSXfer.xs: clean up the stack properly after call_sv to stop internal bleeding. 2003/11/15 12:16 (+0100) kaffeetisch * VFS.pm: Add a comma. * xs/GnomeVFS.xs * xs/GnomeVFSApplicationRegistry.xs * xs/GnomeVFSAsync.xs * xs/GnomeVFSDirectory.xs * xs/GnomeVFSOps.xs * xs/GnomeVFSURI.xs * xs/GnomeVFSUtil.xs: Add API documentation mainly for things that return lists. 2003/11/15 11:18 (+0100) kaffeetisch * Makefile.PL: Remove dependency checking for Gtk2. * VFS.pm: Don't 'use Gtk2;', 'use Glib;'. We don't depend on Gtk2. Add an import method that takes an '-init' parameter, in the style of Gtk2. * t/GnomeVFSAsync: Do 'use Gtk2 -init;' here since VFS.pm isn't doing it anymore. A examples/downloader.pl: Add an example that makes use of GnomeVFSAsync. Also has a cool progress bar cell renderer. 2003/11/14 19:09 (+0100) kaffeetisch * xs/GnomeVFSApplicationRegistry.xs * xs/GnomeVFSAsync.xs * xs/GnomeVFSDirectory.xs * xs/GnomeVFSURI.xs: Plug some memory leaks * xs/GnomeVFSAsync.xs * xs/GnomeVFSUtils.xs: Add the license boilerplate. * xs/GnomeVFS.xs * xs/GnomeVFSAsync.xs * xs/GnomeVFSDirectory.xs * xs/GnomeVFSXfer.xs: Centralize helper functions in GnomeVFS.xs. * vfs2perl.h * t/GnomeVFSAsync * xs/GnomeVFSAsync.xs: Implement and test gnome_vfs_async_find_directory. 2003/11/13 23:01 (+0100) kaffeetisch * vfs2perl.h * xs/GnomeVFSAsync.xs * xs/GnomeVFSDirectory.xs * xs/GnomeVFSXfer.xs: Rename some helper functions to better suit the naming convention. * t/GnomeVFSAsync * xs/GnomeVFSAsync.xs: Implement and test gnome_vfs_async_load_directory_uri - YAPITA, especially when trying to test it. 2003/11/13 17:47 (+0100) kaffeetisch * Makefile.PL: Install the manpage as Gnome2::VFS.3pm, not as VFS.3pm. * xs/GnomeVFS.xs: Use gperl_handle_logs_for. 2003/11/12 22:16 (+0100) kaffeetisch * xs/GnomeIconSelection.xs: Look at the two main members of the info struct when checking whether its valid. * t/GnomeVFSDirectory.t * t/GnomeVFSFileInfo.t * t/GnomeVFSOps.t * t/GnomeVFSUtils.t * t/GnomeVFSXfer.t: Use a temporary scratch pad inside of the package directory instead of /tmp. * t/GnomeVFSFileInfo.t: Skip the Gnome2::VFS::FileInfo -> matches() test on versions older than 2.4.1. A xs/GnomeVFSAsync.xs A t/GnomeVFSAsync * vfs2perl.h: Initial, partial and leaky implementation of GnomeVFSAsync. 2003/11/09 03:02 (+0100) kaffeetisch * Makefile.PL: Remove const_cccmd hack, MakeHelper does it for us. * VFS.pm: Fix bug in the SYNOPSIS. * t/GnomeVFSOps.t: Adapt to the recent changes in flags handling. * xs/GnomeVFSApplicationRegistry.xs: Put get_applications in the correct package. * xs/GnomeVFSOps.xs: Fix Gnome2::VFS::read and Gnome2::VFS::write to work correctly when dealing with binary data. * MANIFEST R t/GnomeVFSApplicationRegistry.t A t/GnomeVFSApplicationRegistry: Disable this test since it seems to be very fragile. 2003/11/07 20:48 (+0100) kaffeetisch * xs/GnomeVFSOps.xs * xs/GnomeVFSXfer.xs: Reorder ALIAS sections to indicate that the original function name shouldn't appear in the documentation. * xs/GnomeVFS.xs * xs/GnomeVFSInit.xs * xs/GnomeVFSOps.xs * xs/GnomeVFSUtils.xs: Add a =for directive to keep Gnome2::VFS.pm3 from being overwritten. * t/GnomeVFS.t * t/GnomeVFSApplicationRegistry.t * t/GnomeVFSOps.t * t/GnomeVFSURI.t: XXX -> FIXME. * Makefile.PL: Use Glib::MakeHelper and create POD documentation. 2003/11/04 09:34 (-0500) muppetman A .cvsignore, xs/.cvsignore: added 2003/11/01 13:24 (+0100) kaffeetisch * xs/GnomeVFSUtils.xs: Apply muppet's patch to make it compile on older versions of gnome-vfs. * xs/GnomeVFSOps.xs: Remove Gnome2::VFS::DESTROY. It wasn't necessary, there are no objects with that package name. * xs/GnomeVFSApplicationRegistry.xs: Move gnome_vfs_application_registry_sync, gnome_vfs_application_registry_shutdown and gnome_vfs_application_registry_reload to the correct package. * xs/GnomeVFS.xs: Implement Gnome2::VFS::check_version. * t/GnomeVFSUtils.t: Add tests for undocumented functions. Skip tests if the correspoinding function isn't available. * t/GnomeVFSApplicationRegistry: Add -> reload() at the beginning and -> shutdown() at the end. * Makefile.PL: Require version 1.01 of Glib for the new T_GPERL_GENERIC_WRAPPER typemap. * vfs2perl.typemap: Switch to T_GPERL_GENERIC_WRAPPER for all types. 2003/10/31 20:12 (+0100) kaffeetisch Memory leak hunting. * xs/GnomeVFSApplicationRegistry.xs * xs/GnomeVFSDirectory.xs * xs/GnomeVFSFileInfo.xs * xs/GnomeVFSOps.xs * xs/GnomeVFSURI.xs * xs/GnomeVFSXfer.xs: Use newRV_noinc instead of newRV_inc or newRV all over the place to plug some biiiig memory leaks. The extra reference count incrementation prevented the destruction handlers from being called at all. * xs/GnomeVFSOps.xs: Use gnome_vfs_file_info_unref instead of g_free to free GnomeVFSFileInfo's. * xs/GnomeVFSURI.xs: Use gnome_vfs_uri_unref on the URI upon destruction of the SV. * xs/GnomeVFSUtils.xs: Add a CLEANUP rule to virtually every function. * MANIFEST: Remove build/* which was accidentally added in the last commit. 2003/10/30 16:25 (+0100) kaffeetisch * vfs2perl.h * vfs2perl.typemap * xs/GnomeVFSOps.xs: Implement and use GnomeVFSFileOffset typemap. * xs/GnomeVFS.xs: Implement GnomeVFSFileSize and GnomeVFSFileOffset typemaps here. * t/GnomeVFSOps.t: Implement seek and truncate tests. A xs/GnomeVFSUtils.xs A t/GnomeVFSUtils.t * MANIFEST: Initial implementation of GnomeVFSUtils. 2003/10/28 23:17 (+0100) kaffeetisch * vfs2perl.h * xs/GnomeVFSOps.xs: Implement and use GnomeVFSFileSize typemap. * xs/GnomeVFSFileInfo.xs: Use ANSI style prototype for gnome_vfs_file_info_get_mime_type. * xs/GnomeVFS.xs: Implement gnome_vfs_result_to_string. * t/GnomeVFSOps.t: Disable the monitor tests. A xs/GnomeVFSApplicationRegistry.xs A t/GnomeVFSApplicationRegistry.t * MANIFEST * vfs2perl.h: Implement GnomeVFSApplicationRegistry. 2003/10/22 22:43 (+0200) kaffeetisch A t/GnomeVFSFileInfo.t A xs/GnomeVFSFileInfo.xs * vfs2perl.h * MANIFEST: Implement gnome_vfs_file_info_matches, gnome_vfs_file_info_get_mime_type and SvGnomeVFSFileInfo. * xs/GnomeVFSOps.xs * xs/GnomeVFSFileInfo.xs: Move newSVGnomeVFSFileInfo to GnomeVFSFileInfo.xs. Turn GnomeVFSFileInfo into an object so you can call methods on it. Retain the hash nature of it, though. Yeah, it's not very OO-ish to be able to directly access the data of an object, but implementing and using accessors would be much more copious. * vfs2perl.typemap: Add typemaps for GnomeVFSFileInfo. 2003/10/22 01:36 (+0200) kaffeetisch * VFS.pm: Follow James Curbo's advice and use a non-local file in the SYNOPSIS to demonstrate that GNOME VFS can do those kind of things, too. 2003/10/20 17:15 (+0200) kaffeetisch * t/GnomeVFSOps.t: Implemented Gnome2::VFS::Monitor tests. They need FAM, so I don't know if it's a good idea to enable them by default. Time will tell. * xs/GnomeVFS.xs: Implement gnome_vfs_get_version_info. * t/GnomeVFSURI.t: Skip resolve_relative test on versions older than 2.3.1. * xs/GnomeVFSURI.xs: Remove version check in gnome_vfs_uri_resolve_relative as it was pointless. 2003/10/19 15:55 (+0200) kaffeetisch A ChangeLog A LICENSE A MANIFEST A META.yml A Makefile.PL A VFS.pm A genmaps.pl A maps A vfs2perl.h A vfs2perl.typemap A t/GnomeVFS.t A t/GnomeVFSDirectory.t A t/GnomeVFSOps.t A t/GnomeVFSURI.t A t/GnomeVFSXfer.t A xs/GnomeVFS.xs A xs/GnomeVFSDirectory.xs A xs/GnomeVFSInit.xs A xs/GnomeVFSOps.xs A xs/GnomeVFSURI.xs A xs/GnomeVFSXfer.xs: Initial import. Gnome2-VFS-1.082/doctypes0000644000175000017500000000114112222506645013473 0ustar lacklackGnomeVFSFileSize unsigned GnomeVFSFileOffset unsigned GnomeVFSMimeApplication Gnome2::VFS::Mime::Application GnomeVFSFileInfo Gnome2::VFS::FileInfo GnomeVFSApplication Gnome2::VFS::Application GnomeVFSMimeType Gnome2::VFS::Mime::Type GnomeVFSHandle Gnome2::VFS::Handle GnomeVFSMonitorHandle Gnome2::VFS::Monitor::Handle GnomeVFSDirectoryHandle Gnome2::VFS::Directory::Handle GnomeVFSAsyncHandle Gnome2::VFS::Async::Handle GnomeVFSDNSSDBrowseHandle Gnome2::VFS::DNSSD::Browse::Handle GnomeVFSDNSSDResolveHandle Gnome2::VFS::DNSSD::Resolve::Handle GnomeVFSResolveHandle Gnome2::VFS::Resolve::Handle Gnome2-VFS-1.082/perl-Gnome2-VFS.doap0000644000175000017500000000144312222506645015313 0ustar lacklack Gnome2::VFS Perl interface to the 2.x series of the GNOME VFS library Torsten Schönfeld tsch Gnome2-VFS-1.082/Makefile.PL0000644000175000017500000001377312222506645013706 0ustar lacklack#!/usr/bin/perl -w use 5.008; use strict; use ExtUtils::MakeMaker; use Cwd; use File::Spec; # $Id$ our %build_reqs = ( 'perl-ExtUtils-Depends' => '0.20', 'perl-ExtUtils-PkgConfig' => '1.03', 'perl-Glib' => '1.120', 'GnomeVFS' => '2.0.0', ); our %PREREQ_PM = ( "Glib" => $build_reqs{'perl-Glib'}, "ExtUtils::Depends" => $build_reqs{'perl-ExtUtils-Depends'}, "ExtUtils::PkgConfig" => $build_reqs{'perl-ExtUtils-PkgConfig'}, ); unless (eval "use ExtUtils::Depends '$build_reqs{'perl-ExtUtils-Depends'}';" . "use ExtUtils::PkgConfig '$build_reqs{'perl-ExtUtils-PkgConfig'}';" . "use Glib '$build_reqs{'perl-Glib'}';" . "use Glib::MakeHelper;" . "use Glib::CodeGen;" . "1") { warn "$@\n"; WriteMakefile( PREREQ_FATAL => 1, PREREQ_PM => \%PREREQ_PM, ); exit 1; # not reached } my %vfs_pkgcfg = ExtUtils::PkgConfig->find("gnome-vfs-2.0 >= $build_reqs{GnomeVFS}"); ############################################################################### mkdir 'build', 0777; my ($major, $minor, $micro) = split /\./, $vfs_pkgcfg{modversion}; my $needs_gtypes = ($major < 2 or $major == 2 && $minor < 5 or $major == 2 && $minor == 5 && $micro < 3); if ($needs_gtypes) { chomp(my $vfs_includes = `pkg-config --variable includedir gnome-vfs-2.0`); my @vfs_headers = glob($vfs_includes . "/gnome-vfs-2.0/libgnomevfs/*.h"); system(q(glib-mkenums --fhead "#ifndef __VFS2PERL_GTYPES_H__\n" ) . q(--fhead "#define __VFS2PERL_GTYPES_H__ 1\n\n" ) . q(--fhead "#include \n\n" ) . q(--fhead "G_BEGIN_DECLS\n\n" ) . q(--eprod "#ifndef GNOME_VFS_TYPE_@ENUMSHORT@\n" ) . q(--eprod "#define GNOME_VFS_TYPE_@ENUMSHORT@ vfs2perl_@enum_name@_get_type()\n" ) . q(--eprod "GType vfs2perl_@enum_name@_get_type (void);\n" ) . q(--eprod "#endif /* !GNOME_VFS_TYPE_@ENUMSHORT@ */\n" ) . q(--ftail "G_END_DECLS\n\n" ) . q(--ftail "#endif /* __VFS2PERL_GTYPES_H__ */\n" ) . "@vfs_headers > build/vfs2perl-gtypes.h"); system(q(glib-mkenums --fhead "#include \n" ) . q(--fhead "#include \n" ) . q(--fhead "#include \n" ) . q(--fhead "#include \n" ) . q(--fhead "#include \n" ) . q(--vhead "static const G@Type@Value _vfs2perl_@enum_name@_values[] = {" ) . q(--vprod " { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," ) . q(--vtail " { 0, NULL, NULL }\n};\n\n" ) . q(--vtail "GType\nvfs2perl_@enum_name@_get_type (void)\n{\n" ) . q(--vtail " static GType type = 0;\n\n" ) . q(--vtail " if (!type)\n" ) . q(--vtail " type = g_@type@_register_static (\"@EnumName@\", _vfs2perl_@enum_name@_values);\n\n" ) . q(--vtail " return type;\n}\n\n" ) . "@vfs_headers > build/vfs2perl-gtypes.c"); # UGLY, UGLY, UGLY! system("perl -pi -e 's/GNOME_VFS_TYPE_VFSURI_HIDE_OPTIONS/GNOME_VFS_TYPE_VFS_URI_HIDE_OPTIONS/g; s/vfs2perl_gnome_vfsuri_hide_options/vfs2perl_gnome_vfs_uri_hide_options/g' build/vfs2perl-gtypes.h build/vfs2perl-gtypes.c"); } else { open GTYPES, ">build/vfs2perl-gtypes.h" or die("Opening '>build/vfs2perl-gtypes.h': $!"); print GTYPES "#include \n"; close GTYPES; } ############################################################################### my @xs_files = (); foreach (Glib::MakeHelper->select_files_by_version ("xs_files", split /\./, $vfs_pkgcfg{modversion})) { push @xs_files, Glib::MakeHelper->read_source_list_file ($_); } my %pod_files = ( 'VFS.pm' => '$(INST_MAN3DIR)/Gnome2::VFS.$(MAN3EXT)', Glib::MakeHelper->do_pod_files (@xs_files), ); Glib::CodeGen->parse_maps ('vfs2perl', input => []); Glib::CodeGen->write_boot (xs_files => \@xs_files, ignore => qr/^Gnome2::VFS$/); ExtUtils::PkgConfig->write_version_macros ( "build/vfs2perl-version.h", "gnome-vfs-2.0" => "VFS", ); ############################################################################### my $vfs = ExtUtils::Depends->new ('Gnome2::VFS', 'Glib'); $vfs->set_inc ($vfs_pkgcfg{cflags} . " -I build"); $vfs->set_libs ($vfs_pkgcfg{libs}); $vfs->add_xs (@xs_files); $vfs->add_c ("vfs2perl.c"); $vfs->add_c ("build/vfs2perl-gtypes.c") if ($needs_gtypes); $vfs->add_pm ('VFS.pm' => '$(INST_LIBDIR)/VFS.pm'); $vfs->add_typemaps (map {File::Spec->catfile(cwd(), $_)} 'build/vfs2perl.typemap', 'vfs.typemap'); $vfs->install (qw(vfs2perl.h build/vfs2perl-autogen.h build/vfs2perl-version.h build/vfs2perl-gtypes.h doctypes)); $vfs->save_config ('build/IFiles.pm'); WriteMakefile( NAME => 'Gnome2::VFS', VERSION_FROM => 'VFS.pm', # finds $VERSION ABSTRACT_FROM => 'VFS.pm', # retrieve abstract from module PREREQ_PM => \%PREREQ_PM, XSPROTOARG => '-noprototypes', MAN3PODS => \%pod_files, $vfs->get_makefile_vars, ); ############################################################################### sub MY::postamble { return Glib::MakeHelper->postamble_clean () . Glib::MakeHelper->postamble_docs_full ( DEPENDS => $vfs, DOCTYPES => 'doctypes', COPYRIGHT_FROM => 'copyright.pod' ) . Glib::MakeHelper->postamble_rpms ( 'GNOME_VFS' => $build_reqs{'GnomeVFS'}, 'PERL_EXTUTILS_DEPENDS' => $build_reqs{'perl-ExtUtils-Depends'}, 'PERL_EXTUTILS_PKGCONFIG' => $build_reqs{'perl-ExtUtils-PkgConfig'}, 'PERL_GLIB' => $build_reqs{'perl-Glib'}, ); } Gnome2-VFS-1.082/LICENSE0000644000175000017500000006346512222506645012744 0ustar lacklack GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! Gnome2-VFS-1.082/maps-2.00000644000175000017500000000466212222506645013111 0ustar lacklackGNOME_VFS_MIME_MONITOR_TYPE GnomeVFSMIMEMonitor GObject Gnome2::VFS::Mime::Monitor GNOME_VFS_TYPE_VFS_DIRECTORY_VISIT_OPTIONS GnomeVFSDirectoryVisitOptions GFlags Gnome2::VFS::DirectoryVisitOptions GNOME_VFS_TYPE_VFS_FILE_FLAGS GnomeVFSFileFlags GFlags Gnome2::VFS::FileFlags GNOME_VFS_TYPE_VFS_FILE_INFO_FIELDS GnomeVFSFileInfoFields GFlags Gnome2::VFS::FileInfoFields GNOME_VFS_TYPE_VFS_FILE_INFO_OPTIONS GnomeVFSFileInfoOptions GFlags Gnome2::VFS::FileInfoOptions GNOME_VFS_TYPE_VFS_FILE_PERMISSIONS GnomeVFSFilePermissions GFlags Gnome2::VFS::FilePermissions GNOME_VFS_TYPE_VFS_MAKE_URI_DIRS GnomeVFSMakeURIDirs GFlags Gnome2::VFS::MakeURIDirs GNOME_VFS_TYPE_VFS_OPEN_MODE GnomeVFSOpenMode GFlags Gnome2::VFS::OpenMode GNOME_VFS_TYPE_VFS_SET_FILE_INFO_MASK GnomeVFSSetFileInfoMask GFlags Gnome2::VFS::SetFileInfoMask GNOME_VFS_TYPE_VFS_URI_HIDE_OPTIONS GnomeVFSURIHideOptions GFlags Gnome2::VFS::URI::HideOptions GNOME_VFS_TYPE_VFS_XFER_OPTIONS GnomeVFSXferOptions GFlags Gnome2::VFS::XferOptions GNOME_VFS_TYPE_VFS_FILE_TYPE GnomeVFSFileType GEnum Gnome2::VFS::FileType GNOME_VFS_TYPE_VFS_FIND_DIRECTORY_KIND GnomeVFSFindDirectoryKind GEnum Gnome2::VFS::FindDirectoryKind GNOME_VFS_TYPE_VFS_MIME_ACTION_TYPE GnomeVFSMimeActionType GEnum Gnome2::VFS::MimeActionType GNOME_VFS_TYPE_VFS_MIME_APPLICATION_ARGUMENT_TYPE GnomeVFSMimeApplicationArgumentType GEnum Gnome2::VFS::MimeApplicationArgumentType GNOME_VFS_TYPE_VFS_MONITOR_EVENT_TYPE GnomeVFSMonitorEventType GEnum Gnome2::VFS::MonitorEventType GNOME_VFS_TYPE_VFS_MONITOR_TYPE GnomeVFSMonitorType GEnum Gnome2::VFS::MonitorType GNOME_VFS_TYPE_VFS_RESULT GnomeVFSResult GEnum Gnome2::VFS::Result GNOME_VFS_TYPE_VFS_SEEK_POSITION GnomeVFSSeekPosition GEnum Gnome2::VFS::SeekPosition GNOME_VFS_TYPE_VFS_XFER_ERROR_ACTION GnomeVFSXferErrorAction GEnum Gnome2::VFS::XferErrorAction GNOME_VFS_TYPE_VFS_XFER_ERROR_MODE GnomeVFSXferErrorMode GEnum Gnome2::VFS::XferErrorMode GNOME_VFS_TYPE_VFS_XFER_OVERWRITE_ACTION GnomeVFSXferOverwriteAction GEnum Gnome2::VFS::XferOverwriteAction GNOME_VFS_TYPE_VFS_XFER_OVERWRITE_MODE GnomeVFSXferOverwriteMode GEnum Gnome2::VFS::XferOverwriteMode GNOME_VFS_TYPE_VFS_XFER_PHASE GnomeVFSXferPhase GEnum Gnome2::VFS::XferPhase GNOME_VFS_TYPE_VFS_XFER_PROGRESS_STATUS GnomeVFSXferProgressStatus GEnum Gnome2::VFS::XferProgressStatus GNOME_VFS_TYPE_VFS_URI GnomeVFSURI GBoxed Gnome2::VFS::URI Gnome2-VFS-1.082/MANIFEST.SKIP0000644000175000017500000000023012222506645013612 0ustar lacklack~$ \.bak$ blib \.bs$ build CVS \.cvsignore$ \.git \.gitignore$ Makefile$ Makefile\.old$ \.o$ \.spec$ \.sw.$ \.tar\.gz$ xs/.+\.c$ \.releaserc$ MYMETA\.*